fvwm-2.6.5.orig/0000755000175000017500000000000011777652121011633 5ustar vwcvwcfvwm-2.6.5.orig/libs/0000755000175000017500000000000011744241477012566 5ustar vwcvwcfvwm-2.6.5.orig/libs/XResource.h0000644000175000017500000000103010556633567014655 0ustar vwcvwc#ifndef LIB_XRESOURCE_H #define LIB_XRESOURCE_H /* * Wrappers around Xrm routines (XResources.c) */ void MergeXResources(Display *dpy, XrmDatabase *pdb, Bool override); void MergeCmdLineResources( XrmDatabase *pdb, XrmOptionDescList opts, int num_opts, char *name, int *pargc, char **argv, Bool fNoDefaults); Bool MergeConfigLineResource( XrmDatabase *pdb, char *line, char *prefix, char *bindstr); Bool GetResourceString( XrmDatabase db, const char *resource, const char *prefix, XrmValue *xval); #endif /* LIB_XRESOURCE_H */ fvwm-2.6.5.orig/libs/XError.c0000644000175000017500000001452210752147557014161 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This function should be used by all modules and fvwm when a X error * occurs and the module exits. */ #include "config.h" #include #include #include #include "FRenderInit.h" #include "XError.h" #undef XSetErrorHandler #define USE_GET_ERROR_TEXT 1 #ifndef USE_GET_ERROR_TEXT static char *error_name(unsigned char code); #endif static char *request_name(unsigned char code); static char unknown[32]; void do_coredump(void) { fprintf(stderr, " Leaving a core dump now\n"); { char *nullp; nullp = NULL; *nullp = 99; } /* exit if this fails */ exit(99); } #define USE_GET_ERROR_TEXT 1 void PrintXErrorAndCoredump(Display *dpy, XErrorEvent *error, char *MyName) { char msg[256]; Bool suc = False; msg[255] = 0; #ifdef USE_GET_ERROR_TEXT /* can't call this from within an error handler! */ /* DV (21-Nov-2000): Well, actually we *can* call it in an error * handler since it does not trigger a protocol request. */ if (error->error_code >= FirstExtensionError) { suc = FRenderGetErrorText(error->error_code, msg); } if (!suc) XGetErrorText(dpy, error->error_code, msg, sizeof(msg)); fprintf(stderr,"%s: Cause of next X Error.\n", MyName); fprintf(stderr, " Error: %d (%s)\n", error->error_code, msg); #else fprintf(stderr,"%s: Cause of next X Error.\n", MyName); if (error->error_code >= FirstExtensionError) { suc = FRenderGetErrorText(error->error_code, msg); } if (suc) fprintf(stderr, " Error: %d (%s)\n", error->error_code, msg); else fprintf(stderr, " Error: %d (%s)\n", error->error_code, error_name(error->error_code)); #endif fprintf(stderr, " Major opcode of failed request: %d (%s)\n", error->request_code, request_name(error->request_code)); fprintf(stderr, " Minor opcode of failed request: %d \n", error->minor_code); /* error->resourceid may be uninitialised. This is no proble since we * are dumping core anyway. */ fprintf(stderr, " Resource id of failed request: 0x%lx \n", error->resourceid); /* leave a coredump */ do_coredump(); } #ifndef USE_GET_ERROR_TEXT /* this comes out of X.h */ static char *error_names[] = { "BadRequest", "BadValue", "BadWindow", "BadPixmap", "BadAtom", "BadCursor", "BadFont", "BadMatch", "BadDrawable", "BadAccess", "BadAlloc", "BadColor", "BadGC", "BadIDChoice", "BadName", "BadLength", "BadImplementation", }; static char *error_name(unsigned char code) { if (code == 0 || code > (sizeof(error_names) / sizeof(char *))) { sprintf(unknown, "Unknown: %d", (int)code); return unknown; } return error_names[code - 1]; } #endif /* this comes out of Xproto.h */ static char *code_names[] = { "CreateWindow", "ChangeWindowAttributes", "GetWindowAttributes", "DestroyWindow", "DestroySubwindows", "ChangeSaveSet", "ReparentWindow", "MapWindow", "MapSubwindows", "UnmapWindow", "UnmapSubwindows", "ConfigureWindow", "CirculateWindow", "GetGeometry", "QueryTree", "InternAtom", "GetAtomName", "ChangeProperty", "DeleteProperty", "GetProperty", "ListProperties", "SetSelectionOwner", "GetSelectionOwner", "ConvertSelection", "SendEvent", "GrabPointer", "UngrabPointer", "GrabButton", "UngrabButton", "ChangeActivePointerGrab", "GrabKeyboard", "UngrabKeyboard", "GrabKey", "UngrabKey", "AllowEvents", "GrabServer", "UngrabServer", "QueryPointer", "GetMotionEvents", "TranslateCoords", "WarpPointer", "SetInputFocus", "GetInputFocus", "QueryKeymap", "OpenFont", "CloseFont", "QueryFont", "QueryTextExtents", "ListFonts", "ListFontsWithInfo", "SetFontPath", "GetFontPath", "CreatePixmap", "FreePixmap", "CreateGC", "ChangeGC", "CopyGC", "SetDashes", "SetClipRectangles", "FreeGC", "ClearArea", "CopyArea", "CopyPlane", "PolyPoint", "PolyLine", "PolySegment", "PolyRectangle", "PolyArc", "FillPoly", "PolyFillRectangle", "PolyFillArc", "PutImage", "GetImage", "PolyText", "PolyText1", "ImageText", "ImageText1", "CreateColormap", "FreeColormap", "CopyColormapAndFree", "InstallColormap", "UninstallColormap", "ListInstalledColormaps", "AllocColor", "AllocNamedColor", "AllocColorCells", "AllocColorPlanes", "FreeColors", "StoreColors", "StoreNamedColor", "QueryColors", "LookupColor", "CreateCursor", "CreateGlyphCursor", "FreeCursor", "RecolorCursor", "QueryBestSize", "QueryExtension", "ListExtensions", "ChangeKeyboardMapping", "GetKeyboardMapping", "ChangeKeyboardControl", "GetKeyboardControl", "Bell", "ChangePointerControl", "GetPointerControl", "SetScreenSaver", "GetScreenSaver", "ChangeHosts", "ListHosts", "SetAccessControl", "SetCloseDownMode", "KillClient", "RotateProperties", "ForceScreenSaver", "SetPointerMapping", "GetPointerMapping", "SetModifierMapping", "GetModifierMapping", }; static char *request_name(unsigned char code) { if (code == 0 || code > (sizeof(code_names) / sizeof(char *))) { if (code == FRenderGetMajorOpCode()) { sprintf(unknown, "XRender"); } else { sprintf(unknown, "Unknown: %d", (int)code); } return unknown; } return code_names[code - 1]; } /* -------------------------- error handler stack -------------------------- */ static ferror_handler_t old_handler = NULL; void ferror_set_temp_error_handler(ferror_handler_t new_handler) { if (old_handler != NULL) { do_coredump(); } old_handler = XSetErrorHandler(old_handler); return; } void ferror_reset_temp_error_handler(void) { if (old_handler == NULL) { do_coredump(); } XSetErrorHandler(old_handler); old_handler = NULL; return; } int ferror_call_next_error_handler(Display *dpy, XErrorEvent *error) { int rc; if (old_handler == NULL) { do_coredump(); } rc = old_handler(dpy, error); return rc; } fvwm-2.6.5.orig/libs/fvwmrect.h0000644000175000017500000000267010552155662014575 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2001 Dominik Vogt */ #ifndef FVWMRECT_H #define FVWMRECT_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef struct { int x; int y; int width; int height; } rectangle; typedef struct { int x; int y; } position; typedef struct { int width; int height; } size_rect; typedef struct { size_rect top_left; size_rect bottom_right; size_rect total_size; } size_borders; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ /* Returns 1 if the given rectangles intersect and 0 otherwise */ int fvwmrect_do_rectangles_intersect(rectangle *r, rectangle *s); /* Subtracts the values in s2_ from the ones in s1_g and stores the result in * diff_g. */ void fvwmrect_subtract_rectangles( rectangle *rdiff, rectangle *r1, rectangle *r2); /* Returns 1 is the rectangles are identical and 0 if not */ int fvwmrect_rectangles_equal( rectangle *r1, rectangle *r2); int fvwmrect_move_into_rectangle( rectangle *move_rec, rectangle *target_rec); int fvwmrect_intersect_xrectangles( XRectangle *r1, XRectangle *r2); #endif /* FVWMRECT_H */ fvwm-2.6.5.orig/libs/CombineChars.c0000644000175000017500000014674210556634174015305 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2003 Marcus Lundblad */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include #include "fvwmlib.h" #include "CombineChars.h" /* ---------------------------- local types -------------------------------- */ typedef struct char_combclass { unsigned short key; int combclass; } char_combclass_t; typedef struct char_comb { unsigned short key; unsigned short first; unsigned short second; } char_comb_t; /* ---------------------------- static variables --------------------------- */ /* would like to use the Unicode replacement character here, but that would result in expanding incoming UTF-8 strings when garbage characters occurs */ /* so for the time being use '?' */ static unsigned short REPLACEMENT_CHARACTER = 0x3f; /* maps characters to combination classes (not in list => 0) */ /* parsed from UnicodeData-3.2.0.txt */ static const char_combclass_t combclass_table[] = { { 0x0300, 230}, { 0x0301, 230}, { 0x0302, 230}, { 0x0303, 230}, { 0x0304, 230}, { 0x0305, 230}, { 0x0306, 230}, { 0x0307, 230}, { 0x0308, 230}, { 0x0309, 230}, { 0x030A, 230}, { 0x030B, 230}, { 0x030C, 230}, { 0x030D, 230}, { 0x030E, 230}, { 0x030F, 230}, { 0x0310, 230}, { 0x0311, 230}, { 0x0312, 230}, { 0x0313, 230}, { 0x0314, 230}, { 0x0315, 232}, { 0x0316, 220}, { 0x0317, 220}, { 0x0318, 220}, { 0x0319, 220}, { 0x031A, 232}, { 0x031B, 216}, { 0x031C, 220}, { 0x031D, 220}, { 0x031E, 220}, { 0x031F, 220}, { 0x0320, 220}, { 0x0321, 202}, { 0x0322, 202}, { 0x0323, 220}, { 0x0324, 220}, { 0x0325, 220}, { 0x0326, 220}, { 0x0327, 202}, { 0x0328, 202}, { 0x0329, 220}, { 0x032A, 220}, { 0x032B, 220}, { 0x032C, 220}, { 0x032D, 220}, { 0x032E, 220}, { 0x032F, 220}, { 0x0330, 220}, { 0x0331, 220}, { 0x0332, 220}, { 0x0333, 220}, { 0x0334, 1}, { 0x0335, 1}, { 0x0336, 1}, { 0x0337, 1}, { 0x0338, 1}, { 0x0339, 220}, { 0x033A, 220}, { 0x033B, 220}, { 0x033C, 220}, { 0x033D, 230}, { 0x033E, 230}, { 0x033F, 230}, { 0x0340, 230}, { 0x0341, 230}, { 0x0342, 230}, { 0x0343, 230}, { 0x0344, 230}, { 0x0345, 240}, { 0x0346, 230}, { 0x0347, 220}, { 0x0348, 220}, { 0x0349, 220}, { 0x034A, 230}, { 0x034B, 230}, { 0x034C, 230}, { 0x034D, 220}, { 0x034E, 220}, { 0x034F, -1 }, { 0x0360, 234}, { 0x0361, 234}, { 0x0362, 233}, { 0x0363, 230}, { 0x0364, 230}, { 0x0365, 230}, { 0x0366, 230}, { 0x0367, 230}, { 0x0368, 230}, { 0x0369, 230}, { 0x036A, 230}, { 0x036B, 230}, { 0x036C, 230}, { 0x036D, 230}, { 0x036E, 230}, { 0x036F, 230}, { 0x0483, 230}, { 0x0484, 230}, { 0x0485, 230}, { 0x0486, 230}, { 0x0488, -3 }, { 0x0489, -3 }, { 0x0591, 220}, { 0x0592, 230}, { 0x0593, 230}, { 0x0594, 230}, { 0x0595, 230}, { 0x0596, 220}, { 0x0597, 230}, { 0x0598, 230}, { 0x0599, 230}, { 0x059A, 222}, { 0x059B, 220}, { 0x059C, 230}, { 0x059D, 230}, { 0x059E, 230}, { 0x059F, 230}, { 0x05A0, 230}, { 0x05A1, 230}, { 0x05A3, 220}, { 0x05A4, 220}, { 0x05A5, 220}, { 0x05A6, 220}, { 0x05A7, 220}, { 0x05A8, 230}, { 0x05A9, 230}, { 0x05AA, 220}, { 0x05AB, 230}, { 0x05AC, 230}, { 0x05AD, 222}, { 0x05AE, 228}, { 0x05AF, 230}, { 0x05B0, 10}, { 0x05B1, 11}, { 0x05B2, 12}, { 0x05B3, 13}, { 0x05B4, 14}, { 0x05B5, 15}, { 0x05B6, 16}, { 0x05B7, 17}, { 0x05B8, 18}, { 0x05B9, 19}, { 0x05BB, 20}, { 0x05BC, 21}, { 0x05BD, 22}, { 0x05BF, 23}, { 0x05C1, 24}, { 0x05C2, 25}, { 0x05C4, 230}, { 0x064B, 27}, { 0x064C, 28}, { 0x064D, 29}, { 0x064E, 30}, { 0x064F, 31}, { 0x0650, 32}, { 0x0651, 33}, { 0x0652, 34}, { 0x0653, 230}, { 0x0654, 230}, { 0x0655, 220}, { 0x0670, 35}, { 0x06D6, 230}, { 0x06D7, 230}, { 0x06D8, 230}, { 0x06D9, 230}, { 0x06DA, 230}, { 0x06DB, 230}, { 0x06DC, 230}, { 0x06DE, -3 }, { 0x06DF, 230}, { 0x06E0, 230}, { 0x06E1, 230}, { 0x06E2, 230}, { 0x06E3, 220}, { 0x06E4, 230}, { 0x06E7, 230}, { 0x06E8, 230}, { 0x06EA, 220}, { 0x06EB, 230}, { 0x06EC, 230}, { 0x06ED, 220}, { 0x0711, 36}, { 0x0730, 230}, { 0x0731, 220}, { 0x0732, 230}, { 0x0733, 230}, { 0x0734, 220}, { 0x0735, 230}, { 0x0736, 230}, { 0x0737, 220}, { 0x0738, 220}, { 0x0739, 220}, { 0x073A, 230}, { 0x073B, 220}, { 0x073C, 220}, { 0x073D, 230}, { 0x073E, 220}, { 0x073F, 230}, { 0x0740, 230}, { 0x0741, 230}, { 0x0742, 220}, { 0x0743, 230}, { 0x0744, 220}, { 0x0745, 230}, { 0x0746, 220}, { 0x0747, 230}, { 0x0748, 220}, { 0x0749, 230}, { 0x074A, 230}, { 0x07A6, -1 }, { 0x07A7, -1 }, { 0x07A8, -1 }, { 0x07A9, -1 }, { 0x07AA, -1 }, { 0x07AB, -1 }, { 0x07AC, -1 }, { 0x07AD, -1 }, { 0x07AE, -1 }, { 0x07AF, -1 }, { 0x07B0, -1 }, { 0x0901, -1 }, { 0x0902, -1 }, { 0x0903, -2 }, { 0x093C, 7}, { 0x093E, -2 }, { 0x093F, -2 }, { 0x0940, -2 }, { 0x0941, -1 }, { 0x0942, -1 }, { 0x0943, -1 }, { 0x0944, -1 }, { 0x0945, -1 }, { 0x0946, -1 }, { 0x0947, -1 }, { 0x0948, -1 }, { 0x0949, -2 }, { 0x094A, -2 }, { 0x094B, -2 }, { 0x094C, -2 }, { 0x094D, 9}, { 0x0951, 230}, { 0x0952, 220}, { 0x0953, 230}, { 0x0954, 230}, { 0x0962, -1 }, { 0x0963, -1 }, { 0x0981, -1 }, { 0x0982, -2 }, { 0x0983, -2 }, { 0x09BC, 7}, { 0x09BE, -2 }, { 0x09BF, -2 }, { 0x09C0, -2 }, { 0x09C1, -1 }, { 0x09C2, -1 }, { 0x09C3, -1 }, { 0x09C4, -1 }, { 0x09C7, -2 }, { 0x09C8, -2 }, { 0x09CB, -2 }, { 0x09CC, -2 }, { 0x09CD, 9}, { 0x09D7, -2 }, { 0x09E2, -1 }, { 0x09E3, -1 }, { 0x0A02, -1 }, { 0x0A3C, 7}, { 0x0A3E, -2 }, { 0x0A3F, -2 }, { 0x0A40, -2 }, { 0x0A41, -1 }, { 0x0A42, -1 }, { 0x0A47, -1 }, { 0x0A48, -1 }, { 0x0A4B, -1 }, { 0x0A4C, -1 }, { 0x0A4D, 9}, { 0x0A70, -1 }, { 0x0A71, -1 }, { 0x0A81, -1 }, { 0x0A82, -1 }, { 0x0A83, -2 }, { 0x0ABC, 7}, { 0x0ABE, -2 }, { 0x0ABF, -2 }, { 0x0AC0, -2 }, { 0x0AC1, -1 }, { 0x0AC2, -1 }, { 0x0AC3, -1 }, { 0x0AC4, -1 }, { 0x0AC5, -1 }, { 0x0AC7, -1 }, { 0x0AC8, -1 }, { 0x0AC9, -2 }, { 0x0ACB, -2 }, { 0x0ACC, -2 }, { 0x0ACD, 9}, { 0x0B01, -1 }, { 0x0B02, -2 }, { 0x0B03, -2 }, { 0x0B3C, 7}, { 0x0B3E, -2 }, { 0x0B3F, -1 }, { 0x0B40, -2 }, { 0x0B41, -1 }, { 0x0B42, -1 }, { 0x0B43, -1 }, { 0x0B47, -2 }, { 0x0B48, -2 }, { 0x0B4B, -2 }, { 0x0B4C, -2 }, { 0x0B4D, 9}, { 0x0B56, -1 }, { 0x0B57, -2 }, { 0x0B82, -1 }, { 0x0BBE, -2 }, { 0x0BBF, -2 }, { 0x0BC0, -1 }, { 0x0BC1, -2 }, { 0x0BC2, -2 }, { 0x0BC6, -2 }, { 0x0BC7, -2 }, { 0x0BC8, -2 }, { 0x0BCA, -2 }, { 0x0BCB, -2 }, { 0x0BCC, -2 }, { 0x0BCD, 9}, { 0x0BD7, -2 }, { 0x0C01, -2 }, { 0x0C02, -2 }, { 0x0C03, -2 }, { 0x0C3E, -1 }, { 0x0C3F, -1 }, { 0x0C40, -1 }, { 0x0C41, -2 }, { 0x0C42, -2 }, { 0x0C43, -2 }, { 0x0C44, -2 }, { 0x0C46, -1 }, { 0x0C47, -1 }, { 0x0C48, -1 }, { 0x0C4A, -1 }, { 0x0C4B, -1 }, { 0x0C4C, -1 }, { 0x0C4D, 9}, { 0x0C55, 84}, { 0x0C56, 91}, { 0x0C82, -2 }, { 0x0C83, -2 }, { 0x0CBE, -2 }, { 0x0CBF, -1 }, { 0x0CC0, -2 }, { 0x0CC1, -2 }, { 0x0CC2, -2 }, { 0x0CC3, -2 }, { 0x0CC4, -2 }, { 0x0CC6, -1 }, { 0x0CC7, -2 }, { 0x0CC8, -2 }, { 0x0CCA, -2 }, { 0x0CCB, -2 }, { 0x0CCC, -1 }, { 0x0CCD, 9}, { 0x0CD5, -2 }, { 0x0CD6, -2 }, { 0x0D02, -2 }, { 0x0D03, -2 }, { 0x0D3E, -2 }, { 0x0D3F, -2 }, { 0x0D40, -2 }, { 0x0D41, -1 }, { 0x0D42, -1 }, { 0x0D43, -1 }, { 0x0D46, -2 }, { 0x0D47, -2 }, { 0x0D48, -2 }, { 0x0D4A, -2 }, { 0x0D4B, -2 }, { 0x0D4C, -2 }, { 0x0D4D, 9}, { 0x0D57, -2 }, { 0x0D82, -2 }, { 0x0D83, -2 }, { 0x0DCA, 9}, { 0x0DCF, -2 }, { 0x0DD0, -2 }, { 0x0DD1, -2 }, { 0x0DD2, -1 }, { 0x0DD3, -1 }, { 0x0DD4, -1 }, { 0x0DD6, -1 }, { 0x0DD8, -2 }, { 0x0DD9, -2 }, { 0x0DDA, -2 }, { 0x0DDB, -2 }, { 0x0DDC, -2 }, { 0x0DDD, -2 }, { 0x0DDE, -2 }, { 0x0DDF, -2 }, { 0x0DF2, -2 }, { 0x0DF3, -2 }, { 0x0E31, -1 }, { 0x0E34, -1 }, { 0x0E35, -1 }, { 0x0E36, -1 }, { 0x0E37, -1 }, { 0x0E38, 103}, { 0x0E39, 103}, { 0x0E3A, 9}, { 0x0E47, -1 }, { 0x0E48, 107}, { 0x0E49, 107}, { 0x0E4A, 107}, { 0x0E4B, 107}, { 0x0E4C, -1 }, { 0x0E4D, -1 }, { 0x0E4E, -1 }, { 0x0EB1, -1 }, { 0x0EB4, -1 }, { 0x0EB5, -1 }, { 0x0EB6, -1 }, { 0x0EB7, -1 }, { 0x0EB8, 118}, { 0x0EB9, 118}, { 0x0EBB, -1 }, { 0x0EBC, -1 }, { 0x0EC8, 122}, { 0x0EC9, 122}, { 0x0ECA, 122}, { 0x0ECB, 122}, { 0x0ECC, -1 }, { 0x0ECD, -1 }, { 0x0F18, 220}, { 0x0F19, 220}, { 0x0F35, 220}, { 0x0F37, 220}, { 0x0F39, 216}, { 0x0F3E, -2 }, { 0x0F3F, -2 }, { 0x0F71, 129}, { 0x0F72, 130}, { 0x0F73, -1 }, { 0x0F74, 132}, { 0x0F75, -1 }, { 0x0F76, -1 }, { 0x0F77, -1 }, { 0x0F78, -1 }, { 0x0F79, -1 }, { 0x0F7A, 130}, { 0x0F7B, 130}, { 0x0F7C, 130}, { 0x0F7D, 130}, { 0x0F7E, -1 }, { 0x0F7F, -2 }, { 0x0F80, 130}, { 0x0F81, -1 }, { 0x0F82, 230}, { 0x0F83, 230}, { 0x0F84, 9}, { 0x0F86, 230}, { 0x0F87, 230}, { 0x0F90, -1 }, { 0x0F91, -1 }, { 0x0F92, -1 }, { 0x0F93, -1 }, { 0x0F94, -1 }, { 0x0F95, -1 }, { 0x0F96, -1 }, { 0x0F97, -1 }, { 0x0F99, -1 }, { 0x0F9A, -1 }, { 0x0F9B, -1 }, { 0x0F9C, -1 }, { 0x0F9D, -1 }, { 0x0F9E, -1 }, { 0x0F9F, -1 }, { 0x0FA0, -1 }, { 0x0FA1, -1 }, { 0x0FA2, -1 }, { 0x0FA3, -1 }, { 0x0FA4, -1 }, { 0x0FA5, -1 }, { 0x0FA6, -1 }, { 0x0FA7, -1 }, { 0x0FA8, -1 }, { 0x0FA9, -1 }, { 0x0FAA, -1 }, { 0x0FAB, -1 }, { 0x0FAC, -1 }, { 0x0FAD, -1 }, { 0x0FAE, -1 }, { 0x0FAF, -1 }, { 0x0FB0, -1 }, { 0x0FB1, -1 }, { 0x0FB2, -1 }, { 0x0FB3, -1 }, { 0x0FB4, -1 }, { 0x0FB5, -1 }, { 0x0FB6, -1 }, { 0x0FB7, -1 }, { 0x0FB8, -1 }, { 0x0FB9, -1 }, { 0x0FBA, -1 }, { 0x0FBB, -1 }, { 0x0FBC, -1 }, { 0x0FC6, 220}, { 0x102C, -2 }, { 0x102D, -1 }, { 0x102E, -1 }, { 0x102F, -1 }, { 0x1030, -1 }, { 0x1031, -2 }, { 0x1032, -1 }, { 0x1036, -1 }, { 0x1037, 7}, { 0x1038, -2 }, { 0x1039, 9}, { 0x1056, -2 }, { 0x1057, -2 }, { 0x1058, -1 }, { 0x1059, -1 }, { 0x1712, -1 }, { 0x1713, -1 }, { 0x1714, 9}, { 0x1732, -1 }, { 0x1733, -1 }, { 0x1734, 9}, { 0x1752, -1 }, { 0x1753, -1 }, { 0x1772, -1 }, { 0x1773, -1 }, { 0x17B4, -2 }, { 0x17B5, -2 }, { 0x17B6, -2 }, { 0x17B7, -1 }, { 0x17B8, -1 }, { 0x17B9, -1 }, { 0x17BA, -1 }, { 0x17BB, -1 }, { 0x17BC, -1 }, { 0x17BD, -1 }, { 0x17BE, -2 }, { 0x17BF, -2 }, { 0x17C0, -2 }, { 0x17C1, -2 }, { 0x17C2, -2 }, { 0x17C3, -2 }, { 0x17C4, -2 }, { 0x17C5, -2 }, { 0x17C6, -1 }, { 0x17C7, -2 }, { 0x17C8, -2 }, { 0x17C9, -1 }, { 0x17CA, -1 }, { 0x17CB, -1 }, { 0x17CC, -1 }, { 0x17CD, -1 }, { 0x17CE, -1 }, { 0x17CF, -1 }, { 0x17D0, -1 }, { 0x17D1, -1 }, { 0x17D2, 9}, { 0x17D3, -1 }, { 0x180B, -1 }, { 0x180C, -1 }, { 0x180D, -1 }, { 0x18A9, 228}, { 0x20D0, 230}, { 0x20D1, 230}, { 0x20D2, 1}, { 0x20D3, 1}, { 0x20D4, 230}, { 0x20D5, 230}, { 0x20D6, 230}, { 0x20D7, 230}, { 0x20D8, 1}, { 0x20D9, 1}, { 0x20DA, 1}, { 0x20DB, 230}, { 0x20DC, 230}, { 0x20DD, -3 }, { 0x20DE, -3 }, { 0x20DF, -3 }, { 0x20E0, -3 }, { 0x20E1, 230}, { 0x20E2, -3 }, { 0x20E3, -3 }, { 0x20E4, -3 }, { 0x20E5, 1}, { 0x20E6, 1}, { 0x20E7, 230}, { 0x20E8, 220}, { 0x20E9, 230}, { 0x20EA, 1}, { 0x302A, 218}, { 0x302B, 228}, { 0x302C, 232}, { 0x302D, 222}, { 0x302E, 224}, { 0x302F, 224}, { 0x3099, 8}, { 0x309A, 8}, { 0xFB1E, 26}, { 0xFE00, -1 }, { 0xFE01, -1 }, { 0xFE02, -1 }, { 0xFE03, -1 }, { 0xFE04, -1 }, { 0xFE05, -1 }, { 0xFE06, -1 }, { 0xFE07, -1 }, { 0xFE08, -1 }, { 0xFE09, -1 }, { 0xFE0A, -1 }, { 0xFE0B, -1 }, { 0xFE0C, -1 }, { 0xFE0D, -1 }, { 0xFE0E, -1 }, { 0xFE0F, -1 }, { 0xFE20, 230}, { 0xFE21, 230}, { 0xFE22, 230}, { 0xFE23, 230}, /*{ 0x1D165, 216}, { 0x1D166, 216}, { 0x1D167, 1}, { 0x1D168, 1}, { 0x1D169, 1}, { 0x1D16D, 226}, { 0x1D16E, 216}, { 0x1D16F, 216}, { 0x1D170, 216}, { 0x1D171, 216}, { 0x1D172, 216}, { 0x1D17B, 220}, { 0x1D17C, 220}, { 0x1D17D, 220}, { 0x1D17E, 220}, { 0x1D17F, 220}, { 0x1D180, 220}, { 0x1D181, 220}, { 0x1D182, 220}, { 0x1D185, 230}, { 0x1D186, 230}, { 0x1D187, 230}, { 0x1D188, 230}, { 0x1D189, 230}, { 0x1D18A, 220}, { 0x1D18B, 220}, { 0x1D1AA, 230}, { 0x1D1AB, 230}, { 0x1D1AC, 230}, { 0x1D1AD, 230},*/ }; /* maps characters to decompositions */ /* parsed from UnicodeData-3.2.0.txt */ static const char_comb_t comb_table[] = { { 0x00C0, 0x0041, 0x0300 }, { 0x00C1, 0x0041, 0x0301 }, { 0x00C2, 0x0041, 0x0302 }, { 0x00C3, 0x0041, 0x0303 }, { 0x00C4, 0x0041, 0x0308 }, { 0x00C5, 0x0041, 0x030A }, { 0x00C7, 0x0043, 0x0327 }, { 0x00C8, 0x0045, 0x0300 }, { 0x00C9, 0x0045, 0x0301 }, { 0x00CA, 0x0045, 0x0302 }, { 0x00CB, 0x0045, 0x0308 }, { 0x00CC, 0x0049, 0x0300 }, { 0x00CD, 0x0049, 0x0301 }, { 0x00CE, 0x0049, 0x0302 }, { 0x00CF, 0x0049, 0x0308 }, { 0x00D1, 0x004E, 0x0303 }, { 0x00D2, 0x004F, 0x0300 }, { 0x00D3, 0x004F, 0x0301 }, { 0x00D4, 0x004F, 0x0302 }, { 0x00D5, 0x004F, 0x0303 }, { 0x00D6, 0x004F, 0x0308 }, { 0x00D9, 0x0055, 0x0300 }, { 0x00DA, 0x0055, 0x0301 }, { 0x00DB, 0x0055, 0x0302 }, { 0x00DC, 0x0055, 0x0308 }, { 0x00DD, 0x0059, 0x0301 }, { 0x00E0, 0x0061, 0x0300 }, { 0x00E1, 0x0061, 0x0301 }, { 0x00E2, 0x0061, 0x0302 }, { 0x00E3, 0x0061, 0x0303 }, { 0x00E4, 0x0061, 0x0308 }, { 0x00E5, 0x0061, 0x030A }, { 0x00E7, 0x0063, 0x0327 }, { 0x00E8, 0x0065, 0x0300 }, { 0x00E9, 0x0065, 0x0301 }, { 0x00EA, 0x0065, 0x0302 }, { 0x00EB, 0x0065, 0x0308 }, { 0x00EC, 0x0069, 0x0300 }, { 0x00ED, 0x0069, 0x0301 }, { 0x00EE, 0x0069, 0x0302 }, { 0x00EF, 0x0069, 0x0308 }, { 0x00F1, 0x006E, 0x0303 }, { 0x00F2, 0x006F, 0x0300 }, { 0x00F3, 0x006F, 0x0301 }, { 0x00F4, 0x006F, 0x0302 }, { 0x00F5, 0x006F, 0x0303 }, { 0x00F6, 0x006F, 0x0308 }, { 0x00F9, 0x0075, 0x0300 }, { 0x00FA, 0x0075, 0x0301 }, { 0x00FB, 0x0075, 0x0302 }, { 0x00FC, 0x0075, 0x0308 }, { 0x00FD, 0x0079, 0x0301 }, { 0x00FF, 0x0079, 0x0308 }, { 0x0100, 0x0041, 0x0304 }, { 0x0101, 0x0061, 0x0304 }, { 0x0102, 0x0041, 0x0306 }, { 0x0103, 0x0061, 0x0306 }, { 0x0104, 0x0041, 0x0328 }, { 0x0105, 0x0061, 0x0328 }, { 0x0106, 0x0043, 0x0301 }, { 0x0107, 0x0063, 0x0301 }, { 0x0108, 0x0043, 0x0302 }, { 0x0109, 0x0063, 0x0302 }, { 0x010A, 0x0043, 0x0307 }, { 0x010B, 0x0063, 0x0307 }, { 0x010C, 0x0043, 0x030C }, { 0x010D, 0x0063, 0x030C }, { 0x010E, 0x0044, 0x030C }, { 0x010F, 0x0064, 0x030C }, { 0x0112, 0x0045, 0x0304 }, { 0x0113, 0x0065, 0x0304 }, { 0x0114, 0x0045, 0x0306 }, { 0x0115, 0x0065, 0x0306 }, { 0x0116, 0x0045, 0x0307 }, { 0x0117, 0x0065, 0x0307 }, { 0x0118, 0x0045, 0x0328 }, { 0x0119, 0x0065, 0x0328 }, { 0x011A, 0x0045, 0x030C }, { 0x011B, 0x0065, 0x030C }, { 0x011C, 0x0047, 0x0302 }, { 0x011D, 0x0067, 0x0302 }, { 0x011E, 0x0047, 0x0306 }, { 0x011F, 0x0067, 0x0306 }, { 0x0120, 0x0047, 0x0307 }, { 0x0121, 0x0067, 0x0307 }, { 0x0122, 0x0047, 0x0327 }, { 0x0123, 0x0067, 0x0327 }, { 0x0124, 0x0048, 0x0302 }, { 0x0125, 0x0068, 0x0302 }, { 0x0128, 0x0049, 0x0303 }, { 0x0129, 0x0069, 0x0303 }, { 0x012A, 0x0049, 0x0304 }, { 0x012B, 0x0069, 0x0304 }, { 0x012C, 0x0049, 0x0306 }, { 0x012D, 0x0069, 0x0306 }, { 0x012E, 0x0049, 0x0328 }, { 0x012F, 0x0069, 0x0328 }, { 0x0130, 0x0049, 0x0307 }, { 0x0134, 0x004A, 0x0302 }, { 0x0135, 0x006A, 0x0302 }, { 0x0136, 0x004B, 0x0327 }, { 0x0137, 0x006B, 0x0327 }, { 0x0139, 0x004C, 0x0301 }, { 0x013A, 0x006C, 0x0301 }, { 0x013B, 0x004C, 0x0327 }, { 0x013C, 0x006C, 0x0327 }, { 0x013D, 0x004C, 0x030C }, { 0x013E, 0x006C, 0x030C }, { 0x0143, 0x004E, 0x0301 }, { 0x0144, 0x006E, 0x0301 }, { 0x0145, 0x004E, 0x0327 }, { 0x0146, 0x006E, 0x0327 }, { 0x0147, 0x004E, 0x030C }, { 0x0148, 0x006E, 0x030C }, { 0x014C, 0x004F, 0x0304 }, { 0x014D, 0x006F, 0x0304 }, { 0x014E, 0x004F, 0x0306 }, { 0x014F, 0x006F, 0x0306 }, { 0x0150, 0x004F, 0x030B }, { 0x0151, 0x006F, 0x030B }, { 0x0154, 0x0052, 0x0301 }, { 0x0155, 0x0072, 0x0301 }, { 0x0156, 0x0052, 0x0327 }, { 0x0157, 0x0072, 0x0327 }, { 0x0158, 0x0052, 0x030C }, { 0x0159, 0x0072, 0x030C }, { 0x015A, 0x0053, 0x0301 }, { 0x015B, 0x0073, 0x0301 }, { 0x015C, 0x0053, 0x0302 }, { 0x015D, 0x0073, 0x0302 }, { 0x015E, 0x0053, 0x0327 }, { 0x015F, 0x0073, 0x0327 }, { 0x0160, 0x0053, 0x030C }, { 0x0161, 0x0073, 0x030C }, { 0x0162, 0x0054, 0x0327 }, { 0x0163, 0x0074, 0x0327 }, { 0x0164, 0x0054, 0x030C }, { 0x0165, 0x0074, 0x030C }, { 0x0168, 0x0055, 0x0303 }, { 0x0169, 0x0075, 0x0303 }, { 0x016A, 0x0055, 0x0304 }, { 0x016B, 0x0075, 0x0304 }, { 0x016C, 0x0055, 0x0306 }, { 0x016D, 0x0075, 0x0306 }, { 0x016E, 0x0055, 0x030A }, { 0x016F, 0x0075, 0x030A }, { 0x0170, 0x0055, 0x030B }, { 0x0171, 0x0075, 0x030B }, { 0x0172, 0x0055, 0x0328 }, { 0x0173, 0x0075, 0x0328 }, { 0x0174, 0x0057, 0x0302 }, { 0x0175, 0x0077, 0x0302 }, { 0x0176, 0x0059, 0x0302 }, { 0x0177, 0x0079, 0x0302 }, { 0x0178, 0x0059, 0x0308 }, { 0x0179, 0x005A, 0x0301 }, { 0x017A, 0x007A, 0x0301 }, { 0x017B, 0x005A, 0x0307 }, { 0x017C, 0x007A, 0x0307 }, { 0x017D, 0x005A, 0x030C }, { 0x017E, 0x007A, 0x030C }, { 0x01A0, 0x004F, 0x031B }, { 0x01A1, 0x006F, 0x031B }, { 0x01AF, 0x0055, 0x031B }, { 0x01B0, 0x0075, 0x031B }, { 0x01CD, 0x0041, 0x030C }, { 0x01CE, 0x0061, 0x030C }, { 0x01CF, 0x0049, 0x030C }, { 0x01D0, 0x0069, 0x030C }, { 0x01D1, 0x004F, 0x030C }, { 0x01D2, 0x006F, 0x030C }, { 0x01D3, 0x0055, 0x030C }, { 0x01D4, 0x0075, 0x030C }, { 0x01D5, 0x00DC, 0x0304 }, { 0x01D6, 0x00FC, 0x0304 }, { 0x01D7, 0x00DC, 0x0301 }, { 0x01D8, 0x00FC, 0x0301 }, { 0x01D9, 0x00DC, 0x030C }, { 0x01DA, 0x00FC, 0x030C }, { 0x01DB, 0x00DC, 0x0300 }, { 0x01DC, 0x00FC, 0x0300 }, { 0x01DE, 0x00C4, 0x0304 }, { 0x01DF, 0x00E4, 0x0304 }, { 0x01E0, 0x0226, 0x0304 }, { 0x01E1, 0x0227, 0x0304 }, { 0x01E2, 0x00C6, 0x0304 }, { 0x01E3, 0x00E6, 0x0304 }, { 0x01E6, 0x0047, 0x030C }, { 0x01E7, 0x0067, 0x030C }, { 0x01E8, 0x004B, 0x030C }, { 0x01E9, 0x006B, 0x030C }, { 0x01EA, 0x004F, 0x0328 }, { 0x01EB, 0x006F, 0x0328 }, { 0x01EC, 0x01EA, 0x0304 }, { 0x01ED, 0x01EB, 0x0304 }, { 0x01EE, 0x01B7, 0x030C }, { 0x01EF, 0x0292, 0x030C }, { 0x01F0, 0x006A, 0x030C }, { 0x01F4, 0x0047, 0x0301 }, { 0x01F5, 0x0067, 0x0301 }, { 0x01F8, 0x004E, 0x0300 }, { 0x01F9, 0x006E, 0x0300 }, { 0x01FA, 0x00C5, 0x0301 }, { 0x01FB, 0x00E5, 0x0301 }, { 0x01FC, 0x00C6, 0x0301 }, { 0x01FD, 0x00E6, 0x0301 }, { 0x01FE, 0x00D8, 0x0301 }, { 0x01FF, 0x00F8, 0x0301 }, { 0x0200, 0x0041, 0x030F }, { 0x0201, 0x0061, 0x030F }, { 0x0202, 0x0041, 0x0311 }, { 0x0203, 0x0061, 0x0311 }, { 0x0204, 0x0045, 0x030F }, { 0x0205, 0x0065, 0x030F }, { 0x0206, 0x0045, 0x0311 }, { 0x0207, 0x0065, 0x0311 }, { 0x0208, 0x0049, 0x030F }, { 0x0209, 0x0069, 0x030F }, { 0x020A, 0x0049, 0x0311 }, { 0x020B, 0x0069, 0x0311 }, { 0x020C, 0x004F, 0x030F }, { 0x020D, 0x006F, 0x030F }, { 0x020E, 0x004F, 0x0311 }, { 0x020F, 0x006F, 0x0311 }, { 0x0210, 0x0052, 0x030F }, { 0x0211, 0x0072, 0x030F }, { 0x0212, 0x0052, 0x0311 }, { 0x0213, 0x0072, 0x0311 }, { 0x0214, 0x0055, 0x030F }, { 0x0215, 0x0075, 0x030F }, { 0x0216, 0x0055, 0x0311 }, { 0x0217, 0x0075, 0x0311 }, { 0x0218, 0x0053, 0x0326 }, { 0x0219, 0x0073, 0x0326 }, { 0x021A, 0x0054, 0x0326 }, { 0x021B, 0x0074, 0x0326 }, { 0x021E, 0x0048, 0x030C }, { 0x021F, 0x0068, 0x030C }, { 0x0226, 0x0041, 0x0307 }, { 0x0227, 0x0061, 0x0307 }, { 0x0228, 0x0045, 0x0327 }, { 0x0229, 0x0065, 0x0327 }, { 0x022A, 0x00D6, 0x0304 }, { 0x022B, 0x00F6, 0x0304 }, { 0x022C, 0x00D5, 0x0304 }, { 0x022D, 0x00F5, 0x0304 }, { 0x022E, 0x004F, 0x0307 }, { 0x022F, 0x006F, 0x0307 }, { 0x0230, 0x022E, 0x0304 }, { 0x0231, 0x022F, 0x0304 }, { 0x0232, 0x0059, 0x0304 }, { 0x0233, 0x0079, 0x0304 }, { 0x0344, 0x0308, 0x0301 }, { 0x0385, 0x00A8, 0x0301 }, { 0x0386, 0x0391, 0x0301 }, { 0x0388, 0x0395, 0x0301 }, { 0x0389, 0x0397, 0x0301 }, { 0x038A, 0x0399, 0x0301 }, { 0x038C, 0x039F, 0x0301 }, { 0x038E, 0x03A5, 0x0301 }, { 0x038F, 0x03A9, 0x0301 }, { 0x0390, 0x03CA, 0x0301 }, { 0x03AA, 0x0399, 0x0308 }, { 0x03AB, 0x03A5, 0x0308 }, { 0x03AC, 0x03B1, 0x0301 }, { 0x03AD, 0x03B5, 0x0301 }, { 0x03AE, 0x03B7, 0x0301 }, { 0x03AF, 0x03B9, 0x0301 }, { 0x03B0, 0x03CB, 0x0301 }, { 0x03CA, 0x03B9, 0x0308 }, { 0x03CB, 0x03C5, 0x0308 }, { 0x03CC, 0x03BF, 0x0301 }, { 0x03CD, 0x03C5, 0x0301 }, { 0x03CE, 0x03C9, 0x0301 }, { 0x03D3, 0x03D2, 0x0301 }, { 0x03D4, 0x03D2, 0x0308 }, { 0x0400, 0x0415, 0x0300 }, { 0x0401, 0x0415, 0x0308 }, { 0x0403, 0x0413, 0x0301 }, { 0x0407, 0x0406, 0x0308 }, { 0x040C, 0x041A, 0x0301 }, { 0x040D, 0x0418, 0x0300 }, { 0x040E, 0x0423, 0x0306 }, { 0x0419, 0x0418, 0x0306 }, { 0x0439, 0x0438, 0x0306 }, { 0x0450, 0x0435, 0x0300 }, { 0x0451, 0x0435, 0x0308 }, { 0x0453, 0x0433, 0x0301 }, { 0x0457, 0x0456, 0x0308 }, { 0x045C, 0x043A, 0x0301 }, { 0x045D, 0x0438, 0x0300 }, { 0x045E, 0x0443, 0x0306 }, { 0x0476, 0x0474, 0x030F }, { 0x0477, 0x0475, 0x030F }, { 0x04C1, 0x0416, 0x0306 }, { 0x04C2, 0x0436, 0x0306 }, { 0x04D0, 0x0410, 0x0306 }, { 0x04D1, 0x0430, 0x0306 }, { 0x04D2, 0x0410, 0x0308 }, { 0x04D3, 0x0430, 0x0308 }, { 0x04D6, 0x0415, 0x0306 }, { 0x04D7, 0x0435, 0x0306 }, { 0x04DA, 0x04D8, 0x0308 }, { 0x04DB, 0x04D9, 0x0308 }, { 0x04DC, 0x0416, 0x0308 }, { 0x04DD, 0x0436, 0x0308 }, { 0x04DE, 0x0417, 0x0308 }, { 0x04DF, 0x0437, 0x0308 }, { 0x04E2, 0x0418, 0x0304 }, { 0x04E3, 0x0438, 0x0304 }, { 0x04E4, 0x0418, 0x0308 }, { 0x04E5, 0x0438, 0x0308 }, { 0x04E6, 0x041E, 0x0308 }, { 0x04E7, 0x043E, 0x0308 }, { 0x04EA, 0x04E8, 0x0308 }, { 0x04EB, 0x04E9, 0x0308 }, { 0x04EC, 0x042D, 0x0308 }, { 0x04ED, 0x044D, 0x0308 }, { 0x04EE, 0x0423, 0x0304 }, { 0x04EF, 0x0443, 0x0304 }, { 0x04F0, 0x0423, 0x0308 }, { 0x04F1, 0x0443, 0x0308 }, { 0x04F2, 0x0423, 0x030B }, { 0x04F3, 0x0443, 0x030B }, { 0x04F4, 0x0427, 0x0308 }, { 0x04F5, 0x0447, 0x0308 }, { 0x04F8, 0x042B, 0x0308 }, { 0x04F9, 0x044B, 0x0308 }, { 0x0622, 0x0627, 0x0653 }, { 0x0623, 0x0627, 0x0654 }, { 0x0624, 0x0648, 0x0654 }, { 0x0625, 0x0627, 0x0655 }, { 0x0626, 0x064A, 0x0654 }, { 0x06C0, 0x06D5, 0x0654 }, { 0x06C2, 0x06C1, 0x0654 }, { 0x06D3, 0x06D2, 0x0654 }, { 0x0929, 0x0928, 0x093C }, { 0x0931, 0x0930, 0x093C }, { 0x0934, 0x0933, 0x093C }, { 0x0958, 0x0915, 0x093C }, { 0x0959, 0x0916, 0x093C }, { 0x095A, 0x0917, 0x093C }, { 0x095B, 0x091C, 0x093C }, { 0x095C, 0x0921, 0x093C }, { 0x095D, 0x0922, 0x093C }, { 0x095E, 0x092B, 0x093C }, { 0x095F, 0x092F, 0x093C }, { 0x09CB, 0x09C7, 0x09BE }, { 0x09CC, 0x09C7, 0x09D7 }, { 0x09DC, 0x09A1, 0x09BC }, { 0x09DD, 0x09A2, 0x09BC }, { 0x09DF, 0x09AF, 0x09BC }, { 0x0A33, 0x0A32, 0x0A3C }, { 0x0A36, 0x0A38, 0x0A3C }, { 0x0A59, 0x0A16, 0x0A3C }, { 0x0A5A, 0x0A17, 0x0A3C }, { 0x0A5B, 0x0A1C, 0x0A3C }, { 0x0A5E, 0x0A2B, 0x0A3C }, { 0x0B48, 0x0B47, 0x0B56 }, { 0x0B4B, 0x0B47, 0x0B3E }, { 0x0B4C, 0x0B47, 0x0B57 }, { 0x0B5C, 0x0B21, 0x0B3C }, { 0x0B5D, 0x0B22, 0x0B3C }, { 0x0B94, 0x0B92, 0x0BD7 }, { 0x0BCA, 0x0BC6, 0x0BBE }, { 0x0BCB, 0x0BC7, 0x0BBE }, { 0x0BCC, 0x0BC6, 0x0BD7 }, { 0x0C48, 0x0C46, 0x0C56 }, { 0x0CC0, 0x0CBF, 0x0CD5 }, { 0x0CC7, 0x0CC6, 0x0CD5 }, { 0x0CC8, 0x0CC6, 0x0CD6 }, { 0x0CCA, 0x0CC6, 0x0CC2 }, { 0x0CCB, 0x0CCA, 0x0CD5 }, { 0x0D4A, 0x0D46, 0x0D3E }, { 0x0D4B, 0x0D47, 0x0D3E }, { 0x0D4C, 0x0D46, 0x0D57 }, { 0x0DDA, 0x0DD9, 0x0DCA }, { 0x0DDC, 0x0DD9, 0x0DCF }, { 0x0DDD, 0x0DDC, 0x0DCA }, { 0x0DDE, 0x0DD9, 0x0DDF }, { 0x0F43, 0x0F42, 0x0FB7 }, { 0x0F4D, 0x0F4C, 0x0FB7 }, { 0x0F52, 0x0F51, 0x0FB7 }, { 0x0F57, 0x0F56, 0x0FB7 }, { 0x0F5C, 0x0F5B, 0x0FB7 }, { 0x0F69, 0x0F40, 0x0FB5 }, { 0x0F73, 0x0F71, 0x0F72 }, { 0x0F75, 0x0F71, 0x0F74 }, { 0x0F76, 0x0FB2, 0x0F80 }, { 0x0F78, 0x0FB3, 0x0F80 }, { 0x0F81, 0x0F71, 0x0F80 }, { 0x0F93, 0x0F92, 0x0FB7 }, { 0x0F9D, 0x0F9C, 0x0FB7 }, { 0x0FA2, 0x0FA1, 0x0FB7 }, { 0x0FA7, 0x0FA6, 0x0FB7 }, { 0x0FAC, 0x0FAB, 0x0FB7 }, { 0x0FB9, 0x0F90, 0x0FB5 }, { 0x1026, 0x1025, 0x102E }, { 0x1E00, 0x0041, 0x0325 }, { 0x1E01, 0x0061, 0x0325 }, { 0x1E02, 0x0042, 0x0307 }, { 0x1E03, 0x0062, 0x0307 }, { 0x1E04, 0x0042, 0x0323 }, { 0x1E05, 0x0062, 0x0323 }, { 0x1E06, 0x0042, 0x0331 }, { 0x1E07, 0x0062, 0x0331 }, { 0x1E08, 0x00C7, 0x0301 }, { 0x1E09, 0x00E7, 0x0301 }, { 0x1E0A, 0x0044, 0x0307 }, { 0x1E0B, 0x0064, 0x0307 }, { 0x1E0C, 0x0044, 0x0323 }, { 0x1E0D, 0x0064, 0x0323 }, { 0x1E0E, 0x0044, 0x0331 }, { 0x1E0F, 0x0064, 0x0331 }, { 0x1E10, 0x0044, 0x0327 }, { 0x1E11, 0x0064, 0x0327 }, { 0x1E12, 0x0044, 0x032D }, { 0x1E13, 0x0064, 0x032D }, { 0x1E14, 0x0112, 0x0300 }, { 0x1E15, 0x0113, 0x0300 }, { 0x1E16, 0x0112, 0x0301 }, { 0x1E17, 0x0113, 0x0301 }, { 0x1E18, 0x0045, 0x032D }, { 0x1E19, 0x0065, 0x032D }, { 0x1E1A, 0x0045, 0x0330 }, { 0x1E1B, 0x0065, 0x0330 }, { 0x1E1C, 0x0228, 0x0306 }, { 0x1E1D, 0x0229, 0x0306 }, { 0x1E1E, 0x0046, 0x0307 }, { 0x1E1F, 0x0066, 0x0307 }, { 0x1E20, 0x0047, 0x0304 }, { 0x1E21, 0x0067, 0x0304 }, { 0x1E22, 0x0048, 0x0307 }, { 0x1E23, 0x0068, 0x0307 }, { 0x1E24, 0x0048, 0x0323 }, { 0x1E25, 0x0068, 0x0323 }, { 0x1E26, 0x0048, 0x0308 }, { 0x1E27, 0x0068, 0x0308 }, { 0x1E28, 0x0048, 0x0327 }, { 0x1E29, 0x0068, 0x0327 }, { 0x1E2A, 0x0048, 0x032E }, { 0x1E2B, 0x0068, 0x032E }, { 0x1E2C, 0x0049, 0x0330 }, { 0x1E2D, 0x0069, 0x0330 }, { 0x1E2E, 0x00CF, 0x0301 }, { 0x1E2F, 0x00EF, 0x0301 }, { 0x1E30, 0x004B, 0x0301 }, { 0x1E31, 0x006B, 0x0301 }, { 0x1E32, 0x004B, 0x0323 }, { 0x1E33, 0x006B, 0x0323 }, { 0x1E34, 0x004B, 0x0331 }, { 0x1E35, 0x006B, 0x0331 }, { 0x1E36, 0x004C, 0x0323 }, { 0x1E37, 0x006C, 0x0323 }, { 0x1E38, 0x1E36, 0x0304 }, { 0x1E39, 0x1E37, 0x0304 }, { 0x1E3A, 0x004C, 0x0331 }, { 0x1E3B, 0x006C, 0x0331 }, { 0x1E3C, 0x004C, 0x032D }, { 0x1E3D, 0x006C, 0x032D }, { 0x1E3E, 0x004D, 0x0301 }, { 0x1E3F, 0x006D, 0x0301 }, { 0x1E40, 0x004D, 0x0307 }, { 0x1E41, 0x006D, 0x0307 }, { 0x1E42, 0x004D, 0x0323 }, { 0x1E43, 0x006D, 0x0323 }, { 0x1E44, 0x004E, 0x0307 }, { 0x1E45, 0x006E, 0x0307 }, { 0x1E46, 0x004E, 0x0323 }, { 0x1E47, 0x006E, 0x0323 }, { 0x1E48, 0x004E, 0x0331 }, { 0x1E49, 0x006E, 0x0331 }, { 0x1E4A, 0x004E, 0x032D }, { 0x1E4B, 0x006E, 0x032D }, { 0x1E4C, 0x00D5, 0x0301 }, { 0x1E4D, 0x00F5, 0x0301 }, { 0x1E4E, 0x00D5, 0x0308 }, { 0x1E4F, 0x00F5, 0x0308 }, { 0x1E50, 0x014C, 0x0300 }, { 0x1E51, 0x014D, 0x0300 }, { 0x1E52, 0x014C, 0x0301 }, { 0x1E53, 0x014D, 0x0301 }, { 0x1E54, 0x0050, 0x0301 }, { 0x1E55, 0x0070, 0x0301 }, { 0x1E56, 0x0050, 0x0307 }, { 0x1E57, 0x0070, 0x0307 }, { 0x1E58, 0x0052, 0x0307 }, { 0x1E59, 0x0072, 0x0307 }, { 0x1E5A, 0x0052, 0x0323 }, { 0x1E5B, 0x0072, 0x0323 }, { 0x1E5C, 0x1E5A, 0x0304 }, { 0x1E5D, 0x1E5B, 0x0304 }, { 0x1E5E, 0x0052, 0x0331 }, { 0x1E5F, 0x0072, 0x0331 }, { 0x1E60, 0x0053, 0x0307 }, { 0x1E61, 0x0073, 0x0307 }, { 0x1E62, 0x0053, 0x0323 }, { 0x1E63, 0x0073, 0x0323 }, { 0x1E64, 0x015A, 0x0307 }, { 0x1E65, 0x015B, 0x0307 }, { 0x1E66, 0x0160, 0x0307 }, { 0x1E67, 0x0161, 0x0307 }, { 0x1E68, 0x1E62, 0x0307 }, { 0x1E69, 0x1E63, 0x0307 }, { 0x1E6A, 0x0054, 0x0307 }, { 0x1E6B, 0x0074, 0x0307 }, { 0x1E6C, 0x0054, 0x0323 }, { 0x1E6D, 0x0074, 0x0323 }, { 0x1E6E, 0x0054, 0x0331 }, { 0x1E6F, 0x0074, 0x0331 }, { 0x1E70, 0x0054, 0x032D }, { 0x1E71, 0x0074, 0x032D }, { 0x1E72, 0x0055, 0x0324 }, { 0x1E73, 0x0075, 0x0324 }, { 0x1E74, 0x0055, 0x0330 }, { 0x1E75, 0x0075, 0x0330 }, { 0x1E76, 0x0055, 0x032D }, { 0x1E77, 0x0075, 0x032D }, { 0x1E78, 0x0168, 0x0301 }, { 0x1E79, 0x0169, 0x0301 }, { 0x1E7A, 0x016A, 0x0308 }, { 0x1E7B, 0x016B, 0x0308 }, { 0x1E7C, 0x0056, 0x0303 }, { 0x1E7D, 0x0076, 0x0303 }, { 0x1E7E, 0x0056, 0x0323 }, { 0x1E7F, 0x0076, 0x0323 }, { 0x1E80, 0x0057, 0x0300 }, { 0x1E81, 0x0077, 0x0300 }, { 0x1E82, 0x0057, 0x0301 }, { 0x1E83, 0x0077, 0x0301 }, { 0x1E84, 0x0057, 0x0308 }, { 0x1E85, 0x0077, 0x0308 }, { 0x1E86, 0x0057, 0x0307 }, { 0x1E87, 0x0077, 0x0307 }, { 0x1E88, 0x0057, 0x0323 }, { 0x1E89, 0x0077, 0x0323 }, { 0x1E8A, 0x0058, 0x0307 }, { 0x1E8B, 0x0078, 0x0307 }, { 0x1E8C, 0x0058, 0x0308 }, { 0x1E8D, 0x0078, 0x0308 }, { 0x1E8E, 0x0059, 0x0307 }, { 0x1E8F, 0x0079, 0x0307 }, { 0x1E90, 0x005A, 0x0302 }, { 0x1E91, 0x007A, 0x0302 }, { 0x1E92, 0x005A, 0x0323 }, { 0x1E93, 0x007A, 0x0323 }, { 0x1E94, 0x005A, 0x0331 }, { 0x1E95, 0x007A, 0x0331 }, { 0x1E96, 0x0068, 0x0331 }, { 0x1E97, 0x0074, 0x0308 }, { 0x1E98, 0x0077, 0x030A }, { 0x1E99, 0x0079, 0x030A }, { 0x1E9B, 0x017F, 0x0307 }, { 0x1EA0, 0x0041, 0x0323 }, { 0x1EA1, 0x0061, 0x0323 }, { 0x1EA2, 0x0041, 0x0309 }, { 0x1EA3, 0x0061, 0x0309 }, { 0x1EA4, 0x00C2, 0x0301 }, { 0x1EA5, 0x00E2, 0x0301 }, { 0x1EA6, 0x00C2, 0x0300 }, { 0x1EA7, 0x00E2, 0x0300 }, { 0x1EA8, 0x00C2, 0x0309 }, { 0x1EA9, 0x00E2, 0x0309 }, { 0x1EAA, 0x00C2, 0x0303 }, { 0x1EAB, 0x00E2, 0x0303 }, { 0x1EAC, 0x1EA0, 0x0302 }, { 0x1EAD, 0x1EA1, 0x0302 }, { 0x1EAE, 0x0102, 0x0301 }, { 0x1EAF, 0x0103, 0x0301 }, { 0x1EB0, 0x0102, 0x0300 }, { 0x1EB1, 0x0103, 0x0300 }, { 0x1EB2, 0x0102, 0x0309 }, { 0x1EB3, 0x0103, 0x0309 }, { 0x1EB4, 0x0102, 0x0303 }, { 0x1EB5, 0x0103, 0x0303 }, { 0x1EB6, 0x1EA0, 0x0306 }, { 0x1EB7, 0x1EA1, 0x0306 }, { 0x1EB8, 0x0045, 0x0323 }, { 0x1EB9, 0x0065, 0x0323 }, { 0x1EBA, 0x0045, 0x0309 }, { 0x1EBB, 0x0065, 0x0309 }, { 0x1EBC, 0x0045, 0x0303 }, { 0x1EBD, 0x0065, 0x0303 }, { 0x1EBE, 0x00CA, 0x0301 }, { 0x1EBF, 0x00EA, 0x0301 }, { 0x1EC0, 0x00CA, 0x0300 }, { 0x1EC1, 0x00EA, 0x0300 }, { 0x1EC2, 0x00CA, 0x0309 }, { 0x1EC3, 0x00EA, 0x0309 }, { 0x1EC4, 0x00CA, 0x0303 }, { 0x1EC5, 0x00EA, 0x0303 }, { 0x1EC6, 0x1EB8, 0x0302 }, { 0x1EC7, 0x1EB9, 0x0302 }, { 0x1EC8, 0x0049, 0x0309 }, { 0x1EC9, 0x0069, 0x0309 }, { 0x1ECA, 0x0049, 0x0323 }, { 0x1ECB, 0x0069, 0x0323 }, { 0x1ECC, 0x004F, 0x0323 }, { 0x1ECD, 0x006F, 0x0323 }, { 0x1ECE, 0x004F, 0x0309 }, { 0x1ECF, 0x006F, 0x0309 }, { 0x1ED0, 0x00D4, 0x0301 }, { 0x1ED1, 0x00F4, 0x0301 }, { 0x1ED2, 0x00D4, 0x0300 }, { 0x1ED3, 0x00F4, 0x0300 }, { 0x1ED4, 0x00D4, 0x0309 }, { 0x1ED5, 0x00F4, 0x0309 }, { 0x1ED6, 0x00D4, 0x0303 }, { 0x1ED7, 0x00F4, 0x0303 }, { 0x1ED8, 0x1ECC, 0x0302 }, { 0x1ED9, 0x1ECD, 0x0302 }, { 0x1EDA, 0x01A0, 0x0301 }, { 0x1EDB, 0x01A1, 0x0301 }, { 0x1EDC, 0x01A0, 0x0300 }, { 0x1EDD, 0x01A1, 0x0300 }, { 0x1EDE, 0x01A0, 0x0309 }, { 0x1EDF, 0x01A1, 0x0309 }, { 0x1EE0, 0x01A0, 0x0303 }, { 0x1EE1, 0x01A1, 0x0303 }, { 0x1EE2, 0x01A0, 0x0323 }, { 0x1EE3, 0x01A1, 0x0323 }, { 0x1EE4, 0x0055, 0x0323 }, { 0x1EE5, 0x0075, 0x0323 }, { 0x1EE6, 0x0055, 0x0309 }, { 0x1EE7, 0x0075, 0x0309 }, { 0x1EE8, 0x01AF, 0x0301 }, { 0x1EE9, 0x01B0, 0x0301 }, { 0x1EEA, 0x01AF, 0x0300 }, { 0x1EEB, 0x01B0, 0x0300 }, { 0x1EEC, 0x01AF, 0x0309 }, { 0x1EED, 0x01B0, 0x0309 }, { 0x1EEE, 0x01AF, 0x0303 }, { 0x1EEF, 0x01B0, 0x0303 }, { 0x1EF0, 0x01AF, 0x0323 }, { 0x1EF1, 0x01B0, 0x0323 }, { 0x1EF2, 0x0059, 0x0300 }, { 0x1EF3, 0x0079, 0x0300 }, { 0x1EF4, 0x0059, 0x0323 }, { 0x1EF5, 0x0079, 0x0323 }, { 0x1EF6, 0x0059, 0x0309 }, { 0x1EF7, 0x0079, 0x0309 }, { 0x1EF8, 0x0059, 0x0303 }, { 0x1EF9, 0x0079, 0x0303 }, { 0x1F00, 0x03B1, 0x0313 }, { 0x1F01, 0x03B1, 0x0314 }, { 0x1F02, 0x1F00, 0x0300 }, { 0x1F03, 0x1F01, 0x0300 }, { 0x1F04, 0x1F00, 0x0301 }, { 0x1F05, 0x1F01, 0x0301 }, { 0x1F06, 0x1F00, 0x0342 }, { 0x1F07, 0x1F01, 0x0342 }, { 0x1F08, 0x0391, 0x0313 }, { 0x1F09, 0x0391, 0x0314 }, { 0x1F0A, 0x1F08, 0x0300 }, { 0x1F0B, 0x1F09, 0x0300 }, { 0x1F0C, 0x1F08, 0x0301 }, { 0x1F0D, 0x1F09, 0x0301 }, { 0x1F0E, 0x1F08, 0x0342 }, { 0x1F0F, 0x1F09, 0x0342 }, { 0x1F10, 0x03B5, 0x0313 }, { 0x1F11, 0x03B5, 0x0314 }, { 0x1F12, 0x1F10, 0x0300 }, { 0x1F13, 0x1F11, 0x0300 }, { 0x1F14, 0x1F10, 0x0301 }, { 0x1F15, 0x1F11, 0x0301 }, { 0x1F18, 0x0395, 0x0313 }, { 0x1F19, 0x0395, 0x0314 }, { 0x1F1A, 0x1F18, 0x0300 }, { 0x1F1B, 0x1F19, 0x0300 }, { 0x1F1C, 0x1F18, 0x0301 }, { 0x1F1D, 0x1F19, 0x0301 }, { 0x1F20, 0x03B7, 0x0313 }, { 0x1F21, 0x03B7, 0x0314 }, { 0x1F22, 0x1F20, 0x0300 }, { 0x1F23, 0x1F21, 0x0300 }, { 0x1F24, 0x1F20, 0x0301 }, { 0x1F25, 0x1F21, 0x0301 }, { 0x1F26, 0x1F20, 0x0342 }, { 0x1F27, 0x1F21, 0x0342 }, { 0x1F28, 0x0397, 0x0313 }, { 0x1F29, 0x0397, 0x0314 }, { 0x1F2A, 0x1F28, 0x0300 }, { 0x1F2B, 0x1F29, 0x0300 }, { 0x1F2C, 0x1F28, 0x0301 }, { 0x1F2D, 0x1F29, 0x0301 }, { 0x1F2E, 0x1F28, 0x0342 }, { 0x1F2F, 0x1F29, 0x0342 }, { 0x1F30, 0x03B9, 0x0313 }, { 0x1F31, 0x03B9, 0x0314 }, { 0x1F32, 0x1F30, 0x0300 }, { 0x1F33, 0x1F31, 0x0300 }, { 0x1F34, 0x1F30, 0x0301 }, { 0x1F35, 0x1F31, 0x0301 }, { 0x1F36, 0x1F30, 0x0342 }, { 0x1F37, 0x1F31, 0x0342 }, { 0x1F38, 0x0399, 0x0313 }, { 0x1F39, 0x0399, 0x0314 }, { 0x1F3A, 0x1F38, 0x0300 }, { 0x1F3B, 0x1F39, 0x0300 }, { 0x1F3C, 0x1F38, 0x0301 }, { 0x1F3D, 0x1F39, 0x0301 }, { 0x1F3E, 0x1F38, 0x0342 }, { 0x1F3F, 0x1F39, 0x0342 }, { 0x1F40, 0x03BF, 0x0313 }, { 0x1F41, 0x03BF, 0x0314 }, { 0x1F42, 0x1F40, 0x0300 }, { 0x1F43, 0x1F41, 0x0300 }, { 0x1F44, 0x1F40, 0x0301 }, { 0x1F45, 0x1F41, 0x0301 }, { 0x1F48, 0x039F, 0x0313 }, { 0x1F49, 0x039F, 0x0314 }, { 0x1F4A, 0x1F48, 0x0300 }, { 0x1F4B, 0x1F49, 0x0300 }, { 0x1F4C, 0x1F48, 0x0301 }, { 0x1F4D, 0x1F49, 0x0301 }, { 0x1F50, 0x03C5, 0x0313 }, { 0x1F51, 0x03C5, 0x0314 }, { 0x1F52, 0x1F50, 0x0300 }, { 0x1F53, 0x1F51, 0x0300 }, { 0x1F54, 0x1F50, 0x0301 }, { 0x1F55, 0x1F51, 0x0301 }, { 0x1F56, 0x1F50, 0x0342 }, { 0x1F57, 0x1F51, 0x0342 }, { 0x1F59, 0x03A5, 0x0314 }, { 0x1F5B, 0x1F59, 0x0300 }, { 0x1F5D, 0x1F59, 0x0301 }, { 0x1F5F, 0x1F59, 0x0342 }, { 0x1F60, 0x03C9, 0x0313 }, { 0x1F61, 0x03C9, 0x0314 }, { 0x1F62, 0x1F60, 0x0300 }, { 0x1F63, 0x1F61, 0x0300 }, { 0x1F64, 0x1F60, 0x0301 }, { 0x1F65, 0x1F61, 0x0301 }, { 0x1F66, 0x1F60, 0x0342 }, { 0x1F67, 0x1F61, 0x0342 }, { 0x1F68, 0x03A9, 0x0313 }, { 0x1F69, 0x03A9, 0x0314 }, { 0x1F6A, 0x1F68, 0x0300 }, { 0x1F6B, 0x1F69, 0x0300 }, { 0x1F6C, 0x1F68, 0x0301 }, { 0x1F6D, 0x1F69, 0x0301 }, { 0x1F6E, 0x1F68, 0x0342 }, { 0x1F6F, 0x1F69, 0x0342 }, { 0x1F70, 0x03B1, 0x0300 }, { 0x1F72, 0x03B5, 0x0300 }, { 0x1F74, 0x03B7, 0x0300 }, { 0x1F76, 0x03B9, 0x0300 }, { 0x1F78, 0x03BF, 0x0300 }, { 0x1F7A, 0x03C5, 0x0300 }, { 0x1F7C, 0x03C9, 0x0300 }, { 0x1F80, 0x1F00, 0x0345 }, { 0x1F81, 0x1F01, 0x0345 }, { 0x1F82, 0x1F02, 0x0345 }, { 0x1F83, 0x1F03, 0x0345 }, { 0x1F84, 0x1F04, 0x0345 }, { 0x1F85, 0x1F05, 0x0345 }, { 0x1F86, 0x1F06, 0x0345 }, { 0x1F87, 0x1F07, 0x0345 }, { 0x1F88, 0x1F08, 0x0345 }, { 0x1F89, 0x1F09, 0x0345 }, { 0x1F8A, 0x1F0A, 0x0345 }, { 0x1F8B, 0x1F0B, 0x0345 }, { 0x1F8C, 0x1F0C, 0x0345 }, { 0x1F8D, 0x1F0D, 0x0345 }, { 0x1F8E, 0x1F0E, 0x0345 }, { 0x1F8F, 0x1F0F, 0x0345 }, { 0x1F90, 0x1F20, 0x0345 }, { 0x1F91, 0x1F21, 0x0345 }, { 0x1F92, 0x1F22, 0x0345 }, { 0x1F93, 0x1F23, 0x0345 }, { 0x1F94, 0x1F24, 0x0345 }, { 0x1F95, 0x1F25, 0x0345 }, { 0x1F96, 0x1F26, 0x0345 }, { 0x1F97, 0x1F27, 0x0345 }, { 0x1F98, 0x1F28, 0x0345 }, { 0x1F99, 0x1F29, 0x0345 }, { 0x1F9A, 0x1F2A, 0x0345 }, { 0x1F9B, 0x1F2B, 0x0345 }, { 0x1F9C, 0x1F2C, 0x0345 }, { 0x1F9D, 0x1F2D, 0x0345 }, { 0x1F9E, 0x1F2E, 0x0345 }, { 0x1F9F, 0x1F2F, 0x0345 }, { 0x1FA0, 0x1F60, 0x0345 }, { 0x1FA1, 0x1F61, 0x0345 }, { 0x1FA2, 0x1F62, 0x0345 }, { 0x1FA3, 0x1F63, 0x0345 }, { 0x1FA4, 0x1F64, 0x0345 }, { 0x1FA5, 0x1F65, 0x0345 }, { 0x1FA6, 0x1F66, 0x0345 }, { 0x1FA7, 0x1F67, 0x0345 }, { 0x1FA8, 0x1F68, 0x0345 }, { 0x1FA9, 0x1F69, 0x0345 }, { 0x1FAA, 0x1F6A, 0x0345 }, { 0x1FAB, 0x1F6B, 0x0345 }, { 0x1FAC, 0x1F6C, 0x0345 }, { 0x1FAD, 0x1F6D, 0x0345 }, { 0x1FAE, 0x1F6E, 0x0345 }, { 0x1FAF, 0x1F6F, 0x0345 }, { 0x1FB0, 0x03B1, 0x0306 }, { 0x1FB1, 0x03B1, 0x0304 }, { 0x1FB2, 0x1F70, 0x0345 }, { 0x1FB3, 0x03B1, 0x0345 }, { 0x1FB4, 0x03AC, 0x0345 }, { 0x1FB6, 0x03B1, 0x0342 }, { 0x1FB7, 0x1FB6, 0x0345 }, { 0x1FB8, 0x0391, 0x0306 }, { 0x1FB9, 0x0391, 0x0304 }, { 0x1FBA, 0x0391, 0x0300 }, { 0x1FBC, 0x0391, 0x0345 }, { 0x1FC1, 0x00A8, 0x0342 }, { 0x1FC2, 0x1F74, 0x0345 }, { 0x1FC3, 0x03B7, 0x0345 }, { 0x1FC4, 0x03AE, 0x0345 }, { 0x1FC6, 0x03B7, 0x0342 }, { 0x1FC7, 0x1FC6, 0x0345 }, { 0x1FC8, 0x0395, 0x0300 }, { 0x1FCA, 0x0397, 0x0300 }, { 0x1FCC, 0x0397, 0x0345 }, { 0x1FCD, 0x1FBF, 0x0300 }, { 0x1FCE, 0x1FBF, 0x0301 }, { 0x1FCF, 0x1FBF, 0x0342 }, { 0x1FD0, 0x03B9, 0x0306 }, { 0x1FD1, 0x03B9, 0x0304 }, { 0x1FD2, 0x03CA, 0x0300 }, { 0x1FD6, 0x03B9, 0x0342 }, { 0x1FD7, 0x03CA, 0x0342 }, { 0x1FD8, 0x0399, 0x0306 }, { 0x1FD9, 0x0399, 0x0304 }, { 0x1FDA, 0x0399, 0x0300 }, { 0x1FDD, 0x1FFE, 0x0300 }, { 0x1FDE, 0x1FFE, 0x0301 }, { 0x1FDF, 0x1FFE, 0x0342 }, { 0x1FE0, 0x03C5, 0x0306 }, { 0x1FE1, 0x03C5, 0x0304 }, { 0x1FE2, 0x03CB, 0x0300 }, { 0x1FE4, 0x03C1, 0x0313 }, { 0x1FE5, 0x03C1, 0x0314 }, { 0x1FE6, 0x03C5, 0x0342 }, { 0x1FE7, 0x03CB, 0x0342 }, { 0x1FE8, 0x03A5, 0x0306 }, { 0x1FE9, 0x03A5, 0x0304 }, { 0x1FEA, 0x03A5, 0x0300 }, { 0x1FEC, 0x03A1, 0x0314 }, { 0x1FED, 0x00A8, 0x0300 }, { 0x1FF2, 0x1F7C, 0x0345 }, { 0x1FF3, 0x03C9, 0x0345 }, { 0x1FF4, 0x03CE, 0x0345 }, { 0x1FF6, 0x03C9, 0x0342 }, { 0x1FF7, 0x1FF6, 0x0345 }, { 0x1FF8, 0x039F, 0x0300 }, { 0x1FFA, 0x03A9, 0x0300 }, { 0x1FFC, 0x03A9, 0x0345 }, { 0x219A, 0x2190, 0x0338 }, { 0x219B, 0x2192, 0x0338 }, { 0x21AE, 0x2194, 0x0338 }, { 0x21CD, 0x21D0, 0x0338 }, { 0x21CE, 0x21D4, 0x0338 }, { 0x21CF, 0x21D2, 0x0338 }, { 0x2204, 0x2203, 0x0338 }, { 0x2209, 0x2208, 0x0338 }, { 0x220C, 0x220B, 0x0338 }, { 0x2224, 0x2223, 0x0338 }, { 0x2226, 0x2225, 0x0338 }, { 0x2241, 0x223C, 0x0338 }, { 0x2244, 0x2243, 0x0338 }, { 0x2247, 0x2245, 0x0338 }, { 0x2249, 0x2248, 0x0338 }, { 0x2260, 0x003D, 0x0338 }, { 0x2262, 0x2261, 0x0338 }, { 0x226D, 0x224D, 0x0338 }, { 0x226E, 0x003C, 0x0338 }, { 0x226F, 0x003E, 0x0338 }, { 0x2270, 0x2264, 0x0338 }, { 0x2271, 0x2265, 0x0338 }, { 0x2274, 0x2272, 0x0338 }, { 0x2275, 0x2273, 0x0338 }, { 0x2278, 0x2276, 0x0338 }, { 0x2279, 0x2277, 0x0338 }, { 0x2280, 0x227A, 0x0338 }, { 0x2281, 0x227B, 0x0338 }, { 0x2284, 0x2282, 0x0338 }, { 0x2285, 0x2283, 0x0338 }, { 0x2288, 0x2286, 0x0338 }, { 0x2289, 0x2287, 0x0338 }, { 0x22AC, 0x22A2, 0x0338 }, { 0x22AD, 0x22A8, 0x0338 }, { 0x22AE, 0x22A9, 0x0338 }, { 0x22AF, 0x22AB, 0x0338 }, { 0x22E0, 0x227C, 0x0338 }, { 0x22E1, 0x227D, 0x0338 }, { 0x22E2, 0x2291, 0x0338 }, { 0x22E3, 0x2292, 0x0338 }, { 0x22EA, 0x22B2, 0x0338 }, { 0x22EB, 0x22B3, 0x0338 }, { 0x22EC, 0x22B4, 0x0338 }, { 0x22ED, 0x22B5, 0x0338 }, { 0x2ADC, 0x2ADD, 0x0338 }, { 0x304C, 0x304B, 0x3099 }, { 0x304E, 0x304D, 0x3099 }, { 0x3050, 0x304F, 0x3099 }, { 0x3052, 0x3051, 0x3099 }, { 0x3054, 0x3053, 0x3099 }, { 0x3056, 0x3055, 0x3099 }, { 0x3058, 0x3057, 0x3099 }, { 0x305A, 0x3059, 0x3099 }, { 0x305C, 0x305B, 0x3099 }, { 0x305E, 0x305D, 0x3099 }, { 0x3060, 0x305F, 0x3099 }, { 0x3062, 0x3061, 0x3099 }, { 0x3065, 0x3064, 0x3099 }, { 0x3067, 0x3066, 0x3099 }, { 0x3069, 0x3068, 0x3099 }, { 0x3070, 0x306F, 0x3099 }, { 0x3071, 0x306F, 0x309A }, { 0x3073, 0x3072, 0x3099 }, { 0x3074, 0x3072, 0x309A }, { 0x3076, 0x3075, 0x3099 }, { 0x3077, 0x3075, 0x309A }, { 0x3079, 0x3078, 0x3099 }, { 0x307A, 0x3078, 0x309A }, { 0x307C, 0x307B, 0x3099 }, { 0x307D, 0x307B, 0x309A }, { 0x3094, 0x3046, 0x3099 }, { 0x309E, 0x309D, 0x3099 }, { 0x30AC, 0x30AB, 0x3099 }, { 0x30AE, 0x30AD, 0x3099 }, { 0x30B0, 0x30AF, 0x3099 }, { 0x30B2, 0x30B1, 0x3099 }, { 0x30B4, 0x30B3, 0x3099 }, { 0x30B6, 0x30B5, 0x3099 }, { 0x30B8, 0x30B7, 0x3099 }, { 0x30BA, 0x30B9, 0x3099 }, { 0x30BC, 0x30BB, 0x3099 }, { 0x30BE, 0x30BD, 0x3099 }, { 0x30C0, 0x30BF, 0x3099 }, { 0x30C2, 0x30C1, 0x3099 }, { 0x30C5, 0x30C4, 0x3099 }, { 0x30C7, 0x30C6, 0x3099 }, { 0x30C9, 0x30C8, 0x3099 }, { 0x30D0, 0x30CF, 0x3099 }, { 0x30D1, 0x30CF, 0x309A }, { 0x30D3, 0x30D2, 0x3099 }, { 0x30D4, 0x30D2, 0x309A }, { 0x30D6, 0x30D5, 0x3099 }, { 0x30D7, 0x30D5, 0x309A }, { 0x30D9, 0x30D8, 0x3099 }, { 0x30DA, 0x30D8, 0x309A }, { 0x30DC, 0x30DB, 0x3099 }, { 0x30DD, 0x30DB, 0x309A }, { 0x30F4, 0x30A6, 0x3099 }, { 0x30F7, 0x30EF, 0x3099 }, { 0x30F8, 0x30F0, 0x3099 }, { 0x30F9, 0x30F1, 0x3099 }, { 0x30FA, 0x30F2, 0x3099 }, { 0x30FE, 0x30FD, 0x3099 }, { 0xFB1D, 0x05D9, 0x05B4 }, { 0xFB1F, 0x05F2, 0x05B7 }, { 0xFB2A, 0x05E9, 0x05C1 }, { 0xFB2B, 0x05E9, 0x05C2 }, { 0xFB2C, 0xFB49, 0x05C1 }, { 0xFB2D, 0xFB49, 0x05C2 }, { 0xFB2E, 0x05D0, 0x05B7 }, { 0xFB2F, 0x05D0, 0x05B8 }, { 0xFB30, 0x05D0, 0x05BC }, { 0xFB31, 0x05D1, 0x05BC }, { 0xFB32, 0x05D2, 0x05BC }, { 0xFB33, 0x05D3, 0x05BC }, { 0xFB34, 0x05D4, 0x05BC }, { 0xFB35, 0x05D5, 0x05BC }, { 0xFB36, 0x05D6, 0x05BC }, { 0xFB38, 0x05D8, 0x05BC }, { 0xFB39, 0x05D9, 0x05BC }, { 0xFB3A, 0x05DA, 0x05BC }, { 0xFB3B, 0x05DB, 0x05BC }, { 0xFB3C, 0x05DC, 0x05BC }, { 0xFB3E, 0x05DE, 0x05BC }, { 0xFB40, 0x05E0, 0x05BC }, { 0xFB41, 0x05E1, 0x05BC }, { 0xFB43, 0x05E3, 0x05BC }, { 0xFB44, 0x05E4, 0x05BC }, { 0xFB46, 0x05E6, 0x05BC }, { 0xFB47, 0x05E7, 0x05BC }, { 0xFB48, 0x05E8, 0x05BC }, { 0xFB49, 0x05E9, 0x05BC }, { 0xFB4A, 0x05EA, 0x05BC }, { 0xFB4B, 0x05D5, 0x05B9 }, { 0xFB4C, 0x05D1, 0x05BF }, { 0xFB4D, 0x05DB, 0x05BF }, { 0xFB4E, 0x05E4, 0x05BF }, /* out of range of unsigned short... */ #if 0 { 0x1D15E, 0x1D157, 0x1D165 }, { 0x1D15F, 0x1D158, 0x1D165 }, { 0x1D160, 0x1D15F, 0x1D16E }, { 0x1D161, 0x1D15F, 0x1D16F }, { 0x1D162, 0x1D15F, 0x1D170 }, { 0x1D163, 0x1D15F, 0x1D171 }, { 0x1D164, 0x1D15F, 0x1D172 }, { 0x1D1BB, 0x1D1B9, 0x1D165 }, { 0x1D1BC, 0x1D1BA, 0x1D165 }, { 0x1D1BD, 0x1D1BB, 0x1D16E }, { 0x1D1BE, 0x1D1BC, 0x1D16E }, { 0x1D1BF, 0x1D1BB, 0x1D16F }, { 0x1D1C0, 0x1D1BC, 0x1D16F }, #endif /* special hack, treat Arabic ligatures as combining characters */ /* combine them to the isolated presentation form, then let * the shaping and joining take care of it */ { 0xFEF5, 0x0644, 0x0622 }, /* LAM_ALEF_MADDA */ { 0xFEF7, 0x0644, 0x0623 }, /* LAM_ALEF_HAMZA_ABOVE */ { 0xFEF9, 0x0644, 0x0625 }, /* LAM_ALEF_HAMZA_BELOW */ { 0xFEFB, 0x0644, 0x0627 }, /* LAM_ALEF */ }; /* -------------------------- local functions ------------------------------ */ /* look-up functions, maybe theese should use binary search? would require a duplicate of comb_table to reverse map... */ static int get_combining_class(unsigned short ch) { int count; int table_size = sizeof(combclass_table) / sizeof(combclass_table[0]); for (count = 0; count < table_size; count++) { if (combclass_table[count].key == ch) { return combclass_table[count].combclass; } } return 0; } static const char_comb_t* get_comb_entry_decomposed(unsigned short ch) { int count; int table_size = sizeof(comb_table) / sizeof(comb_table[0]); for (count = 0; count < table_size; count++) { if (comb_table[count].key == ch) { return &comb_table[count]; } } return NULL; } static unsigned short get_comb_entry_composed(unsigned short first, unsigned short second) { int count; int table_size = sizeof(comb_table) / sizeof(comb_table[0]); for (count = 0; count < table_size; count++) { if (comb_table[count].first == first && comb_table[count].second == second) { return comb_table[count].key; } } return (unsigned short) 0; } static int convert_to_ucs2( const unsigned char *str_utf8, unsigned short *str_ucs2, int len) { int in_pos = 0; int out_pos = 0; while (in_pos < len) { if (str_utf8[in_pos] <= 0x7f) { str_ucs2[out_pos] = (unsigned short)str_utf8[in_pos]; in_pos++; } else { if ((str_utf8[in_pos] & 0300) != 0300) { /* out of sync */ str_ucs2[out_pos] = REPLACEMENT_CHARACTER; in_pos++; } else if (in_pos < len-1 && str_utf8[in_pos] <= 0xdf && str_utf8[in_pos + 1] <= 0xbf && str_utf8[in_pos + 1] >= 0x80) { str_ucs2[out_pos] = ((str_utf8[in_pos] & 0x1f) << 6) + (str_utf8[in_pos+1] & 0x3f); /* check for overlong sequence */ if(str_ucs2[out_pos] < 0x80) str_ucs2[out_pos] = REPLACEMENT_CHARACTER; in_pos += 2; } else if (in_pos < len-2 && str_utf8[in_pos] <= 0xef && str_utf8[in_pos + 1] <= 0xbf && str_utf8[in_pos + 1] >= 0x80 && str_utf8[in_pos + 2] <= 0xbf && str_utf8[in_pos + 2] >= 0x80) { str_ucs2[out_pos] = ((str_utf8[in_pos] & 0x0f) << 12) + ((str_utf8[in_pos+1] & 0x3f) << 6) + (str_utf8[in_pos+2] & 0x3f); /* check for overlong sequence */ if(str_ucs2[out_pos] < 0x800) str_ucs2[out_pos] = REPLACEMENT_CHARACTER; in_pos += 3; } else { /* incomplete sequence */ str_ucs2[out_pos] = REPLACEMENT_CHARACTER; in_pos++; } } out_pos++; } return out_pos; } static int convert_to_utf8( const unsigned short *str_ucs2, unsigned char *str_utf8, int len) { int in_pos = 0; int out_pos = 0; for (in_pos = 0 ; in_pos < len ; in_pos++) { if (str_ucs2[in_pos] <= 0x7f) { str_utf8[out_pos] = str_ucs2[in_pos]; out_pos++; } else if (str_ucs2[in_pos] <= 0x7ff) { str_utf8[out_pos] = (str_ucs2[in_pos] >> 6) | 0xc0; str_utf8[out_pos+1] = (str_ucs2[in_pos] & 0x3f) | 0x80; out_pos += 2; } else { str_utf8[out_pos] = (str_ucs2[in_pos] >> 12) | 0xe0; str_utf8[out_pos+1] = ((str_ucs2[in_pos] & 0xfff) >> 6) | 0x80; str_utf8[out_pos+2] = (str_ucs2[in_pos] & 0x3f) | 0x80; out_pos += 3; } /* this doesn't handle values outside UCS2 (16-bit) */ } return out_pos; } /* main procedure: takes a pointer to a string (UTF-8) first decomposes string, then rearrange combining characters, the combines them back. Result is stored in original string (can never be "expanded" from original size), new length is returned */ int CombineChars( unsigned char *str_visual, int len, superimpose_char_t **comb_chars, int **l_to_v) { int i,j,k; /* counters */ unsigned short *source; unsigned short *dest; int *source_v_to_l; int *dest_v_to_l; int str_len; int in_str_len; int out_str_len; int comp_str_len = 0; Bool has_changed; /* if input has zero length, return immediatly */ if (len == 0) { return 0; } /* decompose composed characters */ source = (unsigned short *)safemalloc( (len + 1) * sizeof(unsigned short)); /* convert from UTF-8-encoded text to internal 16-bit encoding */ str_len = convert_to_ucs2(str_visual,source,len); in_str_len = str_len; /* we don't really need to NULL-terminate source, since we have string length */ /* be pessimistic, assume all characters are decomposed */ dest = (unsigned short *)safemalloc( (str_len + 1) * 2 * sizeof(unsigned short)); /* use theese to keep track of the mapping of characters from logical to visual */ source_v_to_l = (int *)safemalloc(str_len * sizeof(int)); dest_v_to_l = (int *)safemalloc(str_len * 2 * sizeof(int)); /* setup initial mapping 1-to-1 */ for(i = 0 ; i < str_len ; i++) { source_v_to_l[i] = i; } do { has_changed = False; for (i = 0, j = 0; i < str_len; i++) { const char_comb_t *decomp = get_comb_entry_decomposed(source[i]); /* current character is decomposable */ if (decomp) { dest[j] = decomp->first; dest[j+1] = decomp->second; dest_v_to_l[j] = source_v_to_l[i]; dest_v_to_l[j+1] = source_v_to_l[i]; j += 2; has_changed = True; } else /* leave it as is */ { dest[j] = source[i]; dest_v_to_l[j] = source_v_to_l[i]; j++; } } /* now swap */ free(source); free(source_v_to_l); source = dest; source_v_to_l = dest_v_to_l; str_len = j; dest = (unsigned short *)safemalloc( (str_len + 1) * 2 * sizeof(unsigned short)); dest_v_to_l = (int *)safemalloc(str_len * 2 * sizeof(int)); } while (has_changed); /* source now holds decomposed string (got swapped before exiting loop, str_len holds string length */ /* we reuse dest for composing, can use existing string lengths since it will only get shorter */ /* source_v_to_l holds the mapping from positions in decomposed string to original string */ /* rearrange combining characters */ do { has_changed = False; for (i = 0; i < str_len - 1; i++) { /* swap if combining-class(c1) > combining-class(c2) and combining-class(c2) != 0 */ /* use negative values for marks that have combining class 0, but should be taken out for drawing superimposed */ int c1 = get_combining_class(source[i]); int c2 = get_combining_class(source[i+1]); if (c1 > c2 && c2 > 0) { unsigned short temp = source[i]; int temp_v_to_l = source_v_to_l[i]; source[i] = source[i+1]; source[i+1] = temp; source_v_to_l[i] = source_v_to_l[i+1]; source_v_to_l[i+1] = temp_v_to_l; has_changed = True; } } } while (has_changed); /* compose */ do { unsigned short *temp; int *temp_v_to_l; Bool last_changed = False; has_changed = False; for (i = 0, j = 0; i < str_len - 1; j++) { unsigned short composed = get_comb_entry_composed(source[i], source[i+1]); dest_v_to_l[j] = source_v_to_l[i]; if (composed != 0) { dest[j] = composed; /* if the last character was "absorbed" */ if (i == str_len - 2) { last_changed = True; } i += 2; has_changed = True; } else { dest[j] = source[i]; i++; } } temp = dest; dest = source; source = temp; temp_v_to_l = dest_v_to_l; dest_v_to_l = source_v_to_l; source_v_to_l = temp_v_to_l; /* fixup the last character, the loop above goes to second last, since it needs to look at 2 consecutive, if the last character is a non-combining character */ /* since we have an immediate return on zero length, this works otherwise this would introduce crap here */ if (!last_changed) { source[j] = dest[i]; source_v_to_l[j] = dest_v_to_l[i]; str_len = j+1; } else { str_len = j; } } while (has_changed); /* source contains composed string */ /* gather "uncomposed" combining characters here for rendering over normal characters later */ comp_str_len = 0; if (comb_chars != NULL) { /* calculate number of combining characters left */ for (i = 0 ; i < str_len ; i++) { if (get_combining_class(source[i]) != 0) { comp_str_len++; } } /* allocate storage for combining characters */ *comb_chars = (superimpose_char_t *) safemalloc((comp_str_len + 1) * sizeof(superimpose_char_t)); } for (i = 0,j = 0,k = 0 ; i < str_len ; i++) { /* if character is non-combining, just copy it over to output */ /* if first character is a combing character, just output it as if it where a base character */ if (get_combining_class(source[i]) == 0) { dest[j] = source[i]; dest_v_to_l[j] = source_v_to_l[i]; j++; } else { if (comb_chars != NULL) { /* store composing character as associated with last base charcter */ (*comb_chars)[k].position = j == 0 ? 0 : j-1; (*comb_chars)[k].c.byte1 = source[i] >> 8; (*comb_chars)[k].c.byte2 = source[i] & 0xff; k++; } } } /* terminate */ if (comb_chars != NULL) { (*comb_chars)[comp_str_len].position = 0; (*comb_chars)[comp_str_len].c.byte1 = 0; (*comb_chars)[comp_str_len].c.byte2 = 0; } str_len = convert_to_utf8(dest,str_visual,j); out_str_len = j; str_visual[str_len] = 0; if(l_to_v != NULL) { *l_to_v = (int *)safemalloc((in_str_len + 1) * sizeof(int)); /* map the visual to logical mapping obtained above into a logical to visual mapping */ /* setup the final mapping from logical to visual positions */ /* if no base characters out, all positions map to zero, because there we have combining chars in that case */ if(out_str_len == 0) { for(i = 0 ; i < in_str_len ; i++) { (*l_to_v)[i] = 0; } } for(i = 0, j = 0 ; i < out_str_len ; i++) { /* for each element in mapping from visual string insert "backtracked" references from logical string by inserting consequitive entries, as many as the step in the mapping from visual to logical */ int step = (i == out_str_len - 1) ? in_str_len - j : dest_v_to_l[i+1] - dest_v_to_l[i]; for(k = 0 ; k < step ; k++, j++) { (*l_to_v)[j] = i; } } /* terminated it with -1, to avoid have to send around lenghts */ (*l_to_v)[in_str_len] = -1; } /* clean up */ free(source); free(dest); free(source_v_to_l); free(dest_v_to_l); return str_len; } fvwm-2.6.5.orig/libs/FlocaleCharset.h0000644000175000017500000000351407677641664015635 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ #ifndef FLOCALE_CHARSET_H #define FLOCALE_CHARSET_H /* ---------------------------- included header files ---------------------- */ #include "config.h" #include "Flocale.h" /* ---------------------------- global definitions ------------------------- */ #ifdef HAVE_LIBCHARSET #define FlocaleLibcharsetSupport 1 #else #define FlocaleLibcharsetSupport 0 #endif #ifdef HAVE_CODESET #define FlocaleCodesetSupport 1 #else #define FlocaleCodesetSupport 0 #endif #if FlocaleLibcharsetSupport #define Flocale_charset() locale_charset() #else #define Flocale_charset() NULL #endif #if FlocaleCodesetSupport #define Fnl_langinfo(a) nl_langinfo(a) #define FCODESET CODESET #else #define Fnl_langinfo(a) NULL #define FCODESET 0 #endif /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ /* * */ void FlocaleCharsetInit(Display *dpy, const char *module); void FlocaleCharsetSetFlocaleCharset( Display *dpy, FlocaleFont *flf, char *hints, char *encoding, char *module); FlocaleCharset *FlocaleCharsetGetDefaultCharset(Display *dpy, char *module); FlocaleCharset *FlocaleCharsetGetFLCXOMCharset(void); FlocaleCharset *FlocaleCharsetGetUtf8Charset(void); FlocaleCharset *FlocaleCharsetGetLocaleCharset(void); FlocaleCharset *FlocaleCharsetGetUnknownCharset(void); const char *FlocaleGetBidiCharset(Display *dpy, FlocaleCharset *fc); FlocaleCharset *FlocaleCharsetGetEUCJPCharset(void); Bool FlocaleCharsetIsCharsetXLocale(Display *dpy, char *charset, char *module); void FlocaleCharsetPrintXOMInfo(void); #endif /* FLOCALE_CHARSET_H */ fvwm-2.6.5.orig/libs/Rectangles.c0000644000175000017500000000443607677641664015044 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "Rectangles.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ Bool frect_get_intersection( int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2, XRectangle *r) { if (x1 + w1 > x2 && x1 < x2 + w2 && y1 + h1 > y2 && y1 < y2 + h2) { if (r) { r->x = max(x1,x2); r->y = max(y1,y2); r->width = min(x1+w1,x2+w2) - max(x1,x2); r->height =min(y1+h1,y2+h2) - max(y1,y2); } return True; } return False; } Bool frect_get_seg_intersection( int x1, int w1, int x2, int w2, int *x, int *w) { if (x1 + w1 > x2 && x1 < x2 + w2) { if (x) { *x = max(x1,x2); } if (w) { *w = min(x1+w1,x2+w2) - max(x1,x2); } return True; } return False; } Bool frect_get_rect_intersection( XRectangle a, XRectangle b, XRectangle *r) { return frect_get_intersection( a.x, a.y, a.width, a.height, b.x, b.y, b.width, b.height, r); } fvwm-2.6.5.orig/libs/FTips.c0000644000175000017500000003406210556634174013764 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2004 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "libs/ftime.h" #include #include #include "defaults.h" #include "fvwmlib.h" #include "Strings.h" #include "PictureBase.h" #include "Flocale.h" #include "Graphics.h" #include "Colorset.h" #include "libs/FScreen.h" #include "FTips.h" /* ---------------------------- local definitions -------------------------- */ #define FVWM_TIPS_NOTHING 0 #define FVWM_TIPS_WAITING 1 #define FVWM_TIPS_MAPPED 2 /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static Window win = None; static GC gc = None; static Window win_for; static ftips_config *current_config, *default_config; static char *label; static int state = FVWM_TIPS_NOTHING; static void *boxID = NULL; static FlocaleWinString fwin_string; static rectangle box; static unsigned long timeOut; static unsigned long onTime; static Atom _net_um_for = None; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static unsigned long __get_time(void) { struct timeval t; gettimeofday(&t, NULL); return (1000*t.tv_sec + t.tv_usec/1000); } static void __initialize_window(Display *dpy) { XGCValues xgcv; unsigned long valuemask; XSetWindowAttributes attributes; Atom _net_um_window_type; long _net_um_window_type_tooltips; valuemask = CWOverrideRedirect | CWEventMask | CWColormap; attributes.override_redirect = True; attributes.event_mask = ExposureMask; attributes.colormap = Pcmap; win = XCreateWindow( dpy, DefaultRootWindow(dpy), 0, 0, 1, 1, current_config->border_width, Pdepth, InputOutput, Pvisual, valuemask, &attributes); _net_um_window_type = XInternAtom( dpy, "_NET_UM_WINDOW_TYPE", False); _net_um_window_type_tooltips = XInternAtom( dpy, "_NET_UM_WINDOW_TYPE_TOOLTIPS", False); XChangeProperty( dpy, win, _net_um_window_type, XA_ATOM, 32, PropModeReplace, (unsigned char *) &_net_um_window_type_tooltips, 1); _net_um_for = XInternAtom(dpy, "_NET_UM_FOR", False); gc = fvwmlib_XCreateGC(dpy, win, 0, &xgcv); return; } static void __setup_cs(Display *dpy) { XSetWindowAttributes xswa; unsigned long valuemask = 0; if (current_config->colorset > -1) { xswa.border_pixel = Colorset[current_config->colorset].fg; xswa.background_pixel = Colorset[current_config->colorset].bg; if (Colorset[current_config->colorset].pixmap) { /* set later */ xswa.background_pixmap = None; valuemask = CWBackPixmap | CWBorderPixel;; } else { valuemask = CWBackPixel | CWBorderPixel; } } else { xswa.border_pixel = current_config->border_pixel; xswa.background_pixel = current_config->bg; valuemask = CWBackPixel | CWBorderPixel; } XChangeWindowAttributes(dpy, win, valuemask, &xswa); } static void __setup_gc(Display *dpy) { XGCValues xgcv; unsigned long valuemask; valuemask = GCForeground; if (current_config->colorset > -1) { xgcv.foreground = Colorset[current_config->colorset].fg; } else { xgcv.foreground = current_config->fg; } if (current_config->Ffont && current_config->Ffont->font != NULL) { xgcv.font = current_config->Ffont->font->fid; valuemask |= GCFont; } XChangeGC(dpy, gc, valuemask, &xgcv); return; } static void __draw(Display *dpy) { if (!current_config->Ffont) { return; } fwin_string.str = label; fwin_string.win = win; fwin_string.gc = gc; if (current_config->colorset > -1) { fwin_string.colorset = &Colorset[current_config->colorset]; fwin_string.flags.has_colorset = True; } else { fwin_string.flags.has_colorset = False; } fwin_string.x = 2; fwin_string.y = current_config->Ffont->ascent; FlocaleDrawString(dpy, current_config->Ffont, &fwin_string, 0); return; } static void __map_window(Display *dpy) { rectangle new_g; rectangle screen_g; Window dummy; fscreen_scr_arg *fsarg = NULL; /* for now no xinerama support */ ftips_placement_t placement; int x,y; static int border_width = 1; static Window win_f = None; if (border_width != current_config->border_width) { XSetWindowBorderWidth(dpy, win, current_config->border_width); border_width = current_config->border_width; } FScreenGetScrRect( fsarg, FSCREEN_GLOBAL, &screen_g.x, &screen_g.y, &screen_g.width, &screen_g.height); new_g.height = ((current_config->Ffont)? current_config->Ffont->height:0) + 1; new_g.width = 4; if (label && current_config->Ffont) { new_g.width += FlocaleTextWidth( current_config->Ffont, label, strlen(label)); } if (current_config->placement != FTIPS_PLACEMENT_AUTO_UPDOWN && current_config->placement != FTIPS_PLACEMENT_AUTO_LEFTRIGHT) { placement = current_config->placement; } else { XTranslateCoordinates( dpy, win_for, DefaultRootWindow(dpy), box.x, box.y, &x, &y, &dummy); if (current_config->placement == FTIPS_PLACEMENT_AUTO_UPDOWN) { if (y + box.height/2 >= screen_g.height/2) { placement = FTIPS_PLACEMENT_UP; } else { placement = FTIPS_PLACEMENT_DOWN; } } else { if (x + box.width/2 >= screen_g.width/2) { placement = FTIPS_PLACEMENT_LEFT; } else { placement = FTIPS_PLACEMENT_RIGHT; } } } if (placement == FTIPS_PLACEMENT_RIGHT || placement == FTIPS_PLACEMENT_LEFT) { if (current_config->justification == FTIPS_JUSTIFICATION_CENTER) { y = box.y + (box.height / 2) - (new_g.height / 2) - current_config->border_width; } else if (current_config->justification == FTIPS_JUSTIFICATION_RIGHT_DOWN) { y = box.y + box.height - new_g.height - (2 * current_config->border_width) - current_config->justification_offset; } else /* LEFT_UP */ { y = box.y + current_config->justification_offset; } } else /* placement == FTIPS_PLACEMENT_DOWN || placement == FTIPS_PLACEMENT_UP */ { if (current_config->justification == FTIPS_JUSTIFICATION_CENTER) { x = box.x + (box.width / 2) - (new_g.width / 2) - current_config->border_width; } else if (current_config->justification == FTIPS_JUSTIFICATION_RIGHT_DOWN) { x = box.x + box.width - new_g.width - (2 * current_config->border_width) - current_config->justification_offset; } else /* LEFT_UP */ { x = box.x + current_config->justification_offset; } } if (placement == FTIPS_PLACEMENT_RIGHT) { x = box.x + box.width + current_config->placement_offset + 1; } else if (placement == FTIPS_PLACEMENT_LEFT) { x = box.x - current_config->placement_offset - new_g.width - (2 * current_config->border_width) - 1; } else if (placement == FTIPS_PLACEMENT_DOWN) { y = box.y + box.height + current_config->placement_offset - 0; } else /* UP */ { y = box.y - current_config->placement_offset - new_g.height + 0 - (2 * current_config->border_width); } XTranslateCoordinates( dpy, win_for, DefaultRootWindow(dpy), x, y, &new_g.x, &new_g.y, &dummy); if (placement == FTIPS_PLACEMENT_RIGHT || placement == FTIPS_PLACEMENT_LEFT) { int x1,y1,l1,l2; if (new_g.x < 2) { x = box.x + box.width + current_config->placement_offset + 1; XTranslateCoordinates( dpy, win_for, DefaultRootWindow(dpy), x, y, &x1, &y1, &dummy); /* */ l1 = new_g.width + new_g.x - 2; l2 = screen_g.width - (x1 + new_g.width) - current_config->border_width - 2; if (l2 > l1) { new_g.x = x1; } } else if (new_g.x + new_g.width > screen_g.width - (2 * current_config->border_width) - 2) { x = box.x - current_config->placement_offset - new_g.width - (2 * current_config->border_width) - 1; XTranslateCoordinates( dpy, win_for, DefaultRootWindow(dpy), x, y, &x1, &y1, &dummy); /* */ l1 = new_g.width + x1 - 2; l2 = screen_g.width - (new_g.x + new_g.width) - (2 * current_config->border_width) - 2; if (l1 > l2) { new_g.x = x1; } } if ( new_g.y < 2 ) { new_g.y = 2; } else if (new_g.y + new_g.height > screen_g.height - (2 * current_config->border_width) - 2) { new_g.y = screen_g.height - new_g.height - (2 * current_config->border_width) - 2; } } else /* placement == FTIPS_PLACEMENT_DOWN || placement == FTIPS_PLACEMENT_UP */ { if (new_g.y < 2) { y = box.y + box.height + current_config->placement_offset - 0; XTranslateCoordinates( dpy, win_for, DefaultRootWindow(dpy), x, y, &new_g.x, &new_g.y, &dummy); } else if (new_g.y + new_g.height > screen_g.height - (2 * current_config->border_width) - 2) { y = box.y - current_config->placement_offset - new_g.height + 0 - (2 * current_config->border_width); XTranslateCoordinates( dpy, win_for, DefaultRootWindow(dpy), x, y, &new_g.x, &new_g.y, &dummy); } if ( new_g.x < 2 ) { new_g.x = 2; } else if (new_g.x + new_g.width > screen_g.width - (2 * current_config->border_width) - 2) { new_g.x = screen_g.width - new_g.width - (2 * current_config->border_width) - 2; } } /* make changes to window */ XMoveResizeWindow( dpy, win, new_g.x, new_g.y, new_g.width, new_g.height); __setup_gc(dpy); if (current_config->colorset > -1) { SetWindowBackground( dpy, win, new_g.width, new_g.height, &Colorset[current_config->colorset], Pdepth, gc, True); } else { XSetWindowBackground (dpy, win, current_config->bg); } if (current_config->border_width > 0) { XSetWindowBorder( dpy, win, Colorset[current_config->colorset].fg); } if (state != FVWM_TIPS_MAPPED && win_f != win_for) { long l_win_for; l_win_for = win_for; XChangeProperty( dpy, win, _net_um_for, XA_WINDOW, 32, PropModeReplace, (unsigned char *) &l_win_for, 1); win_f = win_for; } XMapRaised(dpy, win); state = FVWM_TIPS_MAPPED; return; } /* ---------------------------- interface functions ------------------------ */ Bool FTipsInit(Display *dpy) { current_config = default_config = FTipsNewConfig(); __initialize_window(dpy); if (gc == None || win == None) { return False; } __setup_cs(dpy); __setup_gc(dpy); memset(&fwin_string, 0, sizeof(fwin_string)); return True; } ftips_config *FTipsNewConfig(void) { ftips_config *fc; fc = (ftips_config *)safemalloc(sizeof(ftips_config)); memset(fc, 0, sizeof(ftips_config)); /* use colorset 0 as default */ fc->border_width = FTIPS_DEFAULT_BORDER_WIDTH; fc->placement = FTIPS_DEFAULT_PLACEMENT; fc->justification = FTIPS_DEFAULT_JUSTIFICATION; fc->placement_offset = FTIPS_DEFAULT_PLACEMENT_OFFSET; fc->justification_offset = FTIPS_DEFAULT_JUSTIFICATION_OFFSET; fc->delay = 1000; fc->mapped_delay = 300; return fc; } void FTipsOn( Display *dpy, Window win_f, ftips_config *fc, void *id, char *str, int x, int y, int w, int h) { unsigned long delay; box.x = x; box.y = y; box.width = w; box.height = h; if (fc == NULL) { fc = default_config; } current_config = fc; if (label != NULL) { free(label); } CopyString(&label, str); win_for = win_f; if (id == boxID) { if (id && state == FVWM_TIPS_WAITING) { FTipsCheck(dpy); } return; } onTime = __get_time(); if (state == FVWM_TIPS_MAPPED) { FTipsCancel(dpy); delay = fc->mapped_delay; } else { delay = fc->delay; } boxID = id; timeOut = onTime + delay; state = FVWM_TIPS_WAITING; if (delay == 0) { FTipsCheck(dpy); } return; } void FTipsCancel(Display *dpy) { if (state == FVWM_TIPS_MAPPED && win != None) { XUnmapWindow(dpy, win); } boxID = 0; state = FVWM_TIPS_NOTHING; } unsigned long FTipsCheck(Display *dpy) { unsigned long ct; if (state != FVWM_TIPS_WAITING || win == None) { return 0; } ct = __get_time(); if (ct >= timeOut) { __map_window(dpy); XFlush(dpy); state = FVWM_TIPS_MAPPED; return 0; } else { XFlush(dpy); return timeOut - ct; } } Bool FTipsExpose(Display *dpy, XEvent *ev) { int ex,ey,ex2,ey2; if (win == None || ev->xany.window != win) { return False; } ex = ev->xexpose.x; ey = ev->xexpose.y; ex2 = ev->xexpose.x + ev->xexpose.width; ey2= ev->xexpose.y + ev->xexpose.height; while (FCheckTypedWindowEvent(dpy, ev->xany.window, Expose, ev)) { ex = min(ex, ev->xexpose.x); ey = min(ey, ev->xexpose.y); ex2 = max(ex2, ev->xexpose.x + ev->xexpose.width); ey2= max(ey2 , ev->xexpose.y + ev->xexpose.height); } #if 0 fprintf ( stderr, "\tExpose: %i,%i,%i,%i %i\n", ex, ey, ex2-ex, ey2-ey, ev->xexpose.count); #endif __draw(dpy); return True; } Bool FTipsHandleEvents(Display *dpy, XEvent *ev) { if (ev->xany.window != win) { return False; } switch(ev->type) { case Expose: FTipsExpose(dpy, ev); break; default: break; } return True; } void FTipsUpdateLabel(Display *dpy, char *str) { if (state != FVWM_TIPS_MAPPED && state != FVWM_TIPS_WAITING) { return; } if (label) { free(label); } CopyString(&label, str); if (state == FVWM_TIPS_MAPPED) { __map_window(dpy); __draw(dpy); } } void FTipsColorsetChanged(Display *dpy, int cs) { if (state != FVWM_TIPS_MAPPED || cs != current_config->colorset) { return; } __map_window(dpy); __draw(dpy); } fvwm-2.6.5.orig/libs/PictureUtils.h0000644000175000017500000000243010552376502015364 0ustar vwcvwc/* -*-c-*- */ #ifndef Picture_Utils_H #define Picture_Utils_H #define PICTURE_CALLED_BY_FVWM 0 #define PICTURE_CALLED_BY_MODULE 1 void PictureReduceColorName(char **my_color); void PictureAllocColors( Display *dpy, Colormap cmap, XColor *colors, int size, Bool no_limit); int PictureAllocColor(Display *dpy, Colormap cmap, XColor *c, int no_limit); int PictureAllocColorAllProp( Display *dpy, Colormap cmap, XColor *c, int x, int y, Bool no_limit, Bool is_8, Bool do_dither); int PictureAllocColorImage( Display *dpy, PictureImageColorAllocator *pica, XColor *c, int x, int y); PictureImageColorAllocator *PictureOpenImageColorAllocator( Display *dpy, Colormap cmap, int x, int y, Bool no_limit, Bool save_pixels, int dither, Bool is_8); void PictureCloseImageColorAllocator( Display *dpy, PictureImageColorAllocator *pica, int *nalloc_pixels, Pixel **alloc_pixels, int *no_limit); void PictureFreeColors( Display *dpy, Colormap cmap, Pixel *pixels, int n, unsigned long planes, Bool no_limit); Pixel PictureGetNextColor(Pixel p, int n); Bool PictureDitherByDefault(void); Bool PictureUseBWOnly(void); int PictureInitColors( int call_type, Bool init_color_limit, PictureColorLimitOption *opt, Bool use_my_color_limit, Bool init_dither); void PicturePrintColorInfo(int verbose); #endif fvwm-2.6.5.orig/libs/safemalloc.h0000644000175000017500000000044307677641664015062 0ustar vwcvwc/* -*-c-*- */ /* * * Procedure: * safe?alloc - mallocs/callocs specified space or exits if there's a * problem * */ char *safemalloc(int length); char *safecalloc(int num, int length); char *saferealloc(char *ptr, int length); char *safestrdup(const char *s); fvwm-2.6.5.orig/libs/FRender.h0000644000175000017500000002552107677641664014305 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ #ifndef FRENDER_H #define FRENDER_H /* ---------------------------- included header files ---------------------- */ #include "config.h" #include "PictureBase.h" #if XRenderSupport #define Picture XRenderPicture #include #undef Picture #endif /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ #if XRenderSupport typedef XRenderDirectFormat FRenderDirectFormat; typedef PictFormat FRPictFormat; typedef XRenderPictFormat FRenderPictFormat; typedef XRenderPicture FRenderPicture; #if 0 /* this has disappeared */ typedef XRenderVisual FRenderVisual; typedef XRenderDepth FRenderDepth; typedef XRenderInfo FRenderInfo; #endif typedef XRenderPictureAttributes FRenderPictureAttributes; typedef XRenderColor FRenderColor; typedef XGlyphInfo FGlyphInfo; #define FRenderPictFormatID PictFormatID #define FRenderPictFormatType PictFormatType #define FRenderPictFormatDepth PictFormatDepth #define FRenderPictFormatRed PictFormatRed #define FRenderPictFormatRedMask PictFormatRedMask #define FRenderPictFormatGreen PictFormatGreen #define FRenderPictFormatGreenMask PictFormatGreenMask #define FRenderPictFormatBlue PictFormatBlue #define FRenderPictFormatBlueMask PictFormatBlueMask #define FRenderPictFormatAlpha PictFormatAlpha #define FRenderPictFormatAlphaMask PictFormatAlphaMask #define FRenderPictFormatColormap PictFormatColormap #define FRenderBadPictFormat 0 #define FRenderBadPicture 1 #define FRenderBadPictOp 2 #define FRenderBadGlyphSet 3 #define FRenderBadGlyph 4 #define FRenderRenderNumberErrors (FRenderBadGlyph+1) #define FRenderPictTypeIndexed PictTypeIndexed #define FRenderPictTypeDirect PictTypeDirect #define FRenderPictOpMinimum PictOpMinimum #define FRenderPictOpClear PictOpClear #define FRenderPictOpSrc PictOpSrc #define FRenderPictOpDst PictOpDst #define FRenderPictOpOver PictOpOver #define FRenderPictOpOverReverse PictOpOverReverse #define FRenderPictOpIn PictOpIn #define FRenderPictOpInReverse PictOpInReverse #define FRenderPictOpOut PictOpOut #define FRenderPictOpOutReverse PictOpOutReverse #define FRenderPictOpAtop PictOpAtop #define FRenderPictOpAtopReverse PictOpAtopReverse #define FRenderPictOpXor PictOpXor #define FRenderPictOpAdd PictOpAdd #define FRenderPictOpSaturate PictOpSaturate #define FRenderPictOpMaximum PictOpMaximum /* * Operators only available in version 0.2 */ #if 0 #define FRenderPictOpDisjointMinimum PictOpDisjointMinimum #define FRenderPictOpDisjointClear PictOpDisjointClear #define FRenderPictOpDisjointSrc PictOpDisjointSrc #define FRenderPictOpDisjointDst PictOpDisjointDst #define FRenderPictOpDisjointOver PictOpDisjointOver #define FRenderPictOpDisjointOverReverse PictOpDisjointOverReverse #define FRenderPictOpDisjointIn PictOpDisjointIn #define FRenderPictOpDisjointInReverse PictOpDisjointInReverse #define FRenderPictOpDisjointOut PictOpDisjointOut #define FRenderPictOpDisjointOutReverse PictOpDisjointOutReverse #define FRenderPictOpDisjointAtop PictOpDisjointAtop #define FRenderPictOpDisjointAtopReverse PictOpDisjointAtopReverse #define FRenderPictOpDisjointXor PictOpDisjointXor #define FRenderPictOpDisjointMaximum PictOpDisjointMaximum #define FRenderPictOpConjointMinimum PictOpConjointMinimum #define FRenderPictOpConjointClear PictOpConjointClear #define FRenderPictOpConjointSrc PictOpConjointSrc #define FRenderPictOpConjointDst PictOpConjointDst #define FRenderPictOpConjointOver PictOpConjointOver #define FRenderPictOpConjointOverReverse PictOpConjointOverReverse #define FRenderPictOpConjointIn PictOpConjointIn #define FRenderPictOpConjointInReverse PictOpConjointInReverse #define FRenderPictOpConjointOut PictOpConjointOut #define FRenderPictOpConjointOutReverse PictOpConjointOutReverse #define FRenderPictOpConjointAtop PictOpConjointAtop #define FRenderPictOpConjointAtopReverse PictOpConjointAtopReverse #define FRenderPictOpConjointXor PictOpConjointXor #define FRenderPictOpConjointMaximum PictOpConjointMaximum #endif /* 0 */ #define FRenderPolyEdgeSharp PolyEdgeSharp #define FRenderPolyEdgeSmooth PolyEdgeSmooth #define FRenderPolyModePrecise #define FRenderPolyModeImprecise #define FRenderCPRepeat CPRepeat #define FRenderCPAlphaMap CPAlphaMap #define FRenderCPAlphaXOrigin CPAlphaXOrigin #define FRenderCPAlphaYOrigin CPAlphaYOrigin #define FRenderCPClipXOrigin CPClipXOrigin #define FRenderCPClipYOrigin CPClipYOrigin #define FRenderCPClipMask CPClipMask #define FRenderCPGraphicsExposure CPGraphicsExposure #define FRenderCPSubwindowMode CPSubwindowMode #define FRenderCPPolyEdge CPPolyEdge #define FRenderCPPolyMode CPPolyMode #define FRenderCPDither CPDither #define FRenderCPComponentAlpha CPComponentAlpha #define FRenderCPLastBit CPLastBit #define FRenderQueryExtension(a,b,c) XRenderQueryExtension(a,b,c) #define FRenderQueryVersion(a,b,c) XRenderQueryVersion(a,b,c) #define FRenderQueryFormats(a) XRenderQueryFormats(a) #define FRenderFindVisualFormat(a,b) XRenderFindVisualFormat(a,b) #define FRenderFindFormat(a,b,c,d) XRenderFindFormat(a,b,c,d) #define FRenderCreatePicture(a,b,c,d,e) XRenderCreatePicture(a,b,c,d,e) #define FRenderChangePicture(a,b,c,d) XRenderChangePicture(a,b,c,d) #define FRenderSetPictureClipRectangles(a,b,c,d,e,f) \ XRenderSetPictureClipRectangles(a,b,c,d,e,f) #define FRenderSetPictureClipRegion(a,b,c) XRenderSetPictureClipRegion(a,b,c) #define FRenderFreePicture(a,b) XRenderFreePicture(a,b) #define FRenderComposite(a,b,c,d,e,f,g,h,i,j,k,l,m) \ XRenderComposite(a,b,c,d,e,f,g,h,i,j,k,l,m) #define FRenderFillRectangle(a,b,c,d,e,f,g,h) \ XRenderFillRectangle(a,b,c,d,e,f,g,h) #define FRenderFillRectangles(a,b,c,d,e,f) XRenderFillRectangles(a,b,c,d,e,f) #else /* !XRenderSupport */ typedef unsigned long FRenderPicture; typedef unsigned long FRPictFormat; typedef struct { short red; short redMask; short green; short greenMask; short blue; short blueMask; short alpha; short alphaMask; } FRenderDirectFormat; typedef struct { FRPictFormat id; int type; int depth; FRenderDirectFormat direct; Colormap colormap; } FRenderPictFormat; typedef struct { Visual *visual; FRenderPictFormat *format; } FRenderVisual; typedef struct { int depth; int nvisuals; FRenderVisual *visuals; } FRenderDepth; typedef struct { FRenderDepth *depths; int ndepths; FRenderPictFormat *fallback; } FRenderScreen; typedef struct _FRenderInfo { FRenderPictFormat *format; int nformat; FRenderScreen *screen; int nscreen; FRenderDepth *depth; int ndepth; FRenderVisual *visual; int nvisual; } FRenderInfo; typedef struct _FRenderPictureAttributes { Bool repeat; FRenderPicture alpha_map; int alpha_x_origin; int alpha_y_origin; int clip_x_origin; int clip_y_origin; Pixmap clip_mask; Bool graphics_exposures; int subwindow_mode; int poly_edge; int poly_mode; Atom dither; Bool component_alpha; } FRenderPictureAttributes; typedef struct { unsigned short red; unsigned short green; unsigned short blue; unsigned short alpha; } FRenderColor; typedef struct _FGlyphInfo { unsigned short width; unsigned short height; short x; short y; short xOff; short yOff; } FGlyphInfo; #define FRenderPictFormatID 0 #define FRenderPictFormatType 0 #define FRenderPictFormatDepth 0 #define FRenderPictFormatRed 0 #define FRenderPictFormatRedMask 0 #define FRenderPictFormatGreen 0 #define FRenderPictFormatGreenMask 0 #define FRenderPictFormatBlue 0 #define FRenderPictFormatBlueMask 0 #define FRenderPictFormatAlpha 0 #define FRenderPictFormatAlphaMask 0 #define FRenderPictFormatColormap 0 #define FRenderBadPictFormat 0 #define FRenderBadPicture 1 #define FRenderBadPictOp 2 #define FRenderBadGlyphSet 3 #define FRenderBadGlyph 4 #define FRenderRenderNumberErrors (FRenderBadGlyph+1) #define FRenderPictTypeIndexed 0 #define FRenderPictTypeDirect 0 #define FRenderPictOpMinimum 0 #define FRenderPictOpClear 0 #define FRenderPictOpSrc 0 #define FRenderPictOpDst 0 #define FRenderPictOpOver 0 #define FRenderPictOpOverReverse 0 #define FRenderPictOpIn 0 #define FRenderPictOpInReverse 0 #define FRenderPictOpOut 0 #define FRenderPictOpOutReverse 0 #define FRenderPictOpAtop 0 #define FRenderPictOpAtopReverse 0 #define FRenderPictOpXor 0 #define FRenderPictOpAdd 0 #define FRenderPictOpSaturate 0 #define FRenderPictOpMaximum 0 /* * Operators only available in version 0.2 */ #if 0 #define FRenderPictOpDisjointMinimum 0 #define FRenderPictOpDisjointClear 0 #define FRenderPictOpDisjointSrc 0 #define FRenderPictOpDisjointDst 0 #define FRenderPictOpDisjointOver 0 #define FRenderPictOpDisjointOverReverse 0 #define FRenderPictOpDisjointIn 0 #define FRenderPictOpDisjointInReverse 0 #define FRenderPictOpDisjointOut 0 #define FRenderPictOpDisjointOutReverse 0 #define FRenderPictOpDisjointAtop 0 #define FRenderPictOpDisjointAtopReverse 0 #define FRenderPictOpDisjointXor 0 #define FRenderPictOpDisjointMaximum 0 #define FRenderPictOpConjointMinimum 0 #define FRenderPictOpConjointClear 0 #define FRenderPictOpConjointSrc 0 #define FRenderPictOpConjointDst 0 #define FRenderPictOpConjointOver 0 #define FRenderPictOpConjointOverReverse 0 #define FRenderPictOpConjointIn 0 #define FRenderPictOpConjointInReverse 0 #define FRenderPictOpConjointOut 0 #define FRenderPictOpConjointOutReverse 0 #define FRenderPictOpConjointAtop 0 #define FRenderPictOpConjointAtopReverse 0 #define FRenderPictOpConjointXor 0 #define FRenderPictOpConjointMaximum 0 #endif #define FRenderPolyEdgeSharp 0 #define FRenderPolyEdgeSmooth 0 #define FRenderPolyModePrecise 0 #define FRenderPolyModeImprecise 0 #define FRenderCPRepeat 0 #define FRenderCPAlphaMap 0 #define FRenderCPAlphaXOrigin 0 #define FRenderCPAlphaYOrigin 0 #define FRenderCPClipXOrigin 0 #define FRenderCPClipYOrigin 0 #define FRenderCPClipMask 0 #define FRenderCPGraphicsExposure 0 #define FRenderCPSubwindowMode 0 #define FRenderCPPolyEdge 0 #define FRenderCPPolyMode 0 #define FRenderCPDither 0 #define FRenderCPComponentAlpha 0 #define FRenderCPLastBit 0 #define FRenderQueryExtension(a,b,c) 0 #define FRenderQueryVersion(a,b,c) 0 #define FRenderQueryFormats(a) 0 #define FRenderFindVisualFormat(a,b) NULL #define FRenderFindFormat(a,b,c,d) NULL #define FRenderCreatePicture(a,b,c,d,e) None #define FRenderChangePicture(a,b,c,d) #define FRenderSetPictureClipRectangles(a,b,c,d,e,f) #define FRenderSetPictureClipRegion(a,b,c) #define FRenderFreePicture(a,b) #define FRenderComposite(a,b,c,d,e,f,g,h,i,j,k,l,m) #define FRenderFillRectangle(a,b,c,d,e,f,g,h) #define FRenderFillRectangles(a,b,c,d,e,f) #endif #endif /* FRENDER_H */ fvwm-2.6.5.orig/libs/fvwmlib.c0000644000175000017500000000371510557140526014400 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include "fvwmlib.h" #include "FScreen.h" #include "FShape.h" #include "Fsvg.h" #include "FRenderInit.h" #include "Graphics.h" #include "PictureBase.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ void flib_init_graphics(Display *dpy) { PictureInitCMap(dpy); FScreenInit(dpy); /* Initialise default colorset */ AllocColorset(0); FShapeInit(dpy); FRenderInit(dpy); Frsvg_init(); return; } fvwm-2.6.5.orig/libs/Fsvg.h0000644000175000017500000000420010557140526013632 0ustar vwcvwc#ifndef FSVG_H #define FSVG_H #ifdef HAVE_RSVG #define USE_SVG 1 #else #define USE_SVG 0 #endif #include "PictureBase.h" #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #if USE_SVG # include # include typedef RsvgDimensionData FRsvgDimensionData; typedef RsvgHandle FRsvgHandle; typedef cairo_surface_t Fcairo_surface_t; typedef cairo_t Fcairo_t; # define FCAIRO_FORMAT_ARGB32 CAIRO_FORMAT_ARGB32 # define FCAIRO_STATUS_SUCCESS CAIRO_STATUS_SUCCESS # define FG_OBJECT(a) G_OBJECT(a) # define Fg_object_unref(a) g_object_unref(a) # define Frsvg_handle_get_dimensions(a, b) \ rsvg_handle_get_dimensions(a, b) # define Frsvg_handle_new_from_file(a, b) rsvg_handle_new_from_file(a, b) # define Frsvg_handle_render_cairo(a, b) rsvg_handle_render_cairo(a, b) # define Frsvg_init() rsvg_init() # define Fcairo_create(a) cairo_create(a) # define Fcairo_destroy(a) cairo_destroy(a) # define Fcairo_image_surface_create_for_data(a,b,c,d,e) \ cairo_image_surface_create_for_data(a,b,c,d,e) # define Fcairo_rotate(a, b) cairo_rotate(a, b) # define Fcairo_scale(a, b, c) cairo_scale(a, b, c) # define Fcairo_status(a) cairo_status(a) # define Fcairo_surface_destroy(a) cairo_surface_destroy(a) # define Fcairo_surface_status(a) cairo_surface_status(a) # define Fcairo_translate(a, b, c) cairo_translate(a, b, c) #else typedef struct { int width; int height; double em; double ex; } FRsvgDimensionData; typedef void FRsvgHandle; typedef void Fcairo_surface_t; typedef void Fcairo_t; # define FCAIRO_FORMAT_ARGB32 0 # define FCAIRO_STATUS_SUCCESS 0 # define FG_OBJECT(a) # define Fg_object_unref(a) # define Frsvg_handle_get_dimensions(a, b) # define Frsvg_handle_new_from_file(a, b) 0 # define Frsvg_handle_render_cairo(a, b) # define Frsvg_init() # define Fcairo_create(a) 0 # define Fcairo_destroy(a) # define Fcairo_image_surface_create_for_data(a,b,c,d,e) 0 # define Fcairo_rotate(a, b) # define Fcairo_scale(a, b, c) # define Fcairo_status(a) 0 # define Fcairo_surface_destroy(a) # define Fcairo_surface_status(a) 0 # define Fcairo_translate(a, b, c) #endif #endif /* FSVG_H */ fvwm-2.6.5.orig/libs/Strings.h0000644000175000017500000000421510466316565014373 0ustar vwcvwc/* -*-c-*- */ #ifndef FVWMLIB_STRINGS_H #define FVWMLIB_STRINGS_H /** * Concatenate three strings. * * Parameters may be NULL to signify the empty string. * * Returns pointer to static storage, overwritten on the next call. **/ char *CatString3(const char *a, const char *b, const char *c); #define CatString2(a,b) CatString3(a,b,NULL) /** * Copy string into newly-malloced memory, stripping leading and * trailing spaces. The string is terminated by either a NUL or * a newline character. **/ void CopyString(char **dest, const char *source); /** * Like CopyString, but strips leading and trailing (double) quotes if any. **/ void CopyStringWithQuotes(char **dest, const char *src); /** * Copy string into newly-malloced memory, stripping leading and * trailing spaces. The difference between this and CopyString() * is that newlines are treated as whitespace by stripcpy(), whereas * CopyString() treats a newline as a string terminator (like the NUL * character. **/ char *stripcpy( const char *source ); /** * Return 1 if the two strings are equal. Case is ignored. **/ int StrEquals( const char *s1, const char *s2 ); /** * Return 1 if the string has the given prefix. Case is ignored. **/ int StrHasPrefix( const char* string, const char* prefix ); /** * Adds single quotes arround the string and escapes single quotes with * backslashes. The result is placed in the given dest, not allocated. * The end of destination, i.e. pointer to '\0' is returned. * You should allocate dest yourself, at least strlen(source) * 2 + 3. **/ char *QuoteString(char *dest, const char *source); /** * Adds delim around the source and escapes all characters in escape with * the corresponding escaper. The dest string must be preallocated. * delim should be included in escape with a proper escaper. * Returns a pointer to the end of dest. **/ char *QuoteEscapeString(char *dest, const char *source, char delim, const char *escape, const char *escaper); /** * Calculates the lenght needed by a escaped by QuoteEscapeString * the corresponding escaper. **/ unsigned int QuoteEscapeStringLength(const char *source, const char *escape); #endif fvwm-2.6.5.orig/libs/Event.c0000644000175000017500000000255610630367353014016 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2001 Dominik Vogt */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include #include "fvwmlib.h" #include "Event.h" /* * Return the subwindow member of an event if the event type has one. */ Window GetSubwindowFromEvent(Display *dpy, const XEvent *eventp) { if (eventp == NULL) { return None; } switch (eventp->type) { case ButtonPress: case ButtonRelease: return eventp->xbutton.subwindow; case KeyPress: case KeyRelease: return eventp->xkey.subwindow; case EnterNotify: case LeaveNotify: return eventp->xcrossing.subwindow; case MotionNotify: return eventp->xmotion.subwindow; default: return None; } } fvwm-2.6.5.orig/libs/fvwmlib.h0000644000175000017500000000177110556634726014416 0ustar vwcvwc/* -*-c-*- */ #ifndef FVWMLIB_H #define FVWMLIB_H #include #include #include #include /* needed for xpm.h and Pixel defn */ #include #include "fvwmrect.h" #include "safemalloc.h" /* Convenience function ti init all the graphics subsystems */ void flib_init_graphics(Display *dpy); /* * Replacements for missing system calls. */ #ifndef HAVE_ATEXIT int atexit(void(*func)()); #endif #ifndef HAVE_GETHOSTNAME int gethostname(char* name, int len); #endif #ifndef HAVE_STRCASECMP int strcasecmp(char* s1, char* s2); #endif #ifndef HAVE_STRNCASECMP int strncasecmp(char* s1, char* s2, int len); #endif #ifndef HAVE_STRERROR char* strerror(int errNum); #endif #ifndef HAVE_USLEEP int usleep(unsigned long usec); #endif /* Set up heap debugging library dmalloc. */ #ifdef HAVE_DMALLOC_H #include #endif /* Set up mtrace from glibc 2.1.x for x > ? */ #ifdef MTRACE_DEBUGGING #include #endif #endif fvwm-2.6.5.orig/libs/FShape.c0000644000175000017500000000216007677641664014113 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ** FShape.c: drop in replacements for the X shape library encapsulation */ #include "config.h" #ifdef SHAPE #include #include #include "FShape.h" int FShapeEventBase = 0; int FShapeErrorBase = 0; Bool FShapesSupported = False; void FShapeInit(Display *dpy) { FShapesSupported = FShapeQueryExtension(dpy, &FShapeEventBase, &FShapeErrorBase); } #endif /* SHAPE */ fvwm-2.6.5.orig/libs/BidiJoin.h0000644000175000017500000000075507701771622014433 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Nadim Shaikli */ /* * FBidiJoin.h * * Interface to character shaping/joining that is required by most Bidi * (bidirectional) languages. */ #ifndef BIDIJOIN_H #define BIDIJOIN_H #include "config.h" #if HAVE_BIDI #include /* * Shape/Join a passed-in visual string */ int shape_n_join(FriBidiChar *str_visual, int str_len); #else /* !HAVE_BIDI */ #define shape_n_join(a, b) 0 #endif /* HAVE_BIDI */ #endif /* BIDIJOIN_H */ fvwm-2.6.5.orig/libs/PictureDitherMatrice.h0000644000175000017500000017553507677641664017053 0ustar vwcvwc/* -*-c-*- */ #ifndef Picture_Dither_Matrice_H #define Picture_Dither_Matrice_H /* This dither table was generated by Raph Levien using patented * technology (US Patent 5,276,535). The dither table itself is in the * public domain. */ #define DM_WIDTH 128 #define DM_WIDTH_SHIFT 7 #define DM_HEIGHT 128 #define DITHER_MATRICE \ { \ { 0, 41, 23, 5, 17, 39, 7, 15, 62, 23, 40, 51, 31, 47, 9, 32, 52, 27, 57, 25, 6, 61, 27, 52, 37, 7, 40, 63, 18, 36, 10, 42, 25, 62, 45, 34, 20, 42, 37, 14, 35, 29, 50, 10, 61, 2, 40, 8, 37, 12, 58, 22, 5, 41, 10, 39, 0, 60, 11, 46, 2, 55, 38, 17, 36, 59, 13, 54, 37, 56, 8, 29, 16, 13, 63, 22, 41, 55, 7, 20, 49, 14, 23, 55, 37, 23, 19, 36, 15, 49, 23, 63, 30, 14, 38, 27, 53, 13, 22, 41, 19, 31, 7, 19, 50, 30, 49, 16, 3, 32, 56, 40, 29, 34, 8, 48, 19, 45, 4, 51, 12, 46, 35, 49, 16, 42, 12, 62 },\ { 30, 57, 36, 54, 47, 34, 52, 27, 43, 4, 28, 7, 17, 36, 62, 13, 44, 7, 18, 48, 33, 21, 44, 14, 30, 47, 12, 33, 5, 55, 31, 58, 13, 30, 4, 17, 52, 10, 60, 26, 46, 0, 39, 27, 42, 22, 47, 25, 60, 32, 9, 38, 48, 17, 59, 30, 49, 18, 34, 25, 51, 19, 5, 48, 21, 8, 28, 46, 1, 32, 41, 19, 54, 47, 37, 18, 28, 11, 44, 30, 39, 56, 2, 33, 8, 42, 61, 28, 58, 8, 46, 9, 41, 4, 58, 7, 21, 48, 59, 10, 52, 14, 42, 57, 12, 25, 7, 53, 42, 24, 11, 50, 17, 59, 42, 2, 36, 60, 32, 17, 63, 29, 21, 7, 59, 32, 24, 39 },\ { 22, 8, 16, 32, 3, 25, 13, 57, 18, 45, 58, 39, 55, 20, 5, 42, 23, 34, 63, 1, 51, 10, 58, 4, 60, 23, 53, 27, 44, 21, 3, 48, 8, 50, 43, 54, 27, 32, 5, 55, 21, 58, 12, 53, 6, 36, 14, 50, 17, 29, 53, 15, 24, 52, 7, 36, 13, 42, 4, 53, 9, 35, 61, 26, 56, 32, 49, 15, 62, 23, 6, 60, 2, 31, 4, 48, 58, 38, 15, 61, 5, 25, 47, 28, 50, 15, 7, 40, 3, 32, 33, 52, 25, 50, 35, 42, 61, 3, 28, 36, 23, 63, 4, 33, 46, 62, 36, 23, 60, 6, 54, 28, 4, 37, 23, 55, 25, 8, 42, 54, 14, 6, 56, 38, 19, 52, 4, 46 },\ { 48, 53, 43, 12, 45, 63, 30, 37, 9, 34, 21, 1, 25, 47, 29, 58, 3, 54, 15, 39, 29, 17, 38, 35, 20, 43, 1, 49, 15, 59, 29, 39, 22, 35, 16, 23, 1, 47, 39, 18, 8, 44, 25, 31, 57, 19, 63, 4, 45, 3, 42, 61, 1, 31, 45, 20, 57, 29, 62, 21, 32, 41, 14, 44, 3, 39, 5, 34, 10, 43, 51, 35, 23, 52, 40, 10, 21, 1, 53, 18, 51, 43, 12, 62, 18, 54, 26, 51, 20, 57, 14, 1, 62, 16, 11, 18, 32, 39, 17, 44, 1, 48, 26, 37, 18, 2, 51, 14, 28, 45, 35, 18, 57, 13, 47, 11, 51, 20, 2, 39, 31, 47, 25, 1, 50, 11, 60, 7 },\ { 18, 28, 1, 56, 21, 10, 51, 2, 46, 54, 14, 61, 11, 50, 13, 38, 19, 31, 45, 9, 55, 24, 47, 5, 54, 9, 62, 11, 35, 8, 51, 14, 57, 6, 63, 40, 58, 14, 51, 28, 62, 34, 15, 48, 1, 41, 30, 35, 55, 21, 34, 11, 49, 37, 8, 52, 4, 23, 15, 43, 1, 58, 11, 23, 53, 16, 55, 26, 58, 18, 27, 12, 45, 14, 25, 63, 42, 33, 27, 35, 9, 31, 21, 38, 1, 44, 34, 12, 48, 38, 21, 44, 29, 47, 26, 53, 1, 46, 54, 8, 59, 29, 11, 55, 22, 41, 33, 20, 39, 1, 48, 9, 44, 32, 5, 62, 29, 44, 57, 23, 10, 58, 34, 43, 15, 37, 26, 33 }, \ { 51, 38, 59, 24, 35, 42, 19, 60, 5, 32, 41, 26, 43, 33, 7, 53, 48, 11, 59, 23, 42, 2, 61, 30, 16, 40, 32, 24, 56, 41, 19, 33, 37, 26, 47, 9, 31, 22, 2, 45, 9, 54, 4, 37, 21, 52, 11, 23, 7, 57, 16, 25, 55, 18, 63, 27, 46, 39, 56, 10, 50, 37, 29, 47, 19, 63, 24, 9, 46, 2, 39, 60, 9, 57, 30, 7, 49, 11, 59, 3, 45, 57, 5, 60, 29, 22, 5, 60, 30, 9, 59, 18, 40, 6, 57, 36, 30, 12, 24, 34, 15, 40, 52, 6, 49, 9, 58, 4, 63, 12, 26, 61, 22, 53, 38, 16, 35, 14, 28, 50, 42, 17, 5, 28, 62, 20, 54, 12 }, \ { 26, 6, 31, 15, 49, 6, 38, 27, 22, 49, 16, 56, 2, 62, 30, 21, 0, 36, 28, 6, 49, 32, 13, 52, 26, 50, 19, 46, 3, 26, 62, 0, 53, 12, 29, 3, 53, 41, 60, 24, 38, 13, 58, 16, 43, 9, 59, 39, 46, 28, 44, 40, 2, 33, 13, 41, 16, 6, 47, 31, 26, 17, 57, 6, 38, 0, 42, 36, 29, 52, 20, 31, 48, 0, 34, 56, 20, 36, 23, 54, 14, 41, 24, 37, 10, 55, 46, 25, 16, 45, 36, 4, 55, 23, 15, 8, 50, 62, 5, 56, 44, 20, 13, 28, 59, 31, 24, 47, 31, 52, 37, 17, 40, 0, 26, 49, 3, 60, 7, 33, 0, 61, 53, 40, 8, 45, 2, 41 }, \ { 16, 63, 43, 4, 61, 24, 56, 13, 53, 8, 36, 12, 24, 41, 16, 46, 60, 26, 52, 39, 14, 57, 21, 37, 0, 45, 7, 59, 38, 17, 43, 10, 45, 20, 61, 43, 19, 11, 33, 17, 50, 32, 23, 61, 28, 49, 26, 0, 18, 51, 5, 60, 22, 58, 29, 0, 59, 34, 19, 62, 3, 52, 7, 44, 30, 59, 13, 50, 15, 62, 7, 17, 38, 22, 44, 15, 40, 4, 47, 28, 33, 17, 49, 16, 51, 40, 10, 56, 0, 53, 13, 49, 28, 38, 60, 21, 43, 19, 37, 27, 3, 51, 34, 39, 0, 45, 15, 43, 10, 21, 3, 55, 8, 33, 59, 10, 41, 18, 52, 24, 46, 20, 30, 13, 58, 22, 36, 57 }, \ { 50, 34, 11, 47, 29, 17, 44, 0, 33, 63, 28, 46, 52, 5, 57, 10, 42, 18, 4, 63, 20, 8, 44, 10, 56, 34, 14, 29, 5, 54, 23, 59, 32, 49, 7, 34, 49, 27, 56, 0, 42, 7, 46, 3, 40, 6, 54, 32, 62, 13, 36, 10, 47, 8, 35, 49, 24, 51, 12, 40, 22, 35, 60, 12, 22, 51, 33, 4, 40, 25, 43, 55, 5, 54, 12, 61, 26, 51, 8, 62, 0, 53, 7, 63, 2, 32, 19, 34, 42, 24, 31, 63, 2, 10, 45, 33, 0, 48, 9, 61, 22, 47, 8, 62, 18, 56, 7, 54, 27, 57, 46, 30, 50, 19, 45, 30, 56, 36, 22, 47, 11, 38, 3, 51, 32, 48, 18, 9 }, \ { 0, 21, 40, 19, 52, 9, 37, 48, 20, 40, 3, 18, 27, 38, 35, 22, 31, 56, 13, 35, 46, 28, 60, 40, 27, 18, 61, 50, 41, 30, 7, 36, 2, 25, 16, 57, 5, 15, 47, 29, 55, 19, 30, 52, 15, 34, 20, 12, 43, 30, 20, 54, 25, 44, 53, 12, 38, 5, 55, 27, 48, 15, 33, 27, 45, 8, 19, 28, 56, 11, 33, 49, 18, 36, 29, 2, 45, 16, 39, 19, 31, 43, 27, 35, 20, 52, 26, 6, 61, 11, 41, 17, 29, 51, 20, 56, 25, 32, 41, 17, 53, 31, 25, 14, 42, 23, 35, 16, 38, 6, 34, 12, 15, 62, 6, 21, 13, 1, 63, 9, 55, 27, 43, 25, 14, 4, 31, 55 }, \ { 44, 29, 61, 2, 35, 58, 26, 15, 60, 10, 51, 59, 14, 55, 8, 50, 2, 44, 25, 51, 1, 33, 16, 4, 48, 36, 2, 21, 12, 57, 48, 13, 51, 55, 40, 28, 37, 62, 8, 39, 12, 63, 36, 10, 59, 24, 56, 47, 9, 50, 41, 1, 32, 17, 6, 21, 61, 30, 9, 43, 1, 54, 41, 2, 54, 37, 48, 61, 1, 46, 21, 3, 58, 24, 50, 32, 60, 10, 57, 25, 46, 12, 59, 4, 45, 13, 57, 47, 27, 39, 5, 58, 47, 14, 35, 4, 52, 13, 60, 6, 36, 10, 45, 55, 4, 50, 29, 2, 61, 50, 25, 58, 44, 24, 36, 42, 54, 28, 40, 32, 16, 56, 6, 62, 46, 39, 60, 23 }, \ { 7, 48, 14, 54, 23, 40, 4, 45, 30, 22, 42, 32, 1, 44, 20, 29, 58, 8, 37, 19, 41, 54, 24, 58, 9, 53, 25, 46, 34, 16, 23, 38, 27, 11, 18, 1, 52, 21, 35, 22, 48, 5, 25, 45, 18, 38, 2, 27, 35, 4, 57, 15, 62, 39, 57, 28, 42, 16, 36, 60, 24, 18, 10, 63, 20, 5, 16, 23, 37, 14, 59, 27, 41, 8, 13, 42, 21, 35, 6, 50, 3, 38, 15, 48, 30, 39, 17, 3, 49, 14, 53, 33, 24, 7, 61, 44, 11, 39, 23, 49, 19, 58, 1, 32, 36, 12, 60, 41, 20, 13, 41, 4, 39, 1, 48, 8, 18, 51, 14, 44, 5, 37, 21, 34, 1, 26, 10, 37 }, \ { 53, 36, 27, 9, 50, 12, 32, 55, 2, 57, 7, 17, 48, 34, 63, 15, 40, 26, 62, 11, 49, 6, 31, 39, 22, 42, 6, 63, 1, 39, 60, 4, 42, 61, 32, 45, 24, 44, 2, 60, 16, 41, 53, 1, 33, 61, 49, 17, 63, 23, 45, 26, 33, 3, 23, 46, 2, 50, 20, 4, 45, 34, 49, 30, 39, 58, 44, 31, 53, 34, 6, 52, 30, 47, 63, 1, 53, 22, 42, 31, 58, 23, 54, 22, 61, 8, 36, 59, 22, 35, 21, 1, 55, 40, 27, 16, 30, 54, 2, 29, 43, 16, 39, 63, 21, 46, 26, 10, 48, 32, 19, 53, 30, 56, 26, 60, 33, 4, 61, 23, 49, 59, 15, 53, 19, 58, 42, 16 }, \ { 20, 5, 59, 46, 25, 62, 7, 19, 43, 25, 37, 61, 11, 24, 4, 54, 12, 52, 3, 32, 17, 61, 12, 47, 15, 55, 18, 31, 53, 28, 9, 50, 21, 6, 55, 9, 58, 14, 54, 26, 33, 7, 31, 58, 13, 21, 8, 42, 29, 6, 37, 11, 48, 52, 14, 60, 11, 39, 56, 32, 14, 58, 7, 26, 17, 4, 42, 8, 11, 47, 19, 38, 10, 17, 26, 37, 9, 55, 28, 13, 18, 40, 6, 33, 1, 43, 25, 11, 51, 7, 62, 43, 18, 37, 3, 57, 45, 9, 38, 58, 5, 52, 27, 7, 17, 53, 5, 57, 37, 2, 63, 9, 22, 15, 11, 38, 25, 45, 35, 0, 28, 10, 41, 30, 50, 8, 31, 57 }, \ { 49, 33, 16, 38, 1, 42, 51, 34, 53, 14, 28, 49, 30, 56, 36, 23, 43, 20, 38, 56, 22, 45, 28, 0, 62, 35, 26, 44, 11, 19, 52, 35, 44, 15, 30, 38, 10, 31, 40, 4, 46, 50, 20, 40, 27, 44, 51, 14, 56, 53, 19, 59, 7, 29, 41, 19, 35, 25, 8, 52, 22, 44, 13, 53, 50, 32, 61, 24, 56, 25, 63, 0, 45, 57, 33, 59, 16, 46, 4, 62, 50, 11, 60, 37, 52, 19, 55, 29, 37, 46, 13, 26, 48, 10, 50, 34, 21, 63, 26, 13, 42, 33, 22, 55, 35, 28, 43, 15, 24, 51, 27, 34, 46, 49, 58, 3, 52, 9, 57, 19, 48, 55, 3, 35, 12, 45, 24, 3 }, \ { 41, 11, 56, 28, 18, 31, 22, 10, 37, 6, 47, 13, 3, 41, 9, 46, 0, 48, 29, 6, 34, 10, 55, 37, 20, 8, 49, 3, 41, 59, 14, 25, 0, 63, 19, 47, 27, 51, 17, 57, 23, 10, 61, 6, 54, 3, 38, 31, 0, 22, 34, 43, 20, 55, 31, 0, 49, 63, 29, 38, 3, 62, 28, 40, 0, 22, 14, 35, 2, 48, 15, 43, 23, 14, 3, 29, 49, 20, 39, 34, 0, 44, 29, 9, 15, 47, 5, 42, 0, 31, 58, 5, 31, 61, 23, 15, 0, 47, 19, 50, 24, 3, 59, 11, 44, 0, 31, 59, 6, 42, 17, 60, 0, 39, 20, 31, 43, 17, 29, 40, 12, 25, 60, 22, 52, 15, 63, 29 }, \ { 20, 52, 8, 44, 62, 4, 59, 49, 17, 63, 21, 39, 60, 18, 52, 27, 33, 59, 14, 51, 59, 43, 24, 5, 51, 30, 57, 17, 32, 5, 37, 56, 48, 34, 42, 3, 60, 5, 36, 13, 43, 37, 18, 34, 25, 12, 59, 24, 47, 36, 11, 50, 3, 38, 9, 58, 16, 5, 43, 18, 47, 10, 37, 18, 59, 46, 29, 52, 40, 12, 34, 28, 56, 36, 53, 7, 43, 8, 24, 52, 26, 17, 56, 43, 24, 32, 63, 20, 57, 16, 22, 52, 36, 8, 41, 56, 29, 32, 54, 7, 35, 57, 14, 48, 20, 62, 13, 39, 53, 29, 8, 45, 13, 29, 7, 61, 14, 54, 6, 63, 38, 32, 18, 43, 2, 39, 6, 47 }, \ { 0, 58, 23, 35, 13, 46, 12, 39, 0, 31, 55, 24, 5, 35, 15, 61, 17, 5, 39, 25, 18, 2, 50, 33, 41, 13, 39, 23, 62, 46, 29, 12, 22, 8, 56, 25, 20, 49, 32, 62, 0, 56, 11, 46, 63, 42, 9, 16, 55, 5, 60, 15, 62, 26, 45, 21, 36, 51, 13, 57, 31, 24, 55, 6, 35, 9, 57, 5, 20, 60, 7, 51, 5, 19, 40, 25, 61, 32, 56, 12, 36, 48, 21, 2, 58, 12, 39, 28, 9, 50, 40, 12, 44, 18, 25, 49, 6, 38, 11, 62, 18, 46, 30, 9, 40, 25, 49, 19, 10, 36, 55, 22, 33, 52, 41, 18, 37, 27, 49, 21, 2, 46, 7, 53, 33, 61, 27, 35 }, \ { 41, 31, 5, 39, 51, 26, 33, 57, 27, 41, 9, 44, 54, 29, 48, 7, 44, 36, 57, 10, 31, 63, 16, 45, 11, 60, 1, 47, 7, 20, 43, 3, 58, 36, 13, 52, 39, 7, 15, 28, 22, 48, 30, 21, 1, 29, 49, 44, 27, 17, 40, 30, 24, 42, 12, 53, 33, 7, 47, 20, 1, 42, 11, 49, 25, 43, 17, 32, 45, 27, 41, 21, 31, 62, 11, 49, 2, 15, 42, 5, 63, 7, 41, 27, 49, 6, 54, 23, 46, 34, 2, 28, 54, 3, 59, 12, 46, 17, 42, 28, 40, 1, 37, 51, 5, 55, 2, 34, 47, 16, 3, 62, 47, 5, 23, 56, 1, 44, 12, 34, 51, 16, 57, 11, 25, 17, 54, 13 }, \ { 60, 26, 55, 18, 3, 60, 20, 6, 52, 15, 50, 19, 32, 11, 23, 53, 26, 21, 1, 47, 42, 27, 8, 58, 21, 27, 53, 36, 26, 54, 31, 50, 17, 30, 45, 1, 29, 59, 44, 53, 41, 4, 35, 58, 51, 19, 32, 4, 52, 34, 48, 8, 51, 5, 56, 2, 25, 61, 27, 38, 54, 27, 62, 21, 51, 1, 39, 62, 10, 50, 1, 58, 13, 47, 38, 18, 35, 54, 22, 51, 30, 19, 59, 34, 14, 32, 44, 4, 60, 15, 52, 62, 20, 43, 30, 35, 21, 60, 4, 52, 12, 24, 61, 18, 30, 42, 23, 61, 25, 50, 27, 38, 11, 59, 12, 35, 50, 30, 59, 24, 8, 42, 28, 37, 48, 9, 44, 21 }, \ { 10, 47, 15, 50, 30, 43, 8, 45, 29, 2, 36, 59, 1, 58, 41, 3, 63, 31, 54, 20, 13, 55, 35, 38, 4, 44, 15, 9, 61, 2, 14, 38, 61, 10, 23, 54, 18, 12, 24, 2, 14, 55, 16, 8, 38, 14, 41, 60, 10, 23, 1, 58, 32, 17, 28, 37, 41, 15, 3, 60, 15, 33, 4, 36, 16, 59, 28, 14, 23, 55, 37, 18, 44, 28, 2, 57, 30, 10, 27, 46, 14, 38, 3, 53, 21, 61, 17, 35, 10, 41, 26, 7, 33, 9, 57, 1, 53, 37, 26, 20, 56, 48, 9, 33, 58, 16, 37, 7, 45, 1, 57, 15, 32, 26, 42, 23, 7, 20, 4, 54, 31, 62, 22, 1, 59, 30, 4, 51 }, \ { 36, 2, 38, 11, 24, 36, 54, 22, 62, 47, 25, 8, 28, 45, 16, 38, 12, 43, 9, 37, 49, 3, 23, 52, 18, 30, 50, 33, 19, 42, 49, 26, 6, 40, 47, 35, 63, 38, 50, 33, 60, 26, 36, 47, 24, 57, 6, 26, 39, 63, 19, 44, 14, 46, 61, 9, 50, 30, 45, 23, 10, 50, 44, 8, 31, 54, 6, 46, 36, 4, 30, 54, 8, 52, 22, 41, 4, 60, 40, 0, 58, 24, 45, 10, 37, 1, 48, 30, 56, 17, 38, 48, 24, 47, 19, 39, 14, 8, 45, 32, 2, 34, 27, 44, 4, 52, 11, 56, 31, 21, 40, 19, 44, 51, 2, 63, 46, 58, 36, 43, 14, 5, 50, 38, 14, 56, 40, 23 }, \ { 61, 46, 32, 63, 54, 1, 14, 34, 12, 40, 18, 49, 37, 10, 61, 30, 51, 24, 60, 7, 29, 40, 62, 11, 46, 58, 6, 56, 24, 10, 34, 52, 21, 59, 16, 3, 27, 5, 20, 46, 9, 40, 7, 62, 2, 30, 53, 15, 48, 10, 28, 35, 54, 6, 21, 34, 18, 55, 7, 40, 57, 19, 26, 60, 41, 13, 24, 51, 19, 61, 9, 25, 34, 15, 63, 11, 45, 17, 20, 47, 33, 8, 31, 62, 43, 26, 53, 7, 24, 59, 0, 13, 55, 4, 62, 27, 51, 31, 63, 15, 58, 7, 54, 14, 46, 22, 28, 43, 12, 63, 8, 54, 5, 17, 39, 33, 15, 10, 27, 17, 47, 34, 19, 45, 27, 12, 33, 17 }, \ { 5, 28, 21, 7, 17, 48, 42, 58, 23, 4, 63, 14, 55, 21, 34, 5, 19, 0, 45, 17, 52, 15, 25, 32, 0, 22, 40, 13, 45, 62, 18, 0, 43, 11, 33, 55, 30, 42, 57, 19, 51, 31, 22, 43, 18, 45, 34, 0, 43, 31, 56, 3, 23, 40, 59, 0, 44, 13, 48, 35, 2, 32, 46, 0, 21, 48, 35, 3, 40, 32, 43, 59, 0, 48, 33, 26, 53, 36, 55, 12, 51, 16, 55, 5, 18, 29, 11, 39, 51, 19, 45, 31, 42, 21, 35, 6, 22, 47, 10, 38, 23, 50, 20, 36, 0, 60, 38, 4, 50, 35, 48, 34, 24, 57, 9, 53, 28, 48, 61, 0, 56, 24, 53, 3, 63, 6, 42, 57 }, \ { 13, 53, 45, 40, 58, 27, 6, 16, 38, 51, 33, 30, 43, 2, 47, 56, 40, 50, 33, 57, 27, 5, 47, 42, 60, 36, 16, 54, 28, 4, 37, 57, 28, 51, 22, 8, 45, 14, 6, 39, 0, 54, 11, 59, 28, 12, 50, 21, 61, 13, 19, 38, 49, 11, 25, 37, 58, 29, 22, 63, 14, 56, 12, 53, 30, 63, 9, 57, 26, 12, 47, 16, 23, 39, 50, 6, 31, 2, 25, 6, 28, 41, 36, 22, 50, 57, 42, 3, 34, 8, 28, 61, 11, 50, 16, 54, 41, 0, 55, 43, 5, 29, 41, 63, 25, 16, 53, 18, 26, 10, 21, 0, 61, 30, 41, 22, 3, 38, 20, 39, 29, 8, 41, 16, 36, 52, 22, 19 }, \ { 55, 34, 0, 25, 10, 32, 56, 44, 28, 0, 57, 7, 26, 53, 23, 8, 13, 35, 22, 12, 36, 60, 20, 8, 14, 29, 48, 2, 41, 49, 23, 13, 39, 7, 48, 58, 25, 53, 34, 62, 28, 16, 48, 4, 37, 56, 27, 5, 36, 52, 46, 7, 62, 33, 52, 11, 17, 53, 5, 28, 41, 24, 38, 17, 5, 39, 20, 45, 15, 56, 5, 38, 60, 8, 14, 57, 21, 48, 62, 39, 59, 13, 1, 60, 9, 32, 16, 63, 44, 25, 52, 15, 36, 2, 60, 29, 12, 33, 25, 17, 59, 45, 13, 8, 49, 32, 6, 40, 59, 29, 45, 37, 13, 47, 6, 55, 30, 45, 9, 52, 13, 59, 25, 47, 32, 1, 49, 30 }, \ { 9, 39, 14, 61, 49, 37, 3, 20, 50, 13, 41, 19, 46, 17, 38, 59, 28, 62, 4, 44, 54, 1, 34, 51, 55, 7, 63, 32, 21, 8, 56, 31, 62, 19, 36, 1, 41, 17, 24, 12, 42, 35, 25, 52, 20, 8, 44, 59, 25, 2, 22, 42, 16, 29, 4, 46, 20, 36, 43, 9, 51, 8, 49, 26, 58, 33, 54, 1, 37, 29, 52, 20, 27, 45, 19, 35, 42, 16, 10, 32, 20, 49, 46, 27, 40, 4, 47, 22, 13, 55, 4, 47, 26, 44, 23, 40, 58, 19, 48, 13, 31, 2, 57, 34, 42, 19, 61, 32, 14, 55, 5, 51, 26, 19, 58, 16, 49, 14, 62, 5, 33, 44, 21, 7, 60, 26, 11, 41 }, \ { 62, 24, 47, 29, 8, 19, 53, 11, 60, 24, 32, 61, 4, 55, 31, 2, 49, 16, 39, 9, 31, 24, 43, 17, 26, 38, 11, 25, 58, 43, 12, 35, 3, 46, 15, 32, 63, 4, 49, 56, 2, 60, 10, 32, 63, 17, 39, 12, 55, 30, 57, 9, 48, 55, 39, 24, 60, 2, 58, 31, 19, 61, 34, 3, 42, 11, 22, 46, 7, 61, 10, 42, 3, 55, 32, 1, 58, 28, 44, 54, 4, 34, 23, 15, 56, 20, 37, 58, 6, 30, 38, 18, 63, 9, 32, 5, 51, 3, 62, 37, 52, 18, 39, 23, 3, 51, 9, 47, 1, 23, 43, 15, 60, 35, 11, 40, 1, 36, 31, 26, 57, 2, 37, 54, 18, 44, 58, 16 }, \ { 5, 51, 3, 33, 43, 62, 21, 42, 35, 9, 48, 15, 36, 10, 22, 42, 20, 46, 26, 56, 50, 12, 59, 3, 48, 19, 45, 53, 1, 27, 47, 17, 52, 24, 56, 11, 51, 21, 37, 30, 20, 46, 14, 41, 1, 47, 33, 7, 41, 17, 35, 27, 20, 1, 14, 54, 26, 33, 18, 47, 1, 44, 14, 59, 16, 52, 28, 18, 49, 31, 25, 34, 63, 13, 51, 24, 9, 50, 3, 23, 38, 63, 7, 52, 29, 46, 11, 33, 50, 22, 57, 36, 1, 57, 49, 17, 39, 28, 9, 35, 6, 27, 53, 15, 55, 30, 24, 58, 36, 41, 11, 52, 32, 3, 44, 25, 62, 23, 51, 15, 42, 22, 50, 10, 39, 4, 31, 35 }, \ { 46, 22, 57, 17, 12, 39, 26, 5, 31, 59, 1, 45, 27, 62, 52, 7, 58, 33, 6, 18, 39, 22, 33, 41, 57, 5, 35, 18, 40, 16, 60, 5, 29, 42, 7, 39, 27, 44, 9, 47, 8, 26, 54, 22, 51, 29, 24, 49, 15, 61, 4, 51, 31, 63, 43, 6, 50, 8, 39, 12, 53, 37, 23, 30, 40, 6, 62, 43, 14, 53, 2, 49, 7, 36, 17, 41, 61, 37, 18, 56, 11, 18, 44, 35, 2, 19, 61, 0, 41, 14, 8, 30, 43, 12, 24, 46, 14, 54, 42, 21, 44, 61, 10, 46, 37, 11, 44, 7, 18, 63, 20, 29, 7, 49, 28, 54, 8, 43, 4, 48, 18, 63, 12, 29, 48, 24, 59, 20 }, \ { 13, 36, 28, 54, 35, 2, 56, 46, 16, 49, 22, 40, 11, 34, 14, 43, 29, 12, 63, 48, 2, 61, 7, 15, 28, 30, 50, 9, 61, 33, 38, 23, 54, 13, 61, 33, 3, 59, 16, 35, 58, 40, 5, 38, 13, 57, 3, 58, 37, 21, 45, 12, 39, 7, 35, 30, 13, 56, 22, 62, 27, 6, 55, 10, 48, 21, 33, 2, 38, 23, 40, 20, 44, 29, 59, 4, 26, 12, 33, 47, 28, 53, 31, 13, 59, 41, 27, 49, 26, 54, 45, 16, 53, 21, 35, 7, 59, 26, 11, 56, 1, 24, 33, 4, 28, 62, 21, 49, 31, 2, 56, 39, 24, 58, 13, 17, 37, 21, 56, 10, 38, 0, 34, 55, 15, 43, 1, 52 }, \ { 42, 9, 50, 6, 25, 60, 14, 38, 10, 29, 53, 18, 57, 3, 25, 51, 0, 53, 25, 17, 29, 37, 52, 46, 0, 62, 14, 37, 4, 50, 10, 44, 0, 46, 20, 25, 50, 19, 55, 0, 23, 31, 62, 34, 11, 45, 19, 32, 0, 53, 10, 59, 23, 47, 18, 60, 42, 28, 37, 3, 50, 15, 35, 44, 0, 51, 27, 60, 9, 57, 16, 58, 11, 22, 46, 15, 53, 48, 7, 42, 0, 60, 5, 49, 24, 54, 9, 17, 39, 5, 34, 62, 3, 40, 60, 31, 0, 47, 29, 16, 49, 39, 59, 17, 50, 0, 40, 13, 53, 38, 16, 46, 0, 42, 34, 60, 2, 53, 29, 31, 58, 46, 27, 6, 61, 8, 37, 28 }, \ { 0, 63, 21, 40, 45, 18, 51, 23, 63, 34, 6, 43, 28, 38, 55, 19, 40, 35, 8, 41, 54, 10, 21, 32, 39, 23, 53, 26, 55, 28, 22, 63, 30, 34, 9, 48, 6, 38, 29, 43, 49, 6, 18, 52, 27, 61, 9, 43, 28, 42, 33, 26, 56, 3, 51, 23, 0, 48, 16, 45, 32, 25, 63, 20, 57, 17, 42, 12, 35, 47, 5, 31, 39, 56, 6, 30, 34, 21, 61, 25, 14, 40, 22, 38, 15, 6, 36, 56, 20, 60, 25, 12, 51, 27, 10, 56, 42, 20, 36, 63, 32, 6, 21, 41, 12, 34, 60, 26, 5, 48, 27, 10, 62, 19, 6, 47, 39, 14, 45, 7, 24, 17, 41, 32, 23, 51, 19, 56 }, \ { 45, 31, 15, 59, 4, 33, 7, 47, 0, 41, 13, 61, 4, 47, 9, 23, 60, 14, 57, 31, 4, 45, 59, 6, 58, 10, 44, 20, 8, 42, 15, 6, 55, 17, 58, 31, 53, 12, 61, 10, 15, 57, 43, 2, 23, 35, 48, 14, 54, 6, 18, 49, 15, 38, 11, 34, 62, 9, 21, 58, 11, 41, 4, 31, 38, 8, 29, 55, 19, 36, 27, 52, 0, 25, 50, 43, 1, 39, 8, 55, 35, 51, 10, 30, 45, 62, 29, 2, 46, 10, 32, 48, 18, 38, 5, 22, 33, 8, 51, 3, 14, 44, 54, 25, 57, 30, 18, 52, 33, 22, 59, 28, 36, 52, 32, 21, 26, 50, 5, 55, 35, 60, 14, 54, 4, 40, 16, 33 }, \ { 27, 3, 49, 10, 30, 40, 55, 27, 57, 24, 52, 21, 32, 17, 60, 30, 5, 44, 27, 49, 19, 34, 13, 24, 43, 36, 3, 49, 31, 59, 37, 48, 26, 41, 2, 41, 14, 36, 21, 32, 40, 26, 13, 49, 55, 5, 16, 40, 25, 60, 36, 1, 63, 29, 17, 44, 25, 40, 52, 5, 29, 47, 54, 13, 46, 24, 60, 4, 51, 22, 63, 14, 45, 18, 12, 62, 17, 57, 19, 42, 3, 26, 58, 48, 1, 21, 40, 52, 23, 37, 44, 1, 29, 58, 43, 50, 15, 61, 19, 45, 58, 28, 7, 48, 2, 46, 8, 42, 3, 55, 8, 50, 12, 4, 55, 10, 63, 33, 20, 40, 11, 3, 46, 20, 48, 26, 61, 11 }, \ { 44, 56, 24, 36, 53, 19, 12, 37, 16, 44, 7, 36, 49, 54, 11, 37, 48, 21, 15, 1, 62, 25, 47, 56, 16, 18, 51, 12, 40, 1, 24, 11, 52, 16, 23, 59, 28, 1, 45, 53, 4, 60, 37, 21, 39, 30, 63, 20, 52, 10, 30, 45, 8, 41, 54, 4, 57, 7, 34, 55, 36, 18, 23, 59, 2, 48, 11, 32, 44, 1, 41, 8, 33, 54, 38, 23, 30, 46, 6, 29, 62, 18, 32, 16, 55, 34, 14, 11, 61, 7, 55, 16, 53, 13, 23, 2, 55, 37, 26, 10, 33, 23, 36, 16, 38, 22, 56, 15, 24, 43, 35, 17, 44, 40, 25, 46, 16, 1, 57, 25, 49, 36, 28, 62, 9, 35, 7, 53 }, \ { 17, 38, 8, 61, 1, 50, 26, 62, 3, 31, 56, 15, 1, 26, 40, 2, 34, 51, 56, 36, 42, 9, 38, 2, 29, 60, 32, 57, 19, 62, 34, 47, 4, 57, 39, 7, 44, 63, 24, 18, 46, 28, 8, 54, 1, 34, 7, 46, 3, 37, 50, 23, 57, 21, 13, 46, 31, 20, 43, 15, 1, 61, 8, 33, 37, 17, 56, 26, 15, 49, 24, 59, 28, 3, 56, 9, 52, 32, 13, 49, 10, 43, 5, 45, 8, 25, 59, 42, 28, 33, 19, 40, 8, 63, 35, 47, 25, 4, 40, 52, 1, 60, 12, 53, 63, 9, 29, 60, 37, 19, 1, 62, 31, 20, 58, 12, 41, 30, 43, 9, 18, 52, 22, 1, 39, 30, 58, 21 }, \ { 13, 47, 29, 18, 43, 34, 5, 48, 20, 42, 10, 45, 30, 58, 20, 63, 24, 11, 6, 28, 54, 14, 22, 52, 41, 7, 26, 5, 45, 15, 53, 13, 35, 27, 18, 50, 12, 33, 5, 56, 10, 17, 45, 24, 59, 15, 50, 26, 56, 13, 19, 5, 32, 52, 27, 36, 2, 61, 12, 26, 49, 40, 27, 52, 13, 50, 6, 39, 61, 34, 10, 37, 48, 20, 41, 27, 2, 36, 59, 24, 54, 33, 63, 20, 38, 50, 3, 17, 52, 4, 58, 27, 45, 21, 32, 11, 48, 17, 57, 20, 46, 38, 25, 43, 4, 34, 51, 6, 13, 45, 57, 26, 6, 48, 2, 35, 53, 23, 61, 34, 59, 6, 42, 56, 13, 51, 2, 41 }, \ { 32, 5, 55, 23, 58, 14, 22, 52, 29, 15, 61, 25, 51, 8, 43, 13, 53, 41, 46, 20, 3, 33, 63, 11, 48, 21, 54, 38, 28, 3, 30, 43, 21, 62, 9, 31, 55, 22, 51, 29, 37, 62, 32, 12, 42, 29, 41, 9, 33, 44, 62, 28, 43, 1, 59, 19, 48, 30, 51, 39, 24, 4, 58, 19, 42, 29, 22, 43, 3, 18, 53, 5, 13, 50, 16, 60, 45, 21, 7, 40, 15, 0, 26, 53, 13, 31, 43, 24, 47, 31, 15, 49, 2, 41, 6, 59, 29, 42, 9, 30, 14, 7, 49, 18, 31, 47, 20, 39, 49, 32, 11, 41, 54, 15, 61, 18, 7, 38, 4, 13, 44, 28, 15, 32, 45, 19, 27, 49 }, \ { 63, 34, 11, 39, 2, 45, 37, 8, 59, 39, 33, 4, 36, 17, 48, 5, 29, 18, 32, 61, 39, 50, 5, 27, 35, 0, 46, 12, 22, 49, 60, 6, 54, 0, 38, 49, 2, 42, 15, 40, 0, 47, 20, 51, 3, 57, 18, 61, 22, 0, 39, 16, 55, 12, 35, 8, 41, 22, 6, 59, 16, 45, 10, 36, 0, 62, 9, 54, 30, 58, 21, 43, 63, 31, 7, 35, 12, 48, 58, 28, 47, 37, 41, 9, 57, 20, 61, 0, 36, 11, 57, 35, 23, 52, 37, 18, 0, 62, 22, 55, 35, 62, 27, 54, 0, 15, 61, 28, 2, 59, 22, 9, 37, 27, 33, 51, 29, 48, 19, 50, 25, 37, 10, 57, 5, 37, 60, 8 }, \ { 20, 25, 46, 52, 31, 60, 12, 55, 0, 19, 11, 46, 62, 35, 23, 38, 57, 0, 55, 10, 16, 30, 58, 44, 17, 59, 29, 63, 42, 8, 36, 20, 33, 46, 16, 61, 25, 35, 8, 54, 26, 7, 58, 22, 34, 6, 47, 14, 53, 31, 48, 9, 37, 25, 49, 63, 16, 55, 45, 14, 34, 63, 21, 53, 25, 33, 46, 16, 35, 7, 46, 29, 0, 39, 25, 55, 22, 34, 18, 4, 56, 11, 23, 51, 28, 6, 39, 14, 62, 44, 19, 8, 60, 12, 56, 28, 50, 34, 39, 5, 51, 3, 41, 12, 57, 35, 10, 53, 25, 17, 52, 30, 47, 0, 43, 14, 5, 57, 31, 55, 0, 63, 47, 23, 54, 24, 14, 43 }, \ { 0, 57, 16, 6, 26, 19, 35, 28, 49, 42, 54, 26, 21, 1, 59, 27, 9, 47, 26, 44, 50, 22, 13, 40, 8, 37, 10, 34, 17, 56, 25, 58, 13, 27, 44, 9, 20, 58, 31, 17, 60, 36, 10, 41, 53, 25, 36, 39, 4, 24, 58, 17, 60, 4, 22, 38, 10, 32, 0, 50, 31, 7, 28, 47, 12, 57, 5, 26, 52, 23, 14, 40, 57, 17, 47, 5, 53, 1, 44, 31, 19, 60, 46, 2, 35, 48, 30, 54, 22, 5, 51, 39, 25, 31, 4, 43, 14, 9, 45, 16, 24, 44, 19, 29, 40, 23, 44, 7, 38, 42, 4, 63, 12, 54, 23, 59, 22, 42, 8, 15, 40, 21, 8, 34, 3, 41, 30, 50 }, \ { 39, 10, 48, 33, 41, 54, 5, 47, 23, 13, 32, 7, 52, 44, 14, 39, 58, 18, 35, 6, 37, 2, 60, 24, 55, 19, 53, 2, 51, 32, 1, 41, 51, 4, 40, 29, 47, 3, 52, 44, 13, 49, 28, 16, 1, 62, 11, 27, 52, 35, 5, 42, 29, 47, 14, 56, 28, 53, 26, 38, 9, 56, 40, 3, 38, 15, 41, 60, 1, 37, 50, 25, 11, 28, 61, 19, 42, 62, 10, 52, 39, 6, 32, 14, 58, 17, 7, 26, 42, 34, 27, 10, 54, 40, 20, 63, 26, 53, 21, 61, 32, 7, 59, 48, 3, 56, 18, 31, 58, 14, 49, 21, 36, 16, 45, 9, 36, 24, 62, 45, 27, 31, 53, 17, 49, 12, 62, 18 }, \ { 28, 59, 21, 58, 2, 16, 38, 9, 62, 3, 56, 41, 10, 31, 50, 4, 32, 52, 12, 63, 23, 46, 33, 31, 4, 48, 25, 43, 14, 23, 47, 11, 22, 55, 14, 60, 23, 37, 11, 39, 23, 2, 45, 56, 31, 43, 19, 55, 16, 46, 21, 51, 11, 33, 44, 2, 41, 18, 5, 52, 23, 44, 17, 60, 27, 49, 11, 32, 44, 10, 54, 2, 56, 33, 8, 38, 13, 29, 36, 16, 24, 63, 27, 51, 21, 43, 56, 12, 49, 3, 59, 48, 1, 15, 46, 7, 36, 2, 47, 11, 50, 27, 37, 13, 33, 8, 51, 46, 1, 34, 28, 40, 3, 33, 60, 29, 47, 1, 35, 11, 59, 42, 2, 60, 26, 46, 6, 35 }, \ { 4, 43, 9, 29, 36, 63, 24, 44, 20, 50, 30, 17, 60, 22, 16, 43, 25, 3, 42, 19, 51, 15, 8, 54, 42, 15, 61, 5, 39, 57, 18, 61, 31, 48, 34, 2, 50, 19, 57, 5, 63, 33, 19, 38, 13, 27, 48, 7, 32, 61, 2, 26, 58, 6, 24, 50, 13, 61, 42, 20, 62, 2, 35, 20, 51, 4, 62, 18, 23, 58, 20, 31, 43, 15, 51, 45, 26, 50, 4, 55, 45, 3, 35, 9, 38, 1, 32, 61, 20, 45, 17, 33, 24, 57, 29, 51, 22, 58, 38, 30, 15, 1, 54, 21, 63, 43, 26, 12, 24, 56, 8, 60, 50, 19, 5, 52, 13, 54, 17, 50, 4, 16, 36, 12, 32, 56, 22, 54 }, \ { 51, 25, 40, 53, 12, 49, 15, 57, 34, 7, 38, 47, 2, 36, 55, 8, 61, 30, 56, 7, 28, 59, 48, 11, 27, 35, 21, 45, 28, 36, 9, 38, 6, 16, 24, 63, 10, 32, 28, 43, 21, 53, 5, 60, 8, 57, 3, 45, 11, 37, 15, 54, 40, 20, 62, 36, 27, 34, 11, 48, 30, 15, 54, 8, 30, 42, 22, 34, 48, 13, 35, 63, 4, 37, 22, 2, 59, 9, 41, 23, 13, 41, 49, 18, 59, 24, 40, 5, 37, 30, 9, 61, 44, 6, 37, 11, 33, 17, 5, 55, 41, 60, 23, 39, 17, 5, 30, 62, 41, 16, 46, 25, 11, 56, 39, 26, 20, 38, 29, 39, 22, 52, 44, 20, 48, 1, 38, 14 }, \ { 15, 33, 2, 18, 44, 6, 27, 0, 32, 61, 25, 12, 58, 28, 40, 20, 47, 13, 34, 43, 38, 1, 23, 62, 40, 0, 51, 10, 63, 3, 52, 26, 44, 30, 45, 6, 41, 54, 0, 51, 12, 30, 46, 24, 49, 22, 40, 33, 63, 23, 43, 30, 9, 47, 0, 17, 54, 7, 57, 3, 37, 47, 24, 46, 13, 55, 7, 52, 2, 42, 6, 26, 49, 18, 60, 34, 16, 57, 33, 20, 61, 30, 8, 54, 14, 46, 12, 53, 16, 55, 38, 13, 22, 53, 18, 59, 46, 27, 43, 19, 32, 10, 45, 6, 49, 36, 52, 2, 20, 55, 6, 39, 32, 15, 44, 3, 58, 10, 63, 6, 56, 30, 7, 58, 9, 40, 19, 63 }, \ { 10, 47, 61, 23, 55, 31, 52, 42, 17, 45, 4, 51, 27, 6, 15, 53, 0, 49, 26, 10, 56, 18, 36, 6, 20, 58, 32, 30, 13, 49, 19, 56, 0, 59, 12, 53, 27, 17, 38, 25, 48, 9, 15, 36, 14, 30, 59, 17, 0, 50, 8, 58, 18, 56, 31, 45, 21, 41, 29, 19, 60, 6, 32, 59, 0, 36, 29, 39, 19, 59, 46, 12, 55, 30, 10, 47, 24, 3, 28, 48, 0, 55, 44, 27, 33, 4, 63, 29, 49, 0, 26, 50, 34, 2, 42, 14, 0, 62, 9, 56, 3, 52, 28, 34, 58, 9, 20, 48, 37, 32, 22, 53, 0, 62, 27, 49, 34, 46, 21, 33, 41, 14, 25, 37, 53, 29, 31, 45 }, \ { 56, 28, 7, 37, 11, 36, 20, 9, 54, 14, 39, 19, 34, 63, 45, 37, 24, 17, 60, 31, 21, 45, 53, 29, 47, 15, 7, 55, 40, 23, 34, 14, 42, 20, 37, 35, 15, 59, 7, 62, 34, 40, 59, 1, 51, 42, 10, 28, 54, 21, 35, 5, 38, 13, 36, 4, 59, 12, 39, 53, 15, 43, 9, 21, 39, 62, 16, 56, 25, 9, 32, 38, 0, 41, 14, 51, 40, 53, 43, 11, 37, 17, 5, 22, 57, 39, 19, 7, 42, 21, 60, 10, 31, 63, 25, 52, 30, 49, 36, 25, 48, 17, 61, 14, 22, 42, 29, 13, 60, 11, 47, 18, 35, 41, 7, 23, 4, 16, 51, 11, 0, 48, 61, 3, 17, 50, 5, 24 }, \ { 0, 42, 21, 49, 60, 3, 57, 40, 29, 48, 23, 56, 42, 11, 22, 5, 59, 39, 4, 50, 3, 41, 12, 57, 25, 50, 44, 18, 4, 46, 7, 62, 33, 50, 4, 56, 21, 32, 43, 18, 3, 23, 55, 34, 20, 4, 53, 38, 12, 46, 29, 52, 25, 61, 23, 51, 26, 46, 1, 34, 25, 57, 28, 51, 26, 11, 50, 3, 44, 28, 53, 21, 57, 27, 62, 6, 31, 19, 8, 63, 26, 59, 36, 47, 15, 29, 50, 25, 35, 47, 18, 41, 4, 48, 8, 40, 12, 23, 6, 44, 13, 40, 1, 31, 55, 0, 61, 43, 4, 50, 26, 58, 9, 53, 24, 61, 42, 55, 31, 43, 57, 20, 34, 27, 43, 8, 59, 39 }, \ { 18, 51, 30, 13, 26, 16, 46, 22, 2, 59, 8, 30, 1, 48, 33, 51, 29, 9, 46, 16, 62, 14, 33, 2, 38, 9, 27, 60, 37, 26, 53, 17, 28, 10, 24, 46, 2, 49, 8, 57, 29, 45, 6, 26, 62, 44, 18, 25, 61, 3, 42, 14, 49, 10, 43, 6, 17, 32, 63, 10, 49, 4, 40, 14, 45, 33, 22, 37, 12, 61, 5, 17, 43, 7, 23, 37, 15, 58, 49, 13, 39, 21, 10, 52, 1, 62, 9, 56, 12, 2, 58, 28, 36, 16, 56, 28, 56, 35, 20, 63, 24, 37, 51, 8, 45, 25, 16, 33, 27, 38, 2, 44, 13, 30, 17, 36, 12, 26, 5, 18, 28, 47, 13, 60, 23, 45, 13, 33 }, \ { 55, 4, 62, 34, 52, 38, 7, 63, 32, 37, 13, 53, 25, 62, 18, 12, 55, 41, 27, 35, 24, 49, 31, 52, 17, 63, 34, 1, 56, 12, 41, 2, 48, 58, 39, 16, 61, 27, 41, 52, 13, 19, 50, 39, 11, 31, 57, 6, 32, 40, 20, 55, 1, 28, 33, 57, 48, 8, 37, 22, 44, 18, 53, 1, 61, 5, 54, 16, 47, 36, 50, 24, 55, 34, 48, 45, 1, 30, 33, 46, 2, 50, 32, 42, 25, 34, 43, 21, 38, 52, 23, 45, 14, 54, 21, 4, 44, 16, 53, 29, 10, 47, 19, 57, 12, 54, 39, 10, 51, 15, 63, 21, 57, 40, 51, 1, 48, 57, 37, 62, 2, 38, 9, 52, 1, 35, 58, 22 }, \ { 36, 46, 10, 42, 1, 27, 43, 15, 50, 21, 45, 16, 41, 3, 35, 44, 20, 1, 57, 11, 55, 7, 43, 8, 22, 42, 13, 46, 21, 39, 31, 60, 22, 5, 29, 44, 11, 35, 20, 4, 36, 58, 32, 15, 47, 2, 36, 48, 16, 60, 8, 35, 44, 63, 16, 2, 40, 26, 55, 14, 58, 35, 24, 31, 19, 42, 31, 58, 1, 29, 10, 40, 2, 19, 12, 54, 22, 61, 7, 24, 56, 5, 28, 16, 54, 3, 15, 58, 6, 30, 8, 62, 1, 43, 31, 47, 7, 59, 1, 38, 58, 4, 34, 27, 38, 5, 31, 59, 7, 46, 30, 3, 34, 6, 28, 59, 20, 8, 32, 15, 53, 24, 55, 31, 19, 49, 11, 26 }, \ { 2, 24, 16, 58, 19, 55, 5, 35, 10, 61, 4, 28, 57, 24, 58, 7, 31, 47, 22, 38, 19, 28, 61, 36, 54, 5, 59, 29, 6, 52, 15, 11, 43, 36, 8, 54, 52, 1, 62, 25, 47, 9, 1, 60, 28, 53, 24, 14, 46, 27, 51, 22, 12, 24, 38, 53, 20, 11, 51, 3, 29, 7, 48, 63, 8, 49, 9, 21, 52, 14, 63, 32, 46, 60, 35, 4, 41, 16, 52, 35, 18, 42, 59, 7, 36, 61, 45, 27, 33, 51, 19, 39, 34, 11, 61, 18, 33, 41, 28, 15, 54, 22, 42, 3, 49, 21, 47, 18, 36, 23, 55, 19, 48, 24, 45, 10, 33, 44, 50, 40, 7, 35, 15, 41, 63, 6, 40, 54 }, \ { 62, 41, 32, 8, 47, 28, 60, 24, 44, 30, 38, 49, 9, 33, 14, 40, 50, 14, 60, 2, 54, 40, 0, 20, 25, 39, 16, 49, 24, 35, 57, 47, 19, 61, 33, 18, 23, 37, 13, 55, 31, 43, 22, 41, 17, 8, 42, 58, 0, 37, 5, 56, 31, 54, 7, 30, 60, 33, 42, 17, 59, 39, 12, 27, 38, 17, 35, 41, 27, 45, 20, 7, 25, 15, 29, 58, 27, 47, 11, 40, 14, 54, 23, 46, 19, 31, 11, 40, 13, 49, 5, 58, 24, 51, 26, 6, 50, 20, 49, 9, 32, 46, 17, 60, 14, 63, 24, 1, 57, 41, 9, 43, 14, 62, 16, 52, 3, 27, 14, 22, 61, 45, 4, 28, 9, 47, 29, 17 }, \ { 5, 50, 12, 53, 38, 18, 11, 51, 0, 55, 17, 6, 47, 54, 19, 63, 5, 26, 34, 45, 13, 30, 47, 58, 10, 48, 32, 3, 62, 9, 26, 0, 25, 14, 50, 3, 47, 30, 42, 16, 6, 63, 12, 49, 33, 55, 21, 10, 34, 63, 18, 41, 3, 47, 19, 43, 0, 49, 8, 28, 46, 20, 52, 0, 56, 24, 60, 3, 59, 5, 39, 57, 48, 52, 9, 38, 3, 21, 26, 60, 0, 32, 12, 38, 4, 48, 53, 0, 60, 15, 29, 44, 18, 10, 38, 57, 13, 60, 2, 26, 62, 7, 50, 29, 35, 8, 40, 53, 28, 12, 60, 33, 38, 5, 37, 29, 60, 39, 56, 0, 30, 18, 50, 34, 59, 25, 14, 44 }, \ { 20, 31, 60, 22, 3, 49, 33, 25, 40, 13, 34, 59, 22, 36, 0, 28, 37, 56, 8, 18, 51, 16, 4, 45, 27, 12, 53, 42, 18, 44, 51, 31, 55, 40, 28, 58, 7, 60, 10, 51, 27, 37, 24, 56, 5, 26, 44, 29, 50, 23, 45, 11, 34, 15, 59, 27, 13, 23, 62, 37, 4, 57, 15, 32, 42, 6, 47, 11, 30, 43, 23, 13, 0, 36, 18, 44, 63, 51, 37, 29, 49, 20, 57, 27, 62, 9, 24, 35, 23, 53, 37, 3, 42, 55, 0, 36, 23, 39, 31, 43, 17, 37, 24, 11, 52, 43, 19, 32, 5, 50, 26, 0, 56, 21, 54, 11, 19, 6, 47, 25, 59, 42, 12, 54, 21, 3, 38, 57 }, \ { 48, 0, 35, 27, 44, 14, 59, 7, 57, 46, 26, 2, 42, 12, 52, 43, 10, 27, 53, 42, 32, 62, 37, 21, 34, 61, 7, 23, 36, 4, 38, 12, 41, 5, 17, 45, 22, 27, 39, 21, 59, 0, 45, 18, 39, 62, 3, 38, 14, 7, 54, 26, 61, 39, 9, 52, 45, 36, 18, 50, 10, 34, 44, 22, 50, 14, 36, 55, 17, 34, 53, 62, 33, 26, 56, 6, 31, 12, 6, 53, 9, 44, 2, 50, 20, 40, 55, 17, 47, 7, 26, 63, 22, 32, 48, 16, 46, 8, 52, 12, 57, 41, 0, 56, 25, 3, 61, 14, 45, 35, 18, 44, 12, 46, 23, 42, 32, 51, 35, 10, 17, 36, 23, 1, 45, 52, 32, 10 }, \ { 37, 15, 43, 8, 63, 39, 21, 31, 16, 37, 19, 62, 30, 46, 17, 60, 21, 48, 1, 23, 6, 25, 11, 56, 1, 40, 30, 58, 15, 54, 21, 59, 9, 63, 35, 56, 11, 51, 2, 46, 34, 14, 53, 7, 30, 11, 51, 19, 60, 40, 30, 1, 24, 50, 20, 32, 3, 56, 5, 25, 31, 13, 61, 2, 29, 60, 25, 20, 51, 2, 27, 8, 18, 42, 10, 45, 21, 34, 43, 17, 62, 29, 41, 14, 34, 6, 30, 43, 2, 57, 33, 13, 45, 12, 27, 62, 4, 55, 21, 35, 5, 27, 45, 33, 16, 47, 30, 54, 22, 10, 51, 27, 63, 7, 49, 1, 58, 22, 15, 43, 53, 7, 57, 39, 27, 12, 61, 24 }, \ { 56, 51, 26, 56, 19, 2, 41, 54, 5, 52, 9, 48, 6, 23, 39, 4, 32, 15, 63, 35, 59, 49, 43, 15, 52, 19, 50, 9, 46, 33, 1, 29, 48, 20, 32, 1, 38, 33, 19, 54, 9, 32, 24, 48, 58, 35, 16, 48, 4, 52, 13, 57, 33, 5, 45, 59, 15, 29, 41, 55, 47, 39, 23, 53, 9, 40, 4, 57, 10, 44, 48, 40, 50, 14, 61, 24, 55, 1, 59, 22, 33, 8, 51, 25, 58, 46, 11, 59, 20, 41, 17, 51, 6, 56, 35, 25, 42, 30, 15, 58, 48, 18, 61, 9, 58, 39, 13, 2, 37, 59, 40, 2, 31, 16, 34, 41, 8, 30, 62, 3, 29, 48, 33, 5, 63, 16, 41, 7 }, \ { 22, 4, 46, 11, 33, 51, 29, 10, 62, 24, 43, 27, 15, 58, 50, 25, 54, 44, 9, 38, 18, 3, 29, 57, 32, 5, 26, 43, 17, 61, 24, 52, 8, 42, 23, 53, 15, 61, 7, 28, 57, 43, 4, 40, 20, 2, 43, 25, 32, 35, 21, 43, 17, 48, 10, 22, 38, 54, 11, 21, 1, 58, 16, 30, 48, 18, 46, 32, 38, 13, 22, 4, 59, 35, 2, 51, 30, 39, 15, 47, 4, 56, 13, 37, 1, 28, 16, 52, 32, 9, 61, 29, 38, 19, 3, 52, 10, 48, 1, 32, 11, 40, 20, 36, 6, 22, 49, 29, 55, 6, 20, 56, 36, 52, 19, 60, 26, 46, 18, 54, 40, 13, 20, 46, 35, 19, 49, 29 }, \ { 61, 17, 34, 53, 23, 6, 48, 35, 20, 40, 1, 56, 36, 29, 11, 34, 7, 41, 14, 30, 55, 20, 46, 8, 24, 38, 63, 2, 37, 10, 45, 14, 34, 49, 6, 13, 44, 25, 49, 41, 21, 12, 61, 15, 54, 29, 63, 12, 56, 8, 49, 2, 62, 36, 28, 61, 0, 25, 41, 63, 35, 8, 44, 6, 37, 62, 7, 21, 63, 28, 55, 31, 16, 24, 41, 19, 9, 57, 27, 36, 18, 42, 31, 62, 22, 55, 38, 4, 27, 47, 1, 40, 14, 54, 43, 20, 60, 23, 38, 63, 25, 51, 2, 53, 26, 63, 10, 42, 17, 34, 47, 25, 13, 5, 44, 11, 55, 2, 38, 27, 6, 60, 52, 25, 9, 55, 1, 40 }, \ { 8, 30, 58, 3, 42, 61, 17, 38, 13, 59, 32, 10, 54, 3, 51, 20, 61, 26, 57, 2, 46, 33, 12, 60, 41, 13, 48, 29, 55, 20, 39, 27, 57, 18, 62, 29, 55, 2, 31, 16, 37, 50, 26, 36, 6, 46, 9, 41, 27, 57, 23, 39, 26, 6, 51, 12, 31, 46, 7, 16, 27, 52, 19, 56, 26, 12, 33, 53, 1, 41, 8, 57, 46, 7, 54, 32, 47, 5, 49, 11, 60, 23, 5, 48, 10, 43, 19, 63, 35, 24, 49, 21, 59, 5, 31, 37, 14, 44, 7, 42, 6, 30, 46, 13, 44, 32, 19, 50, 4, 58, 8, 30, 62, 38, 28, 53, 21, 36, 13, 50, 21, 33, 15, 2, 44, 31, 14, 47 }, \ { 37, 13, 39, 16, 28, 9, 57, 0, 25, 49, 21, 45, 18, 47, 12, 42, 0, 49, 22, 39, 16, 53, 25, 36, 0, 52, 22, 16, 6, 60, 4, 51, 0, 26, 37, 47, 10, 36, 63, 5, 57, 0, 18, 59, 23, 33, 51, 19, 0, 44, 15, 11, 54, 17, 42, 35, 53, 18, 58, 33, 49, 4, 34, 42, 0, 50, 43, 25, 16, 49, 34, 20, 37, 28, 12, 63, 16, 38, 25, 44, 0, 40, 52, 17, 35, 3, 50, 14, 8, 53, 11, 36, 25, 45, 9, 62, 0, 54, 28, 17, 50, 55, 15, 24, 57, 0, 53, 34, 23, 41, 15, 45, 0, 49, 16, 4, 48, 9, 63, 45, 0, 42, 58, 37, 61, 22, 54, 26 }, \ { 0, 50, 21, 47, 54, 36, 27, 45, 52, 4, 34, 15, 63, 29, 37, 59, 17, 31, 6, 61, 28, 5, 48, 18, 59, 27, 34, 56, 44, 31, 35, 12, 41, 59, 16, 3, 40, 20, 50, 22, 30, 40, 52, 10, 45, 3, 59, 22, 37, 61, 29, 46, 31, 58, 2, 22, 9, 43, 3, 39, 14, 61, 24, 54, 15, 29, 11, 60, 39, 17, 5, 61, 0, 44, 50, 3, 31, 14, 58, 21, 54, 28, 15, 45, 60, 26, 33, 58, 44, 22, 60, 2, 57, 34, 49, 27, 18, 34, 21, 59, 29, 4, 36, 41, 8, 39, 28, 11, 62, 26, 53, 20, 35, 24, 59, 32, 29, 39, 24, 31, 57, 23, 11, 28, 5, 36, 11, 59 }, \ { 44, 32, 63, 5, 20, 12, 41, 7, 30, 61, 42, 8, 39, 5, 33, 8, 24, 53, 45, 11, 37, 58, 7, 44, 10, 50, 3, 40, 8, 22, 53, 19, 46, 9, 33, 52, 24, 58, 8, 44, 13, 47, 8, 34, 38, 30, 14, 47, 7, 34, 4, 55, 9, 19, 40, 49, 56, 26, 60, 21, 30, 45, 10, 19, 40, 58, 23, 36, 3, 52, 45, 23, 54, 13, 22, 42, 53, 45, 7, 33, 10, 36, 57, 6, 29, 12, 41, 0, 30, 15, 41, 30, 17, 7, 16, 53, 40, 56, 2, 39, 12, 61, 10, 52, 31, 60, 16, 45, 1, 37, 7, 61, 40, 10, 43, 17, 58, 7, 54, 14, 4, 51, 39, 49, 18, 56, 42, 20 }, \ { 14, 6, 24, 36, 56, 49, 22, 60, 18, 14, 23, 51, 26, 57, 21, 52, 41, 14, 35, 50, 19, 31, 40, 23, 33, 14, 63, 17, 32, 47, 7, 62, 23, 30, 56, 11, 42, 27, 14, 60, 35, 19, 28, 61, 17, 55, 25, 39, 53, 17, 42, 21, 38, 63, 25, 5, 14, 36, 12, 50, 1, 37, 59, 32, 2, 51, 6, 56, 27, 32, 11, 30, 38, 26, 60, 8, 26, 19, 62, 39, 50, 2, 21, 39, 53, 23, 56, 19, 49, 39, 5, 46, 55, 23, 42, 4, 31, 11, 47, 26, 45, 22, 48, 18, 21, 5, 48, 25, 57, 14, 47, 30, 3, 56, 12, 50, 1, 42, 19, 47, 35, 17, 8, 30, 45, 25, 4, 51 }, \ { 28, 58, 43, 1, 31, 8, 33, 2, 44, 55, 32, 1, 60, 12, 46, 27, 4, 62, 23, 1, 56, 13, 62, 2, 54, 36, 25, 51, 1, 57, 26, 42, 3, 49, 17, 38, 1, 48, 31, 4, 54, 3, 50, 24, 1, 49, 5, 63, 13, 27, 52, 1, 48, 13, 45, 33, 52, 30, 46, 20, 55, 28, 6, 48, 24, 38, 20, 47, 14, 62, 48, 9, 58, 4, 36, 30, 56, 1, 34, 12, 18, 63, 25, 48, 4, 16, 37, 7, 62, 10, 52, 28, 13, 50, 36, 63, 24, 51, 15, 58, 8, 33, 1, 38, 56, 35, 42, 9, 33, 51, 22, 18, 48, 32, 27, 37, 23, 61, 33, 11, 59, 29, 62, 1, 53, 10, 60, 33 }, \ { 12, 39, 17, 52, 26, 46, 53, 38, 25, 11, 48, 36, 16, 43, 2, 35, 55, 17, 39, 29, 43, 9, 28, 45, 20, 5, 46, 12, 42, 28, 13, 52, 36, 6, 60, 22, 54, 17, 62, 39, 25, 42, 15, 55, 44, 20, 31, 10, 35, 57, 24, 32, 29, 6, 59, 18, 7, 62, 3, 41, 10, 44, 16, 54, 13, 62, 31, 9, 41, 1, 21, 43, 18, 47, 15, 40, 11, 49, 28, 55, 46, 30, 8, 43, 32, 61, 28, 47, 25, 34, 21, 61, 32, 1, 20, 9, 46, 6, 35, 19, 41, 54, 27, 63, 14, 3, 51, 20, 62, 2, 38, 55, 8, 21, 63, 6, 46, 9, 26, 51, 3, 24, 43, 34, 16, 41, 18, 48 }, \ { 62, 23, 55, 9, 15, 62, 19, 13, 58, 40, 6, 30, 54, 19, 50, 31, 10, 44, 6, 59, 21, 47, 51, 15, 60, 39, 30, 54, 21, 61, 19, 33, 14, 29, 43, 11, 34, 45, 7, 21, 10, 56, 36, 6, 38, 11, 58, 42, 2, 47, 11, 60, 50, 16, 41, 28, 38, 23, 47, 17, 35, 63, 22, 33, 42, 5, 45, 17, 53, 35, 25, 56, 33, 6, 51, 19, 60, 23, 43, 15, 5, 40, 58, 13, 51, 1, 45, 11, 54, 3, 43, 8, 37, 48, 59, 29, 39, 21, 61, 43, 3, 31, 10, 44, 24, 29, 60, 12, 28, 40, 11, 25, 43, 52, 14, 41, 16, 57, 44, 20, 40, 55, 12, 21, 57, 27, 35, 2 }, \ { 37, 6, 31, 42, 40, 4, 29, 50, 0, 20, 63, 28, 9, 58, 14, 24, 63, 26, 48, 16, 34, 4, 32, 38, 23, 11, 58, 4, 37, 9, 45, 5, 63, 48, 26, 57, 2, 28, 32, 51, 46, 29, 13, 62, 27, 46, 28, 18, 50, 15, 40, 4, 19, 34, 54, 0, 53, 9, 26, 58, 28, 5, 49, 0, 57, 27, 19, 60, 29, 8, 59, 12, 37, 63, 24, 46, 3, 37, 6, 52, 26, 32, 20, 36, 9, 22, 59, 18, 35, 51, 14, 57, 17, 24, 12, 44, 56, 0, 30, 13, 59, 20, 49, 17, 54, 43, 6, 34, 46, 17, 58, 36, 0, 34, 29, 54, 25, 2, 36, 15, 60, 6, 37, 46, 4, 50, 9, 45 }, \ { 19, 59, 48, 3, 24, 60, 44, 22, 34, 51, 15, 45, 41, 5, 33, 47, 0, 37, 12, 55, 25, 54, 8, 57, 0, 47, 18, 34, 49, 15, 55, 24, 40, 20, 8, 35, 53, 13, 41, 18, 0, 59, 22, 33, 4, 52, 8, 60, 24, 36, 31, 56, 45, 26, 10, 43, 15, 56, 36, 4, 51, 14, 39, 30, 12, 55, 36, 2, 39, 49, 4, 44, 17, 0, 32, 13, 53, 35, 59, 17, 62, 0, 55, 24, 52, 38, 31, 6, 42, 19, 29, 40, 4, 54, 33, 5, 16, 27, 52, 37, 23, 55, 7, 37, 0, 39, 23, 49, 4, 53, 31, 15, 59, 10, 50, 4, 60, 34, 48, 7, 31, 49, 27, 14, 62, 22, 53, 29 }, \ { 46, 21, 14, 51, 36, 17, 7, 57, 10, 32, 3, 37, 22, 60, 39, 18, 56, 20, 42, 3, 36, 10, 44, 26, 41, 29, 53, 27, 2, 39, 30, 52, 0, 59, 15, 48, 23, 61, 6, 58, 37, 12, 40, 49, 16, 39, 20, 44, 0, 62, 8, 21, 3, 59, 23, 32, 49, 31, 12, 44, 22, 59, 18, 50, 24, 7, 43, 52, 15, 23, 41, 26, 51, 28, 55, 39, 21, 27, 10, 42, 12, 45, 27, 47, 3, 15, 63, 26, 55, 0, 60, 26, 45, 18, 62, 38, 58, 49, 8, 47, 4, 33, 46, 29, 57, 13, 56, 16, 59, 21, 5, 47, 23, 39, 18, 44, 13, 22, 28, 53, 19, 0, 58, 32, 41, 7, 26, 13 }, \ { 0, 56, 34, 28, 11, 55, 31, 47, 26, 41, 56, 13, 53, 28, 11, 49, 7, 52, 32, 61, 50, 22, 63, 17, 13, 56, 7, 19, 43, 62, 10, 21, 37, 32, 43, 4, 38, 19, 44, 25, 31, 54, 5, 23, 61, 30, 53, 12, 35, 22, 43, 53, 37, 48, 7, 62, 20, 2, 61, 41, 8, 34, 47, 9, 63, 34, 28, 10, 55, 33, 14, 57, 7, 47, 9, 61, 4, 49, 31, 50, 21, 38, 8, 16, 57, 44, 33, 5, 49, 36, 12, 50, 7, 34, 10, 25, 2, 22, 36, 15, 26, 61, 18, 9, 22, 46, 32, 8, 27, 37, 44, 30, 55, 3, 62, 24, 38, 56, 5, 45, 38, 24, 43, 10, 19, 54, 39, 61 }, \ { 41, 30, 8, 63, 43, 23, 38, 3, 62, 19, 8, 49, 25, 1, 58, 30, 23, 40, 9, 28, 18, 40, 6, 38, 49, 22, 35, 59, 8, 27, 50, 5, 56, 17, 11, 50, 30, 9, 55, 2, 51, 19, 34, 47, 9, 41, 6, 26, 48, 57, 14, 28, 17, 12, 39, 13, 37, 46, 25, 19, 54, 27, 1, 37, 16, 45, 20, 60, 1, 48, 20, 38, 31, 22, 42, 15, 19, 44, 1, 61, 6, 34, 56, 40, 29, 10, 20, 46, 13, 22, 41, 23, 59, 42, 30, 51, 45, 13, 63, 53, 42, 12, 51, 38, 62, 2, 26, 41, 50, 1, 61, 10, 19, 42, 31, 8, 49, 32, 12, 63, 9, 52, 16, 56, 36, 2, 31, 16 }, \ { 52, 5, 47, 20, 1, 53, 12, 50, 16, 35, 43, 21, 33, 43, 16, 44, 3, 59, 14, 46, 1, 30, 60, 33, 2, 45, 12, 42, 31, 47, 14, 33, 46, 25, 55, 27, 60, 36, 16, 42, 14, 46, 26, 1, 55, 15, 63, 32, 2, 38, 5, 47, 33, 61, 30, 52, 4, 57, 6, 38, 11, 43, 61, 24, 52, 3, 31, 22, 42, 10, 62, 3, 59, 11, 35, 57, 33, 54, 24, 14, 29, 48, 18, 2, 60, 41, 53, 24, 32, 62, 3, 53, 15, 1, 55, 17, 32, 40, 6, 31, 1, 40, 28, 5, 35, 52, 19, 63, 13, 33, 17, 41, 52, 26, 15, 57, 1, 20, 42, 17, 35, 27, 48, 5, 25, 50, 44, 11 }, \ { 35, 25, 38, 57, 33, 17, 40, 6, 59, 27, 54, 5, 61, 10, 52, 26, 36, 19, 51, 35, 57, 48, 11, 20, 54, 25, 61, 16, 1, 58, 24, 61, 3, 39, 7, 47, 1, 22, 49, 28, 63, 10, 58, 32, 17, 36, 45, 19, 51, 29, 59, 10, 50, 1, 23, 42, 18, 29, 51, 21, 56, 32, 14, 5, 40, 58, 47, 13, 54, 35, 29, 45, 18, 52, 26, 2, 38, 8, 46, 36, 58, 11, 52, 35, 17, 28, 1, 58, 9, 39, 17, 28, 37, 48, 20, 9, 57, 24, 50, 19, 58, 16, 48, 25, 43, 11, 35, 6, 45, 24, 56, 4, 36, 7, 47, 35, 52, 28, 59, 30, 2, 61, 21, 33, 63, 12, 18, 59 }, \ { 3, 49, 15, 10, 27, 61, 25, 45, 30, 0, 14, 47, 31, 38, 17, 62, 7, 55, 27, 4, 15, 24, 42, 52, 10, 34, 5, 51, 36, 18, 41, 11, 35, 21, 62, 13, 33, 57, 8, 35, 5, 40, 21, 43, 52, 3, 24, 56, 11, 16, 33, 25, 41, 20, 55, 8, 60, 35, 15, 48, 2, 57, 30, 49, 18, 25, 6, 39, 17, 57, 7, 25, 43, 5, 49, 16, 62, 22, 55, 4, 25, 43, 23, 7, 50, 11, 37, 48, 14, 51, 33, 57, 7, 27, 39, 46, 4, 29, 11, 43, 34, 56, 7, 60, 20, 54, 30, 57, 22, 49, 9, 33, 54, 14, 63, 23, 6, 43, 10, 40, 50, 13, 44, 8, 38, 33, 46, 23 }, \ { 55, 39, 22, 50, 44, 4, 36, 9, 52, 23, 37, 59, 21, 2, 46, 13, 31, 41, 11, 45, 62, 29, 6, 37, 19, 48, 30, 23, 44, 7, 53, 28, 54, 16, 41, 29, 44, 18, 52, 24, 60, 15, 48, 7, 27, 59, 9, 34, 42, 54, 7, 63, 4, 46, 31, 27, 45, 0, 40, 26, 34, 17, 37, 10, 53, 29, 36, 50, 2, 27, 51, 11, 61, 37, 23, 41, 30, 7, 18, 50, 39, 14, 63, 32, 45, 61, 19, 30, 25, 44, 2, 47, 23, 63, 11, 34, 59, 37, 60, 3, 22, 14, 44, 30, 15, 0, 47, 15, 3, 38, 61, 20, 27, 45, 11, 39, 51, 16, 55, 3, 22, 54, 29, 58, 1, 57, 6, 29 }, \ { 9, 17, 60, 2, 34, 56, 20, 62, 39, 12, 49, 6, 29, 56, 34, 48, 0, 58, 22, 38, 18, 43, 56, 0, 63, 14, 55, 3, 59, 31, 15, 45, 0, 49, 6, 58, 3, 38, 12, 45, 0, 37, 29, 57, 13, 39, 30, 49, 0, 23, 44, 36, 16, 57, 13, 54, 11, 24, 63, 9, 53, 7, 62, 42, 0, 59, 15, 23, 63, 34, 40, 16, 32, 0, 53, 12, 48, 28, 59, 33, 0, 53, 9, 27, 3, 22, 54, 5, 56, 9, 61, 13, 42, 14, 52, 19, 0, 21, 47, 27, 53, 36, 3, 50, 39, 58, 25, 40, 53, 28, 12, 50, 0, 59, 32, 2, 21, 34, 26, 46, 37, 7, 18, 47, 24, 14, 53, 42 }, \ { 61, 32, 13, 54, 29, 7, 46, 13, 28, 57, 18, 41, 53, 15, 9, 39, 24, 49, 33, 3, 53, 9, 26, 32, 40, 28, 46, 39, 25, 9, 56, 21, 63, 37, 26, 22, 51, 27, 17, 56, 31, 53, 4, 43, 22, 46, 12, 18, 60, 40, 20, 26, 50, 21, 39, 5, 49, 33, 16, 44, 22, 46, 20, 32, 24, 45, 8, 43, 12, 46, 4, 48, 56, 20, 29, 58, 3, 40, 10, 42, 31, 21, 47, 41, 56, 38, 15, 42, 36, 27, 20, 33, 55, 3, 26, 44, 31, 54, 12, 35, 9, 63, 28, 10, 21, 32, 9, 60, 17, 8, 43, 29, 40, 16, 36, 48, 60, 7, 57, 14, 62, 31, 42, 15, 36, 40, 20, 26 }, \ { 0, 37, 47, 23, 41, 18, 32, 48, 1, 35, 8, 25, 4, 26, 63, 20, 54, 8, 16, 61, 35, 23, 51, 15, 58, 7, 12, 20, 50, 34, 42, 4, 38, 10, 32, 47, 8, 60, 41, 20, 9, 25, 50, 19, 62, 1, 37, 56, 28, 8, 53, 11, 3, 58, 34, 43, 19, 60, 38, 4, 58, 31, 3, 51, 11, 55, 38, 30, 21, 58, 19, 26, 9, 44, 36, 13, 46, 20, 62, 24, 13, 60, 5, 28, 12, 34, 7, 59, 0, 53, 45, 6, 38, 30, 50, 7, 62, 16, 41, 5, 46, 18, 55, 42, 51, 5, 45, 23, 34, 48, 19, 58, 5, 25, 54, 19, 13, 41, 28, 21, 0, 49, 10, 60, 4, 51, 9, 45 }, \ { 19, 28, 6, 58, 10, 51, 4, 22, 55, 42, 60, 45, 34, 51, 42, 5, 30, 45, 27, 40, 13, 47, 4, 49, 21, 38, 60, 29, 2, 57, 17, 27, 52, 19, 61, 14, 30, 34, 2, 44, 63, 33, 11, 35, 16, 51, 25, 6, 14, 47, 31, 61, 37, 29, 18, 8, 52, 2, 28, 54, 13, 41, 15, 62, 35, 18, 2, 60, 6, 33, 41, 61, 31, 6, 56, 17, 34, 50, 6, 52, 44, 35, 16, 51, 59, 24, 48, 18, 31, 40, 16, 49, 21, 60, 17, 39, 10, 49, 32, 57, 24, 39, 1, 25, 18, 62, 37, 12, 56, 1, 37, 11, 52, 44, 9, 30, 47, 4, 51, 40, 55, 25, 34, 27, 56, 30, 32, 54 }, \ { 63, 40, 49, 15, 43, 26, 63, 38, 16, 20, 30, 12, 57, 14, 19, 60, 36, 12, 59, 2, 57, 17, 42, 31, 1, 44, 16, 35, 47, 11, 32, 48, 13, 43, 1, 39, 51, 12, 57, 23, 6, 40, 53, 3, 55, 31, 39, 60, 35, 44, 5, 15, 45, 1, 62, 41, 26, 14, 47, 22, 36, 27, 50, 9, 26, 47, 52, 28, 54, 16, 1, 13, 51, 39, 23, 63, 1, 30, 15, 26, 2, 57, 19, 37, 1, 44, 21, 50, 13, 63, 8, 24, 56, 1, 35, 25, 58, 20, 2, 28, 14, 51, 33, 59, 13, 30, 4, 49, 31, 24, 63, 26, 33, 3, 58, 38, 62, 24, 32, 8, 17, 45, 5, 48, 18, 3, 43, 11 }, \ { 21, 4, 24, 34, 59, 1, 37, 11, 53, 5, 47, 2, 22, 40, 32, 1, 24, 50, 21, 29, 38, 25, 63, 8, 55, 24, 53, 6, 62, 23, 59, 3, 54, 20, 58, 24, 5, 46, 15, 38, 48, 14, 27, 42, 23, 7, 46, 10, 17, 58, 25, 52, 23, 32, 49, 12, 55, 30, 40, 7, 59, 1, 56, 21, 39, 4, 23, 15, 37, 46, 55, 42, 21, 4, 48, 8, 45, 54, 37, 55, 32, 8, 46, 10, 30, 54, 4, 41, 25, 29, 36, 48, 11, 43, 14, 47, 5, 43, 53, 36, 61, 10, 45, 6, 41, 54, 27, 43, 16, 55, 6, 46, 18, 42, 23, 15, 1, 45, 12, 60, 37, 22, 62, 12, 39, 59, 16, 52 }, \ { 47, 35, 56, 7, 19, 46, 31, 50, 33, 24, 61, 35, 50, 7, 53, 44, 55, 6, 46, 10, 52, 5, 21, 43, 36, 10, 18, 41, 26, 37, 8, 29, 40, 36, 9, 49, 34, 26, 61, 21, 7, 59, 18, 62, 29, 54, 20, 32, 51, 0, 40, 10, 55, 6, 20, 36, 9, 61, 5, 51, 44, 19, 33, 43, 13, 57, 40, 63, 8, 24, 29, 10, 60, 34, 27, 40, 25, 18, 10, 42, 21, 49, 26, 62, 38, 12, 33, 61, 5, 57, 2, 19, 54, 28, 62, 22, 38, 31, 16, 7, 22, 47, 29, 17, 35, 8, 20, 51, 2, 40, 22, 50, 13, 61, 28, 53, 35, 20, 56, 30, 2, 53, 14, 41, 23, 34, 8, 31 }, \ { 12, 2, 42, 29, 52, 13, 21, 8, 55, 14, 41, 17, 28, 58, 23, 11, 17, 36, 31, 62, 17, 34, 50, 14, 28, 61, 33, 52, 2, 51, 17, 45, 7, 25, 62, 30, 18, 55, 0, 42, 30, 35, 45, 1, 12, 48, 3, 63, 21, 36, 30, 48, 19, 59, 43, 27, 46, 17, 34, 25, 12, 29, 53, 6, 48, 31, 11, 34, 49, 3, 36, 50, 19, 47, 14, 61, 11, 36, 58, 4, 60, 14, 39, 22, 6, 52, 15, 35, 17, 46, 31, 42, 9, 34, 3, 52, 12, 60, 26, 56, 40, 2, 53, 23, 57, 38, 62, 14, 36, 59, 10, 31, 39, 6, 49, 9, 41, 26, 5, 48, 43, 27, 33, 58, 1, 50, 25, 57 }, \ { 61, 37, 15, 61, 3, 39, 58, 43, 26, 0, 44, 10, 47, 3, 37, 63, 28, 43, 13, 39, 3, 57, 30, 59, 0, 48, 5, 43, 13, 22, 60, 33, 55, 15, 42, 4, 52, 10, 45, 13, 54, 4, 24, 49, 37, 26, 41, 14, 42, 9, 61, 13, 38, 23, 3, 53, 0, 58, 21, 42, 63, 10, 17, 61, 25, 0, 58, 28, 17, 44, 57, 12, 27, 0, 55, 5, 52, 28, 23, 47, 29, 0, 43, 17, 58, 28, 47, 23, 55, 10, 58, 23, 51, 40, 18, 33, 45, 0, 49, 8, 32, 61, 19, 48, 0, 26, 7, 47, 29, 18, 44, 0, 56, 34, 20, 59, 15, 51, 37, 18, 10, 52, 7, 20, 46, 9, 38, 17 }, \ { 6, 27, 48, 23, 45, 29, 5, 18, 38, 62, 27, 56, 20, 32, 15, 9, 48, 0, 54, 22, 45, 20, 7, 41, 23, 39, 19, 27, 58, 31, 44, 0, 12, 50, 23, 56, 20, 39, 32, 59, 16, 52, 33, 9, 57, 22, 6, 58, 28, 50, 24, 2, 56, 35, 16, 45, 32, 38, 15, 54, 2, 38, 46, 22, 35, 45, 20, 5, 52, 25, 7, 35, 59, 32, 22, 43, 38, 3, 51, 16, 34, 53, 32, 50, 3, 40, 8, 43, 0, 39, 27, 4, 14, 61, 8, 55, 15, 41, 20, 44, 27, 13, 39, 11, 46, 42, 54, 33, 4, 52, 23, 61, 14, 25, 43, 2, 33, 11, 63, 29, 61, 17, 40, 55, 22, 62, 28, 44 }, \ { 20, 54, 8, 56, 35, 10, 63, 31, 52, 12, 48, 6, 59, 41, 52, 33, 19, 58, 25, 49, 11, 37, 47, 12, 54, 15, 56, 35, 7, 47, 16, 53, 28, 34, 5, 37, 28, 8, 48, 3, 28, 38, 18, 61, 16, 43, 53, 32, 4, 17, 47, 27, 44, 8, 63, 10, 25, 49, 6, 37, 24, 52, 32, 3, 50, 12, 41, 56, 38, 14, 62, 20, 40, 16, 53, 31, 18, 63, 41, 9, 59, 7, 13, 25, 57, 20, 63, 26, 53, 18, 48, 62, 30, 46, 21, 25, 58, 29, 36, 4, 55, 34, 6, 60, 31, 16, 21, 12, 58, 38, 9, 29, 47, 7, 52, 30, 57, 44, 22, 0, 35, 45, 3, 31, 14, 36, 0, 51 }, \ { 42, 14, 33, 24, 16, 49, 40, 2, 22, 33, 16, 36, 25, 1, 21, 61, 38, 8, 33, 4, 62, 26, 29, 60, 6, 46, 30, 11, 63, 4, 36, 40, 19, 57, 46, 11, 41, 63, 22, 25, 58, 10, 46, 2, 34, 27, 11, 38, 56, 34, 12, 53, 18, 33, 41, 51, 13, 28, 60, 20, 47, 14, 29, 59, 16, 62, 8, 22, 32, 47, 9, 49, 2, 44, 7, 12, 45, 6, 20, 27, 45, 24, 62, 42, 36, 11, 33, 15, 37, 7, 32, 10, 37, 1, 35, 50, 6, 11, 63, 24, 52, 15, 50, 24, 3, 37, 56, 27, 34, 22, 49, 16, 36, 62, 17, 39, 4, 15, 54, 24, 50, 8, 58, 26, 49, 54, 11, 30 }, \ { 4, 59, 41, 1, 53, 12, 25, 45, 59, 7, 51, 39, 54, 14, 46, 4, 27, 53, 16, 44, 18, 51, 1, 32, 25, 2, 50, 40, 20, 54, 24, 9, 62, 2, 27, 60, 1, 17, 36, 50, 6, 40, 30, 55, 41, 19, 49, 1, 21, 60, 40, 5, 62, 1, 22, 30, 57, 4, 43, 31, 1, 55, 40, 7, 27, 37, 30, 54, 1, 19, 42, 30, 56, 26, 62, 49, 24, 57, 37, 56, 2, 39, 16, 5, 30, 55, 3, 49, 60, 23, 56, 44, 17, 52, 13, 42, 28, 48, 18, 45, 9, 37, 21, 41, 58, 10, 48, 1, 63, 5, 41, 57, 2, 24, 12, 48, 27, 42, 32, 46, 13, 38, 19, 34, 5, 41, 25, 60 }, \ { 39, 28, 21, 46, 32, 57, 36, 9, 19, 42, 4, 29, 11, 43, 30, 49, 13, 42, 35, 56, 9, 39, 15, 52, 36, 61, 18, 26, 45, 14, 31, 48, 21, 43, 14, 33, 49, 54, 14, 44, 21, 62, 13, 23, 8, 62, 15, 51, 44, 7, 30, 37, 20, 42, 56, 7, 39, 18, 50, 11, 61, 9, 19, 43, 57, 2, 48, 11, 39, 60, 28, 4, 37, 17, 35, 1, 33, 11, 31, 14, 48, 19, 35, 51, 46, 21, 44, 29, 12, 41, 2, 22, 58, 26, 54, 4, 59, 38, 2, 33, 57, 1, 63, 13, 28, 51, 15, 40, 18, 45, 8, 30, 43, 37, 54, 19, 8, 59, 21, 6, 60, 29, 55, 10, 63, 15, 47, 17 }, \ { 3, 50, 10, 62, 18, 5, 27, 49, 60, 23, 55, 18, 62, 24, 56, 10, 59, 28, 2, 23, 34, 59, 43, 20, 10, 42, 8, 49, 1, 37, 57, 6, 51, 29, 53, 7, 23, 31, 5, 32, 51, 0, 35, 54, 45, 31, 5, 26, 36, 24, 55, 15, 48, 29, 14, 48, 26, 60, 21, 41, 36, 26, 50, 33, 14, 44, 17, 24, 52, 15, 46, 23, 54, 6, 47, 21, 60, 50, 4, 53, 29, 61, 8, 23, 1, 60, 19, 6, 53, 16, 47, 34, 6, 39, 16, 31, 12, 20, 53, 22, 30, 43, 25, 46, 35, 6, 44, 32, 53, 26, 55, 19, 11, 59, 5, 33, 51, 1, 35, 53, 25, 3, 42, 23, 44, 32, 7, 53 }, \ { 22, 44, 37, 6, 26, 51, 38, 0, 34, 13, 31, 46, 3, 37, 6, 19, 40, 21, 47, 63, 12, 5, 29, 55, 22, 58, 34, 28, 60, 22, 11, 41, 17, 38, 9, 44, 59, 39, 56, 19, 11, 47, 25, 15, 3, 39, 57, 17, 61, 11, 46, 3, 58, 9, 54, 35, 2, 34, 8, 45, 15, 56, 5, 23, 53, 33, 63, 35, 4, 59, 10, 51, 13, 61, 29, 41, 15, 25, 43, 19, 40, 10, 54, 33, 41, 12, 38, 51, 31, 26, 61, 9, 30, 45, 24, 62, 49, 40, 10, 61, 14, 49, 5, 17, 54, 20, 60, 23, 3, 13, 35, 50, 32, 23, 46, 27, 38, 63, 16, 12, 39, 48, 18, 51, 1, 27, 56, 35 }, \ { 63, 15, 30, 55, 43, 14, 57, 17, 53, 44, 7, 48, 26, 50, 32, 60, 0, 53, 14, 31, 50, 24, 46, 0, 38, 13, 4, 52, 16, 45, 30, 59, 0, 25, 55, 35, 16, 10, 26, 42, 58, 29, 60, 38, 50, 22, 28, 47, 0, 50, 28, 19, 33, 39, 11, 44, 16, 52, 24, 59, 3, 38, 27, 51, 0, 21, 7, 42, 26, 34, 21, 40, 33, 18, 39, 3, 54, 38, 8, 59, 0, 44, 27, 15, 58, 28, 57, 9, 43, 0, 36, 50, 20, 59, 8, 34, 0, 27, 47, 7, 36, 19, 56, 32, 0, 38, 11, 29, 62, 47, 6, 61, 0, 41, 14, 56, 10, 23, 45, 31, 57, 8, 36, 13, 58, 38, 11, 19 }, \ { 0, 34, 12, 47, 21, 2, 40, 30, 11, 25, 61, 20, 40, 15, 35, 22, 45, 36, 7, 41, 17, 57, 9, 48, 32, 62, 44, 24, 35, 3, 54, 13, 33, 63, 19, 4, 48, 22, 62, 2, 37, 8, 33, 6, 20, 52, 9, 32, 43, 13, 39, 63, 25, 4, 49, 23, 62, 32, 9, 30, 48, 18, 63, 12, 46, 29, 58, 13, 48, 8, 57, 31, 0, 51, 9, 58, 12, 22, 47, 29, 35, 22, 49, 5, 46, 4, 34, 20, 63, 24, 56, 11, 41, 3, 51, 19, 56, 35, 17, 58, 28, 42, 9, 45, 59, 26, 51, 42, 17, 36, 25, 15, 53, 21, 44, 3, 30, 55, 5, 50, 21, 28, 61, 32, 6, 49, 28, 46 }, \ { 58, 42, 60, 4, 31, 59, 22, 63, 35, 38, 9, 54, 1, 57, 8, 51, 16, 58, 27, 53, 3, 38, 30, 15, 27, 6, 19, 56, 10, 50, 21, 36, 47, 5, 43, 28, 51, 32, 13, 46, 18, 54, 16, 43, 63, 12, 36, 59, 22, 34, 5, 52, 17, 59, 27, 41, 0, 19, 55, 37, 13, 43, 6, 34, 41, 10, 36, 55, 19, 44, 3, 16, 58, 27, 49, 25, 32, 62, 17, 55, 13, 63, 18, 52, 25, 37, 17, 48, 13, 32, 5, 46, 28, 37, 14, 43, 25, 5, 51, 39, 3, 52, 33, 22, 8, 40, 12, 4, 57, 9, 46, 39, 28, 58, 13, 62, 17, 42, 19, 36, 0, 47, 16, 43, 24, 21, 54, 13 }, \ { 25, 9, 23, 50, 36, 8, 45, 14, 3, 51, 16, 28, 44, 12, 42, 29, 4, 26, 10, 47, 22, 61, 18, 54, 51, 39, 46, 13, 41, 26, 58, 7, 18, 39, 12, 57, 15, 1, 52, 27, 41, 23, 48, 1, 27, 45, 18, 2, 57, 26, 55, 8, 43, 31, 6, 58, 14, 51, 40, 5, 61, 31, 24, 54, 17, 60, 22, 1, 39, 30, 53, 45, 36, 13, 43, 5, 45, 2, 37, 6, 34, 42, 2, 39, 10, 62, 7, 54, 40, 18, 60, 15, 52, 21, 63, 8, 55, 46, 15, 30, 23, 13, 62, 16, 50, 24, 58, 31, 48, 21, 34, 2, 49, 7, 31, 37, 26, 48, 9, 61, 40, 11, 52, 2, 60, 40, 4, 37 }, \ { 52, 28, 39, 16, 54, 19, 29, 55, 42, 20, 58, 33, 24, 63, 18, 55, 39, 62, 43, 34, 12, 40, 6, 35, 2, 25, 8, 62, 34, 1, 31, 42, 61, 27, 53, 24, 40, 61, 34, 8, 59, 4, 30, 56, 40, 6, 53, 42, 10, 48, 16, 37, 12, 46, 21, 36, 47, 11, 28, 45, 22, 10, 57, 2, 49, 31, 14, 44, 61, 11, 25, 6, 23, 63, 18, 36, 28, 56, 20, 51, 11, 48, 27, 56, 32, 22, 45, 30, 2, 42, 27, 39, 1, 44, 23, 31, 38, 22, 11, 61, 43, 54, 4, 47, 35, 2, 44, 16, 28, 54, 12, 62, 18, 43, 10, 52, 1, 58, 33, 15, 29, 56, 20, 34, 9, 30, 48, 17 }, \ { 46, 2, 56, 11, 41, 1, 49, 6, 27, 47, 2, 48, 5, 32, 37, 3, 13, 19, 32, 1, 55, 28, 60, 17, 43, 59, 32, 20, 49, 16, 55, 23, 14, 46, 2, 36, 6, 30, 20, 49, 12, 47, 35, 14, 21, 60, 29, 14, 35, 24, 46, 1, 56, 29, 53, 8, 33, 23, 56, 1, 35, 46, 20, 39, 26, 4, 53, 28, 17, 38, 60, 34, 48, 9, 55, 15, 46, 7, 41, 31, 60, 24, 16, 36, 1, 59, 19, 52, 35, 6, 55, 11, 59, 33, 7, 57, 4, 29, 48, 1, 19, 26, 37, 30, 18, 63, 37, 6, 59, 1, 40, 24, 56, 33, 46, 22, 35, 7, 24, 53, 39, 5, 26, 45, 55, 18, 62, 7 }, \ { 20, 60, 29, 34, 20, 62, 33, 52, 10, 36, 13, 60, 41, 21, 50, 27, 56, 49, 8, 51, 21, 45, 11, 48, 8, 23, 53, 3, 29, 44, 5, 52, 9, 32, 50, 17, 43, 56, 3, 38, 24, 10, 62, 25, 51, 9, 33, 49, 61, 7, 30, 62, 22, 19, 2, 42, 63, 5, 49, 18, 60, 15, 52, 7, 43, 56, 23, 50, 5, 50, 2, 20, 41, 30, 1, 52, 22, 61, 14, 26, 3, 43, 53, 7, 47, 28, 11, 14, 23, 58, 33, 25, 47, 13, 50, 17, 40, 54, 34, 60, 41, 6, 59, 14, 50, 7, 25, 55, 20, 42, 51, 8, 27, 4, 16, 60, 28, 50, 44, 3, 22, 49, 63, 12, 33, 1, 43, 31 }, \ { 36, 5, 46, 8, 44, 24, 13, 39, 25, 57, 31, 18, 8, 52, 10, 45, 6, 30, 36, 24, 63, 4, 33, 26, 57, 40, 15, 56, 37, 12, 40, 25, 37, 58, 11, 63, 21, 45, 16, 60, 31, 53, 18, 33, 3, 45, 23, 0, 20, 54, 40, 15, 50, 38, 60, 16, 25, 42, 29, 38, 7, 41, 25, 62, 18, 33, 8, 35, 42, 16, 32, 56, 12, 39, 59, 19, 34, 9, 49, 38, 57, 12, 21, 50, 14, 40, 61, 44, 50, 9, 49, 19, 3, 29, 35, 62, 12, 24, 7, 18, 52, 32, 10, 46, 21, 41, 32, 11, 36, 29, 14, 34, 60, 38, 54, 11, 41, 14, 19, 57, 32, 16, 7, 41, 51, 25, 14, 57 }, \ { 53, 18, 26, 50, 15, 58, 4, 63, 17, 43, 7, 40, 61, 35, 15, 41, 23, 60, 16, 38, 14, 42, 19, 50, 0, 31, 10, 46, 27, 63, 18, 60, 0, 20, 29, 39, 8, 26, 37, 5, 42, 0, 44, 39, 57, 17, 58, 41, 28, 37, 4, 32, 9, 44, 12, 31, 54, 10, 59, 14, 27, 53, 12, 36, 0, 47, 13, 63, 21, 58, 10, 24, 50, 27, 4, 26, 44, 53, 31, 0, 18, 42, 29, 33, 57, 4, 32, 26, 0, 38, 16, 61, 41, 53, 20, 0, 42, 44, 49, 27, 10, 56, 39, 0, 57, 15, 53, 49, 3, 61, 22, 47, 17, 5, 49, 26, 2, 63, 39, 10, 47, 27, 37, 23, 4, 59, 38, 10 }, \ { 23, 39, 61, 3, 37, 28, 48, 31, 0, 34, 51, 23, 2, 26, 58, 0, 53, 11, 46, 1, 57, 29, 52, 14, 37, 61, 21, 35, 2, 49, 7, 34, 47, 55, 4, 33, 54, 13, 58, 52, 19, 50, 22, 7, 13, 29, 36, 11, 51, 17, 60, 25, 55, 4, 34, 51, 0, 35, 20, 48, 32, 3, 51, 30, 59, 28, 40, 3, 46, 29, 54, 43, 7, 62, 47, 11, 39, 4, 23, 46, 55, 8, 63, 5, 25, 37, 18, 46, 21, 56, 31, 5, 36, 8, 45, 58, 26, 15, 2, 36, 47, 21, 29, 44, 25, 34, 3, 27, 43, 10, 52, 0, 45, 30, 24, 36, 43, 18, 34, 59, 0, 52, 61, 15, 44, 19, 30, 49 }, \ { 0, 27, 12, 43, 54, 9, 22, 53, 21, 46, 15, 55, 29, 47, 20, 33, 39, 28, 59, 35, 9, 44, 5, 24, 47, 7, 52, 17, 56, 22, 30, 42, 14, 26, 45, 18, 49, 1, 24, 34, 11, 27, 55, 32, 61, 47, 2, 56, 6, 44, 13, 47, 36, 27, 58, 22, 16, 47, 40, 4, 57, 38, 21, 45, 16, 9, 56, 26, 11, 38, 0, 22, 36, 17, 33, 57, 16, 30, 62, 15, 35, 40, 20, 45, 59, 10, 54, 8, 63, 13, 52, 27, 22, 57, 28, 12, 32, 51, 55, 22, 63, 4, 16, 54, 12, 62, 45, 19, 58, 13, 32, 40, 20, 56, 7, 57, 9, 54, 6, 29, 42, 21, 8, 55, 35, 47, 6, 41 }, \ { 56, 33, 58, 32, 19, 35, 42, 6, 59, 11, 38, 5, 49, 12, 62, 7, 52, 17, 5, 25, 54, 20, 61, 31, 54, 27, 41, 11, 44, 5, 59, 12, 36, 51, 10, 61, 28, 41, 48, 9, 43, 63, 5, 40, 20, 8, 49, 26, 34, 21, 58, 1, 18, 45, 7, 39, 61, 26, 8, 50, 23, 10, 63, 5, 55, 37, 19, 49, 52, 15, 59, 47, 13, 54, 1, 25, 42, 58, 10, 48, 3, 27, 50, 1, 17, 48, 34, 41, 16, 40, 2, 45, 10, 39, 17, 61, 5, 38, 19, 9, 41, 31, 60, 38, 5, 23, 36, 8, 30, 55, 24, 63, 12, 48, 14, 51, 31, 20, 45, 25, 12, 50, 32, 2, 28, 11, 62, 14 }, \ { 44, 16, 7, 48, 1, 62, 16, 50, 27, 33, 61, 25, 17, 44, 31, 14, 22, 43, 32, 48, 18, 40, 8, 36, 3, 16, 33, 62, 23, 38, 25, 53, 2, 21, 41, 6, 22, 15, 59, 29, 16, 37, 26, 15, 52, 42, 23, 15, 54, 39, 10, 30, 53, 11, 49, 24, 2, 43, 55, 17, 34, 44, 15, 31, 24, 44, 2, 32, 7, 35, 25, 5, 40, 45, 29, 51, 6, 21, 37, 52, 24, 60, 13, 31, 53, 23, 2, 28, 49, 24, 31, 60, 20, 51, 1, 34, 48, 14, 59, 33, 50, 1, 18, 33, 48, 60, 17, 51, 39, 6, 38, 2, 35, 29, 40, 23, 1, 62, 15, 53, 37, 17, 46, 57, 40, 51, 24, 22 }, \ { 5, 37, 52, 24, 45, 13, 40, 3, 45, 9, 19, 42, 56, 4, 37, 46, 56, 2, 63, 11, 51, 1, 49, 13, 59, 45, 39, 1, 48, 15, 58, 9, 46, 31, 54, 35, 57, 38, 3, 46, 56, 4, 47, 57, 1, 30, 38, 63, 3, 46, 28, 63, 41, 14, 33, 62, 19, 32, 13, 28, 61, 1, 53, 42, 11, 60, 22, 62, 27, 42, 61, 31, 19, 8, 61, 12, 32, 55, 2, 18, 33, 12, 43, 36, 9, 62, 30, 55, 6, 58, 35, 7, 43, 29, 54, 23, 43, 30, 3, 25, 11, 45, 52, 28, 7, 14, 42, 1, 22, 50, 16, 53, 19, 59, 4, 46, 33, 41, 4, 35, 58, 5, 26, 13, 20, 2, 34, 54 }, \ { 30, 63, 21, 10, 26, 55, 29, 59, 23, 39, 53, 1, 36, 24, 59, 27, 10, 34, 23, 38, 30, 60, 22, 42, 28, 19, 9, 57, 30, 19, 43, 33, 13, 63, 3, 19, 11, 50, 31, 20, 14, 34, 10, 35, 17, 59, 7, 31, 19, 25, 50, 5, 20, 57, 29, 6, 52, 41, 4, 46, 20, 37, 26, 17, 49, 6, 39, 18, 53, 14, 3, 49, 57, 23, 34, 48, 14, 41, 28, 38, 56, 6, 58, 25, 39, 19, 43, 15, 37, 11, 47, 18, 53, 4, 37, 9, 62, 21, 53, 40, 57, 24, 13, 40, 56, 26, 47, 31, 59, 25, 45, 27, 10, 43, 21, 61, 13, 27, 48, 9, 23, 43, 31, 62, 38, 59, 9, 47 }, \ { 25, 4, 40, 60, 34, 6, 18, 36, 8, 57, 12, 30, 49, 14, 6, 54, 41, 16, 50, 6, 43, 15, 34, 4, 53, 24, 50, 35, 4, 51, 7, 55, 28, 24, 39, 44, 60, 7, 25, 62, 42, 53, 24, 61, 28, 45, 52, 12, 48, 37, 9, 35, 43, 3, 37, 48, 12, 58, 30, 52, 9, 59, 6, 57, 33, 29, 48, 4, 37, 45, 20, 34, 10, 39, 0, 60, 22, 45, 8, 63, 21, 42, 14, 49, 3, 56, 11, 46, 21, 61, 0, 42, 25, 13, 63, 17, 36, 8, 46, 16, 6, 35, 63, 0, 21, 37, 4, 57, 9, 34, 5, 61, 48, 32, 8, 37, 54, 17, 56, 30, 60, 0, 50, 16, 7, 29, 42, 17 }, \ { 32, 50, 15, 48, 2, 43, 52, 25, 47, 16, 32, 63, 21, 52, 40, 19, 0, 61, 29, 58, 20, 56, 26, 46, 12, 55, 6, 22, 62, 32, 17, 40, 0, 49, 34, 8, 27, 32, 48, 0, 21, 39, 5, 44, 12, 6, 22, 40, 0, 57, 16, 60, 23, 17, 54, 22, 36, 15, 24, 39, 19, 34, 47, 23, 0, 54, 13, 51, 24, 9, 55, 16, 52, 27, 44, 20, 4, 54, 26, 49, 0, 30, 46, 16, 29, 51, 34, 4, 52, 28, 33, 15, 57, 39, 26, 49, 0, 56, 27, 31, 48, 20, 43, 29, 53, 11, 46, 19, 41, 13, 55, 18, 0, 57, 26, 51, 2, 44, 6, 38, 14, 40, 22, 45, 36, 53, 3, 57 }, \ { 44, 12, 37, 28, 22, 57, 11, 38, 0, 51, 9, 41, 4, 29, 11, 47, 33, 45, 12, 26, 3, 36, 9, 63, 31, 16, 38, 44, 14, 47, 25, 61, 20, 58, 15, 47, 17, 57, 13, 36, 9, 51, 18, 29, 50, 36, 54, 20, 61, 27, 32, 13, 53, 44, 9, 27, 0, 63, 45, 2, 56, 10, 14, 43, 41, 28, 58, 11, 35, 60, 30, 41, 6, 63, 11, 51, 37, 32, 15, 10, 35, 53, 5, 61, 22, 7, 26, 59, 23, 9, 44, 48, 21, 3, 51, 32, 24, 41, 12, 61, 2, 55, 9, 15, 35, 58, 28, 15, 62, 30, 37, 23, 42, 29, 11, 17, 35, 24, 63, 20, 52, 28, 8, 55, 11, 23, 47, 19 }, \ { 0, 56, 8, 53, 14, 31, 61, 20, 55, 28, 62, 18, 35, 60, 25, 57, 7, 23, 39, 54, 47, 17, 43, 0, 40, 59, 29, 2, 56, 10, 37, 5, 43, 11, 29, 52, 1, 23, 54, 41, 59, 30, 55, 1, 62, 15, 33, 4, 43, 10, 47, 39, 1, 31, 40, 60, 49, 33, 7, 55, 26, 50, 31, 61, 8, 18, 21, 32, 44, 1, 25, 47, 18, 36, 30, 23, 59, 7, 40, 59, 27, 19, 38, 32, 44, 54, 40, 17, 38, 60, 27, 6, 35, 55, 10, 14, 44, 5, 50, 17, 38, 26, 42, 50, 18, 3, 44, 52, 2, 49, 7, 52, 15, 46, 62, 39, 55, 10, 31, 48, 3, 58, 33, 18, 61, 34, 13, 59 }, \ { 39, 27, 63, 20, 35, 41, 4, 45, 26, 5, 38, 13, 44, 2, 50, 17, 37, 52, 2, 13, 28, 58, 24, 51, 21, 8, 34, 48, 27, 42, 18, 51, 31, 56, 5, 36, 38, 44, 4, 17, 26, 11, 38, 23, 42, 8, 56, 39, 24, 51, 5, 56, 21, 59, 14, 6, 18, 42, 22, 35, 16, 37, 3, 25, 39, 46, 63, 5, 50, 17, 58, 8, 55, 3, 50, 12, 43, 17, 47, 2, 51, 9, 62, 12, 1, 35, 13, 50, 1, 37, 12, 51, 19, 29, 46, 59, 22, 58, 33, 45, 22, 60, 10, 32, 61, 39, 8, 33, 25, 36, 20, 60, 38, 4, 21, 5, 28, 45, 12, 18, 42, 11, 49, 1, 27, 40, 6, 30 }, \ { 24, 16, 42, 1, 50, 10, 48, 17, 33, 43, 24, 48, 21, 55, 31, 42, 10, 21, 63, 35, 49, 6, 33, 13, 41, 53, 10, 20, 60, 6, 53, 26, 12, 41, 22, 60, 14, 28, 63, 33, 49, 3, 45, 16, 48, 26, 14, 46, 18, 30, 35, 26, 8, 50, 29, 51, 25, 57, 12, 47, 53, 9, 62, 20, 54, 2, 36, 15, 40, 28, 33, 13, 38, 24, 46, 1, 29, 56, 33, 20, 44, 24, 41, 26, 57, 20, 63, 8, 30, 55, 5, 41, 62, 8, 34, 2, 37, 10, 19, 6, 37, 1, 53, 23, 5, 27, 58, 22, 43, 12, 50, 26, 9, 34, 54, 32, 49, 1, 59, 37, 22, 46, 25, 36, 51, 15, 54, 46 }, \ { 52, 7, 45, 33, 26, 58, 14, 60, 7, 54, 3, 58, 8, 34, 14, 5, 59, 30, 18, 44, 8, 22, 48, 62, 3, 26, 55, 38, 23, 16, 39, 1, 62, 24, 49, 9, 53, 19, 46, 7, 19, 60, 31, 58, 2, 34, 53, 7, 59, 2, 62, 42, 46, 19, 36, 11, 44, 4, 38, 28, 1, 43, 32, 51, 12, 29, 56, 22, 52, 2, 62, 49, 22, 60, 14, 35, 63, 5, 25, 57, 14, 53, 4, 46, 18, 31, 42, 22, 47, 20, 58, 31, 16, 43, 23, 54, 30, 42, 52, 57, 29, 49, 30, 13, 45, 48, 16, 55, 6, 63, 1, 44, 14, 58, 19, 47, 15, 24, 51, 34, 6, 55, 5, 63, 20, 41, 21, 9 }, \ { 30, 62, 18, 55, 5, 23, 39, 29, 49, 30, 15, 36, 28, 46, 60, 25, 39, 46, 4, 32, 61, 40, 15, 30, 36, 45, 14, 2, 49, 33, 57, 45, 18, 32, 3, 45, 30, 2, 35, 52, 40, 27, 13, 21, 38, 63, 20, 28, 37, 23, 16, 10, 13, 55, 2, 62, 21, 32, 60, 17, 58, 23, 5, 40, 16, 48, 7, 45, 10, 26, 43, 19, 6, 31, 52, 21, 39, 16, 48, 9, 37, 28, 36, 55, 7, 48, 3, 59, 15, 45, 25, 1, 53, 13, 47, 7, 62, 15, 4, 25, 12, 41, 18, 60, 38, 11, 34, 19, 39, 31, 29, 56, 23, 42, 3, 27, 60, 41, 8, 16, 61, 29, 43, 9, 32, 2, 60, 34 }, \ { 3, 38, 13, 37, 52, 44, 2, 19, 12, 42, 63, 19, 40, 1, 20, 50, 12, 55, 15, 56, 27, 1, 54, 11, 57, 18, 32, 63, 44, 4, 29, 13, 37, 61, 35, 16, 42, 57, 12, 22, 6, 55, 43, 10, 50, 5, 44, 11, 48, 52, 34, 58, 28, 41, 38, 30, 7, 52, 11, 49, 30, 14, 45, 27, 59, 34, 21, 38, 32, 58, 11, 36, 56, 42, 9, 41, 3, 54, 31, 42, 0, 60, 16, 11, 39, 24, 52, 33, 6, 36, 10, 40, 32, 60, 26, 20, 39, 28, 47, 34, 63, 8, 54, 3, 24, 56, 0, 51, 13, 47, 16, 40, 7, 35, 52, 11, 36, 4, 57, 30, 39, 13, 18, 50, 58, 28, 12, 48 }, \ { 57, 24, 49, 21, 10, 31, 61, 36, 56, 0, 22, 53, 11, 56, 32, 7, 36, 27, 41, 9, 46, 19, 34, 42, 25, 7, 50, 9, 28, 21, 54, 8, 50, 7, 27, 59, 10, 25, 48, 62, 37, 0, 33, 58, 25, 18, 32, 61, 0, 15, 45, 5, 50, 3, 23, 55, 47, 17, 40, 6, 60, 34, 53, 8, 41, 0, 61, 13, 54, 4, 46, 28, 0, 17, 48, 27, 58, 13, 23, 61, 33, 21, 50, 30, 62, 8, 14, 29, 56, 27, 61, 49, 17, 2, 44, 11, 51, 0, 59, 17, 40, 20, 32, 47, 36, 21, 42, 28, 60, 4, 54, 10, 59, 17, 30, 62, 21, 43, 26, 48, 0, 56, 36, 25, 8, 44, 39, 17 }, \ { 10, 42, 4, 59, 27, 47, 8, 23, 51, 32, 45, 6, 37, 26, 48, 43, 62, 0, 21, 53, 38, 12, 51, 5, 60, 47, 24, 37, 59, 15, 35, 47, 22, 55, 0, 50, 21, 40, 6, 29, 15, 52, 24, 8, 41, 55, 13, 29, 40, 56, 24, 31, 19, 33, 61, 15, 0, 35, 24, 42, 21, 2, 19, 57, 24, 15, 30, 50, 20, 25, 40, 16, 57, 34, 61, 8, 29, 45, 6, 49, 11, 47, 2, 44, 19, 57, 38, 50, 12, 42, 21, 4, 35, 52, 28, 56, 23, 36, 13, 45, 4, 52, 27, 14, 6, 62, 9, 45, 21, 37, 25, 46, 33, 49, 0, 44, 7, 53, 13, 19, 53, 31, 3, 47, 15, 56, 22, 51 }, \ { 35, 28, 53, 32, 1, 16, 54, 40, 9, 17, 25, 58, 14, 59, 3, 22, 16, 51, 31, 5, 23, 58, 28, 17, 35, 20, 0, 42, 11, 52, 3, 31, 41, 17, 43, 13, 32, 54, 18, 60, 32, 45, 17, 49, 2, 36, 51, 22, 7, 36, 9, 63, 48, 12, 46, 26, 43, 28, 63, 13, 48, 37, 51, 33, 5, 47, 55, 9, 42, 63, 7, 51, 24, 12, 37, 19, 55, 34, 18, 38, 15, 28, 54, 34, 5, 43, 22, 0, 48, 14, 54, 24, 58, 9, 38, 5, 32, 55, 21, 30, 49, 9, 59, 43, 30, 51, 35, 26, 7, 53, 2, 22, 14, 27, 57, 18, 38, 24, 33, 45, 10, 41, 20, 60, 37, 5, 32, 0 }, \ { 63, 19, 15, 40, 62, 35, 14, 28, 46, 61, 4, 49, 35, 10, 29, 54, 33, 8, 45, 62, 37, 1, 43, 55, 10, 52, 61, 30, 19, 40, 25, 62, 11, 38, 27, 58, 36, 3, 46, 8, 39, 4, 62, 28, 47, 20, 4, 54, 47, 27, 43, 1, 21, 38, 8, 58, 10, 54, 4, 56, 9, 26, 12, 39, 60, 27, 18, 37, 1, 31, 35, 5, 45, 50, 2, 43, 26, 1, 59, 23, 56, 40, 7, 26, 58, 17, 32, 63, 25, 39, 7, 31, 45, 19, 63, 15, 48, 8, 37, 61, 16, 34, 1, 56, 18, 3, 15, 58, 49, 32, 63, 41, 55, 5, 40, 22, 50, 6, 59, 2, 63, 23, 52, 11, 26, 61, 44, 23 }, \ { 11, 56, 46, 6, 22, 43, 58, 3, 34, 21, 38, 30, 18, 44, 52, 13, 41, 57, 17, 28, 14, 49, 25, 7, 33, 39, 26, 6, 56, 48, 1, 20, 56, 5, 46, 9, 19, 51, 30, 25, 56, 21, 35, 14, 57, 42, 16, 33, 10, 57, 17, 59, 41, 25, 53, 37, 20, 40, 30, 18, 31, 62, 44, 22, 3, 44, 11, 48, 23, 53, 18, 60, 29, 22, 62, 15, 53, 47, 10, 41, 3, 19, 52, 36, 13, 46, 10, 35, 3, 61, 41, 16, 1, 50, 26, 42, 18, 46, 2, 25, 54, 20, 39, 23, 47, 31, 41, 12, 38, 17, 8, 19, 31, 48, 12, 61, 9, 54, 29, 35, 15, 38, 6, 43, 34, 14, 7, 47 }, \ { 39, 2, 33, 26, 53, 8, 18, 50, 41, 12, 53, 1, 63, 24, 19, 39, 2, 24, 47, 10, 60, 38, 19, 63, 48, 4, 15, 45, 32, 14, 60, 36, 29, 53, 23, 63, 34, 12, 61, 1, 43, 11, 53, 30, 1, 26, 60, 45, 23, 39, 3, 29, 12, 50, 4, 16, 51, 3, 45, 36, 50, 1, 16, 54, 35, 14, 57, 30, 58, 9, 46, 14, 41, 10, 32, 38, 4, 30, 21, 51, 32, 63, 25, 1, 60, 27, 53, 18, 51, 22, 28, 55, 34, 12, 40, 3, 60, 29, 57, 41, 6, 44, 11, 53, 8, 61, 24, 57, 1, 28, 44, 59, 36, 3, 34, 25, 41, 31, 16, 44, 22, 47, 28, 58, 1, 49, 54, 29 }, \ { 58, 25, 50, 13, 38, 30, 60, 24, 6, 57, 27, 42, 9, 45, 6, 61, 30, 50, 4, 34, 29, 3, 46, 13, 22, 42, 58, 28, 9, 39, 23, 44, 7, 15, 44, 2, 40, 15, 47, 41, 23, 37, 7, 59, 38, 11, 34, 6, 62, 14, 52, 35, 55, 19, 32, 61, 33, 24, 57, 6, 22, 59, 29, 7, 49, 25, 40, 3, 17, 39, 27, 52, 0, 55, 16, 57, 24, 61, 36, 6, 29, 12, 48, 39, 20, 44, 6, 40, 33, 5, 48, 10, 57, 36, 22, 51, 33, 9, 24, 12, 62, 29, 50, 35, 14, 43, 5, 33, 47, 52, 13, 23, 10, 51, 56, 16, 46, 1, 49, 4, 61, 9, 52, 18, 31, 21, 36, 17 }, \ { 19, 42, 9, 48, 2, 44, 11, 37, 48, 20, 33, 16, 55, 35, 49, 15, 37, 20, 59, 16, 53, 22, 56, 31, 50, 11, 34, 54, 16, 51, 4, 49, 33, 53, 21, 28, 56, 24, 31, 9, 52, 16, 48, 24, 44, 13, 51, 20, 31, 49, 18, 6, 34, 2, 44, 14, 47, 8, 15, 43, 13, 41, 33, 52, 20, 61, 7, 51, 34, 62, 4, 20, 36, 33, 43, 8, 46, 13, 53, 17, 45, 42, 9, 31, 52, 11, 30, 56, 13, 59, 17, 44, 27, 6, 62, 11, 43, 17, 49, 38, 26, 2, 16, 27, 58, 21, 54, 18, 26, 5, 35, 61, 43, 27, 7, 39, 14, 58, 37, 55, 20, 33, 13, 40, 62, 10, 55, 5 }, \ { 51, 14, 61, 29, 59, 20, 55, 31, 0, 49, 11, 60, 3, 26, 22, 56, 0, 40, 12, 43, 41, 8, 36, 0, 17, 57, 24, 2, 46, 26, 61, 18, 0, 38, 12, 59, 6, 49, 3, 57, 19, 63, 5, 33, 18, 54, 28, 56, 0, 43, 26, 46, 63, 27, 56, 22, 27, 54, 38, 28, 63, 24, 10, 45, 0, 31, 42, 21, 12, 25, 44, 49, 59, 6, 26, 50, 3, 34, 27, 59, 0, 35, 62, 16, 4, 58, 47, 0, 43, 24, 37, 2, 54, 20, 46, 31, 0, 56, 34, 5, 55, 45, 60, 37, 0, 40, 10, 38, 63, 46, 15, 20, 0, 53, 21, 62, 30, 11, 24, 27, 40, 0, 57, 26, 3, 45, 27, 35 }, \ } #endif fvwm-2.6.5.orig/libs/Grab.h0000644000175000017500000000051307677641664013625 0ustar vwcvwc/* -*-c-*- */ /* ** MyXGrabServer & MyXUngrabServer - to handle nested grab server calls */ #include void MyXGrabServer(Display *disp); void MyXUngrabServer(Display *disp); void MyXUngrabKeyboard(Display *disp); void MyXGrabKeyboard(Display *disp); void MyXGrabKey(Display *disp); void MyXUngrabKey(Display *disp); fvwm-2.6.5.orig/libs/ClientMsg.c0000644000175000017500000000225607677641663014637 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include "ClientMsg.h" Atom _XA_WM_PROTOCOLS = None; void send_clientmessage (Display *disp, Window w, Atom a, Time timestamp) { XClientMessageEvent ev; if (_XA_WM_PROTOCOLS == None) _XA_WM_PROTOCOLS = XInternAtom(disp, "WM_PROTOCOLS", False); ev.type = ClientMessage; ev.window = w; ev.message_type = _XA_WM_PROTOCOLS; ev.format = 32; ev.data.l[0] = a; ev.data.l[1] = timestamp; FSendEvent(disp, w, False, 0L, (XEvent *) &ev); } fvwm-2.6.5.orig/libs/modifiers.h0000644000175000017500000000162207701425753014720 0ustar vwcvwc/* -*-c-*- */ #ifndef MODIFIERS_H #define MODIFIERS_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ #define ALL_MODIFIERS (ShiftMask|LockMask|ControlMask|Mod1Mask|Mod2Mask|\ Mod3Mask|Mod4Mask|Mod5Mask) /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ extern charmap_t key_modifiers[]; extern unsigned int modifier_mapindex_to_mask[]; /* ---------------------------- interface functions ------------------------ */ int modifiers_string_to_modmask(char *in_modifiers, int *out_modifier_mask); #endif /* MODIFIERS_H */ fvwm-2.6.5.orig/libs/defaults.h0000644000175000017500000004020211622413321014524 0ustar vwcvwc/* -*-c-*- */ /* File: defaults.h * * Description: * #defines for default values shall go into this file as well as tunable * parameters. */ #ifndef _DEFAULTS_ #define _DEFAULTS_ /*** event handling ***/ #define CLOCK_SKEW_MS 30000 /* ms */ /*** grabbing the pointer ***/ #define NUMBER_OF_GRAB_ATTEMPTS 100 #define TIME_BETWEEN_GRAB_ATTEMPTS 10 /* ms */ /*** bindings and mouse buttons ***/ /* Fvwm needs at least 3 buttons. X currently supports up to 5 buttons, so you * can use 3, 4 or 5 here. Do not set this to values higher than 5! Use the * next macro for that. */ #define NUMBER_OF_MOUSE_BUTTONS 5 /* The "extended" buttons do not provide the full functionality because X has * no bit mask value for them. Things like dragging windows don't work with * them. */ #define NUMBER_OF_EXTENDED_MOUSE_BUTTONS 9 #if NUMBER_OF_EXTENDED_MOUSE_BUTTONS > 31 #error No more than 31 mouse buttons can be supported on 32 bit platforms #endif #define DEFAULT_ALL_BUTTONS_MASK \ ((Button1Mask * ((1 << NUMBER_OF_MOUSE_BUTTONS) - 1))) #define DEFAULT_ALL_BUTTONS_MOTION_MASK \ ((Button1MotionMask * ((1 << NUMBER_OF_MOUSE_BUTTONS) - 1))) #define DEFAULT_MODS_UNUSED LockMask /* * These values may be adjusted to fine tune the menu looks. */ /* The first option of the default menu style must be fvwm/win/mwm/.... * fvwm may crash if not. */ #define DEFAULT_MENU_STYLE \ "MenuStyle * fvwm, Foreground black, Background grey, " \ "Greyed slategrey, MenuColorset, ActiveColorset, GreyedColorset" #define DEFAULT_CLICKTIME 150 /* ms */ #define DEFAULT_POPUP_DELAY 15 /* ms*10 */ #define DEFAULT_POPDOWN_DELAY 15 /* ms*10 */ #define DEFAULT_MENU_CLICKTIME (3*DEFAULT_CLICKTIME) #define DEFAULT_MOVE_THRESHOLD 3 /* pixels */ #define MAX_MENU_COPIES 10 /* menu copies */ #define MAX_MENU_ITEM_LABELS 3 /* labels (max. 15) */ #define MAX_MENU_ITEM_MINI_ICONS 2 /* mini icons (max. 15) */ #define DEFAULT_MENU_BORDER_WIDTH 2 /* pixels */ #define MAX_MENU_BORDER_WIDTH 50 /* pixels */ #define MAX_MENU_ITEM_RELIEF_THICKNESS 50 /* pixels */ #define PARENT_MENU_FORCE_VISIBLE_WIDTH 20 /* pixels */ #define DEFAULT_MENU_POPUP_NOW_RATIO 75 /* % of item width */ /* default item formats for left and right submenus. */ #define DEFAULT_MENU_ITEM_FORMAT "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" #define DEFAULT_LEFT_MENU_ITEM_FORMAT "%.1|%3.2<%5i%5l%5l%5r%5i%1|%s" /* size of the submenu triangle. */ #define MENU_TRIANGLE_WIDTH 5 /* pixels */ #define MENU_TRIANGLE_HEIGHT 9 /* pixels */ /* menu underline parameters */ #define MENU_UNDERLINE_THICKNESS 1 /* pixels */ #define MENU_UNDERLINE_GAP 1 /* pixels */ #define MENU_UNDERLINE_HEIGHT (MENU_UNDERLINE_THICKNESS + MENU_UNDERLINE_GAP) /* menu separator parameters */ #define MENU_SEPARATOR_SHORT_X_OFFSET 5 /* pixels */ #define MENU_SEPARATOR_Y_OFFSET 2 /* pixels */ #define MENU_SEPARATOR_HEIGHT 2 /* pixels */ #define MENU_SEPARATOR_TOTAL_HEIGHT \ (MENU_SEPARATOR_HEIGHT + MENU_SEPARATOR_Y_OFFSET) /* menu tear off bar parameters */ #define MENU_TEAR_OFF_BAR_X_OFFSET 1 /* pixels */ #define MENU_TEAR_OFF_BAR_Y_OFFSET 1 /* pixels */ #define MENU_TEAR_OFF_BAR_HEIGHT 4 /* pixels */ #define MENU_TEAR_OFF_BAR_DASH_WIDTH 5 /* pixels */ /* gap above item text */ #define DEFAULT_MENU_ITEM_TEXT_Y_OFFSET 1 /* pixels */ /* gap below item text */ #define DEFAULT_MENU_ITEM_TEXT_Y_OFFSET2 2 /* pixels */ /* same for titles */ #define DEFAULT_MENU_TITLE_TEXT_Y_OFFSET (DEFAULT_MENU_ITEM_TEXT_Y_OFFSET) #define DEFAULT_MENU_TITLE_TEXT_Y_OFFSET2 (DEFAULT_MENU_ITEM_TEXT_Y_OFFSET2) /* minimum for above value */ #define MIN_VERTICAL_SPACING -100 /* pixels */ /* maximum for above value */ #define MAX_VERTICAL_SPACING 100 /* pixels */ /* maximum for above value */ #define MAX_MENU_MARGIN 50 /* pixels */ /* width of a tab in the item format of a menu */ #define MENU_TAB_WIDTH 8 /* spaces */ /* This is the tile width or height for V and H gradients. I guess this should * better be a power of two. A value of 5 definitely causes XFree 3.3.3.1 to * screw up the V_GRADIENT on an 8 bit display, but 4, 6, 7 etc. work well. */ #define DEFAULT_MENU_GRADIENT_PIXMAP_THICKNESS 4 /*** colours ***/ #define DEFAULT_FORE_COLOR "black" #define DEFAULT_BACK_COLOR "gray" #define DEFAULT_HILIGHT_COLOR "white" #define DEFAULT_SHADOW_COLOR "black" #define DEFAULT_CURSOR_FORE_COLOR "black" #define DEFAULT_CURSOR_BACK_COLOR "white" /*** pager ***/ #define DEFAULT_MOVE_THRESHOLD 3 /* pixels */ #define DEFAULT_PAGER_WINDOW_BORDER_WIDTH 1 /* pixels */ /*** fonts ***/ #define EXTRA_TITLE_FONT_HEIGHT 3 /* pixels */ #define EXTRA_TITLE_FONT_WIDTH 3 /* pixels */ #define MIN_FONT_HEIGHT (EXTRA_TITLE_FONT_HEIGHT + 2) #define MAX_FONT_HEIGHT 256 /* pixels */ /*** Flocale ***/ /* adding the good number of "*" speed-up font loading with certain X * server */ #define FLOCALE_MB_FALLBACK_FONT \ "-*-fixed-medium-r-semicondensed-*-13-*-*-*-*-*-*-*," \ "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*," \ "-*-*-medium-r-normal-*-16-*-*-*-*-*-*-*" /* rationale: -*-fixed-medium-r-semicondensed-*-13-* should gives "fixed" in most non multibyte charset (?). -*-fixed-medium-r-normal-*-14-* is ok for jsx -*-medium-r-normal-*-16-* is for gb Of course this is for XFree. Any help for other X server basic font set is welcome. */ #define FLOCALE_FALLBACK_FONT "fixed" #define FLOCALE_FFT_FALLBACK_FONT "MonoSpace" #define FLOCALE_NUMBER_MISS_CSET_ERR_MSG 5 /*** window geometry ***/ #define DEFAULT_MIN_MAX_WINDOW_WIDTH 100 /* pixels */ #define DEFAULT_MIN_MAX_WINDOW_HEIGHT 100 /* pixels */ #define DEFAULT_MAX_MAX_WINDOW_WIDTH 32767 /* pixels */ #define DEFAULT_MAX_MAX_WINDOW_HEIGHT 32767 /* pixels */ /*** icon geometry ***/ #define UNSPECIFIED_ICON_DIMENSION -1 #define MIN_ALLOWABLE_ICON_DIMENSION 0 /* pixels */ #define MAX_ALLOWABLE_ICON_DIMENSION 255 /* pixels */ /* this value is used in a bugfix */ #define WINDOW_FREAKED_OUT_SIZE 65500 /* pixels */ /* Used in Workaround for broken min and max size hints vs a size request */ #define BROKEN_MAXSIZE_LIMIT 1 #define BROKEN_MINSIZE_LIMIT 30000 /* geometry window */ #define GEOMETRY_WINDOW_BW 2 /* pixels */ #define GEOMETRY_WINDOW_STRING " +8888 x +8888 " #define GEOMETRY_WINDOW_POS_STRING " %+-4d %+-4d " #define GEOMETRY_WINDOW_SIZE_STRING " %4d x %-4d " /* * window title layout */ /* the title buttons are shrunk if the title would become smaller than this * number of pixels */ #define MIN_WINDOW_TITLE_LENGTH 10 /* pixels */ /* title bar buttons that get smaller than this size are hidden */ #define MIN_WINDOW_TITLEBUTTON_LENGTH 2 /* pixels */ /* height of stick lines */ #define WINDOW_TITLE_STICK_HEIGHT 1 /* pixels */ /* vertical distance between stick lines */ #define WINDOW_TITLE_STICK_VERT_DIST 4 /* pixels */ /* minimum width of stick lines */ #define WINDOW_TITLE_STICK_MIN_WIDTH 1 /* pixels */ /* gap between border of title window and stick lines */ #define WINDOW_TITLE_STICK_OFFSET 4 /* pixels */ /* gap between title and stick lines */ #define WINDOW_TITLE_TO_STICK_GAP 4 /* pixels */ /* gap between border of title window and text */ #define WINDOW_TITLE_TEXT_OFFSET 10 /* pixels */ /* minimal gap between border of title window and text */ #define MIN_WINDOW_TITLE_TEXT_OFFSET 2 /* pixels */ /* left and right padding for the text into under text area (MultiPixmap)*/ #define TBMP_TITLE_PADDING 5 /* minimal left and right area vs left/right of text/end (MultiPixmap) */ #define TBMP_MIN_RL_TITLE_LENGTH 7 /* maximum number of segemnts in a vector button */ #define MAX_TITLE_BUTTON_VECTOR_LINES 10000 /*** window placement ***/ /** MinOverlap(Percent)Placement **/ /** Now these values are configurable by using styles **/ /* The following factors represent the amount of area that these types of * windows are counted as. For example, by default the area of ONTOP windows * is counted 5 times as much as normal windows. So CleverPlacement will * cover 5 times as much area of another window before it will cover an ONTOP * window. To treat ONTOP windows the same as other windows, set this to 1. * To really, really avoid putting windows under ONTOP windows, set this to a * high value, say 1000. A value of 5 will try to avoid ONTOP windows if * practical, but if it saves a reasonable amount of area elsewhere, it will * place one there. The same rules apply for the other "AVOID" factors. */ /* With the advent of layers, the meaning of ONTOP in the following explanation has changed to mean any window in a higher layer. */ #define PLACEMENT_AVOID_BELOW 0.05 #define PLACEMENT_AVOID_STICKY 1.0 #define PLACEMENT_AVOID_ONTOP 5 #define PLACEMENT_AVOID_ICON 10 #define PLACEMENT_AVOID_EWMH_STRUT 50 /* used in MinOverlap*Placement to forbid complete covering (99%, 95% 85% and 75%) of windows */ #define PLACEMENT_AVOID_COVER_99 12 #define PLACEMENT_AVOID_COVER_95 6 #define PLACEMENT_AVOID_COVER_85 4 #define PLACEMENT_AVOID_COVER_75 1 #define PLACEMENT_FALLBACK_CASCADE_STEP 20 /** Other placement related values **/ /* default string for position placement */ #define DEFAULT_PLACEMENT_POSITION_STRING "0 0" #define DEFAULT_PLACEMENT_POS_CENTER_STRING "50-50w 50-50w" #define DEFAULT_PLACEMENT_POS_MOUSE_STRING "m-50w m-50w" /*** icon layout ***/ /* width of the relief around the icon and icon title */ #define ICON_RELIEF_WIDTH 2 /* pixels */ /* height of stick lines */ #define ICON_TITLE_STICK_HEIGHT WINDOW_TITLE_STICK_HEIGHT /* vertical distance between stick lines */ #define ICON_TITLE_STICK_VERT_DIST WINDOW_TITLE_STICK_VERT_DIST /* vertical offset for icon title */ #define ICON_TITLE_VERT_TEXT_OFFSET -3 /* pixels */ /* minimum width of stick lines */ #define ICON_TITLE_STICK_MIN_WIDTH 3 /* pixels */ /* number of blank pixels before and after a collapsed title */ #define ICON_TITLE_TEXT_GAP_COLLAPSED 1 /* pixels */ /* number of blank pixels before and after an expanded title */ #define ICON_TITLE_TEXT_GAP_EXPANDED 4 /* pixels */ /* extra blank pixels if the icon is sticky */ #define ICON_TITLE_TO_STICK_EXTRA_GAP 1 /* pixels */ /* minimum distance of icons in icon box */ #define MIN_ICON_BOX_DIST 3 /* pixels */ /* padding for the icon into its background */ #define ICON_BACKGROUND_PADDING 0 /* pixels */ /*** general keyboard shortcuts used in move, resize, ... ***/ #define DEFAULT_KDB_SHORTCUT_MOVE_DISTANCE 5 /* pixels */ #define KDB_SHORTCUT_MOVE_DISTANCE_SMALL 1 /* pixels */ #define KDB_SHORTCUT_MOVE_DISTANCE_BIG 100 /* pixels */ /*** movement ***/ #define DEFAULT_OPAQUE_MOVE_SIZE 5 /* percent of window area */ #define DEFAULT_SNAP_ATTRACTION 0 /* snap nothing */ #define DEFAULT_SNAP_ATTRACTION_MODE 0x3 /* snap all */ #define DEFAULT_SNAP_GRID_X 1 /* pixels */ #define DEFAULT_SNAP_GRID_Y 1 /* pixels */ /*** paging ***/ #define DEFAULT_EDGE_SCROLL 100 /* % of screen width/height */ /* Don't page if the pointer has moved for more than this many pixels between * two samples */ #define MAX_PAGING_MOVE_DISTANCE 5 /* pixels */ #define DEFAULT_MOVE_DELAY 0 /* ms */ #define DEFAULT_RESIZE_DELAY -1 /* pixels */ #define DEFAULT_SCROLL_DELAY 0 /* ms */ /*** layers ***/ #define DEFAULT_BOTTOM_LAYER 2 #define DEFAULT_DEFAULT_LAYER 4 #define DEFAULT_TOP_LAYER 6 #define DEFAULT_ROOT_WINDOW_LAYER -1 /*** decorations ***/ /* The number of left and right buttons must be equal. A maximum of 32 buttons * can be handled (16 left and 16 right). */ #define NR_LEFT_BUTTONS 5 #define NR_RIGHT_BUTTONS NR_LEFT_BUTTONS #define NUMBER_OF_TITLE_BUTTONS (NR_LEFT_BUTTONS + NR_RIGHT_BUTTONS) /*** window borders ***/ #define DEFAULT_BORDER_WIDTH 1 /* pixels */ #define DEFAULT_HANDLE_WIDTH 7 /* pixels */ #define MAX_BORDER_WIDTH 500 /* pixels */ #define MAX_HANDLE_WIDTH (MAX_BORDER_WIDTH) /*** module configuration ***/ #define MAX_MODULE_ALIAS_LEN 250 /* bytes */ #define DEFAULT_MODULE_TIMEOUT 30 /* seconds */ #define MAX_MODULE_INPUT_TEXT_LEN 1000 /* bytes */ /*** FvwmConsole configuration */ /* Maximum time FvwmConsole waits for the client to connect. */ #define FVWMCONSOLE_CONNECTION_TO_SECS 60 /* seconds */ /*** misc ***/ #define DEFAULT_EMULATE_MWM False #define DEFAULT_EMULATE_WIN False #define DEFAULT_USE_ACTIVE_DOWN_BUTTONS True #define DEFAULT_USE_INACTIVE_BUTTONS True #define DEFAULT_USE_INACTIVE_DOWN_BUTTONS True /*** Gradients ***/ #define MAX_GRADIENT_SEGMENTS 1000 #define MAX_GRADIENT_COLORS 10000 /*** Xinerama ***/ #define DEFAULT_XINERAMA_ENABLED True /* Xinerama on by default */ #define XINERAMA_CONFIG_STRING "XineramaConfig" /* Replace with -1 to switch off "primary screen" concept by default */ #define DEFAULT_PRIMARY_SCREEN 0 /*** Very long window names (600000 characters or more) seem to hang the X *** server. ***/ #define MAX_WINDOW_NAME_LEN 200 /* characters */ #define MAX_ICON_NAME_LEN 200 /* characters */ /* not tested if this hangs the server too */ #define MAX_RESOURCE_LEN 200 /* characters */ #define MAX_CLASS_LEN 200 /* characters */ /* Set the maximum size a visible name can be. */ #define MAX_VISIBLE_NAME_LEN 4096 /*** numbered window names ***/ #define MAX_WINDOW_NAME_NUMBER 999 #define MAX_WINDOW_NAME_NUMBER_DIGITS 3 /* number/digits of above number */ /* focus policy style defaults */ #define DEF_FP_FOCUS_ENTER 1 #define DEF_FP_UNFOCUS_LEAVE 1 #define DEF_FP_FOCUS_CLICK_CLIENT 0 #define DEF_FP_FOCUS_CLICK_DECOR 0 #define DEF_FP_FOCUS_BY_PROGRAM 1 #define DEF_FP_FOCUS_BY_FUNCTION 1 #define DEF_FP_WARP_POINTER_ON_FOCUS_FUNC 0 #define DEF_FP_LENIENT 0 #define DEF_FP_RAISE_FOCUSED_CLIENT_CLICK 0 #define DEF_FP_RAISE_UNFOCUSED_CLIENT_CLICK 1 #define DEF_FP_RAISE_FOCUSED_DECOR_CLICK 0 #define DEF_FP_RAISE_UNFOCUSED_DECOR_CLICK 0 #define DEF_FP_RAISE_FOCUSED_ICON_CLICK 0 #define DEF_FP_RAISE_UNFOCUSED_ICON_CLICK 0 /* use first three buttons by default */ #define DEF_FP_MOUSE_BUTTONS ( \ ((1 << 0) | (1 << 1) | (1 << 2)) & \ ((1 << NUMBER_OF_MOUSE_BUTTONS) - 1)) #define DEF_FP_MODIFIERS 0 #define DEF_FP_PASS_FOCUS_CLICK 1 #define DEF_FP_PASS_RAISE_CLICK 1 #define DEF_FP_IGNORE_FOCUS_CLICK_MOTION 0 #define DEF_FP_IGNORE_RAISE_CLICK_MOTION 0 #define DEF_FP_ALLOW_FUNC_FOCUS_CLICK 1 #define DEF_FP_ALLOW_FUNC_RAISE_CLICK 1 #define DEF_FP_GRAB_FOCUS 0 #define DEF_FP_GRAB_FOCUS_TRANSIENT 1 #define DEF_FP_OVERRIDE_GRAB_FOCUS 0 #define DEF_FP_RELEASE_FOCUS 0 #define DEF_FP_RELEASE_FOCUS_TRANSIENT 1 #define DEF_FP_OVERRIDE_RELEASE_FOCUS 0 #define DEF_FP_SORT_WINDOWLIST_BY 0 /* Function execution */ #define MAX_FUNCTION_DEPTH 512 /* Tips */ #define FTIPS_DEFAULT_PLACEMENT FTIPS_PLACEMENT_AUTO_UPDOWN #define FTIPS_DEFAULT_JUSTIFICATION FTIPS_JUSTIFICATION_LEFT_UP #define FTIPS_DEFAULT_PLACEMENT_OFFSET 3 #define FTIPS_DEFAULT_JUSTIFICATION_OFFSET 2 #define FTIPS_DEFAULT_BORDER_WIDTH 1 #endif /* _DEFAULTS_ */ fvwm-2.6.5.orig/libs/flist.c0000644000175000017500000000720010556634174014052 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module was all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* code for parsing the fvwm style command */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "safemalloc.h" #include "flist.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ flist *flist_append_obj(flist *list, void *object) { flist *new = (flist *)safemalloc(sizeof(flist)); flist *tl = list; new->object = object; new->next = NULL; new->prev = NULL; if (list == NULL) { return new; } while(tl->next) { tl = tl->next; } tl->next = new; new->prev = tl; return list; } flist *flist_prepend_obj(flist *list, void *object) { flist *new = (flist *)safemalloc(sizeof(flist)); new->object = object; new->next = NULL; new->prev = NULL; if (list == NULL) { return new; } if (list->prev) { list->prev->next = new; new->prev = list->prev; } list->prev = new; new->next = list; return new; } flist *flist_insert_obj(flist *list, void *object, int position) { flist *new; flist *tl; if (position < 0) { return flist_append_obj(list, object); } if (position == 0) { return flist_prepend_obj(list, object); } tl = list; while(tl && position-- > 0) { tl = tl->next; } if (!tl) { return flist_append_obj(list, object); } new = (flist *)safemalloc(sizeof(flist));; new->object = object; new->prev = NULL; if (tl->prev) { tl->prev->next = new; new->prev = tl->prev; } new->next = tl; tl->prev = new; if (tl == list) { return new; } return list; } flist *flist_remove_obj(flist *list, void *object) { flist *tl = list; while (tl && tl->object != object) { tl = tl->next; } if (tl == NULL) { return NULL; } if (tl->prev) { tl->prev->next = tl->next; } if (tl->next) { tl->next->prev = tl->prev; } if (list == tl) { list = list->next; } free(tl); return list; } flist *flist_free_list(flist *list) { flist *tl; while (list) { tl = list; list = list->next; free(tl); } return NULL; } fvwm-2.6.5.orig/libs/Fpng.h0000644000175000017500000003113011364612643013622 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ #ifndef FPNG_H #define FPNG_H /* ---------------------------- included header files ---------------------- */ #include "PictureBase.h" #if PngSupport #include #else #include #endif /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ #ifndef _ZLIB_H typedef unsigned char FzByte; typedef unsigned int FzuInt; typedef unsigned long FzuLong; typedef FzByte FzBytef; #ifdef __STDC__ typedef void *Fzvoidpf; typedef void *Fzvoidp; #else typedef FzByte *Fzvoidpf; typedef FzByte *Fzvoidp; #endif typedef Fzvoidpf (*Fzalloc_func) ( #ifdef __STDC__ Fzvoidpf opaque, FzuInt items, FzuInt size #endif ); typedef Fzvoidp (*Fzfree_func) ( #ifdef __STDC__ Fzvoidpf opaque, Fzvoidpf address #endif ); typedef struct Fz_stream_s { FzBytef *next_in; FzuInt avail_in; FzuLong total_in; FzBytef *next_out; FzuInt avail_out; FzuLong total_out; char *msg; struct internal_state *state; Fzalloc_func zalloc; Fzfree_func zfree; Fzvoidpf opaque; int data_type; FzuLong adler; FzuLong reserved; } Fz_stream; typedef Fz_stream *Fz_streamp; #else /* _ZLIB_H */ #ifdef Z_PREFIX typedef z_Byte FzByte; typedef z_uInt FzuInt; typedef z_uLong FzuLong; typedef z_Bytef FzBytef; typedef z_voidp Fzvoidp; typedef z_voidpf Fzvoidpf; typedef z_stream Fz_stream; #else typedef Byte FzByte; typedef uInt FzuInt; typedef uLong FzuLong; typedef Bytef FzBytef; typedef voidp Fzvoidp; typedef voidpf Fzvoidpf; typedef z_stream Fz_stream; #endif #endif /* !_ZLIB_H */ #if PngSupport typedef png_uint_32 Fpng_uint_32; typedef png_int_32 Fpng_int_32; typedef png_uint_16 Fpng_uint_16; typedef png_int_16 Fpng_int_16; typedef png_byte Fpng_byte; typedef png_size_t Fpng_size_t; typedef png_struct Fpng_struct; typedef png_structp Fpng_structp; typedef png_structpp Fpng_structpp; typedef png_info Fpng_info; typedef png_infop Fpng_infop; typedef png_infopp Fpng_infopp; #else typedef unsigned long Fpng_uint_32; typedef long Fpng_int_32; typedef unsigned short Fpng_uint_16; typedef short Fpng_int_16; typedef unsigned char Fpng_byte; typedef size_t Fpng_size_t; typedef void *Fpng_voidp; typedef Fpng_byte *Fpng_bytep; typedef Fpng_uint_32 *Fpng_uint_32p; typedef Fpng_int_32 *Fpng_int_32p; typedef Fpng_uint_16 *Fpng_uint_16p; typedef Fpng_int_16 *Fpng_int_16p; typedef const char *Fpng_const_charp; typedef char *Fpng_charp; typedef double *Fpng_doublep; typedef Fpng_byte **Fpng_bytepp; typedef Fpng_uint_32 **Fpng_uint_32pp; typedef Fpng_int_32 **Fpng_int_32pp; typedef Fpng_uint_16 **Fpng_uint_16pp; typedef Fpng_int_16 **Fpng_int_16pp; typedef const char **Fpng_const_charpp; typedef char **Fpng_charpp; typedef double **Fpng_doublepp; typedef char ** *Fpng_charppp; typedef struct Fpng_color_struct { Fpng_byte red; Fpng_byte green; Fpng_byte blue; } Fpng_color; typedef Fpng_color *Fpng_colorp; typedef Fpng_color **Fpng_colorpp; typedef struct Fpng_color_16_struct { Fpng_byte index; Fpng_uint_16 red; Fpng_uint_16 green; Fpng_uint_16 blue; Fpng_uint_16 gray; } Fpng_color_16; typedef Fpng_color_16 *Fpng_color_16p; typedef Fpng_color_16 **Fpng_color_16pp; typedef struct Fpng_color_8_struct { Fpng_byte red; Fpng_byte green; Fpng_byte blue; Fpng_byte gray; Fpng_byte alpha; } Fpng_color_8; typedef Fpng_color_8 *Fpng_color_8p; typedef Fpng_color_8 **Fpng_color_8pp; typedef struct Fpng_text_struct { int compression; Fpng_charp key; Fpng_charp text; Fpng_size_t text_length; } Fpng_text; typedef Fpng_text *Fpng_textp; typedef Fpng_text **Fpng_textpp; typedef struct Fpng_time_struct { Fpng_uint_16 year; Fpng_byte month; Fpng_byte day; Fpng_byte hour; Fpng_byte minute; Fpng_byte second; } Fpng_time; typedef Fpng_time *Fpng_timep; typedef Fpng_time **Fpng_timepp; typedef struct Fpng_info_struct { Fpng_uint_32 width; Fpng_uint_32 height; Fpng_uint_32 valid; Fpng_uint_32 rowbytes; Fpng_colorp palette; Fpng_uint_16 num_palette; Fpng_uint_16 num_trans; Fpng_byte bit_depth; Fpng_byte color_type; Fpng_byte compression_type; Fpng_byte filter_type; Fpng_byte interlace_type; Fpng_byte channels; Fpng_byte pixel_depth; Fpng_byte spare_byte; Fpng_byte signature[8]; float gamma; Fpng_byte srgb_intent; int num_text; int max_text; Fpng_textp text; Fpng_time mod_time; Fpng_color_8 sig_bit; Fpng_bytep trans; Fpng_color_16 trans_values; Fpng_color_16 background; Fpng_uint_32 x_offset; Fpng_uint_32 y_offset; Fpng_byte offset_unit_type; Fpng_uint_32 x_pixels_per_unit; Fpng_uint_32 y_pixels_per_unit; Fpng_byte phys_unit_type; Fpng_uint_16p hist; float x_white; float y_white; float x_red; float y_red; float x_green; float y_green; float x_blue; float y_blue; Fpng_charp pcal_purpose; Fpng_int_32 pcal_X0; Fpng_int_32 pcal_X1; Fpng_charp pcal_units; Fpng_charpp pcal_params; Fpng_byte pcal_type; Fpng_byte pcal_nparams; } Fpng_info; typedef Fpng_info *Fpng_infop; typedef Fpng_info **Fpng_infopp; typedef struct Fpng_struct_def Fpng_struct; typedef Fpng_struct *Fpng_structp; typedef struct Fpng_row_info_struct { Fpng_uint_32 width; Fpng_uint_32 rowbytes; Fpng_byte color_type; Fpng_byte bit_depth; Fpng_byte channels; Fpng_byte pixel_depth; } Fpng_row_info; typedef Fpng_row_info *Fpng_row_infop; typedef Fpng_row_info **Fpng_row_infopp; typedef void (*Fpng_error_ptr)( #ifdef __STDC__ Fpng_structp, Fpng_const_charp #endif ); typedef void (*Fpng_rw_ptr)( #ifdef __STDC__ Fpng_structp, Fpng_bytep, Fpng_size_t #endif ); typedef void (*Fpng_flush_ptr) ( #ifdef __STDC__ Fpng_structp #endif ); typedef void (*Fpng_read_status_ptr) ( #ifdef __STDC__ Fpng_structp, Fpng_uint_32, int #endif ); typedef void (*Fpng_write_status_ptr) ( #ifdef __STDC__ Fpng_structp, Fpng_uint_32, int #endif ); typedef void (*Fpng_progressive_info_ptr) ( #ifdef __STDC__ Fpng_structp, Fpng_infop #endif ); typedef void (*Fpng_progressive_end_ptr) ( #ifdef __STDC__ Fpng_structp, Fpng_infop #endif ); typedef void (*Fpng_progressive_row_ptr) ( #ifdef __STDC__ Fpng_structp, Fpng_bytep,Fpng_uint_32, int #endif ); typedef void (*Fpng_user_transform_ptr)( #ifdef __STDC__ Fpng_structp, Fpng_row_infop, Fpng_bytep #endif ); typedef Fpng_voidp (*Fpng_malloc_ptr) ( #ifdef __STDC__ Fpng_structp, Fpng_size_t #endif ); typedef void (*Fpng_free_ptr) ( #ifdef __STDC__ Fpng_structp, Fpng_voidp #endif ); struct png_struct_def { jmp_buf jmpbuf; Fpng_error_ptr error_fn; Fpng_error_ptr warning_fn; Fpng_voidp error_ptr; Fpng_rw_ptr write_data_fn; Fpng_rw_ptr read_data_fn; Fpng_voidp io_ptr; Fpng_user_transform_ptr read_user_transform_fn; Fpng_user_transform_ptr write_user_transform_fn; Fpng_voidp user_transform_ptr; Fpng_byte user_transform_depth; Fpng_byte user_transform_channels; Fpng_uint_32 mode; Fpng_uint_32 flags; Fpng_uint_32 transformations; Fz_stream zstream; Fpng_bytep zbuf; Fpng_size_t zbuf_size; int zlib_level; int zlib_method; int zlib_window_bits; int zlib_mem_level; int zlib_strategy; Fpng_uint_32 width; Fpng_uint_32 height; Fpng_uint_32 num_rows; Fpng_uint_32 usr_width; Fpng_uint_32 rowbytes; Fpng_uint_32 irowbytes; Fpng_uint_32 iwidth; Fpng_uint_32 row_number; Fpng_bytep prev_row; Fpng_bytep row_buf; Fpng_bytep sub_row; Fpng_bytep up_row; Fpng_bytep avg_row; Fpng_bytep paeth_row; Fpng_row_info row_info; Fpng_uint_32 idat_size; Fpng_uint_32 crc; Fpng_colorp palette; Fpng_uint_16 num_palette; Fpng_uint_16 num_trans; Fpng_byte chunk_name[5]; Fpng_byte compression; Fpng_byte filter; Fpng_byte interlaced; Fpng_byte pass; Fpng_byte do_filter; Fpng_byte color_type; Fpng_byte bit_depth; Fpng_byte usr_bit_depth; Fpng_byte pixel_depth; Fpng_byte channels; Fpng_byte usr_channels; Fpng_byte sig_bytes; Fpng_uint_16 filler; Fpng_byte background_gamma_type; float background_gamma; Fpng_color_16 background; Fpng_color_16 background_1; Fpng_flush_ptr output_flush_fn; Fpng_uint_32 flush_dist; Fpng_uint_32 flush_rows; int gamma_shift; float gamma; float screen_gamma; Fpng_bytep gamma_table; Fpng_bytep gamma_from_1; Fpng_bytep gamma_to_1; Fpng_uint_16pp gamma_16_table; Fpng_uint_16pp gamma_16_from_1; Fpng_uint_16pp gamma_16_to_1; Fpng_color_8 sig_bit; Fpng_color_8 shift; Fpng_bytep trans; Fpng_color_16 trans_values; Fpng_read_status_ptr read_row_fn; Fpng_write_status_ptr write_row_fn; Fpng_progressive_info_ptr info_fn; Fpng_progressive_row_ptr row_fn; Fpng_progressive_end_ptr end_fn; Fpng_bytep save_buffer_ptr; Fpng_bytep save_buffer; Fpng_bytep current_buffer_ptr; Fpng_bytep current_buffer; Fpng_uint_32 push_length; Fpng_uint_32 skip_length; Fpng_size_t save_buffer_size; Fpng_size_t save_buffer_max; Fpng_size_t buffer_size; Fpng_size_t current_buffer_size; int process_mode; int cur_palette; Fpng_size_t current_text_size; Fpng_size_t current_text_left; Fpng_charp current_text; Fpng_charp current_text_ptr; Fpng_bytepp offset_table_ptr; Fpng_bytep offset_table; Fpng_uint_16 offset_table_number; Fpng_uint_16 offset_table_count; Fpng_uint_16 offset_table_count_free; Fpng_bytep palette_lookup; Fpng_bytep dither_index; Fpng_uint_16p hist; Fpng_byte heuristic_method; Fpng_byte num_prev_filters; Fpng_bytep prev_filters; Fpng_uint_16p filter_weights; Fpng_uint_16p inv_filter_weights; Fpng_uint_16p filter_costs; Fpng_uint_16p inv_filter_costs; Fpng_charp time_buffer; Fpng_voidp mem_ptr; Fpng_malloc_ptr malloc_fn; Fpng_free_ptr free_fn; Fpng_byte rgb_to_gray_status; Fpng_byte rgb_to_gray_red_coeff; Fpng_byte rgb_to_gray_green_coeff; Fpng_byte rgb_to_gray_blue_coeff; Fpng_byte empty_plte_permitted; }; typedef Fpng_struct **Fpng_structpp; #endif /* ---------------------------- global definitions ------------------------- */ #define FPNG_BYTES_TO_CHECK 4 #if PngSupport #define FPNG_LIBPNG_VER_STRING PNG_LIBPNG_VER_STRING #define FPNG_COLOR_TYPE_PALETTE PNG_COLOR_TYPE_PALETTE #define FPNG_COLOR_TYPE_RGB_ALPHA PNG_COLOR_TYPE_RGB_ALPHA #define FPNG_COLOR_TYPE_GRAY_ALPHA PNG_COLOR_TYPE_GRAY_ALPHA #define FPNG_COLOR_TYPE_GRAY PNG_COLOR_TYPE_GRAY #define FPNG_FILLER_BEFORE PNG_FILLER_BEFORE #define FPNG_FILLER_AFTER PNG_FILLER_AFTER #define FPNG_INFO_tRNS PNG_INFO_tRNS #if PNG_LIBPNG_VER >= 10400 #define Fpng_check_sig(a,b) (!png_sig_cmp(a,0,b)) #else #define Fpng_check_sig(a,b) png_check_sig(a,b) #endif #define Fpng_create_read_struct(a,b,c,d) png_create_read_struct(a,b,c,d) #define Fpng_create_info_struct(a) png_create_info_struct(a) #define Fpng_destroy_read_struct(a,b,c) png_destroy_read_struct(a,b,c) #define Fpng_init_io(a,b) png_init_io(a,b) #define Fpng_read_info(a,b) png_read_info(a,b) #define Fpng_get_IHDR(a,b,c,d,e,f,g,h,i) png_get_IHDR(a,b,c,d,e,f,g,h,i) #define Fpng_set_expand(a) png_set_expand(a) #define Fpng_set_swap_alpha(a) png_set_swap_alpha(a) #define Fpng_set_filler(a,b,c) png_set_filler(a,b,c) #define Fpng_set_bgr(a) png_set_bgr(a) #define Fpng_set_strip_16(a) png_set_strip_16(a) #define Fpng_set_packing(a) png_set_packing(a) #define Fpng_set_gray_to_rgb(a) png_set_gray_to_rgb(a) #define Fpng_get_bit_depth(a,b) png_get_bit_depth(a,b) #if PNG_LIBPNG_VER >= 10400 #define Fpng_set_gray_1_2_4_to_8(a) png_set_expand_gray_1_2_4_to_8(a) #else #define Fpng_set_gray_1_2_4_to_8(a) png_set_gray_1_2_4_to_8(a) #endif #define Fpng_get_valid(a,b,c) png_get_valid(a,b,c) #define Fpng_read_end(a,b) png_read_end(a,b) #define Fpng_set_interlace_handling(a) png_set_interlace_handling(a) #define Fpng_read_rows(a,b,c,d) png_read_rows(a,b,c,d) #define Fpng_read_image(a,b) png_read_image(a,b) #else #define FPNG_LIBPNG_VER_STRING "" #define FPNG_COLOR_TYPE_PALETTE 0 #define FPNG_COLOR_TYPE_RGB_ALPHA 1 #define FPNG_COLOR_TYPE_GRAY_ALPHA 2 #define FPNG_COLOR_TYPE_GRAY 3 #define FPNG_FILLER_BEFORE 6 #define FPNG_FILLER_AFTER 5 #define FPNG_INFO_tRNS 7 #define Fpng_check_sig(a,b) 0 #define Fpng_create_read_struct(a,b,c,d) NULL #define Fpng_create_info_struct(a) NULL #define Fpng_destroy_read_struct(a,b,c) #define Fpng_init_io(a,b) #define Fpng_read_info(a,b) #define Fpng_get_IHDR(a,b,c,d,e,f,g,h,i) #define Fpng_set_expand(a) #define Fpng_set_swap_alpha(a) #define Fpng_set_filler(a,b,c) #define Fpng_set_bgr(a) #define Fpng_set_strip_16(a) #define Fpng_set_packing(a) #define Fpng_set_gray_to_rgb(a) #define Fpng_get_bit_depth(a,b) 0 #define Fpng_set_gray_1_2_4_to_8(a) #define Fpng_get_valid(a,b,c) 0 #define Fpng_read_end(a,b) #define Fpng_set_interlace_handling(a) 0 #define Fpng_read_rows(a,b,c,d) #define Fpng_read_image(a,b) #endif #endif /* FPNG_H */ fvwm-2.6.5.orig/libs/Fplay.h0000644000175000017500000003140511355744341014011 0ustar vwcvwc#ifndef FPLAY_H #define FPLAY_H #ifdef HAVE_RPLAY #define USE_FPLAY 1 #else #define USE_FPLAY 0 #endif #if USE_FPLAY # include # undef M_ERROR /* Solaris fix */ typedef RPLAY FPLAY; typedef RPLAY_ATTRS FPLAY_ATTRS; # define FPLAY_DEFAULT_VALUE RPLAY_DEFAULT_VOLUME # define FPLAY_DEFAULT_PRIORITY RPLAY_DEFAULT_PRIORITY # define FPLAY_NULL RPLAY_NULL # define FPLAY_PLAY RPLAY_PLAY # define FPLAY_STOP RPLAY_STOP # define FPLAY_PAUSE RPLAY_PAUSE # define FPLAY_CONTINUE RPLAY_CONTINUE # define FPLAY_SOUND RPLAY_SOUND # define FPLAY_VOLUME RPLAY_VOLUME # define FPLAY_NSOUNDS RPLAY_NSOUNDS # define FPLAY_COMMAND RPLAY_COMMAND # define FPLAY_APPEND RPLAY_APPEND # define FPLAY_INSERT RPLAY_INSERT # define FPLAY_DELETE RPLAY_DELETE # define FPLAY_CHANGE RPLAY_CHANGE # define FPLAY_COUNT RPLAY_COUNT # define FPLAY_LIST_COUNT RPLAY_LIST_COUNT # define FPLAY_PRIORITY RPLAY_PRIORITY # define FPLAY_RANDOM_SOUND RPLAY_RANDOM_SOUND # define FPLAY_PING RPLAY_PING # define FPLAY_RPTP_SERVER RPLAY_RPTP_SERVER # define FPLAY_RPTP_SERVER_PORT RPLAY_RPTP_SERVER_PORT # define FPLAY_RPTP_SEARCH RPLAY_RPTP_SEARCH # define FPLAY_RPTP_FROM_SENDER RPLAY_RPTP_FROM_SENDER # define FPLAY_SAMPLE_RATE RPLAY_SAMPLE_RATE # define FPLAY_RESET RPLAY_RESET # define FPLAY_DONE RPLAY_DONE # define FPLAY_CLIENT_DATA RPLAY_CLIENT_DATA # define FPLAY_LIST_NAME RPLAY_LIST_NAME # define FPLAY_PUT RPLAY_PUT # define FPLAY_ID RPLAY_ID # define FPLAY_SEQUENCE RPLAY_SEQUENCE # define FPLAY_DATA RPLAY_DATA # define FPLAY_DATA_SIZE RPLAY_DATA_SIZE # define FPLAY_FORMAT_NONE RPLAY_FORMAT_NONE # define FPLAY_FORMAT_LINEAR_8 RPLAY_FORMAT_LINEAR_8 # define FPLAY_FORMAT_ULINEAR_8 RPLAY_FORMAT_ULINEAR_8 # define FPLAY_FORMAT_LINEAR_16 RPLAY_FORMAT_LINEAR_16 # define FPLAY_FORMAT_ULINEAR_16 RPLAY_FORMAT_ULINEAR_16 # define FPLAY_FORMAT_ULAW RPLAY_FORMAT_ULAW # define FPLAY_FORMAT_G721 RPLAY_FORMAT_G721 # define FPLAY_FORMAT_G723_3 RPLAY_FORMAT_G723_3 # define FPLAY_FORMAT_G723_5 RPLAY_FORMAT_G723_5 # define FPLAY_FORMAT_GSM RPLAY_FORMAT_GSM # define FPLAY_BIG_ENDIAN RPLAY_BIG_ENDIAN # define FPLAY_LITTLE_ENDIAN RPLAY_LITTLE_ENDIAN # define FPLAY_AUDIO_PORT_NONE RPLAY_AUDIO_PORT_NONE # define FPLAY_AUDIO_PORT_SPEAKER RPLAY_AUDIO_PORT_SPEAKER # define FPLAY_AUDIO_PORT_HEADPHONE RPLAY_AUDIO_PORT_HEADPHONE # define FPLAY_AUDIO_PORT_LINEOUT RPLAY_AUDIO_PORT_LINEOUT # define FPLAY_MIN_VOLUME RPLAY_MIN_VOLUME # define FPLAY_MAX_VOLUME RPLAY_MAX_VOLUME # define FPLAY_MIN_PRIORITY RPLAY_MIN_PRIORITY # define FPLAY_MAX_PRIORITY RPLAY_MAX_PRIORITY # define FPLAY_DEFAULT_VOLUME RPLAY_DEFAULT_VOLUME # define FPLAY_DEFAULT_PRIORITY RPLAY_DEFAULT_PRIORITY # define FPLAY_DEFAULT_COUNT RPLAY_DEFAULT_COUNT # define FPLAY_DEFAULT_LIST_COUNT RPLAY_DEFAULT_LIST_COUNT # define FPLAY_DEFAULT_RANDOM_SOUND RPLAY_DEFAULT_RANDOM_SOUND # define FPLAY_DEFAULT_SAMPLE_RATE RPLAY_DEFAULT_SAMPLE_RATE # define FPLAY_DEFAULT_OFFSET RPLAY_DEFAULT_OFFSET # define FPLAY_DEFAULT_BYTE_ORDER RPLAY_DEFAULT_BYTE_ORDER # define FPLAY_DEFAULT_CHANNELS RPLAY_DEFAULT_CHANNELS # define FPLAY_DEFAULT_BITS RPLAY_DEFAULT_BITS # define FPLAY_ERROR_NONE RPLAY_ERROR_NONE # define FPLAY_ERROR_MEMORY RPLAY_ERROR_MEMORY # define FPLAY_ERROR_HOST RPLAY_ERROR_HOST # define FPLAY_ERROR_CONNECT RPLAY_ERROR_CONNECT # define FPLAY_ERROR_SOCKET RPLAY_ERROR_SOCKET # define FPLAY_ERROR_WRITE RPLAY_ERROR_WRITE # define FPLAY_ERROR_CLOSE RPLAY_ERROR_CLOSE # define FPLAY_ERROR_PACKET_SIZE RPLAY_ERROR_PACKET_SIZE # define FPLAY_ERROR_BROADCAST RPLAY_ERROR_BROADCAST # define FPLAY_ERROR_ATTRIBUTE RPLAY_ERROR_ATTRIBUTE # define FPLAY_ERROR_COMMAND RPLAY_ERROR_COMMAND # define FPLAY_ERROR_INDEX RPLAY_ERROR_INDEX # define FPLAY_ERROR_MODIFIER RPLAY_ERROR_MODIFIER # define FRPTP_ERROR_NONE RPTP_ERROR_NONE # define FRPTP_ERROR_MEMORY RPTP_ERROR_MEMORY # define FRPTP_ERROR_HOST RPTP_ERROR_HOST # define FRPTP_ERROR_CONNECT RPTP_ERROR_CONNECT # define FRPTP_ERROR_SOCKET RPTP_ERROR_SOCKET # define FRPTP_ERROR_OPEN RPTP_ERROR_OPEN # define FRPTP_ERROR_READ RPTP_ERROR_READ # define FRPTP_ERROR_WRITE RPTP_ERROR_WRITE # define FRPTP_ERROR_PING RPTP_ERROR_PING # define FRPTP_ERROR_TIMEOUT RPTP_ERROR_TIMEOUT # define FRPTP_ERROR_PROTOCOL RPTP_ERROR_PROTOCOL # define FRPTP_ERROR RPTP_ERROR # define FRPTP_OK RPTP_OK # define FRPTP_TIMEOUT RPTP_TIMEOUT # define FRPTP_NOTIFY RPTP_NOTIFY # define FOLD_RPLAY_PLAY OLD_RPLAY_PLAY # define FOLD_RPLAY_STOP OLD_RPLAY_STOP # define FOLD_RPLAY_PAUSE OLD_RPLAY_PAUSE # define FOLD_RPLAY_CONTINUE OLD_RPLAY_CONTINUE # define FRPTP_ASYNC_READ RPTP_ASYNC_READ # define FRPTP_ASYNC_WRITE RPTP_ASYNC_WRITE # define FRPTP_ASYNC_RAW RPTP_ASYNC_RAW # define FRPTP_ASYNC_ENABLE RPTP_ASYNC_ENABLE # define FRPTP_ASYNC_DISABLE RPTP_ASYNC_DISABLE # define FRPTP_EVENT_OK RPTP_EVENT_OK # define FRPTP_EVENT_ERROR RPTP_EVENT_ERROR # define FRPTP_EVENT_TIMEOUT RPTP_EVENT_TIMEOUT # define FRPTP_EVENT_OTHER RPTP_EVENT_OTHER # define FRPTP_EVENT_CONTINUE RPTP_EVENT_CONTINUE # define FRPTP_EVENT_DONE RPTP_EVENT_DONE # define FRPTP_EVENT_PAUSE RPTP_EVENT_PAUSE # define FRPTP_EVENT_PLAY RPTP_EVENT_PLAY # define FRPTP_EVENT_SKIP RPTP_EVENT_SKIP # define FRPTP_EVENT_STATE RPTP_EVENT_STATE # define FRPTP_EVENT_STOP RPTP_EVENT_STOP # define FRPTP_EVENT_VOLUME RPTP_EVENT_VOLUME # define FRPTP_EVENT_CLOSE RPTP_EVENT_CLOSE # define FRPTP_EVENT_FLOW RPTP_EVENT_FLOW # define FRPTP_EVENT_MODIFY RPTP_EVENT_MODIFY # define FRPTP_EVENT_LEVEL RPTP_EVENT_LEVEL # define FRPTP_EVENT_POSITION RPTP_EVENT_POSITION # define FRPTP_EVENT_ALL RPTP_EVENT_ALL # define FRPTP_MAX_ARGS RPTP_MAX_ARGS # define FRPTP_MAX_LINE RPTP_MAX_LINE # define FPLAY_PORT RPLAY_PORT # define FRPTP_PORT RPTP_PORT # define FOLD_RPLAY_PORT OLD_RPLAY_PORT # define FOLD_RPTP_PORT OLD_RPTP_PORT # define FPLAY_PACKET_ID RPLAY_PACKET_ID # define Fplay_errno rplay_errno # define Frptp_errno rptp_errno # define Fplay(a,b) rplay(a,b) # define Fplay_create(a) rplay_create(a) # define Fplay_perror(a) rplay_perror(a) /* variadict macros appeared in C99, so we can't use them */ # define Fplay_set rplay_set # define Fplay_get rplay_get # define Frptp_putline rptp_putline # define Frptp_async_putline rptp_async_putline # define Fplay_destroy(a) rplay_destroy(a) # define Fplay_default_host() rplay_default_host() # define Fplay_display(a) rplay_display(a) # define Fplay_host(a,b) rplay_host(a,b) # define Fplay_host_volume(a,b,c) rplay_host_volume(a,b,c) # define Fplay_local(a) rplay_local(a) # define Fplay_open(a) rplay_open(a) # define Fplay_open_default() rplay_open_default() # define Fplay_open_display() rplay_open_display() # define Fplay_open_port(a,b) rplay_open_port(a,b) # define Fplay_open_sockaddr_in(a) rplay_open_sockaddr(a) # define Fplay_ping(a) rplay_ping(a) # define Fplay_ping_sockaddr_in(a) rplay_ping_sockaddr_in(a) # define Fplay_ping_sockfd(a) rplay_ping_sockfd(a) # define Fplay_close(a) rplay_close(a) # define Fplay_sound(a,b) rplay_sound(a,b) # define Fplay_default(a) rplay_default(a) # define Fplay_convert(a) rplay_convert(a) # define Fplay_pack(a) rplay_pack(a) # define Fplay_unpack(a) rplay_unpack(a) # define Frptp_open(a,b,c,d) rptp_open(a,b,c,d) # define Frptp_read(a,b,c) rptp_read(a,b,c) # define Frptp_write(a,b,c) rptp_write(a,b,c) # define Frptp_close(a) rptp_close(a) # define Frptp_perror(a) rptp_perror(a) # define Frptp_getline(a,b,c) rptp_getline(a,b,c) # define Frptp_command(a,b,c,d) rptp_command(a,b,c,d) # define Frptp_parse(a,b) rptp_parse(a,b) # define Frptp_async_write(a,b,c,d) rptp_async_write(a,b,c,d) # define Frptp_async_register(a,b,c) rptp_async_register(a,b,c) # define Frptp_async_notify(a,b,c) rptp_async_notify(a,b,c) # define Frptp_async_process(a,b) rptp_async_process(a,b) # define Frptp_main_loop() rptp_main_loop() # define Frptp_stop_main_loop(a) rptp_stop_main_loop(a) #else typedef void FPLAY; typedef void FPLAY_ATTRS; # define FPLAY_DEFAULT_VALUE 0 # define FPLAY_DEFAULT_PRIORITY 0 # define FPLAY_NULL 0 # define FPLAY_PLAY 0 # define FPLAY_STOP 0 # define FPLAY_PAUSE 0 # define FPLAY_CONTINUE 0 # define FPLAY_SOUND 0 # define FPLAY_VOLUME 0 # define FPLAY_NSOUNDS 0 # define FPLAY_COMMAND 0 # define FPLAY_APPEND 0 # define FPLAY_INSERT 0 # define FPLAY_DELETE 0 # define FPLAY_CHANGE 0 # define FPLAY_COUNT 0 # define FPLAY_LIST_COUNT 0 # define FPLAY_PRIORITY 0 # define FPLAY_RANDOM_SOUND 0 # define FPLAY_PING 0 # define FPLAY_RPTP_SERVER 0 # define FPLAY_RPTP_SERVER_PORT 0 # define FPLAY_RPTP_SEARCH 0 # define FPLAY_RPTP_FROM_SENDER 0 # define FPLAY_SAMPLE_RATE 0 # define FPLAY_RESET 0 # define FPLAY_DONE 0 # define FPLAY_CLIENT_DATA 0 # define FPLAY_LIST_NAME 0 # define FPLAY_PUT 0 # define FPLAY_ID 0 # define FPLAY_SEQUENCE 0 # define FPLAY_DATA 0 # define FPLAY_DATA_SIZE 0 # define FPLAY_FORMAT_NONE 0 # define FPLAY_FORMAT_LINEAR_8 0 # define FPLAY_FORMAT_ULINEAR_8 0 # define FPLAY_FORMAT_LINEAR_16 0 # define FPLAY_FORMAT_ULINEAR_16 0 # define FPLAY_FORMAT_ULAW 0 # define FPLAY_FORMAT_G721 0 # define FPLAY_FORMAT_G723_3 0 # define FPLAY_FORMAT_G723_5 0 # define FPLAY_FORMAT_GSM 0 # define FPLAY_BIG_ENDIAN 0 # define FPLAY_LITTLE_ENDIAN 0 # define FPLAY_AUDIO_PORT_NONE 0 # define FPLAY_AUDIO_PORT_SPEAKER 0 # define FPLAY_AUDIO_PORT_HEADPHONE 0 # define FPLAY_AUDIO_PORT_LINEOUT 0 # define FPLAY_MIN_VOLUME 0 # define FPLAY_MAX_VOLUME 0 # define FPLAY_MIN_PRIORITY 0 # define FPLAY_MAX_PRIORITY 0 # define FPLAY_DEFAULT_VOLUME 0 # define FPLAY_DEFAULT_PRIORITY 0 # define FPLAY_DEFAULT_COUNT 0 # define FPLAY_DEFAULT_LIST_COUNT 0 # define FPLAY_DEFAULT_RANDOM_SOUND 0 # define FPLAY_DEFAULT_SAMPLE_RATE 0 # define FPLAY_DEFAULT_OFFSET 0 # define FPLAY_DEFAULT_BYTE_ORDER 0 # define FPLAY_DEFAULT_CHANNELS 0 # define FPLAY_DEFAULT_BITS 0 # define FPLAY_ERROR_NONE 0 # define FPLAY_ERROR_MEMORY 0 # define FPLAY_ERROR_HOST 0 # define FPLAY_ERROR_CONNECT 0 # define FPLAY_ERROR_SOCKET 0 # define FPLAY_ERROR_WRITE 0 # define FPLAY_ERROR_CLOSE 0 # define FPLAY_ERROR_PACKET_SIZE 0 # define FPLAY_ERROR_BROADCAST 0 # define FPLAY_ERROR_ATTRIBUTE 0 # define FPLAY_ERROR_COMMAND 0 # define FPLAY_ERROR_INDEX 0 # define FPLAY_ERROR_MODIFIER 0 # define FRPTP_ERROR_NONE 0 # define FRPTP_ERROR_MEMORY 0 # define FRPTP_ERROR_HOST 0 # define FRPTP_ERROR_CONNECT 0 # define FRPTP_ERROR_SOCKET 0 # define FRPTP_ERROR_OPEN 0 # define FRPTP_ERROR_READ 0 # define FRPTP_ERROR_WRITE 0 # define FRPTP_ERROR_PING 0 # define FRPTP_ERROR_TIMEOUT 0 # define FRPTP_ERROR_PROTOCOL 0 # define FRPTP_ERROR 0 # define FRPTP_OK 0 # define FRPTP_TIMEOUT 0 # define FRPTP_NOTIFY 0 # define FOLD_RPLAY_PLAY 0 # define FOLD_RPLAY_STOP 0 # define FOLD_RPLAY_PAUSE 0 # define FOLD_RPLAY_CONTINUE 0 # define FRPTP_ASYNC_READ 0 # define FRPTP_ASYNC_WRITE 0 # define FRPTP_ASYNC_RAW 0 # define FRPTP_ASYNC_ENABLE 0 # define FRPTP_ASYNC_DISABLE 0 # define FRPTP_EVENT_OK 0 # define FRPTP_EVENT_ERROR 0 # define FRPTP_EVENT_TIMEOUT 0 # define FRPTP_EVENT_OTHER 0 # define FRPTP_EVENT_CONTINUE 0 # define FRPTP_EVENT_DONE 0 # define FRPTP_EVENT_PAUSE 0 # define FRPTP_EVENT_PLAY 0 # define FRPTP_EVENT_SKIP 0 # define FRPTP_EVENT_STATE 0 # define FRPTP_EVENT_STOP 0 # define FRPTP_EVENT_VOLUME 0 # define FRPTP_EVENT_CLOSE 0 # define FRPTP_EVENT_FLOW 0 # define FRPTP_EVENT_MODIFY 0 # define FRPTP_EVENT_LEVEL 0 # define FRPTP_EVENT_POSITION 0 # define FRPTP_EVENT_ALL 0 # define FRPTP_MAX_ARGS 0 # define FRPTP_MAX_LINE 0 # define FPLAY_PORT 0 # define FRPTP_PORT 0 # define FOLD_RPLAY_PORT 0 # define FOLD_RPTP_PORT 0 # define FPLAY_PACKET_ID 0 # define Fplay_errno 0 # define Frptp_errno 0 # define Fplay(a,b) 0 # define Fplay_create(a) 0 # define Fplay_perror(a) /* variadict macros appeared in C99, so we can't use them. */ static void Fplay_set(FPLAY *a, ...) {} /* TA: 20100403: These aren't being used anymore. */ /* static int Fplay_get(FPLAY *a, ...) {return 0;} static int Frptp_putline(int a, ...) {return 0;} */ # define Frptp_async_putline Frptp_putline /* # define Fplay_set(...) # define Fplay_get(...) 0 # define Frptp_putline(...) 0 # define Frptp_async_putline(...) 0 */ # define Fplay_destroy(a) # define Fplay_default_host() "" # define Fplay_display(a) 0 # define Fplay_host(a,b) 0 # define Fplay_host_volume(a,b,c) 0 # define Fplay_local(a) 0 # define Fplay_open(a) -1 # define Fplay_open_default() -1 # define Fplay_open_display() -1 # define Fplay_open_port(a,b) -1 # define Fplay_open_sockaddr_in(a) -1 # define Fplay_close(a) 0 # define Fplay_ping(a) 0 # define Fplay_ping_sockaddr_in(a) 0 # define Fplay_ping_sockfd(a) 0 # define Fplay_sound(a,b) 0 # define Fplay_default(a) 0 # define Fplay_convert(a) NULL # define Fplay_pack(a) 0 # define Fplay_unpack(a) 0 # define Frptp_open(a,b,c,d) -1 # define Frptp_read(a,b,c) 0 # define Frptp_write(a,b,c) 0 # define Frptp_close(a) 0 # define Frptp_perror(a) # define Frptp_getline(a,b,c) 0 # define Frptp_command(a,b,c,d) 0 # define Frptp_parse(a,b) NULL # define Frptp_async_write(a,b,c,d) 0 # define Frptp_async_register(a,b,c) # define Frptp_async_notify(a,b,c) # define Frptp_async_process(a,b) # define Frptp_main_loop() 0 # define Frptp_stop_main_loop(a) #endif #endif fvwm-2.6.5.orig/libs/gravity.c0000644000175000017500000002760111454107601014411 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "fvwmlib.h" #include "Parse.h" #include "Strings.h" #include "gravity.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ struct _gravity_offset { int x, y; }; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ #define STRINGS_PER_DIR 7 static char *gravity_dir_optlist[] = { "-", "N", "North", "Top", "t", "Up", "u", "]", "E", "East", "Right", "r", "Right", "r", "_", "S", "South", "Bottom", "b", "Down", "d", "[", "W", "West", "Left", "l", "Left", "l", "^", "NE", "NorthEast", "TopRight", "tr", "UpRight", "ur", ">", "SE", "SouthEast", "BottomRight", "br", "DownRight", "dr", "v", "SW", "SouthWest", "BottomLeft", "bl", "DownLeft", "dl", "<", "NW", "NorthWest", "TopLeft", "tl", "UpLeft", "ul", ".", "C", "Center", "Centre", NULL, NULL, NULL, NULL }; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ /* map gravity to (x,y) offset signs for adding to x and y when window is * mapped to get proper placement. */ void gravity_get_offsets(int grav, int *xp,int *yp) { static struct _gravity_offset gravity_offsets[11] = { { 0, 0 }, /* ForgetGravity */ { -1, -1 }, /* NorthWestGravity */ { 0, -1 }, /* NorthGravity */ { 1, -1 }, /* NorthEastGravity */ { -1, 0 }, /* WestGravity */ { 0, 0 }, /* CenterGravity */ { 1, 0 }, /* EastGravity */ { -1, 1 }, /* SouthWestGravity */ { 0, 1 }, /* SouthGravity */ { 1, 1 }, /* SouthEastGravity */ { 0, 0 }, /* StaticGravity */ }; if (grav < ForgetGravity || grav > StaticGravity) { *xp = *yp = 0; } else { *xp = (int)gravity_offsets[grav].x; *yp = (int)gravity_offsets[grav].y; } return; } /* Move a rectangle while taking gravity into account. */ void gravity_move(int gravity, rectangle *rect, int xdiff, int ydiff) { int xoff; int yoff; gravity_get_offsets(gravity, &xoff, &yoff); rect->x -= xoff * xdiff; rect->y -= yoff * ydiff; return; } /* Resize rectangle while taking gravity into account. */ void gravity_resize(int gravity, rectangle *rect, int wdiff, int hdiff) { int xoff; int yoff; gravity_get_offsets(gravity, &xoff, &yoff); rect->x -= (wdiff * (xoff + 1)) / 2; rect->width += wdiff; rect->y -= (hdiff * (yoff + 1)) / 2; rect->height += hdiff; return; } /* Moves a child rectangle taking its gravity into accout as if the parent * rectangle was moved and resized. */ void gravity_move_resize_parent_child( int child_gravity, rectangle *parent_diff_r, rectangle *child_r) { int xoff; int yoff; gravity_get_offsets(child_gravity, &xoff, &yoff); child_r->x -= xoff * parent_diff_r->x; child_r->y -= yoff * parent_diff_r->y; child_r->x += ((xoff + 1) * parent_diff_r->width) / 2; child_r->y += ((yoff + 1) * parent_diff_r->height) / 2; return; } direction_t gravity_grav_to_dir( int grav) { switch (grav) { case NorthWestGravity: return DIR_NW; case NorthGravity: return DIR_N; case NorthEastGravity: return DIR_NE; case WestGravity: return DIR_W; case CenterGravity: return DIR_NONE; case EastGravity: return DIR_E; case SouthWestGravity: return DIR_SW; case SouthGravity: return DIR_S; case SouthEastGravity: return DIR_SE; case ForgetGravity: case StaticGravity: default: return DIR_NONE; } } int gravity_dir_to_grav( direction_t dir) { switch (dir) { case DIR_N: return NorthGravity; case DIR_E: return EastGravity; case DIR_S: return SouthGravity; case DIR_W: return WestGravity; case DIR_NE: return NorthEastGravity; case DIR_SE: return SouthEastGravity; case DIR_SW: return SouthWestGravity; case DIR_NW: return NorthWestGravity; case DIR_NONE: default: return ForgetGravity; } } int gravity_combine_xy_grav( int grav_x, int grav_y) { switch (grav_x) { case NorthWestGravity: case WestGravity: case SouthWestGravity: grav_x = WestGravity; break; case NorthEastGravity: case EastGravity: case SouthEastGravity: grav_x = EastGravity; break; default: grav_x = CenterGravity; break; } switch (grav_y) { case NorthWestGravity: case NorthGravity: case NorthEastGravity: grav_y = NorthGravity; break; case SouthWestGravity: case SouthGravity: case SouthEastGravity: grav_y = SouthGravity; break; default: grav_y = CenterGravity; break; } if (grav_x == CenterGravity) { return grav_y; } switch (grav_y) { case NorthGravity: return (grav_x == WestGravity) ? NorthWestGravity : NorthEastGravity; case SouthGravity: return (grav_x == WestGravity) ? SouthWestGravity : SouthEastGravity; case CenterGravity: default: return grav_x; } return 0; } void gravity_split_xy_grav( int *ret_grav_x, int *ret_grav_y, int in_grav) { switch (in_grav) { case NorthWestGravity: case WestGravity: case SouthWestGravity: *ret_grav_x = WestGravity; break; case NorthEastGravity: case EastGravity: case SouthEastGravity: *ret_grav_x = EastGravity; break; case NorthGravity: case CenterGravity: case SouthGravity: case ForgetGravity: case StaticGravity: default: *ret_grav_x = CenterGravity; break; } switch (in_grav) { case NorthWestGravity: case NorthGravity: case NorthEastGravity: *ret_grav_y = NorthGravity; break; case SouthWestGravity: case SouthGravity: case SouthEastGravity: *ret_grav_y = SouthGravity; break; case WestGravity: case CenterGravity: case EastGravity: case ForgetGravity: case StaticGravity: default: *ret_grav_y = CenterGravity; break; } } int gravity_combine_xy_dir( int dir_x, int dir_y) { switch (dir_x) { case DIR_W: case DIR_NW: case DIR_SW: dir_x = DIR_W; break; case DIR_E: case DIR_NE: case DIR_SE: dir_x = DIR_E; break; default: dir_x = DIR_NONE; break; } switch (dir_y) { case DIR_N: case DIR_NW: case DIR_NE: dir_y = DIR_N; break; case DIR_S: case DIR_SW: case DIR_SE: dir_y = DIR_S; break; default: dir_y = DIR_NONE; break; } if (dir_x == DIR_NONE) { return dir_y; } switch (dir_y) { case DIR_N: return (dir_x == DIR_W) ? DIR_NW : DIR_NE; case DIR_S: return (dir_x == DIR_W) ? DIR_SW : DIR_SE; case DIR_NONE: default: return dir_x; } } void gravity_split_xy_dir( int *ret_dir_x, int *ret_dir_y, int in_dir) { switch (in_dir) { case DIR_W: case DIR_SW: case DIR_NW: *ret_dir_x = DIR_W; break; case DIR_E: case DIR_NE: case DIR_SE: *ret_dir_x = DIR_E; break; case DIR_N: case DIR_S: case DIR_NONE: default: *ret_dir_x = DIR_NONE; break; } switch (in_dir) { case DIR_N: case DIR_NW: case DIR_NE: *ret_dir_y = DIR_N; break; case DIR_S: case DIR_SW: case DIR_SE: *ret_dir_y = DIR_S; break; case DIR_W: case DIR_E: case DIR_NONE: default: *ret_dir_y = DIR_NONE; break; } } static inline int __gravity_override_one_axis(int dir_orig, int dir_mod) { int ret_dir; if (dir_mod == DIR_NONE) { ret_dir = dir_orig; } else { ret_dir = dir_mod; } return ret_dir; } int gravity_override_dir( int dir_orig, int dir_mod) { int ret_dir; int ret_x; int ret_y; int orig_x; int orig_y; int mod_x; int mod_y; gravity_split_xy_dir(&orig_x, &orig_y, dir_orig); gravity_split_xy_dir(&mod_x, &mod_y, dir_mod); ret_x = __gravity_override_one_axis(orig_x, mod_x); ret_y = __gravity_override_one_axis(orig_y, mod_y); ret_dir = gravity_combine_xy_dir(ret_x, ret_y); return ret_dir; } int gravity_dir_to_sign_one_axis( direction_t dir) { switch (dir) { case DIR_N: case DIR_W: return -1; case DIR_S: case DIR_E: return 1; default: return 0; } } /* Parses the next token in action and returns * * 0 if it is N, North, Top or Up * 1 if it is E, East, Right or Right * 2 if it is S, South, Bottom or Down * 3 if it is E, West, Left or Left * 4 if it is NE, NorthEast, TopRight or UpRight * 5 if it is SE, SouthEast, BottomRight or DownRight * 6 if it is SW, SouthWest, BottomLeft or DownLeft * 7 if it is NW, NorthWest, TopLeft or UpLeft * 8 if it is C, Center or Centre * default_ret if no string matches. * * A pointer to the first character in action behind the token is returned * through ret_action in this case. ret_action may be NULL. If the token * matches none of these strings the default_ret value is returned and the * action itself is passed back in ret_action. */ direction_t gravity_parse_dir_argument( char *action, char **ret_action, direction_t default_ret) { int index; int rc; char *next; next = GetNextTokenIndex(action, gravity_dir_optlist, 0, &index); if (index == -1) { /* nothing selected, use default and don't modify action */ rc = default_ret; next = action; } else { rc = index / STRINGS_PER_DIR; } if (ret_action) { *ret_action = next; } return (direction_t)rc; } char *gravity_dir_to_string(direction_t dir, char *default_str) { char *str = NULL; int d = dir * STRINGS_PER_DIR; if (d >= sizeof(gravity_dir_optlist)/sizeof(gravity_dir_optlist[0])) { return default_str; } str = gravity_dir_optlist[d]; if (str == NULL) { return default_str; } return str; } multi_direction_t gravity_parse_multi_dir_argument( char *action, char **ret_action) { int rc = MULTI_DIR_NONE; char *token, *str; direction_t dir = gravity_parse_dir_argument(action, ret_action, -1); if (dir != -1) { rc = (1 << dir); } else { token = PeekToken(action, &str); if (StrEquals(token, "all")) { rc = MULTI_DIR_ALL; *ret_action = str; } else { rc = MULTI_DIR_NONE; } } return (multi_direction_t)rc; } void gravity_get_next_multi_dir(int dir_set, multi_direction_t *dir) { if (*dir == MULTI_DIR_NONE) { *dir = MULTI_DIR_FIRST; if (dir_set & *dir) { return; } } while(*dir != MULTI_DIR_LAST) { *dir = (*dir << 1); if (dir_set & *dir) { return; } } *dir = MULTI_DIR_NONE; return; } direction_t gravity_multi_dir_to_dir(multi_direction_t mdir) { direction_t dir = DIR_NONE; for ( ; mdir != 0; dir++) { mdir = (mdir >> 1); } if (dir > DIR_ALL_MASK) { dir = DIR_NONE; } return dir; } void gravity_rotate_xy(rotation_t rot, int x, int y, int *ret_x, int *ret_y) { int tx; int ty; switch (rot) { case ROTATION_90: /* CW */ tx = -y; ty = x; break; case ROTATION_180: tx = -x; ty = -y; break; case ROTATION_270: /* CCW */ tx = y; ty = -x; break; default: case ROTATION_0: tx = x; ty = y; break; } *ret_x = tx; *ret_y = ty; return; } rotation_t gravity_add_rotations(rotation_t rot1, rotation_t rot2) { rotation_t rot; rot = ((rot1 + rot2) & ROTATION_MASK); return rot; } fvwm-2.6.5.orig/libs/Target.c0000644000175000017500000001630710630367353014162 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ** fvwmlib_get_target_window and fvwmlib_keyboard_shortcuts - handle window ** selection from modules and fvwm. */ #include "config.h" #include #include #include #include #include #include #include #include #include "fvwmlib.h" #include "Grab.h" #include "Target.h" void fvwmlib_keyboard_shortcuts( Display *dpy, int screen, XEvent *Event, int x_move_size, int y_move_size, int *x_defect, int *y_defect, int ReturnEvent) { int x; int y; int x_root; int y_root; int x_move; int y_move; KeySym keysym; Window JunkRoot; unsigned int JunkMask; if (y_move_size < DEFAULT_KDB_SHORTCUT_MOVE_DISTANCE) { y_move_size = DEFAULT_KDB_SHORTCUT_MOVE_DISTANCE; } if (x_move_size < DEFAULT_KDB_SHORTCUT_MOVE_DISTANCE) { x_move_size = DEFAULT_KDB_SHORTCUT_MOVE_DISTANCE; } if (Event->xkey.state & ControlMask) { x_move_size = y_move_size = KDB_SHORTCUT_MOVE_DISTANCE_SMALL; } if (Event->xkey.state & ShiftMask) { x_move_size = y_move_size = KDB_SHORTCUT_MOVE_DISTANCE_BIG; } keysym = XLookupKeysym(&Event->xkey,0); x_move = 0; y_move = 0; switch(keysym) { case XK_Up: case XK_KP_8: case XK_k: case XK_p: y_move = -y_move_size; break; case XK_Down: case XK_KP_2: case XK_n: case XK_j: y_move = y_move_size; break; case XK_Left: case XK_KP_4: case XK_b: case XK_h: x_move = -x_move_size; break; case XK_Right: case XK_KP_6: case XK_f: case XK_l: x_move = x_move_size; break; case XK_KP_1: x_move = -x_move_size; y_move = y_move_size; break; case XK_KP_3: x_move = x_move_size; y_move = y_move_size; break; case XK_KP_7: x_move = -x_move_size; y_move = -y_move_size; break; case XK_KP_9: x_move = x_move_size; y_move = -y_move_size; break; case XK_Return: case XK_KP_Enter: case XK_space: /* beat up the event */ Event->type = ReturnEvent; break; case XK_Escape: /* simple code to bag out of move - CKH */ /* return keypress event instead */ Event->type = KeyPress; Event->xkey.keycode = XKeysymToKeycode( Event->xkey.display,keysym); break; default: break; } if (x_move || y_move) { int x_def_new = 0; int y_def_new = 0; if (FQueryPointer( dpy, RootWindow(dpy, screen), &JunkRoot, &Event->xany.window, &x_root, &y_root, &x, &y, &JunkMask) == False) { /* pointer is on a different screen - do nothing */ return; } if (x + x_move < 0) { x_def_new = x + x_move; x_move = -x; } else if (x + x_move >= DisplayWidth(dpy, DefaultScreen(dpy))) { x_def_new = x + x_move - DisplayWidth( dpy, DefaultScreen(dpy)); x_move = DisplayWidth(dpy, DefaultScreen(dpy)) - x - 1; } if (y + y_move < 0) { y_def_new = y + y_move; y_move = -y; } else if (y + y_move >= DisplayHeight(dpy, DefaultScreen(dpy))) { y_def_new = y + y_move - DisplayHeight( dpy, DefaultScreen(dpy)); y_move = DisplayHeight( dpy, DefaultScreen(dpy)) - y - 1; } if (x_defect) { int diff = 0; *x_defect += x_def_new; if (*x_defect > 0 && x_move < 0) { diff = min(*x_defect, -x_move); } else if (*x_defect < 0 && x_move > 0) { diff = max(*x_defect, -x_move); } *x_defect -= diff; x_move += diff; } if (y_defect) { int diff = 0; *y_defect += y_def_new; if (*y_defect > 0 && y_move < 0) { diff = min(*y_defect, -y_move); } else if (*y_defect < 0 && y_move > 0) { diff = max(*y_defect, -y_move); } *y_defect -= diff; y_move += diff; } if (x_move || y_move) { FWarpPointer( dpy, None, RootWindow(dpy, screen), 0, 0, 0, 0, x_root + x_move, y_root + y_move); } /* beat up the event */ Event->type = MotionNotify; Event->xkey.x += x_move; Event->xkey.y += y_move; Event->xkey.x_root += x_move; Event->xkey.y_root += y_move; } } void fvwmlib_get_target_window( Display *dpy, int screen, char *MyName, Window *app_win, Bool return_subwindow) { XEvent eventp; int val = -10,trials; Bool finished = False; Bool canceled = False; Window Root = RootWindow(dpy, screen); int is_key_pressed = 0; int is_button_pressed = 0; KeySym keysym; trials = 0; while((trials <10)&&(val != GrabSuccess)) { val=XGrabPointer(dpy, Root, True, ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, Root, XCreateFontCursor(dpy,XC_crosshair), CurrentTime); switch (val) { case GrabInvalidTime: case GrabNotViewable: /* give up */ trials += 100000; break; case GrabSuccess: break; case AlreadyGrabbed: case GrabFrozen: default: usleep(10000); trials++; break; } } if(val != GrabSuccess) { fprintf(stderr,"%s: Couldn't grab the cursor!\n",MyName); exit(1); } MyXGrabKeyboard(dpy); while (!finished && !canceled) { FMaskEvent(dpy, ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask, &eventp); switch (eventp.type) { case KeyPress: is_key_pressed++; break; case KeyRelease: keysym = XLookupKeysym(&eventp.xkey,0); if( !is_key_pressed ) break; switch (keysym) { case XK_Escape: canceled = True; break; case XK_space: case XK_Return: case XK_KP_Enter: finished = True; break; default: fvwmlib_keyboard_shortcuts( dpy, screen, &eventp, 0, 0, NULL, NULL, 0); break; } break; case ButtonPress: is_button_pressed++; break; case ButtonRelease: if( is_button_pressed ) finished = True; break; } } MyXUngrabKeyboard(dpy); XUngrabPointer(dpy, CurrentTime); XSync(dpy,0); if (canceled) { *app_win = None; return; } *app_win = eventp.xany.window; if(return_subwindow && eventp.xbutton.subwindow != None) *app_win = eventp.xbutton.subwindow; return; } Window fvwmlib_client_window(Display *dpy, Window input) { Atom _XA_WM_STATE; unsigned int nchildren; Window root, parent, *children,target; unsigned long nitems, bytesafter; unsigned char *prop; Atom atype; int aformat; int i; _XA_WM_STATE = XInternAtom (dpy, "WM_STATE", False); if ( XGetWindowProperty( dpy, input, _XA_WM_STATE , 0L, 3L , False, _XA_WM_STATE, &atype, &aformat, &nitems, &bytesafter, &prop) == Success) { if(prop != NULL) { XFree(prop); return input; } } if (!XQueryTree(dpy, input, &root, &parent, &children, &nchildren)) return None; for (i = 0; i < nchildren; i++) { target = fvwmlib_client_window(dpy, children[i]); if(target != None) { XFree((char *)children); return target; } } XFree((char *)children); return None; } fvwm-2.6.5.orig/libs/Makefile.in0000644000175000017500000005556611744241233014642 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = libs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in alloca.c \ atexit.c gethostname.c strcasecmp.c strdup.c strerror.c \ strncasecmp.c usleep.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libfvwm_a_AR = $(AR) $(ARFLAGS) libfvwm_a_DEPENDENCIES = @LIBOBJS@ @ALLOCA@ am_libfvwm_a_OBJECTS = gravity.$(OBJEXT) BidiJoin.$(OBJEXT) \ Flocale.$(OBJEXT) PictureUtils.$(OBJEXT) FScreen.$(OBJEXT) \ Graphics.$(OBJEXT) PictureGraphics.$(OBJEXT) \ Bindings.$(OBJEXT) FlocaleCharset.$(OBJEXT) Parse.$(OBJEXT) \ PictureImageLoader.$(OBJEXT) Colorset.$(OBJEXT) \ ColorUtils.$(OBJEXT) CombineChars.$(OBJEXT) Module.$(OBJEXT) \ FRender.$(OBJEXT) Ficonv.$(OBJEXT) envvar.$(OBJEXT) \ Fft.$(OBJEXT) gravity.$(OBJEXT) XResource.$(OBJEXT) \ FEvent.$(OBJEXT) FImage.$(OBJEXT) WinMagic.$(OBJEXT) \ Target.$(OBJEXT) Picture.$(OBJEXT) XError.$(OBJEXT) \ queue.$(OBJEXT) fvwmsignal.$(OBJEXT) System.$(OBJEXT) \ PictureBase.$(OBJEXT) Cursor.$(OBJEXT) Strings.$(OBJEXT) \ fvwmrect.$(OBJEXT) FRenderInit.$(OBJEXT) safemalloc.$(OBJEXT) \ FBidi.$(OBJEXT) wild.$(OBJEXT) Grab.$(OBJEXT) Event.$(OBJEXT) \ ClientMsg.$(OBJEXT) setpgrp.$(OBJEXT) FShape.$(OBJEXT) \ FGettext.$(OBJEXT) Rectangles.$(OBJEXT) timeout.$(OBJEXT) \ flist.$(OBJEXT) charmap.$(OBJEXT) wcontext.$(OBJEXT) \ modifiers.$(OBJEXT) fsm.$(OBJEXT) FTips.$(OBJEXT) \ fio.$(OBJEXT) fvwmlib.$(OBJEXT) libfvwm_a_OBJECTS = $(am_libfvwm_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libfvwm_a_SOURCES) DIST_SOURCES = $(libfvwm_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ noinst_LIBRARIES = libfvwm.a libfvwm_a_SOURCES = \ BidiJoin.h Bindings.h ClientMsg.h ColorUtils.h Colorset.h \ CombineChars.h Cursor.h Event.h FBidi.h FEvent.h FGettext.h FImage.h \ FRender.h FRenderInit.h FRenderInterface.h FSMlib.h FScreen.h \ FShape.h FShm.h FTips.h Fcursor.h Fft.h FftInterface.h Ficonv.h \ Flocale.h FlocaleCharset.h Fplay.h Fpng.h Fsvg.h Fxpm.h Grab.h \ Graphics.h Module.h Parse.h Picture.h PictureBase.h \ PictureDitherMatrice.h PictureGraphics.h PictureImageLoader.h \ PictureUtils.h Rectangles.h Strings.h System.h Target.h WinMagic.h \ XError.h XResource.h charmap.h defaults.h envvar.h fio.h flist.h \ fsm.h ftime.h fvwm_sys_stat.h fvwmlib.h fvwmrect.h fvwmsignal.h \ gravity.c gravity.h lang-strings.h modifiers.h queue.h safemalloc.h \ setpgrp.h timeout.h vpacket.h wcontext.h wild.h \ \ BidiJoin.c Flocale.c PictureUtils.c FScreen.c Graphics.c \ PictureGraphics.c Bindings.c FlocaleCharset.c Parse.c \ PictureImageLoader.c Colorset.c ColorUtils.c CombineChars.c Module.c \ FRender.c Ficonv.c envvar.c Fft.c gravity.c \ XResource.c FEvent.c FImage.c WinMagic.c Target.c Picture.c XError.c \ queue.c fvwmsignal.c System.c PictureBase.c Cursor.c Strings.c \ fvwmrect.c FRenderInit.c safemalloc.c FBidi.c \ wild.c Grab.c Event.c ClientMsg.c setpgrp.c FShape.c \ FGettext.c Rectangles.c timeout.c flist.c charmap.c wcontext.c \ modifiers.c fsm.c FTips.c fio.c fvwmlib.c libfvwm_a_LIBADD = @LIBOBJS@ @ALLOCA@ INCLUDES = -I$(top_srcdir) $(xpm_CFLAGS) $(Xft_CFLAGS) $(X_CFLAGS) \ $(iconv_CFLAGS) $(Xrender_CFLAGS) $(Bidi_CFLAGS) $(png_CFLAGS) \ $(rsvg_CFLAGS) $(intl_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu libs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libfvwm.a: $(libfvwm_a_OBJECTS) $(libfvwm_a_DEPENDENCIES) -rm -f libfvwm.a $(libfvwm_a_AR) libfvwm.a $(libfvwm_a_OBJECTS) $(libfvwm_a_LIBADD) $(RANLIB) libfvwm.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/atexit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/gethostname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strdup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strerror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strncasecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/usleep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BidiJoin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Bindings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ClientMsg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ColorUtils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Colorset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CombineChars.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Cursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Event.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FBidi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FEvent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FGettext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FImage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FRender.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FRenderInit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FScreen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FShape.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTips.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Fft.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Ficonv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Flocale.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FlocaleCharset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Grab.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Graphics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Module.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Picture.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PictureBase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PictureGraphics.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PictureImageLoader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PictureUtils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Rectangles.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Strings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/System.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Target.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WinMagic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XError.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XResource.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charmap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/envvar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvwmlib.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvwmrect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvwmsignal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gravity.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modifiers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/safemalloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setpgrp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcontext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wild.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/libs/ClientMsg.h0000644000175000017500000000102110556634174014616 0ustar vwcvwc/* -*-c-*- */ /* * ICCCM Client Messages - Section 4.2.8 of the ICCCM dictates that all * client messages will have the following form: * * event type ClientMessage * message type _XA_WM_PROTOCOLS * window tmp->w * format 32 * data[0] message atom * data[1] time stamp */ #include #include #include void send_clientmessage(Display *disp, Window w, Atom a, Time timestamp); extern Atom _XA_WM_PROTOCOLS; fvwm-2.6.5.orig/libs/wild.c0000644000175000017500000000422510466316565013675 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include "wild.h" /* * Does `string' match `pattern'? '*' in pattern matches any sub-string * (including the null string) '?' matches any single char. For use * by filenameforall. Note that '*' matches across directory boundaries * * This code donated by Paul Hudson * It is public domain, no strings attached. No guarantees either. * */ int matchWildcards(const char *pattern, const char *string) { if(string == NULL) { if(pattern == NULL) return 1; else if(strcmp(pattern,"*")==0) return 1; else return 0; } if(pattern == NULL) return 1; while (*string && *pattern) { if (*pattern == '?') { /* match any character */ pattern += 1; string += 1; } else if (*pattern == '*') { /* see if the rest of the pattern matches any trailing * substring of the string. */ pattern += 1; if (*pattern == 0) { return 1; /* trailing * must match rest */ } while (*string) { if (matchWildcards(pattern,string)) { return 1; } string++; } return 0; } else { if (*pattern == '\\') { /* has strange, but harmless effects if the * last character is a '\\' */ pattern ++; } if (*pattern++ != *string++) { return 0; } } } if((*pattern == 0)&&(*string == 0)) return 1; if((*string == 0)&&(strcmp(pattern,"*")==0)) return 1; return 0; } fvwm-2.6.5.orig/libs/queue.c0000644000175000017500000001753707677641664014107 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "safemalloc.h" #include "queue.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ typedef struct fqueue_record { struct fqueue_record *next; void *object; struct { unsigned is_scheduled_for_deletion; unsigned is_just_created; } flags; } fqueue_record; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ /* Make newly added items permanent and destroy items scheduled for deletion. */ static void fqueue_cleanup_queue( fqueue *fq, destroy_fqueue_object_t destroy_func) { fqueue_record *head; fqueue_record *tail; fqueue_record *prev; fqueue_record *next; fqueue_record *rec; for (head = NULL, tail = NULL, prev = NULL, rec = fq->first; rec != NULL; rec = next) { if (rec->flags.is_scheduled_for_deletion) { /* destroy and skip it */ next = rec->next; if (rec->object != NULL && destroy_func != NULL) { destroy_func(rec->object); } if (prev != NULL) { prev->next = next; } free(rec); } else { rec->flags.is_just_created = 0; if (head == NULL) { head = rec; } tail = rec; prev = rec; next = rec->next; } } fq->first = head; fq->last = tail; return; } /* Recursively lock the queue. While locked, objects are not deleted from the * queue but marked for later deletion. New objects are marked as such and are * skipped by the queue functions. */ static void fqueue_lock_queue(fqueue *fq) { fq->lock_level++; return; } /* Remove one lock level */ static void fqueue_unlock_queue( fqueue *fq, destroy_fqueue_object_t destroy_func) { switch (fq->lock_level) { case 0: /* bug */ break; case 1: if (fq->flags.is_dirty) { fqueue_cleanup_queue(fq, destroy_func); } /* fall through */ default: fq->lock_level--; return; } return; } /* Chack and possibly execute the action associated with a queue object. * Schedule the object for deletion if it was executed. */ static void fqueue_operate( fqueue *fq, fqueue_record *rec, check_fqueue_object_t check_func, operate_fqueue_object_t operate_func, void *operate_args) { if (rec == NULL || rec->flags.is_scheduled_for_deletion) { return; } if (check_func == NULL || check_func(rec->object, operate_args) == 1) { if (operate_func != NULL) { operate_func(rec->object, operate_args); } rec->flags.is_scheduled_for_deletion = 1; fq->flags.is_dirty = 1; } return; } /* ---------------------------- builtin commands --------------------------- */ /* * Basic queue management */ void fqueue_init(fqueue *fq) { memset(fq, 0, sizeof(*fq)); return; } unsigned int fqueue_get_length(fqueue *fq) { unsigned int len; fqueue_record *t; for (t = fq->first, len = 0; t != NULL; t = t->next) { if (!t->flags.is_scheduled_for_deletion) { len++; } } return len; } /* * Add record to queue */ void fqueue_add_at_front( fqueue *fq, void *object) { fqueue_record *rec; rec = (fqueue_record *)safemalloc(sizeof(fqueue_record)); memset(rec, 0, sizeof(*rec)); rec->object = object; rec->next = fq->first; if (fq->lock_level > 0) { rec->flags.is_just_created = 1; fq->flags.is_dirty = 1; } fq->first = rec; return; } void fqueue_add_at_end( fqueue *fq, void *object) { fqueue_record *rec; rec = (fqueue_record *)safemalloc(sizeof(fqueue_record)); memset(rec, 0, sizeof(*rec)); rec->object = object; if (fq->lock_level > 0) { rec->flags.is_just_created = 1; fq->flags.is_dirty = 1; } if (fq->first == NULL) { fq->first = rec; } else { fq->last->next = rec; } fq->last = rec; rec->next = NULL; return; } void fqueue_add_inside( fqueue *fq, void *object, cmp_objects_t cmp_objects, void *cmp_args) { fqueue_record *rec; fqueue_record *p; fqueue_record *t; rec = (fqueue_record *)safemalloc(sizeof(fqueue_record)); memset(rec, 0, sizeof(*rec)); rec->object = object; if (fq->lock_level > 0) { rec->flags.is_just_created = 1; fq->flags.is_dirty = 1; } /* search place to insert record */ for (p = NULL, t = fq->first; t != NULL && cmp_objects(object, t->object, cmp_args) >= 0; p = t, t = t->next) { /* nothing to do here */ } /* insert record */ if (p == NULL) { /* insert at start */ rec->next = fq->first; fq->first = rec; } else { /* insert after p */ rec->next = p->next; p->next = rec; } if (t == NULL) { fq->last = rec; } return; } /* * Fetch queue objects */ /* Returns the object of the first queue record throuch *ret_object. Returns * 0 if the queue is empty and 1 otherwise. */ int fqueue_get_first( fqueue *fq, void **ret_object) { fqueue_record *rec; for (rec = fq->first; rec != NULL && rec->flags.is_scheduled_for_deletion; rec = rec->next) { /* nothing */ } if (rec == NULL) { return 0; } *ret_object = rec->object; return 1; } /* * Operate on queue objects and possibly remove them from the queue */ /* Runs the operate_func on the first record in the queue. If that function * is NULL or returns 1, the record is removed from the queue. The object of * the queue record must have been freed in operate_func. */ void fqueue_remove_or_operate_from_front( fqueue *fq, check_fqueue_object_t check_func, operate_fqueue_object_t operate_func, destroy_fqueue_object_t destroy_func, void *operate_args) { fqueue_lock_queue(fq); fqueue_operate(fq, fq->first, check_func, operate_func, operate_args); fqueue_unlock_queue(fq, destroy_func); return; } /* Same as above but operates on last record in queue */ void fqueue_remove_or_operate_from_end( fqueue *fq, check_fqueue_object_t check_func, operate_fqueue_object_t operate_func, destroy_fqueue_object_t destroy_func, void *operate_args) { fqueue_lock_queue(fq); fqueue_operate( fq, fq->last, check_func, operate_func, operate_args); fqueue_unlock_queue(fq, destroy_func); return; } /* Same as above but operates on all records in the queue. */ void fqueue_remove_or_operate_all( fqueue *fq, check_fqueue_object_t check_func, operate_fqueue_object_t operate_func, destroy_fqueue_object_t destroy_func, void *operate_args) { fqueue_record *t; if (fq->first == NULL) { return; } fqueue_lock_queue(fq); /* search record(s) to remove */ for (t = fq->first; t != NULL; t = t->next) { if (t->flags.is_just_created || t->flags.is_scheduled_for_deletion) { /* skip */ continue; } fqueue_operate(fq, t, check_func, operate_func, operate_args); } fqueue_unlock_queue(fq, destroy_func); return; } fvwm-2.6.5.orig/libs/safemalloc.c0000644000175000017500000000533210630367353015036 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include "safemalloc.h" static void alloc_failed(char *c, int length) { fprintf(stderr, "%s of %d bytes failed. Exiting\n", c, length); exit(1); } /*********************************************************************** * * Procedure: * safemalloc - mallocs specified space or exits if there's a * problem * ***********************************************************************/ char *safemalloc(int length) { char *ptr; if(length <= 0) length = 1; ptr = malloc(length); if(ptr == (char *)0) { /* doesn't return */ alloc_failed("malloc", length); } return ptr; } /*********************************************************************** * * Procedure: * safecalloc - callocs specified space or exits if there's a * problem * ***********************************************************************/ char *safecalloc(int num, int length) { char *ptr; ptr = calloc(num, length); if(ptr == (char *)0) { /* doesn't return */ alloc_failed("calloc", length); } return ptr; } /*********************************************************************** * * Procedure: * saferealloc - reallocs specified space or exits if there's a * problem * ***********************************************************************/ char *saferealloc(char *src, int length) { char *ptr; if (src) ptr = realloc((void *)src, length); else ptr = malloc(length); if(ptr == (char *)0) { /* doesn't return */ alloc_failed("realloc", length); } return ptr; } /*********************************************************************** * * Procedure: * safestrdup - duplicates a string or exits if there's a * problem * ***********************************************************************/ char *safestrdup(const char *src) { char *cpy = strdup(src); if (cpy == (char *)0) { /* doesn't return */ alloc_failed("strdup", strlen(src) + (size_t)1); } return cpy; } fvwm-2.6.5.orig/libs/FRenderInterface.h0000644000175000017500000000110307677641664016114 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ #ifndef F_RENDER_INTERFACE_H #define F_RENDER_INTERFACE_H Bool FRenderTintRectangle( Display *dpy, Window win, Pixmap mask, Pixel tint, int shade_percent, Drawable d, int dest_x, int dest_y, int dest_w, int dest_h); int FRenderRender( Display *dpy, Window win, Pixmap pixmap, Pixmap mask, Pixmap alpha, int depth, int shade_percent, Pixel tint, int tint_percent, Drawable d, GC gc, GC alpha_gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h, Bool do_repeat); #endif fvwm-2.6.5.orig/libs/Bindings.c0000644000175000017500000005005210656151547014470 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include #include #include #include "libs/fvwmlib.h" #include "libs/Strings.h" #include "libs/wild.h" #include "libs/Grab.h" #include "libs/Bindings.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "libs/modifiers.h" static Bool is_grabbing_everything = False; static int key_min = 0; static int key_max = 0; /* Free the memory use by a binding. */ void FreeBindingStruct(Binding *b) { if (b->key_name) { free(b->key_name); } STROKE_CODE( if (b->Stroke_Seq) free(b->Stroke_Seq); ); if (b->Action) { free(b->Action); } if (b->Action2) { free(b->Action2); } if (b->windowName) { free(b->windowName); } free(b); return; } void FreeBindingList(Binding *b) { Binding *t; for (; b != NULL; b = t) { t = b->NextBinding; FreeBindingStruct(b); } return; } /* Unlink a binding b from a binding list pblist. The previous binding in the * list (prev) must be given also. Pass NULL at the beginning of the list. * The *pblist pointer may be modified by this function. */ static void UnlinkBinding(Binding **pblist, Binding *b, Binding *prev) { Binding *t; if (!prev && b != *pblist) { for (t = *pblist; t && t != b; prev = t, t = t->NextBinding) { /* Find the previous binding in the list. */ } if (t == NULL) { /* Binding not found */ return; } } if (prev) { /* middle of list */ prev->NextBinding = b->NextBinding; } else { /* must have been first one, set new start */ *pblist = b->NextBinding; } return; } /* To remove a binding from the global list (probably needs more processing * for mouse binding lines though, like when context is a title bar button). * Specify either button or keysym, depending on type. */ void RemoveBinding(Binding **pblist, Binding *b, Binding *prev) { UnlinkBinding(pblist, b, NULL); FreeBindingStruct(b); return; } /* * * Actually adds a new binding to a list (pblist) of existing bindings. * Specify either button or keysym/key_name, depending on type. * The parameters action and action2 are assumed to reside in malloced memory * that will be freed in RemoveBinding. The key_name is copied into private * memory and has to be freed by the caller. * */ int AddBinding( Display *dpy, Binding **pblist, binding_t type, STROKE_ARG(void *stroke) int button, KeySym keysym, char *key_name, int modifiers, int contexts, void *action, void *action2, char *windowName) { int i; int min; int max; int maxmods; int m; int mask; int count = 0; KeySym tkeysym; Binding *temp; /* ** Unfortunately a keycode can be bound to multiple keysyms and a ** keysym can bound to multiple keycodes. Thus we have to check every ** keycode with any single modifier. */ if (BIND_IS_KEY_BINDING(type)) { if (key_max == 0) { XDisplayKeycodes(dpy, &key_min, &key_max); } min=key_min; max=key_max; maxmods = 8; } else { min = button; max = button; maxmods = 0; } for (i = min; i <= max; i++) { unsigned int bound_mask = 0; /* If this is a mouse binding we'll fall through the for loop * (maxmods is zero) and the if condition is always true (type * is zero). Since min == max == button there is no loop at all * is case of a mouse binding. */ for (m = 0, tkeysym = XK_Left; m <= maxmods && tkeysym != NoSymbol; m++) { if (BIND_IS_MOUSE_BINDING(type) || STROKE_CODE(BIND_IS_STROKE_BINDING(type) ||) (tkeysym = XKeycodeToKeysym(dpy, i, m)) == keysym) { unsigned int add_modifiers = 0; unsigned int bind_mask = 1; unsigned int check_bound_mask = 0; switch (m) { case 0: /* key generates the key sym with no * modifiers depressed - bind it */ break; case 1: /* key generates the key sym with shift * depressed */ if (modifiers != AnyModifier && !(modifiers & ShiftMask)) { add_modifiers = ShiftMask; bind_mask = (1 << m); /* but don't bind it again if * already bound without * modifiers */ check_bound_mask = 1; } break; default: /* key generates the key sym with * undefined modifiers depressed - * let's make an educated guess at what * modifiers the user expected * based on the XFree86 default * configuration. */ mask = modifier_mapindex_to_mask[m - 1]; if (modifiers != AnyModifier && !(modifiers & mask) != mask) { add_modifiers = mask; bind_mask = (1 << m); /* but don't bind it again if * already bound without * modifiers */ check_bound_mask = 1; } break; } if ((bind_mask & bound_mask) || (check_bound_mask & bound_mask)) { /* already bound, break out */ break; } temp = *pblist; (*pblist) = (Binding *)safemalloc( sizeof(Binding)); (*pblist)->type = type; (*pblist)->Button_Key = i; STROKE_CODE((*pblist)->Stroke_Seq = (stroke) ? (void *)stripcpy((char *)stroke) : NULL); if (BIND_IS_KEY_BINDING(type) && key_name != NULL) { (*pblist)->key_name = stripcpy(key_name); } else { (*pblist)->key_name = NULL; } (*pblist)->Context = contexts; (*pblist)->Modifier = modifiers | add_modifiers; (*pblist)->Action = (action) ? stripcpy(action) : NULL; (*pblist)->Action2 = (action2) ? stripcpy(action2) : NULL; (*pblist)->windowName = windowName ? stripcpy(windowName) : NULL; (*pblist)->NextBinding = temp; bound_mask |= bind_mask; count++; } } } return count; } /* * replacesBinding() - does the new binding, b1, replace a current * binding, b2? */ static Bool replacesBinding(Binding *b1, Binding *b2) { if (b1->type != b2->type) { return False; } if (b1->Context != b2->Context) { return False; } if (b1->Modifier != b2->Modifier) { return False; } if (b1->Button_Key != b2->Button_Key) { return False; } /* definition: "global binding" => b->windowName == NULL * definition: "window-specific binding" => b->windowName != NULL */ if (b1->windowName && b2->windowName) { /* Both bindings are window-specific. The existing binding, b2, * is only replaced (by b1) if it applies to the same window */ if (strcmp(b1->windowName, b2->windowName) != 0) return False; } else if (b1->windowName || b2->windowName) { /* 1 binding is window-specific, the other is global - no need * to replace this binding. */ return False; } if (BIND_IS_KEY_BINDING(b1->type) || BIND_IS_MOUSE_BINDING(b1->type)) { return True; } if (1 STROKE_CODE(&& BIND_IS_STROKE_BINDING(b1->type) && strcmp(b1->Stroke_Seq, b2->Stroke_Seq) == 0)) { return True; } return False; } /* * Does exactly the opposite of AddBinding: It removes the bindings that * AddBinding would have added to the *pblist_src and collects them in the * *pblist_dest. This can be used to remove a binding completely from the * list. The bindings still have to be freed. */ void CollectBindingList( Display *dpy, Binding **pblist_src, Binding **pblist_dest, binding_t type, STROKE_ARG(void *stroke) int button, KeySym keysym, int modifiers, int contexts, char *windowName) { Binding *tmplist = NULL; Binding *btmp; Binding *bold; Binding *tmpprev; Binding *oldprev; /* generate a private list of bindings to be removed */ AddBinding( dpy, &tmplist, type, STROKE_ARG(stroke) button, keysym, NULL, modifiers, contexts, NULL, NULL, windowName); /* now find equivalent bindings in the given binding list and move * them to the new clist */ for (bold = *pblist_src, oldprev = NULL; bold != NULL; oldprev = bold, bold = bold->NextBinding) { for (btmp = tmplist, tmpprev = NULL; btmp != NULL; tmpprev = btmp, btmp = btmp->NextBinding) { if (replacesBinding(btmp, bold)) { /* move matched binding from src list to dest * list */ UnlinkBinding(pblist_src, bold, oldprev); bold->NextBinding = *pblist_dest; *pblist_dest = bold; /* throw away the tmp binding */ UnlinkBinding(&tmplist, btmp, tmpprev); FreeBindingStruct(btmp); /* stop searching for this binding */ break; } } } /* throw away the temporary list */ FreeBindingList(tmplist); return; } /* * bindingAppliesToWindow() * * The Key/Mouse/PointerKey syntax (optionally) allows a window name * (or class or resource) to be specified with the binding, denoting * which windows the binding can be invoked in. This function determines * if the binding actually applies to a window based on its * name/class/resource. */ static Bool does_binding_apply_to_window( Binding *binding, const XClassHint *win_class, const char *win_name) { /* If no window name is specified with the binding then that means * the binding applies to ALL windows. */ if (binding->windowName == NULL) { return True; } else if (win_class == NULL || win_name == NULL) { return False; } if (matchWildcards(binding->windowName, win_name) == True || matchWildcards(binding->windowName, win_class->res_name) == True || matchWildcards(binding->windowName, win_class->res_class) == True) { return True; } return False; } static Bool __compare_binding( Binding *b, STROKE_ARG(char *stroke) int button_keycode, unsigned int modifier, unsigned int used_modifiers, int Context, binding_t type, const XClassHint *win_class, const char *win_name) { if (b->type != type || !(b->Context & Context)) { return False; } if ((b->Modifier & used_modifiers) != modifier && b->Modifier != AnyModifier) { return False; } if (BIND_IS_MOUSE_BINDING(type) && (b->Button_Key != button_keycode && b->Button_Key != 0)) { return False; } else if (BIND_IS_KEY_BINDING(type) && b->Button_Key != button_keycode) { return False; } #ifdef HAVE_STROKE else if (BIND_IS_STROKE_BINDING(type) && ((strcmp(b->Stroke_Seq, stroke) != 0) || b->Button_Key != button_keycode)) { return False; } #endif if (!does_binding_apply_to_window(b, win_class, win_name)) { return False; } return True; } /* is_pass_through_action() - returns true if the action indicates that the * binding should be ignored by fvwm & passed through to the underlying * window. * Note: it is only meaningful to check for pass-thru actions on * window-specific bindings. */ Bool is_pass_through_action(const char *action) { /* action should never be NULL. */ return (strncmp(action, "--", 2) == 0); } /* Check if something is bound to a key or button press and return the action * to be executed or NULL if not. */ void *CheckBinding( Binding *blist, STROKE_ARG(char *stroke) int button_keycode, unsigned int modifier,unsigned int dead_modifiers, int Context, binding_t type, const XClassHint *win_class, const char *win_name) { Binding *b; unsigned int used_modifiers = ~dead_modifiers; void *action = NULL; modifier &= (used_modifiers & ALL_MODIFIERS); for (b = blist; b != NULL; b = b->NextBinding) { if (__compare_binding( b, STROKE_ARG(stroke) button_keycode, modifier, used_modifiers, Context, type, win_class, win_name) == True) { /* If this is a global binding, keep searching * in the hope of finding a window-specific binding. * If we don't find a win-specific binding, we use the * _first_ matching global binding we hit. */ if (action == NULL || b->windowName) { action = b->Action; if (b->windowName) { if (is_pass_through_action(action)) { action = NULL; } break; } } } } return action; } void *CheckTwoBindings( Bool *ret_is_second_binding, Binding *blist, STROKE_ARG(char *stroke) int button_keycode, unsigned int modifier,unsigned int dead_modifiers, int Context, binding_t type, const XClassHint *win_class, const char *win_name, int Context2, binding_t type2, const XClassHint *win_class2, const char *win_name2) { Binding *b; unsigned int used_modifiers = ~dead_modifiers; void *action = NULL; modifier &= (used_modifiers & ALL_MODIFIERS); for (b = blist; b != NULL; b = b->NextBinding) { if (__compare_binding( b, STROKE_ARG(stroke) button_keycode, modifier, used_modifiers, Context, type, win_class, win_name) == True) { if (action == NULL || b->windowName) { *ret_is_second_binding = False; action = b->Action; if (b->windowName) { if (is_pass_through_action(action)) action = NULL; break; } } } if (__compare_binding( b, STROKE_ARG(stroke) button_keycode, modifier, used_modifiers, Context2, type2, win_class2, win_name2) == True) { if (action == NULL || b->windowName) { *ret_is_second_binding = True; action = b->Action; if (b->windowName) { if (is_pass_through_action(action)) { action = NULL; } break; } } } } return action; } /* * GrabWindowKey - grab needed keys for the window for one binding * GrabAllWindowKeys - grab needed keys for the window for all bindings * in blist * GrabWindowButton - same for mouse buttons * GrabAllWindowButtons - same for mouse buttons * GrabAllWindowKeysAndButtons - both of the above * * Inputs: * w - the window to use (the frame window) * grab - 1 to grab, 0 to ungrab * binding - pointer to the bindinge to grab/ungrab * contexts - all context bits that shall receive bindings * dead_modifiers - modifiers to ignore for 'AnyModifier' * cursor - the mouse cursor to use when the pointer is on the * grabbed area (mouse bindings only) * */ void GrabWindowKey(Display *dpy, Window w, Binding *binding, unsigned int contexts, unsigned int dead_modifiers, Bool fGrab) { /* remove unnecessary bits from dead_modifiers */ dead_modifiers &= ~(binding->Modifier & dead_modifiers); dead_modifiers &= ALL_MODIFIERS; if((binding->Context & contexts) && BIND_IS_KEY_BINDING(binding->type)) { if (fGrab) { XGrabKey( dpy, binding->Button_Key, binding->Modifier, w, True, GrabModeAsync, GrabModeAsync); } else { XUngrabKey( dpy, binding->Button_Key, binding->Modifier, w); } if(binding->Modifier != AnyModifier && dead_modifiers != 0) { register unsigned int mods; register unsigned int max = dead_modifiers; register unsigned int living_modifiers = ~dead_modifiers; /* handle all bindings for the dead modifiers */ for (mods = 1; mods <= max; mods++) { /* Since mods starts with 1 we don't need to * test if mods contains a dead modifier. * Otherwise both, dead and living modifiers * would be zero ==> mods == 0 */ if (mods & living_modifiers) { continue; } if (fGrab) { XGrabKey( dpy, binding->Button_Key, mods|binding->Modifier, w, True, GrabModeAsync, GrabModeAsync); } else { XUngrabKey( dpy, binding->Button_Key, mods|binding->Modifier, w); } } } if (!is_grabbing_everything) { XSync(dpy, 0); } } return; } void GrabAllWindowKeys( Display *dpy, Window w, Binding *blist, unsigned int contexts, unsigned int dead_modifiers, Bool fGrab) { MyXGrabServer(dpy); is_grabbing_everything = True; for ( ; blist != NULL; blist = blist->NextBinding) { GrabWindowKey(dpy, w, blist, contexts, dead_modifiers, fGrab); } is_grabbing_everything = False; MyXUngrabServer(dpy); return; } void GrabWindowButton( Display *dpy, Window w, Binding *binding, unsigned int contexts, unsigned int dead_modifiers, Cursor cursor, Bool fGrab) { if (binding->Action == NULL) { return; } dead_modifiers &= ~(binding->Modifier & dead_modifiers); /* dje */ dead_modifiers &= ALL_MODIFIERS; if ((binding->Context & contexts) && ((BIND_IS_MOUSE_BINDING(binding->type) || (BIND_IS_STROKE_BINDING(binding->type) && binding->Button_Key !=0)))) { int bmin = 1; int bmax = NUMBER_OF_EXTENDED_MOUSE_BUTTONS; int button; if(binding->Button_Key >0) { bmin = bmax = binding->Button_Key; } for (button = bmin; button <= bmax; button++) { if (fGrab) { XGrabButton( dpy, button, binding->Modifier, w, True, ButtonPressMask | ButtonReleaseMask, GrabModeSync, GrabModeAsync, None, cursor); } else { XUngrabButton( dpy, button, binding->Modifier, w); } if (binding->Modifier != AnyModifier && dead_modifiers != 0) { register unsigned int mods; register unsigned int max = dead_modifiers; register unsigned int living_modifiers = ~dead_modifiers; /* handle all bindings for the dead modifiers */ for (mods = 1; mods <= max; mods++) { /* Since mods starts with 1 we don't * need to test if mods contains a * dead modifier. Otherwise both, dead * and living modifiers would be zero * ==> mods == 0 */ if (mods & living_modifiers) { continue; } if (fGrab) { XGrabButton( dpy, button, mods|binding->Modifier, w, True, ButtonPressMask | ButtonReleaseMask, GrabModeSync, GrabModeAsync, None, cursor); } else { XUngrabButton( dpy, button, mods|binding->Modifier, w); } } } if (!is_grabbing_everything) { XSync(dpy, 0); } } } return; } void GrabAllWindowButtons( Display *dpy, Window w, Binding *blist, unsigned int contexts, unsigned int dead_modifiers, Cursor cursor, Bool fGrab) { MyXGrabServer(dpy); is_grabbing_everything = True; for ( ; blist != NULL; blist = blist->NextBinding) { GrabWindowButton(dpy, w, blist, contexts, dead_modifiers, cursor, fGrab); } is_grabbing_everything = False; MyXUngrabServer(dpy); return; } void GrabAllWindowKeysAndButtons( Display *dpy, Window w, Binding *blist, unsigned int contexts, unsigned int dead_modifiers, Cursor cursor, Bool fGrab) { MyXGrabServer(dpy); is_grabbing_everything = True; for ( ; blist != NULL; blist = blist->NextBinding) { if (blist->Context & contexts) { if (BIND_IS_MOUSE_BINDING(blist->type) || BIND_IS_STROKE_BINDING(blist->type)) { GrabWindowButton( dpy, w, blist, contexts, dead_modifiers, cursor, fGrab); } else if (BIND_IS_KEY_BINDING(blist->type)) { GrabWindowKey( dpy, w, blist, contexts, dead_modifiers, fGrab); } } } is_grabbing_everything = False; MyXUngrabServer(dpy); return; } void GrabWindowKeyOrButton( Display *dpy, Window w, Binding *binding, unsigned int contexts, unsigned int dead_modifiers, Cursor cursor, Bool fGrab) { if (BIND_IS_MOUSE_BINDING(binding->type) || BIND_IS_STROKE_BINDING(binding->type)) { GrabWindowButton( dpy, w, binding, contexts, dead_modifiers, cursor, fGrab); } else if (BIND_IS_KEY_BINDING(binding->type)) { GrabWindowKey( dpy, w, binding, contexts, dead_modifiers, fGrab); } return; } /* * * Like XStringToKeysym, but allows some typos and does some additional * error checking. * */ KeySym FvwmStringToKeysym(Display *dpy, char *key) { KeySym keysym; char *s; if (!isalpha(*key)) { keysym = XStringToKeysym(key); } else { s = alloca(strlen(key) + 1); strcpy(s, key); /* always prefer the lower case spelling if it exists */ *s = tolower(*s); keysym = XStringToKeysym(s); if (keysym == NoSymbol) { *s = toupper(*s); keysym = XStringToKeysym(s); } } if (keysym == NoSymbol || XKeysymToKeycode(dpy, keysym) == 0) { return 0; } return keysym; } fvwm-2.6.5.orig/libs/WinMagic.h0000644000175000017500000000071110556633567014441 0ustar vwcvwc#ifndef LIB_WINMAGIC #define LIB_WINMAGIC void SlideWindow( Display *dpy, Window win, int s_x, int s_y, int s_w, int s_h, int e_x, int e_y, int e_w, int e_h, int steps, int delay_ms, float *ppctMovement, Bool do_sync, Bool use_hints); Window GetTopAncestorWindow(Display *dpy, Window child); int GetEqualSizeChildren( Display *dpy, Window parent, int depth, VisualID visualid, Colormap colormap, Window **ret_children); #endif /* LIB_WINMAGIC */ fvwm-2.6.5.orig/libs/timeout.c0000644000175000017500000000542207677641664014437 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "safemalloc.h" #include "timeout.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ timeout_t *timeout_create( int n_timeouts) { timeout_t *to; if (n_timeouts < 0 || n_timeouts > TIMEOUT_MAX_TIMEOUTS) { return NULL; } to = (timeout_t *)safecalloc(1, sizeof(timeout_t)); to->n_timeouts = n_timeouts; to->timeouts = (timeout_time_t *)safecalloc( 1, n_timeouts * sizeof(timeout_time_t)); return to; } void timeout_destroy( timeout_t *to) { if (to == NULL) { return; } if (to->timeouts != NULL) { free(to->timeouts); } free(to); return; } timeout_mask_t timeout_tick( timeout_t *to, timeout_time_t n_ticks) { timeout_mask_t mask; int i; if (n_ticks <= 0) { return 0; } for (i = 0, mask = 0; i < to->n_timeouts; i++) { if (to->timeouts[i] > n_ticks) { to->timeouts[i] -= n_ticks; } else if (to->timeouts[i] > 0) { to->timeouts[i] = 0; mask |= 1 << i; } } return mask; } void timeout_rewind( timeout_t *to, timeout_mask_t mask, timeout_time_t ticks_before_alarm) { int i; if (ticks_before_alarm < 0) { return; } for (i = 0; i < to->n_timeouts; i++) { if (mask & (1 << i)) { to->timeouts[i] = ticks_before_alarm; } } return; } fvwm-2.6.5.orig/libs/gethostname.c0000644000175000017500000000272707677641664015274 0ustar vwcvwc/* -*-c-*- */ /* gethostname emulation for SysV and POSIX.1. Copyright (C) 1992 Free Software Foundation, Inc. */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* David MacKenzie */ #include "config.h" #ifdef HAVE_UNAME # include #endif /* Put up to LEN chars of the host name into NAME. Null terminate it if the name is shorter than LEN. Return 0 if ok, -1 if error. */ int gethostname(char *name, int len) { #ifdef HAVE_UNAME struct utsname uts; if (uname (&uts) == -1) return -1; if (len > sizeof (uts.nodename)) { /* More space than we need is available. */ name[sizeof (uts.nodename)] = '\0'; len = sizeof (uts.nodename); } strncpy (name, uts.nodename, len); #else /* Hardcode your system name if you want. */ strcpy (name, ""); #endif return 0; } fvwm-2.6.5.orig/libs/setpgrp.h0000644000175000017500000000014407677641664014436 0ustar vwcvwc/* -*-c-*- */ #ifndef SETPGRP_H #define SETPGRP_H int fvwm_setpgrp(void); #endif /* SETPGRP_H */ fvwm-2.6.5.orig/libs/envvar.c0000644000175000017500000003011510630367353014226 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * MODULE OF fvwm * * DESCRIPTION Routines to expand environment-variables into strings. * Will understand both $ENV and ${ENV} -type variables. * * WRITTEN BY Sverre H. Huseby * sverrehu@ifi.uio.no * * CREATED 1995/10/3 * * UPDATED migo - 21/Jun/1999 - added getFirstEnv, some changes * */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "fvwmlib.h" #include "envvar.h" /* ---------------------------- local definitions -------------------------- */ #ifdef HAVE_UNSETENV #define FHaveUnsetenv 1 #else #define unsetenv(x) do { } while (0) #define FHaveUnsetenv 0 #endif /* ---------------------------- local macros ------------------------------- */ #define ENV_LIST_INC 10 #ifndef NULL #define NULL 0 #endif /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef struct { char *var; char *env; } env_list_item; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /*------------------------------------------------------------------------- * * NAME strDel * * FUNCTION Delete characters from a string. * * INPUT s the string to delete characters from. * idx index of first character to delete. * n number of characters to delete. * * OUTPUT s string with characters deleted. * * DESCRIPTION Deletes characters from a string by moving following * characters back. * */ static void strDel(char *s, int idx, int n) { int l; char *p; if (idx >= (l = strlen(s))) return; if (idx + n > l) n = l - idx; s += idx; p = s + n; do { *s++ = *p; } while (*p++); } /*------------------------------------------------------------------------- * * NAME strIns * * FUNCTION Insert a string into a string. * * INPUT s the string to insert into. * ins the string to insert. * idx index of where to insert the string. * maxstrlen max length of s, including '\0'. * * OUTPUT s string with characters inserted. * * DESCRIPTION The insertion will be done even if the string gets to * long, but characters will be sacrificed at the end of s. * The string is always '\0'-terminated. * */ static void strIns(char *s, const char *ins, int idx, int maxstrlen) { int l, li, move; char *p1, *p2; if (idx > (l = strlen(s))) { idx = l; } li = strlen(ins); move = l - idx + 1; /* include '\0' in move */ p1 = s + l; p2 = p1 + li; while (p2 >= s + maxstrlen) { --p1; --p2; --move; } while (move-- > 0) *p2-- = *p1--; p1 = s + idx; if (idx + li >= maxstrlen) { li = maxstrlen - idx - 1; } while (li-- > 0) *p1++ = *ins++; s[maxstrlen - 1] = '\0'; } /*------------------------------------------------------------------------- * * NAME findEnvVar * * FUNCTION Find first environment variable in a string. * * INPUT s the string to scan. * * OUTPUT len length of variable, including $ and { }. * * RETURNS Pointer to the $ that introduces the variable, or NULL * if no variable is found. * * DESCRIPTION Searches for matches like $NAME and ${NAME}, where NAME is * a sequence of characters, digits and underscores, of which * the first can not be a digit. * * NOTE This function will only return `legal' variables. There * may be $'s in the string that are not followed by what * is considered a legal variable name introducer. Such * occurrences are skipped. * */ static char *findEnvVar(const char *s, int *len) { int brace = 0; char *ret = NULL; const char *next; if (!s) return NULL; while (*s) { next = s + 1; if (*s == '$' && (isalpha(*next) || *next == '_' || *next == '{')) { ret = (char *) s++; if (*s == '{') { brace = 1; ++s; } while (*s && (isalnum(*s) || *s == '_')) ++s; *len = s - ret; if (brace) { if (*s == '}') { ++*len; break; } ret = NULL; } else break; } ++s; } return ret; } /*------------------------------------------------------------------------- * * FUNCTION Look up environment variable. * * INPUT name name of environment variable to look up. This * may include $ and { }. * len length for environment variable name (0 - ignore). * * RETURNS The variable contents, or "" if not found. * */ static const char *getEnv(const char *name, int len) { static char *empty = ""; char *ret = NULL, *tmp, *p, *p2; if ((tmp = safestrdup(name)) == NULL) return empty; /* better than no test at all. */ p = tmp; if (*p == '$') ++p; if (*p == '{') { ++p; if ((p2 = strchr(p, '}')) != NULL) *p2 = '\0'; } if (len > 0 && len < strlen(tmp)) tmp[len] = '\0'; if ((ret = getenv(p)) == NULL) ret = empty; free(tmp); return ret; } /* ---------------------------- interface functions ------------------------ */ /* * FUNCTION Expand environment variables in a string. * * SYNOPSIS #include "envvar.h" * int envExpand(char *s, int maxstrlen); * * INPUT s string to expand environment variables in. * maxstrlen max length of string, including '\0'. * * OUTPUT s the string with environment variables expanded. * * RETURNS Number of changes done. * * NOTES A non-existing variable is substituted with the empty * string. * */ int envExpand(char *s, int maxstrlen) { char *var, *s2; const char *env; int len, ret = 0; s2 = s; while ((var = findEnvVar(s2, &len)) != NULL) { ++ret; env = getEnv(var, len); strDel(s, var - s, len); strIns(s, env, var - s, maxstrlen); s2 = var + strlen(env); } return ret; } /* * FUNCTION Expand environment variables into a new string. * * SYNOPSIS #include "envvar.h" * char *envDupExpand(const char *s, int extra); * * INPUT s string to expand environment variables in. * extra number of extra bytes to allocate in the * string, in addition to the string contents * and the terminating '\0'. * * RETURNS A dynamically allocated string with environment * variables expanded. * Use free() to deallocate the buffer when it is no * longer needed. * NULL is returned if there is not enough memory. * * NOTES A non-existing variable is substituted with the empty * string. * */ char *envDupExpand(const char *s, int extra) { char *var, *ret; const char *env, *s2; int len, slen, elen, bufflen; /* * calculate length needed. */ s2 = s; slen = strlen(s); bufflen = slen + 1 + extra; while ((var = findEnvVar(s2, &len)) != NULL) { env = getEnv(var, len); elen = strlen(env); /* need to make a buffer the maximum possible size, else we * may get trouble while expanding. */ bufflen += len > elen ? len : elen; s2 = var + len; } if (bufflen < slen + 1) bufflen = slen + 1; ret = safemalloc(bufflen); /* * now do the real expansion. */ strcpy(ret, s); envExpand(ret, bufflen - extra); return ret; } /* * FUNCTION Search for the first environment variable and return * its contents and coordinates in the given string. * * INPUT s the string to scan. * may include $ and { } that introduce variable. * * OUTPUT beg index in the string of matching $. * end index in the string, first after matching var. * * RETURNS The variable contents; "" if env variable has legal name, * but does not exist; or NULL if no env variables found. * Returned constant string must not be deallocated. * * NOTE This function will only return `legal' variables. There * may be $'s in the string that are not followed by what * is considered a legal variable name introducer. Such * occurrences are skipped. * If nothing is found returns NULL and sets beg and end to 0. * * EXAMPLE getFirstEnv("echo $HOME/.fvwm/config", &beg, &end) * returns "/home/username" and beg=5, end=10. * */ const char* getFirstEnv(const char *s, int *beg, int *end) { char *var; const char *env; int len; *beg = *end = 0; if ((var = findEnvVar(s, &len)) == NULL) return NULL; env = getEnv(var, len); *beg = var - s; *end = *beg + len; return env; } /* If env is NULL, var is removed from the environment list */ static void add_to_envlist(char *var, char *env) { static env_list_item *env_list = NULL; static unsigned int env_len = 0; static unsigned int env_len_allocated = 0; unsigned int i; /* find string in list */ if (env_list && env_len) { for (i = 0; i < env_len; i++) { if (strcmp(var, env_list[i].var) != 0) { continue; } /* found it - replace old string */ free(env_list[i].var); free(env_list[i].env); if (env == NULL) { /* delete */ env_len--; env_list[i].var = env_list[env_len].var; env_list[i].env = env_list[env_len].env; } else { /* replace */ env_list[i].var = var; env_list[i].env = env; } return; } } if (env == NULL) { return; } /* not found */ if (env_list == NULL) { /* list is still empty */ env_len_allocated = ENV_LIST_INC; env_list = (env_list_item *)safecalloc( sizeof(env_list_item), env_len_allocated); } else if (env_len >= env_len_allocated && env != NULL) { /* need more memory */ env_len_allocated = env_len + ENV_LIST_INC; env_list = (env_list_item *)saferealloc( (void *)env_list, (env_len_allocated) * sizeof(env_list_item)); } env_list[env_len].var = var; env_list[env_len].env = env; env_len++; return; } /* This function keeps a list of all strings that were set in the environment. * If a variable is written again, the old memory is freed. This function * should be called instead of putenv(). * * var - environement variable name * env - environment string ("variable=value") * * Both arguments are copied internally and should be freed after calling this * function. */ void flib_putenv(char *var, char *env) { char *s; s = safestrdup(var); var = s; s = safestrdup(env); env = s; putenv(env); add_to_envlist(var, env); return; } void flib_unsetenv(const char *name) { if (FHaveUnsetenv) { unsetenv(name); } else { int rc; /* try putenv without '=' */ rc = putenv((char *)name); if (rc == 0 || getenv(name) != NULL) { /* failed, write empty string */ flib_putenv((char *)name, ""); return; } } add_to_envlist((char *)name, NULL); return; } fvwm-2.6.5.orig/libs/Rectangles.h0000644000175000017500000000252407677641664015045 0ustar vwcvwc/* -*-c-*- */ /* * Convinence functions for manipulating rectangles, segments, regions ...etc. */ #ifndef FRECTANGLES_H #define FRECTANGLES_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ /* If the two rectangles [x1, y1, w1, h2] and [x2, x2, w2, h2] have a * non emtpy interstection this function return True and the * XRectangle *r is set to the intersection (if not NULL). If the two * rectangles have an emty intersection False is returned and r is not * modified. */ Bool frect_get_intersection( int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2, XRectangle *r); /* as above but the input are XRectangles */ Bool frect_get_rect_intersection( XRectangle a, XRectangle b, XRectangle *r); /* as above for two segments */ Bool frect_get_seg_intersection( int x1, int w1, int x2, int w2, int *x, int *w); #endif fvwm-2.6.5.orig/libs/Colorset.c0000644000175000017500000004662710752147557014545 0ustar vwcvwc/* -*-c-*- */ /* Fvwm colorset technology is Copyright (C) 1999 Joey Shutup * http://www.streetmap.co.uk/streetmap.dll?Postcode2Map?BS24+9TZ * You may use this code for any purpose, as long as the original copyright * and this notice remains in the source code and all documentation */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include #include "libs/fvwmlib.h" #include "libs/FShape.h" #include "libs/Colorset.h" #include "libs/PictureBase.h" #include "libs/Graphics.h" #include "libs/Grab.h" #include "libs/PictureGraphics.h" #include "libs/XError.h" /* globals */ colorset_t *Colorset = NULL; int nColorsets = 0; /* stretch the src rectangle to the dest ractangle keeping its aspect so that * it fills the destination completely. */ static int get_aspect_dimensions( int *ret_w, int *ret_h, int dest_w, int dest_h, int src_w, int src_h) { double ax; double ay; ax = (double)dest_w / (double)src_w; ay = (double)dest_h / (double)src_h; if (ax >= ay) { /* fit in x direction */ *ret_w = dest_w; *ret_h = (src_h * dest_w) / src_w; return 0; } else { /* fit in y direction */ *ret_w = (src_w * dest_h) / src_h; *ret_h = dest_h; return 1; } } /* * AllocColorset() grows the size of the Colorset array to include set n * colorset_t *Colorset will be altered * returns the address of the member */ void AllocColorset(int n) { /* do nothing if it already exists */ if (n < nColorsets) { return; } /* increment n to get the required array size, get a new array */ Colorset = (colorset_t *)saferealloc( (char *)Colorset, ++n * sizeof(colorset_t)); /* zero out colorset 0 it's always defined so will be filled in during module startup */ if (n == 0) { memset( &Colorset[nColorsets], 0, (n - nColorsets) * sizeof(colorset_t)); } else { /* copy colorset 0 into new members so that if undefined ones * are referenced at least they don't give black on black */ for ( ; nColorsets < n; nColorsets++) { memcpy( &Colorset[nColorsets], Colorset, sizeof(colorset_t)); } } nColorsets = n; return; } /* * DumpColorset() returns a char * to the colorset contents in printable form */ static char csetbuf[256]; char *DumpColorset(int n, colorset_t *cs) { sprintf(csetbuf, "Colorset " "%x %lx %lx %lx %lx %lx %lx %lx %lx %lx " "%x %x %x %x %x %x %x %x %x %x %x", n, cs->fg, cs->bg, cs->hilite, cs->shadow, cs->fgsh, cs->tint, cs->icon_tint, cs->pixmap, cs->shape_mask, cs->fg_alpha_percent, cs->width, cs->height, cs->pixmap_type, cs->shape_width, cs->shape_height, cs->shape_type, cs->tint_percent, cs->do_dither_icon, cs->icon_tint_percent, cs->icon_alpha_percent); return csetbuf; } /* * LoadColorset() takes a strings and stuffs it into the array */ int LoadColorset(char *line) { colorset_t *cs; unsigned int n, chars; Pixel fg, bg, hilite, shadow, fgsh, tint, icon_tint; Pixmap pixmap; Pixmap shape_mask; unsigned int fg_alpha_percent, width, height, pixmap_type; unsigned int shape_width, shape_height, shape_type; unsigned int tint_percent, do_dither_icon, icon_tint_percent; unsigned int icon_alpha_percent; if (line == NULL) { return -1; } if (sscanf(line, "%x%n", &n, &chars) < 1) { return -1; } line += chars; /* migo: if you modify this sscanf or other colorset definitions, * please update perllib/FVWM/Tracker/Colorsets.pm too */ if (sscanf(line, "%lx %lx %lx %lx %lx %lx %lx %lx %lx " "%x %x %x %x %x %x %x %x %x %x %x", &fg, &bg, &hilite, &shadow, &fgsh, &tint, &icon_tint, &pixmap, &shape_mask, &fg_alpha_percent, &width, &height, &pixmap_type, &shape_width, &shape_height, &shape_type, &tint_percent, &do_dither_icon, &icon_tint_percent, &icon_alpha_percent) != 20) return -1; AllocColorset(n); cs = &Colorset[n]; cs->fg = fg; cs->bg = bg; cs->hilite = hilite; cs->shadow = shadow; cs->fgsh = fgsh; cs->tint = tint; cs->icon_tint = icon_tint; cs->pixmap = pixmap; cs->shape_mask = shape_mask; cs->fg_alpha_percent = fg_alpha_percent; cs->width = width; cs->height = height; cs->pixmap_type = pixmap_type; cs->shape_width = shape_width; cs->shape_height = shape_height; cs->shape_type = shape_type; cs->tint_percent = tint_percent; cs->do_dither_icon = do_dither_icon; cs->icon_tint_percent = icon_tint_percent; cs->icon_alpha_percent = icon_alpha_percent; return n; } /* scrolls a pixmap by x_off/y_off pixels, wrapping around at the edges. */ Pixmap ScrollPixmap( Display *dpy, Pixmap p, GC gc, int x_off, int y_off, int width, int height, unsigned int depth) { GC tgc; XGCValues xgcv; Pixmap p2; if (p == None || p == ParentRelative || (x_off == 0 && y_off == 0)) { return p; } tgc = fvwmlib_XCreateGC(dpy, p, 0, &xgcv); if (tgc == None) { return p; } XCopyGC(dpy, gc, GCFunction | GCPlaneMask| GCSubwindowMode | GCClipXOrigin | GCClipYOrigin | GCClipMask, tgc); xgcv.tile = p; xgcv.ts_x_origin = x_off; xgcv.ts_y_origin = y_off; xgcv.fill_style = FillTiled; XChangeGC( dpy, tgc, GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, &xgcv); p2 = XCreatePixmap(dpy, p, width, height, depth); if (p2 == None) { return p; } XFillRectangle(dpy, p2, tgc, 0, 0, width, height); XFreeGC(dpy, tgc); return p2; } /* sets a window background from a colorset * if width or height are zero the window size is queried */ void SetWindowBackgroundWithOffset( Display *dpy, Window win, int x_off, int y_off, int width, int height, colorset_t *colorset, unsigned int depth, GC gc, Bool clear_area) { Pixmap pixmap = None; Pixmap mask = None; XID junk; if (0 == width || 0 == height) { if (!XGetGeometry( dpy, win, &junk, (int *)&junk, (int *)&junk, (unsigned int *)&width, (unsigned int *)&height, (unsigned int *)&junk, (unsigned int *)&junk)) { return; } } if (FHaveShapeExtension && colorset->shape_mask) { mask = CreateBackgroundPixmap( dpy, None, width, height, colorset, 1, None, True); if (mask != None) { FShapeCombineMask( dpy, win, FShapeBounding, 0, 0, mask, FShapeSet); XFreePixmap(dpy, mask); } } if (!colorset->pixmap) { /* use the bg pixel */ XSetWindowBackground(dpy, win, colorset->bg); if (clear_area) { XClearArea(dpy, win, 0, 0, width, height, True); } } else { pixmap = CreateOffsetBackgroundPixmap( dpy, win, x_off, y_off, width, height, colorset, depth, gc, False); if (pixmap) { XSetWindowBackgroundPixmap(dpy, win, pixmap); if (clear_area) { XClearArea(dpy, win, 0, 0, width, height, True); } if (pixmap != ParentRelative) { XFreePixmap(dpy, pixmap); } } } return; } Bool UpdateBackgroundTransparency( Display *dpy, Window win, int width, int height, colorset_t *colorset, unsigned int depth, GC gc, Bool clear_area) { if (!CSETS_IS_TRANSPARENT(colorset)) { return False; } else if (!CSETS_IS_TRANSPARENT_PR_PURE(colorset)) { SetWindowBackgroundWithOffset( dpy, win, 0, 0, width, height, colorset, depth, gc, True); } else { XClearArea(dpy, win, 0,0,0,0, clear_area); } return True; } void SetWindowBackground( Display *dpy, Window win, int width, int height, colorset_t *colorset, unsigned int depth, GC gc, Bool clear_area) { SetWindowBackgroundWithOffset( dpy, win, 0, 0, width, height, colorset, depth, gc, clear_area); return; } void GetWindowBackgroundPixmapSize( colorset_t *cs_t, int width, int height, int *w, int *h) { if (cs_t->pixmap == None) { *w = *h = 1; } else { *w = cs_t->width; *h = cs_t->height; switch (cs_t->pixmap_type) { case PIXMAP_STRETCH_ASPECT: get_aspect_dimensions( w, h, width, height, cs_t->width, cs_t->height); break; case PIXMAP_STRETCH_X: *w = width; break; case PIXMAP_STRETCH_Y: *h = height; break; default: break; } } } static int is_bad_gc = 0; static int BadGCErrorHandler(Display *dpy, XErrorEvent *error) { if (error->error_code == BadGC) { is_bad_gc = 1; return 0; } else { int rc; /* delegate error to original handler */ rc = ferror_call_next_error_handler(dpy, error); return rc; } } /* create a pixmap suitable for plonking on the background of a part of a * window */ Pixmap CreateOffsetBackgroundPixmap( Display *dpy, Window win, int x, int y, int width, int height, colorset_t *colorset, unsigned int depth, GC gc, Bool is_shape_mask) { Pixmap pixmap = None; Pixmap cs_pixmap = None; XGCValues xgcv; static GC shape_gc = None; GC fill_gc = None; /* not static as dpy may change (FvwmBacker) */ int cs_width; int cs_height; Bool cs_keep_aspect; Bool cs_stretch_x; Bool cs_stretch_y; if (colorset->pixmap == ParentRelative && !is_shape_mask && colorset->tint_percent > 0) { FvwmRenderAttributes fra; fra.mask = FRAM_DEST_IS_A_WINDOW | FRAM_HAVE_TINT; fra.tint = colorset->tint; fra.tint_percent = colorset->tint_percent; MyXGrabServer(dpy); pixmap = PGraphicsCreateTransparency( dpy, win, &fra, gc, x, y, width, height, True); MyXUngrabServer(dpy); if (pixmap == None) { return ParentRelative; } return pixmap; } else if (colorset->pixmap == ParentRelative && !is_shape_mask) { return ParentRelative; } else if (CSETS_IS_TRANSPARENT_ROOT(colorset) && colorset->pixmap && !is_shape_mask) { int sx,sy; int h,w; XID dummy; cs_pixmap = colorset->pixmap; cs_width = colorset->width; cs_height = colorset->height; if (CSETS_IS_TRANSPARENT_ROOT_PURE(colorset)) { /* check if it is still here */ XID dummy; /* a priori we should grab the server, but this * cause PositiveWrite error when you move a * window with a transparent title bar */ if (!XGetGeometry( dpy, colorset->pixmap, &dummy, (int *)&dummy, (int *)&dummy, (unsigned int *)&w, (unsigned int *)&h, (unsigned int *)&dummy, (unsigned int *)&dummy) || w != cs_width || h != cs_height) { return None; } } XTranslateCoordinates( dpy, win, DefaultRootWindow(dpy), x, y, &sx, &sy, &dummy); pixmap = XCreatePixmap(dpy, win, width, height, Pdepth); if (!pixmap) { return None; } /* make sx and sy positif */ while (sx < 0) { sx = sx + cs_width; } while (sy < 0) { sy = sy + cs_height; } /* make sx and sy in (0,0,cs_width,cs_height) */ while (sx >= cs_width) { sx = sx - cs_width; } while (sy >= cs_height) { sy = sy - cs_height; } xgcv.fill_style = FillTiled; xgcv.tile = cs_pixmap; xgcv.ts_x_origin = cs_width-sx; xgcv.ts_y_origin = cs_height-sy; fill_gc = fvwmlib_XCreateGC( dpy, win, GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, &xgcv); if (fill_gc == None) { XFreePixmap(dpy, pixmap); return None; } XSync(dpy, False); is_bad_gc = 0; ferror_set_temp_error_handler(BadGCErrorHandler); XFillRectangle(dpy, pixmap, fill_gc, 0, 0, width, height); if ( is_bad_gc == 0 && CSETS_IS_TRANSPARENT_ROOT_PURE(colorset) && colorset->tint_percent > 0) { FvwmRenderAttributes fra; fra.mask = FRAM_HAVE_TINT; fra.tint = colorset->tint; fra.tint_percent = colorset->tint_percent; PGraphicsRenderPixmaps( dpy, win, pixmap, None, None, Pdepth, &fra, pixmap, fill_gc, None, None, 0, 0, width, height, 0, 0, width, height, False); } XSync(dpy, False); ferror_reset_temp_error_handler(); if (is_bad_gc == 1) { is_bad_gc = 0; XFreePixmap(dpy, pixmap); pixmap = None; } XFreeGC(dpy,fill_gc); return pixmap; } if (!is_shape_mask) { cs_pixmap = colorset->pixmap; cs_width = colorset->width; cs_height = colorset->height; cs_keep_aspect = (colorset->pixmap_type == PIXMAP_STRETCH_ASPECT); cs_stretch_x = (colorset->pixmap_type == PIXMAP_STRETCH_X) || (colorset->pixmap_type == PIXMAP_STRETCH); cs_stretch_y = (colorset->pixmap_type == PIXMAP_STRETCH_Y) || (colorset->pixmap_type == PIXMAP_STRETCH); } else { /* In spite of the name, win contains the pixmap */ cs_pixmap = colorset->shape_mask; win = colorset->shape_mask; if (shape_gc == None) { xgcv.foreground = 1; xgcv.background = 0; /* create a gc for 1 bit depth */ shape_gc = fvwmlib_XCreateGC( dpy, win, GCForeground|GCBackground, &xgcv); } gc = shape_gc; cs_width = colorset->shape_width; cs_height = colorset->shape_height; cs_keep_aspect = (colorset->shape_type == SHAPE_STRETCH_ASPECT); cs_stretch_x = !(colorset->shape_type == SHAPE_TILED); cs_stretch_y = !(colorset->shape_type == SHAPE_TILED); } if (cs_pixmap == None) { xgcv.foreground = colorset->bg; fill_gc = fvwmlib_XCreateGC(dpy, win, GCForeground, &xgcv); /* create a solid pixmap - not very useful most of the time */ pixmap = XCreatePixmap(dpy, win, 1, 1, depth); XFillRectangle(dpy, pixmap, fill_gc, 0, 0, 1, 1); XFreeGC(dpy,fill_gc); } else if (cs_keep_aspect) { Bool trim_side; int big_width, big_height; Pixmap big_pixmap; int x, y; /* make a pixmap big enough to cover the destination but with * the aspect ratio of the cs_pixmap */ trim_side = get_aspect_dimensions( &big_width, &big_height, width, height, cs_width, cs_height); big_pixmap = CreateStretchPixmap( dpy, cs_pixmap, cs_width, cs_height, depth, big_width, big_height, gc); /* work out where to trim */ x = trim_side ? (big_width - width) / 2 : 0; y = trim_side ? 0 : (big_height - height) / 2; pixmap = XCreatePixmap(dpy, cs_pixmap, width, height, depth); if (pixmap && big_pixmap) { XCopyArea( dpy, big_pixmap, pixmap, gc, x, y, width, height, 0, 0); } if (big_pixmap) { XFreePixmap(dpy, big_pixmap); } } else if (!cs_stretch_x && !cs_stretch_y) { /* it's a tiled pixmap, create an unstretched one */ if (!is_shape_mask) { pixmap = XCreatePixmap( dpy, cs_pixmap, cs_width, cs_height, depth); if (pixmap) { XCopyArea( dpy, cs_pixmap, pixmap, gc, 0, 0, cs_width, cs_height, 0, 0); } } else { /* can't tile masks, create a tiled version of the * mask */ pixmap = CreateTiledPixmap( dpy, cs_pixmap, cs_width, cs_height, width, height, 1, gc); } } else if (!cs_stretch_x) { /* it's an HGradient */ pixmap = CreateStretchYPixmap( dpy, cs_pixmap, cs_width, cs_height, depth, height, gc); } else if (!cs_stretch_y) { /* it's a VGradient */ pixmap = CreateStretchXPixmap( dpy, cs_pixmap, cs_width, cs_height, depth, width, gc); } else { /* It's a full window pixmap */ pixmap = CreateStretchPixmap( dpy, cs_pixmap, cs_width, cs_height, depth, width, height, gc); } if (x != 0 || y != 0) { Pixmap p2; p2 = ScrollPixmap( dpy, pixmap, gc, x, y, width, height, depth); if (p2 != None && p2 != ParentRelative && p2 != pixmap) { XFreePixmap(dpy, pixmap); pixmap = p2; } } return pixmap; } /* create a pixmap suitable for plonking on the background of a window */ Pixmap CreateBackgroundPixmap(Display *dpy, Window win, int width, int height, colorset_t *colorset, unsigned int depth, GC gc, Bool is_shape_mask) { return CreateOffsetBackgroundPixmap( dpy, win, 0, 0, width, height, colorset, depth, gc, is_shape_mask); } /* Draws a colorset background into the specified rectangle in the target * drawable. */ void SetRectangleBackground( Display *dpy, Window win, int x, int y, int width, int height, colorset_t *colorset, unsigned int depth, GC gc) { SetClippedRectangleBackground( dpy, win, x, y, width, height, NULL, colorset, depth, gc); return; } /* Draws a colorset background into the specified rectangle in the target * drawable. */ void SetClippedRectangleBackground( Display *dpy, Window win, int x, int y, int width, int height, XRectangle *clip, colorset_t *colorset, unsigned int depth, GC gc) { GC draw_gc; Pixmap pixmap2; Pixmap pixmap = None; static int last_depth = -1; static GC last_gc = None; XGCValues xgcv; Pixmap clipmask = None; GC clip_gc = None; Bool keep_aspect = (colorset->pixmap_type == PIXMAP_STRETCH_ASPECT); Bool stretch_x = (colorset->pixmap_type == PIXMAP_STRETCH_X) || (colorset->pixmap_type == PIXMAP_STRETCH); Bool stretch_y = (colorset->pixmap_type == PIXMAP_STRETCH_Y) || (colorset->pixmap_type == PIXMAP_STRETCH); int dest_x, dest_y, dest_w, dest_h; if (clip) { dest_x = clip->x; dest_y = clip->y; dest_w = clip->width; dest_h = clip->height; } else { dest_x = x; dest_y = y; dest_w = width; dest_h = height; } if (CSETS_IS_TRANSPARENT_PR_TINT(colorset)) { XClearArea(dpy, win, dest_x, dest_y, dest_w, dest_h, False); PGraphicsTintRectangle( dpy, win, colorset->tint, colorset->tint_percent, win, True, gc, None, None, dest_x, dest_y, dest_w, dest_h); return; } if (CSETS_IS_TRANSPARENT_PR_PURE(colorset)) { XClearArea(dpy, win, dest_x, dest_y, dest_w, dest_h, False); /* don't do anything */ return; } if (CSETS_IS_TRANSPARENT_ROOT(colorset)) { /* FIXME: optimize this ! */ x = y = 0; width = width + dest_x; height = height + dest_y; } /* minimize gc creation by remembering the last requested depth */ if (last_gc != None && depth != last_depth) { XFreeGC(dpy, last_gc); last_gc = None; } if (last_gc == None) { last_gc = fvwmlib_XCreateGC(dpy, win, 0, &xgcv); } draw_gc = last_gc; last_depth = depth; if (FHaveShapeExtension && colorset->shape_mask != None) { clipmask = CreateBackgroundPixmap( dpy, 0, width, height, colorset, 1, None, True); if (clipmask) { /* create a GC for clipping */ xgcv.clip_x_origin = x; xgcv.clip_y_origin = y; xgcv.clip_mask = clipmask; clip_gc = fvwmlib_XCreateGC( dpy, win, GCClipXOrigin | GCClipYOrigin | GCClipMask, &xgcv); draw_gc = clip_gc; } } if (!colorset->pixmap) { /* use the bg pixel */ XSetForeground(dpy, draw_gc, colorset->bg); XFillRectangle( dpy, win, draw_gc, dest_x, dest_y, dest_w, dest_h); } else { pixmap = CreateBackgroundPixmap( dpy, win, width, height, colorset, depth, gc, False); if (keep_aspect) { /* nothing to do */ } if (stretch_x || stretch_y) { if (!stretch_x && colorset->width != width) { pixmap2 = CreateStretchXPixmap( dpy, pixmap, colorset->width, height, depth, width, gc); XFreePixmap(dpy, pixmap); pixmap = pixmap2; } if (!stretch_y && colorset->height != height) { pixmap2 = CreateStretchYPixmap( dpy, pixmap, width, colorset->height, depth, height, gc); XFreePixmap(dpy, pixmap); pixmap = pixmap2; } } else { pixmap2 = CreateTiledPixmap( dpy, pixmap, colorset->width, colorset->height, width, height, depth, gc); XFreePixmap(dpy, pixmap); pixmap = pixmap2; } if (pixmap) { /* Copy the pixmap into the rectangle. */ XCopyArea( dpy, pixmap, win, draw_gc, dest_x - x, dest_y - y, dest_w, dest_h, dest_x, dest_y); XFreePixmap(dpy, pixmap); } } if (FHaveShapeExtension) { if (clipmask != None) { XFreePixmap(dpy, clipmask); } if (clip_gc != None) { XFreeGC(dpy, clip_gc); } } return; } fvwm-2.6.5.orig/libs/ColorUtils.c0000644000175000017500000003164610630367353015036 0ustar vwcvwc/* -*-c-*- */ /* * Around 12/20/99 we did the 3rd rewrite of the shadow/hilite stuff. * (That I know about (dje). * The first stuff I saw just applied a percentage. * Then we got some code from SCWM. * This stuff comes from "Visual.c" which is part of Lesstif. * Here's their copyright: * * Copyright (C) 1995 Free Software Foundation, Inc. * * This file is part of the GNU LessTif Library. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * The routine at the bottom "pixel_to_color_string" was not from Lesstif. * * Port by Dan Espen, no additional copyright */ #include "config.h" /* must be first */ #include #include /* for X functions in general */ #include "fvwmlib.h" /* prototype GetShadow GetHilit */ #include "Parse.h" #include "Colorset.h" #include "PictureBase.h" #include "PictureUtils.h" #include "ColorUtils.h" #define PCT_BRIGHTNESS (6 * 0xffff / 100) /* How much lighter/darker to make things in default routine */ #define PCT_DARK_BOTTOM 70 /* lighter (less dark, actually) */ #define PCT_DARK_TOP 50 /* lighter */ #define PCT_LIGHT_BOTTOM 55 /* darker */ #define PCT_LIGHT_TOP 80 /* darker */ #define PCT_MEDIUM_BOTTOM_BASE 40 /* darker */ #define PCT_MEDIUM_BOTTOM_RANGE 25 #define PCT_MEDIUM_TOP_BASE 60 /* lighter */ #define PCT_MEDIUM_TOP_RANGE -30 /* The "brightness" of an RGB color. The "right" way seems to use * empirical values like the default thresholds below, but it boils down * to red is twice as bright as blue and green is thrice blue. */ #define BRIGHTNESS(r,g,b) (2*(int)(r) + 3*(int)(g) + 1*(int)(b)) /* From Xm.h on Solaris */ #define XmDEFAULT_DARK_THRESHOLD 15 #define XmDEFAULT_LIGHT_THRESHOLD 85 static XColor color; /**** This part is the old fvwm way to calculate colours. Still used for **** 'medium' brigness colours. */ #define DARKNESS_FACTOR 0.5 #define BRIGHTNESS_FACTOR 1.4 #define SCALE 65535.0 #define HALF_SCALE (SCALE / 2) typedef enum { R_MAX_G_MIN, R_MAX_B_MIN, G_MAX_B_MIN, G_MAX_R_MIN, B_MAX_R_MIN, B_MAX_G_MIN } MinMaxState; static void color_mult (unsigned short *red, unsigned short *green, unsigned short *blue, double k) { if (*red == *green && *red == *blue) { double temp; /* A shade of gray */ temp = k * (double) (*red); if (temp > SCALE) { temp = SCALE; } *red = (unsigned short)(temp); *green = *red; *blue = *red; } else { /* Non-zero saturation */ double r, g, b; double min, max; double a, l, s; double delta; double middle; MinMaxState min_max_state; r = (double) *red; g = (double) *green; b = (double) *blue; if (r > g) { if (r > b) { max = r; if (g < b) { min = g; min_max_state = R_MAX_G_MIN; a = b - g; } else { min = b; min_max_state = R_MAX_B_MIN; a = g - b; } } else { max = b; min = g; min_max_state = B_MAX_G_MIN; a = r - g; } } else { if (g > b) { max = g; if (b < r) { min = b; min_max_state = G_MAX_B_MIN; a = r - b; } else { min = r; min_max_state = G_MAX_R_MIN; a = b - r; } } else { max = b; min = r; min_max_state = B_MAX_R_MIN; a = g - r; } } delta = max - min; a = a / delta; l = (max + min) / 2; if (l <= HALF_SCALE) { s = max + min; } else { s = 2.0 * SCALE - (max + min); } s = delta/s; l *= k; if (l > SCALE) { l = SCALE; } s *= k; if (s > 1.0) { s = 1.0; } if (l <= HALF_SCALE) { max = l * (1 + s); } else { max = s * SCALE + l - s * l; } min = 2 * l - max; delta = max - min; middle = min + delta * a; switch (min_max_state) { case R_MAX_G_MIN: r = max; g = min; b = middle; break; case R_MAX_B_MIN: r = max; g = middle; b = min; break; case G_MAX_B_MIN: r = middle; g = max; b = min; break; case G_MAX_R_MIN: r = min; g = max; b = middle; break; case B_MAX_G_MIN: r = middle; g = min; b = max; break; case B_MAX_R_MIN: r = min; g = middle; b = max; break; } *red = (unsigned short) r; *green = (unsigned short) g; *blue = (unsigned short) b; } } /**** End of original fvwm code. ****/ static XColor *GetShadowOrHiliteColor( Pixel background, float light, float dark, float factor) { long brightness; unsigned int red, green, blue; memset(&color, 0, sizeof(color)); color.pixel = background; XQueryColor(Pdpy, Pcmap, &color); red = color.red; green = color.green; blue = color.blue; brightness = BRIGHTNESS(red, green, blue); /* For "dark" backgrounds, make everything a fixed %age lighter */ if (brightness < XmDEFAULT_DARK_THRESHOLD * PCT_BRIGHTNESS) { color.red = (unsigned short) (0xffff - ((0xffff - red) * dark + 50) / 100); color.green = (unsigned short) (0xffff - ((0xffff - green) * dark + 50) / 100); color.blue = (unsigned short) (0xffff - ((0xffff - blue) * dark + 50) / 100); } /* For "light" background, make everything a fixed %age darker */ else if (brightness > XmDEFAULT_LIGHT_THRESHOLD * PCT_BRIGHTNESS) { color.red = (unsigned short)((red * light + 50) / 100); color.green = (unsigned short)((green * light + 50) / 100); color.blue = (unsigned short)((blue * light + 50) / 100); } /* For "medium" background, select is a fixed %age darker; * top (lighter) and bottom (darker) are a variable %age * based on the background's brightness */ else { color_mult(&color.red, &color.green, &color.blue, factor); } return &color; } XColor *GetShadowColor(Pixel background) { return GetShadowOrHiliteColor( background, PCT_LIGHT_BOTTOM, PCT_DARK_BOTTOM, DARKNESS_FACTOR); } Pixel GetShadow(Pixel background) { XColor *colorp; colorp = GetShadowColor(background); PictureAllocColor(Pdpy, Pcmap, colorp, True); if (colorp->pixel == background) { colorp->pixel = PictureGetNextColor(colorp->pixel, 1); } return colorp->pixel; } XColor *GetHiliteColor(Pixel background) { return GetShadowOrHiliteColor( background, PCT_LIGHT_TOP, PCT_DARK_TOP, BRIGHTNESS_FACTOR); } Pixel GetHilite(Pixel background) { XColor *colorp; colorp = GetHiliteColor(background); PictureAllocColor(Pdpy, Pcmap, colorp, True); if (colorp->pixel == background) { colorp->pixel = PictureGetNextColor(colorp->pixel, -1); } return colorp->pixel; } XColor *GetForeShadowColor(Pixel foreground, Pixel background) { XColor bg_color; float fg[3], bg[3]; int result[3]; int i; memset(&color, 0, sizeof(color)); memset(&bg_color, 0, sizeof(bg_color)); color.pixel = foreground; bg_color.pixel = background; XQueryColor(Pdpy, Pcmap, &color); XQueryColor(Pdpy, Pcmap, &bg_color); fg[0] = color.red; fg[1] = color.green; fg[2] = color.blue; bg[0] = bg_color.red; bg[1]= bg_color.green; bg[2] = bg_color.blue; for (i=0; i<3; i++) { if (fg[i] - bg[i] < 8192 && fg[i] - bg[i] > -8192) { result[i] = 0; } else { result[i] = (int)((5 * bg[i] - fg[i]) / 4); if (fg[i] < bg[i] || result[i] < 0) { result[i] = (int)((3 * bg[i] + fg[i]) / 4); } } } color.red = result[0]; color.green = result[1]; color.blue = result[2]; return &color; } Pixel GetForeShadow(Pixel foreground, Pixel background) { XColor *colorp; colorp = GetForeShadowColor(foreground, background); PictureAllocColor(Pdpy, Pcmap, colorp, True); if (colorp->pixel == background) { colorp->pixel = PictureGetNextColor(colorp->pixel, 1); } return colorp->pixel; } XColor *GetTintedColor(Pixel in, Pixel tint, int percent) { XColor tint_color; memset(&color, 0, sizeof(color)); memset(&tint_color, 0, sizeof(tint_color)); color.pixel = in; XQueryColor(Pdpy, Pcmap, &color); tint_color.pixel = tint; XQueryColor(Pdpy, Pcmap, &tint_color); color.red = (unsigned short) (((100-percent)*color.red + tint_color.red * percent) / 100); color.green = (unsigned short) (((100-percent)*color.green + tint_color.green * percent) / 100); color.blue = (unsigned short) (((100-percent)*color.blue + tint_color.blue * percent) / 100); return &color; } Pixel GetTintedPixel(Pixel in, Pixel tint, int percent) { XColor *colorp; colorp = GetTintedColor(in, tint, percent); PictureAllocColor(Pdpy, Pcmap, colorp, True); return colorp->pixel; } /* This function converts the colour stored in a colorcell (pixel) into the * string representation of a colour. The output is printed at the * address 'output'. It is either in rgb format ("rgb:rrrr/gggg/bbbb") if * use_hash is False or in hash notation ("#rrrrggggbbbb") if use_hash is true. * The return value is the number of characters used by the string. The * rgb values of the output are undefined if the colorcell is invalid. The * memory area pointed at by 'output' must be at least 64 bytes (in case of * future extensions and multibyte characters).*/ int pixel_to_color_string( Display *dpy, Colormap cmap, Pixel pixel, char *output, Bool use_hash) { XColor color; int n; color.pixel = pixel; color.red = 0; color.green = 0; color.blue = 0; XQueryColor(dpy, cmap, &color); if (!use_hash) { sprintf( output, "rgb:%04x/%04x/%04x%n", (int)color.red, (int)color.green, (int)color.blue, &n); } else { sprintf( output, "#%04x%04x%04x%n", (int)color.red, (int)color.green, (int)color.blue, &n); } return n; } static char *colorset_names[] = { "$[fg.cs", "$[bg.cs", "$[hilight.cs", "$[shadow.cs", NULL }; Pixel GetSimpleColor(char *name) { XColor color; Bool is_illegal_rgb = False; memset(&color, 0, sizeof(color)); /* This is necessary because some X servers coredump when presented a * malformed rgb colour name. */ if (name && strncasecmp(name, "rgb:", 4) == 0) { int i; char *s; for (i = 0, s = name + 4; *s; s++) { if (*s == '/') i++; } if (i != 2) is_illegal_rgb = True; } if (is_illegal_rgb) { fprintf(stderr, "Illegal RGB format \"%s\"\n", name); } else if (!XParseColor (Pdpy, Pcmap, name, &color)) { fprintf(stderr, "Cannot parse color \"%s\"\n", name ? name : ""); } else if (!PictureAllocColor(Pdpy, Pcmap, &color, True)) { fprintf(stderr, "Cannot allocate color \"%s\"\n", name); } return color.pixel; } Pixel GetColor(char *name) { int i; int n; int cs; char *rest; XColor color; switch ((i = GetTokenIndex(name, colorset_names, -1, &rest))) { case 0: case 1: case 2: case 3: if (!isdigit(*rest) || (*rest == '0' && *(rest + 1) != 0)) { /* not a non-negative integer without leading zeros */ fprintf(stderr, "Invalid colorset number in color '%s'\n", name); return 0; } sscanf(rest, "%d%n", &cs, &n); if (*(rest + n) != ']') { fprintf(stderr, "No closing brace after '%d' in color '%s'\n", cs, name); return 0; } if (*(rest + n + 1) != 0) { fprintf(stderr, "Trailing characters after brace in" " color '%s'\n", name); return 0; } AllocColorset(cs); switch (i) { case 0: color.pixel = Colorset[cs].fg; break; case 1: color.pixel = Colorset[cs].bg; break; case 2: color.pixel = Colorset[cs].hilite; break; case 3: color.pixel = Colorset[cs].shadow; break; } if (!PictureAllocColor(Pdpy, Pcmap, &color, True)) { fprintf(stderr, "Cannot allocate color %d from" " colorset %d\n", i, cs); return 0; } return color.pixel; default: break; } return GetSimpleColor(name); } /* Allocates the color from the input Pixel again */ Pixel fvwmlib_clone_color(Pixel p) { XColor c; c.pixel = p; XQueryColor(Pdpy, Pcmap, &c); if (!PictureAllocColor(Pdpy, Pcmap, &c, True)) { fprintf(stderr, "Cannot allocate clone Pixel %d\n", (int)p); return 0; } return c.pixel; } /* Free an array of colours (n colours), never free black */ void fvwmlib_free_colors(Display *dpy, Pixel *pixels, int n, Bool no_limit) { int i; /* We don't ever free black - dirty hack to allow freeing colours at * all */ /* olicha: ???? */ for (i = 0; i < n; i++) { if (pixels[i] != 0) { PictureFreeColors( dpy, Pcmap, pixels + i, 1, 0, no_limit); } } return; } /* Copy one color and reallocate it */ void fvwmlib_copy_color( Display *dpy, Pixel *dst_color, Pixel *src_color, Bool do_free_dest, Bool do_copy_src) { if (do_free_dest) { fvwmlib_free_colors(dpy, dst_color, 1, True); } if (do_copy_src) { *dst_color = fvwmlib_clone_color(*src_color); } } fvwm-2.6.5.orig/libs/Module.c0000644000175000017500000002606010656151547014162 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ** Module.c: code for modules to communicate with fvwm */ #include "config.h" #include #include #include "libs/defaults.h" #include "Module.h" #include "Parse.h" /* * Loop until count bytes are read, unless an error or end-of-file * condition occurs. */ inline static int positive_read(int fd, char *buf, int count) { while (count > 0) { int n_read = read(fd, buf, count); if (n_read <= 0) { return -1; } buf += n_read; count -= n_read; } return 0; } /* * Reads a single packet of info from fvwm. * The packet is stored in static memory that is reused during * the next call. */ FvwmPacket *ReadFvwmPacket(int fd) { static unsigned long buffer[FvwmPacketMaxSize]; FvwmPacket *packet = (FvwmPacket *)buffer; unsigned long length; /* The `start flag' value supposedly exists to synchronize the * fvwm -> module communication. However, the communication goes * through a pipe. I don't see how any data could ever get lost, * so how would fvwm & the module become unsynchronized? */ do { if (positive_read(fd, (char *)buffer, sizeof(unsigned long)) < 0) { return NULL; } } while (packet->start_pattern != START_FLAG); /* Now read the rest of the header */ if (positive_read(fd, (char *)(&buffer[1]), 3 * sizeof(unsigned long)) < 0) { return NULL; } length = FvwmPacketBodySize_byte(*packet); if (length > FvwmPacketMaxSize_byte - FvwmPacketHeaderSize_byte) { /* packet too long */ return NULL; } /* Finally, read the body, and we're done */ if (positive_read(fd, (char *)(&buffer[4]), length) < 0) { return NULL; } return packet; } /* * * SendFinishedStartupNotification - informs fvwm that the module has * finished its startup procedures and is fully operational now. * */ void SendFinishedStartupNotification(int *fd) { SendText(fd, ModuleFinishedStartupResponse, 0); } /* * * SendUnlockNotification - informs fvwm that the module has * finished it's procedures and fvwm may proceed. * */ void SendUnlockNotification(int *fd) { SendText(fd, ModuleUnlockResponse, 0); } /* * * SendQuitNotification - informs fvwm that the module has * finished and may be killed. * */ static unsigned long ModuleContinue = 1; void SendQuitNotification(int *fd) { ModuleContinue = 0; SendText(fd, ModuleUnlockResponse, 0); /* unlock just in case */ } /* * * SendText - Sends arbitrary text/command back to fvwm * */ void SendText(int *fd, const char *message, unsigned long window) { char *p, *buf; unsigned int len; if (!message) { return; } /* Get enough memory to store the entire message. */ len = strlen(message); p = buf = alloca(sizeof(long) * (3 + 1 + (len / sizeof(long)))); /* Put the message in the buffer, and... */ *((unsigned long *)p) = window; p += sizeof(unsigned long); *((unsigned long *)p) = len; p += sizeof(unsigned long); strcpy(p, message); p += len; memcpy(p, &ModuleContinue, sizeof(unsigned long)); p += sizeof(unsigned long); /* Send it! */ write(fd[0], buf, p - buf); } /* * * SendFvwmPipe - Sends message to fvwm: The message is a comma-delimited * string separated into its component sections and sent one by one to fvwm. * It is discouraged to use this function with a "synchronous" module. * (Form FvwmIconMan) * */ void SendFvwmPipe(int *fd, const char *message, unsigned long window) { const char *hold = message; const char *temp; while ((temp = strchr(hold, ',')) != NULL) { char *temp_msg = (char*)alloca(temp - hold + 1); strncpy(temp_msg, hold, (temp - hold)); temp_msg[(temp - hold)] = '\0'; hold = temp + 1; SendText(fd, temp_msg, window); } /* * Send the last part of the string : * we don't need to copy this into separate * storage because we don't need to modify it ... * * NOTE: this makes this second call to SendText() * distinct from the first call. Two calls is * cleaner than hacking the loop to make only * one call. */ SendText(fd, hold, window); } void SetMessageMask(int *fd, unsigned long mask) { char set_mask_mesg[50]; sprintf(set_mask_mesg, "SET_MASK %lu", mask); SendText(fd, set_mask_mesg, 0); } void SetSyncMask(int *fd, unsigned long mask) { char set_syncmask_mesg[50]; sprintf(set_syncmask_mesg, "SET_SYNC_MASK %lu", mask); SendText(fd, set_syncmask_mesg, 0); } void SetNoGrabMask(int *fd, unsigned long mask) { char set_nograbmask_mesg[50]; sprintf(set_nograbmask_mesg, "SET_NOGRAB_MASK %lu", mask); SendText(fd, set_nograbmask_mesg, 0); } /* * Optional routine that sets the matching criteria for config lines * that should be sent to a module by way of the GetConfigLine function. * * If this routine is not called, all module config lines are sent. */ static int first_pass = 1; void InitGetConfigLine(int *fd, char *match) { char *buffer = (char *)alloca(strlen(match) + 32); first_pass = 0; /* make sure get wont do this */ sprintf(buffer, "Send_ConfigInfo %s", match); SendText(fd, buffer, 0); } /* * Gets a module configuration line from fvwm. Returns NULL if there are * no more lines to be had. "line" is a pointer to a char *. * * Changed 10/19/98 by Dan Espen: * * - The "isspace" call was referring to memory beyond the end of the * input area. This could have led to the creation of a core file. Added * "body_size" to keep it in bounds. */ void GetConfigLine(int *fd, char **tline) { FvwmPacket *packet; int body_count; if (first_pass) { SendText(fd, "Send_ConfigInfo", 0); first_pass = 0; } do { packet = ReadFvwmPacket(fd[1]); if (packet == NULL || packet->type == M_END_CONFIG_INFO) { *tline = NULL; return; } } while (packet->type != M_CONFIG_INFO); /* For whatever reason CONFIG_INFO packets start with three * (unsigned long) zeros. Skip the zeros and any whitespace that * follows */ *tline = (char *)&(packet->body[3]); body_count = FvwmPacketBodySize(*packet) * sizeof(unsigned long); while (body_count > 0 && isspace((unsigned char)**tline)) { (*tline)++; --body_count; } } ModuleArgs *ParseModuleArgs(int argc, char *argv[], int use_arg6_as_alias) { static ModuleArgs ma; /* Need at least six arguments: [0] name of executable [1] file descriptor of module->fvwm pipe (write end) [2] file descriptor of fvwm->module pipe (read end) [3] pathname of last config file read (ignored, use Send_ConfigInfo) [4] application window context [5] window decoration context Optionally (left column used if use_arg6_as_alias is true): [6] alias or user argument 0 [7] user arg 0 or user arg 1 ... */ if (argc < 6) { return NULL; } /* Module name is (last component of) argv[0] or possibly an alias passed on the command line. */ if (use_arg6_as_alias && argc >= 7) { ma.name = argv[6]; ma.user_argc = argc - 7; ma.user_argv = &(argv[7]); } else { char *p = strrchr(argv[0], '/'); if (p == NULL) { ma.name = argv[0]; } else { ma.name = ++p; } ma.user_argc = argc - 6; ma.user_argv = &(argv[6]); } ma.namelen=strlen(ma.name); if (ma.user_argc == 0) { ma.user_argv = NULL; } /* File descriptors for the pipes */ ma.to_fvwm = atoi(argv[1]); ma.from_fvwm = atoi(argv[2]); /* Ignore argv[3] */ /* These two are generated as long hex strings */ ma.window = strtoul(argv[4], NULL, 16); ma.decoration = strtoul(argv[5], NULL, 16); return &ma; } /* expands certain variables in a command to be sent by a module */ char *module_expand_action( Display *dpy, int screen , char *in_action, rectangle *r, char *forecolor, char *backcolor) { char *variables[] = { "$", "fg", "bg", "left", "-left", "right", "-right", "top", "-top", "bottom", "-bottom", "width", "height", NULL }; char *action = NULL; char *src; char *dest; char *string = NULL; char *rest; int val = 0; int offset; int i; char *dest_org; Bool is_string; Bool is_value; Bool has_geom; Bool has_fg; Bool has_bg; rectangle tmpr = { 0, 0, 0, 0 }; has_geom = (r == NULL) ? False : True; has_fg = (forecolor == NULL) ? False : True; has_bg = (backcolor == NULL) ? False : True; if (r == NULL) { r = &tmpr; } /* create a temporary storage for expanding */ action = (char *)safemalloc(MAX_MODULE_INPUT_TEXT_LEN); for (src = in_action, dest = action; *src != 0; src++) { if (*src != '$') { *(dest++) = *src; continue; } /* it's a variable */ dest_org = dest; is_string = False; is_value = False; *(dest++) = *(src++); i = GetTokenIndex(src, variables, -1, &rest); if (i == -1) { src--; continue; } switch (i) { case 0: /* $ */ continue; case 1: /* fg */ string = forecolor; is_string = has_fg; break; case 2: /* bg */ if (backcolor == NULL) { continue; } string = backcolor; is_string = has_bg; break; case 3: /* left */ val = r->x; is_value = has_geom; break; case 4: /* -left */ val = DisplayWidth(dpy, screen) - r->x - 1; is_value = has_geom; break; case 5: /* right */ val = r->x + r->width; is_value = has_geom; break; case 6: /* -right */ val = DisplayWidth(dpy, screen) - r->x - r->width - 1; is_value = has_geom; break; case 7: /* top */ val = r->y; is_value = has_geom; break; case 8: /* -top */ val = DisplayHeight(dpy, screen) - r->y - 1; is_value = has_geom; break; case 9: /* bottom */ val = r->y + r->height; is_value = has_geom; break; case 10: /* -bottom */ val = DisplayHeight(dpy, screen) - r->y - r->height - 1; is_value = has_geom; break; case 11: /* width */ val = r->width; is_value = has_geom; break; case 12: /* height */ val = r->height; is_value = has_geom; break; default: /* unknown */ src--; continue; } /* switch */ if (is_value == False && is_string == False) { src--; continue; } dest = dest_org; src = --rest; if (is_value) { if (MAX_MODULE_INPUT_TEXT_LEN - (dest - action) <= 16) { /* out of space */ free(action); return NULL; } /* print the number into the string */ sprintf(dest, "%d%n", val, &offset); dest += offset; } else if (is_string) { if (MAX_MODULE_INPUT_TEXT_LEN - (dest - action) <= strlen(string)) { /* out of space */ free(action); return NULL; } /* print the colour name into the string */ if (string) { sprintf(dest, "%s%n", string, &offset); dest += offset; } } } /* for */ *dest = 0; return action; } fvwm-2.6.5.orig/libs/queue.h0000644000175000017500000000333707677641664014105 0ustar vwcvwc/* -*-c-*- */ #ifndef QUEUE_H #define QUEUE_H /* * type definitions */ typedef struct { /* do not read or write any members of this structure outside queue.c! */ struct fqueue_record *first; struct fqueue_record *last; unsigned int lock_level; struct { unsigned is_dirty : 1; } flags; } fqueue; #define FQUEUE_INIT { NULL, NULL, 0 } typedef int (*check_fqueue_object_t)(void *object, void *operate_args); typedef void (*operate_fqueue_object_t)(void *object, void *operate_args); typedef int (*cmp_objects_t)(void *object1, void *object2, void *args); typedef void (*destroy_fqueue_object_t)(void *object); /* * Basic queue management */ void fqueue_init(fqueue *fq); unsigned int fqueue_get_length(fqueue *fq); #define FQUEUE_IS_EMPTY(fq) ((fq)->first == NULL) /* * Add record to queue */ void fqueue_add_at_front(fqueue *fq, void *object); void fqueue_add_at_end(fqueue *fq, void *object); void fqueue_add_inside( fqueue *fq, void *object, cmp_objects_t cmp_objects, void *cmp_args); /* * Fetch queue objects */ int fqueue_get_first(fqueue *fq, void **ret_object); /* * Operate on queue objects and possibly remove them from the queue */ void fqueue_remove_or_operate_from_front( fqueue *fq, check_fqueue_object_t check_func, operate_fqueue_object_t operate_func, destroy_fqueue_object_t destroy_func, void *operate_args); void fqueue_remove_or_operate_from_end( fqueue *fq, check_fqueue_object_t check_func, operate_fqueue_object_t operate_func, destroy_fqueue_object_t destroy_func, void *operate_args); void fqueue_remove_or_operate_all( fqueue *fq, check_fqueue_object_t check_func, operate_fqueue_object_t operate_func, destroy_fqueue_object_t destroy_func, void *operate_args); #endif /* QUEUE_H */ fvwm-2.6.5.orig/libs/PictureBase.h0000644000175000017500000001407110646411304015134 0ustar vwcvwc/* -*-c-*- */ #ifndef Picture_Base_H #define Picture_Base_H #include "config.h" #ifdef HAVE_XRENDER #define XRenderSupport 1 #else #define XRenderSupport 0 #endif #ifdef XPM #define XpmSupport 1 #else #define XpmSupport 0 #endif #ifdef HAVE_PNG #define PngSupport 1 #else #define PngSupport 0 #endif extern Bool Pdefault; extern Visual *Pvisual; extern Colormap Pcmap; extern unsigned int Pdepth; extern Display *Pdpy; /* Save area for display pointer */ extern Bool PUseDynamicColors; typedef struct { int color_limit; int strict; int allocate; int not_dynamic; int use_named_table; } PictureColorLimitOption; /** * Set a colon-separated path, with environment variable expansions. * Expand '+' to be the value of the previous path. * * Parameters: * p_path pointer to the path variable * newpath new value for *p_path * free_old_path set true if we should free the memory pointed to * by p_path on entry * * The value of newpath is copied into a newly-allocated place, to which * '*p_path' will point to upon return. The memory region pointed to by * '*p_path' upon entry will be freed if 'free_old_path' is true. * **/ void setPath(char** p_path, const char* newpath, int free_old_path); /** * Search along colon-separated path for filename, with optional suffix. * * Parameters: * path colon-separated path of directory names * filename basename of file to search for * suffix if non-NULL, filename may have this suffix * type mode sought for file * * For each DIR in the path, search for DIR/filename then * DIR/ (if suffix is non-NULL). Return the full path of * the first found. * * The parameter type is a mask consisting of one or more of R_OK, W_OK, X_OK * and F_OK. R_OK, W_OK and X_OK request checking whether the file exists and * has read, write and execute permissions, respectively. F_OK just requests * checking for the existence of the file. * * Returns: full pathname of sought-after file, or NULL. The return value * points to allocated memory that the caller must free. * **/ char* searchPath( const char* path, const char* filename, const char* suffix, int type); /* This routine called during modules initialization. Fvwm has its own code * in fvwm.c */ void PictureInitCMap(Display *dpy); /* as above but force to use the default visual. If use_my_color_limit is True * also enable color limitation (independent than the fvwm one). */ void PictureInitCMapRoot( Display *dpy, Bool init_color_limit, PictureColorLimitOption *opt, Bool use_my_color_limit, Bool init_dither); /* Analogue of the Xlib WhitePixel and BlackPixel functions but use the Pvisual */ Pixel PictureWhitePixel(void); Pixel PictureBlackPixel(void); /* for initialization of the white and black pixel (for fvwm as PictureInitCMap* * do this) */ void PictureSetupWhiteAndBlack(void); /* Analogue of the Xlib DefaultGC function but take care of the Pdepth: - If Pdepth == DefaultDepth return the DefaultGC - If Pdepth != DefaultDepth and first call create a static gc with the win and return the gc - If Pdepth != DefaultDepth and already called return the static gc */ GC PictureDefaultGC(Display *dpy, Window win); /* these can be used to switch visuals before calling GetPicture */ /* do NOT use with CachePicture */ void PictureUseDefaultVisual(void); void PictureUseFvwmVisual(void); void PictureSaveFvwmVisual(void); /** Returns current setting of the image path **/ char* PictureGetImagePath(void); /** Sets image path to newpath. Environment variables are expanded, and '+' is expanded to previous value of imagepath. The new path is in newly-allocated memory, so newpath may be freed or re-used. **/ void PictureSetImagePath(const char* newpath); /** Search for file along pathlist. If pathlist is NULL, will use the current imagepath setting. If filename is not found, but filename.gz is found, will return the latter. Mode is typically R_OK. See searchPath() for more details. **/ char* PictureFindImageFile( const char* filename, const char* pathlist, int mode); typedef struct FvwmPictureThing { struct FvwmPictureThing *next; char *name; unsigned long stamp; /* should be FileStamp */ unsigned long fpa_mask; Pixmap picture; Pixmap mask; Pixmap alpha; unsigned int depth; unsigned int width; unsigned int height; unsigned int count; Pixel *alloc_pixels; int nalloc_pixels; Bool no_limit; } FvwmPicture; typedef struct { unsigned alpha : 1; unsigned alloc_pixels : 1; } FvwmPictureFlags; #define FPAM_NO_ALLOC_PIXELS (1) /* do not return the allocated pixels * this is used only if PUseDynamicColors, * if not the allocated pixels are never * returned */ #define FPAM_NO_COLOR_LIMIT (1 << 1) /* do not use color limitation */ #define FPAM_NO_ALPHA (1 << 2) /* do not return the alpha channel */ #define FPAM_DITHER (1 << 3) /* dither the image */ #define FPAM_TINT (1 << 4) /* tint the image */ #define FPAM_MONOCHROME (1 << 5) /* reduce the color depth to 1-bit */ typedef struct { unsigned mask : 6; XColor tint; int tint_percent; } FvwmPictureAttributes; /* tint no yet implemented */ #define PICTURE_FPA_AGREE(p,fpa) (p->fpa_mask == fpa.mask) #define FRAM_HAVE_ADDED_ALPHA (1) #define FRAM_HAVE_TINT (1 << 1) #define FRAM_HAVE_UNIFORM_COLOR (1 << 2) #define FRAM_DEST_IS_A_WINDOW (1 << 3) #define FRAM_HAVE_ICON_CSET (1 << 4) #include "Colorset.h" typedef struct { unsigned mask : 5; int added_alpha_percent; Pixel tint; int tint_percent; Pixel uniform_pixel; colorset_t *colorset; } FvwmRenderAttributes; #define PICTURE_HAS_ALPHA(picture,cset) \ ((picture && picture->alpha != None) || \ (cset >= 0 && Colorset[cset].icon_alpha_percent < 100)) /* alpha limit if we cannot use the alpha channel */ #define PICTURE_ALPHA_LIMIT 130 typedef struct { Colormap cmap; int dither; int no_limit; Bool is_8; unsigned long *pixels_table; int pixels_table_size; } PictureImageColorAllocator; #endif /* Picture_Base_H */ fvwm-2.6.5.orig/libs/FGettext.h0000644000175000017500000000515407677641664014512 0ustar vwcvwc/* -*-c-*- */ /* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 #include "config.h" #define _(x) FGettext(x) /* NLS can be disabled through the configure --disable-nls option. */ #if HAVE_NLS #define HaveNLSSupport 1 /* Get declarations of GNU message catalog functions. */ # include #else #define HaveNLSSupport 0 /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) # define dgettext(Domainname, Msgid) ((const char *) (Msgid)) # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String void FGettextInit(const char *domain, const char *dir, const char *module); const char *FGettext(char *str); char *FGettextCopy(char *str); void FGettextSetLocalePath(const char *path); void FGettextPrintLocalePath(int verbose); #endif /* _LIBGETTEXT_H */ fvwm-2.6.5.orig/libs/FEvent.c0000644000175000017500000002706010556634174014126 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #define FEVENT_C #define FEVENT_PRIVILEGED_ACCESS #include "config.h" #include "libs/fvwmlib.h" #include #include "FEvent.h" #undef FEVENT_C #undef FEVENT_PRIVILEGED_ACCESS #include #include "libs/ftime.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef struct { Bool (*predicate) (Display *display, XEvent *event, XPointer arg); XPointer arg; XEvent event; Bool found; } fev_check_peek_args; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static XEvent fev_event; static XEvent fev_event_old; /* until Xlib does this for us */ Time fev_last_timestamp = CurrentTime; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* Records the time of the last processed event. */ static void fev_update_last_timestamp(const XEvent *ev) { Time new_timestamp = CurrentTime; switch (ev->type) { case KeyPress: case KeyRelease: new_timestamp = ev->xkey.time; break; case ButtonPress: case ButtonRelease: new_timestamp = ev->xbutton.time; break; case MotionNotify: new_timestamp = ev->xmotion.time; break; case EnterNotify: case LeaveNotify: new_timestamp = ev->xcrossing.time; break; case PropertyNotify: new_timestamp = ev->xproperty.time; break; case SelectionClear: new_timestamp = ev->xselectionclear.time; break; case SelectionRequest: new_timestamp = ev->xselectionrequest.time; break; case SelectionNotify: new_timestamp = ev->xselection.time; break; default: return; } /* Only update if the new timestamp is later than the old one, or * if the new one is from a time at least 30 seconds earlier than the * old one (in which case the system clock may have changed) */ if (new_timestamp > fev_last_timestamp || fev_last_timestamp - new_timestamp > CLOCK_SKEW_MS) { fev_last_timestamp = new_timestamp; } return; } static Bool fev_check_peek_pred( Display *display, XEvent *event, XPointer arg) { fev_check_peek_args *cpa = (fev_check_peek_args *)arg; if (cpa->found == True) { return False; } cpa->found = cpa->predicate(display, event, cpa->arg); if (cpa->found == True) { cpa->event = *event; } return False; } /* ---------------------------- interface functions (privileged access) ----- */ void fev_copy_last_event(XEvent *dest) { *dest = fev_event; return; } XEvent *fev_get_last_event_address(void) { return &fev_event; } /* ---------------------------- interface functions (normal_access) -------- */ Time fev_get_evtime(void) { return fev_last_timestamp; } Bool fev_get_evpos_or_query( Display *dpy, Window w, const XEvent *e, int *ret_x, int *ret_y) { Window JunkW; int JunkC; unsigned int JunkM; Bool rc; int type; type = (e != NULL) ? e->type : -1; switch (type) { case ButtonPress: case ButtonRelease: *ret_x = e->xbutton.x_root; *ret_y = e->xbutton.y_root; return True; case KeyPress: case KeyRelease: *ret_x = e->xkey.x_root; *ret_y = e->xkey.y_root; return True; case EnterNotify: case LeaveNotify: *ret_x = e->xcrossing.x_root; *ret_y = e->xcrossing.y_root; return True; case MotionNotify: if (e->xmotion.same_screen == True) { *ret_x = e->xmotion.x_root; *ret_y = e->xmotion.y_root; } else { /* pointer is on different screen */ *ret_x = 0; *ret_y = 0; } return True; default: rc = FQueryPointer( dpy, w, &JunkW, &JunkW, ret_x, ret_y, &JunkC, &JunkC, &JunkM); if (rc == False) { /* pointer is on a different screen */ *ret_x = 0; *ret_y = 0; } return rc; } } Bool fev_set_evpos(XEvent *e, int x, int y) { switch (e->type) { case ButtonPress: case ButtonRelease: e->xbutton.x_root = x; e->xbutton.y_root = y; return True; case KeyPress: case KeyRelease: e->xkey.x_root = x; e->xkey.y_root = y; return True; case MotionNotify: if (e->xmotion.same_screen == True) { e->xmotion.x_root = x; e->xmotion.y_root = y; return True; } break; default: break; } /* switch */ return False; } void fev_fake_event(XEvent *ev) { fev_event_old = fev_event; fev_event = *ev; /* don't update the last timestamp here; the triggering event has * already done this */ return; } void *fev_save_event(void) { XEvent *ev; ev = (XEvent *)safemalloc(sizeof(XEvent)); *ev = fev_event; return ev; } void fev_restore_event(void *ev) { fev_event = *(XEvent *)ev; free(ev); return; } void fev_make_null_event(XEvent *ev, Display *dpy) { memset(ev, 0, sizeof(*ev)); ev->xany.serial = fev_event.xany.serial; ev->xany.display = dpy; return; } void fev_get_last_event(XEvent *ev) { *ev = fev_event; return; } /* ---------------------------- X event replacements ----------------------- */ XTimeCoord *FGetMotionEvents( Display *display, Window w, Time start, Time stop, int *nevents_return) { XTimeCoord *rc; rc = XGetMotionEvents(display, w, start, stop, nevents_return); return rc; } int FAllowEvents( Display *display, int event_mode, Time time) { int rc; rc = XAllowEvents(display, event_mode, time); return rc; } Bool FCheckIfEvent( Display *display, XEvent *event_return, Bool (*predicate) (Display *display, XEvent *event, XPointer arg), XPointer arg) { Bool rc; XEvent new_ev; rc = XCheckIfEvent(display, &new_ev, predicate, arg); if (rc == True) { fev_event_old = fev_event; fev_event = new_ev; *event_return = fev_event; fev_update_last_timestamp(event_return); } return rc; } Bool FCheckMaskEvent( Display *display, long event_mask, XEvent *event_return) { Bool rc; XEvent new_ev; rc = XCheckMaskEvent(display, event_mask, &new_ev); if (rc == True) { fev_event_old = fev_event; fev_event = new_ev; *event_return = fev_event; fev_update_last_timestamp(event_return); } return rc; } Bool FCheckPeekIfEvent( Display *display, XEvent *event_return, Bool (*predicate) (Display *display, XEvent *event, XPointer arg), XPointer arg) { XEvent dummy; fev_check_peek_args cpa; cpa.predicate = predicate; cpa.arg = arg; cpa.found = False; XCheckIfEvent(display, &dummy, fev_check_peek_pred, (char *)&cpa); if (cpa.found == True) { *event_return = cpa.event; fev_update_last_timestamp(event_return); } return cpa.found; } Bool FCheckTypedEvent( Display *display, int event_type, XEvent *event_return) { Bool rc; XEvent new_ev; rc = XCheckTypedEvent(display, event_type, &new_ev); if (rc == True) { fev_event_old = fev_event; fev_event = new_ev; *event_return = fev_event; fev_update_last_timestamp(event_return); } return rc; } Bool FCheckTypedWindowEvent( Display *display, Window w, int event_type, XEvent *event_return) { Bool rc; XEvent new_ev; rc = XCheckTypedWindowEvent(display, w, event_type, &new_ev); if (rc == True) { fev_event_old = fev_event; fev_event = new_ev; *event_return = fev_event; fev_update_last_timestamp(event_return); } return rc; } Bool FCheckWindowEvent( Display *display, Window w, long event_mask, XEvent *event_return) { Bool rc; XEvent new_ev; rc = XCheckWindowEvent(display, w, event_mask, &new_ev); if (rc == True) { fev_event_old = fev_event; fev_event = new_ev; *event_return = fev_event; fev_update_last_timestamp(event_return); } return rc; } int FEventsQueued( Display *display, int mode) { int rc; rc = XEventsQueued(display, mode); return rc; } int FIfEvent( Display *display, XEvent *event_return, Bool (*predicate) (Display *display, XEvent *event, XPointer arg), XPointer arg) { int rc; fev_event_old = fev_event; rc = XIfEvent(display, &fev_event, predicate, arg); *event_return = fev_event; fev_update_last_timestamp(event_return); return rc; } int FMaskEvent( Display *display, long event_mask, XEvent *event_return) { int rc; fev_event_old = fev_event; rc = XMaskEvent(display, event_mask, &fev_event); *event_return = fev_event; fev_update_last_timestamp(event_return); return rc; } int FNextEvent( Display *display, XEvent *event_return) { int rc; fev_event_old = fev_event; rc = XNextEvent(display, &fev_event); *event_return = fev_event; fev_update_last_timestamp(event_return); return rc; } int FPeekEvent( Display *display, XEvent *event_return) { int rc; rc = XPeekEvent(display, event_return); if (rc == True) { fev_update_last_timestamp(event_return); } return rc; } int FPeekIfEvent( Display *display, XEvent *event_return, Bool (*predicate) (Display *display, XEvent *event, XPointer arg), XPointer arg) { int rc; rc = XPeekIfEvent(display, event_return, predicate, arg); if (rc == True) { fev_update_last_timestamp(event_return); } return rc; } int FPending( Display *display) { int rc; rc = XPending(display); return rc; } int FPutBackEvent( Display *display, XEvent *event) { int rc; rc = XPutBackEvent(display, event); fev_event = fev_event_old; return rc; } int FQLength( Display *display) { int rc; rc = XQLength(display); return rc; } Bool FQueryPointer( Display *display, Window w, Window *root_return, Window *child_return, int *root_x_return, int *root_y_return, int *win_x_return, int *win_y_return, unsigned int *mask_return) { Bool rc; rc = XQueryPointer( display, w, root_return, child_return, root_x_return, root_y_return, win_x_return, win_y_return, mask_return); return rc; } Status FSendEvent( Display *display, Window w, Bool propagate, long event_mask, XEvent *event_send) { Status rc; rc = XSendEvent(display, w, propagate, event_mask, event_send); return rc; } int FWarpPointer( Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y) { int rc; rc = XWarpPointer( display, src_w, dest_w, src_x, src_y, src_width, src_height, dest_x, dest_y); return rc; } int FWarpPointerUpdateEvpos( XEvent *ev, Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y) { int rc; rc = XWarpPointer( display, src_w, dest_w, src_x, src_y, src_width, src_height, dest_x, dest_y); if (ev != NULL && dest_w == DefaultRootWindow(display)) { fev_set_evpos(ev, dest_x, dest_y); } return rc; } int FWindowEvent( Display *display, Window w, long event_mask, XEvent *event_return) { int rc; fev_event_old = fev_event; rc = XWindowEvent(display, w, event_mask, &fev_event); *event_return = fev_event; fev_update_last_timestamp(event_return); return rc; } fvwm-2.6.5.orig/libs/Strings.c0000644000175000017500000001155710556634174014374 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ** Strings.c: various routines for dealing with strings */ #include "config.h" #include #include "safemalloc.h" #include "Strings.h" #define CHUNK_SIZE 256 char *CatString3(const char *a, const char *b, const char *c) { static char* buffer = NULL; static int buffer_len = 0; int len = 1; if (a != NULL) { len += strlen(a); } if (b != NULL) { len += strlen(b); } if (c != NULL) { len += strlen(c); } /* Expand buffer to fit string, to a multiple of CHUNK_SIZE */ if (len > buffer_len) { buffer_len = CHUNK_SIZE * (1 + ((len - 1) / CHUNK_SIZE)); buffer = saferealloc(buffer, buffer_len); } buffer[0] = 0; if (a != NULL) { strcat(buffer, a); } if (b != NULL) { strcat(buffer, b); } if (c != NULL) { strcat(buffer, c); } return buffer; } #undef CHUNK_SIZE void CopyString(char **dest, const char *source) { int len; const char *start; if (source == NULL) { *dest = NULL; return; } /* set 'start' to the first character of the string, skipping over spaces, but not newlines (newline terminates the string) */ while ( isspace((unsigned char)*source) && (*source != '\n') ) { source++; } start = source; /* set 'len' to the length of the string, ignoring trailing spaces */ len = 0; while ( (*source != '\n') && (*source != 0) ) { len++; source++; } source--; while( len > 0 && isspace((unsigned char)*source) ) { len--; source--; } *dest = safemalloc(len+1); strncpy(*dest,start,len); (*dest)[len]=0; } void CopyStringWithQuotes(char **dest, const char *src) { while (src && src[0] == ' ') { src++; } if (src && src[0] == '"') { int len; src++; CopyString(dest, src); len = strlen(*dest); if (len > 0 && (*dest)[len - 1] == '"') { (*dest)[len - 1] = '\0'; } } else { CopyString(dest, src); } } /* * * Copies a string into a new, malloc'ed string * Strips leading spaces and trailing spaces and new lines * */ char *stripcpy( const char *source ) { const char* tmp; char* ptr; int len; if(source == NULL) { return NULL; } while(isspace((unsigned char)*source)) { source++; } len = strlen(source); tmp = source + len -1; while( (tmp >= source) && ((isspace((unsigned char)*tmp)) || (*tmp == '\n')) ) { tmp--; len--; } ptr = safemalloc(len+1); if (len) { strncpy(ptr,source,len); } ptr[len]=0; return ptr; } int StrEquals( const char *s1, const char *s2 ) { if (s1 == NULL && s2 == NULL) { return 1; } if (s1 == NULL || s2 == NULL) { return 0; } return strcasecmp(s1,s2) == 0; } int StrHasPrefix( const char* string, const char* prefix ) { if ( prefix == NULL ) { return 1; } if ( string == NULL ) { return 0; } return strncasecmp( string, prefix, strlen(prefix) ) == 0; } /* * * Adds single quotes arround the string and escapes single quotes with * backslashes. The result is placed in the given dest, not allocated. * The end of destination, i.e. pointer to '\0' is returned. * You should allocate dest yourself, at least strlen(source) * 2 + 3. * */ char *QuoteString(char *dest, const char *source) { int i = 0; *dest++ = '\''; for(i = 0; source[i]; i++) { if (source[i] == '\'') { *dest++ = '\\'; } *dest++ = source[i]; } *dest++ = '\''; *dest = '\0'; return dest; } /* * Adds delim around the source and escapes all characters in escape with * the corresponding escaper. The dest string must be preallocated. * delim should be included in escape with a proper escaper. * Returns a pointer to the end of dest. */ char *QuoteEscapeString(char *dest, const char *source, char delim, const char *escape, const char *escaper) { *dest++ = delim; while (*source) { char *esc; esc = strchr(escape, *source); if (esc != NULL) { *dest++ = escaper[(int)(esc-escape)]; } *dest++ = *source++; } *dest++ = delim; *dest = '\0'; return dest; } /* * Calculates the lenght needed by a escaped by QuoteEscapeString * the corresponding escaper. */ unsigned int QuoteEscapeStringLength(const char *source, const char *escape) { unsigned int len = 2; while (*source) { if (strchr(escape, *source) != NULL) { len++; } len++; source++; } return len; } fvwm-2.6.5.orig/libs/Target.h0000644000175000017500000000062310556633567014173 0ustar vwcvwc#ifndef LIB_TARGET_H #define LIB_TARGET_H void fvwmlib_keyboard_shortcuts( Display *dpy, int screen, XEvent *Event, int x_move_size, int y_move_size, int *x_defect, int *y_defect, int ReturnEvent); void fvwmlib_get_target_window( Display *dpy, int screen, char *MyName, Window *app_win, Bool return_subwindow); Window fvwmlib_client_window(Display *dpy, Window input); #endif /* LIB_TARGET_H */ fvwm-2.6.5.orig/libs/fvwm_sys_stat.h0000644000175000017500000000313410455174377015652 0ustar vwcvwc#ifdef HAVE_SYS_STAT_H #include #endif #ifndef S_IRWXO # define FVWM_S_IRWXO 0007 #else # define FVWM_S_IRWXO S_IRWXO #endif #ifndef S_ISUID # define FVWM_S_ISUID 0004000 #else # define FVWM_S_ISUID S_ISUID #endif #ifndef S_ISGID # define FVWM_S_ISGID 0002000 #else # define FVWM_S_ISGID S_ISGID #endif #ifndef S_ISVTX # define FVWM_S_ISVTX 0001000 #else # define FVWM_S_ISVTX S_ISVTX #endif #ifndef S_IRWXU # define FVWM_S_IRWXU 00700 #else # define FVWM_S_IRWXU S_IRWXU #endif #ifndef S_IRUSR # define FVWM_S_IRUSR 00400 #else # define FVWM_S_IRUSR S_IRUSR #endif #ifndef S_IWUSR # define FVWM_S_IWUSR 00200 #else # define FVWM_S_IWUSR S_IWUSR #endif #ifndef S_IXUSR # define FVWM_S_IXUSR 00100 #else # define FVWM_S_IXUSR S_IXUSR #endif #ifndef S_IRWXG # define FVWM_S_IRWXG 00070 #else # define FVWM_S_IRWXG S_IRWXG #endif #ifndef S_IRGRP # define FVWM_S_IRGRP 00040 #else # define FVWM_S_IRGRP S_IRGRP #endif #ifndef S_IWGRP # define FVWM_S_IWGRP 00020 #else # define FVWM_S_IWGRP S_IWGRP #endif #ifndef S_IXGRP # define FVWM_S_IXGRP 00010 #else # define FVWM_S_IXGRP S_IXGRP #endif #ifndef S_IRWXO # define FVWM_S_IRWXO 00007 #else # define FVWM_S_IRWXO S_IRWXO #endif #ifndef S_IROTH # define FVWM_S_IROTH 00004 #else # define FVWM_S_IROTH S_IROTH #endif #ifndef S_IWOTH # define FVWM_S_IWOTH 00002 #else # define FVWM_S_IWOTH S_IWOTH #endif #ifndef S_IXOTH # define FVWM_S_IXOTH 00001 #else # define FVWM_S_IXOTH S_IXOTH #endif #ifndef S_ISLNK # define FVWM_S_ISLNK(x) 0 #else # define FVWM_S_ISLNK(x) S_ISLNK(x) #endif #ifndef S_IFLNK # define FVWM_S_IFLNK 00000 #else # define FVWM_S_IFLNK S_IFLNK #endif fvwm-2.6.5.orig/libs/Fxpm.h0000644000175000017500000001250410646703412013643 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ #ifndef FXPM_H #define FXPM_H #include "PictureBase.h" #if XpmSupport #include #endif /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ #if XpmSupport typedef XpmColorSymbol FxpmColorSymbol; typedef XpmExtension FxpmExtension; typedef XpmColor FxpmColor; typedef XpmAttributes FxpmAttributes; typedef XpmImage FxpmImage; typedef XpmInfo FxpmInfo; #else typedef struct { char *name; char *value; Pixel pixel; } FxpmColorSymbol; typedef struct { char *name; unsigned int nlines; char **lines; } FxpmExtension; typedef struct { char *string; char *symbolic; char *m_color; char *g4_color; char *g_color; char *c_color; } FxpmColor; typedef int (*FxpmAllocColorFunc)( #ifdef __STDC__ Display*,Colormap,char*,XColor*,void* #endif ); typedef int (*FxpmFreeColorsFunc)( #ifdef __STDC__ Display*,Colormap,Pixel*,int,void* #endif ); typedef struct { unsigned long valuemask; Visual *visual; Colormap colormap; unsigned int depth; unsigned int width; unsigned int height; unsigned int x_hotspot; unsigned int y_hotspot; unsigned int cpp; Pixel *pixels; unsigned int npixels; FxpmColorSymbol *colorsymbols; unsigned int numsymbols; char *rgb_fname; unsigned int nextensions; FxpmExtension *extensions; unsigned int ncolors; FxpmColor *colorTable; char *hints_cmt; char *colors_cmt; char *pixels_cmt; unsigned int mask_pixel; Bool exactColors; unsigned int closeness; unsigned int red_closeness; unsigned int green_closeness; unsigned int blue_closeness; int color_key; Pixel *alloc_pixels; int nalloc_pixels; Bool alloc_close_colors; int bitmap_format; FxpmAllocColorFunc alloc_color; FxpmFreeColorsFunc free_colors; void *color_closure; } FxpmAttributes; typedef struct { unsigned int width; unsigned int height; unsigned int cpp; unsigned int ncolors; FxpmColor *colorTable; unsigned int *data; } FxpmImage; typedef struct { unsigned long valuemask; unsigned int x_hotspot; unsigned int y_hotspot; } FxpmInfo; #endif /* ---------------------------- global definitions ------------------------- */ #if XpmSupport #define FxpmReturnPixels XpmReturnPixels #define FxpmSize XpmSize #define FxpmReturnAllocPixels XpmReturnAllocPixels #define FxpmCloseness XpmCloseness #define FxpmVisual XpmVisual #define FxpmColormap XpmColormap #define FxpmDepth XpmDepth #define FxpmHotspot XpmHotspot #define FxpmExtensions XpmExtensions #define FxpmCharsPerPixel XpmCharsPerPixel #define FxpmColorSymbols XpmColorSymbols #define FxpmRgbFilename XpmRgbFilename #define FxpmInfos XpmInfos #define FxpmReturnInfos XpmReturnInfos #define FxpmReturnExtensions XpmReturnExtensions #define FxpmRGBCloseness XpmRGBCloseness #define FxpmColorKey XpmColorKey #define FxpmAllocCloseColors XpmAllocCloseColors #define FxpmBitmapFormat XpmBitmapFormat #define FxpmAllocColor XpmAllocColor #define FxpmFreeColors XpmFreeColors #define FxpmColorClosure XpmColorClosure #define FxpmComments XpmComments #define FxpmReturnComments XpmReturnComments #define FxpmUndefPixel XpmUndefPixel #define FxpmColorError XpmColorError #define FxpmSuccess XpmSuccess #define FxpmOpenFailed XpmOpenFailed #define FxpmFileInvalid XpmFileInvalid #define FxpmNoMemory XpmNoMemory #define FxpmColorFailed XpmColorFailed #define FXPM_MONO XPM_MONO #define FXPM_GREY4 XPM_GREY4 #define FXPM_GRAY4 XPM_GRAY4 #define FXPM_GREY XPM_GREY #define FXPM_GRAY XPM_GRAY #define FXPM_COLOR XPM_COLOR #define FxpmReadFileToXpmImage(a,b,c) XpmReadFileToXpmImage(a,b,c) #define FxpmCreatePixmapFromXpmImage(a,b,c,d,e,f) \ XpmCreatePixmapFromXpmImage(a,b,c,d,e,f) #define FxpmFreeXpmImage(a) XpmFreeXpmImage(a) #define FxpmFreeXpmInfo(a) XpmFreeXpmInfo(a) #define FxpmReadFileToPixmap(a,b,c,d,e,f) XpmReadFileToPixmap(a,b,c,d,e,f) #define FxpmReadFileToImage(a,b,c,d,e) XpmReadFileToImage(a,b,c,d,e) #define FxpmCreatePixmapFromData(a,b,c,d,e,f) \ XpmCreatePixmapFromData(a,b,c,d,e,f) #else /* !XpmSupport */ #define FxpmReturnPixels 0 #define FxpmSize 0 #define FxpmReturnAllocPixels 0 #define FxpmCloseness 0 #define FxpmVisual 0 #define FxpmColormap 0 #define FxpmDepth 0 #define FxpmHotspot 0 #define FxpmExtensions 0 #define FxpmCharsPerPixel 0 #define FxpmColorSymbols 0 #define FxpmRgbFilename 0 #define FxpmInfos 0 #define FxpmReturnInfos 0 #define FxpmReturnExtensions 0 #define FxpmRGBCloseness 0 #define FxpmColorKey 0 #define FxpmAllocCloseColors 0 #define FxpmBitmapFormat 0 #define FxpmAllocColor 0 #define FxpmFreeColors 0 #define FxpmColorClosure 0 #define FxpmComments 0 #define FxpmReturnComments 0 #define FxpmUndefPixel 0 #define FxpmColorError 1 #define FxpmSuccess 0 #define FxpmOpenFailed -1 #define FxpmFileInvalid -2 #define FxpmNoMemory -3 #define FxpmColorFailed -4 #define FXPM_MONO 2 #define FXPM_GREY4 3 #define FXPM_GRAY4 3 #define FXPM_GREY 4 #define FXPM_GRAY 4 #define FXPM_COLOR 5 #define FxpmReadFileToXpmImage(a,b,c) 0 #define FxpmCreatePixmapFromXpmImage(a,b,c,d,e,f) 0 #define FxpmFreeXpmImage(a) #define FxpmFreeXpmInfo(a) #define FxpmReadFileToPixmap(a,b,c,d,e,f) 0 #define FxpmCreatePixmapFromData(a,b,c,d,e,f) 0 #endif /* XpmSupport */ #endif /* FXPM_H */ fvwm-2.6.5.orig/libs/PictureBase.c0000644000175000017500000001542211622413321015124 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* Changed 02/12/97 by Dan Espen: - added routines to determine color closeness, for color use reduction. Some of the logic comes from pixy2, so the copyright is below. */ /* * Copyright 1996, Romano Giannetti. No guarantees or warantees or anything * are provided or implied in any way whatsoever. Use this program at your * own risk. Permission to use this program for any purpose is given, * as long as the copyright is kept intact. * * Romano Giannetti - Dipartimento di Ingegneria dell'Informazione * via Diotisalvi, 2 PISA * mailto:romano@iet.unipi.it * http://www.iet.unipi.it/~romano * */ /* * * Routines to handle initialization, loading, and removing of xpm's or mono- * icon images. * */ #include "config.h" #include #include #include "fvwmlib.h" #include "Graphics.h" #include "PictureBase.h" #include "PictureUtils.h" #include "Fsvg.h" #include "Strings.h" Bool Pdefault; Visual *Pvisual; static Visual *FvwmVisual; Colormap Pcmap; static Colormap FvwmCmap; unsigned int Pdepth; static unsigned int FvwmDepth; Display *Pdpy; /* Save area for display pointer */ Bool PUseDynamicColors; Pixel PWhitePixel; Pixel PBlackPixel; Pixel FvwmWhitePixel; Pixel FvwmBlackPixel; void PictureSetupWhiteAndBlack(void); void PictureInitCMap(Display *dpy) { char *envp; Pdpy = dpy; /* if fvwm has not set this env-var it is using the default visual */ envp = getenv("FVWM_VISUALID"); if (envp != NULL && *envp > 0) { /* convert the env-vars to a visual and colormap */ int viscount; XVisualInfo vizinfo, *xvi; sscanf(envp, "%lx", &vizinfo.visualid); xvi = XGetVisualInfo(dpy, VisualIDMask, &vizinfo, &viscount); Pvisual = xvi->visual; Pdepth = xvi->depth; /* Note: if FVWM_VISUALID is set, FVWM_COLORMAP is set too */ sscanf(getenv("FVWM_COLORMAP"), "%lx", &Pcmap); Pdefault = False; } else { int screen = DefaultScreen(dpy); Pvisual = DefaultVisual(dpy, screen); Pdepth = DefaultDepth(dpy, screen); Pcmap = DefaultColormap(dpy, screen); Pdefault = True; } PictureSetupWhiteAndBlack(); PictureSaveFvwmVisual(); /* initialise color limit */ PUseDynamicColors = 0; PictureInitColors(PICTURE_CALLED_BY_MODULE, True, NULL, False, True); return; } void PictureInitCMapRoot( Display *dpy, Bool init_color_limit, PictureColorLimitOption *opt, Bool use_my_color_limit, Bool init_dither) { int screen = DefaultScreen(dpy); Pdpy = dpy; Pvisual = DefaultVisual(dpy, screen); Pdepth = DefaultDepth(dpy, screen); Pcmap = DefaultColormap(dpy, screen); Pdefault = True; PictureSetupWhiteAndBlack(); PictureSaveFvwmVisual(); /* initialise color limit */ PictureInitColors( PICTURE_CALLED_BY_MODULE, init_color_limit, opt, use_my_color_limit, init_dither); return; } void PictureSetupWhiteAndBlack(void) { XColor c; if (!Pdefault) { c.flags = DoRed|DoGreen|DoBlue; c.red = c.green = c.blue = 65535; XAllocColor(Pdpy, Pcmap, &c); PWhitePixel = c.pixel; c.red = c.green = c.blue = 0; XAllocColor(Pdpy, Pcmap, &c); PBlackPixel = c.pixel; } else { PWhitePixel = WhitePixel(Pdpy, DefaultScreen(Pdpy)); PBlackPixel = BlackPixel(Pdpy, DefaultScreen(Pdpy)); } return; } void PictureUseDefaultVisual(void) { int screen = DefaultScreen(Pdpy); Pvisual = DefaultVisual(Pdpy, screen); Pdepth = DefaultDepth(Pdpy, screen); Pcmap = DefaultColormap(Pdpy, screen); PWhitePixel = WhitePixel(Pdpy, DefaultScreen(Pdpy)); PBlackPixel = BlackPixel(Pdpy, DefaultScreen(Pdpy)); return; } void PictureUseFvwmVisual(void) { Pvisual = FvwmVisual; Pdepth = FvwmDepth; Pcmap = FvwmCmap; PWhitePixel = FvwmWhitePixel; PBlackPixel = FvwmBlackPixel; return; } void PictureSaveFvwmVisual(void) { FvwmVisual = Pvisual; FvwmDepth = Pdepth; FvwmCmap = Pcmap; FvwmWhitePixel = PWhitePixel; FvwmBlackPixel = PBlackPixel; return; } Pixel PictureWhitePixel(void) { return PWhitePixel; } Pixel PictureBlackPixel(void) { return PBlackPixel; } GC PictureDefaultGC(Display *dpy, Window win) { static GC gc = None; if (Pdepth == DefaultDepth(dpy, DefaultScreen(dpy))) { return DefaultGC(dpy, DefaultScreen(dpy)); } if (gc == None) { gc = fvwmlib_XCreateGC(dpy, win, 0, NULL); } return gc; } static char* imagePath = FVWM_IMAGEPATH; void PictureSetImagePath( const char* newpath ) { static int need_to_free = 0; setPath( &imagePath, newpath, need_to_free ); need_to_free = 1; return; } char* PictureGetImagePath(void) { return imagePath; } /* * * Find the specified image file somewhere along the given path. * * There is a possible race condition here: We check the file and later * do something with it. By then, the file might not be accessible. * Oh well. * */ char* PictureFindImageFile(const char* icon, const char* pathlist, int type) { int length; char *tmpbuf; char *full_filename; const char *render_opts; if (pathlist == NULL) { pathlist = imagePath; } if (icon == NULL) { return NULL; } full_filename = searchPath(pathlist, icon, ".gz", type); /* With USE_SVG, rendering options may be appended to the original filename, hence seachPath() won't find the file. So we hide any such appended options and try once more. */ if (USE_SVG && !full_filename && (render_opts = strrchr(icon, ':'))) { length = render_opts - icon; tmpbuf = (char *)safemalloc(length + 1); strncpy(tmpbuf, icon, length); tmpbuf[length] = 0; full_filename = searchPath(pathlist, tmpbuf, ".gz", type); free(tmpbuf); if (full_filename) { /* Prepending (the previously appended) options will leave any file suffix exposed. Callers who want to access the file on disk will have to remove these prepended options themselves. The format is ":svg_opts:/path/to/file.svg". */ tmpbuf = CatString3(render_opts, ":", full_filename); free(full_filename); full_filename = safestrdup(tmpbuf); } } return full_filename; } fvwm-2.6.5.orig/libs/FRenderInit.c0000644000175000017500000000630210226463751015077 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "fvwmlib.h" #include "PictureBase.h" #include "FRenderInit.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ Bool FRenderExtensionSupported = False; int FRenderErrorBase = -10000; int FRenderMajorOpCode = -10000; int FRenderAlphaDepth = 0; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ void FRenderInit(Display *dpy) { int event_basep; FRenderAlphaDepth = 8; if (!XRenderSupport || !(FRenderExtensionSupported = XQueryExtension( dpy, "RENDER", &FRenderMajorOpCode, &event_basep, &FRenderErrorBase))) { int *pmf = NULL; int i,n; int alpha_depth = 0; FRenderErrorBase = -10000; FRenderMajorOpCode = -10000; FRenderExtensionSupported = 0; pmf = XListDepths(dpy, DefaultScreen(dpy), &n); if (pmf) { i = 0; while(i < n) { if (pmf[i] == 8) { alpha_depth = 8; i = n-1; } else if (pmf[i] >= 8 && (pmf[i] < alpha_depth || alpha_depth == 0)) { alpha_depth = pmf[i]; } i++; } XFree(pmf); } FRenderAlphaDepth = alpha_depth; } } int FRenderGetErrorCodeBase(void) { return FRenderErrorBase; } int FRenderGetMajorOpCode(void) { return FRenderMajorOpCode; } Bool FRenderGetExtensionSupported(void) { return FRenderExtensionSupported; } int FRenderGetAlphaDepth(void) { return FRenderAlphaDepth; } Bool FRenderGetErrorText(int code, char *msg) { if (XRenderSupport) { static char *error_names[] = { "BadPictFormat", "BadPicture", "BadPictOp", "BadGlyphSet", "BadGlyph" }; if (code >= FRenderErrorBase && code <= FRenderErrorBase + (sizeof(error_names) / sizeof(char *)) -1) { sprintf(msg, error_names[code - FRenderErrorBase]); return 1; } } return 0; } fvwm-2.6.5.orig/libs/ColorUtils.h0000644000175000017500000000277110556633567015052 0ustar vwcvwc#ifndef LIB_COLORUTILS_H #define LIB_COLORUTILS_H /* * Stuff for dealing w/ bitmaps & pixmaps: */ XColor *GetShadowColor(Pixel); XColor *GetHiliteColor(Pixel); Pixel GetShadow(Pixel); Pixel GetHilite(Pixel); XColor *GetForeShadowColor(Pixel foreground, Pixel background); Pixel GetForeShadow(Pixel foreground, Pixel background); XColor *GetTintedColor(Pixel in, Pixel tint, int percent); Pixel GetTintedPixel(Pixel in, Pixel tint, int percent); /* This function converts the colour stored in a colorcell (pixel) into the * string representation of a colour. The output is printed at the * address 'output'. It is either in rgb format ("rgb:rrrr/gggg/bbbb") if * use_hash is False or in hash notation ("#rrrrggggbbbb") if use_hash is true. * The return value is the number of characters used by the string. The * rgb values of the output are undefined if the colorcell is invalid. The * memory area pointed at by 'output' must be at least 64 bytes (in case of * future extensions and multibyte characters).*/ int pixel_to_color_string( Display *dpy, Colormap cmap, Pixel pixel, char *output, Bool use_hash); Pixel GetSimpleColor(char *name); /* handles colorset color names too */ Pixel GetColor(char *name); /* duplicate an already allocated color */ Pixel fvwmlib_clone_color(Pixel p); void fvwmlib_free_colors(Display *dpy, Pixel *pixels, int n, Bool no_limit); void fvwmlib_copy_color( Display *dpy, Pixel *dst_color, Pixel *src_color, Bool do_free_dest, Bool do_copy_src); #endif /* LIB_COLORUTILS_H */ fvwm-2.6.5.orig/libs/PictureImageLoader.c0000644000175000017500000005303611622413321016426 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 1993, Robert Nation * Copyright (C) 1999 Carsten Haitzler and various contributors (imlib2) * Copyright (C) 2002 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * * The png loader and PImageRGBtoPixel are from imlib2. The code is from raster * (Carsten Haitzler) * */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include #include #include #include "System.h" #include "Strings.h" #include "Picture.h" #include "PictureUtils.h" #include "Graphics.h" #include "ColorUtils.h" #include "Fxpm.h" #include "Fpng.h" #include "Fsvg.h" #include "FRenderInit.h" #include "Fcursor.h" #include "FImage.h" /* ---------------------------- local definitions -------------------------- */ #define FIMAGE_CMD_ARGS \ Display *dpy, char *path, CARD32 **argb_data, int *width, int *height #define FIMAGE_PASS_ARGS \ dpy, path, argb_data, width, height typedef struct PImageLoader { char *extension; #ifdef __STDC__ int (*func)(FIMAGE_CMD_ARGS); #else int (*func)(); #endif } PImageLoader; /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ static Bool PImageLoadSvg(FIMAGE_CMD_ARGS); static Bool PImageLoadPng(FIMAGE_CMD_ARGS); static Bool PImageLoadXpm(FIMAGE_CMD_ARGS); /* ---------------------------- local variables ---------------------------- */ PImageLoader Loaders[] = { { "xpm", PImageLoadXpm }, { "svg", PImageLoadSvg }, { "png", PImageLoadPng }, {NULL,0} }; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static Bool PImageLoadArgbDataFromFile(FIMAGE_CMD_ARGS) { int done = 0, i = 0, tried = -1; char *ext = NULL; if (path == NULL) return False; if (strlen(path) > 3) { ext = path + strlen(path) - 3; } /* first try to load by extension */ while (!done && ext != NULL && Loaders[i].extension != NULL) { if (StrEquals(Loaders[i].extension, ext)) { if (Loaders[i].func(FIMAGE_PASS_ARGS)) { return True; } tried = i; done = 1; } i++; } i = 0; while (Loaders[i].extension != NULL) { if (i != tried && Loaders[i].func(FIMAGE_PASS_ARGS)) { return True; } i++; } return False; } /* * * svg loader * */ static Bool PImageLoadSvg(FIMAGE_CMD_ARGS) { char *allocated_path; char *render_opts; FRsvgHandle *rsvg; FRsvgDimensionData dim; CARD32 *data; Fcairo_surface_t *surface; Fcairo_t *cr; int i; int j; int b1; int b2; int w = 0; int h = 0; int dw = 0; int dh = 0; int w_sgn = 1; int h_sgn = 1; double angle = 0; double w_scale = 1; double h_scale = 1; double buf; Bool transpose = False; unsigned char a_value; unsigned char r_value; unsigned char g_value; unsigned char b_value; if (!USE_SVG) { return False; } /* Separate rendering options from path */ render_opts = path = allocated_path = safestrdup(path); if (*path == ':' && (path = strchr(path + 1, ':'))) { *path = 0; path ++; render_opts ++; } else { render_opts = ""; } if (!(rsvg = Frsvg_handle_new_from_file(path, NULL))) { free(allocated_path); return False; } /* Parsing of rendering options */ while (*render_opts) { i = 0; switch (*render_opts) { case '!': transpose = !transpose; break; case '*': if (sscanf(render_opts, "*%lf%n", &buf, &i) >= 1) { switch (render_opts[i]) { case 'x': w_scale *= buf; i ++; break; case 'y': h_scale *= buf; i ++; break; default: w_scale *= buf; h_scale *= buf; } } break; case '/': if (sscanf(render_opts, "/%lf%n", &buf, &i) >= 1 && buf) { switch (render_opts[i]) { case 'x': w_scale /= buf; i ++; break; case 'y': h_scale /= buf; i ++; break; default: w_scale /= buf; h_scale /= buf; } } break; case '@': if (sscanf(render_opts, "@%lf%n", &buf, &i) >= 1) { angle += buf; } break; default: j = 0; if ( sscanf( render_opts, "%dx%n%d%n", &b1, &j, &b2, &i) >= 2 && i > j) { w = b1; h = b2; if (w < 0 || (!w && render_opts[0] == '-')) { w *= (w_sgn = -1); } if (h < 0 || (!h && render_opts[j] == '-')) { h *= (h_sgn = -1); } } else if ( sscanf(render_opts, "%d%d%n", &b1, &b2, &i) >= 2) { dw += b1; dh += b2; } } render_opts += i ? i : 1; } free(allocated_path); /* Keep the original aspect ratio when either w or h is 0 */ Frsvg_handle_get_dimensions(rsvg, &dim); if (!w && !h) { w = dim.width; h = dim.height; } else if (!w) { w = h * dim.em / dim.ex; } else if (!h) { h = w * dim.ex / dim.em; } w_scale *= w; h_scale *= h; if (transpose) { b1 = w; w = h; h = b1; b1 = w_sgn; w_sgn = - h_sgn; h_sgn = b1; b1 = dw; dw = - dh; dh = b1; angle += 90; } data = (CARD32 *)safemalloc(w * h * sizeof(CARD32)); memset(data, 0, w * h * sizeof(CARD32)); surface = Fcairo_image_surface_create_for_data((unsigned char *)data, FCAIRO_FORMAT_ARGB32, w, h, w * sizeof(CARD32)); if (Fcairo_surface_status(surface) != FCAIRO_STATUS_SUCCESS) { Fg_object_unref(FG_OBJECT(rsvg)); free(data); if (surface) { Fcairo_surface_destroy(surface); } return False; } cr = Fcairo_create(surface); Fcairo_surface_destroy(surface); if (Fcairo_status(cr) != FCAIRO_STATUS_SUCCESS) { Fg_object_unref(FG_OBJECT(rsvg)); free(data); if (cr) { Fcairo_destroy(cr); } return False; } /* Affine transformations ... * mirroring, rotation, scaling and translation */ Fcairo_translate(cr, .5 * w, .5 * h); Fcairo_scale(cr, w_sgn, h_sgn); Fcairo_translate(cr, dw, dh); Fcairo_rotate(cr, angle * M_PI / 180); Fcairo_scale(cr, w_scale, h_scale); Fcairo_translate(cr, -.5, -.5); Fcairo_scale(cr, 1 / dim.em, 1 / dim.ex); Frsvg_handle_render_cairo(rsvg, cr); Fg_object_unref(FG_OBJECT(rsvg)); Fcairo_destroy(cr); /* Cairo gave us alpha prescaled RGB values, hence we need * to rescale them for PImageCreatePixmapFromArgbData() */ for (i = 0; i < w * h; i++) { if ((a_value = (data[i] >> 030) & 0xff)) { r_value = ((data[i] >> 020) & 0xff) * 0xff / a_value; g_value = ((data[i] >> 010) & 0xff) * 0xff / a_value; b_value = (data[i] & 0xff) * 0xff / a_value; data[i] = (a_value << 030) | (r_value << 020) | (g_value << 010) | b_value; } } *width = w; *height = h; *argb_data = data; return True; } /* * * png loader * */ static Bool PImageLoadPng(FIMAGE_CMD_ARGS) { Fpng_uint_32 w32, h32; Fpng_structp Fpng_ptr = NULL; Fpng_infop Finfo_ptr = NULL; CARD32 *data; int w, h; char hasa = 0, hasg = 0; FILE *f; int bit_depth; int color_type; int interlace_type; unsigned char buf[FPNG_BYTES_TO_CHECK]; unsigned char **lines; int i; if (!PngSupport) { /* suppress compiler warning */ bit_depth = 0; return False; } if (!(f = fopen(path, "rb"))) { return False; } fread(buf, 1, FPNG_BYTES_TO_CHECK, f); if (!Fpng_check_sig(buf, FPNG_BYTES_TO_CHECK)) { fclose(f); return False; } rewind(f); Fpng_ptr = Fpng_create_read_struct(FPNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (!Fpng_ptr) { fclose(f); return False; } Finfo_ptr = Fpng_create_info_struct(Fpng_ptr); if (!Finfo_ptr) { Fpng_destroy_read_struct(&Fpng_ptr, NULL, NULL); fclose(f); return False; } #if 0 if (setjmp(Fpng_ptr->jmpbuf)) { Fpng_destroy_read_struct(&Fpng_ptr, &Finfo_ptr, NULL); fclose(f); return False; } #endif Fpng_init_io(Fpng_ptr, f); Fpng_read_info(Fpng_ptr, Finfo_ptr); Fpng_get_IHDR( Fpng_ptr, Finfo_ptr, (Fpng_uint_32 *) (&w32), (Fpng_uint_32 *) (&h32), &bit_depth, &color_type, &interlace_type, NULL, NULL); interlace_type = 0; /* not used */ *width = w = (int) w32; *height = h = (int) h32; if (color_type == FPNG_COLOR_TYPE_PALETTE) { Fpng_set_expand(Fpng_ptr); } /* TA: XXX: (2011-02-14) -- Happy Valentines Day. * * png_get_color_type() defined in libpng 1.5 now hides a data member * to a struct: * * Finfo_ptr->color_type * * I'm not going to wrap this up in more #ifdef madness, but should * this fail to build on much older libpng versions which we support * (pre 1.3), then I might have to. */ if (png_get_color_type(Fpng_ptr, Finfo_ptr) == FPNG_COLOR_TYPE_RGB_ALPHA) { hasa = 1; } if (png_get_color_type(Fpng_ptr, Finfo_ptr) == FPNG_COLOR_TYPE_GRAY_ALPHA) { hasa = 1; hasg = 1; } if (png_get_color_type(Fpng_ptr, Finfo_ptr) == FPNG_COLOR_TYPE_GRAY) { hasg = 1; } if (hasa) Fpng_set_expand(Fpng_ptr); /* we want ARGB */ /* note form raster: * thanks to mustapha for helping debug this on PPC Linux remotely by * sending across screenshots all the time and me figuring out form them * what the hell was up with the colors * now png loading should work on big endian machines nicely */ #ifdef WORDS_BIGENDIAN Fpng_set_swap_alpha(Fpng_ptr); Fpng_set_filler(Fpng_ptr, 0xff, FPNG_FILLER_BEFORE); #else Fpng_set_bgr(Fpng_ptr); Fpng_set_filler(Fpng_ptr, 0xff, FPNG_FILLER_AFTER); #endif /* 16bit color -> 8bit color */ Fpng_set_strip_16(Fpng_ptr); /* pack all pixels to byte boundaires */ Fpng_set_packing(Fpng_ptr); if (Fpng_get_valid(Fpng_ptr, Finfo_ptr, FPNG_INFO_tRNS)) { Fpng_set_expand(Fpng_ptr); } data = (CARD32 *)safemalloc(w * h * sizeof(CARD32)); lines = (unsigned char **) safemalloc(h * sizeof(unsigned char *)); if (hasg) { Fpng_set_gray_to_rgb(Fpng_ptr); if (Fpng_get_bit_depth(Fpng_ptr, Finfo_ptr) < 8) { Fpng_set_gray_1_2_4_to_8(Fpng_ptr); } } for (i = 0; i < h; i++) { lines[i] = (unsigned char *)data + (i * w * sizeof(CARD32)); } Fpng_read_image(Fpng_ptr, lines); Fpng_read_end(Fpng_ptr, Finfo_ptr); Fpng_destroy_read_struct(&Fpng_ptr, &Finfo_ptr, (png_infopp) NULL); fclose(f); free(lines); *argb_data = data; return True; } /* * * xpm loader * */ static Bool PImageLoadXpm(FIMAGE_CMD_ARGS) { FxpmImage xpm_im; FxpmColor *xpm_color; XColor color; CARD32 *colors; CARD32 *data; char *visual_color; int i; int w; int h; int rc; #ifdef HAVE_SIGACTION struct sigaction defaultHandler; struct sigaction originalHandler; #else RETSIGTYPE (*originalHandler)(int); #endif if (!XpmSupport) { return False; } memset(&xpm_im, 0, sizeof(FxpmImage)); #ifdef HAVE_SIGACTION sigemptyset(&defaultHandler.sa_mask); defaultHandler.sa_flags = 0; defaultHandler.sa_handler = SIG_DFL; sigaction(SIGCHLD, &defaultHandler, &originalHandler); #else originalHandler = signal(SIGCHLD, SIG_DFL); #endif rc = FxpmReadFileToXpmImage(path, &xpm_im, NULL); #ifdef HAVE_SIGACTION sigaction(SIGCHLD, &originalHandler, NULL); #else signal(SIGCHLD, originalHandler); #endif if (rc != FxpmSuccess) { return False; } if (xpm_im.ncolors <= 0) { FxpmFreeXpmImage(&xpm_im); return False; } colors = (CARD32 *)safemalloc(xpm_im.ncolors * sizeof(CARD32)); for (i=0; i < xpm_im.ncolors; i++) { xpm_color = &xpm_im.colorTable[i]; if (xpm_color->c_color) { visual_color = xpm_color->c_color; } else if (xpm_color->g_color) { visual_color = xpm_color->g_color; } else if (xpm_color->g4_color) { visual_color = xpm_color->g4_color; } else { visual_color = xpm_color->m_color; } if (XParseColor(dpy, Pcmap, visual_color, &color)) { colors[i] = 0xff000000 | ((color.red << 8) & 0xff0000) | ((color.green ) & 0xff00) | ((color.blue >> 8) & 0xff); } else { colors[i] = 0; } } *width = w = xpm_im.width; *height = h = xpm_im.height; data = (CARD32 *)safemalloc(w * h * sizeof(CARD32)); for (i=0; i < w * h; i++) { data[i] = colors[xpm_im.data[i]]; } free(colors); *argb_data = data; return True; } /* * * copy image to server * */ static Pixmap PImageCreatePixmapFromFImage(Display *dpy, Window win, FImage *fimage) { GC gc; Pixmap pixmap; int w; int h; int depth; w = fimage->im->width; h = fimage->im->height; depth = fimage->im->depth; pixmap = XCreatePixmap(dpy, win, w, h, depth); if (depth == Pdepth) { gc = PictureDefaultGC(dpy, win); } else { gc = fvwmlib_XCreateGC(dpy, pixmap, 0, NULL); } FPutFImage(dpy, pixmap, gc, fimage, 0, 0, 0, 0, w, h); if (depth != Pdepth) { XFreeGC(dpy, gc); } return pixmap; } /* ---------------------------- interface functions ------------------------ */ /* * * argb data to pixmaps * */ Bool PImageCreatePixmapFromArgbData( Display *dpy, Window win, CARD32 *data, int start, int width, int height, Pixmap *pixmap, Pixmap *mask, Pixmap *alpha, int *nalloc_pixels, Pixel **alloc_pixels, int *no_limit, FvwmPictureAttributes fpa) { FImage *fim; FImage *m_fim = NULL; FImage *a_fim = NULL; XColor c; int i; int j; int a; PictureImageColorAllocator *pica = NULL; int alpha_limit = PICTURE_ALPHA_LIMIT; int alpha_depth = FRenderGetAlphaDepth(); Bool have_mask = False; Bool have_alpha = False; fim = FCreateFImage( dpy, Pvisual, (fpa.mask & FPAM_MONOCHROME) ? 1 : Pdepth, ZPixmap, width, height); if (!fim) { return False; } if (mask) { m_fim = FCreateFImage( dpy, Pvisual, 1, ZPixmap, width, height); } if (alpha && !(fpa.mask & FPAM_NO_ALPHA) && alpha_depth) { alpha_limit = 0; a_fim = FCreateFImage( dpy, Pvisual, alpha_depth, ZPixmap, width, height); } if (!(fpa.mask & FPAM_MONOCHROME)) { c.flags = DoRed | DoGreen | DoBlue; pica = PictureOpenImageColorAllocator( dpy, Pcmap, width, height, !!(fpa.mask & FPAM_NO_COLOR_LIMIT), !!(fpa.mask & FPAM_NO_ALLOC_PIXELS), !!(fpa.mask & FPAM_DITHER), True); } data += start; for (j = 0; j < height; j++) { for (i = 0; i < width; i++, data++) { a = (*data >> 030) & 0xff; if (a > alpha_limit) { c.red = (*data >> 16) & 0xff; c.green = (*data >> 8) & 0xff; c.blue = (*data ) & 0xff; if (pica) { PictureAllocColorImage( dpy, pica, &c, i, j); XPutPixel(fim->im, i, j, c.pixel); } /* Brightness threshold */ else if ((0x99 * c.red + 0x12D * c.green + 0x3A * c.blue) >> 16) { XPutPixel(fim->im, i, j, 1); } else { XPutPixel(fim->im, i, j, 0); } if (m_fim) { XPutPixel(m_fim->im, i, j, 1); } } else if (m_fim != NULL) { XPutPixel(m_fim->im, i, j, 0); have_mask = True; } if (a_fim != NULL) { XPutPixel(a_fim->im, i, j, a); if (a > 0 && a < 0xff) { have_alpha = True; } } } } if (pica) { PictureCloseImageColorAllocator( dpy, pica, nalloc_pixels, alloc_pixels, no_limit); } *pixmap = PImageCreatePixmapFromFImage(dpy, win, fim); if (have_alpha) { *alpha = PImageCreatePixmapFromFImage(dpy, win, a_fim); } else if (have_mask) { *mask = PImageCreatePixmapFromFImage(dpy, win, m_fim); } FDestroyFImage(dpy, fim); if (m_fim) { FDestroyFImage(dpy, m_fim); } if (a_fim) { FDestroyFImage(dpy, a_fim); } return True; } /* * * the images loaders * */ Bool PImageLoadPixmapFromFile( Display *dpy, Window win, char *path, Pixmap *pixmap, Pixmap *mask, Pixmap *alpha, int *width, int *height, int *depth, int *nalloc_pixels, Pixel **alloc_pixels, int *no_limit, FvwmPictureAttributes fpa) { CARD32 *data; if (PImageLoadArgbDataFromFile(dpy, path, &data, width, height)) { *depth = (fpa.mask & FPAM_MONOCHROME) ? 1 : Pdepth; if (PImageCreatePixmapFromArgbData( dpy, win, data, 0, *width, *height, pixmap, mask, alpha, nalloc_pixels, alloc_pixels, no_limit, fpa)) { free(data); return True; } free(data); } /* Bitmap fallback */ else if ( XReadBitmapFile( dpy, win, path, (unsigned int *)width, (unsigned int *)height, pixmap, NULL, NULL) == BitmapSuccess) { *depth = 1; *mask = None; return True; } pixmap = None; mask = None; alpha = None; *width = *height = *depth = 0; if (nalloc_pixels != NULL) { *nalloc_pixels = 0; } if (alloc_pixels != NULL) { *alloc_pixels = NULL; } return False; } FvwmPicture *PImageLoadFvwmPictureFromFile( Display *dpy, Window win, char *path, FvwmPictureAttributes fpa) { FvwmPicture *p; Pixmap pixmap = None; Pixmap mask = None; Pixmap alpha = None; int width = 0, height = 0; int depth = 0, no_limit; int nalloc_pixels = 0; Pixel *alloc_pixels = NULL; char *real_path; /* Remove any svg rendering options from real_path */ if (USE_SVG && *path == ':' && (real_path = strchr(path + 1, ':'))) { real_path ++; } else { real_path = path; } if (!PImageLoadPixmapFromFile( dpy, win, path, &pixmap, &mask, &alpha, &width, &height, &depth, &nalloc_pixels, &alloc_pixels, &no_limit, fpa)) { return NULL; } p = (FvwmPicture*)safemalloc(sizeof(FvwmPicture)); memset(p, 0, sizeof(FvwmPicture)); p->count = 1; p->name = path; p->fpa_mask = fpa.mask; p->next = NULL; setFileStamp(&p->stamp, real_path); p->picture = pixmap; p->mask = mask; p->alpha = alpha; p->width = width; p->height = height; p->depth = depth; p->nalloc_pixels = nalloc_pixels; p->alloc_pixels = alloc_pixels; p->no_limit = no_limit; return p; } Cursor PImageLoadCursorFromFile( Display *dpy, Window win, char *path, int x_hot, int y_hot) { Cursor cursor = 0; CARD32 *data; int width; int height; int i; FcursorImages *fcis; FcursorImage *fci; /* First try the Xcursor loader (animated cursors) */ if ((fcis = FcursorFilenameLoadImages( path, FcursorGetDefaultSize(dpy)))) { for (i = 0; i < fcis->nimage; i++) { if (x_hot < fcis->images[i]->width && x_hot >= 0 && y_hot < fcis->images[i]->height && y_hot >= 0) { fcis->images[i]->xhot = x_hot; fcis->images[i]->yhot = y_hot; } } cursor = FcursorImagesLoadCursor(dpy, fcis); FcursorImagesDestroy(fcis); } /* Get cursor data from the regular image loader */ else if (PImageLoadArgbDataFromFile(dpy, path, &data, &width, &height)) { Pixmap src; Pixmap msk = None; FvwmPictureAttributes fpa; fpa.mask = FPAM_NO_ALPHA | FPAM_MONOCHROME; /* Adjust the hot-spot if necessary */ if ( x_hot < 0 || x_hot >= width || y_hot < 0 || y_hot >= height) { FxpmImage xpm_im; FxpmInfo xpm_info; memset(&xpm_im, 0, sizeof(FxpmImage)); memset(&xpm_info, 0, sizeof(FxpmInfo)); if (FxpmReadFileToXpmImage(path, &xpm_im, &xpm_info) == FxpmSuccess) { if (xpm_info.valuemask & FxpmHotspot) { x_hot = xpm_info.x_hotspot; y_hot = xpm_info.y_hotspot; } FxpmFreeXpmImage(&xpm_im); FxpmFreeXpmInfo(&xpm_info); } if (x_hot < 0 || x_hot >= width) { x_hot = width / 2; } if (y_hot < 0 || y_hot >= height) { y_hot = height / 2; } } /* Use the Xcursor library to create the argb cursor */ if ((fci = FcursorImageCreate(width, height))) { unsigned char alpha; unsigned char red; unsigned char green; unsigned char blue; /* Xcursor expects alpha prescaled RGB values */ for (i = 0; i < width * height; i++) { alpha = ((data[i] >> 24) & 0xff); red = ((data[i] >> 16) & 0xff) * alpha/0xff; green = ((data[i] >> 8) & 0xff) * alpha/0xff; blue = ((data[i] ) & 0xff) * alpha/0xff; data[i] = (alpha << 24) | (red << 16) | (green << 8) | blue; } fci->xhot = x_hot; fci->yhot = y_hot; fci->delay = 0; fci->pixels = (FcursorPixel *)data; cursor = FcursorImageLoadCursor(dpy, fci); FcursorImageDestroy(fci); } /* Create monochrome cursor from argb data */ else if (PImageCreatePixmapFromArgbData( dpy, win, data, 0, width, height, &src, &msk, 0, 0, 0, 0, fpa)) { XColor c[2]; c[0].pixel = GetColor(DEFAULT_CURSOR_FORE_COLOR); c[1].pixel = GetColor(DEFAULT_CURSOR_BACK_COLOR); XQueryColors(dpy, Pcmap, c, 2); cursor = XCreatePixmapCursor( dpy, src, msk, &(c[0]), &(c[1]), x_hot, y_hot); XFreePixmap(dpy, src); XFreePixmap(dpy, msk); } free(data); } return cursor; } /* FIXME: Use color limit */ Bool PImageLoadPixmapFromXpmData( Display *dpy, Window win, int color_limit, char **data, Pixmap *pixmap, Pixmap *mask, int *width, int *height, int *depth) { FxpmAttributes xpm_attributes; if (!XpmSupport) { return False; } xpm_attributes.valuemask = FxpmCloseness | FxpmExtensions | FxpmVisual | FxpmColormap | FxpmDepth; xpm_attributes.closeness = 40000; xpm_attributes.visual = Pvisual; xpm_attributes.colormap = Pcmap; xpm_attributes.depth = Pdepth; /* suppress compiler warning if xpm library is not compiled in */ xpm_attributes.width = 0; xpm_attributes.height = 0; if ( FxpmCreatePixmapFromData( dpy, win, data, pixmap, mask, &xpm_attributes) != FxpmSuccess) { return False; } *width = xpm_attributes.width; *height = xpm_attributes.height; *depth = Pdepth; return True; } fvwm-2.6.5.orig/libs/Graphics.h0000644000175000017500000000561510556633567014513 0ustar vwcvwc#ifndef LIB_GRAPHICS_H #define LIB_GRAPHICS_H void do_relieve_rectangle( Display *dpy, Drawable d, int x, int y, int w, int h, GC ReliefGC, GC ShadowGC, int line_width, Bool use_alternate_shading); void do_relieve_rectangle_with_rotation( Display *dpy, Drawable d, int x, int y, int w, int h, GC ReliefGC, GC ShadowGC, int line_width, Bool use_alternate_shading, int rotation); #define RelieveRectangle(dpy, d, x, y, w, h, ReliefGC, ShadowGC, line_width) \ do_relieve_rectangle( \ dpy, d, x, y, w, h, ReliefGC, ShadowGC, line_width, False) #define RelieveRectangle2(dpy, d, x, y, w, h, ReliefGC, ShadowGC, line_width) \ do_relieve_rectangle( \ dpy, d, x, y, w, h, ReliefGC, ShadowGC, line_width, True) Pixmap CreateStretchXPixmap( Display *dpy, Pixmap src, int src_width, int src_height, int src_depth, int dest_width, GC gc); Pixmap CreateStretchYPixmap( Display *dpy, Pixmap src, int src_width, int src_height, int src_depth, int dest_height, GC gc); Pixmap CreateStretchPixmap( Display *dpy, Pixmap src, int src_width, int src_height, int src_depth, int dest_width, int dest_height, GC gc); Pixmap CreateTiledPixmap( Display *dpy, Pixmap src, int src_width, int src_height, int dest_width, int dest_height, int depth, GC gc); Pixmap CreateRotatedPixmap( Display *dpy, Pixmap src, int src_width, int src_height, int depth, GC gc, int rotation); GC fvwmlib_XCreateGC( Display *display, Drawable drawable, unsigned long valuemask, XGCValues *values); /**** gradient stuff ****/ /* gradient types */ #define H_GRADIENT 'H' #define V_GRADIENT 'V' #define D_GRADIENT 'D' #define B_GRADIENT 'B' #define S_GRADIENT 'S' #define C_GRADIENT 'C' #define R_GRADIENT 'R' #define Y_GRADIENT 'Y' Bool IsGradientTypeSupported(char type); /* Convenience function. Calls AllocNonLinearGradient to fetch all colors and * then frees the color names and the perc and color_name arrays. */ XColor *AllocAllGradientColors( char *color_names[], int perc[], int nsegs, int ncolors, int dither); int ParseGradient(char *gradient, char **rest, char ***colors_return, int **perc_return, int *nsegs_return); Bool CalculateGradientDimensions(Display *dpy, Drawable d, int ncolors, char type, int dither, int *width_ret, int *height_ret); Drawable CreateGradientPixmap( Display *dpy, Drawable d, GC gc, int type, int g_width, int g_height, int ncolors, XColor *xcs, int dither, Pixel **d_pixels, int *d_npixels, Drawable in_drawable, int d_x, int d_y, int d_width, int d_height, XRectangle *rclip); Pixmap CreateGradientPixmapFromString( Display *dpy, Drawable d, GC gc, int type, char *action, int *width_return, int *height_return, Pixel **alloc_pixels, int *nalloc_pixels, int dither); void DrawTrianglePattern( Display *dpy, Drawable d, GC ReliefGC, GC ShadowGC, GC FillGC, int x, int y, int width, int height, int bw, char orientation, Bool draw_relief, Bool do_fill, Bool is_pressed); #endif /* LIB_GRAPHICS_H */ fvwm-2.6.5.orig/libs/FBidi.h0000644000175000017500000000534707702601766013725 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Mikhael Goikhman */ /* * FBidi.h - interface to Bidi (bidirectionality for some asian languages). */ /*** * The main function is * char *FBidiConvert( * const char *logical_str, const char *charset, int str_len, Bool *is_rtl, * int *out_len); * * input: * logical string - the original string * string charset - examples: "iso8859-15", "iso8859-8", "iso8859-6", "utf-8" * * output: * visual string is returned (should be free'd), or NULL if not applicable * the last argument is set to True if the string has the base RTL direction * * The is_rtl aggument may be used for 2 purposes. The first is to change the * string alignment if there is a free space (but it probably worth not to * override the user specified string aligment). The second is to determine * where to put ellipses if the string is longer than the available space. * * There are several possible ways to solve the ellipses problem. * This is not automated, the caller should choose one or another way. * * 1) For a logical string evaluate a visual string (and a base direction) * only once. If needed, cut the visual string and add ellipses at the * correct string side. * * 2) Cut logical string to the size that will be drawn, add allipses to the * end and call FBidiConvert on the resulting string. * * 3) Cut logical string to the size that will be drawn, call FBidiConvert * and add ellipses at the correct string side. * * Probably 2) is the best, but there is one nuance, the ellipses may be at * the middle of the string. With 1) and 3) the ellipses are always on the * edge of the string. The 1) is good when speed is more important than memory * and the string is usually either pure LTR or RTL. * * Example 1: * * input: she said "SHALOM" and then "BOKER TOV". * output: she said "MOLAHS" and then "VOT REKOB". * is_rtl: False * * 1) she said "MO... * 2) she said ...HS" * 3) she said HS"... * * Example 2: * * input: SHALOM, world! * output: !world ,MOLAHS * is_rtl: True * * 1) ...ld ,MOLAHS * 2) wo... ,MOLAHS * 3) ...wo ,MOLAHS * **/ #ifndef FBIDI_H #define FBIDI_H #include "config.h" #include #include "CombineChars.h" #if HAVE_BIDI /* * Checks whether the string in the given charset should be BidiConvert'd. */ Bool FBidiIsApplicable(const char *charset); /* * Converts the given logical string to visual string for the given charset. */ char *FBidiConvert( const char *logical_str, const char *charset, int str_len, Bool *is_rtl, int *out_len, superimpose_char_t *comb_chars, int *pos_l_to_v); #else /* !HAVE_BIDI */ #define FBidiIsApplicable(c) False #define FBidiConvert(s, c, l, r, o, cc, lv) NULL #endif /* HAVE_BIDI */ #endif /* FBIDI_H */ fvwm-2.6.5.orig/libs/modifiers.c0000644000175000017500000000537307701425753014722 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/charmap.h" #include "libs/modifiers.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* The keys must be in lower case! */ charmap_t key_modifiers[] = { {'s', ShiftMask}, {'c', ControlMask}, {'l', LockMask}, {'m', Mod1Mask}, {'1', Mod1Mask}, {'2', Mod2Mask}, {'3', Mod3Mask}, {'4', Mod4Mask}, {'5', Mod5Mask}, {'a', AnyModifier}, {'n', 0}, {0, 0} }; /* Table to translate a modifier map index to a modifier that we define that * generates that index. This mapping can be chosen by each client, but the * settings below try to emulate the usual terminal behaviour. */ unsigned int modifier_mapindex_to_mask[8] = { ShiftMask, Mod3Mask, /* Alt Gr */ Mod3Mask | ShiftMask, /* Just guessing below here - LockMask is not used anywhere*/ ControlMask, Mod1Mask, /* Alt/Meta on XFree86 */ Mod2Mask, /* Num lock on XFree86 */ Mod4Mask, Mod5Mask, /* Scroll lock on XFree86 */ }; /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ /* Converts the input string into a mask with bits for the modifiers */ int modifiers_string_to_modmask(char *in_modifiers, int *out_modifier_mask) { int error; error = charmap_string_to_mask( out_modifier_mask, in_modifiers, key_modifiers, "bad modifier"); return error; } fvwm-2.6.5.orig/libs/vpacket.h0000644000175000017500000000452310557141770014374 0ustar vwcvwc/* -*-c-*- */ #ifndef _VPACKET_ #define _VPACKET_ #include "fvwm/window_flags.h" /* All new-style module packets (i.e., those that are not simply arrays of longs, as used by the older modules) should have a structure definition in this file. */ /* The M_CONFIGURE_WINDOW packet. This is the same packet as the M_ADD_WINDOW packet, the only difference being the type. */ /* RBW- typedef struct config_win_packet */ typedef struct ConfigWinPacket { /*** Alignment notes ***/ /*** Note that this packet format will break on future 128 bit *** platforms. ***/ /*** Put long, Window, and pointers here ***/ unsigned long w; /* Window */ unsigned long frame; /* Window */ unsigned long *fvwmwin; signed long frame_x; signed long frame_y; unsigned long frame_width; unsigned long frame_height; unsigned long desk; /* Temp word for alignment - old flags used to be here. - remove before next release. RBW - 05/01/2000 - layer has usurped this slot. unsigned long dummy; */ unsigned long layer; unsigned long hints_base_width; unsigned long hints_base_height; unsigned long hints_width_inc; unsigned long hints_height_inc; unsigned long orig_hints_width_inc; unsigned long orig_hints_height_inc; unsigned long hints_min_width; unsigned long hints_min_height; unsigned long hints_max_width; unsigned long hints_max_height; unsigned long icon_w; /* Window */ unsigned long icon_pixmap_w; /* Window */ unsigned long hints_win_gravity; unsigned long TextPixel; unsigned long BackPixel; /* Everything below this is post-GSFR */ unsigned long ewmh_hint_layer; unsigned long ewmh_hint_desktop; unsigned long ewmh_window_type; /*** Put int here, fill with dummies to a multiple of 2 ***/ /*** Put short here, fill with dummies to a multiple of 4 ***/ unsigned short title_height; unsigned short border_width; unsigned short short_dummy_3; unsigned short short_dummy_4; /*** Put structures here ***/ window_flags flags; action_flags allowed_actions; } ConfigWinPacket; typedef struct MiniIconPacket { Window w; Window frame; FvwmWindow *fvwmwin; unsigned long width; unsigned long height; unsigned long depth; Pixmap picture; Pixmap mask; Pixmap alpha; char name[1]; } MiniIconPacket; #endif /* _VPACKET_ */ fvwm-2.6.5.orig/libs/FRender.c0000644000175000017500000003407210556634174014265 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include "PictureBase.h" #include "Graphics.h" #include "PictureGraphics.h" #include "FRenderInit.h" #include "FRender.h" #include "FRenderInterface.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static FRenderPictFormat *PFrenderVisualFormat = NULL; static FRenderPictFormat *PFrenderAlphaFormat = NULL; static FRenderPictFormat *PFrenderMaskFormat = NULL; static FRenderPictFormat *PFrenderDirectFormat = NULL; static FRenderPictFormat *PFrenderAbsoluteFormat = NULL; Bool FRenderVisualInitialized = False; /* #define USE_ABSOLUTE_FORMAT 1*/ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static void FRenderVisualInit(Display *dpy) { FRenderPictFormat pf; if (!XRenderSupport || !FRenderGetExtensionSupported()) { return; } PFrenderVisualFormat = FRenderFindVisualFormat (dpy, Pvisual); if (!PFrenderVisualFormat) { fprintf(stderr,"[fvwmlibs][FRenderInit] -- ERROR: " "fail to create XRender Visual Format\n"); return; } pf.depth = 8; pf.type = FRenderPictTypeDirect; pf.direct.alpha = 0; pf.direct.alphaMask = 0xff; PFrenderAlphaFormat = FRenderFindFormat( dpy, FRenderPictFormatType| FRenderPictFormatDepth| FRenderPictFormatAlpha| FRenderPictFormatAlphaMask, &pf, 0); if (!PFrenderAlphaFormat) { fprintf(stderr,"[fvwmlibs][FRenderInit] -- ERROR: " "fail to create XRender Alpha Format\n"); return; } pf.depth = 1; pf.type = FRenderPictTypeDirect; pf.direct.alpha = 0; pf.direct.alphaMask = 1; PFrenderMaskFormat = FRenderFindFormat( dpy, FRenderPictFormatType| FRenderPictFormatDepth| FRenderPictFormatAlpha| FRenderPictFormatAlphaMask, &pf, 0); if (!PFrenderMaskFormat) { fprintf(stderr,"[fvwmlibs][FRenderInit] -- ERROR: " "fail to create XRender Mask Format\n"); return; } pf.depth = 24; pf.type = FRenderPictTypeDirect; pf.direct.alpha = 0; pf.direct.alphaMask = 0; pf.direct.red = 16; pf.direct.redMask = 0xff; pf.direct.green = 8; pf.direct.greenMask = 0xff; pf.direct.blue = 0; pf.direct.blueMask = 0xff; PFrenderDirectFormat = FRenderFindFormat( dpy, FRenderPictFormatType| FRenderPictFormatDepth| FRenderPictFormatRed| FRenderPictFormatRedMask| FRenderPictFormatGreen| FRenderPictFormatGreenMask| FRenderPictFormatBlue| FRenderPictFormatBlueMask| FRenderPictFormatAlpha| FRenderPictFormatAlphaMask, &pf, 0); if (!PFrenderDirectFormat) { fprintf(stderr,"[fvwmlibs][FRenderInit] -- ERROR: " "fail to create XRender Direct Format\n"); return; } pf.depth = 32; pf.type = FRenderPictTypeDirect; pf.direct.alpha = 24; pf.direct.alphaMask = 0xff; pf.direct.red = 16; pf.direct.redMask = 0xff; pf.direct.green = 8; pf.direct.greenMask = 0xff; pf.direct.blue = 0; pf.direct.blueMask = 0xff; PFrenderAbsoluteFormat = FRenderFindFormat( dpy, FRenderPictFormatType| FRenderPictFormatDepth| FRenderPictFormatRed| FRenderPictFormatRedMask| FRenderPictFormatGreen| FRenderPictFormatGreenMask| FRenderPictFormatBlue| FRenderPictFormatBlueMask| FRenderPictFormatAlpha| FRenderPictFormatAlphaMask, &pf, 0); if (!PFrenderAbsoluteFormat) { fprintf(stderr,"[fvwmlibs][FRenderInit] -- ERROR: " "fail to create XRender Absolute Format\n"); return; } } static Bool FRenderCompositeAndCheck( Display *dpy, int op, FRenderPicture src, FRenderPicture alpha, FRenderPicture dest, int x, int y, int a_x, int a_y, int d_x, int d_y, int d_w, int d_h) { FRenderComposite( dpy, op, src, alpha, dest, x, y, a_x, a_y, d_x, d_y, d_w, d_h); return True; } static Bool FRenderCreateShadePicture( Display *dpy, Window win, int alpha_percent) { static Pixmap shade_pixmap = None; static FRenderPicture shade_picture = None; static int saved_alpha_percent = 0; Bool force_update = False; FRenderColor frc; if (!XRenderSupport || !FRenderGetExtensionSupported()) { return 0; } /* FRender Visuals should be already initialized */ if (!shade_pixmap || !shade_picture) { FRenderPictureAttributes pa; if (!shade_pixmap) { shade_pixmap = XCreatePixmap(dpy, win, 1, 1, 8); } pa.repeat = True; if (shade_pixmap) { shade_picture = FRenderCreatePicture( dpy, shade_pixmap, PFrenderAlphaFormat, FRenderCPRepeat, &pa); } force_update = True; } if (shade_picture && (alpha_percent != saved_alpha_percent || force_update)) { frc.red = frc.green = frc.blue = 0; frc.alpha = 0xffff * (alpha_percent)/100; FRenderFillRectangle( dpy, FRenderPictOpSrc, shade_picture, &frc, 0, 0, 1, 1); saved_alpha_percent = alpha_percent; } return shade_picture; } static Bool FRenderTintPicture( Display *dpy, Window win, Pixel tint, int tint_percent, FRenderPicture dest_picture, int dest_x, int dest_y, int dest_w, int dest_h) { static Pixel saved_tint = 0; static int saved_tint_percent = 0; static Pixmap tint_pixmap = None; static FRenderPicture tint_picture = None; FRenderPicture shade_picture = None; FRenderColor frc_tint; Bool force_update = False; FRenderPictureAttributes pa; int rv = 0; if (!XRenderSupport) { return 0; } if (!tint_pixmap || !tint_picture) { pa.repeat = True; if (!tint_pixmap) { tint_pixmap = XCreatePixmap(dpy, win, 1, 1, 32); } if (tint_pixmap) { tint_picture = FRenderCreatePicture( dpy, tint_pixmap, PFrenderAbsoluteFormat, FRenderCPRepeat, &pa); if (!tint_picture) { goto bail; } } else { goto bail; } force_update = True; } if (tint_picture && (tint != saved_tint || tint_percent != saved_tint_percent || force_update)) { XColor color; float alpha_factor = (float)tint_percent/100; force_update = False; color.pixel = tint; XQueryColor(dpy, Pcmap, &color); frc_tint.red = color.red * alpha_factor; frc_tint.green = color.green * alpha_factor; frc_tint.blue = color.blue * alpha_factor; frc_tint.alpha = 0xffff * alpha_factor; FRenderFillRectangle( dpy, FRenderPictOpSrc, tint_picture, &frc_tint, 0, 0, 1, 1); saved_tint = tint; saved_tint_percent = tint_percent; } if (!shade_picture) { shade_picture = FRenderCreateShadePicture(dpy, win, 100); } rv = FRenderCompositeAndCheck( dpy, FRenderPictOpOver, tint_picture, shade_picture, dest_picture, 0, 0, 0, 0, dest_x, dest_y, dest_w, dest_h); bail: return rv; } /* ---------------------------- interface functions ------------------------ */ Bool FRenderTintRectangle( Display *dpy, Window win, Pixmap mask, Pixel tint, int tint_percent, Drawable d, int dest_x, int dest_y, int dest_w, int dest_h) { FRenderPicture dest_picture = None; FRenderPictureAttributes pa; unsigned int val = 0; Bool rv = True; if (!XRenderSupport || !FRenderGetExtensionSupported()) { return 0; } if (!FRenderVisualInitialized) { FRenderVisualInitialized = True; FRenderVisualInit(dpy); } if (!PFrenderVisualFormat || !PFrenderAlphaFormat || !PFrenderAbsoluteFormat || !PFrenderMaskFormat) { return 0; } pa.clip_mask = mask; val = FRenderCPClipMask; if (!(dest_picture = FRenderCreatePicture( dpy, d, PFrenderVisualFormat, val, &pa))) { return 0; } rv = FRenderTintPicture( dpy, win, tint_percent, tint, dest_picture, dest_x, dest_y, dest_w, dest_h); FRenderFreePicture(dpy, dest_picture); return rv; } int FRenderRender( Display *dpy, Window win, Pixmap pixmap, Pixmap mask, Pixmap alpha, int depth, int added_alpha_percent, Pixel tint, int tint_percent, Drawable d, GC gc, GC alpha_gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h, Bool do_repeat) { FRenderColor frc; Pixmap pixmap_copy = None; Pixmap alpha_copy = None; FRenderPicture shade_picture = None; FRenderPicture alpha_picture = None; FRenderPicture mask_picture = None; FRenderPicture src_picture = None; FRenderPicture dest_picture = None; FRenderPicture root_picture = None; FRenderPictureAttributes pa; unsigned long pam = 0; int alpha_x = src_x; int alpha_y = src_y; Bool rv = False; Bool free_alpha_gc = False; if (!XRenderSupport || !FRenderGetExtensionSupported()) { return 0; } if (!FRenderVisualInitialized) { FRenderVisualInitialized = True; FRenderVisualInit(dpy); } if (!PFrenderVisualFormat || !PFrenderAlphaFormat || !PFrenderAbsoluteFormat || !PFrenderMaskFormat) { return 0; } /* it is a bitmap ? */ if (Pdepth != depth && pixmap) { pixmap_copy = PictureBitmapToPixmap( dpy, win, pixmap, Pdepth, gc, src_x, src_y, src_w, src_h); src_x = src_y = 0; } pam = FRenderCPRepeat; if (do_repeat) { pa.repeat = True; } else { pa.repeat = False; } /* * build the src_picture */ if (pixmap == ParentRelative) { /* need backing store and good preparation of the win */ if (gc == None) { gc = PictureDefaultGC(dpy, win); } pixmap_copy = XCreatePixmap(dpy, win, src_w, src_h, Pdepth); if (pixmap_copy && gc) { XCopyArea( dpy, win, pixmap_copy, gc, src_x, src_y, src_w, src_h, 0, 0); } src_x = src_y = 0; } else if (tint_percent > 0 && !pixmap_copy) { if (gc == None) { gc = PictureDefaultGC(dpy, win); } pixmap_copy = XCreatePixmap(dpy, win, src_w, src_h, Pdepth); if (pixmap_copy && gc) { XCopyArea( dpy, pixmap, pixmap_copy, gc, src_x, src_y, src_w, src_h, 0, 0); } src_x = src_y = 0; } else if (!pixmap_copy) { src_picture = FRenderCreatePicture( dpy, pixmap, PFrenderVisualFormat, pam, &pa); } if (!src_picture && pixmap_copy) { src_picture = FRenderCreatePicture( dpy, pixmap_copy, PFrenderVisualFormat, pam, &pa); } if (!src_picture) { goto bail; } /* tint the src, it is why we have done a pixmap copy */ if (tint_percent > 0) { FRenderTintPicture( dpy, win, tint, tint_percent, src_picture, src_x, src_y, src_w, src_h); } if (added_alpha_percent >= 100) { if (alpha != None) { alpha_picture = FRenderCreatePicture( dpy, alpha, PFrenderAlphaFormat, pam, &pa); } else if (mask != None) { alpha_picture = FRenderCreatePicture( dpy, mask, PFrenderMaskFormat, pam, &pa); } else { /* fix a bug in certain XRender server implementation? */ if (!(shade_picture = FRenderCreateShadePicture( dpy, win, 100))) { goto bail; } alpha_x = alpha_y = 0; } } else { if (alpha != None) { alpha_copy = XCreatePixmap(dpy, win, src_w, src_h, 8); if (!alpha_gc) { alpha_gc = fvwmlib_XCreateGC( dpy, alpha, 0, NULL); free_alpha_gc = True; } if (alpha_copy && alpha_gc) { XCopyArea(dpy, alpha, alpha_copy, alpha_gc, alpha_x, alpha_y, src_w, src_h, 0, 0); alpha_picture = FRenderCreatePicture( dpy, alpha_copy, PFrenderAlphaFormat, pam, &pa); } if (alpha_gc && free_alpha_gc) { XFreeGC(dpy, alpha_gc); } alpha_x = alpha_y = 0; } else if (mask != None) { alpha_copy = XCreatePixmap(dpy, win, src_w, src_h, 8); if (alpha_copy) { alpha_picture = FRenderCreatePicture( dpy, alpha_copy, PFrenderAlphaFormat, pam, &pa); } if (alpha_picture) { frc.red = frc.green = frc.blue = frc.alpha = 0; FRenderFillRectangle( dpy, FRenderPictOpSrc, alpha_picture, &frc, 0, 0, src_w, src_h); } mask_picture = FRenderCreatePicture( dpy, mask, PFrenderMaskFormat, pam, &pa); } else { alpha_x = alpha_y = 0; } if (!(shade_picture = FRenderCreateShadePicture( dpy, win, added_alpha_percent))) { goto bail; } if (alpha != None && alpha_picture && shade_picture) { if (!FRenderCompositeAndCheck( dpy, FRenderPictOpAtopReverse, shade_picture, alpha_picture, alpha_picture, 0, 0, alpha_x, alpha_y, 0, 0, src_w, src_h)) { goto bail; } alpha_x = alpha_y = 0; } else if (mask != None && alpha_picture && shade_picture) { if (!FRenderCompositeAndCheck( dpy, FRenderPictOpAtopReverse, shade_picture, mask_picture, alpha_picture, 0, 0, alpha_x, alpha_y, 0, 0, src_w, src_h)) { goto bail; } alpha_x = alpha_y = 0; } } if (alpha_picture == None) { alpha_picture = shade_picture; } dest_picture = FRenderCreatePicture( dpy, d, PFrenderVisualFormat, 0, &pa); if (dest_picture) { rv = FRenderCompositeAndCheck( dpy, FRenderPictOpOver, src_picture, alpha_picture, dest_picture, src_x, src_y, alpha_x, alpha_y, dest_x, dest_y, dest_w, dest_h); } bail: if (dest_picture) { FRenderFreePicture(dpy, dest_picture); } if (src_picture) { FRenderFreePicture(dpy, src_picture); } if (alpha_picture && alpha_picture != shade_picture) { FRenderFreePicture(dpy, alpha_picture); } if (mask_picture) { FRenderFreePicture(dpy, mask_picture); } if (root_picture) { FRenderFreePicture(dpy, root_picture); } if (alpha_copy) { XFreePixmap(dpy, alpha_copy); } if (pixmap_copy) { XFreePixmap(dpy, pixmap_copy); } return rv; } fvwm-2.6.5.orig/libs/FScreen.h0000644000175000017500000000563411641302505014256 0ustar vwcvwc/* -*-c-*- */ #ifndef FVWMLIB_FSCRREN_H #define FVWMLIB_FSCRREN_H /* needs X11/Xlib.h and X11/Xutil.h */ typedef enum { FSCREEN_GLOBAL = -1, FSCREEN_CURRENT = -2, FSCREEN_PRIMARY = -3, FSCREEN_XYPOS = -4 } fscreen_scr_t; typedef enum { FSCREEN_SPEC_GLOBAL = 'g', FSCREEN_SPEC_CURRENT = 'c', FSCREEN_SPEC_PRIMARY = 'p', FSCREEN_SPEC_WINDOW = 'w' } fscreen_scr_spec_t; typedef union { XEvent *mouse_ev; struct { int x; int y; } xypos; } fscreen_scr_arg; #define FSCREEN_MANGLE_USPOS_HINTS_MAGIC ((short)-32109) /* Control */ Bool FScreenIsEnabled(void); Bool FScreenIsSLSEnabled(void); void FScreenInit(Display *dpy); void FScreenOnOff(Bool do_enable); Bool FScreenConfigureSLSSize(int width, int height); Bool FScreenConfigureSLSScreens(int nscreens, char *args); void FScreenSLSOnOff(Bool do_enable); /* Intended to be called by modules. Simply pass in the parameter from the * config string sent by fvwm. */ void FScreenConfigureModule(char *args); const char* FScreenGetConfiguration(void); /* For use by fvwm */ void FScreenSetDefaultModuleScreen(char *scr_spec); void FScreenDisableRandR(void); void FScreenSetPrimaryScreen(int scr); /* Screen info */ Bool FScreenGetScrRect( fscreen_scr_arg *arg, fscreen_scr_t screen, int *x, int *y, int *w, int *h); Bool FScreenGetScrId( fscreen_scr_arg *arg, fscreen_scr_t screen); void FScreenTranslateCoordinates( fscreen_scr_arg *arg_src, fscreen_scr_t screen_src, fscreen_scr_arg *arg_dest, fscreen_scr_t screen_dest, int *x, int *y); void FScreenGetResistanceRect( int wx, int wy, unsigned int ww, unsigned int wh, int *x0, int *y0, int *x1, int *y1); Bool FScreenIsRectangleOnScreen( fscreen_scr_arg *arg, fscreen_scr_t screen, rectangle *rec); void FScreenSpecToString(char *dest, int space, fscreen_scr_t screen); int FScreenOfPointerXY(int x, int y); /* Clipping/positioning */ int FScreenClipToScreen( fscreen_scr_arg *arg, fscreen_scr_t screen, int *x, int *y, int w, int h); void FScreenCenterOnScreen( fscreen_scr_arg *arg, fscreen_scr_t screen, int *x, int *y, int w, int h); /* Geometry management */ int FScreenGetScreenArgument(char *scr_spec, fscreen_scr_spec_t default_screen); int FScreenParseGeometryWithScreen( char *parsestring, int *x_return, int *y_return, unsigned int *width_return, unsigned int *height_return, int *screen_return); int FScreenParseGeometry( char *parsestring, int *x_return, int *y_return, unsigned int *width_return, unsigned int *height_return); int FScreenGetGeometry( char *parsestring, int *x_return, int *y_return, int *width_return, int *height_return, XSizeHints *hints, int flags); void FScreenMangleScreenIntoUSPosHints(fscreen_scr_t screen, XSizeHints *hints); fscreen_scr_t FScreenFetchMangledScreenFromUSPosHints(XSizeHints *hints); /* RandR support */ int FScreenGetRandrEventType(void); Bool FScreenHandleRandrEvent( XEvent *event, int *old_w, int *old_h, int *new_w, int *new_h); #endif /* FVWMLIB_FSCRREN_H */ fvwm-2.6.5.orig/libs/fsm.h0000644000175000017500000000162607714416443013530 0ustar vwcvwc/* -*-c-*- */ #ifndef FSM_H #define FSM_H /* ---------------------------- included header files ---------------------- */ #include "FSMlib.h" /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef struct { FSmsConn smsConn; FIceConn ice_conn; char *clientId; } fsm_client_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ int fsm_init(char *module); void fsm_fdset(fd_set *in_fdset); Bool fsm_process(fd_set *in_fdset); void fsm_proxy(Display *dpy, Window win, char *sm); void fsm_close(void); #endif /* FSM_H */ fvwm-2.6.5.orig/libs/Picture.h0000644000175000017500000000533510633045756014356 0ustar vwcvwc/* -*-c-*- */ #ifndef Picture_H #define Picture_H #include "PictureBase.h" #include "PictureImageLoader.h" /** Manipulating FvwmPictures **/ /** * For PGetFvwmPicture() and PCacheFvwmPicture(), setting * ImagePath to NULL means "search the default image path". **/ /* PGetFvwmPicture * * Return an FvwmPicture loaded from the file pictureName found in the * ImagePath.. If ImagePath is NULL the default image path is used. * */ FvwmPicture* PGetFvwmPicture( Display* dpy, Window win, char* ImagePath, const char* pictureName, FvwmPictureAttributes fpa); /* PFreeFvwmPictureData * * Just free the data allocated by PGetFvwmPicture. This function does not * Free the pixmaps for example. * */ void PFreeFvwmPictureData(FvwmPicture *p); /* PCacheFvwmPicture * * Return the FvwmPicture loaded from the file pictureName found in the * ImagePath. Fisrt the picture is searched in the FvwmPicture cache (so * if this picture has been already loaded it is not loaded again and a * weight is added to the found picture). If the picture is not in the cache * it is loaded from the file and added to the FvwmPicture cache. * If ImagePath is NULL the default image path is used. * */ FvwmPicture* PCacheFvwmPicture( Display *dpy, Window win, char* ImagePath, const char* pictureName, FvwmPictureAttributes fpa); /* PLoadFvwmPictureFromPixmap * * Return a FvwmPicture from the given data. * */ FvwmPicture *PLoadFvwmPictureFromPixmap( Display *dpy, Window win, char *name, Pixmap pixmap, Pixmap mask, Pixmap alpha, int width, int height, int nalloc_pixels, Pixel *alloc_pixels, int no_limit); /* PDestroyFvwmPicture * * Return a FvwmPicture from the given data. The picture is added to the * FvwmPicture cache. This is not really useful as it is not possible * to really cache a picture from the given data. * */ FvwmPicture *PCacheFvwmPictureFromPixmap( Display *dpy, Window win, char *name, Pixmap pixmap, Pixmap mask, Pixmap alpha, int width, int height, int nalloc_pixels, Pixel *alloc_pixels, int no_limit); /* PDestroyFvwmPicture * * Remove a weight to the FvwmPicture p from the FvwmPicture cache. * If the weight is zero the allocated datas from p are freed * */ void PDestroyFvwmPicture(Display *dpy, FvwmPicture *p); /* PCloneFvwmPicture * * Duplicate an already allocated FvwmPicture in the FvwmPicture cache * (a weight is added to the picture). * */ FvwmPicture *PCloneFvwmPicture(FvwmPicture *pic); void PicturePrintImageCache(int verbose); #endif fvwm-2.6.5.orig/libs/FImage.c0000644000175000017500000001315610556634174014070 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "libs/fvwmlib.h" #include "libs/PictureBase.h" #include "libs/FImage.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ int FShmMajorOpCode = -10000; int FShmEventBase = -10000; int FShmErrorBase = -10000; Bool FShmInitialized = False; Bool FShmImagesSupported = False; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static int FShmErrorHandler(Display *dpy, XErrorEvent *ev) { FShmImagesSupported = False; return 0; } static void FShmInit(Display *dpy) { if (FShmInitialized) { return; } FShmInitialized = True; if (!XShmSupport) { return; } FShmImagesSupported = XQueryExtension( dpy, "MIT-SHM", &FShmMajorOpCode, &FShmEventBase, &FShmErrorBase); } static void FShmSafeCreateImage( Display *dpy, FImage *fim, Visual *visual, unsigned int depth, int format, unsigned int width, unsigned int height) { Bool error = False; XErrorHandler save_handler; if (!XShmSupport) { return; } fim->shminfo = (FShmSegmentInfo *)safecalloc( 1, sizeof(FShmSegmentInfo)); if (!(fim->im = FShmCreateImage( dpy, visual, depth, format, NULL, fim->shminfo, width, height))) { error = True; goto bail; } fim->shminfo->shmid = Fshmget( IPC_PRIVATE, fim->im->bytes_per_line * fim->im->height, IPC_CREAT|0777); if (fim->shminfo->shmid <= 0) { error = True; goto bail; } fim->shminfo->shmaddr = fim->im->data = Fshmat( fim->shminfo->shmid, 0, 0); if (fim->shminfo->shmaddr == (char *)(-1)) { error = True; goto bail; } fim->shminfo->readOnly = False; /* use the error handler for a definitive error */ save_handler = XSetErrorHandler(FShmErrorHandler); if (!FShmAttach(dpy, fim->shminfo)) { error = True; } else { XSync(dpy, False); } if (!error && !FShmImagesSupported) { /* get an X error: we are a remote client */ if (FShmDetach(dpy, fim->shminfo)) { XSync(dpy, False); } error = True; } XSetErrorHandler(save_handler); bail: if (error) { if (fim->im) { XDestroyImage (fim->im); fim->im = NULL; } if (fim->shminfo->shmaddr) { Fshmdt(fim->shminfo->shmaddr); } if (fim->shminfo->shmid > 0) { Fshmctl(fim->shminfo->shmid, IPC_RMID, 0); } free(fim->shminfo); fim->shminfo = NULL; } } /* ---------------------------- interface functions ------------------------ */ FImage *FCreateFImage ( Display *dpy, Visual *visual, unsigned int depth, int format, unsigned int width, unsigned int height) { FImage *fim; FShmInit(dpy); fim = (FImage *)safemalloc(sizeof(FImage)); fim->im = NULL; fim->shminfo = NULL; if (XShmSupport && FShmImagesSupported) { FShmSafeCreateImage( dpy, fim, visual, depth, format, width, height); } if(!fim->im ) { if ((fim->im = XCreateImage( dpy, visual, depth, ZPixmap, 0, 0, width, height, Pdepth > 16 ? 32 : (Pdepth > 8 ? 16 : 8), 0))) { fim->im->data = safemalloc( fim->im->bytes_per_line * height); } else { free(fim); } } return fim; } FImage *FGetFImage( Display *dpy, Drawable d, Visual *visual, unsigned int depth, int x, int y, unsigned int width, unsigned int height, unsigned long plane_mask, int format) { FImage *fim; FShmInit(dpy); fim = (FImage *)safemalloc(sizeof(FImage)); fim->im = NULL; fim->shminfo = NULL; if (XShmSupport && FShmImagesSupported) { FShmSafeCreateImage( dpy, fim, visual, depth, format, width, height); if (fim->im) { FShmGetImage( dpy, d, fim->im, x, y, plane_mask); } } if (!fim->im) { fim->im = XGetImage( dpy, d, x, y, width, height, plane_mask, format); } return fim; } void FPutFImage( Display *dpy, Drawable d, GC gc, FImage *fim, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height) { if (fim->shminfo) { if (FShmPutImage( dpy, d, gc, fim->im, src_x, src_y, dest_x, dest_y, width, height, False)) { } } else { XPutImage( dpy, d, gc, fim->im, src_x, src_y, dest_x, dest_y, width, height); } } void FDestroyFImage(Display *dpy, FImage *fim) { if (fim->shminfo) { if (FShmDetach(dpy, fim->shminfo)) { } } XDestroyImage (fim->im); if (fim->shminfo) { Fshmdt(fim->shminfo->shmaddr); Fshmctl(fim->shminfo->shmid, IPC_RMID, 0); free(fim->shminfo); } free(fim); } fvwm-2.6.5.orig/libs/FImage.h0000644000175000017500000000165107677641664014106 0ustar vwcvwc/* -*-c-*- */ #ifndef FIMAGE_H #define FIMAGE_H /* ---------------------------- included header files ---------------------- */ #include "config.h" #include "FShm.h" /* ---------------------------- type definitions --------------------------- */ typedef struct { XImage *im; FShmSegmentInfo *shminfo; } FImage; /* ---------------------------- interface functions ------------------------ */ FImage *FCreateFImage ( Display *dpy, Visual *visual, unsigned int depth, int format, unsigned int width, unsigned int height); FImage *FGetFImage( Display *dpy, Drawable d, Visual *visual, unsigned int depth, int x, int y, unsigned int width, unsigned int height, unsigned long plane_mask, int format); void FPutFImage( Display *dpy, Drawable d, GC gc, FImage *fim, int src_x, int src_y, int dest_x, int dest_y, unsigned int width, unsigned int height); void FDestroyFImage(Display *dpy, FImage *fim); #endif /* FIMAGE_H */ fvwm-2.6.5.orig/libs/usleep.c0000644000175000017500000000205110342154700014206 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include "ftime.h" #ifdef HAVE_SYS_SELECT #include #endif int usleep (unsigned long usec) { struct timeval timeout; timeout.tv_usec = usec % (unsigned long) 1000000; timeout.tv_sec = usec / (unsigned long) 1000000; select(0, NULL, NULL, NULL, &timeout); return 0; } fvwm-2.6.5.orig/libs/strdup.c0000644000175000017500000000167710556634174014266 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" char *strdup(const char *s) { char *d; size_t l; if (s == NULL) { return NULL; } l = strlen (s) + 1; if ((d = (char *)malloc (l)) == NULL) { return NULL; } memcpy (d, s, l); return d; } fvwm-2.6.5.orig/libs/fvwmrect.c0000644000175000017500000000762010552155662014570 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2001 Dominik Vogt */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ** fvwmrect.c: ** This file supplies routines for fvwm internal rectangle handling. */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "fvwmrect.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- local functions ---------------------------- */ static int fvwmrect_do_intervals_intersect( int x1, int width1, int x2, int width2) { return !(x1 + width1 <= x2 || x2 + width2 <= x1); } /* ---------------------------- interface functions ------------------------ */ /* Returns 1 if the given rectangles intersect and 0 otherwise */ int fvwmrect_do_rectangles_intersect(rectangle *r, rectangle *s) { if (r->x + r->width <= s->x) { return 0; } if (s->x + s->width <= r->x) { return 0; } if (r->y + r->height <= s->y) { return 0; } if (s->y + s->height <= r->y) { return 0; } return 1; } /* Subtracts the values in s2_ from the ones in s1_g and stores the result in * diff_g. */ void fvwmrect_subtract_rectangles( rectangle *rdiff, rectangle *r1, rectangle *r2) { rdiff->x = r1->x - r2->x; rdiff->y = r1->y - r2->y; rdiff->width = r1->width - r2->width; rdiff->height = r1->height - r2->height; return; } /* Returns 1 is the rectangles are identical and 0 if not */ int fvwmrect_rectangles_equal( rectangle *r1, rectangle *r2) { if (r1 == r2) { return 1; } if (r1 == NULL || r2 == NULL) { return 0; } if (r1->x != r2->x || r1->y != r2->y || r1->width != r2->width || r1->height != r2->height) { return 1; } return 0; } int fvwmrect_move_into_rectangle(rectangle *move_rec, rectangle *target_rec) { int has_changed = 0; if (!fvwmrect_do_intervals_intersect( move_rec->x, move_rec->width, target_rec->x, target_rec->width)) { move_rec->x = move_rec->x % (int)target_rec->width; if (move_rec->x < 0) { move_rec->x += target_rec->width; } move_rec->x += target_rec->x; has_changed = 1; } if (!fvwmrect_do_intervals_intersect( move_rec->y, move_rec->height, target_rec->y, target_rec->height)) { move_rec->y = move_rec->y % (int)target_rec->height; if (move_rec->y < 0) { move_rec->y += target_rec->height; } move_rec->y += target_rec->y; has_changed = 1; } return has_changed; } int fvwmrect_intersect_xrectangles( XRectangle *r1, XRectangle *r2) { int x1 = max(r1->x, r2->x); int y1 = max(r1->y, r2->y); int x2 = min(r1->x + r1->width, r2->x + r2->width); int y2 = min(r1->y + r1->height, r2->y + r2->height); r1->x = x1; r1->y = y1; r1->width = x2 - x1; r1->height = y2 - y1; if (x2 > x1 && y2 > y1) { return 1; } else { return 0; } } fvwm-2.6.5.orig/libs/Graphics.c0000644000175000017500000010075611622413321014463 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Graphics.c: misc convenience functions for drawing stuff */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include "defaults.h" #include "libs/fvwmlib.h" #include "libs/Parse.h" #include "libs/PictureBase.h" #include "libs/PictureUtils.h" #include "libs/PictureGraphics.h" #include "libs/gravity.h" #include "libs/FImage.h" #include "libs/Graphics.h" /* ---------------------------- local definitions -------------------------- */ /* Define some standard constants that are not included in the C89 standard */ #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #ifndef M_PI_2 #define M_PI_2 1.57079632679489661923 #endif #ifndef M_1_PI #define M_1_PI 0.31830988618379067154 #endif /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ /* Draws the relief pattern around a window * Draws a line_width wide rectangle from (x,y) to (x+w,y+h) i.e w+1 wide, * h+1 high * Draws end points assuming CAP_NOT_LAST style in GC * Draws anti-clockwise in case CAP_BUTT is the style and the end points overlap * Top and bottom lines come out full length, the sides come out 1 pixel less * This is so FvwmBorder windows have a correct bottom edge and the sticky lines * look like just lines * rotation rotate the relief and shadow part */ void do_relieve_rectangle_with_rotation( Display *dpy, Drawable d, int x, int y, int w, int h, GC ReliefGC, GC ShadowGC, int line_width, Bool use_alternate_shading, int rotation) { XSegment* seg; GC shadow_gc, relief_gc; int i,i2; int a; int l; int max_w; int max_h; a = (use_alternate_shading) ? 1 : 0; l = 1 - a; if (w <= 0 || h <= 0) { return; } /* If line_width is negative, reverse the rotation, which will */ /* have the effect of inverting the relief. */ if (line_width < 0) { line_width = -line_width; rotation = gravity_add_rotations(rotation, ROTATION_180); } switch (rotation) { case ROTATION_180: case ROTATION_270: rotation = gravity_add_rotations(rotation, ROTATION_180); shadow_gc = ReliefGC; relief_gc = ShadowGC; break; default: shadow_gc = ShadowGC; relief_gc = ReliefGC; break; } max_w = min((w + 1) / 2, line_width); max_h = min((h + 1) / 2, line_width); seg = (XSegment*)alloca((sizeof(XSegment) * line_width) * 2); /* from 0 to the lesser of line_width & just over half w */ for (i = 0; i < max_w; i++) { if (rotation == ROTATION_0) { /* left */ seg[i].x1 = x+i; seg[i].y1 = y+i+a; seg[i].x2 = x+i; seg[i].y2 = y+h-i+a; } else /* ROTATION_90 */ { /* right */ seg[i].x1 = x+w-i; seg[i].y1 = y+h-i-a; seg[i].x2 = x+w-i; seg[i].y2 = y+i+1-a; } } i2 = i; /* draw top segments */ for (i = 0; i < max_h; i++,i2++) { seg[i2].x1 = x+w-i-a; seg[i2].y1 = y+i; seg[i2].x2 = x+i+1-a; seg[i2].y2 = y+i; } XDrawSegments(dpy, d, relief_gc, seg, i2); /* bottom */ for (i = 0; i < max_h; i++) { seg[i].x1 = x+i+a+l; seg[i].y1 = y+h-i; seg[i].x2 = x+w-i-1+a; seg[i].y2 = y+h-i; } i2 = i; for (i = 0; i < max_w; i++,i2++) { if (rotation == ROTATION_0) { /* right */ seg[i2].x1 = x+w-i; seg[i2].y1 = y+h-i-a; seg[i2].x2 = x+w-i; seg[i2].y2 = y+i+1-a; } else /* ROTATION_90 */ { /* left */ seg[i2].x1 = x+i; seg[i2].y1 = y+i+a; seg[i2].x2 = x+i; seg[i2].y2 = y+h-i+a; } } XDrawSegments(dpy, d, shadow_gc, seg, i2); return; } void do_relieve_rectangle( Display *dpy, Drawable d, int x, int y, int w, int h, GC ReliefGC, GC ShadowGC, int line_width, Bool use_alternate_shading) { do_relieve_rectangle_with_rotation( dpy, d, x, y, w, h, ReliefGC, ShadowGC, line_width, use_alternate_shading, ROTATION_0); return; } /* Creates a pixmap that is a horizontally stretched version of the input * pixmap */ Pixmap CreateStretchXPixmap( Display *dpy, Pixmap src, int src_width, int src_height, int src_depth, int dest_width, GC gc) { int i; Pixmap pixmap; GC my_gc = None; if (src_width < 0 || src_height < 0 || dest_width < 0) { return None; } pixmap = XCreatePixmap(dpy, src, dest_width, src_height, src_depth); if (pixmap == None) { return None; } if (gc == None) { my_gc = fvwmlib_XCreateGC(dpy, pixmap, 0, 0); } for (i = 0; i < dest_width; i++) { XCopyArea( dpy, src, pixmap, (gc == None)? my_gc:gc, (i * src_width) / dest_width, 0, 1, src_height, i, 0); } if (my_gc) { XFreeGC(dpy, my_gc); } return pixmap; } /* Creates a pixmap that is a vertically stretched version of the input * pixmap */ Pixmap CreateStretchYPixmap( Display *dpy, Pixmap src, int src_width, int src_height, int src_depth, int dest_height, GC gc) { int i; Pixmap pixmap; GC my_gc = None; if (src_height < 0 || src_depth < 0 || dest_height < 0) { return None; } pixmap = XCreatePixmap(dpy, src, src_width, dest_height, src_depth); if (pixmap == None) { return None; } if (gc == None) { my_gc = fvwmlib_XCreateGC(dpy, pixmap, 0, 0); } for (i = 0; i < dest_height; i++) { XCopyArea( dpy, src, pixmap, (gc == None)? my_gc:gc, 0, (i * src_height) / dest_height, src_width, 1, 0, i); } if (my_gc) { XFreeGC(dpy, my_gc); } return pixmap; } /* Creates a pixmap that is a stretched version of the input * pixmap */ Pixmap CreateStretchPixmap( Display *dpy, Pixmap src, int src_width, int src_height, int src_depth, int dest_width, int dest_height, GC gc) { Pixmap pixmap = None; Pixmap temp_pixmap; GC my_gc = None; if (src_width < 0 || src_height < 0 || src_depth < 0 || dest_width < 0) { return None; } if (gc == None) { my_gc = fvwmlib_XCreateGC(dpy, src, 0, 0); } temp_pixmap = CreateStretchXPixmap( dpy, src, src_width, src_height, src_depth, dest_width, (gc == None)? my_gc:gc); if (temp_pixmap == None) { if (my_gc) { XFreeGC(dpy, my_gc); } return None; } pixmap = CreateStretchYPixmap( dpy, temp_pixmap, dest_width, src_height, src_depth, dest_height, (gc == None)? my_gc:gc); XFreePixmap(dpy, temp_pixmap); if (my_gc) { XFreeGC(dpy, my_gc); } return pixmap; } /* Creates a pixmap that is a tiled version of the input pixmap. Modifies the * sets the fill_style of the GC to FillSolid and the tile to None. */ Pixmap CreateTiledPixmap( Display *dpy, Pixmap src, int src_width, int src_height, int dest_width, int dest_height, int depth, GC gc) { XGCValues xgcv; Pixmap pixmap; if (src_width < 0 || src_height < 0 || dest_width < 0 || dest_height < 0) { return None; } pixmap = XCreatePixmap(dpy, src, dest_width, dest_height, depth); if (pixmap == None) { return None; } xgcv.fill_style = FillTiled; xgcv.tile = src; xgcv.ts_x_origin = 0; xgcv.ts_y_origin = 0; XChangeGC( dpy, gc, GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin, &xgcv); XFillRectangle(dpy, pixmap, gc, 0, 0, dest_width, dest_height); xgcv.fill_style = FillSolid; XChangeGC(dpy, gc, GCFillStyle, &xgcv); return pixmap; } Pixmap CreateRotatedPixmap( Display *dpy, Pixmap src, int src_width, int src_height, int depth, GC gc, int rotation) { GC my_gc = None; Pixmap pixmap = None; int dest_width, dest_height, i, j; Bool error = False; FImage *fim = NULL; FImage *src_fim = NULL; if (src_width <= 0 || src_height <= 0) { return None; } switch(rotation) { case ROTATION_90: case ROTATION_270: dest_width = src_height; dest_height = src_width; break; case ROTATION_0: case ROTATION_180: dest_width = src_width; dest_height = src_height; break; default: return None; break; } pixmap = XCreatePixmap(dpy, src, dest_width, dest_height, depth); if (pixmap == None) { return None; } if (gc == None) { my_gc = fvwmlib_XCreateGC(dpy, src, 0, 0); } if (rotation == ROTATION_0) { XCopyArea( dpy, src, pixmap, (gc == None)? my_gc:gc, 0, 0, src_width, src_height, 0, 0); goto bail; } if (!(src_fim = FGetFImage( dpy, src, Pvisual, depth, 0, 0, src_width, src_height, AllPlanes, ZPixmap))) { error = True; goto bail; } if (!(fim = FCreateFImage( dpy, Pvisual, depth, ZPixmap, dest_width, dest_height))) { error = True; goto bail; } for (j = 0; j < src_height; j++) { for (i = 0; i < src_width; i++) { switch(rotation) { case ROTATION_270: XPutPixel( fim->im, j, src_width - i - 1, XGetPixel(src_fim->im, i, j)); break; case ROTATION_90: XPutPixel( fim->im, src_height - j - 1, i, XGetPixel(src_fim->im, i, j)); break; case ROTATION_180: XPutPixel( fim->im, src_width - i - 1, src_height - j - 1, XGetPixel(src_fim->im, i, j)); break; default: break; } } } FPutFImage(dpy, pixmap, gc, fim, 0, 0, 0, 0, dest_width, dest_height); bail: if (error && pixmap) { XFreePixmap(dpy,pixmap); pixmap = None; } if (fim) { FDestroyFImage(dpy, fim); } if (src_fim) { FDestroyFImage(dpy, src_fim); } if (my_gc) { XFreeGC(dpy, my_gc); } return pixmap; } /* * * Returns True if the given type of gradient is supported. * */ Bool IsGradientTypeSupported(char type) { switch (toupper(type)) { case V_GRADIENT: case H_GRADIENT: case B_GRADIENT: case D_GRADIENT: case R_GRADIENT: case Y_GRADIENT: case S_GRADIENT: case C_GRADIENT: return True; default: fprintf(stderr, "%cGradient type is not supported\n", toupper(type)); return False; } } /* * * Allocates a linear color gradient (veliaa@rpi.edu) * */ static XColor *AllocLinearGradient( char *s_from, char *s_to, int npixels, int skip_first_color, int dither) { XColor *xcs; XColor from, to, c; float r; float dr; float g; float dg; float b; float db; int i; int got_all = 1; int div; if (npixels < 1) { fprintf(stderr, "AllocLinearGradient: Invalid number of pixels: %d\n", npixels); return NULL; } if (!s_from || !XParseColor(Pdpy, Pcmap, s_from, &from)) { fprintf(stderr, "Cannot parse color \"%s\"\n", s_from ? s_from : ""); return NULL; } if (!s_to || !XParseColor(Pdpy, Pcmap, s_to, &to)) { fprintf(stderr, "Cannot parse color \"%s\"\n", s_to ? s_to : ""); return NULL; } /* divisor must not be zero, hence this calculation */ div = (npixels == 1) ? 1 : npixels - 1; c = from; /* red part and step width */ r = from.red; dr = (float)(to.red - from.red); /* green part and step width */ g = from.green; dg = (float)(to.green - from.green); /* blue part and step width */ b = from.blue; db = (float)(to.blue - from.blue); xcs = (XColor *)safemalloc(sizeof(XColor) * npixels); memset(xcs, 0, sizeof(XColor) * npixels); c.flags = DoRed | DoGreen | DoBlue; for (i = (skip_first_color) ? 1 : 0; i < npixels && div > 0; ++i) { c.red = (unsigned short) ((int)(r + dr / (float)div * (float)i + 0.5)); c.green = (unsigned short) ((int)(g + dg / (float)div * (float)i + 0.5)); c.blue = (unsigned short) ((int)(b + db / (float)div * (float)i + 0.5)); if (dither == 0 && !PictureAllocColor(Pdpy, Pcmap, &c, False)) { got_all = 0; } xcs[i] = c; } if (!got_all && dither == 0) { fprintf(stderr, "Cannot alloc color gradient %s to %s\n", s_from, s_to); } return xcs; } /* * * Allocates a nonlinear color gradient (veliaa@rpi.edu) * */ static XColor *AllocNonlinearGradient( char *s_colors[], int clen[], int nsegs, int npixels, int dither) { XColor *xcs = (XColor *)safemalloc(sizeof(XColor) * npixels); int i; int curpixel = 0; int *seg_end_colors; int seg_sum = 0; float color_sum = 0.0; if (nsegs < 1 || npixels < 2) { fprintf(stderr, "Gradients must specify at least one segment and" " two colors\n"); free(xcs); return NULL; } for (i = 0; i < npixels; i++) { xcs[i].pixel = 0; } /* get total length of all segments */ for (i = 0; i < nsegs; i++) { seg_sum += clen[i]; } /* calculate the index of a segment's las color */ seg_end_colors = alloca(nsegs * sizeof(int)); if (nsegs == 1) { seg_end_colors[0] = npixels - 1; } else { for (i = 0; i < nsegs; i++) { color_sum += (float)(clen[i] * (npixels - 1)) / (float)(seg_sum); seg_end_colors[i] = (int)(color_sum + 0.5); } if (seg_end_colors[nsegs - 1] > npixels - 1) { fprintf(stderr, "BUG: (AllocNonlinearGradient): " "seg_end_colors[nsegs - 1] (%d)" " > npixels - 1 (%d)." " Gradient drawing aborted\n", seg_end_colors[nsegs - 1], npixels - 1); return NULL; } /* take care of rounding errors */ seg_end_colors[nsegs - 1] = npixels - 1; } for (i = 0; i < nsegs; ++i) { XColor *c = NULL; int j; int n; int skip_first_color = (curpixel != 0); if (i == 0) { n = seg_end_colors[0] + 1; } else { n = seg_end_colors[i] - seg_end_colors[i - 1] + 1; } if (n > 1) { c = AllocLinearGradient( s_colors[i], s_colors[i + 1], n, skip_first_color, dither); if (!c && (n - skip_first_color) != 0) { free(xcs); return NULL; } for (j = skip_first_color; j < n; ++j) { xcs[curpixel + j] = c[j]; } curpixel += n - 1; } if (c) { free(c); c = NULL; } if (curpixel != seg_end_colors[i]) { fprintf(stderr, "BUG: (AllocNonlinearGradient): " "nsegs %d, i %d, curpixel %d," " seg_end_colors[i] = %d," " npixels %d, n %d\n", nsegs, i, curpixel, seg_end_colors[i],npixels,n); return NULL; } } return xcs; } /* Convenience function. Calls AllocNonLinearGradient to fetch all colors and * then frees the color names and the perc and color_name arrays. */ XColor *AllocAllGradientColors( char *color_names[], int perc[], int nsegs, int ncolors, int dither) { XColor *xcs = NULL; int i; /* grab the colors */ xcs = AllocNonlinearGradient( color_names, perc, nsegs, ncolors, dither); for (i = 0; i <= nsegs; i++) { if (color_names[i]) { free(color_names[i]); } } free(color_names); free(perc); if (!xcs) { fprintf(stderr, "couldn't create gradient\n"); return NULL; } return xcs; } /* groks a gradient string and creates arrays of colors and percentages * returns the number of colors asked for (No. allocated may be less due * to the ColorLimit command). A return of 0 indicates an error */ int ParseGradient( char *gradient, char **rest, char ***colors_return, int **perc_return, int *nsegs_return) { char *item; char *orig; int npixels; char **s_colors; int *perc; int nsegs, i, sum; Bool is_syntax_error = False; /* get the number of colors specified */ if (rest) { *rest = gradient; } orig = gradient; if (GetIntegerArguments(gradient, &gradient, (int *)&npixels, 1) != 1 || npixels < 2) { fprintf( stderr, "ParseGradient: illegal number of colors in" " gradient: '%s'\n", orig); return 0; } /* get the starting color or number of segments */ gradient = GetNextToken(gradient, &item); if (gradient) { gradient = SkipSpaces(gradient, NULL, 0); } if (!gradient || !*gradient || !item) { fprintf(stderr, "Incomplete gradient style: '%s'\n", orig); if (item) { free(item); } if (rest) { *rest = gradient; } return 0; } if (GetIntegerArguments(item, NULL, &nsegs, 1) != 1) { /* get the end color of a simple gradient */ s_colors = (char **)safemalloc(sizeof(char *) * 2); perc = (int *)safemalloc(sizeof(int)); nsegs = 1; s_colors[0] = item; gradient = GetNextToken(gradient, &item); s_colors[1] = item; perc[0] = 100; } else { free(item); /* get a list of colors and percentages */ if (nsegs < 1) nsegs = 1; if (nsegs > MAX_GRADIENT_SEGMENTS) nsegs = MAX_GRADIENT_SEGMENTS; s_colors = (char **)safemalloc(sizeof(char *) * (nsegs + 1)); perc = (int *)safemalloc(sizeof(int) * nsegs); for (i = 0; !is_syntax_error && i <= nsegs; i++) { s_colors[i] = 0; gradient = GetNextToken(gradient, &s_colors[i]); if (i < nsegs) { if (GetIntegerArguments( gradient, &gradient, &perc[i], 1) != 1 || perc[i] <= 0) { /* illegal size */ perc[i] = 0; } } } if (s_colors[nsegs] == NULL) { fprintf( stderr, "ParseGradient: too few gradient" " segments: '%s'\n", orig); is_syntax_error = True; } } /* sanity check */ for (i = 0, sum = 0; !is_syntax_error && i < nsegs; ++i) { int old_sum = sum; sum += perc[i]; if (sum < old_sum) { /* integer overflow */ fprintf( stderr, "ParseGradient: multi gradient" " overflow: '%s'", orig); is_syntax_error = 1; break; } } if (is_syntax_error) { for (i = 0; i <= nsegs; ++i) { if (s_colors[i]) { free(s_colors[i]); } } free(s_colors); free(perc); if (rest) { *rest = gradient; } return 0; } /* sensible limits */ if (npixels < 2) npixels = 2; if (npixels > MAX_GRADIENT_COLORS) npixels = MAX_GRADIENT_COLORS; /* send data back */ *colors_return = s_colors; *perc_return = perc; *nsegs_return = nsegs; if (rest) *rest = gradient; return npixels; } /* Calculate the prefered dimensions of a gradient, based on the number of * colors and the gradient type. Returns False if the gradient type is not * supported. */ Bool CalculateGradientDimensions( Display *dpy, Drawable d, int ncolors, char type, int dither, int *width_ret, int *height_ret) { static int best_width = 0, best_height = 0; int dither_factor = (dither > 0)? 128:1; /* get the best tile size (once) */ if (!best_width) { if (!XQueryBestTile( dpy, d, 1, 1, (unsigned int*)&best_width, (unsigned int*)&best_height)) { best_width = 0; best_height = 0; } /* this is needed for buggy X servers like XFree 3.3.3.1 */ if (!best_width) best_width = 1; if (!best_height) best_height = 1; } switch (type) { case H_GRADIENT: *width_ret = ncolors; *height_ret = best_height * dither_factor; break; case V_GRADIENT: *width_ret = best_width * dither_factor; *height_ret = ncolors; break; case D_GRADIENT: case B_GRADIENT: /* diagonal gradients are rendered into a rectangle for which * the width plus the height is equal to ncolors + 1. The * rectangle is square when ncolors is odd and one pixel * taller than wide with even numbers */ *width_ret = (ncolors + 1) / 2; *height_ret = ncolors + 1 - *width_ret; break; case S_GRADIENT: /* square gradients have the last color as a single pixel in * the centre */ *width_ret = *height_ret = 2 * ncolors - 1; break; case C_GRADIENT: /* circular gradients have the first color as a pixel in each * corner */ *width_ret = *height_ret = 2 * ncolors - 1; break; case R_GRADIENT: case Y_GRADIENT: /* swept types need each color to occupy at least one pixel at * the edge. Get the smallest odd number that will provide * enough */ for (*width_ret = 1; (double)(*width_ret - 1) * M_PI < (double)ncolors; *width_ret += 2) { /* nothing to do here */ } *height_ret = *width_ret; break; default: fprintf(stderr, "%cGradient not supported\n", type); return False; } return True; } /* Does the actual drawing of the pixmap. If the in_drawable argument is None, * a new pixmap of the given depth, width and height is created. If it is not * None the gradient is drawn into it. The d_width, d_height, d_x and d_y * describe the traget rectangle within the drawable. */ Drawable CreateGradientPixmap( Display *dpy, Drawable d, GC gc, int type, int g_width, int g_height, int ncolors, XColor *xcs, int dither, Pixel **d_pixels, int *d_npixels, Drawable in_drawable, int d_x, int d_y, int d_width, int d_height, XRectangle *rclip) { Pixmap pixmap = None; PictureImageColorAllocator *pica = NULL; XColor c; FImage *fim; register int i, j; XGCValues xgcv; Drawable target; int t_x; int t_y; int t_width; int t_height; if (d_pixels != NULL && *d_pixels != NULL) { if (d_npixels != NULL && *d_npixels > 0) { PictureFreeColors( dpy, Pcmap, *d_pixels, *d_npixels, 0, False); } free(*d_pixels); *d_pixels = NULL; } if (d_npixels != NULL) { *d_npixels = 0; } if (g_height < 0 || g_width < 0 || d_width < 0 || d_height < 0) return None; if (in_drawable == None) { /* create a pixmap to use */ pixmap = XCreatePixmap(dpy, d, g_width, g_height, Pdepth); if (pixmap == None) return None; target = pixmap; t_x = 0; t_y = 0; t_width = g_width; t_height = g_height; } else { target = in_drawable; t_x = d_x; t_y = d_y; t_width = d_width; t_height = d_height; } fim = FCreateFImage( dpy, Pvisual, Pdepth, ZPixmap, t_width, t_height); if (!fim) { fprintf(stderr, "%cGradient couldn't get image\n", type); if (pixmap != None) XFreePixmap(dpy, pixmap); return None; } if (dither) { pica = PictureOpenImageColorAllocator( dpy, Pcmap, t_width, t_height, False, False, dither, False); } /* now do the fancy drawing */ switch (type) { case H_GRADIENT: { for (i = 0; i < t_width; i++) { int d = i * ncolors / t_width; c = xcs[d]; for (j = 0; j < t_height; j++) { if (dither) { c = xcs[d]; PictureAllocColorImage( dpy, pica, &c, i, j); } XPutPixel(fim->im, i, j, c.pixel); } } } break; case V_GRADIENT: { for (j = 0; j < t_height; j++) { int d = j * ncolors / t_height; c = xcs[d]; for (i = 0; i < t_width; i++) { if (dither) { c = xcs[d]; PictureAllocColorImage( dpy, pica, &c, i, j); } XPutPixel(fim->im, i, j, c.pixel); } } break; } case D_GRADIENT: { register int t_scale = t_width + t_height - 1; for (i = 0; i < t_width; i++) { for (j = 0; j < t_height; j++) { c = xcs[(i+j) * ncolors / t_scale]; if (dither) { PictureAllocColorImage( dpy, pica, &c, i, j); } XPutPixel(fim->im, i, j, c.pixel); } } break; } case B_GRADIENT: { register int t_scale = t_width + t_height - 1; for (i = 0; i < t_width; i++) { for (j = 0; j < t_height; j++) { c = xcs[(i + (t_height - j - 1)) * ncolors / t_scale]; if (dither) { PictureAllocColorImage( dpy, pica, &c, i, j); } XPutPixel(fim->im, i, j, c.pixel); } } break; } case S_GRADIENT: { register int t_scale = t_width * t_height; register int myncolors = ncolors * 2; for (i = 0; i < t_width; i++) { register int pi = min(i, t_width - 1 - i) * t_height; for (j = 0; j < t_height; j++) { register int pj = min(j, t_height - 1 - j) * t_width; c = xcs[(min(pi, pj) * myncolors - 1) / t_scale]; if (dither) { PictureAllocColorImage( dpy, pica, &c, i, j); } XPutPixel(fim->im, i, j, c.pixel); } } } break; case C_GRADIENT: { register double t_scale = (double)(t_width * t_height) / sqrt(8); for (i = 0; i < t_width; i++) { for (j = 0; j < t_height; j++) { register double x = (double)((2 * i - t_width) * t_height) / 4.0; register double y = (double)((t_height - 2 * j) * t_width) / 4.0; register double rad = sqrt(x * x + y * y); c = xcs[(int)((rad * ncolors - 0.5) / t_scale)]; if (dither) { PictureAllocColorImage( dpy, pica, &c, i, j); } XPutPixel(fim->im, i, j, c.pixel); } } break; } case R_GRADIENT: { register int w = t_width - 1; register int h = t_height - 1; /* g_width == g_height, both are odd, therefore x can be 0.0 */ for (i = 0; i <= w; i++) { for (j = 0; j <= h; j++) { register double x = (double)((2 * i - w) * h) / 4.0; register double y = (double)((h - 2 * j) * w) / 4.0; /* angle ranges from -pi/2 to +pi/2 */ register double angle; if (x != 0.0) { angle = atan(y / x); } else { angle = (y < 0) ? - M_PI_2 : M_PI_2; } /* extend to -pi/2 to 3pi/2 */ if (x < 0) angle += M_PI; /* move range from -pi/2:3*pi/2 to 0:2*pi */ if (angle < 0.0) angle += M_PI * 2.0; /* normalize to gradient */ c = xcs[(int)(angle * M_1_PI * 0.5 * ncolors)]; if (dither) { PictureAllocColorImage( dpy, pica, &c, i, j); } XPutPixel(fim->im, i, j, c.pixel); } } } break; /* * The Yin Yang gradient style and the following code are: * Copyright 1999 Sir Boris. (email to sir_boris@bigfoot.com may be * read by his groom but is not guaranteed to elicit a response) * No restrictions are placed on this code, as long as the copyright * notice is preserved. */ case Y_GRADIENT: { register int r = t_width * t_height / 4; for (i = 0; i < t_width; i++) { for (j = 0; j < t_height; j++) { register double x = (double)((2 * i - t_width) * t_height) / 4.0; register double y = (double)((t_height - 2 * j) * t_width) / 4.0; register double rad = sqrt(x * x + y * y); /* angle ranges from -pi/2 to +pi/2 */ register double angle; if (x != 0.0) { angle = atan(y / x); } else { angle = (y < 0) ? - M_PI_2 : M_PI_2; } /* extend to -pi/2 to 3pi/2 */ if (x < 0) angle += M_PI; /* warp the angle within the yinyang circle */ if (rad <= r) { angle -= acos(rad / r); } /* move range from -pi/2:3*pi/2 to 0:2*pi */ if (angle < 0.0) angle += M_PI * 2.0; /* normalize to gradient */ c = xcs[(int)(angle * M_1_PI * 0.5 * ncolors)]; if (dither) { PictureAllocColorImage( dpy, pica, &c, i, j); } XPutPixel(fim->im, i, j, c.pixel); } } } break; default: /* placeholder function, just fills the pixmap with the first * color */ memset(fim->im->data, 0, fim->im->bytes_per_line * t_height); XAddPixel(fim->im, xcs[0].pixel); break; } if (dither) { if (d_pixels != NULL && d_npixels != NULL) { PictureCloseImageColorAllocator( dpy, pica, d_npixels, d_pixels, 0); } else { /* possible color leak */ } } /* set the gc style */ xgcv.function = GXcopy; xgcv.plane_mask = AllPlanes; xgcv.fill_style = FillSolid; xgcv.clip_mask = None; XChangeGC(dpy, gc, GCFunction|GCPlaneMask|GCFillStyle|GCClipMask, &xgcv); if (rclip) { XSetClipRectangles(dpy, gc, 0, 0, rclip, 1, Unsorted); } /* copy the image to the server */ FPutFImage(dpy, target, gc, fim, 0, 0, t_x, t_y, t_width, t_height); if (rclip) { XSetClipMask(dpy, gc, None); } FDestroyFImage(dpy, fim); return target; } /* Create a pixmap from a gradient specifier, width and height are hints * that are only used for gradients that can be tiled e.g. H or V types * types are HVDBSCRY for Horizontal, Vertical, Diagonal, Back-diagonal, Square, * Circular, Radar and Yin/Yang respectively (in order of bloatiness) */ Pixmap CreateGradientPixmapFromString( Display *dpy, Drawable d, GC gc, int type, char *action, int *width_return, int *height_return, Pixel **pixels_return, int *nalloc_pixels, int dither) { Pixel *d_pixels = NULL; int d_npixels = 0; XColor *xcs = NULL; int ncolors = 0; char **colors; int *perc, nsegs; Pixmap pixmap = None; /* set return pixels to NULL in case of premature return */ if (pixels_return) *pixels_return = NULL; if (nalloc_pixels) *nalloc_pixels = 0; /* translate the gradient string into an array of colors etc */ if (!(ncolors = ParseGradient(action, NULL, &colors, &perc, &nsegs))) { fprintf(stderr, "Can't parse gradient: '%s'\n", action); return None; } /* grab the colors */ xcs = AllocAllGradientColors( colors, perc, nsegs, ncolors, dither); if (xcs == NULL) { return None; } /* grok the size to create from the type */ type = toupper(type); if (CalculateGradientDimensions( dpy, d, ncolors, type, dither, width_return, height_return)) { pixmap = CreateGradientPixmap( dpy, d, gc, type, *width_return, *height_return, ncolors, xcs, dither, &d_pixels, &d_npixels, None, 0, 0, 0, 0, NULL); } /* if the caller has not asked for the pixels there is probably a leak */ if (PUseDynamicColors) { if (!(pixels_return && nalloc_pixels)) { /* if the caller has not asked for the pixels there is * probably a leak */ fprintf(stderr, "CreateGradient: potential color leak, losing track" " of pixels\n"); if (d_pixels != NULL) { free(d_pixels); } } else { if (!dither) { Pixel *pixels; int i; pixels = (Pixel *)safemalloc( ncolors * sizeof(Pixel)); for(i=0; igraphics_exposures; if (!(valuemask & GCGraphicsExposures)) { valuemask |= GCGraphicsExposures; values->graphics_exposures = 0; } gc = XCreateGC(display, drawable, valuemask, values); values->graphics_exposures = f; return gc; } fvwm-2.6.5.orig/libs/XResource.c0000644000175000017500000002122110630367353014642 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 1999 Dominik Vogt */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ** XResource.c: ** These routines provide modules with an interface to parse all kinds of ** configuration options (X resources, command line options and configuration ** file lines) in the same way (Xrm database). */ #include "config.h" #include #include #include "fvwmlib.h" #include "XResource.h" /* * If you have a module MyModule and want to parse X resources as well as * command line options and a config file: * *** EXAMPLE */ #if 0 #include void main(int argc, char **argv) { const char *MyName = "MyModule"; XrmDatabase db = NULL; XrmValue *rm_value; char *line; /* our private options */ const XrmOptionDescRec my_opts[] = { { "-iconic", ".Iconic", XrmoptionNoArg, "any_string" }, { "-foo", "*bar", XrmoptionSepArg, NULL } }; int opt_argc = argc - 6; /* options start at 6th argument for modules */ char **opt_argv = argv + 6; /* ... (open config file, etc.) */ /* Get global X resources */ MergeXResources(NULL, &db, False); /* config file descriptor in fd; config file takes precedence over X * resources (this may not be what you want). */ for (GetConfigLine(fd, &line); line != NULL; GetConfigLine(fd, &line)) { if (!MergeConfigLineResource(&db, line, MyName, '*')) { /* Parse other lines here (e.g. "ImagePath") */ } else { /* You may still have to parse the line here yourself (e.g. * FvwmButtons may have multiple lines for the same resource). */ } } /* command line takes precedence over all */ MergeCmdLineResources(&db, (XrmOptionDescList)my_opts, 2, MyName, &opt_argc, opt_argv, True /*no default options*/); /* Now parse the database values: */ if (GetResourceString(db, "iconic", MyName, &rm_value)) { /* Just see if there is *any* string and don't mind it's value. */ /* flags |= ICONIC */ } if (GetResourceString(db, "bar", MyName, &rm_value)) { /* ... */ } /* ... */ XrmDestroyDatabase(db); } #endif /*** END OF EXAMPLE ***/ /* Default option table */ static XrmOptionDescRec default_opts[] = { { "-fg", "*Foreground", XrmoptionSepArg, NULL }, { "-bg", "*Background", XrmoptionSepArg, NULL }, { "-fn", "*Font", XrmoptionSepArg, NULL }, { "-geometry", "*Geometry", XrmoptionSepArg, NULL }, { "-title", "*Title", XrmoptionSepArg, NULL } /* Remember to update NUM_DEFAULT_OPTIONS if you change this list! */ }; #define NUM_DEFAULT_OPTS 5 /* internal function */ static void DoMergeString(char *resource, XrmDatabase *ptarget, Bool override) { XrmDatabase db; if (!resource) return; db = XrmGetStringDatabase(resource); XrmCombineDatabase(db, ptarget, override); } /* * * Merges all X resources for the display/screen into a Xrm database. * If the database does not exist (*pdb == NULL), a new database is created. * If override is True, existing entries of the same name are overwritten. * * Please remember to destroy the database with XrmDestroyDatabase(*pdb) * if you do not need it amymore. * */ void MergeXResources(Display *dpy, XrmDatabase *pdb, Bool override) { if (!*pdb) /* create new database */ XrmPutStringResource(pdb, "", ""); DoMergeString(XResourceManagerString(dpy), pdb, override); DoMergeString(XScreenResourceString(DefaultScreenOfDisplay(dpy)), pdb, override); } /* * * Parses the command line given through pargc/argv and puts recognized * entries into the Xrm database *pdb (if *pdb is NULL a new database is * created). The caller may provide an option list in XrmOptionDescList * format (see XrmParseCommand manpage) and/or parse only standard options * (fg, bg, geometry, fn, title). User given options have precedence over * standard options which are disabled if fNoDefaults is True. Existing * values are overwritten. * * All recognised options are removed from the command line (*pargc and * argv are updated accordingly). * * Please remember to destroy the database with XrmDestroyDatabase(*pdb) * if you do not need it amymore. * */ void MergeCmdLineResources(XrmDatabase *pdb, XrmOptionDescList opts, int num_opts, char *name, int *pargc, char **argv, Bool fNoDefaults) { if (!name) return; if (opts && num_opts > 0) XrmParseCommand(pdb, opts, num_opts, name, pargc, argv); if (!fNoDefaults) XrmParseCommand(pdb, default_opts, NUM_DEFAULT_OPTS, name, pargc, argv); } /* * * Takes a line from a config file and puts a corresponding value into the * Xrm database *pdb (will be created if *pdb is NULL). 'prefix' is the * name of the module. A specific type of binding in the database must be * provided in bindstr (either "*" or "."). Leading unquoted whitespace are * stripped from value. Existing values in the database are overwritten. * True is returned if the line was indeed merged into the database (i.e. it * had the correct format) or False if not. * * Example: If prefix = "MyModule" and bindstr = "*", the line * * *MyModuleGeometry 80x25+0+0 * * will be put into the database as if you had this line in your .Xdefaults: * * MyModule*Geometry: 80x25+0+0 * * Please remember to destroy the database with XrmDestroyDatabase(*pdb) * if you do not need it amymore. * */ Bool MergeConfigLineResource(XrmDatabase *pdb, char *line, char *prefix, char *bindstr) { int len; char *end; char *value; char *myvalue; char *resource; /* translate "*(prefix)(suffix)" to "(prefix)(binding)(suffix)", * e.g. "*FvwmPagerGeometry" to "FvwmPager.Geometry" */ if (!line || *line != '*') return False; line++; len = (prefix) ? strlen(prefix) : 0; if (!prefix || strncasecmp(line, prefix, len)) return False; line += len; end = line; while (*end && !isspace((unsigned char)*end)) end++; if (line == end) return False; value = end; while (*value && isspace((unsigned char)*value)) value++; /* prefix*suffix: value */ resource = (char *)safemalloc(len + (end - line) + 2); strcpy(resource, prefix); strcat(resource, bindstr); strncat(resource, line, end - line); len = strlen(value); myvalue = (char *)safemalloc(len + 1); strcpy(myvalue, value); for (len--; len >= 0 && isspace((unsigned char)myvalue[len]); len--) myvalue[len] = 0; /* merge string into database */ XrmPutStringResource(pdb, resource, myvalue); free(resource); free(myvalue); return True; } /* * * Reads the string-value for the pair prefix/resource from the Xrm database * db and returns a pointer to it. The string may only be read and must not * be freed by the caller. 'prefix' is the class name (usually the name of * the module). If no value is found in the database, *val will be NULL. * True is returned if a value was found, False if not. If you are only * interested if there is a string, but not it's value, you can set val to * NULL. * * Example: * * GetResourceString(db, "Geometry", "MyModule", &r) * * returns the resource value of the "Geometry" resource for MyModule in r. * */ Bool GetResourceString( XrmDatabase db, const char *resource, const char *prefix, XrmValue *xval) { char *str_type; char *name; char *Name; int i; name = (char *)safemalloc(strlen(resource) + strlen(prefix) + 2); Name = (char *)safemalloc(strlen(resource) + strlen(prefix) + 2); strcpy(name, prefix); strcat(name, "."); strcat(name, resource); strcpy(Name, name); if (isupper(name[0])) name[0] = tolower(name[0]); if (islower(Name[0])) Name[0] = toupper(Name[0]); i = strlen(prefix) + 1; if (isupper(name[i])) name[i] = tolower(name[i]); if (islower(Name[i])) Name[i] = toupper(Name[i]); if (!XrmGetResource(db, name, Name, &str_type, xval) || xval->addr == NULL || xval->size == 0) { free(name); free(Name); xval->size = 0; xval->addr = NULL; return False; } free(name); free(Name); return True; } fvwm-2.6.5.orig/libs/FSMlib.h0000644000175000017500000006136407714416443014064 0ustar vwcvwc/* -*-c-*- */ #ifndef FSMlib_H #define FSMlib_H /* ---------------------------- included header files ---------------------- */ #include "config.h" #ifdef SESSION #define SessionSupport 1 #else #define SessionSupport 0 #endif #if SessionSupport #include #include #endif /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ #if SessionSupport /* SM.h */ #define FSmProtoMajor SmProtoMajor #define FSmProtoMinor SmProtoMinor #define FSmInteractStyleNone SmInteractStyleNone #define FSmInteractStyleErrors SmInteractStyleErrors #define FSmInteractStyleAny SmInteractStyleAny #define FSmDialogError SmDialogError #define FSmDialogNormal SmDialogNormal #define FSmSaveGlobal SmSaveGlobal #define FSmSaveLocal SmSaveLocal #define FSmSaveBoth SmSaveBoth #define FSmRestartIfRunning SmRestartIfRunning #define FSmRestartAnyway SmRestartAnyway #define FSmRestartImmediately SmRestartImmediately #define FSmRestartNever SmRestartNever #define FSmCloneCommand SmCloneCommand #define FSmCurrentDirectory SmCurrentDirectory #define FSmDiscardCommand SmDiscardCommand #define FSmEnvironment SmEnvironment #define FSmProcessID SmProcessID #define FSmProgram SmProgram #define FSmRestartCommand SmRestartCommand #define FSmResignCommand SmResignCommand #define FSmRestartStyleHint SmRestartStyleHint #define FSmShutdownCommand SmShutdownCommand #define FSmUserID SmUserID #define FSmCARD8 SmCARD8 #define FSmARRAY8 SmARRAY8 #define FSmLISTofARRAY8 SmLISTofARRAY8 #define FSM_Error SM_Error #define FSM_RegisterClient SM_RegisterClient #define FSM_RegisterClientReply SM_RegisterClientReply #define FSM_SaveYourself SM_SaveYourself #define FSM_SaveYourselfRequest SM_SaveYourselfRequest #define FSM_InteractRequest SM_InteractRequest #define FSM_Interact SM_Interact #define FSM_InteractDone SM_InteractDone #define FSM_SaveYourselfDone SM_SaveYourselfDone #define FSM_Die SM_Die #define FSM_ShutdownCancelled SM_ShutdownCancelled #define FSM_CloseConnection SM_CloseConnection #define FSM_SetProperties SM_SetProperties #define FSM_DeleteProperties SM_DeleteProperties #define FSM_GetProperties SM_GetProperties #define FSM_PropertiesReply SM_PropertiesReply #define FSM_SaveYourselfPhase2Request SM_SaveYourselfPhase2Request #define FSM_SaveYourselfPhase2 SM_SaveYourselfPhase2 #define FSM_SaveComplete SM_SaveComplete /* ICE.h */ #define FIceProtoMajor IceProtoMajor #define FIceProtoMinor IceProtoMinor #define FIceLSBfirst IceLSBfirst #define FIceMSBfirst IceMSBfirst #define FICE_Error ICE_Error #define FICE_ByteOrder ICE_ByteOrder #define FICE_ConnectionSetup ICE_ConnectionSetup #define FICE_AuthRequired ICE_AuthRequired #define FICE_AuthReply ICE_AuthReply #define FICE_AuthNextPhase ICE_AuthNextPhase #define FICE_ConnectionReply ICE_ConnectionReply #define FICE_ProtocolSetup ICE_ProtocolSetup #define FICE_ProtocolReply ICE_ProtocolReply #define FICE_Ping ICE_Ping #define FICE_PingReply ICE_PingReply #define FICE_WantToClose ICE_WantToClose #define FICE_NoClose ICE_NoClose #define FIceCanContinue IceCanContinue #define FIceFatalToProtocol IceFatalToProtocol #define FIceFatalToConnection IceFatalToConnection #define FIceBadMinor IceBadMinor #define FIceBadState IceBadState #define FIceBadLength IceBadLength #define FIceBadValue IceBadValue #define FIceBadMajor IceBadMajor #define FIceNoAuth IceNoAuth #define FIceNoVersion IceNoVersion #define FIceSetupFailed IceSetupFailed #define FIceAuthRejected IceAuthRejected #define FIceAuthFailed IceAuthFailed #define FIceProtocolDuplicate IceProtocolDuplicate #define FIceMajorOpcodeDuplicate IceMajorOpcodeDuplicate #define FIceUnknownProtocol IceUnknownProtocol /* SMlib.h */ #define FSmsRegisterClientProcMask SmsRegisterClientProcMask #define FSmsInteractRequestProcMask SmsInteractRequestProcMask #define FSmsInteractDoneProcMask SmsInteractDoneProcMask #define FSmsSaveYourselfRequestProcMask SmsSaveYourselfRequestProcMask #define FSmsSaveYourselfP2RequestProcMask SmsSaveYourselfP2RequestProcMask #define FSmsSaveYourselfDoneProcMask SmsSaveYourselfDoneProcMask #define FSmsCloseConnectionProcMask SmsCloseConnectionProcMask #define FSmsSetPropertiesProcMask SmsSetPropertiesProcMask #define FSmsDeletePropertiesProcMask SmsDeletePropertiesProcMask #define FSmsGetPropertiesProcMask SmsGetPropertiesProcMask #define FSmcSaveYourselfProcMask SmcSaveYourselfProcMask #define FSmcDieProcMask SmcDieProcMask #define FSmcSaveCompleteProcMask SmcSaveCompleteProcMask #define FSmcShutdownCancelledProcMask SmcShutdownCancelledProcMask /* ICEutil.h */ #define FIceAuthLockSuccess IceAuthLockSuccess #define FIceAuthLockError IceAuthLockError #define FIceAuthLockTimeout IceAuthLockTimeout #else /* !SessionSupport */ /* SM.h */ #define FSmProtoMajor 1 #define FSmProtoMinor 0 #define FSmInteractStyleNone 0 #define FSmInteractStyleErrors 1 #define FSmInteractStyleAny 2 #define FSmDialogError 0 #define FSmDialogNormal 1 #define FSmSaveGlobal 0 #define FSmSaveLocal 1 #define FSmSaveBoth 2 #define FSmRestartIfRunning 0 #define FSmRestartAnyway 1 #define FSmRestartImmediately 2 #define FSmRestartNever 3 #define FSmCloneCommand "CloneCommand" #define FSmCurrentDirectory "CurrentDirectory" #define FSmDiscardCommand "DiscardCommand" #define FSmEnvironment "Environment" #define FSmProcessID "ProcessID" #define FSmProgram "Program" #define FSmRestartCommand "RestartCommand" #define FSmResignCommand "ResignCommand" #define FSmRestartStyleHint "RestartStyleHint" #define FSmShutdownCommand "ShutdownCommand" #define FSmUserID "UserID" #define FSmCARD8 "CARD8" #define FSmARRAY8 "ARRAY8" #define FSmLISTofARRAY8 "LISTofARRAY8" #define FSM_Error 0 #define FSM_RegisterClient 1 #define FSM_RegisterClientReply 2 #define FSM_SaveYourself 3 #define FSM_SaveYourselfRequest 4 #define FSM_InteractRequest 5 #define FSM_Interact 6 #define FSM_InteractDone 7 #define FSM_SaveYourselfDone 8 #define FSM_Die 9 #define FSM_ShutdownCancelled 10 #define FSM_CloseConnection 11 #define FSM_SetProperties 12 #define FSM_DeleteProperties 13 #define FSM_GetProperties 14 #define FSM_PropertiesReply 15 #define FSM_SaveYourselfPhase2Request 16 #define FSM_SaveYourselfPhase2 17 #define FSM_SaveComplete 18 /* ICE.h */ #define FIceProtoMajor 1 #define FIceProtoMinor 0 #define FIceLSBfirst 0 #define FIceMSBfirst 1 #define FICE_Error 0 #define FICE_ByteOrder 1 #define FICE_ConnectionSetup 2 #define FICE_AuthRequired 3 #define FICE_AuthReply 4 #define FICE_AuthNextPhase 5 #define FICE_ConnectionReply 6 #define FICE_ProtocolSetup 7 #define FICE_ProtocolReply 8 #define FICE_Ping 9 #define FICE_PingReply 10 #define FICE_WantToClose 11 #define FICE_NoClose 12 #define FIceCanContinue 0 #define FIceFatalToProtocol 1 #define FIceFatalToConnection 2 #define FIceBadMinor 0x8000 #define FIceBadState 0x8001 #define FIceBadLength 0x8002 #define FIceBadValue 0x8003 #define FIceBadMajor 0 #define FIceNoAuth 1 #define FIceNoVersion 2 #define FIceSetupFailed 3 #define FIceAuthRejected 4 #define FIceAuthFailed 5 #define FIceProtocolDuplicate 6 #define FIceMajorOpcodeDuplicate 7 #define FIceUnknownProtocol 8 /* SMlib.h */ #define FSmsRegisterClientProcMask (1L << 0) #define FSmsInteractRequestProcMask (1L << 1) #define FSmsInteractDoneProcMask (1L << 2) #define FSmsSaveYourselfRequestProcMask (1L << 3) #define FSmsSaveYourselfP2RequestProcMask (1L << 4) #define FSmsSaveYourselfDoneProcMask (1L << 5) #define FSmsCloseConnectionProcMask (1L << 6) #define FSmsSetPropertiesProcMask (1L << 7) #define FSmsDeletePropertiesProcMask (1L << 8) #define FSmsGetPropertiesProcMask (1L << 9) #define FSmcSaveYourselfProcMask (1L << 0) #define FSmcDieProcMask (1L << 1) #define FSmcSaveCompleteProcMask (1L << 2) #define FSmcShutdownCancelledProcMask (1L << 3) /* ICEutil.h */ #define IceAuthLockSuccess 0 #define IceAuthLockError 1 #define IceAuthLockTimeout 2 #endif /* SessionSupport */ /* ---------------------------- type definitions --------------------------- */ #if SessionSupport /* ICElib.h */ typedef IcePointer FIcePointer; #define FIcePoAuthHaveReply IcePoAuthHaveReply #define FIcePoAuthRejected IcePoAuthRejected #define FIcePoAuthFailed IcePoAuthFailed #define FIcePoAuthDoneCleanup IcePoAuthDoneCleanup typedef IcePoAuthStatus FIcePoAuthStatus; #define FIcePaAuthContinue IcePaAuthContinue #define FIcePaAuthAccepted IcePaAuthAccepted #define FIcePaAuthRejected IcePaAuthRejected #define FIcePaAuthFailed IcePaAuthFailed typedef IcePaAuthStatus FIcePaAuthStatus; #define FIceConnectPending IceConnectPending #define FIceConnectAccepted IceConnectAccepted #define FIceConnectRejected IceConnectRejected #define FIceConnectIOError IceConnectIOError typedef IceConnectStatus FIceConnectStatus; #define FIceProtocolSetupSuccess IceProtocolSetupSuccess #define FIceProtocolSetupFailure IceProtocolSetupFailure #define FIceProtocolSetupIOError IceProtocolSetupIOError #define FIceProtocolAlreadyActive IceProtocolAlreadyActive typedef IceProtocolSetupStatus FIceProtocolSetupStatus; #define FIceAcceptSuccess IceAcceptSuccess #define FIceAcceptFailure IceAcceptFailure #define FIceAcceptBadMalloc IceAcceptBadMalloc typedef IceAcceptStatus FIceAcceptStatus; #define FIceClosedNow IceClosedNow #define FIceClosedASAP IceClosedASAP #define FIceConnectionInUse IceConnectionInUse #define FIceStartedShutdownNegotiation IceStartedShutdownNegotiation typedef IceCloseStatus FIceCloseStatus; #define FIceProcessMessagesSuccess IceProcessMessagesSuccess #define FIceProcessMessagesIOError IceProcessMessagesIOError #define FIceProcessMessagesConnectionClosed IceProcessMessagesConnectionClosed typedef IceProcessMessagesStatus FIceProcessMessagesStatus; typedef IceReplyWaitInfo FIceReplyWaitInfo; typedef IceConn FIceConn; typedef IceListenObj FIceListenObj; typedef IceWatchProc FIceWatchProc; typedef IcePoProcessMsgProc FIcePoProcessMsgProc; typedef IcePaProcessMsgProc FIcePaProcessMsgProc; typedef IcePoVersionRec FIcePoVersionRec; typedef IcePaVersionRec FIcePaVersionRec; typedef IcePoAuthProc FIcePoAuthProc; typedef IcePaAuthProc FIcePaAuthProc; typedef IceHostBasedAuthProc FIceHostBasedAuthProc; typedef IceProtocolSetupProc FIceProtocolSetupProc; typedef IceProtocolActivateProc FIceProtocolActivateProc; typedef IceIOErrorProc FIceIOErrorProc; typedef IcePingReplyProc FIcePingReplyProc; typedef IceErrorHandler FIceErrorHandler; typedef IceIOErrorHandler FIceIOErrorHandler; /* SMlib.h */ typedef SmPointer FSmPointer; typedef SmcConn FSmcConn; typedef SmsConn FSmsConn; typedef SmPropValue FSmPropValue; typedef SmProp FSmProp; #define FSmcClosedNow SmcClosedNow #define FSmcClosedASAP FSmcClosedASAP #define FSmcConnectionInUse FSmcConnectionInUse typedef SmcCloseStatus FSmcCloseStatus; typedef SmcSaveYourselfProc FSmcSaveYourselfProc; typedef SmcSaveYourselfPhase2Proc FSmcSaveYourselfPhase2Proc; typedef SmcInteractProc FSmcInteractProc; typedef SmcDieProc FSmcDieProc; typedef SmcShutdownCancelledProc FSmcShutdownCancelledProc; typedef SmcSaveCompleteProc FSmcSaveCompleteProc; typedef SmcPropReplyProc FSmcPropReplyProc; typedef SmcCallbacks FSmcCallbacks; typedef SmsRegisterClientProc FSmsRegisterClientProc; typedef SmsInteractRequestProc FSmsInteractRequestProc; typedef SmsInteractDoneProc FSmsInteractDoneProc; typedef SmsSaveYourselfRequestProc FSmsSaveYourselfRequestProc; typedef SmsSaveYourselfPhase2RequestProc FSmsSaveYourselfPhase2RequestProc; typedef SmsSaveYourselfDoneProc FSmsSaveYourselfDoneProc; typedef SmsCloseConnectionProc FSmsCloseConnectionProc; typedef SmsSetPropertiesProc FSmsSetPropertiesProc; typedef SmsDeletePropertiesProc FSmsDeletePropertiesProc; typedef SmsGetPropertiesProc FSmsGetPropertiesProc; typedef SmsCallbacks FSmsCallbacks; typedef SmsNewClientProc FSmsNewClientProc; typedef SmcErrorHandler FSmcErrorHandler; typedef SmsErrorHandler FSmsErrorHandler; /* ICEutil.h */ typedef IceAuthFileEntry FIceAuthFileEntry; typedef IceAuthDataEntry FIceAuthDataEntry; #else /* !SessionSupport */ #ifdef __STDC__ typedef void *FIcePointer; #else typedef char *FIcePointer; #endif /* ICElib.h */ typedef enum { FIcePoAuthHaveReply, FIcePoAuthRejected, FIcePoAuthFailed, FIcePoAuthDoneCleanup } FIcePoAuthStatus; typedef enum { FIcePaAuthContinue, FIcePaAuthAccepted, FIcePaAuthRejected, FIcePaAuthFailed } FIcePaAuthStatus; typedef enum { FIceConnectPending,FIceConnectAccepted,FIceConnectRejected,FIceConnectIOError } FIceConnectStatus; typedef enum { FIceProtocolSetupSuccess,FIceProtocolSetupFailure,FIceProtocolSetupIOError, FIceProtocolAlreadyActive } FIceProtocolSetupStatus; typedef enum { FIceAcceptSuccess,FIceAcceptFailure,FIceAcceptBadMalloc } FIceAcceptStatus; typedef enum { FIceClosedNow,FIceClosedASAP,FIceConnectionInUse, FIceStartedShutdownNegotiation } FIceCloseStatus; typedef enum { FIceProcessMessagesSuccess,FIceProcessMessagesIOError, FIceProcessMessagesConnectionClosed } FIceProcessMessagesStatus; typedef struct { unsigned long sequence_of_request; int major_opcode_of_request; int minor_opcode_of_request; FIcePointer reply; } FIceReplyWaitInfo; typedef void *FIceConn; typedef void *FIceListenObj; typedef void (*FIceWatchProc) ( #ifdef __STDC__ FIceConn, FIcePointer, Bool, FIcePointer * #endif ); typedef void (*FIcePoProcessMsgProc) ( #ifdef __STDC__ FIceConn, FIcePointer, int, unsigned long, Bool, FIceReplyWaitInfo *, Bool * #endif ); typedef void (*FIcePaProcessMsgProc) ( #ifdef __STDC__ FIceConn, FIcePointer, int, unsigned long, Bool #endif ); typedef struct { int major_version; int minor_version; FIcePoProcessMsgProc process_msg_proc; } FIcePoVersionRec; typedef struct { int major_version; int minor_version; FIcePaProcessMsgProc process_msg_proc; } FIcePaVersionRec; typedef FIcePoAuthStatus (*FIcePoAuthProc) ( #ifdef __STDC__ FIceConn, FIcePointer *, Bool, Bool, int, FIcePointer, int *, FIcePointer *, char ** #endif ); typedef FIcePaAuthStatus (*FIcePaAuthProc) ( #ifdef __STDC__ FIceConn, FIcePointer *, Bool, int, FIcePointer, int *, FIcePointer *, char ** #endif ); typedef Bool (*FIceHostBasedAuthProc) ( #ifdef __STDC__ char * #endif ); typedef Status (*FIceProtocolSetupProc) ( #ifdef __STDC__ FIceConn, int, int, char *, char *, FIcePointer *, char ** #endif ); typedef void (*FIceProtocolActivateProc) ( #ifdef __STDC__ FIceConn, FIcePointer #endif ); typedef void (*FIceIOErrorProc) ( #ifdef __STDC__ FIceConn #endif ); typedef void (*FIcePingReplyProc) ( #ifdef __STDC__ FIceConn, FIcePointer #endif ); typedef void (*FIceErrorHandler) ( #ifdef __STDC__ FIceConn, Bool, int, unsigned long, int, int, FIcePointer #endif ); typedef void (*FIceIOErrorHandler) ( #ifdef __STDC__ FIceConn /* iceConn */ #endif ); /* SMlib.h */ typedef FIcePointer FSmPointer; typedef void *FSmcConn; typedef void *FSmsConn; typedef struct { int length; FSmPointer value; } FSmPropValue; typedef struct { char *name; char *type; int num_vals; FSmPropValue *vals; } FSmProp; typedef enum { FSmcClosedNow, FSmcClosedASAP, FSmcConnectionInUse } FSmcCloseStatus; typedef void (*FSmcSaveYourselfProc) ( #ifdef __STDC__ FSmcConn, FSmPointer, int, Bool, int, Bool #endif ); typedef void (*FSmcSaveYourselfPhase2Proc) ( #ifdef __STDC__ FSmcConn, FSmPointer #endif ); typedef void (*FSmcInteractProc) ( #ifdef __STDC__ FSmcConn, FSmPointer #endif ); typedef void (*FSmcDieProc) ( #ifdef __STDC__ FSmcConn, FSmPointer #endif ); typedef void (*FSmcShutdownCancelledProc) ( #ifdef __STDC__ FSmcConn, FSmPointer #endif ); typedef void (*FSmcSaveCompleteProc) ( #ifdef __STDC__ FSmcConn, FSmPointer #endif ); typedef void (*FSmcPropReplyProc) ( #ifdef __STDC__ FSmcConn, FSmPointer, int, FSmProp ** #endif ); typedef struct { struct { FSmcSaveYourselfProc callback; FSmPointer client_data; } save_yourself; struct { FSmcDieProc callback; FSmPointer client_data; } die; struct { FSmcSaveCompleteProc callback; FSmPointer client_data; } save_complete; struct { FSmcShutdownCancelledProc callback; FSmPointer client_data; } shutdown_cancelled; } FSmcCallbacks; typedef Status (*FSmsRegisterClientProc) ( #ifdef __STDC__ FSmsConn, FSmPointer, char * #endif ); typedef void (*FSmsInteractRequestProc) ( #ifdef __STDC__ FSmsConn, FSmPointer, int #endif ); typedef void (*FSmsInteractDoneProc) ( #ifdef __STDC__ FSmsConn, FSmPointer, Bool #endif ); typedef void (*FSmsSaveYourselfRequestProc) ( #ifdef __STDC__ FSmsConn, FSmPointer, int, Bool, int, Bool, Bool #endif ); typedef void (*FSmsSaveYourselfPhase2RequestProc) ( #ifdef __STDC__ FSmsConn, FSmPointer #endif ); typedef void (*FSmsSaveYourselfDoneProc) ( #ifdef __STDC__ FSmsConn, FSmPointer, Bool #endif ); typedef void (*FSmsCloseConnectionProc) ( #ifdef __STDC__ FSmsConn, FSmPointer, int, char ** #endif ); typedef void (*FSmsSetPropertiesProc) ( #ifdef __STDC__ FSmsConn, FSmPointer, int, FSmProp ** #endif ); typedef void (*FSmsDeletePropertiesProc) ( #ifdef __STDC__ FSmsConn, FSmPointer, int, char ** #endif ); typedef void (*FSmsGetPropertiesProc) ( #ifdef __STDC__ FSmsConn, FSmPointer #endif ); typedef struct { struct { FSmsRegisterClientProc callback; FSmPointer manager_data; } register_client; struct { FSmsInteractRequestProc callback; FSmPointer manager_data; } interact_request; struct { FSmsInteractDoneProc callback; FSmPointer manager_data; } interact_done; struct { FSmsSaveYourselfRequestProc callback; FSmPointer manager_data; } save_yourself_request; struct { FSmsSaveYourselfPhase2RequestProc callback; FSmPointer manager_data; } save_yourself_phase2_request; struct { FSmsSaveYourselfDoneProc callback; FSmPointer manager_data; } save_yourself_done; struct { FSmsCloseConnectionProc callback; FSmPointer manager_data; } close_connection; struct { FSmsSetPropertiesProc callback; FSmPointer manager_data; } set_properties; struct { FSmsDeletePropertiesProc callback; FSmPointer manager_data; } delete_properties; struct { FSmsGetPropertiesProc callback; FSmPointer manager_data; } get_properties; } FSmsCallbacks; typedef Status (*FSmsNewClientProc) ( #ifdef __STDC__ FSmsConn,FSmPointer, unsigned long *, FSmsCallbacks *, char ** #endif ); typedef void (*FSmcErrorHandler) ( #ifdef __STDC__ FSmcConn, Bool, int, unsigned long, int, int, FSmPointer #endif ); typedef void (*FSmsErrorHandler) ( #ifdef __STDC__ FSmsConn, Bool, int, unsigned long, int, int, FSmPointer #endif ); /* ICEutil.h */ typedef struct { char *protocol_name; unsigned short protocol_data_length; char *protocol_data; char *network_id; char *auth_name; unsigned short auth_data_length; char *auth_data; } FIceAuthFileEntry; typedef struct { char *protocol_name; char *network_id; char *auth_name; unsigned short auth_data_length; char *auth_data; } FIceAuthDataEntry; #endif /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ #if SessionSupport /* ICElib.h (no all) */ #define FIceSetIOErrorHandler(a) IceSetIOErrorHandler(a) #define FIceFreeListenObjs(a,b) IceFreeListenObjs(a,b) #define FIceConnectionNumber(a) IceConnectionNumber(a) #define FIceSetShutdownNegotiation(a,b) IceSetShutdownNegotiation(a,b) #define FIceCloseConnection(a) IceCloseConnection(a) #define FIceConnectionStatus(a) IceConnectionStatus(a) #define FIceAcceptConnection(a,b) IceAcceptConnection(a,b) #define FIceProcessMessages(a,b,c) IceProcessMessages(a,b,c) #define FIceListenForConnections(a,b,c,d) IceListenForConnections(a,b,c,d) #define FIceAddConnectionWatch(a,b) IceAddConnectionWatch(a,b) #define FIceGetListenConnectionNumber(a) IceGetListenConnectionNumber(a) #define FIceComposeNetworkIdList(a,b) IceComposeNetworkIdList(a,b) #define FIceGetListenConnectionString(a) IceGetListenConnectionString(a) #define FIceSetHostBasedAuthProc(a,b) IceSetHostBasedAuthProc(a,b) #define FIceConnectionString(a) IceConnectionString(a) /* SMlib.h */ #define FSmcOpenConnection(a,b,c,d,e,f,g,h,i,k) \ SmcOpenConnection(a,b,c,d,e,f,g,h,i,k) #define FSmcCloseConnection(a,b,c) SmcCloseConnection(a,b,c) #define FSmcModifyCallbacks(a,b,c) SmcModifyCallbacks(a,b,c) #define FSmcSetProperties(a,b,c) SmcSetProperties(a,b,c) #define FSmcDeleteProperties(a,b,c) SmcDeleteProperties(a,b,c) #define FSmcGetProperties(a,b,c) SmcGetProperties(a,b,c) #define FSmcInteractRequest(a,b,c,d) SmcInteractRequest(a,b,c,d) #define FSmcInteractDone(a,b) SmcInteractDone(a,b) #define FSmcRequestSaveYourself(a,b,c,d,e,f) SmcRequestSaveYourself(a,b,c,d,e,f) #define FSmcRequestSaveYourselfPhase2(a,b,c) SmcRequestSaveYourselfPhase2(a,b,c) #define FSmcSaveYourselfDone(a,b) SmcSaveYourselfDone(a,b) #define FSmcProtocolVersion(a) SmcProtocolVersion(a) #define FSmcProtocolRevision(a) SmcProtocolRevision(a) #define FSmcVendor(a) SmcVendor(a) #define FSmcRelease(a) SmcRelease(a) #define FSmcClientID(a) SmcClientID(a) #define FSmcGetIceConnection(a) SmcGetIceConnection(a) #define FSmsInitialize(a,b,c,d,e,f,g) SmsInitialize(a,b,c,d,e,f,g) #define FSmsClientHostName(a) SmsClientHostName(a) #define FSmsGenerateClientID(a) SmsGenerateClientID(a) #define FSmsRegisterClientReply(a,b) SmsRegisterClientReply(a,b) #define FSmsSaveYourself(a,b,c,d,e) SmsSaveYourself(a,b,c,d,e) #define FSmsSaveYourselfPhase2(a) SmsSaveYourselfPhase2(a) #define FSmsInteract(a) SmsInteract(a) #define FSmsDie(a) SmsDie(a) #define FSmsSaveComplete(a) SmsSaveComplete(a) #define FSmsShutdownCancelled(a) SmsShutdownCancelled(a) #define FSmsReturnProperties(a,b,c) SmsReturnProperties(a,b,c) #define FSmsCleanUp(a) SmsCleanUp(a) #define FSmsProtocolVersion(a) SmsProtocolVersion(a) #define FSmsProtocolRevision(a) SmsProtocolRevision(a) #define FSmsClientID(a) SmsClientID(a) #define FSmsGetIceConnection(a) SmsGetIceConnection(a) #define FSmcSetErrorHandler(a) SmcSetErrorHandler(a) #define FSmsSetErrorHandler(a) SmsSetErrorHandler(a) #define FSmFreeProperty(a) SmFreeProperty(a) #define FSmFreeReasons(a,b) SmFreeReasons(a,b) /* ICEutils.h */ #define FIceAuthFileName(a) IceAuthFileName(a) #define FIceLockAuthFile(a,b,c,d) IceLockAuthFile(a,b,c,d) #define FIceUnlockAuthFile(a) IceUnlockAuthFile(a) #define FIceReadAuthFileEntry(a) IceReadAuthFileEntry(a) #define FIceFreeAuthFileEntry(a) IceFreeAuthFileEntry(a) #define FIceWriteAuthFileEntry(a,b) IceWriteAuthFileEntry(a,b) #define FIceGetAuthFileEntry(a,b,c) IceGetAuthFileEntry(a,b,c) #define FIceGenerateMagicCookie(a) IceGenerateMagicCookie(a) #define FIceSetPaAuthData(a,b) IceSetPaAuthData(a,b) #else /* ICElib.h (no all) */ #define FIceSetIOErrorHandler(a) NULL #define FIceFreeListenObjs(a,b) #define FIceConnectionNumber(a) 0 #define FIceSetShutdownNegotiation(a,b) #define FIceCloseConnection(a) 0 #define FIceConnectionStatus(a) 0 #define FIceAcceptConnection(a,b) NULL #define FIceProcessMessages(a,b,c) 0 #define FIceListenForConnections(a,b,c,d) 0 #define FIceAddConnectionWatch(a,b) 0 #define FIceGetListenConnectionNumber(a) 0 #define FIceComposeNetworkIdList(a,b) NULL #define FIceGetListenConnectionString(a) NULL #define FIceSetHostBasedAuthProc(a,b) #define FIceConnectionString(a) NULL /* SMlib.h */ #define FSmcOpenConnection(a,b,c,d,e,f,g,h,i,k) NULL #define FSmcCloseConnection(a,b,c) 0 #define FSmcModifyCallbacks(a,b,c) #define FSmcSetProperties(a,b,c) #define FSmcDeleteProperties(a,b,c) #define FSmcGetProperties(a,b,c) 0 #define FSmcInteractRequest(a,b,c,d) 0 #define FSmcInteractDone(a,b) #define FSmcRequestSaveYourself(a,b,c,d,e,f) #define FSmcRequestSaveYourselfPhase2(a,b,c) 0 #define FSmcSaveYourselfDone(a,b) #define FSmcProtocolVersion(a) 0 #define FSmcProtocolRevision(a) 0 #define FSmcVendor(a) NULL #define FSmcRelease(a) NULL #define FSmcClientID(a) NULL #define FSmcGetIceConnection(a) NULL #define FSmsInitialize(a,b,c,d,e,f,g) 0 #define FSmsClientHostName(a) NULL #define FSmsGenerateClientID(a) NULL #define FSmsRegisterClientReply(a,b) 0 #define FSmsSaveYourself(a,b,c,d,e) #define FSmsSaveYourselfPhase2(a) #define FSmsInteract(a) #define FSmsDie(a) #define FSmsSaveComplete(a) #define FSmsShutdownCancelled(a) #define FSmsReturnProperties(a,b,c) #define FSmsCleanUp(a) #define FSmsProtocolVersion(a) 0 #define FSmsProtocolRevision(a) 0 #define FSmsClientID(a) NULL #define FSmsGetIceConnection(a) NULL #define FSmcSetErrorHandler(a) NULL #define FSmsSetErrorHandler(a) NULL #define FSmFreeProperty(a) #define FSmFreeReasons(a,b) /* ICEutils.h */ #define FIceAuthFileName(a) NULL #define FIceLockAuthFile(a,b,c,d) 0 #define FIceUnlockAuthFile(a) #define FIceReadAuthFileEntry(a) NULL #define FIceFreeAuthFileEntry(a) #define FIceWriteAuthFileEntry(a,b) 0 #define FIceGetAuthFileEntry(a,b,c) NULL #define FIceGenerateMagicCookie(a) NULL #define FIceSetPaAuthData(a,b) #endif #endif /* FSMlib_H */ fvwm-2.6.5.orig/libs/Fft.c0000644000175000017500000003330610556634174013456 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "fvwmlib.h" #include "wild.h" #include "Strings.h" #include "Flocale.h" #include "Fft.h" #include "FlocaleCharset.h" #include "FftInterface.h" #include "FRenderInit.h" #include "PictureBase.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ #define FFT_SET_ROTATED_90_MATRIX(m) \ ((m)->xx = (m)->yy = 0, (m)->xy = 1, (m)->yx = -1) #define FFT_SET_ROTATED_270_MATRIX(m) \ ((m)->xx = (m)->yy = 0, (m)->xy = -1, (m)->yx = 1) #define FFT_SET_ROTATED_180_MATRIX(m) \ ((m)->xx = (m)->yy = -1, (m)->xy = (m)->yx = 0) /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static Display *fftdpy = NULL; static int fftscreen; static int fft_initialized = False; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static void init_fft(Display *dpy) { fftdpy = dpy; fftscreen = DefaultScreen(dpy); fft_initialized = True; } static FftChar16 *FftUtf8ToFftString16(unsigned char *str, int len, int *nl) { FftChar16 *new; int i = 0, j= 0; new = (FftChar16 *)safemalloc((len+1)*sizeof(FftChar16)); while(i < len && str[i] != 0) { if (str[i] <= 0x7f) { new[j] = str[i]; } else if (str[i] <= 0xdf && i+1 < len) { new[j] = ((str[i] & 0x1f) << 6) + (str[i+1] & 0x3f); i++; } else if (i+2 < len) { new[j] = ((str[i] & 0x0f) << 12) + ((str[i+1] & 0x3f) << 6) + (str[i+2] & 0x3f); i += 2; } i++; j++; } *nl = j; return new; } static void FftSetupEncoding( Display *dpy, FftFontType *fftf, char *encoding, char *module) { FlocaleCharset *fc; if (!FftSupport || fftf == NULL) return; fftf->encoding = NULL; fftf->str_encoding = NULL; if (encoding != NULL) { fftf->str_encoding = encoding; } if (FftSupportUseXft2) { if (encoding != NULL) { fftf->encoding = encoding; } else if ((fc = FlocaleCharsetGetDefaultCharset(dpy,NULL)) != NULL && StrEquals(fc->x,FLC_FFT_ENCODING_ISO8859_1)) { fftf->encoding = FLC_FFT_ENCODING_ISO8859_1; } else { fftf->encoding = FLC_FFT_ENCODING_ISO10646_1; } } else if (FftSupport) { int i = 0; FftPatternElt *e; Fft1Font *f; f = (Fft1Font *)fftf->fftfont; while(i < f->pattern->num) { e = &f->pattern->elts[i]; if (StrEquals(e->object, FFT_ENCODING) && e->values->value.u.s != NULL) { fftf->encoding = e->values->value.u.s; return; } i++; } } } static FftFont *FftGetRotatedFont( Display *dpy, FftFont *f, rotation_t rotation) { FftPattern *rotated_pat; FftMatrix r,b; FftMatrix *pm = NULL; FftFont *rf = NULL; if (f == NULL) return NULL; rotated_pat = FftPatternDuplicate(f->pattern); if (rotated_pat == NULL) { return NULL; } if (rotation == ROTATION_90) { FFT_SET_ROTATED_90_MATRIX(&r); } else if (rotation == ROTATION_180) { FFT_SET_ROTATED_180_MATRIX(&r); } else if (rotation == ROTATION_270) { FFT_SET_ROTATED_270_MATRIX(&r); } else { goto bail; } if ((FftPatternGetMatrix( rotated_pat, FFT_MATRIX, 0, &pm) == FftResultMatch) && pm) { /* rotate the matrice */ b.xx = r.xx * pm->xx + r.xy * pm->yx; b.xy = r.xx * pm->xy + r.xy * pm->yy; b.yx = r.yx * pm->xx + r.yy * pm->yx; b.yy = r.yx * pm->xy + r.yy * pm->yy; } else { b.xx = r.xx; b.xy = r.xy; b.yx = r.yx; b.yy = r.yy; } if (FftPatternDel(rotated_pat, FFT_MATRIX)) { /* nothing */ } if (!FftPatternAddMatrix(rotated_pat, FFT_MATRIX, &b)) { goto bail; } rf = FftFontOpenPattern(dpy, rotated_pat); bail: if (!rf && rotated_pat) { FftPatternDestroy(rotated_pat); } return rf; } void FftPDumyFunc(void) { } /* ---------------------------- interface functions ------------------------ */ void FftGetFontHeights( FftFontType *fftf, int *height, int *ascent, int *descent) { /* fft font height may be > fftfont->ascent + fftfont->descent, this * depends on the minspace value */ *height = fftf->fftfont->height; *ascent = fftf->fftfont->ascent; *descent = fftf->fftfont->descent; return; } void FftGetFontWidths( FlocaleFont *flf, int *max_char_width) { FGlyphInfo extents; /* FIXME: max_char_width should not be use in the all fvwm! */ if (FftUtf8Support && FLC_ENCODING_TYPE_IS_UTF_8(flf->fc)) { FftTextExtentsUtf8(fftdpy, flf->fftf.fftfont, (FftChar8*)"W", 1, &extents); } else { FftTextExtents8(fftdpy, flf->fftf.fftfont, (FftChar8*)"W", 1, &extents); } *max_char_width = extents.xOff; return; } FftFontType *FftGetFont(Display *dpy, char *fontname, char *module) { FftFont *fftfont = NULL; FftFontType *fftf = NULL; char *fn = NULL, *str_enc = NULL; FlocaleCharset *fc; FftPattern *src_pat = NULL, *load_pat = NULL; FftMatrix *a = NULL; FftResult result; result = 0; if (!FftSupport || !(FRenderGetExtensionSupported() || 1)) { return NULL; } if (!fontname) { return NULL; } if (!fft_initialized) { init_fft(dpy); } /* Xft2 always load an USC-4 fonts, that we consider as an USC-2 font * (i.e., an ISO106464-1 font) or an ISO8859-1 if the user ask for this * or the locale charset is ISO8859-1. * Xft1 support ISO106464-1, ISO8859-1 and others we load an * ISO8859-1 font by default if the locale charset is ISO8859-1 and * an ISO106464-1 one if this not the case */ if (matchWildcards("*?8859-1*", fontname)) { str_enc = FLC_FFT_ENCODING_ISO8859_1; } else if (matchWildcards("*?10646-1*", fontname)) { str_enc = FLC_FFT_ENCODING_ISO10646_1; } if (!FftSupportUseXft2 && str_enc == NULL) { if ((fc = FlocaleCharsetGetFLCXOMCharset()) != NULL && StrEquals(fc->x,FLC_FFT_ENCODING_ISO8859_1)) { fn = CatString2(fontname,":encoding=ISO8859-1"); } else { fn = CatString2(fontname,":encoding=ISO10646-1"); } } else { fn = fontname; } if ((src_pat = FftNameParse(fn)) == NULL) { goto bail; } if ((load_pat = FftFontMatch(dpy, fftscreen, src_pat, &result)) == NULL) { goto bail; } /* safety check */ if (FftPatternGetMatrix( load_pat, FFT_MATRIX, 0, &a) == FftResultMatch && a) { FftMatrix b; Bool cm = False; if (a->xx < 0) { a->xx = -a->xx; cm = True; } if (a->yx != 0) { a->yx = 0; cm = True; } if (cm) { b.xx = a->xx; b.xy = a->xy; b.yx = a->yx; b.yy = a->yy; if (FftPatternDel(load_pat, FFT_MATRIX)) { /* nothing */ } if (!FftPatternAddMatrix(load_pat, FFT_MATRIX, &b)) { goto bail; } } } /* FIXME: other safety checking ? */ fftfont = FftFontOpenPattern(dpy, load_pat); if (!fftfont) { goto bail; } fftf = (FftFontType *)safemalloc(sizeof(FftFontType)); fftf->fftfont = fftfont; fftf->fftfont_rotated_90 = NULL; fftf->fftfont_rotated_180 = NULL; fftf->fftfont_rotated_270 = NULL; FftSetupEncoding(dpy, fftf, str_enc, module); bail: if (src_pat) { FftPatternDestroy(src_pat); } if (!fftf && load_pat) { FftPatternDestroy(load_pat); } return fftf; } void FftDrawString( Display *dpy, FlocaleFont *flf, FlocaleWinString *fws, Pixel fg, Pixel fgsh, Bool has_fg_pixels, int len, unsigned long flags) { FftDraw *fftdraw = NULL; typedef void (*DrawStringFuncType)( FftDraw *fftdraw, FftColor *fft_fg, FftFont *uf, int xt, int yt, char *str, int len); DrawStringFuncType DrawStringFunc; char *str; Bool free_str = False; XGCValues vr; XColor xfg, xfgsh; FftColor fft_fg, fft_fgsh; FftFontType *fftf; FftFont *uf; int x,y, xt,yt; float alpha_factor; flocale_gstp_args gstp_args; if (!FftSupport) { return; } fftf = &flf->fftf; if (fws->flags.text_rotation == ROTATION_90) /* CW */ { if (fftf->fftfont_rotated_90 == NULL) { fftf->fftfont_rotated_90 = FftGetRotatedFont(dpy, fftf->fftfont, fws->flags.text_rotation); } uf = fftf->fftfont_rotated_90; #ifdef FFT_BUGGY_FREETYPE y = fws->y + FftTextWidth(flf, fws->e_str, len); #else y = fws->y; #endif x = fws->x - FLF_SHADOW_BOTTOM_SIZE(flf); } else if (fws->flags.text_rotation == ROTATION_180) { if (fftf->fftfont_rotated_180 == NULL) { fftf->fftfont_rotated_180 = FftGetRotatedFont(dpy, fftf->fftfont, fws->flags.text_rotation); } uf = fftf->fftfont_rotated_180; y = fws->y; x = fws->x + FftTextWidth(flf, fws->e_str, len); } else if (fws->flags.text_rotation == ROTATION_270) { if (fftf->fftfont_rotated_270 == NULL) { fftf->fftfont_rotated_270 = FftGetRotatedFont(dpy, fftf->fftfont, fws->flags.text_rotation); } uf = fftf->fftfont_rotated_270; #ifdef FFT_BUGGY_FREETYPE y = fws->y; #else y = fws->y + FftTextWidth(flf, fws->e_str, len); #endif x = fws->x - FLF_SHADOW_UPPER_SIZE(flf); } else { uf = fftf->fftfont; y = fws->y; x = fws->x; } if (uf == NULL) return; fftdraw = FftDrawCreate(dpy, (Drawable)fws->win, Pvisual, Pcmap); if (fws->flags.has_clip_region) { if (FftDrawSetClip(fftdraw, fws->clip_region) == False) { /* just to suppress a compiler warning */ } } if (has_fg_pixels) { xfg.pixel = fg; xfgsh.pixel = fgsh; } else if (fws->gc && XGetGCValues(dpy, fws->gc, GCForeground, &vr)) { xfg.pixel = vr.foreground; } else { #if 0 fprintf(stderr, "[fvwmlibs][FftDrawString]: ERROR --" " cannot find color\n"); #endif xfg.pixel = PictureBlackPixel(); } XQueryColor(dpy, Pcmap, &xfg); alpha_factor = ((fws->flags.has_colorset)? ((float)fws->colorset->fg_alpha_percent/100) : 1); /* Render uses premultiplied alpha */ fft_fg.color.red = xfg.red * alpha_factor; fft_fg.color.green = xfg.green * alpha_factor; fft_fg.color.blue = xfg.blue * alpha_factor; fft_fg.color.alpha = 0xffff * alpha_factor; fft_fg.pixel = xfg.pixel; if (flf->shadow_size != 0 && has_fg_pixels) { XQueryColor(dpy, Pcmap, &xfgsh); fft_fgsh.color.red = xfgsh.red * alpha_factor; fft_fgsh.color.green = xfgsh.green * alpha_factor; fft_fgsh.color.blue = xfgsh.blue * alpha_factor; fft_fgsh.color.alpha = 0xffff * alpha_factor; fft_fgsh.pixel = xfgsh.pixel; } xt = x; yt = y; str = fws->e_str; if (FftUtf8Support && FLC_ENCODING_TYPE_IS_UTF_8(flf->fc)) { DrawStringFunc = (DrawStringFuncType)FftPDrawStringUtf8; } else if (FLC_ENCODING_TYPE_IS_UTF_8(flf->fc)) { DrawStringFunc = (DrawStringFuncType)FftPDrawString16; str = (char *)FftUtf8ToFftString16( (unsigned char *)fws->e_str, len, &len); free_str = True; } else if (FLC_ENCODING_TYPE_IS_USC_2(flf->fc)) { DrawStringFunc = (DrawStringFuncType)FftPDrawString16; } else if (FLC_ENCODING_TYPE_IS_USC_4(flf->fc)) { DrawStringFunc = (DrawStringFuncType)FftPDrawString32; } else { DrawStringFunc = (DrawStringFuncType)FftPDrawString8; } FlocaleInitGstpArgs(&gstp_args, flf, fws, x, y); if (flf->shadow_size != 0 && has_fg_pixels) { while (FlocaleGetShadowTextPosition(&xt, &yt, &gstp_args)) { DrawStringFunc( fftdraw, &fft_fgsh, uf, xt, yt, str, len); } } xt = gstp_args.orig_x; yt = gstp_args.orig_y; DrawStringFunc(fftdraw, &fft_fg, uf, xt, yt, str, len); if (free_str && str != NULL) { free(str); } FftDrawDestroy(fftdraw); return; } int FftTextWidth(FlocaleFont *flf, char *str, int len) { FGlyphInfo extents; int result = 0; if (!FftSupport) { return 0; } if (FftUtf8Support && FLC_ENCODING_TYPE_IS_UTF_8(flf->fc)) { FftTextExtentsUtf8( fftdpy, flf->fftf.fftfont, (FftChar8*)str, len, &extents); result = extents.xOff; } else if (FLC_ENCODING_TYPE_IS_UTF_8(flf->fc)) { FftChar16 *new; int nl; new = FftUtf8ToFftString16((unsigned char *)str, len, &nl); if (new != NULL) { FftTextExtents16( fftdpy, flf->fftf.fftfont, new, nl, &extents); result = extents.xOff; free(new); } } else if (FLC_ENCODING_TYPE_IS_USC_2(flf->fc)) { FftTextExtents16( fftdpy, flf->fftf.fftfont, (FftChar16 *)str, len, &extents); result = extents.xOff; } else if (FLC_ENCODING_TYPE_IS_USC_4(flf->fc)) { FftTextExtents32( fftdpy, flf->fftf.fftfont, (FftChar32 *)str, len, &extents); result = extents.xOff; } else { FftTextExtents8( fftdpy, flf->fftf.fftfont, (FftChar8 *)str, len, &extents); result = extents.xOff; } return result; } void FftPrintPatternInfo(FftFont *f, Bool vertical) { /* FftPatternPrint use stdout */ fflush (stderr); printf("\n height: %i, ascent: %i, descent: %i, maw: %i\n", f->height, f->ascent, f->descent, f->max_advance_width); if (!vertical) { printf(" "); FftPatternPrint(f->pattern); } else { FftMatrix *pm = NULL; if (FftPatternGetMatrix( f->pattern, FFT_MATRIX, 0, &pm) == FftResultMatch && pm) { printf(" matrix: (%f %f %f %f)\n", pm->xx, pm->xy, pm->yx, pm->yy); } } fflush (stdout); return; } fvwm-2.6.5.orig/libs/Ficonv.h0000644000175000017500000000250411243033534014147 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ #ifndef FICONV_H #define FICONV_H /* ---------------------------- included header files ---------------------- */ #include "config.h" /* ---------------------------- global definitions ------------------------- */ #ifdef HAVE_ICONV #define FiconvSupport 1 #else #define FiconvSupport 0 #endif #if FiconvSupport #define Ficonv_open(a,b) iconv_open(a,b) #define Ficonv_close(a) iconv_close(a) #define Ficonv(a,b,c,d,e) iconv(a,b,c,d,e) #else #define Ficonv_open(a,b) (Ficonv_t)-1 #define Ficonv_close(a) -1 #define Ficonv(a,b,c,d,e) -1 #endif /* ---------------------------- global macros ------------------------------ */ #define FICONV_CONVERSION_MAX_NUMBER_OF_WARNING 10 /* ---------------------------- type definitions --------------------------- */ typedef void* Ficonv_t; /* ---------------------------- interface functions ------------------------ */ void FiconvSetTransliterateUtf8(int toggle); char *FiconvUtf8ToCharset( Display *dpy, FlocaleCharset *fc, const char *in, unsigned int in_size); char *FiconvCharsetToUtf8( Display *dpy, FlocaleCharset *fc, const char *in, unsigned int in_size); char *FiconvCharsetToCharset( Display *dpy, FlocaleCharset *in_fc, FlocaleCharset *out_fc, const char *in, unsigned int in_size); #endif /* FICONV_H */ fvwm-2.6.5.orig/libs/System.h0000644000175000017500000000123410630367353014216 0ustar vwcvwc#ifndef LIB_SYSTEM_H #define LIB_SYSTEM_H fd_set_size_t GetFdWidth(void); extern fd_set_size_t fvwmlib_max_fd; void fvwmlib_init_max_fd(void); int getostype(char *buf, int max); void setPath(char **p_path, const char *newpath, int free_old_path); char *searchPath( const char *pathlist, const char *filename, const char *suffix, int type); /* An interface for verifying cached files. */ typedef unsigned long FileStamp; FileStamp getFileStamp(const char *name); void setFileStamp(FileStamp *stamp, const char *name); Bool isFileStampChanged(const FileStamp *stamp, const char *name); /* mkstemp */ int fvwm_mkstemp (char *TEMPLATE); #endif /* LIB_SYSTEM_H */ fvwm-2.6.5.orig/libs/BidiJoin.c0000644000175000017500000002150610556634174014425 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Nadim Shaikli (arabeyes.org) */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * FBidiJoin.c * * A place holder for when fribidi finally implements character * shaping/joining. This shaping/joining is a must for a variety of * Bidi'ed languages such as Arabic, Farsi, as well as all the Syriacs * (Urdu, Sindhi, Pashto, Kurdish, Baluchi, Kashmiri, Kazakh, Berber, * Uighur, Kirghiz, etc). */ #include "config.h" #if HAVE_BIDI #include "fvwmlib.h" #include "BidiJoin.h" /* ---------------------------- included header files ---------------------- */ #include /* ---------------------------- local types -------------------------------- */ typedef struct char_shaped { FriBidiChar base; /* The various Arabic shaped permutations */ FriBidiChar isolated; FriBidiChar initial; FriBidiChar medial; FriBidiChar final; } char_shaped_t; typedef struct char_shaped_comb { /* The Arabic exceptions - 2chars ==> 1char */ FriBidiChar first; FriBidiChar second; FriBidiChar comb_isolated; FriBidiChar comb_joined; } char_shaped_comb_t; /* ---------------------------- static variables --------------------------- */ static const char_shaped_t shaped_table[] = { /* base s i m f */ { 0x0621, 0xFE80, 0x0000, 0x0000, 0x0000, }, /* HAMZA */ { 0x0622, 0xFE81, 0x0000, 0x0000, 0xFE82, }, /* ALEF_MADDA */ { 0x0623, 0xFE83, 0x0000, 0x0000, 0xFE84, }, /* ALEF_HAMZA_ABOVE */ { 0x0624, 0xFE85, 0x0000, 0x0000, 0xFE86, }, /* WAW_HAMZA */ { 0x0625, 0xFE87, 0x0000, 0x0000, 0xFE88, }, /* ALEF_HAMZA_BELOW */ { 0x0626, 0xFE89, 0xFE8B, 0xFE8C, 0xFE8A, }, /* YEH_HAMZA */ { 0x0627, 0xFE8D, 0x0000, 0x0000, 0xFE8E, }, /* ALEF */ { 0x0628, 0xFE8F, 0xFE91, 0xFE92, 0xFE90, }, /* BEH */ { 0x0629, 0xFE93, 0x0000, 0x0000, 0xFE94, }, /* TEH_MARBUTA */ { 0x062A, 0xFE95, 0xFE97, 0xFE98, 0xFE96, }, /* TEH */ { 0x062B, 0xFE99, 0xFE9B, 0xFE9C, 0xFE9A, }, /* THEH */ { 0x062C, 0xFE9D, 0xFE9F, 0xFEA0, 0xFE9E, }, /* JEEM */ { 0x062D, 0xFEA1, 0xFEA3, 0xFEA4, 0xFEA2, }, /* HAH */ { 0x062E, 0xFEA5, 0xFEA7, 0xFEA8, 0xFEA6, }, /* KHAH */ { 0x062F, 0xFEA9, 0x0000, 0x0000, 0xFEAA, }, /* DAL */ { 0x0630, 0xFEAB, 0x0000, 0x0000, 0xFEAC, }, /* THAL */ { 0x0631, 0xFEAD, 0x0000, 0x0000, 0xFEAE, }, /* REH */ { 0x0632, 0xFEAF, 0x0000, 0x0000, 0xFEB0, }, /* ZAIN */ { 0x0633, 0xFEB1, 0xFEB3, 0xFEB4, 0xFEB2, }, /* SEEN */ { 0x0634, 0xFEB5, 0xFEB7, 0xFEB8, 0xFEB6, }, /* SHEEN */ { 0x0635, 0xFEB9, 0xFEBB, 0xFEBC, 0xFEBA, }, /* SAD */ { 0x0636, 0xFEBD, 0xFEBF, 0xFEC0, 0xFEBE, }, /* DAD */ { 0x0637, 0xFEC1, 0xFEC3, 0xFEC4, 0xFEC2, }, /* TAH */ { 0x0638, 0xFEC5, 0xFEC7, 0xFEC8, 0xFEC6, }, /* ZAH */ { 0x0639, 0xFEC9, 0xFECB, 0xFECC, 0xFECA, }, /* AIN */ { 0x063A, 0xFECD, 0xFECF, 0xFED0, 0xFECE, }, /* GHAIN */ { 0x0640, 0x0640, 0x0640, 0x0640, 0x0640, }, /* TATWEEL */ { 0x0641, 0xFED1, 0xFED3, 0xFED4, 0xFED2, }, /* FEH */ { 0x0642, 0xFED5, 0xFED7, 0xFED8, 0xFED6, }, /* QAF */ { 0x0643, 0xFED9, 0xFEDB, 0xFEDC, 0xFEDA, }, /* KAF */ { 0x0644, 0xFEDD, 0xFEDF, 0xFEE0, 0xFEDE, }, /* LAM */ { 0x0645, 0xFEE1, 0xFEE3, 0xFEE4, 0xFEE2, }, /* MEEM */ { 0x0646, 0xFEE5, 0xFEE7, 0xFEE8, 0xFEE6, }, /* NOON */ { 0x0647, 0xFEE9, 0xFEEB, 0xFEEC, 0xFEEA, }, /* HEH */ { 0x0648, 0xFEED, 0x0000, 0x0000, 0xFEEE, }, /* WAW */ { 0x0649, 0xFEEF, 0xFBE8, 0xFBE9, 0xFEF0, }, /* ALEF_MAKSURA */ { 0x064A, 0xFEF1, 0xFEF3, 0xFEF4, 0xFEF2, }, /* YEH */ { 0x0671, 0xFB50, 0x0000, 0x0000, 0xFB51, }, { 0x0679, 0xFB66, 0xFB68, 0xFB69, 0xFB67, }, { 0x067A, 0xFB5E, 0xFB60, 0xFB61, 0xFB5F, }, { 0x067B, 0xFB52, 0xFB54, 0xFB55, 0xFB53, }, { 0x067E, 0xFB56, 0xFB58, 0xFB59, 0xFB57, }, { 0x067F, 0xFB62, 0xFB64, 0xFB65, 0xFB63, }, { 0x0680, 0xFB5A, 0xFB5C, 0xFB5D, 0xFB5B, }, { 0x0683, 0xFB76, 0xFB78, 0xFB79, 0xFB77, }, { 0x0684, 0xFB72, 0xFB74, 0xFB75, 0xFB73, }, { 0x0686, 0xFB7A, 0xFB7C, 0xFB7D, 0xFB7B, }, { 0x0687, 0xFB7E, 0xFB80, 0xFB81, 0xFB7F, }, { 0x0688, 0xFB88, 0x0000, 0x0000, 0xFB89, }, { 0x068C, 0xFB84, 0x0000, 0x0000, 0xFB85, }, { 0x068D, 0xFB82, 0x0000, 0x0000, 0xFB83, }, { 0x068E, 0xFB86, 0x0000, 0x0000, 0xFB87, }, { 0x0691, 0xFB8C, 0x0000, 0x0000, 0xFB8D, }, { 0x0698, 0xFB8A, 0x0000, 0x0000, 0xFB8B, }, { 0x06A4, 0xFB6A, 0xFB6C, 0xFB6D, 0xFB6B, }, { 0x06A6, 0xFB6E, 0xFB70, 0xFB71, 0xFB6F, }, { 0x06A9, 0xFB8E, 0xFB90, 0xFB91, 0xFB8F, }, { 0x06AD, 0xFBD3, 0xFBD5, 0xFBD6, 0xFBD4, }, { 0x06AF, 0xFB92, 0xFB94, 0xFB95, 0xFB93, }, { 0x06B1, 0xFB9A, 0xFB9C, 0xFB9D, 0xFB9B, }, { 0x06B3, 0xFB96, 0xFB98, 0xFB99, 0xFB97, }, { 0x06BB, 0xFBA0, 0xFBA2, 0xFBA3, 0xFBA1, }, { 0x06BE, 0xFBAA, 0xFBAC, 0xFBAD, 0xFBAB, }, { 0x06C0, 0xFBA4, 0x0000, 0x0000, 0xFBA5, }, { 0x06C1, 0xFBA6, 0xFBA8, 0xFBA9, 0xFBA7, }, { 0x06C5, 0xFBE0, 0x0000, 0x0000, 0xFBE1, }, { 0x06C6, 0xFBD9, 0x0000, 0x0000, 0xFBDA, }, { 0x06C7, 0xFBD7, 0x0000, 0x0000, 0xFBD8, }, { 0x06C8, 0xFBDB, 0x0000, 0x0000, 0xFBDC, }, { 0x06C9, 0xFBE2, 0x0000, 0x0000, 0xFBE3, }, { 0x06CB, 0xFBDE, 0x0000, 0x0000, 0xFBDF, }, { 0x06CC, 0xFBFC, 0xFBFE, 0xFBFF, 0xFBFD, }, { 0x06D0, 0xFBE4, 0xFBE6, 0xFBE7, 0xFBE5, }, { 0x06D2, 0xFBAE, 0x0000, 0x0000, 0xFBAF, }, { 0x06D3, 0xFBB0, 0x0000, 0x0000, 0xFBB1, }, /* special treatment for ligatures from combining phase */ { 0xFEF5, 0xFEF5, 0x0000, 0x0000, 0xFEF6, }, /* LAM_ALEF_MADDA */ { 0xFEF7, 0xFEF7, 0x0000, 0x0000, 0xFEF8, }, /* LAM_ALEF_HAMZA_ABOVE */ { 0xFEF9, 0xFEF9, 0x0000, 0x0000, 0xFEFA, }, /* LAM_ALEF_HAMZA_BELOW */ { 0xFEFB, 0xFEFB, 0x0000, 0x0000, 0xFEFC, }, /* LAM_ALEF */ }; static const char_shaped_comb_t shaped_comb_table[] = { { 0x0644, 0x0622, 0xFEF5, 0xFEF6, }, /* LAM_ALEF_MADDA */ { 0x0644, 0x0623, 0xFEF7, 0xFEF8, }, /* LAM_ALEF_HAMZA_ABOVE */ { 0x0644, 0x0625, 0xFEF9, 0xFEFA, }, /* LAM_ALEF_HAMZA_BELOW */ { 0x0644, 0x0627, 0xFEFB, 0xFEFC, }, /* LAM_ALEF */ }; /* -------------------------- local functions ------------------------------ */ static const char_shaped_t * get_shaped_entry(FriBidiChar ch) { int count; int table_size; table_size = sizeof(shaped_table) / sizeof(shaped_table[0]); for (count = 0; count < table_size; count++) { if (shaped_table[count].base == ch) { return &shaped_table[count]; } } return NULL; } /* ------------------------- interface functions --------------------------- */ int shape_n_join( FriBidiChar *str_visual, int str_len) { int i; /* counter of the input string */ int len; /* counter and the final length of the shaped string */ FriBidiChar *orig_str; const char_shaped_t **list; const char_shaped_t *prev; const char_shaped_t *curr; const char_shaped_t *next; list = (const char_shaped_t **)safemalloc( (str_len + 2) * sizeof(char_shaped_t *)); orig_str = (FriBidiChar *)safemalloc( (str_len + 1) * sizeof(FriBidiChar)); /* head is NULL */ *list = NULL; list++; /* Populate with existent shaped characters */ for (i = 0; i < str_len; i++) { list[i] = get_shaped_entry(str_visual[i]); } /* tail is NULL */ list[i] = NULL; /* Store-off non-shaped characters; start with a clean slate */ memcpy(orig_str, str_visual, (str_len * sizeof(str_visual[0]))); memset(str_visual, 0, (str_len * sizeof(str_visual[0]))); /* Traverse the line & build new content */ for (i = 0, len = 0; i <= str_len - 1; i++, len++) { /* Get previous, current, and next characters */ prev = list[i + 1]; curr = list[i]; next = list[i - 1]; /* Process current mapped characters */ if (curr) { if (next) { if (prev) { if (!prev->initial || !prev->medial) { str_visual[len] = curr->initial? curr->initial: curr->isolated; } else { str_visual[len] = curr->medial? curr->medial: curr->final; } } else { str_visual[len] = curr->initial? curr->initial: curr->isolated; } } else { if (prev) { if (!prev->initial || !prev->medial) { str_visual[len] = curr->isolated; } else { str_visual[len] = curr->final? curr->final: curr->isolated; } } else { str_visual[len] = curr->isolated; } } } else { str_visual[len] = orig_str[i]; } } free(list-1); free(orig_str); /* return the length of the new string */ return len; } #endif /* HAVE_BIDI */ fvwm-2.6.5.orig/libs/Cursor.c0000644000175000017500000001027710630367353014211 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Modification History */ /* Created on 10/05/01 by Dan Espen (dane): Extracted from fvwm/cursor.c. Contains common routine to verify and convert a cursor name into a cursor number from X11/cursorfont.h. Used by fvwm CursorStyle command and FvwmForm. */ #include "config.h" #include #include "fvwmlib.h" #include #include "Cursor.h" /* * fvwmCursorNameToIndex: return the number of a X11 cursor from its * name, if not found return -1. */ int fvwmCursorNameToIndex (char *cursor_name) { static const struct CursorNameIndex { const char *name; unsigned int number; } cursor_table[] = { {"arrow", XC_arrow}, {"based_arrow_down", XC_based_arrow_down}, {"based_arrow_up", XC_based_arrow_up}, {"boat", XC_boat}, {"bogosity", XC_bogosity}, {"bottom_left_corner", XC_bottom_left_corner}, {"bottom_right_corner", XC_bottom_right_corner}, {"bottom_side", XC_bottom_side}, {"bottom_tee", XC_bottom_tee}, {"box_spiral", XC_box_spiral}, {"center_ptr", XC_center_ptr}, {"circle", XC_circle}, {"clock", XC_clock}, {"coffee_mug", XC_coffee_mug}, {"cross", XC_cross}, {"cross_reverse", XC_cross_reverse}, {"crosshair", XC_crosshair}, {"diamond_cross", XC_diamond_cross}, {"dot", XC_dot}, {"dotbox", XC_dotbox}, {"double_arrow", XC_double_arrow}, {"draft_large", XC_draft_large}, {"draft_small", XC_draft_small}, {"draped_box", XC_draped_box}, {"exchange", XC_exchange}, {"fleur", XC_fleur}, {"gobbler", XC_gobbler}, {"gumby", XC_gumby}, {"hand1", XC_hand1}, {"hand2", XC_hand2}, {"heart", XC_heart}, {"icon", XC_icon}, {"iron_cross", XC_iron_cross}, {"left_ptr", XC_left_ptr}, {"left_side", XC_left_side}, {"left_tee", XC_left_tee}, {"leftbutton", XC_leftbutton}, {"ll_angle", XC_ll_angle}, {"lr_angle", XC_lr_angle}, {"man", XC_man}, {"middlebutton", XC_middlebutton}, {"mouse", XC_mouse}, {"pencil", XC_pencil}, {"pirate", XC_pirate}, {"plus", XC_plus}, {"question_arrow", XC_question_arrow}, {"right_ptr", XC_right_ptr}, {"right_side", XC_right_side}, {"right_tee", XC_right_tee}, {"rightbutton", XC_rightbutton}, {"rtl_logo", XC_rtl_logo}, {"sailboat", XC_sailboat}, {"sb_down_arrow", XC_sb_down_arrow}, {"sb_h_double_arrow", XC_sb_h_double_arrow}, {"sb_left_arrow", XC_sb_left_arrow}, {"sb_right_arrow", XC_sb_right_arrow}, {"sb_up_arrow", XC_sb_up_arrow}, {"sb_v_double_arrow", XC_sb_v_double_arrow}, {"sizing", XC_sizing}, {"spider", XC_spider}, {"spraycan", XC_spraycan}, {"star", XC_star}, {"target", XC_target}, {"tcross", XC_tcross}, {"top_left_arrow", XC_top_left_arrow}, {"top_left_corner", XC_top_left_corner}, {"top_right_corner", XC_top_right_corner}, {"top_side", XC_top_side}, {"top_tee", XC_top_tee}, {"trek", XC_trek}, {"ul_angle", XC_ul_angle}, {"umbrella", XC_umbrella}, {"ur_angle", XC_ur_angle}, {"watch", XC_watch}, {"x_cursor", XC_X_cursor}, {"xterm", XC_xterm}, }; int cond; int down = 0; int up = (sizeof cursor_table / sizeof cursor_table[0]) - 1; int middle; char temp[20]; char *s; if (!cursor_name || cursor_name[0] == 0 || strlen(cursor_name) >= sizeof temp) return -1; strcpy(temp, cursor_name); for (s = temp; *s != 0; s++) if (isupper(*s)) *s = tolower(*s); while (down <= up) { middle= (down + up) / 2; if ((cond = strcmp(temp, cursor_table[middle].name)) < 0) up = middle - 1; else if (cond > 0) down = middle + 1; else return cursor_table[middle].number; } return -1; } fvwm-2.6.5.orig/libs/FEvent.h0000644000175000017500000001246610403373112014116 0ustar vwcvwc/* -*-c-*- */ #ifndef FEVENT_H #define FEVENT_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions (privileged access) ----- */ #ifdef FEVENT_PRIVILEGED_ACCESS void fev_copy_last_event(XEvent *dest); XEvent *fev_get_last_event_address(void); #endif /* ---------------------------- interface functions (normal_access) -------- */ /* get the latest event time */ Time fev_get_evtime(void); /* This function determines the location of the mouse pointer from the event * if possible, if not it queries the X server. Returns False if it had to * query the server and the call failed because the pointer was on a * different screen. */ Bool fev_get_evpos_or_query( Display *dpy, Window w, const XEvent *e, int *ret_x, int *ret_y); /* Sets the x_root/y_root position in the given event if it's of the proper * type. Returns True if the position was set. */ Bool fev_set_evpos(XEvent *e, int x, int y); /* announce a faked event to the FEvent module */ void fev_fake_event(XEvent *ev); /* temporarily store the cached event in allocated memory */ void *fev_save_event(void); /* restore an event saved with fev_save_event and free the memory it uses */ void fev_restore_event(void *ev); /* fill the event structure *ev with a dummy event of no particular type */ void fev_make_null_event(XEvent *ev, Display *dpy); /* return a copy of the last XEVent in *ev */ void fev_get_last_event(XEvent *ev); /* ---------------------------- X event replacements ----------------------- */ /* Replacements for X functions */ XTimeCoord *FGetMotionEvents( Display *display, Window w, Time start, Time stop, int *nevents_return); int FAllowEvents( Display *display, int event_mode, Time time); Bool FCheckIfEvent( Display *display, XEvent *event_return, Bool (*predicate) (Display *display, XEvent *event, XPointer arg), XPointer arg); Bool FCheckMaskEvent( Display *display, long event_mask, XEvent *event_return); Bool FCheckPeekIfEvent( Display *display, XEvent *event_return, Bool (*predicate) (Display *display, XEvent *event, XPointer arg), XPointer arg); Bool FCheckTypedEvent( Display *display, int event_type, XEvent *event_return); Bool FCheckTypedWindowEvent( Display *display, Window w, int event_type, XEvent *event_return); Bool FCheckWindowEvent( Display *display, Window w, long event_mask, XEvent *event_return); int FEventsQueued( Display *display, int mode); int FIfEvent( Display *display, XEvent *event_return, Bool (*predicate) (Display *display, XEvent *event, XPointer arg), XPointer arg); int FMaskEvent( Display *display, long event_mask, XEvent *event_return); int FNextEvent( Display *display, XEvent *event_return); int FPeekEvent( Display *display, XEvent *event_return); int FPeekIfEvent( Display *display, XEvent *event_return, Bool (*predicate) (Display *display, XEvent *event, XPointer arg), XPointer arg); int FPending( Display *display); int FPutBackEvent( Display *display, XEvent *event); int FQLength( Display *display); Bool FQueryPointer( Display *display, Window w, Window *root_return, Window *child_return, int *root_x_return, int *root_y_return, int *win_x_return, int *win_y_return, unsigned int *mask_return); int FSelectInput( Display *display, Window w, long event_mask); Status FSendEvent( Display *display, Window w, Bool propagate, long event_mask, XEvent *event_send); int FWarpPointer( Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); int FWarpPointerUpdateEvpos( XEvent *ev, Display *display, Window src_w, Window dest_w, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y); int FWindowEvent( Display *display, Window w, long event_mask, XEvent *event_return); /* ---------------------------- disable X symbols -------------------------- */ /* FEVENT_C must only be defined in FEvent.c! */ #ifndef FEVENT_C #define XGetMotionEvents(a, b, c, d, e) use_FGetMotionEvents #define XCheckIfEvent(a, b, c, d) use_FCheckIfEvent #define XCheckMaskEvent(a, b, c) use_FCheckMaskEvent #define XCheckTypedEvent(a, b, c) use_FCheckTypedEvent #define XCheckTypedWindowEvent(a, b, c, d) use_FCheckTypedWindowEvent #define XCheckWindowEvent(a, b, c, d) use_FCheckWindowEvent #define XEventsQueued(a, b) use_FEventsQueued #define XIfEvent(a, b, c, d) use_FIfEvent #define XMaskEvent(a, b, c) use_FMaskEvent #define XNextEvent(a, b) use_FNextEvent #define XPeekEvent(a, b) use_FPeekEvent #define XPeekIfEvent(a, b, c, d) use_FPeekIfEvent #define XPending(a) use_FPending #define XPutBackEvent(a, b) use_FPutBackEvent #define XQueryPointer(a, b, c, d, e, f, g, h, i) use_FQueryPointer #define XQLength(a) use_FQLength #define XSendEvent(a, b, c, d, e) use_FSendEvent #define XWarpPointer(a, b, c, d, e, f, g, h, i) use_FWarpPointer #define XWindowEvent(a, b, c, d) use_FWindowEvent #endif #endif /* FEVENT_H */ fvwm-2.6.5.orig/libs/XError.h0000644000175000017500000000070510752147557014164 0ustar vwcvwc#ifndef FERROR_H #define FERROR_H void do_coredump(void); /* not really a wrapper, but useful and X related */ void PrintXErrorAndCoredump(Display *dpy, XErrorEvent *error, char *MyName); typedef int (*ferror_handler_t)(Display *, XErrorEvent *); void ferror_set_temp_error_handler(ferror_handler_t new_handler); void ferror_reset_temp_error_handler(void); int ferror_call_next_error_handler(Display *dpy, XErrorEvent *error); #endif /* FERROR_H */ fvwm-2.6.5.orig/libs/Picture.c0000644000175000017500000001557610656151547014362 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* Changed 02/12/97 by Dan Espen: - added routines to determine color closeness, for color use reduction. Some of the logic comes from pixy2, so the copyright is below. */ /* * Copyright 1996, Romano Giannetti. No guarantees or warantees or anything * are provided or implied in any way whatsoever. Use this program at your * own risk. Permission to use this program for any purpose is given, * as long as the copyright is kept intact. * * Romano Giannetti - Dipartimento di Ingegneria dell'Informazione * via Diotisalvi, 2 PISA * mailto:romano@iet.unipi.it * http://www.iet.unipi.it/~romano * */ /* * * Routines to handle initialization, loading, and removing of xpm's or mono- * icon images. * */ #include "config.h" #include #include #include #include "ftime.h" #include #include #include #include "fvwmlib.h" #include "System.h" #include "Colorset.h" #include "Picture.h" #include "PictureUtils.h" #include "Fsvg.h" static FvwmPicture *FvwmPictureList=NULL; FvwmPicture *PGetFvwmPicture( Display *dpy, Window win, char *ImagePath, const char *name, FvwmPictureAttributes fpa) { char *path = PictureFindImageFile(name, ImagePath, R_OK); FvwmPicture *p; if (path == NULL) { return NULL; } p = PImageLoadFvwmPictureFromFile(dpy, win, path, fpa); if (p == NULL) { free(path); } return p; } void PFreeFvwmPictureData(FvwmPicture *p) { if (!p) { return; } if (p->alloc_pixels != NULL) { free(p->alloc_pixels); } if(p->name!=NULL) { free(p->name); } free(p); return; } FvwmPicture *PCacheFvwmPicture( Display *dpy, Window win, char *ImagePath, const char *name, FvwmPictureAttributes fpa) { char *path; char *real_path; FvwmPicture *p = FvwmPictureList; /* First find the full pathname */ if ((path = PictureFindImageFile(name, ImagePath, R_OK)) == NULL) { return NULL; } /* Remove any svg rendering options from real_path */ if (USE_SVG && *path == ':' && (real_path = strchr(path + 1, ':'))) { real_path++; } else { real_path = path; } /* See if the picture is already cached */ while (p) { register char *p1, *p2; for (p1 = path, p2 = p->name; *p1 && *p2; ++p1, ++p2) { if (*p1 != *p2) { break; } } /* If we have found a picture with the wanted name and stamp */ if (!*p1 && !*p2 && !isFileStampChanged(&p->stamp, real_path) && PICTURE_FPA_AGREE(p,fpa)) { p->count++; /* Put another weight on the picture */ free(path); return p; } p=p->next; } /* Not previously cached, have to load it ourself. Put it first in list */ p = PImageLoadFvwmPictureFromFile(dpy, win, path, fpa); if(p) { p->next=FvwmPictureList; FvwmPictureList=p; } else { free(path); } return p; } void PDestroyFvwmPicture(Display *dpy, FvwmPicture *p) { FvwmPicture *q = FvwmPictureList; if (!p) { return; } /* Remove a weight */ if(--(p->count)>0) { /* still too heavy? */ return; } /* Let it fly */ if (p->alloc_pixels != NULL) { if (p->nalloc_pixels != 0) { PictureFreeColors( dpy, Pcmap, p->alloc_pixels, p->nalloc_pixels, 0, p->no_limit); } free(p->alloc_pixels); } if(p->name!=NULL) { free(p->name); } if(p->picture!=None) { XFreePixmap(dpy,p->picture); } if(p->mask!=None) { XFreePixmap(dpy,p->mask); } if(p->alpha != None) { XFreePixmap(dpy, p->alpha); } /* Link it out of the list (it might not be there) */ if(p==q) /* in head? simple */ { FvwmPictureList = p->next; } else { while(q && q->next!=p) /* fast forward until end or found */ { q = q->next; } if(q) /* not end? means we found it in there, possibly at end */ { q->next = p->next; /* link around it */ } } free(p); return; } FvwmPicture *PLoadFvwmPictureFromPixmap( Display *dpy, Window win, char *name, Pixmap pixmap, Pixmap mask, Pixmap alpha, int width, int height, int nalloc_pixels, Pixel *alloc_pixels, int no_limit) { FvwmPicture *q; q = (FvwmPicture*)safemalloc(sizeof(FvwmPicture)); memset(q, 0, sizeof(FvwmPicture)); q->count = 1; q->name = name; q->next = NULL; q->stamp = pixmap; q->picture = pixmap; q->mask = mask; q->alpha = alpha; q->width = width; q->height = height; q->depth = Pdepth; q->nalloc_pixels = nalloc_pixels; q->alloc_pixels = alloc_pixels; q->no_limit = no_limit; return q; } FvwmPicture *PCacheFvwmPictureFromPixmap( Display *dpy, Window win, char *name, Pixmap pixmap, Pixmap mask, Pixmap alpha, int width, int height, int nalloc_pixels, Pixel *alloc_pixels, int no_limit) { FvwmPicture *p = FvwmPictureList; /* See if the picture is already cached */ for(; p != NULL; p = p->next) { #if 0 /* at th present time no good way to cache a pixmap */ if (!strcmp(p->name,name)) { p->count++; return p; } #endif } /* Not previously cached, have to load. Put it first in list */ p = PLoadFvwmPictureFromPixmap( dpy, win, name, pixmap, mask, alpha, width, height, nalloc_pixels, alloc_pixels, no_limit); if(p) { p->next = FvwmPictureList; FvwmPictureList = p; } return p; } FvwmPicture *PCloneFvwmPicture(FvwmPicture *pic) { if (pic != NULL) { pic->count++; } return pic; } void PicturePrintImageCache(int verbose) { FvwmPicture *p; unsigned int count = 0; unsigned int hits = 0; unsigned int num_alpha = 0; unsigned int num_mask = 0; fflush(stderr); fflush(stdout); fprintf(stderr, "fvwm info on Image cache:\n"); for (p = FvwmPictureList; p != NULL; p = p->next) { int num_pixmaps = 1; if (p->mask != None) { num_mask++; num_pixmaps++; } if (p->alpha != None) { num_alpha++; num_pixmaps++; } if (verbose > 0) { fprintf(stderr, "Image: %s (%d pixmaps; used %d times)\n", p->name, num_pixmaps, p->count); } count++; hits += p->count-1; } fprintf(stderr, "%u images in cache (%d reuses) " "(%u masks, %u alpha channels => %u pixmaps)\n", count, hits, num_mask, num_alpha, count + num_mask + num_alpha); fflush(stderr); } fvwm-2.6.5.orig/libs/lang-strings.h0000644000175000017500000000112707677641664015364 0ustar vwcvwc/* -*-c-*- */ /* * Please translate the strings into the language which you use for * your pop-up menus. * * Some decisions about where a function is prohibited (based on * mwm-function-hints) is based on a string comparison between the * menu item and the strings below. */ #define MOVE_STRING "move" #define RESIZE_STRING1 "size" #define RESIZE_STRING2 "resize" #define MINIMIZE_STRING "minimize" #define MINIMIZE_STRING2 "iconify" #define MAXIMIZE_STRING "maximize" #define CLOSE_STRING1 "close" #define CLOSE_STRING2 "delete" #define CLOSE_STRING3 "destroy" #define CLOSE_STRING4 "quit" fvwm-2.6.5.orig/libs/fvwmsignal.c0000644000175000017500000001406510656151547015114 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * fvwmsignal.c * Written by Chris Rankin, rankinc@zipworld.com.au * */ #include "config.h" #include #include #include #include "fvwmsignal.h" #define true 1 #define false 0 typedef enum { SIG_INIT=0, SIG_DONE } SIG_STATUS; volatile sig_atomic_t isTerminated = false; static volatile sig_atomic_t canJump = false; #ifdef HAVE_SIGSETJMP static sigjmp_buf deadJump; #define SIGSETJMP(env, savesigs) sigsetjmp(env, savesigs) #else static jmp_buf deadJump; #define SIGSETJMP(env, savesigs) setjmp(env) #endif #if defined(HAVE_SIGLONGJMP) && defined(HAVE_SIGSETJMP) #define SIGLONGJMP(env, val) siglongjmp(env, val) #else #define SIGLONGJMP(env, val) longjmp(env, val) #endif /* * Reap child processes, preventing them from becoming zombies. * We do this asynchronously within the SIGCHLD handler so that * "it just happens". */ RETSIGTYPE fvwmReapChildren(int sig) { (void)sig; BSD_BLOCK_SIGNALS; /* * This is a signal handler, AND SO MUST BE REENTRANT! * Now the wait() functions are safe here, but please don't * add anything unless you're SURE that the new functions * (plus EVERYTHING they call) are also reentrant. There * are very few functions which are truly safe. */ #if HAVE_WAITPID while (waitpid(-1, NULL, WNOHANG) > 0) { /* nothing to do here */ } #elif HAVE_WAIT3 while (wait3(NULL, WNOHANG, NULL) > 0) { /* nothing to do here */ } #else # error One of waitpid or wait3 is needed. #endif BSD_UNBLOCK_SIGNALS; SIGNAL_RETURN; } #ifdef USE_BSD_SIGNALS static int term_sigs; /* * fvwmSetSignalMask - store the set of mutually exclusive signals * away for future reference. This prevents different signals from * trying to access the same static data at the same time. * * NOTE: We don't need this if we have POSIX.1 since we can install * a signal mask automatically using sigaction() */ void fvwmSetSignalMask(int sigmask) { term_sigs = sigmask; } /* * fvwmGetSignalMask - get the set of signals that will terminate fvwm * * NOTE: We don't need this if we have POSIX.1 since we can install * a signal mask automatically using sigaction() */ int fvwmGetSignalMask(void) { return term_sigs; } #endif /* * fvwmSetTerminate - set the "end-of-execution" flag. * This function should ONLY be called at the end of a * signal handler. It is an integral part of the mechanism * to stop system calls from blocking once the process is * finished. * * NOTE: This is NOT a signal handler function in its own right! */ void fvwmSetTerminate(int sig) { BSD_BLOCK_SIGNALS; isTerminated = true; if (canJump) { canJump = false; /* * This non-local jump is safe ONLY because we haven't called * any non-reentrant functions in the short period where the * "canJump" variable is true. * * NOTE: No need to restore the signal mask, since siglongjmp * is designed to do that for us. */ SIGLONGJMP(deadJump, SIG_DONE); } BSD_UNBLOCK_SIGNALS; } #ifdef HAVE_SELECT /* * fvwmSelect - wrapper around the select() system call. * This system call may block indefinitely. We don't want * to block at all if the "terminate" flag is set - we * just want it to fail as quickly as possible. */ int fvwmSelect(fd_set_size_t nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) { volatile int iRet = -1; /* This variable MUST NOT be in a register */ #ifdef C_ALLOCA /* If we're using the C version of alloca, see if anything needs to be * freed up. */ alloca(0); #endif /* * Yes, we trash errno here, but you're only supposed to check * errno immediately after a function fails anyway. If we fail, * then it's because we received a signal. If we succeed, we * shouldn't be checking errno. And if somebody calls us expecting * us to preserve errno then that's their bug. * * NOTE: We mustn't call any function that might trash errno * ourselves, except select() itself of course. I believe * that sigsetjmp() does NOT trash errno. */ errno = EINTR; /* * Now initialise the non-local jump. Between here and the end of * the routine (more-or-less) we must NOT call any non-reentrant * functions! This is because we might need to abandon them half * way through execution and return here! */ if ( SIGSETJMP(deadJump, 1) == SIG_INIT ) { /* * Activate the non-local jump. Between now and when we turn the * jump off again, we must NOT call any non-reentrant functions * because we could be interrupted halfway through ... */ canJump = true; /* * If we have already been told to terminate then we will not * execute the select() because the flag will be set. If a * "terminate" signal arrives between testing the flag and * calling select() then we will jump back to the non-local * jump point ... */ if ( !isTerminated ) { /* * The "die" signal will interrupt this system call: * that IS the whole point, after all :-) */ iRet = select(nfds, SELECT_FD_SET_CAST readfds, SELECT_FD_SET_CAST writefds, SELECT_FD_SET_CAST exceptfds, timeout); } /* * The non-local jump is about to go out of scope, * so we must deactivate it. Note that the return- * value from select() will be safely stored in the * local variable before the jump is disabled. */ canJump = false; } return iRet; } #endif /* HAVE_SELECT */ fvwm-2.6.5.orig/libs/FGettext.c0000644000175000017500000001420411622413321014445 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "safemalloc.h" #include "Strings.h" #include "Parse.h" #include "envvar.h" #include "flist.h" #include "FGettext.h" #include "locale.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ #define FGP_DOMAIN(l) ((FGettextPath *)l->object)->domain #define FGP_DIR(l) ((FGettextPath *)l->object)->dir /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef struct { char *domain; char *dir; } FGettextPath; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static int FGettextInitOk = 0; static char *FGDefaultDir = NULL; static char *FGDefaultDomain = NULL; static const char *FGModuleName = NULL; static flist *FGPathList = NULL; static FGettextPath *FGLastPath = NULL; /* ---------------------------- interface functions ------------------------ */ static void fgettext_add_one_path(char *path, int position) { char *dir,*domain; FGettextPath *tmp; if (!HaveNLSSupport) { return; } domain = GetQuotedString(path, &dir, ";", NULL, NULL, NULL); if (!dir || dir[0] == '\0' || dir[0] != '/') { if (dir) { free(dir); } CopyString(&dir, FGDefaultDir); } if (!domain || domain[0] == '\0') { domain = FGDefaultDomain; } tmp = (FGettextPath *)safemalloc(sizeof(FGettextPath)); tmp->dir = dir; CopyString(&tmp->domain, domain); FGPathList = flist_insert_obj(FGPathList, tmp, position); } static void fgettext_free_fgpath_list(void) { flist *l = FGPathList; if (!HaveNLSSupport) { return; } while(l != NULL) { if (l->object) { if (FGP_DOMAIN(l)) { free(FGP_DOMAIN(l)); } if (FGP_DIR(l)) { free(FGP_DIR(l)); } free(l->object); } l = l->next; } FGLastPath = NULL; FGPathList = flist_free_list(FGPathList); } /* ---------------------------- interface functions ------------------------ */ void FGettextInit(const char *domain, const char *dir, const char *module) { char *btd, *td; if (!HaveNLSSupport) { return; } setlocale (LC_MESSAGES, ""); btd = bindtextdomain (domain, dir); td = textdomain (domain); if (!td || !btd) { fprintf( stderr,"[%s][FGettextInit]: <> " "gettext initialisation fail!\n", module); return; } FGModuleName = module; CopyString(&FGDefaultDir, btd); CopyString(&FGDefaultDomain, td); FGLastPath = (FGettextPath *)safemalloc(sizeof(FGettextPath)); CopyString(&FGLastPath->domain, td); CopyString(&FGLastPath->dir, btd); FGPathList = flist_append_obj(FGPathList, FGLastPath); FGettextInitOk = 1; } const char *FGettext(char *str) { flist *l = FGPathList; const char *s; if (!HaveNLSSupport || !FGettextInitOk || FGPathList == NULL || str == NULL) { return str; } if (FGLastPath != l->object) { (void)bindtextdomain (FGP_DOMAIN(l), FGP_DIR(l)); (void)textdomain (FGP_DOMAIN(l)); FGLastPath = l->object; } s = gettext(str); if (s != str) { return s; } l = l->next; while(l != NULL) { (void)bindtextdomain (FGP_DOMAIN(l), FGP_DIR(l)); (void)textdomain (FGP_DOMAIN(l)); FGLastPath = l->object; s = gettext(str); if (s != str) { return s; } l = l->next; } return str; } char *FGettextCopy(char *str) { const char *trans; char *r = NULL; trans = FGettext(str); if (trans != NULL) { CopyString(&r, trans); } return r; } void FGettextSetLocalePath(const char *path) { char *exp_path = NULL; char *before = NULL; char *after, *p, *str; int count; if (!HaveNLSSupport || !FGettextInitOk) { return; } FGLastPath = NULL; if (path == NULL || path[0] == '\0') { fgettext_free_fgpath_list(); FGLastPath = (FGettextPath *)safemalloc(sizeof(FGettextPath)); CopyString(&FGLastPath->domain, FGDefaultDomain); CopyString(&FGLastPath->dir, FGDefaultDir); FGPathList = flist_append_obj(FGPathList, FGLastPath); FGLastPath = NULL; return; } exp_path = envDupExpand(path, 0); if (StrEquals(exp_path,"None")) { fgettext_free_fgpath_list(); goto bail; } after = GetQuotedString(exp_path, &before, "+", NULL, NULL, NULL); if ((after && strchr(after, '+')) || (before && strchr(before, '+'))) { fprintf( stderr,"[%s][SetLocalePath]: " "To many '+' in locale path specification: %s\n", FGModuleName, path); goto bail; } if (!strchr(exp_path, '+')) { fgettext_free_fgpath_list(); } while(after && *after) { after = GetQuotedString(after, &p, ":", NULL, NULL, NULL); if (p && *p) { fgettext_add_one_path(p,-1); } if (p) { free(p); } } count = 0; str = before; while (str && *str) { str = GetQuotedString(str, &p, ":", NULL, NULL, NULL); if (p && *p) { fgettext_add_one_path(p,count); count++; } if (p) { free(p); } } bail: if (before) { free(before); } if (exp_path) { free(exp_path); } } void FGettextPrintLocalePath(int verbose) { flist *l = FGPathList; if (!HaveNLSSupport || !FGettextInitOk) { return; } fprintf(stderr,"fvwm NLS gettext path:\n"); while(l != NULL) { fprintf( stderr," dir: %s, domain: %s\n", FGP_DIR(l), FGP_DOMAIN(l)); l = l->next; } } fvwm-2.6.5.orig/libs/FftInterface.h0000644000175000017500000000104507677641664015313 0ustar vwcvwc/* -*-c-*- */ #ifndef FFT_INTERFACE_H #define FFT_INTERFACE_H void FftGetFontHeights( FftFontType *fftf, int *height, int *ascent, int *descent); void FftGetFontWidths( FlocaleFont *flf, int *max_char_width); FftFontType *FftGetFont(Display *dpy, char *fontname, char *module); void FftDrawString( Display *dpy, FlocaleFont *flf, FlocaleWinString *fws, Pixel fg, Pixel fgsh, Bool has_fg_pixels, int len, unsigned long flags); int FftTextWidth(FlocaleFont *flf, char *str, int len); void FftPrintPatternInfo(FftFont *f, Bool vertical); #endif fvwm-2.6.5.orig/libs/FScreen.c0000644000175000017500000010512211641302505014242 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * FScreen.c * Xinerama abstraction support for window manager. * * This module is all original code * by Dmitry Yu. Bolkhovityanov * Copyright 2001, Dmitry Bolkhovityanov * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* * Brief description of used concept: * * This code is always used by client, regardless of if Xinerama is * available or not (either because -lXinerama was missing or * because Xinerama extension is missing on display). * * If Xinerama is available, this module maintains a list of screens, * from [1] to [num_screens]. screens[0] is always the "global" screen, * so if Xinerama is unavailable or disabled, the module performs * all checks on screens[0] instead of screens[1..num_screens]. * * The client should first call the FScreenInit(), passing * it the opened display descriptor. During this call the list of * Xinerama screens is retrieved and 'dpy' is saved for future * reference. * * If the client wishes to hard-disable Xinerama support (e.g. if * Xinerama extension is present but is broken on display), it should * call FScreenDisable() *before* FScreenInit(). * * Using real Xinerama screens info may be switched on/off "on the * fly" by calling FScreenSetState(0=off/else=on). * * Modules with Xinerama support should listen to the XineramaEnable * and XineramaDisable strings coming over the module pipe as * M_CONFIG_INFO packets and call FScreenEnable() or * FScreenDisable in response. * */ #include "config.h" #include #include #include "defaults.h" #include "fvwmlib.h" #include "Parse.h" #include "FScreen.h" #include "PictureBase.h" #ifdef HAVE_XINERAMA # undef FSCREEN_NEED_SCREENINFO # define FScreenHaveXinerama 1 # ifdef HAVE_SOLARIS_XINERAMA # define FScreenHaveSolarisXinerama 1 # ifdef HAVE_SOLARIS_XINERAMA_H # include # else # define FSCREEN_NEED_SOLARIS_PROTOTYPES # endif # define FSCREEN_NEED_SCREENINFO # else # define FScreenHaveSolarisXinerama 0 # include # endif #else # define FSCREEN_NEED_SCREENINFO # define FScreenHaveXinerama 0 # define FScreenHaveSolarisXinerama 0 #endif #ifdef FSCREEN_NEED_SCREENINFO typedef struct { int screen_number; short x_org; short y_org; unsigned short width; unsigned short height; } XineramaScreenInfo; #endif #ifdef FSCREEN_NEED_SOLARIS_PROTOTYPES /* Copied from Solaris 9's X11/extensions/xinerama.h */ Bool XineramaGetState(Display*, int); Status XineramaGetInfo(Display*, int, XRectangle*, unsigned char*, int*); Status XineramaGetCenterHint(Display*, int, int*, int*); #endif #if FScreenHaveSolarisXinerama == 0 #define XineramaGetInfo(a,b,c,d,e) 0 #endif #if FScreenHaveXinerama # if FScreenHaveSolarisXinerama # define XineramaQueryExtension(d,b,c) 1 /* Lie, for now */ # define XineramaIsActive(d) XineramaGetState((d),0) # define XineramaQueryScreens(d,s) (*(s)) = 0, NULL # endif #else # define XineramaQueryExtension(da, b, c) 0 # define XineramaIsActive(a) 0 # define XineramaQueryScreens(d,s) (*(s)) = 0, NULL #endif #ifndef MAXFRAMEBUFFERS #define MAXFRAMEBUFFERS 16 #endif #ifdef USE_XINERAMA_EMULATION #define FScreenXineramaEmulation 1 #else #define FScreenXineramaEmulation 0 #endif #if 0 #ifdef HAVE_RANDR #include #include #endif #endif enum { /* Replace with FSCREEN_GLOBAL to restore default behaviour */ DEFAULT_GEOMETRY_SCREEN = FSCREEN_PRIMARY }; /* In fact, only corners matter -- there will never be GRAV_NONE */ enum {GRAV_POS = 0, GRAV_NONE = 1, GRAV_NEG = 2}; static int grav_matrix[3][3] = { { NorthWestGravity, NorthGravity, NorthEastGravity }, { WestGravity, CenterGravity, EastGravity }, { SouthWestGravity, SouthGravity, SouthEastGravity } }; #define DEFAULT_GRAVITY NorthWestGravity static Display *disp = NULL; static Bool is_xinerama_enabled = DEFAULT_XINERAMA_ENABLED; static Bool is_sls_enabled = False; static Bool have_sls_screen_list = False; static XineramaScreenInfo *screens; static XineramaScreenInfo *screens_xi; static XineramaScreenInfo *screens_sls = NULL; /* # of Xinerama screens, *not* counting the global, 0 if disabled */ static int num_screens = 0; /* # of Xinerama screens, *not* counting the global */ static int total_screens = 0; static int total_screens_xi = 0; static int total_screens_sls = 1; static int total_sls_width = 1; static int total_sls_height = 1; static int first_to_check = 0; static int last_to_check = 0; static int default_geometry_scr = FSCREEN_PRIMARY; /* only to be accessed vie the set/get functions! */ static int primary_scr = DEFAULT_PRIMARY_SCREEN; #if 0 #ifdef HAVE_RANDR static Bool randr_disabled = 0; static Bool randr_active = 0; static int randr_event_base = -1; static int randr_error_base = -1; #endif #endif static Window blank_w, vert_w, blank2_w, blank3_w; static int FScreenParseScreenBit(char *arg, char default_screen); static int FindScreenOfXY(int x, int y); static XineramaScreenInfo * solaris_XineramaQueryScreens(Display *d, int *nscreens) { if (FScreenHaveSolarisXinerama) { XineramaScreenInfo *screens = NULL; XRectangle monitors[MAXFRAMEBUFFERS]; unsigned char hints[16]; int result; /* dummy instructions to keep -Wall happy */ hints[0] = hints[0]; result = XineramaGetInfo( d, DefaultScreen(d), monitors, hints, nscreens); if (result) { int m; /* Note, malloced area later freed by XFree() */ screens = (XineramaScreenInfo *)malloc( sizeof(XineramaScreenInfo) * (*nscreens)); for (m = 0; m < *nscreens; ++m) { screens[m].screen_number = m; screens[m].x_org = monitors[m].x; screens[m].y_org = monitors[m].y; screens[m].width = monitors[m].width; screens[m].height = monitors[m].height; } } else { fprintf( stderr, "Error getting Xinerama information\n"); *nscreens = 0; } return screens; } else { return NULL; } } static XineramaScreenInfo *FXineramaQueryScreens(Display *d, int *nscreens) { if (FScreenHaveXinerama == 0) { *nscreens = 0; return NULL; } if (FScreenHaveSolarisXinerama == 1) { return solaris_XineramaQueryScreens(d, nscreens); } else { return XineramaQueryScreens(d, nscreens); } } static void GetMouseXY(XEvent *eventp, int *x, int *y) { if (!is_xinerama_enabled || last_to_check == first_to_check) { /* We use .x_org,.y_org because nothing prevents a screen to be * not at (0,0) */ *x = screens[first_to_check].x_org; *y = screens[first_to_check].y_org; } else { XEvent e; if (eventp == NULL) { eventp = &e; e.type = 0; } fev_get_evpos_or_query( disp, DefaultRootWindow(disp), eventp, x, y); } return; } Bool FScreenIsEnabled(void) { return (!is_xinerama_enabled || num_screens == 0) ? False : True; } Bool FScreenIsSLSEnabled(void) { return is_sls_enabled; } static void FScreenUpdateEmulationMapState(void) { static Bool is_mapped = False; if (!FScreenXineramaEmulation) { return; } if (is_xinerama_enabled && !is_sls_enabled) { if (!is_mapped) { XMapRaised(disp, blank_w); XMapRaised(disp, blank2_w); XMapRaised(disp, blank3_w); XMapRaised(disp, vert_w); is_mapped = True; } } else { if (is_mapped) { XUnmapWindow(disp, blank_w); XUnmapWindow(disp, blank2_w); XUnmapWindow(disp, blank3_w); XUnmapWindow(disp, vert_w); is_mapped = False; } } } static void FScreenSetState(Bool do_enable) { is_xinerama_enabled = do_enable; if (do_enable && total_screens > 0) { num_screens = total_screens; first_to_check = 1; last_to_check = total_screens; } else { num_screens = 0; first_to_check = 0; last_to_check = 0; } FScreenUpdateEmulationMapState(); } void FScreenInit(Display *dpy) { static Bool is_initialised = False; int dummy_rc; if (is_initialised) { return; } dummy_rc = 0; is_initialised = True; disp = dpy; if (FScreenXineramaEmulation) { int count; int w; int h; int ws; unsigned long scr; Window root; XSetWindowAttributes attributes; scr = DefaultScreen(disp); root = RootWindow(disp, scr); /* xinerama emulation simulates xinerama on a single screen: * * actual screen * +---------------------+--------------+ * | | | * | | | * | | | * | | simulated | * | | screen 2 | * | simulated screen 1 | | * | | | * | | | * | | | * | | | * +---------------------+ | * | blank area | | * | | | * +---------------------+--------------+ */ count = 2; total_screens_xi = count; screens_xi = (XineramaScreenInfo *) safemalloc(sizeof(XineramaScreenInfo) * (1 + count)); /* calculate the faked sub screen dimensions */ w = DisplayWidth(disp, scr); ws = 3 * w / 5; h = DisplayHeight(disp, scr); screens_xi[1].screen_number = 0; screens_xi[1].x_org = 0; screens_xi[1].y_org = h / 16; screens_xi[1].width = ws; screens_xi[1].height = 7 * h / 8; screens_xi[2].screen_number = 1; screens_xi[2].x_org = ws; screens_xi[2].y_org = 0; screens_xi[2].width = w - ws; screens_xi[2].height = 7 * h / 8; /* add delimiter */ attributes.background_pixel = PictureWhitePixel(); attributes.override_redirect = True; blank_w = XCreateWindow( disp, root, 0, screens_xi[1].y_org - 1, screens_xi[1].width, 2, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWBackPixel|CWOverrideRedirect, &attributes); blank2_w = XCreateWindow( disp, root, 0, screens_xi[1].y_org + screens_xi[1].height - 1, screens_xi[1].width, 2, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWBackPixel|CWOverrideRedirect, &attributes); blank3_w = XCreateWindow( disp, root, screens_xi[2].x_org, screens_xi[2].height - 1, w - screens_xi[2].x_org, 2, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWBackPixel|CWOverrideRedirect, &attributes); vert_w = XCreateWindow( disp, root, screens_xi[2].x_org - 1, 0, 2, h, 0, CopyFromParent, CopyFromParent, CopyFromParent, CWBackPixel|CWOverrideRedirect, &attributes); } else if (FScreenHaveXinerama && XineramaQueryExtension(disp, &dummy_rc, &dummy_rc) && XineramaIsActive(disp)) { int count; XineramaScreenInfo *info; info = FXineramaQueryScreens(disp, &count); total_screens_xi = count; screens_xi = (XineramaScreenInfo *) safemalloc(sizeof(XineramaScreenInfo) * (1 + count)); memcpy(screens_xi + 1, info, sizeof(XineramaScreenInfo) * count); XFree(info); } else { total_screens_xi = 0; screens_xi = (XineramaScreenInfo *)safemalloc( sizeof(XineramaScreenInfo)*1); } total_screens = total_screens_xi; screens = screens_xi; /* Now, fill screens[0] with global screen parameters */ screens_xi[0].screen_number = -1; screens_xi[0].x_org = 0; screens_xi[0].y_org = 0; screens_xi[0].width = DisplayWidth (disp, DefaultScreen(disp)); screens_xi[0].height = DisplayHeight(disp, DefaultScreen(disp)); /* Fill in the screen range */ FScreenSetState(is_xinerama_enabled); return; } void FScreenOnOff(Bool do_enable) { FScreenSetState(do_enable); } void FScreenSLSOnOff(Bool do_enable) { is_sls_enabled = do_enable; if (do_enable) { total_screens = total_screens_sls; if (!screens_sls) { /* Sls not configured yet, use whole screen by default */ FScreenConfigureSLSSize(1, 1); } screens = screens_sls; } else { total_screens = total_screens_xi; screens = screens_xi; } FScreenSetState(is_xinerama_enabled); } Bool FScreenConfigureSLSSize(int width, int height) { unsigned long scr = DefaultScreen(disp); int w = DisplayWidth(disp, scr); int h = DisplayHeight(disp, scr); if (width <= 1) { width = 1; } else if (width > w) { width = w; } if (height <= 1) { height = 1; } else if (height > h) { height = h; } if (total_sls_width == width && total_sls_height == height && screens_sls) { return False; } if (screens_sls) { free(screens_sls); screens_sls = NULL; } /* calculate the screens */ { int row, col, sn; int ws; int hs; total_screens_sls = width * height; total_sls_width = width; total_sls_height = height; ws = w / total_sls_width; hs = h / total_sls_height; screens_sls = (XineramaScreenInfo *) safemalloc(sizeof(XineramaScreenInfo) * (1 + total_screens_sls)); /* calculate the faked sub screen dimensions */ screens_sls[0] = screens_xi[0]; sn = 1; for (row = 0; row < total_sls_height; row++) { for (col = 0; col < total_sls_width; col++, sn++) { screens_sls[sn].screen_number = sn - 1; screens_sls[sn].x_org = col * ws; screens_sls[sn].y_org = row * hs; screens_sls[sn].width = ws; screens_sls[sn].height = hs; } } } have_sls_screen_list = False; FScreenSLSOnOff(is_sls_enabled); return True; } Bool FScreenConfigureSLSScreens(int nscreens, char *args) { int sn; char *next; if (nscreens == 0 || args == NULL) { return FScreenConfigureSLSSize(1, 1); } if (nscreens == 1 && screens_sls) { return False; } if (screens_sls) { free(screens_sls); screens_sls = NULL; } screens_sls = (XineramaScreenInfo *) safemalloc(sizeof(XineramaScreenInfo) * (nscreens + 1)); screens_sls[0] = screens_xi[0]; for (sn = 1; sn <= nscreens; sn++, args = next) { char *token; int val[4]; /* read next screen spec */ token = PeekToken(args, &next); if (!token) { break; } if (XParseGeometry(token, &val[0], &val[1], (unsigned int *)&val[2], (unsigned int *)&val[3]) == (XValue|YValue|WidthValue|HeightValue) || GetIntegerArguments(args, &next, val, 4) == 4) { if (val[0] < 0 || val[1] < 0 || val[2] < 1 || val[3] < 1) { /* illegal spec */ break; } screens_sls[sn].screen_number = sn - 1; screens_sls[sn].x_org = val[0]; screens_sls[sn].y_org = val[1]; screens_sls[sn].width = val[2]; screens_sls[sn].height = val[3]; } else { /* illegal spec */ break; } } total_screens_sls = sn - 1; have_sls_screen_list = True; FScreenSLSOnOff(is_sls_enabled); return True; } #if 0 void FScreenDisableRandR(void) { if (disp != NULL) { fprintf(stderr, "FScreen: WARNING: FScreenDisableRandR()" " called after FScreenInit()!\n"); } randr_disabled = 1; return; } #endif static int FScreenGetPrimaryScreen(XEvent *ev) { if (!is_xinerama_enabled) { return 0; } if (primary_scr == FSCREEN_GLOBAL) { return 0; } else if (primary_scr == FSCREEN_CURRENT) { int mx; int my; /* use current screen as primary screen */ GetMouseXY(ev, &mx, &my); return FindScreenOfXY(mx, my); } else if (primary_scr < 0 || primary_scr >= last_to_check) { /* out of range */ return 0; } return primary_scr + 1; } void FScreenSetPrimaryScreen(int scr) { primary_scr = scr; } /* Intended to be called by modules. Simply pass in the parameter from the * config string sent by fvwm. */ void FScreenConfigureModule(char *args) { int val[6]; int n; char *next; n = GetIntegerArguments(args, &next, val, 4); if (n != 4) { /* ignore broken line */ return; } FScreenSetPrimaryScreen(val[1]); if (val[3]) { /* SLS screen coordinates follow */ n = GetIntegerArguments(next, &next, val + 4, 1); if (n != 1) { /* ignore broken line */ return; } FScreenConfigureSLSScreens(val[4], next); } else { /* simple SLS line */ n = GetIntegerArguments(next, NULL, val + 4, 2); if (n != 2) { /* ignore broken line */ return; } FScreenConfigureSLSSize(val[4], val[5]); } FScreenSLSOnOff(val[2]); FScreenOnOff(val[0]); return; } /* Here's the function used by fvwm to generate the string which * FScreenConfigureModule expects to receive back as its argument. */ const char *FScreenGetConfiguration(void) { int i; int l; int l2; static char msg[MAX_MODULE_INPUT_TEXT_LEN]; char buf[64]; sprintf( msg, XINERAMA_CONFIG_STRING" %d %d %d %d", FScreenIsEnabled(), primary_scr, FScreenIsSLSEnabled(), have_sls_screen_list); l = strlen(msg); if (have_sls_screen_list) { sprintf(msg + l, " %d", total_screens_sls); for (i = 0; i < total_screens_sls; i++) { sprintf(buf, " %d %d %d %d", screens_sls[i].x_org, screens_sls[i].y_org, screens_sls[i].width, screens_sls[i].height); l2 = strlen(buf); if (l + l2 > MAX_MODULE_INPUT_TEXT_LEN) { break; } strcat(msg + l, buf); l += l2; } } else { sprintf(msg + l, " %d %d", total_sls_width, total_sls_height); } return msg; } /* Sets the default screen for ...ParseGeometry if no screen spec is given. * Usually this is FSCREEN_SPEC_PRIMARY, but this won't allow modules to appear * under the pointer. */ void FScreenSetDefaultModuleScreen(char *scr_spec) { default_geometry_scr = FScreenParseScreenBit(scr_spec, FSCREEN_SPEC_PRIMARY); return; } static int FindScreenOfXY(int x, int y) { int i; x = x % screens_xi[0].width; while (x < 0) { x += screens_xi[0].width; } y = y % screens_xi[0].height; while (y < 0) { y += screens_xi[0].height; } for (i = first_to_check; i <= last_to_check; i++) { if (x >= screens[i].x_org && x < screens[i].x_org + screens[i].width && y >= screens[i].y_org && y < screens[i].y_org + screens[i].height) { return i; } } /* Ouch! A "black hole" coords? As for now, return global screen */ return 0; } static int FindScreen( fscreen_scr_arg *arg, fscreen_scr_t screen) { fscreen_scr_arg tmp; if (num_screens == 0) { screen = FSCREEN_GLOBAL; } switch (screen) { case FSCREEN_GLOBAL: screen = 0; break; case FSCREEN_PRIMARY: screen = FScreenGetPrimaryScreen( (arg && arg->mouse_ev) ? arg->mouse_ev : NULL); break; case FSCREEN_CURRENT: /* translate to xypos format */ if (!arg) { tmp.mouse_ev = NULL; arg = &tmp; } GetMouseXY(arg->mouse_ev, &arg->xypos.x, &arg->xypos.y); /* fall through */ case FSCREEN_XYPOS: /* translate to screen number */ if (!arg) { tmp.xypos.x = 0; tmp.xypos.y = 0; arg = &tmp; } screen = FindScreenOfXY(arg->xypos.x, arg->xypos.y); break; default: /* screen is given counting from 0; translate to counting from * 1 */ screen++; break; } return screen; } /* Given pointer coordinates, return the screen the pointer is on. * * Perhaps most useful with $[pointer.screen] */ int FScreenOfPointerXY(int x, int y) { int pscreen; pscreen = FindScreenOfXY(x, y); return (pscreen > 0) ? --pscreen : pscreen; } /* Returns the specified screens geometry rectangle. screen can be a screen * number or any of the values FSCREEN_GLOBAL, FSCREEN_CURRENT, * FSCREEN_PRIMARY or FSCREEN_XYPOS. The arg union only has a meaning for * FSCREEN_CURRENT and FSCREEN_XYARG. For FSCREEN_CURRENT its mouse_ev member * may be given. It is tried to find out the pointer position from the event * first before querying the pointer. For FSCREEN_XYPOS the xpos member is used * to fetch the x/y position of the point on the screen. If arg is NULL, the * position 0 0 is assumed instead. * * Any of the arguments arg, x, y, w and h may be NULL. * * FSCREEN_GLOBAL: return the global screen dimensions * FSCREEN_CURRENT: return dimensions of the screen with the pointer * FSCREEN_PRIMARY: return the primary screen dimensions * FSCREEN_XYPOS: return dimensions of the screen with the given coordinates * * The function returns False if the global screen was returned and more than * one screen is configured. Otherwise it returns True. */ Bool FScreenGetScrRect( fscreen_scr_arg *arg, fscreen_scr_t screen, int *x, int *y, int *w, int *h) { screen = FindScreen(arg, screen); if (screen < first_to_check || screen > last_to_check) { screen = 0; } if (x) { *x = screens[screen].x_org; } if (y) { *y = screens[screen].y_org; } if (w) { *w = screens[screen].width; } if (h) { *h = screens[screen].height; } return !(screen == 0 && num_screens > 1); } /* returns the screen id */ Bool FScreenGetScrId( fscreen_scr_arg *arg, fscreen_scr_t screen) { screen = FindScreen(arg, screen); if (screen < 0) { screen = FSCREEN_GLOBAL; } return screen; } /* Translates the coodinates *x *y from the screen specified by arg_src and * screen_src to coordinates on the screen specified by arg_dest and * screen_dest. (see FScreenGetScrRect for more details). */ void FScreenTranslateCoordinates( fscreen_scr_arg *arg_src, fscreen_scr_t screen_src, fscreen_scr_arg *arg_dest, fscreen_scr_t screen_dest, int *x, int *y) { int x_src; int y_src; int x_dest; int y_dest; FScreenGetScrRect(arg_src, screen_src, &x_src, &y_src, NULL, NULL); FScreenGetScrRect(arg_dest, screen_dest, &x_dest, &y_dest, NULL, NULL); if (x) { *x = *x + x_src - x_dest; } if (y) { *y = *y + y_src - y_dest; } return; } /* Arguments work exactly like for FScreenGetScrRect() */ int FScreenClipToScreen( fscreen_scr_arg *arg, fscreen_scr_t screen, int *x, int *y, int w, int h) { int sx; int sy; int sw; int sh; int lx = (x) ? *x : 0; int ly = (y) ? *y : 0; int x_grav = GRAV_POS; int y_grav = GRAV_POS; FScreenGetScrRect(arg, screen, &sx, &sy, &sw, &sh); if (lx + w > sx + sw) { lx = sx + sw - w; x_grav = GRAV_NEG; } if (ly + h > sy + sh) { ly = sy + sh - h; y_grav = GRAV_NEG; } if (lx < sx) { lx = sx; x_grav = GRAV_POS; } if (ly < sy) { ly = sy; y_grav = GRAV_POS; } if (x) { *x = lx; } if (y) { *y = ly; } return grav_matrix[y_grav][x_grav]; } /* Arguments work exactly like for FScreenGetScrRect() */ void FScreenCenterOnScreen( fscreen_scr_arg *arg, fscreen_scr_t screen, int *x, int *y, int w, int h) { int sx; int sy; int sw; int sh; int lx; int ly; FScreenGetScrRect(arg, screen, &sx, &sy, &sw, &sh); lx = (sw - w) / 2; ly = (sh - h) / 2; if (lx < 0) lx = 0; if (ly < 0) ly = 0; lx += sx; ly += sy; if (x) { *x = lx; } if (y) { *y = ly; } return; } void FScreenGetResistanceRect( int wx, int wy, unsigned int ww, unsigned int wh, int *x0, int *y0, int *x1, int *y1) { fscreen_scr_arg arg; arg.xypos.x = wx + ww / 2; arg.xypos.y = wy + wh / 2; FScreenGetScrRect(&arg, FSCREEN_XYPOS, x0, y0, x1, y1); *x1 += *x0; *y1 += *y0; return; } /* Arguments work exactly like for FScreenGetScrRect() */ Bool FScreenIsRectangleOnScreen( fscreen_scr_arg *arg, fscreen_scr_t screen, rectangle *rec) { int sx; int sy; int sw; int sh; FScreenGetScrRect(arg, screen, &sx, &sy, &sw, &sh); return (rec->x + rec->width > sx && rec->x < sx + sw && rec->y + rec->height > sy && rec->y < sy + sh) ? True : False; } void FScreenSpecToString(char *dest, int space, fscreen_scr_t screen) { char s[32]; if (space <= 0) { return; } switch (screen) { case FSCREEN_GLOBAL: strcpy(s, "global screen"); break; case FSCREEN_CURRENT: strcpy(s, "current screen"); break; case FSCREEN_PRIMARY: strcpy(s, "primary screen"); break; case FSCREEN_XYPOS: strcpy(s, "screen specified by xy"); break; default: sprintf(s, "%d", screen); break; } strncpy(dest, s, space); dest[space - 1] = 0; return; } static int FScreenParseScreenBit(char *scr_spec, char default_screen) { int scr = default_geometry_scr; char c; c = (scr_spec) ? tolower(*scr_spec) : tolower(default_screen); if (c == FSCREEN_SPEC_GLOBAL) { scr = FSCREEN_GLOBAL; } else if (c == FSCREEN_SPEC_CURRENT) { scr = FSCREEN_CURRENT; } else if (c == FSCREEN_SPEC_PRIMARY) { scr = FSCREEN_PRIMARY; } else if (c == FSCREEN_SPEC_WINDOW) { scr = FSCREEN_XYPOS; } else if (isdigit(c)) { scr = atoi(scr_spec); } else { c = tolower(default_screen); if (c == FSCREEN_SPEC_GLOBAL) { scr = FSCREEN_GLOBAL; } else if (c == FSCREEN_SPEC_CURRENT) { scr = FSCREEN_CURRENT; } else if (c == FSCREEN_SPEC_PRIMARY) { scr = FSCREEN_PRIMARY; } else if (c == FSCREEN_SPEC_WINDOW) { scr = FSCREEN_XYPOS; } else if (isdigit(c)) { scr = atoi(scr_spec); } } return scr; } int FScreenGetScreenArgument(char *scr_spec, fscreen_scr_spec_t default_screen) { while (scr_spec && isspace(*scr_spec)) { scr_spec++; } return FScreenParseScreenBit(scr_spec, default_screen); } /* * FScreenParseGeometry * Does the same as XParseGeometry, but handles additional "@scr". * Since it isn't safe to define "ScreenValue" constant (actual values * of other "XXXValue" are specified in Xutil.h, not by us, so there can * be a clash), the screen value is always returned, even if it wasn't * present in `parse_string' (set to default in that case). * */ int FScreenParseGeometryWithScreen( char *parsestring, int *x_return, int *y_return, unsigned int *width_return, unsigned int *height_return, int *screen_return) { int ret; char *copy, *scr_p; int s_size; int scr; /* Safety net */ if (parsestring == NULL || *parsestring == '\0') { return 0; } /* Make a local copy devoid of "@scr" */ s_size = strlen(parsestring) + 1; copy = safemalloc(s_size); memcpy(copy, parsestring, s_size); scr_p = strchr(copy, '@'); if (scr_p != NULL) { *scr_p++ = '\0'; } /* Do the parsing */ ret = XParseGeometry( copy, x_return, y_return, width_return, height_return); /* Parse the "@scr", if any */ scr = FScreenParseScreenBit(scr_p, FSCREEN_SPEC_PRIMARY); *screen_return = scr; /* We don't need the string any more */ free(copy); return ret; } /* Same as above, but dump screen return value to keep compatible with the X * function. */ int FScreenParseGeometry( char *parsestring, int *x_return, int *y_return, unsigned int *width_return, unsigned int *height_return) { int scr; int rc; int mx; int my; rc = FScreenParseGeometryWithScreen( parsestring, x_return, y_return, width_return, height_return, &scr); if (rc == 0) { return 0; } switch (scr) { case FSCREEN_GLOBAL: scr = 0; break; case FSCREEN_CURRENT: GetMouseXY(NULL, &mx, &my); scr = FindScreenOfXY(mx, my); break; case FSCREEN_PRIMARY: scr = FScreenGetPrimaryScreen(NULL); break; default: scr++; break; } if (scr <= 0 || scr > last_to_check) { scr = 0; } else { /* adapt geometry to selected screen */ if (rc & XValue) { if (rc & XNegative) { *x_return -= (screens[0].width - screens[scr].width - screens[scr].x_org); } else { *x_return += screens[scr].x_org; } } if (rc & YValue) { if (rc & YNegative) { *y_return -= (screens[0].height - screens[scr].height - screens[scr].y_org); } else { *y_return += screens[scr].y_org; } } } return rc; } /* FScreenGetGeometry * Parses the geometry in a form: XGeometry[@screen], i.e. * [=][{xX}][{+-}{+-}][@] * where is either a number or "G" (global) "C" (current) * or "P" (primary) * * Args: * parsestring, x_r, y_r, w_r, h_r the same as in XParseGeometry * hints window hints structure, may be NULL * flags bitmask of allowed flags (XValue, WidthValue, XNegative...) * * Note1: * hints->width and hints->height will be used to calc negative geometry * if width/height isn't specified in the geometry itself. * * Note2: * This function's behaviour is crafted to sutisfy/emulate the * FvwmWinList::MakeMeWindow()'s behaviour. * * Note3: * A special value of `flags' when [XY]Value are there but [XY]Negative * aren't, means that in case of negative geometry specification * x_r/y_r values will be promoted to the screen border, but w/h * wouldn't be subtracted, so that the program can do x-=w later * ([XY]Negative *will* be returned, albeit absent in `flags'). * This option is supposed for proggies like FvwmButtons, which * receive geometry specification long before they are able to actually * use it (and which calculate w/h themselves). * (The same effect can't be obtained with omitting {Width,Height}Value * in the flags, since the app may wish to get the dimensions but apply * some constraints later (as FvwmButtons do, BTW...).) * This option can be also useful in cases where dimensions are * specified not in pixels but in some other units (e.g., charcells). */ int FScreenGetGeometry( char *parsestring, int *x_return, int *y_return, int *width_return, int *height_return, XSizeHints *hints, int flags) { int ret; int saved; int x, y; unsigned int w = 0, h = 0; int grav, x_grav, y_grav; int scr = default_geometry_scr; int scr_x, scr_y; int scr_w, scr_h; /* I. Do the parsing and strip off extra bits */ ret = FScreenParseGeometryWithScreen(parsestring, &x, &y, &w, &h, &scr); saved = ret & (XNegative | YNegative); ret &= flags; /* II. Get the screen rectangle */ switch (scr) { case FSCREEN_GLOBAL: case FSCREEN_CURRENT: case FSCREEN_PRIMARY: case FSCREEN_XYPOS: FScreenGetScrRect(NULL, scr, &scr_x, &scr_y, &scr_w, &scr_h); break; default: scr++; if (scr < first_to_check || scr > last_to_check) scr = first_to_check; scr_x = screens[scr].x_org; scr_y = screens[scr].y_org; scr_w = screens[scr].width; scr_h = screens[scr].height; } /* III. Interpret and fill in the values */ /* Fill in dimensions for future negative calculations if * omitted/forbidden */ /* Maybe should use *x_return,*y_return if hints==NULL? * Unreliable... */ if (hints != NULL && hints->flags & PSize) { if ((ret & WidthValue) == 0) { w = hints->width; } if ((ret & HeightValue) == 0) { h = hints->height; } } else { /* This branch is required for case when size *is* specified, * but masked off */ if ((ret & WidthValue) == 0) { w = 0; } if ((ret & HeightValue) == 0) { h = 0; } } /* Advance coords to the screen... */ x += scr_x; y += scr_y; /* ...and process negative geometries */ if (saved & XNegative) { x += scr_w; } if (saved & YNegative) { y += scr_h; } if (ret & XNegative) { x -= w; } if (ret & YNegative) { y -= h; } /* Restore negative bits */ ret |= saved; /* Guess orientation */ x_grav = (ret & XNegative)? GRAV_NEG : GRAV_POS; y_grav = (ret & YNegative)? GRAV_NEG : GRAV_POS; grav = grav_matrix[y_grav][x_grav]; /* Return the values */ if (ret & XValue) { *x_return = x; if (hints != NULL) { hints->x = x; } } if (ret & YValue) { *y_return = y; if (hints != NULL) { hints->y = y; } } if (ret & WidthValue) { *width_return = w; if (hints != NULL) { hints->width = w; } } if (ret & HeightValue) { *height_return = h; if (hints != NULL) { hints->height = h; } } if (1 /*flags & GravityValue*/ && grav != DEFAULT_GRAVITY) { if (hints != NULL && hints->flags & PWinGravity) { hints->win_gravity = grav; } } if (hints != NULL && ret & XValue && ret & YValue) hints->flags |= USPosition; return ret; } /* FScreenMangleScreenIntoUSPosHints * A hack to mangle the screen number into the XSizeHints structure. * If the USPosition flag is set, hints->x is set to the magic number and * hints->y is set to the screen number. If the USPosition flag is clear, * x and y are set to zero. * * Note: This is a *hack* to allow modules to specify the target screen for * their windows and have the StartsOnScreen style set for them at the same * time. Do *not* rely on the mechanism described above. */ void FScreenMangleScreenIntoUSPosHints(fscreen_scr_t screen, XSizeHints *hints) { if (hints->flags & USPosition) { hints->x = FSCREEN_MANGLE_USPOS_HINTS_MAGIC; hints->y = (short)screen; } else { hints->x = 0; hints->y = 0; } return; } /* FScreenMangleScreenIntoUSPosHints * A hack to mangle the screen number into the XSizeHints structure. * If the USPosition flag is set, hints->x is set to the magic number and * hints->y is set to the screen spec. If the USPosition flag is clear, * x and y are set to zero. * * Note: This is a *hack* to allow modules to specify the target screen for * their windows and have the StartsOnScreen style set for them at the same * time. Do *not* rely on the mechanism described above. */ fscreen_scr_t FScreenFetchMangledScreenFromUSPosHints(XSizeHints *hints) { fscreen_scr_t screen; if ((hints->flags & USPosition) && hints->x == FSCREEN_MANGLE_USPOS_HINTS_MAGIC) { screen = (fscreen_scr_t)(hints->y); } else { screen = FSCREEN_GLOBAL; } return screen; } /* no rand_r for now */ # if 0 int FScreenGetRandrEventType(void) { #ifdef HAVE_RANDR return randr_active? randr_event_base + RRScreenChangeNotify : 0; #else return 0; #endif } Bool FScreenHandleRandrEvent( XEvent *event, int *old_w, int *old_h, int *new_w, int *new_h) { #ifndef HAVE_RANDR return 0; #else XRRScreenChangeNotifyEvent *ev = (XRRScreenChangeNotifyEvent *)event; int nw, nh, tmp; if (!randr_active || event->type != randr_event_base + RRScreenChangeNotify) { return 0; } nw = ev->width; nh = ev->height; /* * Note1: this check is not very good, since the right way is to * obtain a list of possible rotations and ... * * Note2: as to WM's point of view, I'm unsure if rotation should be * treated exactly as resizing (i.e. that it should reposition * windows in the same fashion). */ if (ev->rotation & (1<<1 | 1<<3)) { tmp = nw; nw = nh; nh = tmp; } *old_w = screens[0].width; *old_h = screens[0].height; screens[0].width = nw; *new_w = nw; screens[0].height = nh; *new_h = nh; return (nw != *old_w || nh != *old_h); #endif } #endif fvwm-2.6.5.orig/libs/FTips.h0000644000175000017500000000327210504065263013756 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2004 Olivier Chapuis */ #ifndef FVWMLIB_FTIPS_H #define FVWMLIB_FTIPS_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef enum { FTIPS_PLACEMENT_UP, FTIPS_PLACEMENT_DOWN, FTIPS_PLACEMENT_LEFT, FTIPS_PLACEMENT_RIGHT, FTIPS_PLACEMENT_AUTO_UPDOWN, FTIPS_PLACEMENT_AUTO_LEFTRIGHT } ftips_placement_t; typedef enum { FTIPS_JUSTIFICATION_CENTER, FTIPS_JUSTIFICATION_LEFT_UP, FTIPS_JUSTIFICATION_RIGHT_DOWN } ftips_position_t; typedef struct { int colorset; Pixel fg; Pixel bg; Pixel border_pixel; int border_width; FlocaleFont *Ffont; ftips_placement_t placement; ftips_position_t justification; unsigned int placement_offset; /* pixel */ unsigned int justification_offset; /* pixel */ unsigned long delay; /* ms */ unsigned long mapped_delay; /* ms */ } ftips_config; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ Bool FTipsInit(Display *dpy); ftips_config *FTipsNewConfig(void); void FTipsOn( Display *dpy, Window win_f, ftips_config *fc, void *id, char *str, int x, int y, int w, int h); void FTipsCancel(Display *dpy); unsigned long FTipsCheck(Display *dpy); Bool FTipsExpose(Display *dpy, XEvent *ev); Bool FTipsHandleEvents(Display *dpy, XEvent *ev); void FTipsUpdateLabel(Display *dpy, char *str); void FTipsColorsetChanged(Display *dpy, int cs); #endif fvwm-2.6.5.orig/libs/timeout.h0000644000175000017500000000205007677641664014436 0ustar vwcvwc/* -*-c-*- */ #ifndef TIMEOUT_H #define TIMEOUT_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ #define TIMEOUT_MAX_TIMEOUTS 32 /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef int timeout_time_t; typedef unsigned int timeout_mask_t; typedef struct { int n_timeouts; timeout_time_t *timeouts; } timeout_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ timeout_t *timeout_create( int n_timeouts); void timeout_destroy( timeout_t *to); timeout_mask_t timeout_tick( timeout_t *to, timeout_time_t n_ticks); void timeout_rewind( timeout_t *to, timeout_mask_t mask, timeout_time_t ticks_before_alarm); #endif /* TIMEOUT_H */ fvwm-2.6.5.orig/libs/Cursor.h0000644000175000017500000000005710556633567014223 0ustar vwcvwcint fvwmCursorNameToIndex (char *cursor_name); fvwm-2.6.5.orig/libs/PictureGraphics.h0000644000175000017500000001170210430177645016030 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ #ifndef F_PICTURE_GRAPHICS_H #define F_PICTURE_GRAPHICS_H /* * * dpy: Specifies the connection to the X server. * pixmap: Source pixmap. * mask: Source mask (can be None). * alpha: Source alpha chanel (can be None). * depth: depth of the pixmap (1 or Pdepth). * d: Destination drawable which should be of depth Pdepth. * GC gc: Specifies the a visual GC. * src_x,src_y: Specify the x and y coordinates, which are relative to the * origin of the source pixmap, mask and alpha of the rectangle * which is copied. * src_w,src_h: Width and height of the source rectangle relatively to the * src_x and src_y. * dest_x,dest_y: Specify the x and y coordinates of the destination rectangle, * which are relative to the origin of the drawable d. * */ /* return a pixmap of depth depth which is the copy of the src pixmap of depth * 1 using the gc for the bg and fg colors */ Pixmap PictureBitmapToPixmap( Display *dpy, Window win, Pixmap src, int depth, GC gc, int src_x, int src_y, int src_w, int src_h); /* * PGraphicsRenderPixmaps * * PGraphicsRenderPixmaps copies a rectangle, the src, constituted by a pixmap * with its mask, alpha channel, and rendering attributes to a drawable at a * given position. * */ void PGraphicsRenderPixmaps( Display *dpy, Window win, Pixmap pixmap, Pixmap mask, Pixmap alpha, int depth, FvwmRenderAttributes *fra, Drawable d, GC gc, GC mono_gc, GC alpha_gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h, int do_repeat); /* * PGraphicsRenderPicture * * PGraphicsRenderPicture copies a rectangle, the src, constituted by a picture * and its rendering attributes to a drawable at a given position. * * */ void PGraphicsRenderPicture( Display *dpy, Window win, FvwmPicture *p, FvwmRenderAttributes *fra, Drawable d, GC gc, GC mono_gc, GC alpha_gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h, int do_repeat); /* * PGraphicsCopyPixmaps * * PGraphicsCopyPixmaps copies a rectangle constituted by a pixmap with its * mask and alpha channel to a drawable at a given position. * * * The clip_mask, clip_x_origin and clip_y_origin value of the gc are * modified in this function: the clip_mask is set to mask and reseted to None, * clip_x_origin and clip_y_origin are set to src_x and src_y. * The background and foreground value of the gc is important when you render * a bitmap. If the gc is set to None the function create and destroy a gc for * its use. * */ void PGraphicsCopyPixmaps( Display *dpy, Pixmap pixmap, Pixmap mask, Pixmap alpha, int depth, Drawable d, GC gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y); /* * PGraphicsCopyFvwmPicture * * PGraphicsCopyFvwmPicture copies a rectangle constituted by an FvwmPicture * to a drawable at a given position. It is similar to PGraphicsCopyPixmaps * and the same remarks are valids. The only difference is that the source * rectangle is given by the FvwmPicture p (which contains the pixmap, the * mask, the alpha and the depth). * */ void PGraphicsCopyFvwmPicture( Display *dpy, FvwmPicture *p, Drawable d, GC gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y); /* * PGraphicsTileRectangle * * This function is similar to PGraphicsCopyPixmaps. It tiles the rectangle of * the drawable d defined with coordinates dest_x, dest_y, dest_w, dest_h with * the rectangle composed by the pixmap, its mask and its alpha channel. * */ void PGraphicsTileRectangle( Display *dpy, Window win, Pixmap pixmap, Pixmap shape, Pixmap alpha, int depth, Drawable d, GC gc, GC mono_gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h); FvwmPicture *PGraphicsCreateStretchPicture( Display *dpy, Window win, FvwmPicture *src, int dest_width, int dest_height, GC gc, GC mono_gc, GC alpha_gc); FvwmPicture *PGraphicsCreateTiledPicture( Display *dpy, Window win, FvwmPicture *src, int dest_width, int dest_height, GC gc, GC mono_gc, GC alpha_gc); Pixmap PGraphicsCreateTransparency( Display *dpy, Window win, FvwmRenderAttributes *fra, GC gc, int x, int y, int width, int height, Bool parent_relative); void PGraphicsTintRectangle( Display *dpy, Window win, Pixel tint, int tint_percent, Drawable dest, Bool dest_is_a_window, GC gc, GC mono_gc, GC alpha_gc, int dest_x, int dest_y, int dest_w, int dest_h); /* never used ! */ Pixmap PGraphicsCreateDitherPixmap( Display *dpy, Window win, Drawable src, Pixmap mask, int depth, GC gc, int in_width, int in_height, int out_width, int out_height); #endif fvwm-2.6.5.orig/libs/envvar.h0000644000175000017500000000604510127051015014222 0ustar vwcvwc/* -*-c-*- */ #ifndef FVWMLIB_ENVVAR_H #define FVWMLIB_ENVVAR_H /* * SYNOPSIS #include "envvar.h" * int envExpand(char *s, int maxstrlen); * * INPUT s string to expand environment variables in. * maxstrlen max length of string, including '\0'. * * OUTPUT s the string with environment variables expanded. * * RETURNS Number of changes done. * * NOTES A non-existing variable is substituted with the empty * string. * */ int envExpand(char *s, int maxstrlen); /* * FUNCTION Expand environment variables into a new string. * * SYNOPSIS #include "envvar.h" * char *envDupExpand(const char *s, int extra); * * INPUT s string to expand environment variables in. * extra number of extra bytes to allocate in the * string, in addition to the string contents * and the terminating '\0'. * * RETURNS A dynamically allocated string with environment * variables expanded. * Use free() to deallocate the buffer when it is no * longer needed. * NULL is returned if there is not enough memory. * * NOTES A non-existing variable is substituted with the empty * string. * */ char *envDupExpand(const char *s, int extra); /* * FUNCTION Search for the first environment variable and return * its contents and coordinates in the given string. * * INPUT s the string to scan. * may include $ and { } that introduce variable. * * OUTPUT beg index in the string of matching $. * end index in the string, first after matching var. * * RETURNS The variable contents; "" if env variable has legal name, * but does not exist; or NULL if no env variables found. * Returned constant string must not be deallocated. * * NOTE This function will only return `legal' variables. There * may be $'s in the string that are not followed by what * is considered a legal variable name introducer. Such * occurrences are skipped. * If nothing is found returns NULL and sets beg and end to 0. * * EXAMPLE getFirstEnv("echo $HOME/.fvwm/config", &beg, &end) * returns "/home/username" and beg=5, end=10. * */ const char* getFirstEnv(const char *s, int *beg, int *end); /* This function keeps a list of all strings that were set in the environment. * If a variable is written again, the old memory is freed. This function * should be called instead of putenv(). * * var - environement variable name * env - environment string ("variable=value") * * Both arguments are copied internally and should be freed after calling this * function. */ void flib_putenv(char *var, char *env); /* Replacement for unsetenv(). */ void flib_unsetenv(const char *name); #endif fvwm-2.6.5.orig/libs/wcontext.h0000644000175000017500000000366510552105436014612 0ustar vwcvwc/* -*-c-*- */ #ifndef WCONTEXT_H #define WCONTEXT_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef enum { /* contexts for button presses */ C_NO_CONTEXT = 0x00, C_WINDOW = 0x01, C_TITLE = 0x02, C_ICON = 0x04, C_ROOT = 0x08, C_MENU = 0x10, C_PLACEMENT = 0x20, C_L1 = 0x40, C_R1 = 0x80, C_L2 = 0x100, C_R2 = 0x200, C_L3 = 0x400, C_R3 = 0x800, C_L4 = 0x1000, C_R4 = 0x2000, C_L5 = 0x4000, C_R5 = 0x8000, C_UNMANAGED = 0x10000, C_EWMH_DESKTOP = 0x20000, C_F_TOPLEFT = 0x100000, C_F_TOPRIGHT = 0x200000, C_F_BOTTOMLEFT = 0x400000, C_F_BOTTOMRIGHT = 0x800000, C_SB_LEFT = 0x1000000, C_SB_RIGHT = 0x2000000, C_SB_TOP = 0x4000000, C_SB_BOTTOM = 0x8000000, /* C_ = 0x10000000, */ /* C_ = 0x20000000, */ /* C_ = 0x40000000, */ C_IGNORE_ALL = (int)0x80000000, C_FRAME = (C_F_TOPLEFT|C_F_TOPRIGHT|C_F_BOTTOMLEFT|C_F_BOTTOMRIGHT), C_SIDEBAR = (C_SB_LEFT|C_SB_RIGHT|C_SB_TOP|C_SB_BOTTOM), C_RALL = (C_R1|C_R2|C_R3|C_R4|C_R5), C_LALL = (C_L1|C_L2|C_L3|C_L4|C_L5), C_DECOR = (C_LALL|C_RALL|C_TITLE|C_FRAME|C_SIDEBAR), C_ALL = (C_WINDOW|C_TITLE|C_ICON|C_ROOT|C_FRAME|C_SIDEBAR|\ C_LALL|C_RALL|C_EWMH_DESKTOP), C_MENU_ITEM = (C_ICON|C_MENU) } win_context_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ extern charmap_t win_contexts[]; /* ---------------------------- interface functions ------------------------ */ int wcontext_string_to_wcontext(char *in_context, int *out_context_mask); char wcontext_wcontext_to_char(win_context_t wcontext); win_context_t wcontext_merge_border_wcontext(win_context_t wcontext); #endif /* WCONTEXT_H */ fvwm-2.6.5.orig/libs/flist.h0000644000175000017500000000161507677641664014077 0ustar vwcvwc/* -*-c-*- */ #ifndef FLIST_H #define FLIST_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef struct _flist { void *object; struct _flist *next; struct _flist *prev; } flist; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ flist *flist_append_obj(flist *list, void *object); flist *flist_prepend_obj(flist *list, void *object); flist *flist_insert_obj(flist *list, void *object, int position); flist *flist_remove_obj(flist *list, void *object); flist *flist_free_list(flist *list); #endif /* FLIST_H */ fvwm-2.6.5.orig/libs/PictureImageLoader.h0000644000175000017500000000373010646522443016442 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ #ifndef PICTURE_IMAGE_LOADER_H #define PICTURE_IMAGE_LOADER_H /* ---------------------------- included header files ---------------------- */ #include /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- interface functions ------------------------ */ /* * PImageCreatePixmapFromArgbData * * Create a pixmap with its mask and alpha channel from ARGB data. * */ Bool PImageCreatePixmapFromArgbData( Display *dpy, Window win, CARD32 *data, int start, int width, int height, Pixmap *pixmap, Pixmap *mask, Pixmap *alpha, int *nalloc_pixels, Pixel **alloc_pixels, int *no_limit, FvwmPictureAttributes fpa); /* * PImageLoadPixmapFromFile * * Create a pixmap with its mask and alpha channel from a file. * */ Bool PImageLoadPixmapFromFile( Display *dpy, Window win, char *file, Pixmap *pixmap, Pixmap *mask, Pixmap *alpha, int *width, int *height, int *depth, int *nalloc_pixels, Pixel **alloc_pixels, int *no_limit, FvwmPictureAttributes fpa); /* * PImageLoadPixmapFromFile * * Create a FvwmPicture from a file. * */ FvwmPicture *PImageLoadFvwmPictureFromFile( Display *dpy, Window win, char *path, FvwmPictureAttributes fpa); /* * PImageLoadPixmapFromFile * * Create a cursor from a file. * */ Cursor PImageLoadCursorFromFile( Display *dpy, Window win, char *path, int x_hot, int y_hot); /* * PImageLoadPixmapFromFile * * Create a pixmap with its mask from xpm data. * */ Bool PImageLoadPixmapFromXpmData( Display *dpy, Window win, int color_limit, char **data, Pixmap *pixmap, Pixmap *mask, int *width, int *height, int *depth); #endif /* PICTURE_IMAGE_LOADER_H */ fvwm-2.6.5.orig/libs/wcontext.c0000644000175000017500000000560210315476715014606 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/charmap.h" #include "libs/wcontext.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* The keys must be in lower case! Put more common contexts toward the front. */ charmap_t win_contexts[] = { {'r', C_ROOT}, {'t', C_TITLE}, {'w', C_WINDOW}, {'f', C_FRAME}, {'i', C_ICON}, {'a', C_ALL}, {'1', C_L1}, {'2', C_R1}, {'3', C_L2}, {'4', C_R2}, {'5', C_L3}, {'6', C_R3}, {'7', C_L4}, {'8', C_R4}, {'9', C_L5}, {'0', C_R5}, {'d', C_EWMH_DESKTOP}, {'<', C_F_TOPLEFT}, {'^', C_F_TOPRIGHT}, {'>', C_F_BOTTOMRIGHT}, {'v', C_F_BOTTOMLEFT}, {'s', C_SIDEBAR}, {'[', C_SB_LEFT}, {']', C_SB_RIGHT}, {'-', C_SB_TOP}, {'_', C_SB_BOTTOM}, {'m', C_MENU}, {'p', C_PLACEMENT}, {0, 0} }; /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ /* Converts the input string into a mask with bits for the contexts */ int wcontext_string_to_wcontext(char *in_context, int *out_context_mask) { int error; error = charmap_string_to_mask( out_context_mask, in_context, win_contexts, "bad context"); return error; } char wcontext_wcontext_to_char(win_context_t wcontext) { char c; c = charmap_mask_to_char((int)wcontext, win_contexts); return c; } win_context_t wcontext_merge_border_wcontext(win_context_t wcontext) { if (wcontext & C_FRAME) { wcontext |= C_FRAME; } if (wcontext & C_SIDEBAR) { wcontext |= C_SIDEBAR; } return wcontext; } fvwm-2.6.5.orig/libs/FShape.h0000644000175000017500000001255307677641664014127 0ustar vwcvwc/* -*-c-*- */ /* ** FShape.h: drop in replacements for the X shape library encapsulation */ #ifndef FVWMLIB_FSHAPE_H #define FVWMLIB_FSHAPE_H #ifdef SHAPE #include #define FShapeQueryExtension(dpy, evbase, errbase) \ XShapeQueryExtension(dpy, evbase, errbase) #define FShapeQueryVersion(dpy, vmajor, vminor) \ XShapeQueryVersion(dpy, vmajor, vminor) #define FShapeCombineRegion(dpy, dst, dst_kind, xoff, yoff, reg, op) \ XShapeCombineRegion(dpy, dst, dst_kind, xoff, yoff, reg, op) #define FShapeCombineRectangles( \ dpy, dst, dst_kind, xoff, yoff, rect, n_rects, op, ordering) \ XShapeCombineRectangles( \ dpy, dst, dst_kind, xoff, yoff, rect, n_rects, op, ordering) #define FShapeCombineMask(dpy, dst, dst_kind, xoff, yoff, src, op) \ XShapeCombineMask(dpy, dst, dst_kind, xoff, yoff, src, op) #define FShapeCombineShape(dpy, dst, dst_kind, xoff, yoff, src, src_kind, op) \ XShapeCombineShape(dpy, dst, dst_kind, xoff, yoff, src, src_kind, op) #define FShapeOffsetShape(dpy, dst, dst_kind, xoff, yoff) \ XShapeOffsetShape(dpy, dst, dst_kind, xoff, yoff) #define FShapeQueryExtents( \ dpy, w, bounding_shaped, xb, yb, wb, hb, clip_shaped, \ xclip, yclip, wclip, hclip) \ XShapeQueryExtents( \ dpy, w, bounding_shaped, xb, yb, wb, hb, clip_shaped, \ xclip, yclip, wclip, hclip) #define FShapeSelectInput(dpy, w, mask) \ XShapeSelectInput(dpy, w, mask) #define FShapeInputSelected(dpy, w) \ XShapeInputSelected(dpy, w) #define FShapeGetRectangles(dpy, w, kind, count, ordering) \ XShapeGetRectangles(dpy, w, kind, count, ordering) extern int FShapeEventBase; extern int FShapeErrorBase; /* Shapes compiled in? */ extern Bool FShapesSupported; /* Shapes supported by server? */ #define FHaveShapeExtension 1 void FShapeInit(Display *dpy); #else /* drop in replacements if shape support is not compiled in */ #define X_ShapeQueryVersion 0 #define X_ShapeRectangles 1 #define X_ShapeMask 2 #define X_ShapeCombine 3 #define X_ShapeOffset 4 #define X_ShapeQueryExtents 5 #define X_ShapeSelectInput 6 #define X_ShapeInputSelected 7 #define X_ShapeGetRectangles 8 #define ShapeSet 0 #define ShapeUnion 1 #define ShapeIntersect 2 #define ShapeSubtract 3 #define ShapeInvert 4 #define ShapeBounding 0 #define ShapeClip 1 #define ShapeNotifyMask (1L << 0) #define ShapeNotify 0 #define ShapeNumberEvents (FShapeNotify + 1) typedef struct { int type; /* of event */ unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came frome a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* window of event */ int kind; /* ShapeBounding or ShapeClip */ int x, y; /* extents of new region */ unsigned width, height; Time time; /* server timestamp when region changed */ Bool shaped; /* true if the region exists */ } XShapeEvent; #define FShapeQueryExtension(dpy, evbase, errbase) ((Bool)False) #define FShapeQueryVersion(dpy, vmajor, vminor) ((Status)0) #define FShapeCombineRegion(dpy, dst, dst_kind, xoff, yoff, reg, op) #define FShapeCombineRectangles( \ dpy, dst, dst_kind, xoff, yoff, rect, n_rects, op, ordering) #define FShapeCombineMask(dpy, dst, dst_kind, xoff, yoff, src, op) #define FShapeCombineShape(dpy, dst, dst_kind, xoff, yoff, src, src_kind, op) #define FShapeOffsetShape(dpy, dst, dst_kind, xoff, yoff) #define FShapeQueryExtents( \ dpy, w, bounding_shaped, xb, yb, wb, hb, clip_shaped, \ xclip, yclip, wclip, hclip) ((Status)0) #define FShapeSelectInput(dpy, w, mask) #define FShapeInputSelected(dpy, w) ((unsinged long)0) #define FShapeGetRectangles(dpy, w, kind, count, ordering) ((XRectangle *)0) /* define empty dummies */ #define FShapeEventBase 0 #define FShapeErrorBase 0 /* Shapes supported by server? */ #define FShapesSupported 0 /* Shapes compiled in? */ #define FHaveShapeExtension 0 #define FShapeInit(dpy) #endif /* fvwm replacements for shape lib */ #define F_ShapeQueryVersion X_ShapeQueryVersion #define F_ShapeRectangles X_ShapeRectangles #define F_ShapeMask X_ShapeMask #define F_ShapeCombine X_ShapeCombine #define F_ShapeOffset X_ShapeOffset #define F_ShapeQueryExtents X_ShapeQueryExtents #define F_ShapeSelectInput X_ShapeSelectInput #define F_ShapeInputSelected X_ShapeInputSelected #define F_ShapeGetRectangles X_ShapeGetRectangles #define FShapeSet ShapeSet #define FShapeUnion ShapeUnion #define FShapeIntersect ShapeIntersect #define FShapeSubtract ShapeSubtract #define FShapeInvert ShapeInvert #define FShapeBounding ShapeBounding #define FShapeClip ShapeClip #define FShapeNotifyMask ShapeNotifyMask #define FShapeNotify ShapeNotify #define FShapeNumberEvents ShapeNumberEvents typedef XShapeEvent FShapeEvent; #endif /* FVWMLIB_FSHAPE_H */ fvwm-2.6.5.orig/libs/Parse.c0000644000175000017500000005073610556634174014017 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ** Parse.c: routines for parsing in fvwm & modules */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "fvwmlib.h" #include "Strings.h" #include "Parse.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* Copies a token beginning at src to a previously allocated area dest. dest * must be large enough to hold the token. Leading whitespace causes the token * to be NULL. */ /* NOTE: CopyToken can be called with dest == src. The token will be copied * back down over the src string. */ static char *CopyToken( char *src, char *dest, char *spaces, int snum, char *delims, int dnum, char *out_delim) { int len = 0; char *t; while (*src != 0 && !(isspace((unsigned char)*src) || (snum && strchr(spaces, *src)) || (dnum && strchr(delims, *src)))) { /* Check for quoted text */ if (IsQuote(*src)) { char c = *src; src++; while ((*src != c)&&(*src != 0)) { if ((*src == '\\' && *(src+1) != 0)) { /* Skip over backslashes */ src++; } if (len < MAX_TOKEN_LENGTH - 1) { len++; *(dest++) = *(src++); } else { /* token too long, just skip rest */ src++; } } if (*src == c) { src++; } } else { if ((*src == '\\' && *(src+1) != 0)) { /* Skip over backslashes */ src++; } if (len < MAX_TOKEN_LENGTH - 1) { len++; *(dest++) = *(src++); } else { /* token too long, just skip rest of token */ src++; } } } if (out_delim) { *out_delim = *src; } *dest = 0; t = SkipSpaces(src, spaces, snum); if (*t != 0 && dnum && strchr(delims, *t) != NULL) { if (out_delim) { *out_delim = *t; } src = t + 1; } else if (*src != 0) { src++; } return src; } /* ---------------------------- interface functions ------------------------ */ /* This function escapes all occurences of the characters in the string qchars * in the string as with a preceding echar character. The resulting string is * returned in a malloced memory area. */ char *EscapeString(char *s, const char *qchars, char echar) { char *t; char *ret; int len; for (len = 1, t = s; *t ; t++, len++) { if (strchr(qchars, *t) != NULL) { len++; } } ret = (char *)safemalloc(len); for (t = ret; *s; s++, t++) { if (strchr(qchars, *s) != NULL) { *t = echar; t++; } *t = *s; } *t = 0; return ret; } /* If the string s begins with a quote chracter SkipQuote returns a pointer * to the first unquoted character or to the final '\0'. If it does not, a * pointer to the next character in the string is returned. * There are three possible types of quoting: a backslash quotes the next * character only. Long quotes like " " or ' ' quoting everything in * between and quote pairs like ( ) or { }. * * precedence: * * 1) Backslashes are honoured always, even inside long or pair quotes. * 2) long quotes do quote quoting pair characters but not simple quotes. All * long quotes can quote all other types of long quotes). * 3) pair quotes none of the above. Text between a pair of quotes is treated * as a single token. * * qlong - string of long quoted (defaults to "'` ) * qstart - string of pair quote start characters (defaults to empty string) * qend - string of pair quote end characters (defaults to empty string) * * The defaults are used if NULL is passed for the corresponding string. */ char *SkipQuote( char *s, const char *qlong, const char *qstart, const char *qend) { char *t; if (s == NULL || *s == 0) { return s; } if (!qlong) { qlong = "\"'`"; } if (!qstart) { qstart = ""; } if (!qend) { qend = ""; } if (*s == '\\' && s[1] != 0) { return s+2; } else if (*qlong && (t = strchr(qlong, *s))) { char c = *t; s++; while (*s && *s != c) { /* Skip over escaped text, ie \quote */ if (*s == '\\' && *(s+1) != 0) { s++; } s++; } if (*s == c) { s++; } return s; } else if (*qstart && (t = strchr(qstart, *s))) { char c = *((t - qstart) + qend); while (*s && *s != c) { s = SkipQuote(s, qlong, "", ""); } return (*s == c) ? ++s : s; } return ++s; } /* Returns a string up to the first character from the string delims in a * malloc'd area just like GetNextToken. Quotes are not removed from the * returned string. The returned string is stored in *sout, the return value * of this call is a pointer to the first character after the delimiter or * to the terminating '\0'. Quoting is handled like in SkipQuote. If sin is * NULL, the function returns NULL in *sout. */ char *GetQuotedString( char *sin, char **sout, const char *delims, const char *qlong, const char *qstart, const char *qend) { char *t = sin; unsigned int len; if (!sout) { return NULL; } if (!sin) { *sout = NULL; return NULL; } while (*t && !strchr(delims, *t)) { t = SkipQuote(t, qlong, qstart, qend); } len = t - sin; *sout = (char *)safemalloc(len + 1); memcpy(*sout, sin, len); (*sout)[len] = 0; if (*t) { t++; } return t; } /* SkipSpaces: returns a pointer to the first character in indata that is * neither a whitespace character nor contained in the string 'spaces'. snum * is the number of characters in 'spaces'. You must not pass a NULL pointer * in indata. */ char *SkipSpaces(char *indata, char *spaces, int snum) { while (*indata != 0 && (isspace((unsigned char)*indata) || (snum && strchr(spaces, *indata)))) { indata++; } return indata; } /* ** DoPeekToken: returns next token from string, leaving string intact ** (you must not free returned string) ** ** WARNING: The returned pointer points to a static array that will be ** overwritten in all functions in this file! ** ** For a description of the parameters see DoGetNextToken below. DoPeekToken ** is a bit faster. */ /* NOTE: If indata is the pointer returned by a previous call to PeekToken or * DoPeekToken, the input string will be destroyed. */ char *DoPeekToken( char *indata, char **token, char *spaces, char *delims, char *out_delim) { char *end; int snum; int dnum; static char tmptok[MAX_TOKEN_LENGTH]; snum = (spaces) ? strlen(spaces) : 0; dnum = (delims) ? strlen(delims) : 0; if (indata == NULL) { if (out_delim) { *out_delim = '\0'; } *token = NULL; return NULL; } indata = SkipSpaces(indata, spaces, snum); end = CopyToken(indata, tmptok, spaces, snum, delims, dnum, out_delim); if (tmptok[0] == 0) { *token = NULL; } else { *token = tmptok; } return end; } /* * PeekToken takes the input string "indata" and returns a pointer to the * token, stored in a static char array. The pointer is invalidated by * the next call to PeekToken. If "outdata" is not NULL, the pointer * to the first character after the token is returned through * *outdata. (Note that outdata is a char **, not just a char *). */ char *PeekToken(char *indata, char **outdata) { char *dummy; char *token; if (!outdata) { outdata = &dummy; } *outdata = DoPeekToken(indata, &token, NULL, NULL, NULL); return token; } /**** SMR: Defined but not used -- is this for the future or a relic of the **** past? ****/ /* domivogt (27-Jun-1999): It's intended for future use. I have no problem * commenting it out if it's not used. */ /* Tries to seek up to n tokens in indata. Returns the number of tokens * actually found (up to a maximum of n). */ #if 0 int CheckNTokens(char *indata, unsigned int n) { unsigned int i; char *token; for (i = 0, token = (char *)1; i < n && token != NULL; i++) { token = PeekToken(indata, NULL); } return i; } #endif /* ** MatchToken: does case-insensitive compare on next token in string, leaving ** string intact (returns true if matches, false otherwise) */ int MatchToken(char *pstr,char *tok) { int rc=0; char *ntok; DoPeekToken(pstr, &ntok, NULL, NULL, NULL); if (ntok) { rc = (strcasecmp(tok,ntok)==0); } return rc; } /* unused at the moment */ /* function: XCmpToken description: compare 1st word of s to 1st word of t returns: < 0 if s < t = 0 if s = t > 0 if s > t */ int XCmpToken(const char *s, const char **t) { register const char *w=*t; if (w==NULL) { return 1; } if (s==NULL) { return -1; } while (*w && (*s==*w || toupper(*s)==toupper(*w)) ) { s++; w++; } if ((*s=='\0' && (ispunct(*w) || isspace(*w)))|| (*w=='\0' && (ispunct(*s) || isspace(*s))) ) { return 0; /* 1st word equal */ } else { return toupper(*s)-toupper(*w); /* smaller/greater */ } } /* * * Gets the next "word" of input from string indata. * "word" is a string with no spaces, or a qouted string. * Return value is ptr to indata,updated to point to text after the word * which is extracted. * token is the extracted word, which is copied into a malloced * space, and must be freed after use. DoGetNextToken *never* returns an * empty string or token. If the token consists only of whitespace or * delimiters, the returned token is NULL instead. If out_delim is given, * the character ending the string is returned therein. * * spaces = string of characters to treat as spaces * delims = string of characters delimiting token * * Use "spaces" and "delims" to define additional space/delimiter * characters (spaces are skipped before a token, delimiters are not). * */ char *DoGetNextToken( char *indata, char **token, char *spaces, char *delims, char *out_delim) { char *tmptok; char *end; end = DoPeekToken(indata, &tmptok, spaces, delims, out_delim); if (tmptok == NULL) { *token = NULL; } else { *token = safestrdup(tmptok); } return end; } /* * GetNextToken works similarly to PeekToken, but: stores the token in * *token, & returns a pointer to the first character after the token * in *token. The memory in *token is allocated with malloc and the * calling function has to free() it. * * If possible, use PeekToken because it's faster and does not risk * creating memory leaks. */ char *GetNextToken(char *indata, char **token) { return DoGetNextToken(indata, token, NULL, NULL, NULL); } /* fetch next token and stop at next ',' */ char *GetNextSimpleOption(char *indata, char **option) { return DoGetNextToken(indata, option, NULL, ",", NULL); } /* read multiple tokens up to next ',' or end of line */ char *GetNextFullOption(char *indata, char **option) { return GetQuotedString(indata, option, ",\n", NULL, NULL, NULL); } char *SkipNTokens(char *indata, unsigned int n) { for ( ; n > 0 && indata != NULL && *indata != 0; n--) { PeekToken(indata, &indata); } return indata; } /* * convenience functions */ /* * * Works like GetNextToken, but with the following differences: * * If *indata begins with a "*" followed by the string module_name, * it returns the string following directly after module_name as the * new token. Otherwise NULL is returned. * e.g. GetModuleResource("*FvwmPagerGeometry", &token, "FvwmPager") * returns "Geometry" in token. * */ char *GetModuleResource(char *indata, char **resource, char *module_name) { char *tmp; char *next; if (!module_name) { *resource = NULL; return indata; } tmp = PeekToken(indata, &next); if (!tmp) { return next; } if (tmp[0] != '*' || strncasecmp(tmp+1, module_name, strlen(module_name))) { *resource = NULL; return indata; } CopyString(resource, tmp+1+strlen(module_name)); return next; } /* * * This function uses GetNextToken to parse action for up to num integer * arguments. The number of values actually found is returned. * If ret_action is non-NULL, a pointer to the next token is returned there. * The suffixlist parameter points to a string of possible suffixes for the * integer values. The index of the matched suffix is returned in * ret_suffixnum (0 = no suffix, 1 = first suffix in suffixlist ...). * */ static int _get_suffixed_integer_arguments( char *action, char **ret_action, int *retvals, int num, char *suffixlist, int *ret_suffixnum, char *parsestring) { int i; int j; int n; char *token; int suffixes; /* initialize */ suffixes = 0; if (suffixlist != 0) { /* if passed a suffixlist save its length */ suffixes = strlen(suffixlist); } for (i = 0; i < num && action; i++) { token = PeekToken(action, &action); if (token == NULL) { break; } if (sscanf(token, parsestring, &(retvals[i]), &n) < 1) { break; } if (suffixes != 0 && ret_suffixnum != NULL) { int len; char c; len = strlen(token) - 1; c = token[len]; if (isupper(c)) { c = tolower(c); } for (j = 0; j < suffixes; j++) { char c2 = suffixlist[j]; if (isupper(c2)) { c2 = tolower(c2); } if (c == c2) { ret_suffixnum[i] = j+1; break; } } if (j == suffixes) { ret_suffixnum[i] = 0; } } else if (token[n] != 0 && !isspace(token[n])) { /* there is a suffix but no suffix list was specified */ break; } } if (ret_action != NULL) { *ret_action = action; } return i; } int GetSuffixedIntegerArguments( char *action, char **ret_action, int *retvals, int num, char *suffixlist, int *ret_suffixnum) { return _get_suffixed_integer_arguments( action, ret_action, retvals, num, suffixlist, ret_suffixnum, "%d%n"); } /* * * This function converts the suffix/number pairs returned by * GetSuffixedIntegerArguments into pixels. The unit_table is an array of * integers that determine the factor to multiply with in hundredths of * pixels. I.e. a unit of 100 means: translate the value into pixels, * 50 means divide value by 2 to get the number of pixels and so on. * The unit used is determined by the suffix which is taken as the index * into the table. No size checking of the unit_table is done, so make sure * it is big enough before calling this function. * */ int SuffixToPercentValue(int value, int suffix, int *unit_table) { return (value * unit_table[suffix]) / 100; } /* * * This function uses GetNextToken to parse action for up to num integer * arguments. The number of values actually found is returned. * If ret_action is non-NULL, a pointer to the next token is returned there. * */ int GetIntegerArguments(char *action, char **ret_action, int *retvals,int num) { return _get_suffixed_integer_arguments( action, ret_action, retvals, num, NULL, NULL, "%d%n"); } /* * * Same as above, but supports hexadecimal and octal integers via 0x and 0 * prefixes. * */ int GetIntegerArgumentsAnyBase( char *action, char **ret_action, int *retvals,int num) { return _get_suffixed_integer_arguments( action, ret_action, retvals, num, NULL, NULL, "%i%n"); } /* * * This function tries to match a token with a list of strings and returns * the position of token in the array or -1 if no match is found. The last * entry in the list must be NULL. * * len = 0 : only exact matches * len < 0 : match, if token begins with one of the strings in list * len > 0 : match, if the first len characters do match * * if next is non-NULL, *next will be set to point to the first character * in token after the match. * */ int GetTokenIndex(char *token, char **list, int len, char **next) { int i; int l; int k; if (!token || !list) { if (next) { *next = NULL; } return -1; } l = (len) ? len : strlen(token); for (i = 0; list[i] != NULL; i++) { k = strlen(list[i]); if (len < 0) { l = k; } else if (len == 0 && k != l) { continue; } if (!strncasecmp(token, list[i], l)) { break; } } if (next) { *next = (list[i]) ? token + l : token; } return (list[i]) ? i : -1; } /* * * This function does roughly the same as GetTokenIndex but reads the * token from string action with GetNextToken. The index is returned * in *index. The return value is a pointer to the character after the * token (just like the return value of GetNextToken). * */ char *GetNextTokenIndex(char *action, char **list, int len, int *index) { char *token; char *next; if (!index) { return action; } token = PeekToken(action, &next); if (!token) { *index = -1; return action; } *index = GetTokenIndex(token, list, len, NULL); return (*index == -1) ? action : next; } /* * * Parses two integer arguments given in the form . * character can be ' ' or 'x', but any other character is allowed too * (except 'p' or 'P'). * */ int GetRectangleArguments(char *action, int *width, int *height) { char *token; int n; token = PeekToken(action, NULL); if (!token) { return 0; } n = sscanf(token, "%d%*c%d", width, height); return (n == 2) ? 2 : 0; } /* unit_io is input as well as output. If action has a postfix 'p' or 'P', * *unit_io is set to 100, otherwise it is left untouched. */ int GetOnePercentArgument(char *action, int *value, int *unit_io) { unsigned int len; char *token; int n; *value = 0; if (!action) { return 0; } token = PeekToken(action, NULL); if (!token) { return 0; } len = strlen(token); /* token never contains an empty string, so this is ok */ if (token[len - 1] == 'p' || token[len - 1] == 'P') { *unit_io = 100; token[len - 1] = '\0'; } n = sscanf(token, "%d", value); return n; } int GetTwoPercentArguments( char *action, int *val1, int *val2, int *val1_unit, int *val2_unit) { char *tok1; char *tok2; char *next; int n = 0; *val1 = 0; *val2 = 0; tok1 = PeekToken(action, &next); action = GetNextToken(action, &tok1); if (!tok1) { return 0; } GetNextToken(action, &tok2); if (GetOnePercentArgument(tok2, val2, val2_unit) == 1 && GetOnePercentArgument(tok1, val1, val1_unit) == 1) { free(tok1); free(tok2); return 2; } /* now try MxN style number, specifically for DeskTopSize: */ n = GetRectangleArguments(tok1, val1, val2); free(tok1); if (tok2) { free(tok2); } return n; } /* Parses the next token in action and returns 1 if it is "yes", "true", "y", * "t" or "on", zero if it is "no", "false", "n", "f" or "off" and -1 if it is * "toggle". A pointer to the first character in action behind the token is * returned through ret_action in this case. ret_action may be NULL. If the * token matches none of these strings the default_ret value is returned and * the action itself is passed back in ret_action. If the no_toggle flag is * non-zero, the "toggle" string is handled as no match. */ int ParseToggleArgument( char *action, char **ret_action, int default_ret, char no_toggle) { int index; int rc; char *next; char *optlist[] = { "toggle", "yes", "no", "true", "false", "on", "off", "t", "f", "y", "n", NULL }; next = GetNextTokenIndex(action, optlist, 0, &index); if (index == 0 && no_toggle == 0) { /* toggle requested explicitly */ rc = -1; } else if (index == -1 || (index == 0 && no_toggle)) { /* nothing selected, use default and don't modify action */ rc = default_ret; next = action; } else { /* odd numbers denote True, even numbers denote False */ rc = (index & 1); } if (ret_action) { *ret_action = next; } return rc; } /* Strips the path from 'path' and returns the last component in a malloc'ed * area. */ char *GetFileNameFromPath(char *path) { char *s; char *name; /* we get rid of the path from program name */ s = strrchr(path, '/'); if (s) { s++; } else { s = path; } name = (char *)safemalloc(strlen(s)+1); strcpy(name, s); return name; } fvwm-2.6.5.orig/libs/FRenderInit.h0000644000175000017500000000064007677641664015124 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ /* ---------------------------- included header files ---------------------- */ #ifndef F_RENDER_INIT_H #define F_RENDER_INIT_H void FRenderInit(Display *dpy); int FRenderGetAlphaDepth(void); int FRenderGetErrorCodeBase(void); int FRenderGetMajorOpCode(void); Bool FRenderGetErrorText(int code, char *msg); Bool FRenderGetExtensionSupported(void); #endif fvwm-2.6.5.orig/libs/charmap.h0000644000175000017500000000161411150076641014342 0ustar vwcvwc/* -*-c-*- */ #ifndef CHARMAP_H #define CHARMAP_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef struct { char key; int value; } charmap_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ int charmap_string_to_mask( int *ret, const char *string, charmap_t *table, char *errstring); char charmap_mask_to_char(int mask, charmap_t *table); char *charmap_table_to_string(int mask, charmap_t *table); #endif /* CHARMAP_H */ fvwm-2.6.5.orig/libs/setpgrp.c0000644000175000017500000000224610226463751014415 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Dominik Vogt */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ** setpgrp.c: ** Provides a portable replacement for setpgrp */ #include "config.h" #include #include "setpgrp.h" int fvwm_setpgrp(void) { int rc; #ifdef HAVE_SETPGID rc = setpgid(0, 0); #else # ifdef HAVE_SETPGRP # ifdef SETPGRP_VOID rc = setpgrp(); # else rc = setpgrp(0, 0); # endif # else /* neither setpgrp nor setpgid - just do nothing */ rc = 0; # endif #endif return rc; } fvwm-2.6.5.orig/libs/atexit.c0000644000175000017500000000152307677641664014245 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" int atexit(void (*func)()) { #if HAVE_ON_EXIT return on_exit(func, 0); #else return 1; #endif } fvwm-2.6.5.orig/libs/fsm.c0000644000175000017500000005765611622413321013522 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2003 Olivier Chapuis * some code taken from the xsm: Copyright 1993, 1998 The Open Group */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* A set of functions for implementing a dummy sm. The code is based on xsm */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #ifdef HAVE_GETPWUID #include #endif #include #include #include #include #include #include #include "fvwmlib.h" #include "System.h" #include "flist.h" #include "fsm.h" /* #define FVWM_DEBUG_FSM */ /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef struct { FIceConn ice_conn; int fd; } fsm_ice_conn_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static FIceAuthDataEntry *authDataEntries = NULL; static FIceIOErrorHandler prev_handler; static FIceListenObj *listenObjs; static char *addAuthFile = NULL; static char *remAuthFile = NULL; static flist *fsm_ice_conn_list = NULL; static flist *pending_ice_conn_list = NULL; static int numTransports = 0; static char *networkIds = NULL; static int *ice_fd = NULL; static char *module_name = NULL; static flist *running_list = NULL; static Bool fsm_init_succeed = False; static Atom _XA_WM_CLIENT_LEADER = None; static Atom _XA_SM_CLIENT_ID = None; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* * client list stuff */ static void free_fsm_client(fsm_client_t *client) { if (!SessionSupport) { return; } if (client->clientId) { free(client->clientId); } free(client); } /* * auth stuff */ static void fprintfhex(register FILE *fp, unsigned int len, char *cp) { static const char hexchars[] = "0123456789abcdef"; for (; len > 0; len--, cp++) { unsigned char s = *cp; putc(hexchars[s >> 4], fp); putc(hexchars[s & 0x0f], fp); } } /* * Host Based Authentication Callback. This callback is invoked if * the connecting client can't offer any authentication methods that * we can accept. We can accept/reject based on the hostname. */ static Bool HostBasedAuthProc(char *hostname) { return (0); /* For now, we don't support host based authentication */ } /* * We use temporary files which contain commands to add/remove entries from * the .ICEauthority file. */ static void write_iceauth(FILE *addfp, FILE *removefp, FIceAuthDataEntry *entry) { if (!SessionSupport) { return; } fprintf(addfp, "add %s \"\" %s %s ", entry->protocol_name, entry->network_id, entry->auth_name); fprintfhex(addfp, entry->auth_data_length, entry->auth_data); fprintf(addfp, "\n"); fprintf( removefp, "remove protoname=%s protodata=\"\" netid=%s authname=%s\n", entry->protocol_name, entry->network_id, entry->auth_name); } static char * unique_filename(char *path, char *prefix, int *pFd) { char *tempFile; tempFile = (char *)safemalloc(strlen(path) + strlen(prefix) + 8); sprintf(tempFile, "%s/%sXXXXXX", path, prefix); *pFd = fvwm_mkstemp(tempFile); if (*pFd == -1) { free(tempFile); tempFile = NULL; } return tempFile; } /* * Provide authentication data to clients that wish to connect */ #define MAGIC_COOKIE_LEN 16 static Status SetAuthentication( int count,FIceListenObj *listenObjs,FIceAuthDataEntry **authDataEntries) { FILE *addfp = NULL; FILE *removefp = NULL; char *path; int original_umask; char command[256]; int i; int fd; if (!SessionSupport) { return 0; } original_umask = umask (0077); /* disallow non-owner access */ path = (char *)getenv("SM_SAVE_DIR"); if (!path) { path = getenv("HOME"); } #ifdef HAVE_GETPWUID if (!path) { struct passwd *pwd; pwd = getpwuid(getuid()); if (pwd) { path = pwd->pw_dir; } } #endif if (!path) { path = "."; } if ((addAuthFile = unique_filename (path, ".fsm-", &fd)) == NULL) { goto bad; } if (!(addfp = fdopen(fd, "wb"))) { goto bad; } if ((remAuthFile = unique_filename (path, ".fsm-", &fd)) == NULL) { goto bad; } if (!(removefp = fdopen(fd, "wb"))) { goto bad; } *authDataEntries = (FIceAuthDataEntry *) safemalloc( count * 2 * sizeof (FIceAuthDataEntry)); for (i = 0; i < count * 2; i += 2) { (*authDataEntries)[i].network_id = FIceGetListenConnectionString(listenObjs[i/2]); (*authDataEntries)[i].protocol_name = "ICE"; (*authDataEntries)[i].auth_name = "MIT-MAGIC-COOKIE-1"; (*authDataEntries)[i].auth_data = FIceGenerateMagicCookie (MAGIC_COOKIE_LEN); (*authDataEntries)[i].auth_data_length = MAGIC_COOKIE_LEN; (*authDataEntries)[i+1].network_id = FIceGetListenConnectionString(listenObjs[i/2]); (*authDataEntries)[i+1].protocol_name = "XSMP"; (*authDataEntries)[i+1].auth_name = "MIT-MAGIC-COOKIE-1"; (*authDataEntries)[i+1].auth_data = FIceGenerateMagicCookie (MAGIC_COOKIE_LEN); (*authDataEntries)[i+1].auth_data_length = MAGIC_COOKIE_LEN; write_iceauth(addfp, removefp, &(*authDataEntries)[i]); write_iceauth(addfp, removefp, &(*authDataEntries)[i+1]); FIceSetPaAuthData(2, &(*authDataEntries)[i]); FIceSetHostBasedAuthProc(listenObjs[i/2], HostBasedAuthProc); } fclose(addfp); fclose(removefp); umask (original_umask); sprintf (command, "iceauth source %s", addAuthFile); system(command); unlink (addAuthFile); return 1; bad: if (addfp) { fclose (addfp); } if (removefp) { fclose (removefp); } if (addAuthFile) { unlink (addAuthFile); free (addAuthFile); } if (remAuthFile) { unlink (remAuthFile); free (remAuthFile); } return 0; } static void FreeAuthenticationData(int count, FIceAuthDataEntry *authDataEntries) { /* Each transport has entries for ICE and XSMP */ char command[256]; int i; if (!SessionSupport) { return; } for (i = 0; i < count * 2; i++) { free(authDataEntries[i].network_id); free(authDataEntries[i].auth_data); } free ((char *) authDataEntries); sprintf (command, "iceauth source %s", remAuthFile); system(command); unlink (remAuthFile); free (addAuthFile); free (remAuthFile); } /* * ice stuff */ static void MyIoErrorHandler(FIceConn ice_conn) { if (!SessionSupport) { return; } if (prev_handler) { (*prev_handler) (ice_conn); } } static void InstallIOErrorHandler(void) { FIceIOErrorHandler default_handler; if (!SessionSupport) { return; } prev_handler = FIceSetIOErrorHandler(NULL); default_handler = FIceSetIOErrorHandler(MyIoErrorHandler); if (prev_handler == default_handler) { prev_handler = NULL; } } static void CloseListeners(void) { if (!SessionSupport) { return; } FIceFreeListenObjs(numTransports, listenObjs); } static void ice_watch_fd( FIceConn conn, FIcePointer client_data, Bool opening, FIcePointer *watch_data) { fsm_ice_conn_t *fice_conn; if (!SessionSupport) { return; } if (opening) { fice_conn = (fsm_ice_conn_t *)safemalloc(sizeof(fsm_ice_conn_t)); fice_conn->ice_conn = conn; fice_conn->fd = FIceConnectionNumber(conn); *watch_data = (FIcePointer) fice_conn; fsm_ice_conn_list = flist_append_obj(fsm_ice_conn_list, fice_conn); fcntl(fice_conn->fd, F_SETFD, FD_CLOEXEC); } else { fice_conn = (fsm_ice_conn_t *)*watch_data; fsm_ice_conn_list = flist_remove_obj(fsm_ice_conn_list, fice_conn); free(fice_conn); } } /* * Session Manager callbacks */ static Status RegisterClientProc( FSmsConn smsConn, FSmPointer managerData, char *previousId) { fsm_client_t *client = (fsm_client_t *) managerData; char *id; int send_save = 0; if (!SessionSupport) { return 0; } #ifdef FVWM_DEBUG_FSM fprintf (stderr, "[%s][RegisterClientProc] On FIceConn fd = %d, received " "REGISTER CLIENT [Previous Id = %s]\n", module_name, FIceConnectionNumber (client->ice_conn), previousId ? previousId : "NULL"); #endif /* ignore previousID!! (we are dummy) */ id = FSmsGenerateClientID(smsConn); if (!FSmsRegisterClientReply(smsConn, id)) { /* cannot happen ? */ if (id) { free(id); } fprintf( stderr, "[%s][RegisterClientProc] ERR -- fail to register " "client", module_name); return 0; } #ifdef FVWM_DEBUG_FSM fprintf (stderr, "[%s][RegisterClientProc] On FIceConn fd = %d, sent " "REGISTER CLIENT REPLY [Client Id = %s]\n", module_name, FIceConnectionNumber (client->ice_conn), id); #endif client->clientId = id; /* client->clientHostname = FSmsClientHostName (smsConn); */ /* we are dummy ... do not do that */ if (send_save) { FSmsSaveYourself( smsConn, FSmSaveLocal, False, FSmInteractStyleNone, False); } return 1; } static void InteractRequestProc(FSmsConn smsConn, FSmPointer managerData, int dialogType) { if (!SessionSupport) { return; } /* no intercation! */ #if 0 FSmsInteract (client->smsConn); #endif } static void InteractDoneProc(FSmsConn smsConn, FSmPointer managerData, Bool cancelShutdown) { /* no intercation! */ } static void SaveYourselfReqProc(FSmsConn smsConn, FSmPointer managerData, int saveType, Bool shutdown, int interactStyle, Bool fast, Bool global) { /* no session to save */ } static void SaveYourselfPhase2ReqProc(FSmsConn smsConn, FSmPointer managerData) { fsm_client_t *client; if (!SessionSupport) { return; } client = (fsm_client_t *)managerData; FSmsSaveYourselfPhase2(client->smsConn); } static void SaveYourselfDoneProc(FSmsConn smsConn, FSmPointer managerData, Bool success) { fsm_client_t *client; if (!SessionSupport) { return; } client = (fsm_client_t *) managerData; FSmsSaveComplete(client->smsConn); } static void CloseDownClient(fsm_client_t *client) { if (!SessionSupport) { return; } #ifdef FVWM_DEBUG_FSM fprintf( stderr, "[%s][CloseDownClient] ICE Connection closed, " "FIceConn fd = %d\n", module_name, FIceConnectionNumber (client->ice_conn)); #endif FSmsCleanUp(client->smsConn); FIceSetShutdownNegotiation(client->ice_conn, False); if (!FIceCloseConnection(client->ice_conn) != FIceClosedNow) { /* do not care */ } client->ice_conn = NULL; client->smsConn = NULL; running_list = flist_remove_obj(running_list, client); free_fsm_client(client); } static void CloseConnectionProc(FSmsConn smsConn, FSmPointer managerData, int count, char **reasonMsgs) { fsm_client_t *client = (fsm_client_t *) managerData; if (!SessionSupport) { return; } FSmFreeReasons(count, reasonMsgs); CloseDownClient(client); } static void SetPropertiesProc( FSmsConn smsConn, FSmPointer managerData, int numProps, FSmProp **props) { int i; if (!SessionSupport) { return; } for (i = 0; i < numProps; i++) { FSmFreeProperty(props[i]); } free ((char *) props); } static void DeletePropertiesProc( FSmsConn smsConn, FSmPointer managerData, int numProps, char **propNames) { int i; if (!SessionSupport) { return; } for (i = 0; i < numProps; i++) { free (propNames[i]); } free ((char *) propNames); } static void GetPropertiesProc(FSmsConn smsConn, FSmPointer managerData) { } static Status NewClientProc( FSmsConn smsConn, FSmPointer managerData, unsigned long *maskRet, FSmsCallbacks *callbacksRet, char **failureReasonRet) { fsm_client_t *nc; if (!SessionSupport) { return 0; } nc = (fsm_client_t *)safemalloc(sizeof (fsm_client_t)); *maskRet = 0; nc->smsConn = smsConn; nc->ice_conn = FSmsGetIceConnection(smsConn); nc->clientId = NULL; running_list = flist_append_obj(running_list, nc); #ifdef FVWM_DEBUG_FSM fprintf( stderr, "[%s][NewClientProc] On FIceConn fd = %d, client " "set up session mngmt protocol\n", module_name, FIceConnectionNumber (nc->ice_conn)); #endif /* * Set up session manager callbacks. */ *maskRet |= FSmsRegisterClientProcMask; callbacksRet->register_client.callback = RegisterClientProc; callbacksRet->register_client.manager_data = (FSmPointer) nc; *maskRet |= FSmsInteractRequestProcMask; callbacksRet->interact_request.callback = InteractRequestProc; callbacksRet->interact_request.manager_data = (FSmPointer) nc; *maskRet |= FSmsInteractDoneProcMask; callbacksRet->interact_done.callback = InteractDoneProc; callbacksRet->interact_done.manager_data = (FSmPointer) nc; *maskRet |= FSmsSaveYourselfRequestProcMask; callbacksRet->save_yourself_request.callback = SaveYourselfReqProc; callbacksRet->save_yourself_request.manager_data = (FSmPointer) nc; *maskRet |= FSmsSaveYourselfP2RequestProcMask; callbacksRet->save_yourself_phase2_request.callback = SaveYourselfPhase2ReqProc; callbacksRet->save_yourself_phase2_request.manager_data = (FSmPointer) nc; *maskRet |= FSmsSaveYourselfDoneProcMask; callbacksRet->save_yourself_done.callback = SaveYourselfDoneProc; callbacksRet->save_yourself_done.manager_data = (FSmPointer) nc; *maskRet |= FSmsCloseConnectionProcMask; callbacksRet->close_connection.callback = CloseConnectionProc; callbacksRet->close_connection.manager_data = (FSmPointer) nc; *maskRet |= FSmsSetPropertiesProcMask; callbacksRet->set_properties.callback = SetPropertiesProc; callbacksRet->set_properties.manager_data = (FSmPointer) nc; *maskRet |= FSmsDeletePropertiesProcMask; callbacksRet->delete_properties.callback = DeletePropertiesProc; callbacksRet->delete_properties.manager_data = (FSmPointer) nc; *maskRet |= FSmsGetPropertiesProcMask; callbacksRet->get_properties.callback = GetPropertiesProc; callbacksRet->get_properties.manager_data = (FSmPointer) nc; return 1; } /* * */ static void CompletNewConnectionMsg(void) { flist *l = pending_ice_conn_list; FIceConn ice_conn; FIceAcceptStatus cstatus; if (!SessionSupport) { return; } while(l != NULL) { ice_conn = (FIceConn)l->object; cstatus = FIceConnectionStatus(ice_conn); if (cstatus == (int)FIceConnectPending) { l = l->next; } else if (cstatus == (int)FIceConnectAccepted) { l = l->next; pending_ice_conn_list = flist_remove_obj( pending_ice_conn_list, ice_conn); #ifdef FVWM_DEBUG_FSM char *connstr; connstr = FIceConnectionString (ice_conn); fprintf(stderr, "[%s][NewConnection] ICE Connection " "opened by client, FIceConn fd = %d, Accept at " "networkId %s\n", module_name, FIceConnectionNumber (ice_conn), connstr); free (connstr); #endif } else { if (FIceCloseConnection (ice_conn) != FIceClosedNow) { /* don't care */ } pending_ice_conn_list = flist_remove_obj( pending_ice_conn_list, ice_conn); #ifdef FVWM_DEBUG_FSM if (cstatus == FIceConnectIOError) { fprintf(stderr, "[%s][NewConnection] IO error " "opening ICE Connection!\n", module_name); } else { fprintf(stderr, "[%s][NewConnection] ICE " "Connection rejected!\n", module_name); } #endif } } } static void NewConnectionMsg(int i) { FIceConn ice_conn; FIceAcceptStatus status; if (!SessionSupport) { status = 0; return; } ice_conn = FIceAcceptConnection(listenObjs[i], &status); #ifdef FVWM_DEBUG_FSM fprintf(stderr, "[%s][NewConnection] %i\n", module_name, i); #endif if (!ice_conn) { #ifdef FVWM_DEBUG_FSM fprintf(stderr, "[%s][NewConnection] " "FIceAcceptConnection failed\n", module_name); #endif } else { pending_ice_conn_list = flist_append_obj(pending_ice_conn_list, ice_conn); CompletNewConnectionMsg(); } } static void ProcessIceMsg(fsm_ice_conn_t *fic) { FIceProcessMessagesStatus status; if (!SessionSupport) { return; } #ifdef FVWM_DEBUG_FSM fprintf(stderr, "[%s][ProcessIceMsg] %i\n", module_name, (int)fic->fd); #endif status = FIceProcessMessages(fic->ice_conn, NULL, NULL); if (status == FIceProcessMessagesIOError) { flist *cl; int found = 0; #ifdef FVWM_DEBUG_FSM fprintf(stderr, "[%s][ProcessIceMsg] IO error on connection\n", module_name); #endif for (cl = running_list; cl; cl = cl->next) { fsm_client_t *client = (fsm_client_t *) cl->object; if (client->ice_conn == fic->ice_conn) { CloseDownClient (client); found = 1; break; } } if (!found) { /* * The client must have disconnected before it was added * to the session manager's running list (i.e. before the * NewClientProc callback was invoked). */ FIceSetShutdownNegotiation (fic->ice_conn, False); if (!FIceCloseConnection(fic->ice_conn) != FIceClosedNow) { /* do not care */ } } } } /* * proxy stuff */ static char *GetClientID(Display *dpy, Window window) { char *client_id = NULL; Window client_leader = None; XTextProperty tp; Atom actual_type; int actual_format; unsigned long nitems; unsigned long bytes_after; unsigned char *prop = NULL; if (!SessionSupport) { return NULL; } if (!_XA_WM_CLIENT_LEADER) { _XA_WM_CLIENT_LEADER = XInternAtom( dpy, "WM_CLIENT_LEADER", False); } if (!_XA_SM_CLIENT_ID) { _XA_SM_CLIENT_ID = XInternAtom(dpy, "SM_CLIENT_ID", False); } if (XGetWindowProperty( dpy, window, _XA_WM_CLIENT_LEADER, 0L, 1L, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &prop) == Success) { if (actual_type == XA_WINDOW && actual_format == 32 && nitems == 1 && bytes_after == 0) { client_leader = (Window)(*(long *)prop); } } if (!client_leader) { client_leader = window; } if (client_leader) { if (XGetTextProperty(dpy, client_leader, &tp, _XA_SM_CLIENT_ID)) { if (tp.encoding == XA_STRING && tp.format == 8 && tp.nitems != 0) { client_id = (char *) tp.value; } } } if (prop) { XFree (prop); } return client_id; } static void set_session_manager(Display *dpy, Window window, char *sm) { Window client_leader = None; Atom actual_type; int actual_format; unsigned long nitems; unsigned long bytes_after; unsigned char *prop = NULL; char *dummy_id; static Atom _XA_SESSION_MANAGER = None; if (!SessionSupport) { return; } dummy_id = "0"; if (!_XA_SESSION_MANAGER) { _XA_SESSION_MANAGER = XInternAtom ( dpy, "SESSION_MANAGER", False); } if (!_XA_WM_CLIENT_LEADER) { _XA_WM_CLIENT_LEADER = XInternAtom( dpy, "WM_CLIENT_LEADER", False); } if (!_XA_SM_CLIENT_ID) { _XA_SM_CLIENT_ID = XInternAtom(dpy, "SM_CLIENT_ID", False); } if (XGetWindowProperty( dpy, window, _XA_WM_CLIENT_LEADER, 0L, 1L, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &prop) == Success) { if (actual_type == XA_WINDOW && actual_format == 32 && nitems == 1 && bytes_after == 0) { client_leader = (Window)(*(long *)prop); } } if (!client_leader) { client_leader = window; } #ifdef FVWM_DEBUG_FSM fprintf( stderr, "[%s][fsm_init] Proxy %s window 0x%lx\n", module_name, (sm)? "On":"Off", client_leader); #endif /* set the client id for ksmserver */ if (sm) { XChangeProperty( dpy, client_leader, _XA_SESSION_MANAGER, XA_STRING, 8, PropModeReplace, (unsigned char *)sm, strlen(sm)); XChangeProperty( dpy, client_leader, _XA_SM_CLIENT_ID, XA_STRING, 8, PropModeReplace, (unsigned char *)dummy_id, strlen(dummy_id)); } else { XDeleteProperty(dpy, client_leader, _XA_SESSION_MANAGER); XDeleteProperty(dpy, client_leader, _XA_SM_CLIENT_ID); } } /* ---------------------------- interface functions ------------------------ */ int fsm_init(char *module) { char errormsg[256]; int i; char *p; if (!SessionSupport) { /* -Wall fix */ MyIoErrorHandler(NULL); HostBasedAuthProc(NULL); ice_watch_fd(0, NULL, 0, NULL); NewClientProc(0, NULL, 0, NULL, NULL); #ifdef FVWM_DEBUG_FSM fprintf( stderr, "[%s][fsm_init] No Session Support\n", module_name); #endif return 0; } if (fsm_init_succeed) { fprintf( stderr, "[%s][fsm_init] <> -- " "Session already Initialized!\n", module_name); return 1; } module_name = module; InstallIOErrorHandler (); #ifdef FVWM_DEBUG_FSM fprintf(stderr, "[%s][fsm_init] FSmsInitialize\n", module_name); #endif if (!FSmsInitialize( module, "1.0", NewClientProc, NULL, HostBasedAuthProc, 256, errormsg)) { fprintf( stderr, "[%s][fsm_init] <> -- " "FSmsInitialize failed: %s\n", module_name, errormsg); return 0; } if (!FIceListenForConnections ( &numTransports, &listenObjs, 256, errormsg)) { fprintf( stderr, "[%s][fsm_init] <> -- " "FIceListenForConnections failed:\n" "%s\n", module_name, errormsg); return 0; } atexit(CloseListeners); if (!SetAuthentication(numTransports, listenObjs, &authDataEntries)) { fprintf( stderr, "[%s][fsm_init] <> -- " "Could not set authorization\n", module_name); return 0; } if (FIceAddConnectionWatch(&ice_watch_fd, NULL) == 0) { fprintf(stderr, "[%s][fsm_init] <> -- " "FIceAddConnectionWatch failed\n", module_name); return 0; } ice_fd = (int *)safemalloc(sizeof(int) * numTransports + 1); for (i = 0; i < numTransports; i++) { ice_fd[i] = FIceGetListenConnectionNumber(listenObjs[i]); } networkIds = FIceComposeNetworkIdList(numTransports, listenObjs); p = (char *)safemalloc( 16 + strlen(networkIds) + 1); sprintf(p, "SESSION_MANAGER=%s", networkIds); putenv(p); #ifdef FVWM_DEBUG_FSM fprintf(stderr,"[%s][fsm_init] OK: %i\n", module_name, numTransports); fprintf(stderr,"\t%s\n", p); #endif fsm_init_succeed = True; return 1; } void fsm_fdset(fd_set *in_fdset) { int i; flist *l = fsm_ice_conn_list; fsm_ice_conn_t *fic; if (!SessionSupport || !fsm_init_succeed) { return; } for (i = 0; i < numTransports; i++) { FD_SET(ice_fd[i], in_fdset); } while(l != NULL) { fic = (fsm_ice_conn_t *)l->object; FD_SET(fic->fd, in_fdset); l = l->next; } } Bool fsm_process(fd_set *in_fdset) { int i; flist *l = fsm_ice_conn_list; fsm_ice_conn_t *fic; if (!SessionSupport || !fsm_init_succeed) { return False; } if (pending_ice_conn_list != NULL) { CompletNewConnectionMsg(); } while(l != NULL) { fic = (fsm_ice_conn_t *)l->object; if (FD_ISSET(fic->fd, in_fdset)) { ProcessIceMsg(fic); } l = l->next; } for (i = 0; i < numTransports; i++) { if (FD_ISSET(ice_fd[i], in_fdset)) { NewConnectionMsg(i); } } if (pending_ice_conn_list != NULL) { return True; } return False; } /* this try to explain to ksmserver and various sm poxies that they should not * connect our non XSMP award leader window to the top level sm */ void fsm_proxy(Display *dpy, Window win, char *sm) { char *client_id; flist *l = running_list; Bool found = False; if (!SessionSupport || !fsm_init_succeed) { return; } client_id = GetClientID(dpy, win); if (client_id != NULL && strcmp("0", client_id) != 0) { for (l = running_list; l; l = l->next) { fsm_client_t *client = (fsm_client_t *) l->object; if (client->clientId && strcmp(client->clientId, client_id) == 0) { found = 1; break; } } } if (found) { return; } set_session_manager(dpy, win, sm); } void fsm_close(void) { if (!SessionSupport || !fsm_init_succeed) { return; } FreeAuthenticationData(numTransports, authDataEntries); } fvwm-2.6.5.orig/libs/Flocale.c0000644000175000017500000015761611313027641014302 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* FlocaleRotateDrawString is strongly inspired by some part of xvertext * taken from wmx */ /* Here the copyright for this function: */ /* xvertext, Copyright (c) 1992 Alan Richardson (mppa3@uk.ac.sussex.syma) * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both the * copyright notice and this permission notice appear in supporting * documentation. All work developed as a consequence of the use of * this program should duly acknowledge such use. No representations are * made about the suitability of this software for any purpose. It is * provided "as is" without express or implied warranty. * * Minor modifications by Chris Cannam for wm2/wmx * Major modifications by Kazushi (Jam) Marukawa for wm2/wmx i18n patch * Simplification and complications by olicha for use with fvwm */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include #include #include "defaults.h" #include "fvwmlib.h" #include "Graphics.h" #include "ColorUtils.h" #include "Strings.h" #include "Parse.h" #include "PictureBase.h" #include "Flocale.h" #include "FlocaleCharset.h" #include "FBidi.h" #include "FftInterface.h" #include "Colorset.h" #include "Ficonv.h" #include "CombineChars.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ #define FSwitchDrawString(use_16, dpy, d, gc, x, y, s8, s16, l) \ (use_16) ? \ XDrawString16(dpy, d, gc, x, y, s16, l) : \ XDrawString(dpy, d, gc, x, y, s8, l) #define FSwitchDrawImageString(use_16, dpy, d, gc, x, y, s8, s16, l) \ (use_16) ? \ XDrawImageString16(dpy, d, gc, x, y, s16, l) : \ XDrawImageString(dpy, d, gc, x, y, s8, l) /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static FlocaleFont *FlocaleFontList = NULL; static char *Flocale = NULL; static char *Fmodifiers = NULL; /* TODO: make these (static const char *) */ static char *fft_fallback_font = FLOCALE_FFT_FALLBACK_FONT; static char *mb_fallback_font = FLOCALE_MB_FALLBACK_FONT; static char *fallback_font = FLOCALE_FALLBACK_FONT; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* * shadow local functions */ static void FlocaleParseShadow(char *str, int *shadow_size, int *shadow_offset, int *direction, char * fontname, char *module) { char *dir_str; char *token; multi_direction_t dir; *direction = MULTI_DIR_NONE; token = PeekToken(str, &dir_str); if (token == NULL || *token == 0 || (GetIntegerArguments(token, NULL, shadow_size, 1) != 1) || *shadow_size < 0) { *shadow_size = 0; fprintf(stderr,"[%s][FlocaleParseShadow]: WARNING -- bad " "shadow size in font name:\n\t'%s'\n", (module)? module: "fvwm", fontname); return; } if (*shadow_size == 0) { return; } /* some offset ? */ if (dir_str && *dir_str && (GetIntegerArguments(dir_str, NULL, shadow_offset, 1) == 1)) { if (*shadow_offset < 0) { *shadow_offset = 0; fprintf(stderr,"[%s][FlocaleParseShadow]: WARNING -- " "bad shadow offset in font name:\n\t'%s'\n", (module)? module: "fvwmlibs", fontname); } PeekToken(dir_str, &dir_str); } while (dir_str && *dir_str && *dir_str != '\n') { dir = gravity_parse_multi_dir_argument(dir_str, &dir_str); if (dir == MULTI_DIR_NONE) { fprintf(stderr,"[%s][FlocaleParseShadow]: WARNING -- " "bad shadow direction in font description:\n" "\t%s\n", (module)? module: "fvwmlibs", fontname); PeekToken(dir_str, &dir_str); /* skip it */ } else { *direction |= dir; } } if (*direction == MULTI_DIR_NONE) *direction = MULTI_DIR_SE; } /* * some simple converters */ static int FlocaleChar2bOneCharToUtf8(XChar2b c, char *buf) { int len; char byte1 = c.byte1; char byte2 = c.byte2; unsigned short ucs2 = ((unsigned short)byte1 << 8) + byte2; if(ucs2 <= 0x7f) { len = 1; buf[0] = (char)ucs2; buf[1] = 0; } else if(ucs2 <= 0x7ff) { len = 2; buf[0] = (ucs2 >> 6) | 0xc0; buf[1] = (ucs2 & 0x3f) | 0x80; buf[2] = 0; } else { len = 3; buf[0] = (ucs2 >> 12) | 0xe0; buf[1] = ((ucs2 & 0xfff) >> 6) | 0x80; buf[2] = (ucs2 & 0x3f) | 0x80; buf[3] = 0; } return len; } /* return number of bytes of character at current position (pointed to by str) */ int FlocaleStringNumberOfBytes(FlocaleFont *flf, const char *str) { int bytes = 0; if(FLC_ENCODING_TYPE_IS_UTF_8(flf->fc)) { /* handle UTF-8 */ if ((str[0] & 0x80) == 0) { bytes = 1; } else if((str[0] & ~0xdf) == 0) { bytes = 2; } else { /* this handles only 16-bit Unicode */ bytes = 3; } } else if(flf->flags.is_mb) { /* non-UTF-8 multibyte encoding */ if ((str[0] & 0x80) == 0) { bytes = 1; } else { bytes = 2; } } else { /* we must be using an "ordinary" 8-bit encoding */ bytes = 1; } return bytes; } /* given a string, font specifying its locale and a byte offset gives character offset */ int FlocaleStringByteToCharOffset(FlocaleFont *flf, const char *str, int offset) { const char *curr_ptr = str; int i = 0; int len = strlen(str); int coffset = 0; int curr_len; for(i = 0 ; i < offset && i < len ; i += curr_len, curr_ptr += curr_len, coffset++) { curr_len = FlocaleStringNumberOfBytes(flf, curr_ptr); } return coffset; } /* like above but reversed, ie. return byte offset corresponding to given charater offset */ int FlocaleStringCharToByteOffset(FlocaleFont *flf, const char *str, int coffset) { const char *curr_ptr = str; int i; int len = strlen(str); int offset = 0; int curr_len; for(i = 0 ; i < coffset && i < len ; offset += curr_len, curr_ptr += curr_len, i++) { curr_len = FlocaleStringNumberOfBytes(flf, curr_ptr); } return offset; } /* return length of string in characters */ int FlocaleStringCharLength(FlocaleFont *flf, const char *str) { int i, len; int str_len = strlen(str); for(i = 0, len = 0 ; i < str_len ; i += FlocaleStringNumberOfBytes(flf, str+i), len++); return len; } static XChar2b *FlocaleUtf8ToUnicodeStr2b(char *str, int len, int *nl) { XChar2b *str2b = NULL; int i = 0, j = 0, t; str2b = (XChar2b *)safemalloc((len+1)*sizeof(XChar2b)); while (i < len && str[i] != 0) { if ((str[i] & 0x80) == 0) { str2b[j].byte2 = str[i]; str2b[j].byte1 = 0; } else if ((str[i] & ~0xdf) == 0 && i+1 < len) { t = ((str[i] & 0x1f) << 6) + (str[i+1] & 0x3f); str2b[j].byte2 = (unsigned char)(t & 0xff); str2b[j].byte1 = (unsigned char)(t >> 8); i++; } else if (i+2 > 8); i += 2; } i++; j++; } *nl = j; return str2b; } /* Note: this function is not expected to work; good mb rendering * should be (and is) done using Xmb functions and not XDrawString16 * (or with iso10646-1 fonts and setting the encoding). * This function is used when the locale does not correspond to the font. * It works with "EUC fonts": ksc5601.1987-0, gb2312 and maybe also * cns11643-*. It works patially with jisx* and big5-0. Should try gbk-0, * big5hkscs-0, and cns-11643- */ static XChar2b *FlocaleStringToString2b( Display *dpy, FlocaleFont *flf, char *str, int len, int *nl) { XChar2b *str2b = NULL; char *tmp = NULL; Bool free_str = False; int i = 0, j = 0; Bool euc = True; /* KSC5601 (EUC-KR), GB2312 (EUC-CN), CNS11643-1986-1 * (EUC-TW) and converted jisx (EUC-JP) */ if (flf->fc && StrEquals(flf->fc->x,"jisx0208.1983-0")) { tmp = FiconvCharsetToCharset( dpy, flf->fc, FlocaleCharsetGetEUCJPCharset(), str, len); if (tmp != NULL) { free_str = True; str = tmp; len = strlen(tmp); } } else if (flf->fc && StrEquals(flf->fc->x,"big5-0")) { euc = False; } str2b = (XChar2b *)safemalloc((len+1)*sizeof(XChar2b)); if (euc) { while (i < len && str[i] != 0) { if ((str[i] & 0x80) == 0) { /* seems ok with KSC5601 and GB2312 as we get * almost the ascii. I do no try * CNS11643-1986-1. Should convert to ascii * with jisx */ str2b[j].byte1 = 0x23; /* magic number! */ str2b[j].byte2 = str[i++]; } else if (i+1 < len) { /* mb gl (for gr replace & 0x7f by | 0x80 ...) */ str2b[j].byte1 = str[i++] & 0x7f; str2b[j].byte2 = str[i++] & 0x7f; } else { str2b[j].byte1 = 0; str2b[j].byte2 = 0; i++; } j++; } } else /* big5 and others not yet tested */ { while (i < len && str[i] != 0) { if ((str[i] & 0x80) == 0) { /* we should convert to ascii */ #if 0 str2b[j].byte1 = 0xa2; /* magic number! */ str2b[j].byte2 = str[i++]; #endif /* a blanck char ... */ str2b[j].byte1 = 0x21; str2b[j].byte2 = 0x21; } else if (i+1 < len) { str2b[j].byte1 = str[i++]; str2b[j].byte2 = str[i++]; } else { str2b[j].byte1 = 0; str2b[j].byte2 = 0; i++; } j++; } } *nl = j; if (free_str) free(str); return str2b; } static char *FlocaleEncodeString( Display *dpy, FlocaleFont *flf, char *str, int *do_free, int len, int *nl, int *is_rtl, superimpose_char_t **comb_chars, int **l_to_v) { char *str1, *str2, *str3; int len1; int len2; int i; Bool do_iconv = True; const char *bidi_charset; len1 = len; len2 = 0; if (is_rtl != NULL) *is_rtl = False; *do_free = False; *nl = len; if (flf->str_fc == NULL || flf->fc == NULL || flf->fc == flf->str_fc) { do_iconv = False; } str1 = str; if (FiconvSupport) { char *tmp_str; /* first process combining characters */ tmp_str = FiconvCharsetToUtf8( dpy, flf->str_fc, (const char *)str,len); /* if conversion to UTF-8 failed str1 will be NULL */ if(tmp_str != NULL) { /* do combining */ len = CombineChars((unsigned char *)tmp_str, strlen(tmp_str), comb_chars, l_to_v); /* returns the length of the resulting UTF-8 string */ /* convert back to current charset */ str1 = FiconvUtf8ToCharset( dpy, flf->str_fc, (const char *)tmp_str,len); if (tmp_str != str1) { free(tmp_str); } if (str1) { *nl = len = strlen(str1); *do_free = True; } else { /* convert back to current charset fail */ len = strlen(str); str1 = str; } } } if (FiconvSupport && do_iconv) { str2 = FiconvCharsetToCharset( dpy, flf->str_fc, flf->fc, (const char *)str1, len); if (str2 == NULL) { /* fail to convert */ return str1; } if (str2 != str1) { if (*do_free && str1) { free(str1); str1 = str2; } *do_free = True; len1 = strlen(str2); } } else { str2 = str1; len1 = len; /* initialise array with composing characters (empty) */ if(comb_chars != NULL && *comb_chars == NULL) { *comb_chars = (superimpose_char_t *) safemalloc(sizeof(superimpose_char_t)); (*comb_chars)[0].position = -1; (*comb_chars)[0].c.byte1 = 0; (*comb_chars)[0].c.byte2 = 0; } /* initialise logic to visual mapping here if that is demanded (this is default when no combining has been done (1-to-1)) */ if(l_to_v != NULL && *l_to_v == NULL) { *l_to_v = (int*)safemalloc((len + 1) * sizeof(int)); for(i = 0 ; i < len ; i++) (*l_to_v)[i] = i; (*l_to_v)[len] = -1; } } if (FlocaleGetBidiCharset(dpy, flf->str_fc) != NULL && (bidi_charset = FlocaleGetBidiCharset(dpy, flf->fc)) != NULL) { str3 = FBidiConvert(str2, bidi_charset, len1, is_rtl, &len2, comb_chars != NULL ? *comb_chars : NULL, l_to_v != NULL ? *l_to_v : NULL); if (str3 != NULL && str3 != str2) { if (*do_free) { free(str2); } *do_free = True; len1 = len2; str1 = str3; } /* if we failed to do BIDI convert, return string string from combining phase */ else { str1 = str2; /* we already have the logical to visual mapping from combining phase */ } } *nl = len1; return str1; } static void FlocaleEncodeWinString( Display *dpy, FlocaleFont *flf, FlocaleWinString *fws, int *do_free, int *len, superimpose_char_t **comb_chars, int **l_to_v) { int len2b; fws->e_str = FlocaleEncodeString( dpy, flf, fws->str, do_free, *len, len, NULL, comb_chars, l_to_v); fws->str2b = NULL; if (flf->font != None) { if (FLC_ENCODING_TYPE_IS_UTF_8(flf->fc)) { fws->str2b = FlocaleUtf8ToUnicodeStr2b( fws->e_str, *len, &len2b); } else if (flf->flags.is_mb) { fws->str2b = FlocaleStringToString2b( dpy, flf, fws->e_str, *len, &len2b); } } } /* * Text Drawing with a FontStruct */ static void FlocaleFontStructDrawString( Display *dpy, FlocaleFont *flf, Drawable d, GC gc, int x, int y, Pixel fg, Pixel fgsh, Bool has_fg_pixels, FlocaleWinString *fws, int len, Bool image) { int xt = x; int yt = y; int is_string16; flocale_gstp_args gstp_args; is_string16 = (FLC_ENCODING_TYPE_IS_UTF_8(flf->fc) || flf->flags.is_mb); if (is_string16 && fws->str2b == NULL) { return; } if (image) { /* for rotated drawing */ FSwitchDrawImageString( is_string16, dpy, d, gc, x, y, fws->e_str, fws->str2b, len); } else { FlocaleInitGstpArgs(&gstp_args, flf, fws, x, y); /* normal drawing */ if (flf->shadow_size != 0 && has_fg_pixels == True) { XSetForeground(dpy, fws->gc, fgsh); while (FlocaleGetShadowTextPosition( &xt, &yt, &gstp_args)) { FSwitchDrawString( is_string16, dpy, d, gc, xt, yt, fws->e_str, fws->str2b, len); } } if (has_fg_pixels == True) { XSetForeground(dpy, gc, fg); } xt = gstp_args.orig_x; yt = gstp_args.orig_y; FSwitchDrawString( is_string16, dpy, d, gc, xt,yt, fws->e_str, fws->str2b, len); } return; } /* * Rotated Text Drawing with a FontStruct or a FontSet */ static void FlocaleRotateDrawString( Display *dpy, FlocaleFont *flf, FlocaleWinString *fws, Pixel fg, Pixel fgsh, Bool has_fg_pixels, int len, superimpose_char_t *comb_chars, int *pixel_pos) { static GC my_gc = None; static GC font_gc = None; int j, i, xpfg, ypfg, xpsh, ypsh; unsigned char *normal_data, *rotated_data; unsigned int normal_w, normal_h, normal_len; unsigned int rotated_w, rotated_h, rotated_len; char val; int width, height, descent, min_offset; XImage *image, *rotated_image; Pixmap canvas_pix, rotated_pix; flocale_gstp_args gstp_args; char buf[4]; if (fws->str == NULL || len < 1) { return; } if (fws->flags.text_rotation == ROTATION_0) { return; /* should not happen */ } if (my_gc == None) { my_gc = fvwmlib_XCreateGC(dpy, fws->win, 0, NULL); } XCopyGC(dpy, fws->gc, GCForeground|GCBackground, my_gc); /* width and height (no shadow!) */ width = FlocaleTextWidth(flf, fws->str, len) - FLF_SHADOW_WIDTH(flf); height = flf->height - FLF_SHADOW_HEIGHT(flf); descent = flf->descent - FLF_SHADOW_DESCENT(flf);; if (width < 1) width = 1; if (height < 1) height = 1; /* glyph width and height of the normal text */ normal_w = width; normal_h = height; /* width in bytes */ normal_len = (normal_w - 1) / 8 + 1; /* create and clear the canvas */ canvas_pix = XCreatePixmap(dpy, fws->win, width, height, 1); if (font_gc == None) { font_gc = fvwmlib_XCreateGC(dpy, canvas_pix, 0, NULL); } XSetBackground(dpy, font_gc, 0); XSetForeground(dpy, font_gc, 0); XFillRectangle(dpy, canvas_pix, font_gc, 0, 0, width, height); /* draw the character center top right on canvas */ XSetForeground(dpy, font_gc, 1); if (flf->font != NULL) { XSetFont(dpy, font_gc, flf->font->fid); FlocaleFontStructDrawString(dpy, flf, canvas_pix, font_gc, 0, height - descent, fg, fgsh, has_fg_pixels, fws, len, True); } else if (flf->fontset != None) { XmbDrawString( dpy, canvas_pix, flf->fontset, font_gc, 0, height - descent, fws->e_str, len); } /* here take care of superimposing chars */ i = 0; if(comb_chars != NULL) { while(comb_chars[i].c.byte1 != 0 && comb_chars[i].c.byte2 != 0) { /* draw composing character on top of corresponding "real" character */ FlocaleWinString tmp_fws = *fws; int offset = pixel_pos[comb_chars[i].position]; int curr_len = FlocaleChar2bOneCharToUtf8( comb_chars[i].c, buf); int out_len; char *buf2 = FiconvUtf8ToCharset( dpy, flf->str_fc, (const char *)buf,curr_len); if(buf2 == NULL) { /* if conversion failed, combinational char is not representable in current charset */ /* just replace with empty string */ buf2 = (char *)safemalloc(sizeof(char)); buf2[0] = 0; } tmp_fws.e_str = buf2; tmp_fws.str2b = NULL; if(flf->fontset != None) { XmbDrawString(dpy, canvas_pix, flf->fontset, fws->gc, offset, height - descent, buf2, strlen(buf2)); } else if(flf->font != None) { if (FLC_ENCODING_TYPE_IS_UTF_8(flf->fc)) { tmp_fws.str2b = (XChar2b *) safemalloc(2 * sizeof(XChar2b)); tmp_fws.str2b[0] = comb_chars[i].c; tmp_fws.str2b[1].byte1 = 0; tmp_fws.str2b[1].byte2 = 0; out_len = 1; } else if (flf->flags.is_mb) { tmp_fws.str2b = FlocaleStringToString2b( dpy, flf, tmp_fws.e_str, curr_len, &out_len); } else { out_len = strlen(buf2); } XSetFont(dpy, font_gc, flf->font->fid); FlocaleFontStructDrawString( dpy, flf, canvas_pix, font_gc, offset, height - descent, fg, fgsh, has_fg_pixels, &tmp_fws, out_len, True); } free(buf2); if(tmp_fws.str2b != NULL) { free(tmp_fws.str2b); } i++; } } /* reserve memory for the first XImage */ normal_data = (unsigned char *)safemalloc(normal_len * normal_h); /* create depth 1 XImage */ if ((image = XCreateImage( dpy, Pvisual, 1, XYBitmap, 0, (char *)normal_data, normal_w, normal_h, 8, 0)) == NULL) { return; } image->byte_order = image->bitmap_bit_order = MSBFirst; /* extract character from canvas */ XGetSubImage( dpy, canvas_pix, 0, 0, normal_w, normal_h, 1, XYPixmap, image, 0, 0); image->format = XYBitmap; /* width, height of the rotated text */ if (fws->flags.text_rotation == ROTATION_180) { rotated_w = normal_w; rotated_h = normal_h; } else /* vertical text */ { rotated_w = normal_h; rotated_h = normal_w; } /* width in bytes */ rotated_len = (rotated_w - 1) / 8 + 1; /* reserve memory for the rotated image */ rotated_data = (unsigned char *)safecalloc(rotated_h * rotated_len, 1); /* create the rotated X image */ if ((rotated_image = XCreateImage( dpy, Pvisual, 1, XYBitmap, 0, (char *)rotated_data, rotated_w, rotated_h, 8, 0)) == NULL) { return; } rotated_image->byte_order = rotated_image->bitmap_bit_order = MSBFirst; /* map normal text data to rotated text data */ for (j = 0; j < rotated_h; j++) { for (i = 0; i < rotated_w; i++) { /* map bits ... */ if (fws->flags.text_rotation == ROTATION_270) val = normal_data[ i * normal_len + (normal_w - j - 1) / 8 ] & (128 >> ((normal_w - j - 1) % 8)); else if (fws->flags.text_rotation == ROTATION_180) val = normal_data[ (normal_h - j - 1) * normal_len + (normal_w - i - 1) / 8 ] & (128 >> ((normal_w - i - 1) % 8)); else /* ROTATION_90 */ val = normal_data[ (normal_h - i - 1) * normal_len + j / 8] & (128 >> (j % 8)); if (val) rotated_data[j * rotated_len + i / 8] |= (128 >> (i % 8)); } } /* create the character's bitmap and put the image on it */ rotated_pix = XCreatePixmap(dpy, fws->win, rotated_w, rotated_h, 1); XPutImage( dpy, rotated_pix, font_gc, rotated_image, 0, 0, 0, 0, rotated_w, rotated_h); /* free the image and data */ XDestroyImage(image); XDestroyImage(rotated_image); /* free pixmap and GC */ XFreePixmap(dpy, canvas_pix); /* x and y corrections: we fill a rectangle! */ min_offset = FlocaleGetMinOffset(flf, fws->flags.text_rotation); switch (fws->flags.text_rotation) { case ROTATION_90: /* CW */ xpfg = fws->x - min_offset; ypfg = fws->y; break; case ROTATION_180: xpfg = fws->x; ypfg = fws->y - min_offset + FLF_SHADOW_BOTTOM_SIZE(flf); break; case ROTATION_270: /* CCW */ xpfg = fws->x - min_offset; ypfg = fws->y; break; case ROTATION_0: default: xpfg = fws->x; ypfg = fws->y - min_offset; break; } xpsh = xpfg; ypsh = ypfg; /* write the image on the window */ XSetFillStyle(dpy, my_gc, FillStippled); XSetStipple(dpy, my_gc, rotated_pix); FlocaleInitGstpArgs(&gstp_args, flf, fws, xpfg, ypfg); if (flf->shadow_size != 0 && has_fg_pixels == True) { XSetForeground(dpy, my_gc, fgsh); while (FlocaleGetShadowTextPosition(&xpsh, &ypsh, &gstp_args)) { XSetTSOrigin(dpy, my_gc, xpsh, ypsh); XFillRectangle( dpy, fws->win, my_gc, xpsh, ypsh, rotated_w, rotated_h); } } xpsh = gstp_args.orig_x; ypsh = gstp_args.orig_y; XSetTSOrigin(dpy, my_gc, xpsh, ypsh); XFillRectangle(dpy, fws->win, my_gc, xpsh, ypsh, rotated_w, rotated_h); XFreePixmap(dpy, rotated_pix); return; } /* * Fonts info and checking */ static char *FlocaleGetFullNameOfFontStruct(Display *dpy, XFontStruct *font) { char *full_name = NULL; unsigned long value; if (XGetFontProperty(font, XA_FONT, &value)) { full_name = XGetAtomName(dpy, value); } return full_name; } static char *FlocaleGetCharsetOfFontStruct(Display *dpy, XFontStruct *font) { int i = 0; int count = 0; char *charset = NULL; char *full_name; full_name = FlocaleGetFullNameOfFontStruct(dpy, font); if (full_name == NULL) { return NULL; } while(full_name[i] != '\0' && count < 13) { if (full_name[i] == '-') { count++; } i++; } if (count != 13) { return NULL; } CopyString(&charset, full_name+i); XFree(full_name); return charset; } static char *FlocaleGetCharsetFromName(char *name) { int l,i,e; char *charset; l = strlen(name); i = l-1; while(i >= 0 && name[i] != '-') { i--; } if (i == 0 || i == l-1) { return NULL; } i--; e = i; while(i >= 0 && name[i] != '-') { i--; } if (i <= 0 || e == i) { return NULL; } CopyString(&charset, name + i + 1); return charset; } /* return NULL if it is not reasonable to load a FontSet. * Currently return name if it is reasonable to load a FontSet, but in the * future we may want to transform name for faster FontSet loading */ static char *FlocaleFixNameForFontSet(Display *dpy, char *name, char *module) { char *new_name; char *charset; XFontStruct *test_font = NULL; if (!name) { return NULL; } new_name = name; if (strchr(name, ',')) { /* tmp, do not handle "," separated list */ return name; } charset = FlocaleGetCharsetFromName(name); if (charset == NULL && !strchr(name, '*') && !strchr(name, '?')) { /* probably a font alias! */ if ((test_font = XLoadQueryFont(dpy, name))) { charset = FlocaleGetCharsetOfFontStruct(dpy, test_font); XFreeFont(dpy, test_font); } } if (charset != NULL) { if (!strchr(charset, '*') && !strchr(charset, '?') && !FlocaleCharsetIsCharsetXLocale(dpy, charset, module)) { /* if the charset is fully specified and do not match * one of the X locale charset */ new_name = NULL; #if 0 fprintf(stderr,"[%s][FlocaleGetFontSet]: WARNING -- " "Use of a non X locale charset '%s' when " "loading font: %s\n", (module)? module:"fvwmlibs", charset, name); #endif } free(charset); } return new_name; } /* * Fonts loading */ static FlocaleFont *FlocaleGetFftFont( Display *dpy, char *fontname, char *encoding, char *module) { FftFontType *fftf = NULL; FlocaleFont *flf = NULL; char *fn, *hints = NULL; hints = GetQuotedString(fontname, &fn, "/", NULL, NULL, NULL); if (fn == NULL) { fn = fft_fallback_font; } else if (*fn == '\0') { free(fn); fn = fft_fallback_font; } fftf = FftGetFont(dpy, fn, module); if (fftf == NULL) { if (fn != NULL && fn != fft_fallback_font) { free(fn); } return NULL; } flf = (FlocaleFont *)safemalloc(sizeof(FlocaleFont)); memset(flf, '\0', sizeof(FlocaleFont)); flf->count = 1; flf->fftf = *fftf; FlocaleCharsetSetFlocaleCharset(dpy, flf, hints, encoding, module); FftGetFontHeights( &flf->fftf, &flf->height, &flf->ascent, &flf->descent); FftGetFontWidths(flf, &flf->max_char_width); free(fftf); if (fn != NULL && fn != fft_fallback_font) { free(fn); } return flf; } static FlocaleFont *FlocaleGetFontSet( Display *dpy, char *fontname, char *encoding, char *module) { static int mc_errors = 0; FlocaleFont *flf = NULL; XFontSet fontset = NULL; char **ml; int mc,i; char *ds; XFontSetExtents *fset_extents; char *fn, *hints = NULL, *fn_fixed = NULL; hints = GetQuotedString(fontname, &fn, "/", NULL, NULL, NULL); if (*fn == '\0') { free(fn); fn = fn_fixed = mb_fallback_font; } else if (!(fn_fixed = FlocaleFixNameForFontSet(dpy, fn, module))) { if (fn != NULL && fn != mb_fallback_font) { free(fn); } return NULL; } if (!(fontset = XCreateFontSet(dpy, fn_fixed, &ml, &mc, &ds))) { if (fn_fixed && fn_fixed != fn) { free(fn_fixed); } if (fn != NULL && fn != mb_fallback_font) { free(fn); } return NULL; } if (mc > 0) { if (mc_errors <= FLOCALE_NUMBER_MISS_CSET_ERR_MSG) { mc_errors++; fprintf(stderr, "[%s][FlocaleGetFontSet]: (%s)" " Missing font charsets:\n", (module)? module: "fvwmlibs", fontname); for (i = 0; i < mc; i++) { fprintf(stderr, "%s", ml[i]); if (i < mc - 1) fprintf(stderr, ", "); } fprintf(stderr, "\n"); if (mc_errors == FLOCALE_NUMBER_MISS_CSET_ERR_MSG) { fprintf(stderr, "[%s][FlocaleGetFontSet]: No more" " missing charset reportings\n", (module)? module: "fvwmlibs"); } } XFreeStringList(ml); } flf = (FlocaleFont *)safemalloc(sizeof(FlocaleFont)); memset(flf, '\0', sizeof(FlocaleFont)); flf->count = 1; flf->fontset = fontset; FlocaleCharsetSetFlocaleCharset(dpy, flf, hints, encoding, module); fset_extents = XExtentsOfFontSet(fontset); flf->height = fset_extents->max_ink_extent.height; flf->ascent = - fset_extents->max_ink_extent.y; flf->descent = fset_extents->max_ink_extent.height + fset_extents->max_ink_extent.y; flf->max_char_width = fset_extents->max_ink_extent.width; if (fn_fixed && fn_fixed != fn) { free(fn_fixed); } if (fn != NULL && fn != mb_fallback_font) { free(fn); } return flf; } static FlocaleFont *FlocaleGetFont( Display *dpy, char *fontname, char *encoding, char *module) { XFontStruct *font = NULL; FlocaleFont *flf; char *str,*fn,*tmp; char *hints = NULL; hints = GetQuotedString(fontname, &tmp, "/", NULL, NULL, NULL); str = GetQuotedString(tmp, &fn, ",", NULL, NULL, NULL); while (!font && fn) { if (*fn == '\0') { free(fn); fn = fallback_font; } font = XLoadQueryFont(dpy, fn); if (fn != NULL && fn != fallback_font) { free(fn); fn = NULL; } if (!font && str && *str) { str = GetQuotedString(str, &fn, ",", NULL, NULL, NULL); } } if (font == NULL) { if (fn != NULL && fn != fallback_font) { free(fn); } if (tmp != NULL) { free(tmp); } return NULL; } flf = (FlocaleFont *)safemalloc(sizeof(FlocaleFont)); memset(flf, '\0', sizeof(FlocaleFont)); flf->count = 1; flf->fontset = None; flf->fftf.fftfont = NULL; flf->font = font; FlocaleCharsetSetFlocaleCharset(dpy, flf, hints, encoding, module); flf->height = font->max_bounds.ascent + font->max_bounds.descent; flf->ascent = font->max_bounds.ascent; flf->descent = font->max_bounds.descent; flf->max_char_width = font->max_bounds.width; if (flf->font->max_byte1 > 0) flf->flags.is_mb = True; if (fn != NULL && fn != fallback_font) { free(fn); } if (tmp != NULL) { free(tmp); } return flf; } static FlocaleFont *FlocaleGetFontOrFontSet( Display *dpy, char *fontname, char *encoding, char *fullname, char *module) { FlocaleFont *flf = NULL; if (fontname && strlen(fontname) > 3 && strncasecmp("xft:", fontname, 4) == 0) { if (FftSupport) { flf = FlocaleGetFftFont( dpy, fontname+4, encoding, module); } if (flf) { CopyString(&flf->name, fullname); } return flf; } if (flf == NULL && Flocale != NULL && fontname) { flf = FlocaleGetFontSet(dpy, fontname, encoding, module); } if (flf == NULL && fontname) { flf = FlocaleGetFont(dpy, fontname, encoding, module); } if (flf && fontname) { if (StrEquals(fullname, mb_fallback_font)) { flf->name = mb_fallback_font; } else if (StrEquals(fullname, fallback_font)) { flf->name = fallback_font; } else { CopyString(&flf->name, fullname); } return flf; } return NULL; } /* * locale local functions */ static void FlocaleSetlocaleForX( int category, const char *locale, const char *module) { if ((Flocale = setlocale(category, locale)) == NULL) { fprintf(stderr, "[%s][%s]: ERROR -- Cannot set locale. Please check" " your $LC_CTYPE or $LANG.\n", (module == NULL)? "" : module, "FlocaleSetlocaleForX"); return; } if (!XSupportsLocale()) { fprintf(stderr, "[%s][%s]: WARNING -- X does not support locale %s\n", (module == NULL)? "": module, "FlocaleSetlocaleForX", Flocale); Flocale = NULL; } } /* ---------------------------- interface functions ------------------------ */ /* * locale initialisation */ void FlocaleInit( int category, const char *locale, const char *modifiers, const char *module) { FlocaleSetlocaleForX(category, locale, module); if (Flocale == NULL) return; if (modifiers != NULL && (Fmodifiers = XSetLocaleModifiers(modifiers)) == NULL) { fprintf(stderr, "[%s][%s]: WARNING -- Cannot set locale modifiers\n", (module == NULL)? "": module, "FlocaleInit"); } #if FLOCALE_DEBUG_SETLOCALE fprintf(stderr,"[%s][FlocaleInit] locale: %s, modifier: %s\n", module, Flocale, Fmodifiers); #endif } /* * fonts loading */ char *prefix_list[] = { "Shadow=", "StringEncoding=", NULL }; FlocaleFont *FlocaleLoadFont(Display *dpy, char *fontname, char *module) { FlocaleFont *flf = FlocaleFontList; Bool ask_default = False; char *t; char *str, *opt_str, *encoding= NULL, *fn = NULL; int shadow_size = 0; int shadow_offset = 0; int shadow_dir = MULTI_DIR_SE; int i; /* removing quoting for modules */ if (fontname && (t = strchr("\"'`", *fontname))) { char c = *t; fontname++; if (fontname[strlen(fontname)-1] == c) fontname[strlen(fontname)-1] = 0; } if (fontname == NULL || *fontname == 0) { ask_default = True; fontname = mb_fallback_font; } while (flf) { char *c1, *c2; for (c1 = fontname, c2 = flf->name; *c1 && *c2; ++c1, ++c2) { if (*c1 != *c2) { break; } } if (!*c1 && !*c2) { flf->count++; return flf; } flf = flf->next; } /* not cached load the font as a ";" separated list */ /* But first see if we have a shadow relief and/or an encoding */ str = fontname; while ((i = GetTokenIndex(str, prefix_list, -1, &str)) > -1) { str = GetQuotedString(str, &opt_str, ":", NULL, NULL, NULL); switch(i) { case 0: /* shadow= */ FlocaleParseShadow( opt_str, &shadow_size, &shadow_offset, &shadow_dir, fontname, module); break; case 1: /* encoding= */ if (encoding != NULL) { free(encoding); encoding = NULL; } if (opt_str && *opt_str) { CopyString(&encoding, opt_str); } break; default: break; } if (opt_str != NULL) free(opt_str); } if (str && *str) { str = GetQuotedString(str, &fn, ";", NULL, NULL, NULL); } else { fn = mb_fallback_font; } while (!flf && (fn && *fn)) { flf = FlocaleGetFontOrFontSet( dpy, fn, encoding, fontname, module); if (fn != NULL && fn != mb_fallback_font && fn != fallback_font) { free(fn); fn = NULL; } if (!flf && str && *str) { str = GetQuotedString(str, &fn, ";", NULL, NULL, NULL); } } if (fn != NULL && fn != mb_fallback_font && fn != fallback_font) { free(fn); } if (flf == NULL) { /* loading failed, try default font */ if (!ask_default) { fprintf(stderr,"[%s][FlocaleLoadFont]: " "WARNING -- can't load font '%s'," " trying default:\n", (module)? module: "fvwmlibs", fontname); } else { /* we already tried default fonts: try again? yes */ } if (Flocale != NULL) { if (!ask_default) { fprintf(stderr, "\t%s\n", mb_fallback_font); } if ((flf = FlocaleGetFontSet( dpy, mb_fallback_font, NULL, module)) != NULL) { flf->name = mb_fallback_font; } } if (flf == NULL) { if (!ask_default) { fprintf(stderr,"\t%s\n", fallback_font); } if ((flf = FlocaleGetFont( dpy, fallback_font, NULL, module)) != NULL) { flf->name = fallback_font; } else if (!ask_default) { fprintf(stderr, "[%s][FlocaleLoadFont]:" " ERROR -- can't load font.\n", (module)? module: "fvwmlibs"); } else { fprintf(stderr, "[%s][FlocaleLoadFont]: ERROR" " -- can't load default font:\n", (module)? module: "fvwmlibs"); fprintf(stderr, "\t%s\n", mb_fallback_font); fprintf(stderr, "\t%s\n", fallback_font); } } } if (flf != NULL) { if (shadow_size > 0) { flf->shadow_size = shadow_size; flf->flags.shadow_dir = shadow_dir; flf->shadow_offset = shadow_offset; flf->descent += FLF_SHADOW_DESCENT(flf); flf->ascent += FLF_SHADOW_ASCENT(flf); flf->height += FLF_SHADOW_HEIGHT(flf); flf->max_char_width += FLF_SHADOW_WIDTH(flf); } if (flf->fc == FlocaleCharsetGetUnknownCharset()) { fprintf(stderr,"[%s][FlocaleLoadFont]: " "WARNING -- Unknown charset for font\n\t'%s'\n", (module)? module: "fvwmlibs", flf->name); flf->fc = FlocaleCharsetGetDefaultCharset(dpy, module); } else if (flf->str_fc == FlocaleCharsetGetUnknownCharset() && (encoding != NULL || (FftSupport && flf->fftf.fftfont != NULL && flf->fftf.str_encoding != NULL))) { fprintf(stderr,"[%s][FlocaleLoadFont]: " "WARNING -- Unknown string encoding for font\n" "\t'%s'\n", (module)? module: "fvwmlibs", flf->name); } if (flf->str_fc == FlocaleCharsetGetUnknownCharset()) { flf->str_fc = FlocaleCharsetGetDefaultCharset(dpy, module); } flf->next = FlocaleFontList; FlocaleFontList = flf; } if (encoding != NULL) { free(encoding); } return flf; } void FlocaleUnloadFont(Display *dpy, FlocaleFont *flf) { FlocaleFont *list = FlocaleFontList; int i = 0; if (!flf) { return; } /* Remove a weight, still too heavy? */ if (--(flf->count) > 0) { return; } if (flf->name != NULL && !StrEquals(flf->name, mb_fallback_font) && !StrEquals(flf->name, fallback_font)) { free(flf->name); } if (FftSupport && flf->fftf.fftfont != NULL) { FftFontClose(dpy, flf->fftf.fftfont); if (flf->fftf.fftfont_rotated_90 != NULL) FftFontClose(dpy, flf->fftf.fftfont_rotated_90); if (flf->fftf.fftfont_rotated_180 != NULL) FftFontClose(dpy, flf->fftf.fftfont_rotated_180); if (flf->fftf.fftfont_rotated_270 != NULL) FftFontClose(dpy, flf->fftf.fftfont_rotated_270); } if (flf->fontset != NULL) { XFreeFontSet(dpy, flf->fontset); } if (flf->font != NULL) { XFreeFont(dpy, flf->font); } if (flf->flags.must_free_fc) { if (flf->fc->x) free(flf->fc->x); if (flf->fc->bidi) free(flf->fc->bidi); if (flf->fc->locale != NULL) { while (FLC_GET_LOCALE_CHARSET(flf->fc,i) != NULL) { free(FLC_GET_LOCALE_CHARSET(flf->fc,i)); i++; } free(flf->fc->locale); } free(flf->fc); } /* Link it out of the list (it might not be there) */ if (flf == list) /* in head? simple */ { FlocaleFontList = flf->next; } else { while (list && list->next != flf) { /* fast forward until end or found */ list = list->next; } /* not end? means we found it in there, possibly at end */ if (list) { /* link around it */ list->next = flf->next; } } free(flf); } /* * Width and Drawing Text */ void FlocaleInitGstpArgs( flocale_gstp_args *args, FlocaleFont *flf, FlocaleWinString *fws, int start_x, int start_y) { args->step = 0; args->offset = flf->shadow_offset + 1; args->outer_offset = flf->shadow_offset + flf->shadow_size; args->size = flf->shadow_size; args->sdir = flf->flags.shadow_dir; switch (fws->flags.text_rotation) { case ROTATION_270: /* CCW */ args->orig_x = start_x + FLF_SHADOW_UPPER_SIZE(flf); args->orig_y = start_y + FLF_SHADOW_RIGHT_SIZE(flf); break; case ROTATION_180: args->orig_x = start_x + FLF_SHADOW_RIGHT_SIZE(flf); args->orig_y = start_y; break; case ROTATION_90: /* CW */ args->orig_x = start_x + FLF_SHADOW_BOTTOM_SIZE(flf); args->orig_y = start_y + FLF_SHADOW_LEFT_SIZE(flf); break; case ROTATION_0: default: args->orig_x = start_x + FLF_SHADOW_LEFT_SIZE(flf); args->orig_y = start_y; break; } args->rot = fws->flags.text_rotation; return; } Bool FlocaleGetShadowTextPosition( int *x, int *y, flocale_gstp_args *args) { if (args->step == 0) { args->direction = MULTI_DIR_NONE; args->inter_step = 0; } if ((args->step == 0 || args->inter_step >= args->num_inter_steps) && args->size != 0) { /* setup a new direction */ args->inter_step = 0; gravity_get_next_multi_dir(args->sdir, &args->direction); if (args->direction == MULTI_DIR_C) { int size; size = 2 * (args->outer_offset) + 1; args->num_inter_steps = size * size; } else { args->num_inter_steps = args->size; } } if (args->direction == MULTI_DIR_NONE || args->size == 0) { *x = args->orig_x; *y = args->orig_y; return False; } if (args->direction == MULTI_DIR_C) { int tx; int ty; int size; int is_finished; size = 2 * (args->outer_offset) + 1; tx = args->inter_step % size - args->outer_offset; ty = args->inter_step / size - args->outer_offset; for (is_finished = 0; ty <= args->outer_offset; ty++, tx = -args->outer_offset) { for (; tx <= args->outer_offset; tx++) { if (tx <= -args->offset || tx >= args->offset || ty <= -args->offset || ty >= args->offset) { is_finished = 1; break; } } if (is_finished) { break; } } args->inter_step = (tx + args->outer_offset) + (ty + args->outer_offset) * size; if (!is_finished) { tx = 0; ty = 0; } *x = args->orig_x + tx; *y = args->orig_y + ty; } else if (args->inter_step > 0) { /* into a directional drawing */ (*x) += args->x_sign; (*y) += args->y_sign; } else { direction_t dir; direction_t dir_x; direction_t dir_y; dir = gravity_multi_dir_to_dir(args->direction); gravity_split_xy_dir(&dir_x, &dir_y, dir); args->x_sign = gravity_dir_to_sign_one_axis(dir_x); args->y_sign = gravity_dir_to_sign_one_axis(dir_y); gravity_rotate_xy( args->rot, args->x_sign, args->y_sign, &args->x_sign, &args->y_sign); *x = args->orig_x + args->x_sign * args->offset; *y = args->orig_y + args->y_sign * args->offset; } args->inter_step++; args->step++; return True; } void FlocaleDrawString( Display *dpy, FlocaleFont *flf, FlocaleWinString *fws, unsigned long flags) { int len; Bool do_free = False; Pixel fg = 0, fgsh = 0; Bool has_fg_pixels = False; flocale_gstp_args gstp_args; superimpose_char_t *comb_chars = NULL; char *curr_str; int char_len; /* length in number of chars */ int *pixel_pos = NULL; int i; int j; char buf[4]; int curr_pixel_pos; int curr_len; if (!fws || !fws->str) { return; } if (flags & FWS_HAVE_LENGTH) { len = fws->len; } else { len = strlen(fws->str); } /* encode the string */ FlocaleEncodeWinString( dpy, flf, fws, &do_free, &len, &comb_chars, NULL); curr_str = fws->e_str; for(char_len = 0, i = 0 ; i < len && curr_str[i] != 0 ; char_len++, i += curr_len) { curr_len = FlocaleStringNumberOfBytes(flf, curr_str + i); } /* for superimposition calculate the character positions in pixels */ if (comb_chars != NULL && ( comb_chars[0].c.byte1 != 0 || comb_chars[0].c.byte2 != 0)) { /* the second condition is actually redundant, but there for clarity, ending at 0 is what's expected in a correct string */ pixel_pos = (int *)safemalloc( (char_len != 0 ? char_len : 1) * sizeof(int)); /* if there is 0 bytes in the encoded string, there might still be combining character to draw (at position 0) */ if(char_len == 0) { pixel_pos[0] = 0; } for( i = 0, curr_pixel_pos = 0 ; i < char_len ; i++, curr_str += curr_len) { curr_len = FlocaleStringNumberOfBytes(flf, curr_str); for (j = 0 ; j < curr_len ; j++) { buf[j] = curr_str[j]; } buf[j] = 0; pixel_pos[i] = curr_pixel_pos; /* need to compensate for shadow width (if any) */ curr_pixel_pos += FlocaleTextWidth(flf, buf, curr_len) - FLF_SHADOW_WIDTH(flf); } } /* get the pixels */ if (fws->flags.has_colorset) { fg = fws->colorset->fg; fgsh = fws->colorset->fgsh; has_fg_pixels = True; } else if (flf->shadow_size != 0) { XGCValues xgcv; if (XGetGCValues(dpy, fws->gc, GCForeground, &xgcv) != 0) { fg = xgcv.foreground; } else { fg = PictureBlackPixel(); } fgsh = GetShadow(fg); has_fg_pixels = True; } if(flf->font != None && (FLC_ENCODING_TYPE_IS_UTF_8(flf->fc) || flf->flags.is_mb)) { /* in this case, length is number of 2-byte chars */ len = char_len; } if (fws->flags.text_rotation != ROTATION_0 && flf->fftf.fftfont == NULL) { /* pass in information to perform superimposition */ FlocaleRotateDrawString( dpy, flf, fws, fg, fgsh, has_fg_pixels, len, comb_chars, pixel_pos); } else if (FftSupport && flf->fftf.fftfont != NULL) { FftDrawString( dpy, flf, fws, fg, fgsh, has_fg_pixels, len, flags); } else if (flf->fontset != None) { int xt = fws->x; int yt = fws->y; FlocaleInitGstpArgs(&gstp_args, flf, fws, fws->x, fws->y); if (flf->shadow_size != 0) { XSetForeground(dpy, fws->gc, fgsh); while (FlocaleGetShadowTextPosition( &xt, &yt, &gstp_args)) { XmbDrawString( dpy, fws->win, flf->fontset, fws->gc, xt, yt, fws->e_str, len); } } if (has_fg_pixels == True) { XSetForeground(dpy, fws->gc, fg); } xt = gstp_args.orig_x; yt = gstp_args.orig_y; XmbDrawString( dpy, fws->win, flf->fontset, fws->gc, xt, yt, fws->e_str, len); } else if (flf->font != None) { FlocaleFontStructDrawString( dpy, flf, fws->win, fws->gc, fws->x, fws->y, fg, fgsh, has_fg_pixels, fws, len, False); } /* here take care of superimposing chars */ i = 0; if (comb_chars != NULL) { while(comb_chars[i].c.byte1 != 0 && comb_chars[i].c.byte2 != 0) { /* draw composing character on top of corresponding "real" character */ FlocaleWinString tmp_fws = *fws; int offset = pixel_pos[comb_chars[i].position]; char *buf2; int out_len; curr_len = FlocaleChar2bOneCharToUtf8(comb_chars[i].c, buf); buf2 = FiconvUtf8ToCharset( dpy, flf->str_fc, (const char *)buf, curr_len); if(buf2 == NULL) { /* if conversion failed, combinational char is not representable in current charset */ /* just replace with empty string */ buf2 = (char *)safemalloc(sizeof(char)); buf2[0] = 0; } tmp_fws.e_str = buf2; tmp_fws.str2b = NULL; if(FftSupport && flf->fftf.fftfont != NULL) { tmp_fws.x = fws->x + offset; FftDrawString( dpy, flf, &tmp_fws, fg, fgsh, has_fg_pixels, strlen(buf2), flags); } else if(flf->fontset != None) { int xt = fws->x; int yt = fws->y; FlocaleInitGstpArgs( &gstp_args, flf, fws, fws->x, fws->y); if (flf->shadow_size != 0) { XSetForeground(dpy, fws->gc, fgsh); while (FlocaleGetShadowTextPosition( &xt, &yt, &gstp_args)) { XmbDrawString( dpy, fws->win, flf->fontset, fws->gc, xt, yt, buf2, strlen(buf2)); } } XSetForeground(dpy, fws->gc, fg); xt = gstp_args.orig_x; yt = gstp_args.orig_y; XmbDrawString( dpy, fws->win, flf->fontset, fws->gc, xt + offset, yt, buf2, strlen(buf2)); } else if (flf->font != None) { if (FLC_ENCODING_TYPE_IS_UTF_8(flf->fc)) { tmp_fws.str2b = (XChar2b *) safemalloc(2 * sizeof(XChar2b)); tmp_fws.str2b[0] = comb_chars[i].c; tmp_fws.str2b[1].byte1 = 0; tmp_fws.str2b[1].byte2 = 0; out_len = 1; /*tmp_fws.str2b = FlocaleUtf8ToUnicodeStr2b( tmp_fws.e_str, curr_len, &out_len);*/ } else if (flf->flags.is_mb) { tmp_fws.str2b = FlocaleStringToString2b( dpy, flf, tmp_fws.e_str, curr_len, &out_len); } else { out_len = strlen(buf2); } FlocaleFontStructDrawString( dpy, flf, fws->win, fws->gc, fws->x + offset, fws->y, fg, fgsh, has_fg_pixels, &tmp_fws, out_len, False); } free(buf2); if(tmp_fws.str2b != NULL) { free(tmp_fws.str2b); } i++; } } if (do_free) { if (fws->e_str != NULL) { free(fws->e_str); fws->e_str = NULL; } } if (fws->str2b != NULL) { free(fws->str2b); fws->str2b = NULL; } if(comb_chars != NULL) { free(comb_chars); if(pixel_pos) free(pixel_pos); } return; } void FlocaleDrawUnderline( Display *dpy, FlocaleFont *flf, FlocaleWinString *fws, int offset) { int off1, off2, y, x_s, x_e; superimpose_char_t *comb_chars = NULL; int *l_to_v = NULL; Bool do_free = True; int len = strlen(fws->str); int l_coffset; int v_coffset; int voffset; if (fws == NULL || fws->str == NULL) { return; } /* need to encode the string first to get BIDI and combining chars */ FlocaleEncodeWinString(dpy, flf, fws, &do_free, &len, &comb_chars, &l_to_v); /* we don't need this, only interested in char mapping */ free(comb_chars); /* now calculate char offset (in bytes) in visual string corresponding to coffset */ /* calculate absolute position in string (in characters) */ l_coffset = FlocaleStringByteToCharOffset(flf, fws->str, offset); /* map to an offset in the visual string */ v_coffset = l_to_v[l_coffset]; /* calculate byte offset into visual string */ voffset = FlocaleStringCharToByteOffset(flf, fws->e_str, v_coffset); off1 = FlocaleTextWidth(flf, fws->e_str, voffset) + ((voffset == 0)? FLF_SHADOW_LEFT_SIZE(flf) : - FLF_SHADOW_RIGHT_SIZE(flf) ); off2 = FlocaleTextWidth(flf, fws->e_str + voffset, FlocaleStringNumberOfBytes(flf, fws->e_str + voffset)) - FLF_SHADOW_WIDTH(flf) - 1 + off1; y = fws->y + 2; x_s = fws->x + off1; x_e = fws->x + off2; /* No shadow */ XDrawLine(dpy, fws->win, fws->gc, x_s, y, x_e, y); /* free encoded string if it isn't the same as input string */ if(fws->e_str != fws->str) { free(fws->e_str); fws->e_str = NULL; } if(fws->str2b != NULL) { free(fws->str2b); fws->str2b = NULL; } free(l_to_v); return; } int FlocaleTextWidth(FlocaleFont *flf, char *str, int sl) { int result = 0; char *tmp_str; int new_l,do_free; superimpose_char_t *comb_chars = NULL; if (!str || sl == 0) return 0; if (sl < 0) { /* a vertical string: nothing to do! */ sl = -sl; } /* FIXME */ /* to avoid eccesive calls iconv (slow in Solaris 8) don't bother to encode if string is one byte when drawing a string this function is used to calculate position of each character (for superimposition) */ if(sl == 1) { tmp_str = str; new_l = sl; do_free = False; } else { tmp_str = FlocaleEncodeString( Pdpy, flf, str, &do_free, sl, &new_l, NULL, &comb_chars, NULL); } /* if we get zero-length, check to to see if there if there's any combining chars, if so use an imagninary space as a "base character" */ if (strlen(tmp_str) == 0 && comb_chars && (comb_chars[0].c.byte1 != 0 || comb_chars[0].c.byte2 != 0)) { if(do_free) { free(tmp_str); } if(comb_chars) { free(comb_chars); } return FlocaleTextWidth(flf, " ", 1); } else if (FftSupport && flf->fftf.fftfont != NULL) { result = FftTextWidth(flf, tmp_str, new_l); } else if (flf->fontset != None) { result = XmbTextEscapement(flf->fontset, tmp_str, new_l); } else if (flf->font != None) { if (FLC_ENCODING_TYPE_IS_UTF_8(flf->fc) || flf->flags.is_mb) { XChar2b *str2b; int nl; if (FLC_ENCODING_TYPE_IS_UTF_8(flf->fc)) str2b = FlocaleUtf8ToUnicodeStr2b( tmp_str, new_l, &nl); else str2b = FlocaleStringToString2b( Pdpy, flf, tmp_str, new_l, &nl); if (str2b != NULL) { result = XTextWidth16(flf->font, str2b, nl); free(str2b); } } else { result = XTextWidth(flf->font, tmp_str, new_l); } } if (do_free) { free(tmp_str); } if (comb_chars) { free(comb_chars); } return result + ((result != 0)? FLF_SHADOW_WIDTH(flf):0); } int FlocaleGetMinOffset( FlocaleFont *flf, rotation_t rotation) { int min_offset; #ifdef FFT_BUGGY_FREETYPE switch(rotation) { case ROTATION_270: case ROTATION_180: /* better than descent */ min_offset = (flf->descent + flf->height - flf->ascent)/2; break; case ROTATION_0: case ROTATION_90: default: /* better than ascent */ min_offset = (flf->ascent + flf->height - flf->descent)/2; break; } #else switch(rotation) { case ROTATION_180: case ROTATION_90: /* better than descent */ min_offset = (flf->descent + flf->height - flf->ascent)/2; break; case ROTATION_270: case ROTATION_0: default: /* better than ascent */ min_offset = (flf->ascent + flf->height - flf->descent)/2; break; } #endif return min_offset; } void FlocaleAllocateWinString(FlocaleWinString **pfws) { *pfws = (FlocaleWinString *)safemalloc(sizeof(FlocaleWinString)); memset(*pfws, '\0', sizeof(FlocaleWinString)); } /* * Text properties */ void FlocaleGetNameProperty( Status (func)(Display *, Window, XTextProperty *), Display *dpy, Window w, FlocaleNameString *ret_name) { char **list; int num; XTextProperty text_prop; list = NULL; if (func(dpy, w, &text_prop) == 0) { return; } if (text_prop.encoding == XA_STRING) { /* STRING encoding, use this as it is */ ret_name->name = (char *)text_prop.value; ret_name->name_list = NULL; return; } /* not STRING encoding, try to convert XA_COMPOUND_TEXT */ if (XmbTextPropertyToTextList(dpy, &text_prop, &list, &num) >= Success && num > 0 && *list) { /* Does not consider the conversion is REALLY succeeded: * XmbTextPropertyToTextList return 0 (== Success) on success, * a negative int if it fails (and in this case we are not * here), the number of unconvertible char on "partial" * success*/ XFree(text_prop.value); /* return of XGetWM(Icon)Name() */ ret_name->name = *list; ret_name->name_list = list; } else { if (list) { XFreeStringList(list); } ret_name->name = (char *)text_prop.value; ret_name->name_list = NULL; } } void FlocaleFreeNameProperty(FlocaleNameString *ptext) { if (ptext->name_list != NULL) { if (ptext->name != NULL && ptext->name != *ptext->name_list) XFree(ptext->name); XFreeStringList(ptext->name_list); ptext->name_list = NULL; } else if (ptext->name != NULL) { XFree(ptext->name); } ptext->name = NULL; return; } Bool FlocaleTextListToTextProperty( Display *dpy, char **list, int count, XICCEncodingStyle style, XTextProperty *text_prop_return) { int ret = False; if (Flocale != NULL) { ret = XmbTextListToTextProperty( dpy, list, count, style, text_prop_return); if (ret == XNoMemory) { ret = False; } else { /* ret == Success or the number of unconvertible * characters. ret should be != XLocaleNotSupported * because in this case Flocale == NULL */ ret = True; } } if (!ret) { if (XStringListToTextProperty( list, count, text_prop_return) == 0) { ret = False; } else { ret = True; } } return ret; } /* * Info */ void FlocalePrintLocaleInfo(Display *dpy, int verbose) { FlocaleFont *flf = FlocaleFontList; int count = 0; FlocaleCharset *cs; fflush(stderr); fflush(stdout); fprintf(stderr,"fvwm info on locale:\n"); fprintf(stderr," locale: %s, Modifier: %s\n", (Flocale)? Flocale:"", (Fmodifiers)? Fmodifiers:""); cs = FlocaleCharsetGetDefaultCharset(dpy, NULL); fprintf(stderr," Default Charset: X: %s, Iconv: %s, Bidi: %s\n", cs->x, (cs->iconv_index >= 0)? cs->locale[cs->iconv_index]:"Not defined", (cs->bidi)? "Yes":"No"); FlocaleCharsetPrintXOMInfo(); while (flf) { count++; flf = flf->next; } fprintf(stderr," Number of loaded font: %i\n", count); if (verbose) { count = 0; flf = FlocaleFontList; while(flf) { cs = flf->fc; fprintf(stderr," * Font number %i\n", count); fprintf(stderr," fvwm info:\n"); fprintf(stderr," Name: %s\n", (flf->name)? flf->name:""); fprintf(stderr," Cache count: %i\n", flf->count); fprintf(stderr," Type: "); if (flf->font) { fprintf(stderr,"FontStruct\n"); } else if (flf->fontset) { fprintf(stderr,"FontSet\n"); } else { fprintf(stderr,"XftFont\n"); } fprintf(stderr, " Charset: X: %s, Iconv: %s, " "Bidi: %s\n", cs->x, (cs->iconv_index >= 0)? cs->locale[cs->iconv_index]:"Not defined", (cs->bidi)? "Yes":"No"); fprintf(stderr," height: %i, ascent: %i, " "descent: %i\n", flf->height, flf->ascent, flf->descent); fprintf(stderr," shadow size: %i, " "shadow offset: %i, shadow direction:%i\n", flf->shadow_size, flf->shadow_offset, flf->flags.shadow_dir); if (verbose >= 2) { if (flf->fftf.fftfont != NULL) { FftFontType *fftf; fftf = &flf->fftf; fprintf(stderr, " Xft info:\n" " - Vertical font:"); FftPrintPatternInfo( fftf->fftfont, False); fprintf(stderr, " " "- Rotated font 90:"); if (fftf->fftfont_rotated_90) FftPrintPatternInfo( fftf-> fftfont_rotated_90, True); else fprintf(stderr, " None\n"); fprintf(stderr, " " "- Rotated font 270:"); if (fftf->fftfont_rotated_270) FftPrintPatternInfo( fftf-> fftfont_rotated_270, True); else fprintf(stderr, " None\n"); fprintf(stderr, " " "- Rotated font 180:"); if (fftf->fftfont_rotated_180) FftPrintPatternInfo( fftf-> fftfont_rotated_180, True); else fprintf(stderr, " None\n"); } else if (flf->font != NULL) { char *full_name; full_name = FlocaleGetFullNameOfFontStruct( dpy, flf->font); fprintf(stderr, " X info:\n" " %s\n", (full_name)? full_name:"?"); if (full_name != NULL) { XFree(full_name); } } else if (flf->fontset != NULL) { int n,i; XFontStruct **font_struct_list; char **font_name_list; fprintf(stderr, " X info:\n"); n = XFontsOfFontSet( flf->fontset, &font_struct_list, &font_name_list); for(i = 0; i < n; i++) { fprintf(stderr, " %s\n", font_name_list[i]); } } } count++; flf = flf->next; } } } fvwm-2.6.5.orig/libs/Flocale.h0000644000175000017500000003031111243033534014265 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ #ifndef FLOCALE_H #define FLOCALE_H /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "fvwmlib.h" #include "gravity.h" #include "Fft.h" #include "Colorset.h" /* FlocaleCharset.h and Ficonv.h should not be included */ /* ---------------------------- global definitions ------------------------- */ #define FWS_HAVE_LENGTH (1) #define FLC_ENCODING_TYPE_NONE 0 #define FLC_ENCODING_TYPE_FONT 1 #define FLC_ENCODING_TYPE_UTF_8 2 #define FLC_ENCODING_TYPE_USC_2 3 #define FLC_ENCODING_TYPE_USC_4 4 #define FLC_ENCODING_TYPE_UTF_16 5 #define FLC_FFT_ENCODING_ISO8859_1 "ISO8859-1" #define FLC_FFT_ENCODING_ISO10646_1 "ISO10646-1" #define FLOCALE_FALLBACK_XCHARSET "ISO8859-1" #define FLOCALE_UTF8_XCHARSET "ISO10646-1" #define FLOCALE_ICONV_CONVERSION_MAX_NUMBER_OF_WARNING 10 #define FLC_INDEX_ICONV_CHARSET_NOT_FOUND -1 #define FLC_INDEX_ICONV_CHARSET_NOT_INITIALIZED -2 #define FLC_TRANSLIT_NOT_SUPPORTED ((char*)-1) #define FLOCALE_DEBUG_SETLOCALE 0 #define FLOCALE_DEBUG_CHARSET 0 #define FLOCALE_DEBUG_ICONV 0 /* ---------------------------- global macros ------------------------------ */ #define IS_TEXT_DRAWN_VERTICALLY(x) \ ((x) == TEXT_ROTATED_90 || (x) == TEXT_ROTATED_270) #define FLC_GET_X_CHARSET(fc) ((fc) != NULL)? (fc)->x:NULL #define FLC_SET_ICONV_INDEX(fc, i) (fc)->iconv_index = i #define FLC_GET_LOCALE_CHARSET(fc, i) (fc)->locale[i] #define FLC_GET_ICONV_CHARSET(fc) \ ((fc) != NULL && (fc)->iconv_index >= 0)? (fc)->locale[(fc)->iconv_index]:NULL #define FLC_DO_ICONV_CHARSET_INITIALIZED(fc) \ ((fc) != NULL && (fc)->iconv_index != FLC_INDEX_ICONV_CHARSET_NOT_INITIALIZED) #define FLC_HAVE_ICONV_CHARSET(fc) ((fc) != NULL && (fc)->iconv_index >= 0) #define FLC_GET_BIDI_CHARSET(fc) ((fc) != NULL)? (fc)->bidi : NULL #define FLC_ENCODING_TYPE_IS_UTF_8(fc) \ ((fc) != NULL && (fc)->encoding_type == FLC_ENCODING_TYPE_UTF_8) #define FLC_ENCODING_TYPE_IS_USC_2(fc) \ ((fc) != NULL && (fc)->encoding_type == FLC_ENCODING_TYPE_USC_2) #define FLC_ENCODING_TYPE_IS_USC_4(fc) \ ((fc) != NULL && (fc)->encoding_type == FLC_ENCODING_TYPE_USC_4) #define FLC_DEBUG_GET_X_CHARSET(fc) \ ((fc) == NULL || (fc)->x == NULL)? "None":(fc)->x #define FLC_DEBUG_GET_ICONV_CHARSET(fc) \ ((fc) != NULL && (fc)->iconv_index >= 0)? (fc)->locale[(fc)->iconv_index]:"None" #define FLC_DEBUG_GET_BIDI_CHARSET(fc) \ ((fc) == NULL || (fc)->bidi == NULL)? "None":(fc)->bidi #define FLC_IS_TRANSLIT_SUPPORTED(fc) \ ((fc) != NULL && (fc)->translit_csname != FLC_TRANSLIT_NOT_SUPPORTED \ && (fc)->translit_csname != NULL) #define FLC_GET_ICONV_TRANSLIT_CHARSET(fc) \ ((fc) != NULL && (fc)->translit_csname != FLC_TRANSLIT_NOT_SUPPORTED)?\ (fc)->translit_csname : NULL #define FLC_SET_ICONV_TRANSLIT_CHARSET(fs, csname) \ (fc)->translit_csname = csname #define FLF_MULTIDIR_HAS_UPPER(flf) \ (((flf)->flags.shadow_dir & MULTI_DIR_NW) || \ ((flf)->flags.shadow_dir & MULTI_DIR_N) || \ ((flf)->flags.shadow_dir & MULTI_DIR_NE)) #define FLF_MULTIDIR_HAS_BOTTOM(flf) \ (((flf)->flags.shadow_dir & MULTI_DIR_SW) || \ ((flf)->flags.shadow_dir & MULTI_DIR_S) || \ ((flf)->flags.shadow_dir & MULTI_DIR_SE)) #define FLF_MULTIDIR_HAS_LEFT(flf) \ (((flf)->flags.shadow_dir & MULTI_DIR_SW) || \ ((flf)->flags.shadow_dir & MULTI_DIR_W) || \ ((flf)->flags.shadow_dir & MULTI_DIR_NW)) #define FLF_MULTIDIR_HAS_RIGHT(flf) \ (((flf)->flags.shadow_dir & MULTI_DIR_SE) || \ ((flf)->flags.shadow_dir & MULTI_DIR_E) || \ ((flf)->flags.shadow_dir & MULTI_DIR_NE)) #define FLF_SHADOW_FULL_SIZE(flf) ((flf)->shadow_size + (flf)->shadow_offset) #define FLF_SHADOW_HEIGHT(flf) \ (FLF_SHADOW_FULL_SIZE((flf)) * \ (FLF_MULTIDIR_HAS_UPPER((flf))+FLF_MULTIDIR_HAS_BOTTOM((flf)))) #define FLF_SHADOW_WIDTH(flf) \ (FLF_SHADOW_FULL_SIZE((flf)) * \ (FLF_MULTIDIR_HAS_LEFT((flf))+FLF_MULTIDIR_HAS_RIGHT((flf)))) #define FLF_SHADOW_ASCENT(flf) \ (FLF_SHADOW_FULL_SIZE((flf)) * FLF_MULTIDIR_HAS_UPPER((flf))) #define FLF_SHADOW_DESCENT(flf) \ (FLF_SHADOW_FULL_SIZE((flf)) * FLF_MULTIDIR_HAS_BOTTOM((flf))) #define FLF_SHADOW_LEFT_SIZE(flf) \ (FLF_SHADOW_FULL_SIZE((flf)) * FLF_MULTIDIR_HAS_LEFT((flf))) #define FLF_SHADOW_RIGHT_SIZE(flf) \ (FLF_SHADOW_FULL_SIZE((flf)) * FLF_MULTIDIR_HAS_RIGHT((flf))) #define FLF_SHADOW_UPPER_SIZE(flf) \ (FLF_SHADOW_FULL_SIZE((flf)) * FLF_MULTIDIR_HAS_UPPER((flf))) #define FLF_SHADOW_BOTTOM_SIZE(flf) \ (FLF_SHADOW_FULL_SIZE((flf)) * FLF_MULTIDIR_HAS_BOTTOM((flf))) #define FLF_FONT_HAS_ALPHA(flf,cset) \ ((flf && flf->fftf.fftfont != None) || \ (0 && cset >= 0 && Colorset[cset].fg_alpha_percent < 100)) /* ---------------------------- type definitions --------------------------- */ typedef struct FlocaleCharset { char *x; /* X font charset */ char **locale; /* list of possible charset names */ int iconv_index; /* defines the iconv charset name */ char *bidi; /* if not null a fribidi charset */ short encoding_type; /* encoding: font, utf8 or usc2 */ char *translit_csname; /* iconv csname for transliteration */ } FlocaleCharset; typedef struct _FlocaleFont { struct _FlocaleFont *next; char *name; int count; XFontStruct *font; /* font structure */ XFontSet fontset; /* font set */ FftFontType fftf; /* fvwm xft font */ FlocaleCharset *fc; /* fvwm charset of the font */ FlocaleCharset *str_fc; /* fvwm charset of the strings to be displayed */ int height; /* height of the font: ascent + descent */ int ascent; int descent; int max_char_width; int shadow_size; int shadow_offset; struct { unsigned shadow_dir : (DIR_ALL_MASK + 1); unsigned must_free_fc : 1; /* is_mb are used only with a XFontStruct font, for XFontSet * everything is done in the good way automatically and this * parameters is not needed */ unsigned is_mb : 1; /* if true the font is a 2 bytes font */ } flags; } FlocaleFont; typedef struct { char *str; char *e_str; /* tmp */ XChar2b *str2b; /* tmp */ GC gc; colorset_t *colorset; Window win; int x; int y; int len; Region clip_region; struct { unsigned text_rotation : 2; unsigned has_colorset : 1; unsigned has_clip_region : 1; } flags; } FlocaleWinString; typedef struct { char *name; char **name_list; } FlocaleNameString; typedef struct { int step; int orig_x; int orig_y; int offset; int outer_offset; multi_direction_t direction; int inter_step; int num_inter_steps; int x_sign; int y_sign; int size; unsigned sdir : (DIR_ALL_MASK + 1); rotation_t rot; } flocale_gstp_args; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ /* * i18n X initialization * category: the usual category LC_CTYPE, LC_CTIME, ... * modifier: "" or NULL if NULL XSetLocaleModifiers is not called * module: the name of the fvwm module that call the function for reporting * errors message * The locale and the modifiers is sotred in Flocale and Fmodifiers. * Flocale is set to NULL if the locale is not supported by the Xlib. * In this case the Flocale* functions below does not use the Xmb* functions * * The function should be called as FlocaleInit(LC_CTYPE, "", "", "myname"); */ void FlocaleInit( int category, const char *local, const char *modifier, const char *module); /* * font loading */ /* * load a FlocaleFont (create it or load it from a cache) * fontname: a ";" sperated list of "," separated list of XFLD font names or * either "xft:" followed by a Xft font name. Examples: * "xft:Verdana:Bold:pixelsize=14:rgba=rgb" * "xft:Verdana:size=12;-adobe-courier-medium-r-normal--14-*,fixed" * module: name of the fvwm module for errors msg * If fontname is NULL the "default font" is loaded (2,3,4). * The following logic is used: * 0) If fontname has been has been already loaded the cache is used * 1) We try to load each element "fn" of the ";" seprated list until success * as follows: * a - if fn begin with "xft:", then if FftSupport fn is loaded as an xft * font; if !FftSupport fn is skipped (ignored) * b - If the locale is supported fn is loaded using XCreateFontSet. If this * fail fallback into 1-c) * c - If the locale is not supported or 1-b fail fn is loaded using * XLoadQueryFont (the first loadable font in the fn "," separated list * is load) * 2) If 0) and 1) fail: * - try to load MB_FALLBACK_FONT with XCreateFontSet * - If this fail try to load FALLBACK_FONT with XLoadQueryFont * 3) If everything fail the function return NULL. * * If font loading succed. Only one of the font, fontset, fftfont member of the * FlocaleFont structure is not NULL/None. The caller should use this to * set appropriately the gc member of the FlocaleWinString struct (the fid * gc member should be set only if font is not NULL). * */ FlocaleFont *FlocaleLoadFont(Display *dpy, char *fontname, char *module); /* * unload the flf FlocaleFont */ void FlocaleUnloadFont(Display *dpy, FlocaleFont *flf); /* * Width and Drawing */ /* * Draw the text specified in fstring->str using fstring->gc as GC on the * fstring->win window at position fstring->{x,y} using the ff FlocaleFont. * If flags & FWS_HAVE_LENGTH, the fstring->len first characters of the * string is drawn. If !(flags & FWS_HAVE_LENGTH), the function draw the * the all string (fstring->len is ignored). Note that if ff->font is NULL * the gc should not conatins a GCFont, as if ff->font != NULL the GCFont * value should be ff->font->fid */ void FlocaleDrawString( Display *dpy, FlocaleFont *ff, FlocaleWinString *fstring, unsigned long flags); /* * Underline a character in a string (pete@tecc.co.uk) at coffest position */ void FlocaleDrawUnderline( Display *dpy, FlocaleFont *flf, FlocaleWinString *fws, int coffset); /* * Get the position for shadow text */ void FlocaleInitGstpArgs( flocale_gstp_args *args, FlocaleFont *flf, FlocaleWinString *fws, int start_x, int start_y); Bool FlocaleGetShadowTextPosition( int *x, int *y, flocale_gstp_args *args); /* * Call XmbTextEscapement(ff->fontset, str, sl) if ff->fontset is not None. * Call XTextWith(ff->font, str, sl) if ff->font is not NULL. * If sl is negative, the string is considered to be a vertival string and * the function returns the height of the text. */ int FlocaleTextWidth(FlocaleFont *ff, char *str, int sl); /* * "y" (or "x" position if rotated and Xft font) of the text relatively to 0 */ int FlocaleGetMinOffset(FlocaleFont *flf, rotation_t rotation); /* * Allocate memory for a FlocaleWinString intialized to 0 */ void FlocaleAllocateWinString(FlocaleWinString **pfws); /* * Text properties */ /* * return the window or icon name of a window w * func: XGetWMName or XGetWMIconName * dpy: the display * w: the window for which we want the (icon) name * ret_name_list: for * ret_name: the icon or the window name of the window */ void FlocaleGetNameProperty( Status (func)(Display *, Window, XTextProperty *), Display *dpy, Window w, FlocaleNameString *ret_name); /* * Free the name property allocated with FlocaleGetNameProperty */ void FlocaleFreeNameProperty( FlocaleNameString *ptext); /* * Simple warper to XmbTextListToTextProperty (FlocaleMultibyteSupport and the * locale is supported by the xlib) or XStringListToTextProperty */ Bool FlocaleTextListToTextProperty( Display *dpy, char **list, int count, XICCEncodingStyle style, XTextProperty *text_prop_return); /* * Info */ void FlocalePrintLocaleInfo(Display *dpy, int verbose); /* * Misc */ /* return number of bytes of character at current position (pointed to by str) */ int FlocaleStringNumberOfBytes(FlocaleFont *flf, const char *str); /* given a string, font specifying its locale and a byte offset gives character offset */ int FlocaleStringByteToCharOffset(FlocaleFont *flf, const char *str, int offset); /* like above but reversed, ie. return byte offset corresponding to given charater offset */ int FlocaleStringCharToByteOffset(FlocaleFont *flf, const char *str, int coffset); /* return length of string in characters */ int FlocaleStringCharLength(FlocaleFont *flf, const char *str); #endif /* FLOCALE_H */ fvwm-2.6.5.orig/libs/ftime.h0000644000175000017500000000030107677641664014051 0ustar vwcvwc/* -*-c-*- */ #include "config.h" #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif fvwm-2.6.5.orig/libs/Module.h0000644000175000017500000001661310656151547014172 0ustar vwcvwc/* -*-c-*- */ #ifndef LIBS_MODULE_H #define LIBS_MODULE_H /* ** Module.c: code for modules to communicate with fvwm */ #include #include "libs/fvwmlib.h" /** * fvwm sends packets of this type to modules. **/ typedef struct { /* always holds START_FLAG value */ unsigned long start_pattern; /* one of the M_xxx values, below */ unsigned long type; /* number of unsigned longs in entire packet, *including* header */ unsigned long size; /* last time stamp received from the X server, in milliseconds */ unsigned long timestamp; /* variable size -- use FvwmPacketBodySize to get size */ unsigned long body[1]; } FvwmPacket; typedef struct { Window w; Window frame; void *fvwmwin; } FvwmWinPacketBodyHeader; /* * If you modify constants here, please regenerate Constants.pm in perllib. */ /** All size values in units of "unsigned long" **/ #define FvwmPacketHeaderSize 4 #define FvwmPacketBodySize(p) ((p).size - FvwmPacketHeaderSize) #define FvwmPacketMaxSize 256 #define FvwmPacketBodyMaxSize (FvwmPacketMaxSize - FvwmPacketHeaderSize) /** There seems to be some movement afoot to measure packet sizes in bytes. See fvwm/module_interface.c **/ #define FvwmPacketHeaderSize_byte \ (FvwmPacketHeaderSize * sizeof(unsigned long)) #define FvwmPacketBodySize_byte(p) \ (FvwmPacketBodySize(p) * sizeof(unsigned long)) #define FvwmPacketMaxSize_byte \ (FvwmPacketMaxSize * sizeof(unsigned long)) #define FvwmPacketBodyMaxSize_byte \ (FvwmPacketBodyMaxSize * sizeof(unsigned long)) /* Value of start_pattern */ #define START_FLAG 0xffffffff #define ModuleFinishedStartupResponse "NOP FINISHED STARTUP" #define ModuleUnlockResponse "NOP UNLOCK" /* Possible values of type */ #define M_NEW_PAGE (1) #define M_NEW_DESK (1<<1) #define M_OLD_ADD_WINDOW (1<<2) #define M_RAISE_WINDOW (1<<3) #define M_LOWER_WINDOW (1<<4) #define M_OLD_CONFIGURE_WINDOW (1<<5) #define M_FOCUS_CHANGE (1<<6) #define M_DESTROY_WINDOW (1<<7) #define M_ICONIFY (1<<8) #define M_DEICONIFY (1<<9) #define M_WINDOW_NAME (1<<10) #define M_ICON_NAME (1<<11) #define M_RES_CLASS (1<<12) #define M_RES_NAME (1<<13) #define M_END_WINDOWLIST (1<<14) #define M_ICON_LOCATION (1<<15) #define M_MAP (1<<16) /* It turns out this is defined by on Solaris 2.6. I suspect that simply redefining this will lead to trouble; at some point, these should probably be renamed (FVWM_MSG_ERROR?). */ #ifdef M_ERROR # undef M_ERROR #endif #define M_ERROR (1<<17) #define M_CONFIG_INFO (1<<18) #define M_END_CONFIG_INFO (1<<19) #define M_ICON_FILE (1<<20) #define M_DEFAULTICON (1<<21) #define M_STRING (1<<22) #define M_MINI_ICON (1<<23) #define M_WINDOWSHADE (1<<24) #define M_DEWINDOWSHADE (1<<25) #define M_VISIBLE_NAME (1<<26) #define M_SENDCONFIG (1<<27) #define M_RESTACK (1<<28) #define M_ADD_WINDOW (1<<29) #define M_CONFIGURE_WINDOW (1<<30) #define M_EXTENDED_MSG (1<<31) #define MAX_MESSAGES 31 #define MAX_MSG_MASK 0x7fffffff /* to get more than the old maximum of 32 messages, the 32nd bit is reserved to * mark another 31 messages that have this bit and another one set. * When handling received messages, the message type can be compared to the * MX_... macro. When using one of the calls that accepts a message mask, a * separate call has to be made that ors the MX_... macros. The normal * M_... and MX_... macros must *never* be or'ed in one of these operations' */ #define MX_VISIBLE_ICON_NAME ((1<<0) | M_EXTENDED_MSG) #define MX_ENTER_WINDOW ((1<<1) | M_EXTENDED_MSG) #define MX_LEAVE_WINDOW ((1<<2) | M_EXTENDED_MSG) #define MX_PROPERTY_CHANGE ((1<<3) | M_EXTENDED_MSG) #define MX_REPLY ((1<<4) | M_EXTENDED_MSG) #define MAX_EXTENDED_MESSAGES 5 #define DEFAULT_XMSG_MASK 0x00000000 #define MAX_XMSG_MASK 0x0000001f #define MAX_TOTAL_MESSAGES (MAX_MESSAGES + MAX_EXTENDED_MESSAGES) /* for MX_PROPERTY_CHANGE */ #define MX_PROPERTY_CHANGE_NONE 0 #define MX_PROPERTY_CHANGE_BACKGROUND 1 #define MX_PROPERTY_CHANGE_SWALLOW 2 /** * Reads a single packet of info from fvwm. * The packet is stored into static memory that is reused during * the next call to ReadFvwmPacket. Callers, therefore, must copy * needed data before the next call to ReadFvwmPacket. **/ FvwmPacket* ReadFvwmPacket( int fd ); /* * * SendFinishedStartupNotification - informs fvwm that the module has * finished its startup procedures and is fully operational now. * */ void SendFinishedStartupNotification(int *fd); /* * * SendText - Sends arbitrary text/command back to fvwm * */ void SendText(int *fd, const char *message, unsigned long window); /** Compatibility **/ #define SendInfo SendText /* * * SendUnlockNotification - informs fvwm that the module has * finished it's procedures and fvwm may proceed. * */ void SendUnlockNotification(int *fd); /* * * SendQuitNotification - informs fvwm that the module has * finished and may be killed. * */ void SendQuitNotification(int *fd); /* * * SendFvwmPipe - Sends message to fvwm: The message is a comma-delimited * string separated into its component sections and sent one by one to fvwm. * It is discouraged to use this function with a "synchronous" module. * (Form FvwmIconMan) * */ void SendFvwmPipe(int *fd, const char *message, unsigned long window); /* * * Sets the which-message-types-do-I-want mask for modules * */ void SetMessageMask(int *fd, unsigned long mask); /* * * Sets the which-message-types-do-I-want to be lock on send for modules * */ void SetSyncMask(int *fd, unsigned long mask); /* * * Sets the which-message-types-I-do-not-want while the server is grabbed * and module transmission is locked at the same time. * */ void SetNoGrabMask(int *fd, unsigned long mask); /* * Used to ask for subset of module configuration lines. * Allows modules to get configuration lines more than once. */ void InitGetConfigLine(int *fd, char *match); /** * Gets a module configuration line from fvwm. Returns NULL if there are * no more lines to be had. "line" is a pointer to a char *. **/ void GetConfigLine(int *fd, char **line); /* expands certain variables in a command to be sent by a module */ char *module_expand_action( Display *dpy, int screen , char *in_action, rectangle *r, char *forecolor, char *backcolor); /** * Parse the command line arguments given to the module by fvwm. * Input is the argc & argv from main(), and a flag to indicate * if we accept a module alias as argument #6. * * Returns a pointer to a ModuleArgs structure, or NULL if something * is not kosher. The returned memory is a static buffer. **/ typedef struct { /* module name */ char* name; /* length of the module name */ int namelen; /* file descriptor to send info back to fvwm */ int to_fvwm; /* file descriptor to read packets from fvwm */ int from_fvwm; /* window context of module */ Window window; /* decoration context of module */ unsigned long decoration; /* number of user-specified arguments */ int user_argc; /* vector of user-specified arguments */ char** user_argv; } ModuleArgs; ModuleArgs* ParseModuleArgs( int argc, char* argv[], int use_arg6_as_alias ); #endif fvwm-2.6.5.orig/libs/CombineChars.h0000644000175000017500000000073007702601144015262 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2003 Marcus Lundblad */ /* * FCombineChars.h * * Interface to character combining */ #ifndef FCOMBINECHARS_H #define FCOMBINECHARS_H #include "config.h" #include typedef struct { int position; /* position in the string */ XChar2b c; /* UCS-2 character */ } superimpose_char_t; int CombineChars( unsigned char *str_visual, int len, superimpose_char_t **comb_chars, int **l_to_v); #endif /* FCOMBINECHARS_H */ fvwm-2.6.5.orig/libs/Grab.c0000644000175000017500000000365107677641664013626 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ** MyXGrabServer & MyXUngrabServer - to handle nested grab server calls */ #include "config.h" #include "Grab.h" /* Made into global for module interface. See module.c. */ int myxgrabcount = 0; static unsigned int keyboard_grab_count = 0; static unsigned int key_grab_count = 0; void MyXGrabServer(Display *disp) { if (myxgrabcount == 0) { XSync(disp, 0); XGrabServer(disp); } XSync(disp, 0); ++myxgrabcount; } void MyXUngrabServer(Display *disp) { if (--myxgrabcount < 0) /* should never happen */ { myxgrabcount = 0; } if (myxgrabcount == 0) { XUngrabServer(disp); } XSync(disp, 0); } void MyXGrabKeyboard(Display *dpy) { keyboard_grab_count++; XGrabKeyboard( dpy, RootWindow(dpy, DefaultScreen(dpy)), False, GrabModeAsync, GrabModeAsync, CurrentTime); return; } void MyXUngrabKeyboard(Display *dpy) { if (keyboard_grab_count > 0) { keyboard_grab_count--; } if (keyboard_grab_count == 0 && key_grab_count == 0) { XUngrabKeyboard(dpy, CurrentTime); } return; } void MyXGrabKey(Display *disp) { key_grab_count++; return; } void MyXUngrabKey(Display *disp) { if (key_grab_count > 0) { key_grab_count--; keyboard_grab_count++; MyXUngrabKeyboard(disp); } return; } fvwm-2.6.5.orig/libs/WinMagic.c0000644000175000017500000001723210630367353014430 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 1999 Dominik Vogt */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ** WinMagic.c: ** This file supplies routines for moving and resizing windows in an animated ** fashion. */ #include "config.h" #include #include #include #include "WinMagic.h" /* Continuously moves and resized window win from start geometry (s_?) to end * geometry (e_?). Waits for delay_ms milliseconds after each step except the * last (max. 10 seconds per step). The number of steps is determined by the * steps argument (min. 1 and max. 10000). If the pointer ppctMovement is NULL * the steps are all the same width, if it is given it is interpreted as a * pointer to an array of float percent values. These are used to determine the * distance of each step counted from the start position, i.e. 0.0 means the * start position itself, 50.0 is halfway between start and end position and * 100.0 is the end position. Values smaller than 0.0 or bigger than 100.0 are * allowed too. The do_flush flag determines of all requests are sent to the * X server immediately (True) or not (False). The use_hints detrmines if the * min size and resize hints are used */ void SlideWindow( Display *dpy, Window win, int s_x, int s_y, int s_w, int s_h, int e_x, int e_y, int e_w, int e_h, int steps, int delay_ms, float *ppctMovement, Bool do_sync, Bool use_hints) { int x = 0; int y = 0; int w = 0; int h = 0; int g_w = 0; int g_h = 0; /* -Wall fixes :o( */ int min_w = 1; int min_h = 1; int inc_w = 1; int inc_h = 1; int i; unsigned int us; Bool is_mapped; Bool keep_x1 = False; Bool keep_x2 = False; Bool keep_y1 = False; Bool keep_y2 = False; XSizeHints hints; long dummy; /* check limits */ if (delay_ms > 10000) { /* max. 10 seconds per step */ us = 10000000; } else if (delay_ms < 0) { us = 0; } else { us = 1000 * delay_ms; } if (steps > 10000) { /* max. 10000 steps */ steps = 10000; } if (steps <= 0) { /* no steps, no animation */ if (e_w == 0 || e_h == 0) { XUnmapWindow(dpy, win); } else { XMoveResizeWindow(dpy, win, e_x, e_y, e_w, e_h); XMapWindow(dpy, win); XMapSubwindows(dpy, win); } if (do_sync) XSync(dpy, 0); return; } is_mapped = False; /* Get the mini (re)size hints and do some check consistency */ if (use_hints && XGetWMNormalHints(dpy, win, &hints, &dummy)) { if (hints.flags & PMinSize) { if (hints.min_width >= 1 && hints.min_width <= max(e_w,s_w)) min_w = hints.min_width; if (hints.min_height >= 1 && hints.min_height <= max(e_h,s_h)) min_h = hints.min_height; } if (hints.flags & PResizeInc) { if (hints.width_inc >= 1 && hints.width_inc <= max(e_w,s_w)) inc_w = hints.width_inc; if (hints.height_inc >= 1 && hints.width_inc <= max(e_h,s_h)) inc_h = hints.height_inc; } } if (s_x == e_x) keep_x1 = True; if (s_y == e_y) keep_y1 = True; if (s_x + s_w == e_x + e_w) keep_x2 = True; if (s_y + s_h == e_y + e_h) keep_y2 = True; /* animate the window */ for (i = 0; i <= steps; i++) { if (i == steps) { x = e_x; y = e_y; } else { float f; if (ppctMovement == NULL) { f = (float)i / (float)steps; } else { f = ppctMovement[i] / (float)steps; } x = (int)((float)s_x + (float)(e_x - s_x) * f); y = (int)((float)s_y + (float)(e_y - s_y) * f); } w = s_w + (int)(e_w - s_w) * i / steps; h = s_h + (int)(e_h - s_h) * i / steps; /* take the resize inc in account */ g_w = w - ((w - min_w) % inc_w); x += w-g_w; g_h = h - ((h - min_h) % inc_h); y += h-g_h; /* prevent annoying flickering */ if (keep_x1) x = s_x; if (keep_y1) y = s_y; if (keep_x2) g_w = s_x + s_w - x; if (keep_y2) g_h = s_y + s_h - y; if (g_w < min_w || g_h < min_h) { /* don't show zero width/height windows */ if (is_mapped) { XUnmapWindow(dpy, win); is_mapped = False; } } else { XMoveResizeWindow(dpy, win, x, y, g_w, g_h); if (!is_mapped) { XMapWindow(dpy, win); XMapSubwindows(dpy, win); is_mapped = True; } } /* make sure everything is updated */ if (do_sync) XSync(dpy, 0); if (us && i < steps && is_mapped) { /* don't sleep after the last step */ usleep(us); } } /* for */ /* if hints and asked size do not agree try to respect the caller */ if (e_w > 0 && e_h > 0 && (!is_mapped || g_w != w || g_h != w)) { XMoveResizeWindow(dpy, win, x, y, w, h); if (!is_mapped) { XMapWindow(dpy, win); XMapSubwindows(dpy, win); } if (do_sync) XSync(dpy, 0); } return; } /* This function returns the top level ancestor of the window 'child'. It * returns None if an error occurs or if the window is a top level window. */ Window GetTopAncestorWindow(Display *dpy, Window child) { Window root = None; Window ancestor = child; Window last_child = child; Window *children; unsigned int nchildren; if (child == None) return None; while (ancestor != root) { last_child = ancestor; children = NULL; if ( !XQueryTree( dpy, last_child, &root, &ancestor, &children, &nchildren)) { return None; } if (children) { XFree(children); } } return (last_child == child) ? None : last_child; } /* Given a parent window this function returns a list of children of the * parent window that have the same size, depth, visual and colormap as the * parent window and that have position +0+0 within the parent. If the 'depth' * argument is non-zero it must match the depth of the window. The 'visualid' * and 'colormap' arguments work just the same. The number of matching * children is returned. The list of children is returned in *children. If this * list is non-NULL, it must be free'd with XFree. If an error occurs or the * parent window does not match the required depth, colormap or visualid, the * function returns -1 and NULL in *children. */ int GetEqualSizeChildren( Display *dpy, Window parent, int depth, VisualID visualid, Colormap colormap, Window **ret_children) { XWindowAttributes pxwa; XWindowAttributes cxwa; Window JunkW; Window *children; unsigned int nchildren; int i; int j; if (!XGetWindowAttributes(dpy, parent, &pxwa)) return -1; if (!XQueryTree(dpy, parent, &JunkW, &JunkW, &children, &nchildren)) return -1; if (depth && pxwa.depth != depth) return -1; if (visualid && XVisualIDFromVisual(pxwa.visual) != visualid) return -1; if (colormap && pxwa.colormap != colormap) return -1; for (i = 0, j = 0; i < nchildren; i++) { if (XGetWindowAttributes(dpy, children[i], &cxwa) && cxwa.x == 0 && cxwa.y == 0 && cxwa.width == pxwa.width && cxwa.height == pxwa.height && (!depth || cxwa.depth == depth) && ( !visualid || XVisualIDFromVisual(cxwa.visual) == visualid) && cxwa.class == InputOutput && (!colormap || cxwa.colormap == colormap)) { children[j++] = children[i]; } } /* for */ if (j == 0) { if (children) { XFree(children); children = NULL; } } *ret_children = children; return j; } fvwm-2.6.5.orig/libs/FlocaleCharset.c0000644000175000017500000005732210746560440015615 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include "Strings.h" #include "Parse.h" #include "Flocale.h" #include "FlocaleCharset.h" #include "Ficonv.h" #if FlocaleLibcharsetSupport #include #endif #if FlocaleCodesetSupport #include #endif /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* X locale charset */ static FlocaleCharset *FLCXOMCharset = NULL; /* list of XOM locale charset */ static FlocaleCharset **FLCXOMCharsetList = NULL; static int FLCXOMCharsetList_num = 0; /* UTF-8 charset */ static FlocaleCharset *FLCUtf8Charset = NULL; /* locale charset from the locale not X */ static FlocaleCharset *FLCLocaleCharset = NULL; static char *nullsl[] = {NULL}; #if FiconvSupport /* from hpux iconv man page: The fromcode and tocode names can be any length, * but only the first four and the last letter are used to identify the code * set. */ /* the first name is the gnu canonical name */ char *armscii_8[] = {"ARMSCII-8", NULL}; char *big5_0[] = {"BIG5", "big5", /* aix, hpux, osf */ "zh_TW-big5", /* solaris 9? */ NULL}; char *big5hkscs_0[] = {"BIG5-HKSCS", "BIG5", "big5", /* aix, hpux, osf */ "zh_TW-big5", /* solaris 9? */ NULL}; char *cns11643[] = {"EUCTW", "EUC-TW", "eucTW", "euc-tw", "euctw", NULL}; char *dosencoding_cp437[] = {"CP437", NULL}; char *dosencoding_cp850[] = {"CP850", "cp850", /* osf */ "IBM-850", /* aix */ NULL}; char *gb2312_1980_0[] = {"EUC-CN", "GB2312", "gb2312", /* solaris */ "dechanzi", /* osf */ "hp15CN", /* hpux */ "IBM-eucCN", /* aix */ "eucCN", /* irix */ NULL}; char *gbk_0[] = {"GBK", NULL}; char *georgian_academy[] = {"GEORGIAN-ACADEMY", NULL}; char *georgian_ps[] = {"GEORGIAN-PS", NULL}; char *ibm_cp1133[] = {"CP850" , NULL}; char *isiri_3342[] = {"ISIRI-3342", NULL}; /* embed ascii into ISO-8859-1*/ char *iso8859_1[] = {"ISO-8859-1", /* gnu */ "ISO8859-1", /* aix, irix, osf, solaris */ "iso8859-1", /* aix, irix, osf */ "iso88591", /* hpux */ "8859-1", /* solaris ? */ "iso81", /* hpux */ "ascii", "ASCII", "646", /* solaris */ "ANSI_X3.4-1968", "ISO_646.IRV:1983", /* old glibc */ "american_e", NULL}; char *iso8859_2[] = {"ISO-8859-2", "ISO8859-2", "iso8859-2", "iso88592", "8859-2", "iso82", NULL}; char *iso8859_3[] = {"ISO-8859-3", "ISO8859-3", "iso8859-3", "iso88593", "8859-3", "iso83", NULL}; char *iso8859_4[] = {"ISO-8859-4", "ISO8859-4", "iso8859-4", "iso88594", "8859-4", "iso84", NULL}; char *iso8859_5[] = {"ISO-8859-5", "ISO8859-5", "iso8859-5", "iso88595", "8859-5", "iso85", NULL}; char *iso8859_6[] = {"ISO-8859-6", "ISO8859-6", "iso8859-6", "iso88596", "8859-6", "iso86", NULL}; char *iso8859_7[] = {"ISO-8859-7", "ISO8859-7", "iso8859-7", "iso88597", "8859-7", "iso87", NULL}; char *iso8859_8[] = {"ISO-8859-8", "ISO8859-8", "iso88859-8", "iso88598", "8859-8", "iso88", NULL}; char *iso8859_9[] = {"ISO-8859-9", "ISO8859-9", "iso8859-9", "iso88599", "8859-9", "iso89", NULL}; char *iso8859_10[] = {"ISO-8859-10", "ISO8859-10", "iso8859-10", "iso885910", "8859-10", "iso80", /*?*/ "iso10", NULL}; char *iso8859_13[] = {"ISO-8859-13", "ISO8859-13", "iso8859-13", "iso885913", "8859-13", "IBM-921", /* aix */ "iso813", /*?*/ "iso13", NULL}; char *iso8859_14[] = {"ISO-8859-14", "ISO8859-14", "iso8859-14", "iso885914", "8859-14", "iso814", "iso14", NULL}; char *iso8859_15[] = {"ISO-8859-15", "ISO88859-15", "iso88859-15", "iso885915", "8859-15", "iso815", "iso15", NULL}; char *iso8859_16[] = {"ISO-8859-16", "ISO8859-16", "iso8859-16", "iso885916", "8859-16", "iso80", "iso16", NULL}; char *jisx0201_1976_0[] = {"JIS_X0201", "ISO-IR-14", "jis", /* hpux */ NULL}; char *jisx0208_1983_0[] = {"JIS_X0208", NULL}; char *jisx0208_1990_0[] = {"JIS_X0208", NULL}; char *jisx0212_1990_0[] = {"JIS_X0212", NULL}; char *koi8_r[] = {"KOI8-R", /* gnu, solaris */ NULL}; char *koi8_u[] = {"KOI8-U", NULL}; char *ksc5601[] = {"KSC5636", "ko_KR-johap", /* solaris */ "ko_KR-johap92", "ko_KR-euc", "eucKR", "EUC-KR", "EUCKR", "euc-kr", "CP949", /* osf */ NULL}; char *microsoft_cp1251[] = {"CP1251", NULL}; char *microsoft_cp1255[] = {"CP1255", NULL}; char *microsoft_cp1256[] = {"CP1256", NULL}; char *mulelao_1[] = {"MULELAO-1", "MULELAO", NULL}; char *sjisx_1[] = {"SHIFT_JIS", "SJIS", /* solaris, osf */ "sjis", /* hpux */ "PCK", /* solaris */ NULL}; char *tatar_cyr[] = {NULL}; char *tcvn_5712[] = {"TCVN", NULL}; char *tis620_0[] = {"TIS-620", "tis620", /* hpux */ "TACTIS", /* osf */ NULL}; char *viscii1_1_1[] = {"VISCII", NULL}; /* encofing only ...*/ char *utf_8[] = {"UTF-8", /* gnu, solaris */ "UTF8", "utf8", "utf_8", NULL}; char *usc_2[] = {"USC-2", "USC2", "usc2", "usc-2", "usc_2", NULL}; char *usc_4[] = {"USC-4", "USC4", "usc4", "usc-4", "usc_4", NULL}; char *utf_16[] = {"UTF-16", "UTF16", "utf16", "utf_16", NULL}; char *euc_jp[] = {"EUC-JP", "EUCJP", "euc_jp", "euc-jp", "eucjp", NULL}; #endif #if FiconvSupport #ifdef HAVE_BIDI #define CT_ENTRY(x,y,z) \ {x, y, FLC_INDEX_ICONV_CHARSET_NOT_INITIALIZED, z, FLC_ENCODING_TYPE_FONT} #define CT_ENTRY_WET(x,y,z,t) \ {x, y, FLC_INDEX_ICONV_CHARSET_NOT_INITIALIZED, z, t} #else #define CT_ENTRY(x,y,z) \ {x, y, FLC_INDEX_ICONV_CHARSET_NOT_INITIALIZED, NULL, FLC_ENCODING_TYPE_FONT} #define CT_ENTRY_WET(x,y,z,t) \ {x, y, FLC_INDEX_ICONV_CHARSET_NOT_INITIALIZED, NULL, t} #endif #else /* !FlocaleIconvSupport */ #ifdef HAVE_BIDI #define CT_ENTRY(x,y,z) \ {x, nullsl, FLC_INDEX_ICONV_CHARSET_NOT_FOUND, z, FLC_ENCODING_TYPE_FONT} #define CT_ENTRY_WET(x,y,z,t) \ {x, nullsl, FLC_INDEX_ICONV_CHARSET_NOT_FOUND, z, t} #else #define CT_ENTRY(x,y,z) \ {x, nullsl, FLC_INDEX_ICONV_CHARSET_NOT_FOUND, NULL, FLC_ENCODING_TYPE_FONT} #define CT_ENTRY_WET(x,y,z,t) \ {x, nullsl, FLC_INDEX_ICONV_CHARSET_NOT_FOUND, NULL, t} #endif #endif static FlocaleCharset UnknownCharset = {"Unknown", nullsl, FLC_INDEX_ICONV_CHARSET_NOT_FOUND, NULL}; /* the table contains all Xorg "charset" plus some others */ FlocaleCharset FlocaleCharsetTable[] = { CT_ENTRY("ARMSCII-8", armscii_8, NULL), CT_ENTRY("BIG5-0", big5_0, NULL), CT_ENTRY("BIG5HKSCS-0", big5hkscs_0, NULL), CT_ENTRY("CNS11643.1986-1", cns11643, NULL), CT_ENTRY("CNS11643.1986-2", cns11643, NULL), CT_ENTRY("CNS11643.1992-3", cns11643, NULL), CT_ENTRY("CNS11643.1992-4", cns11643, NULL), CT_ENTRY("CNS11643.1992-5", cns11643, NULL), CT_ENTRY("CNS11643.1992-6", cns11643, NULL), CT_ENTRY("CNS11643.1992-7", cns11643, NULL), CT_ENTRY("DOSENCODING-CP437", dosencoding_cp437, NULL), CT_ENTRY("DOSENCODING-CP850", dosencoding_cp850, NULL), CT_ENTRY("EUC-JP", euc_jp, NULL), CT_ENTRY("GB2312.1980-0", gb2312_1980_0, NULL), CT_ENTRY("GBK-0", gbk_0, NULL), CT_ENTRY("GEORGIAN-ACADEMY", georgian_academy, NULL), CT_ENTRY("GEORGIAN-PS", georgian_ps, NULL), CT_ENTRY("IBM-CP1133", ibm_cp1133, NULL), CT_ENTRY("ISIRI-3342", isiri_3342, "ISIRI-3342"), /* exception ISO10646-1 implies UTF-8 and not USC-2 ! */ CT_ENTRY_WET("ISO10646-1", utf_8, "UTF-8", FLC_ENCODING_TYPE_UTF_8), CT_ENTRY("ISO8859-1", iso8859_1, NULL), CT_ENTRY("ISO8859-2", iso8859_2, NULL), CT_ENTRY("ISO8859-3", iso8859_3, NULL), CT_ENTRY("ISO8859-4", iso8859_4, NULL), CT_ENTRY("ISO8859-5", iso8859_5, NULL), CT_ENTRY("ISO8859-6", iso8859_6, "ISO8859-6"), CT_ENTRY("ISO8859-6.8X", iso8859_6, "ISO8859-6"), CT_ENTRY("ISO8859-7", iso8859_7, NULL), CT_ENTRY("ISO8859-8", iso8859_8, "ISO8859-8"), CT_ENTRY("ISO8859-9", iso8859_9, NULL), CT_ENTRY("ISO8859-9E", iso8859_9, NULL), CT_ENTRY("ISO8859-10", iso8859_10, NULL), CT_ENTRY("ISO8859-13", iso8859_13, NULL), CT_ENTRY("ISO8859-14", iso8859_14, NULL), CT_ENTRY("ISO8859-15", iso8859_15, NULL), CT_ENTRY("ISO8859-16", iso8859_16, NULL), CT_ENTRY("JISX.UDC-1", jisx0201_1976_0, NULL), /* ? */ CT_ENTRY("JISX0201.1976-0", jisx0201_1976_0, NULL), CT_ENTRY("JISX0208.1983-0", jisx0208_1983_0, NULL), CT_ENTRY("JISX0208.1990-0", jisx0208_1990_0, NULL), CT_ENTRY("JISX0212.1990-0", jisx0212_1990_0, NULL), CT_ENTRY("KOI8-C", koi8_r, NULL), CT_ENTRY("KOI8-R", koi8_r, NULL), CT_ENTRY("KOI8-U", koi8_u, NULL), CT_ENTRY("KSC5601.1987-0", ksc5601, NULL), CT_ENTRY("KSC5601.1992-0", ksc5601, NULL), CT_ENTRY("MICROSOFT-CP1251", microsoft_cp1251, NULL), CT_ENTRY("MICROSOFT-CP1255", microsoft_cp1255, "CP1255"), CT_ENTRY("MICROSOFT-CP1256", microsoft_cp1256, "CP1256"), CT_ENTRY("MULELAO-1", mulelao_1, NULL), CT_ENTRY("SJISX-1", sjisx_1, NULL), CT_ENTRY("TATAR-CYR", tatar_cyr, NULL), CT_ENTRY("TCVN-5712", tcvn_5712, NULL), CT_ENTRY("TIS620-0", tis620_0, NULL), CT_ENTRY("VISCII1.1-1", viscii1_1_1, NULL), /* aliases */ /* CT_ENTRY("ADOBE-STANDARD", iso8859_1, NULL), no! */ CT_ENTRY("ASCII-0", iso8859_1, NULL), CT_ENTRY("BIBIG5HKSCS", big5_0, NULL), /* ? */ CT_ENTRY("BIG5-E0", big5_0, NULL), /* emacs */ CT_ENTRY("BIG5-E1", big5_0, NULL), /* emacs */ CT_ENTRY("BIG5-1", big5_0, NULL), CT_ENTRY("ISO646.1991-IRV", iso8859_1, NULL), CT_ENTRY("TIS620.2533-1", tis620_0, NULL), CT_ENTRY_WET("UTF-8", utf_8, "UTF-8", FLC_ENCODING_TYPE_UTF_8), CT_ENTRY_WET("USC-2", usc_2, "USC-2", FLC_ENCODING_TYPE_USC_2), CT_ENTRY_WET("USC-4", usc_4, NULL, FLC_ENCODING_TYPE_USC_4), CT_ENTRY_WET("UTF-16", utf_16, NULL, FLC_ENCODING_TYPE_UTF_16), CT_ENTRY(NULL, nullsl, NULL) }; /* to be supported: ADOBE-STANDARD, some Xft1 charset */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static FlocaleCharset *FlocaleCharsetOfXCharset(char *x) { int j = 0; while(FlocaleCharsetTable[j].x != NULL) { if (StrEquals(x,FlocaleCharsetTable[j].x)) { return &FlocaleCharsetTable[j]; } j++; } return NULL; } static FlocaleCharset *FlocaleCharsetOfLocaleCharset(char *l) { int j = 0, i = 0; while(FlocaleCharsetTable[j].x != NULL) { if (StrEquals(l, FlocaleCharsetTable[j].x)) { return &FlocaleCharsetTable[j]; } i = 0; while(FlocaleCharsetTable[j].locale[i] != NULL) { if (StrEquals(l, FlocaleCharsetTable[j].locale[i])) { return &FlocaleCharsetTable[j]; } i++; } j++; } return NULL; } static FlocaleCharset *FlocaleCharsetOfFontStruct(Display *dpy, XFontStruct *fs) { unsigned long value = 0; char *name,*tmp; FlocaleCharset *fc; int count = 0; if (fs == NULL) return NULL; if (!XGetFontProperty(fs, XA_FONT, &value)) { return NULL; } if ((name = XGetAtomName(dpy, value)) == NULL) { return NULL; } tmp = name; while (*tmp != '\0' && count < 13) { if (*tmp == '-') { count++; } tmp++; if (count == 13) { fc = FlocaleCharsetOfXCharset(tmp); XFree(name); return fc; } } XFree(name); return NULL; } static void FlocaleInit_X_Charset(Display *dpy, const char *module) { #ifdef HAVE_XOUTPUT_METHOD XOM om; XOMCharSetList cs; int i; om = XOpenOM(dpy, NULL, NULL, NULL); if (om && XGetOMValues(om, XNRequiredCharSet, &cs, NULL) == NULL) { if (cs.charset_count > 0) { if (FLCXOMCharsetList != NULL) { free(FLCXOMCharsetList); } FLCXOMCharsetList_num = cs.charset_count; FLCXOMCharsetList = (FlocaleCharset **)safemalloc( sizeof(FlocaleCharset) * cs.charset_count); for (i = 0; i < FLCXOMCharsetList_num; i++) { FLCXOMCharsetList[i] = FlocaleCharsetOfXCharset( cs.charset_list[i]); #if FLOCALE_DEBUG_CHARSET fprintf(stderr, "[FlocaleInitCharset] XOM charset " "%i: %s, bidi:%s\n", i, FLC_DEBUG_GET_X_CHARSET( FLCXOMCharsetList[i]), FLC_DEBUG_GET_BIDI_CHARSET ( FLCXOMCharsetList[i])); #endif } } } if (om) { XCloseOM(om); } if (FLCXOMCharsetList_num > 0 && FLCXOMCharsetList[0]) { char *best_charset; if (FLCLocaleCharset != NULL) { best_charset = FLCLocaleCharset->x; #if FLOCALE_DEBUG_CHARSET fprintf(stderr, "[FlocaleInitCharset] FLCLocaleCharset: %s\n", best_charset); #endif } else { best_charset = FLOCALE_FALLBACK_XCHARSET; #if FLOCALE_DEBUG_CHARSET fprintf(stderr, "[FlocaleInitCharset] FALLBACK: %s\n", best_charset); #endif } FLCXOMCharset = FLCXOMCharsetList[0]; if (best_charset == NULL) { /* should not happen */ } else { for(i = 0; i < FLCXOMCharsetList_num; i++) { if (StrEquals( best_charset, FLC_DEBUG_GET_X_CHARSET( FLCXOMCharsetList[i]))) { FLCXOMCharset = FLCXOMCharsetList[i]; break; } } } #if FLOCALE_DEBUG_CHARSET fprintf(stderr, "[FlocaleInitCharset] XOM charset " "%i: %s\n", i, FLC_DEBUG_GET_X_CHARSET(FLCXOMCharset)); #endif } #endif } /* ---------------------------- interface functions ------------------------ */ void FlocaleCharsetInit(Display *dpy, const char *module) { static Bool initialized = False; char *charset; if (initialized == True) { return; } initialized = True; /* try to find the regular charset */ charset = getenv("CHARSET"); #if FLOCALE_DEBUG_CHARSET fprintf(stderr, "[FlocaleInitCharset] CHARSET: %s\n", (!charset)? "null":charset); #endif if ((!charset || strlen(charset) < 3) && FlocaleLibcharsetSupport) { charset = (char *)Flocale_charset(); #if FLOCALE_DEBUG_CHARSET fprintf( stderr, "[FlocaleInitCharset] FlocaleLibcharsetSupport: %s\n", (!charset)? "null":charset); #endif } if ((!charset || strlen(charset) < 3) && FlocaleCodesetSupport) { charset = Fnl_langinfo(FCODESET); #if FLOCALE_DEBUG_CHARSET fprintf( stderr, "[FlocaleInitCharset] Fnl_langinfo: %s\n", (!charset)? "null":charset); #endif } if (charset != NULL && strlen(charset) > 2) { FLCLocaleCharset = FlocaleCharsetOfLocaleCharset(charset); #if FLOCALE_DEBUG_CHARSET fprintf( stderr, "[FlocaleInitCharset] FLCLocaleCharset: %s\n", charset); #endif } /* set the defaults X locale charsets */ FlocaleInit_X_Charset(dpy, module); /* never null */ FLCUtf8Charset = FlocaleCharsetOfXCharset(FLOCALE_UTF8_XCHARSET); #if FLOCALE_DEBUG_CHARSET fprintf(stderr,"[FlocaleCharsetInit] locale charset: x:%s, bidi:%s\n", FLC_DEBUG_GET_X_CHARSET(FLCXOMCharset), FLC_DEBUG_GET_BIDI_CHARSET (FLCXOMCharset)); fprintf(stderr,"[FlocaleCharsetInit] locale charset: x:%s, bidi:%s\n", FLC_DEBUG_GET_X_CHARSET(FLCLocaleCharset), FLC_DEBUG_GET_BIDI_CHARSET (FLCLocaleCharset)); #endif return; } void FlocaleCharsetSetFlocaleCharset( Display *dpy, FlocaleFont *flf, char *hints, char *encoding, char *module) { char *charset = NULL; char *iconv = NULL; Bool iconv_found = False; int i = 0; FlocaleCharsetInit(dpy, module); if (hints && *hints) { iconv = GetQuotedString( hints, &charset, "/", NULL, NULL, NULL); if (charset && *charset && *charset != '*' ) { flf->fc = FlocaleCharsetOfXCharset(charset); } if (flf->fc == NULL && charset && *charset && *charset != '*') { flf->fc = FlocaleCharsetOfLocaleCharset(charset); } if (flf->fc == NULL && iconv && *iconv) { flf->fc = FlocaleCharsetOfLocaleCharset(iconv); } } if (flf->fc == NULL) { if (FftSupport && flf->fftf.fftfont != NULL) { flf->fc = FlocaleCharsetOfXCharset(flf->fftf.encoding); } else if (flf->fontset != None) { if (FLCXOMCharset != NULL) { flf->fc = FLCXOMCharset; } else { /* we are here if !HAVE_XOUTPUT_METHOD */ XFontStruct **fs_list; char **ml; if (XFontsOfFontSet( flf->fontset, &fs_list, &ml) > 0) { flf->fc = FLCXOMCharset = FlocaleCharsetOfFontStruct( dpy, fs_list[0]); } } } else if (flf->font != NULL) { flf->fc = FlocaleCharsetOfFontStruct(dpy, flf->font); } } if (flf->fc != NULL && iconv && *iconv) { /* the user has specified an iconv converter name: * check if we have it and force user choice */ while(!iconv_found && FLC_GET_LOCALE_CHARSET(flf->fc,i) != NULL) { if ( strcmp( iconv, FLC_GET_LOCALE_CHARSET(flf->fc,i)) == 0) { iconv_found = True; /* Trust the user? yes ... */ FLC_SET_ICONV_INDEX(flf->fc,i); } i++; } } if (iconv && *iconv && !iconv_found) { FlocaleCharset *fc; /* the user has specified an iconv converter name and we do not * have it: must create a FlocaleCharset */ flf->flags.must_free_fc = True; fc = (FlocaleCharset *)safemalloc(sizeof(FlocaleCharset)); if (flf->fc != NULL) { CopyString(&fc->x, flf->fc->x); fc->encoding_type = flf->fc->encoding_type; if (flf->fc->bidi) CopyString(&fc->bidi, flf->fc->bidi); else fc->bidi = NULL; } else { CopyString(&fc->x, "Unknown"); /* for simplicity */ fc->bidi = NULL; fc->encoding_type = FLC_ENCODING_TYPE_FONT; } fc->locale = (char **)safemalloc(2*sizeof(char *)); CopyString(&fc->locale[0], iconv); fc->locale[1] = NULL; fc->iconv_index = FLC_INDEX_ICONV_CHARSET_NOT_INITIALIZED; flf->fc = fc; } if (charset != NULL) { free(charset); } if (flf->fc == NULL) { flf->fc = &UnknownCharset; } /* now the string charset */ if (encoding != NULL) { flf->str_fc = FlocaleCharsetOfXCharset(encoding); if (flf->str_fc == NULL) { flf->str_fc = FlocaleCharsetOfLocaleCharset(encoding); } if (flf->str_fc == NULL) { flf->str_fc = &UnknownCharset; } } else if (FftSupport && flf->fftf.fftfont != NULL) { if (flf->fftf.str_encoding != NULL) { flf->str_fc = FlocaleCharsetOfXCharset( flf->fftf.str_encoding); if (flf->str_fc == NULL) { flf->str_fc = FlocaleCharsetOfLocaleCharset( flf->fftf.str_encoding); } if (flf->str_fc == NULL) { flf->str_fc = &UnknownCharset; } } else { flf->str_fc = FlocaleCharsetGetDefaultCharset(dpy, module); } } if (flf->str_fc == NULL) { if (flf->fc != &UnknownCharset) { flf->str_fc = flf->fc; } else { flf->str_fc = FlocaleCharsetGetDefaultCharset(dpy, module); } } } FlocaleCharset *FlocaleCharsetGetDefaultCharset(Display *dpy, char *module) { static int warn = True; FlocaleCharsetInit(dpy, module); if (FLCXOMCharset != NULL) return FLCXOMCharset; if (FLCLocaleCharset != NULL) return FLCLocaleCharset; if (warn) { warn = False; fprintf(stderr, "[%s][%s]: WARN -- Cannot find default locale " "charset with:\n\t", (module != NULL)? module:"FVWMlibs", "FlocaleGetDefaultCharset"); fprintf(stderr,"X Ouput Method "); fprintf(stderr,", CHARSET env variable"); if (FlocaleLibcharsetSupport) fprintf(stderr,", locale_charset"); if (FlocaleCodesetSupport) fprintf(stderr,", nl_langinfo"); fprintf(stderr,"\n"); /* never null */ FLCLocaleCharset = FlocaleCharsetOfXCharset(FLOCALE_FALLBACK_XCHARSET); fprintf(stderr,"\tUse default charset: %s\n", FLOCALE_FALLBACK_XCHARSET); } return FLCLocaleCharset; } FlocaleCharset *FlocaleCharsetGetFLCXOMCharset(void) { return FLCXOMCharset; } FlocaleCharset *FlocaleCharsetGetUtf8Charset(void) { return FLCUtf8Charset; } FlocaleCharset *FlocaleCharsetGetLocaleCharset(void) { return FLCLocaleCharset; } FlocaleCharset *FlocaleCharsetGetUnknownCharset(void) { return &UnknownCharset; } const char *FlocaleGetBidiCharset(Display *dpy, FlocaleCharset *fc) { if (fc == NULL || fc == FlocaleCharsetGetUnknownCharset() || fc->bidi == NULL) { return NULL; } return (const char *)fc->bidi; } FlocaleCharset *FlocaleCharsetGetEUCJPCharset(void) { static FlocaleCharset *fc = NULL; if (fc != NULL) return fc; /* never null */ fc = FlocaleCharsetOfXCharset("EUC-JP"); return fc; } Bool FlocaleCharsetIsCharsetXLocale(Display *dpy, char *charset, char *module) { #ifdef HAVE_XOUTPUT_METHOD int i; FlocaleCharsetInit(dpy, module); if (FLCXOMCharsetList_num > 0) { for(i = 0; i < FLCXOMCharsetList_num; i++) { if (StrEquals( FLC_DEBUG_GET_X_CHARSET( FLCXOMCharsetList[i]), charset)) { return True; } } } return False; #else return True; /* Hum */ #endif } void FlocaleCharsetPrintXOMInfo(void) { #ifdef HAVE_XOUTPUT_METHOD int i; fprintf(stderr," XOM Charsets: "); if (FLCXOMCharsetList_num > 0) { for(i = 0; i < FLCXOMCharsetList_num; i++) { fprintf( stderr, "%s ", FLC_DEBUG_GET_X_CHARSET(FLCXOMCharsetList[i])); } } fprintf(stderr,"\n"); #endif } fvwm-2.6.5.orig/libs/charmap.c0000644000175000017500000000675211362563523014352 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include "charmap.h" #include "wcontext.h" #include "safemalloc.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ /* Turns a string context of context or modifier values into an array of * true/false values (bits). */ int charmap_string_to_mask( int *ret, const char *string, charmap_t *table, char *errstring) { int len = strlen(string); int error = 0; int i; *ret = 0; for (i = 0; i < len; ++i) { int found_match; int j; char c; c = tolower(string[i]); for (j = 0, found_match = 0; table[j].key != 0; j++) { if (table[j].key == c) { *ret |= table[j].value; found_match = 1; break; } } if (!found_match) { fputs("charmap_string_to_mask: ", stderr); if (errstring != NULL) { fputs(errstring, stderr); } fputc(' ', stderr); fputc(c, stderr); fputc('\n', stderr); error = 1; } } return error; } /* Reverse function of above. Returns zero if no matching mask is found in the * table. */ char charmap_mask_to_char(int mask, charmap_t *table) { char c; for (c = 0; table->key != 0; table++) { if (mask == table->value) { c = table->key; break; } } return c; } /* Used from "PrintInfo Bindings". */ char *charmap_table_to_string(int mask, charmap_t *table) { char *allmods; int modmask; char c[2]; c[1] = 0; modmask = mask; allmods = safemalloc(sizeof(table->value) * 8 + 1); *allmods = 0; for (; table->key !=0; table++) { c[0] = toupper(table->key); /* Don't explicitly match "A" for any context as doing so * means we never see the individual bindings. Incremental * matching here for AnyContext is disasterous.*/ if ((modmask & table->value) && (table->value != C_ALL)) { /* incremental match */ strcat(allmods, c); modmask &= ~table->value; } else if (mask == table->value) { /* exact match */ strcpy(allmods, c); break; } } return allmods; } fvwm-2.6.5.orig/libs/Makefile.am0000644000175000017500000000334111225170337014611 0ustar vwcvwc## Process this file with automake to create Makefile.in noinst_LIBRARIES = libfvwm.a ## please keep .c files in largest first order to speed up parallel makes libfvwm_a_SOURCES = \ BidiJoin.h Bindings.h ClientMsg.h ColorUtils.h Colorset.h \ CombineChars.h Cursor.h Event.h FBidi.h FEvent.h FGettext.h FImage.h \ FRender.h FRenderInit.h FRenderInterface.h FSMlib.h FScreen.h \ FShape.h FShm.h FTips.h Fcursor.h Fft.h FftInterface.h Ficonv.h \ Flocale.h FlocaleCharset.h Fplay.h Fpng.h Fsvg.h Fxpm.h Grab.h \ Graphics.h Module.h Parse.h Picture.h PictureBase.h \ PictureDitherMatrice.h PictureGraphics.h PictureImageLoader.h \ PictureUtils.h Rectangles.h Strings.h System.h Target.h WinMagic.h \ XError.h XResource.h charmap.h defaults.h envvar.h fio.h flist.h \ fsm.h ftime.h fvwm_sys_stat.h fvwmlib.h fvwmrect.h fvwmsignal.h \ gravity.c gravity.h lang-strings.h modifiers.h queue.h safemalloc.h \ setpgrp.h timeout.h vpacket.h wcontext.h wild.h \ \ BidiJoin.c Flocale.c PictureUtils.c FScreen.c Graphics.c \ PictureGraphics.c Bindings.c FlocaleCharset.c Parse.c \ PictureImageLoader.c Colorset.c ColorUtils.c CombineChars.c Module.c \ FRender.c Ficonv.c envvar.c Fft.c gravity.c \ XResource.c FEvent.c FImage.c WinMagic.c Target.c Picture.c XError.c \ queue.c fvwmsignal.c System.c PictureBase.c Cursor.c Strings.c \ fvwmrect.c FRenderInit.c safemalloc.c FBidi.c \ wild.c Grab.c Event.c ClientMsg.c setpgrp.c FShape.c \ FGettext.c Rectangles.c timeout.c flist.c charmap.c wcontext.c \ modifiers.c fsm.c FTips.c fio.c fvwmlib.c libfvwm_a_LIBADD = @LIBOBJS@ @ALLOCA@ INCLUDES = -I$(top_srcdir) $(xpm_CFLAGS) $(Xft_CFLAGS) $(X_CFLAGS) \ $(iconv_CFLAGS) $(Xrender_CFLAGS) $(Bidi_CFLAGS) $(png_CFLAGS) \ $(rsvg_CFLAGS) $(intl_CFLAGS) fvwm-2.6.5.orig/libs/Fcursor.h0000644000175000017500000000220510646415017014352 0ustar vwcvwc#ifndef FCURSOR_H #define FCURSOR_H #ifdef HAVE_XCURSOR # include typedef XcursorImage FcursorImage; typedef XcursorImages FcursorImages; typedef XcursorPixel FcursorPixel; # define FcursorFilenameLoadImages(a,b) XcursorFilenameLoadImages(a,b) # define FcursorGetDefaultSize(a) XcursorGetDefaultSize(a) # define FcursorImageCreate(a,b) XcursorImageCreate(a,b) # define FcursorImageDestroy(a) XcursorImageDestroy(a) # define FcursorImagesDestroy(a) XcursorImagesDestroy(a) # define FcursorImageLoadCursor(a,b) XcursorImageLoadCursor(a,b) # define FcursorImagesLoadCursor(a,b) XcursorImagesLoadCursor(a,b) #else typedef struct { int width; int height; int xhot; int yhot; int delay; void *pixels; } FcursorImage; typedef struct { int nimage; FcursorImage **images; } FcursorImages; typedef void FcursorPixel; # define FcursorFilenameLoadImages(a,b) 0 # define FcursorGetDefaultSize(a) 0 # define FcursorImageCreate(a,b) 0 # define FcursorImageDestroy(a) # define FcursorImagesDestroy(a) # define FcursorImageLoadCursor(a,b) 0 # define FcursorImagesLoadCursor(a,b) 0 #endif #endif /* FCURSOR_H */ fvwm-2.6.5.orig/libs/strerror.c0000644000175000017500000000164707677641664014640 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" char *strerror(int num) { extern int sys_nerr; extern char *sys_errlist[]; if (num >= 0 && num < sys_nerr) return(sys_errlist[num]); else return "Unknown error number"; } fvwm-2.6.5.orig/libs/strcasecmp.c0000644000175000017500000000165307677641664015117 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" int strcasecmp(register char *s1,register char *s2) { while (tolower(*s1) == tolower(*s2)) { ++s1; ++s2; if (!*s1 || !*s2) break; } return (tolower(*s1) - tolower(*s2)); } fvwm-2.6.5.orig/libs/fio.c0000644000175000017500000000305010630367353013500 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include "fio.h" /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- interface functions ------------------------ */ ssize_t fvwm_send(int s, const void *buf, size_t len, int flags) { int rc; size_t offset; const char *data; data = buf; offset = 0; do { rc = send(s, (char *)data + offset, len - offset, flags); if (rc > 0) { offset += rc; } } while ((rc > 0 && (offset < len)) || (rc == -1 && errno == EINTR)); return rc; } ssize_t fvwm_recv(int s, void *buf, size_t len, int flags) { int rc; do { rc = recv(s, buf, len, flags); } while (rc == -1 && errno == EINTR); return rc; } fvwm-2.6.5.orig/libs/FBidi.c0000644000175000017500000001010711552031216013667 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Mikhael Goikhman */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * FBidi.c - interface to Bidi, we use fribidi implementation here. * See FBidi.h for some comments on this interface. */ #include "config.h" #include "FBidi.h" #if HAVE_BIDI #include "safemalloc.h" #include "BidiJoin.h" #include #include Bool FBidiIsApplicable(const char *charset) { if (fribidi_parse_charset((char *)charset) == FRIBIDI_CHAR_SET_NOT_FOUND) { return False; } return True; } char *FBidiConvert( const char *logical_str, const char *charset, int str_len, Bool *is_rtl, int *out_len, superimpose_char_t *comb_chars, int *l_to_v) { char *visual_str; FriBidiCharSet fribidi_charset; FriBidiChar *logical_unicode_str; FriBidiChar *visual_unicode_str; FriBidiParType pbase_dir = FRIBIDI_TYPE_ON; FriBidiStrIndex *pos_l_to_v; int i; if (logical_str == NULL || charset == NULL) { return NULL; } if (str_len < 0) { str_len = strlen(logical_str); } if (is_rtl != NULL) { *is_rtl = False; } fribidi_charset = fribidi_parse_charset((char *)charset); if (fribidi_charset == FRIBIDI_CHAR_SET_NOT_FOUND) { return NULL; } /* it is possible that we allocate a bit more here, if utf-8 */ logical_unicode_str = (FriBidiChar *)safemalloc((str_len + 1) * sizeof(FriBidiChar)); /* convert to unicode first */ str_len = fribidi_charset_to_unicode( fribidi_charset, (char *)logical_str, str_len, logical_unicode_str); visual_unicode_str = (FriBidiChar *)safemalloc((str_len + 1) * sizeof(FriBidiChar)); /* apply bidi algorithm, convert logical string to visual string */ /* also keep track of how characters are reordered here, to reorder combing characters accordingly */ pos_l_to_v = (FriBidiStrIndex *)safemalloc((str_len + 1) * sizeof(FriBidiStrIndex)); fribidi_log2vis( logical_unicode_str, str_len, &pbase_dir, visual_unicode_str, pos_l_to_v, NULL, NULL); /* remap mapping from logical to visual to "compensate" for BIDI */ if (comb_chars != NULL) { for (i = 0; comb_chars[i].c.byte1 != 0 || comb_chars[i].c.byte2 != 0; i++) { /* if input string is zero characters => only combining chars, set position to zero */ comb_chars[i].position = str_len != 0 ? pos_l_to_v[comb_chars[i].position] : 0; } } if (l_to_v != NULL) { /* values in the previuos mapping gives the position of input characters after combining step */ /* mapping from BIDI conversion maps from the positions in the output from combining */ int orig_len; int *l_to_v_temp; for (i = 0; l_to_v[i] != -1; i++) { } orig_len = i; l_to_v_temp = (int *)safemalloc(orig_len * sizeof(int)); for (i = 0; i < orig_len; i++) { l_to_v_temp[i] = pos_l_to_v[l_to_v[i]]; } for (i = 0; i < orig_len; i++) { l_to_v[i] = l_to_v_temp[i]; } free(l_to_v_temp); } free(pos_l_to_v); /* character shape/join - will get pulled into fribidi with time */ str_len = shape_n_join(visual_unicode_str, str_len); visual_str = (char *)safemalloc((4 * str_len + 1) * sizeof(char)); /* convert from unicode finally */ *out_len = fribidi_unicode_to_charset( fribidi_charset, visual_unicode_str, str_len, visual_str); if (is_rtl != NULL && fribidi_get_bidi_type(*visual_unicode_str) == FRIBIDI_TYPE_RTL) { *is_rtl = True; } free(logical_unicode_str); free(visual_unicode_str); return visual_str; } #endif /* HAVE_BIDI */ fvwm-2.6.5.orig/libs/Event.h0000644000175000017500000000032210556633567014022 0ustar vwcvwc#ifndef LIB_EVENT_H #define LIB_EVENT_H /* * Return the subwindow member of an event if the event type has one. */ Window GetSubwindowFromEvent(Display *dpy, const XEvent *eventp); #endif /* LIB_EVENT_H */ fvwm-2.6.5.orig/libs/Bindings.h0000644000175000017500000000772310137411655014475 0ustar vwcvwc/* -*-c-*- */ #include /* XClassHint */ #ifndef FVWMLIB_BINDINGS_H_H #define FVWMLIB_BINDINGS_H_H /* ---------------------------- global definitions ------------------------- */ #define binding_t_t unsigned char /* ---------------------------- global macros ------------------------------ */ #define BIND_IS_KEY_PRESS(t) ((t) == BIND_KEYPRESS || (t) == BIND_PKEYPRESS) #define BIND_IS_KEY_BINDING(t) ((t) == BIND_KEYPRESS || (t) == BIND_PKEYPRESS) #define BIND_IS_PKEY_BINDING(t) ((t) == BIND_PKEYPRESS) #define BIND_IS_MOUSE_BINDING(t) \ ((t) == BIND_BUTTONPRESS || (t) == BIND_BUTTONRELEASE) #define BIND_IS_STROKE_BINDING(t) ((t) == BIND_STROKE) /* ---------------------------- type definitions --------------------------- */ typedef enum { /* press = even number, release = press + 1 */ BIND_BUTTONPRESS = 0, BIND_BUTTONRELEASE = 1, BIND_KEYPRESS = 2, BIND_PKEYPRESS = 4, BIND_STROKE = 6 } binding_t; typedef struct Binding { binding_t_t type; /* Is it a mouse, key, or stroke binding */ STROKE_CODE(void *Stroke_Seq;) /* stroke sequence */ int Button_Key; /* Mouse Button number or Keycode */ char *key_name; /* In case of keycode, give the key_name too */ int Context; /* Fvwm context, ie titlebar, frame, etc */ int Modifier; /* Modifiers for keyboard state */ void *Action; /* What to do? */ void *Action2; /* This one can be used too */ char *windowName; /* Name of window (regex pattern) this binding applies to. NULL means all windows. */ struct Binding *NextBinding; } Binding; /* ---------------------------- interface functions ------------------------ */ void CollectBindingList( Display *dpy, Binding **pblist_src, Binding **pblist_dest, binding_t type, STROKE_ARG(void *stroke) int button, KeySym keysym, int modifiers, int contexts, char *windowName); int AddBinding( Display *dpy, Binding **pblist, binding_t type, STROKE_ARG(void *stroke) int button, KeySym keysym, char *key_name, int modifiers, int contexts, void *action, void *action2, char *windowName); void FreeBindingStruct(Binding *b); void FreeBindingList(Binding *b); void RemoveBinding(Binding **pblist, Binding *b, Binding *prev); Bool RemoveMatchingBinding( Display *dpy, Binding **pblist, binding_t type, STROKE_ARG(char *stroke) int button, KeySym keysym, int modifiers, int contexts); void *CheckBinding( Binding *blist, STROKE_ARG(char *stroke) int button_keycode, unsigned int modifier, unsigned int dead_modifiers, int Context, binding_t type, const XClassHint *win_class, const char *win_name); void *CheckTwoBindings( Bool *ret_is_second_binding, Binding *blist, STROKE_ARG(char *stroke) int button_keycode, unsigned int modifier,unsigned int dead_modifiers, int Context, binding_t type, const XClassHint *win_class, const char *win_name, int Context2, binding_t type2, const XClassHint *win_class2, const char *win_name2); void GrabWindowKey( Display *dpy, Window w, Binding *binding, unsigned int contexts, unsigned int dead_modifiers, Bool fGrab); void GrabAllWindowKeys( Display *dpy, Window w, Binding *blist, unsigned int contexts, unsigned int dead_modifiers, Bool fGrab); void GrabWindowButton( Display *dpy, Window w, Binding *binding, unsigned int contexts, unsigned int dead_modifiers, Cursor cursor, Bool fGrab); void GrabAllWindowButtons( Display *dpy, Window w, Binding *blist, unsigned int contexts, unsigned int dead_modifiers, Cursor cursor, Bool fGrab); void GrabAllWindowKeysAndButtons( Display *dpy, Window w, Binding *blist, unsigned int contexts, unsigned int dead_modifiers, Cursor cursor, Bool fGrab); void GrabWindowKeyOrButton( Display *dpy, Window w, Binding *binding, unsigned int contexts, unsigned int dead_modifiers, Cursor cursor, Bool fGrab); KeySym FvwmStringToKeysym(Display *dpy, char *key); Bool bindingAppliesToWindow(Binding *binding, const XClassHint *win_class, const char *win_name); Bool is_pass_through_action(const char *action); #endif /* FVWMLIB_BINDINGS_H_H */ fvwm-2.6.5.orig/libs/FShm.h0000644000175000017500000000275707677641664013623 0ustar vwcvwc/* -*-c-*- */ #ifndef FSHM_H #define FSHM_H /* ---------------------------- included header files ---------------------- */ #include "config.h" #ifdef HAVE_XSHM #define XShmSupport 1 #else #define XShmSupport 0 #endif #if XShmSupport #include #include #include #endif /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ #if XShmSupport /* XShm */ typedef ShmSeg FShmSeg; typedef XShmSegmentInfo FShmSegmentInfo; #define FShmAttach XShmAttach #define FShmDetach XShmDetach #define FShmPutImage XShmPutImage #define FShmGetImage XShmGetImage #define FShmCreateImage XShmCreateImage /* shm */ #define Fshmget shmget #define Fshmat shmat #define Fshmdt shmdt #define Fshmctl shmctl #define Fshmget shmget #else /* XShm */ typedef unsigned long FhmSeg; typedef struct { FhmSeg shmseg; int shmid; char *shmaddr; Bool readOnly; } FShmSegmentInfo; #define FShmAttach(a, b) 0 #define FShmDetach(a, b) 0 #define FShmPutImage(a, b, c, d, e, f, g, h, i, j, k) 0 #define FShmGetImage(a, b, c, d, e, f) 0 #define FShmCreateImage(a, b, c, d, e, f, g, h) NULL /* shm */ #define Fshmget(a, b, c) 0 #define Fshmat(a, b, c) NULL; #define Fshmdt(a) #define Fshmctl(a, b, c) #endif #endif /* FSHM_H */ fvwm-2.6.5.orig/libs/fvwmsignal.h0000644000175000017500000000405610656151547015120 0ustar vwcvwc/* -*-c-*- */ #ifndef FVWMSIGNAL_H #define FVWMSIGNAL_H /* This module provides wrappers around system functions that could * potentially block, e.g. select(). These wrappers will check that * the "terminate" flag is still clear and then call the system * function in one atomic operation. This ensures that fvwm will not * block in a system function once it has received the signal to quit. * * This module was written by Chris Rankin, rankinc@zipworld.com.au */ /* This module is intended to use POSIX.1 signal semantics, since most * modern systems can reasonably be expected to support POSIX and since * the semantics of the old "signal()" function vary from system to system. * If POSIX.1 is not available then the module can provide BSD signal * semantics, which can be summarised as follows: * - the signal handler will NOT uninstall itself once it has been called * - a signal will be temporarily blocked from further delivery so long * as its handler is running * - certain system calls will be automatically restarted if interrupted * by a signal */ #if !defined(HAVE_SIGACTION) \ && defined(HAVE_SIGBLOCK) && defined(HAVE_SIGSETMASK) # define USE_BSD_SIGNALS #endif #ifdef USE_BSD_SIGNALS # define BSD_BLOCK_SIGNALS int old_mask = sigblock( fvwmGetSignalMask() ) # define BSB_BLOCK_ALL_SIGNALS int old_mask = sigblock( ~0 ) # define BSD_UNBLOCK_SIGNALS sigsetmask( old_mask ) #else # define BSD_BLOCK_SIGNALS # define BSD_BLOCK_ALL_SIGNALS # define BSD_UNBLOCK_SIGNALS #endif #include #include "ftime.h" #if HAVE_SYS_SELECT_H # include #endif /* * Global variables */ extern volatile sig_atomic_t isTerminated; /* * Module prototypes */ RETSIGTYPE fvwmReapChildren(int sig); extern void fvwmSetTerminate(int sig); #ifdef USE_BSD_SIGNALS extern void fvwmSetSignalMask(int); extern int fvwmGetSignalMask(void); #endif #ifdef HAVE_SELECT extern int fvwmSelect( fd_set_size_t nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); #endif #endif /* FVWMSIGNAL_H */ fvwm-2.6.5.orig/libs/Colorset.h0000644000175000017500000001554110551032223014515 0ustar vwcvwc/* -*-c-*- */ /* Fvwm colorset technology is Copyright (C) 1999 Joey Shutup http://www.streetmap.co.uk/streetmap.dll?Postcode2Map?BS24+9TZ You may use this code for any purpose, as long as the original copyright and this notice remains in the source code and all documentation */ #ifndef LIBS_COLORSETS_H #define LIBS_COLORSETS_H typedef struct { Pixel fg; Pixel bg; Pixel hilite; Pixel shadow; Pixel fgsh; Pixel tint; Pixel icon_tint; Pixmap pixmap; Pixmap shape_mask; unsigned int width : 12; unsigned int height : 12; unsigned int pixmap_type: 3; unsigned int shape_width : 12; unsigned int shape_height : 12; unsigned int shape_type : 2; unsigned int do_dither_icon : 1; unsigned int fg_alpha_percent : 7; unsigned int tint_percent : 7; unsigned int icon_alpha_percent : 7; unsigned int icon_tint_percent : 7; #ifdef FVWM_COLORSET_PRIVATE /* fvwm/colorset.c use only */ Pixel fg_tint; Pixel fg_saved; Pixel bg_tint; Pixel bg_saved; Pixmap mask; Pixmap alpha_pixmap; char *pixmap_args; char *gradient_args; char gradient_type; unsigned int color_flags; FvwmPicture *picture; Pixel *pixels; int nalloc_pixels; int fg_tint_percent; int bg_tint_percent; short image_alpha_percent; Bool dither; Bool allows_buffered_transparency; Bool is_maybe_root_transparent; #endif } colorset_t; #define PIXMAP_TILED 0 #define PIXMAP_STRETCH_X 1 #define PIXMAP_STRETCH_Y 2 #define PIXMAP_STRETCH 3 #define PIXMAP_STRETCH_ASPECT 4 #define PIXMAP_ROOT_PIXMAP_PURE 5 #define PIXMAP_ROOT_PIXMAP_TRAN 6 #define SHAPE_TILED 0 #define SHAPE_STRETCH 1 #define SHAPE_STRETCH_ASPECT 2 #ifdef FVWM_COLORSET_PRIVATE #define FG_SUPPLIED 0x1 #define BG_SUPPLIED 0x2 #define HI_SUPPLIED 0x4 #define SH_SUPPLIED 0x8 #define FGSH_SUPPLIED 0x10 #define FG_CONTRAST 0x20 #define BG_AVERAGE 0x40 #define TINT_SUPPLIED 0x80 #define FG_TINT_SUPPLIED 0x100 #define BG_TINT_SUPPLIED 0x200 #define ICON_TINT_SUPPLIED 0x400 #endif /* colorsets are stored as an array of structs to permit fast dereferencing */ extern colorset_t *Colorset; /* some macro for transparency */ #define CSET_IS_TRANSPARENT(cset) \ (cset >= 0 && (Colorset[cset].pixmap == ParentRelative || \ (Colorset[cset].pixmap != None && \ (Colorset[cset].pixmap_type == PIXMAP_ROOT_PIXMAP_TRAN ||\ Colorset[cset].pixmap_type == PIXMAP_ROOT_PIXMAP_PURE)))) #define CSET_IS_TRANSPARENT_PR(cset) \ (cset >= 0 && Colorset[cset].pixmap == ParentRelative) #define CSET_IS_TRANSPARENT_ROOT(cset) \ (cset >= 0 && Colorset[cset].pixmap != None && \ (Colorset[cset].pixmap_type == PIXMAP_ROOT_PIXMAP_TRAN ||\ Colorset[cset].pixmap_type == PIXMAP_ROOT_PIXMAP_PURE)) #define CSET_IS_TRANSPARENT_PR_PURE(cset) \ (cset >= 0 && Colorset[cset].pixmap == ParentRelative && \ Colorset[cset].tint_percent == 0) #define CSET_IS_TRANSPARENT_ROOT_PURE(cset) \ (cset >= 0 && Colorset[cset].pixmap != None && \ Colorset[cset].pixmap_type == PIXMAP_ROOT_PIXMAP_PURE) #define CSET_IS_TRANSPARENT_ROOT_TRAN(cset) \ (cset >= 0 && Colorset[cset].pixmap != None && \ Colorset[cset].pixmap_type == PIXMAP_ROOT_PIXMAP_TRAN) #define CSET_IS_TRANSPARENT_PR_TINT(cset) \ (cset >= 0 && Colorset[cset].pixmap == ParentRelative && \ Colorset[cset].tint_percent > 0) #define CSET_HAS_PIXMAP(cset) \ (cset >= 0 && Colorset[cset].pixmap) #define CSET_HAS_PIXMAP_TILED(cset) \ (CSET_HAS_PIXMAP(cset) && (Colorset[cset].pixmap_type & PIXMAP_TILED)) #define CSET_HAS_PIXMAP_STRETCH_X(cset) \ (CSET_HAS_PIXMAP(cset) && (Colorset[cset].pixmap_type & PIXMAP_STRETCH_X)) #define CSET_HAS_PIXMAP_STRETCH_Y(cset) \ (CSET_HAS_PIXMAP(cset) && (Colorset[cset].pixmap_type & PIXMAP_STRETCH_Y)) #define CSET_HAS_PIXMAP_STRETCH(cset) \ (CSET_HAS_PIXMAP(cset) && (Colorset[cset].pixmap_type & PIXMAP_STRETCH)) #define CSET_HAS_PIXMAP_STRETCH_ASPECT(cset) \ (CSET_HAS_PIXMAP(cset) && \ (Colorset[cset].pixmap_type & PIXMAP_STRETCH_ASPECT)) #define CSET_PIXMAP_IS_XY_STRETCHED(cset) \ (CSET_HAS_PIXMAP_STRETCH(cset) || CSET_HAS_PIXMAP_STRETCH_ASPECT(cset)) #define CSET_PIXMAP_IS_X_STRETCHED(cset) \ (CSET_PIXMAP_IS_XY_STRETCHED(cset) || CSET_HAS_PIXMAP_STRETCH_X(cset)) #define CSET_PIXMAP_IS_Y_STRETCHED(cset) \ (CSET_PIXMAP_IS_XY_STRETCHED(cset) || CSET_HAS_PIXMAP_STRETCH_Y(cset)) #define CSET_PIXMAP_IS_TILED(cset) \ (CSET_HAS_PIXMAP_TILED(cset)) /* some macro for transparency */ #define CSETS_IS_TRANSPARENT(cset) \ (cset != NULL && (cset->pixmap == ParentRelative || \ (cset->pixmap != None && \ (cset->pixmap_type == PIXMAP_ROOT_PIXMAP_TRAN ||\ cset->pixmap_type == PIXMAP_ROOT_PIXMAP_PURE)))) #define CSETS_IS_TRANSPARENT_ROOT(cset) \ (cset != NULL && cset->pixmap != None && \ (cset->pixmap_type == PIXMAP_ROOT_PIXMAP_TRAN ||\ cset->pixmap_type == PIXMAP_ROOT_PIXMAP_PURE)) #define CSETS_IS_TRANSPARENT_PR_PURE(cset) \ (cset != NULL && cset->pixmap == ParentRelative && \ cset->tint_percent == 0) #define CSETS_IS_TRANSPARENT_ROOT_PURE(cset) \ (cset != NULL && cset->pixmap != None && \ cset->pixmap_type == PIXMAP_ROOT_PIXMAP_PURE) #define CSETS_IS_TRANSPARENT_ROOT_TRAN(cset) \ (cset != NULL && cset->pixmap != None && \ cset->pixmap_type == PIXMAP_ROOT_PIXMAP_TRAN) #define CSETS_IS_TRANSPARENT_PR_TINT(cset) \ (cset != NULL && cset->pixmap == ParentRelative && \ cset->tint_percent > 0) #ifndef FVWM_COLORSET_PRIVATE /* Create n new colorsets, fvwm/colorset.c does its own thing (different size) */ void AllocColorset(int n); #endif /* dump one */ char *DumpColorset(int n, colorset_t *colorset); /* load one */ int LoadColorset(char *line); Pixmap CreateOffsetBackgroundPixmap( Display *dpy, Window win, int x, int y, int width, int height, colorset_t *colorset, unsigned int depth, GC gc, Bool is_mask); Pixmap CreateBackgroundPixmap( Display *dpy, Window win, int width, int height, colorset_t *colorset, unsigned int depth, GC gc, Bool is_mask); Pixmap ScrollPixmap( Display *dpy, Pixmap p, GC gc, int x_off, int y_off, int width, int height, unsigned int depth); void SetWindowBackgroundWithOffset( Display *dpy, Window win, int x_off, int y_off, int width, int height, colorset_t *colorset, unsigned int depth, GC gc, Bool clear_area); void SetWindowBackground( Display *dpy, Window win, int width, int height, colorset_t *colorset, unsigned int depth, GC gc, Bool clear_area); void GetWindowBackgroundPixmapSize( colorset_t *cs_t, int width, int height, int *w, int *h); Bool UpdateBackgroundTransparency( Display *dpy, Window win, int width, int height, colorset_t *colorset, unsigned int depth, GC gc, Bool clear_area); void SetRectangleBackground( Display *dpy, Window win, int x, int y, int width, int height, colorset_t *colorset, unsigned int depth, GC gc); void SetClippedRectangleBackground( Display *dpy, Window win, int x, int y, int width, int height, XRectangle *clip, colorset_t *colorset, unsigned int depth, GC gc); #endif fvwm-2.6.5.orig/libs/Fft.h0000644000175000017500000004615710352754445013471 0ustar vwcvwc/* -*-c-*- */ #ifndef FFT_H #define FFT_H /* * Note: This "warper" is far from being complete! if you need something * in Xft or Xft + fontconfig (Fc for short) (aka Xft2) not already defined * you must add the corresponding Fft* functions/types (2 or 3 times). * */ /* ---------------------------- included header files ---------------------- */ /* no compat to avoid problems in the future */ #define _XFT_NO_COMPAT_ 1 #ifdef HAVE_XFT #define Picture XRenderPicture #include #undef Picture #endif #include "FRender.h" /* ---------------------------- global definitions ------------------------- */ #ifdef HAVE_XFT #define FftSupport 1 #ifdef HAVE_XFT_UTF8 #define FftUtf8Support 1 #else #define FftUtf8Support 0 #endif #ifdef HAVE_XFT2 #define FftSupportUseXft2 1 #else #define FftSupportUseXft2 0 #endif #else #define FftSupport 0 #define FftUtf8Support 0 #define FftSupportUseXft2 0 #endif /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ #if FftSupport /* Fc (fontconfig) stuff */ #if FftSupportUseXft2 typedef FcChar8 FftChar8; typedef FcChar16 FftChar16; typedef FcChar32 FftChar32; typedef FcBool FftBool; typedef FcType FftType; typedef FcMatrix FftMatrix; typedef FcValue FftValue; typedef FcPattern FftPattern; typedef FcFontSet FftFontSet; typedef FcObjectSet FftObjectSet; #if 1 /* FftResult must be FcResult for gcc 3.4 not to warn of incompatible * pointer type */ typedef FcResult FftResult; #define FftResultMatch FcResultMatch #define FftResultNoMatch FcResultNoMatch #define FftResultTypeMismatch FcResultTypeMismatch #define FftFftResultNoId FcResultNoId #else typedef enum _FftResult { FftResultMatch = FcResultMatch, FftResultNoMatch = FcResultNoMatch, FftResultTypeMismatch = FcResultTypeMismatch, FftFftResultNoId = FcResultNoId } FftResult; #endif /* XftValue and are different in Xft+Fc and Xft 1 */ typedef struct _Xft1Value { FftType type; union { char *s; int i; Bool b; double d; FftMatrix *m; } u; } Xft1Value; typedef Xft1Value Fft1Value; /* no value list in Xft+Fc */ typedef struct _XftValueList { struct _XftValueList *next; Fft1Value value; } XftValueList; typedef XftValueList FftValueList; /* no XftPatternElt in Xft+Fc */ typedef struct { const char *object; FftValueList *values; } XftPatternElt; typedef XftPatternElt FftPatternElt; /* XftPattern and FcPattern are different */ typedef struct _Xft1Pattern { int num; int size; FftPatternElt *elts; } Fft1Pattern; #else /* !FftSupportUseXft2 */ typedef XftChar8 FftChar8; typedef XftChar16 FftChar16; typedef XftChar32 FftChar32; typedef XftType FftType; typedef XftMatrix FftMatrix; typedef XftPatternElt FftPatternElt; typedef XftFontSet FftFontSet; typedef XftObjectSet FftObjectSet; typedef XftValue FftValue; typedef XftPattern FftPattern; typedef XftValue Fft1Value; typedef XftPattern Fft1Pattern; typedef enum _FftResult { FftResultMatch = XftResultMatch, FftResultNoMatch = XftResultNoMatch, FftResultTypeMismatch = XftResultTypeMismatch, FftFftResultNoId = XftResultNoId } FftResult; #endif /* FftSupportUseXft2 */ /* Xft stuff (common) */ typedef XftDraw FftDraw; typedef XftFont FftFont; typedef XftColor FftColor; #if FftSupportUseXft2 /* XftFont are != in Xft+Fc and Xft */ typedef struct _Fft1Font { int ascent; int descent; int height; int max_advance_width; Bool core; Fft1Pattern *pattern; union { struct { XFontStruct *font; } core; struct { void *font; } ft; } u; } Fft1Font; #else typedef XftFont Fft1Font; #endif #else typedef unsigned char FftChar8; typedef unsigned short FftChar16; typedef unsigned int FftChar32; typedef int FftType; typedef struct { double xx, xy, yx, yy; } FftMatrix; typedef enum _FftResult { FftResultMatch = 0, FftResultNoMatch = 1, FftResultTypeMismatch = 2, FftFftResultNoId = 3 } FftResult; typedef struct { FftType type; union { char *s; int i; Bool b; double d; } u; } XftValue; typedef XftValue FftValue; typedef struct _XftValueList { struct _XftValueList *next; FftValue value; } XftValueList; typedef XftValueList FftValueList; typedef struct { const char *object; FftValueList *values; } XftPatternElt; typedef XftPatternElt FftPatternElt; typedef struct { int num; int size; FftPatternElt *elts; } XftPattern; typedef XftPattern FftPattern; typedef void FftFontSet; typedef void FftFontVoid; typedef void FftDraw; typedef struct { int ascent; int descent; int height; int max_advance_width; Bool core; FftPattern *pattern; union { struct { XFontStruct *font; } core; struct { void *font; } ft; } u; } XftFont; typedef XftFont FftFont; typedef struct { unsigned long pixel; FRenderColor color; } XftColor; typedef XftColor FftColor; typedef void FftObjectSet; /* XftValue are different in Xft+Fc and Xft 1 */ typedef struct _Xft1Value { FftType type; union { char *s; int i; Bool b; double d; FftMatrix *m; } u; } Xft1Value; typedef Xft1Value Fft1Value; /* XftPattern and XftFont are different in Xft+Fc and Xft 1 */ typedef struct _Xft1Pattern { int num; int size; FftPatternElt *elts; } Fft1Pattern; typedef struct _Fft1Font { int ascent; int descent; int height; int max_advance_width; Bool core; Fft1Pattern *pattern; union { struct { XFontStruct *font; } core; struct { void *font; } ft; } u; } Fft1Font; #endif /* * Fvwm Xft font structure */ typedef struct { FftFont *fftfont; FftFont *fftfont_rotated_90; FftFont *fftfont_rotated_180; FftFont *fftfont_rotated_270; char *encoding; char *str_encoding; } FftFontType; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void FftPDumyFunc(void); /* ---------------------------- global definitions ------------------------- */ #if FftSupport /* Fc stuff */ #if FftSupportUseXft2 #define FFT_FAMILY FC_FAMILY #define FFT_STYLE FC_STYLE #define FFT_SLANT FC_SLANT #define FFT_WEIGHT FC_WEIGHT #define FFT_SIZE FC_SIZE #define FFT_PIXEL_SIZE FC_PIXEL_SIZE #define FFT_SPACING FC_SPACING #define FFT_FOUNDRY FC_FOUNDRY #define FFT_CORE FC_CORE #define FFT_ANTIALIAS FC_ANTIALIAS #define FFT_XLFD FC_XLFD #define FFT_FILE FC_FILE #define FFT_INDEX FC_INDEX #define FFT_RASTERIZER FC_RASTERIZER #define FFT_OUTLINE FC_OUTLINE #define FFT_SCALABLE FC_SCALABLE #define FFT_RGBA FC_RGBA #define FFT_SCALE FC_SCALE #define FFT_RENDER FC_RENDER #define FFT_CHAR_WIDTH FC_CHAR_WIDTH #define FFT_CHAR_HEIGHT FC_CHAR_HEIGHT #define FFT_MATRIX FC_MATRIX #define FFT_WEIGHT_LIGHT FC_WEIGHT_LIGHT #define FFT_WEIGHT_MEDIUM FC_WEIGHT_MEDIUM #define FFT_WEIGHT_DEMIBOLD FC_WEIGHT_DEMIBOLD #define FFT_WEIGHT_BOLD FC_WEIGHT_BOLD #define FFT_WEIGHT_BLACK FC_WEIGHT_BLACK #define FFT_SLANT_ROMAN FC_SLANT_ROMAN #define FFT_SLANT_ITALIC FC_SLANT_ITALIC #define FFT_SLANT_OBLIQUE FC_SLANT_OBLIQUE #define FFT_PROPORTIONAL FC_PROPORTIONAL #define FFT_MONO FC_MONO #define FFT_CHARCELL FC_CHARCELL #define FFT_RGBA_NONE FC_RGBA_NONE #define FFT_RGBA_RGB FC_RGBA_RGB #define FFT_RGBA_BGR FC_RGBA_BGR /* new in Fc */ #define FFT_HINTING FC_HINTING #define FFT_VERTICAL_LAYOUT FC_VERTICAL_LAYOUT #define FFT_AUTOHINT FC_AUTOHINT #define FFT_GLOBAL_ADVANCE FC_GLOBAL_ADVANCE #define FFT_SOURCE FC_SOURCE #define FFT_CHARSET FC_CHARSET #define FFT_LANG FC_LANG #define FFT_DIR_CACHE_FILE FC_DIR_CACHE_FILE #define FFT_USER_CACHE_FILE FC_USER_CACHE_FILE /* skip all the FC_LANG_* OS/2 CodePageRange bits */ /* not in Fc */ #define FFT_ENCODING "encoding" #else /* !FftSupportUseXft2 */ #define FFT_FAMILY XFT_FAMILY #define FFT_STYLE XFT_STYLE #define FFT_SLANT XFT_SLANT #define FFT_WEIGHT XFT_WEIGHT #define FFT_SIZE XFT_SIZE #define FFT_PIXEL_SIZE XFT_PIXEL_SIZE #define FFT_ENCODING XFT_ENCODING #define FFT_SPACING XFT_SPACING #define FFT_FOUNDRY XFT_FOUNDRY #define FFT_CORE XFT_CORE #define FFT_ANTIALIAS XFT_ANTIALIAS #define FFT_XLFD XFT_XLFD #define FFT_FILE XFT_FILE #define FFT_INDEX XFT_INDEX #define FFT_RASTERIZER XFT_RASTERIZER #define FFT_OUTLINE XFT_OUTLINE #define FFT_SCALABLE XFT_SCALABLE #define FFT_RGBA XFT_RGBA #define FFT_SCALE XFT_SCALE #define FFT_RENDER XFT_RENDER #define FFT_CHAR_WIDTH XFT_CHAR_WIDTH #define FFT_CHAR_HEIGHT XFT_CHAR_HEIGHT #define FFT_MATRIX XFT_MATRIX #define FFT_WEIGHT_LIGHT XFT_WEIGHT_LIGHT #define FFT_WEIGHT_MEDIUM XFT_WEIGHT_MEDIUM #define FFT_WEIGHT_DEMIBOLD XFT_WEIGHT_DEMIBOLD #define FFT_WEIGHT_BOLD XFT_WEIGHT_BOLD #define FFT_WEIGHT_BLACK XFT_WEIGHT_BLACK #define FFT_SLANT_ROMAN XFT_SLANT_ROMAN #define FFT_SLANT_ITALIC XFT_SLANT_ITALIC #define FFT_SLANT_OBLIQUE XFT_SLANT_OBLIQUE #define FFT_PROPORTIONAL XFT_PROPORTIONAL #define FFT_MONO XFT_MONO #define FFT_CHARCELL XFT_CHARCELL #define FFT_RGBA_NONE XFT_RGBA_NONE #define FFT_RGBA_RGB XFT_RGBA_RGB #define FFT_RGBA_BGR XFT_RGBA_BGR #define FFT_RGBA_VRGB XFT_RGBA_VRGB #define FFT_RGBA_VBGR XFT_RGBA_VBGR /* new in Fc */ #define FFT_HINTING "" #define FFT_VERTICAL_LAYOUT "" #define FFT_AUTOHINT "" #define FFT_GLOBAL_ADVANCE "" #define FFT_SOURCE "" #define FFT_CHARSET "" #define FFT_LANG "" #define FFT_DIR_CACHE_FILE "" #define FFT_USER_CACHE_FILE "" /* skip all the FC_LANG_* OS/2 CodePageRange bits */ /* not in Fc */ #define FFT_ENCODING XFT_ENCODING #endif /* !FftSupportUseXft2 */ /* Fc stuff */ #if FftSupportUseXft2 #define FftConfigSubstitute(a) FcConfigSubstitute(a) #define FftValuePrint(a) FcValuePrint(a) #define FftPatternPrint(a) FcPatternPrint(a) #define FftFontSetPrint(a) FcFontSetPrint(a) #define FftGlyphExists(a,b,c) FcGlyphExists(a,b,c) #define FftObjectSetCreate() FcObjectSetCreate() #define FftObjectSetAdd(a,b) FcObjectSetAdd(a,b) #define FftObjectSetDestroy(a) FcObjectSetDestroy(a) #define FftObjectSetVaBuild(a,b) FcObjectSetVaBuild(a,b) #define FftListFontsPatternObjects(a,b,c,d) FcListFontsPatternObjects(a,b,c,d) #define FftFontSetMatch(a,b,c,d) FcFontSetMatch(a,b,c,d) #define FftPatternCreate() FcPatternCreate() #define FftPatternDuplicate(a) FcPatternDuplicate(a) #define FftValueDestroy(a) FcValueDestroy(a) #define FftValueListDestroy(a) FcValueListDestroy(a) #define FftPatternDestroy(a) FcPatternDestroy(a) #define FftPatternFind(a,b,c) FcPatternFind(a,b,c) #define FftPatternAdd(a,b,c,d) FcPatternAdd(a,b,c,d) #define FftPatternGet(a,b,c,d) FcPatternGet(a,b,c,d) #define FftPatternDel(a,b) FcPatternDel(a,b) #define FftPatternAddInteger(a,b,c) FcPatternAddInteger(a,b,c) #define FftPatternAddDouble(a,b,c) FcPatternAddDouble(a,b,c) #define FftPatternAddString(a,b,c) FcPatternAddString(a,b,c) #define FftPatternAddBool(a,b,c) FcPatternAddBool(a,b,c) #define FftPatternAddMatrix(a,b,c) FcPatternAddMatrix(a,b,c) #define FftPatternGetInteger(a,b,c,d) FcPatternGetInteger(a,b,c,d) #define FftPatternGetDouble(a,b,c,d) FcPatternGetDouble(a,b,c,d) #define FftPatternGetString(a,b,c,d) FcPatternGetString(a,b,c,d) #define FftPatternGetBool(a,b,c,d) FcPatternGetBool(a,b,c,d) #define FftPatternGetMatrix(a,b,c,d) FcPatternGetMatrix(a,b,c,d) #define FftPatternVaBuild(a,b) FcPatternVaBuild(a,b) #else /* !FftSupportUseXft2 */ #define FftConfigSubstitute(a) XftConfigSubstitute(a) #define FftValuePrint(a) XftValuePrint(a) #define FftPatternPrint(a) XftPatternPrint(a) #define FftFontSetPrint(a) XftFontSetPrint(a) #define FftGlyphExists(a,b,c) XftGlyphExists(a,b,c) #define FftObjectSetCreate() XftObjectSetCreate() #define FftObjectSetAdd(a,b) XftObjectSetAdd(a,b) #define FftObjectSetDestroy(a) XftObjectSetDestroy(a) #define FftObjectSetVaBuild(a,b) XftObjectSetVaBuild(a,b) #define FftListFontsPatternObjects(a,b,c,d) XftListFontsPatternObjects(a,b,c,d) #define FftFontSetMatch(a,b,c,d) XftFontSetMatch(a,b,c,d) #define FftPatternCreate() XftPatternCreate() #define FftPatternDuplicate(a) XftPatternDuplicate(a) #define FftValueDestroy(a) XftValueDestroy(a) #define FftValueListDestroy(a) XftValueListDestroy(a) #define FftPatternDestroy(a) XftPatternDestroy(a) #define FftPatternFind(a,b,c) XftPatternFind(a,b,c) #define FftPatternAdd(a,b,c,d) XftPatternAdd(a,b,c,d) #define FftPatternGet(a,b,c,d) XftPatternGet(a,b,c,d) #define FftPatternDel(a,b) XftPatternDel(a,b) #define FftPatternAddInteger(a,b,c) XftPatternAddInteger(a,b,c) #define FftPatternAddDouble(a,b,c) XftPatternAddDouble(a,b,c) #define FftPatternAddString(a,b,c) XftPatternAddString(a,b,c) #define FftPatternAddBool(a,b,c) XftPatternAddBool(a,b,c) #define FftPatternAddMatrix(a,b,c) XftPatternAddMatrix(a,b,c) #define FftPatternGetInteger(a,b,c,d) XftPatternGetInteger(a,b,c,d) #define FftPatternGetDouble(a,b,c,d) XftPatternGetDouble(a,b,c,d) #define FftPatternGetString(a,b,c,d) XftPatternGetString(a,b,c,d) #define FftPatternGetBool(a,b,c,d) XftPatternGetBool(a,b,c,d) #define FftPatternGetMatrix(a,b,c,d) XftPatternGetMatrix(a,b,c,d) #define FftPatternVaBuild(a,b) XftPatternVaBuild(a,b) #endif /* !XftSupportUseXft2 */ /* Xft stuff */ #define FftColorAllocName(a,b,c,d,e) XftColorAllocName(a,b,c,d,e) #define FftColorAllocValue(a,b,c,d,e) XftColorAllocValue(a,b,c,d,e) #define FftColorFree(a,b,c,d) XftColorFree(a,b,c,d) #define FftDefaultHasRender(a) XftDefaultHasRender(a) #define FftDefaultSet(a,b) XftDefaultSet(a,b) #define FftDefaultSubstitute(a,b,c) XftDefaultSubstitute(a,b,c) #define FftDrawCreate(a,b,c,d) XftDrawCreate(a,b,c,d) #define FftDrawCreateBitmap(a,b) XftDrawCreateBitmap(a,b) #define FftDrawChange(a,b) XftDrawChange(a,b) #define FftDrawDestroy(a) XftDrawDestroy(a) #define FftDrawString8(a,b,c,d,e,f,g) XftDrawString8(a,b,c,d,e,f,g) #define FftDrawString16(a,b,c,d,e,f,g) XftDrawString16(a,b,c,d,e,f,g) #define FftDrawString32(a,b,c,d,e,f,g) XftDrawString32(a,b,c,d,e,f,g) #define FftPDrawString8 XftDrawString8 #define FftPDrawString16 XftDrawString16 #define FftPDrawString32 XftDrawString32 #define FftDrawRect(a,b,c,d,e,f) XftDrawRect(a,b,c,d,e,f) #define FftDrawSetClip(a,b) XftDrawSetClip(a,b) #define FftTextExtents8(a,b,c,d,e) XftTextExtents8(a,b,c,d,e) #define FftTextExtents16(a,b,c,d,e) XftTextExtents16(a,b,c,d,e) #define FftTextExtents32(a,b,c,d,e) XftTextExtents32(a,b,c,d,e) #define FftFontMatch(a,b,c,d) XftFontMatch(a,b,c,d) #define FftFontOpenPattern(a,b) XftFontOpenPattern(a,b) #define FftFontOpenName(a,b,c) XftFontOpenName(a,b,c) #define FftFontOpenXlfd(a,b,c) XftFontOpenXlfd(a,b,c) #define FftFontClose(a,b) XftFontClose(a,b) #define FftFontSetCreate() XftFontSetCreate() #define FftFontSetAdd(a,b) XftFontSetAdd(a,b) #define FftInit(a) XftInit(a) #define FftListFontSets(a,b,c,d) XftListFontSets(a,b,c,d) #define FftNameParse(a) XftNameParse(a) #define FftXlfdParse(a,b,c) XftXlfdParse(a,b,c) #define FftCoreOpen(a,b) XftCoreOpen(a,b) /* utf8 functions */ #if FftUtf8Support #define FftDrawStringUtf8(a,b,c,d,e,f,g) XftDrawStringUtf8(a,b,c,d,e,f,g) #define FftPDrawStringUtf8 XftDrawStringUtf8 #define FftTextExtentsUtf8(a,b,c,d,e) XftTextExtentsUtf8(a,b,c,d,e) #else #define FftDrawStringUtf8(a,b,c,d,e,f,g) #define FftPDrawStringUtf8 FftPDumyFunc #define FftTextExtentsUtf8(a,b,c,d,e) #endif #else /* !FftSupport */ #define FFT_FAMILY "" #define FFT_STYLE "" #define FFT_SLANT "" #define FFT_WEIGHT "" #define FFT_SIZE "" #define FFT_PIXEL_SIZE "" #define FFT_SPACING "" #define FFT_FOUNDRY "" #define FFT_CORE "" #define FFT_ANTIALIAS "" #define FFT_XLFD "" #define FFT_FILE "" #define FFT_INDEX "" #define FFT_RASTERIZER "" #define FFT_OUTLINE "" #define FFT_SCALABLE "" #define FFT_RGBA "" #define FFT_SCALE "" #define FFT_RENDER "" #define FFT_CHAR_WIDTH "" #define FFT_CHAR_HEIGHT "" #define FFT_MATRIX "" #define FFT_WEIGHT_LIGHT 0 #define FFT_WEIGHT_MEDIUM 0 #define FFT_WEIGHT_DEMIBOLD 0 #define FFT_WEIGHT_BOLD 0 #define FFT_WEIGHT_BLACK 0 #define FFT_SLANT_ROMAN 0 #define FFT_SLANT_ITALIC 0 #define FFT_SLANT_OBLIQUE 0 #define FFT_PROPORTIONAL 0 #define FFT_MONO 0 #define FFT_CHARCELL 0 #define FFT_RGBA_NONE 0 #define FFT_RGBA_RGB 0 #define FFT_RGBA_BGR 0 #define FFT_RGBA_VRGB 0 #define FFT_RGBA_VBGR 0 /* new in Fc */ #define FFT_HINTING "" #define FFT_VERTICAL_LAYOUT "" #define FFT_AUTOHINT "" #define FFT_GLOBAL_ADVANCE "" #define FFT_SOURCE "" #define FFT_CHARSET "" #define FFT_LANG "" #define FFT_DIR_CACHE_FILE "" #define FFT_USER_CACHE_FILE "" /* skip all the FC_LANG_* OS/2 CodePageRange bits */ /* not in Fc */ #define FFT_ENCODING "" /* Fc stuff */ #define FftConfigSubstitute(a) False #define FftValuePrint(a) #define FftPatternPrint(a) #define FftFontSetPrint(a) #define FftGlyphExists(a,b,c) False #define FftObjectSetCreate() NULL #define FftObjectSetAdd(a,b) False #define FftObjectSetDestroy(a) #define FftObjectSetVaBuild(a,b) NULL #define FftListFontsPatternObjects(a,b,c,d) NULL #define FftFontSetMatch(a,b,c,d) NULL #define FftNameParse(a) NULL #define FftPatternCreate() NULL #define FftPatternDuplicate(a) NULL #define FftValueDestroy(a) #define FftValueListDestroy(a) #define FftPatternDestroy(a) #define FftPatternFind(a,b,c) NULL #define FftPatternAdd(a,b,c,d) False #define FftPatternGet(a,b,c,d) #define FftPatternDel(a,b) False #define FftPatternAddInteger(a,b,c) False #define FftPatternAddDouble(a,b,c) False #define FftPatternAddString(a,b,c) False #define FftPatternAddBool(a,b,c) False #define FftPatternAddMatrix(a,b,c) False #define FftPatternGetInteger(a,b,c,d) 0 #define FftPatternGetDouble(a,b,c,d) 0 #define FftPatternGetString(a,b,c,d) 0 #define FftPatternGetBool(a,b,c,d) 0 #define FftPatternGetMatrix(a,b,c,d) 0 #define FftPatternVaBuild(a,b) NULL /* Xft stuff */ #define FftColorAllocName(a,b,c,d,e) False #define FftColorAllocValue(a,b,c,d,e) False #define FftColorFree(a,b,c,d) #define FftDefaultHasRender(a) False #define FftDefaultSet(a,b) False #define FftDefaultSubstitute(a,b,c) #define FftDrawCreate(a,b,c,d) NULL #define FftDrawCreateBitmap(a,b) NULL #define FftDrawChange(a,b) #define FftDrawDestroy(a) #define FftDrawString8(a,b,c,d,e,f,g) #define FftDrawString16(a,b,c,d,e,f,g) #define FftDrawString32(a,b,c,d,e,f,g) #define FftPDrawString8 FftPDumyFunc #define FftPDrawString16 FftPDumyFunc #define FftPDrawString32 FftPDumyFunc #define FftDrawRect(a,b,c,d,e,f) #define FftDrawSetClip(a,b) False #define FftTextExtents8(a,b,c,d,e) #define FftTextExtents16(a,b,c,d,e) #define FftTextExtents32(a,b,c,d,e) #define FftFontMatch(a,b,c,d) NULL #define FftFontOpenPattern(a,b) NULL #define FftFontOpenName(a,b,c) NULL #define FftFontOpenXlfd(a,b,c) NULL #define FftFontClose(a,b) #define FftFontSetCreate() NULL #define FftFontSetDestroy(a) #define FftFontSetAdd(a,b) False #define FftInit(a) False #define FftListFontSets(a,b,c,d) NULL #define FftNameParse(a) NULL #define FftXlfdParse(a,b,c) NULL #define FftCoreOpen(a,b) NULL /* utf8 functions */ #define FftDrawStringUtf8(a,b,c,d,e,f,g) #define FftPDrawStringUtf8 FftPDumyFunc #define FftTextExtentsUtf8(a,b,c,d,e) #endif #endif /* FFT_H */ fvwm-2.6.5.orig/libs/strncasecmp.c0000644000175000017500000000171107677641664015270 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" int strncasecmp(register char *s1,register char *s2,register int n) { while ((--n > 0) && (tolower(*s1) == tolower(*s2))) { ++s1; ++s2; if (!*s1 || !*s2) break; } return (tolower(*s1) - tolower(*s2)); } fvwm-2.6.5.orig/libs/Ficonv.c0000644000175000017500000003230311622413321014137 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Some code (convert_charsets) inspired by the glib-2 (gutf8.c) copyrighted * by Tom Tromey & Red Hat, Inc. */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include "FlocaleCharset.h" #include "Ficonv.h" #include "Strings.h" #if FiconvSupport #include #if defined(USE_LIBICONV) && !defined (_LIBICONV_H) #error libiconv in use but included iconv.h not from libiconv #endif #if !defined(USE_LIBICONV) && defined (_LIBICONV_H) #error libiconv not in use but included iconv.h is from libiconv #endif #endif /* FiconvSupport */ /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static Bool FiconvInitialized = False; static FlocaleCharset *FLCIconvUtf8Charset = NULL; /* UTF-8 charset */ static FlocaleCharset *FLCIconvDefaultCharset = NULL; static int do_transliterate_utf8 = 0; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static Bool is_iconv_supported(char *c1, char *c2) { Ficonv_t cd1,cd2; Bool r = False; if (!FiconvSupport || !c1 || !c2) return False; cd1 = Ficonv_open(c1, c2); cd2 = Ficonv_open(c2, c1); if (cd1 != (Ficonv_t) -1 && cd2 != (Ficonv_t) -1) r = True; if (cd1 != (Ficonv_t) -1) (void)Ficonv_close(cd1); if (cd2 != (Ficonv_t) -1) (void)Ficonv_close(cd2); return r; } #define TRANSLIT_SUFFIX "//TRANSLIT" static char *translit_csname(char *cs) { return CatString2(cs, TRANSLIT_SUFFIX); } static int is_translit_supported(char *c1, char *c2) { Ficonv_t cd; if (!FiconvSupport || !c1 || !c2) return 0; cd = Ficonv_open(translit_csname(c1),c2); if (cd == (Ficonv_t) -1) { return 0; } Ficonv_close(cd); cd = Ficonv_open(translit_csname(c2),c1); if (cd == (Ficonv_t) -1) { return 0; } Ficonv_close(cd); return 1; } static int set_default_iconv_charsets(FlocaleCharset *fc) { int i=0,j=0; if (!FiconvSupport || FLCIconvUtf8Charset == NULL || fc == NULL) return False; while(FLC_GET_LOCALE_CHARSET(FLCIconvUtf8Charset,i) != NULL) { j = 0; while(FLC_GET_LOCALE_CHARSET(fc,j) != NULL) { if (is_iconv_supported( FLC_GET_LOCALE_CHARSET( FLCIconvUtf8Charset,i), FLC_GET_LOCALE_CHARSET(fc,j))) { FLC_SET_ICONV_INDEX(FLCIconvUtf8Charset,i); FLC_SET_ICONV_INDEX(fc,j); if (is_translit_supported( FLC_GET_LOCALE_CHARSET( FLCIconvUtf8Charset,i), FLC_GET_LOCALE_CHARSET(fc,j))) { FLC_SET_ICONV_TRANSLIT_CHARSET( fc, safestrdup(translit_csname( FLC_GET_LOCALE_CHARSET( fc,j)))); } else { FLC_SET_ICONV_TRANSLIT_CHARSET( fc, FLC_TRANSLIT_NOT_SUPPORTED); } return 1; } j++; } i++; } FLC_SET_ICONV_INDEX(FLCIconvUtf8Charset, FLC_INDEX_ICONV_CHARSET_NOT_FOUND); FLC_SET_ICONV_INDEX(fc, FLC_INDEX_ICONV_CHARSET_NOT_FOUND); return 0; } static void set_iconv_charset_index(FlocaleCharset *fc) { int i = 0; if (!FiconvSupport || fc == NULL) return; if (FLC_DO_ICONV_CHARSET_INITIALIZED(fc)) return; /* already set */ if (FLCIconvUtf8Charset == NULL || !FLC_DO_ICONV_CHARSET_INITIALIZED(FLCIconvUtf8Charset)) { FLC_SET_ICONV_INDEX(fc, FLC_INDEX_ICONV_CHARSET_NOT_FOUND); return; } while(FLC_GET_LOCALE_CHARSET(fc,i) != NULL) { if (is_iconv_supported( FLC_GET_ICONV_CHARSET(FLCIconvUtf8Charset), FLC_GET_LOCALE_CHARSET(fc,i))) { FLC_SET_ICONV_INDEX(fc,i); if (is_translit_supported( FLC_GET_ICONV_CHARSET(FLCIconvUtf8Charset), FLC_GET_LOCALE_CHARSET(fc,i))) { FLC_SET_ICONV_TRANSLIT_CHARSET( fc, safestrdup( translit_csname( FLC_GET_LOCALE_CHARSET( fc,i)))); } else { FLC_SET_ICONV_TRANSLIT_CHARSET( fc, FLC_TRANSLIT_NOT_SUPPORTED); } return; } i++; } FLC_SET_ICONV_INDEX(fc, FLC_INDEX_ICONV_CHARSET_NOT_FOUND); } static char *convert_charsets(const char *in_charset, const char *out_charset, const char *in, unsigned int in_size) { static int error_count = 0; Ficonv_t cd; int have_error = 0; int is_finished = 0; size_t nconv; size_t insize,outbuf_size,outbytes_remaining,len; const char *inptr; char *dest; char *outp; if (in == NULL || !FiconvSupport) return NULL; cd = Ficonv_open(out_charset, in_charset); if (cd == (Ficonv_t) -1) { /* Something went wrong. */ if (error_count > FICONV_CONVERSION_MAX_NUMBER_OF_WARNING) return NULL; error_count++; if (errno == EINVAL) { fprintf( stderr, "[fvwm][convert_charsets]: WARNING -\n\t"); fprintf( stderr, "conversion from `%s' to `%s' not available\n", in_charset,out_charset); } else { fprintf( stderr, "[fvwm][convert_charsets]: WARNING -\n\t"); fprintf( stderr, "conversion from `%s' to `%s' fail (init)\n", in_charset,out_charset); } /* Terminate the output string. */ return NULL; } /* in maybe a none terminate string */ len = in_size; outbuf_size = len + 1; outbytes_remaining = outbuf_size - 1; insize = len; outp = dest = safemalloc(outbuf_size); inptr = in; for (is_finished = 0; is_finished == 0; ) { nconv = Ficonv( cd, (ICONV_ARG_CONST char **)&inptr, &insize, &outp, &outbytes_remaining); is_finished = 1; if (nconv == (size_t) - 1) { switch (errno) { case EINVAL: /* Incomplete text, do not report an error */ break; case E2BIG: { size_t used = outp - dest; outbuf_size *= 2; dest = realloc (dest, outbuf_size); outp = dest + used; /* -1 for nul */ outbytes_remaining = outbuf_size - used - 1; is_finished = 0; break; } #ifdef EILSEQ case EILSEQ: /* Something went wrong. */ if (error_count <= FICONV_CONVERSION_MAX_NUMBER_OF_WARNING) { fprintf( stderr, "[fvwm][convert_charsets]:" " WARNING -\n\t"); fprintf( stderr, "Invalid byte sequence during" " conversion from %s to %s\n", in_charset,out_charset); } have_error = 1; break; #endif default: if (error_count <= FICONV_CONVERSION_MAX_NUMBER_OF_WARNING) { fprintf( stderr, "[fvwm][convert_charsets]:" " WARNING -\n\t"); fprintf( stderr, "Error during conversion from" " %s to %s\n", in_charset, out_charset); } have_error = 1; break; } } } /* Terminate the output string */ *outp = '\0'; if (Ficonv_close (cd) != 0) { fprintf( stderr, "[fvwm][convert_charsets]: WARNING - iconv_close" " fail\n"); } if (have_error) { error_count++; free (dest); return NULL; } else { return dest; } } static void FiconvInit(Display *dpy, const char *module) { int suc = False; if (!FiconvSupport || FiconvInitialized) return; FiconvInitialized = True; FlocaleCharsetInit(dpy, module); FLCIconvUtf8Charset = FlocaleCharsetGetUtf8Charset(); FLCIconvDefaultCharset = FlocaleCharsetGetFLCXOMCharset(); suc = set_default_iconv_charsets(FLCIconvDefaultCharset); if (!suc) { FLCIconvDefaultCharset = FlocaleCharsetGetLocaleCharset(); suc = set_default_iconv_charsets(FLCIconvDefaultCharset); } if (!suc) { fprintf(stderr, "[%s][FiconvInit]: WARN -- Cannot get default " "iconv charset for default charsets '%s' and '%s'\n", module, FLC_DEBUG_GET_X_CHARSET( FlocaleCharsetGetFLCXOMCharset()), FLC_DEBUG_GET_X_CHARSET(FLCIconvDefaultCharset)); FLCIconvUtf8Charset = NULL; FLCIconvDefaultCharset = NULL; } #if FLOCALE_DEBUG_CHARSET fprintf(stderr,"[FiconvInit] iconv charset: x:%s, iconv:%s\n", FLC_DEBUG_GET_X_CHARSET(FLCIconvDefaultCharset), FLC_DEBUG_GET_ICONV_CHARSET(FLCIconvDefaultCharset)); fprintf(stderr,"[FiconvInit] UTF-8 charset: x:%s, iconv:%s\n", FLC_DEBUG_GET_X_CHARSET(FLCIconvUtf8Charset), FLC_DEBUG_GET_ICONV_CHARSET(FLCIconvUtf8Charset)); #endif } static FlocaleCharset *FiconvSetupConversion(Display *dpy, FlocaleCharset *fc) { FlocaleCharset *my_fc = NULL; if (!FiconvSupport) { return NULL; } if (!FiconvInitialized) { FiconvInit(dpy, "fvwm"); } if (FLCIconvUtf8Charset == NULL) { return NULL; } if (fc == NULL) { my_fc = FLCIconvDefaultCharset; if (my_fc == NULL) { return NULL; } } else { my_fc = fc; } if (!FLC_DO_ICONV_CHARSET_INITIALIZED(my_fc)) { set_iconv_charset_index(my_fc); #if FLOCALE_DEBUG_CHARSET fprintf(stderr, "[Flocale] set up iconv charset: " "x: %s, iconv: %s\n", FLC_DEBUG_GET_X_CHARSET(my_fc), FLC_DEBUG_GET_ICONV_CHARSET(my_fc)); #endif if (!FLC_HAVE_ICONV_CHARSET(my_fc)) { fprintf( stderr, "[fvwmlibs] cannot get iconv converter " "for charset %s\n", FLC_DEBUG_GET_X_CHARSET(my_fc)); return NULL; } } if (!FLC_HAVE_ICONV_CHARSET(my_fc)) { return NULL; } return my_fc; } /* ---------------------------- interface functions ------------------------ */ /* set transliteration state */ void FiconvSetTransliterateUtf8(int toggle) { switch (toggle) { case -1: do_transliterate_utf8 ^= 1; break; case 0: case 1: do_transliterate_utf8 = toggle; break; default: do_transliterate_utf8 = 0; } } /* conversion from UTF8 to the "current" charset */ char *FiconvUtf8ToCharset(Display *dpy, FlocaleCharset *fc, const char *in, unsigned int in_size) { char *out = NULL; FlocaleCharset *my_fc = NULL; if (!FiconvSupport) { return NULL; } my_fc = FiconvSetupConversion(dpy, fc); if (my_fc == NULL) { return NULL; } #if FLOCALE_DEBUG_ICONV fprintf(stderr, "[FiconvUtf8ToCharset] conversion from %s to %s\n", FLC_DEBUG_GET_ICONV_CHARSET(FLCIconvUtf8Charset), FLC_DEBUG_GET_ICONV_CHARSET(my_fc)); #endif if (FLC_ENCODING_TYPE_IS_UTF_8(my_fc)) { /* in can be a none terminate string so do not use CopyString */ out = safemalloc(in_size+1); strncpy(out, in, in_size); out[in_size]=0; } else { char *to_cs; if (do_transliterate_utf8 && FLC_IS_TRANSLIT_SUPPORTED(my_fc)) { to_cs = FLC_GET_ICONV_TRANSLIT_CHARSET(my_fc); } else { to_cs = FLC_GET_ICONV_CHARSET(my_fc); } out = convert_charsets( FLC_GET_ICONV_CHARSET(FLCIconvUtf8Charset), to_cs, in, in_size); } return out; } /* conversion from the current charset to UTF8 */ char *FiconvCharsetToUtf8(Display *dpy, FlocaleCharset *fc, const char *in, unsigned int in_size) { char *out = NULL; FlocaleCharset *my_fc = NULL; if (!FiconvSupport) { return NULL; } my_fc = FiconvSetupConversion(dpy, fc); if (my_fc == NULL) { return NULL; } #if FLOCALE_DEBUG_ICONV fprintf(stderr, "[FiconvCharsetToUtf8] conversion from %s to %s\n", FLC_DEBUG_GET_ICONV_CHARSET(my_fc), FLC_DEBUG_GET_ICONV_CHARSET(FLCIconvUtf8Charset)); #endif if (FLC_ENCODING_TYPE_IS_UTF_8(my_fc)) { /* in can be a non terminate string so do not use CopyString */ out = safemalloc(in_size+1); strncpy(out, in, in_size); out[in_size]=0; } else { out = convert_charsets( FLC_GET_ICONV_CHARSET(my_fc), FLC_GET_ICONV_CHARSET(FLCIconvUtf8Charset), in, in_size); } return out; } /* conversion from charset to charset */ char *FiconvCharsetToCharset( Display *dpy, FlocaleCharset *in_fc, FlocaleCharset *out_fc, const char *in, unsigned int in_size) { char *out = NULL; char *tmp = NULL; int tmp_len; Bool free_tmp = False; FlocaleCharset *my_in_fc; FlocaleCharset *my_out_fc; if (!FiconvSupport || (my_in_fc = FiconvSetupConversion(dpy, in_fc)) == NULL) { return NULL; } if (!FiconvSupport || (my_out_fc = FiconvSetupConversion(dpy, out_fc)) == NULL) { return NULL; } tmp = (char *)in; tmp_len = in_size; if (!FLC_ENCODING_TYPE_IS_UTF_8(my_in_fc)) { tmp = FiconvCharsetToUtf8( dpy, my_in_fc, (const char *)in, in_size); if (tmp != NULL) { free_tmp = True; tmp_len = strlen(tmp); } else { /* fail to convert */ return NULL; } } out = tmp; if (!FLC_ENCODING_TYPE_IS_UTF_8(my_out_fc)) { out = FiconvUtf8ToCharset( dpy, my_out_fc, (const char *)tmp, tmp_len); if (free_tmp) { free(tmp); } } return out; } fvwm-2.6.5.orig/libs/System.c0000644000175000017500000001717310661015055014213 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * System.c: code for dealing with various OS system call variants */ #include "config.h" #include "fvwmlib.h" #include "envvar.h" #include "System.h" #include "Strings.h" #if HAVE_UNAME #include #endif #include "libs/fvwm_sys_stat.h" #if HAVE_SYS_SELECT_H #include #endif /* * just in case... */ #ifndef FD_SETSIZE #define FD_SETSIZE 2048 #endif fd_set_size_t fvwmlib_max_fd = (fd_set_size_t)-9999999; fd_set_size_t GetFdWidth(void) { #if HAVE_SYSCONF return min(sysconf(_SC_OPEN_MAX),FD_SETSIZE); #else return min(getdtablesize(),FD_SETSIZE); #endif } void fvwmlib_init_max_fd(void) { fvwmlib_max_fd = GetFdWidth(); return; } /* return a string indicating the OS type (i.e. "Linux", "SINIX-D", ... ) */ int getostype(char *buf, int max) { #if HAVE_UNAME struct utsname sysname; if (uname( &sysname ) >= 0) { buf[0] = '\0'; strncat(buf, sysname.sysname, max); return 0; } #endif strcpy (buf, ""); return -1; } /* * Set a colon-separated path, with environment variable expansions, * and expand '+' to be the value of the previous path. */ void setPath(char **p_path, const char *newpath, int free_old_path) { char *oldpath = *p_path; int oldlen = strlen(oldpath); char *stripped_path = stripcpy(newpath); int found_plus = strchr(newpath, '+') != NULL; /* Leave room for the old path, if we find a '+' in newpath */ *p_path = envDupExpand(stripped_path, found_plus ? oldlen - 1 : 0); free(stripped_path); if (found_plus) { char *p = strchr(*p_path, '+'); memmove(p + oldlen, p + 1, strlen(p + 1) + 1); memmove(p, oldpath, oldlen); } if (free_old_path) { free(oldpath); } } /* * * Find the specified file somewhere along the given path. * * There is a possible race condition here: We check the file and later * do something with it. By then, the file might not be accessible. * Oh well. * */ #include char *searchPath( const char *pathlist, const char *filename, const char *suffix, int type) { char *path; int filename_len; int maxpath_len; if (filename == NULL || *filename == 0) { return NULL; } if (pathlist == NULL || *pathlist == 0) { /* use pwd if no path list is given */ pathlist = "."; } filename_len = strlen(filename); maxpath_len = (pathlist) ? strlen(pathlist) : 0; maxpath_len += (suffix) ? strlen(suffix) : 0; /* +1 for extra / and +1 for null termination */ path = safemalloc(maxpath_len + filename_len + 2); *path = '\0'; if (*filename == '/') { /* No search if filename begins with a slash */ strcpy(path, filename); /* test if the path is accessable -- the module code assumes * this is done */ if (access(filename, type) == 0) { return path; } /* the file is not accessable (don't test suffixes with full * path), return NULL */ free(path); return NULL; } /* Search each element of the pathlist for the file */ while (pathlist && *pathlist) { char *path_end = strchr(pathlist, ':'); char *curr_end; if (path_end != NULL) { strncpy(path, pathlist, path_end - pathlist); path[path_end - pathlist] = '\0'; } else { strcpy(path, pathlist); } /* handle specially the path extention using semicolon */ curr_end = strchr(path, ';'); if (curr_end != NULL) { char *dot = strrchr(filename, '.'); int filebase_len; /* count a leading nil in newext_len too */ int newext_len = path + strlen(path) - curr_end; if (dot != NULL) { filebase_len = dot - filename; } else { filebase_len = filename_len; } *(curr_end++) = '/'; memmove(curr_end + filebase_len, curr_end, newext_len); strncpy(curr_end, filename, filebase_len); } else { strcat(path, "/"); strcat(path, filename); } if (access(path, type) == 0) { return path; } if (suffix && *suffix != '\0') { strcat(path, suffix); if (access(path, type) == 0) { return path; } } /* Point to next element of the path */ if (path_end == NULL) { break; } else { pathlist = path_end + 1; } } /* Hmm, couldn't find the file. Return NULL */ free(path); return NULL; } /* * void setFileStamp(FileStamp *stamp, const char *name); * Bool isFileStampChanged(const FileStamp *stamp, const char *name); * * An interface for verifying cached files. * The first function associates a file stamp with file (named by name). * The second function returns True or False in case the file was changed * from the time the stamp was associated. * * FileStamp can be a structure; try to save memory by evaluating a checksum. */ FileStamp getFileStamp(const char *name) { static struct stat buf; if (!name || stat(name, &buf)) { return 0; } return ((FileStamp)buf.st_mtime << 13) + (FileStamp)buf.st_size; } void setFileStamp(FileStamp *stamp, const char *name) { *stamp = getFileStamp(name); } Bool isFileStampChanged(const FileStamp *stamp, const char *name) { return *stamp != getFileStamp(name); } #ifdef HAVE_SAFETY_MKSTEMP int fvwm_mkstemp (char *TEMPLATE) { return mkstemp(TEMPLATE); } #else /* This function is an adaptation of the mkstemp() function included * in the Gnu C Library, version 2.2.2. The Gnu C library, in turn, * adapted the function from OpenBSD. * Michael Han */ #include #include #include #include #include #include #include "ftime.h" #define __set_errno(val) errno = (val) /* These are the characters used in temporary filenames. */ static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; /* Generate a unique temporary file name from TEMPLATE. The last six characters of TEMPLATE must be "XXXXXX"; they are replaced with a string that makes the filename unique. Then open the file and return a fd. */ int fvwm_mkstemp (char *template) { int len; char *XXXXXX; static unsigned long value; struct timeval tv; int count, fd = -1; int save_errno = errno; len = strlen (template); if (len < 6 || strcmp (&template[len - 6], "XXXXXX")) { __set_errno (EINVAL); return -1; } /* This is where the Xs start. */ XXXXXX = &template[len - 6]; /* Get some more or less random data. */ gettimeofday (&tv, NULL); value = ((unsigned long) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid (); for (count = 0; count < TMP_MAX; value = 7777, count) { unsigned long v = value; /* Fill in the random bits. */ XXXXXX[0] = letters[v % 62]; v /= 62; XXXXXX[1] = letters[v % 62]; v /= 62; XXXXXX[2] = letters[v % 62]; v /= 62; XXXXXX[3] = letters[v % 62]; v /= 62; XXXXXX[4] = letters[v % 62]; v /= 62; XXXXXX[5] = letters[v % 62]; fd = open( template, O_RDWR | O_CREAT | O_EXCL, FVWM_S_IRUSR | FVWM_S_IWUSR); if (fd >= 0) { __set_errno (save_errno); return fd; } else if (errno != EEXIST) { return -1; } } /* We got out of the loop because we ran out of combinations to try. */ __set_errno (EEXIST); return -1; } #endif /* HAVE_SAFETY_MKSTEMP */ fvwm-2.6.5.orig/libs/Parse.h0000644000175000017500000000627610556634174014024 0ustar vwcvwc/* -*-c-*- */ #ifndef FVWMLIB_PARSE_H #define FVWMLIB_PARSE_H /* ---------------------------- included header files ---------------------- */ #include "libs/Strings.h" /* ---------------------------- global definitions ------------------------- */ #define MAX_TOKEN_LENGTH 1023 /* ---------------------------- global macros ------------------------------ */ /* * Stuff for consistent parsing */ #define IsQuote(c) ((c) == '"' || (c) == '\'' || (c) =='`') #define IsBlockStart(c) ((c) == '[' || (c) == '{' || (c) == '(') #define IsBlockEnd(c,cs) (((c) == ']' && (cs) == '[') || ((c) == '}' && (cs) == '{') || ((c) == ')' && (cs) == '(')) /* * function: FindToken * description: find the entry of type 'struct_entry' * holding 'key' in 'table' * returns: pointer to the matching entry * NULL if not found * * table must be sorted in ascending order for FindToken. */ #define FindToken(key,table,struct_entry) \ (struct_entry *) bsearch( \ key, \ (char *)(table), \ sizeof(table) / sizeof(struct_entry), \ sizeof(struct_entry), \ (int(*)(const void*, const void*))XCmpToken) /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ char *EscapeString(char *s, const char *qchars, char echar); char *SkipQuote( char *s, const char *qlong, const char *qstart, const char *qend); char *GetQuotedString( char *sin, char **sout, const char *delims, const char *qlong, const char *qstart, const char *qend); char *SkipSpaces(char *indata, char *spaces, int snum); char *DoPeekToken( char *indata, char **token, char *spaces, char *delims, char *out_delim); char *PeekToken(char *indata, char **token); int MatchToken(char *pstr,char *tok); /* old style parse routine: */ char *DoGetNextToken( char *indata,char **token, char *spaces, char *delims, char *out_delim); char *GetNextToken(char *indata,char **token); char *GetNextSimpleOption(char *indata, char **option); char *GetNextFullOption(char *indata, char **option); char *SkipNTokens(char *indata, unsigned int n); char *GetModuleResource(char *indata, char **resource, char *module_name); int GetSuffixedIntegerArguments( char *action, char **ret_action, int *retvals, int num, char *suffixlist, int *ret_suffixnum); int GetIntegerArgumentsAnyBase( char *action, char **ret_action, int *retvals,int num); int SuffixToPercentValue(int value, int suffix, int *unit_table); int GetIntegerArguments(char *action, char**ret_action, int *retvals,int num); int GetTokenIndex(char *token, char **list, int len, char **next); char *GetNextTokenIndex(char *action, char **list, int len, int *index); int GetRectangleArguments(char *action, int *width, int *height); int GetOnePercentArgument(char *action, int *value, int *unit_io); int GetTwoPercentArguments( char *action, int *val1, int *val2, int *val1_unit, int *val2_unit); int ParseToggleArgument( char *action, char **ret_action, int default_ret, char no_toggle); int XCmpToken(const char *s, const char **t); char *GetFileNameFromPath(char *path); #endif fvwm-2.6.5.orig/libs/alloca.c0000644000175000017500000003555010453715571014172 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* alloca.c -- allocate automatically reclaimed memory (Mostly) portable public-domain implementation -- D A Gwyn This implementation of the PWB library alloca function, which is used to allocate space off the run-time stack so that it is automatically reclaimed upon procedure exit, was inspired by discussions with J. Q. Johnson of Cornell. J.Otto Tennant contributed the Cray support. There are some preprocessor constants that can be defined when compiling for your specific system, for improved efficiency; however, the defaults should be okay. The general concept of this implementation is to keep track of all alloca-allocated blocks, and reclaim any that are found to be deeper in the stack than the current invocation. This heuristic does not reclaim storage as soon as it becomes invalid, but it will do so eventually. As a special case, alloca(0) reclaims storage without allocating any. It is a good idea to use alloca(0) in your main control loop, etc. to force garbage collection. */ #include "config.h" #ifdef emacs #include "blockinput.h" #endif /* If compiling with GCC 2, this file's not needed. */ #if !defined (__GNUC__) || __GNUC__ < 2 /* If someone has defined alloca as a macro, there must be some other way alloca is supposed to work. */ #ifndef alloca #ifdef emacs #ifdef static /* actually, only want this if static is defined as "" -- this is for usg, in which emacs must undefine static in order to make unexec workable */ #ifndef STACK_DIRECTION you lose -- must know STACK_DIRECTION at compile-time #endif /* STACK_DIRECTION undefined */ #endif /* static */ #endif /* emacs */ /* If your stack is a linked list of frames, you have to provide an "address metric" ADDRESS_FUNCTION macro. */ #if defined (CRAY) && defined (CRAY_STACKSEG_END) long i00afunc (); #define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) #else #define ADDRESS_FUNCTION(arg) &(arg) #endif #if __STDC__ typedef void *pointer; #else typedef char *pointer; #endif #ifndef NULL #define NULL 0 #endif /* Different portions of Emacs need to call different versions of malloc. The Emacs executable needs alloca to call xmalloc, because ordinary malloc isn't protected from input signals. On the other hand, the utilities in lib-src need alloca to call malloc; some of them are very simple, and don't have an xmalloc routine. Non-Emacs programs expect this to call use xmalloc. Callers below should use malloc. */ #ifndef emacs #define malloc xmalloc #endif extern pointer malloc (); /* Define STACK_DIRECTION if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #ifndef STACK_DIRECTION #define STACK_DIRECTION 0 /* Direction unknown. */ #endif #if STACK_DIRECTION != 0 #define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ #else /* STACK_DIRECTION == 0; need run-time code. */ static int stack_dir; /* 1 or -1 once known. */ #define STACK_DIR stack_dir static void find_stack_direction () { static char *addr = NULL; /* Address of first `dummy', once known. */ auto char dummy; /* To get stack address. */ if (addr == NULL) { /* Initial entry. */ addr = ADDRESS_FUNCTION (dummy); find_stack_direction (); /* Recurse once. */ } else { /* Second entry. */ if (ADDRESS_FUNCTION (dummy) > addr) stack_dir = 1; /* Stack grew upward. */ else stack_dir = -1; /* Stack grew downward. */ } } #endif /* STACK_DIRECTION == 0 */ /* An "alloca header" is used to: (a) chain together all alloca'ed blocks; (b) keep track of stack depth. It is very important that sizeof(header) agree with malloc alignment chunk size. The following default should work okay. */ #ifndef ALIGN_SIZE #define ALIGN_SIZE sizeof(double) #endif typedef union hdr { char align[ALIGN_SIZE]; /* To force sizeof(header). */ struct { union hdr *next; /* For chaining headers. */ char *deep; /* For stack depth measure. */ } h; } header; static header *last_alloca_header = NULL; /* -> last alloca header. */ /* Return a pointer to at least SIZE bytes of storage, which will be automatically reclaimed upon exit from the procedure that called alloca. Originally, this space was supposed to be taken from the current stack frame of the caller, but that method cannot be made to work for some implementations of C, for example under Gould's UTX/32. */ pointer alloca (size) unsigned size; { auto char probe; /* Probes stack depth: */ register char *depth = ADDRESS_FUNCTION (probe); #if STACK_DIRECTION == 0 if (STACK_DIR == 0) /* Unknown growth direction. */ find_stack_direction (); #endif /* Reclaim garbage, defined as all alloca'd storage that was allocated from deeper in the stack than currently. */ { register header *hp; /* Traverses linked list. */ #ifdef emacs BLOCK_INPUT; #endif for (hp = last_alloca_header; hp != NULL;) if ((STACK_DIR > 0 && hp->h.deep > depth) || (STACK_DIR < 0 && hp->h.deep < depth)) { register header *np = hp->h.next; free ((pointer) hp); /* Collect garbage. */ hp = np; /* -> next header. */ } else break; /* Rest are not deeper. */ last_alloca_header = hp; /* -> last valid storage. */ #ifdef emacs UNBLOCK_INPUT; #endif } if (size == 0) return NULL; /* No allocation required. */ /* Allocate combined header + user data storage. */ { register pointer new = malloc (sizeof (header) + size); /* Address of header. */ if (new == 0) abort(); ((header *) new)->h.next = last_alloca_header; ((header *) new)->h.deep = depth; last_alloca_header = (header *) new; /* User storage begins just after header. */ return (pointer) ((char *) new + sizeof (header)); } } #if defined (CRAY) && defined (CRAY_STACKSEG_END) #ifndef CRAY_STACK #define CRAY_STACK #ifndef CRAY2 /* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ struct stack_control_header { long shgrow:32; /* Number of times stack has grown. */ long shaseg:32; /* Size of increments to stack. */ long shhwm:32; /* High water mark of stack. */ long shsize:32; /* Current size of stack (all segments). */ }; /* The stack segment linkage control information occurs at the high-address end of a stack segment. (The stack grows from low addresses to high addresses.) The initial part of the stack segment linkage control information is 0200 (octal) words. This provides for register storage for the routine which overflows the stack. */ struct stack_segment_linkage { long ss[0200]; /* 0200 overflow words. */ long sssize:32; /* Number of words in this segment. */ long ssbase:32; /* Offset to stack base. */ long:32; long sspseg:32; /* Offset to linkage control of previous segment of stack. */ long:32; long sstcpt:32; /* Pointer to task common address block. */ long sscsnm; /* Private control structure number for microtasking. */ long ssusr1; /* Reserved for user. */ long ssusr2; /* Reserved for user. */ long sstpid; /* Process ID for pid based multi-tasking. */ long ssgvup; /* Pointer to multitasking thread giveup. */ long sscray[7]; /* Reserved for Cray Research. */ long ssa0; long ssa1; long ssa2; long ssa3; long ssa4; long ssa5; long ssa6; long ssa7; long sss0; long sss1; long sss2; long sss3; long sss4; long sss5; long sss6; long sss7; }; #else /* CRAY2 */ /* The following structure defines the vector of words returned by the STKSTAT library routine. */ struct stk_stat { long now; /* Current total stack size. */ long maxc; /* Amount of contiguous space which would be required to satisfy the maximum stack demand to date. */ long high_water; /* Stack high-water mark. */ long overflows; /* Number of stack overflow ($STKOFEN) calls. */ long hits; /* Number of internal buffer hits. */ long extends; /* Number of block extensions. */ long stko_mallocs; /* Block allocations by $STKOFEN. */ long underflows; /* Number of stack underflow calls ($STKRETN). */ long stko_free; /* Number of deallocations by $STKRETN. */ long stkm_free; /* Number of deallocations by $STKMRET. */ long segments; /* Current number of stack segments. */ long maxs; /* Maximum number of stack segments so far. */ long pad_size; /* Stack pad size. */ long current_address; /* Current stack segment address. */ long current_size; /* Current stack segment size. This number is actually corrupted by STKSTAT to include the fifteen word trailer area. */ long initial_address; /* Address of initial segment. */ long initial_size; /* Size of initial segment. */ }; /* The following structure describes the data structure which trails any stack segment. I think that the description in 'asdef' is out of date. I only describe the parts that I am sure about. */ struct stk_trailer { long this_address; /* Address of this block. */ long this_size; /* Size of this block (does not include this trailer). */ long unknown2; long unknown3; long link; /* Address of trailer block of previous segment. */ long unknown5; long unknown6; long unknown7; long unknown8; long unknown9; long unknown10; long unknown11; long unknown12; long unknown13; long unknown14; }; #endif /* CRAY2 */ #endif /* not CRAY_STACK */ #ifdef CRAY2 /* Determine a "stack measure" for an arbitrary ADDRESS. I doubt that "lint" will like this much. */ static long i00afunc (long *address) { struct stk_stat status; struct stk_trailer *trailer; long *block, size; long result = 0; /* We want to iterate through all of the segments. The first step is to get the stack status structure. We could do this more quickly and more directly, perhaps, by referencing the $LM00 common block, but I know that this works. */ STKSTAT (&status); /* Set up the iteration. */ trailer = (struct stk_trailer *) (status.current_address + status.current_size - 15); /* There must be at least one stack segment. Therefore it is a fatal error if "trailer" is null. */ if (trailer == 0) abort (); /* Discard segments that do not contain our argument address. */ while (trailer != 0) { block = (long *) trailer->this_address; size = trailer->this_size; if (block == 0 || size == 0) abort (); trailer = (struct stk_trailer *) trailer->link; if ((block <= address) && (address < (block + size))) break; } /* Set the result to the offset in this segment and add the sizes of all predecessor segments. */ result = address - block; if (trailer == 0) { return result; } do { if (trailer->this_size <= 0) abort (); result += trailer->this_size; trailer = (struct stk_trailer *) trailer->link; } while (trailer != 0); /* We are done. Note that if you present a bogus address (one not in any segment), you will get a different number back, formed from subtracting the address of the first block. This is probably not what you want. */ return (result); } #else /* not CRAY2 */ /* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. Determine the number of the cell within the stack, given the address of the cell. The purpose of this routine is to linearize, in some sense, stack addresses for alloca. */ static long i00afunc (long address) { long stkl = 0; long size, pseg, this_segment, stack; long result = 0; struct stack_segment_linkage *ssptr; /* Register B67 contains the address of the end of the current stack segment. If you (as a subprogram) store your registers on the stack and find that you are past the contents of B67, you have overflowed the segment. B67 also points to the stack segment linkage control area, which is what we are really interested in. */ stkl = CRAY_STACKSEG_END (); ssptr = (struct stack_segment_linkage *) stkl; /* If one subtracts 'size' from the end of the segment, one has the address of the first word of the segment. If this is not the first segment, 'pseg' will be nonzero. */ pseg = ssptr->sspseg; size = ssptr->sssize; this_segment = stkl - size; /* It is possible that calling this routine itself caused a stack overflow. Discard stack segments which do not contain the target address. */ while (!(this_segment <= address && address <= stkl)) { if (pseg == 0) break; stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; this_segment = stkl - size; } result = address - this_segment; /* If you subtract pseg from the current end of the stack, you get the address of the previous stack segment's end. This seems a little convoluted to me, but I'll bet you save a cycle somewhere. */ while (pseg != 0) { stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; result += size; } return (result); } #endif /* not CRAY2 */ #endif /* CRAY */ #endif /* no alloca */ #endif /* not GCC version 2 */ fvwm-2.6.5.orig/libs/wild.h0000644000175000017500000000070610061071556013667 0ustar vwcvwc/* -*-c-*- */ /* * Does `string' match `pattern'? '*' in pattern matches any sub-string * (including the null string) '?' matches any single char. For use * by filenameforall. Note that '*' matches across directory boundaries * * This code donated by Paul Hudson * It is public domain, no strings attached. No guarantees either. * */ int matchWildcards(const char *pattern, const char *string); fvwm-2.6.5.orig/libs/PictureGraphics.c0000644000175000017500000007675210751445123016036 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include "PictureBase.h" #include "Colorset.h" #include "FRenderInit.h" #include "FRenderInterface.h" #include "Graphics.h" #include "PictureGraphics.h" #include "PictureUtils.h" #include "FImage.h" #include "Grab.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static Bool PGrabImageError = True; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static int FSetBackingStore(Display *dpy, Window win, int backing_store) { XWindowAttributes attributes; XSetWindowAttributes set_attributes; int old_bs; XGetWindowAttributes(dpy, win, &attributes); if (attributes.backing_store == backing_store) { return -1; } old_bs = attributes.backing_store; set_attributes.backing_store = backing_store; XChangeWindowAttributes(dpy, win, CWBackingStore, &set_attributes); return old_bs; } static void PCopyArea(Display *dpy, Pixmap pixmap, Pixmap mask, int depth, Drawable d, GC gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y) { XGCValues gcv; unsigned long gcm; GC my_gc = None; if (gc == None) { my_gc = fvwmlib_XCreateGC(dpy, d, 0, NULL); } gcm = GCClipMask | GCClipXOrigin | GCClipYOrigin; gcv.clip_x_origin = dest_x - src_x; /* */ gcv.clip_y_origin = dest_y - src_y; /* */ if (depth == Pdepth) { gcv.clip_mask = mask; if (my_gc != None) { XChangeGC(dpy,my_gc,gcm,&gcv); } else { XChangeGC(dpy,gc,gcm,&gcv); } XCopyArea(dpy, pixmap, d, (my_gc != None)? my_gc:gc, src_x, src_y, src_w, src_h, dest_x, dest_y); } else { /* monochrome bitmap */ gcv.clip_mask = mask; if (my_gc != None) { gcv.foreground = PictureWhitePixel(); gcv.background = PictureBlackPixel(); gcm |= GCBackground|GCForeground; XChangeGC(dpy,my_gc,gcm,&gcv); } else { XChangeGC(dpy,gc,gcm,&gcv); } XCopyPlane(dpy, pixmap, d, (my_gc != None)? my_gc:gc, src_x, src_y, src_w, src_h, dest_x, dest_y, 1); } if (my_gc != None) { XFreeGC(dpy, my_gc); } else { gcm = GCClipMask; gcv.clip_mask = None; XChangeGC(dpy, gc, gcm, &gcv); } } static void PTileRectangle(Display *dpy, Window win, Pixmap pixmap, Pixmap mask, int depth, int src_x, int src_y, Drawable d, GC gc, GC mono_gc, int dest_x, int dest_y, int dest_w, int dest_h) { Pixmap tile_mask = None; XGCValues gcv; unsigned long gcm; GC my_gc = None; GC my_mono_gc = None; if (gc == None) { my_gc = fvwmlib_XCreateGC(dpy, d, 0, NULL); } if (mono_gc == None && (mask != None || Pdepth != depth)) { if (mask != None) my_mono_gc = fvwmlib_XCreateGC(dpy, mask, 0, NULL); else if (depth != Pdepth) my_mono_gc = fvwmlib_XCreateGC(dpy, pixmap, 0, NULL); } gcm = 0; if (mask != None) { /* create a till mask */ tile_mask = XCreatePixmap(dpy, win, dest_w, dest_h, 1); gcv.tile = mask; gcv.ts_x_origin = src_x; gcv.ts_y_origin = src_y; gcv.fill_style = FillTiled; gcm = GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin | GCTile; if (mono_gc != None) { XChangeGC(dpy, mono_gc, gcm, &gcv); } else { gcv.foreground = 1; gcv.background = 0; gcm |= GCBackground|GCForeground; XChangeGC(dpy, my_mono_gc, gcm, &gcv); } XFillRectangle(dpy, tile_mask, (mono_gc != None)? mono_gc:my_mono_gc, src_x, src_y, dest_w, dest_h); if (mono_gc != None) { gcv.fill_style = FillSolid; gcm = GCFillStyle; XChangeGC(dpy, mono_gc, gcm, &gcv); } } gcv.tile = pixmap; gcv.ts_x_origin = dest_x - src_x; gcv.ts_y_origin = dest_y - src_y; gcv.fill_style = FillTiled; gcm = GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; gcv.clip_mask = tile_mask; gcv.clip_x_origin = dest_x; gcv.clip_y_origin = dest_y;; gcm |= GCClipMask | GCClipXOrigin | GCClipYOrigin; if (depth != Pdepth) { Pixmap my_pixmap = None; XChangeGC(dpy, (mono_gc != None)? mono_gc:my_mono_gc, gcm, &gcv); my_pixmap = XCreatePixmap(dpy, win, dest_w, dest_h, 1); XFillRectangle(dpy, my_pixmap, (mono_gc != None)? mono_gc:my_mono_gc, 0, 0, dest_w, dest_h); gcv.clip_mask = my_pixmap; gcv.fill_style = FillSolid; gcm = GCFillStyle | GCClipMask; XChangeGC(dpy, (mono_gc != None)? mono_gc:my_mono_gc, gcm, &gcv); XCopyPlane(dpy, my_pixmap, d, (my_gc != None)? my_gc:gc, 0, 0, dest_w, dest_h, dest_x, dest_y, 1); if (my_pixmap != None) { XFreePixmap(dpy, my_pixmap); } } else { XChangeGC(dpy, (gc != None)? gc:my_gc, gcm, &gcv); XFillRectangle(dpy, d, (gc != None)? gc:my_gc, dest_x, dest_y, dest_w, dest_h); } if (my_gc != None) { XFreeGC(dpy, my_gc); } else { gcv.clip_mask = None; gcv.fill_style = FillSolid; gcm = GCFillStyle | GCClipMask; XChangeGC(dpy, gc, gcm, &gcv); } if (my_mono_gc != None) { XFreeGC(dpy, my_mono_gc); } else if (mono_gc != None) { gcv.clip_mask = None; gcv.fill_style = FillSolid; gcm = GCFillStyle | GCClipMask; XChangeGC(dpy, mono_gc, gcm, &gcv); } if (tile_mask != None) { XFreePixmap(dpy, tile_mask); } } static void PGrabImageErrorHandler(void) { PGrabImageError = True; } static FImage *PGrabXImage( Display *dpy, Drawable d, int x, int y, int w, int h, Bool d_is_a_window) { Bool try_to_grab = True; XWindowAttributes xwa; XErrorHandler saved_eh = NULL; FImage *fim = NULL; PGrabImageError = 0; if (d_is_a_window) { MyXGrabServer(dpy); XGetWindowAttributes(dpy, d, &xwa); XSync(dpy, False); if (xwa.map_state != IsViewable && xwa.backing_store == NotUseful) { try_to_grab = False; #if 0 fprintf(stderr, "Bad attribute! %i,%i\n", xwa.map_state != IsViewable, xwa.backing_store == NotUseful); #endif } else { saved_eh = XSetErrorHandler( (XErrorHandler) PGrabImageErrorHandler); #if 0 fprintf(stderr, "Attribute ok! %i,%i\n", xwa.map_state != IsViewable, xwa.backing_store == NotUseful); #endif } } if (try_to_grab) { fim = FGetFImage(dpy, d, Pvisual, Pdepth, x, y, w, h, AllPlanes, ZPixmap); if (PGrabImageError) { #if 0 fprintf(stderr, "XGetImage error during the grab\n"); #endif if (fim != NULL) { FDestroyFImage(dpy, fim); fim = NULL; } } if (d_is_a_window) { XSetErrorHandler((XErrorHandler) saved_eh); } } if (d_is_a_window) { MyXUngrabServer(dpy); } return fim; } static Pixmap PCreateRenderPixmap( Display *dpy, Window win, Pixmap pixmap, Pixmap mask, Pixmap alpha, int depth, int added_alpha_percent, Pixel tint, int tint_percent, Bool d_is_a_window, Drawable d, GC gc, GC mono_gc, GC alpha_gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h, Bool do_repeat, int *new_w, int *new_h, Bool *new_do_repeat, Pixmap *new_mask) { FImage *pixmap_fim = NULL; FImage *mask_fim = NULL; FImage *alpha_fim = NULL; FImage *dest_fim = NULL; FImage *new_mask_fim = NULL; FImage *out_fim = NULL; Pixmap pixmap_copy = None; Pixmap src_pix = None; Pixmap out_pix = None; unsigned short *am = NULL; XColor *colors = NULL, *dest_colors = NULL; XColor tint_color, c; int w ,h, n_src_w, n_src_h; int j, i, j1, i1, m = 0, k = 0, l = 0; Bool do_free_mono_gc = False; Bool make_new_mask = False; Bool error = False; *new_mask = None; *new_do_repeat = do_repeat; if (depth != Pdepth) { pixmap_copy = XCreatePixmap(dpy, win, src_w, src_h, Pdepth); if (gc == None) { gc = PictureDefaultGC(dpy, win); } if (pixmap_copy && gc) { XCopyPlane( dpy, pixmap, pixmap_copy, gc, src_x, src_y, src_w, src_h, 0, 0, 1); } else { error = True; goto bail; } src_x = src_y = 0; } src_pix = (pixmap_copy)? pixmap_copy:pixmap; if (src_pix == ParentRelative) { pixmap_fim = PGrabXImage( dpy, d, dest_x, dest_y, dest_w, dest_h, d_is_a_window); } else { pixmap_fim = FGetFImage( dpy, src_pix, Pvisual, Pdepth, src_x, src_y, src_w, src_h, AllPlanes, ZPixmap); } if (!pixmap_fim) { error = True; goto bail; } if (mask != None) { mask_fim = FGetFImage( dpy, mask, Pvisual, 1, src_x, src_y, src_w, src_h, AllPlanes, ZPixmap); if (!mask_fim) { error = True; goto bail; } if (src_x != 0 || src_y != 0) make_new_mask = True; } if (alpha != None) { alpha_fim = FGetFImage( dpy, alpha, Pvisual, FRenderGetAlphaDepth(), src_x, src_y, src_w, src_h, AllPlanes, ZPixmap); if (!alpha_fim) { error = True; goto bail; } } if (alpha != None || added_alpha_percent < 100) { dest_fim = PGrabXImage( dpy, d, dest_x, dest_y, dest_w, dest_h, d_is_a_window); /* accept this error */ } if (dest_fim && do_repeat && (dest_w > src_w || dest_h > src_h)) { *new_do_repeat = False; if (mask) { make_new_mask = True; } w = dest_w; h = dest_h; n_src_w = (w < src_w)? w:src_w; n_src_h = (h < src_h)? h:src_h; } else { n_src_w = w = (dest_w < src_w)? dest_w:src_w; n_src_h = h = (dest_h < src_h)? dest_h:src_h; } *new_w = w; *new_h = h; out_pix = XCreatePixmap(dpy, win, w, h, Pdepth); out_fim = FCreateFImage( dpy, Pvisual, Pdepth, ZPixmap, w, h); if (gc == None) { gc = PictureDefaultGC(dpy, win); } if (!out_pix || !out_fim || !gc) { error = True; goto bail; } colors = (XColor *)safemalloc(n_src_w * n_src_h * sizeof(XColor)); if (dest_fim) { dest_colors = (XColor *)safemalloc(w * h * sizeof(XColor)); } am = (unsigned short *)safemalloc( n_src_w * n_src_h * sizeof(unsigned short)); if (tint_percent > 0) { tint_color.pixel = tint; XQueryColor(dpy, Pcmap, &tint_color); } for (j = 0; j < n_src_h; j++) { for (i = 0; i < n_src_w; i++, m++) { if (mask_fim != NULL && (XGetPixel(mask_fim->im, i, j) == 0)) { am[m] = 0; } else if (alpha_fim != NULL) { am[m] = XGetPixel(alpha_fim->im, i, j); if (am[m] == 0 && !dest_fim) { make_new_mask = True; } } else { am[m] = 255; } if (added_alpha_percent < 100) { am[m] = (unsigned short) ((am[m] * added_alpha_percent) / 100); } if (am[m] > 0) { if (!dest_fim) { if (am[m] < 130) { am[m] = 0; make_new_mask = True; } else { am[m] = 255; } } else if (am[m] < 255) { dest_colors[l++].pixel = XGetPixel(dest_fim->im, i, j); } if (am[m] > 0) { colors[k++].pixel = XGetPixel(pixmap_fim->im, i, j); } } } } for (i = 0; i < k; i += 256) XQueryColors(dpy, Pcmap, &colors[i], min(k - i, 256)); if (do_repeat && dest_fim && (n_src_h < h || n_src_w < w)) { for (j1 = 0; j1 < h+n_src_h; j1 +=n_src_h) { for (i1 = 0; i1 < w+n_src_w; i1 += n_src_w) { for(j = 0; !(i1==0 && j1==0) && j < n_src_h && j+j1 < h; j++) { for(i = 0; i < n_src_w && i+i1 < w; i++) { m = j*n_src_w + i; if (am[m] > 0 && am[m] < 255) { dest_colors[l++].pixel = XGetPixel( dest_fim ->im, i1+i, j1+j); } } } } } } for (i = 0; i < l; i += 256) XQueryColors(dpy, Pcmap, &dest_colors[i], min(l - i, 256)); if (make_new_mask) { *new_mask = XCreatePixmap(dpy, win, w, h, 1); if (*new_mask) { new_mask_fim = FCreateFImage( dpy, Pvisual, 1, ZPixmap, w, h); if (mono_gc == None) { mono_gc = fvwmlib_XCreateGC( dpy, *new_mask, 0, NULL); do_free_mono_gc = True; } } } l = 0; m = 0; k = 0; c.flags = DoRed | DoGreen | DoBlue; for (j = 0; j < n_src_h; j++) { for (i = 0; i < n_src_w; i++, m++) { if (am[m] > 0) { if (*new_mask) { XPutPixel(new_mask_fim->im, i, j, 1); } if (tint_percent > 0) { colors[k].blue = (unsigned short) (((100-tint_percent)* colors[k].blue + tint_color.blue * tint_percent) / 100); colors[k].green = (unsigned short) (((100-tint_percent)* colors[k].green + tint_color.green * tint_percent) / 100); colors[k].red = (unsigned short) (((100-tint_percent)* colors[k].red + tint_color.red * tint_percent) / 100); } c.blue = colors[k].blue; c.green = colors[k].green; c.red = colors[k].red; if (am[m] < 255 && dest_fim) { c.blue = (unsigned short) (((255 - am[m])* dest_colors[l].blue + c.blue * am[m]) / 255); c.green = (unsigned short) (((255 - am[m])* dest_colors[l].green + c.green * am[m]) / 255); c.red = (unsigned short) (((255 - am[m])* dest_colors[l].red + c.red * am[m]) / 255); l++; } PictureAllocColor(Pdpy, Pcmap, &c, False); colors[k].pixel = c.pixel; k++; } else { if (dest_fim) { c.pixel = XGetPixel(dest_fim->im, i, j); } else { c.pixel = XGetPixel( pixmap_fim->im, i, j); } if (*new_mask) { XPutPixel(new_mask_fim->im, i, j, 0); } } XPutPixel(out_fim->im, i, j, c.pixel); } } /* tile: editor ligne width limit 107 !!*/ if (do_repeat && dest_fim && (n_src_h < h || n_src_w < w)) { for (j1 = 0; j1 < h+n_src_h; j1 +=n_src_h) { for (i1 = 0; i1 < w+n_src_w; i1 += n_src_w) { k = 0; for(j = 0; !(i1==0 && j1==0) && j < n_src_h; j++) { for(i = 0; i < n_src_w; i++) { m = j*n_src_w + i; if (!(i+i1 < w && j+j1 < h)) { if (am[m] > 0) { k++; } } else { if (am[m] > 0) { if (*new_mask) { XPutPixel( new_mask_fim->im, i+i1, j+j1, 1); } c.blue = colors[k].blue; c.green = colors[k].green; c.red = colors[k].red; c.pixel = colors[k].pixel; k++; if (am[m] < 255) { c.blue = (unsigned short) (((255 - am[m])* dest_colors[l].blue + c.blue * am[m]) / 255); c.green = (unsigned short) (((255 - am[m])* dest_colors[l].green + c.green * am[m]) / 255); c.red = (unsigned short) (((255 - am[m])* dest_colors[l].red + c.red * am[m]) / 255); l++; PictureAllocColor( Pdpy, Pcmap, &c, False); } } else { c.pixel = XGetPixel( dest_fim->im, i+i1, j+j1); if (*new_mask) { XPutPixel( new_mask_fim->im, i+i1, j+j1, 0); } } XPutPixel(out_fim->im, i+i1, j+j1, c.pixel); } } } } } } FPutFImage(dpy, out_pix, gc, out_fim, 0, 0, 0, 0, w, h); if (*new_mask && mono_gc) { FPutFImage( dpy, *new_mask, mono_gc, new_mask_fim, 0, 0, 0, 0, w, h); } bail: if (colors) { free(colors); } if (dest_colors) { free(dest_colors); } if (am) { free(am); } if (pixmap_copy) { XFreePixmap(dpy, pixmap_copy); } if (pixmap_fim) { FDestroyFImage(dpy, pixmap_fim); } if (mask_fim) { FDestroyFImage(dpy, mask_fim); } if (alpha_fim) { FDestroyFImage(dpy, alpha_fim); } if (dest_fim) { FDestroyFImage(dpy, dest_fim); } if (new_mask_fim) { FDestroyFImage(dpy, new_mask_fim); } if (do_free_mono_gc && mono_gc) { XFreeGC(dpy, mono_gc); } if (out_fim) { FDestroyFImage(dpy, out_fim); } if (error) { if (out_pix != None) { XFreePixmap(dpy, out_pix); out_pix = None; } if (*new_mask != None) { XFreePixmap(dpy, *new_mask); *new_mask = None; } } return out_pix; } /* never used and tested */ static Pixmap PCreateDitherPixmap( Display *dpy, Window win, Drawable src, Pixmap mask, int depth, GC gc, int in_width, int in_height, int out_width, int out_height) { FImage *src_fim; FImage *mask_fim = NULL; FImage *out_fim; Pixmap out_pix = None; unsigned char *cm; XColor *colors; XColor c; int j, i, m = 0, k = 0, x = 0, y = 0; if (depth != Pdepth) return None; if (!(src_fim = FGetFImage( dpy, src, Pvisual, depth, 0, 0, in_width, in_height, AllPlanes, ZPixmap))) { return None; } if (mask != None) { mask_fim = FGetFImage( dpy, mask, Pvisual, 1, 0, 0, in_width, in_height, AllPlanes, ZPixmap); if (!mask_fim) { FDestroyFImage(dpy, mask_fim); return None; } } out_pix = XCreatePixmap(dpy, win, out_width, out_height, Pdepth); out_fim = FCreateFImage( dpy, Pvisual, Pdepth, ZPixmap, out_width, out_height); if (gc == None) { gc = PictureDefaultGC(dpy, win); } if (!out_pix || !out_fim || !gc) { FDestroyFImage(dpy, src_fim); if (mask_fim) { FDestroyFImage(dpy, mask_fim); } if (out_pix) { XFreePixmap(dpy, out_pix); } if (out_fim) { FDestroyFImage(dpy, out_fim); } return None; } colors = (XColor *)safemalloc(out_width * out_height * sizeof(XColor)); cm = (unsigned char *)safemalloc(out_width * out_height * sizeof(char)); x = y = 0; for (j = 0; j < out_height; j++,y++) { if (y == in_height) y = 0; for (i = 0; i < out_width; i++,x++) { if (x == in_width) x = 0; if (mask_fim != NULL && (XGetPixel(mask_fim->im, x, y) == 0)) { cm[m++] = 0; } else { cm[m++] = 255; colors[k++].pixel = XGetPixel(src_fim->im, x, y); } } } for (i = 0; i < k; i += 256) XQueryColors(dpy, Pcmap, &colors[i], min(k - i, 256)); k = 0;m = 0; for (j = 0; j < out_height; j++) { for (i = 0; i < out_width; i++) { if (cm[m] > 0) { c = colors[k++]; PictureAllocColorAllProp( Pdpy, Pcmap, &c, i, j, False, False, True); } else { c.pixel = XGetPixel(src_fim->im, i, j); } XPutPixel(out_fim->im, i, j, c.pixel); m++; } } free(colors); free(cm); FDestroyFImage(dpy, src_fim); if (mask_fim) { FDestroyFImage(dpy, mask_fim); } FPutFImage( dpy, out_pix, gc, out_fim, 0, 0, 0, 0, out_width, out_height); FDestroyFImage(dpy, out_fim); return out_pix; } /* ---------------------------- interface functions ------------------------ */ Pixmap PictureBitmapToPixmap( Display *dpy, Window win, Pixmap src, int depth, GC gc, int src_x, int src_y, int src_w, int src_h) { Pixmap dest = None; dest = XCreatePixmap(dpy, win, src_w, src_h, depth); if (dest && gc == None) { gc = PictureDefaultGC(dpy, win); } if (dest && gc) { XCopyPlane( dpy, src, dest, gc, src_x, src_y, src_w, src_h, 0, 0, 1); } return dest; } void PGraphicsRenderPixmaps( Display *dpy, Window win, Pixmap pixmap, Pixmap mask, Pixmap alpha, int depth, FvwmRenderAttributes *fra, Drawable d, GC gc, GC mono_gc, GC alpha_gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h, int do_repeat) { FvwmRenderAttributes t_fra; Pixmap xrs_pixmap = None; Pixmap xrs_mask = None; Pixmap tmp_pixmap, tmp_mask; Bool d_is_a_window; t_fra.added_alpha_percent = 100; t_fra.tint_percent = 0; t_fra.mask = 0; t_fra.tint = None; if (fra) { t_fra.mask = fra->mask; if (fra->mask & FRAM_HAVE_ICON_CSET) { t_fra.added_alpha_percent = fra->colorset->icon_alpha_percent; t_fra.tint_percent = fra->colorset->icon_tint_percent; t_fra.tint = fra->colorset->icon_tint; } if (fra->mask & FRAM_HAVE_ADDED_ALPHA) { t_fra.added_alpha_percent = fra->added_alpha_percent; } if (fra->mask & FRAM_HAVE_TINT) { t_fra.tint_percent = fra->tint_percent; t_fra.tint = fra->tint; } } if (dest_w == 0 && dest_h == 0) { dest_w = src_w; dest_h = src_h; } /* use XRender only when "needed" (backing store pbs) */ if (t_fra.tint_percent > 0 || t_fra.added_alpha_percent < 100 || alpha != None) { /* for testing XRender simulation add && 0 */ if (FRenderRender( dpy, win, pixmap, mask, alpha, depth, t_fra.added_alpha_percent, t_fra.tint, t_fra.tint_percent, d, gc, alpha_gc, src_x, src_y, src_w, src_h, dest_x, dest_y, dest_w, dest_h, do_repeat)) { return; } } /* no render extension or something strange happen */ if (t_fra.tint_percent > 0 || t_fra.added_alpha_percent < 100 || alpha != None) { int new_w, new_h, new_do_repeat; d_is_a_window = !!(t_fra.mask & FRAM_DEST_IS_A_WINDOW); xrs_pixmap = PCreateRenderPixmap( dpy, win, pixmap, mask, alpha, depth, t_fra.added_alpha_percent, t_fra.tint, t_fra.tint_percent, d_is_a_window, d, gc, mono_gc, alpha_gc, src_x, src_y, src_w, src_h, dest_x, dest_y, dest_w, dest_h, do_repeat, &new_w, &new_h, &new_do_repeat, &xrs_mask); if (xrs_pixmap) { src_x = 0; src_y = 0; src_w = new_w; src_h = new_h; depth = Pdepth; do_repeat = new_do_repeat; } } tmp_pixmap = (xrs_pixmap != None)? xrs_pixmap:pixmap; tmp_mask = (xrs_mask != None)? xrs_mask:mask; if (do_repeat) { PTileRectangle( dpy, win, tmp_pixmap, tmp_mask, depth, src_x, src_y, d, gc, mono_gc, dest_x, dest_y, dest_w, dest_h); } else { PCopyArea( dpy, tmp_pixmap, tmp_mask, depth, d, gc, src_x, src_y, src_w, src_h, dest_x, dest_y); } if (xrs_pixmap) { XFreePixmap(dpy, xrs_pixmap); } if (xrs_mask) { XFreePixmap(dpy, xrs_mask); } } void PGraphicsRenderPicture( Display *dpy, Window win, FvwmPicture *p, FvwmRenderAttributes *fra, Drawable d, GC gc, GC mono_gc, GC alpha_gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h, int do_repeat) { PGraphicsRenderPixmaps( dpy, win, p->picture, p->mask, p->alpha, p->depth, fra, d, gc, mono_gc, alpha_gc, src_x, src_y, src_w, src_h, dest_x, dest_y, dest_w, dest_h, do_repeat); } void PGraphicsCopyPixmaps( Display *dpy, Pixmap pixmap, Pixmap mask, Pixmap alpha, int depth, Drawable d, GC gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y) { PGraphicsRenderPixmaps( dpy, None, pixmap, mask, alpha, depth, 0, d, gc, None, None, src_x, src_y, src_w, src_h, dest_x, dest_y, src_w, src_h, False); } void PGraphicsCopyFvwmPicture( Display *dpy, FvwmPicture *p, Drawable d, GC gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y) { PGraphicsRenderPicture( dpy, None, p, 0, d, gc, None, None, src_x, src_y, src_w, src_h, dest_x, dest_y, src_w, src_h, False); } void PGraphicsTileRectangle( Display *dpy, Window win, Pixmap pixmap, Pixmap mask, Pixmap alpha, int depth, Drawable d, GC gc, GC mono_gc, int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, int dest_w, int dest_h) { PGraphicsRenderPixmaps( dpy, win, pixmap, mask, alpha, depth, 0, d, gc, mono_gc, None, src_x, src_y, dest_w, dest_h, dest_x, dest_y, dest_w, dest_h, True); } FvwmPicture *PGraphicsCreateStretchPicture( Display *dpy, Window win, FvwmPicture *src, int dest_width, int dest_height, GC gc, GC mono_gc, GC alpha_gc) { Pixmap pixmap = None, mask = None, alpha = None; FvwmPicture *q; if (src == NULL || src->picture == None) { return NULL; } pixmap = CreateStretchPixmap( dpy, src->picture, src->width, src->height, src->depth, dest_width, dest_height, gc); if (!pixmap) { return NULL; } if (src->mask) { mask = CreateStretchPixmap( dpy, src->mask, src->width, src->height, 1, dest_width, dest_height, mono_gc); } if (src->alpha) { alpha = CreateStretchPixmap( dpy, src->alpha, src->width, src->height, FRenderGetAlphaDepth(), dest_width, dest_height, alpha_gc); } q = (FvwmPicture*)safemalloc(sizeof(FvwmPicture)); memset(q, 0, sizeof(FvwmPicture)); q->count = 1; q->name = NULL; q->next = NULL; q->stamp = pixmap; q->picture = pixmap; q->mask = mask; q->alpha = alpha; q->width = dest_width; q->height = dest_height; q->depth = src->depth; q->alloc_pixels = 0; q->nalloc_pixels = 0; return q; } FvwmPicture *PGraphicsCreateTiledPicture( Display *dpy, Window win, FvwmPicture *src, int dest_width, int dest_height, GC gc, GC mono_gc, GC alpha_gc) { Pixmap pixmap = None, mask = None, alpha = None; FvwmPicture *q; if (src == NULL || src->picture == None) { return NULL; } pixmap = CreateTiledPixmap( dpy, src->picture, src->width, src->height, dest_width, dest_height, src->depth, gc); if (!pixmap) { return NULL; } if (src->mask) { mask = CreateTiledPixmap( dpy, src->mask, src->width, src->height, dest_width, dest_height, 1, mono_gc); } if (src->alpha) { alpha = CreateTiledPixmap( dpy, src->alpha, src->width, src->height, dest_width, dest_height, FRenderGetAlphaDepth(), alpha_gc); } q = (FvwmPicture*)safemalloc(sizeof(FvwmPicture)); memset(q, 0, sizeof(FvwmPicture)); q->count = 1; q->name = NULL; q->next = NULL; q->stamp = pixmap; q->picture = pixmap; q->mask = mask; q->alpha = alpha; q->width = dest_width; q->height = dest_height; q->depth = src->depth; q->alloc_pixels = 0; q->nalloc_pixels = 0; return q; } Pixmap PGraphicsCreateTransparency( Display *dpy, Window win, FvwmRenderAttributes *fra, GC gc, int x, int y, int width, int height, Bool parent_relative) { Pixmap r = None, dp = None; XID junk; XID root; int dummy, sx, sy, sw, sh; int gx = x, gy = y, gh = height, gw = width; int old_backing_store = -1; if (parent_relative) { old_backing_store = FSetBackingStore(dpy, win, Always); XSetWindowBackgroundPixmap(dpy, win, ParentRelative); XClearArea(dpy, win, x, y, width, height, False); XSync(dpy, False); } if (parent_relative) { /* this block is not useful if backing store ... */ if (!XGetGeometry( dpy, win, &root, (int *)&junk, (int *)&junk, (unsigned int *)&sw, (unsigned int *)&sh, (unsigned int *)&junk, (unsigned int *)&junk)) { goto bail; } XTranslateCoordinates( dpy, win, DefaultRootWindow(dpy), x, y, &sx, &sy, &junk); if (sx >= DisplayWidth(dpy, DefaultScreen(dpy))) { goto bail; } if (sy >= DisplayHeight(dpy, DefaultScreen(dpy))) { goto bail; } if (sx < 0) { gx = gx - sx; gw = width + sx; sx = 0; if (gw <= 0) { goto bail; } } if (sy < 0) { gy = gy - sy; gh = height + sy; sy = 0; if (gh <= 0) { goto bail; } } if (sx + gw > DisplayWidth(dpy, DefaultScreen(dpy))) { gw = DisplayWidth(dpy, DefaultScreen(dpy)) - sx; } if (sy + gh > DisplayHeight(dpy, DefaultScreen(dpy))) { gh = DisplayHeight(dpy, DefaultScreen(dpy)) - sy; } } #if 0 fprintf( stderr,"Geo: %i,%i,%i,%i / %i,%i,%i,%i / %i,%i,%i,%i\n", gx,gy,gw,gh, x,y,width,height, sx,sy,sw,sh); #endif if (XRenderSupport && FRenderGetExtensionSupported()) { r = XCreatePixmap(dpy, win, gw, gh, Pdepth); if (FRenderRender( dpy, win, ParentRelative, None, None, Pdepth, 100, fra->tint, fra->tint_percent, r, gc, None, gx, gy, gw, gh, 0, 0, gw, gh, False)) { goto bail; } XFreePixmap(dpy, r); } r = PCreateRenderPixmap( dpy, win, ParentRelative, None, None, Pdepth, 100, fra->tint, fra->tint_percent, True, win, gc, None, None, gx, gy, gw, gh, gx, gy, gw, gh, False, &dummy, &dummy, &dummy, &dp); bail: if (old_backing_store >= 0) { FSetBackingStore(dpy, win, old_backing_store); } return r; } void PGraphicsTintRectangle( Display *dpy, Window win, Pixel tint, int tint_percent, Drawable dest, Bool dest_is_a_window, GC gc, GC mono_gc, GC alpha_gc, int dest_x, int dest_y, int dest_w, int dest_h) { Pixmap p; FvwmRenderAttributes fra; #if 0 /* this does not work. why? */ if (FRenderTintRectangle( dpy, win, None, tint, tint_percent, dest, dest_x, dest_y, dest_w, dest_h)) { return; } #else if (FRenderRender( dpy, win, ParentRelative, None, None, Pdepth, 100, tint, tint_percent, win, gc, None, dest_x, dest_y, dest_w, dest_h, dest_x, dest_y, dest_w, dest_h, False)) { return; } #endif if (dest_is_a_window) { fra.tint = tint; fra.tint_percent = tint_percent; fra.mask = FRAM_DEST_IS_A_WINDOW | FRAM_HAVE_TINT; p = PGraphicsCreateTransparency( dpy, dest, &fra, gc, dest_x, dest_y, dest_w, dest_h, False); if (p) { XCopyArea( dpy, p, dest, gc, 0, 0, dest_w, dest_h, dest_x, dest_y); XFreePixmap(dpy, p); } } } #if 0 /* humm... maybe useful one day with menus */ Pixmap PGraphicsCreateTranslucent( Display *dpy, Window win, FvwmRenderAttributes *fra, GC gc, int x, int y, int width, int height) { Pixmap r = None; int gx = x, gy = y, gh = height, gw = width; FvwmRenderAttributes t_fra; Pixmap root_pix = None; Pixmap dp = None; int dummy; t_fra.added_alpha_percent = 100; t_fra.tint_percent = 0; t_fra.tint = 0; t_fra.mask = 0; if (fra) { if (fra->mask & FRAM_HAVE_TINT) { t_fra.tint_percent = fra->tint_percent; t_fra.tint = fra->tint; t_fra.mask = FRAM_HAVE_TINT; } } if (x >= DisplayWidth(dpy, DefaultScreen(dpy))) { goto bail; } if (y >= DisplayHeight(dpy, DefaultScreen(dpy))) { goto bail; } if (x < 0) { gx = 0; gw = width + x; if (gw <= 0) { goto bail; } } if (y < 0) { gy = 0; gh = gh+y; if (gh <= 0) { goto bail; } } if (gx + gw > DisplayWidth(dpy, DefaultScreen(dpy))) { gw = DisplayWidth(dpy, DefaultScreen(dpy)) - gx; } if (gy + gh > DisplayHeight(dpy, DefaultScreen(dpy))) { gh = DisplayHeight(dpy, DefaultScreen(dpy)) - gy; } { /* make a screen shoot */ GC my_gc; unsigned long valuemask = GCSubwindowMode; XGCValues values; values.subwindow_mode = IncludeInferiors; root_pix = XCreatePixmap(dpy, win, gw, gh, Pdepth); my_gc = fvwmlib_XCreateGC(dpy, win, 0, NULL); XChangeGC(dpy, my_gc, valuemask, &values); MyXGrabServer(dpy); XCopyArea( dpy, DefaultRootWindow(dpy), root_pix, my_gc, gx, gy, gw, gh, 0, 0); MyXUngrabServer(dpy); XFreeGC(dpy,my_gc); } if (XRenderSupport && FRenderGetExtensionSupported()) { r = XCreatePixmap(dpy, win, gw, gh, Pdepth); if (FRenderRender( dpy, win, root_pix, None, None, Pdepth, t_fra.added_alpha_percent, t_fra.tint, t_fra.tint_percent, r, gc, None, 0, 0, gw, gh, 0, 0, gw, gh, False)) { goto bail; } XFreePixmap(dpy, r); r = None; } r = PCreateRenderPixmap( dpy, win, root_pix, None, None, Pdepth, 100, fra->tint, fra->tint_percent, True, win, gc, None, None, 0, 0, gw, gh, gx, gy, gw, gh, False, &dummy, &dummy, &dummy, &dp); bail: if (root_pix) { XFreePixmap(dpy, root_pix); } if (dp) { XFreePixmap(dpy, dp); } return r; } #endif /* never tested and used ! */ Pixmap PGraphicsCreateDitherPixmap( Display *dpy, Window win, Drawable src, Pixmap mask, int depth, GC gc, int in_width, int in_height, int out_width, int out_height) { return PCreateDitherPixmap( dpy, win, src, mask, depth, gc, in_width, in_height, out_width, out_height); } fvwm-2.6.5.orig/libs/fio.h0000644000175000017500000000054710550175037013512 0ustar vwcvwc/* -*-c-*- */ /* Wrappers for io functions from the standard library that might be * interrupted. These functions are restarted when necessary. */ /* ---------------------------- interface functions ------------------------ */ ssize_t fvwm_send(int s, const void *buf, size_t len, int flags); ssize_t fvwm_recv(int s, void *buf, size_t len, int flags); fvwm-2.6.5.orig/libs/PictureUtils.c0000644000175000017500000015341011622413321015352 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 1993, Robert Nation * Copyright (C) 2002 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include #include #include #include "fvwmlib.h" #include "envvar.h" #include "Grab.h" #include "Parse.h" #include "ftime.h" #include "PictureBase.h" #include "PictureUtils.h" #include "PictureDitherMatrice.h" /* ---------------------------- local definitions and macro ----------------- */ #if 0 /* dv: unused */ /* form alloc_in_cmap from the xpm lib */ #define XPM_DIST(r1,g1,b1,r2,g2,b2) (long)\ (3*(abs((long)r1-(long)r2) + \ abs((long)g1-(long)g2) + \ abs((long)b1-(long)b2)) + \ abs((long)r1 + (long)g1 + (long)b1 - \ ((long)r2 + (long)g2 + (long)b2))) #define XPM_COLOR_CLOSENESS 40000 #endif #define SQUARE(X) ((X)*(X)) #define TRUE_DIST(r1,g1,b1,r2,g2,b2) (long)\ (SQUARE((long)((r1 - r2)>>8)) \ + SQUARE((long)((g1 - g2)>>8)) \ + SQUARE((long)((b1 - b2)>>8))) #define FAST_DIST(r1,g1,b1,r2,g2,b2) (long)\ (abs((long)(r1 - r2)) \ + abs((long)(g1 - g2)) \ + abs((long)(b1 - b2))) #define FVWM_DIST(r1,g1,b1,r2,g2,b2) \ (abs(r1 - r2) + abs(g1 - g2) + abs(b1 - b2) \ + 2*abs(abs(r1-g1) + abs(g1-b1) + abs(r1-b1) \ - abs(r2-g2) - abs(g2-b2) - abs(r2-b2))) #define USED_DIST(r1,g1,b1,r2,g2,b2) FVWM_DIST(r1,g1,b1,r2,g2,b2) #define PICTURE_COLOR_CLOSENESS USED_DIST(3,3,3,0,0,0) #define PICTURE_PAllocTable 1000000 #define PICTURE_PUseDynamicColors 100000 #define PICTURE_PStrictColorLimit 10000 #define PICTURE_use_named 1000 #define PICTURE_TABLETYPE_LENGHT 7 /* humm ... dither is probably borken with gamma correction. Anyway I do * do think that using gamma correction for the colors cubes is a good * idea */ #define USE_GAMMA_CORECTION 0 /* 2.2 is recommanded by the Poynon colors FAQ, some others suggest 1.5 and 2 * Use float constants!*/ #define COLOR_GAMMA 1.5 #define GREY_GAMMA 2.0 /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef struct { XColor color; /* rgb color info */ unsigned long alloc_count; /* nbr of allocation */ } PColor; typedef struct { /* * info for colors table (depth <= 8) */ /* color cube used */ short nr; short ng; short nb; short ngrey; /* grey palette def, nbr of grey = 2^grey_bits */ short grey_bits; /* color cube used for dithering with the named table */ short d_nr; short d_ng; short d_nb; short d_ngrey_bits; /* do we found a pre-allocated pallet ? */ Bool pre_allocated_pallet; /* info for depth > 8 */ int red_shift; int green_shift; int blue_shift; int red_prec; int green_prec; int blue_prec; /* for dithering in depth 15 and 16 */ unsigned short *red_dither; unsigned short *green_dither; unsigned short *blue_dither; /* colors allocation function */ int (*alloc_color)(Display *dpy, Colormap cmap, XColor *c); int (*alloc_color_no_limit)(Display *dpy, Colormap cmap, XColor *c); int (*alloc_color_dither)( Display *dpy, Colormap cmap, XColor *c, int x, int y); void (*free_colors)( Display *dpy, Colormap cmap, Pixel *pixels, int n, unsigned long planes); void (*free_colors_no_limit)( Display *dpy, Colormap cmap, Pixel *pixels, int n, unsigned long planes); } PColorsInfo; typedef struct { int cols_index; long closeness; } CloseColor; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static int PColorLimit = 0; static PColor *Pct = NULL; static PColor *Pac = NULL; static short *PMappingTable = NULL; static short *PDitherMappingTable = NULL; static Bool PStrictColorLimit = 0; static Bool PAllocTable = 0; static PColorsInfo Pcsi = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* * get shift and prec from a mask */ static void decompose_mask( unsigned long mask, int *shift, int *prec) { *shift = 0; *prec = 0; while (!(mask & 0x1)) { (*shift)++; mask >>= 1; } while (mask & 0x1) { (*prec)++; mask >>= 1; } } /* * color allocation in the colormap. strongly inspired by SetCloseColor from * the Xpm library (depth <= 8) */ static int closeness_cmp(const void *a, const void *b) { CloseColor *x = (CloseColor *) a, *y = (CloseColor *) b; /* cast to int as qsort requires */ return (int) (x->closeness - y->closeness); } static int alloc_color_in_cmap(XColor *c, Bool force) { static XColor colors[256]; CloseColor closenesses[256]; XColor tmp; int i,j; int map_entries = (Pvisual->class == DirectColor)? (1 << Pdepth) : Pvisual->map_entries; time_t current_time; time_t last_time = 0; map_entries = (map_entries > 256)? 256:map_entries; current_time = time(NULL); if (current_time - last_time >= 2 || force) { last_time = current_time; for (i = 0; i < map_entries; i++) { colors[i].pixel = i; } XQueryColors(Pdpy, Pcmap, colors, map_entries); } for(i = 0; i < map_entries; i++) { closenesses[i].cols_index = i; closenesses[i].closeness = USED_DIST( (int)(c->red), (int)(c->green), (int)(c->blue), (int)(colors[i].red), (int)(colors[i].green), (int)(colors[i].blue)); } qsort(closenesses, map_entries, sizeof(CloseColor), closeness_cmp); i = 0; j = closenesses[i].cols_index; while (force || (abs((long)c->red - (long)colors[j].red) <= PICTURE_COLOR_CLOSENESS && abs((long)c->green - (long)colors[j].green) <= PICTURE_COLOR_CLOSENESS && abs((long)c->blue - (long)colors[j].blue) <= PICTURE_COLOR_CLOSENESS)) { tmp.red = colors[j].red; tmp.green = colors[j].green; tmp.blue = colors[j].blue; if (XAllocColor(Pdpy, Pcmap, &tmp)) { c->red = tmp.red; c->green = tmp.green; c->blue = tmp.blue; c->pixel = tmp.pixel; return 1; } else { i++; if (i == map_entries) break; j = closenesses[i].cols_index; } } return 0; } /* * dithering */ static int my_dither(int x, int y, XColor *c) { /* the dither matrice */ static const char DM[128][128] = DITHER_MATRICE; int index; const char *dmp; if (Pcsi.grey_bits != 0) { /* Grey Scale */ int prec = Pcsi.grey_bits; if (Pcsi.grey_bits == 1) { /* FIXME, can we do a better dithering */ prec = 2; } dmp = DM[(0 + y) & (DM_HEIGHT - 1)]; index = (c->green + ((c->blue + c->red) >> 1)) >> 1; index += (dmp[(0 + x) & (DM_WIDTH - 1)] << 2) >> prec; index = (index - (index >> prec)); index = index >> (8 - Pcsi.grey_bits); } else { /* color cube */ int dith, rs, gs, bs, gb, b; int tr,tb,tg; rs = Pcsi.d_nr - 1; gs = Pcsi.d_ng - 1; bs = Pcsi.d_nb - 1; gb = Pcsi.d_ng*Pcsi.d_nb; b = Pcsi.d_nb; dmp = DM[(0 + y) & (DM_HEIGHT - 1)]; dith = (dmp[(0 + x) & (DM_WIDTH - 1)] << 2) | 7; tr = ((c->red * rs) + dith) >> 8; tg = ((c->green * gs) + (262 - dith)) >> 8; tb = ((c->blue * bs) + dith) >> 8; index = tr * gb + tg * b + tb; #if 0 /* try to use the additonal grey. Not easy, good for * certain image/gradient bad for others */ if (Pcsi.d_ngrey_bits) { int g_index; /* dither in the Pcsi.ngrey^3 cc */ tr = ((c->red * (Pcsi.ngrey-1)) + dith) >> 8; tg = ((c->green * (Pcsi.ngrey-1)) + (262 - dith)) >> 8; tb = ((c->blue * (Pcsi.ngrey-1)) + dith) >> 8; /* get the grey */ fprintf(stderr, "%i,%i,%i(%i/%i) ", tr,tg,tb, abs(tr-tg) + abs(tb-tg) + abs(tb-tr),Pcsi.ngrey); g_index = ((tr + tg + tb)/3); if (g_index != 0 && g_index != Pcsi.ngrey-1 && abs(tr-tg) + abs(tb-tg) + abs(tb-tr) <= Pcsi.d_ngrey_bits) { g_index = g_index + Pcsi.ng*Pcsi.nb*Pcsi.ng -1; index = g_index; } } #endif if (PDitherMappingTable != NULL) { index = PDitherMappingTable[index]; } } return index; } static int my_dither_depth_15_16_init(void) { const unsigned char _dither_44[4][4] = { {0, 4, 1, 5}, {6, 2, 7, 3}, {1, 5, 0, 4}, {7, 3, 6, 2} }; int y,x,i; int rm = 0xf8, re = 0x7, gm = 0xfc, ge = 0x3, bm = 0xf8, be = 0x7; if (Pdepth == 16 && (Pvisual->red_mask == 0xf800) && (Pvisual->green_mask == 0x7e0) && (Pvisual->blue_mask == 0x1f)) { /* ok */ } else if (Pdepth == 15 && (Pvisual->red_mask == 0x7c00) && (Pvisual->green_mask == 0x3e0) && (Pvisual->blue_mask == 0x1f)) { gm = 0xf8; ge = 0x7; } else { return 0; /* fail */ } Pcsi.red_dither = (unsigned short *)safemalloc(4*4*256*sizeof(unsigned short)); Pcsi.green_dither = (unsigned short *)safemalloc(4*4*256*sizeof(unsigned short)); Pcsi.blue_dither = (unsigned short *)safemalloc(4*4*256*sizeof(unsigned short)); for (y = 0; y < 4; y++) { for (x = 0; x < 4; x++) { for (i = 0; i < 256; i++) { if ((_dither_44[x][y] < (i & re)) && (i < (256 - 8))) { Pcsi.red_dither[ (x << 10) | (y << 8) | i] = ((i + 8) & rm) << 8; } else { Pcsi.red_dither[ (x << 10) | (y << 8) | i] = (i & rm) << 8; } if ((_dither_44[x][y] < ((i & ge) << 1)) && (i < (256 - 4))) { Pcsi.green_dither[ (x << 10) | (y << 8) | i] = ((i + 4) & gm) << 8; } else { Pcsi.green_dither[ (x << 10) | (y << 8) | i] = (i & gm) << 8; } if ((_dither_44[x][y] < (i & be)) && (i < (256 - 8))) { Pcsi.blue_dither[ (x << 10) | (y << 8) | i] = ((i + 8) & bm) << 8; } else { Pcsi.blue_dither[ (x << 10) | (y << 8) | i] = (i & bm) << 8; } } } } return 1; } /* * Color allocation in the "palette" */ static int alloc_color_in_pct(XColor *c, int index) { if (Pct[index].alloc_count == 0) { int s = PStrictColorLimit; PStrictColorLimit = 0; c->red = Pct[index].color.red; c->green = Pct[index].color.green; c->blue = Pct[index].color.blue; PictureAllocColor(Pdpy, Pcmap, c, True); /* WARN (rec) */ Pct[index].color.pixel = c->pixel; Pct[index].alloc_count = 1; PStrictColorLimit = s; } else { c->red = Pct[index].color.red; c->green = Pct[index].color.green; c->blue = Pct[index].color.blue; c->pixel = Pct[index].color.pixel; if (Pct[index].alloc_count < 0xffffffff) (Pct[index].alloc_count)++; } return 1; } static int get_color_index(int r, int g, int b, int is_8) { int index; if (!is_8) { r= r >> 8; g= g >> 8; b= b >> 8; } if (Pcsi.grey_bits > 0) { /* FIXME: Use other proporition ? */ index = ((r+g+b)/3) >> (8 - Pcsi.grey_bits); } else { #if 1 /* "exact" computation (corrected linear dist) */ float fr,fg,fb; int ir, ig, ib; /* map to the cube */ fr = ((float)r * (Pcsi.nr-1))/255; fg = ((float)g * (Pcsi.ng-1))/255; fb = ((float)b * (Pcsi.nb-1))/255; if (PMappingTable != NULL) { ir = (int)fr + (fr - (int)fr > 0.5); ig = (int)fg + (fg - (int)fg > 0.5); ib = (int)fb + (fb - (int)fb > 0.5); index = ir * Pcsi.ng*Pcsi.nb + ig * Pcsi.nb + ib; } else { /* found the best of the 8 linear closest points */ int lr,lg,lb,tr,tg,tb,best_dist = -1,i,d; index = 0; lr = min((int)fr+1,Pcsi.nr-1); lg = min((int)fg+1,Pcsi.ng-1); lb = min((int)fb+1,Pcsi.nb-1); for(tr =(int)fr; tr<=lr; tr++) { for(tg =(int)fg; tg<=lg; tg++) { for(tb =(int)fb; tb<=lb; tb++) { i = tr * Pcsi.ng*Pcsi.nb + tg * Pcsi.nb + tb; d = USED_DIST( r,g,b, (Pct[i].color.red>>8), (Pct[i].color.green>>8), (Pct[i].color.blue>>8)); if (best_dist == -1 || d < best_dist) { index = i; best_dist = d; } } } } /* now found the best grey */ if (Pcsi.ngrey - 2 > 0) { /* FIXME: speedup this with more than 8 grey */ int start = Pcsi.nr*Pcsi.ng*Pcsi.nb; for(i=start; i < start+Pcsi.ngrey-2; i++) { d = USED_DIST( r,g,b, (Pct[i].color.red>>8), (Pct[i].color.green>>8), (Pct[i].color.blue>>8)); if (d < best_dist) { index = i; best_dist = d; } } } return index; } #else /* approximation; faster */ index = ((r * Pcsi.nr)>>8) * Pcsi.ng*Pcsi.nb + ((g * Pcsi.ng)>>8) * Pcsi.nb + ((b * Pcsi.nb)>>8); #endif if (PMappingTable != NULL) { index = PMappingTable[index]; } } return index; } /* * Main colors allocator */ static int alloc_color_proportion(Display *dpy, Colormap cmap, XColor *c) { c->pixel = (Pixel)( ((c->red >> (16 - Pcsi.red_prec))<< Pcsi.red_shift) + ((c->green >> (16 - Pcsi.green_prec))<< Pcsi.green_shift) + ((c->blue >> (16 - Pcsi.blue_prec))<< Pcsi.blue_shift) ); return 1; } static int alloc_color_proportion_dither( Display *dpy, Colormap cmap, XColor *c, int x, int y) { /* 8 bit colors !! */ c->red = Pcsi.red_dither[ (((x + 0) & 0x3) << 10) | ((y & 0x3) << 8) | ((c->red) & 0xff)] * 257; c->green = Pcsi.green_dither[ (((x + 0) & 0x3) << 10) | ((y & 0x3) << 8) | ((c->green) & 0xff)] * 257; c->blue = Pcsi.blue_dither[ (((x + 0) & 0x3) << 10) | ((y & 0x3) << 8) | ((c->blue) & 0xff)] * 257; c->pixel = (Pixel)( ((c->red >> (16 - Pcsi.red_prec)) << Pcsi.red_shift) + ((c->green >> (16 - Pcsi.green_prec)) << Pcsi.green_shift) + ((c->blue >> (16 - Pcsi.blue_prec)) << Pcsi.blue_shift) ); return 1; } static int alloc_color_proportion_grey( Display *dpy, Colormap cmap, XColor *c) { /* FIXME: is this ok in general? */ c->pixel = ((c->red + c->green + c->blue)/3); if (Pdepth < 16) { c->pixel = c->pixel >> (16 - Pdepth); } return 1; } static int alloc_color_in_table(Display *dpy, Colormap cmap, XColor *c) { int index = get_color_index(c->red,c->green,c->blue, False); return alloc_color_in_pct(c, index); } static int alloc_color_in_table_dither( Display *dpy, Colormap cmap, XColor *c, int x, int y) { int index; /* 8 bit colors !! */ index = my_dither(x, y, c); return alloc_color_in_pct(c, index); } static int alloc_color_dynamic_no_limit( Display *dpy, Colormap cmap, XColor *c) { int r = 0; if (XAllocColor(dpy, cmap, c)) { r = 1; } else if (!alloc_color_in_cmap(c, False)) { MyXGrabServer(dpy); r = alloc_color_in_cmap(c, True); MyXUngrabServer(dpy); } else { r = 1; } if (r && Pac != NULL && (c->pixel <= (1 << Pdepth) /* always true*/)) { Pac[c->pixel].alloc_count++; Pac[c->pixel].color.red = c->red; Pac[c->pixel].color.green = c->green; Pac[c->pixel].color.blue = c->blue; Pac[c->pixel].color.pixel = c->pixel; } return r; } static int alloc_color_x( Display *dpy, Colormap cmap, XColor *c) { return XAllocColor(dpy, cmap, c); } static void free_colors_in_table( Display *dpy, Colormap cmap, Pixel *pixels, int n, unsigned long planes) { Pixel *p; int i,j,do_free; int m = 0; if (!Pct || !PUseDynamicColors) { return; } p = (Pixel *)safemalloc(n*sizeof(Pixel)); for(i= 0; i < n; i++) { do_free = 1; for(j=0; j 0) { XFreeColors(dpy, cmap, p, m, planes); } free(p); return; } static void free_colors_x( Display *dpy, Colormap cmap, Pixel *pixels, int n, unsigned long planes) { XFreeColors(dpy, cmap, pixels, n, planes); if (Pac != NULL) { int nbr_colors = (1 << Pdepth); int i; for(i= 0; i < n; i++) { if (pixels[i] <= nbr_colors) { Pac[pixels[i]].alloc_count--; } } } } /* * local function for building pallet (dynamic colors, private DirectColor * cmap) */ static XColor *build_mapping_colors(int nr, int ng, int nb) { int r, g, b, i; XColor *colors; colors = (XColor *)safemalloc(nr*ng*nb * sizeof(XColor)); i = 0; for (r = 0; r < nr; r++) { for (g = 0; g < ng; g++) { for (b = 0; b < nb; b++) { colors[i].red = r * 65535 / (nr - 1); colors[i].green = g * 65535 / (ng - 1); colors[i].blue = b * 65535 / (nb - 1); i++; } } } return colors; } static short *build_mapping_table(int nr, int ng, int nb, Bool use_named) { int size = nr*ng*nb; XColor *colors_map; short *Table; int i,j, minind; double mindst = 40000; double dst; colors_map = build_mapping_colors(nr, ng, nb); Table = (short *)safemalloc((size+1) * sizeof(short)); for(i=0; i 0) { for(i = 0; i < npixels; i++) { if (color_table[i].alloc_count) { pixels[n++] = color_table[i].color.pixel; } color_table[i].alloc_count = 0; } if (n > 0) { XFreeColors(Pdpy, Pcmap, pixels, n, 0); } } } /* FIXME: the DirectColor case */ static int get_nbr_of_free_colors(int max_check) { int check = 1; Pixel Pixels[256]; int map_entries = (Pvisual->class == DirectColor)? (1 << Pdepth):Pvisual->map_entries; if (max_check < 1) return 0; if (map_entries > 256) { max_check = 256; } max_check = (max_check > map_entries) ? map_entries:max_check; while(1) { if (XAllocColorCells( Pdpy, Pcmap, False, NULL, 0, Pixels, check)) { XFreeColors(Pdpy, Pcmap, Pixels, check, 0); check++; } else { return check-1; } if (check > max_check) { return check-1; } } return check-1; } static PColor *alloc_color_cube( int nr, int ng, int nb, int ngrey, int grey_bits, Bool do_allocate) { int r, g, b, grey, i, start_grey, end_grey; PColor *color_table; XColor color; int size; size = nr*ng*nb + ngrey + (1 << grey_bits)*(grey_bits != 0); if (grey_bits) { ngrey = (1 << grey_bits); } if (nr > 0 && ngrey > 0) { start_grey = 1; end_grey = ngrey - 1; size = size - 2; } else { start_grey = 0; end_grey = ngrey; } color_table = (PColor *)safemalloc((size+1) * sizeof(PColor)); i = 0; #if USE_GAMMA_CORECTION #define CG(x) 65535.0 * pow((x)/65535.0,1/COLOR_GAMMA) #define GG(x) 65535.0 * pow((x)/65535.0,1/GREY_GAMMA) #else #define CG(x) x #define GG(x) x #endif if (nr > 0) { for (r = 0; r < nr; r++) { for (g = 0; g < ng; g++) { for (b = 0; b < nb; b++) { color.red = CG(r * 65535 / (nr - 1)); color.green = CG(g * 65535 / (ng - 1)); color.blue = CG(b * 65535 / (nb - 1)); if (do_allocate) { if (!XAllocColor(Pdpy, Pcmap, &color)) { free_table_colors( color_table, i); free(color_table); return NULL; } color_table[i].color.pixel = color.pixel; color_table[i].alloc_count = 1; } else { color_table[i].alloc_count = 0; } color_table[i].color.red = color.red; color_table[i].color.green = color.green; color_table[i].color.blue = color.blue; i++; } } } } if (ngrey > 0) { for (grey = start_grey; grey < end_grey; grey++) { color.red = color.green = color.blue = GG(grey * 65535 / (ngrey - 1)); if (do_allocate) { if (!XAllocColor(Pdpy, Pcmap, &color)) { free_table_colors(color_table, i); free(color_table); return NULL; } color_table[i].color.pixel = color.pixel; color_table[i].alloc_count = 1; } else { color_table[i].alloc_count = 0; } color_table[i].color.red = color.red; color_table[i].color.green = color.green; color_table[i].color.blue = color.blue; i++; } } color_table[size].color.red = color_table[size-1].color.red; color_table[size].color.green = color_table[size-1].color.green; color_table[size].color.blue = color_table[size-1].color.blue; color_table[size].color.pixel = color_table[size-1].color.pixel; color_table[size].alloc_count = 0; PColorLimit = size; return color_table; } static PColor *alloc_named_ct(int *limit, Bool do_allocate) { /* First thing in base array are colors probably already in the color map because they have familiar names. I pasted them into a xpm and spread them out so that similar colors are spread out. Toward the end are some colors to fill in the gaps. Currently 61 colors in this list. */ char *color_names[] = { "black", "white", "grey", "green", "blue", "red", "cyan", "yellow", "magenta", "DodgerBlue", "SteelBlue", "chartreuse", "wheat", "turquoise", "CadetBlue", "gray87", "CornflowerBlue", "YellowGreen", "NavyBlue", "MediumBlue", "plum", "aquamarine", "orchid", "ForestGreen", "lightyellow", "brown", "orange", "red3", "HotPink", "LightBlue", "gray47", "pink", "red4", "violet", "purple", "gray63", "gray94", "plum1", "PeachPuff", "maroon", "lavender", "salmon", /* for peachpuff, orange gap */ "blue4", /* for navyblue/mediumblue gap */ "PaleGreen4", /* for forestgreen, yellowgreen gap */ "#AA7700", /* brick, no close named color */ "#11EE88", /* light green, no close named color */ "#884466", /* dark brown, no close named color */ "#CC8888", /* light brick, no close named color */ "#EECC44", /* gold, no close named color */ "#AAAA44", /* dull green, no close named color */ "#FF1188", /* pinkish red */ "#992299", /* purple */ "#CCFFAA", /* light green */ "#664400", /* dark brown*/ "#AADD99", /* light green */ "#66CCFF", /* light blue */ "#CC2299", /* dark red */ "#FF11CC", /* bright pink */ "#11CC99", /* grey/green */ "#AA77AA", /* purple/red */ "#EEBB77" /* orange/yellow */ }; int NColors = sizeof(color_names)/sizeof(char *); int i,rc; PColor *color_table; XColor color; *limit = (*limit > NColors)? NColors: *limit; color_table = (PColor *)safemalloc((*limit+1) * sizeof(PColor)); for(i=0; i<*limit; i++) { rc=XParseColor(Pdpy, Pcmap, color_names[i], &color); if (rc==0) { fprintf(stderr,"color_to_rgb: can't parse color %s," " rc %d\n", color_names[i], rc); free_table_colors(color_table, i); free(color_table); return NULL; } if (do_allocate) { if (!XAllocColor(Pdpy, Pcmap, &color)) { free_table_colors(color_table, i); free(color_table); return NULL; } color_table[i].color.pixel = color.pixel; color_table[i].alloc_count = 1; } else { color_table[i].alloc_count = 0; } color_table[i].color.red = color.red; color_table[i].color.green = color.green; color_table[i].color.blue = color.blue; } color_table[*limit].color.red = color_table[*limit-1].color.red; color_table[*limit].color.green = color_table[*limit-1].color.green; color_table[*limit].color.blue = color_table[*limit-1].color.blue; color_table[*limit].color.pixel = color_table[*limit-1].color.pixel; color_table[*limit].alloc_count = 0; PColorLimit = *limit; return color_table; } static void create_mapping_table( int nr, int ng, int nb, int ngrey, int grey_bits, Bool non_regular_pallet) { Pcsi.grey_bits = 0; /* initialize dithering colors numbers */ if (!non_regular_pallet) { /* */ Pcsi.d_nr = nr; Pcsi.d_ng = ng; Pcsi.d_nb = nb; Pcsi.d_ngrey_bits = 2; while((1< 0) { Pcsi.nr = 0; Pcsi.ng = 0; Pcsi.nb = 0; Pcsi.ngrey = 0; Pcsi.grey_bits = grey_bits; } else if (non_regular_pallet || (0&&ngrey>0)) { /* note: using these table with !used_named && ngrey>0 will * probably leads to faster image loading. But I see nothing * of significative. On the others hands not using it gives * maybe better colors approximation. */ if (PColorLimit <= 9) { Pcsi.nr = 8; Pcsi.ng = 8; Pcsi.nb = 8; Pcsi.ngrey = 0; } else { Pcsi.nr = 16; Pcsi.ng = 16; Pcsi.nb = 16; Pcsi.ngrey = 0; } PMappingTable = build_mapping_table( Pcsi.nr, Pcsi.ng, Pcsi.nb, non_regular_pallet); } else { Pcsi.nr = nr; Pcsi.ng = ng; Pcsi.nb = nb; Pcsi.ngrey = ngrey; Pcsi.grey_bits = 0; } } static void finish_ct_init( int call_type, int ctt, int nr, int ng, int nb, int ngrey, int grey_bits, Bool use_named) { if (call_type == PICTURE_CALLED_BY_FVWM) { char *env; if (PAllocTable) { ctt = PICTURE_PAllocTable + ctt; } if (PUseDynamicColors) { ctt = PICTURE_PUseDynamicColors + ctt; } if (PStrictColorLimit) { ctt = PICTURE_PStrictColorLimit + ctt; } if (use_named) { ctt = PICTURE_use_named + ctt; } else { ctt++; } env = safemalloc(PICTURE_TABLETYPE_LENGHT + 1); sprintf(env, "%i", ctt); flib_putenv("FVWM_COLORTABLE_TYPE", env); free(env); if (Pdepth <= 8) { Pac = (PColor *)safecalloc( (1 << Pdepth), sizeof(PColor)); } } if (Pct) { if (!PAllocTable && call_type == PICTURE_CALLED_BY_FVWM) { free_table_colors(Pct, PColorLimit); } create_mapping_table(nr,ng,nb,ngrey,grey_bits,use_named); } } #define PA_COLOR_CUBE (1 << 1) #define FVWM_COLOR_CUBE (1 << 2) #define PA_GRAY_SCALE (1 << 3) #define FVWM_GRAY_SCALE (1 << 4) #define ANY_COLOR_CUBE (PA_COLOR_CUBE|FVWM_COLOR_CUBE) #define ANY_GRAY_SCALE (PA_GRAY_SCALE|FVWM_GRAY_SCALE) static int PictureAllocColorTable( PictureColorLimitOption *opt, int call_type, Bool use_my_color_limit) { char *envp; int free_colors, nbr_of_color, limit, cc_nbr, i, size; int use_named_table = 0; int do_allocate = 0; int use_default = 1; int private_cmap = !(Pdefault); int color_limit; int pa_type = (Pvisual->class != GrayScale) ? PA_COLOR_CUBE : PA_GRAY_SCALE; int fvwm_type = (Pvisual->class != GrayScale) ? FVWM_COLOR_CUBE : FVWM_GRAY_SCALE; int cc[][6] = { /* {nr,ng,nb,ngrey,grey_bits,logic} */ /* 5 first for direct colors and Pdepth > 8*/ /* 8192 colors depth 13, a reasonable max for a color table */ {16, 32, 16, 0, 0, FVWM_COLOR_CUBE}, /* 4096 colors depth 12 */ {16, 16, 16, 0, 0, FVWM_COLOR_CUBE}, /* 1024 colors depth 10 */ {8, 16, 8, 0, 0, FVWM_COLOR_CUBE}, /* 512 colors depth 9 */ {8, 8, 8, 0, 0, FVWM_COLOR_CUBE}, /* 256 colors 3/3/2 standard colormap */ {8, 8, 4, 0, 0, FVWM_COLOR_CUBE}, /* 256 grey scale */ {0, 0, 0, 0, 8, ANY_GRAY_SCALE}, /* 244 Xrender XFree-4.2 */ {6, 6, 6, 30, 0, ANY_COLOR_CUBE}, /* 216 Xrender XFree-4.2,GTK/QT "default cc" */ {6, 6, 6, 0, 0, ANY_COLOR_CUBE}, /* 180 (GTK) */ {6, 6, 5, 0, 0, ANY_COLOR_CUBE}, /* 144 (GTK) */ {6, 6, 4, 0, 0, ANY_COLOR_CUBE}, /* 128 grey scale */ {0, 0, 0, 0, 7, ANY_GRAY_SCALE}, /* 125 GTK mini default cc (may change? 444) */ {5, 5, 5, 0, 0, ANY_COLOR_CUBE}, /* 100 (GTK with color limit) */ {5, 5, 4, 0, 0, ANY_COLOR_CUBE}, /* 85 Xrender XFree-4.3 */ {4, 4, 4, 23, 0, ANY_COLOR_CUBE}, /* 78 (in fact 76) a good default ??*/ {4, 4, 4, 16, 0, FVWM_COLOR_CUBE}, /* 70 a good default ?? */ {4, 4, 4, 8, 0, ANY_COLOR_CUBE}, /* 68 a good default ?? */ {4, 4, 4, 6, 0, ANY_COLOR_CUBE}, /* 64 Xrender XFree-4.3 (GTK wcl) */ {4, 4, 4, 0, 0, ANY_COLOR_CUBE}, /* 64 grey scale */ {0, 0, 0, 0, 6, ANY_GRAY_SCALE}, /* 54, maybe a good default? */ {4, 4, 3, 8, 0, FVWM_COLOR_CUBE}, /* 48, (GTK wcl) no grey but ok */ {4, 4, 3, 0, 0, FVWM_COLOR_CUBE}, /* 32, 2/2/1 standard colormap */ {4, 4, 2, 0, 0, FVWM_COLOR_CUBE}, /* 32 xrender xfree-4.2 */ {0, 0, 0, 0, 6, ANY_GRAY_SCALE}, /* 29 */ {3, 3, 3, 4, 0, FVWM_COLOR_CUBE}, /* 27 (xrender in depth 6&7(hypo) GTK wcl) */ {3, 3, 3, 0, 0, FVWM_COLOR_CUBE|PA_COLOR_CUBE*(Pdepth<8)}, /* 16 grey scale */ {0, 0, 0, 0, 4, FVWM_GRAY_SCALE}, /* 10 */ {2, 2, 2, 4, 0, FVWM_COLOR_CUBE}, /* 8 (xrender/qt/gtk wcl) */ {2, 2, 2, 0, 0, FVWM_COLOR_CUBE}, /* 8 grey scale Xrender depth 4 and XFree-4.3 */ {0, 0, 0, 0, 3, FVWM_GRAY_SCALE|PA_GRAY_SCALE*(Pdepth<5)}, /* 4 grey scale*/ {0, 0, 0, 0, 2, FVWM_GRAY_SCALE|FVWM_COLOR_CUBE|PA_COLOR_CUBE*(Pdepth<4)}, /* 2 */ {0, 0, 0, 0, 1, FVWM_COLOR_CUBE|FVWM_GRAY_SCALE} }; cc_nbr = sizeof(cc)/(sizeof(cc[0])); /* set up default */ PStrictColorLimit = 0; PUseDynamicColors = 1; PAllocTable = 0; use_named_table = False; color_limit = 0; use_default = True; /* use fvwm color limit */ if (!use_my_color_limit && (envp = getenv("FVWM_COLORTABLE_TYPE")) != NULL) { int nr = 0, ng = 0, nb = 0, grey_bits = 0, ngrey = 0; int ctt = atoi(envp); if (ctt >= PICTURE_PAllocTable) { ctt -= PICTURE_PAllocTable; PAllocTable = 1; /* not useful for a module !*/ } if (ctt >= PICTURE_PUseDynamicColors) { PUseDynamicColors = 1; ctt -= PICTURE_PUseDynamicColors; } if (ctt >= PICTURE_PStrictColorLimit) { PStrictColorLimit = 1; ctt -= PICTURE_PStrictColorLimit; } if (ctt >= PICTURE_use_named) { ctt -= PICTURE_use_named; Pct = alloc_named_ct(&ctt, False); use_named_table = True; } else if (ctt == 0) { /* depth <= 8 and no colors limit ! */ PColorLimit = 0; return 0; } else if (ctt <= cc_nbr) { ctt--; Pct = alloc_color_cube( cc[ctt][0], cc[ctt][1], cc[ctt][2], cc[ctt][3], cc[ctt][4], False); nr = cc[ctt][0]; ng = cc[ctt][1]; nb = cc[ctt][2]; ngrey = cc[ctt][3]; grey_bits = cc[ctt][4]; } if (Pct != NULL) { /* should always happen */ finish_ct_init( call_type, ctt, nr, ng, nb, ngrey, grey_bits, use_named_table); return PColorLimit; } } nbr_of_color = (1 << Pdepth); color_limit = 0; /* parse the color limit env variable */ if ((envp = getenv("FVWM_COLORLIMIT")) != NULL) { char *rest, *l; rest = GetQuotedString(envp, &l, ":", NULL, NULL, NULL); if (l && *l != '\0' && (color_limit = atoi(l)) >= 0) { use_default = 0; } if (l != NULL) { free(l); } if (color_limit == 9 || color_limit == 61) { use_named_table = 1; } if (rest && *rest != '\0') { if (rest[0] == '1') { PStrictColorLimit = 1; } else { PStrictColorLimit = 0; } if (strlen(rest) > 1 && rest[1] == '1') { use_named_table = 1; } else { use_named_table = 0; } if (strlen(rest) > 2 && rest[2] == '1') { PUseDynamicColors = 1; } else { PUseDynamicColors = 0; } if (strlen(rest) > 3 && rest[3] == '1') { PAllocTable = 1; } else { PAllocTable = 0; } } } else if (opt != NULL) /* use the option */ { if (opt->color_limit > 0) { use_default = 0; color_limit = opt->color_limit; } if (color_limit == 9 || color_limit == 61) { use_named_table = 1; } if (opt->strict > 0) { PStrictColorLimit = 1; } else if (opt->strict == 0) { PStrictColorLimit = 0; } if (opt->use_named_table > 0) { use_named_table = 1; } else if (opt->use_named_table == 0) { use_named_table = 0; } if (opt->not_dynamic > 0) { PUseDynamicColors = 0; } else if (opt->not_dynamic == 0) { PUseDynamicColors = 0; } if (opt->allocate > 0) { PAllocTable = 1; } else if (opt->allocate == 0) { PAllocTable = 0; } } if (color_limit <= 0) { use_default = 1; color_limit = nbr_of_color; } /* first try to see if we have a "pre-allocated" color cube. * The bultin RENDER X extension pre-allocate a color cube plus * some grey's (xc/programs/Xserver/render/miindex) * See gdk/gdkrgb.c for the cubes used by gtk+-2, 666 is the default, * 555 is the minimal cc (this may change): if gtk cannot allocate * the 555 cc (or better) a private cmap is used. * for qt-3: see src/kernel/{qapplication.cpp,qimage.cpp,qcolor_x11.c} * the 666 cube is used by default (with approx in the cmap if some * color allocation fail), and some qt app may accept an * --ncols option to limit the nbr of colors, then some "2:3:1" * proportions color cube are used (222, 232, ..., 252, 342, ..., 362, * 452, ...,693, ...) * imlib2 try to allocate the 666 cube if this fail it try more * exotic table (see rend.c and rgba.c) */ i = 0; free_colors = 0; if (Pdepth <= 8 && !private_cmap && use_default && i < cc_nbr && Pct == NULL && (Pvisual->class & 1)) { free_colors = get_nbr_of_free_colors(nbr_of_color); } while(Pdepth <= 8 && !private_cmap && use_default && i < cc_nbr && Pct == NULL && (Pvisual->class & 1)) { size = cc[i][0]*cc[i][1]*cc[i][2] + cc[i][3] - 2*(cc[i][3] > 0) + (1 << cc[i][4])*(cc[i][4] != 0); if (size > nbr_of_color || !(cc[i][5] & pa_type)) { i++; continue; } if (free_colors <= nbr_of_color - size) { Pct = alloc_color_cube( cc[i][0], cc[i][1], cc[i][2], cc[i][3], cc[i][4], True); } if (Pct != NULL) { if (free_colors <= get_nbr_of_free_colors(nbr_of_color)) { /* done */ } else { free_table_colors(Pct, PColorLimit); free(Pct); Pct = NULL; } } i++; } if (Pct != NULL) { PUseDynamicColors = 0; PAllocTable = 1; Pcsi.pre_allocated_pallet = 1; i = i - 1; finish_ct_init( call_type, i, cc[i][0], cc[i][1], cc[i][2], cc[i][3], cc[i][4], 0); return PColorLimit; } /* * now use "our" table */ limit = (color_limit >= nbr_of_color)? nbr_of_color:color_limit; if (use_default && !private_cmap) { /* XRender cvs default: */ #if 0 if (limit > 100) limit = nbr_of_color/3; else limit = nbr_of_color/2; /* depth 8: 85 */ /* depth 4: 8 */ #endif if (limit > 256) { /* direct colors & Pdepth > 8 */ if (Pdepth >= 16) { limit = 8192; } else if (Pdepth >= 15) { limit = 4096; } else { limit = 512; } } else if (limit == 256) { if (Pvisual->class == GrayScale) { limit = 64; } else if (Pvisual->class == DirectColor) { limit = 32; } else { limit = 68; /* candidate: * limit = 54; 4x4x3 + 6 grey * limit = 61 (named table) * limit = 85 current XRender default 4cc + 21 * limit = 76 future(?) XRender default 4cc + 16 * limit = 68 4x4x4 + 4 * limit = 64 4x4x4 + 0 */ } } else if (limit == 128 || limit == 64) { if (Pvisual->class == GrayScale) { limit = 32; } else { limit = 31; } } else if (limit >= 16) { if (Pvisual->class == GrayScale) { limit = 8; } else { limit = 10; } } else if (limit >= 8) { limit = 4; } else { limit = 2; } } if (limit < 2) { limit = 2; } if (Pvisual->class == DirectColor) { /* humm ... Any way this case should never happen in real life: * DirectColor default colormap! */ PUseDynamicColors = 0; PAllocTable = 1; PStrictColorLimit = 1; } if (PAllocTable) { do_allocate = 1; } else { do_allocate = 0; } /* use the named table ? */ if (use_named_table) { i = limit; while(Pct == NULL && i >= 2) { Pct = alloc_named_ct(&i, do_allocate); i--; } } if (Pct != NULL) { finish_ct_init( call_type, PColorLimit, 0, 0, 0, 0, 0, 1); return PColorLimit; } /* color cube or regular grey scale */ i = 0; while(i < cc_nbr && Pct == NULL) { if ((cc[i][5] & fvwm_type) && cc[i][0]*cc[i][1]*cc[i][2] + cc[i][3] - 2*(cc[i][3] > 0) + (1 << cc[i][4])*(cc[i][4] != 0) <= limit) { Pct = alloc_color_cube( cc[i][0], cc[i][1], cc[i][2], cc[i][3], cc[i][4], do_allocate); } i++; } if (Pct != NULL) { i = i-1; finish_ct_init( call_type, i, cc[i][0], cc[i][1], cc[i][2], cc[i][3], cc[i][4], 0); return PColorLimit; } /* I do not think we can be here */ Pct = alloc_color_cube(0, 0, 0, 0, 1, False); finish_ct_init(call_type, cc_nbr-1, 0, 0, 0, 0, 1, 0); if (Pct == NULL) { fprintf(stderr, "[fvwm] ERR -- Cannot get Black and White. exiting!\n"); exit(2); } return PColorLimit; } /* * Allocation of a private DirectColor cmap this is broken for depth > 16 */ static Bool alloc_direct_colors(int *limit, Bool use_my_color_limit) { unsigned long nr,ng,nb,r,g,b,cr,cg,cf,pr,pg; unsigned long red_mask, green_mask, blue_mask; XColor *colors; if (Pdepth <= 16) { red_mask = Pvisual->red_mask; green_mask = Pvisual->green_mask; blue_mask = Pvisual->blue_mask; } else { /* Use a standard depth 16 colormap. This is broken FIXME! */ red_mask = 0xf800; green_mask = 0x7e0; blue_mask = 0x1f; } decompose_mask( red_mask, &Pcsi.red_shift, &Pcsi.red_prec); decompose_mask( green_mask, &Pcsi.green_shift, &Pcsi.green_prec); decompose_mask( blue_mask, &Pcsi.blue_shift, &Pcsi.blue_prec); if (!use_my_color_limit) { /* colors allocated by fvwm we can return */ return 1; } nr = 1 << Pcsi.red_prec; ng = 1 << Pcsi.green_prec; nb = 1 << Pcsi.blue_prec; colors = (XColor *)safemalloc(nb*sizeof(XColor)); cf = DoRed|DoBlue|DoGreen; for (r=0; r> (16 - Pcsi.red_prec)) << Pcsi.red_shift; for (g = 0; g < ng; g++) { cg = g * 65535 / (ng - 1); pg = (cg >> (16 - Pcsi.green_prec)) << Pcsi.green_shift; for (b = 0; b < nb; b++) { colors[b].flags = cf; colors[b].red = cr; colors[b].green = cg; colors[b].blue = b * 65535 / (nb - 1); colors[b].pixel = (Pixel)(pr + pg + ((colors[b].blue >> (16 - Pcsi.blue_prec)) << Pcsi.blue_shift)); } XStoreColors(Pdpy, Pcmap, colors, nb); } } free(colors); return 1; } /* * Init the table for Static Colors */ static void init_static_colors_table(void) { XColor colors[256]; int i; int nbr_of_colors = min(256, (1 << Pdepth)); PColorLimit = nbr_of_colors; Pct = (PColor *)safemalloc((nbr_of_colors+1) * sizeof(PColor)); for (i = 0; i < nbr_of_colors; i++) { colors[i].pixel = Pct[i].color.pixel = i; } XQueryColors(Pdpy, Pcmap, colors, nbr_of_colors); for (i = 0; i < nbr_of_colors; i++) { Pct[i].color.red = colors[i].red; Pct[i].color.green = colors[i].green; Pct[i].color.blue = colors[i].blue; Pct[i].alloc_count = 1; } Pct[PColorLimit].color.red = Pct[PColorLimit-1].color.red; Pct[PColorLimit].color.green = Pct[PColorLimit-1].color.green; Pct[PColorLimit].color.blue = Pct[PColorLimit-1].color.blue; Pct[PColorLimit].alloc_count = 1; create_mapping_table(0, 0, 0, 0, 0, True); } /* * misc local functions */ static void print_colormap(Colormap cmap) { XColor colors[256]; int i; int nbr_of_colors = max(256, (1 << Pdepth)); for (i = 0; i < nbr_of_colors; i++) { colors[i].pixel = i; } XQueryColors(Pdpy, cmap, colors, nbr_of_colors); for (i = 0; i < nbr_of_colors; i++) { fprintf(stderr," rgb(%.3i): %.3i/%.3i/%.3i\n", i, colors[i].red >> 8, colors[i].green >> 8, colors[i].blue >> 8); } } /* ---------------------------- interface functions ------------------------ */ int PictureAllocColor(Display *dpy, Colormap cmap, XColor *c, int no_limit) { if (PStrictColorLimit && Pct != NULL) { no_limit = 0; } if (no_limit) { return Pcsi.alloc_color_no_limit(dpy, cmap, c); } else { return Pcsi.alloc_color(dpy, cmap, c); } return 0; } int PictureAllocColorAllProp( Display *dpy, Colormap cmap, XColor *c, int x, int y, Bool no_limit, Bool is_8, Bool do_dither) { if (!no_limit && do_dither && Pcsi.alloc_color_dither != NULL) { if (!is_8) { c->red = c->red >> 8; c->green = c->green >> 8; c->blue = c->blue >> 8; } return Pcsi.alloc_color_dither(dpy, cmap, c, x, y); } else { if (is_8) { c->red = c->red << 8; c->green = c->green << 8; c->blue = c->blue << 8; } return PictureAllocColor(dpy, cmap, c, False); } return 0; } int PictureAllocColorImage( Display *dpy, PictureImageColorAllocator *pica, XColor *c, int x, int y) { int r; r = PictureAllocColorAllProp( dpy, pica->cmap, c, x, y, pica->no_limit, pica->is_8, pica->dither); if (r && pica->pixels_table != NULL && pica->pixels_table_size && c->pixel < pica->pixels_table_size) { pica->pixels_table[c->pixel]++; } return r; } PictureImageColorAllocator *PictureOpenImageColorAllocator( Display *dpy, Colormap cmap, int x, int y, Bool no_limit, Bool do_not_save_pixels, int dither, Bool is_8) { PictureImageColorAllocator *pica; Bool do_save_pixels = False; pica = (PictureImageColorAllocator *)safemalloc( sizeof(PictureImageColorAllocator)); if (Pdepth <= 8 && !do_not_save_pixels && (Pvisual->class & 1) && ((PUseDynamicColors && Pct) || no_limit)) { int s = 1 << Pdepth; pica->pixels_table = (unsigned long *)safecalloc( s, sizeof(unsigned long)); pica->pixels_table_size = s; do_save_pixels = True; } if (!do_save_pixels) { pica->pixels_table = NULL; pica->pixels_table_size = 0; } pica->is_8 = is_8; if (dither && Pdepth <= 16) { pica->dither = dither; } else { pica->dither = dither; } pica->no_limit = no_limit; pica->cmap = cmap; return pica; } void PictureCloseImageColorAllocator( Display *dpy, PictureImageColorAllocator *pica, int *nalloc_pixels, Pixel **alloc_pixels, Bool *no_limit) { if (nalloc_pixels) { *nalloc_pixels = 0; } if (alloc_pixels != NULL) { *alloc_pixels = NULL; } if (no_limit != NULL) { *no_limit = 0; } if (pica->pixels_table) { int i,j; int k = 0, l = 0; unsigned int np = 0; int free_num = 0; Pixel *free_pixels = NULL; Pixel *save_pixels = NULL; for(i = 0; i < pica->pixels_table_size; i++) { if (pica->pixels_table[i]) { free_num += (pica->pixels_table[i]-1); np++; } } if (free_num) { free_pixels = (Pixel *)safemalloc( free_num * sizeof(Pixel)); } if (np && nalloc_pixels != NULL && alloc_pixels != NULL) { save_pixels = (Pixel *)safemalloc(np * sizeof(Pixel)); } for(i = 0; i < pica->pixels_table_size; i++) { if (pica->pixels_table[i]) { if (save_pixels) { save_pixels[k++] = i; } for(j=1; j < pica->pixels_table[i]; j++) { free_pixels[l++] = i; } } } if (free_num) { PictureFreeColors( dpy, pica->cmap, free_pixels, free_num, 0, pica->no_limit); free(free_pixels); } if (nalloc_pixels != NULL && alloc_pixels != NULL) { *nalloc_pixels = np; *alloc_pixels = save_pixels; if (no_limit != NULL) { *no_limit = pica->no_limit; } } else if (save_pixels) { free(save_pixels); } free(pica->pixels_table); } free(pica); return; } void PictureFreeColors( Display *dpy, Colormap cmap, Pixel *pixels, int n, unsigned long planes, Bool no_limit) { if (no_limit) { if (Pcsi.free_colors_no_limit != NULL) { Pcsi.free_colors_no_limit( dpy, cmap, pixels, n, planes); } } else { if (Pcsi.free_colors != NULL) { Pcsi.free_colors(dpy, cmap, pixels, n, planes); } } return; } Pixel PictureGetNextColor(Pixel p, int n) { int i; XColor c; if (n >= 0) n = 1; else n = -1; if (Pct == NULL) { return p; } for(i=0; i 0) { c = Pct[0].color; alloc_color_in_pct(&c, 0); return Pct[0].color.pixel; } else { c = Pct[i+n].color; alloc_color_in_pct(&c, i+n); return Pct[i+n].color.pixel; } } } return p; } /* Replace the color in my_color by the closest matching color from base_table */ void PictureReduceColorName(char **my_color) { int index; XColor rgb; /* place to calc rgb for each color in xpm */ if (!XpmSupport) return; if (!strcasecmp(*my_color,"none")) { return; /* do not substitute the "none" color */ } if (!XParseColor(Pdpy, Pcmap, *my_color, &rgb)) { fprintf(stderr,"color_to_rgb: can't parse color %s\n", *my_color); } index = get_color_index(rgb.red,rgb.green,rgb.blue, False); /* Finally: replace the color string by the newly determined color * string */ free(*my_color); /* free old color */ /* area for new color */ *my_color = safemalloc(8); sprintf(*my_color,"#%x%x%x", Pct[index].color.red >> 8, Pct[index].color.green >> 8, Pct[index].color.blue >> 8); /* put it there */ return; } Bool PictureDitherByDefault(void) { if (Pct != NULL) { return True; } return False; } Bool PictureUseBWOnly(void) { if (Pdepth < 2 || (PStrictColorLimit && PColorLimit == 2)) { return True; } return False; } int PictureInitColors( int call_type, Bool init_color_limit, PictureColorLimitOption *opt, Bool use_my_color_limit, Bool init_dither) { Bool dither_ok = False; switch (Pvisual->class) { case DirectColor: /* direct colors is more or less broken */ decompose_mask( Pvisual->red_mask, &Pcsi.red_shift, &Pcsi.red_prec); decompose_mask( Pvisual->green_mask, &Pcsi.green_shift, &Pcsi.green_prec); decompose_mask( Pvisual->blue_mask, &Pcsi.blue_shift, &Pcsi.blue_prec); Pcsi.alloc_color_no_limit = alloc_color_proportion; Pcsi.alloc_color = alloc_color_proportion; Pcsi.alloc_color_dither = alloc_color_proportion_dither; Pcsi.free_colors_no_limit = NULL; Pcsi.free_colors = NULL; PColorLimit = 0; break; case TrueColor: decompose_mask( Pvisual->red_mask, &Pcsi.red_shift, &Pcsi.red_prec); decompose_mask( Pvisual->green_mask, &Pcsi.green_shift, &Pcsi.green_prec); decompose_mask( Pvisual->blue_mask, &Pcsi.blue_shift, &Pcsi.blue_prec); Pcsi.alloc_color_no_limit = alloc_color_proportion; Pcsi.alloc_color = alloc_color_proportion; Pcsi.free_colors_no_limit = NULL; Pcsi.free_colors = NULL; PColorLimit = 0; if (init_dither && (Pdepth == 15 || Pdepth == 16)) { dither_ok = my_dither_depth_15_16_init(); } if (dither_ok) { Pcsi.alloc_color_dither = alloc_color_proportion_dither; } else { Pcsi.alloc_color_dither = NULL; } break; case StaticColor: if (0 && Pvisual->red_mask != 0 && Pvisual->green_mask != 0 && Pvisual->blue_mask != 0) { decompose_mask( Pvisual->red_mask, &Pcsi.red_shift, &Pcsi.red_prec); decompose_mask( Pvisual->green_mask, &Pcsi.green_shift, &Pcsi.green_prec); decompose_mask( Pvisual->blue_mask, &Pcsi.blue_shift, &Pcsi.blue_prec); Pcsi.alloc_color_no_limit = alloc_color_proportion; Pcsi.alloc_color = alloc_color_proportion; PColorLimit = 0; } else { if (init_color_limit) { Pcsi.alloc_color = alloc_color_in_table; Pcsi.alloc_color_dither = alloc_color_in_table_dither; Pcsi.alloc_color_no_limit = alloc_color_x; init_static_colors_table(); } else { Pcsi.alloc_color = alloc_color_x; Pcsi.alloc_color_dither = NULL; Pcsi.alloc_color_no_limit = alloc_color_x; } } Pcsi.free_colors_no_limit = NULL; Pcsi.free_colors = NULL; break; case StaticGray: /* FIXME: we assume that we have a regular grey ramp */ if (0) { Pcsi.alloc_color_no_limit = alloc_color_proportion_grey; Pcsi.alloc_color = alloc_color_proportion; PColorLimit = 0; } else { if (init_color_limit) { Pcsi.alloc_color = alloc_color_in_table; Pcsi.alloc_color_dither = alloc_color_in_table_dither; Pcsi.alloc_color_no_limit = alloc_color_x; init_static_colors_table(); } else { Pcsi.alloc_color = alloc_color_x; Pcsi.alloc_color_dither = NULL; Pcsi.alloc_color_no_limit = alloc_color_x; } } Pcsi.free_colors_no_limit = NULL; Pcsi.free_colors = NULL; break; case PseudoColor: case GrayScale: default: Pcsi.alloc_color_no_limit = alloc_color_dynamic_no_limit; Pcsi.free_colors_no_limit = free_colors_x; break; } if (!(Pvisual->class & 1)) { /* static classes */ PUseDynamicColors = 0; if (call_type == PICTURE_CALLED_BY_FVWM && getenv("FVWM_COLORTABLE_TYPE") != NULL) { flib_putenv("FVWM_COLORTABLE_TYPE", ""); } return PColorLimit; } /* dynamic classes */ if (!Pdefault && Pvisual->class == DirectColor) { PColorLimit = 0; PUseDynamicColors = 0; alloc_direct_colors(0, use_my_color_limit); if (call_type == PICTURE_CALLED_BY_FVWM && getenv("FVWM_COLORTABLE_TYPE") != NULL) { flib_putenv("FVWM_COLORTABLE_TYPE", ""); } return 0; } if (init_color_limit) { Pcsi.alloc_color = alloc_color_in_table; Pcsi.alloc_color_dither = alloc_color_in_table_dither; PictureAllocColorTable(opt, call_type, use_my_color_limit); if (PUseDynamicColors) { Pcsi.free_colors = free_colors_in_table; } else { Pcsi.free_colors = NULL; } } else { Pcsi.alloc_color = alloc_color_dynamic_no_limit; Pcsi.free_colors = free_colors_x; Pcsi.alloc_color_dither = NULL; } return PColorLimit; } void PicturePrintColorInfo(int verbose) { unsigned long nbr_of_colors = 1 << Pdepth; fprintf(stderr, "fvwm info on colors\n"); fprintf(stderr, " Visual ID: 0x%x, Default?: %s, Class: ", (int)(Pvisual->visualid), (Pdefault)? "Yes":"No"); if (Pvisual->class == TrueColor) { fprintf(stderr,"TrueColor"); } else if (Pvisual->class == PseudoColor) { fprintf(stderr,"PseudoColor"); } else if (Pvisual->class == DirectColor) { fprintf(stderr,"DirectColor"); } else if (Pvisual->class == StaticColor) { fprintf(stderr,"StaticColor"); } else if (Pvisual->class == GrayScale) { fprintf(stderr,"GrayScale"); } else if (Pvisual->class == StaticGray) { fprintf(stderr,"StaticGray"); } fprintf(stderr, "\n"); fprintf(stderr, " Depth: %i, Number of colors: %lu", Pdepth, (unsigned long)nbr_of_colors); if (Pct != NULL) { fprintf(stderr,"\n Pallet with %i colors", PColorLimit); if (Pvisual->class & 1) { fprintf(stderr,", Number of free colors: %i\n", get_nbr_of_free_colors((1 << Pdepth))); fprintf(stderr, " Auto Detected: %s, Strict: %s, Allocated: %s," " Dynamic: %s\n", (Pcsi.pre_allocated_pallet)? "Yes":"No", (PStrictColorLimit)? "Yes":"No", (PAllocTable)? "Yes":"No", (PUseDynamicColors)? "Yes":"No"); } else { fprintf(stderr," (default colormap)\n"); } if (PColorLimit <= 256) { int i; int count = 0; int count_alloc = 0; if (verbose) { fprintf(stderr," The fvwm colors table:\n"); } for (i = 0; i < PColorLimit; i++) { if (verbose) { fprintf( stderr, " rgb:%.3i/%.3i/%.3i\t%lu\n", Pct[i].color.red >> 8, Pct[i].color.green >> 8, Pct[i].color.blue >> 8, Pct[i].alloc_count); } if (Pct[i].alloc_count) { count++; } } if ((Pvisual->class & 1) && Pac != NULL) { if (verbose) { fprintf(stderr," fvwm colors not in" " the table:\n"); } for(i=0; i < nbr_of_colors; i++) { int j = 0; Bool found = False; if (!Pac[i].alloc_count) continue; while(j < PColorLimit && !found) { if (i == Pct[j].color.pixel) { found = True; } j++; } if (found) continue; count_alloc++; if (verbose) { fprintf( stderr, " rgb:" "%.3i/%.3i/%.3i\t%lu\n", Pac[i].color.red >> 8, Pac[i].color.green >> 8, Pac[i].color.blue >> 8, Pac[i].alloc_count); } } if (verbose && count_alloc == 0) { if (verbose) { fprintf(stderr," None\n"); } } } if (Pvisual->class & 1) { fprintf(stderr, " Number of colours used by fvwm:\n"); fprintf(stderr, " In the table: %i\n", count); fprintf( stderr, " Out of the table: %i\n", count_alloc); fprintf(stderr, " Total: %i\n", count_alloc+count); } } } else { if (Pvisual->class == DirectColor) { fprintf(stderr, ", Pseudo Pallet with: %i colors\n", (1 << Pcsi.red_prec)*(1 << Pcsi.green_prec)* (1 << Pcsi.blue_prec)); } else { fprintf(stderr, ", No Pallet (static colors)\n"); } fprintf(stderr, " red: %i, green: %i, blue %i\n", 1 << Pcsi.red_prec, 1 << Pcsi.green_prec, 1 << Pcsi.blue_prec); if (verbose && Pdepth <= 8) { if (Pvisual->class == DirectColor) { fprintf(stderr, " Colormap:\n"); } else { fprintf(stderr, " Static Colormap used by fvwm:\n"); } print_colormap(Pcmap); } } if (Pdepth <= 8 && verbose >= 2) { fprintf(stderr,"\n Default Colormap:\n"); print_colormap(DefaultColormap(Pdpy,DefaultScreen(Pdpy))); } } fvwm-2.6.5.orig/libs/gravity.h0000644000175000017500000000520211454107601014407 0ustar vwcvwc/* -*-c-*- */ #ifndef GRAVITY_H #define GRAVITY_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef enum { DIR_NONE = -1, DIR_N = 0, DIR_E = 1, DIR_S = 2, DIR_W = 3, DIR_MAJOR_MASK = 3, DIR_NE = 4, DIR_SE = 5, DIR_SW = 6, DIR_NW = 7, DIR_MINOR_MASK = 7, DIR_MASK = 7, DIR_C = 8, DIR_ALL_MASK = 8 } direction_t; typedef enum { MULTI_DIR_NONE = 0, MULTI_DIR_FIRST = (1 << DIR_N), MULTI_DIR_N = (1 << DIR_N), MULTI_DIR_E = (1 << DIR_E), MULTI_DIR_S = (1 << DIR_S), MULTI_DIR_W = (1 << DIR_W), MULTI_DIR_NE = (1 << DIR_NE), MULTI_DIR_SE = (1 << DIR_SE), MULTI_DIR_SW = (1 << DIR_SW), MULTI_DIR_NW = (1 << DIR_NW), MULTI_DIR_ALL = ((1 << (DIR_MASK + 1)) - 1), MULTI_DIR_C = (1 << DIR_C), MULTI_DIR_LAST = (1 << DIR_ALL_MASK) } multi_direction_t; typedef enum { ROTATION_0 = 0, ROTATION_90 = 1, ROTATION_180 = 2, ROTATION_270 = 3, ROTATION_MASK = 3 } rotation_t; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void gravity_get_offsets(int grav, int *xp,int *yp); void gravity_move(int gravity, rectangle *rect, int xdiff, int ydiff); void gravity_resize(int gravity, rectangle *rect, int wdiff, int hdiff); void gravity_move_resize_parent_child( int child_gravity, rectangle *parent_diff_r, rectangle *child_r); direction_t gravity_grav_to_dir( int grav); int gravity_dir_to_grav( direction_t dir); int gravity_combine_xy_grav( int grav_x, int grav_y); void gravity_split_xy_grav( int *ret_grav_x, int *ret_grav_y, int in_grav); int gravity_combine_xy_dir( int dir_x, int dir_y); void gravity_split_xy_dir( int *ret_dir_x, int *ret_dir_y, int in_dir); int gravity_override_dir( int dir_orig, int dir_mod); int gravity_dir_to_sign_one_axis( direction_t dir); direction_t gravity_parse_dir_argument( char *action, char **ret_action, direction_t default_ret); char *gravity_dir_to_string(direction_t dir, char *default_str); multi_direction_t gravity_parse_multi_dir_argument( char *action, char **ret_action); void gravity_get_next_multi_dir(int dir_set, multi_direction_t *dir); direction_t gravity_multi_dir_to_dir(multi_direction_t mdir); void gravity_rotate_xy(rotation_t rot, int x, int y, int *ret_x, int *ret_y); rotation_t gravity_add_rotations(rotation_t rot1, rotation_t rot2); #endif /* GRAVITY_H */ fvwm-2.6.5.orig/INSTALL.fvwm0000644000175000017500000004556710656151546013663 0ustar vwcvwc -*- text -*- If you only need an information about all supported features skip to the "Supported Features" and the following sections. VMS users: ignore this file, and follow the instructions in vms/README instead. This file details only configuration options peculiar to fvwm. Please read the generic instructions in INSTALL first. Important Note! =============== The `configure' script keeps a cache of information it discovers, so that subsequent invocations of `configure' will be faster. However, if you update information on your system (such as install or upgrade an optional library like Xpm, etc. [see below]) the cache may contain outdated information; this can lead to confusing behavior during subsequent `configure' invocations or builds. If you're not familiar with how this works it might be safest to remove the cache each time before running `configure'; you can either do a simple: $ rm -f config.cache Or you may feel more comfortable with a complete cleaning: $ make distclean What gets installed, and where ============================== * fvwm is installed into ${prefix}/bin * a couple of utilities are also installed into ${prefix}/bin; this includes fvwm-config, fvwm-menu-*, fvwm-bug, fvwm-convert-*, fvwm-root, FvwmCommand * all FvwmModule modules are installed into ${libexecdir}/fvwm/${VERSION} * all manual pages are installed into ${mandir}/man1 * some configuration files are installed into ${datadir}/fvwm, for example, FvwmForm & FvwmScript configurations and others * perl library is installed into ${datadir}/fvwm/perllib where VERSION is the version string of fvwm, typically something like "2.4.0". No other files are installed. There are sample fvwm/config files which you may copy manually to ${datadir}/fvwm, see below. Unless you used configure options, * ${prefix} is /usr/local * ${bindir} is ${prefix}/bin * ${mandir} is ${prefix}/man * ${libexecdir} is ${prefix}/libexec * ${datadir} is ${prefix}/share * ${sysconfdir} is ${prefix}/etc Thus the default locations are: /usr/local/bin, /usr/local/man/man1, /usr/local/libexec/fvwm/VERSION, and /usr/local/share/fvwm for the fvwm executables, man pages, modules, and configuration files, respectively. Note that by default, none of the executables are stripped when they're installed. If you'd like them to be, run `make install-strip' instead of `make install'. Note that due to a bug in the older versions of autoconf/automake this may fail in some of the modules directories trying to strip shell scripts. We recommend that you run `make -k install-strip', which will continue past the failures. Configuration File ================== Fvwm configures itself at runtime by reading one or more configuration files. The default locations of the config file are ~/.fvwm/config and /usr/local/share/fvwm/config (if the user's file is not found). The .fvwm2rc file names used in the past are supported too. Sample configuration files may be found in the sample.fvwmrc directory. To avoid clobbering the current configuration, no configuration file is installed by default. You must copy it manually the first time fvwm is installed. But this is fully optional, fvwm can run without any configuration file and has an ability to install some configurations into the user home directory (precisely, FVWM_USERDIR). Other system-wide configuration files are located in /usr/local/share/fvwm (also called FVWM_DATADIR) that can be used directly from the configuration directory. See the FvwmForm man page for some examples. For users starting fvwm without a fvwm/config or fvwm/.fvwm2rc file, there are built-in dialogs that can copy files from the configuration directory into the users home directory to create the users startup file. See the fvwm man page under "INITIALIZATION". Bug Reports =========== One of the installed scripts is fvwm-bug that allows users to send bug reports to either the local address or the developer address or both. The local email address defaults to the installer login, probably root. To override this default, set $FVWM_BUGADDR before running ./configure. There is also a web based bug reporting system, see the Home Page. CPP === One of fvwm's modules, FvwmCpp, requires a C preprocessor program. The configuration will look in various common places for cpp. If one is not found, FvwmCpp will still compile but you'll need to invoke it with the -cpppath option to tell it where to find cpp. FvwmCpp will exit with an error message if no path to cpp is known. You can tell configure what cpp to use by setting the FVWM_CPP environment variable before invoking configure: $ FVWM_CPP=/my/special/cpp ./configure Supported Features ================== Fvwm has several compile time features that may be switched on and off using ./configure. To query what your installed fvwm supports run one of: % fvwm-config --info % fvwm-config --supports Please run './configure --help' to see a list of all option. The sections below explain these options. Line shown by configure Feature name ./configure options --------------------------------------------------------------------------- With Asian bi-direct. text support? bidi --disable-bidi With Gettext Native Lang Support gettext --with-intl-* With GTK+ required for FvwmGtk? gtk --with-gtk-* With GDK image support in FvwmGtk? gdk-imlib --with-imlib-* With GNOME libs support in FvwmGtk? gnome-libs --with-gnome With PNG image support? png --with-png-* With ReadLine sup. in FvwmConsole? readline --with-readline-* With RPlay support in FvwmEvent? rplay --with-rpm-* With Shaped window support? shape --disable-shape With With Shared memory for XImage? shm --disable-shm With Session Management support? sm --disable-sm With Mouse strokes (gestures)? stroke --with-stroke-* With SVG image support? rsvg --disable-rsvg With Xcursor support? xcursor --disable-xcursor With Xinerama multi-head support? xinerama --disable-xinerama With Xft anti-alias font support? xft --enable-xft --with-xft-* With XPM image support? xpm --with-xpm-* With Xrender image support? xrender --disable-xrender Perl library directory: perllib --disable-perllib None of these features are essential, but some are nice to have. It is safe *not* to compile in the following features: bidi (not needed if you don't plan to read Arabic and Hebrew) gnome-libs (really not needed, used only in FvwmGtk for minor things) rplay (really not needed, used only in FvwmEvent for internal sound) xinerama (not needed if you or your users have only one monitor) Optional libraries used by fvwm =============================== Fvwm can optionally be compiled to use the following libraries: xpm (XPM image format) png (PNG image format) rsvg (SVG image format) rplay (RPlay audio) readline (Command line editing using readline) stroke (Mouse strokes) intl (Internationalization and localization using gettext) By default, these are probed for, and used if found. If you want to use any of them, install the library before configuring fvwm. It is possible to explicitly tell configure to skip autoprobing of a given library and disable it (see below). Xpm allows the use of coloured icons. See the Xpm web page at http://www.inria.fr/koala/lehors/xpm.html for all the latest info and links to source code. You can also get the source code from ftp://ftp.x.org/contrib/libraries/. If you're having trouble building with XPM even after reading this, try Question 2.4 in the fvwm FAQ. Png allows to load coloured icons from files in PNG format. See the libpng web page at http://www.libpng.org/pub/png/libpng.html for all the latest info and links to source code. libpng is available as ANSI C source code and requires the zlib library. The zlib package can be found at http://www.gzip.org/zlib/ Librsvg allows rendering of SVG (scalable vector graphics) image files. See the librsvg web page at http://librsvg.sourceforge.net/ for more information and links to source code. Librsvg uses the Cairo library as a rendering backend. Source code can be found at http://cairographics.org/ Rplay is used in one module (FvwmEvent) to play sounds without invoking an external program. This library appears to have been orphaned in November, 1996. The latest version is available at http://rplay.doit.org/dist/. Readline is used in one module (FvwmConsole) to allow fancy command-line editing, a history buffer, etc. It is GNU software, and should be found on any GNU site, such as ftp://ftp.gnu.org/gnu/readline/. To build with readline support, either termcap or ncurses library should be found. Use --with-termcap-library or --with-ncurses-library to specify the path (directory or library file) to termcap or ncurses. The first valid library found is used. It is possible to disable termcap or ncurses autoprobing using --without-termcap-library or --without-ncurses-library. Disabling both disables readline support, like --without-readline-library. LibStroke allows interpretation by fvwm of mouse strokes (i.e., motions of the mouse). For more informations see the LibStroke web page at http://www.etla.net/~willey/projects/libstroke/ and the fvwm man page. Gettext is included in glibc, so it may be a part of your system. Alternatively, there is GNU gettext package available at http://www.gnu.org/software/gettext/. If configure doesn't do the right thing, try one or more of the following flags (examples assume library is named "foo"): --without-foo-library to disable probing for libfoo --with-foo-library=FILE to specify the library filename --with-foo-library=DIR to specify directory containing libfoo --with-foo-includes=DIR to specify include directory for headers The desired include directory is the one in which the following header may be found: xpm X11/xpm.h png png.h (zlib.h) readline readline/readline.h rplay rplay.h stroke stroke.h intl libintl.h Only one version of the --with-foo-library flag may be specified. Optional libraries used by FvwmGtk ================================== FvwmGtk module requires GTK+ and optionally GDK-Imlib and GNOME libraries. GDK-Imlib library that is a part of Imlib version 1 is used to have images. Note, fvwm itself has an ability to support GNOME Window Manager hints (which is enabled by default), this has nothing to do with GNOME library support compiled into FvwmGtk (which is autoprobed and used if passed). To disable autoprobing of GTK+, Imlib and GNOME libraries, use: --disable-gtktest --disable-imlibtest --without-gnome This does not turn GTK+ and Imlib support off, instead, one part of the checking, precisely compilation, is quietly considered to be passed. To disable GTK+ and Imlib support even if the corresponding libraries are installed, try this solution: --with-gtk-prefix=/no/dir --with-imlib-prefix=/no/dir Run './configure --help' for more information about configure options. Shared Libraries in Non-standard Places ======================================= Note that at this time, autoconf and fvwm don't handle systems which require a runtime library path separate from the link path very gracefully. If you have such a system (e.g., Solaris) and you have installed the optional libraries in places not normally searched (e.g., not in /usr/lib, /lib or similar), you may need to specify the runtime path separately; the above options won't add it for you. A good way to do this is set the Makefile LDFLAGS variable before configure runs to contain the -R option. For example: $ LDFLAGS="-L/opt/xpm -R/opt/xpm" ./configure \ --with-xpm-library=/opt/xpm/lib \ --with-xpm-includes=/opt/xpm/include In the future, fvwm's configuration may perform this step automatically. Compile-time Options ==================== Fvwm has several options selectable only at compile time. These are intended to keep fvwm's memory footprint small, by compiling in the code only if requested. Each such option, say "foo", is selectable by an "--enable-foo" or a "--disable-foo" switch. By default, all of these options (except debug messages) are enabled. This is probably what you want -- unless memory is *really* tight -- so normally none of these options are used. If option "foo" is enabled by default, the NON-default version of the switch is shown in the list below, and vice-versa. In other words, the version of the switch that you are likely to use is the one listed. --disable-package-subdirs don't create subdirs for modules and data ~~~~~~~~~~~~~~~~~~~~~~~~~ Usually fvwm is installed to common places, like /usr or /usr/local/X11, in this case it is essential to create the package subdirectories for modules and data files. Hovewer, if fvwm is installed to its own prefix, like /opt/fvwm or /opt/fvwm-2.4, it's possible to disable them. With --enable-package-subdirs (default): modules are installed into: $libexecdir/fvwm/$VERSION data files are installed into: $datadir/fvwm With --disable-package-subdirs: modules are installed into: $libexecdir data files are installed into: $datadir This option is good if you need a full control over exact directory names: $ ./configure --prefix=/tmp/fvwm --disable-package-subdirs \ --libexecdir='${prefix}/modules' --datadir='${prefix}/data' If you switch this option between builds, you need "make clean"! --enable-debug-msgs enable debugging messages ~~~~~~~~~~~~~~~~~~~ If you would like to see lots of debug messages from fvwm, for debugging purposes, enable this option. When reporting bugs, please do not send the debug output. It is almost never useful in this situation. --enable-command-log enable command logging ~~~~~~~~~~~~~~~~~~~~ If you would like to see all commands executed and their times, enable this option. Remember, when using this, the command time offset is given in the system ticks, and it only means anything for commands executed in one batch; for example, after startup the command time offset may freely reach hours. --disable-sm disable session management support ~~~~~~~~~~~~ Fvwm has experimental session management support, which is autoconfigured by searching for SM library, which is often shipped together with your X libraries. Note, the session management support is activated when fvwm is run under a session manager like xsm or gnome-session. This option disables session management support completely. --disable-xft disable anti-aliased text rendering ~~~~~~~~~~~~~ Fvwm can use the Xft library (version 1 or 2) to perform anti-aliased text rendering in any text drawn by fvwm and modules. By default, Xft library is probed and this support is enabled if Xft works. You need XFree version >= 4.1 and freetype2 version >= 6.1.0 (aka version 2.0.6), but more recent versions are better. The FONT NAMES AND FONT LOADING section of the fvwm manual page explains how to enable anti-aliased rendering at runing time. This option disables Xft support completely. --disable-xrender disable Xrender alpha-blend rendering ~~~~~~~~~~~~~~~~~ Fvwm uses the Xrender library for alpha-blend rendering and tinting. This library is contained in XFree version >= 4.0 and others recent X package. This option disables Xrender support completely. --disable-xcursor disable Xcursor ARGB/animated cursor loading ~~~~~~~~~~~~~~~~~ Fvwm can use the Xcursor library to load ARGB/animated mouse cursors. This library is contained in XFree version >= 4.3 and others recent X packages. This option disables Xcursor support. --disable-rsvg disable scalable vector graphics (SVG images) ~~~~~~~~~~~~~~ Fvwm can use the librsvg library to render SVG files into icons and images. You need a librsvg version >= 2.13.92 that uses Cairo as the rendering backend. This option disables SVG image loading support. --disable-shape disable shape extensions ~~~~~~~~~~~~~~~ Shaped window extensions are enabled by default; this option will disable them. Shaped window extensions seem to increase the window managers RSS by about 60 Kbytes. They provide for leaving a title-bar on the window without a border. If you don't use shaped window extension, you can either make your shaped windows undecorated, or live with a border and backdrop around all your shaped windows (oclock, xeyes). If you normally use a shaped window (xeyes or oclock), you might as well compile this extension in, since the memory cost is minimal in this case (the shaped window shared libs will be loaded anyway). If you don't normally use shaped windows, you have to decide for yourself. Note: if it is compiled in, run time detection is used to make sure that the currently running X server supports it. --disable-bidi disable bi-directional text support ~~~~~~~~~~~~~~ The bi-directional text support is used to properly handle right-to-left languages, like Hebrew and Arabic. By default, fribidi library is probed and this support is enabled if fribidi works. This option explicitly disables the bi-directional text support. --with-fribidi-bindir directory of fribidi-config if not in PATH ~~~~~~~~~~~~~~~~~~~~~ The location of fribidi libraries and headers (needed for Bidi support) is determined using fribidi-config utility. This option specifies a directory where fribidi-config is installed if it is not in the $PATH. --disable-perllib disable installing fvwm perl library ~~~~~~~~~~~~~~~~~ By default the fvwm perl library is installed together with all other data files. Perl library may be used to write fvwm modules in perl. Currently the FvwmPerl module uses it. This option disables installing the fvwm perl library. --with-gnome no, yes or prefix for GNOME files (FvwmGtk only) ~~~~~~~~~~~~ FvwmGtk may be built as a GTK application or a GNOME application. This is autodetected and if GNOME libs found, they are used in FvwmGtk. You may also specify the location of GNOME headers and libs using --with-gnome-includes and --with-gnome-libs, but this is usually never needed, since all required info should be returned by gnome-config if GNOME is properly installed. In case the GNOME installation works and you don't want to be dependant on GNOME, specify --without-gnome. --enable-xinerama-emulation enable Xinerama emulation on one screen ~~~~~~~~~~~~~~~~~~~~~~~~~~~ This option is only useful for developers. Usually the Xinerama support is only activated at run time when it is compiled in and X supports it and X is run with Xinerama extension. This option enables the Xinerama emulation even when X does not support it or fvwm is run on one screen. This divides the screen to 2 non equivalent parts and one black area. fvwm-2.6.5.orig/tests/0000755000175000017500000000000011744241503012765 5ustar vwcvwcfvwm-2.6.5.orig/tests/README.test_options0000644000175000017500000000125507257425007016410 0ustar vwcvwcRun the test_options script from this directory. It will configure and build fvwm multiple times for every selected combination of configure options. Parameters: -0: build once with all options disabled/enabled (2 builds) -1: build once with any single option disabled/enabled (2 builds per option) -2: build once with any combination of two options disabled/enabled (n * n + n builds where n is the number of options) -a: all tests (2 ^ n builds) The default is 'test_options -0 -1' since '-2' can take a very long time. A summary logfile test_options.log is generated as well as an additional log for each build (test_options.log.*). The names are self explaining. fvwm-2.6.5.orig/tests/Makefile.in0000644000175000017500000004672411744241235015051 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ SUBDIRS = hints EXTRA_DIST = README.test_options test_options all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/tests/hints/0000755000175000017500000000000011744241503014112 5ustar vwcvwcfvwm-2.6.5.orig/tests/hints/Makefile.in0000644000175000017500000004026411744241235016167 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = hints_test$(EXEEXT) subdir = tests/hints DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) hints_test_SOURCES = hints_test.c hints_test_OBJECTS = hints_test.$(OBJEXT) hints_test_LDADD = $(LDADD) am__DEPENDENCIES_1 = hints_test_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = hints_test.c DIST_SOURCES = hints_test.c ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ LDADD = -L$(top_builddir)/libs $(X_LIBS) -lfvwm \ $(X_PRE_LIBS) -lXext -lX11 -lm $(X_EXTRA_LIBS) INCLUDES = -I$(top_srcdir) $(X_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/hints/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/hints/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) hints_test$(EXEEXT): $(hints_test_OBJECTS) $(hints_test_DEPENDENCIES) @rm -f hints_test$(EXEEXT) $(LINK) $(hints_test_OBJECTS) $(hints_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hints_test.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstPROGRAMS ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/tests/hints/README0000644000175000017500000000473207646272256015017 0ustar vwcvwcThis directory contains only the hints_test.c program. To compile it either try "make" or something like % gcc -g -O2 -Wall -I/usr/X11R6/include -L/usr/X11R6/lib -c hints_test.c % gcc -g -O2 -Wall -o hints_test hints_test.o -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 should work. The program does nothing: it is just a 170x100 black window. However, using options you can set various hints (XSizeHints, XWMHints, MWM hints, EWMH hints) on the window. Here are the options: --help Show usage --min-size w h Set the min_width and min_height XSizeHints to w and h --max-size w h Set the max_width and max_height XSizeHints to w and h --inc-size w h Set the inc_width and inc_height XSizeHints to w and h --p-geometry geometry Set the program geometry and the gravity accordingly. geometry is a standard X geometry (not a F geometry) --us-geometry geometry Set the user geometry and the gravity accordingly. geometry is a standard X geometry (not a F geometry) --input Bool Set the InputHint to Bool where Bool is either true or false --focus-proto Respect the WM_TAKE_FOCUS protocol --no-delete-proto By default the program respect the WM_DELETE_WINDOW protocol. This option forces the program to do not use it at all. --wm-state state Set the initial wm state to state, where state can be withdrawn, iconic or normal --wm-urgency Set the wm urgency flags --wm-group win Set the window group leader to win where win can be root, window or the id of an window. --transient win Set the WM_TRANSIENT_FOR window to win where win can be root or the id of an window. --mwm-decor args where args is a non empty space separated list of the following key words: all, border, resizeh, title, menu, minimize, maximize --mwm-func args where args is a non empty space separated list of the following key words: all, resize, move, maximize, minimize, close --mwm-input arg where arg can be: modless, app_modal, sys_modal, full_app_modal --ewmh-type type Set the EWMH window type to type where type can be: normal, dock, toolbar, desktop, menu, dialog, splash, utility --ewmh-state states Set the EWMH window states to states where states is a non empty space separated list of the following key words: hidden, shaded, sticky, skippager, skiptaskbar, maxhoriz, maxvert, modal, staysontop, fullscreen --ewmh-desktop int Set desktop initial state This is just a test program there is no full checking when the options are parsed. Do not forget to use xprop and xwininfo. Have Fun! fvwm-2.6.5.orig/tests/hints/Makefile.am0000644000175000017500000000041507622247415016156 0ustar vwcvwc## Process this file with automake to create Makefile.in # Don't install this, its just for testing. noinst_PROGRAMS = hints_test LDADD = -L$(top_builddir)/libs $(X_LIBS) -lfvwm \ $(X_PRE_LIBS) -lXext -lX11 -lm $(X_EXTRA_LIBS) INCLUDES = -I$(top_srcdir) $(X_CFLAGS) fvwm-2.6.5.orig/tests/hints/hints_test.c0000644000175000017500000004424710504065264016456 0ustar vwcvwc/* -*-c-*- */ #include "config.h" #include #include #include #include #include #include #include "libs/FEvent.h" Display *dpy; Window Root, win; int screen; int has_focus_proto = 0; int has_delete_proto = 1; int input_mode = -1; Atom ATOM_NET_WM_WINDOW_TYPE = None; Atom ATOM_NET_WM_WINDOW_TYPE_DESKTOP = None; Atom ATOM_NET_WM_WINDOW_TYPE_DOCK = None; Atom ATOM_NET_WM_WINDOW_TYPE_TOOLBAR = None; Atom ATOM_NET_WM_WINDOW_TYPE_MENU = None; Atom ATOM_NET_WM_WINDOW_TYPE_DIALOG = None; Atom ATOM_NET_WM_WINDOW_TYPE_NORMAL = None; Atom ATOM_NET_WM_WINDOW_TYPE_SPLASH = None; Atom ATOM_NET_WM_WINDOW_TYPE_UTILITY = None; Atom ATOM_KDE_NET_WM_WINDOW_TYPE_OVERRIDE = None; Atom ATOM_NET_WM_STATE = None; Atom ATOM_NET_WM_STATE_MODAL = None; Atom ATOM_NET_WM_STATE_STICKY = None; Atom ATOM_NET_WM_STATE_MAXIMIZED_VERT = None; Atom ATOM_NET_WM_STATE_MAXIMIZED_HORIZ = None; Atom ATOM_NET_WM_STATE_SHADED = None; Atom ATOM_NET_WM_STATE_SKIP_TASKBAR = None; Atom ATOM_NET_WM_STATE_SKIP_PAGER = None; Atom ATOM_NET_WM_STATE_HIDDEN = None; Atom ATOM_NET_WM_STATE_STAYS_ON_TOP = None; Atom ATOM_NET_WM_STATE_FULLSCREEN = None; Atom ATOM_NET_WM_DESKTOP = None; /* wm protocol */ Atom ATOM_WM_DELETE_WINDOW = None; Atom ATOM_WM_TAKE_FOCUS = None; /* Motif window hints */ Atom ATOM_MOTIF_WM_HINTS = None; #define MWM_HINTS_FUNCTIONS (1L << 0) #define MWM_HINTS_DECORATIONS (1L << 1) #define MWM_HINTS_INPUT_MODE (1L << 2) #define MWM_HINTS_STATUS (1L << 3) /* ? */ /* bit definitions for MwmHints.functions */ #define MWM_FUNC_ALL (1L << 0) #define MWM_FUNC_RESIZE (1L << 1) #define MWM_FUNC_MOVE (1L << 2) #define MWM_FUNC_MINIMIZE (1L << 3) #define MWM_FUNC_MAXIMIZE (1L << 4) #define MWM_FUNC_CLOSE (1L << 5) /* values for MwmHints.input_mode */ #define MWM_INPUT_MODELESS 0 #define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1 #define MWM_INPUT_SYSTEM_MODAL 2 #define MWM_INPUT_FULL_APPLICATION_MODAL 3 /* bit definitions for MwmHints.decorations */ #define MWM_DECOR_ALL (1L << 0) #define MWM_DECOR_BORDER (1L << 1) #define MWM_DECOR_RESIZEH (1L << 2) #define MWM_DECOR_TITLE (1L << 3) #define MWM_DECOR_MENU (1L << 4) #define MWM_DECOR_MINIMIZE (1L << 5) #define MWM_DECOR_MAXIMIZE (1L << 6) /* * _MWM_HINTS property */ typedef struct { long props[4]; /* props[0]: flags */ /* props[1]: functions */ /* props[2]: decorations */ /* props[3]: inputMode */ } PropMotifWmHints; typedef PropMotifWmHints PropMwmHints; #define PROP_MOTIF_WM_HINTS_ELEMENTS 4 #define PROP_MWM_HINTS_ELEMENTS PROP_MOTIF_WM_HINTS_ELEMENTS void Xloop(void) { while (1) { XEvent ev; XWindowAttributes xatt; /* Sit and wait for an event to happen */ FNextEvent(dpy,&ev); switch(ev.type) { case ConfigureNotify: break; case ClientMessage: if (has_delete_proto && ev.xclient.format == 32 && ev.xclient.data.l[0] == ATOM_WM_DELETE_WINDOW) { exit(0); } else if (has_focus_proto && ev.xclient.data.l[0] == ATOM_WM_TAKE_FOCUS) { printf("WM_TAKE_FOCUS message\n"); if (input_mode == 1) { printf ("\t...do nothing\n"); } else if (input_mode == 0) { if (XGetWindowAttributes(dpy, win, &xatt) && xatt.map_state == IsViewable) { printf ("\t...setting focus on our own: %lu\n", ev.xclient.data.l[1]); XSetInputFocus( dpy, win, RevertToParent, ev.xclient.data.l[1]); } else { printf ("\t...but we are not viewable\n"); } } } break; default: break; } } } #define XIA(a) XInternAtom(dpy,a,False); void InitAtom(void) { ATOM_NET_WM_WINDOW_TYPE = XIA("_NET_WM_WINDOW_TYPE"); ATOM_NET_WM_WINDOW_TYPE_DESKTOP = XIA("_NET_WM_WINDOW_TYPE_DESKTOP"); ATOM_NET_WM_WINDOW_TYPE_DOCK = XIA("_NET_WM_WINDOW_TYPE_DOCK"); ATOM_NET_WM_WINDOW_TYPE_TOOLBAR = XIA("_NET_WM_WINDOW_TYPE_TOOLBAR"); ATOM_NET_WM_WINDOW_TYPE_MENU = XIA("_NET_WM_WINDOW_TYPE_MENU"); ATOM_NET_WM_WINDOW_TYPE_DIALOG = XIA("_NET_WM_WINDOW_TYPE_DIALOG"); ATOM_NET_WM_WINDOW_TYPE_NORMAL = XIA("_NET_WM_WINDOW_TYPE_NORMAL"); ATOM_NET_WM_WINDOW_TYPE_SPLASH = XIA("_NET_WM_WINDOW_TYPE_SPLASH"); ATOM_NET_WM_WINDOW_TYPE_UTILITY = XIA("_NET_WM_WINDOW_TYPE_UTILITY"); ATOM_KDE_NET_WM_WINDOW_TYPE_OVERRIDE = XIA("_KDE_NET_WM_WINDOW_TYPE_OVERRIDE"); ATOM_NET_WM_STATE = XIA("_NET_WM_STATE"); ATOM_NET_WM_STATE_MODAL = XIA("_NET_WM_STATE_MODAL"); ATOM_NET_WM_STATE_STICKY = XIA("_NET_WM_STATE_STICKY"); ATOM_NET_WM_STATE_MAXIMIZED_VERT = XIA("_NET_WM_STATE_MAXIMIZED_VERT"); ATOM_NET_WM_STATE_MAXIMIZED_HORIZ = XIA("_NET_WM_STATE_MAXIMIZED_HORIZ"); ATOM_NET_WM_STATE_SHADED = XIA("_NET_WM_STATE_SHADED"); ATOM_NET_WM_STATE_SKIP_TASKBAR = XIA("_NET_WM_STATE_SKIP_TASKBAR"); ATOM_NET_WM_STATE_SKIP_PAGER = XIA("_NET_WM_STATE_SKIP_PAGER"); ATOM_NET_WM_STATE_HIDDEN = XIA("_NET_WM_STATE_HIDDEN"); ATOM_NET_WM_STATE_FULLSCREEN = XIA("_NET_WM_STATE_FULLSCREEN"); ATOM_NET_WM_STATE_STAYS_ON_TOP = XIA("_NET_WM_STATE_STAYS_ON_TOP"); ATOM_NET_WM_DESKTOP = XIA("_NET_WM_DESKTOP"); ATOM_WM_DELETE_WINDOW = XIA("WM_DELETE_WINDOW"); ATOM_WM_TAKE_FOCUS = XIA("WM_TAKE_FOCUS"); ATOM_MOTIF_WM_HINTS = XIA("_MOTIF_WM_HINTS"); } void show_usage(void) { printf("Usage: hints_test OPTIONS\n"); printf("Options:\n"); printf(" --mwm-func \n"); printf(" all, resize, move, minimize, maximize, close\n"); printf(" --mwm-decor \n"); printf(" all, border, resizeh, title, menu, minimize, maximize\n"); printf(" --ewmh-state \n"); printf(" hidden, shaded, sticky, skippager, skiptaskbar,\n"); printf(" maxhoriz, maxvert, modal, staysontop, fullscreen\n"); printf(" --ewmh-type \n"); printf(" normal, dock, toolbar, desktop, menu, dialog, splash, utility\n"); printf(" --mwm-input { modless, app_modal, sys_modal, full_app_modal}\n"); printf(" --ewmh-desktop\n"); printf(" --wm-state { withdrawn, normal, iconic }\n"); printf(" --wm-urgency\n"); printf(" --wm-group { window, root, }\n"); printf(" --min-size \n"); printf(" --max-size \n"); printf(" --inc-size \n"); printf(" --p-geometry \n"); printf(" --us-geometry \n"); printf(" --input { true, false }\n"); printf(" --delete-proto\n"); printf(" --no-delete-proto\n"); printf(" --transient\n"); } int main(int argc, char **argv) { int state_count = 0; Atom states[10]; Atom type = 0; int i,x_r,y_r; unsigned int h_r,w_r; int ret; int ewmh_state_arg = 0; int ewmh_type_arg = 0; int mwm_func_arg = 0; int mwm_decor_arg = 0; int has_ewmh_desktop = 0; Atom ewmh_desktop = 0; XSizeHints hints; XClassHint classhints; XWMHints wm_hints; PropMwmHints mwm_hints; Window trans_win = 0; if (!(dpy = XOpenDisplay(""))) { fprintf(stderr, "can't open display\n"); exit(1); } screen = DefaultScreen(dpy); Root = RootWindow(dpy, screen); InitAtom(); hints.width = 170; hints.height = 100; hints.x = 0; hints.y = 0; hints.flags = 0; wm_hints.flags = 0; mwm_hints.props[0] = 0; mwm_hints.props[1] = 0; mwm_hints.props[2] = 0; mwm_hints.props[3] = 0; win = XCreateSimpleWindow( dpy, Root, 0, 0, hints.width, hints.height, 0, 0, 0); for (i = 1; i < argc; i++) { char *error_arg = NULL; if (strcasecmp(argv[i], "--help") == 0) { show_usage(); exit(0); } else if (strcasecmp(argv[i], "--ewmh-state") == 0) { ewmh_state_arg = 1; ewmh_type_arg = 0; mwm_func_arg = 0; mwm_decor_arg = 0; } else if (strcasecmp(argv[i], "--ewmh-type") == 0) { ewmh_state_arg = 0; ewmh_type_arg = 1; mwm_func_arg = 0; mwm_decor_arg = 0; } else if (strcasecmp(argv[i], "--mwm-func") == 0) { ewmh_state_arg = 0; ewmh_type_arg = 0; mwm_func_arg = 1; mwm_decor_arg = 0; } else if (strcasecmp(argv[i], "--mwm-decor") == 0) { ewmh_state_arg = 0; ewmh_type_arg = 0; mwm_func_arg = 0; mwm_decor_arg = 1; } else if (strcasecmp(argv[i], "--min-size") == 0) { i++; hints.min_width = atoi(argv[i]); i++; hints.min_height = atoi(argv[i]); hints.flags |= PMinSize; } else if (strcasecmp(argv[i], "--max-size") == 0) { i++; hints.max_width = atoi(argv[i]); i++; hints.max_height = atoi(argv[i]); hints.flags |= PMaxSize; } else if (strcasecmp(argv[i], "--inc-size") == 0) { i++; hints.width_inc = atoi(argv[i]); i++; hints.height_inc = atoi(argv[i]); hints.flags |= PResizeInc; } else if (strcasecmp(argv[i], "--p-geometry") == 0) { i++; ret = XParseGeometry(argv[i], &x_r, &y_r, &w_r, &h_r); if ((ret & WidthValue) && (ret & HeightValue)) { hints.width = w_r; hints.height = h_r; hints.flags |= PSize; } if ((ret & XValue) && (ret & YValue)) { hints.x = x_r; hints.y = y_r; hints.win_gravity = NorthWestGravity; if (ret & XNegative) { hints.x += XDisplayWidth(dpy, screen) - hints.width; hints.win_gravity = NorthEastGravity; } if (ret & YNegative) { hints.y += XDisplayHeight(dpy, screen) - hints.height; if (ret & XNegative) { hints.win_gravity = SouthEastGravity; } else { hints.win_gravity = SouthWestGravity; } hints.flags |= PWinGravity; } hints.flags |= PPosition; } } else if (strcasecmp(argv[i], "--us-geometry") == 0) { i++; ret = XParseGeometry(argv[i], &x_r, &y_r, &w_r, &h_r); if ((ret & WidthValue) && (ret & HeightValue)) { hints.width = w_r; hints.height = h_r; hints.flags |= USSize; } if ((ret & XValue) && (ret & YValue)) { hints.x = x_r; hints.y = y_r; hints.win_gravity=NorthWestGravity; if (ret & XNegative) { hints.x += XDisplayWidth(dpy,screen) - hints.width; hints.win_gravity=NorthEastGravity; } if (ret & YNegative) { hints.y += XDisplayHeight(dpy,screen) - hints.height; if (ret & XNegative) { hints.win_gravity = SouthEastGravity; } else { hints.win_gravity = SouthWestGravity; } } hints.flags |= USPosition | PWinGravity; } } else if (strcasecmp(argv[i], "--input") == 0) { i++; if (strcasecmp(argv[i], "true") == 0) { wm_hints.input = input_mode = True; wm_hints.flags |= InputHint; } else if (strcasecmp(argv[i], "false") == 0) { wm_hints.input = input_mode = False; wm_hints.flags |= InputHint; } else { error_arg = "--input"; } } else if (strcasecmp(argv[i], "--focus-proto") == 0) { has_focus_proto = 1; } else if (strcasecmp(argv[i], "--no-delete-proto") == 0) { has_delete_proto = 0; } else if (strcasecmp(argv[i], "--wm-state") == 0) { wm_hints.flags |= StateHint; i++; if (strcasecmp(argv[i], "withdrawn") == 0) { wm_hints.initial_state = WithdrawnState; } else if (strcasecmp(argv[i], "normal") == 0) { wm_hints.initial_state = NormalState; } else if (strcasecmp(argv[i], "iconic") == 0) { wm_hints.initial_state = IconicState; } else { error_arg = "--wm-state"; } } else if (strcasecmp(argv[i], "--wm-urgency") == 0) { wm_hints.flags |= XUrgencyHint; } else if (strcasecmp(argv[i], "--wm-group") == 0) { wm_hints.flags |= WindowGroupHint; i++; if (strcasecmp(argv[i], "window") == 0) { wm_hints.window_group = win; } else if (strcasecmp(argv[i], "root") == 0) { wm_hints.window_group = Root; } else { wm_hints.window_group = strtoul(argv[i], NULL, 0); } } else if (strcasecmp(argv[i], "--transient") == 0) { i++; if (strcasecmp(argv[i],"root") == 0) { trans_win = Root; } else { trans_win = strtoul(argv[i], NULL, 0); } } else if (strcasecmp(argv[i], "--mwm-input") == 0) { mwm_hints.props[0] |= MWM_HINTS_INPUT_MODE; i++; if (strcasecmp(argv[i], "modless") == 0) { mwm_hints.props[3] = MWM_INPUT_MODELESS; } else if (strcasecmp(argv[i], "app_modal") == 0) { mwm_hints.props[3] = MWM_INPUT_PRIMARY_APPLICATION_MODAL; } else if (strcasecmp(argv[i], "sys_modal") == 0) { mwm_hints.props[3] = MWM_INPUT_SYSTEM_MODAL; } else if (strcasecmp(argv[i], "full_app_modal") == 0) { mwm_hints.props[3] = MWM_INPUT_FULL_APPLICATION_MODAL; } else { error_arg = "--mwm-input"; } } else if (strcasecmp(argv[i], "--ewmh-desktop") == 0) { has_ewmh_desktop = 1; i++; ewmh_desktop = atol(argv[i]); } else if (ewmh_state_arg && state_count < 10) { if (strcasecmp(argv[i], "hidden") == 0) { states[state_count++] = ATOM_NET_WM_STATE_HIDDEN; } else if (strcasecmp(argv[i], "shaded") == 0) { states[state_count++] = ATOM_NET_WM_STATE_SHADED; } else if (strcasecmp(argv[i], "sticky") == 0) { states[state_count++] = ATOM_NET_WM_STATE_STICKY; } else if (strcasecmp(argv[i], "skippager") == 0) { states[state_count++] = ATOM_NET_WM_STATE_SKIP_PAGER; } else if (strcasecmp(argv[i], "skiptaskbar") == 0) { states[state_count++] = ATOM_NET_WM_STATE_SKIP_TASKBAR; } else if (strcasecmp(argv[i], "maxhoriz") == 0) { states[state_count++] = ATOM_NET_WM_STATE_MAXIMIZED_HORIZ; } else if (strcasecmp(argv[i], "maxvert") == 0) { states[state_count++] = ATOM_NET_WM_STATE_MAXIMIZED_VERT; } else if (strcasecmp(argv[i], "modal") == 0) { states[state_count++] = ATOM_NET_WM_STATE_MODAL; } else if (strcasecmp(argv[i], "staysontop") == 0) { states[state_count++] = ATOM_NET_WM_STATE_STAYS_ON_TOP; } else if (strcasecmp(argv[i], "fullscreen") == 0) { states[state_count++] = ATOM_NET_WM_STATE_FULLSCREEN; } else { error_arg = "--ewmh-state"; } } else if (ewmh_type_arg) { if (strcasecmp(argv[i], "normal") == 0) { type = ATOM_NET_WM_WINDOW_TYPE_NORMAL; } else if (strcasecmp(argv[i], "dock") == 0) { type = ATOM_NET_WM_WINDOW_TYPE_DOCK; } else if (strcasecmp(argv[i], "toolbar") == 0) { type = ATOM_NET_WM_WINDOW_TYPE_TOOLBAR; } else if (strcasecmp(argv[i], "desktop") == 0) { type = ATOM_NET_WM_WINDOW_TYPE_DESKTOP; } else if (strcasecmp(argv[i], "menu") == 0) { type = ATOM_NET_WM_WINDOW_TYPE_MENU; } else if (strcasecmp(argv[i], "dialog") == 0) { type = ATOM_NET_WM_WINDOW_TYPE_DIALOG; } else if (strcasecmp(argv[i], "splash") == 0) { type = ATOM_NET_WM_WINDOW_TYPE_SPLASH; } else if (strcasecmp(argv[i], "utility") == 0) { type = ATOM_NET_WM_WINDOW_TYPE_UTILITY; } else { error_arg = "--ewmh-type"; } } else if (mwm_func_arg) { mwm_hints.props[0] |= MWM_HINTS_FUNCTIONS; if (strcasecmp(argv[i], "all") == 0) { mwm_hints.props[1] |= MWM_FUNC_ALL; } else if (strcasecmp(argv[i], "resize") == 0) { mwm_hints.props[1] |= MWM_FUNC_RESIZE; } else if (strcasecmp(argv[i], "move") == 0) { mwm_hints.props[1] |= MWM_FUNC_MOVE; } else if (strcasecmp(argv[i], "minimize") == 0) { mwm_hints.props[1] |= MWM_FUNC_MINIMIZE; } else if (strcasecmp(argv[i], "maximize") == 0) { mwm_hints.props[1] |= MWM_FUNC_MAXIMIZE; } else if (strcasecmp(argv[i], "close") == 0) { mwm_hints.props[1] |= MWM_FUNC_CLOSE; } else { error_arg = "--mwm-func"; } } else if (mwm_decor_arg) { mwm_hints.props[0] |= MWM_HINTS_DECORATIONS; if (strcasecmp(argv[i], "all") == 0) { mwm_hints.props[2] |= MWM_DECOR_ALL; } else if (strcasecmp(argv[i], "border") == 0) { mwm_hints.props[2] |= MWM_DECOR_BORDER; } else if (strcasecmp(argv[i], "resizeh") == 0) { mwm_hints.props[2] |= MWM_DECOR_RESIZEH; } else if (strcasecmp(argv[i], "title") == 0) { mwm_hints.props[2] |= MWM_DECOR_TITLE; } else if (strcasecmp(argv[i], "menu") == 0) { mwm_hints.props[2] |= MWM_DECOR_MENU; } else if (strcasecmp(argv[i], "minimize") == 0) { mwm_hints.props[2] |= MWM_DECOR_MINIMIZE; } else if (strcasecmp(argv[i], "maximize") == 0) { mwm_hints.props[2] |= MWM_DECOR_MAXIMIZE; } else { error_arg = "--mwm-decor"; } } else { error_arg = "regular"; } if (error_arg) { show_usage(); printf("Invalid %s argument: %s\n", error_arg, argv[i]); exit(1); } } XSelectInput(dpy, win, StructureNotifyMask); if (wm_hints.flags) { XSetWMHints(dpy, win, &wm_hints); } if (state_count != 0) { XChangeProperty( dpy, win, ATOM_NET_WM_STATE, XA_ATOM, 32, PropModeReplace, (unsigned char *)states, state_count); } if (type != 0) { XChangeProperty( dpy, win, ATOM_NET_WM_WINDOW_TYPE, XA_ATOM, 32, PropModeReplace, (unsigned char *)&type, 1); } if (has_ewmh_desktop) { XChangeProperty( dpy, win, ATOM_NET_WM_DESKTOP, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&ewmh_desktop, 1); } if (has_delete_proto || has_focus_proto) { Atom proto[2]; int j = 0; if (has_delete_proto) proto[j++] = ATOM_WM_DELETE_WINDOW; if (has_focus_proto) proto[j++] = ATOM_WM_TAKE_FOCUS; XSetWMProtocols(dpy, win, proto, j); } { XTextProperty nametext; char *list[] = { NULL, NULL }; list[0] = "Hints Test"; classhints.res_name = strdup("hints_test"); classhints.res_class = strdup("HintsTest"); if (!XStringListToTextProperty(list, 1, &nametext)) { fprintf(stderr, "Failed to convert name to XText\n"); exit(1); } XSetWMProperties( dpy, win, &nametext, &nametext, NULL, 0, &hints, NULL, &classhints); XFree(nametext.value); } if (mwm_hints.props[0] != 0) { XChangeProperty( dpy, win, ATOM_MOTIF_WM_HINTS, ATOM_MOTIF_WM_HINTS, 32, PropModeReplace,(unsigned char *)&mwm_hints, PROP_MWM_HINTS_ELEMENTS); } if (trans_win !=0) XSetTransientForHint(dpy, win, trans_win); XMapWindow(dpy, win); XSetWindowBackground(dpy, win, 0); Xloop(); return 1; } fvwm-2.6.5.orig/tests/ChangeLog0000644000175000017500000001557211405242147014550 0ustar vwcvwc2010-06-13 Thomas Adam * purify/README: Clairfy, clearly, that the typos in the purify.fvwm2rc file are deliberate. 2010-01-06 Thomas Adam * purify/README: * purify/install.purify: Copy purify.fvwm2rc to /tmp - add instructions in README. 2009-03-21 Mikhael Goikhman * perl/show-commands: * perl/README: add new example script to show all fvwm commands with descriptions 2009-03-17 Mikhael Goikhman * perl/module-example: * perl/module-flash: * perl/module-gtkflash: * perl/module-gtkwinlist: * perl/module-tkdesker: * perl/module-trackertest: * perl/module-winlist: * perl/xmessage.fpl: * perl/xmessage.ppp: convert my old code to use var_name and function_name coding style 2008-03-12 Jes~s Guerrero * tests/menus/menus.read: * tests/menus/README: * tests/purify/purify.fvwm2rc: test stuff for VerticalMargins 2007-08-07 Dominik Vogt * perl/module-winlist: * perl/README: * perl/module-example: write fvwm in lower case 2007-01-28 Dominik Vogt * hints/Makefile.am (LDADD): 2006-09-19 Viktor Griph * hints/hints_test.c (main): change dimensions and allocation counts to unsigned types. 2005-11-26 Dominik Vogt * hints/hints_test.c: do not #include stdlib.h (comes from config.h) 2005-07-18 Dominik Vogt * hints/hints_test.c: 64-bit fixes 2004-12-21 Mikhael Goikhman * perl/module-winlist update one event field name 2004-06-03 Dominik Vogt * hints/hints_test.c (main): fixed if clause 2004-05-29 Dan Espen * purify/purify.fvwm2rc: Add a CenterPlacement test. Add bugopts ExplainWindowPlacement test. 2003-11-02 Dan Espen * purify/purify.fvwm2rc: Add some mouse bindings for TearOff to tests. 2003-07-16 olicha * purify/purify.fvwm2rc: Added WindowStyle and DestroyWindowStyle tests 2003-05-26 olicha * purify/purify.fvwm2rc: Some improvement 2003-05-22 olicha * purify/purify.fvwm2rc: A few adjustments. Added png and xbm images in decor tests 2003-04-22 Mikhael Goikhman * perl/README: * perl/module-example: * perl/module-flash: * perl/module-trackertest: updated/added new perl-based module tests 2003-05-22 olicha * purify/install.purify: * purify/test.png Added a png icons * purify/purify.fvwm2rc: Added icons in menus. Use test.png in various place (need more). Complete styles tests and map some window during styles test to put the styles in action (need more work). Be more agressive with the decoration cmd (TitleStyle -> TitleStyle + UpdateStyles ...). Added DesktopName, EdgeThickness, EwmhBaseStruts, GotoDesk, GotoDeskAndPage, Xinerama*, Cond, CondCase, On and Direction tests. Iproved Current and None. 2003-05-18 olicha * purify/purify.fvwm2rc: Updated. Added a window_iconic and window_shaded. Be more agressive with Style (Style -> Style + UpdateStyles). Added more font in DefaultFont. More menu position. Added a few new MenuStyle. Added BugOpts, LocalePath, PrintInfo, ResizeMaximize, ResizeMoveMaximize and StickAcross{Desks,Page} tests. 2003-04-13 Mikhael Goikhman * hints/README: * hints/hints_test.c: reformatted, added --help, basic argument checking 2003-03-02 Dominik Vogt * hints/hints_test.c: -Wall fix 2003-02-28 Dominik Vogt * Makefile.am: fixed "make distcheck" 2003-02-11 Dan Espen * hints/Makefile: remove. * hints/Makefile.am: Supplied missing Makefile.am. 2003-01-26 Dominik Vogt * Makefile.am: * hints/Makefile: * hints/Makefile.am: replaced Makefile with Makefile.am 2003-01-18 Marcus Lundblad * hints/Makefile: Fixed linking againts libfvwm.a in the Makefile 2003-01-12 Dan Espen * purify/windowshade.pl: Test program for windowshading. 2002-12-30 Mikhael Goikhman * perl/module-tkdesker: improved 2002-10-09 Mikhael Goikhman * perl/module-gtkflash: one more module for tutorial purposes 2002-09-17 Mikhael Goikhman * perl/module-flash: added a new module for the tutorial purposes 2002-09-13 Mikhael Goikhman * perl/module-example: add a 0.5 sec delay to autoraising 2002-09-13 Mikhael Goikhman * perl/module-*: updated to use a new event handler API 2002-06-23 Mikhael Goikhman * perl/xmessage.ppp: added examples for new preprocess directives 2002-05-28 Mikhael Goikhman * perl/module-example: improved example module and documented all steps 2002-05-28 Mikhael Goikhman * perl/README: * perl/module-example: * perl/module-gtkwinlist: * perl/module-tkdesker: * perl/module-winlist: * perl/xmessage.fpl: * perl/xmessage.ppp: updated test modules; module-gtkwinlist now understands messages like iconify (itself) added tests for FvwmPerl load and preprocess; 2002-02-25 Mikhael Goikhman * perl/README: * perl/module-gtkwinlist: a new sample Perl/Gtk module 2002-02-23 Mikhael Goikhman * perl/README: * perl/module-tkdesker: a new simple Perl/Tk module 2002-02-12 Mikhael Goikhman * hints/README: * hints/Makefile: some improvements 2002-02-11 Mikhael Goikhman * perl/*: added 2 test modules written in perl 2002-01-17 olicha * hints/hints_test.c (main): fixed a miss print * hints/README: Document -ewmh-desktop 2001-12-30 olicha * hints/README: * hints/hints_test.c: Added a program which map a window with various hints set or not accordingly to some options 2001-04-07 Dominik Vogt * purify/purify.fvwm2rc: added DestroyDecor recreate tests 2001-04-06 Dominik Vogt * purify/purify.fvwm2rc: added tests for AddToFunc parsing 2001-03-22 Dominik Vogt * purify/purify.fvwm2rc: more gradient tests 2001-03-14 Dominik Vogt * FvwmButtons/FvwmButtons.sh: fixed sliding position of top right panel in test 3 2001-03-12 Dan Espen * FvwmButtons/FvwmButtons.sh: Add one button test. 2001-03-11 Dan Espen * FvwmButtons/FvwmButtons.sh: no double ;; after trap. Added positioning test. Other clean up. fvwm-2.6.5.orig/tests/test_options0000755000175000017500000001221607257425007015456 0ustar vwcvwc#!/bin/sh # Hell, this is really difficult with /bin/sh. I want my zsh back! testdir=tests fvwmdir=.. myname=`basename $0` log=$testdir/$myname.log typeset -i c1 typeset -i c2 typeset -i c3 typeset -i i1 typeset -i i2 typeset -i nopts typeset -i copts usage () { echo "usage: $myname [-0] [-1] [-2] [-a] [make options]" echo " -0: run tests with all options defined and disabled (2 builds)" echo " -1: run tests with one option defined and disabled" echo " -2: run tests with two options defined and disabled" echo " -a: run all possible tests" echo " default is: myname -0 -1" echo " logging output goes to $log and $log.*" } # #parse command line # run_depth_0="" run_depth_1="" run_depth_2="" run_all="" custom="" while [ -n "$1" ] ; do if [ "$1" = "-h" ] ; then usage exit elif [ "$1" = "-?" ] ; then usage exit elif [ "$1" = "-0" ] ; then run_depth_0=1 run_all="" custom=1 elif [ "$1" = "-1" ] ; then run_depth_1=1 run_all="" custom=1 elif [ "$1" = "-2" ] ; then run_depth_2=1 run_all="" custom=1 elif [ "$1" = "-a" ] ; then run_depth_0="" run_depth_1="" run_depth_2="" run_all=1 custom=1 else break; fi shift done MAKE_OPTS="$*" # set default if nothing was selected if [ -z "$custom" ]; then run_depth_0="1" run_depth_1="1" fi if [ ! -x ./$myname ] ; then echo please run $myname from $testdir exit 1 fi cd $fvwmdir rm -f "$log"* > /dev/null 2>&1 ################## # some functions # ################## # clean up before next build clean_up () { make clean > /dev/null 2>&1 make distclean > /dev/null 2>&1 rm -f config.cache > /dev/null 2>&1 for i in `find . -name .deps -type d` ; do rm -rf $i; done > /dev/null 2>&1 for i in `find . -name Makefile` ; do rm -f $i; done > /dev/null 2>&1 for i in `find . -name "*.o"` ; do rm -f $i; done > /dev/null 2>&1 } # generate parameter list for configure disable_options () { CONFIGURE_OPTS="" while [ ! "$1" = "" ]; do CONFIGURE_OPTS="$CONFIGURE_OPTS --disable-${BUILD_OPTIONS[$1]}" shift done c3=0 while [ ! "${BUILD_OPTIONS[$c3]}" = "" ]; do echo $CONFIGURE_OPTS | grep -q -- "--disable-${BUILD_OPTIONS[$c3]}" || CONFIGURE_OPTS="$CONFIGURE_OPTS --enable-${BUILD_OPTIONS[$c3]}" c3=$c3+1 done } # disable all enabled options and vice versa reverse_options () { CONFIGURE_OPTS=`echo $CONFIGURE_OPTS | sed -e 's/--enable-/--xyz-/g' | sed -e 's/--disable-/--enable-/g' | sed -e 's/--xyz-/--disable-/g'` } # call configure and make (with logging) build () { echo "+++ testing (logfile $1): $CONFIGURE_OPTS" >> $log # clean up echo "cleaning up..." >> $log clean_up # configure echo "configuring..." >> $log echo "./configure $CONFIGURE_OPTS" > $log.$1 if nice ./configure --enable-extras $CONFIGURE_OPTS >> $log.$1 2>&1; then echo ok >> $log else echo FAILED >> $log fi # make echo "building..." >> $log if nice make $MAKE_OPTS > $log.$1 2>&1; then echo ok >> $log else echo FAILED >> $log fi echo >> $log } ############################ # end of functions section # ############################ # # get the list of possible options # c1=0 nopts=0 copts=1 for i in ` grep "^\(dnl dummy: \)\?smr_SWITCH" configure.in | grep -v debug-msgs | sed -e 's/^.*smr_SWITCH.//g' | cut -f 1 -d ","`; do BUILD_OPTIONS[$c1]="$i" OPTIONS="$OPTIONS $i" c1=$c1+1; nopts=$nopts+1; copts=$copts+$copts done # # now do the tests # if [ "$run_depth_1" = "1" ] ; then i1=$nopts+$nopts echo echo " +++ running $i1 tests for depth 1 +++" echo c1=0 while [ ! "${BUILD_OPTIONS[$c1]}" = "" ]; do disable_options $c1 echo build ${BUILD_OPTIONS[$c1]}_off build ${BUILD_OPTIONS[$c1]}_off reverse_options echo build ${BUILD_OPTIONS[$c1]}_on build ${BUILD_OPTIONS[$c1]}_on c1=$c1+1 done fi if [ "$run_depth_2" = "1" ] ; then i1="$nopts * $nopts + $nopts" echo echo " +++ running $i1 tests for depth 2 +++" echo c1=0 while [ -n "${BUILD_OPTIONS[$c1]}" ]; do c2=$c1+1 while [ -n "${BUILD_OPTIONS[$c2]}" ]; do disable_options $c1 $c2 echo build ${BUILD_OPTIONS[$c1]}_off,${BUILD_OPTIONS[$c2]}_off build ${BUILD_OPTIONS[$c1]}_off reverse_options echo build ${BUILD_OPTIONS[$c1]}_on,${BUILD_OPTIONS[$c2]}_on build ${BUILD_OPTIONS[$c1]}_on c2=$c2+1 done c1=$c1+1 done fi if [ "$run_depth_0" = "1" ] ; then echo echo " +++ running 2 tests for depth 0 +++" echo disable_options reverse_options echo build all_disabled build all_disabled disable_options echo build all_enabled build all_enabled fi if [ "$run_all" = "1" ] ; then i1=$copts+1 echo echo " +++ running $i1 tests for all combination of options +++" echo c1=0 while [ ! "$c1" = "$copts" ]; do c2=$c1 i1=0 opts_off="" while [ ! "$i1" = "$nopts" ]; do i2="$c2/2" i2="$i2*2" if [ "$i2" = "$c2" ]; then opts_off="$opts_off $i1" fi i1=$i1+1 c2=$c2/2 done disable_options $opts_off echo "test $c1 of $copts (logfile: `basename $log.$c1`):" echo "$CONFIGURE_OPTS" build $c1 c1=$c1+1 done fi fvwm-2.6.5.orig/tests/Makefile.am0000644000175000017500000000040407627633731015034 0ustar vwcvwc## This is a -*- Makefile -*- ## Process this file with automake to create Makefile.in SUBDIRS = hints EXTRA_DIST = README.test_options test_options ## The files in the purify subdir are NOT distributed, due to controversy over ## the benefits of doing so. fvwm-2.6.5.orig/acinclude.m40000644000175000017500000016174511550375466014045 0ustar vwcvwcdnl Convenience macros dnl new version of FUNC_SELECT dnl - submitted to autoconf maintainer; expected to appear in next version AC_DEFUN([AC_FUNC_SELECT], [AC_CHECK_FUNCS(select) if test "$ac_cv_func_select" = yes; then AC_CHECK_HEADERS(unistd.h sys/types.h sys/time.h sys/select.h sys/socket.h) AC_MSG_CHECKING([argument types of select()]) AC_CACHE_VAL(ac_cv_type_fd_set_size_t,dnl [AC_CACHE_VAL(ac_cv_type_fd_set,dnl [for ac_cv_type_fd_set in 'fd_set' 'int' 'void'; do for ac_cv_type_fd_set_size_t in 'int' 'size_t' 'unsigned long' 'unsigned'; do for ac_type_timeval in 'struct timeval' 'const struct timeval'; do AC_TRY_COMPILE(dnl [#ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif], [extern select ($ac_cv_type_fd_set_size_t, $ac_cv_type_fd_set *, $ac_cv_type_fd_set *, $ac_cv_type_fd_set *, $ac_type_timeval *);], [ac_found=yes ; break 3],ac_found=no) done done done ])dnl AC_CACHE_VAL ])dnl AC_CACHE_VAL if test "$ac_found" = no; then AC_MSG_ERROR([can not determine argument types]) fi AC_MSG_RESULT([select($ac_cv_type_fd_set_size_t,$ac_cv_type_fd_set *,...)]) AH_TEMPLATE([fd_set_size_t], [Define to the type used in argument 1 `select'. Usually this is an `int'.]) AC_DEFINE_UNQUOTED(fd_set_size_t, $ac_cv_type_fd_set_size_t) ac_cast= if test "$ac_cv_type_fd_set" != fd_set; then # Arguments 2-4 are not fd_set. Some weirdo systems use fd_set type for # FD_SET macros, but insist that you cast the argument to select. I don't # understand why that might be, but it means we cannot define fd_set. AC_EGREP_CPP(dnl changequote(<<,>>)dnl <<(^|[^a-zA-Z_0-9])fd_set[^a-zA-Z_0-9]>>dnl changequote([,]),dnl [#ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif],dnl # We found fd_set type in a header, need special cast ac_cast="($ac_cv_type_fd_set *)",dnl # No fd_set type; it is safe to define it AH_TEMPLATE([fd_set], [Define to the type used in arguments 2-4 of `select', if not set by system headers.]) AC_DEFINE_UNQUOTED(fd_set,$ac_cv_type_fd_set)) fi AH_TEMPLATE([SELECT_FD_SET_CAST], [Define a suitable cast for arguments 2-4 of `select'. On most systems, this will be the empty string, as select usually takes pointers to fd_set.]) AC_DEFINE_UNQUOTED(SELECT_FD_SET_CAST,$ac_cast) fi ]) dnl Checking for typedefs, with extra headers dnl pds_CHECK_TYPE(TYPE, DEFAULT, [HEADERS], [comment]) AC_DEFUN([pds_CHECK_TYPE], [AC_REQUIRE([AC_HEADER_STDC])dnl AC_MSG_CHECKING(for $1) AC_CACHE_VAL(ac_cv_type_$1, [AC_EGREP_CPP(dnl changequote(<<,>>)dnl <<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl changequote([,]), [#include #if STDC_HEADERS #include #include #endif $3], ac_cv_type_[$1]=yes, ac_cv_type_[$]1=no)])dnl AC_MSG_RESULT($ac_cv_type_[$1]) if test $ac_cv_type_[$1] = no; then AH_TEMPLATE([$1],[$4]) AC_DEFINE_UNQUOTED($1, $2) fi ]) dnl Configure-time switch with default dnl dnl Each switch defines an --enable-FOO and --disable-FOO option in dnl the resulting configure script. dnl dnl Usage: dnl smr_SWITCH(name, description, default, pos-def, neg-def, dnl pos-def-comment, neg-def-comment) dnl dnl where: dnl dnl name name of switch; generates --enable-name & --disable-name dnl options dnl description help string is set to this prefixed by "enable" or dnl "disable", whichever is the non-default value dnl default either "on" or "off"; specifies default if neither dnl --enable-name nor --disable-name is specified dnl pos-def a symbol to AC_DEFINE if switch is on (optional) dnl neg-def a symbol to AC_DEFINE if switch is off (optional) dnl AC_DEFUN([smr_SWITCH], [ AC_MSG_CHECKING(whether to enable [$2]) AC_ARG_ENABLE( $1, ifelse($3, on, [AC_HELP_STRING([--disable-$1], [disable $2])], [AC_HELP_STRING([--enable-$1], [enable $2])] ), ifelse([$4], , , [AH_TEMPLATE([$4],[$6])]) ifelse([$5], , , [AH_TEMPLATE([$5],[$7])]) [ if test "$enableval" = yes; then AC_MSG_RESULT(yes) ifelse($4, , , [AC_DEFINE($4)]) else AC_MSG_RESULT(no) ifelse($5, , , [AC_DEFINE($5)]) fi ], ifelse($3, on, [ AC_MSG_RESULT(yes) ifelse($4, , , [AC_DEFINE($4)]) ], [ AC_MSG_RESULT(no) ifelse($5, , , [AC_DEFINE($5)])]) ) ]) dnl Allow argument for optional libraries; wraps AC_ARG_WITH, to dnl provide a "--with-foo-library" option in the configure script, where foo dnl is presumed to be a library name. The argument given by the user dnl (i.e. "bar" in ./configure --with-foo-library=bar) may be one of three dnl things: dnl * boolean (no, yes or blank): whether to use library or not dnl * file: assumed to be the name of the library dnl * directory: assumed to *contain* the library dnl dnl The argument is sanity-checked. If all is well, two variables are dnl set: "with_foo" (value is yes, no, or maybe), and "foo_LIBS" (value dnl is either blank, a file, -lfoo, or '-L/some/dir -lfoo'). The idea dnl is: the first tells you whether the library is to be used or not dnl (or the user didn't specify one way or the other) and the second dnl to put on the command line for linking with the library. dnl dnl Usage: dnl smr_ARG_WITHLIB(name, libname, description) dnl dnl name name for --with argument ("foo" for libfoo) dnl libname (optional) actual name of library, dnl if different from name dnl description (optional) used to construct help string dnl AC_DEFUN([smr_ARG_WITHLIB], [ ifelse($2, , smr_lib=[$1], smr_lib=[$2]) AC_ARG_WITH([$1]-library, ifelse($3, , AS_HELP_STRING([--with-$1-library[=PATH]],[use $1 library]), AS_HELP_STRING([--with-$1-library[=PATH]],[use $1 library ($3)])), [ if test "$withval" = yes; then with_[$1]=yes [$1]_LIBS="-l${smr_lib}" elif test "$withval" = no; then with_[$1]=no [$1]_LIBS= else with_[$1]=yes if test -f "$withval"; then [$1]_LIBS=$withval elif test -d "$withval"; then [$1]_LIBS="-L$withval -l${smr_lib}" else AC_MSG_ERROR([--with-$1-library argument must be yes/no, file or directory]) fi fi ], [ with_[$1]=maybe [$1]_LIBS="-l${smr_lib}" ])]) dnl Check if the include files for a library are accessible, and dnl define the variable "name_CFLAGS" with the proper "-I" flag for dnl the compiler. The user has a chance to specify the includes dnl location, using "--with-foo-includes". dnl dnl This should be used *after* smr_ARG_WITHLIB *and* AC_CHECK_LIB are dnl successful. dnl dnl Usage: dnl smr_ARG_WITHINCLUDES(name, header, extra-flags) dnl dnl name library name, MUST same as used with smr_ARG_WITHLIB dnl header a header file required for using the lib dnl extra-flags (optional) flags required when compiling the dnl header, typically more includes; for ex. X_CFLAGS dnl AC_DEFUN([smr_ARG_WITHINCLUDES], [ AC_ARG_WITH([$1]-includes, AS_HELP_STRING([--with-$1-includes=DIR],[set directory for $1 headers]), [ if test -d "$withval"; then [$1]_CFLAGS="-I${withval}" else AC_MSG_ERROR([argument must be a directory]) fi]) dnl We need to put the given include directory into CPPFLAGS temporarily, but dnl then restore CPPFLAGS to its old value. dnl smr_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS ${[$1]_CFLAGS}" ifelse($3, , , CPPFLAGS="$CPPFLAGS [$3]") AC_CHECK_HEADERS($2) CPPFLAGS=$smr_save_CPPFLAGS ]) dnl Probe for an optional library. This macro creates both dnl --with-foo-library and --with-foo-includes options for the configure dnl script. If --with-foo-library is *not* specified, the default is to dnl probe for the library, and use it if found. dnl dnl Usage: dnl smr_CHECK_LIB(name, libname, desc, func, header, x-libs, x-flags) dnl dnl name name for --with options dnl libname (optional) real name of library, if different from dnl above dnl desc (optional) short descr. of library, for help string dnl func function of library, to probe for dnl header (optional) header required for using library dnl x-libs (optional) extra libraries, if needed to link with lib dnl x-flags (optional) extra flags, if needed to include header files dnl AC_DEFUN([smr_CHECK_LIB], [ ifelse($2, , smr_lib=[$1], smr_lib=[$2]) ifelse($5, , , smr_header=[$5]) smr_ARG_WITHLIB($1,$2,$3) if test "$with_$1" != no; then AC_CHECK_LIB(ifelse($2, , $1, $2), $4, smr_havelib=yes, smr_havelib=no; problem_$1=": Can't find working lib$smr_lib", ifelse($6, , ${$1_LIBS}, [${$1_LIBS} $6])) if test "$smr_havelib" = yes -a "$smr_header" != ""; then smr_ARG_WITHINCLUDES($1, $smr_header, $7) smr_safe=`echo "$smr_header" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$ac_cv_header_'$smr_safe`\" != yes"; then smr_havelib=no problem_$1=": Can't find working $smr_header" fi fi if test "$smr_havelib" = yes; then with_$1=yes problem_$1= else $1_LIBS= $1_CFLAGS= with_$1=no fi else problem_$1=": Explicitly disabled" fi]) dnl Defines a boolean variable for config.h depending on a condition. dnl dnl Usage: dnl mg_DEFINE_IF_NOT(c-code, cpp-if-cond, var-name, extra-flags, var-comment) dnl dnl c-code the first code part inside main() dnl cpp-if-cond boolean preprocessor condition dnl var-name this variable will be defined if the given condition is false dnl extra-flags (optional) extra flags for compiling, typically more -I glags dnl dnl Example: dnl mg_DEFINE_IF_NOT([#include ], [defined __USE_BSD], [NON_BSD]) dnl AC_DEFUN([mg_DEFINE_IF_NOT], [ mg_save_CPPFLAGS="$CPPFLAGS" ifelse($4, , , CPPFLAGS="$CPPFLAGS [$4]") AH_TEMPLATE([$3],[$5]) AC_TRY_RUN([ #include int main(int c, char **v) { $1 #if $2 return 0; #else return 1; #endif } ], [:], [AC_DEFINE($3)]) CPPFLAGS="$mg_save_CPPFLAGS" ]) dnl -------------------------------------------------------------------------- dnl contents of gtk.m4 # Configure paths for GTK+ # Owen Taylor 97-11-3 dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS dnl AC_DEFUN([AM_PATH_GTK], [dnl dnl Get the cflags and libraries from the gtk-config script dnl AC_ARG_WITH(gtk-prefix,AS_HELP_STRING([--with-gtk-prefix=PFX],[prefix for GTK files (optional)]), gtk_config_prefix="$withval", gtk_config_prefix="") AC_ARG_WITH(gtk-exec-prefix,AS_HELP_STRING([--with-gtk-exec-prefix=PFX], [exec prefix for GTK files (optional)]), gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") AC_ARG_ENABLE(gtktest,AS_HELP_STRING([--disable-gtktest], [do not try to compile and run a test GTK program]),, enable_gtktest=yes) if test x$gtk_config_exec_prefix != x ; then gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config fi fi if test x$gtk_config_prefix != x ; then gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_prefix/bin/gtk-config fi fi AC_PATH_PROG(GTK_CONFIG, gtk-config, no) min_gtk_version=ifelse([$1], ,0.99.7,$1) AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes else GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'` gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'` gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" dnl dnl Now check if the installed GTK is sufficiently new. (Also sanity dnl checks the results of gtk-config to some extent dnl rm -f conf.gtktest AC_TRY_RUN([ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gtktest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If gtk-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } #endif /* defined (GTK_MAJOR_VERSION) ... */ else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); printf("*** correct copy of gtk-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$GTK_CONFIG" = "no" ; then echo "*** The gtk-config script installed by GTK could not be found" echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GTK_CONFIG environment variable to the" echo "*** full path to gtk-config." else if test -f conf.gtktest ; then : else echo "*** Could not run GTK test program, checking why..." CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" AC_TRY_LINK([ #include #include ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" echo "*** version of GTK. If it is not finding GTK, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" echo "*** came with the system with the command" echo "***" echo "*** rpm --erase --nodeps gtk gtk-devel" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK was incorrectly installed" echo "*** or that you have moved GTK since it was installed. In the latter case, you" echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) rm -f conf.gtktest ]) # Check for gdk-imlib AC_DEFUN([AM_PATH_GDK_IMLIB], [dnl dnl Get the cflags and libraries from the imlib-config script dnl AC_ARG_WITH(imlib-prefix,AS_HELP_STRING([--with-imlib-prefix=PFX],[prefix for IMLIB files (optional)]), imlib_prefix="$withval", imlib_prefix="") AC_ARG_WITH(imlib-exec-prefix,AS_HELP_STRING([--with-imlib-exec-prefix=PFX],[exec prefix for IMLIB files (optional)]), imlib_exec_prefix="$withval", imlib_exec_prefix="") AC_ARG_ENABLE(imlibtest,AS_HELP_STRING([--disable-imlibtest],[do not try to compile and run a test IMLIB program]), , enable_imlibtest=yes) if test x$imlib_exec_prefix != x ; then imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix" if test x${IMLIBCONF+set} != xset ; then IMLIBCONF=$imlib_exec_prefix/bin/imlib-config fi fi if test x$imlib_prefix != x ; then imlib_args="$imlib_args --prefix=$imlib_prefix" if test x${IMLIBCONF+set} != xset ; then IMLIBCONF=$imlib_prefix/bin/imlib-config fi fi AC_PATH_PROG(IMLIBCONF, imlib-config, no) min_imlib_version=ifelse([$1], ,1.8.1,$1) AC_MSG_CHECKING(for GDK IMLIB - version >= $min_imlib_version) no_imlib="" if test "$IMLIBCONF" = "no" ; then no_imlib=yes else GDK_IMLIB_CFLAGS=`$IMLIBCONF $imlibconf_args --cflags-gdk` GDK_IMLIB_LIBS=`$IMLIBCONF $imlibconf_args --libs-gdk` imlib_major_version=`$IMLIBCONF $imlib_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'` imlib_minor_version=`$IMLIBCONF $imlib_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'` if test "x$enable_imlibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS" LIBS="$LIBS $GDK_IMLIB_LIBS" dnl dnl Now check if the installed IMLIB is sufficiently new. (Also sanity dnl checks the results of imlib-config to some extent dnl rm -f conf.imlibtest AC_TRY_RUN([ #include #include #include /* migo: originally it was GdkImLibColor with incorrect spelling */ GdkImlibImage testimage; int main () { int major, minor; char *tmp_version; system ("touch conf.gdkimlibtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_imlib_version"); if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) { printf("%s, bad version string\n", "$min_imlib_version"); exit(1); } if (($imlib_major_version > major) || (($imlib_major_version == major) && ($imlib_minor_version > minor))) { return 0; } else { printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version); printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor); printf("*** best to upgrade to the required version.\n"); printf("*** If imlib-config was wrong, set the environment variable IMLIBCONF\n"); printf("*** to point to the correct copy of imlib-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } ],, no_imlib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_imlib" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$IMLIBCONF" = "no" ; then (echo "*** The imlib-config script installed by IMLIB could not be found" >&5) 2>/dev/null || \ echo "*** The imlib-config script installed by IMLIB could not be found" (echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in" >&5) 2>/dev/null || \ echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in" (echo "*** your path, or set the IMLIBCONF environment variable to the" >&5) 2>/dev/null || \ echo "*** your path, or set the IMLIBCONF environment variable to the" (echo "*** full path to imlib-config." >&5) 2>/dev/null || \ echo "*** full path to imlib-config." else if test -f conf.gdkimlibtest ; then : else (echo "*** Could not run IMLIB test program, checking why..." >&5) 2>/dev/null || \ echo "*** Could not run IMLIB test program, checking why..." CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS" LIBS="$LIBS $GDK_IMLIB_LIBS" AC_TRY_LINK([ #include #include ], [ return 0; ], [ (echo "*** The test program compiled, but did not run. This usually means" >&5) 2>/dev/null || \ echo "*** The test program compiled, but did not run. This usually means" (echo "*** that the run-time linker is not finding IMLIB or finding the wrong" >&5) 2>/dev/null || \ echo "*** that the run-time linker is not finding IMLIB or finding the wrong" (echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your" >&5) 2>/dev/null || \ echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your" (echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" >&5) 2>/dev/null || \ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" (echo "*** to the installed location Also, make sure you have run ldconfig if that" >&5) 2>/dev/null || \ echo "*** to the installed location Also, make sure you have run ldconfig if that" (echo "*** is required on your system" >&5) 2>/dev/null || \ echo "*** is required on your system" (echo "***" >&5) 2>/dev/null || \ echo "***" (echo "*** If you have an old version installed, it is best to remove it, although" >&5) 2>/dev/null || \ echo "*** If you have an old version installed, it is best to remove it, although" (echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" >&5) 2>/dev/null || \ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ (echo "*** The test program failed to compile or link. See the file config.log for the" >&5) 2>/dev/null || \ echo "*** The test program failed to compile or link. See the file config.log for the" (echo "*** exact error that occured. This usually means IMLIB was incorrectly installed" >&5) 2>/dev/null || \ echo "*** exact error that occured. This usually means IMLIB was incorrectly installed" (echo "*** or that you have moved IMLIB since it was installed. In the latter case, you" >&5) 2>/dev/null || \ echo "*** or that you have moved IMLIB since it was installed. In the latter case, you" (echo "*** may want to edit the imlib-config script: $IMLIBCONF" >&5) 2>/dev/null || \ echo "*** may want to edit the imlib-config script: $IMLIBCONF"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GDK_IMLIB_CFLAGS="" GDK_IMLIB_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GDK_IMLIB_CFLAGS) AC_SUBST(GDK_IMLIB_LIBS) rm -f conf.gdkimlibtest ]) dnl -------------------------------------------------------------------------- dnl from gnome.m4, modified by migo dnl dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag]) dnl dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh dnl is not found. dnl AC_DEFUN([GNOME_INIT_HOOK],[ AC_SUBST(GNOME_LIBS) AC_SUBST(GNOMEUI_LIBS) AC_SUBST(GNOME_LIBDIR) AC_SUBST(GNOME_INCLUDEDIR) AC_ARG_WITH(gnome-includes, AS_HELP_STRING([--with-gnome-includes], [location of GNOME headers]),[ CFLAGS="$CFLAGS -I$withval" ]) gnome_prefix=$ac_default_prefix/lib AC_ARG_WITH(gnome-libs, AS_HELP_STRING([--with-gnome-libs],[location of GNOME libs]),[ LDFLAGS="$LDFLAGS -L$withval" gnome_prefix=$withval ]) AC_ARG_WITH(gnome, AS_HELP_STRING([--with-gnome],[no, yes or prefix for GNOME files (for FvwmGtk only)]), if test x$withval = xyes; then with_gnomelibs=yes dnl Note that an empty true branch is not dnl valid sh syntax. ifelse([$1], [], :, [$1]) else if test "x$withval" = xno; then with_gnomelibs=no problem_gnomelibs=": Explicitly disabled" else with_gnomelibs=yes LDFLAGS="$LDFLAGS -L$withval/lib" CFLAGS="$CFLAGS -I$withval/include" gnome_prefix=$withval/lib fi fi, with_gnomelibs=yes) if test "x$with_gnomelibs" = xyes; then problem_gnomelibs=": Can't find working gnome-config" AC_PATH_PROG(GNOME_CONFIG,gnome-config,no) if test "$GNOME_CONFIG" = "no"; then no_gnome_config="yes" else AC_MSG_CHECKING(whether $GNOME_CONFIG works) if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then AC_MSG_RESULT(yes) GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`" GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`" GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`" GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`" $1 else AC_MSG_RESULT(no) no_gnome_config="yes" fi fi # migo: disable this destructive logic # if test x$exec_prefix = xNONE; then # if test x$prefix = xNONE; then # gnome_prefix=$ac_default_prefix/lib # else # gnome_prefix=$prefix/lib # fi # else # gnome_prefix=`eval echo \`echo $libdir\`` # fi if test "$no_gnome_config" = "yes"; then AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix) if test -f $gnome_prefix/gnomeConf.sh; then AC_MSG_RESULT(found) echo "loading gnome configuration from" \ "$gnome_prefix/gnomeConf.sh" . $gnome_prefix/gnomeConf.sh $1 else AC_MSG_RESULT(not found) if test x$2 = xfail; then AC_MSG_ERROR([Could not find the gnomeConf.sh file that is generated by gnome-libs install]) fi with_gnomelibs=no fi fi fi # test whether gnome can be compiled if test "x$with_gnomelibs" = xyes; then problem_gnomelibs=": Can't compile trivial gnome app" AC_MSG_CHECKING(whether trivial gnome compilation works) my_CPPFLAGS="$CPPFLAGS" my_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $GNOME_INCLUDEDIR $GTK_CFLAGS" LIBS="$LIBS $GNOME_LIBDIR $GNOMEUI_LIBS" AC_TRY_RUN([ #include int main(int c, char **v) { /* we can not really run this outside of X */ if (!c) gnome_init("test-app", "0.0", c, v); return 0; }], [with_gnomelibs=yes], [with_gnomelibs=no] ) AC_MSG_RESULT($with_gnomelibs) CPPFLAGS="$my_CPPFLAGS" LIBS="$my_LIBS" else # just for safety with_gnomelibs=no fi if test "x$with_gnomelibs" = xyes; then problem_gnomelibs="" else GNOME_LIBS= GNOMEUI_LIBS= GNOME_LIBDIR= GNOME_INCLUDEDIR= fi ]) # # check if iconv second argument use const char. # AC_DEFUN([ICONV_SECOND_ARG],[ AC_MSG_CHECKING(check if second arg of iconv is const) AC_TRY_COMPILE([ #include #include extern #if defined(__STDC__) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], use_const=no, use_const=yes) AC_MSG_RESULT($use_const) AH_TEMPLATE([ICONV_ARG_CONST], [define if second arg of iconv use const]) if test "x$use_const" = "xyes"; then AC_DEFINE(ICONV_ARG_CONST, const) else AC_DEFINE(ICONV_ARG_CONST, ) fi ]) # # check for locale_charset if libiconv is used # AC_DEFUN([CHECK_LIBCHARSET],[ AC_MSG_CHECKING(check for libcharset) ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $iconv_CFLAGS" LIBS="$LIBS $iconv_LIBS" AC_TRY_LINK([ #include ], [const char *c; c = locale_charset (); ], r=yes, r=no) AC_MSG_RESULT($r) if test "x$r" = "xyes"; then AC_DEFINE(HAVE_LIBCHARSET) fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" ]) #----------------------------------------------------------------------------- # pkg-config dnl dnl AC_DEFUN([AM_CHECK_PKG_CONFIG], [dnl dnl Get the cflags and libraries from the freetype-config script dnl AC_ARG_WITH(pkgconfig-prefix, AS_HELP_STRING([--with-pkgconfig-prefix=PFX],[prefix where pkg-config is installed]), pkgconfig_config_prefix="$withval", pkgconfig_config_prefix="") AC_ARG_WITH(pkgconfig-exec-prefix, AS_HELP_STRING([--with-pkgconfig-exec-prefix=PFX],[exec prefix where pkg-config is installed]), pkgconfig_config_exec_prefix="$withval",pkgconfig_config_exec_prefix="") if test x$pkgconfig_config_exec_prefix != x ; then pkgconfig_config_args="$pkgconfig_config_args --exec-prefix=$pkgconfig_config_exec_prefix" if test x${PKG_CONFIG+set} != xset ; then PKG_CONFIG=$pkgconfig_config_exec_prefix/bin/pkg-config fi fi if test x$pkgconfig_config_prefix != x ; then pkgconfig_config_args="$pkgconfig_config_args --prefix=$pkgconfig_config_prefix" if test x${PKG_CONFIG+set} != xset ; then PKG_CONFIG=$pkgconfig_config_prefix/bin/pkg-config fi fi AC_PATH_PROG(PKG_CONFIG, pkg-config, no) ]) #----------------------------------------------------------------------------- # Configure paths for FreeType2 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor dnl AM_CHECK_FT2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for FreeType2, and define FT2_CFLAGS and FT2_LIBS dnl AC_DEFUN([AM_CHECK_FT2], [dnl dnl Get the cflags and libraries from the freetype-config script dnl AC_ARG_WITH(freetype-prefix, AS_HELP_STRING([--with-freetype-prefix=PFX],[prefix where FreeType is installed (for Xft)]), ft_config_prefix="$withval", ft_config_prefix="") AC_ARG_WITH(freetype-exec-prefix, AS_HELP_STRING([--with-freetype-exec-prefix=PFX],[exec prefix where FreeType is installed]), ft_config_exec_prefix="$withval", ft_config_exec_prefix="") AC_ARG_ENABLE(freetypetest, AS_HELP_STRING([--disable-freetypetest],[do not try to compile and run a test FreeType program]), [], enable_fttest=yes) if test x$ft_config_exec_prefix != x ; then ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" if test x${FT2_CONFIG+set} != xset ; then FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config fi fi if test x$ft_config_prefix != x ; then ft_config_args="$ft_config_args --prefix=$ft_config_prefix" if test x${FT2_CONFIG+set} != xset ; then FT2_CONFIG=$ft_config_prefix/bin/freetype-config fi fi AC_PATH_PROG(FT2_CONFIG, freetype-config, no) min_ft_version=ifelse([$1], ,6.1.0,$1) AC_MSG_CHECKING(for FreeType - version >= $min_ft_version) no_ft="" if test "$FT2_CONFIG" = "no" ; then no_ft=yes else FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'` ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'` ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'` ft_min_major_version=`echo $min_ft_version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'` ft_min_minor_version=`echo $min_ft_version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'` ft_min_micro_version=`echo $min_ft_version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'` if test "x$enable_fttest" = "xyes" ; then ft_config_is_lt=no if test $ft_config_major_version -lt $ft_min_major_version ; then ft_config_is_lt=yes else if test $ft_config_major_version -eq $ft_min_major_version ; then if test $ft_config_minor_version -lt $ft_min_minor_version ; then ft_config_is_lt=yes else if test $ft_config_minor_version -eq $ft_min_minor_version ; then if test $ft_config_micro_version -lt $ft_min_micro_version ; then ft_config_is_lt=yes fi fi fi fi fi if test "x$ft_config_is_lt" = "xyes" ; then ifelse([$3], , :, [$3]) else ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $FT2_CFLAGS" LIBS="$FT2_LIBS $LIBS" dnl dnl Sanity checks for the results of freetype-config to some extent dnl AC_TRY_RUN([ #include #include FT_FREETYPE_H #include #include int main() { FT_Library library; FT_Error error; error = FT_Init_FreeType(&library); if (error) return 1; else { FT_Done_FreeType(library); return 0; } } ],, no_ft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi # test $ft_config_version -lt $ft_min_version fi # test "x$enable_fttest" = "xyes" fi # test "$FT2_CONFIG" = "no" if test "x$no_ft" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$FT2_CONFIG" = "no" ; then echo "*** The freetype-config script installed by FreeType 2 could not be found." echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the FT2_CONFIG environment variable to the" echo "*** full path to freetype-config." else echo "*** The FreeType test program failed to run. If your system uses" echo "*** shared libraries and they are installed outside the normal" echo "*** system library path, make sure the variable LD_LIBRARY_PATH" echo "*** (or whatever is appropiate for your system) is correctly set." fi FT2_CFLAGS="" FT2_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(FT2_CFLAGS) AC_SUBST(FT2_LIBS) ]) #----------------------------------------------------------------------------- # Configure paths for fontconfig # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor # modified by olicha for fontconfig dnl AM_CHECK_FC([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for fontconfig, and define FC_CFLAGS and FC_LIBS dnl AC_DEFUN([AM_CHECK_FC], [dnl dnl Get the cflags and libraries from the fontconfig-config script dnl AC_ARG_WITH(fontconfig-prefix, AS_HELP_STRING([--with-fontconfig-prefix=PFX],[prefix where fontconfig is installed (for Xft2)]), fc_config_prefix="$withval", fc_config_prefix="") AC_ARG_WITH(fontconfig-exec-prefix, AS_HELP_STRING([--with-fontconfig-exec-prefix=PFX],[exec prefix where fontconfig is installed]), fc_config_exec_prefix="$withval", fc_config_exec_prefix="") AC_ARG_ENABLE(fontconfigtest, AS_HELP_STRING([--disable-fontconfigtest],[do not try to compile and run a test fontconfig program]), [], enable_fctest=yes) if test x$fc_config_exec_prefix != x ; then fc_config_args="$fc_config_args --exec-prefix=$fc_config_exec_prefix" if test x${FC_CONFIG+set} != xset ; then FC_CONFIG=$fc_config_exec_prefix/bin/fontconfig-config fi fi if test x$fc_config_prefix != x ; then fc_config_args="$fc_config_args --prefix=$fc_config_prefix" if test x${FC_CONFIG+set} != xset ; then FC_CONFIG=$fc_config_prefix/bin/fontconfig-config fi fi AC_PATH_PROG(FC_CONFIG, fontconfig-config, no) min_fc_version=ifelse([$1], ,1.0.1,$1) AC_MSG_CHECKING(for Fontconfig - version >= $min_fc_version) no_fc="" pkg_config_fontconfig_exists="" if test "$FC_CONFIG" = "no" ; then if test "x$PKG_CONFIG" != "xno" ; then if $PKG_CONFIG --exists 'fontconfig' ; then if $PKG_CONFIG --exists 'fontconfig >= $1' ; then FC_CFLAGS=`$PKG_CONFIG --cflags fontconfig` FC_LIBS=`$PKG_CONFIG --libs fontconfig` else no_fc=yes fc_config_is_lt=yes fi else pkg_config_fontconfig_exists="maybe" no_fc=yes fi else no_fc=yes fi else FC_CFLAGS=`$FC_CONFIG $fc_config_args --cflags` FC_LIBS=`$FC_CONFIG $fc_config_args --libs` fc_config_major_version=`$FC_CONFIG $fc_config_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'` fc_config_minor_version=`$FC_CONFIG $fc_config_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'` fc_config_micro_version=`$FC_CONFIG $fc_config_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'` fc_min_major_version=`echo $min_fc_version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'` fc_min_minor_version=`echo $min_fc_version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'` fc_min_micro_version=`echo $min_fc_version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'` fc_config_is_lt=no if test $fc_config_major_version -lt $fc_min_major_version ; then fc_config_is_lt=yes else if test $fc_config_major_version -eq $fc_min_major_version ; then if test $fc_config_minor_version -lt $fc_min_minor_version ; then fc_config_is_lt=yes else if test $fc_config_minor_version -eq $fc_min_minor_version ; then if test $fc_config_micro_version -lt $fc_min_micro_version ; then fc_config_is_lt=yes fi fi fi fi fi if test "x$fc_config_is_lt" = "xyes" ; then no_fc=yes fi fi if test "x$no_fc" = x ; then if test "x$enable_fctest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $FC_CFLAGS $FT2_CFLAGS" LIBS="$FC_LIBS $LIBS $FT2_LIBS" dnl dnl Sanity checks for the results of fontconfig-config/pkg-config to some extent dnl AC_TRY_RUN([ #include #include #include int main() { FcBool result; result = FcInit(); if (result) { return 0; } else { return 1; } } ],, no_fc=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_fc" = x; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "x$fc_config_is_lt" = "xyes"; then echo "*** Your Fontconfig package version is < $1" elif test "x$pkg_config_fontconfig_exists" = "xmaybe"; then echo "*** fontconfig was not found in the pkg-config search path." echo "*** either fontconfig is not installed or perhaps you should" echo "*** add the directory containing fontconfig.pc to the " echo "*** PKG_CONFIG_PATH environment variable." elif test "$FC_CONFIG" != "no"; then echo "*** The Fontconfig test program failed to run. If your system uses" echo "*** shared libraries and they are installed outside the normal" echo "*** system library path, make sure the variable LD_LIBRARY_PATH" echo "*** (or whatever is appropiate for your system) is correctly set." fi FC_CFLAGS="" FC_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(FC_CFLAGS) AC_SUBST(FC_LIBS) ]) #----------------------------------------------------------------------------- # Configure paths for xft 2 # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor # modified by olicha for xft dnl AM_CHECK_XFT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for xft, and define XFT_CFLAGS and XFT_LIBS dnl AC_DEFUN([AM_CHECK_XFT], [dnl dnl Get the cflags and libraries from the xft-config script dnl AC_ARG_WITH(xft-prefix, AS_HELP_STRING([--with-xft-prefix=PFX],[prefix where Xft2 is installed (optional)]), xft_config_prefix="$withval", xft_config_prefix="") AC_ARG_WITH(xft-exec-prefix, AS_HELP_STRING([--with-xft-exec-prefix=PFX],[exec prefix where Xft2 is installed]), xft_config_exec_prefix="$withval", xft_config_exec_prefix="") AC_ARG_ENABLE(xfttest, AS_HELP_STRING([--disable-xfttest],[do not try to compile and run a test Xft program]), [], enable_xfttest=yes) if test x$xft_config_exec_prefix != x ; then xft_config_args="$xft_config_args --exec-prefix=$xft_config_exec_prefix" if test x${XFT_CONFIG+set} != xset ; then XFT_CONFIG=$xft_config_exec_prefix/bin/xft-config fi fi if test x$xft_config_prefix != x ; then xft_config_args="$xft_config_args --prefix=$xft_config_prefix" if test x${XFT_CONFIG+set} != xset ; then XFT_CONFIG=$xft_config_prefix/bin/xft-config fi fi AC_PATH_PROG(XFT_CONFIG, xft-config, no) min_xft_version=ifelse([$1], ,2.0.0,$1) AC_MSG_CHECKING(for Xft - version >= $min_xft_version) no_xft="" pkg_config_xft_exists="" if test "$XFT_CONFIG" = "no" ; then if test "x$PKG_CONFIG" != "xno" ; then if $PKG_CONFIG --exists 'xft' ; then if $PKG_CONFIG --exists 'xft >= $1' ; then XFT_CFLAGS=`$PKG_CONFIG --cflags xft` XFT_LIBS=`$PKG_CONFIG --libs xft` else no_xft=yes xft_config_is_lt=yes fi else pkg_config_xft_exists="maybe" no_xft=yes fi else no_xft=yes fi else XFT_CFLAGS=`$XFT_CONFIG $xft_config_args --cflags` XFT_LIBS=`$XFT_CONFIG $xft_config_args --libs` xft_config_major_version=`$XFT_CONFIG $xft_config_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'` xft_config_minor_version=`$XFT_CONFIG $xft_config_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'` xft_config_micro_version=`$XFT_CONFIG $xft_config_args --version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'` xft_min_major_version=`echo $min_xft_version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'` xft_min_minor_version=`echo $min_xft_version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'` xft_min_micro_version=`echo $min_xft_version | \ sed 's/^[[^0-9.]]*\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/'` xft_config_is_lt=no if test $xft_config_major_version -lt $xft_min_major_version ; then xft_config_is_lt=yes else if test $xft_config_major_version -eq $xft_min_major_version ; then if test $xft_config_minor_version -lt $xft_min_minor_version ; then xft_config_is_lt=yes else if test $xft_config_minor_version -eq $xft_min_minor_version ; then if test $xft_config_micro_version -lt $xft_min_micro_version ; then xft_config_is_lt=yes fi fi fi fi fi if test "x$xft_config_is_lt" = "xyes" ; then ifelse([$3], , :, [$3]) fi fi if test "x$no_xft" = x ; then if test "x$enable_xfttest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$XFT_CFLAGS $CFLAGS" LIBS="$XFT_LIBS $LIBS" dnl dnl Sanity checks for the results of xft-config/pkg-config to some extent dnl AC_TRY_RUN([ #include #include #include int main() { FcBool result = 1; result = XftInit(NULL); if (result) { return 0; } else { return 1; } } ],, no_xft=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_xft" = x; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "x$xft_config_is_lt" = "xyes"; then echo "*** Your xft2 package version is < $1" elif test "x$pkg_config_fontconfig_exists" = "xmaybe" ; then echo "*** xft2 was not found in the pkg-config search path." echo "*** either xft is not installed or perhaps you should" echo "*** add the directory containing xft.pc to the " echo "*** PKG_CONFIG_PATH environment variable." elif test "$XFT_CONFIG" = "no"; then echo "*** The xft-config script installed by Xft 2 could not be found." echo "*** If Xft 2 was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the XFT_CONFIG environment variable to the" echo "*** full path to xft-config." else echo "*** The Xft test program failed to run. If your system uses" echo "*** shared libraries and they are installed outside the normal" echo "*** system library path, make sure the variable LD_LIBRARY_PATH" echo "*** (or whatever is appropiate for your system) is correctly set." fi XFT_CFLAGS="" XFT_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(XFT_CFLAGS) AC_SUBST(XFT_LIBS) ]) #----------------------------------------------------------------------------- # gettext stuff from the gettext package # # Authors: Ulrich Drepper , 1996. # modified by the fvwm workers # AC_DEFUN([AM_GNU_FGETTEXT], [ AC_REQUIRE([AM_PO_SUBDIRS])dnl intl_LIBS= intl_CFLAGS= POSUB= found_gettext=yes dnl check for the necessary stuff in the libc dnl the pbs is that we can detect this stuff but in fact the included dnl libintl.h is from gettext dnl Moreover, we do not try to use other implementation, but we may try dnl one day $UNSET ac_cv_header_intl_h $UNSET ac_cv_func_gettext $UNSET ac_cv_func_bindtextdomain $UNSET ac_cv_func_textdomain dnl a "gnu extension" $UNSET ac_cv_func_dgettext #bind_textdomain_codeset AC_CHECK_HEADER(libintl.h, [AC_CHECK_FUNCS(gettext bindtextdomain textdomain dgettext,, found_gettext=no)], found_gettext=no) AC_MSG_CHECKING([for gnu gettext in libc]) if test x"$found_gettext" = "xyes"; then problem_gettext=" (libc)" AC_MSG_RESULT([yes]) AC_MSG_CHECKING(if a simple gettext program link) AC_TRY_LINK([ #include ], [const char *c; c = gettext("foo");], found_gettext=yes;problem_gettext=" (libc)", found_gettext=no) AC_MSG_RESULT($found_gettext) else AC_MSG_RESULT([no]) fi if test x"$found_gettext" = xno; then dnl not found, check for libintl $UNSET ac_cv_header_intl_h $UNSET ac_cv_lib_intl_bindtextdomain $UNSET ac_cv_lib_intl_textdomain $UNSET ac_cv_lib_intl_dgettext smr_CHECK_LIB(intl, intl, for Native Language Support, bindtextdomain, libintl.h) if test x"$intl_LIBS" != x; then no_textdomain=no no_dgettext=no ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" AC_CHECK_LIB(intl, textdomain,, no_textdomain=yes, [$intl_LIBS $iconv_LIBS]) if test "$no_textdomain" != "yes"; then AC_CHECK_LIB(intl, dgettext,, no_dgettext=yes, [$intl_LIBS $iconv_LIBS]) if test "$no_dgettext" != "yes"; then CFLAGS="$CFLAGS $intl_LIBS $iconv_LIBS" LIBS="$LIBS $intl_LIBS $iconv_LIBS" AC_MSG_CHECKING(if a simple gettext program link) AC_TRY_LINK([ #include ], [const char *c; c = gettext("foo");], found_gettext=yes;problem_gettext=" (intl library)", found_gettext=no) AC_MSG_RESULT($found_gettext) fi fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "$found_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo USE_NLS=yes dnl We need to process the po/ directory. POSUB=po else USE_NLS=no fi dnl Make the po/ variables we use known to autoconf ]) dnl Checks for all prerequisites of the po subdirectory, dnl except for USE_NLS. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_MKINSTALLDIRS])dnl dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) dnl Search for GNU xgettext 0.11 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :) dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU msgfmt. if test "$GMSGFMT" != ":"; then dnl If it is no GNU msgfmt we define it as : so that the dnl Makefiles still can work. if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` AC_MSG_RESULT( [found $GMSGFMT program is not GNU msgfmt; ignore it]) GMSGFMT=":" fi fi dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po fi AC_PATH_PROG(MSGUNIQ, msguniq, $MSGUNIQ) AC_MSG_CHECKING([for NLS fvwm messages catalogs]) AC_MSG_RESULT([$ALL_LINGUAS]) POFILES= GMOFILES= UPDATEPOFILES= DUMMYPOFILES= for lang in $ALL_LINGUAS; do for dom in $ALL_DOMAINS; do POFILES="$POFILES $dom.$lang.po" GMOFILES="$GMOFILES $dom.$lang.gmo" UPDATEPOFILES="$UPDATEPOFILES $dom.$lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $dom.$lang.nop" done done # CATALOGS depends on both $ac_dir and the user's LINGUAS environment variable. INST_LINGUAS= AC_MSG_CHECKING([for NLS desired catalogs to be installed]) #if test "%UNSET%" != "$LINGUAS"; then # FIXME: How to check if LINGUAS has been *set* to "" if test -n "$LINGUAS"; then AC_MSG_RESULT([$LINGUAS]) else AC_MSG_RESULT([all]) fi AC_MSG_CHECKING([for NLS messages catalogs to be installed]) if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no #if test "%UNSET%" != "$LINGUAS"; then if test -n "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi AC_MSG_RESULT([$INST_LINGUAS]) CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi ]) AC_DEFUN([AM_MKINSTALLDIRS], [ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but $(top_srcdir). dnl Try to locate is. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi ]) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) #----------------------------------------------------------------------------- # Safety check for mkstemp # AC_DEFUN([AM_SAFETY_CHECK_MKSTEMP],[ AC_CHECK_FUNCS(mkstemp) has_safety_mkstemp=no AC_MSG_CHECKING(if mkstemp is safe) if test x$ac_cv_func_mkstemp != xno; then AC_TRY_RUN([ #include #include #include int main(void) { char template[128]; char template_orig[128]; int fd; sprintf(template, "configure-mkstemp-test.XXXXXX"); strcpy(template_orig, template); fd = mkstemp(template); if (fd == -1) { /* could not create temp file */ return 1; } if (strcmp(template, template_orig) == 0) { /* mkstemp broken */ return 2; } if (close(fd) != 0) { /* doh! */ return 3; } if (unlink(template)) { return 4; } /* mkstemp works properly */ return 0; } ], [has_safety_mkstemp=yes], [has_safety_mkstemp=no]) fi AH_TEMPLATE([HAVE_SAFETY_MKSTEMP],[Enable the use of mkstemp]) if test x$has_safety_mkstemp = xno; then AC_MSG_RESULT(no, use our mkstemp) else AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SAFETY_MKSTEMP) fi ]) fvwm-2.6.5.orig/config.sub0000755000175000017500000010460611562437544013627 0ustar vwcvwc#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-03-23' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; # This must be matched before tile*. tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: fvwm-2.6.5.orig/Makefile.in0000644000175000017500000006543511744241235013707 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ config.guess config.sub depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ AUTOMAKE_OPTIONS = 1.4 SUBDIRS = \ libs \ fvwm \ modules \ bin \ utils \ $(FVWM_PERLLIB) \ doc \ docs \ rpm \ debian \ sample.fvwmrc \ $(POSUB) \ tests EXTRA_DIST = \ INSTALL.fvwm \ vms/README \ vms/config.h \ vms/fvwmrc.dat \ vms/make_fvwm.mms \ vms/vms.c \ vms/vms.h \ vms/vms_shareables.opt # Usage: # make dist2 # instead of make dist # make distcheck2 # instead of make distcheck # make distclean2 # instead of make distclean DISTCHECK_CONFIGURE_FLAGS = --enable-htmldoc all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ distclean distclean-generic distclean-hdr distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am dist2: dist gzip -dc $(distdir).tar.gz | bzip2 -9 >$(distdir).tar.bz2 distcheck2: distcheck dist2 @banner="$(distdir).tar.bz2 - ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$banner"; \ echo "$$dashes" @if test "x$(ISRELEASED)" != xyes; then \ echo 'Warning: ISRELEASED is not set to "yes".'; \ echo ' So these can not be the official tarballs.'; \ fi distclean2: distclean # Usage: # make rpm-dist # make release=1 rpm-dist # make rpm-this # make version=2.3.22 release=2 rpm-this # make rpm-dist cparams='--enable-multibyte --quiet' mparams='CFLAGS="-O2 -g"' # automatical regeneration is missing for other dirs, so do it explicitly rpm-regenerate: (cd rpm && $(MAKE) $(AM_MAKEFLAGS) Makefile *.spec) || exit 1 rpm-dist: dist rpm-this rpm-this: rpm-regenerate (cd rpm && $(MAKE) $(AM_MAKEFLAGS) this) || exit 1 # Usage: # make deb-dist # make release=1 deb-dist # make deb-this # make version=2.3.22 release=2 deb-this # make deb-dist cparams='--enable-gnome --quiet' mparams='CFLAGS="-O2 -g"' # make deb-inplace release=1.mg fullname=migo # works on sources directly deb-regenerate: (cd debian && $(MAKE) $(AM_MAKEFLAGS) Makefile control) || exit 1 deb-dist: dist deb-this deb-this: deb-regenerate $(MAKE) -f debian/Makefile $(AM_MAKEFLAGS) this || exit 1 deb-inplace: deb-regenerate $(MAKE) -f debian/Makefile $(AM_MAKEFLAGS) inplace || exit 1 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/README0000644000175000017500000000456611705517466012531 0ustar vwcvwcWelcome to fvwm. Fvwm is a multiple large virtual desktop window manager, originally (a looooong time ago!) derived from twm. Fvwm is intended to have a small memory footprint but a rich feature set, be extremely customizable and extendible, and have a high degree of Motif mwm compatibility. Fvwm 2.6.X marks a new development model for fvwm. Previously, fvwm ran two different code bases, one for development which is marked with odd numbers in the form of "X.ODD_NUMBER.Y" and stable release in the form of "X.EVEN_NUMBER.Y". The odd-numbered releases were considered unstable; where new features were tried and tested. The even-numbered releases were for stable version of fvwm where backwards-compatibility was maintained. Starting with 2.6.X though, this is no longer the case. There is only ever one version of fvwm and there is no longer a version which is considered unstable. A released version of fvwm is always considered stable, and if/when the version number of fvwm reaches an odd-number, such as 2.7.X, that is not to be considered as unstable, rather, just an increment on its versioning. ALL VERSIONS OF FVWM PRIOR TO 2.6.X ARE NOT SUPPORTED UPSTREAM. Users of fvwm prior to 2.6.X can make use of the fvwm-convert-2.6 utility to try and have their configuration file converted to a newer syntax. Please see its manpage for more details on how to use it. Fvwm's original author, Rob Nation (THANKS ROB!), has "retired" from work on it, so please don't bother him with silly little things like bug reports or enhancement requests. Care and feeding of fvwm is now handled by a group of people on the fvwm-workers mailing list, with many contributions by fans everywhere. If you have any questions, concerns, bug reports, enhancement requests, etc., please read the files in the docs/ subdirectory first. In particular the FAQ, BUGS, and TODO lists. Also, check the fvwm man page carefully. Next, try the fvwm mailing list. Another excellent resource is the official WWW page http://www.fvwm.org and the mailing list archives found there. For information on compiling and installing fvwm, see the INSTALL and INSTALL.fvwm files (INSTALL is the boilerplate autoconf instruction file; INSTALL.fvwm contains fvwm-specific details). Bugs can be reported to the fvwm-workers mailing list. See http://www.fvwm.org for details on fvwm-specific mailing lists. Have fun! -- The fvwm-workers fvwm-2.6.5.orig/depcomp0000755000175000017500000004426711324777651013231 0ustar vwcvwc#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: fvwm-2.6.5.orig/docs/0000755000175000017500000000000011744241503012553 5ustar vwcvwcfvwm-2.6.5.orig/docs/FAQ0000644000175000017500000040342111550303237013107 0ustar vwcvwc====================================================================== Fvwm Frequently Asked Questions ====================================================================== Last updated 20 Jan 2009 for unstable release 2.5.26 and stable release 2.4.20. Contents 0. *The* most frequently asked questions :) 0.1 A few minutes after fvwm is started my keyboard and mouse bindings stop working. What can I do? 0.2 I use XMMS, but it ignores some window styles. 0.3 I like transparency. What can I do? 1. About Fvwm 1.1 What does fvwm stand for? 1.2 Where do I find the current versions of fvwm? 1.3 Any WWW Sites about fvwm? 1.4 Where do I ask questions about fvwm? 1.5 What are the differences between fvwm 1.xx and 2.xx? 1.6 What's the relative memory usage for the various window managers out there? 1.7 Why the rename of the various files (fvwm2, .fvwm2rc, fvwm2.man)? 1.8 When will fvwm release X.Y.Z be ready? 2. Installation 2.1 I want to use fvwm, but I don't have root access on my machine. Can I still install and run it? 2.2 I'm trying to use fvwm under CDE/COSE, but encountering difficulties. Any suggestions? 2.3 I'm trying to compile fvwm under SunOS using cc, but the compiler is having lots of problems. What gives? 2.4 I want colored icons, but they won't work. Why not? When I run configure, it reports "no" to "Have XPM support?" How can I get XPM support? 2.5 I'm a sysadmin, and if I wanted to force fvwm to read a system rc file and then the user's rc file, how would I do that? 2.6 I'm a sysadmin, and if I wanted fvwm to look for all of its rc files in a hidden directory, say ~/.fvwm, much like CDE does, how could I do that? 2.7 How can I use fvwm with GNOME version <= 1? 2.8 How can I use fvwm with GNOME version >= 2 or KDE version >= 2? 3. Features, Configuration, Functions & Commands 3.1 I use fvwm on a RedHat Linux system and can't figure out how to change my fvwm configuration. I've read the fvwm man page but when I edit my .fvwm2rc nothing seems to happen. What's going on? 3.2 Is it possible to raise a window when I click into the window itself, not just the border? 3.3 How do I get Alt-Tab behavior like another GUI? 3.4 What's the difference between the Focus and FlipFocus commands? 3.5 You can bind mouse movements to keystrokes, how about mouse presses? 3.6 I'd like to bind a key to paste/use the current selection, how can I do that? 3.7 Will fvwm ever support a separate colormap for each desktop? 3.8 I really like the horizontal bars that appear on the title bars of sticky windows. Can I get those on other windows as well? 3.9 How do I set the Sun keyboard key xxxx to an fvwm command? Or more generally, I'm having problems defining key bindings for fvwm - what can I do? 3.10 My .fvwmrc from version 1.xx no longer works. What do I do? 3.11 What happened to the fvwm 1.xx 'include' command? 3.12 How do I get window titles on sub windows of ... 3.13 I just upgraded to version >= 2.3.2, and my configuration settings disappeared! How do I get them back? 3.14 Some applications (e.g. Eterm) don't use the icon I defined for them. Why? 3.15 I don't like the gaps in my icon box when I de-iconify an application. Is there some kind of auto arrange function? 3.16 How do I set up an fvwm menu item that shuts down my Linux machine? 3.17 Although the Recapture command is obsolete, do I still need it to apply certain style changes? 3.18 When my specific window (or all windows) pops up, I want it to get focus/be moved/be resized/be closed/be shaded... How? 3.19 When my specific window (or all windows) is closed, I want to switch desks/wrap to my app X/popup a menu/start app X... How? 3.20 I have a multi head setup (multiple screens used under X). How can I tell fvwm to use different configurations for the screens? 3.21 How do I maximize a window but not cover up FvwmTaskBar? 3.22 Why my close button looks pressed in maximized windows? Why don't buttons show on the titlebar of some windows? 3.23 How to define transparent menus? 3.24 How to define transparent modules? 3.25 How to define transparent decorations? 3.26 How about transparent applications too? 3.27 How can I define emacs type multi-keystroke fvwm bindings? 3.28 How do I remove all decorations from a window? 3.29 What's the best way to make on-the-fly config changes? 3.30 How can I toggle a window's layer? 4. Modules 4.1 I'm using FvwmButtons (or GoodStuff in 1.xx), and sometimes the buttons stay depressed, and other times they don't. Why is that? 4.2 When having FvwmButtons swallow an app, is it possible to have button presses assigned to actions as well? For instance, I'd like to swallow xload and have a button press pop up an xterm, or swallow xbiff and have a button press bring up the list of messages. 4.3 I'm seeing odd things when trying to preprocess files with the FvwmM4/Cpp module... 4.4 I heard about this FvwmFileMgr module. Where can I find it? 4.5 I used to use GoodStuff in fvwm 1.xx, but it's not in the 2.xx distribution. What do I use now? 4.6 I want to have the sub panels in FvwmButtons not at their default position near the button but somewhere else on the screen. Is this possible? 4.7 How can I open a sub panel or push buttons in FvwmButtons with a keyboard shortcut? 5. Development, Known Problems & Bug Reports 5.1 I'd really like to see neat feature XYZ in fvwm. Wouldn't that be cool? I even have a patch. When can it be added? 5.2 How do I create/submit/apply patches? 5.3 How do I submit a bug report? 5.4 I have a window that is behaving unexpectedly under fvwm, but just fine under (whatever other window manager), or I have just some random bug. What do I do? 5.5 Why do NumLock, CapsLock and ScrollLock interfere with ClickToFocus and/or my mouse bindings? 5.6 Menus with gradient backgrounds flicker or are very slow. 5.7 Why won't the StartIconic style work with {Netscape, etc.}? 5.8 How do I capture the output (e.g. errors) of fvwm? 5.9 I try to run some program under fvwm, but it dies with an X11 error like BadAccess. The same program works just fine under MWM or OLWM. What's going on? 5.10 Every time I update my install, my currently running fvwm session dies. Why is that? 5.11 After I restart fvwm certain windows or icons raise above all other windows and cannot be lowered by any means. One example are the shortcuts of KFM (the KDE file manager). What can I do about that? 5.12 The StartsOnPage style does not work for me. Why? 5.13 Some modules can not be started when I restart fvwm. 5.14 I'm running Rational Rose and fvwm ignores its windows. 5.15 Although I use the WindowListSkip style for my modules they still show up in FvwmIconMan, FvwmWinList etc. 5.16 When I Maximize an application, sometimes I get gaps around the edges, and other times I don't. What's going on? 6. Miscellaneous 6.1 What exactly is the difference between a DESK, a PAGE, and the SCREEN? 6.2 I'd really like {NeXT, Win95, etc} look and feel. Are you going to support that? 6.3 Where can I get more XPMs for icons? 6.4 Linux XF86 virtual screen size & fvwm interaction... 6.5 I know this question doesn't have to do with fvwm, but what happened to to rxvt and rclock which Rob Nation used to support? Where can I find them now? 6.6 How do I set the background with fvwm? 6.7 When I use Fvwm, my XYZ isn't the right color. What's wrong? 6.8 I just got a mouse with 57 buttons. How do I make Fvwm use them? 6.9 Why does fvwm change my X Cursor theme? 7. Hints and Examples from the Developers 7.1 An easy way to test new configurations. 7.2 Using shell commands for configuration. 7.3 How to start applications on a page or desk other than the current. 7.4 How to start applications on a page or desk other than the current without moving the viewport to the new page or desk. 7.5 A more efficient MWM menu style. 7.6 Placing menus on the screen. 7.7 Are you flipping pages by accident when moving the mouse close to the border of the screen? 7.8 Lining up your windows and icons. 7.9 Moving the mouse/focus/page with the keyboard. 7.10 The cat safe desktop :-) 7.11 Lowering and moving windows. 7.12 Toggling windows on and off. 7.13 Starting applications by clicking on an icon (also known as "docking" applications). 7.14 Positioning a window using arithmetic. 7.15 Hiding the mouse pointer. 7.16 Finding the mouse pointer. 7.17 Autohiding FvwmButtons or other windows. 7.18 Using application screenshots as icon or mini icon thumbnails. ====================================================================== 0 - The most frequently asked question ====================================================================== 0.1 A few minutes after fvwm is started my keyboard and mouse bindings stop working. What can I do? A: Probably your NumLock, CapsLock or ScrollLock key is pressed. See Q 5.5 for more details. Trivia: In all my years as an fvwm developer this has been by far the most frequently asked question. Whoever can solve this problem so that this question is never asked again will be mentioned in big letters on the fvwm home page :-) ---------------------------------------------------------------------- 0.2 I use XMMS, but it ignores some window styles. A: XMMS wants to do everything by itself and overrides many settings of the window manager. Check the options menu in XMMS and if that does not help, ask the XMMS people about it at http://xmms.org/ *Please* do not ask XMMS questions on the fvwm mailing lists and do not report XMMS related bugs before you tried the XMMS mailing lists. No offense meant, but we really have more important things to do than providing user support for third party software. ---------------------------------------------------------------------- 0.3 I like transparency. What can I do? A: See questions 3.23, 3.24, 3.25, 3.26 that deal with transparency. Also see configurations supplied in fvwm-themes package, some themes use transparent menus, modules and/or decorations. E.g.: http://fvwm-themes.sf.net/screenshots/full/transparent.png http://fvwm-themes.sf.net/screenshots/full/transparent.jpg ====================================================================== 1 - About Fvwm ====================================================================== 1.1 What does fvwm stand for? A: "Fill_in_the_blank_with_whatever_f_word_you_like_at_the_time Virtual Window Manager". Rob Nation (the original Author of fvwm) doesn't really remember what the F stood for originally, so we have several potential answers: Feeble, Fabulous, Famous, Fast, Foobar, Fantastic, Flexible, F!@#$%, Flashy, fvwm (the GNU recursive approach), Free, Final, Funky, Fred's (who the heck is Fred?), Freakin', Flawed, Father-of-all, Feivel (the mouse from "An American Tail"), Frungy (hey, where does that come from?), Floppy, Foxy, Frenzied, Funny, Fumbling etc. Just pick your Favorite (hey, there's another one!), which will of course change depending on your mood and whether or not you've run across any bugs recently. I prefer Fabulous or Fantastic myself, although I often use F!@#$% or Freakin' while debugging... Recently 'Feline' is becoming popular. Perhaps this has something to do with the discovery that four of the six core developers have cats (averaging 1.17 cats)? Miaow. Know what? I found another one while stroking my cats: FEEDING :-) Check this link: http://fvwm.org/fvwm-cats/ ---------------------------------------------------------------------- 1.2 Where do I find the current versions of fvwm? A: New main distribution site (official + beta code): ftp://ftp.fvwm.org/pub/fvwm/ Alternate sites: USA: ftp://sunsite.unc.edu/pub/Linux/X11/window-managers/ ftp://ftp.cs.columbia.edu/pub/cheah/ Europe: ftp://unix.hensa.ac.uk/pub/walnut.creek/FreeBSD/incoming/ ftp://ftp.jussieu.fr/pub/X11/fvwm/ ftp://ftp.loria.fr/pub/unix/fvwm/ By the way, 1.24r was the last released version of the 1.xx series and the first official release of 2.xx is 2.2. As of 2.2, an odd second digit denotes development releases and even numbers denote stable releases. ---------------------------------------------------------------------- 1.3 Any WWW Sites about fvwm? A: Yup. The official site is: http://www.fvwm.org/ There are links on the official site to other related fvwm sites. ---------------------------------------------------------------------- 1.4 Where do I ask questions about fvwm? A: If your local fvwm maintainer can't help you, then try the fvwm mailing list. The fvwm discussion mailing list address is: fvwm@fvwm.org And there is an announce mailing list as well: fvwm-announce@fvwm.org They are maintained by Jason Tibbitts, and are Majordomo based mailing lists. To subscribe to the list, send "subscribe fvwm" in the body of a message to -request@fvwm.org. For example, to subscribe to the fvwm mailing list, send a request to fvwm-request@fvwm.org. To unsubscribe from a list, send "unsubscribe fvwm" in the body of a message to -request@fvwm.org. To report problems, send mail to fvwm-owner@fvwm.org. Here's the list descriptions and instructions directly from Jason: ------------------------------------------------------------------ (fvwm) Description ----------- This list is for discussion relating to the fvwm window manager, which is intended to have a small memory footprint and a rich feature set, be extremely customizable and extendible and have a high degree of Motif MWM compatibility. All relevant discussion is encouraged. Posting of binaries or irrelevant discussion is strongly frowned upon. Posting of short patches (less than 200 lines) is acceptable, but all patches should also be sent to the fvwm-workers list (see Q5.2, below) for inspection and possible inclusion in the distribution. Instructions ------------ To send a message to the list, mail to fvwm@fvwm.org. For help on dealing with the mailing list software (for getting the archives or other files which may be made available) send the message "help" to fvwm-request@fvwm.org. If you have problems with the mailing list itself and need to talk to a human, send mail to fvwm-owner@fvwm.org. This address is for mailing list issues only; reports on the fvwm software will be sent to /dev/null. Archives of previous messages are available; to get them send the above mentioned help message and investigate the "index" and "get" commands or ftp them from ftp://ftp.fvwm.org/pub/fvwm/list-archive/. (fvwm-announce) This list is for announcements relating to the fvwm window manager, which is intended to have a small memory footprint and a rich feature set, be extremely customizable and extendible and have a high degree of Motif MWM compatibility. Replies to messages from this list are set by default to go the fvwm discussion list, fvwm@fvwm.org. The current fvwm distribution is available for ftp at ftp://ftp.fvwm.org/pub/fvwm/ ------------------------------------------------------------------ ---------------------------------------------------------------------- 1.5 What are the differences between fvwm 1.xx and 2.xx? A: A lot. To name a few general ones: - Bug fixes. 1.xx is not worked on at all any more. - Better rc file format. No longer order dependent. - More flexible and powerful. For example, many previously global options now operate on a per window group level instead. - More and better modules. - M4 preprocessing is no longer part of the fvwm exec, but rather has been moved to a module. There is also a module to use cpp too. See the FvwmM4 and FvwmCpp man pages. Be sure to check the NEWS file for new or changed features too. ---------------------------------------------------------------------- 1.6 What's the relative memory usage for the various window managers out there? A: Here's a little table comparing some of them. It was done on an AIX based IBM RS6000 model 355 using the same number of windows (3) and XSession to switch between the window managers, and I used 'top' to show the values: SIZE RES 545K 652K fvwm2 (fvwm 2.0.35) 457K 528K fvwm (fvwm 1.24rb) 856K 960K ctwm (ctwm 3.2p1) 1004K 1156K mwm (mwm 1.2) 543K 632K twm (???) 263K 328K aixwm (a simple ugly window manager included w/ aix) Note: This information is terribly outdated. ---------------------------------------------------------------------- 1.7 Why the rename of the various files (fvwm2, .fvwm2rc, fvwm2.man)? A: Some people find this annoying, but it was done for several reasons: - so both 1.xx and 2.xx can be installed for use, in case some people at the same site would rather stay at 1.xx - the syntax of the rc files is pretty different and completely incompatible - when people ask questions, if they explicitly mention their .fvwm2rc file I know that they are running one of the 2.xx versions, since they rarely mention exactly what version they are running. Note, starting from 2.5.1, the executable fvwm2 became fvwm again. Also, starting from 2.5.11, the default config file is either personal ~/.fvwm/config or system wide $datadir/fvwm/config. So, we completely returned to the "fvwm" name. ---------------------------------------------------------------------- 1.8 When will fvwm release X.Y.Z be ready? A: This is always a difficult question to answer. We work on fvwm on a volunteer basis. Things get done when we have the time. Joining the fvwm-workers mailing list might prove instructive. ====================================================================== 2 - Installation ====================================================================== 2.1 I want to use fvwm, but I don't have root access on my machine. Can I still install and run it? A: Very easily, using the '--prefix' flag at configure time. Suppose your home directory is /home/sam. After unpacking the fvwm sources, do "./configure --prefix=/home/sam [other options as needed]'. Now, after building ("make") and installing ("make install"), you will find the binaries in /home/sam/bin, the man pages in /home/sam/man, etc. The modules will be in /home/sam/libexec, and fvwm binary will have this module path built in. ---------------------------------------------------------------------- 2.2 I'm trying to use fvwm under CDE/COSE, but encountering difficulties. Any suggestions? A: Sure - here's one from Graeme McCaffery: ----- Finally I have found out how to run fvwm properly from CDE 8-)) (thanks to Lars Sodergren). First set your home session in Dtwm. That usually is an empty session, though you could have the CDE session manager remember what your desktop was like instead of FvwmSaveDesk etc.. Then you have to set two resources in .Xdefaults: Dtsession*wmStartupCommand: /home/orion/spxgm/bin/Fvwm Dtsession*waitWmTimeout: 1 In this case I run fvwm from a shell script so that library variables etc are set properly for everyone. The waitWmTimeout tells the session manager how long to wait until it starts the window manager. I've set it to 1 second. By default it's 60 seconds. Finally you have to quit with /usr/dt/bin/dtaction ExitSession (or whatever your path is for dtaction) Now you can happily use CDE programs and fvwm. ----- On the other hand, here is a link to a web page that describes how to add multiple window managers to the CDE login menu: http://twirl.mcc.ac.uk/~zzassgl/wm.html ---------------------------------------------------------------------- 2.3 I'm trying to compile fvwm under SunOS using cc, but the compiler is having lots of problems. What gives? A: cc under SunOS is not an ANSI C compiler. Try using acc or gcc instead. ---------------------------------------------------------------------- 2.4 I want colored icons, but they won't work. Why not? When I run configure, it reports "no" to "Have XPM support?" How can I get XPM support? A: Fvwm uses the XPM (X PixMap) library to provide support for colored and shaped icons. XPM doesn't ship with the basic X distribution as provided by The Open Group or XFree86. However, many vendors will bundle it as a standard component anyway. If not, you can get a copy of the source from ftp://ftp.x.org/contrib/libraries/ and build it yourself. If you have XPM on your system, there are a number of ways configure could still decide not to use it. First, if you've installed XPM in a non-standard place (not in the normal system or X11 directories--say in /opt/xpm or /usr/local or similar) then you need to tell configure where to look. Use the --with-xpm-library and --with-xpm-includes options (see INSTALL.fvwm). Typically configure will say "Xpm library or header not found" if this is the problem. Second, your version of XPM may be too old. Fvwm requires XPM 3.4g or better. Typically configure will say "Xpm library version is too old!" if this is the problem. In that case, you'll need to install a newer version. Third, XPM may be mis-installed on your system. If configure says " Xpm library version and header file version don't match!" then this may be the problem. Either use the --with-xpm-library and --with-xpm-includes options to specify more precisely what you want, or try re-installing XPM. Last, there could be a linker error. This is especially common on systems where XPM may be built as a shared library and installed in a non-standard directory (Solaris is a good example). There are some notes about building using shared libraries in the INSTALL.fvwm file. If you can't figure it out, contact the fvwm mailing list. Please be sure to provide the type of hardware and operating system you're using, how you invoked configure, and extract the lines dealing with XPM from the config.log file and include that. ---------------------------------------------------------------------- 2.5 I'm a sysadmin, and if I wanted to force fvwm to read a system rc file and then the user's rc file, how would I do that? A: Well, you could probably do something like this. Have the first line of everyone's ~/.fvwm/config or ~/.fvwm/.fvwm2rc files be 'Read global.config' and have global.config reside in "$datadir"/fvwm (the value of $datadir is set on ./configure step). ---------------------------------------------------------------------- 2.6 I'm a sysadmin, and if I wanted fvwm to look for all of its rc files in a hidden directory, say ~/.fvwm, much like CDE does, how could I do that? A: Fvwm now supports ~/.fvwm search directory by default. This could be probably done similarly to Q2.5 above. The system rc "$datadir"/fvwm/config (or system.fvwm2rc) could do something like: Read Init quiet Read Decors quiet Read Styles quiet Read Functions quiet Read Menus quiet Read Keys quiet Read Modules quiet or whatever breakdown you deemed appropriate, and you would have default versions of these in "$datadir"/fvwm/ that it could find in case the user was missing one of them and you wanted to supply defaults. ---------------------------------------------------------------------- 2.7 How can I use fvwm with GNOME (version <= 1)? A: Since the latest fvwm versions are mostly GNOME compliant, you may simply run GNOME applications, like panel, gmc, gnome-terminal and all others with fvwm. The included fvwm-menu-desktop script (with a massive man page) will help you build fvwm menus for gnome applications. To ensure you run fvwm and not gnome-session, create .Xclients file in your home directory and put a call to fvwm in it. The file ~/.xinitrc can be used for the same purpose if you want to bypass any system-wide logic installed by your distributor or sysadmin. An alternative solution is to run fvwm inside of /usr/bin/gnome-session. After you start gnome-session (don't start fvwm yourself), go to the foot menu in the GNOME panel, then choose System menus / Settings / Desktop / Window Manager and create an entry for fvwm. Fvwm supports session management. If you run gnome-session, SessionInitFunction and SessionRestartFunction are called instead of InitFunction and RestartFunction, see the fvwm man page. StartFunction, for running modules, is called as usual. Here are examples of the GNOME Window Manager hints support in fvwm: o If you run gnome panel inside fvwm without GNOME support, you can't fully use GNOME pager applets (if at all); with GNOME support you can correctly see pages/desks and move windows between them inside applets. You can also use the GNOME Tasklist applet and manage your windows using it. o If you run gmc and bind GnomeButton (see the man page), you can pass root clicks to a gnome application (i.e. to gmc in this case). ---------------------------------------------------------------------- 2.8 How can I use fvwm with GNOME version >= 2 or KDE version >= 2? A: Most standard applications work as any other application with fvwm. However, some features and special applications such as panels, pagers, taskbars and desktops need a special support. Interaction between the window manager, the desktop environment and applications is standardized in the Extended Window Manager Hints specification. fvwm supports this specification since the 2.5.x series (GNOME, GTK, KDE and QT since their version 2). See the "Extended Window Manager Hints" section of the fvwm manual page and the commands and styles which start with "EWMH" for more details. You can use fvwm as the GNOME window manager. For this, start GNOME (gnome-session). The game is to replace the running window manager (sawfish or metacity by default) by fvwm. You may try to type "fvwm --replace&" in a terminal. If this does not work kill fvwm and open the session properties dialog (run "gnome-session-properties&" in a terminal) and change, in the second tab, the metacity (or sawfish) Style value from "Restart" to "Normal" (do not forget to "Apply" this change), so that gnome-session won't restart it when you kill it. Then, run "killall metacity; sleep 1; fvwm &" in a terminal. After you have succeeded starting fvwm you just have to save your session (say via GNOME session logout). The next time you start gnome-session, fvwm will be used (and you do not need to save the session again at logout). Note that if you use gnome-smproxy, and run an FvwmButtons which swallows some applications which use the old session protocol these applications are restarted by gnome-session and FvwmButtons at session restart which can cause trouble. You can also use fvwm as the KDE window manager. KDE is started by a shell script called "startkde". This script starts ksmserver which starts the window manager (kwin by default). To start fvwm you should add the option "-w fvwm" to the ksmserver command line (close to the end of the script). You may copy startkde to startkde_fvwm somewhere in your path, edit startkde_fvwm and finally replace startkde by startkde_fvwm in your X startup script (e.g., ~/.xinitrc, ~/.Xclients or ~/.xsession). Note that ksmserver does not support the fvwm Restart command. You should use "Restart fvwm" for restarting fvwm. But if you do that it is a bad idea to save the session later. ====================================================================== 3 - Features, Configuration, Functions & Commands ====================================================================== 3.1 I use fvwm on a RedHat Linux system and can't figure out how to change my fvwm configuration. I've read the fvwm man page but when I edit my .fvwm2rc nothing seems to happen. What's going on? A: RedHat Linux installs the X server accompanied (by default) by a configuration management system. In earlier releases it was called TheNextLevel and in more recent releases it's called AnotherLevel. For further information about TheNextLevel, consult RedHat's documentation in /usr/doc/TheNextLevel/. For information about AnotherLevel, do a 'man AnotherLevel'. ---------------------------------------------------------------------- 3.2 Is it possible to raise a window when I click into the window itself, not just the border? A: Any version later than 2.0.46 (i.e. 2.1.0 or later) has this feature. In the 2.2.x series, use: GlobalOpts MouseFocusClickRaises With the later 2.3.x betas and after use: Style * MouseFocusClickRaises ---------------------------------------------------------------------- 3.3 How do I get Alt-Tab behavior like another GUI? A: The built in command WindowList provides a very close approximation to the Alt-Tab feature found in another GUI. It doesn't look the same but the following fvwm/config sample will provide a similar interface: Key Tab A M WindowList Root c c NoDeskSort Starting with release 2.3.2, the above key binding is built-in. Starting with release 2.3.15 you can hold the alt key down and keep hitting tab. A single alt-tab selects the previous window. The remainder of this FAQ entry describes releases prior to 2.3.2. Hitting Alt-Tab will pop up the WindowList menu. Unlike another GUI you should not keep the Alt key held down, the menu will stay up until you hit Return/Enter/Space or Escape. You can change focus to a window on the menu by using the up and down arrow keys to move the menu selection and then hitting Return or Enter. Hitting Escape will close the menu without doing anything. The WindowList menu has hot keys assigned for the first 26 windows and you can use the hot key to go directly to the window. The menu invoked with the above line will show all windows in most recently focused order unless you have used the Focus command (see Q3.4). It shows each windows name and geometry with some extra flags to indicate Sticky, OnTop and iconified windows. A simpler style can be used with the following: Key Tab A M WindowList Root c c CurrentDesk, NoGeometry This will just list the windows on the current desk (titles only). The other GUI has the feature of selecting the previous window if Alt-TAB is hit and released quickly. This behavior can be exactly duplicated with 2.5.1 or later but not with earlier fvwm versions. Key Tab A M WindowList Root c c \ CurrentDesk, NoGeometry, CurrentAtEnd, IconifiedAtEnd Similar functionality can be assigned to hitting Alt-TAB twice in quick succession (like a double click for keys): DestroyFunc my_dbltab2 AddToFunc my_dbltab2 + I WindowListFunc DestroyFunc my_dbltab AddToFunc my_dbltab + I Prev (CurrentDesk) my_dbltab2 Key Tab A M WindowList Root c c \ CurrentDesk, NoGeometry my_dbltab There are a lot of options to the WindowList command to control which windows are listed in which order and it may not be possible to set conditions for the Prev command to reliably select the second item when double keying. The WindowList command has no parallel for CurrentPage, Transient, Visible, Maximized, Raised, and pattern matching. The Prev conditions have no parallel for OnTop, Alphabetic and desk sorting. The WindowList menu respects the WindowListSkip style attribute whereas Prev respects the CirculateSkip and CirculateSkipIcon style attributes. ---------------------------------------------------------------------- 3.4 What's the difference between the Focus and FlipFocus commands? A: Both of these commands change the keyboard focus to the target window. They differ only in the way they affect the internally held list of windows. This list is used by the Next, Prev and WindowList commands. The list is normally sorted in most recently focused order with new windows being added to the end. The FlipFocus command plucks the target window from the list and inserts it at the beginning, The Focus command rotates the list around until the target window is at the beginning. The behavior of FlipFocus is also used when changing focus with the mouse and the automatic focus changing when using ClickToFocus style. If you never use the Focus command the list will remain in most recently focused order. If you do use the Focus command the list will gradually get back to most recently focused order as you use FlipFocus. The Focus command is very useful in conjunction with the Next and Prev commands. e.g. Key KP_Add A M Next (AcceptsFocus, CurrentDesk, !Iconic) Focus Key KP_Subtract A M Prev (AcceptsFocus, CurrentDesk, !Iconic) Focus Or for fvwm versions earlier than 2.4.1: Key KP_Add A M Next [CurrentDesk !Iconic] Focus Key KP_Subtract A M Prev [CurrentDesk !Iconic] Focus These bindings allow you to circulate the focus around the windows on the current desk in both directions. If Prev FlipFocus were used the focus would toggle between the top two windows on the window list. If you have several windows on a desk and you want to set the circulation order for the Next and Prev commands you should focus on the windows using the mouse or FlipFocus in the order you want. Fvwm will learn the order and use it for the Next and Prev commands. If you subsequently use the mouse to focus or FlipFocus the order will be lost. ---------------------------------------------------------------------- 3.5 You can bind mouse movements to keystrokes, how about mouse presses? A: Although fvwm has commands for binding movements to keystrokes, controlling the pointer with the keyboard should really be handled by the X server. The following is an excerpt of the X FAQ on this topic: If you have the X Keyboard (XKB) Extension, you can enable mouse keys, which makes it possible to generate mouse motion and button events using the keyboard. Events generated by MouseKeys are completely transparent -- they will work with any application that connects to a server that has the X Keyboard Extension, regardless of whether the application itself uses XKB. XKB is enabled by default in X11R6.1. First, set up the Num Lock key so that Shift+Num_Lock toggles mouse keys: $ xmodmap -e "keysym Num_Lock = Num_Lock Pointer_EnableKeys" (XFree86 3.1.2E is based on R6.1 and has the X Keyboard Extension; it also has a binding to Pointer_EnableKeys in its default keymap. You use Alt+Shift+Num_Lock to toggle MouseKeys on and off. If you are using an earlier release of X or XFree86, you won't have XKB and the instructions will not work. See http://www.XFree86.org/FAQ for more information.) You might also have to turn off server num lock for this to work. Now press "Shift+Num_Lock" to enable MouseKeys. When MouseKeys are on: o) The keypad arrow keys move the pointer o) The keypad '5' key behaves like the 'default' pointer button. o) The keypad '0' key locks the default pointer button (for easy dragging). o) The keypad '.' key unlock the default pointer button (to release a drag). o) The keypad '+' key double-clicks the default pointer button. o) The keypad '/' key sets the 'default' button to Button1 o) The keypad '*' key sets the default button to Button2 o) The keypad '-' key sets the default button to Button3 This is the default configuration, but the mechanism allows for nearly infinite configurability. [thanks to Erik Fortune (erik@westworld.engr.sgi.com), 6/96] ---------------------------------------------------------------------- 3.6 I'd like to bind a key to paste/use the current selection, how can I do that? A: You can't directly with fvwm, but there may be a solution that is more generally applicable - use the program 'xcb' available at ftp://ftp.x.org/contrib/utilities/ or from your favorite mirror. It could probably be used to get the desired effect or close to it. This is most useful for running programs and passing the selection to them (e.g. - invoke your favorite browser with the current selection as the URL). To get a semi-generic paste facility to work, you'll probably need to use 'xse' (see Q3.5). If anyone comes up with a good example of this, please send it to the fvwm mailing list for inclusion here. ---------------------------------------------------------------------- 3.7 Will fvwm ever support a separate colormap for each desktop? A: Doubtful, although I'd like to see it too. I believe that it'd be possible to change the default colormap whenever you switch desks, which would give programs started when that desk is active that colormap, how would you deal with windows being moved across desks? Plus fvwm itself needs certain colormap entries for all of its drawing (borders, menus, etc), so these colors would have to be pre-allocated in all of the colormaps, or something like that. While this all *might* be technically possible, I don't feel that it's really feasible right now (too much code bloat and complexity), especially since most color hog programs (i.e. Netscape) allow you to have them install private colormaps. I may explore this a little at some point in the future though. ---------------------------------------------------------------------- 3.8 I really like the horizontal bars that appear on the title bars of sticky windows. Can I get those on other windows as well? A: Yes. For release 2.3.14 and after, put the line Style * StippledTitle in your fvwm/config (or .fvwm2rc). For earlier releases use GlobalOpts StipledTitles (Yes, the spelling was inconsistent.) ---------------------------------------------------------------------- 3.9 How do I set the Sun keyboard key xxxx to an fvwm command? Or more generally, I'm having problems defining key bindings for fvwm - what can I do? A: From Jon Mountjoy, one of fvwm's users: - Function keys on Sun Keyboard on Top Row are F1 - F8 - Keys on the function keypad on the Left of the Sun Keyboard are F11 == Stop, F12 == Again, ..., F20 == Cut His Example: # Function keys on Sun Keyboard on Top Row Key F1 A N Exec me(netscape) & Key F2 A N Exec me(netscape -install) & Key F5 A N Exec makex(Adder) Key F6 A N Exec makex(Lambda) Key F7 A N Exec makex(Castor) Key F8 A N Exec xterm -T Local & # Keys on the function keypad on the Left of the Sun Keyboard: # F11 = Stop, F12 = Again, ..., F20 = Cut Key F11 AWF N Next (!iconic, CurrentPage) Focus Key F12 AWF N Prev (!iconic, CurrentPage) Focus Key F13 WF N Maximize 100 100 Key F15 WF N RaiseLower "" Key F17 WIF N Iconify "" Key F18 WF N Stick "" Key F20 WIF N Delete "" Key Help AWF N Iconify "" A more general solution is to use xev (usually distributed w/ X11) or xkeycaps (an X11 interface to xmodmap written by Jamie Zawinski, available from ftp.x.org) to find out what the keysym for whatever key you want REALLY is, and use that for binding fvwm commands. ---------------------------------------------------------------------- 3.10 My .fvwmrc from version 1.xx no longer works. What do I do? A: Start with a new one or convert your old one. This can be done by hand or with a little help from the 'fvwm-convert-2.2' in the utils directory. And here is a list of rc file command changes compiled by Makoto 'MAR_kun' MATSUSHITA . It may or may not be 100% accurate or complete, especially as changes evolve, but it's a good start. Note that there have been some changes in 2.1.x and up that are not reflected in the conversion script yet. ** Fvwm-1.xx commands ** ** Fvwm-2.0.x equivalent ** AppsBackingStore (obsoleted) AutoRaise delay (obsoleted, use FvwmAuto) BackingStore (obsoleted) BoundaryWidth Width Style (BorderWidth width) ButtonStyle button# WidthxHeight <- CenterOnCirculate (obsoleted) CirculateSkip windowname Style (CirculateSkip) CirculateSkipIcons Style (CirculateSkipIcon) ClickTime delay <- ClickToFocus Style (ClickToFocus) Cursor cursor_num cursor_type CursorStyle context cursornum DecorateTransients Style (DecorateTransient) DeskTopScale Scale (obsoleted, use FvwmPager) DeskTopSize HorizontalxVertical <- DontMoveOff (obsoleted) EdgeResistance scrolling moving <- EdgeScroll horizontal vertical <- Font fontname MenuStyle (arg4) Function FunctionName AddToFunc (not compatible) HiBackColor colorname Style (HilightFore color) HiForeColor colorname Style (HilightFore color) Icon windowname bitmap-file Style (Icon iconname-file) IconBox left top right bottom Style (IconBox l t r b) IconFont fontname Style (IconFont fontname) IconPath path ImagePath path Key keyname Context Modifiers Function <- Lenience Style (Lenience) MenuBackColor colorname MenuStyle (arg2) MenuForeColor colorname MenuStyle (arg1) MenuStippleColor colorname MenuStyle (arg3) Module ModuleName <- ModulePath path <- Mouse Button Context Modifiers Function <- MWMBorders Style (MWMBorder) MWMButtons Style (MWMButtons) MWMDecorHints Style (MWMDecor) MWMFunctionHints Style (MWMFunctions) MWMHintOverride Style (HintOverride) MWMMenus MenuStyle (arg5) NoBorder windowname Style (NoBorder) NoBoundaryWidth Width Style (HandleWidth width) NoPPosition Style (NoPPosition) NoTitle windowname Style (NoTitle) OpaqueMove percentage OpaqueMoveSize percentage OpaqueResize (obsoleted) Pager X_Location Y_Location (obsoleted, use FvwmPager) PagerForeColor colorname (obsoleted, use FvwmPager) PagerBackColor colorname (obsoleted, use FvwmPager) PagerFont fontname (obsoleted, use FvwmPager) PagingDefault pagingdefaultvalue (obsoleted) PixmapPath ImagePath path Popup PopupName AddToMenu (not compatible) RandomPlacement Style (RandomPlacement) SaveUnders (obsoleted) SloppyFocus Style (SloppyFocus) SmartPlacement Style (SmartPlacement) StartsOnDesk windowname desk-number Style (StartsOnDesk desk-number) StaysOnTop windowname Style (StaysOnTop) StdBackColor colorname Style (BackColor color) StdForeColor colorname Style (ForeColor color) StickyBackColor colorname (obsoleted) StickyForeColor colorname (obsoleted) Sticky windowname Style (Sticky) StickyIcons Style (StickyIcon) StubbornIcons (obsoleted) StubbornIconPlacement (obsoleted) StubbornPlacement (obsoleted) Style windowname options <- SuppressIcons Style (NoIcon) WindowFont fontname Style (Font fontname) WindowListSkip windowname Style (WindowListSkip) XORvalue number <- ** fvwm-1 built-in functions *** Beep <- CirculateDown [ name window_name ] Next (not compatible) CirculateUp [ name window_name ] Prev (not compatible) Close <- CursorMove horizontal vertical <- Delete <- Desk arg1 arg2 <- Destroy <- Exec name command <- Focus <- Function <- GotoPage x y <- Iconify [ value ] <- Lower <- Maximize [ horizontal vertical ] <- Module name ModuleName Module ModuleName Move [ x y ] <- Nop <- Popup <- Quit <- Raise <- RaiseLower <- Refresh <- Resize [ x y ] <- Restart name WindowManagerName <- Stick <- Scroll horizonal vertical <- Title <- TogglePage (obsoleted) Wait name <- Warp [ name window_name ] Next or Prev (not compatible) WindowsDesk new_desk (obsoleted, use MoveToDesk) WindowList arg1 arg2 <- *** New in fvwm-2 ** All AnimatedMove BugOpts BusyCursor DefaultColors DefaultColorset DefaultFont DefaultIcon DefaultLayers Destroy DestroyMenu EdgeThickness Emulate EscapeFunc ExecUseShell HideGeometryWindow KillModule Layer Menu menu-name double-click-action MoveToDesk MoveToPage Next (conditions) command None (arguments) command Pick PointerKey Prev (conditions) command QuitSession Read filename Recapture RecaptureWindow SaveQuitSession SaveSession Silent SnapAttraction SnapGrid StrokeFunc XORPixmap + (more functions are being added from time to time, so please check the man page and the NEWS file too). ---------------------------------------------------------------------- 3.11 What happened to the fvwm 1.xx 'include' command? A: It was actually part of the M4 preprocessing. You can use the 'Read' builtin to get the same effect, or use the FvwmM4 module. ---------------------------------------------------------------------- 3.12 How do I get window titles on sub windows of ... (e.g. Netscape)? A: These windows are known as 'transient' windows because of their short lived nature. To get the window decorations for transient windows you can use the Style command: Style * DecorateTransient or to switch it off: Style * NakedTransient ---------------------------------------------------------------------- 3.13 I just upgraded to version >= 2.3.2, and my configuration settings disappeared! How do I get them back? A: The directory for system-wide configuration files changed from ${sysconfdir} (/usr/local/etc, unless set otherwise at configure time) to a subdirectory, ${sysconfdir}/fvwm. Move your config files by hand and restart fvwm. This change was made because fvwm now installs several files into this directory. ---------------------------------------------------------------------- 3.14 Some applications (e.g. Eterm) don't use the icon I defined for them. Why? A: Eterm provides its own icon and fvwm does not know if it is a plain icon or if Eterm wants to draw into it (like xbiff does when you get new mail). You can explicitly override the application provided icon with a style command: Style IconOverride ---------------------------------------------------------------------- 3.15 I don't like the gaps in my icon box when I de-iconify an application. Is there some kind of auto arrange function? A: Assuming you are using the IconBox option of the Style command this can be done with a tricky fvwm function. Put the DeiconifyAndRearrange function below in your configuration file: DestroyFunc DeiconifyAndRearrange AddToFunc DeiconifyAndRearrange + C Iconify off + C All (CurrentPage, Iconic) PlaceAgain Icon This works with fvwm-2.5.3 and later. Older fvwm releases can achieve the same effect with: DestroyFunc DeiconifyAndRearrange AddToFunc DeiconifyAndRearrange + C Iconify off + C All (CurrentPage, Iconic) RecaptureWindow However, as the Recapture and RecaptureWindow commands may be removed in the future, please use PlaceAgain instead of Recapture if possible. Also, replace all places where you call the Iconify builtin function to de-iconify an icon with a call to the new function. For example, replace DestroyFunc IconFunc AddToFunc IconFunc + C Iconify off + M Raise + M Move + D Iconify off with: DestroyFunc IconFunc AddToFunc IconFunc + C DeiconifyAndRearrange + M Raise + M Move + D DeiconifyAndRearrange and: Mouse 1 I A Iconify off with: Mouse 1 I A DeiconifyAndRearrange ---------------------------------------------------------------------- 3.16 How do I set up an fvwm menu item that shuts down my Linux machine? A: Write a little shell script to run the shutdown command. Install sudo on your system (see the man page, etc.) Set up the sudoers config file to allow you, your wife, etc. to run that script with root permissions. Add a menu item to your fvwm root menu (or wherever) that invokes "sudo /my/script/name". ---------------------------------------------------------------------- 3.17 Although the Recapture command is obsolete, do I still need it to apply certain style changes? A: Excerpt from the man page: There are many commands that affect look and feel of specific, some or all windows, like Style, Mouse, the FvwmTheme module (for fvwm 2.4.x), Colorsets and many others. For performance reasons such changes are not applied immediately but only when fvwm is idle, i.e. no user interaction or module input is pending. Specifically, new Style options that are set in a function are not applied until after the function has completed. This can sometimes lead to unwanted effects. To force that all pending changes are applied immediately, use the UpdateStyles, Refresh or RefreshWindow commands. ---------------------------------------------------------------------- 3.18 When my specific window (or all windows) pops up, I want it to get focus/be moved/be resized/be closed/be shaded... How? A: The following discusses a general solution, you should substitute the application names used in the examples as well as fvwm commands (Move, Iconify, Close) with the ones you need. To get resource names of an application you want to catch, use FvwmIdent module. The first possible approach to achieve what you want is to have a separate function to start your application, like: DestroyFunc StartKedit AddToFunc StartKedit + I Exec exec kedit + I Wait kedit + I Next (kedit) Resize 100p 200p This approach has 3 problems: 1) You need to use StartKedit function to start your application, this will not work if you start it from the command line. 2) If for some reason the application is not started, fvwm waits for it in Wait, you will need to press Ctrl-Alt-Esc. 3) If you have more than one kedit window, it is not guaranteed that the right one is resized. But this approach has one plus - it also enables any fvwm commands that you may want to issue before executing your command. For example, to start kedit window iconic, but not affect its subwindows, you can use: DestroyFunc StartAppIconic AddToFunc StartAppIconic + I Style $0 StartIconic + I Exec exec $0 $1 + I Wait $0 + I Style $0 StartNormal + I UpdateStyles StartAppIconic kedit /tmp/my.txt The second approach is to use FvwmEvent, this solves the first two problems (in fvwm 2.2) or all three problems (in fvwm 2.3 and later). The sample to use with fvwm 2.2.3+ versions (this resizes the newly created window "My Window", supposing you have only one such window): DestroyModuleConfig FvwmEvent* *FvwmEvent add_window SetGeometryForMyWindow DestroyFunc SetGeometryForMyWindow AddToFunc SetGeometryForMyWindow + I Next ("My Window") Move +10p +10p + I Next ("My Window") Resize 100p 200p AddToFunc StartFunction I Module FvwmEvent The sample to use with fvwm 2.3.21 to 2.4.15 versions (consider to upgrade and use the version below). This moves a newly created window named "My Window", and warps a pointer to all new windows regardless of their name: *FvwmEvent-NewWindow: Cmd *FvwmEvent-NewWindow: PassId *FvwmEvent-NewWindow: StartDelay 4 *FvwmEvent-NewWindow: add_window FuncFocusWindow DestroyFunc FuncFocusWindow AddToFunc FuncFocusWindow + I WindowId $0 ("My Window") Move 200p 100p + I WindowId $0 Focus + I WindowId $0 WarpToWindow AddToFunc StartFunction I FvwmEvent FvwmEvent-NewWindow And finally the suggested configuration for 2.5.7+ and 2.4.16+. This moves a newly created window named "My Window", and wraps a pointer to all new windows regardless of their name: *FvwmEvent-NewWindow: StartDelay 4 *FvwmEvent-NewWindow: add_window FuncFocusWindow DestroyFunc FuncFocusWindow AddToFunc FuncFocusWindow + I ThisWindow ("My Window") Move 200p 100p + I Focus + I WarpToWindow AddToFunc StartFunction I FvwmEvent FvwmEvent-NewWindow ---------------------------------------------------------------------- 3.19 When my specific window (or all windows) is closed, I want to switch desks/wrap to my app X/popup a menu/start app X... How? A: Please read the answer to the previous question to understand better. Again, there are two approaches. The first is good in one kind of situations, bad in others: DestroyFunc StartKedit AddToFunc StartKedit + I Exec kedit; xmessage -name DummyWindow -g +10000+10000 "dummy" + I Wait DummyWindow + I Exec xmessage -timeout 10 "Sorry, you can't close kedit" + I StartKedit The second approach is to use FvwmEvent: *FvwmEvent-OldWindow: Cmd *FvwmEvent-OldWindow: PassId *FvwmEvent-OldWindow: destroy_window FuncPopupMyMenu DestroyFunc FuncPopupMyMenu AddToFunc FuncPopupMyMenu # go to the desk 0 when any window is closed + I GotoDesk 0 # popup my menu when "panel" is closed + I WindowId $0 ("panel") Popup MenuFvwmRoot AddToFunc StartFunction I FvwmEvent FvwmEvent-OldWindow ---------------------------------------------------------------------- 3.20 I have a multi head setup (multiple screens used under X). How can I tell fvwm to use different configurations for the screens? A: Fvwm spawns itself into all found screens unless -s command line parameter is specified, as explained in the man page. All spawned fvwm processes by default use the same configuration on each screen. There are several ways to change the default behavior. Write your configuration file as you would if you had only one screen. Then move the screen specific lines into separate configuration files and call them, for example, config. where is the screen number. Usually this will be 0 for the main screen and 1 for the secondary screen. Place the screen specific files in the $HOME/.fvwm directory or whatever you set $FVWM_USERDIR to. Now add this line to your config file: Read config.$[screen] The $[screen] will be replaced with the number of the screen each instance of fvwm is started on. Another method, which should work for older fvwm versions as well, is to specify a separate file for each screen explicitly. For this, start a separate fvwm for each screen in your .xinitrc (or .Xclients): fvwm -s -d :0.0 -f config-0 & fvwm -s -d :0.1 -f config-1 & fvwm -s -d :0.2 -f config-2 Note that only the last command is without a trailing ampersand. If you wish, config-* files may all include "Read config-common". ---------------------------------------------------------------------- 3.21 How do I maximize a window but not cover up FvwmTaskBar? A: Instead of Maximize use "Maximize 100 -30p" where 30 is the width of your FvwmTaskBar. Or use EwmhBaseStruts in Fvwm 2.5.x or later. ---------------------------------------------------------------------- 3.22 Why my close button looks pressed in maximized windows? Why don't buttons show on the titlebar of some windows? A: Fvwm has some builtin idea of what the buttons do, and some applications can request that certain buttons not be shown. For example, it's normal for Fvwm to suppress the iconify button (builtin button 4, the second button from the right) on a transient (dialog) window. The command: Style * DecorateTransient tells fvwm you want titles and buttons on transient windows. Style * MwmFunctions tells fvwm to accept application hints to hide certain buttons. ButtonStyle 2 - Clear MWMDecorMin says button 2 performs the minimize (iconify) function. Mouse 0 2 A Iconify makes any mouse button on button 2 iconify the window. Buttons won't show until some action is assigned to them using Mouse or Key commands. Things to look for in the man page are: DecorateTransient, MwmDecorXXX, MwmFunctions So, if you use Windows-like buttons, then redefine button hints: ButtonStyle 1 - Clear MWMDecorMenu ButtonStyle 2 - Clear ButtonStyle 4 - Clear MWMDecorMax ButtonStyle 6 - Clear MWMDecorMin Finally, this command makes button relief to follow the state: Style * MWMButtons ---------------------------------------------------------------------- 3.23 How to define transparent menus? A: First, it may help to read about colorsets in fvwm and FvwmTheme man pages. We speak about transparency, not translucency here. This means the background of the parent window (for example the root window) will be used for our "transparent" areas, this is not always the window under our "transparent" window. However, it is possible to get a real transparency (i.e. translucency) by applying one patch and using new Colorset Translucent option the patch adds. We do not discuss this here, however you may get this patch with README.patch included from: http://fvwm-themes.sf.net/patch/ To define a transparent colorset, use something like: Colorset 23 Transparent, fg rgb:ff/ff/c4, bg darkgray (you may use any other number greater than 0 instead of 23) There is another way to define transparent colorset, by using RootTransparent instead of Transparent, but please remember, you should use a good utility to set the root background image, like "fvwm-root -r" or "Esetroot" or "wmsetbg", otherwise RootTransparent will not work: Colorset 23 RootTransparent, fg rgb:ff/ff/c4, bg darkcyan The good thing about RootTransparent is that it is possible to automatically calculate the average background color (used for highlighting/shading) and efficiently tint the visible part of the root image using something like: Colorset 23 RootTransparent, fg rgb:ff/ff/c4, bg average, \ Tint black 20, bgTint black 20 If you have enough memory, you may use "RootTransparent buffer" to speed up transparent menus, modules or decorations. If you are not sure whether you use "fvwm-root -r" or similar utility to set the root background, do not use RootTransparent option, use Transparent option without tinting, and set the bg color explicitly. Once a transparent colorset is defined, use it in menus: MenuStyle * MenuColorset 23 See the man pages for a more complete explanation of colorsets. ---------------------------------------------------------------------- 3.24 How to define transparent modules? A: See question 3.23 to learn how to define a transparent colorset (you may reuse the same transparent colorset or define separate colorsets for different modules). Then read the man page for your specific module that you want to make transparent and specify this transparent colorset(s), like: *FvwmPager: Colorset * 23 *FvwmButtons: Colorset 23 *FvwmIconMan: Colorset 23 Style FvwmPager ParentalRelativity Style FvwmButtons ParentalRelativity Style FvwmIconMan ParentalRelativity A side note: the ParentalRelativity option is not always needed. It is not needed if you use RootTransparent or you never intend to move a module inside its parent, or you swallow a module, since FvwmButtons adds ParentalRelativity automatically for swallowed fvwm modules. Otherwise you need Style ParentalRelativity for transparent windows, but doing this for all windows is overhead. Note, that previously "Pixmap none" option was used to define transparency; Pixmap option is obsolete, use colorsets instead. If you swallow FvwmPager (or FvwmIconMan) into FvwmButtons, then you may configure both FvwmPager and FvwmButtons to be transparent or just one of them to be transparent, depending on what you want to achieve. ---------------------------------------------------------------------- 3.25 How to define transparent decorations? A: See question 3.23 to learn how to define a transparent colorset. Only RootTransparent method works for transparent decorations! This basically means that you should use external utilities like "wmsetbg" or "Esetroot" to set background in JPG/GIF/TIFF format and our utility "fvwm-root -r" for XPM/PNG images. To get transparent decorations, use a configuration like this: AddToFunc StartFunction + I Exec fvwm-root -r $HOME/wallpapers/sea.png Colorset 41 RootTransparent buffer, fg white, bg average, \ Tint cyan 15, bgTint cyan 15 # tint is optional Colorset 42 RootTransparent buffer, fg white, bg average, \ Tint red 15, bgTint red 15 # tint is optional Style * Colorset 41, HilightColorset 42 # to use fg and bg BorderStyle Inactive Colorset 42 -- flat BorderStyle Active Colorset 41 -- flat TitleStyle AllInactive Colorset 42 -- flat TitleStyle AllActive Colorset 41 -- flat ButtonStyle All -- UseTitleStyle flat It is possible to define partially transparent decorations too. You may achieve this by adding "AddTitleStyle Colorset NN PP", or even "TitleStyle Colorset NN PP". Please read the man page. Also search in fvwm-themes to see whether some theme provides the window decoration look similar to what you want to achieve. ---------------------------------------------------------------------- 3.26 How about transparent applications too? A: This is not really an fvwm related question, you should find X applications supporting transparency and read their documentation. Depending on the application you should set the root image in one or another way. Usually utilities like fvwm-root (with possible "-r" parameter), Esetroot or wmsetbg should be used. There is a wide range of terminal emulators that may be configured to be transparent, like Eterm, aterm, gnome-terminal and others. Here is an example command line: aterm -ls -sh 70 -bg black -fg white -tr +sb -fn 7x14 -fb 7x14bold Some applications have transparent theme, e.g. gkrellm and xmms. Some applications may show text on the root image, e.g. root-tail. There are a lot of other applications supporting transparency not listed here, search in FreshMeat, http://freshmeat.net/. ---------------------------------------------------------------------- 3.27 How can I define emacs type multi-keystroke fvwm bindings? A: In emacs, keys can be set up as prefix keys, so that once you type the prefix key, a subsequent key has a special meaning. For example, Control-a would normally go to the beginning of a line but Control-c Control-a might do something completely different. There are at least 2 ways to do the same thing with fvwm. The simplest technique is to use the prefix key to invoke a menu and then use the menu hot keys as the second key in the binding. Since menu hot keys don't include modifiers, you can only use plain keys for the second key in the sequence. This second technique lets you use any key for the second key but only works with 2.5.x or later. This approach invokes a function on the first key that defines the action of the second key for a short time and then removes it: DestroyFunc Ctrl-Alt-F-Action AddToFunc Ctrl-Alt-F-Action + I Key X A A Exec xterm + I Key C A A Exec xcalc # optionally popup a prompt window here + I Schedule 5000 Key X A A - + I Schedule 5000 Key C A A - # Press Ctrl-Alt-F and then "x" or "c" Key F A CM Ctrl-Alt-F-Action With this, you press the second key in 5 seconds otherwise the binding for the second key is removed. With fvwm-2.5.24 or later (using SendToModule) a much better solution is: SendToModule buttons-alias PressButton A 1 This would send the FvwmButtons instance "button-alias" a command to invoke the action that button "A" has as though the button were clicked with mouse button 1. For instance: *button-alias: (Id A, Title "My Button", Action (Mouse 1) \ `Exec exec xcalc`) ---------------------------------------------------------------------- 3.28 How do I remove all decorations from a window? A: I see this a lot on IRC. Most people try and do this: Style * !Title, BorderWidth 0 This doesn't always work because many forget about a window having having handles -- which sit on the border. If a window has defined handles, then these effectively override any of border settings -- especially the "BorderWidth" option. But there are Handle equivalents, hence the correct way to remove decorations from a window would be: Style * !Title, !Borders, !Handles To set the BorderWidth of a window which has handles: Style * HandleWidth 5 ---------------------------------------------------------------------- 3.29 What's the best way to make on-the-fly config changes? A: Often is the case, one might want to make config changes to fvwm. Adding them to the .fvwm2rc file (or in more recent releases .fvwm/.fvwm2rc or ~/.fvwm/config) and then restarting fvwm is one way -- but this has problems with memory, especially with Colorset definitions being redeclared, etc. The better approach to making changes is instead to use FvwmConsole which is a way of making live changes to fvwm configs. When you're satisfied that they're correct, then you can add them to your fvwm config file so that they're there the next time fvwm loads, thus reducing the need to restart fvwm. ---------------------------------------------------------------------- 3.30 How can I toggle a window's layer? A: Usually what people want from this, is a means of making a window stay on top for a time, and then putting it back in the layer it was in originally. This is best achieved with a function, as in: DestroyFunc ToggleLayer AddToFunc ToggleLayer + I ThisWindow (Layer 6) Layer + I TestRc (NoMatch) Layer 0 6 This function first of all checks to see if the window that's going to be toggled is in layer 6 (which in this context is assumed to be the layer which is used for the style StaysOnTop -- see the DefaultLayers command for more information), and if it is, to put it in the layer it was previously in. Otherwise, if we didn't do it (because the window in question was in any other layer), the window is put in layer 6. This function can be bound in the usual way, either via the Pick command to some key/mouse binding, or bound to a button on the titlebar, etc. ====================================================================== 4 - Modules ====================================================================== 4.1 I'm using FvwmButtons (or GoodStuff in 1.xx), and sometimes the buttons stay depressed, and other times they don't. Why is that? A: From the FvwmButtons man page: If command is an fvwm Exec command, then the button will remain pushed in until a window whose name or class matches the quoted portion of the command is encountered. This is intended to provide visual feedback to the user that the action he has requested will be performed. If the quoted portion contains no characters, then the button will pop out immediately. Note that users can continue pressing the button, and re-executing the command, even when it looks "pressed in." ---------------------------------------------------------------------- 4.2 When having FvwmButtons swallow an app, is it possible to have button presses assigned to actions as well? For instance, I'd like to swallow xload and have a button press pop up an xterm, or swallow xbiff and have a button press bring up the list of messages. A: Yes, with the alpha release 2.5.0 or any later release. For older releases, read on. The button presses normally get passed through to the swallowed application, but if you put a title on the button, you can assign actions to that. Here's an example that someone sent to the mailing list once: *FvwmButtons(1x4, \ Title 'System Info', \ Swallow "xload" 'Exec xload', \ Action(Mouse 1) 'Exec xosview -cua0 -net 200 -ul -l -geometry 325x325', \ Action(Mouse 2) 'Exec xcpustate -interval 1 -bg "#a4978e" -fg black', \ Action(Mouse 3) 'Exec rxvt -fg "khaki" -bg "dark olive green" \ -fat -n top -T Top -7 -e top' ) And you could come up with something similar for xbiff (untested): *FvwmButtons(1x2, \ Title 'Check Mail' Swallow "xbiff" 'Exec xbiff', \ Action(Mouse 1) 'Exec from | xmessage -file -' ) plus you could bind another button (say Mouse 3) to run your mail program. Sometime in the future I'll probably try and fix it so that you can actually assign a button press over the application itself... ---------------------------------------------------------------------- 4.3 I'm seeing odd things when trying to preprocess files with the FvwmM4/Cpp module... A: Yup, I imagine that you might be. Things like the InitFunction not being called or windows that were running before fvwm started not getting their Borders & Style options set, etc. The reason for all this is because of the fact that FvwmM4 is a module. Fvwm won't be looking at the commands coming back from the module until after it hits the main loop of the code, AFTER the startup is all done and it has already tried to execute the InitFunction. To force synchronous execution of FvwmM4/Cpp use: ModuleSynchronous FvwmM4/Cpp -lock filename See the man page for more details. ---------------------------------------------------------------------- 4.4 I heard about this FvwmFileMgr module. Where can I find it? A: The FvwmFileMgr module disappeared because a file manager doesn't need to be integrated with a window manager and something like xfm does a much better job. I recommend you pick that up instead (from ftp.x.org or your favorite mirror). ---------------------------------------------------------------------- 4.5 I used to use GoodStuff in fvwm 1.xx, but it's not in the 2.xx distribution. What do I use now? A: GoodStuff was renamed to FvwmButtons. Same module, new name (that fits in with the other modules naming convention). ---------------------------------------------------------------------- 4.6 I want to have the sub panels in FvwmButtons not at their default position near the button but somewhere else on the screen. Is this possible? A: Yes, but not with the current implementation of the panels. Please read question 7.12 for instructions. ---------------------------------------------------------------------- 4.7 How can I open a sub panel or push buttons in FvwmButtons with a keyboard shortcut? A: FvwmButtons does not support keyboard shortcuts itself. Since fvwm version 2.3.24 the FakeClick command can be used to simulate a click in the FvwmButtons window: fvwm-2.3.24 or later: DestroyFunc press_fvwmbuttons AddToFunc press_fvwmbuttons + I Next (FvwmButtons, CirculateHit) WarpToWindow $1 $2 + I FakeClick depth 2 press $0 release $0 fvwm-2.5.1 or later (moves the pointer back to the original position): DestroyFunc press_fvwmbuttons AddToFunc press_fvwmbuttons + I SetEnv pointer_x $[pointer.x] + I SetEnv pointer_y $[pointer.y] + I Next (FvwmButtons, CirculateHit) WarpToWindow $1 $2 + I FakeClick depth 2 press $0 release $0 + I WindowId root WarpToWindow $[pointer_x]p $[pointer_y]p With this function, you can warp the pointer to the desired button to press and simulate a click. Call it with press_fvwmbuttons btn xoff yoff ^ ^ ^ | | |___ y offset of the button | |________ x offset of the button |_____________ button to press For example, if the button of a panel is at 30% of FvwmButtons' width and 10% of its height and you want to simulate mouse button 1, issue press_fvwmbuttons 1 30 10 You can bind this to a key. For example: Key f1 a n press_fvwmbuttons 1 30 10 Note that this solution does not work well if the mouse is moved at the same time. With fvwm-2.5.24 or later (using SendToModule) a much better solution is: SendToModule buttons-alias PressButton A 1 This would send the FvwmButtons instance "button-alias" a command to invoke the action that button "A" has as though the button were clicked with mouse button 1. For instance: *button-alias: (Id A, Title "My Button", Action (Mouse 1) \ `Exec exec xcalc`) ====================================================================== 5 - Development, Known Problems & Bug Reports ====================================================================== 5.1 I'd really like to see neat feature XYZ in fvwm. Wouldn't that be cool? I even have a patch. When can it be added? A: If you plan to write a patch, *please*, first of all fetch the latest development release from our web site or better yet use CVS as described in http://fvwm.org/documentation/dev_cvs.php. It is also a good idea to contact the fvwm-workers list. At times, patches for older releases may prove completely worthless, e.g. because the fix has already been integrated, a feature already added or removed or simply because the code is very different to the code you patches. You will do yourself and us a great favor. Otherwise all your hard work may be wasted. People are always requesting or suggesting new features (many of which are great ideas and where a lot of the current features came from). One of the more common ones for example is Windows 95 look and feel (although since this was first written, that particular feature has actually been indirectly implemented via several appearance-affecting features). I'd like to make a statement about this. fvwm is supposed to be small, fast, powerful, and flexible, and sometimes tradeoffs have to be made here. The module interface helps here, as a lot of features that not everyone wants or needs don't have to be in the main module consuming resources for those people that don't want or need them. So if you have a suggestion (or a patch), please think of a way to make it as small and generic as possible if you feel it belongs in the main module. If you plan to make a patch, please contact the fvwm-workers mailing list first. From time to time we are changing the code in a very disruptive way and if you create a patch to a version before such changes were made we will all have a hard time to integrate the patch. Most of the time we will ask you to update the patch for the current code anyway. Bear in mind that we make no guarantees that we'll add any requested feature or apply any submitted patches to the official version, but please don't let this dissuade you from submitting them. We like to get new ideas and we're always curious to see how someone would implement a given feature, even if we never plan to put it in fvwm. Also, we may choose to re-implement any patches submitted, which may change the syntax, functionality, etc. Please don't take offense from that, as we mean no offense and we generally have a good reason (at least by our way of thinking) for our actions... ---------------------------------------------------------------------- 5.2 How do I create/submit/apply patches? A: First of all, please read the first section of the answer to Q5.1! Please add proper entries to the ChangeLog file(s) and possibly to NEWS and AUTHORS files whenever you submit a patch. The ChangeLog lists *all* changed files and functions along with a useful explanation of the change details. The NEWS file mentions all user-visible changes, including bug fixes. Also, do not forget to write a section for the man page if the patch includes new features. You can find more detailed instructions for working with the fvwm sources in the files doc/DEVELOPERS and doc/CONVENTIONS in CVS or the tarballs. Creating a patch against CVS sources (preferable) - 1) Execute "cvs update -AdP" to ensure there are no conflicts with the most recent sources. 2) Don't forget to update the ChangeLog file (see below) and all manual pages if needed. 3) In the base cvs directory run: cvs diff -u >myfeature.patch Creating a patch against released sources - 1) Copy the original file(s) to the same name with the additional extension of .orig (or something like that). 2) Update the ChangeLog file. If you use (x)emacs, move the cursor into the function you changed and hit -x 4 a. This will generate an empty ChangeLog entry in the right file (there are several ChangeLogs). Add a description of what you did. Do this each time you change a function or file (for changes outside of functions). You should update the AUTHORS and NEWS files too if appropriate. Please take the time to add the ChangeLog entries, it makes our work a lot easier. 3) Run diff with either the -c (context) or -u (unified) switch on the sets of files, with the .orig file FIRST. I prefer unified diff's because they are smaller, but sometimes they aren't as readable (and some diff versions don't support unified diffs), so either context or unified diffs are fine (but please, no "plain" diffs). ex: cp fvwm.c fvwm.c.orig ; ; diff -u fvwm.c.orig fvwm.c Submitting a patch - Mail it to the fvwm-workers mailing list . If your patch is large you should compress it (preferably with gzip). Should it still be larger than 25k you might want to to place it on a web page and email the URL to the mailing list or ask on the fvwm-workers list first. Be sure to read the answer to Q5.1. Don't forget the ChangeLog and the documentation. Applying a patch - Get a copy of the program 'patch' from your favorite source, such as ftp://ftp.gnu.org/gnu/patch/, compile it, and then follow its directions (generally just cd into the appropriate directory and run 'patch < patchfile'). ---------------------------------------------------------------------- 5.3 How do I submit a bug report? A: Please do not report any 'bugs' related to XMMS to the fvwm the fvwm mailing lists but send them to the XMMS developers instead. Please write a DETAILED description of your problem. By detailed we mean more than just "my window isn't behaving right" or "I found a bug": - If you want a template for a bug report, see the "fvwm-bug" shell script that comes with fvwm. - Describe the problem as best you can, preferably with suggestions on how to reproduce it easily - If applicable, include information from: xwininfo (preferably w/ the -all option) xprop FvwmIdent xdpyinfo (maybe) - What exact version of fvwm you are running. - What OS & version you are running under - What version of X11 are you running under, and is it an MIT server or a vendor specific server (e.g. the OpenWindow X server under SunOS) - How was fvwm compiled (compiler & version, options, etc) - What settings do you have in your config file that may be pertinent. This should be sent to the fvwm-workers mailing list. ---------------------------------------------------------------------- 5.4 I have a window that is behaving unexpectedly under fvwm, but just fine under (whatever other window manager), or I have just some random bug. What do I do? A: First, check your rc file and your .Xdefaults to make sure that something blatantly obvious in there isn't causing the problem. Second, *PLEASE PLEASE PLEASE* check the FAQ, BUGS, TODO, and man pages. Finally, check the official WWW page and the mailing list archives (which have a search facility) stored there. If you still can't figure it out, report your problem as a bug (see Q5.3). ---------------------------------------------------------------------- 5.5 Why do NumLock, CapsLock and ScrollLock interfere with ClickToFocus and/or my mouse bindings? A: Because they are treated as modifiers. You can use the IgnoreModifiers command to turn individual modifiers off for bindings. With XFree86 and fvwm version 2.4.0 or above, the right command is IgnoreModifiers L25 If you changed your modifiers manually or are using a different X server use the 'xmodmap' command to find out which modifiers correspond to the keys you want to switch off. This command creates a lot of extra network traffic, depending on your CPU, network connection, the number of Key, Mouse or PointerKey commands in your configuration file and the number of modifiers you want to ignore. If you do not have a lightning fast machine or very few bindings you should not ignore more than two modifiers. So do not ignore scroll-lock if you have no problem with it. A better way to solve this problem is to modify the keyboard mapping of your X server. The commands xmodmap -e "clear Lock" xmodmap -e "clear Mod2" xmodmap -e "clear Mod5" remove the CapsLock, NumLock and ScrollLock from the keyboard map. Pressing these keys has no effect then. To re-add them try this: xmodmap -e "add Lock = Caps_Lock" xmodmap -e "add Mod2 = Num_Lock" xmodmap -e "add Mod5 = Scroll_Lock" Fvwm has to be restarted to use the changes made by xmodmap. Please refer to the man page of the xmodmap command for further details. If you disable the CapsLock key in your keyboard map in this way, you can speed up fvwm a bit by removing the Lock modifier from the list of ignored modifiers: IgnoreModifiers Since we all occasionally press NumLock or ScrollLock, it makes sense to redefine some main bindings to work with any modifiers. I.e. consider to replace something like this in your configuration: Mouse 1 R N Menu MenuFvwmRoot with this: Mouse 1 R A Menu MenuFvwmRoot ---------------------------------------------------------------------- 5.6 Menus with gradient backgrounds flicker or are very slow. A: The flickering is caused by fvwm constantly redrawing the menus when a sub menu pops up or down. One way to help this is to use a X server with backing storage (XFree86 has backing storage support, I don't know about other servers but I guess that any decent X server has it). If your Xserver is started with the -bs option, remove it. If not try the -wm option, for example: startx -- -wm You may have to adapt this example to your system (e.g. if you use xinit to start X). If that doesn't help, either because your X server does not have backing storage or because system resources are limited, make sure sub menus do not overlap the parent menu: MenuStyle PopupOffset 1 100 Unfortunately this does not work properly with the fvwm menu style. For the speed problem both suggestions above might help too. Another thing to try is to turn hilighting of the active menu item other than by foreground color off. Put these lines in your fvwm/config after the menu styles have been defined: MenuStyle Hilight3DOff, HilightBackOff MenuStyle ActiveFore ---------------------------------------------------------------------- 5.7 Why won't the StartIconic style work with {Netscape, etc.}? A: The application won't allow it. This has only been observed with Netscape. When Netscape starts up, fvwm starts the main window in the iconic state. Netscape immediately issues another MapRequest, to which the window manager must respond by de-iconifying the window, according to the ICCCM rules. (Netscape can be persuaded to start iconic, however, by invoking it with the -iconic command line flag.) ---------------------------------------------------------------------- 5.8 How do I capture the output (e.g. errors) of fvwm? A: Errors are reported to the standard error file. You can redirect standard error to a file when fvwm is started: "fvwm 2> fvwm-errors". X sessions started by xdm often redirect errors to a file named ".xsession-errors". Alternatively, FvwmConsole or "FvwmForm FvwmForm-Talk" modules will display error messages. ---------------------------------------------------------------------- 5.9 I try to run some program under fvwm, but it dies with an X11 error like BadAccess. The same program works just fine under MWM or OLWM. What's going on? A: The error message usually looks something like this: X Error of failed request: BadAccess (attempt to access private resource denied) Major opcode of failed request: 28 (X_GrabButton) Serial number of failed request: 1595 Current serial number in output stream: 1596 Well, this is telling you that there is a conflict in key/button assignments. In your config you have bound some key/button that this program really wants to bind to an action, but it can't since fvwm has already done so (but you weren't doing it in the rc file for your previous window manager). Figure out what the offending key binding is and remove it from your fvwm/config, or temporarily via "FvwmForm FvwmForm-Talk" by removing the fvwm binding (see the man page for the Key & Mouse commands). ---------------------------------------------------------------------- 5.10 Every time I update my install, my currently running fvwm session dies. Why is that? A: Many OSes swap the program from memory via the image on the disk, and if you overwrite it, and then the current one tries to swap something back into memory before you restart, it'll core dump. To avoid this, rename your old executables or move them to some other directory. The 'mv' command preserves the inode so it won't core dump, but then when you restart fvwm it'll pick up the new copy. ---------------------------------------------------------------------- 5.11 After I restart fvwm certain windows or icons raise above all other windows and cannot be lowered by any means. One example are the shortcuts of KFM (the KDE file manager). What can I do about that? A: Some applications use so called 'override redirect' windows that are not (and cannot be) managed by the window manager. By convention as defined in the ICCCM, such windows must only be displayed for a very short time. KFM and possibly other applications ignore this convention and use permanent 'override redirect' windows, e.g. the KFM shortcuts. Fvwm can not easily detect these windows when it restarts and places the windows managed by fvwm below them. However, since fvwm version 2.3.8 there is a command that will help you, although it might cause trouble with other applications using 'override redirect' windows. We can't make any promises since KFM is violating the conventions and the applications may violate them in different ways. Now the command. Put this anywhere in your config file: BugOpts RaiseOverUnmanaged on ---------------------------------------------------------------------- 5.12 The StartsOnPage style does not work for me. Why? A: Many applications request a specific position where they want to appear (the so called 'program specified position'). Unless fvwm is told explicitly to ignore this, the program specified position overrides the StartsOnPage style. Use this line in your configuration file: Style * NoPPosition ---------------------------------------------------------------------- 5.13 Some modules can not be started when I restart fvwm. A: You may see the following error message on the console: [fvwm][PositiveWrite]: <> Failed to read descriptor: - data available=N - terminate signal=N It means that fvwm has given up waiting for one of its modules to reply, and so has killed it. The length of the timeout is a configuration parameter - try adding ModuleTimeout 10 to your config file. The units are in seconds and the default value is 5. This problem will only occur on slow machines or high system load (many open windows). ---------------------------------------------------------------------- 5.14 I'm running Rational Rose and fvwm ignores its windows. A: This problem might occur on other applications besides the one mentioned. The symptoms as reported by Raymond Toy are: I've been using fvwm for ages and it's always worked for me just fine. However, I've started using Rational Rose for Solaris. fvwm seems to get completely confused. o Fvwm doesn't draw any frames around the Rose window like it does for all other windows (except for those I explicit said not to). o The Rose window is always on top. Nothing I do can bring another window above the Rose window. o Using fvwm's identify window module shows nothing. No identify window pops up showing the window info. o Focus sometimes seems to be lost. (I have focus follows mouse). I have to move the mouse out of the window and back in to get focus. Sometimes I also have to click in the window to get focus. The annoying thing is that this all seems to work with CDE and dtwm. I don't want to have to switch to dtwm so any hints or pointers on where to look to get fvwm to understand this window would help me a lot. Heres what we found out: Rational Rose uses software from Mainsoft that lets MS Windows applications be recompiled to run on UNIX. There are 2 Mainsoft Knowledgebase pages that relate to UNIX window managers: http://www.mainsoft.com/kb_mainwin/kbmw0027.html http://dev.mainsoft.com/Default.aspx?tabid=58 [KBMW0034] These pages suggest that you export MWWM=allwm or MWWM=MWM before starting the application. The first page is missing, but can be found using http://web.archive.org. Raymond reports: This works just fine! Setting MWWM=allwm, Rose comes up like a normal X app where the WM draws the borders. With MWWM=MWM, it works ok too except that for the main window, no borders are drawn by the WM and Rose draws its own borders (I have fvwm respecting MWM decor hints). (This is correct as mentioned by the Knowledgebase pages above.) I don't recall what Rose looks like with dtwm, but I suspect it's quite close to all MWWM=MWM. Next we had Klaus Zeitler report that the Rational Rose official startup script is explicitly setting ALLWM to nothing. This makes it more difficult for an individual user to set this variable. If you can, you can just modify the script, otherwise, your other alternative is to copy the script somewhere where you can modify it and run it from there. ---------------------------------------------------------------------- 5.15 Although I use the WindowListSkip style for my modules they still show up in FvwmIconMan, FvwmWinList etc. A: Make sure you have *FvwmIconMan: UseWinList true in your config file. If that does not help, the modules you are using may not match the fvwm executable. Recompile and reinstall everything and the problem should go away. ---------------------------------------------------------------------- 5.16 When I Maximize an application, sometimes I get gaps around the edges, and other times I don't. What's going on? A: The ICCCM specification allows applications to specify certain properties the window manager should honor, such as aspect ratio (PAspect) or increments to be resized in (PResizeInc). Of course, sometimes these properties won't perfectly match the size of your desktop (or ewmh struts), if that should happen, you will get gaps. In general, the application will have a good reason for doing this (for example, a terminal window may not want to have only part of a column visible), but you can make fvwm ignore the hints with Style * ResizeHintOverride ====================================================================== 6 - Miscellaneous ====================================================================== 6.1 What exactly is the difference between a DESK, a PAGE, and the SCREEN? A: Our naming convention is sometimes a source of confusion, and when discussing problems and the like it's good to maintain a consistent meaning. To illustrate how features of fvwm should be referred to - fvwm has multiple disjoint DESKTOPS, each of which is comprised of M by N PAGES, which are each the size of the physical SCREEN. The physical SCREEN acts as a viewport over one of the PAGES of the current DESK. Here's a picture to clarify (also, take a look at the FvwmPager module): Desk 0 Desk 1 +----------+----------+ +----------+----------+ | | | | | | | Page 0 0 | Page 1 0 | | | | | | | | | | | | | | | | +----------+----------+ +----------+----------+ |+--------+| | | | | ||Page 0 1|| Page 1 1 | | | | || || | | | | |+--------+| | | | | +----------+----------+ +----------+----------+ It shows two 2 x 2 DESKTOPS. If the current DESK were number 0, and the current PAGE were 0 1, the SCREEN would show only the windows located there, plus any sticky ones. Desktops are numbered consecutively, beginning with 0. The user is not responsible for creating new desktops, those details are handled inside fvwm. To display the different desktops, the user can configure key bindings that determine which desktop is displayed. For example, to have the combinations Meta-1 to Meta-4 display desktop numbers 0 to 3, one would add this to her config: Key 1 A M GotoDesk 0 Key 2 A M GotoDesk 1 Key 3 A M GotoDesk 2 Key 4 A M GotoDesk 3 The same can be done for pages. For example, if each desktop has a size of 2 by to pages you could bind Meta-F1 to Meta-F4 to flip pages: DeskTopSize 2x2 Key F1 A M GotoPage 0 0 Key F2 A M GotoPage 1 0 Key F3 A M GotoPage 0 1 Key F4 A M GotoPage 1 1 It is also a good idea to create a pager that displays several desktops, side by side. This command displays the first 4 desktops: Module FvwmPager 0 3 Or if you prefer to see only the current desktop in the pager: Module FvwmPager * * ---------------------------------------------------------------------- 6.2 I'd really like {OpenWindows, NeXT, Win95, Mac, etc} look and feel. Are you going to support that? A: This is not our primary mission, but we think fvwm does a pretty good job of producing these appearances. You may want to take a look at the http://fvwm-themes.sourceforge.net/ package. ---------------------------------------------------------------------- 6.3 Where can I get more XPMs for icons? A: If you want more color icons, grab the ones out of the ctwm distribution (also at ftp.x.org) which has a lot of nice ones. You can also find more in other distributions at ftp.x.org, and at http://www.sct.gu.edu.au/~anthony/icons/ (which has a lot, I believe). Icons used to be distributed along with fvwm. Now there is a basic set of icons available at the fvwm web site. You might find some links at the fvwm web site to other sources of icons. You may want to take a look at the http://wm-icons.sourceforge.net/ package. ---------------------------------------------------------------------- 6.4 Linux XF86 virtual screen size & fvwm interaction... A: Turn off the Linux Virtual Screen stuff in your XF86Config file if you don't like it. The XFree86 virtual screen feature and hardware panning support in certain video cards is a pretty useless kludge when you're using a window manager that implements virtual desktops. ---------------------------------------------------------------------- 6.5 I know this question doesn't have to do with fvwm, but what happened to to rxvt and rclock which Rob Nation used to support? Where can I find them now? A: The official home for rxvt is: http://www.rxvt.org/ and rclock can be found in that rxvt distribution as well. ---------------------------------------------------------------------- 6.6 How do I set the background with fvwm? A: Setting the background image is not really part of the window manager. If you are using one of the Linux distributions, most likely, some part of the distribution is setting the background for you. There is a program shipped with fvwm (fvwm-root, previously known as xpmroot) that you can use to set the background to an XPM or PNG image. Other programs like "xv", "xli", "xloadimage", "display", "feh" and "Esetroot", may be used too, they support some image formats that fvwm-root does not. If you just want a static image on your background, you might invoke one of these programs from your .xsession or .xinitrc file. You can also invoke one of these programs from the StartFunction in your config. The fvwm module FvwmBacker can be used to change the background depending on the desk you are currently on by calling an external program. One big disadvantage of external programs is that changing the background on the fly can be pretty slow. FvwmBacker can use the image defined in a colorset and cached by fvwm for fast background changing. For example: Colorset 10 TiledPixmap foo.xpm Colorset 11 Pixmap bar.png FvwmBacker: Command (Desk *, Page * 0) Colorset 10 FvwmBacker: Command (Desk *, Page * 1) Colorset 11 However, fvwm can handle only xpm, xbm and png images. Other formats must be converted before they can be used in fvwm. If you want to set a different background per screen (i.e., you're using Xinerama), then the program "Nitrogen" can be used to do that. See: http://projects.l3ib.org/nitrogen/ ---------------------------------------------------------------------- 6.7 When I use Fvwm, my XYZ isn't the right color. Whats wrong? A: Under this heading we've had questions about FvwmForm being all white, icons not displaying and messages about being unable to allocate colors. Older hardware uses something called 8 bit color. You can also mis-configure newer hardware so that it's only using 8 bit color. When you use 8 bit color, your display can only have 256 colors on it at once. This is explained in excruciating detail in the http://www.sunhelp.org/faq/FrameBuffer.html If your display can support more than 256 colors, that's the way to go. Look up the documentation for your X server. You may want to start with "man X". If you are stuck with 8 bit color, fvwm can help. In the 2.2.x releases, you can use the "ColorLimit" command to reduce the number of colors Fvwm uses in icons. In the 2.3.x releases and later, ColorLimiting is automatic, but you still might want to use this command to further reduce color use. Other things you may want to do: - Always run Netscape with the "-install" argument. - If you use an image on your screen background, reduce the number of colors it uses. For xv add the "-nc nn" argument. For xli use the "-colors nn" argument. - Don't use color gradients. - Some applications are color hungry. Beware of anything TK based, and FrameMaker in its default setting. If you still have problems after this, try the fvwm mailing list. ---------------------------------------------------------------------- 6.8 I just got a mouse with 57 buttons. How do I make Fvwm use them? A: Okay, we know you don't have 57 buttons, but we've seen reports of up to 7 so far. Starting with Fvwm 2.4.0 Fvwm supports all five mouse buttons that X officially supports, and since 2.5.11, up to 9 buttons are supported by default. 2.5.11 and later: To use more than 9 buttons (up to 31), modify the file libs/defaults.h. Replace #define NUMBER_OF_EXTENDED_MOUSE_BUTTONS 9 with #define NUMBER_OF_EXTENDED_MOUSE_BUTTONS 15 2.4.10 to 2.5.10: To use more than 5 buttons, modify the file libs/defaults.h. Replace #define NUMBER_OF_MOUSE_BUTTONS 5 with #define NUMBER_OF_MOUSE_BUTTONS 7 Then recompile and reinstall fvwm. However, the buttons with numbers higher than 5 do not work as well as 1 to 5. This is because X does not provide the necessary interface to handle more than 5 buttons in some functions. This means that some functionality is not available with buttons 6 and higher. The maximum possible number you can use is 31. Any higher value will probably not work and possibly even crash fvwm or its modules. ---------------------------------------------------------------------- 6.9 Why does fvwm change my X Cursor theme? A: It doesn't. There is a standard set of cursors that should always be available to applications, such as crosshair, left_ptr, arrow, pencil, and so on. Your theme should provide each of these cursors, but some don't. When something (for example, an application or fvwm) requests a cursor that your theme does not provide, X falls back to the default. If you are seeing fvwm using cursors that do not match your theme, you should use CursorStyle to change to a cursor that is available, or find a more complete theme. Note that fvwm does not control what cursors your applications request. ====================================================================== 7 - Hints and Examples from the Developers ====================================================================== 7.1 An easy way to test new configurations. Did you know that you do not need to restart X or fvwm to see what most configuration commands do? There are several modules that allow you to issue fvwm commands at any time. Among these are FvwmCommand, "FvwmForm FvwmForm-Talk" and FvwmConsole. Personally I use FvwmCommand and FvwmConsole. When you run FvwmConsole you get a shell like window where you can type configuration commands that are sent to fvwm. Just add an entry to some menu that starts it: AddToMenu main_menu + "FvwmConsole" Module FvwmConsole Using FvwmCommand is a bit more tricky. To use it you need to start a server in your config by adding this line: Module FvwmCommandS Make sure FvwmCommand is in your search path. Now you can enter commands on the command line of your favorite shell: FvwmCommand "MenuStyle * Font 6x9" Note that you have to quote the command. The advantage of FvwmCommand over FvwmConsole is that you can use your shell with all its features to run commands (command completion and history for example). The disadvantage is that it is a bit slow since a new FvwmCommand has to be started for each command. Other related modules and commands are FvwmScript and PipeRead. ---------------------------------------------------------------------- 7.2 Using shell commands for configuration. Sometimes you might want to use the output of a shell command or script in your config. For example you might need a menu that has all filenames in a certain directory as its entries. You can use the PipeRead command and the FvwmCommand module. I recommend using PipeRead since creating twenty menu items takes a considerable amount of time with FvwmCommand. Example from my config: # make the background menu DestroyFunc MakeBackgroundMenu AddToFunc MakeBackgroundMenu + I DestroyMenu BackgroundMenu + I AddToMenu BackgroundMenu Backgrounds Title + I PipeRead 'for i in `/bin/ls $HOME/.fvwm/backgrounds/*.bg.*`; \ do echo -e AddToMenu BackgroundMenu `basename $i | sed -e \ "s/\.bg\..*$//"` Function SetDefaultBackground $i; done' # set the default background DestroyFunc SetDefaultBackground AddToFunc SetDefaultBackground + I Exec echo -e $0 > $HOME/.fvwm/background + I SetBackground # set a new background DestroyFunc SetBackground AddToFunc SetBackground + I Exec test -r $HOME/.fvwm/background && xv -root -quit -viewonly \ `cat $HOME/.fvwm/background|tr -d "\n"` # activate setting from last session and build the menu AddToFunc StartFunction + I SetBackground + I MakeBackgroundMenu The MakeBackgroundMenu function builds a menu that contains an item for every file that matches the pattern "*.bg.*" in the directory $HOME/.fvwm/backgrounds. The suffix .bg.* is removed. When I select an item the file is displayed in the background using xv. Furthermore the path and filename are stored in $HOME/.fvwm/background. When I start my next fvwm session the filename is fetched from there so I get the background from my last session. I have an even more complex setup for color palettes. ---------------------------------------------------------------------- 7.3 How to start applications on a page or desk other than the current. Use the 'StartsOnDesk' or 'StartsOnPage' style in your config: Style Netscape* StartsOnPage 0 1 or Style Netscape* StartsOnDesk 1 Any window with a title that begins with 'Netscape' will be placed on page 0 1 (desk 1). You will probably want to use these options too: Style * RecaptureHonorsStartsOnPage, CaptureHonorsStartsOnPage If you want to start applications on a different page in the background without switching to this page, use the 'SkipMapping' style: Style Netscape* StartsOnPage 0 1, SkipMapping ---------------------------------------------------------------------- 7.4 How to start applications on a page or desk other than the current without moving the viewport to the new page or desk. Use the SkipMapping style: Style Netscape* StartsOnPage 0 1, SkipMapping ---------------------------------------------------------------------- 7.5 A more efficient MWM menu style. Perhaps you have noticed that with the MWM menu style your sub menus are shown as soon as the pointer enters their menu items, even if you just want to scroll down the list. You can prevent this with the 'PopupDelay' and 'PopupDelayed' options of the MenuStyle command: MenuStyle mwm MenuStyle PopupDelayed, PopupDelay 80 The sub menu will be shown 80 milliseconds after the pointer enters the menu item. You will hardly notice the delay. Note that 80 ms is just long enough to move through the menu with auto repeat on my cursor keys. You may have to experiment with this number to get it right. ---------------------------------------------------------------------- 7.6 Placing menus on the screen. Do you have to close windows or move the pointer all over the screen to find some part of the background where you can bring up your main menu (or any other root menu)? Then you should use a keyboard shortcut. For example Key space A M Menu root c c main_menu in your config gives you the menu 'main_menu' in the center of the screen when you press Alt-space. Or you might want a shortcut to the window menu: Key space A SM Menu root c c WindowMenu You can place menus anywhere you like, not just where the mouse pointer is. Please read the section for the 'Menu' command in the man page. ---------------------------------------------------------------------- 7.7 Are you flipping pages by accident when moving the mouse close to the border of the screen? You can disable page flipping with the EdgeScroll command: EdgeScroll 0 0 in your config turns it off. ---------------------------------------------------------------------- 7.8 Lining up your windows and icons. The SnapAttraction and SnapGrid commands really help to keep your desktop tidy. With SnapAttraction windows (or icons or both) are 'attracted' to each other. When you drag a window (icon) and it comes close to another window (icon) it clings to it without a gap between the borders. Put this command in your config: SnapAttraction 8 SameType This means windows cling to other windows if they get closer than 8 pixels and icons cling to icons. Or if you just want it for windows/icons use SnapAttraction 8 Windows or SnapAttraction 8 Icons Or if you want icons to cling to windows and vice versa: SnapAttraction 8 All The SnapGrid command is a big help too: SnapGrid 8 in your config tells fvwm to use a grid of 8 pixels to place windows and icons. Try it and see if you like it. Hint: It might be a good idea to use a divisor of your desktop width and height for SnapGrid. ---------------------------------------------------------------------- 7.9 Moving the mouse/focus/page with the keyboard. Try these key bindings for mouse movement: # shift- to move a few pixels Key Left A S CursorMove -1 0 Key Right A S CursorMove +1 +0 Key Up A S CursorMove +0 -1 Key Down A S CursorMove +0 +1 # shift-meta- to move 1/4 page Key Left A SM Scroll -25 +0 Key Right A SM Scroll +25 +0 Key Up A SM Scroll +0 -25 Key Down A SM Scroll +0 +25 or these to flip pages # shift-control- to move a full page Key Left A SC CursorMove -10 +0 Key Right A SC CursorMove +10 +0 Key Up A SC CursorMove +0 -10 Key Down A SC CursorMove +0 +10 # Alt-Fn to go to a specific page (like on the Linux console) Key F1 A M GotoPage 0 0 Key F2 A M GotoPage 1 0 Key F3 A M GotoPage 0 1 Key F4 A M GotoPage 1 1 or to change the focus to a window in a specific direction: # number keys on keypad to move the focus Key KP_1 A C Direction SouthWest (AcceptsFocus) Focus Key KP_2 A C Direction South (AcceptsFocus) Focus Key KP_3 A C Direction SouthEast (AcceptsFocus) Focus Key KP_4 A C Direction West (AcceptsFocus) Focus Key KP_6 A C Direction East (AcceptsFocus) Focus Key KP_7 A C Direction NorthWest (AcceptsFocus) Focus Key KP_8 A C Direction North (AcceptsFocus) Focus Key KP_9 A C Direction NorthEast (AcceptsFocus) Focus ---------------------------------------------------------------------- 7.10 The cat safe desktop ^_^ If your cats keep stepping on your keyboard while you are brewing another cup of coffee, one of these hints may help: Use 'Style * MouseFocus' and move the mouse pointer over the background when you go away. If you can't do without your 'SloppyFocus' you can move the mouse pointer into a window that takes no keyboard input and give it the focus (e.g. FvwmButtons or a console message window). A true fanatic creates a separate window with a picture of his cat for this ^_^ ---------------------------------------------------------------------- 7.11 Lowering and moving windows. In some configurations moving a window with the middle mouse button lowers the window after moving it. Lowering it before moving gives you a nice visual effect: Mouse 2 T A Function MoveOrLower DestroyFunc MoveOrLower AddToFunc MoveOrLower + C Lower + M Lower + M Move + D Lower ---------------------------------------------------------------------- 7.12 Toggling windows on and off. It is often desirable to have a menu item or perhaps a button in FvwmButtons or FvwmWharf that launches an application when used the first time and closes it if used a second time. Although it is not obvious how to do this, it is possible. Let's assume you need a menu item that toggles an FvwmConsole window on and off. Then put the following lines in your config (for fvwm-2.5.11 or later): DestroyFync ToggleFvwmConsole AddToFunc ToggleFvwmConsole + I ToggleWindow FvwmConsole "Module FvwmConsole" # Application toggling function # First argument is the window name, second argument is the # command to start the application. DestroyFunc ToggleWindow AddToFunc ToggleWindow + I None ($$0, CirculateHit) $$1 + I TestRc (Match) Break + I Next (currentpage, visible, !iconic, $$0, CirculateHit) Close + I TestRc (Match) Break + I Next ($$0, CirculateHit) Function MakeVisible # Helper function DestroyFunc MakeVisible AddToFunc MakeVisible + I MoveToDesk + I MoveToPage + I MoveToScreen + I Raise + I Iconify off + I WindowShade off To invoke the function, you can add it to a menu AddToMenu + "toggle FvwmConsole" Function ToggleFvwmConsole Or if you prefer a button in the button bar: *FvwmButtons: (Action ToggleFvwmConsole) The lines with MoveToDesk, MoveToPage and Raise will bring the window to the top of the current page if it is not visible instead of closing it. The generic function ToggleWindow can be reused to toggle all kinds of windows. If you want to toggle one specific window, e.g. an xterm, but still want to have other xterms that are not toggled, you must give the window an unique name: DestroyFunc RunXMessages AddToFunc RunXMessages + I Exec exec xterm -T XMessages -n XMessages \ -e tail -f /var/adm/?* ~/.X.err DestroyFunc ToggleXMessages AddToFunc ToggleXMessages + I ToggleWindow XMessages RunXMessages Keep in mind that these functions simply check if a window with the specified name exists. They will happily close manually opened windows or launch an application multiple times if the application is slow to start (e.g. like netscape). For fvwm-2.5.10 or earlier, these functions should work too: DestroyFunc ToggleFvwmConsole AddToFunc ToggleFvwmConsole + I None (FvwmConsole, CirculateHit) FvwmConsole + I Next (FvwmConsole, CirculateHit, CurrentPage, Visible) Close + I Next (FvwmConsole, CirculateHit) MoveToDesk + I Next (FvwmConsole, CirculateHit) MoveToPage + I Next (FvwmConsole, CirculateHit) Raise DestroyFunc ToggleXMessages AddToFunc ToggleXMessages + I None (XMessages, CirculateHit) Exec exec \ xterm -T XMessages -n XMessages -e tail -f /var/adm/?* ~/.X.err + I Next (XMessages, CirculateHit) Close ---------------------------------------------------------------------- 7.13 Starting applications by clicking on an icon (also known as "docking" applications). Normally an icon represents a minimized application. If you want to turn that around, and launch applications by clicking on icons we can't stop you. Heres a way to do that using FvwmButtons: # FvwmButtons icon launcher: DestroyFunc Launcher AddToFunc Launcher + I DestroyModuleConfig $0Launch: * + I *$0Launch: Geometry 64x68 + I *$0Launch: Columns 1 + I *$0Launch: Rows 4 + I *$0Launch: Frame 0 + I *$0Launch: (1x3+0+0, Icon $1, Action (Mouse 1) `Exec $2`) + I *$0Launch: Pixmap none + I *$0Launch: (1x1+0+3, Font 9x15, Fore White, Back DarkBlue, \ Title $0, Action (Mouse 1) `Exec $2`) + I Style $0Launch HandleWidth 0, NoTitle + I Module FvwmButtons $3 $0Launch # Examples: Launcher RXVT xterm.xpm "rxvt -bg black" "-g +0+0" Launcher XV xv.xpm "xv" "-g +0+100" Also, GNOME and KDE have desktop icon applications gmc and kfm, which enable this functionality. These applications may be run under fvwm. Nautilus (version >= 2) and kdesktop may be run under fvwm version 2.5.1 or better. ---------------------------------------------------------------------- 7.14 Positioning a window using arithmetic. This example shows how to center a window on the screen. Note how is uses PipeRead and the shell construct $(()) in order to perform arithmetic. DestroyFunc CenterWindow AddToFunc CenterWindow + I ThisWindow Piperead "echo Move \ +$(( $[vp.width]/2-$[w.width]/2 ))p \ +$(( $[vp.height]/2-$[w.height]/2 ))p" If you had a window named "MyWindow" you would center it using the command: Next (MyWindow) CenterWindow ThisWindow may be removed, it is only needed to avoid errors when CenterWindow is called without a window context. (In which case see the Pick command.) With fvwm release 2.5.11, you can place windows in the center of the screen using "Style X CenterPlacement". But with fvwm release 2.5.22 and greater CenterPlacement is deprecated over the use of PositionPlacement style which allows for not only centering windows, but positioning windows anywhere on the screen using the same arguments as the Move command. But in terms of centering windows: Style MyWindow PositionPlacement Center ---------------------------------------------------------------------- 7.15 Hiding the mouse pointer. Some users don't like the mouse pointer getting in the way of what they are looking at. You might want to search for and install the "unclutter" program. Unclutter hides the mouse pointer after you haven't moved the mouse for a while. If you find unclutter causes the pointer to flash on and off or move around on its own, run unclutter with the -noevents argument. ---------------------------------------------------------------------- 7.16 Finding the mouse pointer. Sometimes its hard to see the mouse pointer. Here is a way to find it: Key Super_L A A Exec xmessage -name "SmallBlob" -bg red \ -fg white -nearmouse -timeout 1 'I am here!' Style SmallBlob UsePPosition, NoTitle, NoHandles, BorderWidth 10 ---------------------------------------------------------------------- 7.17 Autohiding FvwmButtons or other windows. Some applications have a feature usually called "autohiding" which allows to withdraw a window to a location where it does not use precious desktop space. It is possible to write some small functions in fvwm that can hide any window you like: fvwm-2.5.11 or later: # The autohiding functions DestroyFunc autohide AddToFunc autohide + I ThisWindow ($0) Deschedule $[w.id] + I ThisWindow ($0) KeepRc ThisWindow (shaded) WindowShade off + I TestRc (!Match) All ($0, !shaded) autohide_hide $1 $2 DestroyFunc autohide_hide AddToFunc autohide_hide + I Schedule $0 $[w.id] WindowShade $1 + I Schedule $0 $[w.id] Deschedule $[w.id] # Start FvwmAuto AddToFunc StartFunction + I Module FvwmAuto 1 -menter enter_handler # Add the windows you want to autohide DestroyFunc enter_handler AddToFunc enter_handler + I autohide FvwmButtons 500 S # ^ ^ ^ # | | |___ Shade direction (optional) # | |_______ Hide delay (milliseconds) # |___________________ Unique window name/resource Simply add any windows you like to the enter_handler function as in the example above. The autohide function is called with two or three parameters. The first one is the window's name or class, which must be unique. The second is the delay in milliseconds before the window is hidden after the pointer leaves it, and the last - optional - one indicates the direction in which it is hidden (N, S, E, W, NW, NE, SW or SE). You can find a slightly more complicated version below. The difference is that showing the window does not happen immediately, but can be delayed too. fvwm-2.5.11 or later: DestroyFunc autohide AddToFunc autohide + I ThisWindow ($0) Deschedule $[w.id] + I TestRc (!Match) Deschedule -$[w.id] + I ThisWindow ($0) KeepRc ThisWindow (shaded) \ autohide_show $1 $3 + I TestRc (!Match) All ($0, !shaded) autohide_hide $2 $3 DestroyFunc autohide_show AddToFunc autohide_show + I Schedule $0 -$[w.id] WindowShade $1 off + I Schedule $0 -$[w.id] Deschedule $[w.id] + I Schedule $0 -$[w.id] Deschedule -$[w.id] DestroyFunc autohide_hide AddToFunc autohide_hide + I Schedule $0 $[w.id] WindowShade $1 on + I Schedule $0 $[w.id] Deschedule $[w.id] + I Schedule $0 $[w.id] Deschedule -$[w.id] AddToFunc StartFunction + I Module FvwmAuto 1 -menter enter_handler DestroyFunc enter_handler AddToFunc enter_handler + I autohide FvwmButtons 250 500 S # ^ ^ ^ ^ # | | | |__ Shade direction (optional) # | | |______ Hide delay # | |__________ Show delay # |______________________ Unique window name/resource These functions work too in 2.5.8 to 2.5.10, but you may have to remove the KeepRc command from the autohide function in both versions. ---------------------------------------------------------------------- 7.18 Using application screenshots as icon or mini icon thumbnails. With a bit of scripting magic, fvwm can take a screenshot of an application window when it's iconified, resize it, and use it as the application's icon. However, there are some applications that can do it on their own, which is the recommended method. With xterm, you can use the +ai (active icon) option on the command line: $ xterm +ai There is a live-icon elisp package for XEmacs. Put this in your XEmacs configuration file: (load-library "live-icon") ; Control size, same as max icon size, uncomment if you want ; this feature. ;(setq live-icon-max-height 48) ;(setq live-icon-max-width 48) Make sure you are not using the style IconOverride for these applications. It disables the use of active icons. There may be other applications with similar features. Assuming you want application thumbnails as icons provided by fvwm, you need fvwm 2.5.8 or later, as this solution requires the WindowStyle command, and you should have the ImageMagick utilities available in your $PATH . The function below provides a Replacement for the Iconify command called Thumbnail, which you can use in your bindings and raises each window, takes a screenshot and attempts to set the screenshot as the window's Icon. Taking a screenshot may take a couple of seconds. The window is iconified immediately, but the new thumbnail is activated when the screenshot is ready. Note that a screenshot can only be made reliably from the visible parts of a window. So if the window is halfway off screen, on a different desk, or buried beneath other windows, the thumbnail may be smaller than expected or be empty in the hidden parts. There is no way to prevent this. The same solution should work for mini icons. Just replace the word "icon" with "miniicon" everywhere. DestroyFunc Thumbnail AddToFunc Thumbnail + I Raise + I ThisWindow (!Shaded, Iconifiable, !Iconic) PipeRead \ "xwd -silent -id $[w.id] | convert -scale 64 -frame 1x1 \ -mattecolor black -quality 0 xwd:- \ png:$[FVWM_USERDIR]/icon.tmp.$[w.id].png \ && echo WindowStyle IconOverride, \ Icon $[FVWM_USERDIR]/icon.tmp.$[w.id].png \ || echo Nop" + I Iconify You can use FvwmEvent to remove the Icons when each window is returned to its non Iconic state. DestroyFunc DeThumbnail AddToFunc DeThumbnail + I Exec rm -f $[FVWM_USERDIR]/icon.tmp.$[w.id].png + I DestroyWindowStyle *FvwmEvent: deiconify DeThumbnail AddToFunc StartFunction I Module FvwmEvent If you cannot use DestroyWindowStyle as you require it for some other purpose, you can save the window's current Icon, and restore it when required, this solution requires fvwm 2.5.9 or later. The Thumbnail function should look like this: DestroyFunc Thumbnail AddToFunc Thumbnail + I Raise + I SetEnv Icon-$[w.id] $[w.iconfile] + I ThisWindow (!Shaded, Iconifiable, !Iconic) PipeRead \ "xwd -silent -id $[w.id] | convert -scale 64 -frame 1x1 \ -mattecolor black -quality 0 xwd:- \ png:$[FVWM_USERDIR]/icon.tmp.$[w.id].png \ && echo WindowStyle IconOverride, \ Icon $[FVWM_USERDIR]/icon.tmp.$[w.id].png \ || echo Nop" + I Iconify And then the Icon is restored with this function: DestroyFunc DeThumbnail AddToFunc DeThumbnail + I PipeRead "echo WindowStyle Icon \\$\\[Icon-$[w.id]\\]" + I UnsetEnv Icon-$[w.id] + I Exec rm -f $[FVWM_USERDIR]/icon.tmp.$[w.id].png These Icons can also survive a Restart by adding this check to your StartFunction: AddToFunc StartFunction I Test (Restart) All (Iconic) \ Test (f $[FVWM_USERDIR]/icon.tmp.$[w.id].png) WindowStyle \ IconOverride, Icon $[FVWM_USERDIR]/icon.tmp.$[w.id].png You can also check for any remaining icons left behind and remove them in your ExitFunction: DestroyFunc ExitFunction AddToFunc ExitFunction I Test (!ToRestart) \ Exec rm -f $[FVWM_USERDIR]/icon.tmp.* The same solution should work for mini icons. Just replace the word "icon" with "miniicon" everywhere. ---------------------------------------------------------------------- fvwm-2.6.5.orig/docs/fvwm.lsm0000644000175000017500000000151711744241306014254 0ustar vwcvwcBegin4 Title: fvwm (F? Virtual Window Manager) Version: 2.6.5 Entered-date: 2012-04-20 Description: fvwm is an ICCCM-compliant X window manager providing a 3D look for window decorations, multiple discontiguous virtual desktops, a high degree of configurability, and an external module interface for implementing functional extensions. Keywords: window manager, X11, virtual, themes Author: Rob Nation, fvwm workers Maintained-by: fvwm workers list Primary-site: ftp.fvwm.org /pub/ftp 2M fvwm-2.6.5.tar.gz Alternate-site: metalab.unc.edu /pub/Linux/X11/window-managers/ 1k fvwm.lsm 2M fvwm-2.6.5.tar.gz Original-site: Platforms: Unix, X Copying-policy: GNU General Public License End fvwm-2.6.5.orig/docs/Makefile.in0000644000175000017500000003110611744241233014621 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = docs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/fvwm.lsm.in ChangeLog TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = fvwm.lsm CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ EXTRA_DIST = \ ANNOUNCE COMMANDS BUGS CONVENTIONS DEVELOPERS FAQ TODO error_codes\ fvwm.lsm all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): fvwm.lsm: $(top_builddir)/config.status $(srcdir)/fvwm.lsm.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/docs/error_codes0000644000175000017500000002077106610765116015022 0ustar vwcvwc/********************************************************************** * * This file contains the codes needed to descipher an Fvwm Internal * Error. This list is compiled from pieces of the X include files, * but is not actually used by the fvwm code. It is included for * debugging purposes. *********************************************************************/ /************************************************************************* * Request codes * From Xproto.h *************************************************************************/ #define X_CreateWindow 1 #define X_ChangeWindowAttributes 2 #define X_GetWindowAttributes 3 #define X_DestroyWindow 4 #define X_DestroySubwindows 5 #define X_ChangeSaveSet 6 #define X_ReparentWindow 7 #define X_MapWindow 8 #define X_MapSubwindows 9 #define X_UnmapWindow 10 #define X_UnmapSubwindows 11 #define X_ConfigureWindow 12 #define X_CirculateWindow 13 #define X_GetGeometry 14 #define X_QueryTree 15 #define X_InternAtom 16 #define X_GetAtomName 17 #define X_ChangeProperty 18 #define X_DeleteProperty 19 #define X_GetProperty 20 #define X_ListProperties 21 #define X_SetSelectionOwner 22 #define X_GetSelectionOwner 23 #define X_ConvertSelection 24 #define X_SendEvent 25 #define X_GrabPointer 26 #define X_UngrabPointer 27 #define X_GrabButton 28 #define X_UngrabButton 29 #define X_ChangeActivePointerGrab 30 #define X_GrabKeyboard 31 #define X_UngrabKeyboard 32 #define X_GrabKey 33 #define X_UngrabKey 34 #define X_AllowEvents 35 #define X_GrabServer 36 #define X_UngrabServer 37 #define X_QueryPointer 38 #define X_GetMotionEvents 39 #define X_TranslateCoords 40 #define X_WarpPointer 41 #define X_SetInputFocus 42 #define X_GetInputFocus 43 #define X_QueryKeymap 44 #define X_OpenFont 45 #define X_CloseFont 46 #define X_QueryFont 47 #define X_QueryTextExtents 48 #define X_ListFonts 49 #define X_ListFontsWithInfo 50 #define X_SetFontPath 51 #define X_GetFontPath 52 #define X_CreatePixmap 53 #define X_FreePixmap 54 #define X_CreateGC 55 #define X_ChangeGC 56 #define X_CopyGC 57 #define X_SetDashes 58 #define X_SetClipRectangles 59 #define X_FreeGC 60 #define X_ClearArea 61 #define X_CopyArea 62 #define X_CopyPlane 63 #define X_PolyPoint 64 #define X_PolyLine 65 #define X_PolySegment 66 #define X_PolyRectangle 67 #define X_PolyArc 68 #define X_FillPoly 69 #define X_PolyFillRectangle 70 #define X_PolyFillArc 71 #define X_PutImage 72 #define X_GetImage 73 #define X_PolyText8 74 #define X_PolyText16 75 #define X_ImageText8 76 #define X_ImageText16 77 #define X_CreateColormap 78 #define X_FreeColormap 79 #define X_CopyColormapAndFree 80 #define X_InstallColormap 81 #define X_UninstallColormap 82 #define X_ListInstalledColormaps 83 #define X_AllocColor 84 #define X_AllocNamedColor 85 #define X_AllocColorCells 86 #define X_AllocColorPlanes 87 #define X_FreeColors 88 #define X_StoreColors 89 #define X_StoreNamedColor 90 #define X_QueryColors 91 #define X_LookupColor 92 #define X_CreateCursor 93 #define X_CreateGlyphCursor 94 #define X_FreeCursor 95 #define X_RecolorCursor 96 #define X_QueryBestSize 97 #define X_QueryExtension 98 #define X_ListExtensions 99 #define X_ChangeKeyboardMapping 100 #define X_GetKeyboardMapping 101 #define X_ChangeKeyboardControl 102 #define X_GetKeyboardControl 103 #define X_Bell 104 #define X_ChangePointerControl 105 #define X_GetPointerControl 106 #define X_SetScreenSaver 107 #define X_GetScreenSaver 108 #define X_ChangeHosts 109 #define X_ListHosts 110 #define X_SetAccessControl 111 #define X_SetCloseDownMode 112 #define X_KillClient 113 #define X_RotateProperties 114 #define X_ForceScreenSaver 115 #define X_SetPointerMapping 116 #define X_GetPointerMapping 117 #define X_SetModifierMapping 118 #define X_GetModifierMapping 119 #define X_NoOperation 127 /***************************************************************** * ERROR CODES * from X.h *****************************************************************/ #define Success 0 /* everything's okay */ #define BadRequest 1 /* bad request code */ #define BadValue 2 /* int parameter out of range */ #define BadWindow 3 /* parameter not a Window */ #define BadPixmap 4 /* parameter not a Pixmap */ #define BadAtom 5 /* parameter not an Atom */ #define BadCursor 6 /* parameter not a Cursor */ #define BadFont 7 /* parameter not a Font */ #define BadMatch 8 /* parameter mismatch */ #define BadDrawable 9 /* parameter not a Pixmap or Window */ #define BadAccess 10 /* depending on context: - key/button already grabbed - attempt to free an illegal cmap entry - attempt to store into a read-only color map entry. - attempt to modify the access control list from other than the local host. */ #define BadAlloc 11 /* insufficient resources */ #define BadColor 12 /* no such colormap */ #define BadGC 13 /* parameter not a GC */ #define BadIDChoice 14 /* choice not in range or already used */ #define BadName 15 /* font or color name doesn't exist */ #define BadLength 16 /* Request length incorrect */ #define BadImplementation 17 /* server is defective */ #define FirstExtension Error 128 #define LastExtensionError 255 /************************************************************************* * Event Types * From X.h *************************************************************************/ #define KeyPress 2 #define KeyRelease 3 #define ButtonPress 4 #define ButtonRelease 5 #define MotionNotify 6 #define EnterNotify 7 #define LeaveNotify 8 #define FocusIn 9 #define FocusOut 10 #define KeymapNotify 11 #define Expose 12 #define GraphicsExpose 13 #define NoExpose 14 #define VisibilityNotify 15 #define CreateNotify 16 #define DestroyNotify 17 #define UnmapNotify 18 #define MapNotify 19 #define MapRequest 20 #define ReparentNotify 21 #define ConfigureNotify 22 #define ConfigureRequest 23 #define GravityNotify 24 #define ResizeRequest 25 #define CirculateNotify 26 #define CirculateRequest 27 #define PropertyNotify 28 #define SelectionClear 29 #define SelectionRequest 30 #define SelectionNotify 31 #define ColormapNotify 32 #define ClientMessage 33 #define MappingNotify 34 #define LASTEvent 35 /* must be bigger than any event # */ fvwm-2.6.5.orig/docs/TODO0000644000175000017500000001014607315101413013237 0ustar vwcvwc********************************************************************** TO-DO list for fvwm 2.xx ********************************************************************** Please note that not everything on this list will be done, in particular the ones that end in '?' which are really just meant to be 'think about this and perhaps investigate'. But they are things that I didn't want to lose track of. It may periodically get out of date too... ---------------------------------------------------------------------- Cleanups: - Modules should be installed with 'install-exec', rather than 'install-data' target. This requires putting 'exec' in the automake variable for the module directory; i.e. moduledir --> moduleexecdir? ---------------------------------------------------------------------- Bugfixes: - Colormaps and xlock -install -mode blank (& swirl) interaction still isn't 100% correct? ---------------------------------------------------------------------- New stuff: - Allow resizing to leave the x/y ratio intact? - Multi column menus? (for LONG lists) Or scrolling menus? - Access to certain window attribs from .fvwm2rc funcs, and simple if/else capabilities (or perhaps a module to do so)?? - Simple static variables for .fvwm2rc functions (for toggles, etc)?? - Resurrect StubbornPlacement style - Add StickyOnDesk style, to allow stickyness on certain desks only, or perhaps a StaysOnDesk style, to replace StartsOnDesk and work with the Sticky attribute, I'm not sure... Either way, multiple values need to be allowed - Easy module name changes from .fvwm2rc (either using changes in module exec code & rc parser, or in modules themselves) - Improved FvwmPager (add/rename desktops on fly) - A module that just has buttons for the active desktops, like desktop switcher in dtwm (COSE). Could be munged into FvwmPager. - See if it's possible to drop windows onto the pager ala olvwm? - Add option to not show sticky windows in pager. Perhaps also add ability to filter out windows based on name/class/resource? - Module to X Select window Name, Class, Resource, ID, etc...?? - FvwmMsgLog module to pop up a log of fvwm error msgs? - Support for cut in FvwmForm text fields. (It has paste.) - Make FvwmForm have Resource & Class values (All modules should have Class=FvwmModule and Resource=Module_name (not the alias) - Add to module communications to pass titlebar & button window ids to allow modules to muck with those windows (for animation, or whatever)? - Implement (or at least investigate) dynamic loading of functions on systems that support it? AIX - load Linux - dld (gnu) or dlopen (ELF) SunOS, Solaris, OSF - dlopen HP-UX - shl_* I don't know how much of a win this is over modules though. Less portable. Could be useful for changing border and menu styles or adding complex functions to the rc language dynamically. (Actually, this might be a big win for some modules, like the pager, autoraise, and the preprocessor modules - it would eliminate time delays in socket comm. Idea - dynloaded modules add hook functions that module comm functions invoke. Gives modules greater access to fvwm internals, although generic functions should be provided to actually access them. Both types of modules, socket & dyn, could be supported simultaneously?) - A WindowGravity option that controlls placement direction choices for SmartPlacement (and perhaps RandomPlacement)? Perhaps make it a Style option?? - Allow bitmap/mask files to define buttons as well? (Better: new alternate def like hl(x1,y1,x2,y2) sh(x1,y1,x2,y2)) - Add a WaitForExec to force waiting for the last Exec command to finish, or an ExecAndWait function that doesn't return until command is finished (perhaps call it 'System', to match the C function) - Investigate internationalization issues (handling of compound text, messages placed in a message catalog, etc) to see if they should be added at some point. fvwm-2.6.5.orig/docs/ChangeLog0000644000175000017500000007617511552016266014350 0ustar vwcvwc2011-04-15 Thomas Adam * ANNOUNCE: Updated for the latest 2.6.0 stable release. 2011-04-10 Thomas Adam * FAQ: * DEVELOPERS: * DEVELOPER-CVS: Remove any references to Jitterbug, or explicit mention of our old bug tracker, and suggest where instead bugs should be reported (fvwm-workers@) 2011-01-29 Thomas Adam * FAQ: Added note about how to toggle between a window being ontop and in the default layer. 2011-01-08 Thomas Adam * FAQ: Added note about how to apply changes on-the-fly. 2010-08-31 Thomas Adam * FAQ: Added note on how to remove window decorations. 2010-07-16 Thomas Adam * todo-3.0: Added note regarding XTest replacing XSendEvent where applicable. 2010-06-13 Thomas Adam * todo-2.6: Added F5 - discussion about XChangeWindowAttribure(). 2010-06-13 Thomas Adam * todo-2.6: Correct minor typos. * DEVELOPER-CVS: Always suggest running utils/configure_dev.sh -- forget doing it by hand. 2010-04-28 Thomas Adam * todo-3.0: General tidy-up, as well as note for .in file via configure. 2010-04-03 Thomas Adam * ANNOUNCE: Updated for the 2.5.29 release. 2010-04-03 Thomas Adam * DEVELOPERS: * DEVELOPER-CVS: Add new file "DEVELOPER-CVS" -- a verbatim copy of cvs.html -- to aggregate the information in one place. 2010-04-03 Thomas Adam * todo-2.6: Add discussion point for using XIM for UTF-8 mappings. 2010-04-03 Thomas Adam * todo-2.6: Add observation about recursive commands. 2010-02-26 Viktor Griph * todo-2.6: Add discussion point regarding EWMH toolbars. 2010-02-25 Thomas Adam * todo-2.6: Add release-stopping note for investigation into a possible replacement/removal of fvwm-menu-desktop as the entire underying data structure isn't true anymore. 2010-01-03 Thomas Adam * FAQ: Minor grammatical corrections (P. Vojta). 2010-01-02 Thomas Adam * todo-2.6: Update to reflect development status. Move items around -- make fvwm-convert-2.6 and updating sample fvwm2rc files release critical. Mark some items as closed recently. 2009-09-20 Viktor Griph * ANNOUNCE: updated for 2.5.28 release 2009-08-26 Viktor Griph * DEVELOPERS (Preparations): Add note about using -Wdeclaration-after-statement when possible 2009-03-17 Mikhael Goikhman * COMMANDS: regenerated (by create-commands) * todo-2.6: close items E.11, E.12 2009-02-27 Thomas Adam * todo-2.6: Deprecate the "Closed recently" section, since this file is updated so infrequently, the term "recently" was in 2005, when at the time of writing, it's 2009. Instead, add all closed bugs under "Closed" from now on. 2009-02-23 Dominik Vogt * ANNOUNCE: updated for 2.5.27 release 2008-05-07 Dominik Vogt * ANNOUNCE: updated for 2.5.25 release 2008-01-08 Viktor Griph * DEVELOPERS: add instructions on how to update the html documentation 2007-11-24 Dominik Vogt * DEVELOPERS: updated release instructions * ANNOUNCE: updated for 2.5.24 release 2007-09-01 Dominik Vogt * DEVELOPERS: updated release instructions * ANNOUNCE: updated for 2.5.23 release 2007-08-28 Viktor Griph * ANNOUNCE: updated 2007-08-28 Dominik Vogt * ANNOUNCE: updated 2007-08-07 Dominik Vogt * BUGS: * todo-2.6: * FAQ: write fvwm in lower case 2007-08-05 Dominik Vogt * fvwm.lsm.in: removed FVWMNAMEUCASE 2007-01-20 Dominik Vogt * ANNOUNCE: updated for 2.5.22 release 2007-01-15 Viktor Griph * ANNOUNCE: updated for 2.5.20 release 2007-01-06 Viktor Griph * todo-2.6 (todo): close C.5. Tested placement with gtk+2 sample app, works well. 2006-12-09 Viktor Griph * ANNOUNCE: updated for 2.5.19 release 2006-12-08 Viktor Griph * todo-2.6 (todo): added B11: bug #1647, default charset selection. * FAQ: updated some outdated URLs. 2006-09-17 Viktor Griph * todo-2.6: finished C.23 2006-09-11 Dominik Vogt * ANNOUNCE: updated for 2.5.18 release 2006-07-19 Dominik Vogt * ANNOUNCE: updated for 2.5.17 release 2006-07-13 Viktor Griph * todo-vars: add a line indicating the need for a 'raw'-filter. 2006-03-21 Serge Koksharov * CONVENTIONS: * FAQ: corrected typos 2006-02-11 Mikhael Goikhman * todo-vars: add specification of fvwm variables 2006-02-10 Mikhael Goikhman * COMMANDS: regenerated (by create-commands) * FAQ (5.2): fix small typo 2006-02-09 Dominik Vogt * FAQ (Q5.2): updated instructions for submitting patches 2006-01-20 Dominik Vogt * ANNOUNCE: updated for 2.5.16 release 2006-01-14 Dominik Vogt * ANNOUNCE: updated for 2.5.14 release * DEVELOPERS: Updated. 2005-10-24 Viktor Griph * FAQ: Changed CenterWindow function in Q7.14 to work with oversized windows. 2005-10-18 Viktor Griph * DEVELOPERS (Preparations): fixed a typo 2005-08-24 Dominik Vogt * ANNOUNCE: updated for 2.5.14 release 2005-07-16 Dominik Vogt * DEVELOPERS: updated for gcc-3.x 2005-03-09 Dan Espen * FAQ: Spelling correction from Thomas Adam. A spell check yielded a few more spelling problems. Updated unclutter FAQ entry to mention the -noevents fix for pointer movement. 2005-02-25 Dan Espen * FAQ (3.23): Typo. 2004-12-21 Mikhael Goikhman * docs/FAQ (1.7): improve wording 2004-12-12 Dominik Vogt * FAQ: (5.16) added 2004-10-10 Dominik Vogt * FAQ (7.17): Updated 2004-10-06 Dominik Vogt * ANNOUNCE: updated for 2.5.12 release 2004-09-30 Dominik Vogt * ANNOUNCE: updated for 2.5.11 release 2004-09-10 Dominik Vogt * FAQ (6.9): Added cursor theme question (6.8): Updated 2004-09-01 Dan Espen * FAQ (6.8): Fix text to use same number of buttons as subject line. 2004-07-19 Dominik Vogt * FAQ (7.12): updated 2004-05-31 Dan Espen * todo-2.6: Finished item E.4. 2004-05-30 Dan Espen * docs/FAQ: Add note about using CenterPlacement in positioning window with arithmetic question. 2004-05-18 Mikhael Goikhman * docs/FAQ: rework 3.22 2004-04-21 Mikhael Goikhman * docs/FAQ: * docs/todo-2.6: new default ~/.fvwm/config file is now recommended instead of still supported ~/.fvwm/.fvwm2rc 2004-04-21 Dominik Vogt * FAQ: Corrected Q3.3 2004-04-14 Dominik Vogt * FAQ: Added Q7.18 2004-03-19 Dominik Vogt * ANNOUNCE: updated for 2.5.10 release 2004-03-02 Dominik Vogt * ANNOUNCE: updated for 2.5.9 release 2004-02-15 Dan Espen * FAQ: add emacs type keybindings description. 2004-02-05 Dominik Vogt * FAQ: added hint on FvwmBacker's caching capabilities using colour sets 2004-01-17 Marcus Lundblad * todo-2.6: added bug regarding editing multi-byte encoded text in FvwmScript 2003-12-08 Mikhael Goikhman * FAQ: added questions "How to define transparent menus/modules/decorations?" 2003-11-01 Dan Espen * FAQ: Attempt to explain why button assignments might not work. 2003-10-31 Mikhael Goikhman * ANNOUNCE: updated for 2.5.8 release 2003-10-25 Mikhael Goikhman * COMMANDS: regenerated (by create-commands) 2003-10-11 Mikhael Goikhman * docs/DEVELOPERS: improved instructions a bit 2003-09-28 Dominik Vogt * FAQ (Q7.17): improved autohide script 2003-08-07 Dan Espen * FAQ (Q 2.7, 2.8): Lang checks. 2003-08-07 olicha * FAQ (Q 2.8): New Q/A "How can I use FVWM with GNOME version >= 2 or KDE version >= 2?" (Q 2.7): GNOME --> GNOME (version <= 1). (Q 7.13): Mention also nautilus and kdesktop 2003-07-07 Mikhael Goikhman * COMMANDS: regenerated (by create-commands) 2003-07-06 Dominik Vogt * CONVENTIONS: added a draft of project maintenance and coding conventions 2002-07-01 Mikhael Goikhman * DEVELOPERS: replaced web page regeneration instructions 2003-05-06 Dominik Vogt * FAQ (Q 0.2): redirect XMMS questions to xmms.org 2003-05-05 Uwe Pross * FAQ: removed link wrappers 2003-04-26 Dominik Vogt * FAQ (Q 4.7): explain how to control FvwmButtons with key presses (Q 7.17): official autohide implementation 2003-04-19 Mikhael Goikhman * ANNOUNCE: added dedication 2003-04-15 Mikhael Goikhman * FAQ: WindowListFunc is executed now within a window context, so "WindowId $0" is not needed anymore in its definition 2003-04-07 Uwe Pross * FAQ: Removed spaces before heading in the answer section. 2003-03-11 Dominik Vogt * FAQ (Q 5.13): no XMMS bug reports please 2003-03-10 Dominik Vogt * FAQ (Q 7.13): updated 2003-02-28 Dominik Vogt * ANNOUNCE: updated for 2.5.6 2003-02-17 Dan Espen * FAQ: New hints, hiding the mouse pointer, finding the mouse pointer. 2003-01-12 Mikhael Goikhman * COMMANDS: now autogenerated by a script shown in "fvwm-perllib man FVWM::Commands" 2002-12-14 Mikhael Goikhman * COMMANDS: some changes and corrections 2002-12-11 Dan Espen * COMMANDS: Finish first pass. 2002-12-10 Dan Espen * COMMANDS: A few more one liners. 2002-12-08 Mikhael Goikhman * Makefile.am: don't include outdated 1994 files color_combos and m4_hacks to DIST, include file COMMANDS to DIST 2002-12-02 Dominik Vogt * ANNOUNCE: updated for 2.5.5 2002-10-24 Mikhael Goikhman * FAQ: reworded 6.7 question; added info to the 5.5 and 6.6 answers 2002-09-13 Dan Espen * FAQ: Update 4.3 for ModuleSynchronous vs. FvwmM4/Cpp. 2002-09-06 Mikhael Goikhman * DEVELOPERS: updated 2002-08-26 Mikhael Goikhman * COMMANDS: a new file with one line description for all existing commands * ANNOUNCE: added missing 2.5.3 announce 2002-08-23 Dominik Vogt * DEVELOPERS: updated 2002-08-16 Dominik Vogt * DEVELOPERS (Preparations): * fvwm.lsm.in: use new configure macros to fill in defaults 2002-08-14 Dan Espen * FAQ: Added Maximize but don't cover (3.21), and Positioning a window using arithmetic (7.15). Remove hot-spot information since its in the man page. 2002-08-12 Dan Espen * FAQ: Add hot-spot information. 2002-08-06 Dominik Vogt * DEVELOPERS: updated building info 2002-08-05 Dominik Vogt * DEVELOPERS (Preparations): updated building info 2002-07-21 Dominik Vogt * FAQ (3.15): Updated new DeiconifyAndRearrange function using PlaceAgain 2002-06-12 Mikhael Goikhman * docs/DEVELOPERS: small changes in the last "realizing" sections 2002-05-22 Mikhael Goikhman * FAQ (7.12): updated 2002-04-25 Mikhael Goikhman * ANNOUNCE: updated for 2.5.1 2002-03-10 Dominik Vogt * DEVELOPERS: updated 2002-03-05 Dan Espen * DEVELOPERS: Fixed up some typos. 2002-01-29 Dominik Vogt * FAQ: corrected typos and updated some outdated answers 2002-01-07 Dominik Vogt * FAQ (5.5): updated 2001-12-16 Dominik Vogt * FAQ: some corrections 2001-11-10 Dominik Vogt * FAQ (6.8): add a comment about the maximum possible number of mouse buttons 2001-11-09 Dan Espen * FAQ: 6.8, mouse with 57 buttons. 2001-09-05 olicha * ANNOUNCE: PlacedByFvwm 2001-08-05 Dominik Vogt * FAQ (3.4): updatedy 2001-07-28 Dominik Vogt * FAQ: replaced CurrentScreen with CurrentPage in example 2001-07-19 Dan Espen * FAQ (5.14): Update Rational Rose information. 2001-07-17 Dan Espen * ANNOUNCE: Update for FvwmIconBox. 2001-07-15 Dan Espen * ANNOUNCE: Updated for 2.4.1. 2001-06-28 Dominik Vogt * fvwm.lsm.in: * FAQ: updated for 2.4.0 pre release 2001-05-24 Mikhael Goikhman * FAQ (7.13): minor syntax change 2001-05-24 Dan Espen * FAQ: Add gmc and kfm as possibilities for question 7.13. 2001-05-10 Mikhael Goikhman * FAQ (5.1, 5.2): enhanced patch questions by suggesting to use cvs diff 2001-05-01 Dan Espen * FAQ: Update alt-tab answer. 2001-03-31 Mikhael Goikhman * FAQ (2.7): improvements 2001-03-24 Mikhael Goikhman * ANNOUNCE (New utilities): updated 2001-03-24 Dominik Vogt * ANNOUNCE (Highlights): typo corrections 2001-03-23 Dan Espen * ANNOUNCE: Changes. 2001-03-24 Dominik Vogt * ANNOUNCE: spell checked and sorted announcement 2001-03-22 Dan Espen * FAQ: Colormap question 6.7. 2001-03-18 Dan Espen * FAQ: Fix date in "last updated line". 2001-03-14 Dan Espen * FAQ: Document when MouseFocusClickRaises changed to a Style. 2001-03-11 Dominik Vogt * TODO: * FAQ: * BUGS: replaced lines looking like cvs conflict markers 2001-02-25 Dominik Vogt * FAQ (7.12): small enhancement (7.10): typo correction 2001-02-13 Dan Espen * FAQ (2.2): Include Dtsession in CDE resources. 2001-01-27 Dominik Vogt * FAQ (5.15): New question about WindowListSkip and modules 2000-12-18 Dan Espen * FAQ (5.14): New URLs for Mainsoft Knowledgebase pages. 2000-11-26 Mikhael Goikhman * FAQ (3.20): enhanced 2000-11-26 Dominik Vogt * FAQ (3.20): how to use different config files for multi head. 2000-11-20 Dominik Vogt * FAQ (0.1): added *the* most frequently asked question in a prominent place (1.1): Updated the 'F' question. 2000-11-18 Dominik Vogt * FAQ (5.5): corrected typo 2000-11-03 Dan Espen * ANNOUNCE: Getting closer to completion, mention GlobalOpts. 2000-10-10 Mikhael Goikhman * FAQ: several updates and new questions: 2.7 How can I use FVWM with GNOME? 3.18 When my specific window (or all windows) pops up, I want.. 3.19 When my specific window (or all windows) is closed, I want.. 2000-09-26 Dan Espen * ANNOUNCE (Highlights): Mention conversion program. 2000-09-16 Mikhael Goikhman * docs/ANNOUNCE: corrections, updates and small comments * docs/fvwm.lsm: now generated from fvwm.lsm.in 2000-09-07 Dan Espen * FAQ (5.14): Add solution for Rational Rose problem. 2000-08-29 Dan Espen * FAQ (5.5): Add note about restarting fvwm after using xmodmap. 2000-08-28 Dan Espen * ANNOUNCE (Highlights): Added faster startup. Some explanation of layers. Clarified the announcement of EscapeFunc. 2000-05-03 Dominik Vogt * FAQ (3.17): added question about Recapture/Refresh 2000-04-15 Dan Espen * FAQ (3.8): Support pre-2.3.14 stippled titles. 2000-04-12 Dan Espen * FAQ: Added launcher example. 2000-04-01 Dan Espen * FAQ (6.6): Added question about backgrounds. 6.3: Updated icons question. 2000-03-24 Dominik Vogt * FAQ (5.13): added question about ModuleTimeout command 2000-03-13 Dan Espen * ANNOUNCE (Highlights): Document FvwmGoodStuff's demise. 2000-02-28 Dominik Vogt * FAQ (3.8): fixed answer 2000-02-14 Dan Espen * ANNOUNCE: Some more updates and comments. 2000-02-08 Dominik Vogt * FAQ (5.12): new question about why StartsOnPage doesn't work without NoPPosition. 2000-02-04 Dominik Vogt * FAQ: removed references to old GlobalOpts command * FAQ (5.1): (5.2): updated 2000-01-02 Dominik Vogt * FAQ (3.10): updated 1999-12-16 Dominik Vogt * ANNOUNCE: some updates and comments 1999-12-13 Dominik Vogt * FAQ: fixed typo 1999-12-12 Dan Espen * ANNOUNCE: First pass on 2.4 announcement. 1999-12-04 Dan Espen * FAQ: Fix link to CDE page, I had a = instead of a dash. and make it look a little more like a link. 1999-11-26 Dan Espen * FAQ (CDE): Added link to proceedure that shows how to add one or more window managers to the CDE login menu. 1999-11-25 Dominik Vogt * FAQ: some updates 1999-11-14 Dominik Vogt * FAQ (7.12): (4.6) FAQ for 'toggling' buttons and menu entries ispell session 1999-09-19 Dominik Vogt * FAQ: removed some cut-and-paste trash (5.11): FAQ for RaiseOverUnmanaged bug option 1999-08-15 Dominik Vogt * Y2K-Compliance: * fvwm.lsm: * FAQ: * BUGS: remaned fvwm2 -> fvwm 1999-08-12 Dominik Vogt * FAQ (3.16): added question on how to shut down Linux from a menu 1999-08-09 Dan Espen * Makefile.am: remove text and man page generation files, they are now in fvwm-web. 1999-08-08 Dominik Vogt * FAQ (6.1): Added hint on how to bind keys for page or desk flipping as suggested by Paul E. Johnson. 1999-08-01 Dominik Vogt * FAQ (3.15): Corrected hint to work on current page (7.3): Added hint to SkipMapping Sun Jul 11 10:42:20 1999 DanEspen * TODO (Bugfixes): Remove TODO items: "Allow env var to specify an additional read directory ($FVWMRCDIR or $FVWMHOME or something similiar)?" (Its done.) "Add better overall icon handling options?" (I can only guess what it meant, but I think the default box covers it.) "Support for passwords in FvwmForm" You can set the fg/bg color on a field by field basis. "Fix line spacing in FvwmForm for lines that have only text (no buttons) so that FvwmForm can be used as a "Help" form." Done. "Run profiling on FVWM to see if I can speed it up any more" Its been done. (We could dispense with the TODO file completely and rely on Jitterbug instead.) 1999-07-04 Dominik Vogt * DEVELOPERS: updated realese building procedure * Makefile.am: removed references to removed web pages Thu Jul 1 22:32:28 1999 DanEspen * Moved web stuff into fvwm-web. 1999-06-24 Dominik Vogt * FAQ (3.15): added a hint how to get auto arranging icons 1999-06-23 Dominik Vogt * FAQ (3.14): added a FAQ entry for Eterm icons 1999-06-18 Dominik Vogt * index.html: added fvwm-cats link * links.html: updated/removed a few links (WM icons, Fvwm95, Bowman) Tue May 25 20:04:12 1999 DanEspen * mod_m2f_communication.html: Added description of InitGetConfigInfo. * TODO (Bugfixes): Added note, part of the "Make GetConfigLine be more intelligent" is done. 1999-05-22 Dominik Vogt * FAQ (5.1): updated Sun May 2 09:41:01 1999 DanEspen * FAQ (A): Starting with 2.3.2, alt-tab is builtin. Sat May 1 20:05:56 1999 Steve Robbins * mod_f2m_communication.html: module types documented in libs/Module.h 1999-04-30 Dan Espen * Makefile.am (HTML): Remove man-pages.html * run_man2html.sh (curr_section): Use nroff -man instead of the previous kludge. Invoke cut and find without the full path. Get the ".1" out of the file name. * man-pages.html: This file is now obsolete, and removed. * README: New instructions for using run_man2html.sh. * run_man2html.sh: Do all the man pages using "find" and generate the man page index. Mon Apr 26 13:13:02 1999 Steve Robbins * links.html: add link to fvwm2gnome page. 1999-04-26 Dan Espen * txt2html.sh (outfile): Changed so that greater than and less than can appear in output document as links. * FAQ (A): Added link to fvwm-cats. Fri Apr 23 14:37:36 1999 Steve Robbins * FAQ (3.13): document the change of FVWM_CONFIGDIR to $sysconfdir/fvwm. 1999-04-14 Dominik Vogt * TODO (Bugfixes): updated 1999-04-08 Dominik Vogt * fvwm.lsm (Copying-policy): GPL 1999-04-04 Dominik Vogt * TODO: updated * BUGS: updated Sun Apr 4 03:03:22 1999 Steve Robbins * DEVELOPERS: a couple of rewordings, especially about autoreconf vs. autoconf. * cvs.html: add link to daily snapshots, a note about `cvs -q', a note about autoREconf, and that you can rename checked-out directories. Also fixed HTML coding bugs:

and tags were interdigitized. 1999-03-28 Dominik Vogt * FAQ (5.5): added a warning about IgnoreModifiers performace, added instructions to disable modifiers 1999-03-19 Fred Maciel * FAQ: spell corrections and better explanation for FvwmM4/Cpp odd behavior. Sat Mar 20 15:19:37 1999 DanEspen * FAQ: Change references to FvwmTalk. * TODO (Bugfixes): Change references to FvwmTalk. * man-pages.html: Remove FvwmTalk, add FvwmAnimate. Mon Mar 15 22:47:01 1999 Steve Robbins * DEVELOPERS (Building a distribution): removed the note about enabling all optional subdirectories, as there are no longer any optional subdirectories. Sat Mar 13 11:17:48 1999 Steve Robbins * DEVELOPERS: added note about implementing features in modules rather than mainline code (from Matthias Clasen). Added note about using JitterBug. 1999-03-12 Paul D. Smith * Makefile.am (HTML): Removed version.html. * version.html: Removed; the information here is superceded by that in download.html, and this file isn't referenced anywhere. Fri Mar 12 00:30:36 1999 Steve Robbins * run_man2html.sh: change `#' to `#!' on first line. Bug noted by Ram Bhamidipaty. 1999-03-07 Dominik Vogt * FAQ (4.2): Fixed typos in example (5.2): Q16 -> Q5.1 1999-03-06 Dominik Vogt * mod_initialization.html (descriptors): * mod_m2f_communication.html: * mod_f2m_communication.html: Rerenamed builtin functions Send_ConfigInfo <- SendConfigInfo Send_WindowList <- SendWindowList set_mask <- SetMask Sat Mar 6 11:43:27 1999 DanEspen * links.html: Added link to Jay Kuri's copy of the Module Documentation in Palm Pilot format. 1999-03-05 Dominik Vogt * mod_initialization.html (descriptors): * mod_m2f_communication.html: * mod_f2m_communication.html: Renamed builtin functions Send_ConfigInfo -> SendConfigInfo Send_WindowList -> SendWindowList set_mask -> SetMask * features.html: * BUGS: updated "ICCCM 1.1" to "ICCCM 2" Thu Mar 4 00:42:09 1999 Steve Robbins * TODO: removed item about coalescing PixmapPath with IconPath. Thu Mar 4 00:31:59 1999 Steve Robbins * mod_m2f_communication.html: * mod_f2m_communication.html: * FAQ: documented IconPath, PixmapPath change to ImagePath. Sun Feb 28 08:29:59 1999 Steve Robbins * DEVELOPERS: added Paul Smith's "Rules of the Road". Sat Feb 27 11:19:51 1999 Steve Robbins * DEVELOPERS: document "autoreconf" step upon initial checkout. 1999-02-26 Steven Michael ROBBINS * cvs.html: * DEVELOPERS: document "automake --add-missing" step upon initial checkout. Tue Feb 23 10:31:22 1999 Steve Robbins * links.html: updated changed links, removed some dead links and one happily obsolete one -- my old v2.0.46 autoconf patches. 1999-02-19 Dominik Vogt * download.html: updated for 2.2 * version.html: updated for 2.2 * fvwm.lsm: updated for 2.2 * ANNOUNCE: Updated for 2.2 1999-02-18 Dominik Vogt * FAQ: restructured FAQ and incorporated configuration-hints file * configuration-hints: file removed 1999-02-15 Dominik Vogt * configuration-hints: Added new file. * ANNOUNCE: updated for 2.1.13 1999-02-14 Dominik Vogt * Makefile.am (EXTRA_DIST): removed fvwm-2.xx.lsm from distribution * FAQ (15): Added RedHat configuration question 1999-02-04 Paul D. Smith * cvs.html: Update CVS pserver hostname. * links.html: Update web site, ftp site, and mailing list URLs. * FAQ: Ditto. * download.html: Ditto. * ftp.html: Ditto. * fvwm-2.2.lsm: Ditto. * mailinglist.html: Ditto. * version.html: Ditto. * fvwm-2.xx.lsm: Ditto. 1999-02-02 Paul D. Smith * FAQ: Rewrote question 13 about XPM support. 1999-01-19 Paul D. Smith * ANNOUNCE: Update. * FAQ: Update new URLs. 1999-01-19 Steven Michael ROBBINS * cvs.html: Major overhaul, bringing it up-to-date with current conventions. Added links to the GNU tools needed for building the CVS tree. * DEVELOPERS: Fixed a bug in the recipe for building a distribution (use "cvs tag", rather than "cvs rtag"). Also updated to reflect the situation after the auto*-generated files are removed. * BUGS: Removed Xpm library v4.7 coredump note. The configure script now ensures up-to-date xpm is used. Added note about removing config.cache file before reconfiguring. 1999-01-18 Paul D. Smith * BUGS: Remove install-strip issue. Sun Jan 17 16:07:15 1999 Steve Robbins * FAQ: Fiddled with answers to: 4, 7, 13, 24, 32, 40. A few other spelling fixes. 1999-01-16 Bob Woodside * docs/FAQ: Removed Question 20 (why do Motif popups disappear under the window with Autoraise in effect, etc.?). This no longer happens as of 2.1.8. Added Question 49 (why can't I use StartIconic with Netscape, etc.?). 1999-01-16 Dominik Vogt * ANNOUNCE: updated for 2.1.8 1999-01-04 Dan Espen * version.html: Changed to ask for bug reports to be entered into the Fvwm bug tracking system. * download.html: Changed to ask for bug reports to be entered into the Fvwm bug tracking system. Tue Dec 1 15:33:26 1998 DanEspen * download.html: Updated beta download URL to 2.1.4. 1998-11-30 Dan Espen * download.html: Updated beta download URL to 2.1.3. Added link to /pub/fvwm. * index.html: Corrected URL for bug tracking system. 1998-11-25 Dan Espen * index.html: Linked main page to bug tracking system. * black-stone1.jpg: A little darker version. 1998-11-23 Dan Espen * man-pages.html: removed -man from the file names. 1998-11-12 Dan Espen * cvs.html (Deleting Directories and Files): Added description of file deletion process. * cvs.html (Getting_Updates): Added example of how to resolve a conflict during an update. Tue Nov 10 07:11:44 1998 Steve Robbins * Makefile.am: Fixed up the list of files *again*. 1998-11-05 Steven Michael ROBBINS * cvs.html: Fixed the examples of anonymous CVS. Added a note that the head of the CVS tree is alpha code. * Makefile.am: Fixed up the distributed-files list to include all the HTML Dan added yesterday. 1998-11-05 Dan Espen * txt2html.sh (outfile): Replaced txt2html.ksh with txt2html.sh. Added logic to handle '<>&' special characters in text. 1998-11-04 Dan Espen * README: * black-stone1.jpg: * index.html: * fvwm.gif: * download.html: * features.html: * mailinglist.html: * docs.html: * modules.html: * mod_changes.html: * mod_concept.html: * mod_security.html: * mod_initialization.html: * mod_m2f_communication.html: * mod_f2m_communication.html: * links.html: * txt2html.ksh: Added The main docs come from the web site, the module docs are restructured, and updated. fvwm-2.6.5.orig/docs/ANNOUNCE0000644000175000017500000000053111744240713013705 0ustar vwcvwcFVWM 2.6.5 ========== * New features: - FvwmPager now wraps window names if SmallFont is set. * Bug fixes: - Made signals registered with FVWM unblocking. - The "UnderMouse" option to PositionPlacement now honors the EWMH working area by default, if it's in use. - FvwmButtons handles the deleted window correctly for sub-windows. fvwm-2.6.5.orig/docs/fvwm.lsm.in0000644000175000017500000000145410655355425014671 0ustar vwcvwcBegin4 Title: fvwm (@FVWMNAMELONG@) Version: @VERSION@ Entered-date: @RELDATENUM@ Description: fvwm is an ICCCM-compliant X window manager providing a 3D look for window decorations, multiple discontiguous virtual desktops, a high degree of configurability, and an external module interface for implementing functional extensions. Keywords: window manager, X11, virtual, themes Author: Rob Nation, fvwm workers Maintained-by: @FVWMWORKERSLISTLONG@ Primary-site: @FVWMFTP@ @FVWMFTPDIR@ 2M fvwm-@VERSION@.tar.gz Alternate-site: @FVWMALTFTP@ @FVWMALTFTPDIR@ 1k fvwm.lsm 2M fvwm-@VERSION@.tar.gz Original-site: Platforms: Unix, X Copying-policy: GNU General Public License End fvwm-2.6.5.orig/docs/Makefile.am0000644000175000017500000000026607702072376014624 0ustar vwcvwc## This is a -*- Makefile -*- ## Process this file with automake to create Makefile.in EXTRA_DIST = \ ANNOUNCE COMMANDS BUGS CONVENTIONS DEVELOPERS FAQ TODO error_codes\ fvwm.lsm fvwm-2.6.5.orig/docs/BUGS0000644000175000017500000000577410656151546013263 0ustar vwcvwcHerein lies the (partial?) list of Known Bugs. Further bug reports (or even better, solutions) can be sent to the fvwm mailing list (see the FAQ for address and how to PROPERLY report bugs). See 'Bugfixes' section of the TODO list for additional known bugs and be sure to have a look at the bug tracking system that can be reached from our home page. ********************************************************************** ********************************************************************** - No geometry can be specified for FvwmButtons panels. - FvwmSave and FvwmSaveDesk are not up to date. - xscreensaver may not be able to allocate a private colormap - AutoHide in FvwmTaskBar does not work well. See 'EdgeThickness' command in the man page. - A piperead command may hang if used in .fvwm2rc (if the pipe is never closed). - StartsOnPage does not work as expected? Please read the manpage carefully. ********************************************************************** ********************************************************************** Configure remembers too many things, particularly with respect to the optional libraries. If you ever need to re-run configure, using different --with options, please remove "config.cache" file first. ---------------------------------------------------------------------- Binding a key to a window decoration but not to the window itself is discouraged because when the key-press event finally gets to the window it will be marked as SYNTHETIC and will be ignored by many applications. ---------------------------------------------------------------------- Sending DESTROY window manager options to applications is a bad way to close them and should only be used as a last resort. Strange things can happen. Please try CLOSE first. ---------------------------------------------------------------------- Some users have seen intermittent problems with XEmacs version 19.13 not being refreshed correctly after a restart of fvwm. If this occurs, you should be able to open a new frame and delete the old one. I can't debug this, as I don't see this problem. I don't know if the problem is from XEmacs, fvwm, or something specific to a few user's setups. ---------------------------------------------------------------------- Some users have been getting odd startup problems, like total lockups. I cannot reproduce this, and have no idea why. Let me know if you see this and find a way to consistently reproduce it. ---------------------------------------------------------------------- Fvwm attempts to be ICCCM 2 compliant. In addition, ICCCM states that it should be possible for applications to receive ANY keystroke, which is not consistent with the keyboard shortcut approach used in fvwm and most other window managers. In particular you cannot have the same keyboard shortcuts working with your fvwm and another fvwm running within Xnest (a nested X server). The same problem exists with mouse bindings. ---------------------------------------------------------------------- fvwm-2.6.5.orig/docs/CONVENTIONS0000644000175000017500000001655510410662510014311 0ustar vwcvwcThis document tries to list all the conventions that the fvwm developers adhere to, either by consensus through discussion, common practice or unspoken agreement. It is hopefully useful for the fvwm development newbie. Do not take these 'rules' as religious duties. All of this can be discussed if need be. If you add items to or modify items in this list, add your name and the reasoning for the change. ! = This rule *must* be followed * = Less strict rules o = Suggestions A. Programming Languages ! The following programming languages are allowed: - ANSI C - Perl - Portable /bin/sh scripts for examples. All other languages - specifically C++ - are not allowed since they cause portability problems. [dv] B. New Code Files * There are templates for new code files in the fvwm directory. Try to always use them as they provide a clean structure of the header and code files. Please honour the section titles. For example, put all static functions (and only static functions) under the "local functions" section. [dv] ! All .c files *must* have #include "config.h" as the first non-comment line. Otherwise the settings made by the configure script may not be used. This can cause random problems. [dv] * Add a comment "/* -*-c-*- */" at the beginning to tell (x)emacs it is a C source file even if it was renamed to something like foo.c.bak. [dv] C. File Names * The names of the code files in the fvwm directory are in lower case. [dv] * Files in the libs directory may begin with a capital 'F'. This letter is reserved for wrapper files for third party libraries or modules. For example, FShape is an abstraction of the XShape X server extension and FBidi is a wrapper for the fribidi library. Do not use the 'F' for other purposes. [dv] D. Copyright Notices * A copy of the GPL should be at the beginning of all code files (.c) and scripts, but not at the beginning of header files (.h). [dv] E. Code Formatting * Follow the Linux Kernel Coding Rules. Specifically: [dv] * Indent with TABS only. The TAB width is eight spaces. Reasoning: This limits the space available for nesting blocks in functions. For long functions, it is easier to read. Also, a properly formatted file can be read with any editor as long as it has at least 80 columns and a TAB width of 8 or less. [dv] o Always place curly braces on a separate line. In some cases, placing braces on the same line as other code confuses (x)emacs. [dv] * Use no more than 79 columns per line. If you have trouble to fit the code in 79 characters, think how you could move some of it to a separate function. Note: Due to a bug in xemacs, it is sometimes not possible to start the editor window with 80 columns. It comes up either with 79 or 81 columns. Hence the rule to no use 80 columns per line. [dv] * Try to keep functions short. A function should not consist of more than one or two screen pages. Reasoning: Improves readability. [dv] * Always keep code maintenance in mind. Break down complex expressions into a series of smaller expressions and leave the optimizing work to the compiler. It is of utmost importance that your code is easy to understand. [dv] F. Coding ! Global variables are forbidden. Full stop. [dv] * Chose meaningful function and variable names. But keep in mind that C guarantees only 32 character to be used. [dv] * Flag variables should always begin with auxiliary verbs. For example: is_new, do_restart, has_this, use_that, etc. Reasoning: when you look at the flag variable out of context, you immediately recognise it as a flag. If you name a flag for example restart or new, this may not be clear without looking up the definition. [dv] o The names of local helper functions with limited functionality may begin with two underscores. For example "__local_function". These functions *must* be declared static and *must not* be ever exported. Reasoning: this is a visual aid for code maintenance. When you encounter a function with such a name you know that it contains limited local functionality. [dv] * Comment your code liberately, but do not explain the obvious. It is often better to chose meaningful function and variable names. G. Formatting text files * Indent text files with spaces and do not use more than 79 colums. Do not use TABs in text files. [dv] * Some of the supplementary text files in the distribution are regulary posted to mailing lists. According to the most strict version of the Nettiquette I found, no more than 67 columns must be used in these files. These files are - NEWS - FAQ - ANNOUNCE Note: (x)emacs auto-fill-mode is very useful to do this. [dv] o You may add the literal string "-*-text-*-" in the first line of the file to tell (x)emacs that it is a text file. [dv] ! If you are unsure about your knowledge of the English language, ask for help on the mailing list when you write documentation. [dv] o In English, the full stop ('.') or colon (':') is usually followed by two spaces instead of one. Reasoning: Improves readability. [dv] H. Release Management * New patches may be tried out in the development versions (with an odd second digit in the version number). Features may be changed, renamed or removed at any time. [dv] ! In the stable versions, features can not easily be changed or removed. For backwards compatibility think of the least disrupting way of doing changes. [dv] * As you may conclude from above two items, try to never add experimental features close to the next stable release. Once the feature is made available in a stable version, it becomes virtually impossible to back it out or change its syntax. [dv] I. Maintaining the NEWS * In the development versions, only new, removed and changed features must be mentioned in the NEWS. [dv] * There is currently some discussion whether features that were added in a prior development release and are renamed or removed later, before the next stable release, should be deleted from the NEWS or not. [dv] ! In the stable versions, all changes to any file *must* be mentioned in the NEWS. This is important since the NEWS file is sent as part of the release announcement. Users must be able to judge whether they want the new release or not. [dv] J. Maintaining the ChangeLog ! The ChangeLog is meant to ease code maintenance. With proper and detailed entries, the ChangeLog can dramatically reduce the time needed to find problems and fix bugs. [dv] ! Every change *must* be ChangeLog'ed as detailed as possible. To generate a ChangeLog entry while you are coding, press "C-x 4 a" in (x)emacs. [dv] ! If at all possible, put *all* names of modified files and functions in the ChangeLog. [dv] * Please do not use wildcards in the ChangeLog entries. If you modified fvwm.c and fvwm.h, do not write "fvwm.[ch]" or "fvwm.{c,h}" or "fvwm.*". Reasoning: wildcards make it virtually impossible to grep through the ChangeLog. [dv] K. Maintaining Man Pages ! Every feature must be described with all options in the man page. [dv] * The man page has its own formatting rules. See fvwm/fvwm.1.in for details. [dv] fvwm-2.6.5.orig/docs/DEVELOPERS0000644000175000017500000002610311550303237014146 0ustar vwcvwc Notes for Developers -*-text-*- -------------------- Last updated on 08-Jan-2006 You will need to install several GNU tools to be able to use the cvs sources. If you do not have these tools available, build from the tar file distribution instead, available from ftp.fvwm.org. To build from the CVS sources, you will need: * GNU gcc * GNU make * autoconf (version >= 2.53) * automake (version >= 1.4) After the *initial* checkout of the sources, (see DEVELOPER-CVS or cvs.html) you will need to execute the following commands from the top of the source tree. aclocal autoheader automake --add-missing autoconf There will be some warnings, which are ignorable as long as you get a working configure script: the configure script will fix all those problems. Now, configure and build as per INSTALL.fvwm and INSTALL. If configure fails, please look through `config.log' for clues. Development Rules of the Road ----------------------------- 1) _Every_ change must be properly ChangeLogged, listing the name of the changed function. If you use Emacs, you can do this oh-so-trivially with the "C-x 4 a" command; it will add a header (if it's a new day), the name of the file, and even the name of the function you're currently in. There is a vim-script utils/changelog.vim that does the same when yoi type ":ChangeLog". If you start adding them as you change functions, it'll soon become second-nature and we'll get proper ChangeLogs. If you don't use Emacs, please mimic the format of all the other log entries when adding your own. 2) If you make a user-visible change please add a blurb about it to the NEWS file. A couple sentences is fine; don't repeat the documentation but give folks enough of an idea so they can decide if they want to learn more. Bug fixes (unless they're _really_ user visible) shouldn't be noted in the NEWS file. 3) If you add a new user-visible feature, don't forget to update the appropriate man pages at the same time! 4) Bug fixes may be committed at any time (unless we're in code freeze for a release), usually without much review (unless you want someone else to look at it). All our code freezes, etc. are merely procedural, not enforced, so it's important you read fvwm-workers and keep up-to-date with the current state of the tree. 5) New features should be discussed on the list to ensure everyone thinks they're "appropriate" (one of the goals of fvwm is to be relatively efficient, remember, which means we don't necessarily want the kitchen sink). 6) If the new feature is large enough, unstable enough, or not targeted at the next release, it should go on a private branch. Otherwise, consensus will probably have it installed on the main branch. 7) Before adding a new feature think twice if it could perhaps be implemented as a module (perhaps after some extension of the fvwm<->module communication protocol). Moving features in modules helps to keep fvwm itself clean and efficient. 8) See CONVENTIONS for more details. ** Of course, compile and test before committing! ** Dealing with CVS ---------------- All details about dealing with CVS should be found in cvs.html or DEVELOPER-CVS. Go look there! Changing a Makefile ------------------- First of all, NEVER edit anything named Makefile or Makefile.in. These are both derived from the corresponding Makefile.am. The most common reason for editing is to change the list of sources. Steps: 1. edit foo/blah/Makefile.am 2. re-run "make" from the top of the build directory Step 2 will take care of rebuilding the Makefile.in and Makefile from your changed Makefile.am. Makefile.am has a simple format, basically: bin_PROGRAMS = fvwm fvwm_SOURCES = blah.c blah.h foo.c foo.h ... Notice that you have to add all files, C-code *and* headers, to the _SOURCES line. This is vital, because this is the list of files that are packed into the distribution. If you leave one out, nobody will be able to build the distributed tar file! Changing configure.ac --------------------- The most common reason to do this is to change the version string. If you're editing it for any other reason, I will assume you know what you're doing. Steps: 1. edit configure.ac, and find the line containing AM_INIT_AUTOMAKE(fvwm, x.y.z) at the top of the file 2. change x.y.z to the new version string 3. re-run "make" from the top of the build directory Step 3 will take care of rebuilding the configure script, and usually all the other Makefiles. Building an official distribution --------------------------------- By this, I mean the files fvwm-x.y.z.tar.gz and fvwm-x.y.z.tar.bz2. It is important to do all steps in the given order! Preparations: - Make sure you have all optional libraries installed. - When building a release, update the CVS sources first. For a stable release it is best to throw away the whole source tree and check it out from scratch to ensure all source files have been added to CVS. - Change the dates in configure.ac and fill in the release date in NEWS. Note: For releases prior to 2.5.3, the date has to be updated in docs/fvwm.lsm.in and fvwm/fvwm.1 instead of configure.ac. - Verify that the version variable at the very beginning of configure.ac has the value of the going to be released version and set ISRELEASED to "yes". It should be "yes" in the released tarballs. - Update docs/ANNOUNCE file. For the first version of a major release (e.g. 2.6.0) all user visible changes have to be mentioned. For the following maintenance releases *all* code changes have to be listed. This is usually done by copying all entries from the NEWS file. Don't forget to proof read the file as it will be sent to the fvwm-announce mailing list. - Update the ChangeLog for all the changes above. - Commit these changes. Configuration tests: Note that you need to have actually built everything before packing the distribution. Among other things, this generates the proper dependency information for insertion into Makefile.in's generated by "make distcheck2". - Run $ aclocal && autoheader && automake --add-missing && autoconf - If you are building a stable release, remove the config.cache file if there is one (autoconf 2.52 does no longer generate this file by default). Of course doing this for a development release won't hurt either. - Run $ ./configure --enable-htmldoc - Make sure configure detects all optional libraries except the ones that are recommended not to be used. Repeat the previous step until configure finds everything. Building a release without any optional library should be a rare exception. Compile tests: - Run $ make clean even if you checked out from scratch. It is a useful additional check. - Double check that you get no warnings during the build: $ make CFLAGS="-g -O2 -Wall -Wpointer-arith -fno-strict-aliasing -Werror" On some systems, the system include files generate warnings. On such a system you have to omit the -Werror option and check the output of the compilation run for warnings manually. It is important to use the -O2 option because gcc can not generate some warnings without it. If your gcc-version does not know the option "-fno-strict-aliasing", remove it. If you have gcc >= 3.4 you should also use -Wdeclaration-after-statement since it will catch code that won't compile on all C89 compilers. - Fix all warnings and problems, commit the changes and repeat the previous step until no more warnings occur. Build and test the release tarballs: The next step will create the tar file, then unpack it and attempt to build fvwm from it and install to a scratch directory. This makes sure that you really *did* include all the files necessary to build the package into the tar file. It may be hard to appreciate how useful this is, until it has reminded you that you forgot file "foo.h" in some _SOURCES line. But trust me, it will save your bacon in this way some day! - Run $ make distcheck2 - Ensure that you see the messages "fvwm-x.y.z.tar.gz is ready for distribution" and "fvwm-x.y.z.tar.bz2 - ready for distribution" Tag the release: * Important note: Before you proceed, please ask yourself if the code is ready to be released: * Have you committed patches only hours or even minutes ago? * Have there been any big changes in the last few days? * Are there any important parts that are not well tested? * Are you tired from work or have you been hacking fvwm for many hours in a row? Should your answer to any of these questions be 'yes', please do take a break now and reconsider, especially if this is going to be a stable release. The steps above are not critical and can not screw up anything bad. This is not true for what follows. If you do something wrong now, you will have a hard time cleaning up the mess. Should something go wrong and you are not sure about the correct fixes, please ask on the fvwm-workers list for help. It's important that the files included in the release tarballs and the tagged files are identical. - Tag the CVS tree (replace x, y and z): $ cvs tag version-x_y_z Upload the release: Hopefully you didn't change any files after the last commit. Otherwise commit your changes and return to the previous sections, i.e. rebuild tarballs using "make distcheck2" and retag the tree. - Upload the files fvwm-x.y.z.tar.gz and fvwm-x.y.z.tar.bz2 to ftp://ftp.fvwm.org/pub/incoming/fvwm - Notify fvwm-owner@fvwm.org of the upload. Increase the version number: - Increase the version number in the very beginning of configure.ac (see above) and set ISRELEASED to "no". - Create a new section for future changes in the NEWS file. - Add a ChangeLog entry indicating that a new version started. - Commit these three changes. - For a stable release, copy the NEWS from the stable branch to the development branch and update the link in the same document. Update fvwm-web: - Update the release numbers at the bottom of definitions.inc file. - If this is the head development version, then run a shell script in fvwm-web called regenerate_pages to update the web pages for NEWS, FAQ and AUTHORS. It should usually work without parameters for a typical setup (when fvwm and fvwm-web trees are sibling directories), optionally pass a parameter to regenerate_pages - the fvwm location relative to fvwm-web. $ cd fvwm-web $ ./regenerate_pages - Update the html documentation: go to the directory doc and run the script $ ./updatedoc - Generate the man pages: go to the directory documentation/manpages and run the script $ ./manpages2php It needs the program "man2html" installed. - Generate ChangeLog entries for all these changes and commit them. Announce the release: - Once the tarballs are in place, mail the ANNOUNCE file to the usual places, at least to fvwm-announce. fvwm-2.6.5.orig/docs/COMMANDS0000644000175000017500000003053111157773463013716 0ustar vwcvwcThe recognized commands for fvwm 2.5.28 (from cvs) as of 17-Mar-2009: # - Comment line (ignored) * - Module configuration line (no space after asterisk) + - Continue the last AddToFunc, AddToMenu or AddToDecor AddButtonStyle - Add to a button style (see ButtonStyle) AddTitleStyle - Add to a title style (see TitleStyle) AddToDecor - Add a decor definition (will be obsolete) AddToFunc - Add a function definition AddToMenu - Add a menu definition All - Operate on all windows matching the given condition AnimatedMove - Like Move, but uses animation to move windows Any - Operate if there is any window matching the condition Beep - Produce a bell BorderStyle - Define a window border look (will be reworked) Break - Stop executing the current (but not parent) function BugOpts - Set some application bug workarounds BusyCursor - Show/don't show the wait cursor in certain operations ButtonState - Disable some titlebar button states (not recommended) ButtonStyle - Define a window button look (will be reworked) ChangeDecor - Attach decor to a window (will be obsolete) ChangeMenuStyle - Attach menu style to a menu (see MenuStyle) CleanupColorsets - Reset all used colorsets with the default gray colors ClickTime - Set a time in milliseconds for click and double click Close - Try to Delete a window, if this fails, Destroy it ColorLimit - Set limit on colors used (obsolete) ColormapFocus - Change the colormap behaviour for low-depth X servers Colorset - Manage colors used like fg, bg, image bg, gradient bg CopyMenuStyle - Copy the existing menu style to new or existing one Current - Operate on the currently focused window CursorMove - Move the cursor pointer non interactively CursorStyle - Define different cursor pointer shapes and colors DefaultColors - Set colors for the feedback window (will be obsolete) DefaultColorset - Set colors for the Move/Resize feedback window DefaultFont - The default font to use (mainly for feedback window) DefaultIcon - The default icon to use for iconified windows DefaultLayers - Set StaysOnBottom, StaysPut, StaysOnTop layer numbers Delete - Try to delete a window using the X delete protocol Deschedule - Remove commands sheduled earlier using Schedule Desk - (obsolete, use GotoDesk instead) DesktopName - Define the desktop names used in WindowList, modules DesktopSize - Set virtual desktop size in units of physical pages Destroy - Kill a window without any warning to an application DestroyDecor - Delete decor defined by AddToDecor (will be obsolete) DestroyFunc - Delete function defined using AddToFunc DestroyMenu - Delete menu defined using AddToMenu DestroyMenuStyle - Delete menu style defined using MenuStyle DestroyModuleConfig - Delete matching module config lines defined using "*" DestroyStyle - Delete style defined using Style DestroyWindowStyle - Delete style defined using WindowStyle Direction - Operate on the next window in the specified direction Echo - Print message to stderr, mainly for debugging EchoFuncDefinition - Print the definion of a function EdgeCommand - Bind one or another screen edge to an fvwm action EdgeLeaveCommand - Bind one or another screen edge to an fvwm action EdgeResistance - Control viewport scrolling and window move over edge EdgeScroll - Control how much of the viewport is scrolled if any EdgeThickness - Control how closely to edge to run command/scrolling Emulate - Only used to position the position/size window EscapeFunc - Abort a wait or ModuleSynchonous command EwmhBaseStruts - Define restricted areas of the screen EwmhNumberOfDesktops - For ewmh pager, define number of desktops Exec - Execute an external command ExecUseShell - The shell to use to execute an external command FakeClick - Generate a mouse click FakeKeypress - Send a keyboard event to a window FlipFocus - Focus a window without rotating windowlist order Focus - Give focus to a window FocusStyle - Configure focus and raise policy for windows Function - Execute a user defined function, see AddToFunc GlobalOpts - (obsolete, use corresponding Style * instead) GnomeButton - Pass mouse button presses on root to GNOME program GnomeShowDesks - Limit GNOME pager to the number of desks GotoDesk - Switch viewport to another desk same page GotoDeskAndPage - Switch viewport to another desk and page GotoPage - Switch viewport to another page same desk HideGeometryWindow - Hide/show the position/size window HilightColor - (obsolete, use Style * HighlightFore/Back) HilightColorset - (obsolete, use Style * HighlightColorset) IconFont - (obsolete, use Style * IconFont) Iconify - Change iconification status of a window (minimize) IconPath - (obsolete, use ImagePath instead) IgnoreModifiers - Modifiers to ignore on mouse and key bindings ImagePath - Directories to search for images KeepRc - Do not modify the previous command return code Key - Bind or unbind a key to an fvwm action KillModule - Stops an fvwm module Layer - Change the layer of a window LocalePath - Directories/domains to search for locale data Lower - Lower a window within a layer Maximize - Toggle maximal-size status of a window Menu - Display (post) a menu MenuStyle - Control appearance and behavior of a menu Module - Invoke an fvwm module ModuleListenOnly - Invoke an fvwm module ModulePath - Modify the directories to search for an fvwm module ModuleSynchronous - Invoke an fvwm module synchronously ModuleTimeout - Set timeout value for response from module Mouse - Bind or unbind a mouse button press to an fvwm action Move - Move a window MoveThreshold - Set number of pixels in a click and a hold vs. a drag MoveToDesk - Move a window to another desk same page MoveToPage - Move a window to another page same desk MoveToScreen - Move a window to another Xinerama screen Next - Operate on the next window matching conditions None - Perform command if no window matches conditions Nop - Do nothing (used internally) NoWindow - Prefix that runs a command without a window context OpaqueMoveSize - Set maximum size window fvwm should move opaquely Pick - Prefix to force a window context, prompted if needed PipeRead - Exec system command interpret output as fvwm commands PixmapPath - (obsolete, use ImagePath instead) PlaceAgain - Replace a window using initial window placement logic PointerKey - Bind an action to a key based on pointer not focus PointerWindow - Operate on window under pointer if it meets conditions Popup - Display (pop-up) a menu, see also Menu Prev - Operate on the precious window matching conditions PrintInfo - Print information about the state of fvwm PropertyChange - Internal, used for inter-module communication Quit - Exit fvwm QuitScreen - Stop managing the specified screen QuitSession - Ask session manager to shut down itself and fvwm Raise - Raise a window in a layer RaiseLower - Alternately raise or lower a window in a layer Read - Read fvwm commands from a file ReadWriteColors - Used for colorset speed hacks (will be removed?) Recapture - Reapply styles to all windows (will be obsolete) RecaptureWindow - Reapply styles to one window (will be obsolete) Refresh - Cause all windows to redraw themselves RefreshWindow - Cause one window to redraw itself Repeat - Repeat (very unreliably) the last command, don't use Resize - Cause a window to be resized ResizeMaximize - Resize a window and mark window as maximized ResizeMove - Resize and move in one operation ResizeMoveMaximize - Resize and move in one operation and mark maximized RestackTransients - Regroup the window transients in the stack Restart - Restart itself or replace with another window manager SaveQuitSession - Cause session manager to save and shutdown fvwm SaveSession - Cause session manager to save the session ScanForWindow - Operate on the matching window in the given direction Schedule - Run an fvwm command after a delay Scroll - Scroll the desktop viewport Send_ConfigInfo - Internal, used for module communication Send_Reply - Internal, used for module communication Send_WindowList - Internal, used for module communication SendToModule - Send a string (action) to a module set_mask - Internal, used for module communication set_nograb_mask - Internal, used for module communication set_sync_mask - Internal, used for module communication SetAnimation - Control animated moves and menus SetEnv - Set an environment variable Silent - Suppress errors on command, avoid window selection SnapAttraction - Control attraction of windows during move SnapGrid - Control grid used with SnapAttraction State - Control user defined window states Stick - Change window stickyness StickAcrossDesks - Change window stickyness on a desk basis StickAcrossPages - Change window stickyness on a page basis Stroke - Bind a stroke to an fvwm action StrokeFunc - Record stroke and execute corresponding stroke action Style - Set attributes of windows that match a pattern TearMenuOff - Convert a menu to a window, for use in menu items Test - Execute command if conditions are met TestRc - Conditional switch (may be changed) ThisWindow - Operate on the context window if it meets conditions Title - Insert title into a menu TitleStyle - Control window title UnsetEnv - Remove an environment variable UpdateDecor - Update window decor (obsolete and not needed anymore) UpdateStyles - Cause styles to update while still in a function Wait - Pause until a matching window appears WarpToWindow - Warp the pointer to a window WindowFont - (obsolete, use Style * Font) WindowId - Execute command for window matching the windowid WindowList - Display the window list as a menu to select a window WindowShade - Shade/unshade a window WindowShadeAnimate - (obsolete, use Style * WindowShadeSteps) WindowStyle - Set styles on the selected window Xinerama - Control Xinerama support XineramaPrimaryScreen - Identify Xinerama primary screen XineramaSls - Control single logical screen support XineramaSlsScreens - Configure layout for single logical screen XineramaSlsSize - Configure layout for single logical screen sizes XorPixmap - Use a pixmap for move/resize rubber-band XorValue - Change bits used for move/resize rubber-band XSync - For debugging, send all pending requests to X server XSynchronize - For debugging, cause all X requests to be synchronous fvwm-2.6.5.orig/config.h.in0000644000175000017500000004172511744241320013654 0ustar vwcvwc/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Old AIX systems (3.2.5) don't define some common keysyms. */ #undef COMPAT_OLD_KEYSYMDEF /* Old libstroke <= 0.4 does not use STROKE_ prefix for constants. */ #undef COMPAT_OLD_LIBSTROKE /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Support fribidi-0.10.4 and older with "CHARSET" spelling. */ #undef FRIBIDI_CHARSET_SPELLING /* Suffix for old (to be deprecated) config filenames */ #undef FVWM2RC /* Produces a log of all executed commands and their times on stderr. */ #undef FVWM_COMMAND_LOG /* Name of config filenames in FVWM_USERDIR and FVWM_DATADIR */ #undef FVWM_CONFIG /* if you would like to see lots of debug messages from fvwm, for debugging purposes, uncomment the next line */ #undef FVWM_DEBUG_MSGS /* Where to search for images. */ #undef FVWM_IMAGEPATH /* Define if gdk-imlib is used */ #undef GDK_IMLIB /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define if fribidi library is used. */ #undef HAVE_BIDI /* Define to 1 if you have the `bindtextdomain' function. */ #undef HAVE_BINDTEXTDOMAIN /* Have nl_langinfo (CODESET) */ #undef HAVE_CODESET /* Define to 1 if you have the `dgettext' function. */ #undef HAVE_DGETTEXT /* Define to 1 if you have the `div' function. */ #undef HAVE_DIV /* Define to 1 if you have the header file. */ #undef HAVE_DMALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `gethostname' function. */ #undef HAVE_GETHOSTNAME /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getpwuid' function. */ #undef HAVE_GETPWUID /* Define to 1 if you have the `gettext' function. */ #undef HAVE_GETTEXT /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define if readline has full GNU interface */ #undef HAVE_GNU_READLINE /* Define if iconv (in the libc) or libiconv is available */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `dmalloc' library (-ldmalloc). */ #undef HAVE_LIBDMALLOC /* Define to 1 if you have the `efence' library (-lefence). */ #undef HAVE_LIBEFENCE /* Define to 1 if you have the `intl' library (-lintl). */ #undef HAVE_LIBINTL /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkfifo' function. */ #undef HAVE_MKFIFO /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef HAVE_NLS /* Define to 1 if you have the `on_exit' function. */ #undef HAVE_ON_EXIT /* Define if ppm library is used. */ #undef HAVE_PNG /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define if readline is available. */ #undef HAVE_READLINE /* Define if rplay library is used. */ #undef HAVE_RPLAY /* Define if librsvg library is used. */ #undef HAVE_RSVG /* Enable the use of mkstemp */ #undef HAVE_SAFETY_MKSTEMP /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setpgid' function. */ #undef HAVE_SETPGID /* Define to 1 if you have the `setpgrp' function. */ #undef HAVE_SETPGRP /* Define to 1 if you have the `setvbuf' function. */ #undef HAVE_SETVBUF /* Define to 1 if you have the `sigaction' function. */ #undef HAVE_SIGACTION /* Define to 1 if you have the `siginterrupt' function. */ #undef HAVE_SIGINTERRUPT /* Define to 1 if you have the `siglongjmp' function. */ #undef HAVE_SIGLONGJMP /* Define to 1 if you have the `sigsetjmp' function. */ #undef HAVE_SIGSETJMP /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define if Solaris' Xinerama calls are being used. (Solaris 7 11/99 and later) */ #undef HAVE_SOLARIS_XINERAMA /* Define if Solaris' X11/extensions/xinerama.h header is provided. (Solaris 9 and later) */ #undef HAVE_SOLARIS_XINERAMA_H /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define if stroke library is used. */ #undef HAVE_STROKE /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `sysconf' function. */ #undef HAVE_SYSCONF /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSTEMINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the `textdomain' function. */ #undef HAVE_TEXTDOMAIN /* Define to 1 if you have the `uname' function. */ #undef HAVE_UNAME /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unsetenv' function. */ #undef HAVE_UNSETENV /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP /* Define to 1 if you have the `vfprintf' function. */ #undef HAVE_VFPRINTF /* Define to 1 if you have the `wait3' function. */ #undef HAVE_WAIT3 /* Define to 1 if you have the `wait4' function. */ #undef HAVE_WAIT4 /* Define to 1 if you have the `waitpid' function. */ #undef HAVE_WAITPID /* Define if Xcursor library is used. */ #undef HAVE_XCURSOR /* Define if Xft library is used. */ #undef HAVE_XFT /* Define if Xft 2 library is used. */ #undef HAVE_XFT2 /* Define if Xft library can handle utf8 encoding */ #undef HAVE_XFT_UTF8 /* Define if Xinerama library is used. */ #undef HAVE_XINERAMA /* Enable X output method */ #undef HAVE_XOUTPUT_METHOD /* Define if Xrender library is used. */ #undef HAVE_XRENDER /* Define if MIT Shared Memory extension is used. */ #undef HAVE_XSHM /* define if second arg of iconv use const */ #undef ICONV_ARG_CONST /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define a suitable cast for arguments 2-4 of `select'. On most systems, this will be the empty string, as select usually takes pointers to fd_set. */ #undef SELECT_FD_SET_CAST /* Enables session management functionality. */ #undef SESSION /* Define to 1 if the `setpgrp' function takes no argument. */ #undef SETPGRP_VOID /* Define if you want the Shaped window extensions. Shaped window extensions seem to increase the window managers RSS by about 60 Kbytes. They provide for leaving a title-bar on the window without a border. If you don't use shaped window extension, you can either make your shaped windows undecorated, or live with a border and backdrop around all your shaped windows (oclock, xeyes) If you normally use a shaped window (xeyes or oclock), you might as well compile this extension in, since the memory cost is minimal in this case (The shaped window shared libs will be loaded anyway). If you don't normally use a shaped window, you have to decide for yourself. Note: if it is compiled in, run time detection is used to make sure that the currently running X server supports it. */ #undef SHAPE /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `Pixel', as computed by sizeof. */ #undef SIZEOF_PIXEL /* The size of `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* The size of `Window', as computed by sizeof. */ #undef SIZEOF_WINDOW /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* define if we use libiconv (not needed in general: for example iconv is native with recent glibc) */ #undef USE_LIBICONV /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Define if Xinerama should be emulated on a single screen. */ #undef USE_XINERAMA_EMULATION /* Version number of package */ #undef VERSION /* Additional version information, like date */ #undef VERSIONINFO /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define if Xpm library is used. */ #undef XPM /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Enables to use setlocale() provided by X */ #undef X_LOCALE #ifdef COMPAT_OLD_KEYSYMDEF # define XK_Page_Up XK_Prior # define XK_Page_Down XK_Next #endif #ifdef COMPAT_OLD_LIBSTROKE /* currently we only use one constant */ # define STROKE_MAX_SEQUENCE MAX_SEQUENCE #endif #ifdef FRIBIDI_CHARSET_SPELLING # define FRIBIDI_CHAR_SET_NOT_FOUND FRIBIDI_CHARSET_NOT_FOUND #endif #ifdef FVWM_COMMAND_LOG # define FVWM_DEBUG_TIME 1 #endif #ifdef FVWM_DEBUG_MSGS # define DBUG(x,y) fvwm_msg(DBG,x,y) #else # define DBUG(x,y) /* no messages */ #endif #ifdef USE_LIBICONV /* define to use locale_charset in the place of nl_langinfog if libiconv * is used */ #undef HAVE_LIBCHARSET #endif #ifdef HAVE_STROKE # define STROKE_ARG(x) x, # define STROKE_CODE(x) x #else # define STROKE_ARG(x) # define STROKE_CODE(x) #endif /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /** * The next few defines are options that are only changed from their values * shown here on systems that _don't_ use the configure script. **/ /* Enable tests for missing too many XEvents. Usually you want this. */ #define WORRY_ABOUT_MISSED_XEVENTS 1 /* Define if the X11 ConnectionNumber is actually a file descriptor. */ #define HAVE_X11_FD 1 /* Define if fork() has unix semantics. On VMS, no child process is created until after a successful exec(). */ #define FORK_CREATES_CHILD 1 /* Suffix for executable filenames; NULL if no extension needed. */ #define EXECUTABLE_EXTENSION NULL /* Define to remove the extension from executable pathnames before calling exec(). */ #undef REMOVE_EXECUTABLE_EXTENSION /* Enables the "MiniIcon" Style option to specify a small pixmap which * can be used as one of the title-bar buttons, shown in window list, * utilized by modules, etc. Requires PIXMAP_BUTTONS to be defined * (see below). */ /* #undef MINI_ICONS */ /* NOTE: hard coded to 1 */ #if 1 #define FMiniIconsSupported 1 #else #define FMiniIconsSupported 0 #endif /* Enables tagged general decoration styles which can be assigned to * windows using the UseDecor Style option, or dynamically updated * with ChangeDecor. To create and destroy "decor" definitions, see * the man page entries for AddToDecor and DestroyDecor. There is a * slight memory penalty for each additionally defined decor. */ /* #undef USEDECOR */ /* NOTE: hard coded to 1 */ #define USEDECOR 1 #if RETSIGTYPE != void #define SIGNAL_RETURN return 0 #else #define SIGNAL_RETURN return #endif /* Allow GCC extensions to work, if you have GCC. */ #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(x) # endif /* The __-protected variants of `format' and `printf' attributes * are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #if HAVE_ALLOCA_H # include #else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_MEMORY_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #if defined (HAVE_MALLOC_H) && !defined (__FreeBSD__) && !defined (__OpenBSD__) && !defined(__NetBSD__) # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifndef HAVE_STRCHR # define strchr(_s,_c) index((_s),(_c)) # define strrchr(_s,_c) rindex((_s),(_c)) #endif #ifndef HAVE_MEMCPY # define memcpy(_d,_s,_l) bcopy((_s),(_d),(_l)) #endif #ifndef HAVE_MEMMOVE # define memmove(_d,_s,_l) bcopy((_s),(_d),(_l)) #endif #if HAVE_SYS_TYPES_H # include #endif #if HAVE_UNISTD_H # include #endif #ifndef min # define min(a,b) (((a)<(b)) ? (a) : (b)) #endif #ifndef max # define max(a,b) (((a)>(b)) ? (a) : (b)) #endif #ifndef abs # define abs(a) (((a)>=0)?(a):-(a)) #endif #include "libs/defaults.h" #ifndef FEVENT_C #include #include "libs/FEvent.h" #endif #ifndef O_NOFOLLOW #define O_NOFOLLOW 0 #endif #ifdef HAVE_LSTAT #define DO_USE_LSTAT 1 #define fvwm_lstat(x,y) lstat(x,y) #else #define DO_USE_LSTAT 0 #define fvwm_lstat(x,y) -1 #endif /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to the type used in arguments 2-4 of `select', if not set by system headers. */ #undef fd_set /* Define to the type used in argument 1 `select'. Usually this is an `int'. */ #undef fd_set_size_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Specify a type for sig_atomic_t if it's not available. */ #undef sig_atomic_t /* Define to `unsigned int' if does not define. */ #undef size_t fvwm-2.6.5.orig/install-sh0000755000175000017500000003253711324777651013655 0ustar vwcvwc#!/bin/sh # install - install a program, script, or datafile scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: fvwm-2.6.5.orig/configure0000755000175000017500000154414411744241235013551 0ustar vwcvwc#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="fvwm/fvwm.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LOCAL_BUGADDR with_xpm with_xrender with_xinerama with_xft with_xcursor with_stroke with_sm with_shm with_shape with_rplay with_readline with_rsvg with_png with_perllib with_iconv with_gnomelibs with_gettext with_gdkimlib with_gtk with_bidi GNOME_CONFIG GNOME_INCLUDEDIR GNOME_LIBDIR GNOMEUI_LIBS GNOME_LIBS GDK_IMLIB_LIBS GDK_IMLIB_CFLAGS IMLIBCONF GTK_LIBS GTK_CFLAGS MANFVWMGTK FVWMGTK GTK_CONFIG LIBOBJS ALLOCA RANLIB LN_S FVWM_CPP CATOBJEXT DUMMYPOFILES UPDATEPOFILES GMOFILES POFILES CATALOGS INST_LINGUAS MKINSTALLDIRS LOCALEDIR POSUB USE_NLS intl_CFLAGS intl_LIBS MSGUNIQ MSGMERGE XGETTEXT GMSGFMT MSGFMT ALL_DOMAINS FVWMSCRIPT_DOMAIN FVWMTASKBAR_DOMAIN FVWM_DOMAIN ALL_LINGUAS FVWM_PERLLIB Bidi_CFLAGS Bidi_LIBS FRIBIDI_CONFIG iconv_CFLAGS iconv_LIBS readline_CFLAGS readline_LIBS stroke_CFLAGS stroke_LIBS rplay_CFLAGS rplay_LIBS rsvg_LIBS rsvg_CFLAGS png_CFLAGS png_LIBS xpm_CFLAGS xpm_LIBS Xft_CFLAGS Xft_LIBS XFT_LIBS XFT_CFLAGS XFT_CONFIG FC_LIBS FC_CFLAGS FC_CONFIG FT2_LIBS FT2_CFLAGS FT2_CONFIG Xcursor_LIBS Xcursor_CFLAGS Xrender_CFLAGS Xrender_LIBS Xinerama_CFLAGS Xinerama_LIBS FVWM_BUILD_HTMLDOC_FALSE FVWM_BUILD_HTMLDOC_TRUE FVWM_BUILD_MANDOC_FALSE FVWM_BUILD_MANDOC_TRUE XSLTPROC DOC_SECTIONS_XML_PATH DOC_SECTIONS_XML DOC_SECTIONS DOC_MODULES_HTML DOC_MODULES DOC_COMMANDS_HTML DOC_COMMANDS_XML_PATH DOC_COMMANDS_XML DOC_COMMANDS PKG_CONFIG host_os host_vendor host_cpu host build_os build_vendor build_cpu build EGREP GREP FVWM_IMAGEPATH X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS CPP am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC XMKMF FVWM_DOCDIR FVWM_CONFDIR FVWM_PERLLIBDIR FVWM_DATADIR FVWM_MODULEDIR PERL REQUIRED_PERL_VERSION SED am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM MANPAGE_PREAMBLE FVWMWORKERSLISTLONG FVWMWORKERSLIST FVWMLIST FVWMALTFTPDIR FVWMALTFTP FVWMFTPDIR FVWMFTP FVWMHOMEPAGE FVWMNAMELONG RELDATENUM RELDATESHORT RELDATELONG VERSIONINFO ISRELEASED target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_package_subdirs enable_dmalloc enable_efence enable_command_log enable_debug_msgs with_x enable_dependency_tracking with_imagepath with_pkgconfig_prefix with_pkgconfig_exec_prefix enable_mandoc enable_htmldoc enable_sm enable_shape enable_shm enable_xinerama enable_xinerama_emulation enable_xrender enable_xcursor enable_xft with_freetype_prefix with_freetype_exec_prefix enable_freetypetest with_fontconfig_prefix with_fontconfig_exec_prefix enable_fontconfigtest with_xft_prefix with_xft_exec_prefix enable_xfttest with_xpm_library with_xpm_includes with_png_library with_png_includes enable_rsvg with_rplay_library with_rplay_includes with_stroke_library with_stroke_includes with_termcap_library with_readline_library with_readline_includes with_ncurses_library enable_iconv with_iconv_library with_iconv_includes enable_bidi with_fribidi_bindir enable_perllib enable_nls with_intl_library with_intl_includes enable_gtk with_gtk_prefix with_gtk_exec_prefix enable_gtktest with_imlib_prefix with_imlib_exec_prefix enable_imlibtest with_gnome_includes with_gnome_libs with_gnome ' ac_precious_vars='build_alias host_alias target_alias XMKMF CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-package-subdirs do not create subdirs for modules and data --enable-dmalloc enable support for the dmalloc debugging library --enable-efence enable support for the efence debugging library --enable-command-log enable command logging --enable-debug-msgs enable debugging messages --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-mandoc disable generation of man pages --enable-htmldoc enable generation of HTML documentation --disable-sm disable session management support --disable-shape disable shaped window support --disable-shm disable MIT Shared Memory Extension --disable-xinerama disable Xinerama multi screen support --enable-xinerama-emulation enable Xinerama emulation on one screen (useful only for developers) --disable-xrender disable Xrender alpha-blend rendering --disable-xcursor disable Xcursor ARGB/animated cursor loading --disable-xft disable Xft anti-aliased font rendering --disable-freetypetest do not try to compile and run a test FreeType program --disable-fontconfigtest do not try to compile and run a test fontconfig program --disable-xfttest do not try to compile and run a test Xft program --disable-rsvg disable scalable vector graphics (SVG images) --disable-iconv disable support for iconv character conversion --disable-bidi disable bi-directional text support --disable-perllib disable installing fvwm perl library --disable-nls do not use Native Language Support --disable-gtk do not build modules using gtk library --disable-gtktest do not try to compile and run a test GTK program --disable-imlibtest do not try to compile and run a test IMLIB program Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-x use the X Window System --with-imagepath=PATH colon-delimited search path for images --with-pkgconfig-prefix=PFX prefix where pkg-config is installed --with-pkgconfig-exec-prefix=PFX exec prefix where pkg-config is installed --with-freetype-prefix=PFX prefix where FreeType is installed (for Xft) --with-freetype-exec-prefix=PFX exec prefix where FreeType is installed --with-fontconfig-prefix=PFX prefix where fontconfig is installed (for Xft2) --with-fontconfig-exec-prefix=PFX exec prefix where fontconfig is installed --with-xft-prefix=PFX prefix where Xft2 is installed (optional) --with-xft-exec-prefix=PFX exec prefix where Xft2 is installed --with-xpm-library=PATH use xpm library (for coloured or shaped icons) --with-xpm-includes=DIR set directory for xpm headers --with-png-library=PATH use png library (for coloured or shaped icons) --with-png-includes=DIR set directory for png headers --with-rplay-library=PATH use rplay library (adds audio capability) --with-rplay-includes=DIR set directory for rplay headers --with-stroke-library=PATH use stroke library (mouse strokes recognition) --with-stroke-includes=DIR set directory for stroke headers --with-termcap-library=PATH use termcap library (to accomplish readline) --with-readline-library=PATH use readline library (line editing/history) --with-readline-includes=DIR set directory for readline headers --with-ncurses-library=PATH use ncurses library (to accomplish readline) --with-iconv-library=PATH use iconv library (if not found sys iconv is used) --with-iconv-includes=DIR set directory for iconv headers --with-fribidi-bindir=DIR directory of fribidi-config if not in PATH --with-intl-library=PATH use intl library (for Native Language Support) --with-intl-includes=DIR set directory for intl headers --with-gtk-prefix=PFX prefix for GTK files (optional) --with-gtk-exec-prefix=PFX exec prefix for GTK files (optional) --with-imlib-prefix=PFX prefix for IMLIB files (optional) --with-imlib-exec-prefix=PFX exec prefix for IMLIB files (optional) --with-gnome-includes location of GNOME headers --with-gnome-libs location of GNOME libs --with-gnome no, yes or prefix for GNOME files (for FvwmGtk only) Some influential environment variables: XMKMF Path to xmkmf, Makefile generator for X Window System CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ISRELEASED=yes version=2.6.5 VERSIONINFO="" RELDATELONG="20 April 2012" RELDATESHORT="02-Apr-2012" RELDATENUM="2012-04-20" # constant variable settings FVWMNAMELONG="F? Virtual Window Manager" FVWMHOMEPAGE="http://fvwm.org/" FVWMFTP="ftp.fvwm.org" FVWMFTPDIR="/pub/ftp" FVWMALTFTP="metalab.unc.edu" FVWMALTFTPDIR="/pub/Linux/X11/window-managers/" FVWMLIST="fvwm@fvwm.org" FVWMWORKERSLIST="fvwm-workers@fvwm.org" FVWMWORKERSLISTLONG="fvwm workers list " MANPAGE_PREAMBLE='.\" WARNING: This file was automatically generated. Edit the .in file instead.' if test ! x"$ISRELEASED" = xyes; then VERSIONINFO=" (from cvs)" RELDATELONG="(not released yet)" RELDATESHORT="(not released yet)" RELDATENUM="(not released yet)" # # migo: unfortunately this nice idea can not work, it is not updated. # # I will think more about this, maybe autoconf-2.50+ has a solution. # if test -d CVS/ -a -f CVS/Entries && \ # date +%Y-%m-%d -d 'Wed Sep 4 12:36:50 2002' >/dev/null 2>&1 # then # # this is not the exact date, but better than the current date # for file in CVS/Entries */CVS/Entries; do # changelog_date="`cat $file | grep /ChangeLog/ \ # | cut -d/ -f4`" # test ! x"$changelog_date" = x && \ # date +%Y-%m-%d -d "$changelog_date" >>changelog_dates # done # changelog_date=`cat changelog_dates | sort -r -u | head -1` # VERSIONINFO=" (from cvs $changelog_date)" # rm -f changelog_dates # fi fi cat >>confdefs.h <<_ACEOF #define VERSIONINFO "$VERSIONINFO" _ACEOF am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=fvwm VERSION=${version} cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers config.h" # check for programs needed to build html docs # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_SED+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$SED"; then ac_cv_prog_SED="$SED" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_SED="sed" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_SED" && ac_cv_prog_SED="""" fi fi SED=$ac_cv_prog_SED if test -n "$SED"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 $as_echo "$SED" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi #!!! PERL="" REQUIRED_PERL_VERSION=5.004 if test x"$PERL" = x; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test ! x"$PERL" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl $REQUIRED_PERL_VERSION or better" >&5 $as_echo_n "checking for perl $REQUIRED_PERL_VERSION or better... " >&6; } HAVE_PERL_FOR_DOCS=1 if ("$PERL" -e "require $REQUIRED_PERL_VERSION;") 2>/dev/null; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $PERL not found or too old" >&5 $as_echo "$as_me: WARNING: $PERL not found or too old" >&2;} fi else HAVE_PERL_FOR_DOCS=0 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: perl is not found, it is required for some scripts and modules" >&5 $as_echo "$as_me: WARNING: perl is not found, it is required for some scripts and modules" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: It is recommended to install perl $REQUIRED_PERL_VERSION or better later" >&5 $as_echo "$as_me: WARNING: It is recommended to install perl $REQUIRED_PERL_VERSION or better later" >&2;} PERL=/usr/bin/perl fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming $PERL as perl location" >&5 $as_echo "assuming $PERL as perl location" >&6; } # installation paths FVWM_MODULESUBDIR=/${PACKAGE}/${VERSION} FVWM_DATASUBDIR=/${PACKAGE} FVWM_DOCSUBDIR=/doc/${PACKAGE} # Check whether --enable-package-subdirs was given. if test "${enable_package_subdirs+set}" = set; then : enableval=$enable_package_subdirs; if test x"$enableval" = xno; then FVWM_MODULESUBDIR=""; FVWM_DATASUBDIR=""; fi fi FVWM_MODULEDIR='${libexecdir}'"$FVWM_MODULESUBDIR" FVWM_DATADIR='${datadir}'"$FVWM_DATASUBDIR" FVWM_DOCDIR='${datadir}'"$FVWM_DOCSUBDIR" FVWM_PERLLIBDIR='${datadir}'"$FVWM_DATASUBDIR/perllib" FVWM_CONFDIR='${sysconfdir}' $as_echo "#define FVWM_CONFIG \"config\"" >>confdefs.h $as_echo "#define FVWM2RC \".fvwm2rc\"" >>confdefs.h # Various configure-time options # Check whether --enable-dmalloc was given. if test "${enable_dmalloc+set}" = set; then : enableval=$enable_dmalloc; ac_cv_dmalloc="$enableval" else ac_cv_dmalloc="no" fi # Check whether --enable-efence was given. if test "${enable_efence+set}" = set; then : enableval=$enable_efence; ac_cv_efence="$enableval" else ac_cv_efence="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable command logging" >&5 $as_echo_n "checking whether to enable command logging... " >&6; } # Check whether --enable-command-log was given. if test "${enable_command_log+set}" = set; then : enableval=$enable_command_log; if test "$enableval" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define FVWM_COMMAND_LOG 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debugging messages" >&5 $as_echo_n "checking whether to enable debugging messages... " >&6; } # Check whether --enable-debug-msgs was given. if test "${enable_debug_msgs+set}" = set; then : enableval=$enable_debug_msgs; if test "$enableval" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define FVWM_DEBUG_MSGS 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Need to know where X is, for finding some libraries (e.g. xpm) no_x="" DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi if test x"$no_x" = x"yes"; then echo echo "X11 libraries or header files could not be found. Please make" echo "sure the X11 development package is installed on your system." echo "If it is definitely installed, try setting the include and library" echo "paths with the --x-include and --x-libraries options of configure." echo "Fvwm can not be compiled without the X11 development environment." echo echo "Aborting." echo exit 1 fi # FIXME: default value should be derived from computed path to X # includes. Actually, this should probably not appear in configure # at all: it is settable at runtime, and only confuses the issue to # have it settable here too. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking imagepath" >&5 $as_echo_n "checking imagepath... " >&6; } val="/usr/include/X11/bitmaps:/usr/include/X11/pixmaps" # Check whether --with-imagepath was given. if test "${with_imagepath+set}" = set; then : withval=$with_imagepath; case "$withval" in no) as_fn_error $? "Can not disable image path." "$LINENO" 5 ;; yes) ;; *) val="$withval" ;; esac fi cat >>confdefs.h <<_ACEOF #define FVWM_IMAGEPATH "$val" _ACEOF FVWM_IMAGEPATH="$val" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $val" >&5 $as_echo "$val" >&6; } # Minimal checks for programs: enough to enable checking for # optional libraries. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # added -Wall for gcc, what about for others? if test "x$GCC" = "xyes"; then CFLAGS="-Wall -Wno-implicit-int $CFLAGS" fi # Help finding POSIX functions on some systems { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if ${ac_cv_search_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_strerror+:} false; then : break fi done if ${ac_cv_search_strerror+:} false; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 $as_echo "$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h # catch -Werror and similar options when running configure cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int i; static j; int *p; char *c; switch (*p = p = *c) { case 0: printf("%Q", c, p); } *c = &i; c = p; while (1 || (unsigned int)3 >= 0 || ((int)-1) == ((unsigned int)1)); return; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else as_fn_error $? "\" configure is not able to compile programs with warnings. Please remove all offending options like -Werror from the CFLAGS and CPPFLAGS variables and run configure again.\"" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # check size of some types ac_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $X_CFLAGS" # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of Window" >&5 $as_echo_n "checking size of Window... " >&6; } if ${ac_cv_sizeof_Window+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (Window))" "ac_cv_sizeof_Window" "#include #include "; then : else if test "$ac_cv_type_Window" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (Window) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_Window=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_Window" >&5 $as_echo "$ac_cv_sizeof_Window" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_WINDOW $ac_cv_sizeof_Window _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of Pixel" >&5 $as_echo_n "checking size of Pixel... " >&6; } if ${ac_cv_sizeof_Pixel+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (Pixel))" "ac_cv_sizeof_Pixel" "#include #include "; then : else if test "$ac_cv_type_Pixel" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (Pixel) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_Pixel=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_Pixel" >&5 $as_echo "$ac_cv_sizeof_Pixel" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_PIXEL $ac_cv_sizeof_Pixel _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 $as_echo_n "checking size of void *... " >&6; } if ${ac_cv_sizeof_void_p+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : else if test "$ac_cv_type_void_p" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (void *) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_void_p=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 $as_echo "$ac_cv_sizeof_void_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF CFLAGS="$ac_save_CFLAGS" size_check_failed="" if test "$ac_cv_sizeof_void_p" -gt "$ac_cv_sizeof_long"; then echo "The type void * is bigger than long." size_check_failed=1 fi if test "$ac_cv_sizeof_Window" -gt "$ac_cv_sizeof_long"; then echo "The type Window is bigger than long." size_check_failed=1 fi if test "$ac_cv_sizeof_Pixel" -gt "$ac_cv_sizeof_long"; then echo "The type Pixel is bigger than long." size_check_failed=1 fi if test x"$size_check_failed" = x1; then echo "This is not supported by the module interface yet (make_new_vpacket)." echo "Detected type sizes are: int($ac_cv_sizeof_int), long($ac_cv_sizeof_long), void*($ac_cv_sizeof_void_p), Window($ac_cv_sizeof_Window), Pixel($ac_cv_sizeof_Pixel)" echo "Please report details of your system and this message to ${FVWMWORKERSLIST}." echo exit 1 fi # 'unset' is not portable, but setting to null is not enough to avoid using # the cached value! For ancient shells "rm config.cache" is a solution. UNSET=true if unset UNSET 2>/dev/null; then UNSET=unset; fi # ********* multibyte # FreeBSD has libxpg4, check this and use if found. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac case $host_os in freebsd*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setlocale in -lxpg4" >&5 $as_echo_n "checking for setlocale in -lxpg4... " >&6; } if ${ac_cv_lib_xpg4_setlocale+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxpg4 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char setlocale (); int main () { return setlocale (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_xpg4_setlocale=yes else ac_cv_lib_xpg4_setlocale=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xpg4_setlocale" >&5 $as_echo "$ac_cv_lib_xpg4_setlocale" >&6; } if test "x$ac_cv_lib_xpg4_setlocale" = xyes; then : LIBS="$LIBS -lxpg4" fi ;; *) ;; esac # *** pkg-config # unfortunately, we need pkg-config for the detection of certain libs: # - version of fontconfig without fontconfig-config # - version of fribidi without fribidi-config # Check whether --with-pkgconfig-prefix was given. if test "${with_pkgconfig_prefix+set}" = set; then : withval=$with_pkgconfig_prefix; pkgconfig_config_prefix="$withval" else pkgconfig_config_prefix="" fi # Check whether --with-pkgconfig-exec-prefix was given. if test "${with_pkgconfig_exec_prefix+set}" = set; then : withval=$with_pkgconfig_exec_prefix; pkgconfig_config_exec_prefix="$withval" else pkgconfig_config_exec_prefix="" fi if test x$pkgconfig_config_exec_prefix != x ; then pkgconfig_config_args="$pkgconfig_config_args --exec-prefix=$pkgconfig_config_exec_prefix" if test x${PKG_CONFIG+set} != xset ; then PKG_CONFIG=$pkgconfig_config_exec_prefix/bin/pkg-config fi fi if test x$pkgconfig_config_prefix != x ; then pkgconfig_config_args="$pkgconfig_config_args --prefix=$pkgconfig_config_prefix" if test x${PKG_CONFIG+set} != xset ; then PKG_CONFIG=$pkgconfig_config_prefix/bin/pkg-config fi fi # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Building man pages & HTML documentation (from XML source). # extract command names if test ! x"$SED" = x; then DOC_COMMANDS=` sed -n ' :findhead /#.*define.*CMD_ENT/bfindcmd n bfindhead :findcmd n /CMD_ENT/bfound bfindcmd :found /"#"/bfindcmd /"propertychange"/bfindcmd /"readwritecolors"/bfindcmd /"send_.*"/bfindcmd /"set_.*"/bfindcmd s/.*CMD_ENT.*CMD_// s/,.*// p n bfindcmd ' < fvwm/functable.c` DOC_COMMANDS=`echo $DOC_COMMANDS` # with .xml suffix DOC_COMMANDS_XML=`for i in $DOC_COMMANDS; do echo ${i}.xml; done` DOC_COMMANDS_XML=`echo $DOC_COMMANDS_XML` # with .xml suffix and path DOC_COMMANDS_XML_PATH=` for i in $DOC_COMMANDS; do echo ../commands/${i}.xml; done ` DOC_COMMANDS_XML_PATH=`echo $DOC_COMMANDS_XML_PATH` # with .html suffix DOC_COMMANDS_HTML=`for i in $DOC_COMMANDS; do echo ${i}.html; done` DOC_COMMANDS_HTML=`echo $DOC_COMMANDS_HTML` # extract module names DOC_MODULES="" DOC_MODULES=` for i in modules/*; do echo "$i"; done | sed -n ' :search /^modules.Fvwm/bfound bnext :found s/modules.// /FvwmTabs/bnext p :next n bsearch ' ` DOC_MODULES=`echo $DOC_MODULES` DOC_MODULES_HTML=`for i in $DOC_MODULES; do echo ${i}.html; done` DOC_MODULES_HTML=`echo $DOC_MODULES_HTML` # extract man page section names DOC_SECTIONS=`cat doc/fvwm/sections` DOC_SECTIONS=`echo $DOC_SECTIONS` DOC_SECTIONS_XML=`for i in $DOC_SECTIONS; do echo ${i}.xml; done` DOC_SECTIONS_XML=`echo $DOC_SECTIONS_XML` DOC_SECTIONS_XML_PATH=`for i in $DOC_SECTIONS; do echo ${i}.xml; done` DOC_SECTIONS_XML_PATH=`echo $DOC_SECTIONS_XML` else DOC_COMMANDS="" DOC_COMMANDS_XML="" DOC_COMMANDS_XML_PATH="" DOC_COMMANDS_HTML="" DOC_MODULES="" DOC_MODULES_HTML="" DOC_SECTIONS="" DOC_SECTIONS_XML="" DOC_SECTIONS_XML_PATH="" fi problem_mandoc="" # Extract the first word of "xsltproc", so it can be a program name with args. set dummy xsltproc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_XSLTPROC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$XSLTPROC"; then ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_XSLTPROC="xsltproc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_XSLTPROC" && ac_cv_prog_XSLTPROC="""" fi fi XSLTPROC=$ac_cv_prog_XSLTPROC if test -n "$XSLTPROC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 $as_echo "$XSLTPROC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Check whether --enable-mandoc was given. if test "${enable_mandoc+set}" = set; then : enableval=$enable_mandoc; if test x"$enableval" = xyes; then with_mandoc="yes, check" else with_mandoc="no" problem_mandoc=": Explicitly disabled" fi else with_mandoc="not specified, check" fi if test ! x"$with_mandoc" = xno; then if test x"$XSLTPROC" = x ; then with_mandoc="no" problem_mandoc=": No xsltproc found in PATH" elif test x"$SED" = x ; then with_mandoc="no" problem_mandoc=": No sed found in PATH" elif test x"$HAVE_PERL_FOR_DOCS" = x0 ; then with_mandoc="no" problem_mandoc=": No perl found in PATH" else with_mandoc="yes" fi fi if test x"$with_mandoc" = xyes; then FVWM_BUILD_MANDOC_TRUE= FVWM_BUILD_MANDOC_FALSE='#' else FVWM_BUILD_MANDOC_TRUE='#' FVWM_BUILD_MANDOC_FALSE= fi problem_htmldoc="" # Check whether --enable-htmldoc was given. if test "${enable_htmldoc+set}" = set; then : enableval=$enable_htmldoc; if test x"$enableval" = xyes; then with_htmldoc="yes, check" else with_htmldoc="no" problem_htmldoc=": Explicitly disabled" fi else with_htmldoc="no" fi if test ! x"$with_htmldoc" = xno; then if test x"$XSLTPROC" = x ; then with_htmldoc="no" problem_htmldoc=": No xsltproc found in PATH" elif test x"$SED" = x ; then with_htmldoc="no" problem_htmldoc=": No sed found in PATH" elif test x"$HAVE_PERL_FOR_DOCS" = x0 ; then with_htmldoc="no" problem_htmldoc=": No perl found in PATH" else with_htmldoc="yes" fi fi if test x"$with_htmldoc" = xyes; then FVWM_BUILD_HTMLDOC_TRUE= FVWM_BUILD_HTMLDOC_FALSE='#' else FVWM_BUILD_HTMLDOC_TRUE='#' FVWM_BUILD_HTMLDOC_FALSE= fi # ********* session management # Check the availability of SM; we don't have to add any extra libraries, # since -lSM -lICE are in X_PRE_LIBS when they exist. problem_sm="" # Check whether --enable-sm was given. if test "${enable_sm+set}" = set; then : enableval=$enable_sm; if test x"$enableval" = xyes; then with_sm="yes, check" else with_sm="no" problem_sm=": Explicitly disabled" fi else with_sm="not specified, check" fi if test ! x"$with_sm" = xno; then $UNSET ac_cv_lib_SM_SmcOpenConnection { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SmcOpenConnection in -lSM" >&5 $as_echo_n "checking for SmcOpenConnection in -lSM... " >&6; } if ${ac_cv_lib_SM_SmcOpenConnection+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lSM $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SmcOpenConnection (); int main () { return SmcOpenConnection (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_SM_SmcOpenConnection=yes else ac_cv_lib_SM_SmcOpenConnection=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SM_SmcOpenConnection" >&5 $as_echo "$ac_cv_lib_SM_SmcOpenConnection" >&6; } if test "x$ac_cv_lib_SM_SmcOpenConnection" = xyes; then : with_sm=yes; $as_echo "#define SESSION 1" >>confdefs.h else with_sm=no; problem_sm=": Failed to detect libSM" fi fi # Checking for optional libraries # Default is to use them if found; can be disable using --without # These are put up front so that if they are requested, but # configure fails to find them, we fail early. # ********* shape extension # Check whether --enable-shape was given. if test "${enable_shape+set}" = set; then : enableval=$enable_shape; if test x"$enableval" = xyes; then with_shape="yes, check" else with_shape="no" problem_shape=": Explicitly disabled" fi else with_shape="not specified, check" fi if test ! x"$with_shape" = xno; then $UNSET ac_cv_lib_Xext_XShapeQueryExtension { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XShapeQueryExtension in -lXext" >&5 $as_echo_n "checking for XShapeQueryExtension in -lXext... " >&6; } if ${ac_cv_lib_Xext_XShapeQueryExtension+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XShapeQueryExtension (); int main () { return XShapeQueryExtension (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xext_XShapeQueryExtension=yes else ac_cv_lib_Xext_XShapeQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShapeQueryExtension" >&5 $as_echo "$ac_cv_lib_Xext_XShapeQueryExtension" >&6; } if test "x$ac_cv_lib_Xext_XShapeQueryExtension" = xyes; then : with_shape=yes; $as_echo "#define SHAPE 1" >>confdefs.h else with_shape=no; problem_shape=": Failed to detect Shape extension" fi fi # ********* MIT Shared Memory Extension # Check whether --enable-shm was given. if test "${enable_shm+set}" = set; then : enableval=$enable_shm; if test x"$enableval" = xyes; then with_shm="yes, check" else with_shm="no" problem_shm=": Explicitly disabled" fi else with_shm="not specified, check" fi if test ! x"$with_shm" = xno; then $UNSET ac_cv_lib_Xext_XShmQueryExtension { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XShmQueryExtension in -lXext" >&5 $as_echo_n "checking for XShmQueryExtension in -lXext... " >&6; } if ${ac_cv_lib_Xext_XShmQueryExtension+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XShmQueryExtension (); int main () { return XShmQueryExtension (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xext_XShmQueryExtension=yes else ac_cv_lib_Xext_XShmQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShmQueryExtension" >&5 $as_echo "$ac_cv_lib_Xext_XShmQueryExtension" >&6; } if test "x$ac_cv_lib_Xext_XShmQueryExtension" = xyes; then : with_shm=yes; $as_echo "#define HAVE_XSHM 1" >>confdefs.h else with_shm=no; problem_shm=": Can't detect MIT Shared Memory ext." fi fi # ********* xinerama problem_xinerama="" # Check whether --enable-xinerama was given. if test "${enable_xinerama+set}" = set; then : enableval=$enable_xinerama; if test x"$enableval" = xyes; then with_xinerama="yes, check" else with_xinerama="no" problem_xinerama=": Explicitly disabled" fi else with_xinerama="not specified, check" fi if test ! x"$with_xinerama" = xno; then $UNSET ac_cv_lib_Xinerama_XineramaIsActive _check_solaris_xinerama=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XineramaIsActive in -lXinerama" >&5 $as_echo_n "checking for XineramaIsActive in -lXinerama... " >&6; } if ${ac_cv_lib_Xinerama_XineramaIsActive+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXinerama $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XineramaIsActive (); int main () { return XineramaIsActive (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xinerama_XineramaIsActive=yes else ac_cv_lib_Xinerama_XineramaIsActive=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xinerama_XineramaIsActive" >&5 $as_echo "$ac_cv_lib_Xinerama_XineramaIsActive" >&6; } if test "x$ac_cv_lib_Xinerama_XineramaIsActive" = xyes; then : with_xinerama=yes; Xinerama_LIBS=-lXinerama; $as_echo "#define HAVE_XINERAMA 1" >>confdefs.h else _check_solaris_xinerama=yes fi if test x"$_check_solaris_xinerama" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XineramaGetState in -lXext" >&5 $as_echo_n "checking for XineramaGetState in -lXext... " >&6; } if ${ac_cv_lib_Xext_XineramaGetState+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XineramaGetState (); int main () { return XineramaGetState (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xext_XineramaGetState=yes else ac_cv_lib_Xext_XineramaGetState=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XineramaGetState" >&5 $as_echo "$ac_cv_lib_Xext_XineramaGetState" >&6; } if test "x$ac_cv_lib_Xext_XineramaGetState" = xyes; then : $as_echo "#define HAVE_XINERAMA 1" >>confdefs.h $as_echo "#define HAVE_SOLARIS_XINERAMA 1" >>confdefs.h with_xinerama=yes; Xinerama_LIBS=-lXext my_CPPFLAGS="$CPPFLAGS"; CPPFLAGS="$X_CPPFLAGS $CPPFLAGS" my_hdr="X11/extensions/xinerama.h" as_ac_Header=`$as_echo "ac_cv_header_$my_hdr" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$my_hdr" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : $as_echo "#define HAVE_SOLARIS_XINERAMA_H 1" >>confdefs.h problem_xinerama=" (Using Solaris Xinerama calls)" else problem_xinerama=" (Using Solaris 9 prototypes for missing header)" fi CPPFLAGS="$my_CPPFLAGS" else with_xinerama=no; Xinerama_LIBS= problem_xinerama=": Failed to detect libXinerama" fi fi $UNSET _check_solaris_xinerama fi # ********* xinerama-emulation { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Xinerama emulation on one screen (useful only for developers)" >&5 $as_echo_n "checking whether to enable Xinerama emulation on one screen (useful only for developers)... " >&6; } # Check whether --enable-xinerama-emulation was given. if test "${enable_xinerama_emulation+set}" = set; then : enableval=$enable_xinerama_emulation; if test "$enableval" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define USE_XINERAMA_EMULATION 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$enable_xinerama_emulation" = xyes; then with_xinerama_emulation=yes else with_xinerama_emulation=no fi # ********* xrender problem_xrender="" # Check whether --enable-xrender was given. if test "${enable_xrender+set}" = set; then : enableval=$enable_xrender; if test x"$enableval" = xyes; then with_xrender="yes, check" else with_xrender="no" problem_xrender=": Explicitly disabled" fi else with_xrender="not specified, check" fi if test ! x"$with_xrender" = xno; then $UNSET ac_cv_lib_Xrender_XRenderComposite { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRenderComposite in -lXrender" >&5 $as_echo_n "checking for XRenderComposite in -lXrender... " >&6; } if ${ac_cv_lib_Xrender_XRenderComposite+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrender $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XRenderComposite (); int main () { return XRenderComposite (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xrender_XRenderComposite=yes else ac_cv_lib_Xrender_XRenderComposite=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderComposite" >&5 $as_echo "$ac_cv_lib_Xrender_XRenderComposite" >&6; } if test "x$ac_cv_lib_Xrender_XRenderComposite" = xyes; then : with_xrender=yes; Xrender_LIBS=-lXrender; $as_echo "#define HAVE_XRENDER 1" >>confdefs.h else with_xrender=no; Xrender_LIBS= problem_xrender=": Failed to detect libXrender" fi fi # ********* xcursor xcursor_CFLAGS="" xcursor_LIBS="" # Check whether --enable-xcursor was given. if test "${enable_xcursor+set}" = set; then : enableval=$enable_xcursor; if test x"$enableval" = xno; then with_xcursor=no problem_xcursor=": Explicitly disabled" fi fi if test ! x"$with_xcursor" = xno; then with_xcursor=no if test ! x"$with_xrender" = xno; then $UNSET ac_cv_lib_Xrender_XRenderCreateCursor { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRenderCreateCursor in -lXrender" >&5 $as_echo_n "checking for XRenderCreateCursor in -lXrender... " >&6; } if ${ac_cv_lib_Xrender_XRenderCreateCursor+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrender $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XRenderCreateCursor (); int main () { return XRenderCreateCursor (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xrender_XRenderCreateCursor=yes else ac_cv_lib_Xrender_XRenderCreateCursor=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderCreateCursor" >&5 $as_echo "$ac_cv_lib_Xrender_XRenderCreateCursor" >&6; } if test "x$ac_cv_lib_Xrender_XRenderCreateCursor" = xyes; then : with_xcursor=yes else problem_xcursor=": Your libXrender version is too old" fi else problem_xcursor=": Need Xrender support" fi fi if test x"$with_xcursor" = xyes ; then $UNSET ac_cv_lib_Xcursor_XcursorImageLoadCursor { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XcursorImageLoadCursor in -lXcursor" >&5 $as_echo_n "checking for XcursorImageLoadCursor in -lXcursor... " >&6; } if ${ac_cv_lib_Xcursor_XcursorImageLoadCursor+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXcursor $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XcursorImageLoadCursor (); int main () { return XcursorImageLoadCursor (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xcursor_XcursorImageLoadCursor=yes else ac_cv_lib_Xcursor_XcursorImageLoadCursor=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xcursor_XcursorImageLoadCursor" >&5 $as_echo "$ac_cv_lib_Xcursor_XcursorImageLoadCursor" >&6; } if test "x$ac_cv_lib_Xcursor_XcursorImageLoadCursor" = xyes; then : $as_echo "#define HAVE_XCURSOR 1" >>confdefs.h Xcursor_LIBS=-lXcursor problem_xcursor="" else with_xcursor=no problem_xcursor=": Failed to detect libXcursor" fi fi # ********* xft problem_xft="" # Check whether --enable-xft was given. if test "${enable_xft+set}" = set; then : enableval=$enable_xft; if test x"$enableval" = xyes; then with_xft="yes, check" else with_xft="no" problem_xft=": Explicitly disabled" fi else with_xft="not specified, check" fi if test ! x"$with_xft" = xno; then # first check for freetype2 have_freetype=no # Check whether --with-freetype-prefix was given. if test "${with_freetype_prefix+set}" = set; then : withval=$with_freetype_prefix; ft_config_prefix="$withval" else ft_config_prefix="" fi # Check whether --with-freetype-exec-prefix was given. if test "${with_freetype_exec_prefix+set}" = set; then : withval=$with_freetype_exec_prefix; ft_config_exec_prefix="$withval" else ft_config_exec_prefix="" fi # Check whether --enable-freetypetest was given. if test "${enable_freetypetest+set}" = set; then : enableval=$enable_freetypetest; else enable_fttest=yes fi if test x$ft_config_exec_prefix != x ; then ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" if test x${FT2_CONFIG+set} != xset ; then FT2_CONFIG=$ft_config_exec_prefix/bin/freetype-config fi fi if test x$ft_config_prefix != x ; then ft_config_args="$ft_config_args --prefix=$ft_config_prefix" if test x${FT2_CONFIG+set} != xset ; then FT2_CONFIG=$ft_config_prefix/bin/freetype-config fi fi # Extract the first word of "freetype-config", so it can be a program name with args. set dummy freetype-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_FT2_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $FT2_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_FT2_CONFIG="$FT2_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_FT2_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_FT2_CONFIG" && ac_cv_path_FT2_CONFIG="no" ;; esac fi FT2_CONFIG=$ac_cv_path_FT2_CONFIG if test -n "$FT2_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FT2_CONFIG" >&5 $as_echo "$FT2_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi min_ft_version=6.1.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FreeType - version >= $min_ft_version" >&5 $as_echo_n "checking for FreeType - version >= $min_ft_version... " >&6; } no_ft="" if test "$FT2_CONFIG" = "no" ; then no_ft=yes else FT2_CFLAGS=`$FT2_CONFIG $ft_config_args --cflags` FT2_LIBS=`$FT2_CONFIG $ft_config_args --libs` ft_config_major_version=`$FT2_CONFIG $ft_config_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\1/'` ft_config_minor_version=`$FT2_CONFIG $ft_config_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\2/'` ft_config_micro_version=`$FT2_CONFIG $ft_config_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\3/'` ft_min_major_version=`echo $min_ft_version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\1/'` ft_min_minor_version=`echo $min_ft_version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\2/'` ft_min_micro_version=`echo $min_ft_version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\3/'` if test "x$enable_fttest" = "xyes" ; then ft_config_is_lt=no if test $ft_config_major_version -lt $ft_min_major_version ; then ft_config_is_lt=yes else if test $ft_config_major_version -eq $ft_min_major_version ; then if test $ft_config_minor_version -lt $ft_min_minor_version ; then ft_config_is_lt=yes else if test $ft_config_minor_version -eq $ft_min_minor_version ; then if test $ft_config_micro_version -lt $ft_min_micro_version ; then ft_config_is_lt=yes fi fi fi fi fi if test "x$ft_config_is_lt" = "xyes" ; then : else ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $FT2_CFLAGS" LIBS="$FT2_LIBS $LIBS" if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include FT_FREETYPE_H #include #include int main() { FT_Library library; FT_Error error; error = FT_Init_FreeType(&library); if (error) return 1; else { FT_Done_FreeType(library); return 0; } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_ft=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi # test $ft_config_version -lt $ft_min_version fi # test "x$enable_fttest" = "xyes" fi # test "$FT2_CONFIG" = "no" if test "x$no_ft" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$FT2_CONFIG" = "no" ; then echo "*** The freetype-config script installed by FreeType 2 could not be found." echo "*** If FreeType 2 was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the FT2_CONFIG environment variable to the" echo "*** full path to freetype-config." else echo "*** The FreeType test program failed to run. If your system uses" echo "*** shared libraries and they are installed outside the normal" echo "*** system library path, make sure the variable LD_LIBRARY_PATH" echo "*** (or whatever is appropiate for your system) is correctly set." fi FT2_CFLAGS="" FT2_LIBS="" : fi if test x"$no_ft" = x; then have_freetype=yes else have_freetype=no problem_xft=": Can't detect freetype2 >= 6.1.0/2.0.6" fi # check for fontconfig for Xft 2 have_fontconfig=no if test ! x"$have_freetype" = xno ; then # Check whether --with-fontconfig-prefix was given. if test "${with_fontconfig_prefix+set}" = set; then : withval=$with_fontconfig_prefix; fc_config_prefix="$withval" else fc_config_prefix="" fi # Check whether --with-fontconfig-exec-prefix was given. if test "${with_fontconfig_exec_prefix+set}" = set; then : withval=$with_fontconfig_exec_prefix; fc_config_exec_prefix="$withval" else fc_config_exec_prefix="" fi # Check whether --enable-fontconfigtest was given. if test "${enable_fontconfigtest+set}" = set; then : enableval=$enable_fontconfigtest; else enable_fctest=yes fi if test x$fc_config_exec_prefix != x ; then fc_config_args="$fc_config_args --exec-prefix=$fc_config_exec_prefix" if test x${FC_CONFIG+set} != xset ; then FC_CONFIG=$fc_config_exec_prefix/bin/fontconfig-config fi fi if test x$fc_config_prefix != x ; then fc_config_args="$fc_config_args --prefix=$fc_config_prefix" if test x${FC_CONFIG+set} != xset ; then FC_CONFIG=$fc_config_prefix/bin/fontconfig-config fi fi # Extract the first word of "fontconfig-config", so it can be a program name with args. set dummy fontconfig-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_FC_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $FC_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_FC_CONFIG="$FC_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_FC_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_FC_CONFIG" && ac_cv_path_FC_CONFIG="no" ;; esac fi FC_CONFIG=$ac_cv_path_FC_CONFIG if test -n "$FC_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC_CONFIG" >&5 $as_echo "$FC_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi min_fc_version=1.0.1 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fontconfig - version >= $min_fc_version" >&5 $as_echo_n "checking for Fontconfig - version >= $min_fc_version... " >&6; } no_fc="" pkg_config_fontconfig_exists="" if test "$FC_CONFIG" = "no" ; then if test "x$PKG_CONFIG" != "xno" ; then if $PKG_CONFIG --exists 'fontconfig' ; then if $PKG_CONFIG --exists 'fontconfig >= 1.0.1' ; then FC_CFLAGS=`$PKG_CONFIG --cflags fontconfig` FC_LIBS=`$PKG_CONFIG --libs fontconfig` else no_fc=yes fc_config_is_lt=yes fi else pkg_config_fontconfig_exists="maybe" no_fc=yes fi else no_fc=yes fi else FC_CFLAGS=`$FC_CONFIG $fc_config_args --cflags` FC_LIBS=`$FC_CONFIG $fc_config_args --libs` fc_config_major_version=`$FC_CONFIG $fc_config_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\1/'` fc_config_minor_version=`$FC_CONFIG $fc_config_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\2/'` fc_config_micro_version=`$FC_CONFIG $fc_config_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\3/'` fc_min_major_version=`echo $min_fc_version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\1/'` fc_min_minor_version=`echo $min_fc_version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\2/'` fc_min_micro_version=`echo $min_fc_version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\3/'` fc_config_is_lt=no if test $fc_config_major_version -lt $fc_min_major_version ; then fc_config_is_lt=yes else if test $fc_config_major_version -eq $fc_min_major_version ; then if test $fc_config_minor_version -lt $fc_min_minor_version ; then fc_config_is_lt=yes else if test $fc_config_minor_version -eq $fc_min_minor_version ; then if test $fc_config_micro_version -lt $fc_min_micro_version ; then fc_config_is_lt=yes fi fi fi fi fi if test "x$fc_config_is_lt" = "xyes" ; then no_fc=yes fi fi if test "x$no_fc" = x ; then if test "x$enable_fctest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $FC_CFLAGS $FT2_CFLAGS" LIBS="$FC_LIBS $LIBS $FT2_LIBS" if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main() { FcBool result; result = FcInit(); if (result) { return 0; } else { return 1; } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_fc=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_fc" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "x$fc_config_is_lt" = "xyes"; then echo "*** Your Fontconfig package version is < 1.0.1" elif test "x$pkg_config_fontconfig_exists" = "xmaybe"; then echo "*** fontconfig was not found in the pkg-config search path." echo "*** either fontconfig is not installed or perhaps you should" echo "*** add the directory containing fontconfig.pc to the " echo "*** PKG_CONFIG_PATH environment variable." elif test "$FC_CONFIG" != "no"; then echo "*** The Fontconfig test program failed to run. If your system uses" echo "*** shared libraries and they are installed outside the normal" echo "*** system library path, make sure the variable LD_LIBRARY_PATH" echo "*** (or whatever is appropiate for your system) is correctly set." fi FC_CFLAGS="" FC_LIBS="" : fi if test x"$no_fc" = x ; then have_fontconfig=yes fontconfig_CFLAGS=`$PKG_CONFIG --cflags fontconfig` fontconfig_LIBS=`$PKG_CONFIG --libs fontconfig` CFLAGS="$CFLAGS $fontconfig_CFLAGS" LIBS="$LIBS $fontconfig_LIBS" else have_fontconfig=no problem_xft=": Can't detect fontconfig >= 1.0.1" fi fi # now check for Xft 2 with_xft=no if test ! x"$have_fontconfig" = xno ; then # Xft 2 # Check whether --with-xft-prefix was given. if test "${with_xft_prefix+set}" = set; then : withval=$with_xft_prefix; xft_config_prefix="$withval" else xft_config_prefix="" fi # Check whether --with-xft-exec-prefix was given. if test "${with_xft_exec_prefix+set}" = set; then : withval=$with_xft_exec_prefix; xft_config_exec_prefix="$withval" else xft_config_exec_prefix="" fi # Check whether --enable-xfttest was given. if test "${enable_xfttest+set}" = set; then : enableval=$enable_xfttest; else enable_xfttest=yes fi if test x$xft_config_exec_prefix != x ; then xft_config_args="$xft_config_args --exec-prefix=$xft_config_exec_prefix" if test x${XFT_CONFIG+set} != xset ; then XFT_CONFIG=$xft_config_exec_prefix/bin/xft-config fi fi if test x$xft_config_prefix != x ; then xft_config_args="$xft_config_args --prefix=$xft_config_prefix" if test x${XFT_CONFIG+set} != xset ; then XFT_CONFIG=$xft_config_prefix/bin/xft-config fi fi # Extract the first word of "xft-config", so it can be a program name with args. set dummy xft-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XFT_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $XFT_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_XFT_CONFIG="$XFT_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XFT_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_XFT_CONFIG" && ac_cv_path_XFT_CONFIG="no" ;; esac fi XFT_CONFIG=$ac_cv_path_XFT_CONFIG if test -n "$XFT_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XFT_CONFIG" >&5 $as_echo "$XFT_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi min_xft_version=2.0.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Xft - version >= $min_xft_version" >&5 $as_echo_n "checking for Xft - version >= $min_xft_version... " >&6; } no_xft="" pkg_config_xft_exists="" if test "$XFT_CONFIG" = "no" ; then if test "x$PKG_CONFIG" != "xno" ; then if $PKG_CONFIG --exists 'xft' ; then if $PKG_CONFIG --exists 'xft >= 2.0.0' ; then XFT_CFLAGS=`$PKG_CONFIG --cflags xft` XFT_LIBS=`$PKG_CONFIG --libs xft` else no_xft=yes xft_config_is_lt=yes fi else pkg_config_xft_exists="maybe" no_xft=yes fi else no_xft=yes fi else XFT_CFLAGS=`$XFT_CONFIG $xft_config_args --cflags` XFT_LIBS=`$XFT_CONFIG $xft_config_args --libs` xft_config_major_version=`$XFT_CONFIG $xft_config_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\1/'` xft_config_minor_version=`$XFT_CONFIG $xft_config_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\2/'` xft_config_micro_version=`$XFT_CONFIG $xft_config_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\3/'` xft_min_major_version=`echo $min_xft_version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\1/'` xft_min_minor_version=`echo $min_xft_version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\2/'` xft_min_micro_version=`echo $min_xft_version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\3/'` xft_config_is_lt=no if test $xft_config_major_version -lt $xft_min_major_version ; then xft_config_is_lt=yes else if test $xft_config_major_version -eq $xft_min_major_version ; then if test $xft_config_minor_version -lt $xft_min_minor_version ; then xft_config_is_lt=yes else if test $xft_config_minor_version -eq $xft_min_minor_version ; then if test $xft_config_micro_version -lt $xft_min_micro_version ; then xft_config_is_lt=yes fi fi fi fi fi if test "x$xft_config_is_lt" = "xyes" ; then : fi fi if test "x$no_xft" = x ; then if test "x$enable_xfttest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$XFT_CFLAGS $CFLAGS" LIBS="$XFT_LIBS $LIBS" if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main() { FcBool result = 1; result = XftInit(NULL); if (result) { return 0; } else { return 1; } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_xft=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_xft" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "x$xft_config_is_lt" = "xyes"; then echo "*** Your xft2 package version is < 2.0.0" elif test "x$pkg_config_fontconfig_exists" = "xmaybe" ; then echo "*** xft2 was not found in the pkg-config search path." echo "*** either xft is not installed or perhaps you should" echo "*** add the directory containing xft.pc to the " echo "*** PKG_CONFIG_PATH environment variable." elif test "$XFT_CONFIG" = "no"; then echo "*** The xft-config script installed by Xft 2 could not be found." echo "*** If Xft 2 was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the XFT_CONFIG environment variable to the" echo "*** full path to xft-config." else echo "*** The Xft test program failed to run. If your system uses" echo "*** shared libraries and they are installed outside the normal" echo "*** system library path, make sure the variable LD_LIBRARY_PATH" echo "*** (or whatever is appropiate for your system) is correctly set." fi XFT_CFLAGS="" XFT_LIBS="" : fi if test x"$no_xft" = x; then with_xft=yes problem_xft=" (version 2)" $as_echo "#define HAVE_XFT2 1" >>confdefs.h $as_echo "#define HAVE_XFT 1" >>confdefs.h $as_echo "#define HAVE_XFT_UTF8 1" >>confdefs.h Xft_LIBS=$XFT_LIBS Xft_CFLAGS=$XFT_CFLAGS else problem_xft=": Can't detect Xft2, detected fontconfig" fi fi # if Xft2 not detected check for Xft1 if test ! x"$have_freetype" = xno && test ! x"$with_xft" = xyes; then #Xft 1 $UNSET ac_cv_lib_XftConfigSubstitute $UNSET ac_cv_lib_Xft_XftFontOpen $UNSET ac_cv_lib_Xft_XftDrawStringUtf8 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftFontOpen in -lXft" >&5 $as_echo_n "checking for XftFontOpen in -lXft... " >&6; } if ${ac_cv_lib_Xft_XftFontOpen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXft $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $FT2_LIBS $Xrender_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XftFontOpen (); int main () { return XftFontOpen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xft_XftFontOpen=yes else ac_cv_lib_Xft_XftFontOpen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftFontOpen" >&5 $as_echo "$ac_cv_lib_Xft_XftFontOpen" >&6; } if test "x$ac_cv_lib_Xft_XftFontOpen" = xyes; then : with_xft=yes else with_xft=no fi if test x"$with_xft" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftConfigSubstitute in -lXft" >&5 $as_echo_n "checking for XftConfigSubstitute in -lXft... " >&6; } if ${ac_cv_lib_Xft_XftConfigSubstitute+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXft $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $FT2_LIBS $Xrender_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XftConfigSubstitute (); int main () { return XftConfigSubstitute (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xft_XftConfigSubstitute=yes else ac_cv_lib_Xft_XftConfigSubstitute=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftConfigSubstitute" >&5 $as_echo "$ac_cv_lib_Xft_XftConfigSubstitute" >&6; } if test "x$ac_cv_lib_Xft_XftConfigSubstitute" = xyes; then : is_xft1=yes else is_xft1=no fi if test x"$is_xft1" = xyes; then Xft_LIBS="-lXft $FT2_LIBS" Xft_CFLAGS="$Xft_CFLAGS $FT2_CFLAGS" problem_xft=" (version 1)" $as_echo "#define HAVE_XFT 1" >>confdefs.h else with_xft=no problem_xft=": Can't detect Xft 1 or fontconfig" fi else problem_xft=": Can't detect Xft 1 or 2 and fontconfig" fi if test x"$with_xft" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftDrawStringUtf8 in -lXft" >&5 $as_echo_n "checking for XftDrawStringUtf8 in -lXft... " >&6; } if ${ac_cv_lib_Xft_XftDrawStringUtf8+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXft $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $FT2_LIBS $Xrender_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XftDrawStringUtf8 (); int main () { return XftDrawStringUtf8 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xft_XftDrawStringUtf8=yes else ac_cv_lib_Xft_XftDrawStringUtf8=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftDrawStringUtf8" >&5 $as_echo "$ac_cv_lib_Xft_XftDrawStringUtf8" >&6; } if test "x$ac_cv_lib_Xft_XftDrawStringUtf8" = xyes; then : $as_echo "#define HAVE_XFT_UTF8 1" >>confdefs.h fi fi fi fi # ********* xpm problem_xpm=": Xpm library or header not found" $UNSET ac_cv_header_X11_xpm_h $UNSET ac_cv_lib_Xpm_XpmReadFileToXpmImage smr_lib=Xpm smr_header=X11/xpm.h smr_lib=Xpm # Check whether --with-xpm-library was given. if test "${with_xpm_library+set}" = set; then : withval=$with_xpm_library; if test "$withval" = yes; then with_xpm=yes xpm_LIBS="-l${smr_lib}" elif test "$withval" = no; then with_xpm=no xpm_LIBS= else with_xpm=yes if test -f "$withval"; then xpm_LIBS=$withval elif test -d "$withval"; then xpm_LIBS="-L$withval -l${smr_lib}" else as_fn_error $? "--with-xpm-library argument must be yes/no, file or directory" "$LINENO" 5 fi fi else with_xpm=maybe xpm_LIBS="-l${smr_lib}" fi if test "$with_xpm" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmReadFileToXpmImage in -lXpm" >&5 $as_echo_n "checking for XpmReadFileToXpmImage in -lXpm... " >&6; } if ${ac_cv_lib_Xpm_XpmReadFileToXpmImage+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm ${xpm_LIBS} $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XpmReadFileToXpmImage (); int main () { return XpmReadFileToXpmImage (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xpm_XpmReadFileToXpmImage=yes else ac_cv_lib_Xpm_XpmReadFileToXpmImage=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xpm_XpmReadFileToXpmImage" >&5 $as_echo "$ac_cv_lib_Xpm_XpmReadFileToXpmImage" >&6; } if test "x$ac_cv_lib_Xpm_XpmReadFileToXpmImage" = xyes; then : smr_havelib=yes else smr_havelib=no; problem_xpm=": Can't find working lib$smr_lib" fi if test "$smr_havelib" = yes -a "$smr_header" != ""; then # Check whether --with-xpm-includes was given. if test "${with_xpm_includes+set}" = set; then : withval=$with_xpm_includes; if test -d "$withval"; then xpm_CFLAGS="-I${withval}" else as_fn_error $? "argument must be a directory" "$LINENO" 5 fi fi smr_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS ${xpm_CFLAGS}" CPPFLAGS="$CPPFLAGS $X_CFLAGS" for ac_header in $smr_header do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS=$smr_save_CPPFLAGS smr_safe=`echo "$smr_header" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$ac_cv_header_'$smr_safe`\" != yes"; then smr_havelib=no problem_xpm=": Can't find working $smr_header" fi fi if test "$smr_havelib" = yes; then with_xpm=yes problem_xpm= else xpm_LIBS= xpm_CFLAGS= with_xpm=no fi else problem_xpm=": Explicitly disabled" fi if test ! x"$xpm_LIBS" = x; then # Check for proper version of Xpm -- from XEmacs 21.x configure.in { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Xpm 3.4g or better" >&5 $as_echo_n "checking for Xpm 3.4g or better... " >&6; } my_CPPFLAGS="$CPPFLAGS" my_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $xpm_CFLAGS $X_CFLAGS" LIBS="$LIBS $xpm_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main(int c, char **v) { return c == 1 ? 0 : XpmIncludeVersion != XpmLibraryVersion() ? 1 : XpmIncludeVersion < 30407 ? 2 : 0 ;} _ACEOF if ac_fn_c_try_run "$LINENO"; then : ./conftest dummy_arg; xpm_status=$?; if test x"$xpm_status" = x0; then with_xpm=yes problem_xpm="" else with_xpm=no; if test x"$xpm_status" = x1; then problem_xpm=": Xpm library and header versions don't match" elif test x"$xpm_status" = x2x; then problem_xpm=": Xpm library version is too old" else problem_xpm=": Internal xpm detection logic error" fi fi else with_xpm=no; problem_xpm=": Xpm test error, see config.log" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_xpm" >&5 $as_echo "$with_xpm" >&6; } CPPFLAGS="$my_CPPFLAGS" LIBS="$my_LIBS" if test x"$with_xpm" = xyes; then $as_echo "#define XPM 1" >>confdefs.h # FVWMBANNER=FvwmBanner AC_SUBST(FVWMBANNER) # XPMROOT=xpmroot AC_SUBST(XPMROOT) # FVWMSCRIPT=FvwmScript AC_SUBST(FVWMSCRIPT) else xpm_LIBS= xpm_CFLAGS= fi fi # ********* png problem_png=": png library or header not found" $UNSET ac_cv_header_png_h $UNSET ac_cv_lib_png_png_read_info smr_lib=png smr_header=png.h smr_lib=png # Check whether --with-png-library was given. if test "${with_png_library+set}" = set; then : withval=$with_png_library; if test "$withval" = yes; then with_png=yes png_LIBS="-l${smr_lib}" elif test "$withval" = no; then with_png=no png_LIBS= else with_png=yes if test -f "$withval"; then png_LIBS=$withval elif test -d "$withval"; then png_LIBS="-L$withval -l${smr_lib}" else as_fn_error $? "--with-png-library argument must be yes/no, file or directory" "$LINENO" 5 fi fi else with_png=maybe png_LIBS="-l${smr_lib}" fi if test "$with_png" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_read_info in -lpng" >&5 $as_echo_n "checking for png_read_info in -lpng... " >&6; } if ${ac_cv_lib_png_png_read_info+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng ${png_LIBS} -lz -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char png_read_info (); int main () { return png_read_info (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_png_png_read_info=yes else ac_cv_lib_png_png_read_info=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_read_info" >&5 $as_echo "$ac_cv_lib_png_png_read_info" >&6; } if test "x$ac_cv_lib_png_png_read_info" = xyes; then : smr_havelib=yes else smr_havelib=no; problem_png=": Can't find working lib$smr_lib" fi if test "$smr_havelib" = yes -a "$smr_header" != ""; then # Check whether --with-png-includes was given. if test "${with_png_includes+set}" = set; then : withval=$with_png_includes; if test -d "$withval"; then png_CFLAGS="-I${withval}" else as_fn_error $? "argument must be a directory" "$LINENO" 5 fi fi smr_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS ${png_CFLAGS}" for ac_header in $smr_header do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS=$smr_save_CPPFLAGS smr_safe=`echo "$smr_header" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$ac_cv_header_'$smr_safe`\" != yes"; then smr_havelib=no problem_png=": Can't find working $smr_header" fi fi if test "$smr_havelib" = yes; then with_png=yes problem_png= else png_LIBS= png_CFLAGS= with_png=no fi else problem_png=": Explicitly disabled" fi if test ! x"$png_LIBS" = x; then # Check for proper version of png { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng 1.0.4a or better" >&5 $as_echo_n "checking for libpng 1.0.4a or better... " >&6; } my_CPPFLAGS="$CPPFLAGS" my_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $png_CFLAGS" LIBS="$LIBS $png_LIBS -lz -lm" if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main(int c, char **v) { return c == 1 ? 0 : (PNG_LIBPNG_VER < 10005) ? 2 : 0 ;} _ACEOF if ac_fn_c_try_run "$LINENO"; then : ./conftest dummy_arg; png_status=$?; if test x"$png_status" = x0; then with_png=yes; else with_png=no; if test x"$png_status" = x2; then problem_png=": png library version is too old" else problem_png=": Internal png detection logic error" fi fi else with_png="no"; problem_png=": png test error, see config.log" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_png" >&5 $as_echo "$with_png" >&6; } CPPFLAGS="$my_CPPFLAGS" LIBS="$my_LIBS" fi if test x"$with_png" = xyes; then $as_echo "#define HAVE_PNG 1" >>confdefs.h png_LIBS="$png_LIBS -lz" problem_png="" else with_png=no fi # ** needed by the png support { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # ********* rsvg rsvg_min_version=2.13.92 # Check whether --enable-rsvg was given. if test "${enable_rsvg+set}" = set; then : enableval=$enable_rsvg; if test x"$enableval" = xno; then with_rsvg=no problem_rsvg=": Explicitly disabled" fi fi if test ! x"$with_rsvg" = xno; then with_rsvg=no if test ! x"$PKG_CONFIG" = xno ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for librsvg - version >= $rsvg_min_version" >&5 $as_echo_n "checking for librsvg - version >= $rsvg_min_version... " >&6; } if $PKG_CONFIG --exists librsvg-2.0 ; then if $PKG_CONFIG --exists "librsvg-2.0 >= $rsvg_min_version" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo svg backend" >&5 $as_echo_n "checking for cairo svg backend... " >&6; } if $PKG_CONFIG --exists cairo-svg ; then svg_packages="librsvg-2.0 cairo-svg" elif $PKG_CONFIG --exists libsvg-cairo ; then svg_packages="librsvg-2.0 libsvg-cairo" elif $PKG_CONFIG --exists cairo ; then svg_packages="librsvg-2.0 cairo" else svg_packages="" fi if test ! x"$svg_packages" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } rsvg_CFLAGS=`$PKG_CONFIG --cflags $svg_packages` rsvg_LIBS=`$PKG_CONFIG --libs $svg_packages` with_rsvg=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** cairo was not found in the pkg-config search" >&5 $as_echo "$as_me: WARNING: *** cairo was not found in the pkg-config search" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** path. Add the directory containing cairo.pc" >&5 $as_echo "$as_me: WARNING: *** path. Add the directory containing cairo.pc" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** to the PKG_CONFIG_PATH environment variable." >&5 $as_echo "$as_me: WARNING: *** to the PKG_CONFIG_PATH environment variable." >&2;} problem_rsvg=": Cannot detect cairo backend" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Your librsvg version is < $rsvg_min_version" >&5 $as_echo "$as_me: WARNING: *** Your librsvg version is < $rsvg_min_version" >&2;} problem_rsvg=": Your librsvg version is too old" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** librsvg-2.0 was not found in the pkg-config search" >&5 $as_echo "$as_me: WARNING: *** librsvg-2.0 was not found in the pkg-config search" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** path. Either librsvg is not installed or you need" >&5 $as_echo "$as_me: WARNING: *** path. Either librsvg is not installed or you need" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** to add the directory containing librsvg-2.0.pc to" >&5 $as_echo "$as_me: WARNING: *** to add the directory containing librsvg-2.0.pc to" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** the PKG_CONFIG_PATH environment variable." >&5 $as_echo "$as_me: WARNING: *** the PKG_CONFIG_PATH environment variable." >&2;} problem_rsvg=": librsvg library or header not found" fi else problem_rsvg=": pkg-config not found" fi fi if test x"$with_rsvg" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a librsvg program compiles and runs" >&5 $as_echo_n "checking whether a librsvg program compiles and runs... " >&6; } original_CFLAGS="$CFLAGS" original_LIBS="$LIBS" CFLAGS="$CFLAGS $rsvg_CFLAGS" LIBS="$LIBS $rsvg_LIBS" if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main() { RsvgHandle *rsvg; g_type_init(); if(!(rsvg = rsvg_handle_new())) return 1; g_object_unref(G_OBJECT(rsvg)); return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** The librsvg test program failed to run. If your system" >&5 $as_echo "$as_me: WARNING: *** The librsvg test program failed to run. If your system" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** has shared libraries outside the normal system library" >&5 $as_echo "$as_me: WARNING: *** has shared libraries outside the normal system library" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** path, you need to make sure that the LD_LIBRARY_PATH" >&5 $as_echo "$as_me: WARNING: *** path, you need to make sure that the LD_LIBRARY_PATH" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** (or the like) environment variable is correctly set." >&5 $as_echo "$as_me: WARNING: *** (or the like) environment variable is correctly set." >&2;} with_rsvg=no problem_rsvg=": Failed to run test program" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$original_CFLAGS" LIBS="$original_LIBS" fi if test x"$with_rsvg" = xyes ; then $as_echo "#define HAVE_RSVG 1" >>confdefs.h problem_rsvg="" else rsvg_CFLAGS="" rsvg_LIBS="" fi # ********* rplay $UNSET ac_cv_header_rplay_h $UNSET ac_cv_lib_rplay_rplay_create # Add in X_EXTRA_LIBS here to get things like connect(). smr_lib=rplay smr_header=rplay.h smr_lib=rplay # Check whether --with-rplay-library was given. if test "${with_rplay_library+set}" = set; then : withval=$with_rplay_library; if test "$withval" = yes; then with_rplay=yes rplay_LIBS="-l${smr_lib}" elif test "$withval" = no; then with_rplay=no rplay_LIBS= else with_rplay=yes if test -f "$withval"; then rplay_LIBS=$withval elif test -d "$withval"; then rplay_LIBS="-L$withval -l${smr_lib}" else as_fn_error $? "--with-rplay-library argument must be yes/no, file or directory" "$LINENO" 5 fi fi else with_rplay=maybe rplay_LIBS="-l${smr_lib}" fi if test "$with_rplay" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rplay_create in -lrplay" >&5 $as_echo_n "checking for rplay_create in -lrplay... " >&6; } if ${ac_cv_lib_rplay_rplay_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrplay ${rplay_LIBS} $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rplay_create (); int main () { return rplay_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rplay_rplay_create=yes else ac_cv_lib_rplay_rplay_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rplay_rplay_create" >&5 $as_echo "$ac_cv_lib_rplay_rplay_create" >&6; } if test "x$ac_cv_lib_rplay_rplay_create" = xyes; then : smr_havelib=yes else smr_havelib=no; problem_rplay=": Can't find working lib$smr_lib" fi if test "$smr_havelib" = yes -a "$smr_header" != ""; then # Check whether --with-rplay-includes was given. if test "${with_rplay_includes+set}" = set; then : withval=$with_rplay_includes; if test -d "$withval"; then rplay_CFLAGS="-I${withval}" else as_fn_error $? "argument must be a directory" "$LINENO" 5 fi fi smr_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS ${rplay_CFLAGS}" for ac_header in $smr_header do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS=$smr_save_CPPFLAGS smr_safe=`echo "$smr_header" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$ac_cv_header_'$smr_safe`\" != yes"; then smr_havelib=no problem_rplay=": Can't find working $smr_header" fi fi if test "$smr_havelib" = yes; then with_rplay=yes problem_rplay= else rplay_LIBS= rplay_CFLAGS= with_rplay=no fi else problem_rplay=": Explicitly disabled" fi test ! x"$rplay_LIBS" = x && $as_echo "#define HAVE_RPLAY 1" >>confdefs.h # ********* stroke $UNSET ac_cv_header_stroke_h $UNSET ac_cv_lib_stroke_stroke_init smr_lib=stroke smr_header=stroke.h smr_lib=stroke # Check whether --with-stroke-library was given. if test "${with_stroke_library+set}" = set; then : withval=$with_stroke_library; if test "$withval" = yes; then with_stroke=yes stroke_LIBS="-l${smr_lib}" elif test "$withval" = no; then with_stroke=no stroke_LIBS= else with_stroke=yes if test -f "$withval"; then stroke_LIBS=$withval elif test -d "$withval"; then stroke_LIBS="-L$withval -l${smr_lib}" else as_fn_error $? "--with-stroke-library argument must be yes/no, file or directory" "$LINENO" 5 fi fi else with_stroke=maybe stroke_LIBS="-l${smr_lib}" fi if test "$with_stroke" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stroke_init in -lstroke" >&5 $as_echo_n "checking for stroke_init in -lstroke... " >&6; } if ${ac_cv_lib_stroke_stroke_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lstroke ${stroke_LIBS} $X_LIBS -lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char stroke_init (); int main () { return stroke_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_stroke_stroke_init=yes else ac_cv_lib_stroke_stroke_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stroke_stroke_init" >&5 $as_echo "$ac_cv_lib_stroke_stroke_init" >&6; } if test "x$ac_cv_lib_stroke_stroke_init" = xyes; then : smr_havelib=yes else smr_havelib=no; problem_stroke=": Can't find working lib$smr_lib" fi if test "$smr_havelib" = yes -a "$smr_header" != ""; then # Check whether --with-stroke-includes was given. if test "${with_stroke_includes+set}" = set; then : withval=$with_stroke_includes; if test -d "$withval"; then stroke_CFLAGS="-I${withval}" else as_fn_error $? "argument must be a directory" "$LINENO" 5 fi fi smr_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS ${stroke_CFLAGS}" CPPFLAGS="$CPPFLAGS $X_CFLAGS -I/usr/X11R6/include" for ac_header in $smr_header do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS=$smr_save_CPPFLAGS smr_safe=`echo "$smr_header" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$ac_cv_header_'$smr_safe`\" != yes"; then smr_havelib=no problem_stroke=": Can't find working $smr_header" fi fi if test "$smr_havelib" = yes; then with_stroke=yes problem_stroke= else stroke_LIBS= stroke_CFLAGS= with_stroke=no fi else problem_stroke=": Explicitly disabled" fi test ! x"$stroke_LIBS" = x && $as_echo "#define HAVE_STROKE 1" >>confdefs.h # ********* readline with_readline=no problem_readline=": Both termcap and ncurses disabled" smr_lib=termcap # Check whether --with-termcap-library was given. if test "${with_termcap_library+set}" = set; then : withval=$with_termcap_library; if test "$withval" = yes; then with_termcap=yes termcap_LIBS="-l${smr_lib}" elif test "$withval" = no; then with_termcap=no termcap_LIBS= else with_termcap=yes if test -f "$withval"; then termcap_LIBS=$withval elif test -d "$withval"; then termcap_LIBS="-L$withval -l${smr_lib}" else as_fn_error $? "--with-termcap-library argument must be yes/no, file or directory" "$LINENO" 5 fi fi else with_termcap=maybe termcap_LIBS="-l${smr_lib}" fi if test ! x"$with_termcap" = xno; then # Forget cached values, so user can re-run configure $UNSET ac_cv_header_readline_history_h $UNSET ac_cv_lib_readline_readline { $as_echo "$as_me:${as_lineno-$LINENO}: checking with termcap" >&5 $as_echo_n "checking with termcap... " >&6; } smr_lib=readline smr_header=readline/history.h smr_lib=readline # Check whether --with-readline-library was given. if test "${with_readline_library+set}" = set; then : withval=$with_readline_library; if test "$withval" = yes; then with_readline=yes readline_LIBS="-l${smr_lib}" elif test "$withval" = no; then with_readline=no readline_LIBS= else with_readline=yes if test -f "$withval"; then readline_LIBS=$withval elif test -d "$withval"; then readline_LIBS="-L$withval -l${smr_lib}" else as_fn_error $? "--with-readline-library argument must be yes/no, file or directory" "$LINENO" 5 fi fi else with_readline=maybe readline_LIBS="-l${smr_lib}" fi if test "$with_readline" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline ${readline_LIBS} $termcap_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : smr_havelib=yes else smr_havelib=no; problem_readline=": Can't find working lib$smr_lib" fi if test "$smr_havelib" = yes -a "$smr_header" != ""; then # Check whether --with-readline-includes was given. if test "${with_readline_includes+set}" = set; then : withval=$with_readline_includes; if test -d "$withval"; then readline_CFLAGS="-I${withval}" else as_fn_error $? "argument must be a directory" "$LINENO" 5 fi fi smr_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS ${readline_CFLAGS}" for ac_header in $smr_header do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS=$smr_save_CPPFLAGS smr_safe=`echo "$smr_header" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$ac_cv_header_'$smr_safe`\" != yes"; then smr_havelib=no problem_readline=": Can't find working $smr_header" fi fi if test "$smr_havelib" = yes; then with_readline=yes problem_readline= else readline_LIBS= readline_CFLAGS= with_readline=no fi else problem_readline=": Explicitly disabled" fi if test ! x"$readline_LIBS" = x; then with_readline=yes readline_LIBS="$readline_LIBS $termcap_LIBS" $as_echo "#define HAVE_READLINE 1" >>confdefs.h fi fi smr_lib=ncurses # Check whether --with-ncurses-library was given. if test "${with_ncurses_library+set}" = set; then : withval=$with_ncurses_library; if test "$withval" = yes; then with_ncurses=yes ncurses_LIBS="-l${smr_lib}" elif test "$withval" = no; then with_ncurses=no ncurses_LIBS= else with_ncurses=yes if test -f "$withval"; then ncurses_LIBS=$withval elif test -d "$withval"; then ncurses_LIBS="-L$withval -l${smr_lib}" else as_fn_error $? "--with-ncurses-library argument must be yes/no, file or directory" "$LINENO" 5 fi fi else with_ncurses=maybe ncurses_LIBS="-l${smr_lib}" fi if test ! x"$with_ncurses" = xno && test x"$readline_LIBS" = x; then # We couldn't use readline with termcap; try with ncurses? # Doesn't this seem a hacky way to do this?? # unset cached values from last check... $UNSET ac_cv_header_readline_history_h $UNSET ac_cv_lib_readline_readline { $as_echo "$as_me:${as_lineno-$LINENO}: checking with ncurses" >&5 $as_echo_n "checking with ncurses... " >&6; } smr_lib=readline smr_header=readline/history.h smr_lib=readline # Check whether --with-readline-library was given. if test "${with_readline_library+set}" = set; then : withval=$with_readline_library; if test "$withval" = yes; then with_readline=yes readline_LIBS="-l${smr_lib}" elif test "$withval" = no; then with_readline=no readline_LIBS= else with_readline=yes if test -f "$withval"; then readline_LIBS=$withval elif test -d "$withval"; then readline_LIBS="-L$withval -l${smr_lib}" else as_fn_error $? "--with-readline-library argument must be yes/no, file or directory" "$LINENO" 5 fi fi else with_readline=maybe readline_LIBS="-l${smr_lib}" fi if test "$with_readline" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 $as_echo_n "checking for readline in -lreadline... " >&6; } if ${ac_cv_lib_readline_readline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline ${readline_LIBS} $ncurses_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char readline (); int main () { return readline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_readline=yes else ac_cv_lib_readline_readline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 $as_echo "$ac_cv_lib_readline_readline" >&6; } if test "x$ac_cv_lib_readline_readline" = xyes; then : smr_havelib=yes else smr_havelib=no; problem_readline=": Can't find working lib$smr_lib" fi if test "$smr_havelib" = yes -a "$smr_header" != ""; then # Check whether --with-readline-includes was given. if test "${with_readline_includes+set}" = set; then : withval=$with_readline_includes; if test -d "$withval"; then readline_CFLAGS="-I${withval}" else as_fn_error $? "argument must be a directory" "$LINENO" 5 fi fi smr_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS ${readline_CFLAGS}" for ac_header in $smr_header do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS=$smr_save_CPPFLAGS smr_safe=`echo "$smr_header" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$ac_cv_header_'$smr_safe`\" != yes"; then smr_havelib=no problem_readline=": Can't find working $smr_header" fi fi if test "$smr_havelib" = yes; then with_readline=yes problem_readline= else readline_LIBS= readline_CFLAGS= with_readline=no fi else problem_readline=": Explicitly disabled" fi if test ! x"$readline_LIBS" = x; then with_readline=yes readline_LIBS="$readline_LIBS $ncurses_LIBS" $as_echo "#define HAVE_READLINE 1" >>confdefs.h fi fi if test x"$with_readline" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for append_history in -lreadline" >&5 $as_echo_n "checking for append_history in -lreadline... " >&6; } if ${ac_cv_lib_readline_append_history+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $readline_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char append_history (); int main () { return append_history (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_append_history=yes else ac_cv_lib_readline_append_history=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_append_history" >&5 $as_echo "$ac_cv_lib_readline_append_history" >&6; } if test "x$ac_cv_lib_readline_append_history" = xyes; then : $as_echo "#define HAVE_GNU_READLINE 1" >>confdefs.h fi fi # Check if Xsetlocale() is available or not. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Xsetlocale in -lX11" >&5 $as_echo_n "checking for _Xsetlocale in -lX11... " >&6; } if ${ac_cv_lib_X11__Xsetlocale+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $X_LIBS -lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char _Xsetlocale (); int main () { return _Xsetlocale (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_X11__Xsetlocale=yes else ac_cv_lib_X11__Xsetlocale=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11__Xsetlocale" >&5 $as_echo "$ac_cv_lib_X11__Xsetlocale" >&6; } if test "x$ac_cv_lib_X11__Xsetlocale" = xyes; then : $as_echo "#define X_LOCALE 1" >>confdefs.h fi # Check if Xsetlocale() is available or not. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenOM in -lX11" >&5 $as_echo_n "checking for XOpenOM in -lX11... " >&6; } if ${ac_cv_lib_X11_XOpenOM+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $X_LIBS -lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenOM (); int main () { return XOpenOM (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_X11_XOpenOM=yes else ac_cv_lib_X11_XOpenOM=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenOM" >&5 $as_echo "$ac_cv_lib_X11_XOpenOM" >&6; } if test "x$ac_cv_lib_X11_XOpenOM" = xyes; then : $as_echo "#define HAVE_XOUTPUT_METHOD 1" >>confdefs.h fi # ******** iconv with_iconv=no with_iconv_type=no with_lib_iconv=no with_sys_iconv=no problem_iconv=": Explicitly disabled" # Check whether --enable-iconv was given. if test "${enable_iconv+set}" = set; then : enableval=$enable_iconv; ac_cv_iconv="$enableval" else ac_cv_iconv="yes" fi if test ! x"$ac_cv_iconv" = xno; then # * first check for gnu libiconv $UNSET ac_cv_header_libiconv_h $UNSET ac_cv_lib_libiconv_libiconv_open smr_lib=iconv smr_header=iconv.h smr_lib=iconv # Check whether --with-iconv-library was given. if test "${with_iconv_library+set}" = set; then : withval=$with_iconv_library; if test "$withval" = yes; then with_iconv=yes iconv_LIBS="-l${smr_lib}" elif test "$withval" = no; then with_iconv=no iconv_LIBS= else with_iconv=yes if test -f "$withval"; then iconv_LIBS=$withval elif test -d "$withval"; then iconv_LIBS="-L$withval -l${smr_lib}" else as_fn_error $? "--with-iconv-library argument must be yes/no, file or directory" "$LINENO" 5 fi fi else with_iconv=maybe iconv_LIBS="-l${smr_lib}" fi if test "$with_iconv" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5 $as_echo_n "checking for libiconv_open in -liconv... " >&6; } if ${ac_cv_lib_iconv_libiconv_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liconv ${iconv_LIBS} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char libiconv_open (); int main () { return libiconv_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_iconv_libiconv_open=yes else ac_cv_lib_iconv_libiconv_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5 $as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; } if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then : smr_havelib=yes else smr_havelib=no; problem_iconv=": Can't find working lib$smr_lib" fi if test "$smr_havelib" = yes -a "$smr_header" != ""; then # Check whether --with-iconv-includes was given. if test "${with_iconv_includes+set}" = set; then : withval=$with_iconv_includes; if test -d "$withval"; then iconv_CFLAGS="-I${withval}" else as_fn_error $? "argument must be a directory" "$LINENO" 5 fi fi smr_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS ${iconv_CFLAGS}" for ac_header in $smr_header do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS=$smr_save_CPPFLAGS smr_safe=`echo "$smr_header" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$ac_cv_header_'$smr_safe`\" != yes"; then smr_havelib=no problem_iconv=": Can't find working $smr_header" fi fi if test "$smr_havelib" = yes; then with_iconv=yes problem_iconv= else iconv_LIBS= iconv_CFLAGS= with_iconv=no fi else problem_iconv=": Explicitly disabled" fi if test ! x"$iconv_LIBS" = x; then $as_echo "#define USE_LIBICONV 1" >>confdefs.h with_lib_iconv=yes fi # * check for system iconv ac_fn_c_check_func "$LINENO" "iconv_open" "ac_cv_func_iconv_open" if test "x$ac_cv_func_iconv_open" = xyes; then : with_sys_iconv=yes fi if test x"$with_lib_iconv" = xyes && test x"$with_sys_iconv" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Both system iconv and libiconv found: use libiconv" >&5 $as_echo "$as_me: WARNING: *** Both system iconv and libiconv found: use libiconv" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Use --with-iconv-library=no to use the system iconv" >&5 $as_echo "$as_me: WARNING: *** Use --with-iconv-library=no to use the system iconv" >&2;} fi # * libiconv found check for libcharset to get the good iconv charset if test x"$with_lib_iconv" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking check for libcharset" >&5 $as_echo_n "checking check for libcharset... " >&6; } ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $iconv_CFLAGS" LIBS="$LIBS $iconv_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { const char *c; c = locale_charset (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : r=yes else r=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $r" >&5 $as_echo "$r" >&6; } if test "x$r" = "xyes"; then $as_echo "#define HAVE_LIBCHARSET 1" >>confdefs.h fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi test x"$with_lib_iconv" = xyes -o x"$with_sys_iconv" = xyes && with_iconv=yes && problem_iconv="" test x"$with_lib_iconv" = xyes && with_iconv_type="yes (libiconv)" test x"$with_sys_iconv" = xyes && with_iconv_type="yes (from C library)" if test x"$with_iconv" = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** " >&5 $as_echo "$as_me: WARNING: *** " >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** No iconv() implementation found in C library or libiconv" >&5 $as_echo "$as_me: WARNING: *** No iconv() implementation found in C library or libiconv" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Please install libiconv ftp://ftp.gnu.org/pub/gnu/libiconv/" >&5 $as_echo "$as_me: WARNING: *** Please install libiconv ftp://ftp.gnu.org/pub/gnu/libiconv/" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** " >&5 $as_echo "$as_me: WARNING: *** " >&2;} fi if test x"$with_iconv" = xyes; then $as_echo "#define HAVE_ICONV 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking check if second arg of iconv is const" >&5 $as_echo_n "checking check if second arg of iconv is const... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include extern #if defined(__STDC__) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : use_const=no else use_const=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_const" >&5 $as_echo "$use_const" >&6; } if test "x$use_const" = "xyes"; then $as_echo "#define ICONV_ARG_CONST const" >>confdefs.h else $as_echo "#define ICONV_ARG_CONST /**/" >>confdefs.h fi fi fi # ******** nl_langinfo and CODESET { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo (CODESET)" >&5 $as_echo_n "checking for nl_langinfo (CODESET)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { char *codeset = nl_langinfo(CODESET); setlocale(LC_CTYPE, ""); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_CODESET 1" >>confdefs.h have_codeset=yes else have_codeset=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_codeset" >&5 $as_echo "$have_codeset" >&6; } # ********* fribidi # Check whether --enable-bidi was given. if test "${enable_bidi+set}" = set; then : enableval=$enable_bidi; if test x"$enableval" = xyes; then with_bidi="yes, check" else with_bidi="no" problem_bidi=": Explicitly disabled" fi else with_bidi="not specified, check" fi fribidi_min_version=0.19.2 if test ! x"$with_bidi" = xno; then # Check whether --with-fribidi-bindir was given. if test "${with_fribidi_bindir+set}" = set; then : withval=$with_fribidi_bindir; FRIBIDI_BINDIR="$withval" else FRIBIDI_BINDIR="." fi if test ! x"$PKG_CONFIG" = xno && $PKG_CONFIG --exists "fribidi >= $fribidi_min_version"; then FRIBIDI_CONFIG="$PKG_CONFIG fribidi" else # Extract the first word of "fribidi-config", so it can be a program name with args. set dummy fribidi-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_FRIBIDI_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $FRIBIDI_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_FRIBIDI_CONFIG="$FRIBIDI_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$FRIBIDI_BINDIR:$PATH" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_FRIBIDI_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi FRIBIDI_CONFIG=$ac_cv_path_FRIBIDI_CONFIG if test -n "$FRIBIDI_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FRIBIDI_CONFIG" >&5 $as_echo "$FRIBIDI_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test x"$FRIBIDI_CONFIG" = x; then with_bidi=no problem_bidi=": pkgconfig fribidi: fribidi version >= $fribidi_min_version needed." else Bidi_CFLAGS=`$FRIBIDI_CONFIG --cflags` Bidi_LIBS=`$FRIBIDI_CONFIG --libs` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fribidi_log2vis in -lfribidi" >&5 $as_echo_n "checking for fribidi_log2vis in -lfribidi... " >&6; } if ${ac_cv_lib_fribidi_fribidi_log2vis+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfribidi $Bidi_LIBS $Bidi_CFLAGS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fribidi_log2vis (); int main () { return fribidi_log2vis (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fribidi_fribidi_log2vis=yes else ac_cv_lib_fribidi_fribidi_log2vis=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fribidi_fribidi_log2vis" >&5 $as_echo "$ac_cv_lib_fribidi_fribidi_log2vis" >&6; } if test "x$ac_cv_lib_fribidi_fribidi_log2vis" = xyes; then : with_bidi=yes; problem_bidi= else with_bidi=no; problem_bidi=": No good libs via $FRIBIDI_CONFIG" fi fi fi if test ! x"$with_bidi" = xno; then fribidi_in_path=yes ac_save_LIBS="$LIBS" LIBS="$LIBS $Bidi_LIBS" if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main() { FriBidiChar *logical_unicode_str = (FriBidiChar *)malloc((4 + 1) * sizeof(FriBidiChar)); fribidi_charset_to_unicode( fribidi_parse_charset("iso8859-8"), "test", 4, logical_unicode_str); return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : : else fribidi_in_path=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi LIBS="$ac_save_LIBS" if test ! x"$fribidi_in_path" = xyes; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $Bidi_CFLAGS" LIBS="$LIBS $Bidi_LIBS" if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main() { FriBidiChar *logical_unicode_str = (FriBidiChar *)malloc((4 + 1) * sizeof(FriBidiChar)); fribidi_charset_to_unicode( fribidi_parse_charset("iso8859-8"), "test", 4, logical_unicode_str); return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : : else with_bidi=no; problem_bidi=": Bad fribidi version, see config.log" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi if test ! x"$fribidi_in_path" = xno; then Bidi_CFLAGS= Bidi_LIBS=-lfribidi fi fi if test x"$with_bidi" = xno; then Bidi_CFLAGS= Bidi_LIBS= else $as_echo "#define HAVE_BIDI 1" >>confdefs.h if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main(int c, char **v) { return FRIBIDI_CHARSET_NOT_FOUND * 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : $as_echo "#define FRIBIDI_CHARSET_SPELLING 1" >>confdefs.h fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi # ********* perllib with_perllib="yes" problem_perllib="" FVWM_PERLLIB=perllib # Check whether --enable-perllib was given. if test "${enable_perllib+set}" = set; then : enableval=$enable_perllib; if test x"$enableval" = xno; then with_perllib="no" problem_perllib=": Explicitly disabled" FVWM_PERLLIB="" fi fi # ******* gettext ALL_LINGUAS="ar de fr sv_SE zh_CN" FVWM_DOMAIN="fvwm" FVWMTASKBAR_DOMAIN="FvwmTaskBar" FVWMSCRIPT_DOMAIN="FvwmScript" ALL_DOMAINS="$FVWM_DOMAIN $FVWMTASKBAR_DOMAIN $FVWMSCRIPT_DOMAIN" LOCALEDIR='${datadir}'"/locale" with_gettext="yes" problem_gettext="" # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then : enableval=$enable_nls; if test x"$enableval" = xno; then with_gettext="no" problem_gettext=": Explicitly disabled" fi fi if test ! x"$with_gettext" = xno; then MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 $as_echo "$MSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GMSGFMT+:} false; then : $as_echo_n "(cached) " >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 $as_echo "$GMSGFMT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_XGETTEXT+:} false; then : $as_echo_n "(cached) " >&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 $as_echo "$XGETTEXT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f messages.po # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGMERGE+:} false; then : $as_echo_n "(cached) " >&6 else case "$MSGMERGE" in /*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 $as_echo "$MSGMERGE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$GMSGFMT" != ":"; then if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 && (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5 $as_echo "found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; } GMSGFMT=":" fi fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 && (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then : ; else { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5 $as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; } XGETTEXT=":" fi rm -f messages.po fi # Extract the first word of "msguniq", so it can be a program name with args. set dummy msguniq; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_MSGUNIQ+:} false; then : $as_echo_n "(cached) " >&6 else case $MSGUNIQ in [\\/]* | ?:[\\/]*) ac_cv_path_MSGUNIQ="$MSGUNIQ" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSGUNIQ="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MSGUNIQ" && ac_cv_path_MSGUNIQ="$MSGUNIQ" ;; esac fi MSGUNIQ=$ac_cv_path_MSGUNIQ if test -n "$MSGUNIQ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGUNIQ" >&5 $as_echo "$MSGUNIQ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NLS fvwm messages catalogs" >&5 $as_echo_n "checking for NLS fvwm messages catalogs... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALL_LINGUAS" >&5 $as_echo "$ALL_LINGUAS" >&6; } POFILES= GMOFILES= UPDATEPOFILES= DUMMYPOFILES= for lang in $ALL_LINGUAS; do for dom in $ALL_DOMAINS; do POFILES="$POFILES $dom.$lang.po" GMOFILES="$GMOFILES $dom.$lang.gmo" UPDATEPOFILES="$UPDATEPOFILES $dom.$lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $dom.$lang.nop" done done # CATALOGS depends on both $ac_dir and the user's LINGUAS environment variable. INST_LINGUAS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NLS desired catalogs to be installed" >&5 $as_echo_n "checking for NLS desired catalogs to be installed... " >&6; } #if test "%UNSET%" != "$LINGUAS"; then # FIXME: How to check if LINGUAS has been *set* to "" if test -n "$LINGUAS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5 $as_echo "$LINGUAS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: all" >&5 $as_echo "all" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NLS messages catalogs to be installed" >&5 $as_echo_n "checking for NLS messages catalogs to be installed... " >&6; } if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no #if test "%UNSET%" != "$LINGUAS"; then if test -n "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INST_LINGUAS" >&5 $as_echo "$INST_LINGUAS" >&6; } CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi intl_LIBS= intl_CFLAGS= POSUB= found_gettext=yes $UNSET ac_cv_header_intl_h $UNSET ac_cv_func_gettext $UNSET ac_cv_func_bindtextdomain $UNSET ac_cv_func_textdomain $UNSET ac_cv_func_dgettext #bind_textdomain_codeset ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" if test "x$ac_cv_header_libintl_h" = xyes; then : for ac_func in gettext bindtextdomain textdomain dgettext do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else found_gettext=no fi done else found_gettext=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnu gettext in libc" >&5 $as_echo_n "checking for gnu gettext in libc... " >&6; } if test x"$found_gettext" = "xyes"; then problem_gettext=" (libc)" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if a simple gettext program link" >&5 $as_echo_n "checking if a simple gettext program link... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { const char *c; c = gettext("foo"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : found_gettext=yes;problem_gettext=" (libc)" else found_gettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_gettext" >&5 $as_echo "$found_gettext" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$found_gettext" = xno; then $UNSET ac_cv_header_intl_h $UNSET ac_cv_lib_intl_bindtextdomain $UNSET ac_cv_lib_intl_textdomain $UNSET ac_cv_lib_intl_dgettext smr_lib=intl smr_header=libintl.h smr_lib=intl # Check whether --with-intl-library was given. if test "${with_intl_library+set}" = set; then : withval=$with_intl_library; if test "$withval" = yes; then with_intl=yes intl_LIBS="-l${smr_lib}" elif test "$withval" = no; then with_intl=no intl_LIBS= else with_intl=yes if test -f "$withval"; then intl_LIBS=$withval elif test -d "$withval"; then intl_LIBS="-L$withval -l${smr_lib}" else as_fn_error $? "--with-intl-library argument must be yes/no, file or directory" "$LINENO" 5 fi fi else with_intl=maybe intl_LIBS="-l${smr_lib}" fi if test "$with_intl" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindtextdomain in -lintl" >&5 $as_echo_n "checking for bindtextdomain in -lintl... " >&6; } if ${ac_cv_lib_intl_bindtextdomain+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl ${intl_LIBS} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char bindtextdomain (); int main () { return bindtextdomain (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_bindtextdomain=yes else ac_cv_lib_intl_bindtextdomain=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_bindtextdomain" >&5 $as_echo "$ac_cv_lib_intl_bindtextdomain" >&6; } if test "x$ac_cv_lib_intl_bindtextdomain" = xyes; then : smr_havelib=yes else smr_havelib=no; problem_intl=": Can't find working lib$smr_lib" fi if test "$smr_havelib" = yes -a "$smr_header" != ""; then # Check whether --with-intl-includes was given. if test "${with_intl_includes+set}" = set; then : withval=$with_intl_includes; if test -d "$withval"; then intl_CFLAGS="-I${withval}" else as_fn_error $? "argument must be a directory" "$LINENO" 5 fi fi smr_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS ${intl_CFLAGS}" for ac_header in $smr_header do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS=$smr_save_CPPFLAGS smr_safe=`echo "$smr_header" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$ac_cv_header_'$smr_safe`\" != yes"; then smr_havelib=no problem_intl=": Can't find working $smr_header" fi fi if test "$smr_havelib" = yes; then with_intl=yes problem_intl= else intl_LIBS= intl_CFLAGS= with_intl=no fi else problem_intl=": Explicitly disabled" fi if test x"$intl_LIBS" != x; then no_textdomain=no no_dgettext=no ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for textdomain in -lintl" >&5 $as_echo_n "checking for textdomain in -lintl... " >&6; } if ${ac_cv_lib_intl_textdomain+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $intl_LIBS $iconv_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char textdomain (); int main () { return textdomain (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_textdomain=yes else ac_cv_lib_intl_textdomain=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_textdomain" >&5 $as_echo "$ac_cv_lib_intl_textdomain" >&6; } if test "x$ac_cv_lib_intl_textdomain" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBINTL 1 _ACEOF LIBS="-lintl $LIBS" else no_textdomain=yes fi if test "$no_textdomain" != "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dgettext in -lintl" >&5 $as_echo_n "checking for dgettext in -lintl... " >&6; } if ${ac_cv_lib_intl_dgettext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $intl_LIBS $iconv_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dgettext (); int main () { return dgettext (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_dgettext=yes else ac_cv_lib_intl_dgettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_dgettext" >&5 $as_echo "$ac_cv_lib_intl_dgettext" >&6; } if test "x$ac_cv_lib_intl_dgettext" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBINTL 1 _ACEOF LIBS="-lintl $LIBS" else no_dgettext=yes fi if test "$no_dgettext" != "yes"; then CFLAGS="$CFLAGS $intl_LIBS $iconv_LIBS" LIBS="$LIBS $intl_LIBS $iconv_LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if a simple gettext program link" >&5 $as_echo_n "checking if a simple gettext program link... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { const char *c; c = gettext("foo"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : found_gettext=yes;problem_gettext=" (intl library)" else found_gettext=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $found_gettext" >&5 $as_echo "$found_gettext" >&6; } fi fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "$found_gettext" = "yes"; then CATOBJEXT=.gmo USE_NLS=yes POSUB=po else USE_NLS=no fi if test x"$USE_NLS" = "xyes"; then $as_echo "#define HAVE_NLS 1" >>confdefs.h else with_gettext="no" problem_gettext=": Failed to detected GNU gettext" fi else USE_NLS=no fi # libs and buil # programs for devel #catalogs # Check for REQUIRED headers and functions before going any # further. # The module interface uses variadic functions for message passing. for ac_header in stdarg.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" if test "x$ac_cv_header_stdarg_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDARG_H 1 _ACEOF fi done for ac_func in vfprintf do : ac_fn_c_check_func "$LINENO" "vfprintf" "ac_cv_func_vfprintf" if test "x$ac_cv_func_vfprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFPRINTF 1 _ACEOF fi done if test x$ac_cv_header_stdarg_h = xno -o \ $ac_cv_func_vfprintf = no; then as_fn_error $? "stdarg.h and vfprintf required" "$LINENO" 5 fi # For reaping children, fvwm needs either waitpid() or wait3() # Some extra modules may need wait4() too for ac_func in waitpid do : ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid" if test "x$ac_cv_func_waitpid" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WAITPID 1 _ACEOF fi done if test x$ac_cv_func_waitpid = xno; then for ac_func in wait3 wait4 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test x$ac_cv_func_wait3 = xno; then as_fn_error $? "Either waitpid or wait3 function is required" "$LINENO" 5 fi fi # C89/C99 signal handling for ac_func in sigsetjmp siglongjmp do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Look harder for a C preprocessor for FvwmCpp # Extract the first word of "cpp", so it can be a program name with args. set dummy cpp; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_FVWM_CPP+:} false; then : $as_echo_n "(cached) " >&6 else case $FVWM_CPP in [\\/]* | ?:[\\/]*) ac_cv_path_FVWM_CPP="$FVWM_CPP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/lib:/usr/lib:/usr/ccs/lib" for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_FVWM_CPP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_FVWM_CPP" && ac_cv_path_FVWM_CPP="no" ;; esac fi FVWM_CPP=$ac_cv_path_FVWM_CPP if test -n "$FVWM_CPP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FVWM_CPP" >&5 $as_echo "$FVWM_CPP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$FVWM_CPP" = xno; then FVWM_CPP= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot locate a C preprocessor: run FvwmCpp with -cppprog" >&5 $as_echo "$as_me: WARNING: cannot locate a C preprocessor: run FvwmCpp with -cppprog" >&2;} fi # Finish checking for programs. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # Checks for header files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi for ac_header in stdlib.h fcntl.h limits.h malloc.h string.h memory.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in getopt.h sys/select.h sys/systeminfo.h sys/time.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF # Checks for library functions. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if ${ac_cv_working_alloca_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_working_alloca_h=yes else ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if ${ac_cv_func_alloca_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ void *alloca (size_t); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_alloca_works=yes else ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=\${LIBOBJDIR}alloca.$ac_objext $as_echo "#define C_ALLOCA 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if ${ac_cv_os_cray+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined CRAY && ! defined CRAY2 webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "webecray" >/dev/null 2>&1; then : ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_c_stack_direction=0 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { return find_stack_direction () < 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_stack_direction=1 else ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_func in strftime do : ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" if test "x$ac_cv_func_strftime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRFTIME 1 _ACEOF else # strftime is in -lintl on SCO UNIX. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 $as_echo_n "checking for strftime in -lintl... " >&6; } if ${ac_cv_lib_intl_strftime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strftime (); int main () { return strftime (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_intl_strftime=yes else ac_cv_lib_intl_strftime=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 $as_echo "$ac_cv_lib_intl_strftime" >&6; } if test "x$ac_cv_lib_intl_strftime" = xyes; then : $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h LIBS="-lintl $LIBS" fi fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 $as_echo_n "checking whether setpgrp takes no argument... " >&6; } if ${ac_cv_func_setpgrp_void+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : as_fn_error $? "cannot check setpgrp when cross compiling" "$LINENO" 5 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* If this system has a BSD-style setpgrp which takes arguments, setpgrp(1, 1) will fail with ESRCH and return -1, in that case exit successfully. */ return setpgrp (1,1) != -1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_setpgrp_void=no else ac_cv_func_setpgrp_void=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 $as_echo "$ac_cv_func_setpgrp_void" >&6; } if test $ac_cv_func_setpgrp_void = yes; then $as_echo "#define SETPGRP_VOID 1" >>confdefs.h fi for ac_func in gettimeofday mkfifo putenv setvbuf socket waitpid do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in strdup strstr strtol memmove memcpy strchr sysconf uname div do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in sigaction siginterrupt getpwuid do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in setpgrp setpgid do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in lstat do : ac_fn_c_check_func "$LINENO" "lstat" "ac_cv_func_lstat" if test "x$ac_cv_func_lstat" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LSTAT 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sig_atomic_t" >&5 $as_echo_n "checking for sig_atomic_t... " >&6; } if ${ac_cv_type_sig_atomic_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if STDC_HEADERS #include #include #endif #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "(^|[^a-zA-Z_0-9])sig_atomic_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then : ac_cv_type_sig_atomic_t=yes else ac_cv_type_$1=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_sig_atomic_t" >&5 $as_echo "$ac_cv_type_sig_atomic_t" >&6; } if test $ac_cv_type_sig_atomic_t = no; then cat >>confdefs.h <<_ACEOF #define sig_atomic_t int _ACEOF fi if test x$ac_cv_func_setvbuf = xyes; then if ${ac_cv_func_setvbuf_reversed+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_func_setvbuf_reversed=no fi fi for ac_func in select do : ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" if test "x$ac_cv_func_select" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SELECT 1 _ACEOF fi done if test "$ac_cv_func_select" = yes; then for ac_header in unistd.h sys/types.h sys/time.h sys/select.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking argument types of select()" >&5 $as_echo_n "checking argument types of select()... " >&6; } if ${ac_cv_type_fd_set_size_t+:} false; then : $as_echo_n "(cached) " >&6 else if ${ac_cv_type_fd_set+:} false; then : $as_echo_n "(cached) " >&6 else for ac_cv_type_fd_set in 'fd_set' 'int' 'void'; do for ac_cv_type_fd_set_size_t in 'int' 'size_t' 'unsigned long' 'unsigned'; do for ac_type_timeval in 'struct timeval' 'const struct timeval'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif int main () { extern select ($ac_cv_type_fd_set_size_t, $ac_cv_type_fd_set *, $ac_cv_type_fd_set *, $ac_cv_type_fd_set *, $ac_type_timeval *); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_found=yes ; break 3 else ac_found=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done done fi fi if test "$ac_found" = no; then as_fn_error $? "can not determine argument types" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: select($ac_cv_type_fd_set_size_t,$ac_cv_type_fd_set *,...)" >&5 $as_echo "select($ac_cv_type_fd_set_size_t,$ac_cv_type_fd_set *,...)" >&6; } cat >>confdefs.h <<_ACEOF #define fd_set_size_t $ac_cv_type_fd_set_size_t _ACEOF ac_cast= if test "$ac_cv_type_fd_set" != fd_set; then # Arguments 2-4 are not fd_set. Some weirdo systems use fd_set type for # FD_SET macros, but insist that you cast the argument to select. I don't # understand why that might be, but it means we cannot define fd_set. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "(^|[^a-zA-Z_0-9])fd_set[^a-zA-Z_0-9]" >/dev/null 2>&1; then : # We found fd_set type in a header, need special cast ac_cast="($ac_cv_type_fd_set *)" else # No fd_set type; it is safe to define it cat >>confdefs.h <<_ACEOF #define fd_set $ac_cv_type_fd_set _ACEOF fi rm -f conftest* fi cat >>confdefs.h <<_ACEOF #define SELECT_FD_SET_CAST $ac_cast _ACEOF fi if test ! x"$ac_cv_func_select" = xyes; then as_fn_error $? "select required" "$LINENO" 5 fi # Check for standard functions that we have replacements for. ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname" if test "x$ac_cv_func_gethostname" = xyes; then : $as_echo "#define HAVE_GETHOSTNAME 1" >>confdefs.h else case " $LIBOBJS " in *" gethostname.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS gethostname.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" if test "x$ac_cv_func_strcasecmp" = xyes; then : $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h else case " $LIBOBJS " in *" strcasecmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strcasecmp.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" if test "x$ac_cv_func_strncasecmp" = xyes; then : $as_echo "#define HAVE_STRNCASECMP 1" >>confdefs.h else case " $LIBOBJS " in *" strncasecmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strncasecmp.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = xyes; then : $as_echo "#define HAVE_STRDUP 1" >>confdefs.h else case " $LIBOBJS " in *" strdup.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strdup.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes; then : $as_echo "#define HAVE_STRERROR 1" >>confdefs.h else case " $LIBOBJS " in *" strerror.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strerror.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" if test "x$ac_cv_func_usleep" = xyes; then : $as_echo "#define HAVE_USLEEP 1" >>confdefs.h else case " $LIBOBJS " in *" usleep.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS usleep.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit" if test "x$ac_cv_func_atexit" = xyes; then : $as_echo "#define HAVE_ATEXIT 1" >>confdefs.h else case " $LIBOBJS " in *" atexit.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS atexit.$ac_objext" ;; esac fi # check for mkstemp, see the discution on this subject on the fvwm workers # list (2001-02-16 and 2001-02-24) for ac_func in mkstemp do : ac_fn_c_check_func "$LINENO" "mkstemp" "ac_cv_func_mkstemp" if test "x$ac_cv_func_mkstemp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MKSTEMP 1 _ACEOF fi done has_safety_mkstemp=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking if mkstemp is safe" >&5 $as_echo_n "checking if mkstemp is safe... " >&6; } if test x$ac_cv_func_mkstemp != xno; then if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main(void) { char template[128]; char template_orig[128]; int fd; sprintf(template, "configure-mkstemp-test.XXXXXX"); strcpy(template_orig, template); fd = mkstemp(template); if (fd == -1) { /* could not create temp file */ return 1; } if (strcmp(template, template_orig) == 0) { /* mkstemp broken */ return 2; } if (close(fd) != 0) { /* doh! */ return 3; } if (unlink(template)) { return 4; } /* mkstemp works properly */ return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : has_safety_mkstemp=yes else has_safety_mkstemp=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi if test x$has_safety_mkstemp = xno; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_SAFETY_MKSTEMP 1" >>confdefs.h fi # If we do not have atexit(), then check for on_exit() if test x$ac_cv_func_atexit = xno; then for ac_func in on_exit do : ac_fn_c_check_func "$LINENO" "on_exit" "ac_cv_func_on_exit" if test "x$ac_cv_func_on_exit" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ON_EXIT 1 _ACEOF fi done fi # Check for unsetenv function for ac_func in unsetenv do : ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv" if test "x$ac_cv_func_unsetenv" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNSETENV 1 _ACEOF fi done # ********* GTK, IMLIB, GNOME # Check the availability of gtk FVWMGTK="" MANFVWMGTK="" # Check whether --enable-gtk was given. if test "${enable_gtk+set}" = set; then : enableval=$enable_gtk; enable_gtktest="$enableval" else enable_gtktest=yes fi if test x"$enable_gtktest" = xyes; then # Check whether --with-gtk-prefix was given. if test "${with_gtk_prefix+set}" = set; then : withval=$with_gtk_prefix; gtk_config_prefix="$withval" else gtk_config_prefix="" fi # Check whether --with-gtk-exec-prefix was given. if test "${with_gtk_exec_prefix+set}" = set; then : withval=$with_gtk_exec_prefix; gtk_config_exec_prefix="$withval" else gtk_config_exec_prefix="" fi # Check whether --enable-gtktest was given. if test "${enable_gtktest+set}" = set; then : enableval=$enable_gtktest; else enable_gtktest=yes fi if test x$gtk_config_exec_prefix != x ; then gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config fi fi if test x$gtk_config_prefix != x ; then gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" if test x${GTK_CONFIG+set} != xset ; then GTK_CONFIG=$gtk_config_prefix/bin/gtk-config fi fi # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GTK_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $GTK_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GTK_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no" ;; esac fi GTK_CONFIG=$ac_cv_path_GTK_CONFIG if test -n "$GTK_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_CONFIG" >&5 $as_echo "$GTK_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi min_gtk_version=1.1.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5 $as_echo_n "checking for GTK - version >= $min_gtk_version... " >&6; } no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes else GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\1/'` gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\2/'` gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\3/'` if test "x$enable_gtktest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" rm -f conf.gtktest if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.gtktest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_gtk_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_gtk_version"); exit(1); } if ((gtk_major_version != $gtk_config_major_version) || (gtk_minor_version != $gtk_config_minor_version) || (gtk_micro_version != $gtk_config_micro_version)) { printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, gtk_major_version, gtk_minor_version, gtk_micro_version); printf ("*** was found! If gtk-config was correct, then it is best\n"); printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } #if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) else if ((gtk_major_version != GTK_MAJOR_VERSION) || (gtk_minor_version != GTK_MINOR_VERSION) || (gtk_micro_version != GTK_MICRO_VERSION)) { printf("*** GTK+ header files (version %d.%d.%d) do not match\n", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", gtk_major_version, gtk_minor_version, gtk_micro_version); } #endif /* defined (GTK_MAJOR_VERSION) ... */ else { if ((gtk_major_version > major) || ((gtk_major_version == major) && (gtk_minor_version > minor)) || ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", gtk_major_version, gtk_minor_version, gtk_micro_version); printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); printf("*** correct copy of gtk-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_gtk=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_gtk" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } FVWMGTK="FvwmGtk$EXEEXT" MANFVWMGTK=FvwmGtk.1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$GTK_CONFIG" = "no" ; then echo "*** The gtk-config script installed by GTK could not be found" echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GTK_CONFIG environment variable to the" echo "*** full path to gtk-config." else if test -f conf.gtktest ; then : else echo "*** Could not run GTK test program, checking why..." CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" echo "*** version of GTK. If it is not finding GTK, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" echo "*** came with the system with the command" echo "***" echo "*** rpm --erase --nodeps gtk gtk-devel" else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GTK was incorrectly installed" echo "*** or that you have moved GTK since it was installed. In the latter case, you" echo "*** may want to edit the gtk-config script: $GTK_CONFIG" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GTK_CFLAGS="" GTK_LIBS="" : fi rm -f conf.gtktest if test x"$no_gtk" = x; then with_gtk=yes problem_gtk="" else with_gtk=no problem_gtk=": Failed to detect GTK, see config.log" fi else with_gtk=no problem_gtk=": Explicitly disabled" fi # Check the availability of gdk-imlib # Check whether --with-imlib-prefix was given. if test "${with_imlib_prefix+set}" = set; then : withval=$with_imlib_prefix; imlib_prefix="$withval" else imlib_prefix="" fi # Check whether --with-imlib-exec-prefix was given. if test "${with_imlib_exec_prefix+set}" = set; then : withval=$with_imlib_exec_prefix; imlib_exec_prefix="$withval" else imlib_exec_prefix="" fi # Check whether --enable-imlibtest was given. if test "${enable_imlibtest+set}" = set; then : enableval=$enable_imlibtest; else enable_imlibtest=yes fi if test x$imlib_exec_prefix != x ; then imlib_args="$imlib_args --exec-prefix=$imlib_exec_prefix" if test x${IMLIBCONF+set} != xset ; then IMLIBCONF=$imlib_exec_prefix/bin/imlib-config fi fi if test x$imlib_prefix != x ; then imlib_args="$imlib_args --prefix=$imlib_prefix" if test x${IMLIBCONF+set} != xset ; then IMLIBCONF=$imlib_prefix/bin/imlib-config fi fi # Extract the first word of "imlib-config", so it can be a program name with args. set dummy imlib-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_IMLIBCONF+:} false; then : $as_echo_n "(cached) " >&6 else case $IMLIBCONF in [\\/]* | ?:[\\/]*) ac_cv_path_IMLIBCONF="$IMLIBCONF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_IMLIBCONF="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_IMLIBCONF" && ac_cv_path_IMLIBCONF="no" ;; esac fi IMLIBCONF=$ac_cv_path_IMLIBCONF if test -n "$IMLIBCONF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IMLIBCONF" >&5 $as_echo "$IMLIBCONF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi min_imlib_version=1.8.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GDK IMLIB - version >= $min_imlib_version" >&5 $as_echo_n "checking for GDK IMLIB - version >= $min_imlib_version... " >&6; } no_imlib="" if test "$IMLIBCONF" = "no" ; then no_imlib=yes else GDK_IMLIB_CFLAGS=`$IMLIBCONF $imlibconf_args --cflags-gdk` GDK_IMLIB_LIBS=`$IMLIBCONF $imlibconf_args --libs-gdk` imlib_major_version=`$IMLIBCONF $imlib_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\1/'` imlib_minor_version=`$IMLIBCONF $imlib_args --version | \ sed 's/^[^0-9.]*\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*$/\2/'` if test "x$enable_imlibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS" LIBS="$LIBS $GDK_IMLIB_LIBS" rm -f conf.imlibtest if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include /* migo: originally it was GdkImLibColor with incorrect spelling */ GdkImlibImage testimage; int main () { int major, minor; char *tmp_version; system ("touch conf.gdkimlibtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_imlib_version"); if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) { printf("%s, bad version string\n", "$min_imlib_version"); exit(1); } if (($imlib_major_version > major) || (($imlib_major_version == major) && ($imlib_minor_version > minor))) { return 0; } else { printf("\n*** 'imlib-config --version' returned %d.%d, but the minimum version\n", $imlib_major_version, $imlib_minor_version); printf("*** of IMLIB required is %d.%d. If imlib-config is correct, then it is\n", major, minor); printf("*** best to upgrade to the required version.\n"); printf("*** If imlib-config was wrong, set the environment variable IMLIBCONF\n"); printf("*** to point to the correct copy of imlib-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_imlib=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_imlib" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define GDK_IMLIB 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$IMLIBCONF" = "no" ; then (echo "*** The imlib-config script installed by IMLIB could not be found" >&5) 2>/dev/null || \ echo "*** The imlib-config script installed by IMLIB could not be found" (echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in" >&5) 2>/dev/null || \ echo "*** If IMLIB was installed in PREFIX, make sure PREFIX/bin is in" (echo "*** your path, or set the IMLIBCONF environment variable to the" >&5) 2>/dev/null || \ echo "*** your path, or set the IMLIBCONF environment variable to the" (echo "*** full path to imlib-config." >&5) 2>/dev/null || \ echo "*** full path to imlib-config." else if test -f conf.gdkimlibtest ; then : else (echo "*** Could not run IMLIB test program, checking why..." >&5) 2>/dev/null || \ echo "*** Could not run IMLIB test program, checking why..." CFLAGS="$CFLAGS $GDK_IMLIB_CFLAGS" LIBS="$LIBS $GDK_IMLIB_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : (echo "*** The test program compiled, but did not run. This usually means" >&5) 2>/dev/null || \ echo "*** The test program compiled, but did not run. This usually means" (echo "*** that the run-time linker is not finding IMLIB or finding the wrong" >&5) 2>/dev/null || \ echo "*** that the run-time linker is not finding IMLIB or finding the wrong" (echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your" >&5) 2>/dev/null || \ echo "*** version of IMLIB. If it is not finding IMLIB, you'll need to set your" (echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" >&5) 2>/dev/null || \ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" (echo "*** to the installed location Also, make sure you have run ldconfig if that" >&5) 2>/dev/null || \ echo "*** to the installed location Also, make sure you have run ldconfig if that" (echo "*** is required on your system" >&5) 2>/dev/null || \ echo "*** is required on your system" (echo "***" >&5) 2>/dev/null || \ echo "***" (echo "*** If you have an old version installed, it is best to remove it, although" >&5) 2>/dev/null || \ echo "*** If you have an old version installed, it is best to remove it, although" (echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" >&5) 2>/dev/null || \ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else (echo "*** The test program failed to compile or link. See the file config.log for the" >&5) 2>/dev/null || \ echo "*** The test program failed to compile or link. See the file config.log for the" (echo "*** exact error that occured. This usually means IMLIB was incorrectly installed" >&5) 2>/dev/null || \ echo "*** exact error that occured. This usually means IMLIB was incorrectly installed" (echo "*** or that you have moved IMLIB since it was installed. In the latter case, you" >&5) 2>/dev/null || \ echo "*** or that you have moved IMLIB since it was installed. In the latter case, you" (echo "*** may want to edit the imlib-config script: $IMLIBCONF" >&5) 2>/dev/null || \ echo "*** may want to edit the imlib-config script: $IMLIBCONF" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GDK_IMLIB_CFLAGS="" GDK_IMLIB_LIBS="" : fi rm -f conf.gdkimlibtest if test x"$no_imlib" = x; then with_gdkimlib=yes problem_gdkimlib="" else with_gdkimlib=no problem_gdkimlib=": Failed on gdk-imlib, see config.log" fi # Check whether --with-gnome-includes was given. if test "${with_gnome_includes+set}" = set; then : withval=$with_gnome_includes; CFLAGS="$CFLAGS -I$withval" fi gnome_prefix=$ac_default_prefix/lib # Check whether --with-gnome-libs was given. if test "${with_gnome_libs+set}" = set; then : withval=$with_gnome_libs; LDFLAGS="$LDFLAGS -L$withval" gnome_prefix=$withval fi # Check whether --with-gnome was given. if test "${with_gnome+set}" = set; then : withval=$with_gnome; if test x$withval = xyes; then with_gnomelibs=yes : else if test "x$withval" = xno; then with_gnomelibs=no problem_gnomelibs=": Explicitly disabled" else with_gnomelibs=yes LDFLAGS="$LDFLAGS -L$withval/lib" CFLAGS="$CFLAGS -I$withval/include" gnome_prefix=$withval/lib fi fi else with_gnomelibs=yes fi if test "x$with_gnomelibs" = xyes; then problem_gnomelibs=": Can't find working gnome-config" # Extract the first word of "gnome-config", so it can be a program name with args. set dummy gnome-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GNOME_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $GNOME_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_GNOME_CONFIG="$GNOME_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GNOME_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GNOME_CONFIG" && ac_cv_path_GNOME_CONFIG="no" ;; esac fi GNOME_CONFIG=$ac_cv_path_GNOME_CONFIG if test -n "$GNOME_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNOME_CONFIG" >&5 $as_echo "$GNOME_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$GNOME_CONFIG" = "no"; then no_gnome_config="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $GNOME_CONFIG works" >&5 $as_echo_n "checking whether $GNOME_CONFIG works... " >&6; } if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`" GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`" GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`" GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } no_gnome_config="yes" fi fi # migo: disable this destructive logic # if test x$exec_prefix = xNONE; then # if test x$prefix = xNONE; then # gnome_prefix=$ac_default_prefix/lib # else # gnome_prefix=$prefix/lib # fi # else # gnome_prefix=`eval echo \`echo $libdir\`` # fi if test "$no_gnome_config" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnomeConf.sh file in $gnome_prefix" >&5 $as_echo_n "checking for gnomeConf.sh file in $gnome_prefix... " >&6; } if test -f $gnome_prefix/gnomeConf.sh; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 $as_echo "found" >&6; } echo "loading gnome configuration from" \ "$gnome_prefix/gnomeConf.sh" . $gnome_prefix/gnomeConf.sh else { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } if test x = xfail; then as_fn_error $? "Could not find the gnomeConf.sh file that is generated by gnome-libs install" "$LINENO" 5 fi with_gnomelibs=no fi fi fi # test whether gnome can be compiled if test "x$with_gnomelibs" = xyes; then problem_gnomelibs=": Can't compile trivial gnome app" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether trivial gnome compilation works" >&5 $as_echo_n "checking whether trivial gnome compilation works... " >&6; } my_CPPFLAGS="$CPPFLAGS" my_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $GNOME_INCLUDEDIR $GTK_CFLAGS" LIBS="$LIBS $GNOME_LIBDIR $GNOMEUI_LIBS" if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main(int c, char **v) { /* we can not really run this outside of X */ if (!c) gnome_init("test-app", "0.0", c, v); return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : with_gnomelibs=yes else with_gnomelibs=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gnomelibs" >&5 $as_echo "$with_gnomelibs" >&6; } CPPFLAGS="$my_CPPFLAGS" LIBS="$my_LIBS" else # just for safety with_gnomelibs=no fi if test "x$with_gnomelibs" = xyes; then problem_gnomelibs="" else GNOME_LIBS= GNOMEUI_LIBS= GNOME_LIBDIR= GNOME_INCLUDEDIR= fi # Unfortunately we have 2 gnome supports: WM hints and gnome libs. # The $with_gnomehints below refers to the first, not GNOME_INIT_HOOK. if test ! x"$enable_gnome_hints" = xno; then with_gnomehints=yes problem_gnomehints="" else with_gnomehints=no problem_gnomehints=": Explicitly disabled" fi # Define some compatibility macros needed for config.h. mg_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main(int c, char **v) { #include #if defined XK_Page_Up && defined XK_Page_Down return 0; #else return 1; #endif } _ACEOF if ac_fn_c_try_run "$LINENO"; then : : else $as_echo "#define COMPAT_OLD_KEYSYMDEF 1" >>confdefs.h fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CPPFLAGS="$mg_save_CPPFLAGS" if test x"$with_stroke" = xyes; then mg_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $stroke_CFLAGS" if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main(int c, char **v) { #include #if defined STROKE_MAX_SEQUENCE return 0; #else return 1; #endif } _ACEOF if ac_fn_c_try_run "$LINENO"; then : : else $as_echo "#define COMPAT_OLD_LIBSTROKE 1" >>confdefs.h fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CPPFLAGS="$mg_save_CPPFLAGS" fi # Allow building with dmalloc. Do this last to avoid screwing up any # other checks above. case "$ac_cv_dmalloc" in yes) for ac_header in dmalloc.h do : ac_fn_c_check_header_mongrel "$LINENO" "dmalloc.h" "ac_cv_header_dmalloc_h" "$ac_includes_default" if test "x$ac_cv_header_dmalloc_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DMALLOC_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dmalloc_shutdown in -ldmalloc" >&5 $as_echo_n "checking for dmalloc_shutdown in -ldmalloc... " >&6; } if ${ac_cv_lib_dmalloc_dmalloc_shutdown+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dmalloc_shutdown (); int main () { return dmalloc_shutdown (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dmalloc_dmalloc_shutdown=yes else ac_cv_lib_dmalloc_dmalloc_shutdown=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dmalloc_dmalloc_shutdown" >&5 $as_echo "$ac_cv_lib_dmalloc_dmalloc_shutdown" >&6; } if test "x$ac_cv_lib_dmalloc_dmalloc_shutdown" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBDMALLOC 1 _ACEOF LIBS="-ldmalloc $LIBS" fi CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" ;; esac # Allow building with efence. case "$ac_cv_efence" in yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -lefence" >&5 $as_echo_n "checking for malloc in -lefence... " >&6; } if ${ac_cv_lib_efence_malloc+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lefence $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char malloc (); int main () { return malloc (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_efence_malloc=yes else ac_cv_lib_efence_malloc=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_efence_malloc" >&5 $as_echo "$ac_cv_lib_efence_malloc" >&6; } if test "x$ac_cv_lib_efence_malloc" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBEFENCE 1 _ACEOF LIBS="-lefence $LIBS" fi ;; esac # some explicit definitions for config.h file # mainly for fvwm-config LOCAL_BUGADDR=${FVWM_BUGADDR-${USER-${LOGNAME-`whoami`}}} ac_config_files="$ac_config_files Makefile libs/Makefile fvwm/Makefile modules/Makefile bin/fvwm-bug.1 bin/fvwm-config.1 bin/fvwm-convert-2.2.1 bin/fvwm-convert-2.4.1 bin/fvwm-convert-2.6.1 bin/fvwm-menu-desktop.1 bin/fvwm-root.1 modules/FvwmAnimate/FvwmAnimate.1 modules/FvwmAuto/FvwmAuto.1 modules/FvwmBacker/FvwmBacker.1 modules/FvwmBanner/FvwmBanner.1 modules/FvwmButtons/FvwmButtons.1 modules/FvwmCommand/FvwmCommand.1 modules/FvwmConsole/FvwmConsole.1 modules/FvwmConsole/FvwmConsoleC.pl.1 modules/FvwmCpp/FvwmCpp.1 modules/FvwmDragWell/FvwmDragWell.1 modules/FvwmEvent/FvwmEvent.1 modules/FvwmForm/FvwmForm.1 modules/FvwmGtk/FvwmGtk.1 modules/FvwmIconBox/FvwmIconBox.1 modules/FvwmIconMan/FvwmIconMan.1 modules/FvwmIdent/FvwmIdent.1 modules/FvwmM4/FvwmM4.1 modules/FvwmPager/FvwmPager.1 modules/FvwmProxy/FvwmProxy.1 modules/FvwmRearrange/FvwmRearrange.1 modules/FvwmSave/FvwmSave.1 modules/FvwmSaveDesk/FvwmSaveDesk.1 modules/FvwmScript/FvwmScript.1 modules/FvwmScroll/FvwmScroll.1 modules/FvwmTaskBar/FvwmTaskBar.1 modules/FvwmTheme/FvwmTheme.1 modules/FvwmWharf/FvwmWharf.1 modules/FvwmWinList/FvwmWinList.1 bin/Makefile bin/fvwm-config bin/fvwm-bug bin/fvwm-perllib bin/fvwm-menu-xlock bin/fvwm-menu-directory bin/fvwm-menu-desktop bin/fvwm-menu-headlines bin/fvwm-convert-2.4 bin/fvwm-convert-2.6 utils/Makefile perllib/Makefile perllib/General/Makefile perllib/FVWM/Makefile perllib/FVWM/Module/Makefile perllib/FVWM/Tracker/Makefile perllib/FVWM/Module.pm rpm/Makefile rpm/fvwm.spec debian/Makefile debian/control doc/fvwm.ent doc/footer.html doc/Makefile doc/fvwm/Makefile doc/commands/Makefile doc/docbook-xml/Makefile doc/docbook-xml/ent/Makefile doc/docbook-xsl/Makefile doc/docbook-xsl/common/Makefile doc/docbook-xsl/manpages/Makefile doc/docbook-xsl/profiling/Makefile doc/docbook-xsl/highlighting/Makefile doc/docbook-xsl/lib/Makefile doc/docbook-xsl/html/Makefile doc/modules/Makefile doc/modules/images/Makefile doc/modules/images/FvwmTabs/Makefile doc/images/Makefile doc/images/svg_rendering/Makefile docs/fvwm.lsm docs/Makefile sample.fvwmrc/Makefile tests/Makefile tests/hints/Makefile po/Makefile modules/FvwmAnimate/Makefile modules/FvwmAuto/Makefile modules/FvwmBacker/Makefile modules/FvwmBanner/Makefile modules/FvwmButtons/Makefile modules/FvwmCommand/Makefile modules/FvwmCommand/scripts/Makefile modules/FvwmConsole/Makefile modules/FvwmConsole/FvwmConsoleC.pl modules/FvwmCpp/Makefile modules/FvwmDebug/Makefile modules/FvwmDebug/FvwmDebug modules/FvwmDebug/FvwmGtkDebug modules/FvwmDragWell/Makefile modules/FvwmEvent/Makefile modules/FvwmForm/Makefile modules/FvwmIconBox/Makefile modules/FvwmIconMan/Makefile modules/FvwmIdent/Makefile modules/FvwmM4/Makefile modules/FvwmPager/Makefile modules/FvwmPerl/Makefile modules/FvwmPerl/FvwmPerl modules/FvwmProxy/Makefile modules/FvwmRearrange/Makefile modules/FvwmSave/Makefile modules/FvwmSaveDesk/Makefile modules/FvwmScript/Makefile modules/FvwmScript/Scripts/Makefile modules/FvwmScript/Widgets/Makefile modules/FvwmScroll/Makefile modules/FvwmTabs/Makefile modules/FvwmTabs/FvwmTabs modules/FvwmTaskBar/Makefile modules/FvwmTheme/Makefile modules/FvwmWharf/Makefile modules/FvwmWinList/Makefile modules/FvwmWindowMenu/Makefile modules/FvwmWindowMenu/FvwmWindowMenu modules/FvwmGtk/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FVWM_BUILD_MANDOC_TRUE}" && test -z "${FVWM_BUILD_MANDOC_FALSE}"; then as_fn_error $? "conditional \"FVWM_BUILD_MANDOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${FVWM_BUILD_HTMLDOC_TRUE}" && test -z "${FVWM_BUILD_HTMLDOC_FALSE}"; then as_fn_error $? "conditional \"FVWM_BUILD_HTMLDOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "libs/Makefile") CONFIG_FILES="$CONFIG_FILES libs/Makefile" ;; "fvwm/Makefile") CONFIG_FILES="$CONFIG_FILES fvwm/Makefile" ;; "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; "bin/fvwm-bug.1") CONFIG_FILES="$CONFIG_FILES bin/fvwm-bug.1" ;; "bin/fvwm-config.1") CONFIG_FILES="$CONFIG_FILES bin/fvwm-config.1" ;; "bin/fvwm-convert-2.2.1") CONFIG_FILES="$CONFIG_FILES bin/fvwm-convert-2.2.1" ;; "bin/fvwm-convert-2.4.1") CONFIG_FILES="$CONFIG_FILES bin/fvwm-convert-2.4.1" ;; "bin/fvwm-convert-2.6.1") CONFIG_FILES="$CONFIG_FILES bin/fvwm-convert-2.6.1" ;; "bin/fvwm-menu-desktop.1") CONFIG_FILES="$CONFIG_FILES bin/fvwm-menu-desktop.1" ;; "bin/fvwm-root.1") CONFIG_FILES="$CONFIG_FILES bin/fvwm-root.1" ;; "modules/FvwmAnimate/FvwmAnimate.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmAnimate/FvwmAnimate.1" ;; "modules/FvwmAuto/FvwmAuto.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmAuto/FvwmAuto.1" ;; "modules/FvwmBacker/FvwmBacker.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmBacker/FvwmBacker.1" ;; "modules/FvwmBanner/FvwmBanner.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmBanner/FvwmBanner.1" ;; "modules/FvwmButtons/FvwmButtons.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmButtons/FvwmButtons.1" ;; "modules/FvwmCommand/FvwmCommand.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmCommand/FvwmCommand.1" ;; "modules/FvwmConsole/FvwmConsole.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmConsole/FvwmConsole.1" ;; "modules/FvwmConsole/FvwmConsoleC.pl.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmConsole/FvwmConsoleC.pl.1" ;; "modules/FvwmCpp/FvwmCpp.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmCpp/FvwmCpp.1" ;; "modules/FvwmDragWell/FvwmDragWell.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmDragWell/FvwmDragWell.1" ;; "modules/FvwmEvent/FvwmEvent.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmEvent/FvwmEvent.1" ;; "modules/FvwmForm/FvwmForm.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmForm/FvwmForm.1" ;; "modules/FvwmGtk/FvwmGtk.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmGtk/FvwmGtk.1" ;; "modules/FvwmIconBox/FvwmIconBox.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmIconBox/FvwmIconBox.1" ;; "modules/FvwmIconMan/FvwmIconMan.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmIconMan/FvwmIconMan.1" ;; "modules/FvwmIdent/FvwmIdent.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmIdent/FvwmIdent.1" ;; "modules/FvwmM4/FvwmM4.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmM4/FvwmM4.1" ;; "modules/FvwmPager/FvwmPager.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmPager/FvwmPager.1" ;; "modules/FvwmProxy/FvwmProxy.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmProxy/FvwmProxy.1" ;; "modules/FvwmRearrange/FvwmRearrange.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmRearrange/FvwmRearrange.1" ;; "modules/FvwmSave/FvwmSave.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmSave/FvwmSave.1" ;; "modules/FvwmSaveDesk/FvwmSaveDesk.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmSaveDesk/FvwmSaveDesk.1" ;; "modules/FvwmScript/FvwmScript.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmScript/FvwmScript.1" ;; "modules/FvwmScroll/FvwmScroll.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmScroll/FvwmScroll.1" ;; "modules/FvwmTaskBar/FvwmTaskBar.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmTaskBar/FvwmTaskBar.1" ;; "modules/FvwmTheme/FvwmTheme.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmTheme/FvwmTheme.1" ;; "modules/FvwmWharf/FvwmWharf.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmWharf/FvwmWharf.1" ;; "modules/FvwmWinList/FvwmWinList.1") CONFIG_FILES="$CONFIG_FILES modules/FvwmWinList/FvwmWinList.1" ;; "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; "bin/fvwm-config") CONFIG_FILES="$CONFIG_FILES bin/fvwm-config" ;; "bin/fvwm-bug") CONFIG_FILES="$CONFIG_FILES bin/fvwm-bug" ;; "bin/fvwm-perllib") CONFIG_FILES="$CONFIG_FILES bin/fvwm-perllib" ;; "bin/fvwm-menu-xlock") CONFIG_FILES="$CONFIG_FILES bin/fvwm-menu-xlock" ;; "bin/fvwm-menu-directory") CONFIG_FILES="$CONFIG_FILES bin/fvwm-menu-directory" ;; "bin/fvwm-menu-desktop") CONFIG_FILES="$CONFIG_FILES bin/fvwm-menu-desktop" ;; "bin/fvwm-menu-headlines") CONFIG_FILES="$CONFIG_FILES bin/fvwm-menu-headlines" ;; "bin/fvwm-convert-2.4") CONFIG_FILES="$CONFIG_FILES bin/fvwm-convert-2.4" ;; "bin/fvwm-convert-2.6") CONFIG_FILES="$CONFIG_FILES bin/fvwm-convert-2.6" ;; "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; "perllib/Makefile") CONFIG_FILES="$CONFIG_FILES perllib/Makefile" ;; "perllib/General/Makefile") CONFIG_FILES="$CONFIG_FILES perllib/General/Makefile" ;; "perllib/FVWM/Makefile") CONFIG_FILES="$CONFIG_FILES perllib/FVWM/Makefile" ;; "perllib/FVWM/Module/Makefile") CONFIG_FILES="$CONFIG_FILES perllib/FVWM/Module/Makefile" ;; "perllib/FVWM/Tracker/Makefile") CONFIG_FILES="$CONFIG_FILES perllib/FVWM/Tracker/Makefile" ;; "perllib/FVWM/Module.pm") CONFIG_FILES="$CONFIG_FILES perllib/FVWM/Module.pm" ;; "rpm/Makefile") CONFIG_FILES="$CONFIG_FILES rpm/Makefile" ;; "rpm/fvwm.spec") CONFIG_FILES="$CONFIG_FILES rpm/fvwm.spec" ;; "debian/Makefile") CONFIG_FILES="$CONFIG_FILES debian/Makefile" ;; "debian/control") CONFIG_FILES="$CONFIG_FILES debian/control" ;; "doc/fvwm.ent") CONFIG_FILES="$CONFIG_FILES doc/fvwm.ent" ;; "doc/footer.html") CONFIG_FILES="$CONFIG_FILES doc/footer.html" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/fvwm/Makefile") CONFIG_FILES="$CONFIG_FILES doc/fvwm/Makefile" ;; "doc/commands/Makefile") CONFIG_FILES="$CONFIG_FILES doc/commands/Makefile" ;; "doc/docbook-xml/Makefile") CONFIG_FILES="$CONFIG_FILES doc/docbook-xml/Makefile" ;; "doc/docbook-xml/ent/Makefile") CONFIG_FILES="$CONFIG_FILES doc/docbook-xml/ent/Makefile" ;; "doc/docbook-xsl/Makefile") CONFIG_FILES="$CONFIG_FILES doc/docbook-xsl/Makefile" ;; "doc/docbook-xsl/common/Makefile") CONFIG_FILES="$CONFIG_FILES doc/docbook-xsl/common/Makefile" ;; "doc/docbook-xsl/manpages/Makefile") CONFIG_FILES="$CONFIG_FILES doc/docbook-xsl/manpages/Makefile" ;; "doc/docbook-xsl/profiling/Makefile") CONFIG_FILES="$CONFIG_FILES doc/docbook-xsl/profiling/Makefile" ;; "doc/docbook-xsl/highlighting/Makefile") CONFIG_FILES="$CONFIG_FILES doc/docbook-xsl/highlighting/Makefile" ;; "doc/docbook-xsl/lib/Makefile") CONFIG_FILES="$CONFIG_FILES doc/docbook-xsl/lib/Makefile" ;; "doc/docbook-xsl/html/Makefile") CONFIG_FILES="$CONFIG_FILES doc/docbook-xsl/html/Makefile" ;; "doc/modules/Makefile") CONFIG_FILES="$CONFIG_FILES doc/modules/Makefile" ;; "doc/modules/images/Makefile") CONFIG_FILES="$CONFIG_FILES doc/modules/images/Makefile" ;; "doc/modules/images/FvwmTabs/Makefile") CONFIG_FILES="$CONFIG_FILES doc/modules/images/FvwmTabs/Makefile" ;; "doc/images/Makefile") CONFIG_FILES="$CONFIG_FILES doc/images/Makefile" ;; "doc/images/svg_rendering/Makefile") CONFIG_FILES="$CONFIG_FILES doc/images/svg_rendering/Makefile" ;; "docs/fvwm.lsm") CONFIG_FILES="$CONFIG_FILES docs/fvwm.lsm" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "sample.fvwmrc/Makefile") CONFIG_FILES="$CONFIG_FILES sample.fvwmrc/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/hints/Makefile") CONFIG_FILES="$CONFIG_FILES tests/hints/Makefile" ;; "po/Makefile") CONFIG_FILES="$CONFIG_FILES po/Makefile" ;; "modules/FvwmAnimate/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmAnimate/Makefile" ;; "modules/FvwmAuto/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmAuto/Makefile" ;; "modules/FvwmBacker/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmBacker/Makefile" ;; "modules/FvwmBanner/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmBanner/Makefile" ;; "modules/FvwmButtons/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmButtons/Makefile" ;; "modules/FvwmCommand/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmCommand/Makefile" ;; "modules/FvwmCommand/scripts/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmCommand/scripts/Makefile" ;; "modules/FvwmConsole/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmConsole/Makefile" ;; "modules/FvwmConsole/FvwmConsoleC.pl") CONFIG_FILES="$CONFIG_FILES modules/FvwmConsole/FvwmConsoleC.pl" ;; "modules/FvwmCpp/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmCpp/Makefile" ;; "modules/FvwmDebug/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmDebug/Makefile" ;; "modules/FvwmDebug/FvwmDebug") CONFIG_FILES="$CONFIG_FILES modules/FvwmDebug/FvwmDebug" ;; "modules/FvwmDebug/FvwmGtkDebug") CONFIG_FILES="$CONFIG_FILES modules/FvwmDebug/FvwmGtkDebug" ;; "modules/FvwmDragWell/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmDragWell/Makefile" ;; "modules/FvwmEvent/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmEvent/Makefile" ;; "modules/FvwmForm/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmForm/Makefile" ;; "modules/FvwmIconBox/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmIconBox/Makefile" ;; "modules/FvwmIconMan/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmIconMan/Makefile" ;; "modules/FvwmIdent/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmIdent/Makefile" ;; "modules/FvwmM4/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmM4/Makefile" ;; "modules/FvwmPager/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmPager/Makefile" ;; "modules/FvwmPerl/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmPerl/Makefile" ;; "modules/FvwmPerl/FvwmPerl") CONFIG_FILES="$CONFIG_FILES modules/FvwmPerl/FvwmPerl" ;; "modules/FvwmProxy/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmProxy/Makefile" ;; "modules/FvwmRearrange/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmRearrange/Makefile" ;; "modules/FvwmSave/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmSave/Makefile" ;; "modules/FvwmSaveDesk/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmSaveDesk/Makefile" ;; "modules/FvwmScript/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmScript/Makefile" ;; "modules/FvwmScript/Scripts/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmScript/Scripts/Makefile" ;; "modules/FvwmScript/Widgets/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmScript/Widgets/Makefile" ;; "modules/FvwmScroll/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmScroll/Makefile" ;; "modules/FvwmTabs/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmTabs/Makefile" ;; "modules/FvwmTabs/FvwmTabs") CONFIG_FILES="$CONFIG_FILES modules/FvwmTabs/FvwmTabs" ;; "modules/FvwmTaskBar/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmTaskBar/Makefile" ;; "modules/FvwmTheme/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmTheme/Makefile" ;; "modules/FvwmWharf/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmWharf/Makefile" ;; "modules/FvwmWinList/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmWinList/Makefile" ;; "modules/FvwmWindowMenu/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmWindowMenu/Makefile" ;; "modules/FvwmWindowMenu/FvwmWindowMenu") CONFIG_FILES="$CONFIG_FILES modules/FvwmWindowMenu/FvwmWindowMenu" ;; "modules/FvwmGtk/Makefile") CONFIG_FILES="$CONFIG_FILES modules/FvwmGtk/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi # --------------------------------------------------------------------------- # Original config.status is patched to make generated scripts executable. sed 's/> $ac_file/> $ac_file; test x"`head -1 $ac_file | cut -c1-2`" = x"#!" \&\& chmod a+rx $ac_file/' config.status-t && \ mv config.status-t config.status chmod +x config.status # --------------------------------------------------------------------------- # --------------------------------------------------------------------------- cat >config.status-t <>config.status-t && \ mv config.status-t config.status chmod +x config.status # --------------------------------------------------------------------------- eval my_bindir="`eval echo ${bindir}`" eval my_mandir="`eval echo ${mandir}`" eval my_moddir="`eval echo ${FVWM_MODULEDIR}`"; eval my_moddir="$my_moddir" eval my_datdir="`eval echo ${FVWM_DATADIR}`" eval my_docdir="`eval echo ${FVWM_DOCDIR}`" eval my_plldir="`eval echo ${FVWM_PERLLIBDIR}`" test x"$FVWM_PERLLIB" = x && my_plldir="(Not installed) $my_plldir" eval my_localedir="`eval echo ${LOCALEDIR}`" test x"$USE_NLS" = xno && my_localedir="(Not installed) $my_localdir" case "$with_gtk" in yes) fvwmgtk_msg=" With GDK image support in FvwmGtk? $with_gdkimlib$problem_gdkimlib With GNOME libs support in FvwmGtk? $with_gnomelibs$problem_gnomelibs" ;; no) fvwmgtk_msg="" ;; esac echo " Fvwm Configuration: Version: $VERSION$VERSIONINFO Executables: $my_bindir Man pages: $my_mandir Modules: $my_moddir Data files: $my_datdir Doc files: $my_docdir Perl lib: $my_plldir Locale msg: $my_localedir $INST_LINGUAS With Asian bi-direct. text support? $with_bidi$problem_bidi With Gettext Native Lang support? $with_gettext$problem_gettext With GTK+ required for FvwmGtk? $with_gtk$problem_gtk$fvwmgtk_msg With Iconv support? $with_iconv_type$problem_iconv With Mouse strokes (gestures)? $with_stroke$problem_stroke With PNG image support? $with_png$problem_png With ReadLine sup. in FvwmConsole? $with_readline$problem_readline With RPlay support in FvwmEvent? $with_rplay$problem_rplay With Shaped window support? $with_shape$problem_shape With Shared memory for XImage? $with_shm$problem_shm With Session Management support? $with_sm$problem_sm With SVG image support? $with_rsvg$problem_rsvg With Xcursor support? $with_xcursor$problem_xcursor With Xinerama multi-head support? $with_xinerama$problem_xinerama With Xft anti-alias font support? $with_xft$problem_xft With XPM image support? $with_xpm$problem_xpm With Xrender image support? $with_xrender$problem_xrender Build man pages? $with_mandoc$problem_mandoc Build HTML documentation? $with_htmldoc$problem_htmldoc See INSTALL.fvwm for the description of what this may mean." case "$with_xinerama_emulation" in yes) echo " Xinerama emulation enabled." ;; esac case "$ac_cv_dmalloc" in yes) echo " DMALLOC heap debugging library enabled." ;; esac case "$ac_cv_efence" in yes) echo " EFENCE debugging library enabled." ;; esac fvwm-2.6.5.orig/sample.fvwmrc/0000755000175000017500000000000011744241503014407 5ustar vwcvwcfvwm-2.6.5.orig/sample.fvwmrc/system.fvwm2rc-sample-950000644000175000017500000042522411222754365020774 0ustar vwcvwc#-----------------------------------------------------------------------------# # # Sample-95: .fvwm2rc example configuration file for a more or less Windows95 # look and feel # # The suggested way to install this configuration file is to (re)move # any .fvwm2rc file you have in ~/.fvwm or ~ and run fvwm without any # startup file. # # Then, run the "Setup 95 Script" from the root menu. This creates # and installs the following configuration files: .fvwm2rc, bindings, # decorations, functions, globalfeel, menus, modules, startup, styles, # iconstyles. # If perl is not installed on your machine (my god), only one file is # installed: .fvwm2rc (and this configuration should work). Some instructions # are given below for a first editing of this file. Maybe the first thing # to do in this case is to segment this file. For that, you can move the # parts of this file between the marks "#SEG foo" and "#SEG xyz" into a # file foo and add "Read foo" to this file (until the "#SEG END" mark). # # You do need the fvwm_icons distribution installed in the fvwm image path. # If they are installed in another directory use the ImagePath command # below or set this directory via the Setup95 Script. # # For the sound effects to work you need the fvwm_sounds distribution # installed and an .au player. The Setup95 Script allows you to set the # installation directory of this distribution as your sound player (if not, # manually edit the *FvwmEvent commands). Note that if you use rplay, the # rplayd daemon must be run. # # The Setup95 Script asks you to choose between two looks, one is close # to Windows and the other one is close to a "classical" fvwm look. # For switching from the windows look to the fvwm one by hand, comment the # x lines that follow the #WIN x lines and uncomment the x lines that # follow the #FVWM x lines. # # There is an option for machines with a "low X server (comment #FAST and # uncomment #SLOW). You may have to use some intermediate values (Base # Configuration can help and if you "rebuild Sample-95" .FvwmBaseConfig # may over write the effect of this option). See also the BackingStore and # SaveUnder style. # # I've tried to use very common apps (like Gimp or Netscape) so that this # configuration file is as universal as possible. For menus, the Setup 95 # Script starts with a big menu. Comment the menu entries that correspond # to applications not in your path. Moreover, the Setup95 Script asks you # to set your preferred terminal, editor and file manager (#PREF). However, # you surely need to edit the menu definitions and the BarButtons # configuration to get your preferred applications. # # I have a laptop so I have added one laptop option. If you answer yes # to the Setup95 question: "do you have a laptop?" you will have xapm # in your BarButtons. To get it by hand, just uncomment the line that # follows #LAPTOP. # # GNOME and KDE menus: fvwm has a perl script that can build GNOME and # KDE menus: fvwm-menu-desktop (man fvwm-menu-desktop for details). If GNOME # and/or KDE are installed in your machine, Setup95 will ask you which menus # you want to add to your Programs sub menus (G_SM_G/F means FvwmGtk/fvwm # gnome system menu, G_SM_G/F means FvwmGtk/fvwm gnome user menu, G_RHM_G/F # means gnome redhat menu, G_M_G means that we need to start FvwmGtk, K_SM # means kde system menu and K_UM means kde user menu. You may have to edit # the line G_*M_* to set your GNOME install directory (Setup95 try to # find it)). KDE (mini-)Icon Styles and KDE ImagePath (#K_M) are provided # if you select one of the KDE menus. For GNOME, (mini-)Icon Styles are # provided if you have the panel installed (#G_ST) and the image path is # set if you ask for FvwmGtk menus (#G_M_G). # # GNOME session: This configuration can be used under gnome-session. In # this case almost no modules are started (for a first installation). # However, you may use more modules: this depends on your gnome panel # configuration. If Setup95 builds a configuration to be used # under gnome-session, the lines which follow #G_SESSION will be uncommented. # The panel stays put option (the line which follow #G_PANEL) try to put # the panel in the same layers as the other windows. # Note that it safe to "Build a config for gnome-session" for using with # a normal fvwm session. # # CDE: There is an elementary support for CDE (lines which follow #CDE). # # Note: for saving its state (the changes you do via settings-->* up to the # first separator) Sample-95 uses some files $FVWM_USERDIR/.start-* (see # section 5), $FVWM_USERDIR/.fvwm-layers (see section 6) and the usual fvwm # config files: .FvwmAnimate, .FvwmForm, ~/.xinitrc-fvwm, .FvwmBaseConfig # # There are many comments, but a good reading of the fvwm FAQ, of the man # pages of fvwm and its modules is recommended. Also, you can read the # sample-95 MINI-FAQ that you can find at the end of this file. # #!D For the fvwm-workers. These lines will not appear if the Setup95 Script #!D is used to install this file. I hope that the above lines give enough #!D information for editing this file at a devel level. Be sure to take a #!D look to the perl script fvwm-script-setup95.pl and to FvwmScript-Setup95. #!D More information is given here. #!D If you add entries to the menus which contains Exec and exec then #!D fvwm-script-setup95.pl will check if the application run is in #!D the path. Supported format is #!D Exec exec app [options] #!D Exec cd path; /.app [options] (to run path/app in path) #!D Exec exec killall app #!D Exec xterm [options] -e app [option] #!D Moreover, you can use #!E app1:app2:... in the end of a line for #!D commenting this line unless app1 or app2 or ... is in the path. #!D This is currently used in icons styles definitions and for line #!D separator in menu definitions. These ends of line will not appear in the #!D builded file. # #-----------------------------------------------------------------------------# # # Summary: # # 1. Module and Image paths. (In this file) # 2. Root cursor, Windows Decoration and Menus Style. (In decorations) # 3. Set up the Major operating modes. (In globalfeel) # 4. Miscellaneous Major operating mode. (In globalfeel) # 5. Stuff to do at start-up and on restart. (In startup) # 6. Set applications dependent styles. (In styles) # 7. Set applications Mini Icons and Icons. (In iconstyles) # 8. Define some complex functions. (In functions) # 9. Mouse, frame buttons and keyboard bindings. (In bindings) # 10. Define the menus. (In menus) # 11. Definitions used by the modules. (In modules) # 12. MINI-FAQ. (In this file) # #-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------# # # 1. Module and Image paths # These paths are colon-separated lists, just like regular unix PATH # #-----------------------------------------------------------------------------# # ModulePath is builtin, you may add some directories here #ModulePath $HOME/mymodules:+ # The default image path is: # /usr/include/X11/bitmap:/usr/include/X11/pixmaps # if the fvwm_icons are not installed in one of these directories or if # you want to add a personal image path uncomment and edit the next line #ImagePath :add_dir_to_fvwm_image_path:+ #K_M 1 for KDE Styles and menus #ImagePath +:$KDEDIR/share/icons:$KDEDIR/share/apps/kappfinder/pics/: #G_M_G 1 for FvwmGtk menus #ImagePath +:/usr/share/pixmaps: # Warning: you may have to replace /usr by gnomeinstallpath in the previous # line. gnomeinstallpath may be /usr/local, /opt/gnome, ... #-----------------------------------------------------------------------------# # # Start the Show # #-----------------------------------------------------------------------------# #SEG decorations #-----------------------------------------------------------------------------# # # 2. Root cursor, Windows Decoration and Menu Styles: # Default fonts, colors, Border, Title, Button Styles, Menu Styles # window button bindings. # (this section may be the theme part of the config, but you need to use # FvwmTheme to define and propagate the colors) #-----------------------------------------------------------------------------# #------------------------------------------------------------------------------ # Set the root cursor #------------------------------------------------------------------------------ CursorStyle ROOT left_ptr CursorStyle TITLE left_ptr CursorStyle DEFAULT left_ptr CursorStyle SYS left_ptr CursorStyle MENU left_ptr #------------------------------------------------------------------------------ # Fonts - one for window titles, another for icons, and another for the menus #------------------------------------------------------------------------------ #WIN 1 Style * Font "xft:sans-serif:Medium;-*-times-medium-r-*-*-16-*-*-*-*-*-*-*" #FVWM 1 #Style * Font "xft:sans-serif:Medium;-*-times-bold-r-*-*-14-*-*-*-*-*-*-*" Style * IconFont \ "xft:monospace:pixelsize=12:Medium;-*-fixed-medium-r-*-*-12-*-*-*-*-*-*-*" #------------------------------------------------------------------------------ # Set the default window colors. #------------------------------------------------------------------------------ # Text and background color for the title bar (overridden in the WIN case), # and the border of the inactive window (also used by icon title, # and "hilight" and "shadow" colors). #WIN 1 Style * ForeColor #c3c3c3, BackColor #c3c3c3 #FVWM 1 #Style * ForeColor #c3c3c3, BackColor grey51 # Text and background color for the title bar (overriden in the WIN case), # and the border of the active (selected) window (also used by icon title, # and "hilight" and "shadow" colors). #WIN 1 Style * HilightFore white, HilightBack #c3c3c3 #FVWM 1 #Style * HilightFore white, HilightBack SlateBlue #------------------------------------------------------------------------------ # Border, Title and Button Styles #------------------------------------------------------------------------------ Style * BorderWidth 5, HandleWidth 5 #WIN 13 Style "*" FvwmBorder # MWMBorder Style "*" FvwmButtons BorderStyle Inactive -- HiddenHandles NoInset BorderStyle Active -- HiddenHandles NoInset TitleStyle ActiveUp (solid Blue4 -- Flat) TitleStyle ActiveDown (solid Blue4 -- Flat) TitleStyle Inactive (solid grey51 -- Flat) TitleStyle LeftJustified ButtonStyle 1 MiniIcon (-- flat) ButtonStyle all -- UseTitleStyle Flat AddButtonStyle 2 Pixmap mini.winXX-close.xpm -- left AddButtonStyle 4 Pixmap mini.winXX-maximize.xpm -- left AddButtonStyle 6 Pixmap mini.winXX-minimize.xpm -- right #FVWM 11 #Style "*" MWMBorder # FVWMBorder #Style "*" MWMButtons #TitleStyle Centered #ButtonStyle all -- UseTitleStyle #ButtonStyle 2 17 20x20@1 30x20@1 50x40@1 70x20@1 80x20@1 80x30@0 60x50@0 80x70@1 80x80@0 70x80@0 50x60@0 30x80@0 20x80@0 20x70@0 40x50@1 20x30@0 20x20@1 #ButtonStyle 4 4 50x25@1 75x75@0 25x75@0 50x25@1 #ButtonStyle 6 4 50x65@1 35x35@1 65x35@1 50x65@0 #ButtonStyle 1 - Clear MWMDecorMenu #ButtonStyle 2 - Clear #ButtonStyle 4 - Clear MWMDecorMax #ButtonStyle 6 - Clear MWMDecorShade #------------------------------------------------------------------------------ # The MenuStyle command allows almost full control over menu look and feel. # We use the preconfigured 'Win' or 'Fvwm' default. This resets most other # options and must be set first. We also define a menu called winops for # the windows operations menus and very long one. The menus which use this # style are (and must) be defined in the end of the menus. #------------------------------------------------------------------------------ #WIN 4 MenuStyle * win MenuStyle * font "xft:sans-serif:Medium;-*-times-medium-r-*-*-16-*-*-*-*-*-*-*" MenuStyle * Foreground black, Background grey80 MenuStyle * ActiveFore white, HilightBack Blue4 #FVWM 5 #MenuStyle * fvwm #MenuStyle * font "xft:sans-serif:Medium;-*-times-bold-r-*-*-14-*-*-*-*-*-*-*" #MenuStyle * Foreground black, Background grey80 #MenuStyle * ActiveFore black, HilightBack grey85 #MenuStyle * Hilight3DThick MenuStyle * Greyed grey60 # default is invisible on backgroud grey80 MenuStyle * VerticalItemSpacing 2 4, VerticalTitleSpacing 2 4 CopyMenuStyle * winops #WIN 1 MenuStyle winops font "xft:sans-serif:Medium;-*-times-medium-r-*-*-14-*-*-*-*-*-*-*" #FVWM 2 #MenuStyle winops font "xft:sans-serif:Medium;-*-times-bold-r-*-*-12-*-*-*-*-*-*-*" #MenuStyle winops TitleWarpOff MenuStyle winops VerticalItemSpacing 1 2, VerticalTitleSpacing 1 2 #SEG globalfeel #-----------------------------------------------------------------------------# # # 3. Set up the major operating modes # #-----------------------------------------------------------------------------# # WARNING! # # If you use (or ever used) Settings-->Configuration-->Base Config # to configure your major operating modes then all commands in this # section 3 are overridden by the last line of this section (PipeRead). # So, you can comment the last line of this section. # Or, instead, you can remove all the lines of this section but the last one. # # If you use Base Config and this section has some application dependent # styles, a suggested solution is to move them to the styles file. # This way Base Config does not destroy your application specific # styles when you use it. #WIN 1 To have more WIN-like behavior Emulate win #FVWM 1 #Emulate fvwm HideGeometryWindow Never #WIN 1 SnapAttraction 10 SameType Screen #FVWM 1 #SnapAttraction 0 SameType Screen #FAST 3 OpaqueMoveSize 100 Style * ResizeOpaque Style * WindowShadeSteps 20 #SLOW 3 #OpaqueMoveSize 0 #Style * ResizeOutline #Style * WindowShadeSteps 0 EdgeScroll 0 0 EdgeResistance 500 0 EdgeThickness 1 # # The focus policy. Once you are used to clicking *inside* windows to # raise them you will not want to lose this feature. # Style * SloppyFocus Style * MouseFocusClickRaises # # MinOverlapPlacement places window automatically in a way that attempts to be # place windows 'intelligent'. # Style * MinOverlapPlacement # # !UsePPosition instructs fvwm to ignore the PPosition field in window # geometry hints. Emacs annoyingly sets PPosition to (0,0)! # Style * !UsePPosition Style * GrabFocusOff # If you ever used Base Config, then the next line overrides this section # with the settings you defined! In this case you may replace the whole # section 3 by one command "Read .FvwmBaseConfig". PipeRead '[ ! -f $FVWM_USERDIR/.FvwmBaseConfig ] || echo Read .FvwmBaseConfig' #----------------------------------------------------------------------------# # # 4. Miscellaneous Major operating mode # #----------------------------------------------------------------------------# #------------------------------------------------------------------------------ # Set the desk top size in units of physical screen size #------------------------------------------------------------------------------ DeskTopSize 2x2 #------------------------------------------------------------------------------ # Some good things (in general) #------------------------------------------------------------------------------ Style * MWMFunctions Style * MWMDecor Style * HintOverride Style * OLDecor BusyCursor DynamicMenu True, Read True #------------------------------------------------------------------------------ # transient windows #------------------------------------------------------------------------------ # You can do a lot of things with transient windows. However, you may # want to set transient style by application (in styles). # Heres one example: # # If you want to decorate transient windows: #Style * DecorateTransient # In *general* it is not a good idea to be able to lower transient window # under its main window, but why not... #Style * DontRaiseTransient # In my HO the defaults (which are "Motif" compliant) are good. #------------------------------------------------------------------------------ # bogus hack #------------------------------------------------------------------------------ # # fvwm has a command for bogus applications. Here an example with KFM # #KFM_ICONS 1 uncomment the next line if you use the KFM "icons" #BugOpts RaiseOverUnmanaged on #PANEL_PUT 1 you may try this for a "stays put" gnome panel #DefaultLayers 6 8 10 #SEG startup #-----------------------------------------------------------------------------# # # 5. Stuff to do at start-up and on restart # #-----------------------------------------------------------------------------# # Defines the background Read .start-Background # This file defines which applications manager we start: TaskBarGlobal, # TaskBarDesk, IconBoxGlobal, IconBoxDesk, ...etc. Read .start-apps-man # This one decides which big buttons we start BarButtons, Wharf or None Read .start-FvwmButtons # This one decides if we start the DeskerPanel Read .start-DeskerPanelButtons # This one decides if we start MiniButtons Read .start-MiniButtons # This one decides if we start WinMakerAppButtons Read .start-WinMakerAppButtons # This file decides if we start FvwmAnimate or not Read .start-FvwmAnimate # This one decides if we start FvwmAuto Read .start-FvwmAuto # This one decides if we start FvwmBanner Read .start-FvwmBanner # Sounds effect (FvwmEvent) Read .start-FvwmEvent # The StartFunction is used at start and restart with or without a Session # Manager. The above file .start-* defines this function. If # we want Gtk menus and dialog (defined in the modules section) we start # FvwmGtk. AddToFunc StartFunction #G_M_G 1 #+ I Module FvwmGtk # The InitFunction is used at fvwm start AddToFunc InitFunction # Load the X Setup Scripts setting if we use it + I Exec [ -f $HOME/.xinitrc-fvwm ] && sh $HOME/.xinitrc-fvwm #+ I Exec exec xsetroot -solid \#7F4B7F # The restart function: AddToFunc RestartFunction #+ I Module FvwmButtons MyButtons # # When used with a session manager fvwm uses SessionInitFunction and # SessionRestartFunction in the place of InitFunction and RestartFunction # AddToFunc SessionInitFunction # Do not Load the X Setup Scripts setting, some Session Managers have its own # method (e.g., GNOME) #+ I Exec [ -f $HOME/.xinitrc-fvwm ] && sh $HOME/.xinitrc-fvwm #+ I Module FvwmButtons MyButtons AddToFunc SessionRestartFunction #+ I Module FvwmButtons MyButtons #SEG styles #-----------------------------------------------------------------------------# # # 6. Set application dependent styles # # Order is important! # If compatible styles are set for a single window in multiple Style # commands, then the styles are ORed together. If conflicting styles # are set, the last one specified is used. # #-----------------------------------------------------------------------------# Style *lock !Title, !Handles, Sticky, WindowListSkip Style xeyes !Title, Sticky Style *biff* !Title, Sticky, WindowListSkip Style xsysinfo !Title, Sticky, WindowListSkip Style xload !Title, Sticky, WindowListSkip Style xconsole Sticky, StartIconic Style xpostit WindowListSkip Style PostitNote WindowListSkip Style Postit !Handles, WindowListSkip # gnome panel & icons Style panel Sticky, !Title, WindowListSkip, CirculateSkip Style desktop_icon CirculateSkip, WindowListSkip, !Title # Animation is broken in gnome panel 1.4 with GNOMEUseHints. # GNOMEIgnoreHints also disables panel moving itself from layer to layer. Style panel GNOMEIgnoreHints # xsm panel Style xsm Sticky, !Title, WindowListSkip, CirculateSkip Style FvwmForm-QuitVerify !Button 1, !Button 2, !Button 4, !Button 6, \ StaysOnTop, NoHandles, WindowListSkip # Some version of Netscape need the following if you want that the # page source (and others horrible banner) to be decorated (but you may # lost some MWM decor hints) #Style Netscape NoDecorHint # I do not like that the "find in page" of netscape cannot be lowered. # Uncomment the next line if your are agree. #Style Netscape DontRaiseTransient #DT 1 for the CDE "desk icon" #Style popup_* CirculateSkip, WindowListSkip # Read the layers settings (stays OnTop, Put or OnBottom) Read .fvwm-layers #SEG iconstyles #-----------------------------------------------------------------------------# # # 7. Set applications Mini Icons and Icons # #-----------------------------------------------------------------------------# # Note: Most applications provide an icon. Style * IconBox 10 -80 -0 -0, IconGrid 64 64, IconFill left bottom, \ IconBox 10 +300 -150 -80, IconGrid 64 64, IconFill bottom left Style * SlipperyIcon, IconTitle # default Style * MiniIcon mini.doc.xpm, Icon page.xpm # Terminals Style *term* MiniIcon mini.term.xpm, Icon rterm2.xpm Style rxvt MiniIcon mini.term.xpm, Icon rterm2.xpm #!E rxvt # Accessories Style xcalc MiniIcon mini.calc.xpm, Icon rcalc2.xpm Style xconsole MiniIcon mini.term.xpm, Icon rtrem2.xpm Style xmag MiniIcon mini.zoom.xpm, Icon mag_glass.xpm Style xfontsel MiniIcon mini.font.xpm, Icon toolbox.xpm Style xgrab MiniIcon mini.camera.xpm Style *clock* MiniIcon mini.clock.xpm Style ddd MiniIcon mini.bug2.xpm #!E ddd Style xgdb MiniIcon mini.bug2.xpm #!E xgdb Style XClipboard MiniIcon mini.clipboard.xpm, Icon toolbox.xpm Style *color* MiniIcon mini.colors.xpm, Icon resize # Applications Style lyx MiniIcon mini.edit.xpm #!E lyx Style thot MiniIcon mini.edit.xpm #!E thot Style ghostview MiniIcon mini.gv.xpm #!E ghostview Style gv MiniIcon mini.gv.xpm #!E gv Style xdvi MiniIcon mini.zoom.xpm #!E xdvi Style acroread MiniIcon mini.pdf.xpm #!E acroread Style xpdf MiniIcon mini.pdf.xpm #!E xpdf Style plan MiniIcon mini.calandar.xpm #!E plan # Sciences Style GNUplot MiniIcon mini.graph.xpm, Icon graphs.xpm #!E gnuplot Style *maple MiniIcon mini.zoom.xpm #!E xmpale Style Scilab MiniIcon mini.graph2.xpm #!E scilab Style Xaos MiniIcon mini.fractal.xpm #!E xaos Style fractint MiniIcon mini.fractal.xpm #!E xfractint Style xephem MiniIcon mini.exp.xpm #!E xephem Style XTide MiniIcon mini.exp.xpm #!E xtide Style THX-1138 MiniIcon mini.calc.xpm #!E thx-1138 # System Style Top MiniIcon mini.run.xpm, Icon toolbox.xpm Style tkps MiniIcon mini.hex.xpm, Icon toolbox.xpm #!E tkps Style xosview MiniIcon mini.run.xpm, Icon toolbox.xpm #!E xosview Style xload MiniIcon mini.perf.xpm, Icon toolbox.xpm Style xmem MiniIcon mini.perf.xpm, Icon toolbox.xpm #!E xmem Style XSysStats MiniIcon mini.run.xpm #!E XSysStats # File Mgr Style xfm MiniIcon mini.filemgr.xpm, Icon Xfm.xpm #!E xfm Style fr MiniIcon mini.filemgr.xpm, Icon Xfm.xpm #!E fr Style Midnight-Commander MiniIcon mini.filemgr.xpm, Icon Xfm.xpm #!E mc # Editors Style emacs MiniIcon mini.edit.xpm, Icon lemacs.xpm #!E emacs:xemacs Style VIM MiniIcon mini.edit.xpm, Icon lemacs.xpm #!E gvim Style *edit MiniIcon mini.edit.xpm, Icon lemacs.xpm Style dtpad MiniIcon mini.edit.xpm, Icon lemacs.xpm #!E /usr/dt/bin/dtpad # Network Style *ppp* MiniIcon mini.connect.xpm, Icon Mosaic.xpm Style Hifs MiniIcon mini.connect.xpm, Icon Mosaic.xpm #!E hifs # Internet # Netscape resource Style Netscape MiniIcon mini.nscape.xpm Style Navigator MiniIcon mini.nscape.xpm Style MailFolder MiniIcon mini.dirlink.xpm Style MailThread MiniIcon mini.mail.xpm Style Composition MiniIcon mini.letter.xpm Style Composer MiniIcon mini.editor.xpm Style *Download* MiniIcon mini.ftp.xpm # Style amaya MiniIcon mini.nscape.xpm #!E amaya Style Mozilla MiniIcon mini.nscape.xpm #!E mozilla Style lynx MiniIcon mini.cat.xpm, Icon Mosaic.xpm #!E lynx Style xmh MiniIcon mini.mail.xpm, Icon Mail2.xpm #!E xmh Style Mail MiniIcon mini.mail.xpm, Icon Mail2.xpm #!E mail Style *mail* MiniIcon mini.mail.xpm, Icon Mail2.xpm Style Pine MiniIcon mini.mail.xpm, Icon Mail2.xpm #!E pine Style Mutt MiniIcon mini.mail.xpm, Icon Mail2.xpm #!E mutt Style NcFtp MiniIcon mini.ftp.xpm, Icon Mosaic.xpm #!E ncftp Style *ftp* MiniIcon mini.ftp.xpm, Icon Mosaic.xpm Style "X-Chat*" MiniIcon mini.doc1.xpm, Icon page.xpm #!E xchat Style Irc MiniIcon mini.doc1.xpm #!E irc Style tkirc MiniIcon mini.doc1.xpm #!E tkirc Style Licq MiniIcon mini.doc1.xpm #!E licq Style Style zircon MiniIcon mini.zircon.xpm #! zircon Style xgopher MiniIcon mini.gopher.xpm #!E xgopher # Graphics Style xv MiniIcon mini.xv.xpm #!E xv Style "The GIMP" MiniIcon mini.gimp.xpm, Icon gimp.xpm #!E gimp Style "Gimp" MiniIcon mini.gimp.xpm, Icon gimp.xpm #!E gimp Style xfig MiniIcon mini.xfig.xpm #!E xfig Style xfpovary MiniIcon mini.ray.xpm #!E xfpovary # xpaint resource names Style xpaint MiniIcon mini.palette.xpm Style Canvas MiniIcon mini.palette.xpm Style fatbits MiniIcon mini.palette.xpm Style filebrowser MiniIcon mini.ofolder.xpm # Style XbmBrowser MiniIcon mini.directory.xpm #!E xbmbrowser Style ee MiniIcon mini.palette.xpm #!E ee # Multimedia Style *mixer MiniIcon mini.audiovol.xpm Style *playcd* MiniIcon mini.cdlabel.xpm Style *cdplay* MiniIcon mini.cdlabel.xpm Style xltwavplay MiniIcon mini.sound.xpm #!E xltwavplay Style MiXViews MiniIcon mini.audiovol.xpm #!E mxv Style freeamp MiniIcon mini.audiovol.xpm #!E freeamp Style XAnim MiniIcon mini.display.xpm #!E xanim # Games and amusement Style *maze MiniIcon mini.maze.xpm Style xboard MiniIcon mini.slon.xpm #!E xboard Style XGammon MiniIcon mini.go.xpm #!E xgammon Style xsokoban MiniIcon mini.go.xpm #!E xsokoban Style xlander MiniIcon mini.xlander.xpm #!E xlander Style xmahjongg MiniIcon mini.xmahjongg.xpm #!E xmahjongg Style xjewel MiniIcon mini.xjewel.xpm #!E xjewel Style hextris MiniIcon mini.hextris.xpm #!E hextris Style *tetris* MiniIcon mini.tetris.xpm Style kpat2 MiniIcon mini.heart.xpm #!E kpat2 Style xeyes MiniIcon mini.eyes.xpm Style xcat MiniIcon mini.cat.xpm #!E xcat Style Quake* MiniIcon mini.destroy.xpm, Icon doomface.xpm Style Koules MiniIcon mini.happy.xpm Style xroach MiniIcon mini.roach.xpm Style xlogo MiniIcon mini.x2.xpm # Modules, Form and script Style Fvwm* MiniIcon - Style FvwmScript* MiniIcon mini.fvwm.xpm Style FvwmForm* MiniIcon mini.fvwm.xpm Style FvwmIdent MiniIcon mini.question.xpm, Icon question.xpm Style FvwmConsole MiniIcon mini.xterm.xpm, Icon wterm.xpm Style FvwmScript-BellSetup MiniIcon mini.audiovol.xpm, Icon bell.xpm Style FvwmScript-KeyboardSetup MiniIcon mini.keyboard.xpm,Icon keyboard.xpm Style FvwmScript-ScreenSetup MiniIcon mini.monitor.xpm, Icon screen.xpm Style FvwmScript-PointerSetup MiniIcon mini.mouse.xpm, Icon pointer.xpm Style FvwmScript-BaseConfig MiniIcon mini.fvwm.xpm, Icon settings.xpm Style FvwmScript-Find MiniIcon mini.zoom.xpm, Icon find1.xpm Style FvwmScript-Quit MiniIcon mini.question.xpm Style FvwmScript-Colorset MiniIcon mini.colors.xpm, Icon settings.xpm Style FvwmScript-ScreenDump MiniIcon mini.camera.xpm, Icon resize.xpm Style FvwmScript-Setup95 MiniIcon mini.fvwm.xpm, Icon settings.xpm Style FvwmScript-Date MiniIcon mini.clock.xpm, Icon date.xpm Style FvwmForm-QuitVerify MiniIcon mini.question.xpm Style FvwmForm-Rlogin MiniIcon mini.connect.xpm, Icon Mosaic.xpm Style FvwmForm-Capture MiniIcon mini.camera.xpm, Icon resize.xpm Style FvwmForm-Talk MiniIcon mini.telnet.xpm, Icon rterm.xpm Style FvwmForm-RootCursor MiniIcon mini.xarchie.xpm, Icon settings.xpm Style FvwmForm-Form MiniIcon mini.fvwm.xpm, Icon settings.xpm Style FvwmForm-Setup MiniIcon mini.fvwm.xpm, Icon settings.xpm Style FormFvwmAnimate MiniIcon mini.iconify.xpm, Icon settings.xpm Style xmessage MiniIcon mini.question.xpm, Icon settings.xpm Style WinMakerAppButtons* !Icon # Help Style man MiniIcon mini.book1.xpm, Icon help.xpm # xman resource names Style topBox MiniIcon mini.book1.xpm, Icon help.xpm Style help MiniIcon mini.book2.xpm, Icon help.xpm Style manualBrowser MiniIcon mini.book2.xpm, Icon help.xpm Style *FAQ* MiniIcon mini.question.xpm, Icon help.xpm # others... Style IDL* MiniIcon mini.zoom.xpm Style XDbx MiniIcon mini.bug2.xpm Style control-panel MiniIcon mini.eye.xpm #!E control-panel Style xvidtune MiniIcon mini.x2.xpm # To get the kde mini-icon styles build the system menu (i.e., uncomment # the lines that follow K_SM) #G_ST 51 some icons, an alternative is to use fvwm2gnome and fvwm-menu-desktop #Style "gcolorsel" MiniIcon mini.colors.xpm, Icon resize.xpm #Style "gcalc" MiniIcon mini.calc.xpm, Icon rcalc2.xpm #Style "gdiskfree" MiniIcon mini.fdisk.xpm #Style "gEdit" MiniIcon mini.edit.xpm, Icon lemacs.xpm #Style "gedit" MiniIcon mini.edit.xpm, Icon lemacs.xpm #Style "gfontsel" MiniIcon mini.font.xpm #Style "ghex" MiniIcon mini.hex.xpm, Icon page.xpm #Style "gless" MiniIcon mini.file.xpm Icon page.xpm #Style "gmix" MiniIcon mini.sound.xpm #Style "gmailman" MiniIcon mini.mail.xpm, Icon mail2.xpm #Style "gmc" MiniIcon mini.filemgr.xpm, Icon Xfm.xpm #Style "gmenu" MiniIcon mini.doc1.xpm, Icon dialog_box.xpm #Style "gnome-help-browser" MiniIcon mini.book3.xpm, Icon help.xpm #Style "GnomeHelpBrowser" MiniIcon mini.book3.xpm, Icon help.xpm #Style "gnome-ppp" MiniIcon mini.connect.xpm, Icon Mosaic.xpm #Style "gnome-run" MiniIcon mini.hammer.xpm, Icon run.xpm #Style "gnome-sync" MiniIcon mini.folder.xpm, Icon folder.xpm #Style "gnomecal" MiniIcon norm.calendar.xpm, Icon mini/clock.xpm #Style "gnomecard" MiniIcon mini.doc1.xpm, Icon page2.xpm #Style "gnomecc" MiniIcon mini.hammer.xpm, Icon mini/home.xpm #Style "GnomeTerminal" MiniIcon mini.term.xpm, Icon rterm2.xpm #Style "gnp" MiniIcon mini.doc1.xpm, Icon page2.xpm #Style "gnp+" MiniIcon mini.doc1.xpm, Icon page2.xpm #Style "gnumeric" MiniIcon mini.calc2.xpm Icon rcalc2.xpm #Style "GQview" MiniIcon mini.palette.xpm Icon xpaint.xpm #Style "gsearchtool" MiniIcon mini.zoom.xpm, Icon find1.xpm #Style "gstripchart" MiniIcon mini.graph2.xpm #Style "gtalk" MiniIcon mini.zircon.xpm #Style "gtcd" MiniIcon mini.cdlabel.xpm #Style "gtk-shell" MiniIcon mini.doc1.xpm, Icon page.xpm #Style "gtop" MiniIcon mini.run.xpm, Icon toolbox.xpm #Style "gtt" MiniIcon mini.clock.xpm, Icon toolbox.xpm #Style "guname" MiniIcon mini.question.xpm Icon page2.xpm #Style "gw" MiniIcon mini.run.xpm, Icon page2.xpm #Style "gxedit" MiniIcon mini.edit.xpm, Icon lemacs.xpm #Style "vumeter" MiniIcon mini.sound.xpm #Style "freecell" MiniIcon mini.heart.xpm #Style "gnibbles" MiniIcon mini.happy.xpm #Style "gnobots" MiniIcon mini.happy.xpm #Style "gnobots2" MiniIcon mini.happy.xpm #Style "gnome-stones" MiniIcon mini.happy.xpm #Style "gnomine" MiniIcon mini.happy.xpm #Style "gtali" MiniIcon mini.happy.xpm #Style "gturing" MiniIcon mini.happy.xpm #Style "iagno" MiniIcon mini.happy.xpm #Style "mahjongg" MiniIcon mini.happy.xpm #Style "same-gnome" MiniIcon mini.happy.xpm #Style "sol" MiniIcon mini.heart.xpm #Style "gtkballs" MiniIcon mini.happy.xpm #Style "gfpoken" MiniIcon mini.happy.xpm #Style "Imlib*" MiniIcon mini.hammer.xpm #CDE 10 #Style Dtfile MiniIcon mini.filemgr.xpm #Style Dtpad MiniIcon mini.edit.xpm #Style Dthelp* MiniIcon mini.book1.xpm #Style Dtcm* MiniIcon mini.calendar.xpm #Style Dtcalc MiniIcon mini.calc.xpm #Style Dticon* MiniIcon mini.palette.xpm #Style Dtprint* MiniIcon mini.fax.xpm #Style Dtstyle* MiniIcon mini.desktop.xpm #Style "Applications Manager" MiniIcon mini.programs.xpm #Style "Trash Can" MiniIcon mini.paper.xpm #SEG functions #----------------------------------------------------------------------------# # # 8. Now define some handy complex functions # #----------------------------------------------------------------------------# #------------------------------------------------------------------------------ # This one moves and then raises the window if you drag the mouse, # only raises the window if you click, or does a vertical maximize if # you double click (full screen maximize would be 'Maximize 100 100') #------------------------------------------------------------------------------ DestroyFunc Move-or-Raise AddToFunc Move-or-Raise M Move + M Raise + C Raise + D Maximize 0 100 #------------------------------------------------------------------------------ # As above but double click shade #------------------------------------------------------------------------------ DestroyFunc Move-or-Raise-or-Shade AddToFunc Move-or-Raise-or-Shade M Move + M Raise + C Raise + D WindowShade #------------------------------------------------------------------------------ # This one moves and then lowers the window if you drag the mouse, # only lowers the window if you click, or does a RaiseLower if you double # click #------------------------------------------------------------------------------ DestroyFunc Move-or-Lower AddToFunc Move-or-Lower M Move + M Lower + C Lower + D RaiseLower #------------------------------------------------------------------------------ # This one moves or (de)iconifies: #------------------------------------------------------------------------------ DestroyFunc Move-or-Iconify-or-Raise AddToFunc Move-or-Iconify-or-Raise M Move + C Raise + D Iconify #------------------------------------------------------------------------------ # This one maximizes vertically if you click (leaving room for the taskbar # at the bottom, or does a full maximization if you double click, or a # true full vertical maximization if you just hold the mouse button down. #------------------------------------------------------------------------------ DestroyFunc Maximize-Func AddToFunc Maximize-Func M Maximize 0 98 + C Maximize 0 100 + D Maximize 100 98 #------------------------------------------------------------------------------ # This one resizes and then raises the window if you drag the mouse, # only raises the window if you click, or does shade if you double # click #------------------------------------------------------------------------------ DestroyFunc Resize-or-Raise-or-Shade AddToFunc Resize-or-Raise-or-Shade M Resize + M Raise + C Raise + D WindowShade #------------------------------------------------------------------------------ # This one focuses and then 'warps' to the window. #------------------------------------------------------------------------------ DestroyFunc FocusAndWarp AddToFunc FocusAndWarp I Focus + I WarpToWindow 1 1 #------------------------------------------------------------------------------ # Like the previous one, but de-iconifies first. #------------------------------------------------------------------------------ DestroyFunc DeiconifyFocusAndWarp AddToFunc DeiconifyFocusAndWarp I Iconify off + I FocusAndWarp #------------------------------------------------------------------------------ # Like the previous one, but only Raise. #------------------------------------------------------------------------------ DestroyFunc DeiconifyFocusAndRaise AddToFunc DeiconifyFocusAndRaise I Iconify off + I Focus + I Raise #------------------------------------------------------------------------------ # This one is used to modify some style for a window (almost obsolet) #------------------------------------------------------------------------------ DestroyFunc StyleAndRecapture AddToFunc StyleAndRecapture I Style "$0" $1 + I All ("$0") RecaptureWindow #------------------------------------------------------------------------------ # A really useful one: de-iconifies, warps to the window # or creates it if it doen't exist (often used with mailtools) #------------------------------------------------------------------------------ DestroyFunc WarpOrExec AddToFunc WarpOrExec I Next (AcceptsFocus $0) Iconify -1 + I Next (AcceptsFocus $0) FocusAndWarp + I None (AcceptsFocus $0) Exec $0 $1 #------------------------------------------------------------------------------ # For the left button #------------------------------------------------------------------------------ DestroyMenu "window_ops_func" AddToFunc "window_ops_func" "C" PopUp Window-Ops2 + "M" PopUp Window-Ops2 + "D" Delete #------------------------------------------------------------------------------ # Functions to restart Modules and Restart/Kill FvwmButtons by aliases #------------------------------------------------------------------------------ DestroyFunc RestartModule AddToFunc RestartModule + I KillModule $0 + I Module $0 DestroyFunc RestartModuleByAlias AddToFunc RestartModuleByAlias + I All ($2) Close + I Module $0 $1 # This function is for WMakerFvwmButtons (start or iconify id started) DestroyFunc MyPanelButtons AddToFunc MyPanelButtons + I All ($0) Iconify + I None (CirculateHit $0) FvwmButtons -g +$1+$2 $0 #------------------------------------------------------------------------------ # Functions for FvwmScript-BaseConfig #------------------------------------------------------------------------------ DestroyFunc BaseConfigOkFunc AddToFunc BaseConfigOkFunc I Read styles DestroyFunc BaseConfigApplyFunc AddToFunc BaseConfigApplyFunc I Read styles #------------------------------------------------------------------------------ # Functions which start and save state for FvwmAnimate, FvwmEvent, etc ... # $1 $2 is used only by FvwmAuto #------------------------------------------------------------------------------ DestroyFunc ModuleOn AddToFunc ModuleOn + I KillModule $0 + I Module $0 $1 $2 + I Exec echo "AddToFunc StartFunction I $0 $1 $2" > $FVWM_USERDIR/.start-$0 DestroyFunc ModuleOff AddToFunc ModuleOff + I KillModule $0 + I Exec echo "# Do not start $0" > $FVWM_USERDIR/.start-$0 #------------------------------------------------------------------------------ # Functions which start and save state for MiniButtons and WinMakerAppButtons #------------------------------------------------------------------------------ DestroyFunc ButtonsOn AddToFunc ButtonsOn + I All ($2) Close + I Module $0 $1 + I Exec echo "AddToFunc StartFunction I $0 $1" > $FVWM_USERDIR/.start-$1 DestroyFunc ButtonsOff AddToFunc ButtonsOff + I All ($1) Close + I Exec echo "# Do not start $0" > $FVWM_USERDIR/.start-$0 #------------------------------------------------------------------------------ # Functions for choosing the "Big" buttons Wharf or BarButtons #------------------------------------------------------------------------------ DestroyFunc ChangeButtonsOn AddToFunc ChangeButtonsOn + I All (BarButtons) Close + I KillModule FvwmWharf + I Exec echo "AddToFunc StartFunction I $0" > $FVWM_USERDIR/.start-FvwmButtons + I $0 DestroyFunc ChangeButtonsOff AddToFunc ChangeButtonsOff + I All (BarButtons) Close + I KillModule FvwmWharf + I Exec echo "# No Buttons Bar" > $FVWM_USERDIR/.start-FvwmButtons + I $0 #------------------------------------------------------------------------------ # Functions for Raising modules only #------------------------------------------------------------------------------ DestroyFunc StartModulesAutoRaise AddToFunc StartModulesAutoRaise + I Style FvwmDesker Lenience + I FvwmAuto 400 Silent ModulesAutoRaise + I Exec echo "AddToFunc StartFunction I StartModulesAutoRaise" > $FVWM_USERDIR/.start-FvwmAuto DestroyFunc ModulesAutoRaise AddToFunc ModulesAutoRaise + I Current (FvwmButtons) Raise + I Current (FvwmTaskBar) Raise + I Current (FvwmIconBox) Raise + I Current (FvwmDesker) Raise + I Current (FvwmIconMan) Raise + I Current (FvwmWinList) Raise + I Current (FvwmWharf) Raise + I Current (panel) Raise #------------------------------------------------------------------------------ # Functions which start and save a background #------------------------------------------------------------------------------ DestroyFunc SetBackground AddToFunc SetBackground + I KillModule FvwmBacker + I $0 + I Exec echo "AddToFunc StartFunction I $0" > $FVWM_USERDIR/.start-Background DestroyFunc SetBackgroundOff AddToFunc SetBackgroundOff + I KillModule FvwmBacker + I Exec echo "# Background disabled" > $FVWM_USERDIR/.start-Background #------------------------------------------------------------------------------ # Functions which start and defines which applications manager we use #------------------------------------------------------------------------------ DestroyFunc ChangeAppsMan AddToFunc ChangeAppsMan + I KillModule FvwmTaskBar + I KillModule FvwmWinList + I KillModule FvwmIconMan + I KillModule FvwmIconBox + I Exec echo "AddToFunc StartFunction I $0" > $FVWM_USERDIR/.start-apps-man + I $0 DestroyFunc AppsManNone AddToFunc AppsManNone + I Style * !Icon + I KillModule FvwmTaskBar + I KillModule FvwmWinList + I KillModule FvwmIconMan + I KillModule FvwmIconBox + I Exec echo "AddToFunc StartFunction I Style * !Icon # No applications Manager" > $FVWM_USERDIR/.start-apps-man DestroyFunc UseIcons AddToFunc UseIcons + I Style * Icon + I Read iconstyles # Need to reaload menus for KDE mini-icons styles + I Read menus + I KillModule FvwmTaskBar + I KillModule FvwmWinList + I KillModule FvwmIconMan + I KillModule FvwmIconBox + I Exec echo "# Use Icons" > $FVWM_USERDIR/.start-apps-man DestroyFunc WinListDesk AddToFunc WinListDesk + I Style * !Icon + I *FvwmWinList: ShowCurrentDesk + I Module FvwmWinList DestroyFunc WinListGlobal AddToFunc WinListGlobal + I Style * !Icon + I DestroyModuleConfig FvwmWinList: ShowCurrent* + I Module FvwmWinList DestroyFunc TaskBarDesk AddToFunc TaskBarDesk + I Style * !Icon + I DestroyModuleConfig FvwmTaskBar: AutoHid* + I *FvwmTaskBar: DeskOnly + I Module FvwmTaskBar DestroyFunc TaskBarGlobal AddToFunc TaskBarGlobal + I Style * !Icon + I DestroyModuleConfig FvwmTaskBar: AutoHid* + I DestroyModuleConfig FvwmTaskBar: Desk* + I Module FvwmTaskBar DestroyFunc TaskBarDeskAutoHide AddToFunc TaskBarDeskAutoHide + I Style * !Icon + I *FvwmTaskBar: DeskOnly + I *FvwmTaskBar: AutoHide + I Module FvwmTaskBar DestroyFunc TaskBarGlobalAutoHide AddToFunc TaskBarGlobalAutoHide + I Style * !Icon + I DestroyModuleConfig FvwmTaskBar: Desk* + I *FvwmTaskBar: AutoHide + I Module FvwmTaskBar DestroyFunc IconManGlobal AddToFunc IconManGlobal + I Style * !Icon + I *FvwmIconMan: Resolution global + I Module FvwmIconMan DestroyFunc IconManDesk AddToFunc IconManDesk + I Style * !Icon + I *FvwmIconMan: Resolution desk + I Module FvwmIconMan DestroyFunc IconManPage AddToFunc IconManPage + I Style * !Icon + I *FvwmIconMan: Resolution page + I Module FvwmIconMan DestroyFunc IconBoxDesk AddToFunc IconBoxDesk + I Style * !Icon + I *FvwmIconBox: ResolutionDesk + I Module FvwmIconBox DestroyFunc IconBoxGlobal AddToFunc IconBoxGlobal + I Style * !Icon + I DestroyModuleConfig FvwmIconBox: Reso* + I Module FvwmIconBox #------------------------------------------------------------------------------ # Functions for Layers #------------------------------------------------------------------------------ DestroyFunc SetLayers AddToFunc SetLayers + I StyleAndRecapture $n $0 + I Exec F=$FVWM_USERDIR; Z=$F/.fvwm-layers; T=$F/.tmp-layers; if grep -qe "$n" $Z; then sed -e "s/\ $n\ .*/\ $n\ $0/" $Z>$T; cat $T>$Z; else echo "Style $n $0" >>$Z; fi DestroyFunc DestroyLayers AddToFunc DestroyLayers + I StyleAndRecapture $n StaysPut + I Exec F=$FVWM_USERDIR; Z=$F/.fvwm-layers; T=$F/.tmp-layers; sed -e "/^Style\ $n\ .*/d" $Z>$T; cat $T>$Z #------------------------------------------------------------------------------ # Function for reloading the icons styles #------------------------------------------------------------------------------ DestroyFunc ReloadIconStylesAndMenus AddToFunc ReloadIconStylesAndMenus + I Read iconstyles + I Read menus # Need to reload the NoIcon style + I PipeRead 'if grep -qe AddToFunc $FVWM_USERDIR/.start-apps-man; then echo "Style * !Icon"; fi' #------------------------------------------------------------------------------ # Functions for Loading/Saving/Showing Settings #------------------------------------------------------------------------------ DestroyFunc SaveAsSettings AddToFunc SaveAsSettings + I Exec F=$FVWM_USERDIR;for i in ~/.xinitrc-fvwm $F/.FvwmBaseConfig $F/.FvwmAnimate $F/.FvwmForm $F/.start-Background $F/.start-apps-man $F/.start-FvwmButtons $F/.start-DeskerPanelButtons $F/.start-MiniButtons $F/.start-WinMakerAppButtons $F/.start-FvwmAnimate $F/.start-FvwmAuto $F/.start-FvwmBanner $F/.start-FvwmEvent $F/.fvwm-layers; do [ ! -f "$i" ] || /bin/cp $i $i-$0; done; DestroyFunc LoadSettings AddToFunc LoadSettings + I Exec F=$FVWM_USERDIR; for i in ~/.xinitrc-fvwm $F/.FvwmBaseConfig $F/.FvwmAnimate $F/.FvwmForm $F/.start-Background $F/.start-apps-man $F/.start-FvwmButtons $F/.start-DeskerPanelButtons $F/.start-MiniButtons $F/.start-WinMakerAppButtons $F/.start-FvwmAnimate $F/.start-FvwmAuto $F/.start-FvwmBanner $F/.start-FvwmEvent $F/.fvwm-layers; do [ ! -f "$i-$0" ] || /bin/cp $i-$0 $i; done; + I Exec [ ! -f ~/.xinitrc-fvwm-$0 ] || (xscreensaver-command -exit; ~/.xinitrc-fvwm-$0) + I PipeRead '[ ! -f $FVWM_USERDIR/.FvwmBaseConfig ] || (echo Read .FvwmBaseConfig; echo BaseConfigOkFunc)' + I Style * StaysPut + I Read .fvwm-layers-$0 + I KillModule FvwmAnimate + I KillModule FvwmAuto + I KillModule FvwmEvent + I KillModule FvwmButtons + I KillModule FvwmWharf + I KillModule FvwmTaskBar + I KillModule FvwmWinList + I KillModule FvwmIconMan + I KillModule FvwmIconBox + I PipeRead 'F=$FVWM_USERDIR; F=$FVWM_USERDIR; for i in $F/.start-Background $F/.start-apps-man $F/.start-FvwmButtons $F/.start-DeskerPanelButtons $F/.start-MiniButtons $F/.start-WinMakerAppButtons $F/.start-FvwmAnimate $F/.start-FvwmAuto $F/.start-FvwmBanner $F/.start-FvwmEvent; do [ ! -f "$i-$0" ] || sed -e s/AddToFunc\\.StartFunction\\.I\\.// $i-$0; done; if [ -f "$F/.start-apps-man-$0" ]; then if grep -qe Icons $F/.start-apps-man-$0; then echo "Style * Icon"; echo "Read iconstyles"; echo "Read menus"; fi; fi' DestroyFunc ShowFvwmSettings AddToFunc ShowFvwmSettings I Exec F=$FVWM_USERDIR;f=$F/.tmp-modules-setting; echo "" > $f; for j in 0 1 2 3 4; do if [ "$j" -eq "0" ]; then j=""; t="Current Setting:"; l="--------------"; else j="-$j"; t="Setting$j:"; l="---------"; fi; echo $t >> $f; echo $l >> $f; for i in $F/.start-Background $F/.start-apps-man $F/.start-FvwmButtons $F/.start-DeskerPanelButtons $F/.start-MiniButtons $F/.start-WinMakerAppButtons $F/.start-FvwmAnimate $F/.start-FvwmAuto $FVWM_USERDIR/.start-FvwmBanner $F/.start-FvwmEvent; do z="$i$j"; [ ! -f "$z" ] || sed -e s/^\\#\.// -e s/\.*exec/Background:/ -e s/AddToFunc\.StartFunction\.I/Start/ -e s/FvwmEvent/Sounds\ Effect/ $z >> $f; done; echo -n "Base Config: ">>$f; if [ -f $F/.FvwmBaseConfig$j ]; then echo "Used">>$f; else echo "Not Used">>$f; fi; echo "">>$f;done; xmessage -file $f DestroyFunc ShowXSettings AddToFunc ShowXSettings \ I Exec T=$FVWM_USERDIR/.tmp-x-set;u=~/.xinitrc-fvwm;echo "">$T;for j in 0 1 2 3 4;do if [ "$j" -eq "0" ];then z=$u;t="Current Setting:";else z="$u-$j";t="Setting-$j:";fi;echo $t >>$T;if grep -qe Bell $z;then grep -e "xset b" $z|sed -e s/xset\.b/Bell:/>>$T;fi;if grep -qe Screen $z;then echo -n "Background: ">>$T;if grep -qe \#xsetroot $z;then echo "disabled">>$T;elif grep -qe fvwm-root $z;then grep -e fvwm-root $z|sed -e s/xpmroot\.//>>$T;else grep -e xsetroot $z|sed -e s/xsetroot\.//>>$T;fi;grep -e "xset s" $z|sed -e s/xset\.s/xsaver:/>>$T;echo -n "DPMS: ">>$T;grep -e xset\.*dpms $z|sed -e s/xset\.-dpms/Off/ -e s/xset\.dpms/On/>>$T;echo -n "xscreensaver: ">>$T;if grep -qe \#xscreen $z;then echo "Off">>$T;else echo "On">>$T;fi;fi;if grep -qe Keyboard $z;then echo -n "Keyboard: ">>$T;grep -e "xset r" $z|sed -e s/xset\.r/auto\ repeat/ -e s/c/Vol/>>$T;fi;if grep -qe Pointer $z;then echo -n "Mouse: ">>$T;grep -e "xset m" $z|sed -e s/xset\.m//>>$T;fi;echo "">>$T;done;xmessage -file $T DestroyFunc ShowLayers AddToFunc ShowLayers I Exec F=$FVWM_USERDIR; T=$F/.tmp-layers; echo -e "A StaysOnTop window is a window which is above \nthe normal (i.e., StaysPut) windows, a StaysOnBottom\nwindow is below the normal windows. Here the list\nof StaysOnTop and StaysOnBottom windows:\n"> $T; u=$F/.fvwm-layers; for j in 0 1 2 3 4; do if [ "$j" -eq "0" ];then z=$u; t="Current Setting:"; l="---------------"; else z="$u-$j"; t="Setting-$j:"; l="----------"; fi; echo $t >>$T; echo $l >>$T; [ ! -f $z ] || cat $z>>$T; echo "" >> $T; done; xmessage -file $T #SEG bindings #-----------------------------------------------------------------------------# # # 9. Mouse, frame buttons and keyboard bindings # #-----------------------------------------------------------------------------# #------------------------------------------------------------------------------ # First, for the mouse in the root window (Context=R) # Button 1 gives the Utilities menu # Button 2 gives the Window Ops menu # Button 3 gives the WindowList (like TwmWindows) # I use the AnyModifier (A) option for the modifier field, so you can hold down # any Shift-Ctrl-whatever combination you want! # Moreover on a window the same bindings are defined with the Alt modifier #------------------------------------------------------------------------------ # Button Context Modifi Function Mouse 1 R A Menu Utilities mouse -1p -1p Mouse 2 R A Menu Window mouse -1p -1p Mouse 3 R A WindowList mouse -1p -1p Mouse 3 R C WindowList mouse -1p -1p OnlyListSkip Mouse 1 W M Menu Utilities mouse -1p -1p Mouse 2 W M Menu Window mouse -1p -1p Mouse 3 W M WindowList mouse -1p -1p Mouse 3 W CM WindowList mouse -1p -1p OnlyListSkip #G_SESSION 3 bind Shift Mouse * to gnomebutton #Mouse 1 R S GnomeButton #Mouse 2 R S GnomeButton #Mouse 3 R S GnomeButton #------------------------------------------------------------------------------ # Now the rest of the frame # Here I invoke my complex functions for Move-or-lower, Move-or-Raise-Shade, # and Resize-or-Raise. #------------------------------------------------------------------------------ # Button 1 in the corners or sides, with any modifiers, gives resize or raise Mouse 1 FS A Function "Resize-or-Raise-or-Shade" # Button 1 in the title, sides, w/ any modifiers, gives move or raise or shade Mouse 1 T A Function "Move-or-Raise-or-Shade" Mouse 1 FS C Function "Move-or-Raise-or-Shade" # Button 1 in an icons gives move for a drag, de-iconify for a double-click, # raiselower for a single click Mouse 1 I A Function "Move-or-Iconify-or-Raise" # Alt Button 1 on an icons raise all icons Mouse 1 I M All (CurrentPage Iconic) Raise # Button 2 in an icon, w/ any modifiers, gives de-iconify Mouse 2 I A Iconify # Button 2 in the corners, sides, or title-bar gives the window ops menu Mouse 2 FST A Menu Window-Ops2 # Button 3 anywhere in the decoration (except the title-bar buttons) # does a raise-lower Mouse 3 TSF A RaiseLower # Button 3 on a icon: Mouse 3 I A Menu Window-Ops3 c+0 -101m # Button 3 in the window, with the Modifier-1 key (usually alt or diamond) # gives Raise-Lower. Used to use control here, but that interferes with xterm Mouse 3 W SM RaiseLower #----------------------------------------------------------------------------- # Mouse windows buttons binding # buttons: 1 3 5 7 9 8 6 4 2 #------------------------------------------------------------------------------ # Button Context Modif Function Mouse 1 1 A Function "window_ops_func" Mouse 2 1 A Menu WindowGroupOps Mouse 3 1 A Menu Move-Window Mouse 1 2 A Close Mouse 2 2 A All ($c) Close Mouse 3 2 A Destroy Mouse 1 4 A Maximize 100 100 Mouse 2 4 A Maximize 0 100 Mouse 3 4 A Maximize 100 0 Mouse 1 6 A Iconify Mouse 2 6 A All ($c) Iconify On Mouse 3 6 A All ($c) WindowShade On #------------------------------------------------------------------------------ # Now some keyboard shortcuts. #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # press arrow + Shift anywhere, and scroll by 1 page #------------------------------------------------------------------------------ Key Left A S Scroll -100 0 Key Right A S Scroll +100 +0 Key Up A S Scroll +0 -100 Key Down A S Scroll +0 +100 #------------------------------------------------------------------------------ # press arrow + Alt key, and scroll by 1/10 of a page #------------------------------------------------------------------------------ Key Left A M Scroll -10 +0 Key Right A M Scroll +10 +0 Key Up A M Scroll +0 -10 Key Down A M Scroll +0 +10 #------------------------------------------------------------------------------ # press arrow + control-meta anywhere, and move the pointer by 1% of a page #------------------------------------------------------------------------------ Key Left A MC CursorMove -1 0 Key Right A MC CursorMove +1 +0 Key Up A MC CursorMove +0 -1 Key Down A MC CursorMove +0 +1 #------------------------------------------------------------------------------ # press arrow + Shift-Alt key, and move the pointer by 1/10 of a page #------------------------------------------------------------------------------ Key Left A SM CursorMove -10 +0 Key Right A SM CursorMove +10 +0 Key Up A SM CursorMove +0 -10 Key Down A SM CursorMove +0 +10 #------------------------------------------------------------------------------ # Page Up/Page Down keys are used to scroll by one desktop page # in any context, press page up/down + control + alt # in root context, just pressing page up/down is OK #------------------------------------------------------------------------------ Key Next A CM Desk -1 0 0 3 Key Next R M Desk -1 0 0 3 Key Prior A CM Desk +1 0 0 3 Key Prior R M Desk +1 0 0 3 #------------------------------------------------------------------------------ # Alt-Shift-Fx window operations #------------------------------------------------------------------------------ Key F4 A MS Close Key F5 A MS RaiseLower Key F6 A MS All (Iconic) Raise # originally Restore Key F7 A MS Move Key F8 A MS Resize Key F9 A MS Iconify Key F10 A MS Maximize 100 100 Key F11 A MS FvwmIdent Key F12 A MS FvwmConsole #------------------------------------------------------------------------------ # The menus via Alt-Shift-Fx #------------------------------------------------------------------------------ Key F1 A MS Menu Utilities mouse -1p -1p Key F2 A MS Menu Window mouse -1p -1p Key F3 A MS WindowList mouse -1p -1p #------------------------------------------------------------------------------ # The famous Alt-tab binding #------------------------------------------------------------------------------ DestroyFunc my_dbltab2 AddToFunc my_dbltab2 + I WindowListFunc DestroyFunc my_dbltab_prev AddToFunc my_dbltab_prev + I Prev my_dbltab2 Key Tab A M WindowList Root c c CurrentAtEnd, IconifiedAtEnd, NoGeometry, NoDeskSort, SelectOnRelease Alt_L my_dbltab_prev Key Tab A CM WindowList Root c c CurrentAtEnd, IconifiedAtEnd, NoGeometry, OnlyListSkip, SelectOnRelease #------------------------------------------------------------------------------ # Stroke Bindings #------------------------------------------------------------------------------ # # You need fvwm compiled with stroke support and libstroke installed # See the Stroke and StrokeFunc entries in the fvwm man page # We use mostly simple stroke motion. For complex stroke motions we need # to consider many sloppy stroke motions for each action. #STROKE 2 #Mouse 3 R N StrokeFunc FeedBack DrawMotion #Mouse 3 W M StrokeFunc FeedBack DrawMotion #STROKE 2 We need to redefine the default bindings #Stroke 0 0 R N WindowList mouse -1p -1p #Stroke 0 0 W M WindowList mouse -1p -1p #PREF 11 #STROKE 2 A | from the top to the bottom #Stroke N852 0 R N Exec exec xterm #Stroke N852 0 W M Exec exec xterm #STROKE 2 A | from the bottom to the top #Stroke N258 0 R N Exec exec emacs #Stroke N258 0 W M Exec exec emacs #STROKE 2 A / from the bottom to the top #Stroke N159 0 R N Exec exec xfm #Stroke N159 0 W M Exec exec xfm #STROKE 2 A C from the top #Stroke N9874123 0 R N Exec exec xcalc #Stroke N9874123 0 W M Exec exec xcalc #STROKE 11 A N (from the bottom) #Stroke 7415963 0 R N Exec exec mozilla #Stroke 74148963 0 R N Exec exec mozilla #Stroke 74158963 0 R N Exec exec mozilla #Stroke 7418963 0 R N Exec exec mozilla #Stroke 415963 0 R N Exec exec mozilla # #Stroke 7415963 0 W M Exec exec mozilla #Stroke 74148963 0 W M Exec exec mozilla #Stroke 74158963 0 W M Exec exec mozilla #Stroke 7418963 0 W M Exec exec mozilla #Stroke 415963 0 W M Exec exec mozilla #STROKE 4 A clockwise box from the top left #Stroke N78963214 0 R N FvwmForm FvwmForm-QuitVerify #Stroke N789632147 0 R N FvwmForm FvwmForm-QuitVerify #Stroke N78963214 0 W M FvwmForm FvwmForm-QuitVerify #Stroke N789632147 0 W M FvwmForm FvwmForm-QuitVerify #SEG menus #-----------------------------------------------------------------------------# # # 10. Now define the menus # #-----------------------------------------------------------------------------# #------------------------------------------------------------------------------ #--------- Taskbar's start menu #------------------------------------------------------------------------------ DestroyMenu StartMenu AddToMenu StartMenu@side.fvwm2.xpm@^black^ + "&Shells%shells.xpm%" Popup Shells + "&Programs%programs.xpm%" Popup Programs + "&Documents%documents.xpm%" Popup Documents + "&Settings%settings.xpm%" Popup Settings + "" Nop Test (f /etc/X11/fvwm/DebianMenu) + "&Debian Menu%programs.xpm%" Popup /Debian + "&Module%modules.xpm%" Popup Module-Popup + "&Find%find1.xpm%" FvwmScript FvwmScript-Find + "&Help%help.xpm%" Exec exec xman #PREF 1 + "&Run...%run.xpm%" Exec exec xterm + "" Nop + "&Screen Saver%screen.xpm%" Popup Screen + "Shut &Down%shutdown.xpm%" Module FvwmScript FvwmScript-Quit #------------------------------------------------------------------------------ # Root Menu: This menu will fire up some very common utilities #------------------------------------------------------------------------------ DestroyMenu Utilities AddToMenu Utilities "Root Menu" Title #PREF 3 + "&Terminal%mini.term.xpm%" Exec exec xterm + "&Editor%mini.edit.xpm%" Exec exec emacs + "&File Manager%mini.filemgr.xpm%" Exec exec xfm + "&Top%mini.run.xpm%" Exec exec xterm -geometry 80x40 -T Top -n Top -e top + "" Nop + "&Shells%mini.term.xpm%" Popup Shells + "&Programs%mini.start.xpm%" Popup Programs + "" Nop + "Fvwm &Modules%mini.modules.xpm%" Popup Module-Popup + "&Settings%mini.desktop.xpm%" Popup Settings + "&Documents%mini.books.xpm%" Popup Documents + "&Screen Saver%mini.display.xpm%" Popup Screen + "" Nop + "&Restart%mini.turn.xpm%" Popup Restart + "&Quit fvwm%mini.stop.xpm%" FvwmForm FvwmForm-QuitVerify DestroyFunc SetDebianMenu AddToFunc SetDebianMenu + I Read /etc/X11/fvwm/DebianMenu + I DestroyMenu Utilities + I AddToMenu Utilities "Root Menu" Title #PREF 3 + I + "&Terminal%mini.term.xpm%" Exec exec x-terminal-emulator + I + "&Editor%mini.edit.xpm" Exec exec emacs + I + "&File Manager%mini.filemgr.xpm%" Exec exec xfm + I + "&Top%mini.run.xpm%" Exec exec xterm -geometry 80x40 -T Top -n Top -e top + I + "" Nop + I + "&Shells%mini.term.xpm" Popup /Debian/XShells + I + "&Programs%mini.start.xpm%" Popup /Debian/Apps + I + "" Nop + I + "&Fvwm Modules%mini.modules.xpm%" Popup Module-Popup + I + "&Settings%mini.desktop.xpm%" Popup Settings + I + "&Documents%mini.books.xpm%" Popup Documents + I + "&Help%mini.book1.xpm%" Popup /Debian/Help + I + "&Screen Saver%mini.display.xpm%" Popup /Debian/Screen + I + "" Nop + I + "&Window Managers%mini.x2.xpm%" Popup /Debian/WindowManagers + I + "&Restart%mini.turn.xpm%" Restart + I + "&Quit fvwm%mini.stop.xpm%" FvwmForm FvwmForm-QuitVerify Test (f /etc/X11/fvwm/DebianMenu) SetDebianMenu #------------------------------------------------------------------------------ #--------- SHELLS #------------------------------------------------------------------------------ DestroyMenu Shells AddToMenu Shells + "&Xterm default%mini.term.xpm%" Exec exec xterm + "Xterm/&root default%mini.term.xpm%" Exec exec xterm -fg violet -bg black -e su -l + "&NXterm default%mini.term.xpm%" Exec exec nxterm + "&Rxvt default%mini.term.xpm%" Exec exec rxvt + "&Eterm default%mini.term.xpm%" Exec exec Eterm + "X&iterm default%mini.term.xpm%" Exec exec xiterm + "&Aterm default%mini.term.xpm%" Exec exec aterm + "&GNOME Term default%mini.term.xpm%" Exec exec gnome-terminal + "&Konsole default%mini.term.xpm%" Exec exec konsole + "&Kvt default%mini.term.xpm%" Exec exec kvt + "&Dtterm default%mini.term.xpm%" Exec exec /usr/bin/dtterm + "" Nop + "&Xterm 80x40 (7x14 font)%mini.term.xpm%" Exec exec xterm -n $USER@$HOST -T $USER@$HOST -g 80x40 -sb +sk +si -sl 4096 -j -ls -fn 7x14 -fb 7x14bold + "Xterm/r&oot 80x40 (7x14 font)%mini.term.xpm%" Exec exec xterm -n root@$HOST -T root@$HOST -g 80x40 -sb +sk +si -sl 4096 -j -ls -fn 7x14 -fb 7x14bold -fg violet -bg black -e su -l + "&NXterm 80x40 (7x14 font)%mini.term.xpm%" Exec exec nxterm -n $USER@$HOST -T $USER@$HOST -g 80x40 -sb +sk +si -sl 4096 -j -ls -fn 7x14 -fb 7x14bold + "&Rxvt 80x40 (7x14 font)%mini.term.xpm%" Exec exec rxvt -n $USER@$HOST -T $USER@$HOST -g 80x40 --loginShell -fn 7x14 -fb 7x14bold + "&Eterm 80x40 (7x14 font)%mini.term.xpm%" Exec exec Eterm -n $USER@$HOST -T $USER@$HOST -g 80x40 --login-shell --font 7x14 --bold-font 7x14bold + "X&iterm 80x40 (7x14 font)%mini.term.xpm%" Exec exec xiterm -n $USER@$HOST -T $USER@$HOST -g 80x40 -sb +sk +si -sl 4096 -ls -fn 7x14 -fb 7x14bold + "&Aterm 80x40 (7x14 font)%mini.term.xpm%" Exec exec aterm -n $USER@$HOST -T $USER@$HOST -g 80x40 -sb +sk +si -sl 4096 -ls -fn 7x14 -fb 7x14bold + "&GNOME Term 80x40 (7x14 font)%mini.term.xpm%" Exec exec gnome-terminal --title=$USER@$HOST --geometry=80x40 --login --font=7x14 + "&Kvt 80x40 (7x14 font)%mini.term.xpm%" Exec exec kvt -n $USER@$HOST -T $USER@$HOST -vt_geometry 80x40 -sl 4096 -ls -vt_font 7x14 + "&Konsole 80x40%mini.term.xpm%" Exec exec konsole -nowelcome -sl 4096 -ls -vt_sz 80x40 + "&Dtterm 80x40 (7x14 font)%mini.term.xpm%" Exec exec /usr/dt/bin/dtterm -n $USER@$HOST -T $USER@$HOST -sl 4096 -ls -g 80x40 -fn 7x14 -fb 7x14bold + "" Nop + "Remote &login ...%mini.connect.xpm%" FvwmForm FvwmForm-Rlogin #------------------------------------------------------------------------------ #--------- Programs #------------------------------------------------------------------------------ DestroyMenu Programs AddToMenu Programs #G_SM_G 2 # AddToMenu Programs "&GNOME Menu%mini.gnome.xpm%" SendToModule FvwmGtk gnome-sys #+ "" Nop #G_SM_F 2 #AddToMenu Programs "&GNOME Menu%mini.gnome.xpm%" Popup gnome-sys #+ "" Nop #G_UM_G 2 #AddToMenu Programs "GNOME &User%mini.gnome.xpm%" SendToModule FvwmGtk gnome-user #+ "" Nop #G_UM_F 2 #AddToMenu Programs "GNOME &User%mini.gnome.xpm%" Popup gnome-user #+ "" Nop #G_RHM_G 2 #AddToMenu Programs "GNOME &RedHat%mini.gnome.xpm%" SendToModule FvwmGtk gnome-redhat #+ "" Nop #G_RHM_F 2 #AddToMenu Programs "GNOME &RedHat%mini.gnome.xpm%" Popup gnome-redhat #+ "" Nop #K_SM 2 #AddToMenu Programs "&KDE Menu%mini.kde.xpm" Popup kde-sys #+ "" Nop #K_UM 2 #AddToMenu Programs "KDE &User%mini.kde.xpm" Popup kde-user #+ "" Nop #CDE 2 #AddToMenu Programs "&CDE Menu%mini.folder.xpm" Popup cde-menu #+ "" Nop AddToMenu Programs + "&Accessories%mini.hammer.xpm%" Popup Accessories + "&Applications%mini.pencil.xpm%" Popup Applications + "&Science%mini.question.xpm%" Popup Science + "&System%mini.filemgr.xpm%" Popup System + "&Editors%mini.edit.xpm%" Popup Editors + "&Network%mini.telnet.xpm%" Popup Network + "&Internet%mini.connect.xpm%" Popup Internet + "&Graphics%mini.paint.xpm%" Popup Graphics + "&Multimedia%mini.cd.xpm%" Popup Multimedia + "&Games%mini.happy.xpm%" Popup Games #------------------------------------------------------------------------------ #--------- KDE, CDE & GNOME "fvwm" menus # For more informtion man fvwm-menu-desktop #K_SM 1 #PipeRead 'fvwm-menu-desktop --desktop kde-sys --enable-mini-icons --enable-style' #K_UM 1 #PipeRead 'fvwm-menu-desktop --desktop kde-user --enable-mini-icons' #G_SM_F 1 #PipeRead 'fvwm-menu-desktop --desktop gnome-sys --type fvwm --install-prefix /usr --enable-mini-icons --mini-icons-path '' --icon-toptitle :no::: --icon-title :no::: --icon-folder mini.folder.xpm:ow::: --icon-app mini.gnome.xpm:ow:::' #G_UM_F 1 #PipeRead 'fvwm-menu-desktop --desktop gnome-user --type fvwm --enable-mini-icons --mini-icons-path '' --icon-toptitle :no::: --icon-title :no::: --icon-folder mini.folder.xpm:ow::: --icon-app mini.doc.xpm:ow:::' #G_RHM_F 1 #PipeRead 'fvwm-menu-desktop --desktop gnome-redhat --type fvwm --enable-mini-icons --mini-icons-path '' --icon-toptitle :no::: --icon-title :no::: --icon-folder mini.folder.xpm:ow::: --icon-app mini.ball2.xpm:ow:::' #CDE 17 #DestroyMenu cde-menu #AddToMenu cde-menu #+ "&Applications Manager%mini.programs.xpm%" Exec exec /usr/dt/bin/dtaction Dtappmgr #+ "&Terminal%mini.term.xpm%" Exec exec /usr/dt/bin/dtterm #+ "&File Manager%mini.filemgr.xpm%" Exec exec /usr/dt/bin/dtfile #+ "&Trash Can%mini.paper.xpm%" Exec exec /usr/dt/bin/dtaction Dttrash #+ "Text &Editor%mini.edit.xpm%" Exec exec /usr/dt/bin/dtpad #+ "Desktop &Help%mini.book1.xpm%" Exec exec /usr/dt/bin/dthelpview -helpVolume browser #+ "Man Pages%mini.book1.xpm%" Exec exec /usr/dt/bin/dthelpview -man #+ "&Mailer%mini.mail.xpm%" Exec exec /usr/dt/bin/dtmail #+ "&Calandar%mini.calandar.xpm%" Exec exec /usr/dt/bin/dtcm #+ "&Calculator%mini.calc.xpm%" Exec exec /usr/dt/bin/dtcalc #+ "&Icon Editor%mini.palette.xpm%" Exec exec /usr/dt/bin/dticon #+ "&Print Manager%mini.fax.xpm%" Exec exec /usr/dt/bin/dtprintinfo #+ "&Styles Manager%mini.hammer.xpm%" Exec exec /usr/dt/bin/dtstyle #+ "" Nop #+ "&Exit CDE%mini.stop.xpm%" Exec exec /usr/dt/bin/dtaction ExitSession #------------------------------------------------------------------------------ #--------- Accessories DestroyMenu Accessories AddToMenu Accessories + "&Calculator%mini.calc.xpm%" Exec exec xcalc + "&Magnifying glass%mini.zoom.xpm%" Exec exec xmag + "&Font viewer%mini.font.xpm%" Exec exec xfontsel + "&Xdaliclock%mini.clock.xpm%" Exec exec xdaliclock + "X&clock%mini.clock.xpm%" Exec exec xclock + "&Rclock%mini.clock.xpm%" Exec exec rclock + "x&apm%mini.connect.xpm%" Exec exec xapm + "&View colormap%mini.colors.xpm%" Exec exec xcolormap + "&Color viewer%mini.colors.xpm%" Exec exec xcolorsel + "&Capture Form%mini.camera.xpm%" FvwmForm FvwmForm-Capture + "&Screen Dump Script%mini.camera.xpm%" FvwmScript FvwmScript-ScreenDump + "X&grab%mini.camera.xpm%" Exec exec xgrab + "&Ddd%mini.bug2.xpm%" Exec exec ddd + "Xx&gdb%mini.bug2.xpm%" Exec exec xxgdb + "&Xclipboard%mini.clipboard.xpm%" Exec exec xclipboard #------------------------------------------------------------------------------ #--------- Applications DestroyMenu Applications AddToMenu Applications + "&Lyx%mini.edit.xpm%" Exec exec lyx + "&Thot%mini.edit.xpm%" Exec exec thot + "&Ghostview (Postscript)%mini.gv.xpm%" Exec exec ghostview + "&GV (Postscript)%mini.gv.xpm%" Exec exec gv + "X&dvi%mini.zoom.xpm%" Exec exec xdvi + "&Acroread (PDF)%mini.pdf.xpm%" Exec exec acroread + "&Xpdf (PDF)%mini.pdf.xpm%" Exec exec xpdf + "&Plan%mini.doc1.xpm%" Exec exec plan #------------------------------------------------------------------------------ #--------- Science DestroyMenu Science AddToMenu Science + "Thx-1138%mini.calc.xpm%" Exec exec thx-1138 + "GNU &plot%mini.graph.xpm%" Exec exec xterm -T GNUplot -name GNUplot -e gnuplot + "&SCILAB%mini.zoom.xpm%" Exec exec scilab + "&Maple%mini.graph2.xpm%" Exec exec xmaple + "&Mathematica%mini.graph2.xpm%" Exec exec mathematica + "&Xaos%mini.fractal.xpm%" Exec exec xaos + "&Fractint%mini.fractal.xpm%" Exec exec xterm -font 7x14 -e xfractint + "X&ephem%mini.exp.xpm%" Exec exec xephem + "X&tide%mini.exp.xpm%" Exec exec xtide #------------------------------------------------------------------------------ #--------- System DestroyMenu System AddToMenu System + "&Running processes%mini.run.xpm%" Exec exec xterm -g 80x40 -e top + "&TK processes%mini.hex.xpm%" Exec exec tkps + "&System load%mini.perf.xpm%" Exec exec xload + "&Xosview%mini.run.xpm%" Exec exec xosview + "&Memory usage%mini.perf.xpm%" Exec exec xmem + "&XSysStats%mini.run.xpm%" Exec exec XSysStats + "&xconsole%mini.term.xpm%" Exec exec xconsole + "Set &Date Script%mini.clock.xpm%" FvwmScript FvwmScript-Date + "" Nop + "&Midnight-Commander%mini.filemgr.xpm%" Exec exec xterm -g 80x40 -n Midnight-Commander -T Midnight-Commander -e mc -x + "X&fm%mini.filemgr.xpm%" Exec exec xfm + "File &Runer%mini.filemgr.xpm%" Exec exec fr + "&kfm%mini.filemgr.xpm%" Exec exec kfmclient openURL $HOME + "&gmc%mini.filemgr.xpm%" Exec exec gmc #------------------------------------------------------------------------------ #--------- Editors DestroyMenu Editors AddToMenu Editors + "&Emacs%mini.edit.xpm%" Exec exec emacs + "&XEmacs%mini.edit.xpm%" Exec exec xemacs + "&Gvim%mini.edit.xpm%" Exec exec gvim + "&Nedit%mini.edit.xpm%" Exec exec nedit + "&Xedit%mini.edit.xpm%" Exec exec xedit #------------------------------------------------------------------------------ #--------- Network DestroyMenu Network AddToMenu Network + "&Rlogin%mini.connect.xpm%" Module FvwmForm FvwmForm-Rlogin + "&Vppp%mini.connect.xpm%" Exec exec vppp + "&Ezppp%mini.connect.xpm%" Exec exec ezppp + "&Hifs%mini.eyes.xpm%" Exec exec xterm -ls -bg #c0c0c0 -fg black -T Hifs -name Hifs -geometry 26x24 -e hifs #------------------------------------------------------------------------------ #--------- Internet DestroyMenu Internet AddToMenu Internet + "&Mozilla%mini.nscape.xpm%" Exec exec mozilla + "&Netscape%mini.nscape.xpm%" Exec exec netscape + "&Amaya%mini.nscape.xpm%" Exec exec amaya + "&Lynx%mini.cat.xpm%" Exec exec xterm -g 80x30 -n lynx -T lynx -e lynx + "" Nop #!E mail:pine:mutt:elm + "Xfmail%mini.mail.xpm%" Exec exec xfmail + "&Xmh%mini.mail.xpm%" Exec exec xmh + "&Mail%mini.mail.xpm%" Exec exec xterm -g 80x30 -n Mail -T Mail -e mail + "&Pine%mini.mail.xpm%" Exec exec xterm -g 80x30 -n Pine -T Pine -e pine + "&Mutt%mini.mail.xpm%" Exec exec xterm -g 80x30 -n Mutt -T Mutt -e mutt + "&Elm%mini.mail.xpm%" Exec exec xterm -g 80x30 -n Elm -T Elm -e elm + "" Nop #!E ncftp:xftp:irc:tkirc:licq:zircon:xgropher:xtel + "Nc&FTP%mini.ftp.xpm%" Exec exec xterm -g 80x30 -n NcFtp -T FTP -e ncftp + "&Xftp%mini.ftp.xpm%" Exec exec xftp + "X-&Chat%mini.doc1.xpm%" Exec exec xchat + "Irc%mini.doc1.xpm%" Exec exec xterm -g 80x30 -n Irc -T Trc -e irc + "Tkirc%mini.doc1.xpm%" Exec exec tkirc + "Lirc%mini.doc1.xpm%" Exec exec licq + "&Zircon%mini.zircon.xpm%" Exec exec zircon + "X&Gopher%mini.gopher.xpm%" Exec exec xgopher + "Minitel%mini.xterm.xpm%" Exec exec xtel -petit #------------------------------------------------------------------------------ #--------- Graphics DestroyMenu Graphics AddToMenu Graphics + "The &Gimp%mini.gimp.xpm%" Exec exec gimp + "&XPaint%mini.palette.xpm%" Exec exec xpaint + "X&fig%mini.xfig.xpm%" Exec exec xfig + "X&Fpovray%mini.ray.xpm%" Exec exec xfpovray + "" Nop #!E xv:xbmbrowser:ee + "&XV%mini.xv.xpm%" Exec exec xv + "Xbm&Browser%mini.directory.xpm%" Exec exec xbmbrowser + "&EE%mini.palette.xpm%" Exec exec ee #------------------------------------------------------------------------------ #--------- Multimedia DestroyMenu Multimedia AddToMenu Multimedia + "&CD player%mini.cdlabel.xpm%" Exec exec xplaycd + "X&mixer%mini.audiovol.xpm%" Exec exec xmixer + "X<wav%mini.sound.xpm%" Exec exec xltwavplay + "FreeAmp%mini.sound.xpm%" Exec exec freeamp + "MiXViews%mini.sound.xpm%" Exec exec mxv #------------------------------------------------------------------------------ #--------- Games and amusements DestroyMenu Games AddToMenu Games + "&Maze%mini.maze.xpm%" Exec exec maze + "&Spider%mini.espada.xpm%" Exec exec spider + "&Chess%mini.slon.xpm%" Exec exec xboard + "&XGammon%mini.go.xpm%" Exec exec xgammon + "X&lander%mini.xlander.xpm%" Exec exec xlander + "X&mahjongg%mini.xmahjongg.xpm%" Exec exec xmahjongg + "X&Sokoban%mini.go.xpm%" Exec exec xsokoban + "X&jewel%mini.xjewel.xpm%" Exec exec xjewel + "&Hextris%mini.hextris.xpm%" Exec exec hextris + "&Maelstrom%mini.destroy.xpm%" Exec exec Maelstrom + "Koules%mini.happy.xpm%" Exec exec xkoules + "Quake%mini.destroy.xpm%" Exec cd /usr/local/games/quake/ ; exec ./stquake + "Quake2%mini.destroy.xpm%" Exec cd /usr/local/games/quake2/ ; exec ./quake2 +set vid_ref softx + "" Nop + "&Amusements%mini.happy.xpm%" Popup Amusements DestroyMenu Amusements AddToMenu Amusements + "&Eyes%mini.eyes.xpm%" Exec exec xeyes + "&X logo%mini.bx2.xpm%" Exec exec xlogo + "X&roach%mini.roach.xpm%" Exec exec xroach + "X&snow%mini.xsnow.xpm%" Exec exec xsnow + "&Stop Xsnow%mini.xsnow.xpm%" Exec exec killall xsnow + "&Desktop cat%mini.cat.xpm%" Exec exec xcat #------------------------------------------------------------------------------ #--------- Modules #------------------------------------------------------------------------------ DestroyMenu Module-Popup AddToMenu Module-Popup + "&Autoraise%mini.raise.xpm%" RestartModule FvwmAuto 500 + "A&nimate%mini.iconify.xpm%" RestartModule FvwmAnimate + "&Backer%mini.rainbow.xpm%" RestartModule FvwmBacker + "B&anner%mini.ray.xpm%" RestartModule FvwmBanner + "B&uttons Bar%mini.pencil.xpm%" RestartModuleByAlias FvwmButtons BarButtons BarButtons + "&Mini button bar%mini.pencil.xpm%" RestartModuleByAlias FvwmButtons MiniButtons MiniButtons + "&WMaker buttons%mini.pencil.xpm%" RestartModuleByAlias FvwmButtons WinMakerAppButtons WinMakerApp* + "&Console%mini.xterm.xpm%" Module FvwmConsole -sb + "&Debug%mini.bug2.xpm%" RestartModule FvwmDebug + "&IconBox%mini.icons.xpm%" RestartModule FvwmIconBox + "I&conMan%mini.run.xpm%" RestartModule FvwmIconMan + "Identif&y%mini.question.xpm%" RestartModule FvwmIdent + "Desker &Panel%mini.pager.xpm%" RestartModuleByAlias FvwmButtons DeskerPanelButtons DeskerPanelButtons + "Sound &effect%mini.sound.xpm%" RestartModule FvwmEvent + "&Talk to Fvwm%mini.telnet.xpm%" FvwmForm FvwmForm-Talk + "Task&Bar%mini.exp.xpm%" RestartModule FvwmTaskBar + "Window &List%mini.windows.xpm%" RestartModule FvwmWinList + "&Wharf%mini.pencil.xpm%" RestartModule FvwmWharf + "" Nop + "&Kill Modules%mini.bomb.xpm%" Popup Kill-Module-Popup DestroyMenu Kill-Module-Popup AddToMenu Kill-Module-Popup + "&Autoraise%mini.raise.xpm%" KillModule FvwmAuto + "A&nimate%mini.iconify.xpm%" KillModule FvwmAnimate + "&Backer%mini.rainbow.xpm%" KillModule FvwmBacker + "B&anner%mini.ray.xpm%" KillModule FvwmBanner + "B&utton bar%mini.pencil.xpm%" All (BarButtons) Close + "&Mini button bar%mini.pencil.xpm%" All (MiniButtons) Close + "&WMaker buttons%mini.pencil.xpm%" All (WinMakerApp*) Close + "&Console%mini.xterm.xpm%" KillModule FvwmConsole + "&Debug%mini.bug2.xpm%" KillModule FvwmDebug + "&IconBox%mini.icons.xpm%" KillModule FvwmIconBox + "I&conMan%mini.run.xpm%" KillModule FvwmIconMan + "Identif&y%mini.question.xpm%" KillModule FvwmIdent + "Desker &Panel%mini.pager.xpm%" All (DeskerPanelButtons) Close + "Sound &effect%mini.sound.xpm%" KillModule FvwmEvent + "&Talk%mini.telnet.xpm%" All (FvwmForm-Talk) Close + "Task&Bar%mini.exp.xpm%" KillModule FvwmTaskBar + "Window &List%mini.windows.xpm%" KillModule FvwmWinList + "&Wharf%mini.pencil.xpm%" KillModule FvwmWharf #------------------------------------------------------------------------------ #--------- Settings #------------------------------------------------------------------------------ DestroyMenu Settings AddToMenu Settings + "&Configuration%mini.fvwm.xpm%" Popup FvwmConfig + "&Animation%mini.iconify.xpm%" Popup Animate-Settings + "Applications &Managers%mini.windows.xpm%" Popup AppsManager + "Auto&Raise%mini.raise.xpm%" Popup AutoRaise-Settings + "Back&ground%mini.display.xpm%" Popup Background-Settings + "&Banner%mini.ray.xpm%" Popup Banner-Settings + "B&uttons Bar%mini.pencil.xpm%" Popup Buttons-Settings + "&Mini Buttons%mini.pencil.xpm%" Popup MiniButtons-Settings + "Desker &Panel%mini.pager.xpm%" Popup DeskerPanel-settings + "S&ounds Effect%mini.audiovol.xpm%" Popup Sound-Settings + "&WMaker Applets%mini.pencil.xpm%" Popup WinMakerApp-Settings + "Set &Layers%mini.windows.xpm%" Popup Layers-Settings + "&X Setup Scripts%mini.x.xpm%" Popup XsetupScripts + "&Show/Load/Save Settings%mini.turn.xpm%" Popup Load-Settings + "" Nop + "&Edit .fvwm2rc%mini.edit.xpm%" Popup Edit-Config + "Reload .fvwm2rc%mini.turn.xpm%" Popup Reload-Config + "Temporary Change:" Title + "&Focus/Paging%mini.zoom.xpm%" Popup Focus-Settings + "&Mouse Speed%mini.cat.xpm%" Popup Mouse-Settings + "&Keyboard%mini.keyboard.xpm%" Popup Keyboard-Settings + "&Bell%mini.audiovol.xpm%" Popup Bell-Settings + "&Screen%mini.monitor.xpm%" Popup X-settings #------------------------------------------------------------------------------ #--------- Fvwm Config DestroyMenu FvwmConfig AddToMenu FvwmConfig + "&Base Configuration%mini.fvwm.xpm%" FvwmScript FvwmScript-BaseConfig + "&Form Configuration%mini.fvwm.xpm%" FvwmForm FvwmForm-Form + "" Nop + "&Rebuild Sample 95%mini.fvwm.xpm%" FvwmScript FvwmScript-Setup95 + "&Load Default Sample%mini.fvwm.xpm%" FvwmForm FvwmForm-Setup #------------------------------------------------------------------------------ #--------- Apps Manager DestroyMenu AppsManager AddToMenu AppsManager + "TaskBar &Desk%mini.exp.xpm%" ChangeAppsMan TaskBarDesk + "TaskBar &Global%mini.exp.xpm%" ChangeAppsMan TaskBarGlobal + "TaskBar &Desk (Auto Hide)%mini.exp.xpm%" ChangeAppsMan TaskBarDeskAutoHide + "TaskBar &Global (Auto Hide)%mini.exp.xpm%" ChangeAppsMan TaskBarGlobalAutoHide + "" Nop + "IconBox &Desk%mini.icons.xpm%" ChangeAppsMan IconBoxDesk + "IconBox &Global%mini.icons.xpm%" ChangeAppsMan IconBoxGlobal + "" Nop + "IconMan &Page%mini.run.xpm%" ChangeAppsMan IconManPage + "IconMan &Desk%mini.run.xpm%" ChangeAppsMan IconManDesk + "IconMan &Global%mini.run.xpm%" ChangeAppsMan IconManGlobal + "" Nop + "WinList &Desk%mini.windows.xpm%" ChangeAppsMan WinListDesk + "WinList &Global%mini.windows.xpm%" ChangeAppsMan WinListGlobal + "" Nop + "Use &Icons%mini.icons.xpm%" UseIcons + "" Nop + "&None%mini.windows.xpm%" AppsManNone #------------------------------------------------------------------------------ #--------- Animate settings DestroyMenu Animate-Settings AddToMenu Animate-settings + "&Animation on%mini.iconify.xpm%" ModuleOn FvwmAnimate + "Animation &off%mini.cross.xpm%" ModuleOff FvwmAnimate + "Animate &Menu%mini.iconify.xpm%" Popup MenuFvwmAnimate #------------------------------------------------------------------------------ #--------- AutoRaise settings DestroyMenu AutoRaise-Settings AddToMenu AutoRaise-Settings + "Raise &Slow%mini.raise.xpm%" ModuleOn 'FvwmAuto' '1000' + "Raise &Default%mini.raise.xpm%" ModuleOn 'FvwmAuto' '500' + "Raise &Fast%mini.raise.xpm%" ModuleOn 'FvwmAuto' '250' + "Speedy &Gonzales%mini.raise.xpm%" ModuleOn 'FvwmAuto' '50' + "Raise &Modules Only%mini.modules.xpm%" StartModulesAutoRaise + "AutoRaise &off%mini.cross.xpm%" ModuleOff FvwmAuto #------------------------------------------------------------------------------ #--------- Background settings DestroyMenu Background-Settings AddToMenu Background-Settings + "&FvwmBacker%mini.rainbow.xpm%" SetBackground FvwmBacker + "&Disable Background%mini.cross.xpm%" SetBackgroundOff + "Some &Solid Colors%mini.colors.xpm%" Popup Back-Solid + "Some &Gradientd%mini.colors.xpm%" Popup Back-Gradient + "&Personal%mini.colors.xpm%" Popup Back-Personal PipeRead '[ ! -d /usr/share/pixmaps/backgrounds ] || echo + \\"\\&Site Background%mini.colors.xpm%\\" Popup Back-Site' PipeRead '[ ! -n "$KDEDIR" ] || echo + \\"\\&KDE Background%mini.colors.xpm%\\" Popup Back-KDE' PipeRead '[ ! -d /usr/local/share/WindowMaker/Backgrounds ] || echo + \\"\\&WM Background%mini.colors.xpm%\\" Popup Back-Local-WM' PipeRead '[ ! -d /usr/share/WindowMaker/Backgrounds ] || echo + \\"\\&WM Background%mini.colors.xpm%\\" Popup Back-WM' PipeRead '[ ! -d /usr/share/afterstep/backgrounds ] || echo + \\"\\&AS Background%mini.colors.xpm%\\" Popup Back-AS' PipeRead '[ ! -d /usr/local/share/afterstep/backgrounds ] || echo + \\"\\&AS Background%mini.colors.xpm%\\" Popup Back-Local-AS' DestroyFunc SetBackFromDirectory AddToFunc SetBackFromDirectory + I DestroyMenu recreate $0 + I PipeRead 'for i in `/bin/ls $1`; \ do echo AddToMenu $0 "`basename $i`" SetBackground \\"$2 $i\\"; done' DestroyFunc SetBackFromDirectories AddToFunc SetBackFromDirectories + I DestroyMenu recreate $0 + I PipeRead 'for j in `/bin/ls -d $1`; do echo AddToMenu $0 "`basename $j`:" Title; for i in `/bin/ls $j/*`; do echo AddToMenu $0 "`basename $i`" SetBackground \\"$2 $i\\"; done; done' # Replace $FVWM_USERDIR/images/backgrounds/ by your backgrounds directory # and uncomment the next line #AddToMenu Back-Personal DynamicPopupAction SetBackFromDirectory 'Back-Personal' '$FVWM_USERDIR/images/backgrounds/*' 'Exec exec xv -root -quit' AddToMenu Back-Site DynamicPopupAction SetBackFromDirectories 'Back-Site' '/usr/share/pixmaps/backgrounds/*' 'Exec exec xv -root -quit' AddToMenu Back-KDE DynamicPopupAction SetBackFromDirectory 'Back-KDE' '$KDEDIR/share/wallpapers/*' 'Exec exec xv -root -quit' AddToMenu Back-WM DynamicPopupAction SetBackFromDirectory 'Back-WM' '/usr/share/WindowMaker/Backgrounds/*' 'Exec exec xv -root -quit' AddToMenu Back-Local-WM DynamicPopupAction SetBackFromDirectory 'Back-Local-WM' '/usr/local/share/WindowMaker/Backgrounds/*' 'Exec exec xv -root -quit' AddToMenu Back-AS DynamicPopupAction SetBackFromDirectory 'Back-AS' '/usr/share/afterstep/backgrounds/*' 'Exec exec xv -root -quit' AddToMenu Back-Local-AS DynamicPopupAction SetBackFromDirectory 'Back-Local-AS' '/usr/local/share/afterstep/backgrounds/*' 'Exec exec xv -root -quit' DestroyMenu Back-Solid AddToMenu Back-Solid + "&Red 1%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Red1' + "Red &2%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Red2' + "Red &3%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Red3' + "Red &4%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Red4' + "&Yellow 1%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Yellow1' + "Yellow &2%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Yellow2' + "Yellow &3%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Yellow3' + "Yellow &4%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Yellow4' + "&Orange 1%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Orange1' + "Orange &2%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Orange2' + "Orange &3%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Orange3' + "Orange &4%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Orange4' + "&Green 1%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Green1' + "Green &2%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Green2' + "Green &3%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Green3' + "Green &4%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Green4' + "&Cyan 1%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Cyan1' + "Cyan &2%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Cyan2' + "Cyan &3%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Cyan3' + "Cyan &4%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Cyan4' + "&Blue 1%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Blue1' + "Blue &2%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Blue2' + "Blue &3%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Blue3' + "Blue &4%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Blue4' + "&Magenta 1%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Magenta1' + "Magenta &2%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Magenta2' + "Magenta &3%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Magenta3' + "Magenta &4%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Magenta4' + "&Snow1%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid snow1' + "Snow &2%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid snow2' + "Snow &3%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid snow3' + "Snow &4%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid snow4' + "&Black%mini.rball.xpm%" SetBackground 'Exec exec xsetroot -solid Black' DestroyMenu Back-Gradient AddToMenu Back-Gradient + "&Red decay%mini.bball.xpm%" SetBackground 'Exec exec bggen red1 red4 | xv -root -quit -' + "&Yellow Orange decay%mini.bball.xpm%" SetBackground 'Exec exec bggen Yellow1 Orange4 | xv -root -quit -' + "&Green decay%mini.bball.xpm%" SetBackground 'Exec exec bggen green1 DarkGreen | xv -root -quit -' + "&Blue decay%mini.bball.xpm%" SetBackground 'Exec exec bggen 100 100 255 0 0 100 | xv -root -quit -' + "&Magenta decayy%mini.bball.xpm%" SetBackground 'Exec exec bggen blue magenta | xv -root -quit -' + "&Blue to Red%mini.bball.xpm%" SetBackground 'Exec exec bggen blue red | xv -root -quit -' + "Blue to &Cyan%mini.bball.xpm%" SetBackground 'Exec exec bggen blue4 Cyan1 | xv -root -quit -' + "&Cyan to Blue%mini.bball.xpm%" SetBackground 'Exec exec bggen Cyan Blue4 | xv -root -quit -' + "&Black/pink/black%mini.bball.xpm%" SetBackground 'Exec exec bggen black pink black | xv -root -quit -' + "Black/&red/black%mini.bball.xpm%" SetBackground 'Exec exec bggen black red black | xv -root -quit -' + "&Sun Raise 1%mini.bball.xpm%" SetBackground 'Exec exec bggen black orange black pink| xv -root -quit -' + "Sun Raise &2%mini.bball.xpm%" SetBackground 'Exec exec bggen black orange black Blue4| xv -root -quit -' + "Sun Raise &3%mini.bball.xpm%" SetBackground 'Exec exec bggen black red black grey60| xv -root -quit -' + "&Rainbowy%mini.bball.xpm%" SetBackground 'Exec exec bggen red green blue | xv -root -quit -' + "&Full Rainbowy%mini.bball.xpm%" SetBackground 'Exec exec bggen black red yellow green blue purple black | xv -root -quit -' + "&White to Black%mini.bball.xpm%" SetBackground 'Exec exec bggen white black | xv -root -quit -' + "&Black to White%mini.bball.xpm%" SetBackground 'Exec exec bggen white black | xv -root -quit -' #------------------------------------------------------------------------------ #--------- Banner settings DestroyMenu Banner-Settings AddToMenu Banner-Settings + "&Banner on%mini.ray.xpm%" ModuleOn FvwmBanner + "Banner &off%mini.cross.xpm%" ModuleOff FvwmBanner #------------------------------------------------------------------------------ #--------- Buttons settings DestroyMenu Buttons-Settings AddToMenu Buttons-Settings + "&Buttons Bar%mini.pencil.xpm%" ChangeButtonsOn 'FvwmButtons BarButtons' + "&Wharf%mini.pencil.xpm%" ChangeButtonsOn FvwmWharf + "&None%mini.cross.xpm%" ChangeButtonsOff #------------------------------------------------------------------------------ #--------- MiniButtons settings DestroyMenu MiniButtons-Settings AddToMenu MiniButtons-Settings + "&Mini Buttons on%mini.pencil.xpm%" ButtonsOn FvwmButtons MiniButtons MiniButtons + "Mini Buttons &off%mini.cross.xpm%" ButtonsOff MiniButtons MiniButtons #------------------------------------------------------------------------------ #--------- DeskerPanel settings DestroyMenu DeskerPanel-Settings AddToMenu DeskerPanel-Settings + "&Desker Panel on%mini.pencil.xpm%" ButtonsOn FvwmButtons DeskerPanelButtons DeskerPanelButtons + "Desker Panel &off%mini.cross.xpm%" ButtonsOff DeskerPanelButtons DeskerPanelButtons #------------------------------------------------------------------------------ #--------- WMaker Applets settings DestroyMenu WinMakerApp-Settings AddToMenu WinMakerApp-Settings + "&WMaker Applets on%mini.pencil.xpm%" ButtonsOn FvwmButtons WinMakerAppButtons WinMakerApp* + "WMaker Applets &off%mini.cross.xpm%" ButtonsOff WinMakerAppButtons WinMakerApp* #------------------------------------------------------------------------------ #--------- Sound settings DestroyMenu Sound-Settings AddToMenu Sound-Settings + "&Sound Effect on%mini.audiovol.xpm%" ModuleOn FvwmEvent + "Sound Effect &off%mini.cross.xpm%" ModuleOff FvwmEvent + "Sound &card%mini.sound.xpm%" Exec exec xmixer #------------------------------------------------------------------------------ #--------- Layers Settings DestroyMenu Layers-Settings AddToMenu Layers-Settings + "%mini.raise2.xpm%StaysOn&Top" Pick (CirculateHit) SetLayers StaysOnTop + "%mini.window.xpm%Stays&Put" Pick (CirculateHit) DestroyLayers + "%mini.lower2.xpm%StaysOn&Bottom" Pick (CirculateHit) SetLayers StaysOnBottom #------------------------------------------------------------------------------ #--------- X setup Script DestroyMenu XsetupScripts AddToMenu XsetupScripts + "&Bell%mini.audiovol.xpm%" FvwmScript FvwmScript-BellSetup + "&KeyBoard%mini.keyboard.xpm%" FvwmScript FvwmScript-KeyboardSetup + "&Screen%mini.monitor.xpm%" FvwmScript FvwmScript-ScreenSetup + "&Mouse%mini.mouse.xpm%" FvwmScript FvwmScript-PointerSetup #------------------------------------------------------------------------------ #--------- Edit config #PREF 12 DestroyMenu Edit-Config AddToMenu Edit-Config + "Edit .fvwm2rc%mini.edit.xpm%" Exec exec emacs $FVWM_USERDIR/.fvwm2rc + "Edit decorations%mini.edit.xpm%" Exec exec emacs $FVWM_USERDIR/decorations + "Edit globalfeel%mini.edit.xpm%" Exec exec emacs $FVWM_USERDIR/globalfeel + "Edit startup%mini.edit.xpm%" Exec exec emacs $FVWM_USERDIR/startup + "Edit styles%mini.edit.xpm%" Exec exec emacs $FVWM_USERDIR/styles + "Edit iconstyles%mini.edit.xpm%" Exec exec emacs $FVWM_USERDIR/iconstyles + "Edit functions%mini.edit.xpm%" Exec exec emacs $FVWM_USERDIR/functions + "Edit bindings%mini.edit.xpm%" Exec exec emacs $FVWM_USERDIR/bindings + "Edit menus%mini.edit.xpm%" Exec exec emacs $FVWM_USERDIR/menus + "Edit modules%mini.edit.xpm%" Exec exec emacs $FVWM_USERDIR/modules #------------------------------------------------------------------------------ #--------- Reload config DestroyMenu Reload-Config AddToMenu Reload-Config + "Reload decorations%mini.turn.xpm%" Read decorations + "Reload globalfeel%mini.turn.xpm%" Read globalfeel + "Reload styles%mini.turn.xpm%" Read styles + "Reload iconstyles && menus%mini.turn.xpm%" ReloadIconStylesAndMenus + "Reload functions%mini.turn.xpm%" Read functions + "Reload bindings%mini.turn.xpm%" Read bindings + "Reload modules%mini.turn.xpm%" Read modules #------------------------------------------------------------------------------ #--------- Load / Save As settings DestroyMenu Load-Settings AddToMenu Load-Settings + "Show &Fvwm Settings%mini.fvwm.xpm%" ShowFvwmSettings + "Show Layers Settings%mini.window.xpm%" ShowLayers + "Show &X Settings%mini.x2.xpm%" ShowXSettings + "" Nop + "&Load Setting 1%mini.turn.xpm%" LoadSettings 1 + "Load Setting &2%mini.turn.xpm%" LoadSettings 2 + "Load Setting &3%mini.turn.xpm%" LoadSettings 3 + "Load Setting &4%mini.turn.xpm%" LoadSettings 4 + "Save Current As:" Title + "&Setting 1%mini.diskette.xpm%" SaveAsSettings 1 + "Setting &2%mini.diskette.xpm%" SaveAsSettings 2 + "Setting &3%mini.diskette.xpm%" SaveAsSettings 3 + "Setting &4%mini.diskette.xpm%" SaveAsSettings 4 #------------------------------------------------------------------------------ #--------- Focus/Paging settings DestroyMenu Focus-Settings AddToMenu Focus-Settings + "&Sloppy Focus%mini.mouse.xpm%" Style * SloppyFocus + "&Click To Focus%mini.mouse.xpm%" Style * ClickToFocus + "&Focus Follows Mouse%mini.mouse.xpm%" Style * FocusFollowsMouse + "" Nop + "&Colormap Follows Mouse%mini.colors.xpm%" ColormapFocus FollowsMouse + "&Colormap Follows Focus%mini.colors.xpm%" ColormapFocus FollowsFocus + "" Nop + "&Full Paging ON%mini.maximize2.xpm%" EdgeScroll 100 100 + "&All Paging OFF%mini.cross.xpm%" EdgeScroll 0 0 + "&Horizontal Paging Only%mini.maximize-horiz.xpm%" EdgeScroll 100 0 + "&Vertical Paging Only%mini.maximize-vert.xpm%" EdgeScroll 0 100 + "&Partial Paging%mini.maximize2.xpm%" EdgeScroll 50 50 + "&Full Paging && Edge Wrap%mini.maximize2.xpm%" EdgeScroll 100000 100000 #------------------------------------------------------------------------------ #--------- Mouse settings DestroyMenu Mouse-Settings AddToMenu Mouse-Settings + "Mouse &Slow%mini.mouse.xpm%" Exec xset m 1 1 + "Mouse &Default%mini.mouse.xpm%" Exec xset m default + "Mouse &Fast%mini.cat.xpm%" Exec xset m 4 2 + "Speedy &Gonzales%mini.cat.xpm%" Exec xset m 10 2 #------------------------------------------------------------------------------ #--------- Keyboard settings DestroyMenu Keyboard-Settings AddToMenu Keyboard-Settings + "&Auto-repeat on%mini.keyboard.xpm%" Exec xset r on + "Auto-repeat &off%mini.keyboard.xpm%" Exec xset r off #------------------------------------------------------------------------------ #--------- Sound settings DestroyMenu Bell-Settings AddToMenu Bell-Settings + "&Bell on%mini.sound.xpm%" Exec xset b on + "Bell &off%mini.cross.xpm%" Exec xset b off + "Sound &card%mini.sound.xpm%" Exec exec xmixer #------------------------------------------------------------------------------ #--------- X & screen settings DestroyMenu X-Settings AddToMenu X-Settings + "Back &Color%mini.colors.xpm%" Popup Backcolor + "Back &Animation%mini.fractal.xpm%" Popup Background-Animation + "&Root Cursor Form%mini.xarchie.xpm%" FvwmForm FvwmForm-RootCursor + "&Video tuning%mini.monitor.xpm%" Exec exec xterm -T Xvidtune -e xvidtune + "&X configuration%mini.display.xpm%" Exec exec xterm -T Xconfig -e Xconfigurator #--------- Background color DestroyMenu Backcolor AddToMenu Backcolor + "&Black%mini.bball.xpm%" Exec exec xsetroot -solid Black + "&Red%mini.bball.xpm%" Exec exec xsetroot -solid Red + "&Yellow%mini.bball.xpm%" Exec exec xsetroot -solid Yellow + "&Green%mini.bball.xpm%" Exec exec xsetroot -solid Green + "&Cyan%mini.bball.xpm%" Exec exec xsetroot -solid Cyan4 + "&Blue%mini.bball.xpm%" Exec exec xsetroot -solid Blue + "&Magenta%mini.bball.xpm%" Exec exec xsetroot -solid Magenta + "&White%mini.bball.xpm%" Exec exec xsetroot -solid White + "&Blue decay%mini.bball.xpm%" Exec exec bggen 100 100 255 0 0 100 | xv -root -quit - + "&Rainbow%mini.bball.xpm%" Exec exec bggen red green blue | xv -root -quit - + "&Full Rainbow%mini.bball.xpm%" Exec exec bggen black red yellow green blue purple black | xv -root -quit - + "&Magenta decay%mini.bball.xpm%" Exec exec bggen blue magenta | xv -root -quit - #--------- Background animation DestroyMenu "Background-Animation" AddToMenu "Background-Animation" + "&Braid%mini.rball.xpm%" Exec exec xlock -nice 10 -inroot -mode braid + "&Flame%mini.rball.xpm%" Exec exec xlock -nice 10 -inroot -mode flame + "&Grav%mini.rball.xpm%" Exec exec xlock -nice 10 -inroot -mode grav + "&Pyro%mini.rball.xpm%" Exec exec xlock -nice 10 -inroot -mode pyro + "&Qix%mini.rball.xpm%" Exec exec xlock -nice 10 -inroot -mode qix + "&Rock%mini.rball.xpm%" Exec exec xlock -nice 10 -inroot -mode rock + "&Slip%mini.rball.xpm%" Exec exec xlock -nice 10 -inroot -mode spiral + "&Spline%mini.rball.xpm%" Exec exec xlock -nice 10 -inroot -mode spline + "&Swarm%mini.rball.xpm%" Exec exec xlock -nice 10 -inroot -mode swarm + "&Worm%mini.rball.xpm%" Exec exec xlock -nice 10 -inroot -mode worm + "&Random%mini.rball.xpm%" Exec exec xlock -nice 10 -inroot -mode random # Stop the animation in the background + "&Stop It%mini.cross.xpm%" \ Exec kill -9 $(ps aux | grep xlock | grep -v grep | awk '{print $2}') #------------------------------------------------------------------------------ #--------- Documents #------------------------------------------------------------------------------ DestroyMenu Documents AddToMenu Documents + "&Xman%mini.book1.xpm%" Exec exec xman + "&Fvwm Home Page%mini.fvwm.xpm%" Exec exec mozilla http://www.fvwm.org/ + "&Fvwm Themes Home Page%mini.icons.xpm%" Exec exec mozilla http://fvwm-themes.sourceforge.net/ + "&Sample 95 MINI-FAQ%mini.book1.xpm%" Exec exec xterm -bg white -fg black -g 80x35 -n "Sample-95 MINI-FAQ" -T "Sample-95 MINI-FAQ" -e less +?"-- Sample-95 MINI-FAQ --" $FVWM_USERDIR/.fvwm2rc + "Fvwm &Man Pages%mini.book1.xpm%" Popup FvwmManPage + "" Nop + "&Browser%mini.folder.xpm%" Menu MenuBrowser + "Browser (&cached)%mini.folder.xpm%" Menu MenuBrowserCached AddToMenu Documents MissingSubmenuFunction FuncFvwmMenuDirectory + "&Root dir%mini.folder.xpm%" Popup / + "&Home dir%mini.folder.xpm%" Popup ~ DestroyMenu MenuBrowser #PREF 1 AddToMenu MenuBrowser DynamicPopupAction Piperead 'fvwm-menu-directory --reuse --name MenuBrowser --dir $HOME --special-dirs --exec-file ^"emacs" --xterm=" xterm -e" --icon-dir=mini.folder.xpm --icon-title=mini.term.xpm --icon-file=mini.file.xpm --icon-app=mini.hex.xpm --check-subdir' DestroyMenu MenuBrowserCached #PREF 1 AddToMenu MenuBrowserCached DynamicPopupAction Piperead 'fvwm-menu-directory --all --reuse --name MenuBrowserCached --dir $HOME --special-dirs --exec-file ^"emacs" --xterm=" xterm -e" --icon-dir=mini.folder.xpm --icon-title=mini.term.xpm --icon-file=mini.file.xpm --icon-app=mini.hex.xpm --check-subdir' DestroyFunc FuncFvwmMenuDirectory #PREF 1 AddToFunc FuncFvwmMenuDirectory I PipeRead 'fvwm-menu-directory --dir "$0" --exec-file ^"emacs" --xterm=" xterm -e" --icon-dir=mini.folder.xpm --icon-title=mini.term.xpm --icon-file=mini.file.xpm --icon-app=mini.hex.xpm --check-subdir' #------------- FvwmManPage DestroyFunc ViewManPage AddToFunc ViewManPage + I Exec exec xterm -g 80x40 -e man $0 DestroyMenu FvwmManPage AddToMenu FvwmManPage "Fvwm Man Pages" Title + "%mini.book1.xpm%fvwm" ViewManPage fvwm + "%mini.book1.xpm%FvwmAnimate" ViewManPage FvwmAnimate + "%mini.book1.xpm%FvwmAuto" ViewManPage FvwmAuto + "%mini.book1.xpm%FvwmBacker" ViewManPage FvwmBacker + "%mini.book1.xpm%FvwmBanner" ViewManPage FvwmBanner + "%mini.book1.xpm%FvwmButtons" ViewManPage FvwmButtons + "%mini.book1.xpm%FvwmCommand" ViewManPage FvwmCommand + "%mini.book1.xpm%FvwmConsole" ViewManPage FvwmConsole + "%mini.book1.xpm%FvwmConsoleC.pl" ViewManPage FvwmConsoleC.pl + "%mini.book1.xpm%FvwmCpp" ViewManPage FvwmCpp + "%mini.book1.xpm%FvwmDebug" ViewManPage FvwmDebug + "%mini.book1.xpm%FvwmDragWell" ViewManPage FvwmDragWell + "%mini.book1.xpm%FvwmEvent" ViewManPage FvwmEvent + "%mini.book1.xpm%FvwmForm" ViewManPage FvwmForm + "%mini.book1.xpm%FvwmGtk" ViewManPage FvwmGtk + "%mini.book1.xpm%FvwmGtkDebug" ViewManPage FvwmGtkDebug + "%mini.book1.xpm%FvwmIconBox" ViewManPage FvwmIconBox + "%mini.book1.xpm%FvwmIconMan" ViewManPage FvwmIconMan + "%mini.book1.xpm%FvwmIdent" ViewManPage FvwmIdent + "%mini.book1.xpm%FvwmM4" ViewManPage FvwmM4 + "%mini.book1.xpm%FvwmPager" ViewManPage FvwmPager + "%mini.book1.xpm%FvwmPerl" ViewManPage FvwmPerl + "%mini.book1.xpm%FvwmProxy" ViewManPage FvwmProxy + "%mini.book1.xpm%FvwmRearrange" ViewManPage FvwmRearrange + "%mini.book1.xpm%FvwmSave" ViewManPage FvwmSave + "%mini.book1.xpm%FvwmSaveDesk" ViewManPage FvwmSaveDesk + "%mini.book1.xpm%FvwmScript" ViewManPage FvwmScript + "%mini.book1.xpm%FvwmScroll" ViewManPage FvwmScroll + "%mini.book1.xpm%FvwmTaskBar" ViewManPage FvwmTaskBar + "%mini.book1.xpm%FvwmTheme" ViewManPage FvwmTheme + "%mini.book1.xpm%FvwmWharf" ViewManPage FvwmWharf + "%mini.book1.xpm%FvwmWinList" ViewManPage FvwmWinList + "%mini.book1.xpm%FvwmWindowMenu" ViewManPage FvwmWindowMenu + "" Nop + "%mini.book1.xpm%fvwm-config" ViewManPage fvwm-config + "%mini.book1.xpm%fvwm-perllib" ViewManPage fvwm-perllib + "%mini.book1.xpm%fvwm-root" ViewManPage fvwm-root + "%mini.book1.xpm%fvwm-bug" ViewManPage fvwm-bug + "%mini.book1.xpm%fvwm-convert-2.2" ViewManPage fvwm-convert-2.2 + "%mini.book1.xpm%fvwm-convert-2.4" ViewManPage fvwm-convert-2.4 + "%mini.book1.xpm%fvwm-convert-2.6" ViewManPage fvwm-convert-2.6 + "" Nop + "%mini.book1.xpm%fvwm-menu-desktop" ViewManPage fvwm-menu-desktop + "%mini.book1.xpm%fvwm-menu-directory" ViewManPage fvwm-menu-directory + "%mini.book1.xpm%fvwm-menu-headlines" ViewManPage fvwm-menu-headlines + "%mini.book1.xpm%fvwm-menu-xlock" ViewManPage fvwm-menu-xlock #------------------------------------------------------------------------------ #--------- ScreenSaver #------------------------------------------------------------------------------ DestroyMenu Screen AddToMenu Screen + "&Screensaver%mini.display.xpm%" Exec exec xlock -nolock -nice 19 -mode random + "Screen&lock%mini.lock.xpm%" Exec exec xlock -nice 19 -mode random + "" Nop #!E xlock + "&Screensaver%mini.display.xpm%" Popup MenuSSaver #!E xlock + "Sc&reen&lock%mini.lock.xpm%" Popup MenuSLock #!E xlock + "" Nop #!E xscreensaver + "(Re)start &XscreenSaver%mini.display.xpm%" Exec xscreensaver-command -exit ; exec xscreensaver -no-splash + "&Stop XscreenSaver%mini.cross.xpm%" Exec exec xscreensaver-command -exit + "XscreenSaver &Demo%mini.display.xpm%" Exec xscreensaver-command -exit ; exec xscreensaver; exec xscreensaver-command -demo + "" Nop #!E xscreensaver + "&Locked XscreenSaver%mini.lock.xpm%" Exec exec xscreensaver-command -lock + "&Activate XscreenSaver%mini.display.xpm%" Exec exec xscreensaver-command -activate PipeRead 'fvwm-menu-xlock -n MenuSSaver -t "Screensaver" -icon-item mini.bball.xpm -- -nice 19 -nolock' #!E xlock PipeRead 'fvwm-menu-xlock -n MenuSLock -t "Lock Screen" -icon-item mini.rball.xpm -- -nice 19' #!E xlock #------------------------------------------------------------------------------ #--------- Restart #------------------------------------------------------------------------------ DestroyMenu Restart AddToMenu Restart "Restart Window Manager" Title + "&Restart Self%mini.turn.xpm%" Restart + "" Nop + "&fvwm-themes-start%mini.fvwm.xpm%" Restart fvwm-themes-start + "&fvwm%mini.fvwm.xpm%" Restart fvwm -s + "&fvwm2%mini.fvwm.xpm%" Restart fvwm2 -s + "&fvwm95%mini.fvwm.xpm%" Restart fvwm95 -s + "&AnotherLevel%mini.fvwm.xpm%" Restart AnotherLevel + "&AnotherLevelUp%mini.fvwm.xpm%" Restart AnotherLevelUp + "" Nop + "&afterstep%mini.windows.xpm%" Restart afterstep + "&blackbox%mini.windows.xpm%" Restart blackbox + "&enlightenment%mini.windows.xpm%" Restart enlightenment + "&flwm%mini.windows.xpm%" Restart flwm + "&icewm%mini.windows.xpm%" Restart icewm + "&kwm%mini.windows.xpm%" Restart kwm + "&mwm%mini.mwm.xpm%" Restart mwm + "&olvwm%mini.olwm.xpm%" Restart olvwm + "&sawfish%mini.windows.xpm%" Restart sawfish + "&sawmill%mini.windows.xpm%" Restart sawmill + "&scwm%mini.windows.xpm%" Restart scwm + "&twm%mini.twm.xpm%" Restart twm + "&uwm%mini.windows.xpm%" Restart uwm + "&wm2%mini.windows.xpm%" Restart wm2 + "&wmaker%mini.windows.xpm%" Restart wmaker + "&wmx%mini.windows.xpm%" Restart wmx + "&xfwm%mini.windows.xpm%" Restart xfwm + "" Nop + "Just &xterm%mini.term.xpm%" Restart xterm # A bit dangerous in a menu #+ "" Nop #+ "Halt%mini.stop.xpm%" Exec exec shutdown -h now #+ "Reboot%mini.lightbolt-full.xpm%" Exec exec shutdown -r now #------------------------------------------------------------------------------ #------------- Windows Operations #------------------------------------------------------------------------------ #----------------------------------------------------------------------------- # The "root" windows ops menu (Mouse 2) DestroyMenu "Window" AddToMenu "Window" "Window Operations" Title + "&Move%mini.move1.xpm%" Move + "&Resize%mini.resize3.xpm%" Resize + "(De)&Iconify%mini.iconify1.xpm%" Iconify + "(Un)M&aximize%mini.maximize1.xpm%" Maximize 100 100 + "(Un)Max&wide%mini.maximize-horiz1.xpm%" Maximize 100 0 + "(Un)Max&tall%mini.maximize-vert1.xpm%" Maximize 0 100 + "(Un)&Shade%mini.shade1.xpm%" WindowShade + "(Un)S&tick%mini.stick1.xpm%" Stick + "R&aise%mini.raise2.xpm%" Raise + "&Lower%mini.lower2.xpm%" Lower + "" Nop + "&Delete%mini.cross.xpm%" Delete + "&Close%mini.delete.xpm%" Close + "&Destroy%mini.bomb.xpm%" Destroy + "" Nop + "Move to &Page%mini.move1.xpm%" Popup Move-window + "&Group Ops%mini.windows.xpm%" Popup WindowGroupOps + "&Window Style%mini.window.xpm%" Popup WindowStyle + "&Rearrange/Scroll%mini.windows.xpm%" Popup WinRearrange + "" Nop + "&Identify%mini.question.xpm%" Module FvwmIdent + "Switch &to...%mini.windows.xpm%" WindowList #------------------------------------------------------------------------------ # A trimmed down version of "Window Ops", good for binding to decorations DestroyMenu "Window-Ops2" AddToMenu "Window-Ops2" + "&Move%mini.move1.xpm%" Move + "&Resize%mini.resize3.xpm%" Resize + "(De)&Iconify%mini.iconify1.xpm%" Iconify + "(Un)M&aximize%mini.maximize1.xpm%" Maximize 100 100 + "(Un)Max&wide%mini.maximize-horiz1.xpm%" Maximize 100 0 + "(Un)Max&tall%mini.maximize-vert1.xpm%" Maximize 0 100 + "(Un)&Shade%mini.shade1.xpm%" WindowShade + "(Un)S&tick%mini.stick1.xpm%" Stick #+ "R&aiseLower%mini.raise2.xpm%" RaiseLower + "" Nop + "&Close%mini.delete.xpm%" Close + "" Nop + "&Identify%mini.question.xpm%" Module FvwmIdent + "More&...%mini.window.xpm%" Menu Window This 0 0 #------------------------------------------------------------------------------ # A trimmed down version of "Window Ops", good for binding to TaskBar, # WinList ... buttons DestroyMenu "Window-Ops3" AddToMenu "Window-Ops3" + "Move to &Page%mini.move1.xpm%" Popup Move-window + "&Group Ops%mini.windows.xpm%" Popup WindowGroupOps + "" Nop + "(De)&Iconify%mini.iconify1.xpm%" Iconify + "(Un)&Shade%mini.shade1.xpm%" WindowShade + "(Un)S&tick%mini.stick1.xpm%" Stick + "(Un)M&aximize%mini.maximize1.xpm%" Maximize 95 95 + "%mini.window.xpm%Scroll&Bar (75%% scr)" Module FvwmScroll 75p 75p + "" Nop + "&Close%mini.delete.xpm%" Close + "" Nop + "&Identify%mini.question.xpm%" Module FvwmIdent + "More&...%mini.window.xpm%" Menu Window This 0 0 #------------------------------------------------------------------------------ # A "Move Window" menu DestroyMenu "Move-Window" AddToMenu "Move-Window" "Move to ..." Title + 'Page &1%mini.move1.xpm%' MoveToPage 0 0 + 'Page &2%mini.move1.xpm%' MoveToPage 1 0 + 'Page &3%mini.move1.xpm%' MoveToPage 0 1 + 'Page &4%mini.move1.xpm%' MoveToPage 1 1 + '' Nop + '&Fvwm%mini.move1.xpm%' MoveToDesk 0 0 + '&Devel%mini.move1.xpm%' MoveToDesk 0 1 + '&Internet%mini.move1.xpm%' MoveToDesk 0 2 + '&Misc%mini.move1.xpm%' MoveToDesk 0 3 #------------------------------------------------------------------------------ # A group version of WindowOps DestroyMenu WindowGroupOps AddToMenu WindowGroupOps "Group Ops" Title + "&Iconify%mini.iconify1.xpm%" Pick All ($c) Iconify on + "&DeIconify%mini.iconify1.xpm%" Pick All ($c) Iconify off + "&Shade%mini.shade1.xpm%" Pick All ($c) WindowShade on + "&UnShade%mini.shade1.xpm%" Pick All ($c) WindowShade off + "R&aise%mini.raise2.xpm%" Pick All ($c) Raise + "&Lower%mini.lower2.xpm%" Pick All ($c) Lower + "" Nop + "&Delete%mini.cross.xpm%" Pick Delete + "&Close%mini.delete.xpm%" Pick Close + "&Destroy%mini.bomb.xpm%" Pick Destroy + "&Quick move to ..." Title + 'Page &1%mini.move1.xpm%' Pick All ($c) MoveToPage 0 0 + 'Page &2%mini.move1.xpm%' Pick All ($c) MoveToPage 1 0 + 'Page &3%mini.move1.xpm%' Pick All ($c) MoveToPage 0 1 + 'Page &4%mini.move1.xpm%' Pick All ($c) MoveToPage 1 1 + '' Nop + '&Fvwm%mini.move1.xpm%' Pick All ($c) MoveToDesk 0 0 + '&Devel%mini.move1.xpm%' Pick All ($c) MoveToDesk 0 1 + '&Internet%mini.move1.xpm%' Pick All ($c) MoveToDesk 0 2 + '&Misc%mini.move1.xpm%' Pick All ($c) MoveToDesk 0 3 DestroyMenu WindowStyle AddToMenu WindowStyle + "%mini.window.xpm%Title&AtTop" Pick (CirculateHit) Style $n TitleAtTop + "%mini.window.xpm%&NoTitle" Pick (CirculateHit) Style $n !Title + "%mini.window.xpm%&Title" Pick (CirculateHit) Style $n !Title + "%mini.window.xpm%TitleAt&Bottom" Pick (CirculateHit) Style $n TitleAtBottom + "" Nop + "%mini.raise2.xpm%StaysOn&Top" Pick (CirculateHit) StyleAndRecapture $n StaysOnTop + "%mini.window.xpm%Stays&Put" Pick (CirculateHit) StyleAndRecapture $n StaysPut + "%mini.lower2.xpm%StaysOn&Bottom" Pick (CirculateHit) StyleAndRecapture $n StaysOnBottom + "" Nop + "%mini.window.xpm%&FvwmBorder" Pick (CirculateHit) Style $n FvwmBorder + "%mini.window.xpm%&MWMBorder" Pick (CirculateHit) Style $n MWMBorder + "%mini.window.xpm%&DepressableBorder" Pick (CirculateHit) Style $n DepressableBorder + "%mini.window.xpm%&FirmBorder" Pick (CirculateHit) Style $n FirmBorder + "%mini.window.xpm%&Handles" Pick (CirculateHit) Style $n Handles + "%mini.window.xpm%&NoHandles" Pick (CirculateHit) Style $n !Handles + "%mini.window.xpm%BorderWidth &0" Pick (CirculateHit) Style $n BorderWidth 0 + "%mini.window.xpm%BorderWidth &5" Pick (CirculateHit) Style $n BorderWidth 5 + "%mini.window.xpm%HandleWidth &0" Pick (CirculateHit) Style $n HandleWidth 0 + "%mini.window.xpm%HandleWidth &7" Pick (CirculateHit) Style $n HandleWidth 7 + "" Nop + "%mini.resize3.xpm%&ResizeOpaque" Pick (CirculateHit) Style $n ResizeOpaque + "%mini.resize3.xpm%Resize&Outline" Pick (CirculateHit) Style $n ResizeOutline + "%mini.mouse.xpm%Sloppy&Focus" Pick (CirculateHit) Style $n SloppyFocus + "%mini.mouse.xpm%&ClickToFocus" Pick (CirculateHit) Style $n ClickToFocus + "%mini.mouse.xpm%&MouseFocus" Pick (CirculateHit) Style $n MouseFocus + "%mini.mouse.xpm%&NeverFocus" Pick (CirculateHit) Style $n NeverFocus DestroyMenu WinRearrange AddToMenu WinRearrange + "&Cascade%mini.windows.xpm%" FvwmRearrange -cascade -m 3 3 -incx 2 + "Tile &horizontally%mini.windows.xpm%" FvwmRearrange -tile -h -m 2 2 98 98 + "Tile &vertically%mini.windows.xpm%" FvwmRearrange -tile -m 2 2 98 98 + "" Nop + "&ScrollBar (1/2 app)%mini.window.xpm%" Module FvwmScroll 2 2 + "%mini.window.xpm%&Scroll&Bar (75%% scr)" Module FvwmScroll 75p 75p + "" Nop + "&Arrange Icons%mini.icons.xpm%" All (CurrentDesk Iconic) RecaptureWindow + "&Refresh Screen%mini.ray.xpm%" Refresh #---------------------------------------------------------------------------- # Use the winops menus styles for the "Windows Operations Menus" # Use it also for big menu ChangeMenuStyle winops Window Window-Ops2 Window-Ops3 Move-Window WindowGroupOps WindowStyle WinRearrange Back-Solid Back-Gradient FvwmManPage MenuSSaver MenuSLock #SEG modules #-----------------------------------------------------------------------------# # # 11. Definitions used by the modules # (Alphabetic order is used, but the Form are at the end) #-----------------------------------------------------------------------------# #------------------------------------------------------------------------------ #------------------ FvwmBacker #------------------------------------------------------------------------------ *FvwmBacker: Command(Desk 0, Page * *) -solid Blue *FvwmBacker: Command(Desk 1, Page * *) -solid \#7F4B7F *FvwmBacker: Command(Desk 2, Page * *) -solid midnightblue *FvwmBacker: Command(Desk 3, Page * *) -solid black #------------------------------------------------------------------------------ #------------------ FvwmBanner #------------------------------------------------------------------------------ Style FvwmBanner !Title, Sticky, StaysOnTop, WindowListSkip, CirculateSkip *FvwmBannerTimeout 2 #------------------------------------------------------------------------------ #------------------ FvwmButtons: BarButtons #------------------------------------------------------------------------------ Style BarButtons !Title, !Handles, Sticky, WindowListSkip, \ BorderWidth 4, CirculateSkip DestroyModuleConfig BarButtons: * *BarButtons: Fore Black *BarButtons: Back #c3c3c3 *BarButtons: Font "xft:sans-serif:Bold:pixelsize=10;-*-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*" # Geometry - really likes to pick its own size, but giving a position is OK # Warning: I've added a size geometry to avoid pbs if the fvwm_icons are # not in the image path ! Remove the size in this geometry especially if # you add buttons *BarButtons: Geometry 120x445-5-84 # Layout: specify rows or columns, not both *BarButtons: Columns 2 #LAPTOP 1 Are you a laptop user ? #*BarButtons: (2x1, Title "xapm", Swallow(Kill) "xapm" "Exec exec xapm -geometry -1500-1500 -p") # Define the buttons to use..... #PREF 3 *BarButtons: (1x2, Title FileMgr, Icon Xfm.xpm, Action 'Exec exec xfm') *BarButtons: (1x2, Title terminal, Icon rterm2.xpm, Action 'Exec exec xterm') *BarButtons: (1x2, Title editor, Icon lemacs.xpm, Action 'Exec exec emacs') *BarButtons: (1x2, Title xv, Icon xv.xpm, Action 'Exec exec xv', \ Action(Mouse 2) 'Exec exec ee', \ Action(Mouse 3) 'Exec exec gqview') *BarButtons: (1x2, Title Gimp, Icon gimp.xpm, Action 'Exec exec gimp', \ Action(Mouse 2) 'Exec exec xpaint', \ Action(Mouse 3) 'Exec exec kiconedit') *BarButtons: (1x2, Title gview, Icon gv.xpm, Action 'Exec exec ghostview', \ Action(Mouse 2) 'Exec exec xdvi', \ Action(Mouse 3) 'Exec exec xpdf') *BarButtons: (1x2, Title www, Icon nscape.xpm, Action 'Exec exec netscape', \ Action(Mouse 2) 'Exec exec vppp', \ Action(Mouse 3) 'Exec exec xterm -geometry 80x30 -e mutt') *BarButtons: (1x2, Padding 0 0, Container(Padding 0 0, Frame 2, Columns 3)) *BarButtons: (Icon mini.move1.xpm, Action Move) *BarButtons: (Icon mini.resize3.xpm, Action Resize) *BarButtons: (Icon mini.iconify1.xpm, Action Iconify) *BarButtons: (Icon mini.maximize1.xpm, Action Maximize 90 90) *BarButtons: (Icon mini.shade1.xpm, Action WindowShade) *BarButtons: (Icon mini.stick1.xpm, Action Stick) *BarButtons: (Icon mini.cross.xpm, Action Delete) *BarButtons: (Icon mini.bomb.xpm, Action Destroy) *BarButtons: (Icon mini.question.xpm, Action Module FvwmIdent) *BarButtons: (End) *BarButtons: (1x2, Title "xload", Swallow "xload" "Exec exec nice -16 \ xload -nolabel -update 4 -bg grey59 -hl grey70 \ -geometry -1500-1500") *BarButtons: (1x2, Title "xclock", Swallow "xclock" "Exec \ exec xclock -padding 0 -geometry -1500-1500") *BarButtons: (2x2, Swallow "FvwmPagerPager" 'FvwmPager FvwmPagerPager * *') #------------------------------------------------------------------------------ #------------------ FvwmButtons: MiniButtons #------------------------------------------------------------------------------ Style "MiniButtons" !Title, !Handles, Sticky, WindowListSkip, \ BorderWidth 0, CirculateSkip DestroyModuleConfig MiniButtons* *MiniButtons: Fore Black *MiniButtons: Back #c0c0c0 *MiniButtons: Geometry -2+2 *MiniButtons: Rows 1 *MiniButtons: Padding 1 1 #PREF 3 *MiniButtons: - mini.term.xpm Exec exec xterm *MiniButtons: - mini.filemgr.xpm Exec exec xfm *MiniButtons: - mini.doc1.xpm Exec exec emacs *MiniButtons: - mini.calc.xpm Exec exec xcalc *MiniButtons: - mini.cd.xpm Exec exec xplaycd *MiniButtons: - mini.audiovol.xpm Exec exec xmixer *MiniButtons: - mini.happy.xpm Exec exec xmine *MiniButtons: - mini.bomb.xpm Destroy #------------------------------------------------------------------------------ #------------------ FvwmButtons: DeskerPanelButtons #------------------------------------------------------------------------------ Style "DeskerPanelButtons" !Title, !Handles, Sticky, WindowListSkip, \ BorderWidth 0, CirculateSkip #Style "DeskerPanelButtons" StaysOnTop DestroyModuleConfig DeskerPanelButtons: * *DeskerPanelButtons: Fore Black *DeskerPanelButtons: Back grey57 *DeskerPanelButtons: Geometry 12x79 *DeskerPanelButtons: Rows 1 *DeskerPanelButtons: Frame 1 *DeskerPanelButtons: Padding 0 0 #FAST 1 *DeskerPanelButtons: (Panel(right, steps 12, delay 0, position module top, indicator10) "FvwmDesker" 'Module FvwmPager FvwmDesker 0 3') #SLOW 1 #*DeskerPanelButtons: (Panel(right, steps 0, position module top, indicator10) "FvwmDesker" 'Module FvwmPager FvwmDesker 0 3') #------------------------------------------------------------------------------ #------------------ FvwmButtons: WinMakerAppButtons & WinMakerAppPanelCd #------------------------------------------------------------------------------ Style "WinMakerApp*" !Title, !Handles, BorderWidth 0, Sticky, \ WindowListSkip, CirculateSkip DestroyModuleConfig WinMakerAppButtons: * #------------------------------------- # Buttons: # We use "hands panel", the advantage is that we use the applet # in the panel only when we need it: Button 3 kill the panel *WinMakerAppButtons: Geometry +0+120 *WinMakerAppButtons: Columns 1 *WinMakerAppButtons: Back #c0c0c0 *WinMakerAppButtons: Fore black *WinMakerAppButtons: (Frame 1, Size 64 64, \ Swallow "wmjmail" 'Exec exec wmjmail', Action(Mouse 1) \ 'MyPanelButtons "WinMakerAppPanelMail" $right $top', \ Action(Mouse 3) 'All (WinMakerAppPanelMail) Close') *WinMakerAppButtons: (Frame 1, Size 64 64, \ Swallow "wmppp" 'Exec exec wmppp' Action(Mouse 1) \ 'MyPanelButtons "WinMakerAppPanelPPP" $right $top', \ Action(Mouse 3) 'All (WinMakerAppPanelPPP) Close') *WinMakerAppButtons: (Frame 1, Size 64 64, \ Swallow "wmmount" 'Exec exec wmmount -s', Action(Mouse 1) \ 'MyPanelButtons "WinMakerAppPanelCd" $right $top', \ Action(Mouse 3) 'All (WinMakerAppPanelCd) Close') #----------------- # The Mail Panel *WinMakerAppPanelMail: Rows 1 *WinMakerAppPanelMail: Back #c0c0c0 *WinMakerAppPanelMail: Fore black *WinMakerAppPanelMail: (Frame 1, Size 64 64, \ Swallow "wmCalClock" 'Exec exec wmCalClock') *WinMakerAppPanelMail: (Frame 1, Size 64 64, \ Swallow "wmglobe" 'Exec exec wmglobe') *WinMakerAppPanelMail: (Frame 1, Size 64 64, \ Swallow "wmMoonClock" 'Exec exec wmMoonClock') #----------------- # The PPP Panel *WinMakerAppPanelPPP: Rows 1 *WinMakerAppPanelPPP: Back #c0c0c0 *WinMakerAppPanelPPP: Fore black *WinMakerAppPanelPPP: (Frame 1, Size 64 64, \ Swallow "wminet" 'Exec exec wminet') *WinMakerAppPanelPPP: (Frame 1, Size 64 64, \ Swallow "wmsysmon" 'Exec exec wmsysmon') #----------------- # The Cd Panel *WinMakerAppPanelCd: Rows 1 *WinMakerAppPanelCd: Back #c0c0c0 *WinMakerAppPanelCd: Fore black *WinMakerAppPanelCd: (Frame 1, Size 64 64, \ Swallow "wmmixer" 'Exec exec wmmixer -s') *WinMakerAppPanelCd: (Frame 1, Size 64 64, \ Swallow "wmcdplay" 'Exec exec wmcdplay -s') #------------------------------------------------------------------------------ #------------------ FvwmEvent #------------------------------------------------------------------------------ DestroyModuleConfig FvwmEvent: * # replace rplay by a sound player that can play .au sound file *FvwmEvent: Cmd "Exec exec rplay " *FvwmEvent: StartDelay 3 *FvwmEvent: Delay 1 *FvwmEvent: startup "/usr/share/sounds/gong.au" *FvwmEvent: add_window "/usr/share/sounds/wipe.au" *FvwmEvent: destroy_window "/usr/share/sounds/pook.au" *FvwmEvent: iconify "/usr/share/sounds/clong.au" *FvwmEvent: deiconify "/usr/share/sounds/clong.au" *FvwmEvent: windowshade "/usr/share/sounds/slide.au" *FvwmEvent: dewindowshade "/usr/share/sounds/slide.au" *FvwmEvent: new_page "/usr/share/sounds/slide.au" *FvwmEvent: new_desk "/usr/share/sounds/slide.au" #------------------------------------------------------------------------------ #------------------ FvwmGtk for GNOME menus #------------------------------------------------------------------------------ *FvwmGtk: IconSize 22 22 #G_SM_G 1 #*FvwmGtk: Destroy "gnome-sys" #G_SM_G 1 #PipeRead "fvwm-menu-desktop --desktop gnome-sys --install-prefix /usr --type gtk --enable-mini-icons" #G_RHM_G 2 #*FvwmGtk: Destroy "gnome-redhat" #PipeRead "fvwm-menu-desktop --desktop gnome-redhat --type gtk --enable-mini-icons" #G_UM_G 2 #*FvwmGtk: Destroy "gnome-user" #PipeRead "fvwm-menu-desktop --desktop gnome-user --type gtk --enable-mini-icons" #------------------------------------------------------------------------------ #------------------ IconBox #------------------------------------------------------------------------------ Style "FvwmIconBox" !Title, !Handles, Sticky, WindowListSkip, CirculateSkip DestroyModuleConfig FvwmIconBox: * *FvwmIconBox: Back #c0c0c0 *FvwmIconBox: Fore Black #WIN 1 *FvwmIconBox: IconHiBack Blue4 #FVWM 1 #*FvwmIconBox: IconHiBack SlateBlue *FvwmIconBox: IconHiFore white *FvwmIconBox: Geometry +0-0 *FvwmIconBox: MaxIconSize 48x48 *FvwmIconBox: Font "xft:sans-serif:Bold:pixelsize=12;-*-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*" *FvwmIconBox: SortIcons IconName #*FvwmIconBox: SortIcons ResClass *FvwmIconBox: Padding 10 *FvwmIconBox: FrameWidth 0 0 *FvwmIconBox: Lines 6 *FvwmIconBox: SBWidth 11 *FvwmIconBox: Placement Left Top *FvwmIconBox: HideSC Horizontal *FvwmIconBox: SetWMIconSize *FvwmIconBox: HilightFocusWin *FvwmIconBox: Resolution Desk *FvwmIconBox: UseSkipList # mouse bindings *FvwmIconBox: Mouse 1 Click DeiconifyFocusAndRaise *FvwmIconBox: Mouse 1 DoubleClick DeiconifyFocusAndWarp *FvwmIconBox: Mouse 2 Click Iconify *FvwmIconBox: Mouse 3 DoubleClick Iconify off *FvwmIconBox: Mouse 3 Click Menu Window-Ops3 c+0 -101m *FvwmIconBox: Mouse 3 DoubleClick FvwmIdent # Key bindings *FvwmIconBox: Key r RaiseLower *FvwmIconBox: Key space Iconify *FvwmIconBox: Key d Close # FvwmIconBox built-in functions *FvwmIconBox: Key n Next *FvwmIconBox: Key p Prev *FvwmIconBox: Key h Left *FvwmIconBox: Key j Down *FvwmIconBox: Key k Up *FvwmIconBox: Key l Right # animation *FvwmIconBoxNoIconAction SendToModule FvwmAnimate animate #------------------------------------------------------------------------------ #------------------ IconMan #------------------------------------------------------------------------------ Style "FvwmIconMan" !Title, !Handles, Sticky, WindowListSkip, CirculateSkip DestroyModuleConfig FvwmIconMan: * # nbr de manager *FvwmIconMan: nummanagers 2 #global, desk, or page #*FvwmIconMan: Resolution page *FvwmIconMan: Resolution global #*FvwmIconMan: Resolution desk *FvwmIconMan: background #c0c0c0 *FvwmIconMan: foreground Black *FvwmIconMan: plainbutton up Black #c0c0c0 *FvwmIconMan: selectbutton down Black #c0c0c0 #WIN 2 *FvwmIconMan: focusbutton up white Blue4 *FvwmIconMan: focusandselectbutton down white Blue4 #FVWM 2 #*FvwmIconMan: focusbutton up white SlateBlue #*FvwmIconMan: focusandselectbutton down white SlateBlue *FvwmIconMan: iconbutton down Black grey51 *FvwmIconMan: font "xft:sans-serif:Medium:pixelsize=12;-*-times-bold-r-*-*-12-*-*-*-*-*-*-*" *FvwmIconMan: followfocus true *FvwmIconMan: usewinlist true *FvwmIconMan: sort name *FvwmIconMan: drawicons always *FvwmIconMan: 2 title "Icon Man" #PREF 4 *FvwmIconMan: 1 title " emacs windows" *FvwmIconMan: 1 iconname "FvwmIconMan: emacs" *FvwmIconMan: 1 format "%i" *FvwmIconMan: 1 show resource=*macs *FvwmIconMan: 2 managergeometry 1x0+0-0 *FvwmIconMan: 1 managergeometry 1x0+260-0 *FvwmIconMan: 1 buttongeometry 200x22 *FvwmIconMan: 2 buttongeometry 250x22 # action *FvwmIconMan: action Mouse 1 N sendcommand DeiconifyFocusAndRaise *FvwmIconMan: action Mouse 2 N sendcommand Iconify *FvwmIconMan: action Mouse 3 N sendcommand "Menu Window-Ops3 c+0 -101m " *FvwmIconMan: action Key Left N gotobutton Left, select *FvwmIconMan: action Key Right N gotobutton Right, select *FvwmIconMan: action Key Up N gotobutton Up, select *FvwmIconMan: action Key Down N gotobutton Down, select *FvwmIconMan: action Key q A quit *FvwmIconMan: action Key i A sendcommand Iconify *FvwmIconMan: action Key g A sendcommand IconManGlobal *FvwmIconMan: action Key p A sendcommand IconManPage *FvwmIconMan: action Key d A sendcommand IconManDesk # animation *FvwmIconMan: NoIconAction "SendToModule FvwmAnimate animate" #------------------------------------------------------------------------------ #------------------ Identify #------------------------------------------------------------------------------ Style "FvwmIdent" Sticky, !Button 2, !Button 4, !Button 6 *FvwmIdent: Back Blue4 *FvwmIdent: Fore Yellow *FvwmIdent: Font ""xft:sans-serif:Medium;-adobe-times-medium-r-*-*-14-*-*-*-*-*-*-* #------------------------------------------------------------------------------ #------------------ FvwmPager: Swallowed by ButtonBar #------------------------------------------------------------------------------ Style "FvwmPagerPager" !Title, !Handles, Sticky, WindowListSkip, CirculateSkip DestroyModuleConfig FvwmPagerPager: * *FvwmPagerPager: UseSkipList *FvwmPagerPager: Back grey60 *FvwmPagerPager: Fore black *FvwmPagerPager: Font "xft:monospace:Bold:pixelsize=10;-adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* *FvwmPagerPager: Hilight white *FvwmPagerPager: MiniIcons *FvwmPagerPager: Balloons *FvwmPagerPager: BalloonFore black *FvwmPagerPager: BalloonBack bisque *FvwmPagerPager: BalloonFont "xft:monospace:Medium:pixelsize=10;-*-fixed-medium-r-*-*-10-*-*-*-*-*-*-*" *FvwmPagerPager: Geometry 319x69+5000+5000 #WIN 1 *FvwmPagerPager: WindowColors white grey51 white Blue4 #FVWM 1 #*FvwmPagerPager: WindowColors white grey51 white SlateBlue *FvwmPagerPager: Label 0 Fvwm *FvwmPagerPager: Label 1 Development *FvwmPagerPager: Label 2 Internet *FvwmPagerPager: Label 3 Misc *FvwmPagerPager: SmallFont "xft:sans-serif:Medium:pixelsize=8;-*-fixed-medium-r-*-*-8-*-*-*-*-*-*-*" #------------------------------------------------------------------------------ #------------------ FvwmPager: FvwmDesker, the panel of StartPagerButtons #------------------------------------------------------------------------------ Style "FvwmDesker" !Title, !Handles, Sticky, WindowListSkip, CirculateSkip DestroyModuleConfig FvwmDesker: * *FvwmDesker: UseSkipList *FvwmDesker: Back grey60 *FvwmDesker: Fore black *FvwmDesker: Font "xft:monospace:Bold:pixelsize=10;-*-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*" *FvwmDesker: Hilight white *FvwmDesker: Geometry 319x69+5000+5000 *FvwmDesker: MiniIcons *FvwmDesker: Balloons *FvwmDesker: BalloonFore black *FvwmDesker: BalloonBack bisque *FvwmDesker: BalloonFont "xft:monospace:Medium:pixelsize=10;-*-fixed-medium-r-*-*-10-*-*-*-*-*-*-*" #WIN 1 *FvwmDesker: WindowColors white grey51 white Blue4 #FVWM 1 *FvwmDesker: Label 0 Fvwm *FvwmDesker: Label 1 Development *FvwmDesker: Label 2 Internet *FvwmDesker: Label 3 Misc *FvwmDesker: SmallFont "xft:sans-serif:Medium:pixelsize=8;-*-fixed-medium-r-*-*-8-*-*-*-*-*-*-*" #------------------------------------------------------------------------------ #------------------ FvwmScript #------------------------------------------------------------------------------ *FvwmScript: DefaultFont "xft:sans-serif:Medium:pixelsize=12;-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*" *FvwmScript: DefaultFore black *FvwmScript: DefaultBack grey85 *FvwmScript: DefaultHilight grey100 *FvwmScript: DefaultShadow grey55 #------------------------------------------------------------------------------ #------------------ FvwmTaskBar #------------------------------------------------------------------------------ Style "FvwmTaskBar" !Title, !Handles, Sticky, WindowListSkip, \ CirculateSkip, TitleAtBottom # Note: Title at bottom is for shading. *FvwmTaskBar: Geometry +0-0 *FvwmTaskBar: Fore Black *FvwmTaskBar: Back #c0c0c0 *FvwmTaskBar: IconFore Black *FvwmTaskBar: IconBack grey51 *FvwmTaskBar: Font "xft:sans-serif:Medium:pixelsize=12;-adobe-times-medium-r-*-*-14-*-*-*-*-*-*-*" *FvwmTaskBar: SelFont "xft:sans-serif:Bold:pixelsize=12;-adobe-times-bold-r-*-*-14-*-*-*-*-*-*-*" *FvwmTaskBar: StatusFont "xft:sans-serif:Medium:pixelsize=12;*-fixed-medium-r-*-*-12-*-*-*-*-*-*-*" *FvwmTaskBar: Action Click1 DeiconifyFocusAndRaise *FvwmTaskBar: Action Click2 Iconify *FvwmTaskBar: Action Click3 Menu Window-Ops3 c+0 -101m *FvwmTaskBar: UseSkipList *FvwmTaskBar: AutoStick *FvwmTaskBar: StartName Start *FvwmTaskBar: StartMenu StartMenu mouse -100p -100m *FvwmTaskBar: StartIcon mini.penguin.xpm *FvwmTaskBar: ShowTips *FvwmTaskBar: ShowTransients #*FvwmTaskBar: HighlightFocus *FvwmTaskBar: AutoHide *FvwmTaskBar: DeskOnly *FvwmTaskBar: NoIconAction SendToModule FvwmAnimate animate #------------------------------------------------------------------------------ #------------------ FvwmWharf #------------------------------------------------------------------------------ Style "FvwmWharf" !Title, !Handles, Sticky, WindowListSkip, \ BorderWidth 2, CirculateSkip DestroyModuleConfig FvwmWharf: * *FvwmWharf: Animate *FvwmWharf: AnimateMain *FvwmWharf: Geometry -2-50 *FvwmWharf: Columns 1 *FvwmWharf: Bgcolor Grey #*FvwmWharf: ForceSize *FvwmWharf: FullPush *FvwmWharf: TextureType 1 *FvwmWharf: TextureColor WhiteSmoke DarkGrey *FvwmWharf X arrows2.xpm Folder *FvwmWharf kill rbomb2.xpm Close *FvwmWharf Recycler Jrecycle.xpm Restart *FvwmWharf Exit exit.xpm FvwmForm FvwmForm-QuitVerify *FvwmWharf xlock Jlock.xpm Exec exec xlock -nice 10 -mode random *FvwmWharf ~Folder #PREF 3 *FvwmWharf term rterm2.xpm Exec exec xterm *FvwmWharf editor lemacs.xpm Exec exec emacs *FvwmWharf filemgr Xfm.xpm Exec exec xfm *FvwmWharf Y arrows2.xpm Folder *FvwmWharf netscape nscape.xpm Exec exec netscape *FvwmWharf xview xv.xpm Exec exec xv *FvwmWharf gimp gimp.xpm Exec exec gimp *FvwmWharf GV gv.xpm Exec exec ghostview *FvwmWharf ~Folder *FvwmWharf xclock nil MaxSwallow "xclock" xclock -padding 0 -bg white *FvwmWharf xload nil MaxSwallow "xload" \ xload -nolabel -update 5 -bg grey51 -geometry -1500-1500 *FvwmWharf pager nil MaxSwallowModule "FvwmPagerPager" FvwmPager FvwmPagerPager * * #------------------------------------------------------------------------------ #------------------ FvwmWinList #------------------------------------------------------------------------------ Style "FvwmWinList" !Title, Sticky, WindowListSkip, CirculateSkip DestroyModuleConfig FvwmWinList: * *FvwmWinList: Back #c3c3c3 *FvwmWinList: Fore Black #WIN 1 *FvwmWinList: FocusBack Blue4 #FVWM 1 #*FvwmWinList: FocusBack SlateBlue *FvwmWinList: FocusFore white *FvwmWinList: IconBack grey51 *FvwmWinList: IconFore Black *FvwmWinList: Font "xft:sans-serif:Medium:pixelsize=12;-adobe-helvetica-bold-r-*-*-12-*-*-*-*-*-*-*" *FvwmWinList: Action Click1 DeiconifyFocusAndRaise *FvwmWinList: Action Click2 Iconify *FvwmWinList: Action Click3 Menu Window-Ops3 c+0 -101m *FvwmWinList: UseSkipList *FvwmWinList: ShowCurrentDesk *FvwmWinList: MinWidth 180 *FvwmWinList: MaxWidth 250 *FvwmWinList: Geometry +0-0 *FvwmWinList: NoIconAction SendToModule FvwmAnimate animate #SEG END #-----------------------------------------------------------------------------# # # THAT'S ALL FOLKS!! # #-----------------------------------------------------------------------------# # # -- Sample-95 MINI-FAQ -- # # # * Why doesn't this FAQ contain my question? # * What are the default bindings? # * Some (mini-)icons are missing in menus and in some buttons! # * Does Sample-95 support themes? # * Can I use Sample-95 with GNOME? # * How can I load saved settings before starting fvwm? # * Can I use WindowMaker and AfterStep applets with fvwm? # * Who wrote this configuration file? # # ---------------------------------------------------------------------------- # # * Why doesn't this FAQ contain my question? # # Maybe because the answer is in the beginning of the configuration file # (i.e., this file!), in the fvwm FAQ or in the fvwm man pages. # # ---------------------------------------- # # * What are the default bindings? # # Mouse bindings: # -------------- # # Mouse 1 on the root window: main menu # Mouse 2 on the root window: window operations menu # Mouse 3 on the root window: Window List of all normal applications # Ctrl-Mouse 3 on the root window: Window List of all skipped applications # # Alt-Mouse x inside a window: as Mouse x on the root window # Shift-Alt-Mouse 3 inside a window: Raise or Lower # If you have built the config for gnome-session: # Shift-Mouse x on the root window gives the corresponding "GNOME button" # Mouse 1 on the title: Raise, Move for a drag, shade for a double click # Mouse 1 on the borders: Raise, Resize for a drag, shade for a double click # Mouse 1 on an icon: Move, Raise on one click, deiconify for a double # Alt-Mouse 1 on an icon; Raise all the icons # Ctrl-Mouse 1 on the borders: As mouse 1 on the title # Mouse 2 on the title or the borders: window operations menu # Mouse 2 on an icon: deiconify # Mouse 3 on the title/borders: Raise or Lower # Mouse 3 on an icon: The "modules/icons" window operations menu # # Window Buttons: # -------------- # # - Left button: # Mouse 1: Window operation menu, double click: close # Mouse 2: Group operations menu # Mouse 3: Quick Move window menu # - Close button (right button) # Mouse 1: Close # Mouse 2: Close all the windows with the same class # Mouse 3: Destroy # - Maximize button (2nd right button) # Mouse 1: Full Maximize # Mouse 2: Maximize Horizontally # Mouse 3: Maximize Vertically # - Iconify button (3rd right button) # Mouse 1: Iconify # Mouse 2: Iconify all the windows with the same class # Mouse 3: Shade all the windows with the same class # # Key bindings (anywhere): # ------------ # # Shift-Left/Right/Up/Down: scroll Left/Right/Up/Down by 1 page # Alt-Left/Right/Up/Down: scroll Left/Right/Up/Down by 1/10 page # # Shift-Ctrl-Left/Right/Up/Down: move the pointer by 1O% of a page # Alt-Ctrl-Left/Right/Up/Down: move the pointer by 1% of a page # # Alt-Ctrl-PageUp/PageDown: scroll by one desktop page # # Shift-Alt-F1: Main menu # Shift-Alt-F2: Window operations menu # Shift-Alt-F3: WindowList # Shift-Alt-F4: Close # Shift-Alt-F5: RaiseLower # Shift-Alt-F6: Raise all Icons # Shift-Alt-F7: Move # Shift-Alt-F8: Resize # Shift-Alt-F9: Iconify # Shift-Alt-F10: Maximize # Shift-Alt-F11: Identify # Shift-Alt-F12: Console # # Alt-Tab released at once: previous (normal) window # Alt-Tab: WindowList of all normal windows and warp to the selected window # when released # # Ctrl-Alt-Tab: WindowList of all skipped windows # # Stroke bindings: # --------------- # # You need to have fvwm compiled with stroke support (these bindings # are defined only in this case) and libstroke installed. # Mouse button 3 is used (this button must be pressed during the stroke), # no modifiers are needed when you start your mouse motion on the root # window and you must use the Alt modifier if you start your mouse motion # on a window (you cannot start your motion on a window title bar or frame). # The mouses motion: # # A | from the top to the bottom: your preferred terminal # A | from the bottom to the top: your prefered editor # A / from the bottom to the top: your prefered file manager # A C from the top: xcalc # A N (from the bottom): netscape # A clockwise box from the top left: FvwmForm-QuitVerify # # Add more yourself! # # ---------------------------------------- # # * Some (mini-)icons are missing in menus and in buttons! # # If you have no mini(-icons) then either your ImagePath does not contain # the directory of the fvwm_icons or you are using a RedHat/Mandrake/... rpm # version of fvwm-icons which uses mini- in the place of mini. for # mini-icons name. If only some mini(-icons) are missing, then you are using # a too old version of fvwm_icons. # # ---------------------------------------- # # * Does Sample-95 support themes? # # No. But, it is possible to hack the configuration to have an "elementary" # themes engine. The basic idea is to use FvwmTheme to propagate the colors # and to replace "Read decorations" by "Read theme" in .fvwm2rc where theme # is a symbolic link to a theme. A theme will be a file which look like # decorations plus the FvwmTheme configuration commands. Other technical # functions are needed as a function for switching between themes. This is # left to your own pleasure! Doing elaborated fvwm configurations is one of # the better games under UNIX. # # If you want a powerful themes engine do not use Sample-95, it is not the # aim of this configuration. There are a powerful themes engine which is # under fast development: fvwm-themes (http://fvwm-themes.sourceforge.net/). # # # ---------------------------------------- # # * Can I use Sample-95 with GNOME? # # Yes. You "need" fvwm compiled with GNOME support and it is preferable to # run fvwm under gnome-session. Also, do not forget that you have to set # FVWM_USERDIR, so start the gnome-session as # env FVWM_USERDIR="your FVWM_USERDIR" gnome-session # Of course, it is preferable to set the "build a file for gnome-session" # option of the Setup95 script. You may use the option "Try a Stays Put panel" # to put the panel in the same layer than the normal windows, but you may # have to leave GNOME/fvwm and start again X to avoid problems. # Note that under session, Sample-95 does not load your "X settings" by # default (GNOME has its own method). Moreover, read the next question for # using a different setting when you use GNOME (you may also use the # Session(Init/Restart)Function functionality, see the startup file). # One thing that you can add to your configuration file is: # GnomeShowDesk x # where x is the number of desks you want to see in the GNOME pager at # start (if not the GNOME pager is dynamic). # Also, for leaving GNOME you must use GNOME or you must "QuitSession" for # just exiting or "Exec exec save-session --kill" for saving and exiting. # # ---------------------------------------- # # * How can I load saved settings before starting fvwm? # # Say, you want to use setting 1 under a normal fvwm session, setting 2 # under a gnome-session and setting 3 under a normal fvwm session but the # shell test FOO is true. Then, your .xinitrc/.xsession file can look # as follows (where $1 is the "first" argument given by startx, or by kdm or # gdm ...). # # ... # case $1 in # fvwm) # F="your FVWM_USERDIR" # if FOO; Then $X="3"; else $X=1; fi; # for i in $F/.FvwmAnimate $F/.FvwmForm $F/.fvwm-layers \ # ~/.xinitrc-fvwm $F/.FvwmBaseConfig \ $F/.start-Background \ # $F/.start-apps-man $F/.start-FvwmButtons $F/.start-DeskerPanelButtons \ # $F/.start-MiniButtons $F/.start-WinMakerAppButtons \ # $F/.start-FvwmAnimate $F/.start-FvwmAuto $F/.start-FvwmBanner \ # $F/.start-FvwmEvent; \ # do /bin/cp $i-$X $i; # done; # fvwm # ;; # gnome) # F="your FVWM_USERDIR" # for i in $F/.FvwmAnimate $F/.FvwmForm $F/.fvwm-layers \ # ~/.xinitrc-fvwm $F/.FvwmBaseConfig \ $F/.start-Background \ # $F/.start-apps-man $F/.start-FvwmButtons $F/.start-DeskerPanelButtons \ # $F/.start-MiniButtons $F/.start-WinMakerAppButtons \ # $F/.start-FvwmAnimate $F/.start-FvwmAuto $F/.start-FvwmBanner \ # $F/.start-FvwmEvent; \ # do /bin/cp $i-2 $i; # done; # env FVWM_USERDIR="your FVWM_USERDIR" gnome-session # ;; # ... other cases ... # esac # # ---------------------------------------- # # * Can I use WindowMaker and AfterStep applets with fvwm? # # Yes most WM and AS applets are fvwm compliant. Moreover, sample-95 provides # a FvwmButtons for you called WinMakerAppButtons. Of course, you have to # edit the configuration of this buttons to put your preferred applets. Note # that you have an applets panel under the 3 first applets. These panels are # special: Mouse 1 (on the background of the applet) start the panel (or only # map it if it is already started) if it is not out. If the panel is out, # Mouse 1 unmaps it (but the panel applets are alive). The special thing is # that Mouse 3 *kills* the panel: this can save your cpu. # # ---------------------------------------- # # * Who wrote this configuration file? # # The starting point is "the" fvwm95 configuration file. Then, Dominik # did some work on it and in particular so that it worked fine with # fvwm-2.3.x. Later, olicha spent a lot of time with it, wrote the Setup95 # Script and rewrote all the "Settings" stuff. Some ideas came from # fvwm-themes (thanks to the fvww-themes workers, and in particular migo). # Probably, some others fvwm-workers have added improvement but did not take # the time to update this answer. fvwm-2.6.5.orig/sample.fvwmrc/decor_examples0000644000175000017500000000216607260476106017340 0ustar vwcvwcDestroyMenu MiscStyles AddToMenu MiscStyles "Decor Menu" Title # Macro to define the decor function # Arg 0, DecorName, creates a function of the same name that # reads the function when the menu item is selected, # and adds the item to the MiscStyles menu # Optionally, a Decor can define the function "DecorRemoveHook" # which is run whenever a new decor is loaded. DestroyFunc DecorHook AddToFunc DecorHook I DestroyFunc $0 AddToFunc DecorHook I AddToFunc $0 I DecorRemoveHook AddToFunc DecorHook I AddToFunc $0 I PipeRead 'rm .fvwm/.DecorCurrent 2>/dev/null' AddToFunc DecorHook I AddToFunc $0 I PipeRead 'ln -s $0 .fvwm/.DecorCurrent 2>/dev/null' AddToFunc DecorHook I AddToFunc $0 I read .DecorCurrent AddToFunc DecorHook I AddToMenu MiscStyles "$1" $0 # Define an initial DecorRemoveHook: DestroyFunc DecorRemoveHook AddToFunc DecorRemoveHook I Nop # Load up the decor menu: PipeRead 'sed -n -e "s/\# DecorHook/DecorHook/p" .fvwm/Decor*[!~]' AddToMenu MiscStyles "&X. Remove current decor" Exec rm .fvwm/.DecorCurrent 2>/dev/null # Now load the current decor (if any) read .DecorCurrent quiet fvwm-2.6.5.orig/sample.fvwmrc/Makefile.in0000644000175000017500000003476711744241235016477 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = sample.fvwmrc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(configdir)" DATA = $(config_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ configdir = @FVWM_DATADIR@ EXTRA_DIST = decor_examples new-features system.fvwm2rc \ system.fvwm2rc-sample-1 system.fvwm2rc-sample-2 \ system.fvwm2rc-sample-95 DecorMwm DecorWin95 config_DATA = system.fvwm2rc-sample-95 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sample.fvwmrc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu sample.fvwmrc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-configDATA: $(config_DATA) @$(NORMAL_INSTALL) test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)" @list='$(config_DATA)'; test -n "$(configdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(configdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(configdir)" || exit $$?; \ done uninstall-configDATA: @$(NORMAL_UNINSTALL) @list='$(config_DATA)'; test -n "$(configdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(configdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(configdir)" && rm -f $$files tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(configdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-configDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-configDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-configDATA install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-configDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/sample.fvwmrc/new-features0000644000175000017500000003547411222754365016762 0ustar vwcvwc############################## # Sample .fvwm2rc file # Configured by Jay Kuri # 2/9/99 ############################## # Paths # Paths are given as a list of directories, seperated by colons # # ImagePath A list of directories where images (bitmaps, pixmaps, # etc) can be found. # # ModulePath A list of directories where fvwm modules are stored. # The compiled-in setting will contain all modules # distributed with fvwm, so you only set this if you # add your own modules in another directory. # ImagePath /usr/X11R6/include/X11/pixmaps/:$HOME/xpms:$HOME/pixmaps #ModulePath $FVWM_MODULEDIR:$HOME/fvwm-modules # set XORvalue to something visible. This sets the coloration of the # 'rubber-band' window-borders when moving and resizing windows. XORvalue 208 # Make our windows snap-up against other windows and make icons snap # up against other icons SnapAttraction 20 SameType # Font configuration # # WindowFont style Sets the font to be used in window title-bars # # IconFont style Sets the font that will be used for icon labels. # Style * Font -adobe-helvetica-bold-r-*-*-14-*-*-*-*-*-*-* Style * IconFont -adobe-helvetica-bold-r-*-*-14-*-*-*-*-*-*-* # Highlight color # # This sets the textcolor and background color for the active window Style * HilightFore #ffffff, HilightBack #1ea819 # BorderStyle # # This sets how the border of windows will be displayed. # Format: BorderStyle [state] [style] [ -- [!flag] ... ] # State is either Active or Inactive # The commands below set the borders to solid colors # BorderStyle Active -- NoInset HiddenHandles BorderStyle Inactive -- NoInset HiddenHandles # TitleStyle # # This option sets the style of the window title-bar # We set the Active style to a Green vertical gradient, # the Active (pushed down) style to the reverse of the green gradient # and the Inactive style to a blue vertical gradient # # Format: TitleStyle [state] [style] [ -- [!flag] ... ] # TitleStyle ActiveUp Vgradient 16 #1ea819 #065414 -- flat TitleStyle ActiveDown Vgradient 16 #065414 #1ea819 -- flat TitleStyle Inactive Vgradient 16 #11236b #03092b -- flat # The Second Variation of TitleStyle: # # Format: TitleStyle [ justification ] [ height num ] # TitleStyle LeftJustified height 18 # Button Styles # # Now we are going to set up the buttons # # The two commands we use are: # # ButtonStyle button [ state ] [ style ] [ -- [!]flag ... ] # # AddButtonStyle button [ state ] [ style ] [-- [!]flag ...] # # the 'button' is the number of the button you are defining, it can be # a number from 0-9 or the word 'all' which means apply the style to all # buttons. # Even button numbers are on the right, while odd button numbers are on the # left. The lower numbers are on the outside: 13579 title 86420 # # First, we set all buttons to start with the same style we are using for # the title. Then we define the pixmaps we use as our buttons using # AddButtonStyle. ButtonStyle All -- UseTitleStyle flat AddButtonStyle 1 Pixmap button.xpm AddButtonStyle 2 Pixmap button-max.xpm AddButtonStyle 4 Pixmap button-vert.xpm AddButtonStyle 6 Pixmap button-horiz.xpm AddButtonStyle 8 Pixmap button-close.xpm # MenuStyle # # MenuStyle is perhaps the most complicated configuration option. For this # reason we suggest you read the fvwm man page. However, using the # MenuStyle definition below, we will attempt to give you an idea of how to # use it. # # Format: MenuStyle stylename options # # The StyleName is a name to indicate which menustyle you are defining. All # of the menus get the '*' by default. (you can change the menu style a menu # uses with the 'changemenustyle' option) # # Here we set the default menu-style: # # Background sets the default menu background color # # ActiveFore sets the foreground color of the currently selected menu-item # # ForeGround sets the foreground color of non-selected menu-items # # Popupoffset sets the offset of child-menus. # Format: Popupoffset pixels percent # We set the percent to 100, making the child-menus pop-up to the right # of the existing menus. # # MenuFace sets the background of the menu using the 'fancy' options. # Menuface is another complicated one so again, check the man-page, # but I'll explain the one here: # This menuface command sets the background of the menus to a # Horizontal gradient using 64 colors, with one pair of colors, # from the color #758591 to the color #102030. # # Animation turns menu animations on. If you pop-up a submenu on the right # edge of the screen, the menu will move over so it is fully visible. # MenuStyle * background #455561, ActiveFore #ccfcf0, ForeGround black MenuStyle * popupoffset 0 100 MenuStyle * MenuFace HGradient 64 1 #758591 100 #102030, Animation # Set up some desktop options # # Desktop [Horizontal]x[vertical] Defines the virtual desktop size, # 1x1 = one physical screen size (no virtual desktop DesktopSize 1x1 # EdgeResistance scrolling moving # Sets how hard it is to change the desktop viewport # scrolling is in milliseconds # moving is in pixels (how far a window's edge must move to move off-screen # # These values don't much matter in this configuration as our viewport # is only as big as our screen anyway. EdgeResistance 750 75 # EdgeScroll horizontal vertical # Sets the percentage of a page to scroll when the cursor is on the edge # of the screen. Again, not useful in this configuration since we only # have a viewport as big as our screen. EdgeScroll 100 100 # OpaqueMoveSize percentage # This option tells fvwm the maximum size window that it should move # with contents intact (ie, not 'rubber-banding') You should keep this # low if you don't have good video hardware. OpaqueMoveSize 50 # Style related options # # Styles are used to set-up how windows are treated by the window manager. # They allow you to change the way windows are placed, decorated and treated # in general. You can give different options to different windows, so that # your xterms may be decorated differently than, say, your netscape window. # # The format of the style commands are: # Style windowname options # # The windowname is the window's name class or resource string that you want # this option to affect. You can use wildcards (such as * or ?), thus # "*" specifies options for all windows. # The options that you can specify with the Style command are many and varied # and really warrant a look at the fvwm man page. # # We set up some global defaults here for all windows. Style "*" ForeColor grey40 Style "*" BackColor #11236b Style "*" TileCascadePlacement Style "*" StickyIcon Style "*" IconBox 5 -50 -134 -5 Style "*" BorderWidth 5, HandleWidth 5 Style "*" !UsePPosition Style "*" NakedTransient # Some Fvwm-Related Styles Style "Fvwm*" !Title, !Handles, Sticky, WindowListSkip Style "FvwmWinList" !Title Style "FvwmPager" BorderWidth 0 # My own settings style "XTerm" BorderWidth 4, Handlewidth 4, Icon Monitor.xpm style "Netscape" BorderWidth 3, Handlewidth 3 Style "*clock" BorderWidth 0,!Title,!Handles,WindowListSkip,Sticky Style "XMcd" !Title Style "*Dialog_popup" WindowListSkip Style "*Download" WindowListSkip,!Title # Resources for Modules # # Resources are usually of the form # *Modulename: Option value # # Resources are used to configure fvwm modules. See the man page for each # module to find out what resources you can set # # FvwmPager *FvwmPager: Back #150525 *FvwmPager: Fore #484058 *FvwmPager: Font -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* *FvwmPager: Hilight #908090 *FvwmPager: DeskTopScale 64 *FvwmPager: Geometry -0-0 *FvwmPager: Label 0 Pager *FvwmPager: SmallFont 5x8 *FvwmPager: Columns 1 *FvwmPager: Label 0 All *FvwmPager: Label 1 Work *FvwmPager: Label 2 No *FvwmPager: Label 3 Play *FvwmPager: Balloons Pager *FvwmPager: Balloonfore white # FvwmForm # options for the FvwmForm module which we specify as 'Ssh' later on *Ssh: Fore #dfdfdf *Ssh: Back #303030 *Ssh: ItemBack black *Ssh: ItemFore #ffffff *Ssh: Font -*-lucidatypewriter-medium-r-*-*-14-*-*-*-m-*-*-* *Ssh: ButtonFont -*-lucidatypewriter-medium-r-*-*-14-*-*-*-m-*-*-* *Ssh: InputFont -*-lucidatypewriter-medium-r-*-*-14-*-*-*-m-*-*-* *Ssh: Line Left *Ssh: Text "Host" *Ssh: Input Host 30 *Ssh: Line Left *Ssh: Text "User" *Ssh: Input User 30 *Ssh: Line Center *Ssh: Button quit "OK" ^M *Ssh: Command Exec exec xterm -sl 1024 -cr white -fg white -bg black -T "\"$(Host)\"" -e ssh $(Host) -l $(User) & *Ssh: Button quit "Cancel" ^[ *Ssh: Command Nop # Function definitions # # Functions let you define more complex events than fvwm provides # in it's default configuration. It allows you to do multiple things # when something happens... for example. The following function # can be used on the titlebar of a window, and will allow you to move, # raise or windowshade a window when you move, click, or doubleclick # the titlebar, respectively. AddToFunc "Move-or-Raise" "M" Move + "M" Raise + "C" Raise + "D" WindowShade AddToFunc "Move-or-Iconify" "M" Move + "D" Iconify + "C" RaiseLower AddToFunc "Resize-or-Raise" "M" Resize + "M" Raise + "C" Raise + "D" RaiseLower AddToFunc "StartFunction" + "Immediate" Module FvwmPager 0 3 + "Immediate" Module FvwmAudio + "Immediate" Module FvwmAuto 750 + "Immediate" Module FvwmAnimate AddToFunc "InitFunction" + "Immediate" Exec xsetroot -solid \#050530 + "Immediate" Desk 0 2 + "Immediate" Desk 0 0 AddToFunc "RestartFunction" + "Immediate" Exec xsetroot -solid \#004020 AddToFunc "Maximize_func" "M" Maximize 0 100 + "C" Maximize 0 80 + "D" Maximize 100 100 # Popup menus # # Now we start defining menus. The Window-popups are used for # window-operations. # # Application and root-menu definitions come later AddToMenu "Window-Popup" "Window Ops" Title + "Move" Function Move-or-Raise + "Resize" Function Resize-or-Raise + "Raise" Raise + "Lower" Lower + "(De)Iconify" Iconify + "(Un)Stick" Stick + "(Un)Maximize" Function maximize_func + "Identify" Module FvwmIdent + "" Nop + "Destroy" Destroy + "Close" Close + "" Nop + "Refresh Screen" Refresh AddToMenu "Window-ops-Popup" "Move" Function Move-or-Raise + "Resize" Function Resize-or-Raise + "Raise" Raise + "Lower" Lower + "Iconify" Iconify + "(Un)Stick" Stick + "Identify" Module FvwmIdent + "" Nop + "Destroy" Destroy + "Close" Close + "" Nop + "Scrollbar" Module FvwmScroll 2 2 # Key bindings # # Now we set-up some hot-keys. # The format for Key-bindings is: # # Key keyname context modifier function # # context describes where the binding applies, W for an application window, # R for root window, A for anywhere, T for title, etc. # modifier is keyboard meta-keys which should be pressed, N for none, # S for Shift, M for Meta, C for Control, or A for any. You can combine # these, so things like SM (shift-Meta) are valid. # Key F3 W M Iconify Key F3 I M Iconify Key F4 W M Close Key F11 A C Exec exec xlock -mode swarm & Key F9 A M Desk 0 0 Key F10 A M Desk 0 1 Key F11 A M Desk 0 2 Key F12 A M Desk 0 3 # These are some neat ones. They allow you to hit control- # to switch focus to the window next to your current window in that direction. # Some people don't like this, if you don't, comment out these lines # Key Right A C Direction East (AcceptsFocus CurrentDesk !Iconic) Focus Key Left A C Direction West (AcceptsFocus CurrentDesk !Iconic) Focus Key Up A C Direction North (AcceptsFocus CurrentDesk !Iconic) Focus Key Down A C Direction South (AcceptsFocus CurrentDesk !Iconic) Focus # Familiar alt-tabbing Key Tab A M Next (AcceptsFocus CurrentDesk !Iconic) Focus Key Tab A SM Prev (AcceptsFocus CurrentDesk !Iconic) Focus # Mouse bindings # # Mouse bindings work in very much the same way as key bindings # # Format: Mouse Button Context Modifiers function # Mouse 1 R N Menu "Utilities" Nop Mouse 2 R N Menu "Window-Popup" Nop Mouse 3 R N Module FvwmWinList transient Mouse 1 1 N Iconify Mouse 3 1 N Menu "Window-ops-Popup" Nop Mouse 1 2 N Maximize Mouse 3 2 N Function "Resize-or-Raise" Mouse 1 4 N Maximize 0 100 Mouse 1 6 N Maximize 100 0 Mouse 1 8 N Delete Mouse 1 T N Function "Move-or-Raise" Mouse 1 SF N Function "Resize-or-Raise" Mouse 3 T N RaiseLower Mouse 1 I N Function "Move-or-Iconify" Mouse 3 I N Function "Move-or-Iconify" Mouse 2 TSFI N Menu "Window-ops-Popup" Nop Mouse 3 S N Function "Move-or-Iconify" # # Some Example Menus # # AddToMenu "Remote-Popup" "somewhere" exec xterm -sl 1024 -cr white -fg white -bg \#114433 -T Oneway -e ssh -l me somewhere.com + "generic" FvwmForm Ssh AddToMenu "Applications-Popup" "Netscape" Exec /usr/local/bin/netscape + "Addressbook" Exec addressbook + "Xdir" Exec xdir + "Knews" Exec knews AddToMenu "Graphics-Popup" "The GIMP" Exec xterm -fg \#30d030 -bg black -T gimpit -geometry 80x5+602+787 -e /usr/local/bin/gimp + "Tgif" Exec tgif + "Xpaint" Exec xpaint + "Xmag" Exec xmag + "XView" Exec xv + "Image Magick" Exec display AddToMenu "Development-Popup" "X-gdb" Exec xxgdb + "ddd" Exec ddd + "X-man" Exec xman AddToMenu "Accessories-Popup" "Calculator" Exec xcalc + "Seyon" Exec seyon -modems /dev/cuaa1 + "Nedit" Exec nedit + "Lock" Exec xlock -mode swarm AddToMenu "Games-Popup" "X-kobo" Exec xkobo + "X-boing" Exec xboing + "Mahjong" Exec xmj + "Minesweeper" Exec xmine + "X-Emeraldia" Exec xemeraldia -noscore + "Solitaire" Exec tksol AddToMenu "Sound-Popup" "X-Mixer" Exec xmmix + "Xm-CD Player" Exec xmcd AddToMenu "Module-Popup" "FvwmTalk" Module FvwmTalk + "Clean-Up" Module FvwmClean + "Identify" Module FvwmIdent + "IconManager" Module FvwmIconMan + "Control Animation" Popup MenuFvwmAnimate AddToMenu "Utilities" "Utilities" Title + "Xterm" Exec xterm -sl 1024 +ut -fg white -bg black -e tcsh + "" Nop + "Remotes" Popup Remote-Popup + "Applications" Popup Applications-Popup + "Graphics Apps" Popup Graphics-Popup + "Development" Popup Development-Popup + "Accessories" Popup Accessories-Popup + "Entertainment" Popup Games-Popup + "Sound Stuff" Popup Sound-Popup + "Modules" Popup Module-Popup + "" Nop + "Refresh" Refresh + "Quit X" Popup Quit-Verify AddToMenu "Quit-Verify" "Restart WM" Restart + "Yes, Really Quit" Quit + "" Nop + "No, Don't Quit" Nop fvwm-2.6.5.orig/sample.fvwmrc/system.fvwm2rc-sample-10000644000175000017500000002633111222754365020673 0ustar vwcvwc# this is a sample .fvwmrc file for fvwm-2. # Apparantly, you can retrieve sample .fvwmrc's from # ftp://ftp.best.com/pub/tdgilman/Fvwmrcs # you can also submit your favourite .fvwmrc to # tdgilman@best.com # if you want to. # small up triangle ButtonStyle 2 4 50x35@1 65x65@0 35x65@0 50x35@1 # small down triangle ButtonStyle 4 4 50x65@1 35x35@1 65x35@1 50x65@0 EdgeResistance 250 10 Style * Font -adobe-times-bold-r-*-*-18-*-*-*-*-*-*-* Style * IconFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* EdgeScroll 100 100 DeskTopSize 2x2 Menustyle * fvwm, Font -adobe-times-bold-r-*-*-14-*-*-*-*-*-*-* MenuStyle * Foreground maroon, Background grey60, Greyed grey40 ClickTime 750 ColormapFocus FollowsMouse Style * HilightFore black, HilightBack palevioletred Style * BorderWidth 5, HandleWidth 5 Style * Icon unknown1.xpm, Color Black/#40a0c0 Style * TileManualPlacement Style * MWMFunctions,MWMDecor,HintOverride Style * DecorateTransient,IconBox 0 -10 -280 -1 Style "Fvwm*" !Title, !Handles, Sticky, WindowListSkip, Style "Fvwm*" BorderWidth 0,CirculateSkipIcon Style "Fvwm Pager" StaysOnTop Style "FvwmPager" StaysOnTop Style "FvwmBanner" StaysOnTop Style "FvwmButtons" !Title, !Handles, Sticky, WindowListSkip Style "FvwmButtons" BorderWidth 0, CirculateSkip Style "FvwmButtons" Icon toolbox.xpm,ClickToFocus Style "*lock" !Title, !Handles, Sticky, WindowListSkip Style "*lock" TileCascadePlacement Style "xbiff" !Title, Sticky, WindowListSkip,ClickToFocus Style "Maker" StartsOnDesk 1,TileCascadePlacement,ClickToFocus Style "matlab" StartsOnDesk 3 Style "signal" StartsOnDesk 3 Style "rxvt" Icon term.xpm,SloppyFocus,IconBox -70 1 -1 -140 Style "XTerm" Icon xterm.xpm,IconBox -70 1 -1 -140 Style "XTerm" Color black/#aa80aa,MWMBorder,MWMButtons Style "Appointment" Icon datebook.xpm, !Button 2, !Button 4,ClickToFocus Style "xcalc" Icon xcalc.xpm, !Button 2,TileCascadePlacement,ClickToFocus Style "xmh" Icon mail1.xpm, !IconTitle,StickyIcon Style "xmh" TileCascadePlacement, StartsOnDesk 2, !Button 2 Style "xman" Icon xman.xpm,TileCascadePlacement,ClickToFocus Style "xvgr" Icon graphs.xpm,TileCascadePlacement,ClickToFocus Style "matlab" Icon math4.xpm,ClickToFocus Style "xmag" Icon mag_glass.xpm,CenterPlacement, ClickToFocus Style "xgraph" Icon graphs.xpm,TileCascadePlacement,ClickToFocus Style "sppeed6" Icon math3.xpm,!Title,ClickToFocus Style "sppeed6_user" Icon math4.xpm,!Title Style "xmosaic" !UsePPosition, color Green/Yellow,ClickToFocus Style "MetaCard" TileCascadePlacement, ClickToFocus Key Left A C Scroll -100 0 Key Right A C Scroll +100 +0 Key Up A C Scroll +0 -100 Key Down A C Scroll +0 +100 Key Left A M Scroll -10 +0 Key Right A M Scroll +10 +0 Key Up A M Scroll +0 -10 Key Down A M Scroll +0 +10 Key Left A SC CursorMove -1 0 Key Right A SC CursorMove +1 +0 Key Up A SC CursorMove +0 -1 Key Down A SC CursorMove +0 +1 Key Left A SM CursorMove -10 +0 Key Right A SM CursorMove +10 +0 Key Up A SM CursorMove +0 -10 Key Down A SM CursorMove +0 +10 Key KP_F1 A M Popup "Utilities" Key KP_F2 A M Popup "Window-Ops" Key KP_F3 A M Module FvwmWinList Key KP_F4 A M Iconify Key F5 A M Move 100p 100p Key F6 A M Resize 10 10 Key F7 A M Next (AcceptsFocus) focus Key F8 A M Prev (AcceptsFocus) focus Key F10 A A Next (AcceptsFocus rxvt) Focus Key F11 A A Prev (AcceptsFocus CurrentDesk rxvt) Focus Key F15 FTIWS A Raise Mouse 1 R A Menu Utilities Nop Mouse 2 R A Menu Window-Ops Nop Mouse 3 R A WindowList Mouse 0 1 A Menu Window-Ops2 Close Mouse 0 2 A Maximize-Func Mouse 0 4 A Iconify Mouse 1 F A Resize-or-Raise Mouse 1 TS A Move-or-Raise Mouse 1 I A Move-or-Iconify Mouse 2 I A Iconify Mouse 2 FST A Menu Window-Ops2 Nop Mouse 3 TSIF A RaiseLower ########################Initialization Functions ############################ AddToFunc StartFunction I Module FvwmButtons + I exec xsetroot -mod 2 2 -fg \#554055 -bg \#705070 ########################Menus ######################################## AddToMenu Utilities "Utilities" Title + "Xterm" Exec exec xterm -e tcsh & + "Rxvt" Exec exec rxvt & + "Remote Logins" Popup Remote-Logins + "Top" Exec exec rxvt -T Top -n Top -e top & + "Calculator" Exec exec xcalc & + "Xman" Exec exec xman & + "Xmag" Exec exec xmag & + "emacs" Exec exec xemacs & + "Mail" MailFunction xmh "-font fixed" + "" Nop + "Modules" Popup Module-Popup + "" Nop + "Exit Fvwm" Popup Quit-Verify AddToMenu Window-Ops "Window Ops" Title + "Move" Move-or-Raise2 + "Resize" Resize-or-Raise2 + "Raise" Raise + "Lower" Lower + "(De)Iconify" Iconify + "(Un)Stick" Stick + "(Un)Maximize" maximize_func + "" Nop + "Delete" Delete + "Close" Close + "Destroy" Destroy + "" Nop + "Refresh Screen" Refresh AddToMenu Window-Ops2 "Move" Move-or-Raise + "Resize" Resize-or-Raise + "Raise" Raise + "Lower" Lower + "Iconify" Iconify + "(Un)Stick" Stick + "" Nop + "Delete" Delete + "Close" Close + "Destroy" Destroy + "" Nop + "ScrollBar" Module FvwmScroll 2 2 + "Print" PrintFunction AddToMenu Remote-Logins "dopey" Exec ssh dopey rxvt -display $HOSTDISPLAY & + "snoopy" Exec ssh snoopy rxvt -display $HOSTDISPLAY & + "grumpy" Exec ssh grumpy rxvt -display $HOSTDISPLAY & + "happy" Exec ssh happy rxvt -display $HOSTDISPLAY & + "bailey" Exec ssh bailey rxvt -display $HOSTDISPLAY & + "barnum" Exec ssh barnum rxvt -display $HOSTDISPLAY & + "joker" Exec ssh joker rxvt -display $HOSTDISPLAY & + "signal" Exec rxterm signal AddToMenu Module-Popup "Modules" Title + "Button-Bar" Module FvwmButtons + "Clean-Up" Module FvwmClean + "Identify" Module FvwmIdent + "SaveDesktop" Module FvwmSave + "Debug" Module FvwmDebug + "Pager" Module FvwmPager 0 1 + "WinList" Module FvwmWinList + "Background" Module FvwmBacker + "IconBox" Module FvwmIconBox + "Banner" Module FvwmBanner + "Talk" Module FvwmTalk + "Prompt" Module FvwmPrompt "hello" raise AddToMenu Quit-Verify "Really Quit Fvwm?" Title + "Yes, Really Quit" Quit + "Restart Fvwm" Restart + "Restart Fvwm 1.x" Restart fvwm -s + "Start twm" Restart twm + "Start mwm" Restart mwm + "Start olwm" Restart /usr/openwin/bin/olwm + "Start tvtwm" Restart vtwm + "Start dummy" Restart xterm + "" Nop + "No, Don't Quit" Nop ########################Functions ######################################## AddToFunc MailFunction I Next (AcceptsFocus $0) Iconify -1 + I Next (AcceptsFocus $0) focus + I None (AcceptsFocus $0) Exec $0 $1 AddToFunc Move-or-Raise I Raise + M Move + D Lower AddToFunc Move-or-Raise2 M Raise + M Move + D Lower AddToFunc Maximize-Func M Maximize 0 100 + C Maximize 0 80 + D Maximize 100 100 AddToFunc Move-or-Iconify I Raise + M Move + D Iconify AddToFunc Resize-or-Raise I Raise + M Resize + D Lower AddToFunc Resize-or-Raise2 M Raise + M Resize + D Lower AddToFunc PrintFunction I Raise + I Exec xdpr -id $w AddToFunc Iconify-and-Raise I Iconify + I Raise ################## FvwmButtons button-bar ################################ # Colors *FvwmButtonsFore Black *FvwmButtonsBack #908090 # Font *FvwmButtonsFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* # Geometry - really likes to pick its own size, but giving a position is OK *FvwmButtonsGeometry -1-1 # Layout: specify rows or columns, not both *FvwmButtonsRows 2 # xterm or rxvts on remote machines can be done like this # Output re-direction is csh style, not sh style # You will want to substitute your own hosts here! *FvwmButtons Dopey rterm.xpm Exec "XTerm" ssh dopey "exec rxvt -T dopey -display $HOSTDISPLAY &/dev/null & "& *FvwmButtons Grumpy rterm.xpm Exec "XTerm" ssh grumpy "exec rxvt -T grumpy -display $HOSTDISPLAY &/dev/null & "& *FvwmButtons Snoopy rterm.xpm Exec "XTerm" ssh snoopy "exec rxvt -T snoopy -display $HOSTDISPLAY &/dev/null & "& *FvwmButtons signal rterm.xpm Exec "XTerm" rxterm signal & *FvwmButtons mail mail2.xpm Function MailFunction xmh "-font fixed" *FvwmButtons whatever clock.xpm Swallow "Clock" Exec rclock -bg \#908090 -geometry -1500-1500 -font -*-times-*-r-*-*-17-*-*-*-*-*-*-* -mailupdate 10 & *FvwmButtons(4x1) - whatever Swallow "FvwmPager" Module FvwmPager 0 3 ########################## Window-Identifier ############################### # Just choose colors and a fonts *FvwmIdentBack MidnightBlue *FvwmIdentFore Yellow *FvwmIdentFont -adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-*-* ########################### Pager ######################################### *FvwmPagerBack #908090 *FvwmPagerFore #484048 *FvwmPagerFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* *FvwmPagerHilight #cab3ca *FvwmPagerGeometry -1-1 *FvwmPagerLabel 0 Misc *FvwmPagerLabel 1 Maker *FvwmPagerLabel 2 Mail *FvwmPagerLabel 3 Matlab *FvwmPagerSmallFont 5x8 ##########################FvwmWinList################################## *FvwmWinListBack #908090 *FvwmWinListFore Black *FvwmWinListFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* *FvwmWinListAction Click1 Iconify -1,Focus *FvwmWinListAction Click2 Iconify *FvwmWinListAction Click3 Module "FvwmIdent" FvwmIdent *FvwmWinListUseSkipList *FvwmWinListGeometry +0-1 *FvwmBackerDesk 0 -solid steelblue *FvwmBackerDesk 1 -solid midnightblue *FvwmScrollBack grey40 *FvwmScrollFore green ############################################################ ############################################################ # Note that icons are shown in the module # only if Icon commnand is applied. #Style * !Icon ############################################################ *FvwmIconBoxIconBack #cfcfcf *FvwmIconBoxIconHiFore black *FvwmIconBoxIconHiBack LightSkyBlue *FvwmIconBoxBack #5f9ea0 #*FvwmIconBoxFore blue *FvwmIconBoxGeometry 5x1+0+0 *FvwmIconBoxMaxIconSize 64x38 *FvwmIconBoxFont -adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-*-* *FvwmIconBoxSortIcons IconName *FvwmIconBoxPadding 4 *FvwmIconBoxLines 10 *FvwmIconBoxSBWidth 11 *FvwmIconBoxPlacement Left Top *FvwmIconBoxPixmap fvwm.xpm #*FvwmIconBoxHideSC Horizontal *FvwmIconBoxSetWMIconSize *FvwmIconBoxHilightFocusWin #*FvwmIconBoxResolution Desk *FvwmIconBoxMouse 1 Click RaiseLower *FvwmIconBoxMouse 1 DoubleClick Iconify *FvwmIconBoxMouse 2 Click Iconify -1, Focus *FvwmIconBoxMouse 3 Click Module FvwmIdent *FvwmIconBoxKey r RaiseLower *FvwmIconBoxKey space Iconify *FvwmIconBoxKey d Close *FvwmIconBoxKey n Next *FvwmIconBoxKey p Prev *FvwmIconBoxKey h Left *FvwmIconBoxKey j Down *FvwmIconBoxKey k Up *FvwmIconBoxKey l Right # # Icon file specifications # # Mostly, you don't have to specify icon files, as FvwmIconBox now # reads icon files specified in Style commands. # *FvwmIconBox "Fvwm*" - fvwm-2.6.5.orig/sample.fvwmrc/system.fvwm2rc-sample-20000644000175000017500000005023311705516565020676 0ustar vwcvwc########################################################################## # Fvwm - F? Virtual Window Manager, Version 2.x (fvwm) Configuration File # Created April 1996 # ########################################################################## # PATH Setup # # Not normally needed; use configure to set defaults at compile time. # # IMPORTANT: if you decide to set a ModulePath, please note that modules # are normally installed into a version-dependent # directory. Be sure to update this file after installing # a new version. # # Colon seperated unix directory paths for Modules, and for images #ModulePath /usr/local/libexec/fvwm/2.x.y #ImagePath /usr/include/X11/pixmaps:/usr/local/include/X11/pixmaps ############################################################################ # COLORS and FONTS # # Set the fore and back border colors for the window that has focus Style * HilightFore linen, HilightBack SteelBlue4 # Set fore/back border colors for all other windows Style * Color linen/VioletRed4 # Set colors/font for pop-up menus Menustyle * fvwm, Font -adobe-times-bold-r-*-*-14-*-*-*-*-*-*-* MenuStyle * Foreground maroon, Background grey60, Greyed grey40 #Menustyle * fvwm, Font 7x13bold #MenuStyle * Foreground black, Background grey, Greyed slategrey # Set fonts to use on title bar and icon label Style * Font 9x15 # Style * Font -adobe-times-bold-r-*-*-18-*-*-*-*-*-*-* Style * IconFont 9x15 # Style * IconFont -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-* ############################################################################ # ICON Setup # # Auto Place Icons is a nice feature (Left Top Right Bottom) Style * IconBox -215 200 -1 -100 # If you don't want icons for some or all windows (or all of them!) # Style * !Icon # If you want ALL icons to follow you around the desktop (Sticky) #Style * StickyIcon ############################################################################ # FOCUS Setup # # Does the window with focus control the colormap, or the one under the mouse # ColormapFocus FollowsFocus # ColormapFocus FollowsMouse # Uncomment this to force you to click in a window to give it focus #Style * ClickToFocus # default: focus follows mouse #Style * MouseFocus # If you knock your mouse out of the xterm, it keeps focus while in root window Style "*term" SloppyFocus ############################################################################ # MISC Setup # # click/release must occur in * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include #include #include #include void paste_primary(Display *dpy, int window, int property, int delete) { Atom actual_type; int actual_format; unsigned long nitems, bytes_after, nread; unsigned char *data, *d, *h, buf[256]; if (property == None) { window = DefaultRootWindow (dpy); property = XA_CUT_BUFFER0; delete = False; } nread = 0; h = buf; do { if (XGetWindowProperty (dpy, window, property, nread/4, 1024L, delete, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, (unsigned char **)&data) != Success) return; if (actual_type != XA_STRING) return; /* send the text line-by-line, recognize continuation lines */ d = data; while (1) { switch (*d) { case '\n': *h = 0; break; case '\\': if (d[1] == '\n') { *h = ' '; d++; break; } /* fall through */ default: *h = *d; } if (h - buf == 255) { fprintf(stderr, "xselection: line too long\n"); *h = 0; } if (*h == 0) { h = buf; while (*h == ' ') h++; printf ("%s\n", h); h = buf; } else h++; if (*d == 0) break; d++; } nread += nitems; XFree (data); } while (bytes_after > 0); } int main (int argc, char **argv) { XEvent event; Atom sel_property; char *display_name = NULL; Display *dpy; Window window; if (!(dpy = XOpenDisplay (display_name))) { fprintf (stderr, "xselection: can't open display %s\n", XDisplayName (display_name)); exit (1); } window = XCreateSimpleWindow (dpy, DefaultRootWindow(dpy), 0,0,10,10, 0,0,0); sel_property = XInternAtom (dpy, "VT_SELECTION", False); XConvertSelection (dpy, XA_PRIMARY, XA_STRING, sel_property, window, CurrentTime); while (1) { XNextEvent (dpy, &event); if (event.type == SelectionNotify) { paste_primary (dpy, event.xselection.requestor, event.xselection.property, True); exit (0); } } } fvwm-2.6.5.orig/utils/configure_dev.sh0000755000175000017500000000032707647133475016162 0ustar vwcvwc#!/bin/sh # reconfigure CVS source code # must be called from main fvwm directory set -x aclocal || exit 1 autoheader || exit 2 automake --add-missing || exit 3 autoreconf || exit 4 ./configure ${1+"$@"} || exit 5 fvwm-2.6.5.orig/utils/changelog.vim0000644000175000017500000000543510373323462015440 0ustar vwcvwc" File: changelog.vim " Summary: A function adding a ChangeLog entry. " Author: David Necas (Yeti) " URL: http://trific.ath.cx/Ftp/vim/scripts/changelog.vim " License: This Vim script is in the public domain. " Version: 2004-10-08 " Usage: Do :ChangeLog inside a function you've just changed. " Customization: " Set your name and e-mail in .vimrc: " let changelog_maintainer_name = "Me " " Set function name matching regex for particular filetype: " let b:changelog_function_re = "^\\s*sub\\s*" " let b:changelog_function_re = "^\\s*\\(def\\|class\\)\\s*" " let b:changelog_function_re = "^\\(procedure\\|function\\)\\s\\+" " ... " The default is "^" appropriate for C, "" switches function names off. command! -nargs=0 ChangeLog call ChangeLog() function! s:ChangeLog() " Maintainer's name, try to guess when undefined if !exists('g:changelog_maintainer_name') echoerr 'changelog_maintainer_name not defined! guessing...' let node=substitute(system('hostname -f'), "\n", '', 'g') let usrinfo=system('grep ^`id -un`: /etc/passwd') let login=matchstr(usrinfo,'^\w\+') let t=matchend(usrinfo,'\w\+:[^:]\+:\d\+:\d\+:') let name=matchstr(usrinfo,'[^:]\+',t) let g:changelog_maintainer_name=name.' <'.login.'@'.node.'>' endif " Find current function name let l=line('.') let c=col('.') if exists('b:changelog_function_re') if strlen(b:changelog_function_re) == 0 let re='' else let re=b:changelog_function_re.'\w\+\s*[({]' endif else let re='^\w\+\s*[({]' endif if strlen(re) > 0 && search(re, 'bW') > 0 let foo=matchstr(getline('.'),'\w\+\(\s*[({]\)\@=') call cursor(l,c) if strlen(foo) > 0 let foo=' ('.foo.')' endif else let foo='' endif " Find and open the ChangeLog let f=expand('%:p:h') while strlen(f)>1 && !filewritable(f.'/ChangeLog') let f=fnamemodify(f,':h') endwhile let rf=strpart(expand('%:p'),strlen(f)+1) " Relativize filename let f=f.'/ChangeLog' if !filewritable(f) echoerr "Cannot find ChangeLog in parent directories" return endif execute "split ".f " Add the entry call cursor(1,1) " FIXME: If changelog_time_format changes, this should change too call search('^\u\l\l \u\l\l \+\d\+ \d\d:\d\d:\d\d ', 'W') call cursor(line('.')-1,0) call append('.','') call append('.',' ') " Some people may want a TAB here if exists('g:changelog_time_format') let timefmt=g:changelog_time_format else " Try to emulate date(1) output while being fairly portable (incl. Win32) let timefmt="%a %b %d %H:%M:%S %Z %Y" endif call append('.',' * '.rf.foo.':') " Some people may want a TAB here call append('.',strftime(timefmt).' '.g:changelog_maintainer_name) call cursor(line('.')+3,10000) endfunction fvwm-2.6.5.orig/utils/ChangeLog0000644000175000017500000000337110634077523014547 0ustar vwcvwc2007-06-14 Dominik Vogt * fvwm_make_browse_menu.sh: fixed script 2007-01-28 Dominik Vogt * Makefile.am (LDADD): 2006-08-29 Harald Dunkel * xselection.c: change offset and length args for XGetWindowProperty() to long (to support 64bit architectures) 2006-02-11 Dominik Vogt * changelog.vim: * Makefile.am (EXTRA_DIST): added :ChangeLog command script for vim 2005-11-26 Dominik Vogt * xselection.c: do not #include stdlib.h (comes from config.h) 2004-03-19 Dominik Vogt * fvwm_make_browse_menu.sh: * fvwm_make_directory_menu.sh: quoting security fix 2003-04-15 Dan Espen * configure_dev.sh: Nice streamlining from Cameron Simpson. 2002-04-12 Mikhael Goikhman * Makefile.am (EXTRA_DIST): * fvwm_make_browse_menu.sh: * fvwm_make_directory_menu.sh: moved from bin to utils again, may be installed into docdir later 2002-11-07 Dominik Vogt * Makefile.am (EXTRA_DIST): distribute the build scripts * fvwm_make_browse_menu.sh: * fvwm_make_directory_menu.sh: moved from utils to bin 2002-09-13 Dominik Vogt * configure_dev.sh: added autoheader 2002-08-12 Dominik Vogt * xselection.c: let config.h include strinh.h or strings.h 2002-04-12 Mikhael Goikhman * *: split utils/ directory into 2 directories: bin/ - for programs installed into ${bindir} utils/ - mainly for developer utilities The entries prior to 12-Apr-2002 may be found in ../bin/ChangeLog. fvwm-2.6.5.orig/utils/fvwm_make_directory_menu.sh0000755000175000017500000000440710026616067020416 0ustar vwcvwc#!/bin/sh # ### # This script demonstates the fvwm menu MissingSubmenuFunction functionality. # You can use a more configurable fvwm-menu-directory instead. # The line below almost exactly simulates this script: # fvwm-menu-directory --links --order 4 --exec-file vi --dir DIR ### # # Modification History # # Created on 06/07/99 by Dominik Vogt (domivogt): # # provides output to read in with PipeRead to build a menu # containing a directory listing. # # You should put these lines into your fvwm configuration file to invoke # this script: # # AddToFunc MakeMissingDirectoryMenu # + i piperead 'fvwm_make_directory_menu.sh '$0 # # And put these lines in the menu from which you want to pop up the # directory menus: # # AddToMenu SomeMenu MissingSubmenuFunction MakeMissingDirectoryMenu # + "my directory item" Popup /whatever/path/you/like # # Note: please use absolute path names. # # configuration section # # If you want to optimize for speed, unset this variable. Warning: speed # optimization takes up a lot of memory that is never free'd again while fvwm # is running. OPTIMIZE_SPACE=yes # you may use the absolute path here if you have an alias like ls="ls -F" LS="/bin/ls -LF" SED=sed # the name of our menu MENU=`echo $1 | $SED -e 's://*:/:g'` PMENU=`echo "$MENU" | $SED -e s:\"::g` # the command to execute on plain files ACTION=vi # the terminal program to invoke TERMINAL="xterm -e" TERMINALSHELL="xterm" # # you may customize this script below here. # # dump all menu items echo DestroyMenu recreate \""$PMENU"\" # add a new title echo AddToMenu \""$PMENU"\" \""$PMENU"\" Exec "echo cd $MENU\; $TERMINALSHELL | $SHELL" # add a separator echo AddToMenu \""$PMENU"\" \"\" nop # destroy the menu after it is popped down if [ "$OPTIMIZE_SPACE" = yes ] ; then echo AddToMenu \""$PMENU"\" DynamicPopDownAction DestroyMenu \""$PMENU"\" fi # set the 'missing submenu function' echo AddToMenu \""$PMENU"\" MissingSubmenuFunction MakeMissingDirectoryMenu # add directory contents $LS "$MENU" 2> /dev/null | $SED -n ' /\/$/ bdirectory s:[=*@|]$::1 s:"::g s:^\(.*\)$:AddToMenu "'"$PMENU"'" "\1" Exec '"$TERMINAL $ACTION"' "'"$MENU"'/\1":1 bnext :directory s:^\(.*\)/$:AddToMenu "'"$PMENU"'" "\1" Popup "'"$PMENU"'/\1" item +100 c:1 :next s://*:/:g p ' fvwm-2.6.5.orig/utils/quantize_pixmaps0000755000175000017500000000230306610765111016312 0ustar vwcvwc#!/bin/sh cd $HOME/tmp-icons # We process all of the xpm files in ~/icons, reducing their collective # colourmap, and producing files in ~/tmp-icons. # Make a note of those files with transparent bits for zapping afterwards: # this isn't perfect, but seems to work OK for the pixmaps that I use. # Notice that the input, output, and number of colours are hardwired. # (The ppmtogif | giftoppm is to make sure the ppm file is in raw format, because # ppmquant appears not to work with the result of xpmtoppm!) echo Converting files to ppm format NONE="" for i in ../icons/*.xpm do echo -n $i " " sed 's/[Nn]one/black/g' $i | xpmtoppm | ppmtogif | giftoppm > `basename $i .xpm`.ppm if test -s `basename $i .xpm`.ppm then if grep -iq None $i then NONE="$NONE `basename $i`" fi else rm -f `basename $i .xpm`.ppm fi done echo Performing quantization to 32 colours ppmquantall 32 *.ppm echo Converting to xpm format again for i in *.ppm do echo -n $i " " ppmtoxpm $i > `basename $i .ppm`.xpm rm -f $i done echo Trying to fix transparent pixels in some files for i in $NONE do echo $i sed 's/` c #000000/` c None/' $i > $i-tmp.xpm mv $i-tmp.xpm $i done fvwm-2.6.5.orig/utils/Makefile.am0000644000175000017500000000076310373323462015027 0ustar vwcvwc## Process this file with automake to create Makefile.in ## Don't build and install xselection, there is a better xselection package. EXTRA_PROGRAMS = xselection EXTRA_DIST = quantize_pixmaps build_dev.sh configure_dev.sh rebuild_dev.sh \ fvwm_make_browse_menu.sh fvwm_make_directory_menu.sh changelog.vim LDADD = -L$(top_builddir)/libs $(X_LIBS) -lfvwm $(xpm_LIBS) \ $(X_PRE_LIBS) -lXext -lX11 -lm $(X_EXTRA_LIBS) $(png_LIBS) INCLUDES = -I$(top_srcdir) $(xpm_CFLAGS) $(X_CFLAGS) $(png_CFLAGS) fvwm-2.6.5.orig/utils/build_dev.sh0000755000175000017500000000025307205224516015261 0ustar vwcvwc#!/bin/sh # call make with -Wall -Werror # must be called from main fvwm directory echo 'make CFLAGS="-O2 -g -Wall -Werror"' make CFLAGS="-O2 -g -Wall -Werror" || exit 1 fvwm-2.6.5.orig/utils/fvwm_make_browse_menu.sh0000755000175000017500000000447610634077523017724 0ustar vwcvwc#!/bin/sh # ### # This script demonstrates the fvwm menu DynamicPopupAction functionality. # You can use a more configurable fvwm-menu-directory instead. # The line below almost exactly simulates this script: # fvwm-menu-directory --reuse --links --order 4 --name \ # --exec-file vi --exec-title - --special-dirs ### # # Modification History # # Created on 05/06/99 by Dominik Vogt (domivogt): # # provides output to read in with PipeRead to build a menu # containing a directory listing. # # You should put these lines into your fvwm configuration file to invoke # this script: # # AddToMenu # + DynamicPopupAction Piperead 'fvwm_make_browse_menu.sh ' # # configuration section # # the file containing the desired directory name DIRFILE="$HOME/.fvwm_browse_menu_cwd" # you may use the absolute path here if you have an alias like ls="ls -F" LS=ls SED=sed # the name of our menu MENU=`echo "$1" | $SED -e s:\"::g` # the command to execute on plain files ACTION=vi # the terminal program to invoke TERMINAL="xterm -e" # # you may customize this script below here. # # create a file containing the current working directory if [ ! -f "$DIRFILE" ] ; then echo "$HOME" > "$DIRFILE" fi # get desired directory DIR="`cat "$DIRFILE"`" if [ ! -d "$DIR" ] ; then DIR="$HOME" fi # dump all menu items echo DestroyMenu recreate \""$MENU"\" # add a new title echo AddToMenu \""$MENU"\" \"`cat "$DIRFILE"`\" Title # add '..' entry cd "$DIR"/.. echo AddToMenu \""$MENU"\" \"..\" PipeRead \'echo \""`/bin/pwd`"\" \> "$DIRFILE" ';' echo Menu \\\""$MENU"\\\" WarpTitle\' # add separator echo AddToMenu \""$MENU"\" \"\" Nop # add $HOME entry echo AddToMenu \""$MENU"\" \"~\" PipeRead \'echo \""$HOME"\" \> "$DIRFILE" ';' echo Menu \\\""$MENU"\\\" WarpTitle\' # add separator echo AddToMenu \""$MENU"\" \"\" Nop # add directory contents for i in `"$LS" "$DIR"` ; do if [ -d "$DIR/$i" ] ; then # it's a directory cd "$DIR/$i" # put new path in $DIRFILE and invoke the menu again echo AddToMenu \""$MENU"\" \""$i/"\" PipeRead \'echo \"`echo $DIR/$i|$SED -e s://:/:g`\" \> "$DIRFILE" ';' echo Menu \\\""$MENU"\\\" WarpTitle\' else # something else, apply $ACTION to it echo AddToMenu \""$MENU"\" \""$i"\" Exec $TERMINAL $ACTION \""$DIR/$i"\" fi done fvwm-2.6.5.orig/po/0000755000175000017500000000000011744241503012241 5ustar vwcvwcfvwm-2.6.5.orig/po/FvwmTaskBar.ar.po0000644000175000017500000000172211744241503015373 0ustar vwcvwc# Arabic translations for fvwm package. # Copyright (C) 2002 fvwm workers # This file is distributed under the same license as the fvwm package. # Nadim Shaikli # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2003-04-11 12:43+0200\n" "PO-Revision-Date: 2002-12-06 08:25+0100\n" "Last-Translator: Nadim Shaikli \n" "Language-Team: Arabic\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 0.9.6\n" #: ../modules/FvwmTaskBar/Goodies.c:462 msgid "No new mail" msgstr "لا يوجد رسائل جديدة" #: ../modules/FvwmTaskBar/Goodies.c:466 msgid "You have new mail" msgstr "لديك رسائل جديدة" #: ../modules/FvwmTaskBar/Goodies.c:470 msgid "You have mail" msgstr "لديك رسائل بالبريد" #: ../modules/FvwmTaskBar/FvwmTaskBar.c:1320 msgid "Click here to start" msgstr "أضغط هنا للبدأ" fvwm-2.6.5.orig/po/FvwmScript.ar.po0000644000175000017500000001367111744241503015316 0ustar vwcvwc# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR fvwm workers # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2002-11-28 14:23+0100\n" "PO-Revision-Date: 2003-04-13 11:35+0200\n" "Last-Translator: NEEDS TRANSLATION \n" "Language-Team: Should be Arabic \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ascii\n" "Content-Transfer-Encoding: 8bit\n" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 2 msgid "Bell Setup" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 44 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 43 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 47 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 132 msgid "Apply" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 62 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 62 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 66 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 170 msgid "Save" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 80 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 89 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 94 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 235 msgid "Quit" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 95 msgid "Beep" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 130 msgid "Volume:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 156 msgid "Pitch(Hz):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 182 msgid "Duration(ms):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 207 msgid "Bell" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 2 msgid "Keyboard Setup" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 120 msgid "Click Volume (%)" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 133 msgid "AutoRepeat On" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 159 msgid "Start Delay: " msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 185 msgid "Repeat Delay:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 210 msgid "Keyboard" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 2 msgid "Pointer Setup" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 108 msgid "Right-handed user|Left-handed user" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 122 msgid "Mouse configuration:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 150 msgid "Acceleration:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 177 msgid "Threshold (pixels):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 202 msgid "Pointer" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 2 msgid "Screen Setup" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 264 msgid "Background" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 279 msgid "Uniform color:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 394 msgid "Pixmap:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 425 msgid "Browser..." msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 468 msgid "Disable xinit background" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 500 msgid "Screen-saver" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 514 msgid "Blank" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 528 msgid "Timeout(s):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 554 msgid "Pattern" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 569 msgid "Cycle(s):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 614 msgid "DPMS" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 628 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 768 msgid "Enable" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 643 msgid "Disable" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 657 msgid "Standby(s):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 684 msgid "Suspend(s):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 711 msgid "Off(s):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 754 msgid "xscreensaver" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 794 msgid "Config and Demo" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 2 msgid "File Browser" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 42 msgid "OK" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 58 msgid "Cancel" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 86 msgid "Path:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 181 msgid " Show hidden files" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 246 msgid "Selected file:" msgstr "" fvwm-2.6.5.orig/po/FvwmTaskBar.fr.gmo0000644000175000017500000000120511744241503015540 0ustar vwcvwcDl P:ShClick here to startNo new mailYou have mailYou have new mailProject-Id-Version: fvwm POT-Creation-Date: 2003-04-11 12:43+0200 PO-Revision-Date: 2002-11-27 21:29+0100 Last-Translator: Olivier Chapuis Language-Team: French Language: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); Cliquer ici pour ouvrir le menuPas de nouveaux messagesVous avez un messageVous avez un nouveau messagefvwm-2.6.5.orig/po/FvwmScript.zh_CN.gmo0000644000175000017500000000471311744241503016056 0ustar vwcvwc/C  ,: @ NY^ cn t   &)17 ?JR Zh m"{     " *E7}     ';SZj q~     " / B U d t       # /+ $&*('!-,.% ") Show hidden filesAcceleration:ApplyAutoRepeat OnBackgroundBeepBellBell SetupBlankBrowser...CancelClick Volume (%)Config and DemoCycle(s):DPMSDisableDisable xinit backgroundDuration(ms):EnableFile BrowserKeyboardKeyboard SetupMouse configuration:OKOff(s):Path:PatternPitch(Hz):Pixmap:PointerPointer SetupQuitRepeat Delay:Right-handed user|Left-handed userSaveScreen SetupScreen-saverSelected file:Standby(s):Start Delay: Suspend(s):Threshold (pixels):Timeout(s):Uniform color:Volume:xscreensaverProject-Id-Version: FvwmScript POT-Creation-Date: 2002-11-28 14:23+0100 PO-Revision-Date: 2004-05-22 16:16+0800 Last-Translator: Funda Wang Language-Team: zh_CN Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 显示隐藏文件加速:应用自动重复开背景响铃相应响铃设置空浏览器...取消点击音量(%)配置并演示循环(秒):DPMS禁用禁用 xinit 背景持续时间(毫秒):启用文件浏览器键盘键盘设置鼠标配置:确定关机(秒):路径:图案频率(Hz):像素图:指针指点设备设置退出重复延迟:右手用户|左手用户保存屏幕设置屏幕保护程序选中的文件:待机(秒):启动延迟:休眠(秒):阀值(像素):计时(秒):单一颜色:音量:xscreensaverfvwm-2.6.5.orig/po/FvwmScript.fr.gmo0000644000175000017500000000426611744241503015467 0ustar vwcvwc(\5pq      ( /<ETiltz  "     #/>PF    !0 5@ R]e!(AQfv  & ( #$ ' " ! % Show hidden filesAcceleration:ApplyAutoRepeat OnBackgroundBellBell SetupBrowser...CancelClick Volume (%)Config and DemoDPMSDisableDisable xinit backgroundDuration(ms):EnableFile BrowserKeyboardKeyboard SetupMouse configuration:OKOff(s):Path:Pixmap:PointerPointer SetupQuitRepeat Delay:Right-handed user|Left-handed userSaveScreen SetupScreen-saverSelected file:Standby(s):Start Delay: Suspend(s):Timeout(s):Uniform color:Volume:Project-Id-Version: fvwm POT-Creation-Date: 2002-11-28 14:23+0100 PO-Revision-Date: 2003-04-13 11:35+0200 Last-Translator: Olivier Chapuis Language-Team: French Language: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); Fichiers cachsAcclration:AppliquerRptition ActiveFondClocheConfiguration de la ClocheParcourirAnnulerVolume d'un clique (%)Config et DmoDPMSDsactiverPas de fond xinitDure(ms):ActiverSlectionneur de FichiersClavierConfiguration du ClavierSouris pour un:OKExtinction(s):Chemin:Image:SourisConfiguration de la SourisQuitterDlai de Rptition:Droitier|GaucherSauverConfiguration de l'cranSauveur d'cranFichier slectionn:Interrompre(s):Dlai de Dpart:Veille(s):Dlai(s):Couleur Uniforme:Volume:fvwm-2.6.5.orig/po/fvwm.de.po0000644000175000017500000001745710656151550014170 0ustar vwcvwc# German translations for fvwm package # Copyright (C) 2003 fvwm workers # This file is distributed under the same license as the fvwm package. # Andrei Mitrofanow , 2003. # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2002-11-28 14:23+0100\n" "PO-Revision-Date: 2002-11-23 06:00+0100\n" "Last-Translator: Andrei Mitrofanow \n" "Language-Team: German\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../fvwm/fvwm.c:1362 msgid "Builtin Menu" msgstr "Internes Men" #: ../fvwm/fvwm.c:1365 msgid "Setup Form" msgstr "Konfiguration mit Form" #: ../fvwm/fvwm.c:1368 msgid "Setup 95 Script" msgstr "Konfiguration mit Script95" #: ../fvwm/fvwm.c:1371 msgid "Issue fvwm commands" msgstr "Fvwm-Konsole" #: ../fvwm/fvwm.c:1374 msgid "Restart fvwm" msgstr "Fvwm neu starten" #: ../fvwm/fvwm.c:1375 msgid "Exit fvwm" msgstr "Fvwm beenden" #: ../fvwm/expand.c:255 ../fvwm/virtual.c:2042 msgid "Desk" msgstr "Arbeitsplatz" #: ../fvwm/windowlist.c:94 ../fvwm/windowlist.c:100 ../fvwm/windowlist.c:107 msgid "\tGeometry" msgstr "\tGeometrie" #: ../fvwm/windowlist.c:105 #, c-format msgid "Desk: %d%s" msgstr "Arbeitsplatz: %d%s" #: ../fvwm/menus.c:1674 msgid "More&..." msgstr "Mehr&..." #. ./fvwm/ConfigFvwmSetup: line 91 msgid "Root Menu" msgstr "Haupt Menu" #. ./fvwm/ConfigFvwmSetup: line 95 msgid "Remote Logins" msgstr "Entfernt Anmelden" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 97 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 109 msgid "Utilities" msgstr "Werkzeuge" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 99 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 194 msgid "Fvwm Modules" msgstr "Module von Fvwm" #. ./fvwm/ConfigFvwmSetup: line 100 msgid "Fvwm Window Ops" msgstr "Fenster" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 101 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 124 msgid "Fvwm Config Ops" msgstr "Konfiguration" #. ./fvwm/ConfigFvwmSetup: line 103 msgid "Refresh Screen" msgstr "Bildschirm neuzeichnen" #. ./fvwm/ConfigFvwmSetup: line 104 msgid "Recapture Screen" msgstr "Bildschirm speichern" #. ./fvwm/ConfigFvwmSetup: line 106 msgid "Exit Fvwm" msgstr "Fvwm beenden" #. ./fvwm/ConfigFvwmSetup: line 121 msgid "Reset X defaults" msgstr "X Voreinstellungen setzen" #. ./fvwm/ConfigFvwmSetup: line 125 msgid "Sloppy Focus" msgstr "Fokus flssig" #. ./fvwm/ConfigFvwmSetup: line 126 msgid "Click To Focus" msgstr "Klick fr Fokus" #. ./fvwm/ConfigFvwmSetup: line 127 msgid "Focus Follows Mouse" msgstr "Fokus folgt Maus" #. ./fvwm/ConfigFvwmSetup: line 129 msgid "Colormap Follows Mouse" msgstr "Farbpalette folgt Maus" #. ./fvwm/ConfigFvwmSetup: line 130 msgid "Colormap Follows Focus" msgstr "Farbpalette folgt Fokus" #. ./fvwm/ConfigFvwmSetup: line 132 msgid "Full Paging ON" msgstr "Seitenbergang" #. ./fvwm/ConfigFvwmSetup: line 133 msgid "All Paging OFF" msgstr "Seitenbergang aus" #. ./fvwm/ConfigFvwmSetup: line 134 msgid "Horizontal Paging Only" msgstr "Seitenbergang horizontal" #. ./fvwm/ConfigFvwmSetup: line 135 msgid "Vertical Paging Only" msgstr "Seitenbergang vertikale" #. ./fvwm/ConfigFvwmSetup: line 136 msgid "Partial Paging" msgstr "Seitenbergang teilweise" #. ./fvwm/ConfigFvwmSetup: line 137 msgid "Full Paging && Edge Wrap" msgstr "Seitenbergang && Ecken" #. ./fvwm/ConfigFvwmSetup: line 144 msgid "&Move" msgstr "&Verschieben" #. ./fvwm/ConfigFvwmSetup: line 145 msgid "&Resize" msgstr "&Grsse ndern" #. ./fvwm/ConfigFvwmSetup: line 146 msgid "R&aise" msgstr "An&heben" #. ./fvwm/ConfigFvwmSetup: line 147 msgid "&Lower" msgstr "Ab&senken" #. ./fvwm/ConfigFvwmSetup: line 148 msgid "(De)&Iconify" msgstr "(De)&Minimierer" #. ./fvwm/ConfigFvwmSetup: line 149 msgid "(Un)&Stick" msgstr "(Los)&Festklemmer" #. ./fvwm/ConfigFvwmSetup: line 150 msgid "(Un)Ma&ximize" msgstr "(De)Ma&ximierer" #. ./fvwm/ConfigFvwmSetup: line 152 msgid "&Delete" msgstr "&Lsche" #. ./fvwm/ConfigFvwmSetup: line 153 msgid "&Close" msgstr "&Schliesse" #. ./fvwm/ConfigFvwmSetup: line 154 msgid "Destroy" msgstr "&Zerstre" #. ./fvwm/ConfigFvwmSetup: line 161 msgid "Window Ops" msgstr "Fenster" #. ./fvwm/ConfigFvwmSetup: line 163 msgid "Re&fresh Window" msgstr "Fester erneuern" #. ./fvwm/ConfigFvwmSetup: line 172 msgid "Print" msgstr "Drucken" #. ./fvwm/ConfigFvwmSetup: line 173 msgid "Print Re&verse" msgstr "Drucken (Rckseite)" #. ./fvwm/ConfigFvwmSetup: line 195 msgid "Control Animation" msgstr "Animationskontrolle" #. ./fvwm/ConfigFvwmSetup: line 204 msgid "desks" msgstr "Arbeitsplatz" #. ./fvwm/ConfigFvwmSetup: line 210 msgid "Stop Module Menu" msgstr "Fvwm-Module stoppen" #. ./fvwm/ConfigFvwmSetup: line 213 msgid "Stop Fvwm Modules" msgstr "Fvwm-Module stoppen" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 214 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 215 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 216 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 217 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 218 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 219 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 220 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 221 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 222 msgid "Stop" msgstr "Stop" #. ./fvwm/ConfigFvwmSetup: line 241 msgid "Really Quit Fvwm?" msgstr "Fvwm beenden?" #. ./fvwm/ConfigFvwmSetup: line 242 msgid "Yes, Really Quit" msgstr "Ja, fvwm beenden" #. ./fvwm/ConfigFvwmSetup: line 244 msgid "Restart" msgstr "Neustart" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 246 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 247 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 248 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 249 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 250 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 251 msgid "Start" msgstr "Start" #. ./fvwm/ConfigFvwmSetup: line 253 msgid "Just an Xterm" msgstr "XTerm" #. ./fvwm/ConfigFvwmSetup: line 255 msgid "No, Don't Quit" msgstr "Nein, fvwm nicht beenden" # FvwmForm #. ./modules/FvwmForm/FvwmForm-Setup.in: line 8 msgid "fvwm - Create Configuration" msgstr "fvwm - Erzeuge Konfiguration" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 13 msgid "Use this form to create your fvwm2rc configuration file." msgstr "Nutze dieses Formular um fvwm2rc zu erzeugen" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 15 msgid "The file created is ~/.fvwm/.fvwm2rc or $FVWM_USERDIR/.fvwm2rc." msgstr "Die Datei ist ~/.fvwm/.fvwm2rc oder $FVWM_USERDIR/.fvwm2rc." #. ./modules/FvwmForm/FvwmForm-Setup.in: line 19 msgid "After creation, the fvwm2rc file can then be changed with any" msgstr "Nach dem Erzeugen, knnen Sie die Datei mit einem Editor" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 21 msgid "editor to suit your own needs." msgstr "an Ihre Wnsche anpassen" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 26 msgid "Create a starting .fvwm2rc file" msgstr "Erzeuge eine Startdatei .fvwm2rc" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 30 msgid "These files are optional. Select the modules you want to customize." msgstr "Diese Dateien sind nicht notwendig. Die Auswahl der Module anpassen" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 32 msgid "You can always copy them later." msgstr "Sie knnen diese spter kopieren" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 53 msgid "Return - Dismiss" msgstr "Annehmen - Schliessen" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 55 msgid "Copy Config File(s)" msgstr "Konfigurationsdateien kopieren" fvwm-2.6.5.orig/po/FvwmTaskBar.de.gmo0000644000175000017500000000114011744241503015517 0ustar vwcvwcDl J-=LClick here to startNo new mailYou have mailYou have new mailProject-Id-Version: fvwm POT-Creation-Date: 2003-04-11 12:43+0200 PO-Revision-Date: 2002-11-27 21:29+0100 Last-Translator: Andrei Mitrofanow Language-Team: German Language: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); Klick hier um zu startenKeine neue PostSie haben PostSie haben neue Postfvwm-2.6.5.orig/po/FvwmTaskBar.pot0000644000175000017500000000147307646515633015177 0ustar vwcvwc# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR fvwm workers # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2003-04-11 12:43+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: ../modules/FvwmTaskBar/Goodies.c:462 msgid "No new mail" msgstr "" #: ../modules/FvwmTaskBar/Goodies.c:466 msgid "You have new mail" msgstr "" #: ../modules/FvwmTaskBar/Goodies.c:470 msgid "You have mail" msgstr "" #: ../modules/FvwmTaskBar/FvwmTaskBar.c:1320 msgid "Click here to start" msgstr "" fvwm-2.6.5.orig/po/Makefile.in0000644000175000017500000005733111744241234014320 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = po DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @LOCALEDIR@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ FVWM_POT_FILES = \ ../fvwm/fvwm.c \ ../fvwm/expand.c \ ../fvwm/windowlist.c \ ../fvwm/virtual.c \ ../fvwm/menus.c FVWMRC_POT_FILES = \ ../fvwm/ConfigFvwmSetup \ ../modules/FvwmForm/FvwmForm-Setup.in FVWMTASKBAR_POT_FILES = \ ../modules/FvwmTaskBar/Goodies.c \ ../modules/FvwmTaskBar/FvwmTaskBar.c FVWMSCRIPT_POT_FILES = \ ../modules/FvwmScript/Scripts/FvwmScript-BellSetup \ ../modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup \ ../modules/FvwmScript/Scripts/FvwmScript-PointerSetup \ ../modules/FvwmScript/Scripts/FvwmScript-ScreenSetup \ ../modules/FvwmScript/Scripts/FvwmScript-FileBrowser EXTRA_DIST = \ @POFILES@ @GMOFILES@ fvwm.pot FvwmTaskBar.pot FvwmScript.pot \ remove-potcdate.sed remove-potcdate.sin COPYRIGHT_HOLDER = fvwm workers # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = MSGMERGE_UPDATE = @MSGMERGE@ --update SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update all: all-am .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu po/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu po/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile all-local installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic \ maintainer-clean-local mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am all-local check check-am clean clean-generic \ distclean distclean-generic distdir dvi dvi-am html html-am \ info info-am install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic maintainer-clean-local mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ uninstall-local .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ if test -f $${lang}.po; then \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo; \ fi .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all-local: all-local-@USE_NLS@ # make [all] should do nothing ... #all-local-yes: $(CATALOGS) all-local-yes: all-local-no: catalogs: $(CATALOGS) maintainer-clean-local: rm -f $(GMOFILES) $(FVWM_DOMAIN).pot-update: $(FVWM_POT_FILES) \ $(FVWMRC_POT_FILES) \ remove-potcdate.sed rm -f fvwmrc.pot; \ rcpotfiles='$(FVWMRC_POT_FILES)'; \ rm -f duplicate; \ for file in $$rcpotfiles; do \ perl -ne 's/\[gt\.((\\.|.)+?)\]/ print \ "\#$$ARGV: line $$.\n"."msgid \"$$1\"\n"."msgstr \"\"\n\n"/ge' \ $$file >> duplicate; \ done; \ msguniq duplicate > fvwmrc.pot; rm -f duplicate; \ potfiles='$(FVWM_POT_FILES)'; \ $(XGETTEXT) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) -o $(FVWM_DOMAIN).po \ --copyright-holder='$(COPYRIGHT_HOLDER)' $$potfiles; \ test ! -f $(FVWM_DOMAIN).po || { \ if test -f $(srcdir)/$(FVWM_DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(FVWM_DOMAIN).pot > $(FVWM_DOMAIN).1po && \ sed -f remove-potcdate.sed < $(FVWM_DOMAIN).po > $(FVWM_DOMAIN).2po && \ if cmp $(FVWM_DOMAIN).1po $(FVWM_DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(FVWM_DOMAIN).1po $(FVWM_DOMAIN).2po $(FVWM_DOMAIN).po; \ else \ rm -f $(FVWM_DOMAIN).1po $(FVWM_DOMAIN).2po $(srcdir)/$(FVWM_DOMAIN).pot && \ mv $(FVWM_DOMAIN).po $(srcdir)/$(FVWM_DOMAIN).pot; \ fi; \ else \ mv $(FVWM_DOMAIN).po $(srcdir)/$(FVWM_DOMAIN).pot; \ fi; \ mv $(FVWM_DOMAIN).pot duplicate.pot; \ cat fvwmrc.pot >> duplicate.pot; \ msguniq duplicate.pot > $(FVWM_DOMAIN).pot; \ rm -f duplicate.pot fvwmrc.pot; \ } $(srcdir)/$(FVWM_DOMAIN).pot: $(MAKE) $(FVWM_DOMAIN).pot-update $(FVWMTASKBAR_DOMAIN).pot-update: $(FVWMTASKBAR_POT_FILES) \ remove-potcdate.sed potfiles='$(FVWMTASKBAR_POT_FILES)'; \ $(XGETTEXT) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ -o $(FVWMTASKBAR_DOMAIN).po \ --copyright-holder='$(COPYRIGHT_HOLDER)' $$potfiles; \ test ! -f $(FVWMTASKBAR_DOMAIN).po || { \ if test -f $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot \ > $(FVWMTASKBAR_DOMAIN).1po && \ sed -f remove-potcdate.sed < $(FVWMTASKBAR_DOMAIN).po \ > $(FVWMTASKBAR_DOMAIN).2po && \ if cmp $(FVWMTASKBAR_DOMAIN).1po $(FVWMTASKBAR_DOMAIN).2po \ >/dev/null 2>&1; then \ rm -f $(FVWMTASKBAR_DOMAIN).1po $(FVWMTASKBAR_DOMAIN).2po \ $(FVWMTASKBAR_DOMAIN).po; \ else \ rm -f $(FVWMTASKBAR_DOMAIN).1po $(FVWMTASKBAR_DOMAIN).2po \ $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot && \ mv $(FVWMTASKBAR_DOMAIN).po $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot; \ fi; \ else \ mv $(FVWMTASKBAR_DOMAIN).po $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot; \ fi; \ } $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot: $(MAKE) $(FVWMTASKBAR_DOMAIN).pot-update $(FVWMSCRIPT_DOMAIN).pot-update: $(FVWMSCRIPT_POT_FILES) \ remove-potcdate.sed potfiles='$(FVWMSCRIPT_POT_FILES)'; \ rm -f duplicate; \ for file in $$potfiles; do \ perl -ne 's/LocaleTitle\s+\{((\\.|.)+?)\}/ print \ "\#$$ARGV: line $$.\n"."msgid \"$$1\"\n"."msgstr \"\"\n\n"/ge' \ $$file >> duplicate; \ done; \ msguniq duplicate > duplicate.pot; \ cat pot_head_sample > $(FVWMSCRIPT_DOMAIN).pot; \ cat duplicate.pot >> $(FVWMSCRIPT_DOMAIN).pot; \ rm -f duplicate duplicate.pot; $(srcdir)/$(FVWMSCRIPT_DOMAIN).pot: $(MAKE) $(FVWMSCRIPT_DOMAIN).pot-update $(POFILES): $(srcdir)/$(FVWM_DOMAIN).pot $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot \ $(srcdir)/$(FVWMSCRIPT_DOMAIN).pot dlang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ dom=`echo $$dlang | sed -e 's/\..*$$//'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ if test -f $${dlang}.po; then \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${dlang}.po $${dom}.pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${dlang}.po $${dom}.pot; \ fi # @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ # test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ # echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(FVWM_DOMAIN).pot"; \ # cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(FVWM_DOMAIN).pot install-data-local: install-data-local-@USE_NLS@ install-data-local-no: all install-data-local-yes: all $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ all_domains='$(ALL_DOMAINS)'; \ for dom in $$all_domains; do \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ cat="$$dom.$$cat"; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ if test -r $$cat; \ then realcat=$$cat; \ else realcat=$(srcdir)/$$cat; \ fi; \ if test -f $$realcat; then \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$$dom.mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$$dom.mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && \ LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' \ >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && \ LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc \ $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file \ $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo; \ ln -s ../LC_MESSAGES/$$dom.mo \ $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$dom.mo \ $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$dom.mo \ $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo; \ echo "installing $$realcat link as \ $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo"; \ fi; \ done; \ fi; \ done; \ done installdirs-data: installdirs-data-local-@USE_NLS@ installdirs-data-local-no: installdirs-data-local-yes: $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ all_domains='$(ALL_DOMAINS)'; \ for dom in $$all_domainss; do \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && \ LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' \ >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && \ LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc \ $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file \ $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done; \ done uninstall-local: uninstall-local-@USE_NLS@ uninstall-local-no: uninstall-local-yes: catalogs='$(CATALOGS)'; \ all_domains='$(ALL_DOMAINS)'; \ for dom in $$all_domains; do \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo; \ done; \ done; \ done update-po: Makefile $(MAKE) $(FVWM_DOMAIN).pot-update $(MAKE) $(FVWMTASKBAR_DOMAIN).pot-update $(MAKE) $(FVWMSCRIPT_DOMAIN).pot-update $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for updating PO files. .nop.po-update: dlang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po-update$$//'`; \ dom=`echo $$dlang | sed -e 's/\..*$$//'`; \ tmpdir=`pwd`; \ echo "$$dlang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $$dlang.po $$dom.pot -o $$dlang.new.po"; \ cd $(srcdir); \ if $(MSGMERGE) $$dlang.po $$dom.pot -o $$tmpdir/$$dlang.new.po; then \ if cmp $$dlang.po $$tmpdir/$$dlang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$dlang.new.po; \ else \ if mv -f $$tmpdir/$$dlang.new.po $$dlang.po; then \ :; \ else \ echo "msgmerge for $$dlang.po failed: cannot move \ $$tmpdir/$$dlang.new.po to $$dlang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$dlang.po failed!" 1>&2; \ rm -f $$tmpdir/$$dlang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/po/FvwmScript.pot0000644000175000017500000001364607646515633015121 0ustar vwcvwc# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR fvwm workers # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2002-11-28 14:23+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 2 msgid "Bell Setup" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 44 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 43 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 47 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 132 msgid "Apply" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 62 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 62 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 66 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 170 msgid "Save" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 80 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 89 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 94 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 235 msgid "Quit" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 95 msgid "Beep" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 130 msgid "Volume:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 156 msgid "Pitch(Hz):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 182 msgid "Duration(ms):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 207 msgid "Bell" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 2 msgid "Keyboard Setup" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 120 msgid "Click Volume (%)" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 133 msgid "AutoRepeat On" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 159 msgid "Start Delay: " msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 185 msgid "Repeat Delay:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 210 msgid "Keyboard" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 2 msgid "Pointer Setup" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 108 msgid "Right-handed user|Left-handed user" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 122 msgid "Mouse configuration:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 150 msgid "Acceleration:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 177 msgid "Threshold (pixels):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 202 msgid "Pointer" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 2 msgid "Screen Setup" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 264 msgid "Background" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 279 msgid "Uniform color:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 394 msgid "Pixmap:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 425 msgid "Browser..." msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 468 msgid "Disable xinit background" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 500 msgid "Screen-saver" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 514 msgid "Blank" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 528 msgid "Timeout(s):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 554 msgid "Pattern" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 569 msgid "Cycle(s):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 614 msgid "DPMS" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 628 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 768 msgid "Enable" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 643 msgid "Disable" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 657 msgid "Standby(s):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 684 msgid "Suspend(s):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 711 msgid "Off(s):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 754 msgid "xscreensaver" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 794 msgid "Config and Demo" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 2 msgid "File Browser" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 42 msgid "OK" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 58 msgid "Cancel" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 86 msgid "Path:" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 181 msgid " Show hidden files" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 246 msgid "Selected file:" msgstr "" fvwm-2.6.5.orig/po/fvwm.fr.gmo0000644000175000017500000001040610656151550014336 0ustar vwcvwcC4YL    =C R_n   ";J Zgw & 5CT \i z  ?D 8_       E4 z      = # ? L b |   !    &1 X t     2; NXm " :GPUi9}== 3?^z!) /.$ >9" 24 1 *-' %8,<+0A);@C#!?76=&B5(:3 Geometry&Close&Delete&Lower&Move&Resize(De)&Iconify(Un)&Stick(Un)Ma&ximizeAfter creation, the fvwm2rc file can then be changed with anyAll Paging OFFBuiltin MenuClick To FocusColormap Follows FocusColormap Follows MouseControl AnimationCopy Config File(s)Create a starting .fvwm2rc fileDeskDesk: %d%sDestroyExit FvwmExit fvwmFocus Follows MouseFull Paging && Edge WrapFull Paging ONFvwm Config OpsFvwm ModulesFvwm Window OpsHorizontal Paging OnlyIssue fvwm commandsJust an XtermMore&...No, Don't QuitPartial PagingPrintPrint Re&verseR&aiseRe&fresh WindowReally Quit Fvwm?Recapture ScreenRefresh ScreenRemote LoginsReset X defaultsRestartRestart fvwmReturn - DismissRoot MenuSetup 95 ScriptSetup FormSloppy FocusStartStopStop Fvwm ModulesStop Module MenuThe file created is ~/.fvwm/.fvwm2rc or $FVWM_USERDIR/.fvwm2rc.These files are optional. Select the modules you want to customize.Use this form to create your fvwm2rc configuration file.UtilitiesVertical Paging OnlyWindow OpsYes, Really QuitYou can always copy them later.deskseditor to suit your own needs.fvwm - Create ConfigurationProject-Id-Version: fvwm POT-Creation-Date: 2002-11-28 14:23+0100 PO-Revision-Date: 2002-11-23 06:00+0100 Last-Translator: Olivier Chapuis Language-Team: French MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); Gometrie&Fermer&QuitterEn &arrire&Dplacer&Redimensionner(De)&Minimiser(De)&Fixer(De)&MaximiserAprs cration, vous pouvez diter ce fichier avec un diteurToute Pagination dsactiveMenu InterneCliquer pour le FocusLa Colormap suit le FocusLa Colormap suit la sourisControler l'animationCopier les FichiersCrez un fichier .fvwm2rc initialBureauBureau: %d%s&BrulerQuitter fvwmQuitter fvwmLe Focus suit la sourisPagination complte && Bord lectriquePagination complte activeOprations de configModules de FvwmOprations sur les fentresPagination horizontale seulementExecuter des commandes fvwmJuste XTermPlus&...Non, On ne quitte pasPagination partielleImprimerImprimer (reverse)&En avantRafrchir la fentreOn quitte vraiment ?Recapturer l'cranRaffrachir l'cranLogin distanceRtablir les dfauts de XRedmarrerRedmarrer fvwmQuitterMenu PrincipalConfiguration avec Script95Configuration avec FormFocus fluideDmarrerStopArrter des ModulesArrter des ModulesCe ficher est ~/.fvwm/.fvwm2rc ou $FVWM_USERDIR/.fvwm2rc.Ces fichiers sont optionnels. Choisissez les modules diterUtilisez cette Form pour crer votre fichier de configurationUtilitairesPagination verticale seulementOprations sur les fentresOui, On quitte vraimentVous pourrez les copier plus tardbureaupour une configuration votre convenancefvwm - Crer votre Configurationfvwm-2.6.5.orig/po/fvwm.ar.po0000644000175000017500000002072410656151550014171 0ustar vwcvwc# Arabic translations for fvwm package. # Copyright (C) 2002 fvwm workers # This file is distributed under the same license as the fvwm package. # Nadim Shaikli # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2002-11-28 14:23+0100\n" "PO-Revision-Date: 2002-12-06 08:25+0100\n" "Last-Translator: Nadim Shaikli \n" "Language-Team: Arabic\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 0.9.6\n" #: ../fvwm/fvwm.c:1362 msgid "Builtin Menu" msgstr "قائمة مبنية داخليا" #: ../fvwm/fvwm.c:1365 msgid "Setup Form" msgstr "شاشة الإعداد" #: ../fvwm/fvwm.c:1368 msgid "Setup 95 Script" msgstr "ملف إعداد 95" #: ../fvwm/fvwm.c:1371 msgid "Issue fvwm commands" msgstr "أصدر أوامر fvwm" #: ../fvwm/fvwm.c:1374 msgid "Restart fvwm" msgstr "أعد تشغيل fvwm" #: ../fvwm/fvwm.c:1375 msgid "Exit fvwm" msgstr "أخرج من fvwm" #: ../fvwm/expand.c:255 ../fvwm/virtual.c:2042 msgid "Desk" msgstr "المكتب" #: ../fvwm/windowlist.c:94 ../fvwm/windowlist.c:100 ../fvwm/windowlist.c:107 msgid "\tGeometry" msgstr "\tالأبعاد" #: ../fvwm/windowlist.c:105 #, c-format msgid "Desk: %d%s" msgstr "المكتب: %d%s" #: ../fvwm/menus.c:1674 msgid "More&..." msgstr "" #. ./fvwm/ConfigFvwmSetup: line 91 msgid "Root Menu" msgstr "القائمة الجذرية" #. ./fvwm/ConfigFvwmSetup: line 95 msgid "Remote Logins" msgstr "الدخول عن بعد" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 97 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 109 msgid "Utilities" msgstr "برامج الخدمات" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 99 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 194 msgid "Fvwm Modules" msgstr "وحدات Fvwm" #. ./fvwm/ConfigFvwmSetup: line 100 msgid "Fvwm Window Ops" msgstr "خيارات نوافذ Fvwm" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 101 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 124 msgid "Fvwm Config Ops" msgstr "خيارات إعداد Fvwm" #. ./fvwm/ConfigFvwmSetup: line 103 msgid "Refresh Screen" msgstr "أعد تنشيط الشاشة" #. ./fvwm/ConfigFvwmSetup: line 104 msgid "Recapture Screen" msgstr "أعد عرض الشاشة" #. ./fvwm/ConfigFvwmSetup: line 106 msgid "Exit Fvwm" msgstr "الخروج من Fvwm" #. ./fvwm/ConfigFvwmSetup: line 121 msgid "Reset X defaults" msgstr "إسترجاع الإفتراضي لأكس" #. ./fvwm/ConfigFvwmSetup: line 125 msgid "Sloppy Focus" msgstr "تركيز بطيئ" #. ./fvwm/ConfigFvwmSetup: line 126 msgid "Click To Focus" msgstr "تركيز بالضعط" #. ./fvwm/ConfigFvwmSetup: line 127 msgid "Focus Follows Mouse" msgstr "تركيز بلحاق الفارة" #. ./fvwm/ConfigFvwmSetup: line 129 msgid "Colormap Follows Mouse" msgstr "خارطة الألوان تلحق بالفارة" #. ./fvwm/ConfigFvwmSetup: line 130 msgid "Colormap Follows Focus" msgstr "خارطة الألوان تلحق بالتركيز" #. ./fvwm/ConfigFvwmSetup: line 132 msgid "Full Paging ON" msgstr "تشغيل التصفح الكامل " #. ./fvwm/ConfigFvwmSetup: line 133 msgid "All Paging OFF" msgstr "توقيف التصفح الكامل" #. ./fvwm/ConfigFvwmSetup: line 134 msgid "Horizontal Paging Only" msgstr "التصفح الأفقي فقط" #. ./fvwm/ConfigFvwmSetup: line 135 msgid "Vertical Paging Only" msgstr "التصفح العمودي فقط" #. ./fvwm/ConfigFvwmSetup: line 136 msgid "Partial Paging" msgstr "تصفح جزئي" #. ./fvwm/ConfigFvwmSetup: line 137 msgid "Full Paging && Edge Wrap" msgstr "تصفح كامل مع القلب عند الحواف" #. ./fvwm/ConfigFvwmSetup: line 144 msgid "&Move" msgstr "&حرك" #. ./fvwm/ConfigFvwmSetup: line 145 msgid "&Resize" msgstr "غ&ير الحجم" #. ./fvwm/ConfigFvwmSetup: line 146 msgid "R&aise" msgstr "ار&فع" #. ./fvwm/ConfigFvwmSetup: line 147 msgid "&Lower" msgstr "ا&خفض" #. ./fvwm/ConfigFvwmSetup: line 148 msgid "(De)&Iconify" msgstr "(عدم) التحويل لأي&قونة" #. ./fvwm/ConfigFvwmSetup: line 149 msgid "(Un)&Stick" msgstr "(أزل)ت&ثبيت" #. ./fvwm/ConfigFvwmSetup: line 150 msgid "(Un)Ma&ximize" msgstr "(أزل) الت&كبير" #. ./fvwm/ConfigFvwmSetup: line 152 msgid "&Delete" msgstr "اح&ذف" #. ./fvwm/ConfigFvwmSetup: line 153 msgid "&Close" msgstr "أ&غلق" #. ./fvwm/ConfigFvwmSetup: line 154 msgid "Destroy" msgstr "تدمير" #. ./fvwm/ConfigFvwmSetup: line 161 msgid "Window Ops" msgstr "خيارات النافذة" #. ./fvwm/ConfigFvwmSetup: line 163 msgid "Re&fresh Window" msgstr "أعد تنشيط النافذة" #. ./fvwm/ConfigFvwmSetup: line 172 msgid "Print" msgstr "أطبع" #. ./fvwm/ConfigFvwmSetup: line 173 msgid "Print Re&verse" msgstr "أطبع بالم&قلوب" #. ./fvwm/ConfigFvwmSetup: line 195 msgid "Control Animation" msgstr "تحكم بالحركة" #. ./fvwm/ConfigFvwmSetup: line 204 msgid "desks" msgstr "مكاتب" #. ./fvwm/ConfigFvwmSetup: line 210 msgid "Stop Module Menu" msgstr "قائمة إيقاف الوحدات" #. ./fvwm/ConfigFvwmSetup: line 213 msgid "Stop Fvwm Modules" msgstr "إيقاف وحدات Fvem" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 214 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 215 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 216 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 217 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 218 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 219 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 220 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 221 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 222 msgid "Stop" msgstr "إيقاف" #. ./fvwm/ConfigFvwmSetup: line 241 msgid "Really Quit Fvwm?" msgstr "هل تريد الخروج من Fvwm ؟" #. ./fvwm/ConfigFvwmSetup: line 242 msgid "Yes, Really Quit" msgstr "نعم، أريد الخروج" #. ./fvwm/ConfigFvwmSetup: line 244 msgid "Restart" msgstr "أعد التشغيل" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 246 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 247 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 248 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 249 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 250 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 251 msgid "Start" msgstr "إبدأ" #. ./fvwm/ConfigFvwmSetup: line 253 msgid "Just an Xterm" msgstr "أظهر Xterm فقط" #. ./fvwm/ConfigFvwmSetup: line 255 msgid "No, Don't Quit" msgstr "لا، لا تخرج" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 8 msgid "fvwm - Create Configuration" msgstr "إنشاء ملف خيارات ل fvwm" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 13 msgid "Use this form to create your fvwm2rc configuration file." msgstr "إستعمل هذا النموذج لإنشاء ملف الإعدادات fvwm2rc الخاص بك" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 15 msgid "The file created is ~/.fvwm/.fvwm2rc or $FVWM_USERDIR/.fvwm2rc." msgstr "الملف المنشأ هو ~/.fvwm/.fvwm2rc أو $FVWM_USERDIR/.fvwm2rc" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 19 msgid "After creation, the fvwm2rc file can then be changed with any" msgstr "بعد الإنشاء، من الممكن تعديل الملف الخيارات fvwm2rc بإستعمال أي" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 21 msgid "editor to suit your own needs." msgstr "محرر نصوص تريده." #. ./modules/FvwmForm/FvwmForm-Setup.in: line 26 msgid "Create a starting .fvwm2rc file" msgstr "أنشئ الملف المبدئي .fvwm2rc " #. ./modules/FvwmForm/FvwmForm-Setup.in: line 30 msgid "These files are optional. Select the modules you want to customize." msgstr "الملفات التالية إختيارية. أختر الوحدات التي تود أن تخصصها." #. ./modules/FvwmForm/FvwmForm-Setup.in: line 32 msgid "You can always copy them later." msgstr "تستطيع نسخهم في الوقت الذي تريد." #. ./modules/FvwmForm/FvwmForm-Setup.in: line 53 msgid "Return - Dismiss" msgstr "رجوع - خروج" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 55 msgid "Copy Config File(s)" msgstr "إنسخ ملفات التعريف" fvwm-2.6.5.orig/po/README0000644000175000017500000000462607646515633013147 0ustar vwcvwc* Requirement for Translators and developers: gettext-0.11.5 http://www.gnu.org/software/gettext/ Read the doc. However, the logic used is a bit different than the gettext logic * For translators: Contact fvwm-workers@fvwm.org * For programmers: To be written * For creating a new catalogs, say LL_CC (e.g., fr, zh_CN): - Edit configure.in and add LL_CC to ALL_LINGUAS - run autoconf and ./configure (with your usual options) and check that the new "lang" appear in the list of "lang" Locale msg: prefix/share/locale ... LL_CC ... - cd to po/ - create a domain.LL_CC.po file for all files domain.pot: msginit -i fvwm.pot -l LL_CC -o fvwm.LL_CC.po msginit -i FvwmTaskBar.pot -l LL_CC -o FvwmTaskBar.LL_CC.po ... The --no-translator option can be useful under certain situation (e.g., you do not use the LL_CC locale). In this case you should edit the files you have created and in particular set the appropriate CHARSET. - Then, you can start the translation of fvwm.LL_CC.po, FvwmTaskBar.LL_CC.po ...etc NOTE: You should "make domain.LL_CC.gmo" before make install and test your translation visually! * make: - make [all] should do nothing (but, maybe, recreating the Makefile). "make install" install! But see the previous NOTE. - The following (re)build everything (safe): make po-update - If some messages have changed in some source files in "domain": make domain.pot-update update domain.pot. Then you can make domain.LL_CC.po to get the new messages for translation. After translation: make domain.LL_CC.gmo # create a binary mo file from the po one make install restart fvwm for visual testing. - Other targets: make update-gmo # build all the binary gmo files * Creation of a new domain: ask the fvwm-workers@fvwm.org. Basically: - Update ALL_DOMAINS in configure.in - Add NEW_DOMAIN in configure.in - Create po/$NEW_DOMAIN.pot (xgettext) and add it to EXTRA_DIST (todo: remove this step) - Set the files which contains msg NEW_DOMAIN = file1 file2 ... in the beginning of po/Makefile.am - Add $(srcdir)/$(NEW_DOMAIN).pot: and $(NEW_DOMAIN).pot-update: in po/Makfile.am - Update $(POFILES): and update-po: in po/Makfile.am (todo: remove this step) fvwm-2.6.5.orig/po/FvwmTaskBar.sv_SE.gmo0000644000175000017500000000113211744241503016147 0ustar vwcvwcDl M 1 ?KClick here to startNo new mailYou have mailYou have new mailProject-Id-Version: fvwm POT-Creation-Date: 2003-04-11 12:43+0200 PO-Revision-Date: 2003-10-19 13:34+0200 Last-Translator: Johan Svedberg Language-Team: Swedish Language: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Klicka hr fr att startaIngen ny postDu har postDu har ny postfvwm-2.6.5.orig/po/FvwmScript.de.gmo0000644000175000017500000000500111744241503015434 0ustar vwcvwc/C  ,: @ NY^ cn t   &)17 ?JR Zh m"{     " *J7     !; R\ an       ( 0 G ` j        # /+ $&*('!-,.% ") Show hidden filesAcceleration:ApplyAutoRepeat OnBackgroundBeepBellBell SetupBlankBrowser...CancelClick Volume (%)Config and DemoCycle(s):DPMSDisableDisable xinit backgroundDuration(ms):EnableFile BrowserKeyboardKeyboard SetupMouse configuration:OKOff(s):Path:PatternPitch(Hz):Pixmap:PointerPointer SetupQuitRepeat Delay:Right-handed user|Left-handed userSaveScreen SetupScreen-saverSelected file:Standby(s):Start Delay: Suspend(s):Threshold (pixels):Timeout(s):Uniform color:Volume:xscreensaverProject-Id-Version: fvwm POT-Creation-Date: 2002-11-28 14:23+0100 PO-Revision-Date: 2003-04-13 11:35+0200 Last-Translator: Andrei Mitrofanow Language-Team: German Language: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); Zeige versteckte DateienBeschleunigung:AkzeptierenWiederhohlung AktivHintergrundPiebtonLautsprecherLautsprecher KonfigurationLeerBetrachterAbbrechenLautstrke des Klicks (%)Konfiguration und DemoKreislaufDPMSDeaktivierenDeaktiviere HintergrundDauer(ms):AktivierenDateimanagerTastaturKonfiguration der TastaturMaus Konfiguration:OKAus(s):Pfad:PatternTonhhe(Hz)Bilder:ZeigerMaus EinstellungenBeendenWiederhohlverzgerung:Rechtshnder|LinkshnderSpeichernBildschirm EinstellungenBildschirmschonerAuswahl:Standby(s):Startverzgerung:Suspend(s):SchwellwertTimeout(s):Farben:Lautstrke:xscreensaverfvwm-2.6.5.orig/po/fvwm.sv_SE.po0000644000175000017500000001765310656151550014615 0ustar vwcvwc# Swedish translations for fvwm package # Svenska versttningar fr paket fvwm. # Copyright (C) 2003 fvwm workers # This file is distributed under the same license as the fvwm package. # Johan Svedberg , 2003. # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2002-11-28 14:23+0100\n" "PO-Revision-Date: 2003-10-19 15:01+0200\n" "Last-Translator: Johan Svedberg \n" "Language-Team: Swedish\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../fvwm/fvwm.c:1362 msgid "Builtin Menu" msgstr "Inbyggd meny" #: ../fvwm/fvwm.c:1365 msgid "Setup Form" msgstr "Instllningsformulr" #: ../fvwm/fvwm.c:1368 msgid "Setup 95 Script" msgstr "Stll in 95 skript" #: ../fvwm/fvwm.c:1371 msgid "Issue fvwm commands" msgstr "Utfr fvwm-kommandon" #: ../fvwm/fvwm.c:1374 msgid "Restart fvwm" msgstr "Starta om fvwm" #: ../fvwm/fvwm.c:1375 msgid "Exit fvwm" msgstr "Avsluta fvwm" #: ../fvwm/expand.c:255 ../fvwm/virtual.c:2042 msgid "Desk" msgstr "Skrivbord" #: ../fvwm/windowlist.c:94 ../fvwm/windowlist.c:100 ../fvwm/windowlist.c:107 msgid "\tGeometry" msgstr "\tStorlek" #: ../fvwm/windowlist.c:105 #, c-format msgid "Desk: %d%s" msgstr "Skrivbord: %d%s" #: ../fvwm/menus.c:1674 msgid "More&..." msgstr "Mer&..." #. ./fvwm/ConfigFvwmSetup: line 91 msgid "Root Menu" msgstr "Rotmeny" #. ./fvwm/ConfigFvwmSetup: line 95 msgid "Remote Logins" msgstr "Fjrrinloggningar" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 97 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 109 msgid "Utilities" msgstr "Verktyg" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 99 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 194 msgid "Fvwm Modules" msgstr "Fvwm-moduler" #. ./fvwm/ConfigFvwmSetup: line 100 msgid "Fvwm Window Ops" msgstr "Fvwm-fnsterinstllningar" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 101 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 124 msgid "Fvwm Config Ops" msgstr "Fvwm-konfigurationsinstllningar" #. ./fvwm/ConfigFvwmSetup: line 103 msgid "Refresh Screen" msgstr "Rita om skrm" #. ./fvwm/ConfigFvwmSetup: line 104 msgid "Recapture Screen" msgstr "Uppdatera skrm" #. ./fvwm/ConfigFvwmSetup: line 106 msgid "Exit Fvwm" msgstr "Avsluta Fvwm" #. ./fvwm/ConfigFvwmSetup: line 121 msgid "Reset X defaults" msgstr "Nollstll X-standarder" #. ./fvwm/ConfigFvwmSetup: line 125 msgid "Sloppy Focus" msgstr "Slarvigt fokus" #. ./fvwm/ConfigFvwmSetup: line 126 msgid "Click To Focus" msgstr "Klicka fr att fokusera" #. ./fvwm/ConfigFvwmSetup: line 127 msgid "Focus Follows Mouse" msgstr "Fokus fljer mus" #. ./fvwm/ConfigFvwmSetup: line 129 msgid "Colormap Follows Mouse" msgstr "Frgkarta fljer mus" #. ./fvwm/ConfigFvwmSetup: line 130 msgid "Colormap Follows Focus" msgstr "Frgkarta fljer fokus" #. ./fvwm/ConfigFvwmSetup: line 132 msgid "Full Paging ON" msgstr "Full sidfunktionalitet P" #. ./fvwm/ConfigFvwmSetup: line 133 msgid "All Paging OFF" msgstr "All sidfunktionalitet AV" #. ./fvwm/ConfigFvwmSetup: line 134 msgid "Horizontal Paging Only" msgstr "Endast horisontal sidfunktionalitet" #. ./fvwm/ConfigFvwmSetup: line 135 msgid "Vertical Paging Only" msgstr "Endast vertikal sidfunktionalitet" #. ./fvwm/ConfigFvwmSetup: line 136 msgid "Partial Paging" msgstr "Delvis sidfunktionalitet" #. ./fvwm/ConfigFvwmSetup: line 137 msgid "Full Paging && Edge Wrap" msgstr "Full sidfunktionalitet && Kantbrytning" #. ./fvwm/ConfigFvwmSetup: line 144 msgid "&Move" msgstr "&Flytta" #. ./fvwm/ConfigFvwmSetup: line 145 msgid "&Resize" msgstr "&ndra storlek" #. ./fvwm/ConfigFvwmSetup: line 146 msgid "R&aise" msgstr "&Hj" #. ./fvwm/ConfigFvwmSetup: line 147 msgid "&Lower" msgstr "&Snk" #. ./fvwm/ConfigFvwmSetup: line 148 msgid "(De)&Iconify" msgstr "(Av)&Minimera" #. ./fvwm/ConfigFvwmSetup: line 149 msgid "(Un)&Stick" msgstr "(Av)&Stt fast" #. ./fvwm/ConfigFvwmSetup: line 150 msgid "(Un)Ma&ximize" msgstr "(Av)Ma&ximera" #. ./fvwm/ConfigFvwmSetup: line 152 msgid "&Delete" msgstr "&Ta bort" #. ./fvwm/ConfigFvwmSetup: line 153 msgid "&Close" msgstr "St&ng" #. ./fvwm/ConfigFvwmSetup: line 154 msgid "Destroy" msgstr "Frstr" #. ./fvwm/ConfigFvwmSetup: line 161 msgid "Window Ops" msgstr "Fnsterinstllningar" #. ./fvwm/ConfigFvwmSetup: line 163 msgid "Re&fresh Window" msgstr "R&ita om fnster" #. ./fvwm/ConfigFvwmSetup: line 172 msgid "Print" msgstr "Skriv ut" #. ./fvwm/ConfigFvwmSetup: line 173 msgid "Print Re&verse" msgstr "Skriv ut omvnd" #. ./fvwm/ConfigFvwmSetup: line 195 msgid "Control Animation" msgstr "Kontrollera animation" #. ./fvwm/ConfigFvwmSetup: line 204 msgid "desks" msgstr "skrivbord" #. ./fvwm/ConfigFvwmSetup: line 210 msgid "Stop Module Menu" msgstr "Stanna modulmeny" #. ./fvwm/ConfigFvwmSetup: line 213 msgid "Stop Fvwm Modules" msgstr "Stanna Fvwm-moduler" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 214 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 215 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 216 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 217 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 218 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 219 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 220 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 221 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 222 msgid "Stop" msgstr "Stanna" #. ./fvwm/ConfigFvwmSetup: line 241 msgid "Really Quit Fvwm?" msgstr "Avsluta Fvwm?" #. ./fvwm/ConfigFvwmSetup: line 242 msgid "Yes, Really Quit" msgstr "Ja, avsluta" #. ./fvwm/ConfigFvwmSetup: line 244 msgid "Restart" msgstr "Starta om" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 246 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 247 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 248 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 249 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 250 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 251 msgid "Start" msgstr "Starta" #. ./fvwm/ConfigFvwmSetup: line 253 msgid "Just an Xterm" msgstr "Bara en Xterm" #. ./fvwm/ConfigFvwmSetup: line 255 msgid "No, Don't Quit" msgstr "Nej, avsluta inte" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 8 msgid "fvwm - Create Configuration" msgstr "fvwm - Skapa konfiguration" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 13 msgid "Use this form to create your fvwm2rc configuration file." msgstr "Anvnd det hr formulret fr att skapa din fvwm2rc-konfigurationsfil" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 15 msgid "The file created is ~/.fvwm/.fvwm2rc or $FVWM_USERDIR/.fvwm2rc." msgstr "Den skapade filen r ~/.fvwm/.fvwm2rc eller $FVWM_USERDIR/.fvwm2rc." #. ./modules/FvwmForm/FvwmForm-Setup.in: line 19 msgid "After creation, the fvwm2rc file can then be changed with any" msgstr "Efter skapande s kan fvwm2rc-filen modifieras med vilken" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 21 msgid "editor to suit your own needs." msgstr "redigerare som helst fr att passa dina egna behov." #. ./modules/FvwmForm/FvwmForm-Setup.in: line 26 msgid "Create a starting .fvwm2rc file" msgstr "Skapa en startande .fvwm2rc-fil" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 30 msgid "These files are optional. Select the modules you want to customize." msgstr "De hr filerna r valfria. Vlj modulerna som du vill stlla in." #. ./modules/FvwmForm/FvwmForm-Setup.in: line 32 msgid "You can always copy them later." msgstr "Du kan alltid kopiera dem senare." #. ./modules/FvwmForm/FvwmForm-Setup.in: line 53 msgid "Return - Dismiss" msgstr "tervnd - Avsluta" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 55 msgid "Copy Config File(s)" msgstr "Kopiera konfigurationsfil(er)" fvwm-2.6.5.orig/po/FvwmScript.fr.po0000644000175000017500000001501311744241503015313 0ustar vwcvwc# French translations for fvwm package # Traduction anglaise du package fvwm. # Copyright (C) 2002 fvwm workers # This file is distributed under the same license as the fvwm package. # Olivier Chapuis , 2002. # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2002-11-28 14:23+0100\n" "PO-Revision-Date: 2003-04-13 11:35+0200\n" "Last-Translator: Olivier Chapuis \n" "Language-Team: French\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 2 msgid "Bell Setup" msgstr "Configuration de la Cloche" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 44 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 43 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 47 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 132 msgid "Apply" msgstr "Appliquer" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 62 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 62 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 66 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 170 msgid "Save" msgstr "Sauver" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 80 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 89 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 94 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 235 msgid "Quit" msgstr "Quitter" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 95 msgid "Beep" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 130 msgid "Volume:" msgstr "Volume:" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 156 msgid "Pitch(Hz):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 182 msgid "Duration(ms):" msgstr "Dure(ms):" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 207 msgid "Bell" msgstr "Cloche" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 2 msgid "Keyboard Setup" msgstr "Configuration du Clavier" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 120 msgid "Click Volume (%)" msgstr "Volume d'un clique (%)" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 133 msgid "AutoRepeat On" msgstr "Rptition Active" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 159 msgid "Start Delay: " msgstr "Dlai de Dpart:" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 185 msgid "Repeat Delay:" msgstr "Dlai de Rptition:" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 210 msgid "Keyboard" msgstr "Clavier" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 2 msgid "Pointer Setup" msgstr "Configuration de la Souris" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 108 msgid "Right-handed user|Left-handed user" msgstr "Droitier|Gaucher" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 122 msgid "Mouse configuration:" msgstr "Souris pour un:" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 150 msgid "Acceleration:" msgstr "Acclration:" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 177 msgid "Threshold (pixels):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 202 msgid "Pointer" msgstr "Souris" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 2 msgid "Screen Setup" msgstr "Configuration de l'cran" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 264 msgid "Background" msgstr "Fond" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 279 msgid "Uniform color:" msgstr "Couleur Uniforme:" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 394 msgid "Pixmap:" msgstr "Image:" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 425 msgid "Browser..." msgstr "Parcourir" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 468 msgid "Disable xinit background" msgstr "Pas de fond xinit" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 500 msgid "Screen-saver" msgstr "Sauveur d'cran" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 514 msgid "Blank" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 528 msgid "Timeout(s):" msgstr "Dlai(s):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 554 msgid "Pattern" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 569 msgid "Cycle(s):" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 614 msgid "DPMS" msgstr "DPMS" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 628 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 768 msgid "Enable" msgstr "Activer" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 643 msgid "Disable" msgstr "Dsactiver" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 657 msgid "Standby(s):" msgstr "Interrompre(s):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 684 msgid "Suspend(s):" msgstr "Veille(s):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 711 msgid "Off(s):" msgstr "Extinction(s):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 754 msgid "xscreensaver" msgstr "" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 794 msgid "Config and Demo" msgstr "Config et Dmo" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 2 msgid "File Browser" msgstr "Slectionneur de Fichiers" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 42 msgid "OK" msgstr "OK" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 58 msgid "Cancel" msgstr "Annuler" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 86 msgid "Path:" msgstr "Chemin:" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 181 msgid " Show hidden files" msgstr "Fichiers cachs" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 246 msgid "Selected file:" msgstr "Fichier slectionn:" fvwm-2.6.5.orig/po/FvwmScript.sv_SE.gmo0000644000175000017500000000504011744241503016066 0ustar vwcvwc/C  ,: @ NY^ cn t   &)17 ?JR Zh m"{     " *M7     8A FQk|     ' / )G q w          # /+ $&*('!-,.% ") Show hidden filesAcceleration:ApplyAutoRepeat OnBackgroundBeepBellBell SetupBlankBrowser...CancelClick Volume (%)Config and DemoCycle(s):DPMSDisableDisable xinit backgroundDuration(ms):EnableFile BrowserKeyboardKeyboard SetupMouse configuration:OKOff(s):Path:PatternPitch(Hz):Pixmap:PointerPointer SetupQuitRepeat Delay:Right-handed user|Left-handed userSaveScreen SetupScreen-saverSelected file:Standby(s):Start Delay: Suspend(s):Threshold (pixels):Timeout(s):Uniform color:Volume:xscreensaverProject-Id-Version: fvwm POT-Creation-Date: 2002-11-28 14:23+0100 PO-Revision-Date: 2003-10-19 13:33+0200 Last-Translator: Johan Svedberg Language-Team: Swedish Language: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Visa dolda filerAcceleration:VerkstllAutorepetition pBakgrundTutaRingklockaRingklockinstllningarTomBlddrare...AvbrytKlickvolym (%)Konfiguration och demonstrationCykel(s)DPMSInaktiveraInaktivera xinit-bakgrundVaraktighet(ms):AktiveraFilhanterareTangentbordTangentbordsinstllningarMuskonfiguration:OkAvstngning(s):Skvg:MnsterTonhjd(Hz):Punktgrafikbild:PekarePekdonsinstllningarAvslutaRepetitionsfrdrjning:Hgerhnt anvndare|Vnsterhnt anvndareSparaSkrminstllningarSkrmslckareVald fil:Standby(s):Startfrdrjning: Suspendering(s):Nedre grns (bildpunkter):Timeout(er):Genomgende frg:Volym:xscreensaverfvwm-2.6.5.orig/po/FvwmTaskBar.ar.gmo0000644000175000017500000000117511744241503015541 0ustar vwcvwcDl 2#";^Click here to startNo new mailYou have mailYou have new mailProject-Id-Version: fvwm POT-Creation-Date: 2003-04-11 12:43+0200 PO-Revision-Date: 2002-12-06 08:25+0100 Last-Translator: Nadim Shaikli Language-Team: Arabic Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Generator: KBabel 0.9.6 أضغط هنا للبدألا يوجد رسائل جديدةلديك رسائل بالبريدلديك رسائل جديدةfvwm-2.6.5.orig/po/FvwmTaskBar.de.po0000644000175000017500000000167511744241503015370 0ustar vwcvwc# German translations for fvwm package # Copyright (C) 2003 fvwm workers # This file is distributed under the same license as the fvwm package. # Andrei Mitrofanow , 2002. # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2003-04-11 12:43+0200\n" "PO-Revision-Date: 2002-11-27 21:29+0100\n" "Last-Translator: Andrei Mitrofanow \n" "Language-Team: German\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../modules/FvwmTaskBar/Goodies.c:462 msgid "No new mail" msgstr "Keine neue Post" #: ../modules/FvwmTaskBar/Goodies.c:466 msgid "You have new mail" msgstr "Sie haben neue Post" #: ../modules/FvwmTaskBar/Goodies.c:470 msgid "You have mail" msgstr "Sie haben Post" #: ../modules/FvwmTaskBar/FvwmTaskBar.c:1320 msgid "Click here to start" msgstr "Klick hier um zu starten" fvwm-2.6.5.orig/po/fvwm.de.gmo0000644000175000017500000001017010656151550014315 0ustar vwcvwcC4YL    =C R_n   ";J Zgw & 5CT \i z  ?D 8_       ?4 t       8 # 6 D T l       , E T b r z         %:Qc}  ;+Cg,   5B[/.$ >9" 24 1 *-' %8,<+0A);@C#!?76=&B5(:3 Geometry&Close&Delete&Lower&Move&Resize(De)&Iconify(Un)&Stick(Un)Ma&ximizeAfter creation, the fvwm2rc file can then be changed with anyAll Paging OFFBuiltin MenuClick To FocusColormap Follows FocusColormap Follows MouseControl AnimationCopy Config File(s)Create a starting .fvwm2rc fileDeskDesk: %d%sDestroyExit FvwmExit fvwmFocus Follows MouseFull Paging && Edge WrapFull Paging ONFvwm Config OpsFvwm ModulesFvwm Window OpsHorizontal Paging OnlyIssue fvwm commandsJust an XtermMore&...No, Don't QuitPartial PagingPrintPrint Re&verseR&aiseRe&fresh WindowReally Quit Fvwm?Recapture ScreenRefresh ScreenRemote LoginsReset X defaultsRestartRestart fvwmReturn - DismissRoot MenuSetup 95 ScriptSetup FormSloppy FocusStartStopStop Fvwm ModulesStop Module MenuThe file created is ~/.fvwm/.fvwm2rc or $FVWM_USERDIR/.fvwm2rc.These files are optional. Select the modules you want to customize.Use this form to create your fvwm2rc configuration file.UtilitiesVertical Paging OnlyWindow OpsYes, Really QuitYou can always copy them later.deskseditor to suit your own needs.fvwm - Create ConfigurationProject-Id-Version: fvwm POT-Creation-Date: 2002-11-28 14:23+0100 PO-Revision-Date: 2002-11-23 06:00+0100 Last-Translator: Andrei Mitrofanow Language-Team: German MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); Geometrie&Schliesse&LscheAb&senken&Verschieben&Grsse ndern(De)&Minimierer(Los)&Festklemmer(De)Ma&ximiererNach dem Erzeugen, knnen Sie die Datei mit einem EditorSeitenbergang ausInternes MenKlick fr FokusFarbpalette folgt FokusFarbpalette folgt MausAnimationskontrolleKonfigurationsdateien kopierenErzeuge eine Startdatei .fvwm2rcArbeitsplatzArbeitsplatz: %d%s&ZerstreFvwm beendenFvwm beendenFokus folgt MausSeitenbergang && EckenSeitenbergangKonfigurationModule von FvwmFensterSeitenbergang horizontalFvwm-KonsoleXTermMehr&...Nein, fvwm nicht beendenSeitenbergang teilweiseDruckenDrucken (Rckseite)An&hebenFester erneuernFvwm beenden?Bildschirm speichernBildschirm neuzeichnenEntfernt AnmeldenX Voreinstellungen setzenNeustartFvwm neu startenAnnehmen - SchliessenHaupt MenuKonfiguration mit Script95Konfiguration mit FormFokus flssigStartStopFvwm-Module stoppenFvwm-Module stoppenDie Datei ist ~/.fvwm/.fvwm2rc oder $FVWM_USERDIR/.fvwm2rc.Diese Dateien sind nicht notwendig. Die Auswahl der Module anpassenNutze dieses Formular um fvwm2rc zu erzeugenWerkzeugeSeitenbergang vertikaleFensterJa, fvwm beendenSie knnen diese spter kopierenArbeitsplatzan Ihre Wnsche anpassenfvwm - Erzeuge Konfigurationfvwm-2.6.5.orig/po/FvwmTaskBar.fr.po0000644000175000017500000000201711744241503015376 0ustar vwcvwc# French translations for fvwm package # Traduction anglaise du package fvwm. # Copyright (C) 2002 fvwm workers # This file is distributed under the same license as the fvwm package. # Olivier Chapuis , 2002. # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2003-04-11 12:43+0200\n" "PO-Revision-Date: 2002-11-27 21:29+0100\n" "Last-Translator: Olivier Chapuis \n" "Language-Team: French\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../modules/FvwmTaskBar/Goodies.c:462 msgid "No new mail" msgstr "Pas de nouveaux messages" #: ../modules/FvwmTaskBar/Goodies.c:466 msgid "You have new mail" msgstr "Vous avez un nouveau message" #: ../modules/FvwmTaskBar/Goodies.c:470 msgid "You have mail" msgstr "Vous avez un message" #: ../modules/FvwmTaskBar/FvwmTaskBar.c:1320 msgid "Click here to start" msgstr "Cliquer ici pour ouvrir le menu" fvwm-2.6.5.orig/po/FvwmScript.zh_CN.po0000644000175000017500000001475511744241503015721 0ustar vwcvwc# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR fvwm workers # This file is distributed under the same license as the PACKAGE package. # Funda Wang , 2004. # msgid "" msgstr "" "Project-Id-Version: FvwmScript\n" "POT-Creation-Date: 2002-11-28 14:23+0100\n" "PO-Revision-Date: 2004-05-22 16:16+0800\n" "Last-Translator: Funda Wang \n" "Language-Team: zh_CN \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 2 msgid "Bell Setup" msgstr "响铃设置" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 44 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 43 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 47 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 132 msgid "Apply" msgstr "应用" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 62 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 62 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 66 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 170 msgid "Save" msgstr "保存" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 80 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 89 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 94 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 235 msgid "Quit" msgstr "退出" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 95 msgid "Beep" msgstr "响铃" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 130 msgid "Volume:" msgstr "音量:" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 156 msgid "Pitch(Hz):" msgstr "频率(Hz):" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 182 msgid "Duration(ms):" msgstr "持续时间(毫秒):" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 207 msgid "Bell" msgstr "相应" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 2 msgid "Keyboard Setup" msgstr "键盘设置" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 120 msgid "Click Volume (%)" msgstr "点击音量(%)" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 133 msgid "AutoRepeat On" msgstr "自动重复开" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 159 msgid "Start Delay: " msgstr "启动延迟:" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 185 msgid "Repeat Delay:" msgstr "重复延迟:" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 210 msgid "Keyboard" msgstr "键盘" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 2 msgid "Pointer Setup" msgstr "指点设备设置" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 108 msgid "Right-handed user|Left-handed user" msgstr "右手用户|左手用户" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 122 msgid "Mouse configuration:" msgstr "鼠标配置:" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 150 msgid "Acceleration:" msgstr "加速:" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 177 msgid "Threshold (pixels):" msgstr "阀值(像素):" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 202 msgid "Pointer" msgstr "指针" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 2 msgid "Screen Setup" msgstr "屏幕设置" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 264 msgid "Background" msgstr "背景" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 279 msgid "Uniform color:" msgstr "单一颜色:" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 394 msgid "Pixmap:" msgstr "像素图:" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 425 msgid "Browser..." msgstr "浏览器..." #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 468 msgid "Disable xinit background" msgstr "禁用 xinit 背景" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 500 msgid "Screen-saver" msgstr "屏幕保护程序" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 514 msgid "Blank" msgstr "空" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 528 msgid "Timeout(s):" msgstr "计时(秒):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 554 msgid "Pattern" msgstr "图案" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 569 msgid "Cycle(s):" msgstr "循环(秒):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 614 msgid "DPMS" msgstr "DPMS" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 628 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 768 msgid "Enable" msgstr "启用" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 643 msgid "Disable" msgstr "禁用" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 657 msgid "Standby(s):" msgstr "待机(秒):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 684 msgid "Suspend(s):" msgstr "休眠(秒):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 711 msgid "Off(s):" msgstr "关机(秒):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 754 msgid "xscreensaver" msgstr "xscreensaver" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 794 msgid "Config and Demo" msgstr "配置并演示" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 2 msgid "File Browser" msgstr "文件浏览器" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 42 msgid "OK" msgstr "确定" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 58 msgid "Cancel" msgstr "取消" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 86 msgid "Path:" msgstr "路径:" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 181 msgid " Show hidden files" msgstr " 显示隐藏文件" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 246 msgid "Selected file:" msgstr "选中的文件:" fvwm-2.6.5.orig/po/FvwmTaskBar.zh_CN.gmo0000644000175000017500000000111511744241503016132 0ustar vwcvwcDl F # 0=Click here to startNo new mailYou have mailYou have new mailProject-Id-Version: FvwmTaskBar POT-Creation-Date: 2003-04-11 12:43+0200 PO-Revision-Date: 2004-05-22 16:17+0800 Last-Translator: Funda Wang Language-Team: zh_CN Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 点击此处开始无新邮件您有邮件您有新邮件fvwm-2.6.5.orig/po/FvwmScript.ar.gmo0000644000175000017500000000056211744241503015455 0ustar vwcvwc$,889Project-Id-Version: fvwm POT-Creation-Date: 2002-11-28 14:23+0100 PO-Revision-Date: 2003-04-13 11:35+0200 Last-Translator: NEEDS TRANSLATION Language-Team: Should be Arabic Language: MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: 8bit fvwm-2.6.5.orig/po/FvwmTaskBar.zh_CN.po0000644000175000017500000000163411744241503015774 0ustar vwcvwc# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR fvwm workers # This file is distributed under the same license as the PACKAGE package. # Funda Wang , 2004. # msgid "" msgstr "" "Project-Id-Version: FvwmTaskBar\n" "POT-Creation-Date: 2003-04-11 12:43+0200\n" "PO-Revision-Date: 2004-05-22 16:17+0800\n" "Last-Translator: Funda Wang \n" "Language-Team: zh_CN \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../modules/FvwmTaskBar/Goodies.c:462 msgid "No new mail" msgstr "无新邮件" #: ../modules/FvwmTaskBar/Goodies.c:466 msgid "You have new mail" msgstr "您有新邮件" #: ../modules/FvwmTaskBar/Goodies.c:470 msgid "You have mail" msgstr "您有邮件" #: ../modules/FvwmTaskBar/FvwmTaskBar.c:1320 msgid "Click here to start" msgstr "点击此处开始" fvwm-2.6.5.orig/po/fvwm.pot0000644000175000017500000001520710656151550013754 0ustar vwcvwc# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR fvwm workers # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2002-11-28 14:23+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: ../fvwm/fvwm.c:1362 msgid "Builtin Menu" msgstr "" #: ../fvwm/fvwm.c:1365 msgid "Setup Form" msgstr "" #: ../fvwm/fvwm.c:1368 msgid "Setup 95 Script" msgstr "" #: ../fvwm/fvwm.c:1371 msgid "Issue fvwm commands" msgstr "" #: ../fvwm/fvwm.c:1374 msgid "Restart fvwm" msgstr "" #: ../fvwm/fvwm.c:1375 msgid "Exit fvwm" msgstr "" #: ../fvwm/expand.c:255 ../fvwm/virtual.c:2042 msgid "Desk" msgstr "" #: ../fvwm/windowlist.c:94 ../fvwm/windowlist.c:100 ../fvwm/windowlist.c:107 msgid "\tGeometry" msgstr "" #: ../fvwm/windowlist.c:105 #, c-format msgid "Desk: %d%s" msgstr "" #: ../fvwm/menus.c:1674 msgid "More&..." msgstr "" #. ./fvwm/ConfigFvwmSetup: line 91 msgid "Root Menu" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 95 msgid "Remote Logins" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 97 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 109 msgid "Utilities" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 99 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 194 msgid "Fvwm Modules" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 100 msgid "Fvwm Window Ops" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 101 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 124 msgid "Fvwm Config Ops" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 103 msgid "Refresh Screen" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 104 msgid "Recapture Screen" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 106 msgid "Exit Fvwm" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 121 msgid "Reset X defaults" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 125 msgid "Sloppy Focus" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 126 msgid "Click To Focus" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 127 msgid "Focus Follows Mouse" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 129 msgid "Colormap Follows Mouse" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 130 msgid "Colormap Follows Focus" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 132 msgid "Full Paging ON" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 133 msgid "All Paging OFF" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 134 msgid "Horizontal Paging Only" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 135 msgid "Vertical Paging Only" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 136 msgid "Partial Paging" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 137 msgid "Full Paging && Edge Wrap" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 144 msgid "&Move" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 145 msgid "&Resize" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 146 msgid "R&aise" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 147 msgid "&Lower" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 148 msgid "(De)&Iconify" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 149 msgid "(Un)&Stick" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 150 msgid "(Un)Ma&ximize" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 152 msgid "&Delete" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 153 msgid "&Close" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 154 msgid "Destroy" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 161 msgid "Window Ops" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 163 msgid "Re&fresh Window" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 172 msgid "Print" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 173 msgid "Print Re&verse" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 195 msgid "Control Animation" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 204 msgid "desks" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 210 msgid "Stop Module Menu" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 213 msgid "Stop Fvwm Modules" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 214 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 215 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 216 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 217 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 218 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 219 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 220 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 221 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 222 msgid "Stop" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 241 msgid "Really Quit Fvwm?" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 242 msgid "Yes, Really Quit" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 244 msgid "Restart" msgstr "" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 246 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 247 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 248 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 249 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 250 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 251 msgid "Start" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 253 msgid "Just an Xterm" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 255 msgid "No, Don't Quit" msgstr "" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 8 msgid "fvwm - Create Configuration" msgstr "" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 13 msgid "Use this form to create your fvwm2rc configuration file." msgstr "" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 15 msgid "The file created is ~/.fvwm/.fvwm2rc or $FVWM_USERDIR/.fvwm2rc." msgstr "" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 19 msgid "After creation, the fvwm2rc file can then be changed with any" msgstr "" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 21 msgid "editor to suit your own needs." msgstr "" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 26 msgid "Create a starting .fvwm2rc file" msgstr "" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 30 msgid "These files are optional. Select the modules you want to customize." msgstr "" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 32 msgid "You can always copy them later." msgstr "" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 53 msgid "Return - Dismiss" msgstr "" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 55 msgid "Copy Config File(s)" msgstr "" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 66 msgid "Restart fvwm" msgstr "" fvwm-2.6.5.orig/po/fvwm.zh_CN.po0000644000175000017500000001712310656151550014567 0ustar vwcvwc# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR fvwm workers # This file is distributed under the same license as the PACKAGE package. # Funda Wang , 2004. # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2002-11-28 14:23+0100\n" "PO-Revision-Date: 2004-05-22 16:12+0800\n" "Last-Translator: Funda Wang \n" "Language-Team: zh_CN \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../fvwm/fvwm.c:1362 msgid "Builtin Menu" msgstr "内建菜单" #: ../fvwm/fvwm.c:1365 msgid "Setup Form" msgstr "设置表单" #: ../fvwm/fvwm.c:1368 msgid "Setup 95 Script" msgstr "设置 95 脚本" #: ../fvwm/fvwm.c:1371 msgid "Issue fvwm commands" msgstr "执行 fvwm 命令" #: ../fvwm/fvwm.c:1374 msgid "Restart fvwm" msgstr "重新启动 fvwm" #: ../fvwm/fvwm.c:1375 msgid "Exit fvwm" msgstr "退出 fvwm" #: ../fvwm/expand.c:255 ../fvwm/virtual.c:2042 msgid "Desk" msgstr "桌面" #: ../fvwm/windowlist.c:94 ../fvwm/windowlist.c:100 ../fvwm/windowlist.c:107 msgid "\tGeometry" msgstr "\t几何" #: ../fvwm/windowlist.c:105 #, c-format msgid "Desk: %d%s" msgstr "桌面:%d%s" #: ../fvwm/menus.c:1674 msgid "More&..." msgstr "" #. ./fvwm/ConfigFvwmSetup: line 91 msgid "Root Menu" msgstr "根菜单" #. ./fvwm/ConfigFvwmSetup: line 95 msgid "Remote Logins" msgstr "远程登录" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 97 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 109 msgid "Utilities" msgstr "实用工具" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 99 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 194 msgid "Fvwm Modules" msgstr "Fvwm 模块" #. ./fvwm/ConfigFvwmSetup: line 100 msgid "Fvwm Window Ops" msgstr "Fvwm 窗口操作" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 101 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 124 msgid "Fvwm Config Ops" msgstr "Fvwm 配置操作" #. ./fvwm/ConfigFvwmSetup: line 103 msgid "Refresh Screen" msgstr "刷新屏幕" #. ./fvwm/ConfigFvwmSetup: line 104 msgid "Recapture Screen" msgstr "重新抓取屏幕" #. ./fvwm/ConfigFvwmSetup: line 106 msgid "Exit Fvwm" msgstr "退出 Fvwm" #. ./fvwm/ConfigFvwmSetup: line 121 msgid "Reset X defaults" msgstr "重置 X 默认值" #. ./fvwm/ConfigFvwmSetup: line 125 msgid "Sloppy Focus" msgstr "粘性置焦" #. ./fvwm/ConfigFvwmSetup: line 126 msgid "Click To Focus" msgstr "单击置焦" #. ./fvwm/ConfigFvwmSetup: line 127 msgid "Focus Follows Mouse" msgstr "焦点跟随鼠标" #. ./fvwm/ConfigFvwmSetup: line 129 msgid "Colormap Follows Mouse" msgstr "颜色图跟随鼠标" #. ./fvwm/ConfigFvwmSetup: line 130 msgid "Colormap Follows Focus" msgstr "颜色图跟随焦点" #. ./fvwm/ConfigFvwmSetup: line 132 msgid "Full Paging ON" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 133 msgid "All Paging OFF" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 134 msgid "Horizontal Paging Only" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 135 msgid "Vertical Paging Only" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 136 msgid "Partial Paging" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 137 msgid "Full Paging && Edge Wrap" msgstr "" #. ./fvwm/ConfigFvwmSetup: line 144 msgid "&Move" msgstr "移动(&M)" #. ./fvwm/ConfigFvwmSetup: line 145 msgid "&Resize" msgstr "大小(&R)" #. ./fvwm/ConfigFvwmSetup: line 146 msgid "R&aise" msgstr "升起(&A)" #. ./fvwm/ConfigFvwmSetup: line 147 msgid "&Lower" msgstr "降低(&L)" #. ./fvwm/ConfigFvwmSetup: line 148 msgid "(De)&Iconify" msgstr "最小化(&I)" #. ./fvwm/ConfigFvwmSetup: line 149 msgid "(Un)&Stick" msgstr "置顶(&S)" #. ./fvwm/ConfigFvwmSetup: line 150 msgid "(Un)Ma&ximize" msgstr "最大化(&X)" #. ./fvwm/ConfigFvwmSetup: line 152 msgid "&Delete" msgstr "删除(&D)" #. ./fvwm/ConfigFvwmSetup: line 153 msgid "&Close" msgstr "关闭(&C)" #. ./fvwm/ConfigFvwmSetup: line 154 msgid "Destroy" msgstr "摧毁" #. ./fvwm/ConfigFvwmSetup: line 161 msgid "Window Ops" msgstr "窗口操作" #. ./fvwm/ConfigFvwmSetup: line 163 msgid "Re&fresh Window" msgstr "刷新窗口(&F)" #. ./fvwm/ConfigFvwmSetup: line 172 msgid "Print" msgstr "打印" #. ./fvwm/ConfigFvwmSetup: line 173 msgid "Print Re&verse" msgstr "翻转打印(&V)" #. ./fvwm/ConfigFvwmSetup: line 195 msgid "Control Animation" msgstr "控制动画" #. ./fvwm/ConfigFvwmSetup: line 204 msgid "desks" msgstr "桌面" #. ./fvwm/ConfigFvwmSetup: line 210 msgid "Stop Module Menu" msgstr "停止模块菜单" #. ./fvwm/ConfigFvwmSetup: line 213 msgid "Stop Fvwm Modules" msgstr "停止 Fvwm 模块" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 214 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 215 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 216 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 217 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 218 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 219 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 220 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 221 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 222 msgid "Stop" msgstr "停止" #. ./fvwm/ConfigFvwmSetup: line 241 msgid "Really Quit Fvwm?" msgstr "真的要退出 Fvwm 吗?" #. ./fvwm/ConfigFvwmSetup: line 242 msgid "Yes, Really Quit" msgstr "是的,真的退出" #. ./fvwm/ConfigFvwmSetup: line 244 msgid "Restart" msgstr "重新启动" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 246 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 247 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 248 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 249 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 250 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 251 msgid "Start" msgstr "开始" #. ./fvwm/ConfigFvwmSetup: line 253 msgid "Just an Xterm" msgstr "只是 Xterm" #. ./fvwm/ConfigFvwmSetup: line 255 msgid "No, Don't Quit" msgstr "不,不要退出" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 8 msgid "fvwm - Create Configuration" msgstr "fvwm - 创建配置" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 13 msgid "Use this form to create your fvwm2rc configuration file." msgstr "使用此表单创建您自己的 fvwm2rc 配置文件。" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 15 msgid "The file created is ~/.fvwm/.fvwm2rc or $FVWM_USERDIR/.fvwm2rc." msgstr "创建的文件是 ~/.fvwm/.fvwm2rc 或 $FVWM_USERDIR/.fvwm2rc。" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 19 msgid "After creation, the fvwm2rc file can then be changed with any" msgstr "创建之后,fvwm2rc 文件就可以用您喜欢的任何" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 21 msgid "editor to suit your own needs." msgstr "文本编辑器进行更改。" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 26 msgid "Create a starting .fvwm2rc file" msgstr "创建初始的 .fvwm2rc 文件" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 30 msgid "These files are optional. Select the modules you want to customize." msgstr "这些文件是可选的。请选择您想要自定义的模块。" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 32 msgid "You can always copy them later." msgstr "您当然可以稍后再复制。" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 53 msgid "Return - Dismiss" msgstr "返回 - 丢弃" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 55 msgid "Copy Config File(s)" msgstr "复制配置文件" fvwm-2.6.5.orig/po/fvwm.ar.gmo0000644000175000017500000001142610656151550014334 0ustar vwcvwcB,Y<    =3 BO^u   +: JWg~   *; CP ak { ?D 8F        ' C S ] g q y '   n $P "u  3 1  ". ,Q ~    " 5 %,Ro  7 A'b*5Ig| $IjFa"-Pl: &.-# =8' 13 0 ),& $7+;*/@(:?B"!>65<%A492 Geometry&Close&Delete&Lower&Move&Resize(De)&Iconify(Un)&Stick(Un)Ma&ximizeAfter creation, the fvwm2rc file can then be changed with anyAll Paging OFFBuiltin MenuClick To FocusColormap Follows FocusColormap Follows MouseControl AnimationCopy Config File(s)Create a starting .fvwm2rc fileDeskDesk: %d%sDestroyExit FvwmExit fvwmFocus Follows MouseFull Paging && Edge WrapFull Paging ONFvwm Config OpsFvwm ModulesFvwm Window OpsHorizontal Paging OnlyIssue fvwm commandsJust an XtermNo, Don't QuitPartial PagingPrintPrint Re&verseR&aiseRe&fresh WindowReally Quit Fvwm?Recapture ScreenRefresh ScreenRemote LoginsReset X defaultsRestartRestart fvwmReturn - DismissRoot MenuSetup 95 ScriptSetup FormSloppy FocusStartStopStop Fvwm ModulesStop Module MenuThe file created is ~/.fvwm/.fvwm2rc or $FVWM_USERDIR/.fvwm2rc.These files are optional. Select the modules you want to customize.Use this form to create your fvwm2rc configuration file.UtilitiesVertical Paging OnlyWindow OpsYes, Really QuitYou can always copy them later.deskseditor to suit your own needs.fvwm - Create ConfigurationProject-Id-Version: fvwm POT-Creation-Date: 2002-11-28 14:23+0100 PO-Revision-Date: 2002-12-06 08:25+0100 Last-Translator: Nadim Shaikli Language-Team: Arabic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Generator: KBabel 0.9.6 الأبعادأ&غلقاح&ذفا&خفض&حركغ&ير الحجم(عدم) التحويل لأي&قونة(أزل)ت&ثبيت(أزل) الت&كبيربعد الإنشاء، من الممكن تعديل الملف الخيارات fvwm2rc بإستعمال أيتوقيف التصفح الكاملقائمة مبنية داخلياتركيز بالضعطخارطة الألوان تلحق بالتركيزخارطة الألوان تلحق بالفارةتحكم بالحركةإنسخ ملفات التعريفأنشئ الملف المبدئي .fvwm2rc المكتبالمكتب: %d%sتدميرالخروج من Fvwmأخرج من fvwmتركيز بلحاق الفارةتصفح كامل مع القلب عند الحوافتشغيل التصفح الكامل خيارات إعداد Fvwmوحدات Fvwmخيارات نوافذ Fvwmالتصفح الأفقي فقطأصدر أوامر fvwmأظهر Xterm فقطلا، لا تخرجتصفح جزئيأطبعأطبع بالم&قلوبار&فعأعد تنشيط النافذةهل تريد الخروج من Fvwm ؟أعد عرض الشاشةأعد تنشيط الشاشةالدخول عن بعدإسترجاع الإفتراضي لأكسأعد التشغيلأعد تشغيل fvwmرجوع - خروجالقائمة الجذريةملف إعداد 95شاشة الإعدادتركيز بطيئإبدأإيقافإيقاف وحدات Fvemقائمة إيقاف الوحداتالملف المنشأ هو ~/.fvwm/.fvwm2rc أو $FVWM_USERDIR/.fvwm2rcالملفات التالية إختيارية. أختر الوحدات التي تود أن تخصصها.إستعمل هذا النموذج لإنشاء ملف الإعدادات fvwm2rc الخاص بكبرامج الخدماتالتصفح العمودي فقطخيارات النافذةنعم، أريد الخروجتستطيع نسخهم في الوقت الذي تريد.مكاتبمحرر نصوص تريده.إنشاء ملف خيارات ل fvwmfvwm-2.6.5.orig/po/ChangeLog0000644000175000017500000000553111652476141014025 0ustar vwcvwc2011-10-15 Thomas Adam * FvwmTaskBar.zh_TW.po: * FvwmScript.zh_TW.po: * fvwm.zh_TW.po: Add Traditional Chinese translation. 2007-08-07 Dominik Vogt * fvwm.pot: * fvwm.sv_SE.po: * fvwm.fr.po: * fvwm.zh_CN.po: * fvwm.ar.po: * fvwm.de.po: write fvwm in lower case 2007-04-29 Viktor Griph * Makefile.am (FVWM_POT_FILES): added ../fvwm/menus.c to FVWM_POT_FILES * fvwm.sv_SE.po: translated "More&..." to Swedish 2007-04-17 Jesus Guerrero <6thpink(at)terra(dot)es> * po/fvwm.de.po: * po/fvwm.fr.po: * po/fvwm.pot: added the "&More..." string 2004-05-23 Mikhael Goikhman * po/FvwmScript.zh_CN.gmo: * po/FvwmScript.zh_CN.po: * po/FvwmTaskBar.zh_CN.gmo: * po/FvwmTaskBar.zh_CN.po: * po/fvwm.zh_CN.gmo: * po/fvwm.zh_CN.po: added Chinese translations by Funda Wang 2003-10-26 Mikhael Goikhman * fvwm.sv_SE.po: * FvwmTaskBar.sv_SE.po: * FvwmScript.sv_SE.po: added Swedish translations by Johan Svedberg 2003-10-15 Mikhael Goikhman * fvwm.de.gmo: * fvwm.de.po: * FvwmTaskBar.de.gmo: * FvwmTaskBar.de.po: * FvwmScript.de.gmo: * FvwmScript.de.po: added German translations by Andrei Mitrofanow 2003-04-16 olicha * Makefile.am: Fixed make dist 2003-04-14 olicha * Makefile.am: * FvwmScript.pot (new file): Adding FvwmScript pot and rules * FvwmScript.fr.po (new file): * FvwmScript.fr.gmo (new file): French translation 2002-12-06 olicha * fvwm.ar.gmo (new file): * FvwmTaskBar.ar.gmo (new file): * fvwm.ar.po (new file): * FvwmTaskBar.ar.po (new file): Arabic translation from Nadim Shaikli * README: Updated 2002-12-03 olicha * FvwmTaskBar.fr.po: * FvwmTaskBar.fr.gmo: Fixed translation, courrier -> message 2002-12-02 olicha * Makefile.am (uninstall-local-yes): Fixed make uninstall 2002-12-02 Dominik Vogt * Makefile.am: fixed (?) install and uninstall rules (uninstall-local-yes): use ALL_DOMAINS instead of undefined ALL_DOMAIN 2002-11-28 olicha * fvwm.fr.gmo (new file): * FvwmTaskBar.fr.gmo (new file): Auto generated binary version of fvwm.fr.po and FvwmTaskBar.fr.po * fvwm.fr.po (new file): * FvwmTaskBar.fr.po (new file): French translation files * fvwm.pot (new file): * FvwmTaskBar.pot (new file): po templet files (auto regenerated by make update-po) * README (new file): Start a convenient little doc * Makefile.am (new file): * remove-potcdate.sed (new file): * remove-potcdate.sin (new file): New directory for NLS Dump the gettext-0.11.5 po/ directory and totally modify it for Automake and multiple domain fvwm-2.6.5.orig/po/fvwm.fr.po0000644000175000017500000001775210656151550014205 0ustar vwcvwc# French translations for fvwm package # Traduction anglaise du package fvwm. # Copyright (C) 2002 fvwm workers # This file is distributed under the same license as the fvwm package. # Olivier Chapuis , 2002. # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2002-11-28 14:23+0100\n" "PO-Revision-Date: 2002-11-23 06:00+0100\n" "Last-Translator: Olivier Chapuis \n" "Language-Team: French\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: ../fvwm/fvwm.c:1362 msgid "Builtin Menu" msgstr "Menu Interne" #: ../fvwm/fvwm.c:1365 msgid "Setup Form" msgstr "Configuration avec Form" #: ../fvwm/fvwm.c:1368 msgid "Setup 95 Script" msgstr "Configuration avec Script95" #: ../fvwm/fvwm.c:1371 msgid "Issue fvwm commands" msgstr "Executer des commandes fvwm" #: ../fvwm/fvwm.c:1374 msgid "Restart fvwm" msgstr "Redmarrer fvwm" #: ../fvwm/fvwm.c:1375 msgid "Exit fvwm" msgstr "Quitter fvwm" #: ../fvwm/expand.c:255 ../fvwm/virtual.c:2042 msgid "Desk" msgstr "Bureau" #: ../fvwm/windowlist.c:94 ../fvwm/windowlist.c:100 ../fvwm/windowlist.c:107 msgid "\tGeometry" msgstr "\tGometrie" #: ../fvwm/windowlist.c:105 #, c-format msgid "Desk: %d%s" msgstr "Bureau: %d%s" #: ../fvwm/menus.c:1674 msgid "More&..." msgstr "Plus&..." #. ./fvwm/ConfigFvwmSetup: line 91 msgid "Root Menu" msgstr "Menu Principal" #. ./fvwm/ConfigFvwmSetup: line 95 msgid "Remote Logins" msgstr "Login distance" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 97 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 109 msgid "Utilities" msgstr "Utilitaires" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 99 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 194 msgid "Fvwm Modules" msgstr "Modules de Fvwm" #. ./fvwm/ConfigFvwmSetup: line 100 msgid "Fvwm Window Ops" msgstr "Oprations sur les fentres" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 101 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 124 msgid "Fvwm Config Ops" msgstr "Oprations de config" #. ./fvwm/ConfigFvwmSetup: line 103 msgid "Refresh Screen" msgstr "Raffrachir l'cran" #. ./fvwm/ConfigFvwmSetup: line 104 msgid "Recapture Screen" msgstr "Recapturer l'cran" #. ./fvwm/ConfigFvwmSetup: line 106 msgid "Exit Fvwm" msgstr "Quitter fvwm" #. ./fvwm/ConfigFvwmSetup: line 121 msgid "Reset X defaults" msgstr "Rtablir les dfauts de X" #. ./fvwm/ConfigFvwmSetup: line 125 msgid "Sloppy Focus" msgstr "Focus fluide" #. ./fvwm/ConfigFvwmSetup: line 126 msgid "Click To Focus" msgstr "Cliquer pour le Focus" #. ./fvwm/ConfigFvwmSetup: line 127 msgid "Focus Follows Mouse" msgstr "Le Focus suit la souris" #. ./fvwm/ConfigFvwmSetup: line 129 msgid "Colormap Follows Mouse" msgstr "La Colormap suit la souris" #. ./fvwm/ConfigFvwmSetup: line 130 msgid "Colormap Follows Focus" msgstr "La Colormap suit le Focus" #. ./fvwm/ConfigFvwmSetup: line 132 msgid "Full Paging ON" msgstr "Pagination complte active" #. ./fvwm/ConfigFvwmSetup: line 133 msgid "All Paging OFF" msgstr "Toute Pagination dsactive" #. ./fvwm/ConfigFvwmSetup: line 134 msgid "Horizontal Paging Only" msgstr "Pagination horizontale seulement" #. ./fvwm/ConfigFvwmSetup: line 135 msgid "Vertical Paging Only" msgstr "Pagination verticale seulement" #. ./fvwm/ConfigFvwmSetup: line 136 msgid "Partial Paging" msgstr "Pagination partielle" #. ./fvwm/ConfigFvwmSetup: line 137 msgid "Full Paging && Edge Wrap" msgstr "Pagination complte && Bord lectrique" #. ./fvwm/ConfigFvwmSetup: line 144 msgid "&Move" msgstr "&Dplacer" #. ./fvwm/ConfigFvwmSetup: line 145 msgid "&Resize" msgstr "&Redimensionner" #. ./fvwm/ConfigFvwmSetup: line 146 msgid "R&aise" msgstr "&En avant" #. ./fvwm/ConfigFvwmSetup: line 147 msgid "&Lower" msgstr "En &arrire" #. ./fvwm/ConfigFvwmSetup: line 148 msgid "(De)&Iconify" msgstr "(De)&Minimiser" #. ./fvwm/ConfigFvwmSetup: line 149 msgid "(Un)&Stick" msgstr "(De)&Fixer" #. ./fvwm/ConfigFvwmSetup: line 150 msgid "(Un)Ma&ximize" msgstr "(De)&Maximiser" #. ./fvwm/ConfigFvwmSetup: line 152 msgid "&Delete" msgstr "&Quitter" #. ./fvwm/ConfigFvwmSetup: line 153 msgid "&Close" msgstr "&Fermer" #. ./fvwm/ConfigFvwmSetup: line 154 msgid "Destroy" msgstr "&Bruler" #. ./fvwm/ConfigFvwmSetup: line 161 msgid "Window Ops" msgstr "Oprations sur les fentres" #. ./fvwm/ConfigFvwmSetup: line 163 msgid "Re&fresh Window" msgstr "Rafrchir la fentre" #. ./fvwm/ConfigFvwmSetup: line 172 msgid "Print" msgstr "Imprimer" #. ./fvwm/ConfigFvwmSetup: line 173 msgid "Print Re&verse" msgstr "Imprimer (reverse)" #. ./fvwm/ConfigFvwmSetup: line 195 msgid "Control Animation" msgstr "Controler l'animation" #. ./fvwm/ConfigFvwmSetup: line 204 msgid "desks" msgstr "bureau" #. ./fvwm/ConfigFvwmSetup: line 210 msgid "Stop Module Menu" msgstr "Arrter des Modules" #. ./fvwm/ConfigFvwmSetup: line 213 msgid "Stop Fvwm Modules" msgstr "Arrter des Modules" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 214 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 215 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 216 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 217 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 218 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 219 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 220 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 221 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 222 msgid "Stop" msgstr "Stop" #. ./fvwm/ConfigFvwmSetup: line 241 msgid "Really Quit Fvwm?" msgstr "On quitte vraiment ?" #. ./fvwm/ConfigFvwmSetup: line 242 msgid "Yes, Really Quit" msgstr "Oui, On quitte vraiment" #. ./fvwm/ConfigFvwmSetup: line 244 msgid "Restart" msgstr "Redmarrer" #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 246 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 247 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 248 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 249 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 250 #. #-#-#-#-# duplicate #-#-#-#-# #. ./fvwm/ConfigFvwmSetup: line 251 msgid "Start" msgstr "Dmarrer" #. ./fvwm/ConfigFvwmSetup: line 253 msgid "Just an Xterm" msgstr "Juste XTerm" #. ./fvwm/ConfigFvwmSetup: line 255 msgid "No, Don't Quit" msgstr "Non, On ne quitte pas" # FvwmForm #. ./modules/FvwmForm/FvwmForm-Setup.in: line 8 msgid "fvwm - Create Configuration" msgstr "fvwm - Crer votre Configuration" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 13 msgid "Use this form to create your fvwm2rc configuration file." msgstr "Utilisez cette Form pour crer votre fichier de configuration" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 15 msgid "The file created is ~/.fvwm/.fvwm2rc or $FVWM_USERDIR/.fvwm2rc." msgstr "Ce ficher est ~/.fvwm/.fvwm2rc ou $FVWM_USERDIR/.fvwm2rc." #. ./modules/FvwmForm/FvwmForm-Setup.in: line 19 msgid "After creation, the fvwm2rc file can then be changed with any" msgstr "Aprs cration, vous pouvez diter ce fichier avec un diteur" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 21 msgid "editor to suit your own needs." msgstr "pour une configuration votre convenance" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 26 msgid "Create a starting .fvwm2rc file" msgstr "Crez un fichier .fvwm2rc initial" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 30 msgid "These files are optional. Select the modules you want to customize." msgstr "Ces fichiers sont optionnels. Choisissez les modules diter" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 32 msgid "You can always copy them later." msgstr "Vous pourrez les copier plus tard" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 53 msgid "Return - Dismiss" msgstr "Quitter" #. ./modules/FvwmForm/FvwmForm-Setup.in: line 55 msgid "Copy Config File(s)" msgstr "Copier les Fichiers" fvwm-2.6.5.orig/po/FvwmScript.sv_SE.po0000644000175000017500000001517411744241503015733 0ustar vwcvwc# Swedish translations for fvwm package # Svenska versttningar fr paket fvwm. # Copyright (C) 2003 fvwm workers # This file is distributed under the same license as the fvwm package. # Johan Svedberg , 2003. # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2002-11-28 14:23+0100\n" "PO-Revision-Date: 2003-10-19 13:33+0200\n" "Last-Translator: Johan Svedberg \n" "Language-Team: Swedish\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 2 msgid "Bell Setup" msgstr "Ringklockinstllningar" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 44 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 43 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 47 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 132 msgid "Apply" msgstr "Verkstll" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 62 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 62 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 66 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 170 msgid "Save" msgstr "Spara" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 80 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 89 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 94 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 235 msgid "Quit" msgstr "Avsluta" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 95 msgid "Beep" msgstr "Tuta" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 130 msgid "Volume:" msgstr "Volym:" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 156 msgid "Pitch(Hz):" msgstr "Tonhjd(Hz):" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 182 msgid "Duration(ms):" msgstr "Varaktighet(ms):" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 207 msgid "Bell" msgstr "Ringklocka" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 2 msgid "Keyboard Setup" msgstr "Tangentbordsinstllningar" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 120 msgid "Click Volume (%)" msgstr "Klickvolym (%)" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 133 msgid "AutoRepeat On" msgstr "Autorepetition p" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 159 msgid "Start Delay: " msgstr "Startfrdrjning: " #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 185 msgid "Repeat Delay:" msgstr "Repetitionsfrdrjning:" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 210 msgid "Keyboard" msgstr "Tangentbord" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 2 msgid "Pointer Setup" msgstr "Pekdonsinstllningar" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 108 msgid "Right-handed user|Left-handed user" msgstr "Hgerhnt anvndare|Vnsterhnt anvndare" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 122 msgid "Mouse configuration:" msgstr "Muskonfiguration:" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 150 msgid "Acceleration:" msgstr "Acceleration:" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 177 msgid "Threshold (pixels):" msgstr "Nedre grns (bildpunkter):" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 202 msgid "Pointer" msgstr "Pekare" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 2 msgid "Screen Setup" msgstr "Skrminstllningar" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 264 msgid "Background" msgstr "Bakgrund" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 279 msgid "Uniform color:" msgstr "Genomgende frg:" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 394 msgid "Pixmap:" msgstr "Punktgrafikbild:" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 425 msgid "Browser..." msgstr "Blddrare..." #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 468 msgid "Disable xinit background" msgstr "Inaktivera xinit-bakgrund" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 500 msgid "Screen-saver" msgstr "Skrmslckare" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 514 msgid "Blank" msgstr "Tom" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 528 msgid "Timeout(s):" msgstr "Timeout(er):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 554 msgid "Pattern" msgstr "Mnster" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 569 msgid "Cycle(s):" msgstr "Cykel(s)" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 614 msgid "DPMS" msgstr "DPMS" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 628 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 768 msgid "Enable" msgstr "Aktivera" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 643 msgid "Disable" msgstr "Inaktivera" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 657 msgid "Standby(s):" msgstr "Standby(s):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 684 msgid "Suspend(s):" msgstr "Suspendering(s):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 711 msgid "Off(s):" msgstr "Avstngning(s):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 754 msgid "xscreensaver" msgstr "xscreensaver" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 794 msgid "Config and Demo" msgstr "Konfiguration och demonstration" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 2 msgid "File Browser" msgstr "Filhanterare" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 42 msgid "OK" msgstr "Ok" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 58 msgid "Cancel" msgstr "Avbryt" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 86 msgid "Path:" msgstr "Skvg:" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 181 msgid " Show hidden files" msgstr " Visa dolda filer" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 246 msgid "Selected file:" msgstr "Vald fil:" fvwm-2.6.5.orig/po/remove-potcdate.sed0000644000175000017500000000007207571567375016060 0ustar vwcvwc/^"POT-Creation-Date: .*"$/{ x s/P/P/ ta g d bb :a x :b } fvwm-2.6.5.orig/po/FvwmScript.de.po0000644000175000017500000001506111744241503015277 0ustar vwcvwc# German translations for fvwm package # Copyright (C) 2003 fvwm workers # This file is distributed under the same license as the fvwm package. # Andrei Mitrofanow , 2003. # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2002-11-28 14:23+0100\n" "PO-Revision-Date: 2003-04-13 11:35+0200\n" "Last-Translator: Andrei Mitrofanow \n" "Language-Team: German\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 2 msgid "Bell Setup" msgstr "Lautsprecher Konfiguration" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 44 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 43 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 47 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 132 msgid "Apply" msgstr "Akzeptieren" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 62 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 62 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 66 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 170 msgid "Save" msgstr "Speichern" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 80 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 89 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 94 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 235 msgid "Quit" msgstr "Beenden" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 95 msgid "Beep" msgstr "Piebton" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 130 msgid "Volume:" msgstr "Lautstrke:" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 156 msgid "Pitch(Hz):" msgstr "Tonhhe(Hz)" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 182 msgid "Duration(ms):" msgstr "Dauer(ms):" #. ./modules/FvwmScript/Scripts/FvwmScript-BellSetup: line 207 msgid "Bell" msgstr "Lautsprecher" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 2 msgid "Keyboard Setup" msgstr "Konfiguration der Tastatur" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 120 msgid "Click Volume (%)" msgstr "Lautstrke des Klicks (%)" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 133 msgid "AutoRepeat On" msgstr "Wiederhohlung Aktiv" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 159 msgid "Start Delay: " msgstr "Startverzgerung:" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 185 msgid "Repeat Delay:" msgstr "Wiederhohlverzgerung:" #. ./modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup: line 210 msgid "Keyboard" msgstr "Tastatur" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 2 msgid "Pointer Setup" msgstr "Maus Einstellungen" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 108 msgid "Right-handed user|Left-handed user" msgstr "Rechtshnder|Linkshnder" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 122 msgid "Mouse configuration:" msgstr "Maus Konfiguration:" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 150 msgid "Acceleration:" msgstr "Beschleunigung:" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 177 msgid "Threshold (pixels):" msgstr "Schwellwert" #. ./modules/FvwmScript/Scripts/FvwmScript-PointerSetup: line 202 msgid "Pointer" msgstr "Zeiger" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 2 msgid "Screen Setup" msgstr "Bildschirm Einstellungen" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 264 msgid "Background" msgstr "Hintergrund" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 279 msgid "Uniform color:" msgstr "Farben:" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 394 msgid "Pixmap:" msgstr "Bilder:" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 425 msgid "Browser..." msgstr "Betrachter" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 468 msgid "Disable xinit background" msgstr "Deaktiviere Hintergrund" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 500 msgid "Screen-saver" msgstr "Bildschirmschoner" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 514 msgid "Blank" msgstr "Leer" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 528 msgid "Timeout(s):" msgstr "Timeout(s):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 554 msgid "Pattern" msgstr "Pattern" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 569 msgid "Cycle(s):" msgstr "Kreislauf" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 614 msgid "DPMS" msgstr "DPMS" #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 628 #. #-#-#-#-# duplicate #-#-#-#-# #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 768 msgid "Enable" msgstr "Aktivieren" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 643 msgid "Disable" msgstr "Deaktivieren" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 657 msgid "Standby(s):" msgstr "Standby(s):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 684 msgid "Suspend(s):" msgstr "Suspend(s):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 711 msgid "Off(s):" msgstr "Aus(s):" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 754 msgid "xscreensaver" msgstr "xscreensaver" #. ./modules/FvwmScript/Scripts/FvwmScript-ScreenSetup: line 794 msgid "Config and Demo" msgstr "Konfiguration und Demo" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 2 msgid "File Browser" msgstr "Dateimanager" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 42 msgid "OK" msgstr "OK" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 58 msgid "Cancel" msgstr "Abbrechen" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 86 msgid "Path:" msgstr "Pfad:" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 181 msgid " Show hidden files" msgstr "Zeige versteckte Dateien" #. ./modules/FvwmScript/Scripts/FvwmScript-FileBrowser: line 246 msgid "Selected file:" msgstr "Auswahl:" fvwm-2.6.5.orig/po/Makefile.am0000644000175000017500000002635310615067467014321 0ustar vwcvwc localedir = @LOCALEDIR@ FVWM_POT_FILES = \ ../fvwm/fvwm.c \ ../fvwm/expand.c \ ../fvwm/windowlist.c \ ../fvwm/virtual.c \ ../fvwm/menus.c FVWMRC_POT_FILES = \ ../fvwm/ConfigFvwmSetup \ ../modules/FvwmForm/FvwmForm-Setup.in FVWMTASKBAR_POT_FILES = \ ../modules/FvwmTaskBar/Goodies.c \ ../modules/FvwmTaskBar/FvwmTaskBar.c FVWMSCRIPT_POT_FILES = \ ../modules/FvwmScript/Scripts/FvwmScript-BellSetup \ ../modules/FvwmScript/Scripts/FvwmScript-KeyboardSetup \ ../modules/FvwmScript/Scripts/FvwmScript-PointerSetup \ ../modules/FvwmScript/Scripts/FvwmScript-ScreenSetup \ ../modules/FvwmScript/Scripts/FvwmScript-FileBrowser EXTRA_DIST = \ @POFILES@ @GMOFILES@ fvwm.pot FvwmTaskBar.pot FvwmScript.pot \ remove-potcdate.sed remove-potcdate.sin COPYRIGHT_HOLDER = fvwm workers # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = MSGMERGE_UPDATE = @MSGMERGE@ --update SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ if test -f $${lang}.po; then \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo; \ fi .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all-local: all-local-@USE_NLS@ # make [all] should do nothing ... #all-local-yes: $(CATALOGS) all-local-yes: all-local-no: catalogs: $(CATALOGS) maintainer-clean-local: rm -f $(GMOFILES) $(FVWM_DOMAIN).pot-update: $(FVWM_POT_FILES) \ $(FVWMRC_POT_FILES) \ remove-potcdate.sed rm -f fvwmrc.pot; \ rcpotfiles='$(FVWMRC_POT_FILES)'; \ rm -f duplicate; \ for file in $$rcpotfiles; do \ perl -ne 's/\[gt\.((\\.|.)+?)\]/ print \ "\#$$ARGV: line $$.\n"."msgid \"$$1\"\n"."msgstr \"\"\n\n"/ge' \ $$file >> duplicate; \ done; \ msguniq duplicate > fvwmrc.pot; rm -f duplicate; \ potfiles='$(FVWM_POT_FILES)'; \ $(XGETTEXT) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) -o $(FVWM_DOMAIN).po \ --copyright-holder='$(COPYRIGHT_HOLDER)' $$potfiles; \ test ! -f $(FVWM_DOMAIN).po || { \ if test -f $(srcdir)/$(FVWM_DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(FVWM_DOMAIN).pot > $(FVWM_DOMAIN).1po && \ sed -f remove-potcdate.sed < $(FVWM_DOMAIN).po > $(FVWM_DOMAIN).2po && \ if cmp $(FVWM_DOMAIN).1po $(FVWM_DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(FVWM_DOMAIN).1po $(FVWM_DOMAIN).2po $(FVWM_DOMAIN).po; \ else \ rm -f $(FVWM_DOMAIN).1po $(FVWM_DOMAIN).2po $(srcdir)/$(FVWM_DOMAIN).pot && \ mv $(FVWM_DOMAIN).po $(srcdir)/$(FVWM_DOMAIN).pot; \ fi; \ else \ mv $(FVWM_DOMAIN).po $(srcdir)/$(FVWM_DOMAIN).pot; \ fi; \ mv $(FVWM_DOMAIN).pot duplicate.pot; \ cat fvwmrc.pot >> duplicate.pot; \ msguniq duplicate.pot > $(FVWM_DOMAIN).pot; \ rm -f duplicate.pot fvwmrc.pot; \ } $(srcdir)/$(FVWM_DOMAIN).pot: $(MAKE) $(FVWM_DOMAIN).pot-update $(FVWMTASKBAR_DOMAIN).pot-update: $(FVWMTASKBAR_POT_FILES) \ remove-potcdate.sed potfiles='$(FVWMTASKBAR_POT_FILES)'; \ $(XGETTEXT) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ -o $(FVWMTASKBAR_DOMAIN).po \ --copyright-holder='$(COPYRIGHT_HOLDER)' $$potfiles; \ test ! -f $(FVWMTASKBAR_DOMAIN).po || { \ if test -f $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot \ > $(FVWMTASKBAR_DOMAIN).1po && \ sed -f remove-potcdate.sed < $(FVWMTASKBAR_DOMAIN).po \ > $(FVWMTASKBAR_DOMAIN).2po && \ if cmp $(FVWMTASKBAR_DOMAIN).1po $(FVWMTASKBAR_DOMAIN).2po \ >/dev/null 2>&1; then \ rm -f $(FVWMTASKBAR_DOMAIN).1po $(FVWMTASKBAR_DOMAIN).2po \ $(FVWMTASKBAR_DOMAIN).po; \ else \ rm -f $(FVWMTASKBAR_DOMAIN).1po $(FVWMTASKBAR_DOMAIN).2po \ $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot && \ mv $(FVWMTASKBAR_DOMAIN).po $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot; \ fi; \ else \ mv $(FVWMTASKBAR_DOMAIN).po $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot; \ fi; \ } $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot: $(MAKE) $(FVWMTASKBAR_DOMAIN).pot-update $(FVWMSCRIPT_DOMAIN).pot-update: $(FVWMSCRIPT_POT_FILES) \ remove-potcdate.sed potfiles='$(FVWMSCRIPT_POT_FILES)'; \ rm -f duplicate; \ for file in $$potfiles; do \ perl -ne 's/LocaleTitle\s+\{((\\.|.)+?)\}/ print \ "\#$$ARGV: line $$.\n"."msgid \"$$1\"\n"."msgstr \"\"\n\n"/ge' \ $$file >> duplicate; \ done; \ msguniq duplicate > duplicate.pot; \ cat pot_head_sample > $(FVWMSCRIPT_DOMAIN).pot; \ cat duplicate.pot >> $(FVWMSCRIPT_DOMAIN).pot; \ rm -f duplicate duplicate.pot; $(srcdir)/$(FVWMSCRIPT_DOMAIN).pot: $(MAKE) $(FVWMSCRIPT_DOMAIN).pot-update $(POFILES): $(srcdir)/$(FVWM_DOMAIN).pot $(srcdir)/$(FVWMTASKBAR_DOMAIN).pot \ $(srcdir)/$(FVWMSCRIPT_DOMAIN).pot dlang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ dom=`echo $$dlang | sed -e 's/\..*$$//'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ if test -f $${dlang}.po; then \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $${dlang}.po $${dom}.pot"; \ cd $(srcdir) && $(MSGMERGE_UPDATE) $${dlang}.po $${dom}.pot; \ fi # @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ # test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ # echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(FVWM_DOMAIN).pot"; \ # cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(FVWM_DOMAIN).pot install-data-local: install-data-local-@USE_NLS@ install-data-local-no: all install-data-local-yes: all $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ all_domains='$(ALL_DOMAINS)'; \ for dom in $$all_domains; do \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ cat="$$dom.$$cat"; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ if test -r $$cat; \ then realcat=$$cat; \ else realcat=$(srcdir)/$$cat; \ fi; \ if test -f $$realcat; then \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$$dom.mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$$dom.mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && \ LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' \ >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && \ LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc \ $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file \ $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo; \ ln -s ../LC_MESSAGES/$$dom.mo \ $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$dom.mo \ $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$$dom.mo \ $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo; \ echo "installing $$realcat link as \ $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo"; \ fi; \ done; \ fi; \ done; \ done installdirs-data: installdirs-data-local-@USE_NLS@ installdirs-data-local-no: installdirs-data-local-yes: $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ all_domains='$(ALL_DOMAINS)'; \ for dom in $$all_domainss; do \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && \ LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' \ >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && \ LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc \ $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file \ $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done; \ done uninstall-local: uninstall-local-@USE_NLS@ uninstall-local-no: uninstall-local-yes: catalogs='$(CATALOGS)'; \ all_domains='$(ALL_DOMAINS)'; \ for dom in $$all_domains; do \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$$dom.mo; \ done; \ done; \ done update-po: Makefile $(MAKE) $(FVWM_DOMAIN).pot-update $(MAKE) $(FVWMTASKBAR_DOMAIN).pot-update $(MAKE) $(FVWMSCRIPT_DOMAIN).pot-update $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for updating PO files. .nop.po-update: dlang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po-update$$//'`; \ dom=`echo $$dlang | sed -e 's/\..*$$//'`; \ tmpdir=`pwd`; \ echo "$$dlang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $$dlang.po $$dom.pot -o $$dlang.new.po"; \ cd $(srcdir); \ if $(MSGMERGE) $$dlang.po $$dom.pot -o $$tmpdir/$$dlang.new.po; then \ if cmp $$dlang.po $$tmpdir/$$dlang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$dlang.new.po; \ else \ if mv -f $$tmpdir/$$dlang.new.po $$dlang.po; then \ :; \ else \ echo "msgmerge for $$dlang.po failed: cannot move \ $$tmpdir/$$dlang.new.po to $$dlang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$dlang.po failed!" 1>&2; \ rm -f $$tmpdir/$$dlang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: fvwm-2.6.5.orig/po/FvwmTaskBar.sv_SE.po0000644000175000017500000000174311744241503016013 0ustar vwcvwc# Swedish translations for fvwm package # Svenska versttningar fr paket fvwm. # Copyright (C) 2003 fvwm workers # This file is distributed under the same license as the fvwm package. # Johan Svedberg , 2003. # msgid "" msgstr "" "Project-Id-Version: fvwm\n" "POT-Creation-Date: 2003-04-11 12:43+0200\n" "PO-Revision-Date: 2003-10-19 13:34+0200\n" "Last-Translator: Johan Svedberg \n" "Language-Team: Swedish\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../modules/FvwmTaskBar/Goodies.c:462 msgid "No new mail" msgstr "Ingen ny post" #: ../modules/FvwmTaskBar/Goodies.c:466 msgid "You have new mail" msgstr "Du har ny post" #: ../modules/FvwmTaskBar/Goodies.c:470 msgid "You have mail" msgstr "Du har post" #: ../modules/FvwmTaskBar/FvwmTaskBar.c:1320 msgid "Click here to start" msgstr "Klicka hr fr att starta" fvwm-2.6.5.orig/po/fvwm.zh_CN.gmo0000644000175000017500000000725310656151550014736 0ustar vwcvwc<S( )3:BIO W d o=} +K P[ c mw  '8 GUf n{   ?D,8q   41 f n y ;   " 8 N [ n        % 8 ? P [ l        , 3 : M A` B 9  ,9!Oqx3":', !;/7 8.$*#4+01  %-96< )(5&2 Geometry&Close&Delete&Lower&Move&Resize(De)&Iconify(Un)&Stick(Un)Ma&ximizeAfter creation, the fvwm2rc file can then be changed with anyBuiltin MenuClick To FocusColormap Follows FocusColormap Follows MouseControl AnimationCopy Config File(s)Create a starting .fvwm2rc fileDeskDesk: %d%sDestroyExit FvwmExit fvwmFocus Follows MouseFvwm Config OpsFvwm ModulesFvwm Window OpsIssue fvwm commandsJust an XtermNo, Don't QuitPrintPrint Re&verseR&aiseRe&fresh WindowReally Quit Fvwm?Recapture ScreenRefresh ScreenRemote LoginsReset X defaultsRestartRestart fvwmReturn - DismissRoot MenuSetup 95 ScriptSetup FormSloppy FocusStartStopStop Fvwm ModulesStop Module MenuThe file created is ~/.fvwm/.fvwm2rc or $FVWM_USERDIR/.fvwm2rc.These files are optional. Select the modules you want to customize.Use this form to create your fvwm2rc configuration file.UtilitiesWindow OpsYes, Really QuitYou can always copy them later.deskseditor to suit your own needs.fvwm - Create ConfigurationProject-Id-Version: fvwm POT-Creation-Date: 2002-11-28 14:23+0100 PO-Revision-Date: 2004-05-22 16:12+0800 Last-Translator: Funda Wang Language-Team: zh_CN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 几何关闭(&C)删除(&D)降低(&L)移动(&M)大小(&R)最小化(&I)置顶(&S)最大化(&X)创建之后,fvwm2rc 文件就可以用您喜欢的任何内建菜单单击置焦颜色图跟随焦点颜色图跟随鼠标控制动画复制配置文件创建初始的 .fvwm2rc 文件桌面桌面:%d%s摧毁退出 Fvwm退出 fvwm焦点跟随鼠标Fvwm 配置操作Fvwm 模块Fvwm 窗口操作执行 fvwm 命令只是 Xterm不,不要退出打印翻转打印(&V)升起(&A)刷新窗口(&F)真的要退出 Fvwm 吗?重新抓取屏幕刷新屏幕远程登录重置 X 默认值重新启动重新启动 fvwm返回 - 丢弃根菜单设置 95 脚本设置表单粘性置焦开始停止停止 Fvwm 模块停止模块菜单创建的文件是 ~/.fvwm/.fvwm2rc 或 $FVWM_USERDIR/.fvwm2rc。这些文件是可选的。请选择您想要自定义的模块。使用此表单创建您自己的 fvwm2rc 配置文件。实用工具窗口操作是的,真的退出您当然可以稍后再复制。桌面文本编辑器进行更改。fvwm - 创建配置fvwm-2.6.5.orig/po/fvwm.sv_SE.gmo0000644000175000017500000001032310656151550014744 0ustar vwcvwcC4YL    =C R_n   ";J Zgw & 5CT \i z  ?D 8_       B4 w       9  + 8 P g |      & D ^   #     )9> O] m{ 1CB@E !7 L!X z3/.$ >9" 24 1 *-' %8,<+0A);@C#!?76=&B5(:3 Geometry&Close&Delete&Lower&Move&Resize(De)&Iconify(Un)&Stick(Un)Ma&ximizeAfter creation, the fvwm2rc file can then be changed with anyAll Paging OFFBuiltin MenuClick To FocusColormap Follows FocusColormap Follows MouseControl AnimationCopy Config File(s)Create a starting .fvwm2rc fileDeskDesk: %d%sDestroyExit FvwmExit fvwmFocus Follows MouseFull Paging && Edge WrapFull Paging ONFvwm Config OpsFvwm ModulesFvwm Window OpsHorizontal Paging OnlyIssue fvwm commandsJust an XtermMore&...No, Don't QuitPartial PagingPrintPrint Re&verseR&aiseRe&fresh WindowReally Quit Fvwm?Recapture ScreenRefresh ScreenRemote LoginsReset X defaultsRestartRestart fvwmReturn - DismissRoot MenuSetup 95 ScriptSetup FormSloppy FocusStartStopStop Fvwm ModulesStop Module MenuThe file created is ~/.fvwm/.fvwm2rc or $FVWM_USERDIR/.fvwm2rc.These files are optional. Select the modules you want to customize.Use this form to create your fvwm2rc configuration file.UtilitiesVertical Paging OnlyWindow OpsYes, Really QuitYou can always copy them later.deskseditor to suit your own needs.fvwm - Create ConfigurationProject-Id-Version: fvwm POT-Creation-Date: 2002-11-28 14:23+0100 PO-Revision-Date: 2003-10-19 15:01+0200 Last-Translator: Johan Svedberg Language-Team: Swedish MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); StorlekSt&ng&Ta bort&Snk&Flytta&ndra storlek(Av)&Minimera(Av)&Stt fast(Av)Ma&ximeraEfter skapande s kan fvwm2rc-filen modifieras med vilkenAll sidfunktionalitet AVInbyggd menyKlicka fr att fokuseraFrgkarta fljer fokusFrgkarta fljer musKontrollera animationKopiera konfigurationsfil(er)Skapa en startande .fvwm2rc-filSkrivbordSkrivbord: %d%sFrstrAvsluta FvwmAvsluta fvwmFokus fljer musFull sidfunktionalitet && KantbrytningFull sidfunktionalitet PFvwm-konfigurationsinstllningarFvwm-modulerFvwm-fnsterinstllningarEndast horisontal sidfunktionalitetUtfr fvwm-kommandonBara en XtermMer&...Nej, avsluta inteDelvis sidfunktionalitetSkriv utSkriv ut omvnd&HjR&ita om fnsterAvsluta Fvwm?Uppdatera skrmRita om skrmFjrrinloggningarNollstll X-standarderStarta omStarta om fvwmtervnd - AvslutaRotmenyStll in 95 skriptInstllningsformulrSlarvigt fokusStartaStannaStanna Fvwm-modulerStanna modulmenyDen skapade filen r ~/.fvwm/.fvwm2rc eller $FVWM_USERDIR/.fvwm2rc.De hr filerna r valfria. Vlj modulerna som du vill stlla in.Anvnd det hr formulret fr att skapa din fvwm2rc-konfigurationsfilVerktygEndast vertikal sidfunktionalitetFnsterinstllningarJa, avslutaDu kan alltid kopiera dem senare.skrivbordredigerare som helst fr att passa dina egna behov.fvwm - Skapa konfigurationfvwm-2.6.5.orig/po/remove-potcdate.sin0000644000175000017500000000066007571567375016101 0ustar vwcvwc# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } fvwm-2.6.5.orig/vms/0000755000175000017500000000000011744241476012441 5ustar vwcvwcfvwm-2.6.5.orig/vms/fvwmrc.dat0000644000175000017500000003020111027437716014431 0ustar vwcvwc# Date : 10-DEC-1998 pour la version VMS, sur base de la version Linux. ModulePath /fvwm_bindir/ PixmapPath /fvwm_pixdir/ IconPath /fvwm_icodir/ # --- Boutons pour chaque fenêtre --- # --- Configurations globales --- EdgeResistance 400 1 EdgeScroll 100 100 OpaqueMoveSize 100 XORvalue 255 DeskTopSize 2x3 ClickTime 150 ColormapFocus FollowsMouse #ColorLimit 50 TitleStyle Centered SnapAttraction 5 Windows #----------------------------------------------------------------------------------------------------------------------------------- # --- Style des menus --- MenuStyle * fvwm, foreground White, background #606060, greyed #e0e0f0, HilightBackOff MenuStyle * ActiveFore #a63230, Hilight3DOff, Animation, Font lucidasans-bold-8 MenuStyle * TitleWarpOff, TitleUnderlines0, SeparatorsShort, TrianglesSolid, Animation MenuStyle * MenuFace TiledPixmap slate.xpm MenuStyle MenuStyleDeBase fvwm, foreground Black, background #bbbbbb, greyed #e0e0f0, HilightBackOff MenuStyle MenuStyleDeBase ActiveFore #a63230, Hilight3DOff, Animation, Font lucidasans-bold-12 MenuStyle MenuStyleDeBase TitleWarpOff, TitleUnderlines0, SeparatorsShort, TrianglesSolid MenuStyle MenuStyleDeBase MenuFace TiledPixmap concrete.xpm #MenuStyle MenuStyleDeBase SidePic LogoFvwm2.xpm MenuStyle MenuStyleMenuFenetres fvwm, foreground White, background #606060, greyed #e0e0f0, HilightBackOff MenuStyle MenuStyleMenuFenetres ActiveFore #a63230, Hilight3DOff, Animation, Font lucidasans-bold-8 MenuStyle MenuStyleMenuFenetres TitleWarpOff, TitleUnderlines0, SeparatorsShort, TrianglesSolid MenuStyle MenuStyleMenuFenetres MenuFace TiledPixmap slate.xpm # --- Style de fenêtres prédéfini standard --- AddToDecor AllWindowsDecor + ButtonStyle 1 Vector 5 45x45@1 55x45@1 55x55@0 45x55@0 45x45@1 + ButtonStyle 3 Vector 11 30x70@0 30x25@1 50x45@0 70x25@1 70x70@0 65x70@0 65x40@1 50x55@0 35x40@1 35x70@0 30x70@0 + ButtonStyle 2 Vector 8 50x25@1 75x75@0 25x75@0 50x25@1 50x45@0 60x65@1 40x65@1 50x45@0 + ButtonStyle 4 Vector 8 50x75@1 25x25@1 75x25@1 50x75@0 50x55@0 35x35@0 65x35@0 50x55@1 + ButtonStyle 6 Vector 13 35x33@1 35x25@1 65x25@1 65x33@0 55x33@0 55x67@0 65x67@1 65x75@0 35x75@0 35x67@1 45x67@1 45x33@1 40x33@0 + ButtonStyle 8 Vector 5 25x25@1 25x45@1 75x45@0 75x25@0 25x25@1 + TitleStyle Inactive TiledPixmap concrete.xpm + BorderStyle Inactive TiledPixmap concrete.xpm + TitleStyle ActiveDown TiledPixmap mini_blah.xpm + TitleStyle ActiveUp TiledPixmap slate.xpm + BorderStyle Active TiledPixmap slate.xpm #Style AllWindowsStyle UseDecor AllWindowsDecor, Color Black/#bbbbbb, HandleWidth 10, NoIcon Style AllWindowsStyle UseDecor AllWindowsDecor, Color Black/#bbbbbb, HandleWidth 10 Style AllWindowsStyle ShowMapping, SloppyFocus, TileCascadePlacement, HintOverride, DecorateTransient Style AllWindowsStyle Font lucidasans-bolditalic-12, HilightFore white, HilightBack #606060 # --- Style prédéfini pour les fenêtres creées par decWindow --- Style StyleDecWindow UseDecor AllWindowsDecor, Sticky, NoTitle, ClickToFocus, WindowListSkip # --- Style prédéfini pour les fenêtres d'outils desktop --- Style StyleDesktop UseDecor AllWindowsDecor, Sticky, NoTitle, ClickToFocus, WindowListSkip, BorderWidth 20 # --- Style prédéfini discret --- Style StyleDiscret UseDecor AllWindowsDecor, Sticky, NoTitle, NoHandles, BorderWidth 6, ClickToFocus, WindowListSkip # --- Style prédéfini pour les fenêtres FrontEnd (FvwmFrm) --- Style StyleFrontEnd color NoHandles, BorderWidth 18, NoTitle #----------------------------------------------------------------------------------------------------------------------------------- # --- Apparence des fenêtres --- Style "*" UseStyle AllWindowsStyle # --- Apparence des fenetres de DecWindow (Session mamanger et les menus punaises) --- Style "*VUE$MASTER*" UseStyle StyleDecWindow Style "*DECW$TERMINAL*" UseStyle AllWindowsStyle Style "*FileView*" UseStyle AllWindowsStyle # --- Apparence des fenêtres autres --- Style "Fvwm*" UseStyle StyleDesktop Style "FvwmWinList*" UseStyle StyleDesktop, SloppyFocus Style "Clock*" UseStyle StyleDiscret # --- Apparence des Front end via FvwmForm --- Style "FrontEnd_*" UseStyle StyleFrontEnd #----------------------------------------------------------------------------------------------------------------------------------- # --- Autostart --- AddToFunc InitFunction + "I" Wait DECW$TERMINAL + "I" Module FvwmWinList + "I" Wait FvwmWinList + "I" Module FvwmPager 0 0 + "I" Wait FvwmPager + "I" Module FvwmButtons + "I" Wait FvwmButtons + "I" Module FvwmAuto 400 #+ "I" Module FvwmAnimate AddToFunc K_FondParDefaut "I" Exec Decw$Utils:XSetRoot.Exe -solid "#24a0a8" AddToFunc K_Reconstruction_Ecran + "I" Function K_FondParDefaut + "I" Refresh AddToFunc K_Focus + "I" Focus + "I" WarpToWindow 10 10 AddToFunc MoveRaiseShade + "M" Move + "I" Raise + "C" Raise + "D" WindowShade AddToFunc ResizeRaise + "M" Resize + "M" Raise + "C" Raise + "D" WindowShade AddToFunc MoveIconify + "M" Move + "D" Iconify # Où Modif Action # --- Control+Flêche n'importe où change de page --- Key Left A C Scroll -100000 +0 Key Right A C Scroll +100000 +0 Key Up A C Scroll +0 -100000 Key Down A C Scroll +0 +100000 # --- Shift+Control+Flêche n'importe où bouge d'un dizième de page --- Key Left A SC Scroll -10 +0 Key Right A SC Scroll +10 +0 Key Up A SC Scroll +0 -10 Key Down A SC Scroll +0 +10 # --- Essais Key Next A S Next [ CurrentScreen CurrentDesk !iconic CirculateHit *DECW$TERMINAL* ] K_Focus Key Prev A S Prev [ CurrentScreen CurrentDesk !iconic CirculateHit *DECW$TERMINAL* ] K_Focus # --- Le pavé numérique --- Key KP_7 A C GotoPage 0 0 Key KP_8 A C GotoPage 1 0 Key KP_9 A C GotoPage 2 0 Key KP_4 A C GotoPage 0 1 Key KP_5 A C GotoPage 1 1 Key KP_6 A C GotoPage 2 1 Key KP_1 A C GotoPage 0 2 Key KP_2 A C GotoPage 1 2 Key KP_3 A C GotoPage 2 2 # --- Essais --- Key Tab A S WindowList Root c c CurrentDesk NoGeometry Key Tab A C WindowList Root c c NoDeskSort # --- Souris dans la root window (sur le fond d'écran) --- Mouse 1 R A Menu MenuDuJour Nop Mouse 2 R A Menu MenuDesktop Nop Mouse 3 R A WindowList NoGeometry # --- Souris sur les boutons de la barre de titre --- Mouse 1 1 A Close Mouse 1 3 A Popup MenuActionsFenetres Nop Mouse 1 2 N Maximize 100 100 Mouse 1 4 N Maximize 50 50 Mouse 1 6 A Iconify Mouse 1 8 A WindowShade Mouse 2 123 A Move Mouse 2 468 A Move # --- Souris sur les autres éléments de décoration --- Mouse 1 T A MoveRaiseShade Mouse 1 FS A ResizeRaise Mouse 1 I A MoveIconify Mouse 1 W CS Move Mouse 2 I A Iconify Mouse 2 FST A Popup MenuActionsFenetres Nop Mouse 2 W S Popup MenuActionsFenetres Nop Mouse 3 FST N MoveRaiseShade Mouse 3 WFST M MoveRaiseShade Mouse 3 WFST S MoveRaiseShade Mouse 3 WFST 5 MoveRaiseShade Mouse 3 A C Module FvwmIdent DestroyMenu MenuDuJour AddToMenu MenuDuJour + "Machins courants" Title + "" Nop + "Netscape" Exec Thor$outils:NETSCAPE-EXPORT-ALPHA-V303B1-JAV-092597 + "BookReader" Exec Sys$System:Decw$BookReader + "" Nop + "Modules Fvwm" Popup MenuModules + "" Nop + "Graphiques" Popup MenuGraphique ChangeMenuStyle MenuStyleDeBase MenuDuJour DestroyMenu MenuModules AddToMenu MenuModules + "FvwmWinList" Module FvwmWinList + "FvwmTalk" Module FvwmTalk + "FvwmButtons" Module FvwmButtons + "FvwmAuto" Module FvwmAuto 400 + "FvwmIdent" Module FvwmIdent + "FvwmPager" Module FvwmPager 0 0 + "FvwmWhere" Module FvwmWhere FvwmWhereFab 0 + "FvwmAnimate" Module FvwmAnimate + "FvwmAnimate Control" Popup MenuFvwmAnimate ChangeMenuStyle MenuStyleDeBase MenuModules DestroyMenu MenuDesktop AddToMenu MenuDesktop + "Trucs desktop" Title + "" Nop + "XSetRoot" Exec Decw$Utils:XSetRoot.Exe -solid "#60a0c0" + "Image de fond" Exec Thor$Outils:Xv -root -quit -slow24 -ncols 100 -max DISK$Thor:[Thor_USR.VILLARD_F.Archives.IMG]FondCourant.Image + "" Nop + "Lock Eyes" Exec Thor$Outils:XLock -mode eyes + "Lock Life" Exec Thor$Outils:XLock -mode life + "" Nop + "Refresh screen" Refresh + "Arrêt de Fvwm2" Quit ChangeMenuStyle MenuStyleDeBase MenuDesktop DestroyMenu MenuGraphique AddToMenu MenuGraphique + "XV direct" Exec Thor$Outils:Xv + "XV paramètré" Module FvwmForm FrontEnd_Xv_ + "BitMap" Exec Decw$Utils:bitmap & + "XMag" Exec Decw$utils:xmag + "Xev" Exec Decw$Utils:Xev ChangeMenuStyle MenuStyleDeBase MenuGraphique DestroyMenu MenuActionsFenetres AddToMenu MenuActionsFenetres + "Iconify/Deiconify" Iconify + "Stick/Unstick" Stick + "Maximize/Normal" Maximize 100 100 + "Shade" WindowShade + "Resize" Resize + "Raise" Raise + "Lower" Lower + "Move" Move + "" Nop + "Close" Close + "Delete" Delete + "Destroy" Destroy ChangeMenuStyle MenuStyleMenuFenetres MenuActionsFenetres #----------------------------------------------------------------------------------------------------------------------------------- # Modules #----------------------------------------------------------------------------------------------------------------------------------- # --- FvwmIdent --- *FvwmIdentFore #ddbb40 *FvwmIdentBack #200050 *FvwmIdentFont lucidasans-italic-10 # --- FvwmWinList --- *FvwmWinListBack #bbbbbb *FvwmWinListFore Black *FvwmWinListFocusBack #606060 *FvwmWinListFocusFore White *FvwmWinListIconFore #751010 #*FvwmWinListFont lucidasans-8 #*FvwmWinListFont 6x9 #*FvwmWinListFont 7x13 *FvwmWinListFont lucidasans-italic-8 *FvwmWinListAction Click1 Iconify -1, K_Focus 8 10 *FvwmWinListAction Click2 Function K_Focus 8 10 *FvwmWinListAction Click3 Popup MenuActionsFenetres *FvwmWinListUseSkipList *FvwmWinListGeometry +1-2 #*FvwmWinListLeftJustify *FvwmWinListUseIconNames True *FvwmWinListMaxWidth 150 # # ---------- Pager ---------- *FvwmPagerBack #a8b9e1 *FvwmPagerFore #808080 *FvwmPagerHilight White *FvwmPagerFont None *FvwmPagerGeometry 50x100+0+0 *FvwmPagerLabel 0 Desk1 *FvwmPagerLabel 1 Desk2 *FvwmPagerRows : 3 *FvwmPagerColumns : 2 *FvwmPagerBalloons *FvwmPagerBalloonBack White *FvwmPagerBalloonFore Black *FvwmPagerBalloonBorderColor Black *FvwmPagerBalloonFont lucidasans-8 # # ---------- Where (Fab) ---------- *FvwmWhereTestFont lucidasans-bolditalic-18 *FvwmWhereTestFore #505050 *FvwmWhereTestBack #d2afa1 *FvwmWhereTestGeometry +172+0 # #-------------------------------------------------------------------------------- # Front end au lancement de xv en tnt que viewer #-------------------------------------------------------------------------------- *FrontEnd_Xv_WarpPointer *FrontEnd_Xv_Position 400 50 *FrontEnd_Xv_Font lucidasans-bolditalic-12 *FrontEnd_Xv_Back #70a0b0 *FrontEnd_Xv_Fore Black *FrontEnd_Xv_InputFont -*-fixed-*-*-*-*-14-*-*-*-*-*-*-* *FrontEnd_Xv_ButtonFont lucidasans-bolditalic-8 *FrontEnd_Xv_ItemBack #656570 *FrontEnd_Xv_ItemFore White *FrontEnd_Xv_Line center *FrontEnd_Xv_Text "Fichiers à visualiser par xv" *FrontEnd_Xv_Line left *FrontEnd_Xv_Input Files 50 "/k/images/fab/*" *FrontEnd_Xv_Line expand *FrontEnd_Xv_Button quit "Go'n stop (^M)" ^M *FrontEnd_Xv_Command Exec Thor$Outils:Xv $(Files) *FrontEnd_Xv_Button continue "Go'n stay (^S)" ^S *FrontEnd_Xv_Command Exec xv $(Files) *FrontEnd_Xv_Button quit "Laisse tomber (^Z)" ^Z *FrontEnd_Xv_Command Nop # ---------- FvwmButtons button-bar ---------- *FvwmButtonsFore Black *FvwmButtonsBack #a8b9e1 *FvwmButtonsFont lucidasans-bolditalic-10 *FvwmButtonsGeometry +0+0 *FvwmButtonsBoxSize smart *FvwmButtonsFrame 3 *FvwmButtonsRows 1 *FvwmButtonsColumns 2 *FvwmButtons(Size 70 90 Padding 3 3 Frame -3 Swallow (UseOld) FvwmPager "Module FvwmPager") *FvwmButtons(Size 70 90 Padding 3 3 Frame -3 Swallow (UseOld, NoClose) Clock Nop) fvwm-2.6.5.orig/vms/config.h0000644000175000017500000002422707506342335014063 0ustar vwcvwc/*---------------------------------------------------------------------------------------------------------------------------------- File : config.h for Fvwm Author : Fabien Villard (Villard_F@Decus.Fr) Date : 20-JAN-1999 Descrip : adapted for VMS from the config.h.in generated automatically from configure.in by autoheader. Compatibility stuff for Fvwm. Tested with Dec 5.7 on Alpha. Note : this file can be edited to change some options. Modifs : 25-JAN-1999 Fab Version 2.1.10 de Fvwm. Autoconfig gives args types for select(). 11-MAR-1999 Steve Add new symbols for systems that can't use autoconf. ----------------------------------------------------------------------------------------------------------------------------------*/ /* --- Those defines were intialy in makefiles and command lines --- */ #define FVWMRC "FvwmRc.Dat" #define FVWM_MODULEDIR "Fvwm$BaseDir:[Modules.Bin]" #define FVWM_DATADIR "/Sys$Login" #include "libs/vms.h" /* - Replacement functions - */ #define fork vfork #define execvp execv #define execl VMS_ExecL #define fvwm_msg VMS_msg #define select VMS_select_pipes #define CoerceEnterNotifyOnCurrentWindow \ CoerceEnterNotifyOnCurrentWind /* - Nname too long, exceeds 31 characters. - */ #define __attribute__(toto) #undef DEBUG_EVENTS /* --- Define to trace My_XNextEvent and DispatchEvent in events.c --- */ #define DEBUG_MODULES /* --- Define to trace modules launching --- */ #define PACKAGE "VMS port (25-JAN-1999)" #define VERSION "2.3.0" /* Where to search for the fvwm icons. */ #define FVWM_IMAGEPATH "Sys$Login:" /* Define if Xpm library is used. */ #define XPM /* Define if rplay library is used. */ #undef HAVE_RPLAY /* Define if readline is available. */ #undef HAVE_READLINE /* Define if you want the Shaped window extensions. * Shaped window extensions seem to increase the window managers RSS by about 60 Kbytes. They provide for leaving a title-bar * on the window without a border. If you don't use shaped window extension, you can either make your shaped windows undecorated, * or live with a border and backdrop around all your shaped windows (oclock, xeyes) * * If you normally use a shaped window (xeyes or oclock), you might as well compile this extension in, since the memory cost is * minimal in this case (The shaped window shared libs will be loaded anyway). If you don't normally use a shaped window, you have * to decide for yourself. * * Note: if it is compiled in, run time detection is used to make sure that the currently running X server supports it. */ #undef SHAPE /* Enables the "MiniIcon" Style option to specify a small pixmap which can be used as one of the title-bar buttons, shown in * window list, utilized by modules, etc. Requires PIXMAP_BUTTONS to be defined (see below). */ /* NOTE: hard coded to 1 */ #if 1 #define FMiniIconsSupported 1 #else #define FMiniIconsSupported 0 #endif /* Enables tagged general decoration styles which can be assigned to windows using the UseDecor Style option, or dynamically * updated with ChangeDecor. To create and destroy "decor" definitions, see the man page entries for AddToDecor and DestroyDecor. * There is a slight memory penalty for each additionally defined decor. */ /* NOTE: hard coded to 1 #define USEDECOR 1 /* Enables session management functionality. */ #undef SESSION /* Specify a type for sig_atomic_t if it's not available. */ #undef sig_atomic_t /* ** if you would like to see lots of debug messages from fvwm, for debugging ** purposes, uncomment the next line */ #undef FVWM_DEBUG_MSGS #ifdef FVWM_DEBUG_MSGS # define DBUG(x,y) fvwm_msg(DBG,x,y) #else # define DBUG(x,y) /* no messages */ #endif /** * The next few defines are options that are only changed from their values * shown here on systems that _don't_ use the configure script. **/ /* Enable tests for missing too many XEvents. Usually you want this. */ #undef WORRY_ABOUT_MISSED_XEVENTS /* Define if the X11 ConnectionNumber is actually a file descriptor. */ #undef HAVE_X11_FD /* Define if fork() has unix semantics. On VMS, no child process is created until after a successful exec(). */ #undef FORK_CREATES_CHILD /* Suffix for executable filenames; NULL if no extension needed. */ #define EXECUTABLE_EXTENSION ".exe" /* Define to remove the extension from executable pathnames before calling exec(). */ #define REMOVE_EXECUTABLE_EXTENSION 1 /* Define to empty if the keyword does not work. */ #undef const /* Define if you have the strftime function. */ #define HAVE_STRFTIME 1 /* Define if you have that is POSIX.1 compatible. */ #define HAVE_SYS_WAIT_H 1 /* ### Define as __inline if that's what the C compiler calls it. */ /* #define inline __inline */ #define inline /* Define if on MINIX. */ #undef _MINIX /* Define to `long' if doesn't define. */ #undef off_t /* Define to `int' if doesn't define. */ #undef pid_t /* ### Define if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* ### Define if you need to in order for stat and other things to work. */ #undef _POSIX_SOURCE /* Define as the return type of signal handlers (int or void). */ #define RETSIGTYPE void /* Define to the type of arg1 for select(). */ #define SELECT_TYPE_ARG1 int /* Define to the type of args 2, 3 and 4 for select(). */ #define SELECT_TYPE_ARG234 (fd_set *) /* Define to the type of arg5 for select(). */ #define SELECT_TYPE_ARG5 (struct timeval *) /* Define if the setvbuf function takes the buffering type as its second argument and the buffer pointer as the third, as on * System V before release 3. */ #undef SETVBUF_REVERSED /* Define to `unsigned' if doesn't define. */ #undef size_t /* Define if you have the ANSI C header files. */ #define STDC_HEADERS /* Define if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define if lex declares yytext as a char * by default, not a char[]. */ #undef YYTEXT_POINTER /* Define if you have the atexit function. */ #undef HAVE_ATEXIT /* Define if you have the div function. */ #define HAVE_DIV 1 /* Define if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define if you have the gettimeofday function. */ /* Fab 8-DEC-1998, VMS : from time.h : ** Note that gettimeofday() is UTC based, so it is not visible if ** compiling in a local time based compatibility mode. */ #define HAVE_GETTIMEOFDAY 1 /* Define if you have the memcpy function. */ #define HAVE_MEMCPY 1 /* Define if you have the memmove function. */ #define HAVE_MEMMOVE 1 /* Define if you have the mkfifo function. */ #undef HAVE_MKFIFO /* Define if you have the on_exit function. */ #undef HAVE_ON_EXIT /* Define if you have the putenv function. */ #define HAVE_PUTENV 1 /* Define if you have the select function. */ #define HAVE_SELECT 1 /* Define if you have the setvbuf function. */ #define HAVE_SETVBUF 1 /* Define if you have the sigaction function. */ #undef HAVE_SIGACTION /* Define if you have the siginterrupt function. */ #undef HAVE_SIGINTERRUPT /* Define if you have the socket function. */ #define HAVE_SOCKET 1 /* Define if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define if you have the strchr function. */ #define HAVE_STRCHR 1 /* Define if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 /* Define if you have the strncasecmp function. */ #define HAVE_STRNCASECMP 1 /* Define if you have the strstr function. */ #define HAVE_STRSTR 1 /* Define if you have the strtol function. */ #define HAVE_STRTOL 1 /* Define if you have the sysconf function. */ #undef HAVE_SYSCONF /* Define if you have the uname function. */ #define HAVE_UNAME 1 /* Define if you have the usleep function. */ #define HAVE_USLEEP 1 /* Define if you have the vfprintf function. */ #define HAVE_VFPRINTF 1 /* Define if you have the wait3 function. */ #define HAVE_WAIT3 1 /* Define if you have the wait4 function. */ #define HAVE_WAIT4 1 /* Define if you have the waitpid function. */ #define HAVE_WAITPID 1 /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ #undef HAVE_GETOPT_H /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the header file. */ #define HAVE_MALLOC_H 1 /* Define if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define if you have the header file. */ #define HAVE_STDARG_H 1 /* Define if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define if you have the header file. */ #define HAVE_STRING_H 1 /* Define if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define if you have the header file. */ #undef HAVE_SYS_SYSTEMINFO_H /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STRING_H # include # else # include # endif # ifdef HAVE_MEMORY_H # include # endif # ifdef HAVE_STDLIB_H # include # endif # ifdef HAVE_MALLOC_H # include # endif # ifndef HAVE_STRCHR # define strchr(_s,_c) index((_s),(_c)) # define strrchr(_s,_c) rindex((_s),(_c)) # endif #endif #ifndef HAVE_MEMCPY # define memcpy(_d,_s,_l) bcopy((_s),(_d),(_l)) #endif #ifndef HAVE_MEMMOVE # define memmove(_d,_s,_l) bcopy((_s),(_d),(_l)) #endif #if HAVE_SYS_TYPES_H # include #endif #if HAVE_UNISTD_H # include #endif #ifndef min # define min(a,b) (((a)<(b)) ? (a) : (b)) #endif #ifndef max # define max(a,b) (((a)>(b)) ? (a) : (b)) #endif #ifndef abs # define abs(a) (((a)>=0)?(a):-(a)) #endif #include "libs/defaults.h" fvwm-2.6.5.orig/vms/vms.c0000644000175000017500000005355210656151550013416 0ustar vwcvwc/* -*-c-*- */ /*---------------------------------------------------------------------------------------------------------------------------------- Module : vms.c for Fvwm on Open VMS Author : Fabien Villard (Villard_F@Decus.Fr) Date : 5-JAN-1999 Action : special functions for running Fvwm with OpenVms. They can be helpfull for other VMS ports. Functions : internal functions : AttentionAST() and TimerAST() exported functions : VMS_msg(), VMS_SplitCommand() and VMS_select_pipes() Copyright : Fabien Villard, 1999. No guarantees or warantees are provided or implied in any way whatsoever. Use this program at your own risk. Permission to use, modify, and redistribute this program is hereby given, provided that this copyright is kept intact. ----------------------------------------------------------------------------------------------------------------------------------*/ #include "config.h" #include ^ #include #include #include #include "ftime.h" #include #include #include "vms.h" #include #include #include #include #include #include /* --- Define to debug VMS_select_pipes() routine --- */ #undef DEBUG_SELECT /* --- Define to debug VMS_SplitCommand() routine --- */ #define DEBUG_SPLIT /* --- Define this to post a read attention AST on a write pipe in VMS_select_pipes(). --- */ #undef POST_READATTN_AST /* --- Define to debug VMS_ExecL() routine --- */ #define DEBUG_EXECL /* --- Define to close or sync output file after each line in VMS_msg() --- */ #undef DEBUG_CLOSE_OUTPUT #undef DEBUG_SYNC_OUTPUT #ifdef DEBUG_SELECT #define DBG_SEL 1 #else #define DBG_SEL 0 #endif #ifdef DEBUG_SPLIT #define DBG_SPL 1 #else #define DBG_SPL 0 #endif #ifdef DEBUG_EXECL #define DBG_EXL 1 #else #define DBG_EXL 0 #endif #define SELECT_ERROR -1 #define SELECT_TIMEOUT 0 #define MAX_DEVICE 32 /* - Maximum FD to check - */ #define MAX_DEVICENAME 256 #define DEV_UNUSED 0 #define DEV_READPIPE 1 #define DEV_WRITEPIPE 2 #define DEV_EFN 3 /* --- File descriptors information. We allocate statically for it's a very oten used function. --- */ typedef struct { int eventFlag; /* - Event flag pour les attentes passives - */ unsigned short vmsChannel; /* - Canal VMS sur la mailbox - */ char deviceName[MAX_DEVICENAME]; /* - Nom du device (la mailbox ou les X events) - */ char devType; /* - Type de device : DEV_xxx - */ char qioPending; /* - Une QIO est en attente (1) ou non (0) - */ } Pipe_Infos_Type; typedef struct { short condVal; short retCount; int devInfo; } Iosb_Type; /* --- Global variables. I do not like them, but, because of the AST it's the easiest way :-) They have to be volatile because they are modified by AST and main function. --- */ volatile unsigned int SpecialEfn; /* - One ef for all. This to avoid multi ef clusters problem - */ volatile char SpecialEfnToClear; /* - Special ef is set by us - */ /*---------------------------------------------------------------------------------------------------------------------------------- Fonctions : AttentionAST et TimedAST Actions : attention AST : activated by the attention QIO (ReadAttention or WriteAttention) on the pipe's mailbox. It gets the ef to set in the AstPrm. Timed AST : activated when time has come. This two functions set also the special ef on which we then waitfr. This is to avoid multi ef clusters problem. ----------------------------------------------------------------------------------------------------------------------------------*/ void AttentionAST(int efn) { unsigned int sysStat, efnState; sysStat = sys$setef(efn); if (! (sysStat & 1)) fvwm_msg(ERR, "AttentionAST", " Error setting efn %d (%d)", efn, sysStat); else if (DBG_SEL) fvwm_msg(DBG, "AttentionAST", " Efn %d set.", efn); if (0 < SpecialEfn) { sysStat = sys$setef(SpecialEfn); if (! (sysStat & 1)) fvwm_msg(ERR, "AttentionAST", " Error setting special efn %d (%d)", SpecialEfn, sysStat); else if (DBG_SEL) fvwm_msg(DBG, "AttentionAST", " Special efn %d set. We'll have to clear it.", SpecialEfn); SpecialEfnToClear = 1; } } void TimedAST(int filler) { unsigned int sysStat; if (0 < SpecialEfn) { sysStat = sys$setef(SpecialEfn); if (! (sysStat & 1)) fvwm_msg(ERR, "TimedAST", " Error setting special efn %d (%d)", SpecialEfn, sysStat); else if (DBG_SEL) fvwm_msg(DBG, "TimedAST", " Special efn %d set. We'll have to clear it.", SpecialEfn); SpecialEfnToClear = 1; } } #define VMS_TestStatus(stat, message, degage) {\ if (! (stat & 1)) {\ if (DBG_SEL) fvwm_msg(ERR, "VMS_select_pipes", message, stat);\ if (degage) {\ result = SELECT_ERROR;\ goto End_VMS_select_pipes;\ }\ }\ } /*---------------------------------------------------------------------------------------------------------------------------------- Fonction : VMS_select_pipes Action : replacement for select() for pipes and other devices (such as X communications) with an ef already assigned. Prototype is identical to select(). ----------------------------------------------------------------------------------------------------------------------------------*/ int VMS_select_pipes(int nbPipes, fd_set *readFds, fd_set *writeFds, fd_set *filler, struct timeval *timeoutVal) { int iFd, result, nbPipesReady, sysStat, libStat, timeoutEf; char *retPtr; unsigned short vmsChannel; unsigned int efnState, qioFuncCode; struct dsc$descriptor_s deviceNameDesc; Pipe_Infos_Type infosPipes[MAX_DEVICE]; Iosb_Type qioIosb; struct { unsigned int l0, l1; } timeoutBin; char specialEfnToFree; if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "********************************************************************************"); SpecialEfn = -1; specialEfnToFree = SpecialEfnToClear = 0; nbPipesReady = result = 0; deviceNameDesc.dsc$b_dtype = DSC$K_DTYPE_T; deviceNameDesc.dsc$b_class = DSC$K_CLASS_S; /* --- Too much pipes : trace and truncat. --- */ if (MAX_DEVICE < nbPipes) { if (DBG_SEL) fvwm_msg(ERR, "VMS_select_pipes", "Too much pipes (%d instead of %d max), reduced.", nbPipes, MAX_DEVICE); nbPipes = MAX_DEVICE; } /* --- Pre-work of selected fd to get their types and search special ef. --- */ if (NULL != readFds || NULL != writeFds) { for (iFd = 0; iFd < nbPipes; iFd++) { infosPipes[iFd].devType = DEV_UNUSED; infosPipes[iFd].qioPending = 0; infosPipes[iFd].vmsChannel = 0; if ( (NULL != readFds && FD_ISSET(iFd, readFds)) || (NULL != writeFds && FD_ISSET(iFd, writeFds)) ) { if (FD_ISSET(iFd, readFds)) infosPipes[iFd].devType = DEV_READPIPE; else if (FD_ISSET(iFd, writeFds)) infosPipes[iFd].devType = DEV_WRITEPIPE; /* --- Get VMS mailbox name. This function is VMS specific. --- */ retPtr = getname(iFd, infosPipes[iFd].deviceName); /* --- If we fail, it's probably because the FD is an EF. --- */ if (NULL == retPtr) { if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "Special efn trouve : %d", iFd); infosPipes[iFd].devType = DEV_EFN; SpecialEfn = iFd; } else { /* --- Trying to connect to the mailbox --- */ deviceNameDesc.dsc$w_length = strlen(infosPipes[iFd].deviceName); deviceNameDesc.dsc$a_pointer = infosPipes[iFd].deviceName; sysStat = sys$assign(&deviceNameDesc, &(infosPipes[iFd].vmsChannel), 0, NULL, 0); VMS_TestStatus(sysStat, "Error : sys$assign returns %d", 1); } } } /* --- No special ef found. Create one. Then in both cases, clear it. --- */ if (-1 == SpecialEfn) { specialEfnToFree = 1; libStat = lib$get_ef(&SpecialEfn); VMS_TestStatus(libStat, "No event flags left (Error %d)", 1); if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "Special efn created : %d", SpecialEfn); } sysStat = sys$clref(SpecialEfn); VMS_TestStatus(sysStat, "Can't clear special event flag (Error %d)", 1); /* --- DO the real work on fd --- */ for (iFd = 0; iFd < nbPipes; iFd++) { if (DEV_READPIPE == infosPipes[iFd].devType || DEV_WRITEPIPE == infosPipes[iFd].devType) { /* --- Allocate and initialize an ef --- */ libStat = lib$get_ef(&(infosPipes[iFd].eventFlag)); VMS_TestStatus(libStat, "No more event flags (Error %d)", 1); sysStat = sys$clref(infosPipes[iFd].eventFlag); VMS_TestStatus(sysStat, "Can't clear ef (err %d)", 1); if (DBG_SEL) { fvwm_msg(DBG, "VMS_select_pipes", "FD %2d %s Nom <%s> Canal %d Efn %d cleared", iFd, (DEV_READPIPE == infosPipes[iFd].devType)?"READ":(DEV_WRITEPIPE == infosPipes[iFd].devType)?"WRIT":"UNKN", infosPipes[iFd].deviceName, infosPipes[iFd].vmsChannel, infosPipes[iFd].eventFlag); } /* --- Read pipe, we wait for a writer to... write. --- */ if (FD_ISSET(iFd, readFds)) { qioFuncCode = IO$_SETMODE | IO$M_WRTATTN; sysStat = sys$qio(0, infosPipes[iFd].vmsChannel, qioFuncCode, &qioIosb, NULL, 0, AttentionAST, infosPipes[iFd].eventFlag, 0, 0, 0, 0); VMS_TestStatus(qioIosb.condVal, "Attention QIO failed (Secondary error %d)", 0); VMS_TestStatus(sysStat, "Attention QIO failed (Error %d)", 1); infosPipes[iFd].qioPending = 1; if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "Attention QIO ok. qioIosb.condVal = %d (%x)", qioIosb.condVal, qioIosb.condVal); } /* --- Write pipe. Sometimes we can wait for a reader to post a read request. But when the process is not symetrical we may stay blocked here. So, better consider pipe is always ready. --- */ else if (FD_ISSET(iFd, writeFds)) { #ifdef POST_READATTN_AST qioFuncCode = IO$_SETMODE | IO$M_READATTN; sysStat = sys$qio(0, infosPipes[iFd].vmsChannel, qioFuncCode, &qioIosb, NULL, 0, AttentionAST, infosPipes[iFd].eventFlag, 0, 0, 0, 0); VMS_TestStatus(qioIosb.condVal, "Read attention QIO failed (Secondary error %d)", 0); VMS_TestStatus(sysStat, "Read attention QIO failed (Error %d)", 1); infosPipes[iFd].qioPending = 1; if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "Read attention QIO ok. qioIosb.condVal = %d (%x)", qioIosb.condVal, qioIosb.condVal); #else AttentionAST(infosPipes[iFd].eventFlag); if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "Attention automatique"); #endif } } /* --- Not a pipe. It's probably an ef already allocated elsewhere, by us for example. --- */ else if (DEV_EFN == infosPipes[iFd].devType) { infosPipes[iFd].qioPending = 0; strcpy(infosPipes[iFd].deviceName, "Device_non_pipe"); infosPipes[iFd].vmsChannel = 0; infosPipes[iFd].eventFlag = iFd; /* --- We clear this special ef only if we own it. In the other case, the owner had coped with that. --- */ if (iFd != SpecialEfn) { sysStat = sys$clref(infosPipes[iFd].eventFlag); VMS_TestStatus(sysStat, "Can't clear ef (Error %d)", 1); } if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "FD %2d EFN Nom <%s> Canal %d Efn %d", iFd, infosPipes[iFd].deviceName, infosPipes[iFd].vmsChannel, infosPipes[iFd].eventFlag); } } } /* --- Time out event --- */ if (NULL != timeoutVal) { float timeoutFloat; unsigned int libCvtFunc = LIB$K_DELTA_SECONDS_F; libStat = lib$get_ef(&timeoutEf); VMS_TestStatus(libStat, "No event flags left (Error %d)", 1); if (0 != timeoutVal->tv_sec || 0 != timeoutVal->tv_usec) { sysStat = sys$clref(timeoutEf); VMS_TestStatus(sysStat, "Can't clear timer ef (Error %d)", 1); timeoutFloat = (float)timeoutVal->tv_sec + (float)timeoutVal->tv_usec / 1000000.0; if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "Timer %f, %d sec %d usec", timeoutFloat, timeoutVal->tv_sec, timeoutVal->tv_usec); libStat = lib$cvtf_to_internal_time(&libCvtFunc, &timeoutFloat, &timeoutBin); VMS_TestStatus(libStat, "Can't convert time in float (Error %d)", 1); sysStat = sys$setimr(timeoutEf, &timeoutBin, TimedAST, 0, 0); VMS_TestStatus(sysStat, "Can't post the timed AST (Error %d)", 1); if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "Timed AST with ef %d in %f s", timeoutEf, timeoutFloat); } /* --- Null time out --- */ else { sysStat = sys$clref(timeoutEf); VMS_TestStatus(sysStat, "Can't clear (timeout = 0) timer ef (Error %d)", 1); } } /* --- Wait for one of all those events :-) --- */ if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "Waiting events..."); sysStat = sys$waitfr(SpecialEfn); VMS_TestStatus(sysStat, "Wait events request failed (Error %d)", 1); if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "One event happened.", time(NULL)); /* --- Some events did come --- */ if (NULL != readFds) FD_ZERO(readFds); if (NULL != writeFds) FD_ZERO(writeFds); /* --- Time out --- */ if (NULL != timeoutVal) { sysStat = sys$readef(timeoutEf, &efnState); VMS_TestStatus(sysStat, "Can't read timeout ef state (Error %d)", 1); if (SS$_WASSET == sysStat) { timeoutVal->tv_sec = 0; timeoutVal->tv_usec = 0; result = SELECT_TIMEOUT; goto End_VMS_select_pipes; } /* --- Cancel timeout --- */ else { sysStat = sys$cantim(0, 0); VMS_TestStatus(sysStat, "Can't cancel timer request (Error %d)", 0); } } /* --- Checking other events --- */ for (iFd = 0; iFd < nbPipes; iFd++) { if (DEV_UNUSED != infosPipes[iFd].devType) { sysStat = sys$readef(infosPipes[iFd].eventFlag, &efnState); VMS_TestStatus(sysStat, "Can't read ef state (Error %d)", 1); if (SS$_WASSET == sysStat) { nbPipesReady++; infosPipes[iFd].qioPending = 0; if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "Event flag %d set !", infosPipes[iFd].eventFlag); if (DEV_READPIPE == infosPipes[iFd].devType) FD_SET(iFd, readFds); else if (DEV_WRITEPIPE == infosPipes[iFd].devType) FD_SET(iFd, writeFds); else FD_SET(iFd, readFds); } } } /* --- Don't give false informations : if we set the special event and we don't own it, don't say it. --- */ /* if (! specialEfnToFree && SpecialEfnToClear) { nbPipesReady--; if (FD_ISSET(SpecialEfn, readFds)) FD_CLR(SpecialEfn, readFds); else if (FD_ISSET(SpecialEfn, writeFds)) FD_CLR(SpecialEfn, writeFds); } */ result = nbPipesReady; if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "Nombre de pipes prets : %d", nbPipesReady); End_VMS_select_pipes:; /* --- Clear resources --- */ for (iFd = 0; iFd < nbPipes; iFd++) { if (DEV_UNUSED != infosPipes[iFd].devType) { if (1 == infosPipes[iFd].qioPending) { sysStat = sys$cancel(infosPipes[iFd].vmsChannel); VMS_TestStatus(sysStat, "Can't cancel QIO (Error %d)", 0); } if (0 != infosPipes[iFd].vmsChannel) { sysStat = sys$dassgn(infosPipes[iFd].vmsChannel); VMS_TestStatus(sysStat, "Can't deallocate channel (Error %d)", 0); } if (DEV_EFN != infosPipes[iFd].devType) { libStat = lib$free_ef(&(infosPipes[iFd].eventFlag)); VMS_TestStatus(libStat, "Can't free ef (Error %d)", 0); } } } if (specialEfnToFree) { libStat = lib$free_ef(&SpecialEfn); VMS_TestStatus(libStat, "Can't free special ef (Error %d)", 0); } if (NULL != timeoutVal) { libStat = lib$free_ef(&timeoutEf); VMS_TestStatus(libStat, "Can't free timer ef (Error %d)", 0); } if (DBG_SEL) fvwm_msg(DBG, "VMS_select_pipes", "********************************************************************************"); return(result); } /*---------------------------------------------------------------------------------------------------------------------------------- Function : VMS_msg Action : replacement for fvwm_msg ----------------------------------------------------------------------------------------------------------------------------------*/ char FabName[] = "Sys$Login:Fvwm.log"; void VMS_msg(int type,char *id,char *msg,...) { char *typestr; va_list args; char buffer1[1024], buffer2[1024]; static FILE *fabFD = NULL; static int fabNew = 1; switch(type) { case DBG: typestr="Dbg"; break; case ERR: typestr="Err"; break; case WARN: typestr="Wrn"; break; case INFO: default: typestr=""; break; } sprintf(buffer1,"[fvwm-%d/%d-%s-%s] ", time(NULL), clock(), typestr, id); va_start(args,msg); vsprintf(buffer2, msg, args); va_end(args); strcat(buffer1, buffer2); if (NULL == fabFD) { if (1 == fabNew) { fabFD = fopen(FabName, "w"); fabNew = 0; } else fabFD = fopen(FabName, "a"); } if (NULL != fabFD) { fprintf(fabFD, "%s\n", buffer1); #ifdef DEBUG_SYNC_OUTPUT fsync(fileno(fabFD)); #endif #ifdef DEBUG_CLOSE_OUTPUT fclose(fabFD); fabFD = NULL; #endif } else fprintf(stderr, "FAB-ERROR : file %s not opened <%s>", FabName, strerror(errno)); } /*---------------------------------------------------------------------------------------------------------------------------------- Function : VMS_SplitCommand Action : split command string in an array of string pointers to words of command. Array is passed. Each pointer is freed if necessary. The pointer after the last used argument pointer is set to NULL. ----------------------------------------------------------------------------------------------------------------------------------*/ void VMS_SplitCommand( char *cmd, /* - Command to split - */ char **argums, /* - Array of arguments - */ int maxArgums, /* - Size of the array of argumets - */ int *nbArgums) { /* - Number of arguments created - */ int iArgum, argumLen; char *tmpChar, *tmpArgum; if (DBG_SPL) fvwm_msg(DBG,"VMS_SplitCommand","Splitting <%s>", cmd); tmpChar = tmpArgum = cmd; iArgum = 0; argumLen = 0; /* --- Split command in arguments --- */ while (0 != *tmpChar) { if (' ' == *tmpChar) { if (DBG_SPL) fvwm_msg(DBG,"VMS_SplitCommand","End word..."); if (0 < argumLen) { if (NULL != argums[iArgum]) free(argums[iArgum]); argums[iArgum] = (char *)malloc(argumLen + 1); if (NULL == argums[iArgum]) { VMS_msg(ERR, "VMS_SplitCommand", "Can't allocate memory"); exit(0); } strncpy(argums[iArgum], tmpArgum, argumLen); argums[iArgum][argumLen] = 0; if (DBG_SPL) fvwm_msg(DBG,"VMS_SplitCommand","New word <%s>, Len: %d", argums[iArgum], strlen(argums[iArgum])); iArgum++; tmpArgum = tmpChar + 1; argumLen = 0; } } else argumLen++; tmpChar++; } /* --- Get last argument --- */ if (0 < argumLen) { argums[iArgum] = (char *)malloc(argumLen + 1); if (NULL == argums[iArgum]) { VMS_msg(ERR, "VMS_SplitCommand", "Can't allocate memory"); exit(0); } strncpy(argums[iArgum], tmpArgum, argumLen); argums[iArgum][argumLen] = 0; if (DBG_SPL) fvwm_msg(DBG,"VMS_SplitCommand","Last word <%s>, Len: %d", argums[iArgum], strlen(argums[iArgum])); iArgum++; } argums[iArgum] = NULL; *nbArgums = iArgum; /* --- Remove quotes in each argument --- */ for (iArgum = 0; iArgum < *nbArgums; iArgum++) { if ('"' == argums[iArgum][0]) { tmpChar = (char *)malloc(strlen(argums[iArgum])); if (NULL == tmpChar) { VMS_msg(ERR, "VMS_SplitCommand", "Can't allocate memory"); exit(0); } strncpy(tmpChar, argums[iArgum] + 1, strlen(argums[iArgum]) - 1); tmpChar[strlen(argums[iArgum]) - 1] = 0; free(argums[iArgum]); argums[iArgum] = tmpChar; } if ('"' == argums[iArgum][strlen(argums[iArgum]) - 1]) argums[iArgum][strlen(argums[iArgum]) - 1] = 0; if (DBG_SPL) fvwm_msg(DBG,"VMS_SplitCommand","Argument %d <%s>", iArgum, argums[iArgum]); } } /*---------------------------------------------------------------------------------------------------------------------------------- Function : VMS_ExecL Action : replacemant for execl. It splits command and calls execv() from the Dec RTL. This function assumes its params are passed a special way. It can't be considered working in all cases. In fact it works only in one :-) The array containing splitted command is statically allocated, so we never free it and allocate it just once. ----------------------------------------------------------------------------------------------------------------------------------*/ int VMS_ExecL( const char *fileSpec, /* - Conventionnaly, image to run. With Unix, often a shell - */ const char *arg0, /* - The same as fileSpec, by convention - */ ...) { /* - Real unix command, eventually splitted - */ int execStat, nbArgums; static char **argums = NULL; char *cmdPtr; va_list vaCmd; if (DBG_EXL) fvwm_msg(DBG,"VMS_ExecL","Entering function..."); /* --- Allocates the arguments array, once --- */ if (NULL == argums) { argums = (char **)malloc(sizeof(char *) * VMS_MAX_ARGUMENT_IN_CMD); if (NULL == argums) { fvwm_msg(ERR,"VMS_ExecL","Error allocating argums <%s>", strerror(errno)); exit(100); } memset(argums, 0, sizeof(char *) * VMS_MAX_ARGUMENT_IN_CMD); } /* --- Initialize the varying argument list --- */ va_start(vaCmd, arg0); /* --- Assumes the shell command is in the fourth argument, third would be "-c" or something indicating the image to be run by the shell. Well of course, it can be something very different. --- */ cmdPtr = va_arg(vaCmd, char*); cmdPtr = va_arg(vaCmd, char*); va_end(vaCmd); if (DBG_EXL) fvwm_msg(DBG,"VMS_ExecL","cmd <%s>", cmdPtr); /* --- Splits command in the argument array --- */ VMS_SplitCommand(cmdPtr, argums, VMS_MAX_ARGUMENT_IN_CMD, &nbArgums); if (DBG_EXL) fvwm_msg(DBG,"VMS_ExecL","cmd now broken in %d arguments", nbArgums); /* --- Calling exec : if it fails, don't return the fact. Thus, the unix code won't remark the problem and continue the parent process. --- */ execStat = execv(argums[0], argums); if (-1 == execStat) fvwm_msg(ERR,"VMS_ExecL","execl failed (%s)", strerror(errno)); return(0); } fvwm-2.6.5.orig/vms/README0000644000175000017500000002501110656151550013312 0ustar vwcvwc-------------------------------------------------------------------------------- Fvwm with OpenVms, how-to Fabien Villard (Villard_f@Decus.Fr), February 1999 -------------------------------------------------------------------------------- Versions : ---------- Fvwm 2.3 official version. OpenVms Alpha V7.1-1H1, DecC V5.7-006 Thanks ------ Thanks to the fvwm team and especially to Steve Robbins who worked with me to integrate the OpenVMS port in the source tree. Compilation ----------- Set Default to . Copy [.Vms]Make_Fvwm.Mms to . Copy [.Vms]Vms_Shareables.Opt . Edit the Make_Fvwm.Mms file and modify the first macros to suit your environment. Copy [.Vms]Config.h file to Config.h. Edit the Config.h file and modifiy what you want, according to the comments in it. Especially, deactive all XPMlibraries uses if you don't have them or don't need this support. Copy [.Vms]/vms.c and [.Vms]/vms.h into [.Libs]. Then do a $ Mms/Descript=Make_Fvwm.Mms/Ignore=Warning. This will create the fvwm executable Fvwm.Exe in [.Fvwm] and the modules executables FvwmXxx.Exe in the directory [.Modules.Bin]. Installation ------------ Copy the images Fvwm.Exe and FvwmXxx.Exe where appropriate. Extract from the end of this README and edit the Fvwm_Ope.Com procedure, mofify the logical names to reflect your environment. The Fvwm distribution contains a set of icons, pixmaps and miniicons in the [.icons] directory. They can be moved to a more appropriate place. Put this file where it goes in your environment. Copy the FvwmRc.Dat file in your Sys$Login. Edit it. The sample is provided just for a quickstart. The docs can be found in the files *.1 (Unix manpages, no time to convert them) in [.fvwm] and [.modules.FvwmXxx]FvwmXxx.1 directories. In your Sys$Login, you have a VUE$PROFILE.VUE$DAT file. Save it, for example under the name VUE$PROFILE.VUE$DAT_MOTIF. Open DecWindow "Menus..." option of the Session Menu Bar. Create a new "Item name", say "Fvwm", with the following command : @Fvwm_Ope.Com Open DecWindow "Automatic Startup..." entry of the Session Menu Bar. Kill the "Window Manager" entry and add instead the newly created "Fvwm" item. Save the session manager options. Now in your Sys$Login, the modification timestamp of VUE$PROFILE.VUE$DAT has changed. Save the new form, for example under the name VUE$PROFILE.VUE$DAT_FVWM. Close the session and reopen it. Fvwm must run. If it goes wrong ---------------- If Fvwm doesn't run, or run and die, but the XServer is still there, no problem. Just open a new DecTerm. It will popup on top of the windows list. Click in it, it gets the focus. Then do something like Copy VUE$PROFILE.VUE$DAT_MOTIF VUE$PROFILE.VUE$DAT CLose the session, reopen it, Mwm will run. Some informations can be found in the file Fvwm.Log in your Sys$Login. In vms.h there are some debugguing macros that can be activated to trace more. Especially, the one that enable flush and/or open/close of the trace file. Attention it slows the fvwm start a lot. All that precedes can be accomplished with only TmpMbx and NetMbx privileges. Next, if you are unlucky, need more privileges, or less kindness :-) If the XServer die unexpectadly (Quotas limits, file protections...), you can restart it from the console, or from another machine, or, you can reboot your ws. That's not very fair, but... In both cases, don't forget to manage the copy above. -------------------------------------------------------------------------------- Fvwm under OpenVms, modifications list Fabien Villard (Villard_F@Decus.Fr), 20-JAN-1999 -------------------------------------------------------------------------------- Fvwm configuration : -------------------- The file VMS_config.h is derived from the config.h.in generated by autoconf. It can be edited to modify the system configuration (HAVE_xxx, ...) and the stuff you want in Fvwm (SHAPE, ...). Some things are added here to help debugguing the VMS port, and others ARE the port :-) : #include "vms.h" : this gives acces to the VMS stuff for all sources of Fvwm without modifying them. #define fork vfork : in my version of DecC I haven't fork, but vfork. See more on this later. #define execvp execv : this avoid using the PATH environment variable and with a minor modification of code, allows to use logicals to locate the modules. #define execl VMS_ExecL : the new function VMS_ExecL() gets the command Unix'ly passed to the shell, splits it in words and rebuild an array of arguments. Then it calls execv(), assuming it has found an image name. If execv() call fails, VMS_ExecL() returns 0, hiding the fail. Thus the original code, executing in the parent context, doesn't call exit() which is fatal for the parent with actual version of Dec C RTL. #define fvwm_msg VMS_msg : there is a coredump I can't figure out (quotas) when using the fprintf(stderr,...) function to display debug informations. DecWindows crashes with a generic error 65535, probably meaning a VMS IO error. I give in Vms.c another tracing function wich can be forced to open/close the output file, or to flush outputs (it could be cool to get the the image name of the process running to display in the log file or to have separate logs for each modules, if someone is interested in adding it) #define select VMS_select_pipes : that's the big deal. The select() function is not working as expected and we cannot give it the X file descriptor wich under VMS is an event flag. So I rewrote the select() function, considering the C pipes are implemented as MailBoxes under VMS. New sources : ------------- Vms.c/Vms.h : contains specific functions for VMS. Sources modifications : ----------------------- [.Fvwm]Fvwm.c because DecWindow gives an event flag instead of a file descriptor in the fd field of the Display structure, we cannot use the fcntl() function with it. I don't know if we could get the fd, or even if there is one. So we must comment the fcntl() call on X file descriptor. If DecWindow uses a file descriptor (I guess no), it will remain open in the subprocesses spawned by exec() functions family. If it doesn't use one, no consequences. [.fvwm]module.c o When the fork/exec functions are used with Unixes, the code between the fork() and the exec() is executed by the child process. With VMS, it is executed by the parent process, for the child doesn't exist yet. So, we cannot close the parent pipes that the child doesn't need. o Despite the fact that there is code to verify the existence of the image to run in a child process, the child process spawning can fail (protections, quotas,...) more easely than under Unix. The exec() function then returns just after the call and the original code exits. I think with VMS it must not be considered a fatal error. [.fvwm]misc.c Just comment out the original fvwm_msg() function to activate the VMS_msg(). [.fvwm]module.c The image names are traditionnaly built wit a ".exe" extension in VMS and without extension in Unix. To limit the incompatibilities in the Fvwm resource files, speaking of module names, I add temporarily this extension to the file name searched, when the file type is executable. So, apart from the actual locations of things, the syntaxe of the resource file is not changed. [.modules.fvwmpager]fvwmpager.c o Due to the VMS_select_pipes() implementation (see the source), some ghosts X events can be generated. Depending upon the way returns from the function are managed, this can lead to false "missed X events". Fvwmpager.c exits when those missed X events are to numerous. I bypass this test. [.modules.fvwmwinlist]fvwmwinlist.c o Probably due to DecWindow events buffering, I must add an XFlush() call to have the window really redrawn. Fvwm unused sources : --------------------- [.Libs]usleep.c [.libs]strerror.c [.Libs]strcasecmp.c [.Libs]strncasecmp.c -------------------------------------------------------------------------------- Fvwm with OpenVms, DCL procedures Fabien Villard (Villard_f@Decus.Fr), 28-JAN-1999 -------------------------------------------------------------------------------- FVWM_OPE.COM : launch Fvwm from the DecWindow session manager. SHSUBPROC.COM : is a small utility to view the processes involved in Fvwm execution. Launch it with : $ @SHSUBPROC DECW$SESSION ----------- FVWM_OPE.COM -------------------------------------------------- $! Set Process/Dump $! --- Location of the Fvwm images --- $ Assign/NoLog Fab$Exe fvwm_bindir $! --- Location of the pixmaps --- $ Assign/NoLog DARC:[VMS.Pixmaps] fvwm_pixdir $! --- Location of the icons --- $ Assign/NoLog DARC:[VMS.Icons] fvwm_icodir $ Run/NoDebug Fab$Exe:fvwm.Exe $ Exit ----------- FVWM_OPE.COM -------------------------------------------------- ---------- SHSUBPROC.COM -------------------------------------------------- $ Verbose = 0 $ Say :== Write Sys$Output $ If P1 .Eqs. "" $ Then $ Say "P1 : Master Process Name" $ Goto EndScript $ EndIf $ MasterName = P1 $! $ ProcessContext = "" $ A = F$Context("Process", ProcessContext, "PRCNAM", MasterName, "Eql") $ MasterPid = F$Pid(ProcessContext) $ If MasterPid .Eqs. "" Then Goto EndScript $ If Verbose .Eq. 1 Then Say "---------- Pid of Decw$Session process : " + MasterPid $ NbProc == 1 $ Level == 0 $ Call DisplayProcess 'MasterPid $ Call ListSubProc 'MasterPid $ Say "There are ", NbProc, " processes in this job." $EndScript: $ Exit $! $ListSubProc: SubRoutine $ Level == Level + 1 $ Owner = P1 $ If Verbose .Eq. 1 Then Say "---------- Listing subprocesses of ", Owner $ SubContext = "" $ A = F$Context("Process", SubContext, "OWNER", Owner, "Eql") $NextProcess: $ Pid = F$Pid(SubContext) $ If Pid .Eqs. "" Then Goto NoMoreProcess $ NbProc == NbProc + 1 $ Call DisplayProcess 'Pid $ Call ListSubProc 'Pid $ Goto NextProcess $! $NoMoreProcess: $ Level == Level - 1 $ If Verbose Then Say "---------- End ", Owner $EndSubroutine $! $DisplayProcess:SubRoutine $ Pid = P1 $ PrcNam = F$GetJpi(Pid, "PrcNam") $ ImagName = F$GetJpi(Pid, "ImagName") $ ModuleName = F$Parse(ImagName,"","","NAME","SYNTAX_ONLY") $ FormPrcNam = F$Fao("!#AS!AS", Level*2, "", PrcNam) $ Say F$Fao("!22AS !8AS !12AS", FormPrcNam, Pid, ModuleName) $EndSubroutine ---------- SHSUBPROC.COM -------------------------------------------------- fvwm-2.6.5.orig/vms/vms_shareables.opt0000644000175000017500000000013506672466042016164 0ustar vwcvwcsys$share:decw$xtlibshrr5/share sys$share:decw$xlibshr/share sys$share:decw$xextlibshr/share fvwm-2.6.5.orig/vms/vms.h0000644000175000017500000000163707677641666013445 0ustar vwcvwc/* -*-c-*- */ /*---------------------------------------------------------------------------------------------------------------------------------- Module : vms.h for Fvwm on Open VMS Author : Fabien Villard (Villard_F@Decus.Fr) Date : 5-JAN-1999 Action : specials functions and constants for running Fvwm with OpenVms. ----------------------------------------------------------------------------------------------------------------------------------*/ #include "ftime.h" #ifndef DBG #define DBG -1 #define INFO 0 #define WARN 1 #define ERR 2 #endif #define VMS_MAX_ARGUMENT_IN_CMD 255 /* - Maximum number in a command passed to builtin functions - */ void VMS_msg(int type,char *id,char *msg,...); void VMS_SplitCommand(char *cmd, char **argums, int maxArgums, int *nbArgums); int VMS_select_pipes(int nbPipes, fd_set *readFds, fd_set *writeFds, fd_set *filler, struct timeval *timeoutVal); fvwm-2.6.5.orig/vms/make_fvwm.mms0000644000175000017500000013604707252570161015141 0ustar vwcvwcBaseDirFix = ! Ex Device:[Path] BaseDir = ! Ex Device:[Path.] XpmInclude = ! If needed XpmLib = ! If needed CCCommand = Cc/Pref=All/Nested_Include_Directory=Primary_File/Standard=Relaxed_Ansi89 .First @ If F$Search("[.Libs]Libs.Olb") .Eqs. "" Then Write Sys$Output "Creating library [.Libs]Libs.Olb..." @ If F$Search("[.Libs]Libs.Olb") .Eqs. "" Then Lib/Create/Obj [.Libs]Libs.Olb @ If F$Search("[.Fvwm]Fvwm.Olb") .Eqs. "" Then Write Sys$Output "Creating library [.Fvwm]Fvwm.Olb..." @ If F$Search("[.Fvwm]Fvwm.Olb") .Eqs. "" Then Lib/Create/Obj [.Fvwm]Fvwm.Olb @ If F$Search("[.Modules]Bin.Dir") .Eqs. "" Then Write Sys$Output "Creating directory [.Modules]Bin.Dir..." @ If F$Search("[.Modules]Bin.Dir") .Eqs. "" Then Cre/Dir [.Modules.Bin] @ Write Sys$Output "Redefining logical X11..." @ Assign/Job DECW$INCLUDE,$(XpmInclude) X11 @ Assign/Job $(BaseDir)[Libs] Libs @ Assign/Job $(BaseDir)[Fvwm] Fvwm Fvwm : [.Fvwm]Fvwm.Exe, - [.Modules.Bin]FvwmWinList.Exe, - [.Modules.Bin]FvwmAuto.Exe, - [.Modules.Bin]FvwmPager.Exe, - [.Modules.Bin]FvwmIdent.Exe, - [.Modules.Bin]FvwmForm.Exe, - [.Modules.Bin]FvwmIconMan.Exe, - [.Modules.Bin]FvwmButtons.Exe, - [.Modules.Bin]FvwmTalk.Exe, - [.Modules.Bin]FvwmEvent.Exe, - [.Modules.Bin]FvwmRearrange.Exe, - [.Modules.Bin]FvwmAnimate.Exe @ Continue [.Fvwm]Fvwm.Exe : [.Libs]Libs.Olb, [.Fvwm]Fvwm.Olb @ Write Sys$Output "Creating image $(MMS$TargetName)..." @ Link/Exe=[.Fvwm]Fvwm.Exe $(BaseDir)[Fvwm]Fvwm.Olb/Lib/Inc=Fvwm, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(XpmLib)/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Libs]Libs.Olb : [.Libs]Vms.Obj, [.Libs]CLIENTMSG.Obj, [.Libs]COLORUTILS.Obj, - [.Libs]DEBUG.Obj, [.Libs]ENVVAR.Obj, [.Libs]GETFONT.Obj, [.Libs]GETHOSTNAME.Obj, [.Libs]GRAB.Obj, - [.Libs]MODPARSE.Obj, [.Libs]MODULE.Obj, [.Libs]PARSE.Obj, [.Libs]PICTURE.Obj, [.Libs]SAFEMALLOC.Obj, - [.Libs]STRINGS.Obj, [.Libs]SYSTEM.Obj, [.Libs]WILD.Obj, [.Libs]XRESOURCE.Obj, [.Libs]Graphics.Obj @ Continue !----------------------------------------------------------------------------------------------------------------------------------- ! Directory [.Libs] !----------------------------------------------------------------------------------------------------------------------------------- [.Libs]Vms.Obj : [.Libs]Vms.C, Config.h, [.Libs]Vms.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000], $(BaseDir)[fvwm], $(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]CLIENTMSG.Obj : [.Libs]CLIENTMSG.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]COLORUTILS.Obj : [.Libs]COLORUTILS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]DEBUG.Obj : [.Libs]DEBUG.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]ENVVAR.Obj : [.Libs]ENVVAR.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]GETFONT.Obj : [.Libs]GETFONT.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]GETHOSTNAME.Obj : [.Libs]GETHOSTNAME.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]GRAB.Obj : [.Libs]GRAB.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]MODPARSE.Obj : [.Libs]MODPARSE.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]MODULE.Obj : [.Libs]MODULE.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]PARSE.Obj : [.Libs]PARSE.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]PICTURE.Obj : [.Libs]PICTURE.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]SAFEMALLOC.Obj : [.Libs]SAFEMALLOC.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]STRINGS.Obj : [.Libs]STRINGS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]SYSTEM.Obj : [.Libs]SYSTEM.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]WILD.Obj : [.Libs]WILD.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]XRESOURCE.Obj : [.Libs]XRESOURCE.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) [.Libs]Graphics.Obj : [.Libs]Graphics.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ $(CCCommand) /Obj=[.Libs] /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) $(MMS$Source) @ Lib/Rep/Obj [.Libs]Libs.Olb $(MMS$Target) !----------------------------------------------------------------------------------------------------------------------------------- ! Directory [.Fvwm] !----------------------------------------------------------------------------------------------------------------------------------- [.Fvwm]Fvwm.Olb : [.Fvwm]FVWM.Obj, [.Fvwm]ADD_WINDOW.Obj, [.Fvwm]BINDINGS.Obj, [.Fvwm]BORDERS.Obj, [.Fvwm]BUILTINS.Obj, - [.Fvwm]COLORMAPS.Obj, [.Fvwm]COLORS.Obj, [.Fvwm]DECORATIONS.Obj, [.Fvwm]EVENTS.Obj, - [.Fvwm]FOCUS.Obj, [.Fvwm]FUNCTIONS.Obj, [.Fvwm]ICONS.Obj, [.Fvwm]MENUS.Obj, [.Fvwm]MISC.Obj, - [.Fvwm]MODCONF.Obj, [.Fvwm]MODULE.Obj, [.Fvwm]MOVE.Obj, [.Fvwm]PLACEMENT.Obj, [.Fvwm]READ.Obj, - [.Fvwm]RESIZE.Obj, [.Fvwm]STYLE.Obj, [.Fvwm]VIRTUAL.Obj, [.Fvwm]WINDOWS.Obj, [.Fvwm]IcccM2.Obj @ Continue [.Fvwm]FVWM.Obj : [.Fvwm]FVWM.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) FVWM.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]ADD_WINDOW.Obj : [.Fvwm]ADD_WINDOW.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) ADD_WINDOW.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]BINDINGS.Obj : [.Fvwm]BINDINGS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) BINDINGS.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]BORDERS.Obj : [.Fvwm]BORDERS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) BORDERS.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]BUILTINS.Obj : [.Fvwm]BUILTINS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) BUILTINS.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]COLORMAPS.Obj : [.Fvwm]COLORMAPS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) COLORMAPS.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]COLORS.Obj : [.Fvwm]COLORS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) COLORS.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]DECORATIONS.Obj : [.Fvwm]DECORATIONS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) DECORATIONS.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]EVENTS.Obj : [.Fvwm]EVENTS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) EVENTS.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]FOCUS.Obj : [.Fvwm]FOCUS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) FOCUS.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]FUNCTIONS.Obj : [.Fvwm]FUNCTIONS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) FUNCTIONS.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]ICONS.Obj : [.Fvwm]ICONS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) ICONS.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]MENUS.Obj : [.Fvwm]MENUS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) MENUS.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]MISC.Obj : [.Fvwm]MISC.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) MISC.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]MODCONF.Obj : [.Fvwm]MODCONF.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) MODCONF.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]MODULE.Obj : [.Fvwm]MODULE.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) MODULE.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]MOVE.Obj : [.Fvwm]MOVE.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) MOVE.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]PLACEMENT.Obj : [.Fvwm]PLACEMENT.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) PLACEMENT.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]READ.Obj : [.Fvwm]READ.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) READ.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]RESIZE.Obj : [.Fvwm]RESIZE.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) RESIZE.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]STYLE.Obj : [.Fvwm]STYLE.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) STYLE.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]VIRTUAL.Obj : [.Fvwm]VIRTUAL.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) VIRTUAL.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]WINDOWS.Obj : [.Fvwm]WINDOWS.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) WINDOWS.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) [.Fvwm]ICCCM2.Obj : [.Fvwm]ICCCM2.C, Config.h @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Fvwm] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) ICCCM2.C @ Set Def $(BaseDirFix) @ Lib/Rep/Obj [.Fvwm]Fvwm.Olb $(MMS$Target) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmWinList !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmWinList.Exe : [.Modules.FvwmWinList]BUTTONARRAY.Obj, [.Modules.FvwmWinList]COLORS.Obj, - [.Modules.FvwmWinList]FVWMWINLIST.Obj, [.Modules.FvwmWinList]LIST.Obj, - [.Modules.FvwmWinList]MALLOCS.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmWinList]BUTTONARRAY.Obj, [.Modules.FvwmWinList]COLORS.Obj, - [.Modules.FvwmWinList]FVWMWINLIST.Obj, [.Modules.FvwmWinList]LIST.Obj, - [.Modules.FvwmWinList]MALLOCS.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(XpmLib)/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmWinList]BUTTONARRAY.Obj : [.Modules.FvwmWinList]BUTTONARRAY.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmWinList] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) BUTTONARRAY.C @ Set Def $(BaseDirFix) [.Modules.FvwmWinList]COLORS.Obj : [.Modules.FvwmWinList]COLORS.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmWinList] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) COLORS.C @ Set Def $(BaseDirFix) [.Modules.FvwmWinList]FVWMWINLIST.Obj : [.Modules.FvwmWinList]FVWMWINLIST.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmWinList] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) FVWMWINLIST.C @ Set Def $(BaseDirFix) [.Modules.FvwmWinList]LIST.Obj : [.Modules.FvwmWinList]LIST.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmWinList] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) LIST.C @ Set Def $(BaseDirFix) [.Modules.FvwmWinList]MALLOCS.Obj : [.Modules.FvwmWinList]MALLOCS.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmWinList] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) MALLOCS.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmAuto !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmAuto.Exe : [.Modules.FvwmAuto]FvwmAuto.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmAuto]FvwmAuto.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmAuto]FvwmAuto.Obj : [.Modules.FvwmAuto]FvwmAuto.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmAuto] @ $(CCCommand) /Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) FvwmAuto.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmPager !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmPager.Exe : [.Modules.FvwmPager]FvwmPager.Obj, [.Modules.FvwmPager]X_Pager.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmPager]FvwmPager.Obj, [.Modules.FvwmPager]X_Pager.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(XpmLib)/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmPager]FvwmPager.Obj : [.Modules.FvwmPager]FvwmPager.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmPager] @ $(CCCommand) /Obj=FvwmPager.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) FvwmPager.C @ Set Def $(BaseDirFix) [.Modules.FvwmPager]X_Pager.Obj : [.Modules.FvwmPager]X_Pager.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmPager] @ $(CCCommand) /Obj=X_Pager.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) X_Pager.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmIdent !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmIdent.Exe : [.Modules.FvwmIdent]FvwmIdent.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmIdent]FvwmIdent.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmIdent]FvwmIdent.Obj : [.Modules.FvwmIdent]FvwmIdent.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmIdent] @ $(CCCommand) /Obj=FvwmIdent.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) FvwmIdent.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmForm !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmForm.Exe : [.Modules.FvwmForm]FvwmForm.Obj, [.Modules.FvwmForm]DefineMe.Obj, - [.Modules.FvwmForm]ParseCommand.Obj, [.Modules.FvwmForm]ReadXServer.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmForm]FvwmForm.Obj, - [.Modules.FvwmForm]DefineMe.Obj, - [.Modules.FvwmForm]ParseCommand.Obj, - [.Modules.FvwmForm]ReadXServer.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(XpmLib)/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmForm]FvwmForm.Obj : [.Modules.FvwmForm]FvwmForm.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmForm] @ $(CCCommand) /Obj=FvwmForm.Obj /inc=([],$(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) FvwmForm.C @ Set Def $(BaseDirFix) [.Modules.FvwmForm]DefineMe.Obj : [.Modules.FvwmForm]DefineMe.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmForm] @ $(CCCommand) /Obj=DefineMe.Obj /inc=([],$(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) DefineMe.C @ Set Def $(BaseDirFix) [.Modules.FvwmForm]ParseCommand.Obj : [.Modules.FvwmForm]ParseCommand.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmForm] @ $(CCCommand) /Obj=ParseCommand.Obj /inc=([],$(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) ParseCommand.C @ Set Def $(BaseDirFix) [.Modules.FvwmForm]ReadXServer.Obj : [.Modules.FvwmForm]ReadXServer.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmForm] @ $(CCCommand) /Obj=ReadXServer.Obj /inc=([],$(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) ReadXServer.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmIconMan !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmIconMan.Exe : [.Modules.FvwmIconMan]FvwmIconMan.Obj, [.Modules.FvwmIconMan]Debug.Obj, - [.Modules.FvwmIconMan]Functions.Obj, [.Modules.FvwmIconMan]Fvwm.Obj, - [.Modules.FvwmIconMan]Globals.Obj, [.Modules.FvwmIconMan]ReadConfig.Obj, - [.Modules.FvwmIconMan]WinList.Obj, [.Modules.FvwmIconMan]X.Obj, - [.Modules.FvwmIconMan]XManager.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmIconMan]FvwmIconMan.Obj, [.Modules.FvwmIconMan]Debug.Obj, - [.Modules.FvwmIconMan]Functions.Obj, [.Modules.FvwmIconMan]Fvwm.Obj, - [.Modules.FvwmIconMan]Globals.Obj, [.Modules.FvwmIconMan]ReadConfig.Obj, - [.Modules.FvwmIconMan]WinList.Obj, [.Modules.FvwmIconMan]X.Obj, - [.Modules.FvwmIconMan]XManager.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(XpmLib)/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmIconMan]FvwmIconMan.Obj : [.Modules.FvwmIconMan]FvwmIconMan.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmIconMan] @ $(CCCommand) /Obj=FvwmIconMan.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[Modules.FvwmIconMan]) - FvwmIconMan.C @ Set Def $(BaseDirFix) [.Modules.FvwmIconMan]Debug.Obj : [.Modules.FvwmIconMan]Debug.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmIconMan] @ $(CCCommand) /Obj=Debug.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[Modules.FvwmIconMan]) - Debug.C @ Set Def $(BaseDirFix) [.Modules.FvwmIconMan]Functions.Obj : [.Modules.FvwmIconMan]Functions.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmIconMan] @ $(CCCommand) /Obj=Functions.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[Modules.FvwmIconMan]) - Functions.C @ Set Def $(BaseDirFix) [.Modules.FvwmIconMan]Fvwm.Obj : [.Modules.FvwmIconMan]Fvwm.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmIconMan] @ $(CCCommand) /Obj=Fvwm.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[Modules.FvwmIconMan]) - Fvwm.C @ Set Def $(BaseDirFix) [.Modules.FvwmIconMan]Globals.Obj : [.Modules.FvwmIconMan]Globals.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmIconMan] @ $(CCCommand) /Obj=Globals.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[Modules.FvwmIconMan]) - Globals.C @ Set Def $(BaseDirFix) [.Modules.FvwmIconMan]ReadConfig.Obj : [.Modules.FvwmIconMan]ReadConfig.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmIconMan] @ $(CCCommand) /Obj=ReadConfig.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[Modules.FvwmIconMan]) - ReadConfig.C @ Set Def $(BaseDirFix) [.Modules.FvwmIconMan]WinList.Obj : [.Modules.FvwmIconMan]WinList.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmIconMan] @ $(CCCommand) /Obj=WinList.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[Modules.FvwmIconMan]) - WinList.C @ Set Def $(BaseDirFix) [.Modules.FvwmIconMan]X.Obj : [.Modules.FvwmIconMan]X.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmIconMan] @ $(CCCommand) /Obj=X.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[Modules.FvwmIconMan]) - X.C @ Set Def $(BaseDirFix) [.Modules.FvwmIconMan]XManager.Obj : [.Modules.FvwmIconMan]XManager.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmIconMan] @ $(CCCommand) /Obj=XManager.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[Modules.FvwmIconMan]) - XManager.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmButtons !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmButtons.Exe : [.Modules.FvwmButtons]FvwmButtons.Obj, [.Modules.FvwmButtons]BUTTON.Obj, - [.Modules.FvwmButtons]DRAW.Obj, [.Modules.FvwmButtons]ICONS.Obj, - [.Modules.FvwmButtons]MISC.Obj, [.Modules.FvwmButtons]OUTPUT.Obj, - [.Modules.FvwmButtons]PARSE.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmButtons]FvwmButtons.Obj, [.Modules.FvwmButtons]BUTTON.Obj, - [.Modules.FvwmButtons]DRAW.Obj, [.Modules.FvwmButtons]ICONS.Obj, - [.Modules.FvwmButtons]MISC.Obj, [.Modules.FvwmButtons]OUTPUT.Obj, - [.Modules.FvwmButtons]PARSE.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(XpmLib)/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmButtons]FvwmButtons.Obj : [.Modules.FvwmButtons]FvwmButtons.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmButtons] @ $(CCCommand) /Obj=FvwmButtons.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) - FvwmButtons.C @ Set Def $(BaseDirFix) [.Modules.FvwmButtons]Button.Obj : [.Modules.FvwmButtons]Button.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmButtons] @ $(CCCommand) /Obj=Button.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) Button.C @ Set Def $(BaseDirFix) [.Modules.FvwmButtons]Draw.Obj : [.Modules.FvwmButtons]Draw.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmButtons] @ $(CCCommand) /Obj=Draw.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) Draw.C @ Set Def $(BaseDirFix) [.Modules.FvwmButtons]Icons.Obj : [.Modules.FvwmButtons]Icons.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmButtons] @ $(CCCommand) /Obj=Icons.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) Icons.C @ Set Def $(BaseDirFix) [.Modules.FvwmButtons]Misc.Obj : [.Modules.FvwmButtons]Misc.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmButtons] @ $(CCCommand) /Obj=Misc.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) Misc.C @ Set Def $(BaseDirFix) [.Modules.FvwmButtons]Output.Obj : [.Modules.FvwmButtons]Output.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmButtons] @ $(CCCommand) /Obj=Output.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) Output.C @ Set Def $(BaseDirFix) [.Modules.FvwmButtons]Parse.Obj : [.Modules.FvwmButtons]Parse.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmButtons] @ $(CCCommand) /Obj=Parse.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) Parse.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmTalk !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmTalk.Exe : [.Modules.FvwmTalk]FvwmTalk.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmTalk]FvwmTalk.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmTalk]FvwmTalk.Obj : [.Modules.FvwmTalk]FvwmTalk.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmTalk] @ $(CCCommand) /Obj=FvwmTalk.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) FvwmTalk.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmEvent !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmEvent.Exe : [.Modules.FvwmEvent]FvwmEvent.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmEvent]FvwmEvent.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmEvent]FvwmEvent.Obj : [.Modules.FvwmEvent]FvwmEvent.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmEvent] @ $(CCCommand) /Obj=FvwmEvent.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) FvwmEvent.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmRearrange !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmRearrange.Exe : [.Modules.FvwmRearrange]FvwmRearrange.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmRearrange]FvwmRearrange.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmRearrange]FvwmRearrange.Obj : [.Modules.FvwmRearrange]FvwmRearrange.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmRearrange] @ $(CCCommand) /Obj=FvwmRearrange.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) - FvwmRearrange.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmAnimate !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmAnimate.Exe : [.Modules.FvwmAnimate]FvwmAnimate.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmAnimate]FvwmAnimate.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmAnimate]FvwmAnimate.Obj : [.Modules.FvwmAnimate]FvwmAnimate.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmAnimate] @ $(CCCommand) /Obj=FvwmAnimate.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) - FvwmAnimate.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmIconBox !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmIconBox.Exe : [.Modules.FvwmIconBox]FvwmIconBox.Obj, [.Modules.FvwmIconBox]Icons.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmIconBox]FvwmIconBox.Obj, - [.Modules.FvwmIconBox]Icons.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmIconBox]FvwmIconBox.Obj : [.Modules.FvwmIconBox]FvwmIconBox.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmIconBox] @ $(CCCommand) /Obj=FvwmIconBox.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[modules.FvwmIconBox]) - FvwmIconBox.C @ Set Def $(BaseDirFix) [.Modules.FvwmIconBox]Icons.Obj : [.Modules.FvwmIconBox]Icons.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmIconBox] @ $(CCCommand) /Obj=Icons.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[modules.FvwmIconBox]) - Icons.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmBacker !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmBacker.Exe : [.Modules.FvwmBacker]FvwmBacker.Obj, - [.Modules.FvwmBacker]Mallocs.Obj, - [.Modules.FvwmBacker]RootBits.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmBacker]FvwmBacker.Obj, - [.Modules.FvwmBacker]Mallocs.Obj, - [.Modules.FvwmBacker]RootBits.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmBacker]FvwmBacker.Obj : [.Modules.FvwmBacker]FvwmBacker.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmBacker] @ $(CCCommand) /Obj=FvwmBacker.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs], $(BaseDir)[.Modules.FvwmBacker]) - FvwmBacker.C @ Set Def $(BaseDirFix) [.Modules.FvwmBacker]Mallocs.Obj : [.Modules.FvwmBacker]Mallocs.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmBacker] @ $(CCCommand) /Obj=Mallocs.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs], $(BaseDir)[.Modules.FvwmBacker]) - Mallocs.C @ Set Def $(BaseDirFix) [.Modules.FvwmBacker]Root_Bits.Obj : [.Modules.FvwmBacker]Root_Bits.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmBacker] @ $(CCCommand) /Obj=Root_Bits.Obj - /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs], $(BaseDir)[.Modules.FvwmBacker]) - Root_Bits.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! Module FvwmBanner !----------------------------------------------------------------------------------------------------------------------------------- [.Modules.Bin]FvwmBanner.Exe : [.Modules.FvwmBanner]FvwmBanner.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Modules.FvwmBanner]FvwmBanner.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Modules.FvwmBanner]FvwmBanner.Obj : [.Modules.FvwmBanner]FvwmBanner.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Modules.FvwmBanner] @ $(CCCommand) /Obj=FvwmBanner.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs]) FvwmBanner.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! extra FvwmCommand !----------------------------------------------------------------------------------------------------------------------------------- [.Extras.Bin]FvwmCommand.Exe : [.Extras.FvwmCommand]FvwmCommand.Obj, [.Extras.FvwmCommand]FvwmCommandS.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Extras.FvwmCommand]FvwmCommand.Obj, - [.Extras.FvwmCommand]FvwmCommandS.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Extras.FvwmCommand]FvwmCommand.Obj : [.Extras.FvwmCommand]FvwmCommand.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Extras.FvwmCommand] @ $(CCCommand) /Obj=FvwmCommand.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[.Extras.FvwmCommand]) - FvwmCommand.C @ Set Def $(BaseDirFix) [.Extras.FvwmCommand]FvwmCommands.Obj : [.Extras.FvwmCommand]FvwmCommands.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Extras.FvwmCommand] @ $(CCCommand) /Obj=FvwmCommands.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[.Extras.FvwmCommand]) - FvwmCommands.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! extra FvwmConsole !----------------------------------------------------------------------------------------------------------------------------------- [.Extras.Bin]FvwmConsole.Exe : [.Extras.FvwmConsole]FvwmConsole.Obj, - [.Extras.FvwmConsole]FvwmConsoleC.Obj, - [.Extras.FvwmConsole]GetLine.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Extras.FvwmConsole]FvwmConsole.Obj, - [.Extras.FvwmConsole]FvwmConsoleC.Obj, - [.Extras.FvwmConsole]GetLine.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Extras.FvwmConsole]FvwmConsole.Obj : [.Extras.FvwmConsole]FvwmConsole.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Extras.FvwmConsole] @ $(CCConsole) /Obj=FvwmConsole.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[.Extras.FvwmConsole]) - FvwmConsole.C @ Set Def $(BaseDirFix) [.Extras.FvwmConsole]FvwmConsoleC.Obj : [.Extras.FvwmConsole]FvwmConsoleC.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Extras.FvwmCommand] @ $(CCConsoleC) /Obj=FvwmConsoleC.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[.Extras.FvwmConsole]) - FvwmConsoleC.C @ Set Def $(BaseDirFix) [.Extras.FvwmConsole]GetLine.Obj : [.Extras.FvwmConsole]GetLine.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Extras.FvwmCommand] @ $(CCGetLine) /Obj=GetLine.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[.Extras.FvwmConsole]) - GetLine.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! extra FvwmDebug !----------------------------------------------------------------------------------------------------------------------------------- [.Extras.Bin]FvwmDebug.Exe : [.Extras.FvwmDebug]FvwmDebug.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Extras.FvwmDebug]FvwmDebug.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Extras.FvwmDebug]FvwmDebug.Obj : [.Extras.FvwmDebug]FvwmDebug.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Extras.FvwmDebug] @ $(CCCommand) /Obj=FvwmDebug.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[.Extras.FvwmDebug]) - FvwmDebug.C @ Set Def $(BaseDirFix) !----------------------------------------------------------------------------------------------------------------------------------- ! extra FvwmScript !----------------------------------------------------------------------------------------------------------------------------------- [.Extras.Bin]FvwmScript.Exe : [.Extras.FvwmScript]FvwmScript.Obj, - [.Extras.FvwmScript]Instructions.Obj, - [.Extras.FvwmScript]LibYYWrap.Obj, - [.Extras.FvwmScript]Scanner.Obj, - [.Extras.FvwmScript]Script.Obj @ Write Sys$Output "Creating image $(MMS$Target)..." @ Set Def $(BaseDirFix) @ Link/Exe=$(MMS$Target) [.Extras.FvwmScript]FvwmScript.Obj, - [.Extras.FvwmScript]Instructions.Obj, - [.Extras.FvwmScript]LibYYWrap.Obj, - [.Extras.FvwmScript]Scanner.Obj, - [.Extras.FvwmScript]Script.Obj, - $(BaseDir)[Libs]Libs.Olb/Lib, - $(BaseDir)[000000]Vms_Shareables.Opt/Opt @ Write Sys$Output "" [.Extras.FvwmScript]FvwmScript.Obj : [.Extras.FvwmScript]FvwmScript.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Extras.FvwmScript] @ $(CCCommand) /Obj=FvwmScript.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[.Extras.FvwmScript]) - FvwmScript.C @ Set Def $(BaseDirFix) [.Extras.FvwmScript]Instructions.Obj : [.Extras.FvwmScript]Instructions.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Extras.FvwmScript] @ $(CCCommand) /Obj=Instructions.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[.Extras.FvwmScript]) - Instructions.C @ Set Def $(BaseDirFix) [.Extras.FvwmScript]LibYYWrap.Obj : [.Extras.FvwmScript]LibYYWrap.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Extras.FvwmScript] @ $(CCCommand) /Obj=LibYYWrap.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[.Extras.FvwmScript]) - LibYYWrap.C @ Set Def $(BaseDirFix) [.Extras.FvwmScript]Scanner.Obj : [.Extras.FvwmScript]Scanner.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Extras.FvwmScript] @ $(CCCommand) /Obj=Scanner.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[.Extras.FvwmScript]) - Scanner.C @ Set Def $(BaseDirFix) [.Extras.FvwmScript]Script.Obj : [.Extras.FvwmScript]Script.C @ Write Sys$Output "Compiling $(MMS$Source)..." @ Set Def $(BaseDirFix) @ Set Def [.Extras.FvwmScript] @ $(CCCommand) /Obj=Script.Obj /inc=($(BaseDir)[000000],$(BaseDir)[fvwm],$(BaseDir)[libs],$(BaseDir)[.Extras.FvwmScript]) - Script.C @ Set Def $(BaseDirFix) fvwm-2.6.5.orig/NEWS0000644000175000017500000022163211744240713012332 0ustar vwcvwcNote, the changes for the last STABLE release start with release 2.6.0. ------------------------------------------------------------------- Changes in CVS HEAD (20-Apr-2012) * New features: - FvwmPager now wraps window names if SmallFont is set. * Bug fixes: - Made signals registered with FVWM unblocking. - The "UnderMouse" option to PositionPlacement now honors the EWMH working area by default, if it's in use. - FvwmButtons handles the deleted window correctly for sub-windows. ------------------------------------------------------------------- Changes in stable release 2.6.4 (01-Feb-2012) * New features: - FvwmIconMan no longer allows for itself to be transient by using: Module FvwmIconMan Transient This is too ambiguous with valid module alias names, hence a transient FvwmIconMan must be created with "-Transient" as in: Module FvwmIconMan -Transient - New command InfoStore -- to store key/value pairs of information to relieve the burden of the SetEnv command. - Speed-up improvements for fvwm-menu-desktop when generating XDG menus by removing unnecessary stat(2) calls. - BusyCursor and CursorStyle have been set to make the cursor look like a dot during Read/PipeRead commands, by default. * Bug fixes: - FvwmRearrange now understands the "ewmhiwa" option when placing windows. - Client gravity for subwindows is honoured for reparenting windows, such as with XEmbed, when changing the parent's geometry. - Conditional command processing of !Layer n, as in: Next (Xteddy, !Layer 4) Echo cuddles has now been fixed. - Fixed handling of swallowed windows for transient FvwmButtons'. - fvwm-menu-desktop now looks in /usr/share/applications for KDE legacy mode. - fvwm-config no longer accepts "--is-stable", "--is-released", "--is-final". ------------------------------------------------------------------- Changes in stable release 2.6.3 (30-Sept-2011) * New features: - New Style commands: TitleFormat IconTitleFormat Used to specify a window's visible name. These new options deprecate the older styles: IndexedWindowName IndexedIconName ExactWindowName ExactIconName - New Resize argument to direction: "automatic" which works out, automatically, which direction a window should be resized in based on which quadrant the pointer is in on the window -- this is best observed by the grid formed from "ResizeOutline", as the shape of this grid is used when calculating this. Furthermore, the existing option of "warptoborder" can be used in conjunction with "direction automatic" to warp the pointer to the appropriate window edge. - Couple of changes to the Move command: - The EWMH working area is now honoured by default. - To move a window ignoring the working area, the option "ewmhiwa" can be used, similar to how the Maximize command works. - New expansion placeholder $[pointer.screen] to return the screen number the pointer is on. * Bug fixes: - A few minor ones; nothing user-visible per se. ------------------------------------------------------------------- Changes in stable release 2.6.2 (06-Aug-2011) * New features: - New MenuStyle "UniqueHotkeyActivatesImmediate" and its negation "!UniqueHotkeyActivatesImmediate" to retain the menu until the user presses one of the menu keybindings to enact that change in the case where there's only one item defined in the menu at the specified hotkey. * Bug fixes: - Fix infinite loop crash when FvwmButtons quits/restarts with RootTransparent colorsets. - Fix setting window states across FVWM restarts where those windows do not set WM_COMMAND. - Windows are now correctly restored when coming out of fullscreen mode. ------------------------------------------------------------------- Changes in stable release 2.6.1 (16-Apr-2011) * New features: None. * Bug fixes: - Make the version and check of Fribidi >= 0.19.2 - fvwm-menu-desktop: - Make XML::Parser check runtime as it's a non-standard module. - Fix perl version check. ------------------------------------------------------------------- Changes in stable release 2.6.0 (15-Apr-2011) * New features: - Support libpng 1.5.0's slightly newer API. * Bug fixes: - Fix width of FvwmTaskBar to fit on screen properly by using the correct module information to determine the border size. - Fix resizing shaded windows with a shade direction that does not match the window's gravity. Shaded windows might have jumped to strange positions when being resized by the application. - FvwmIconMan now accepts an optional module alias when running in transient mode. - Use of the NoUSPosition style is now properly reported by "BugOpts ExplainWindowPlacement on". - Fix the CursorMove command to no longer move the pointer beyond the boundary of a page, if EdgeScroll was set to disable page flipping. - Fix NeverFocus windows from taking focus when opening menus, etc. - Plus *MANY* other fixes, improvements, etc. Please see the docs/ANNOUNCE file from 2_6_0. ------------------------------------------------------------------- ------------------------------------------------------------------- Changes in beta release 2.5.31 (09-Aug-2010) * New features: * Bug fixes: - fvwm-convert-2.6: Don't double-up comma separated options to conditional commands if they're already delimited by commas. - Correctly report a window's height and width if the window has incomplete resize increment set. - Maintain any State hints on a window when used with WindowStyle. - FvwmIconMan now correctly handles sticky windows. ------------------------------------------------------------------- Changes in beta release 2.5.30 (09-May-2010) * New features: - Support libpng 1.4.0's slightly newer API. * Bug fixes: - Don't lazy match AnyContext when printing out bindings and the contexts they apply to with "PrintInfo Bindings". ------------------------------------------------------------------- Changes in beta release 2.5.29 (03-Apr-2010) * New features: - Added new fvwm-convert-2.6 script to convert older fvwm 2.4.x config files. - New BugOpts option QtDragnDropWorkaround to work around an oddity in handling drag-n-drop events to Qt applications. * Bug fixes: - Fixed the InitialMapCommand style from running when FVWM is restarting. - Fix rendering of FvwmForm windows when initially mapped. - Fix placement of windows when using MinoverlapPlacement and friends. - Fix segfault when tearing off menus using a Pixmap background. - Fix "window jump" bug when moving a window across page boundaries. - Flush property events for same type in applications which repeatedly set the same XAtom. (Gnucash, Openoffice, etc.) - Fix opening of files using Read/PipeRead to accept paths in the form "./" to indicate CWD. Fixes $ fvwm -f ./some-fvwm2rc - Fix further crash when copying menustyles with MenuFace involving pixmaps. - Make layer changes apply immediately via Style commands for any currently mapped windows. - Fix flickering/incorrect location of the GeometryWindow with Xinerama/TwinView when resizing windows. ------------------------------------------------------------------- Changes in beta release 2.5.28 (20-Sep-2009) * New features: - New differentiated options for SnapAttraction when snapping against screen edges: "None", "ScreenWindows", "ScreenIcons", "ScreenAll" - New option to the BugOpts command: TransliterateUtf8. * Bug fixes: - Fixed non-visible Qt windows after a Qt deferred map (e.g. Skype profile windows). - Fixed the use of the X-resource "fvwmstyle". - Fixed segmentation fault in FvwmEvent when parsing an undefined event name, or an undefined environment variable to the RPlayHost option. - Fixed the events startup, shutdown and unknown in FvwmEvent. - Fvwm now retains utf8 window names when the WM_NAME changes, and the utf8 name converted to the default charset match the old WM_NAME. - Fixed the options RPlayVolume and RPlayPriority in FvwmEvent. - Fixed SnapAttraction: Option SameType/Icons/Windows did falsely not affect conditions of option "Screen" and option "SameType" snapped falsely icons and windows together. - Fixed a problem where modules would get incorrect stacking information if many windows were restacked at the same time. - Fixed BugOpts parsing of more than one option at a time and restoring of default value for the last option in the command line when omitted. - 64 bit fix for setting EWMH _NET_WM_ICON property on windows. ------------------------------------------------------------------- Changes in beta release 2.5.27 (23-Feb-2009) * New features: - New extended variable $[w.visiblename] - Style matching now honours the window's visible name which means it can be matched before the real name, hence: Style $[w.visiblename] Colorset 5 is now honoured. Useful with IndexedWindowName as a style option. - New style InitialMapCommand allows to execute any command when a window is mapped first. - New option to PrintInfo, "bindings" which prints out all of the Key, PointerKey, Mouse and Stroke bindings which fvwm knows about. * Bug fixes: - Fixed compilation without XRender support. - Fixed handling of _NET_MOVERESIZE_WINDOWS requests. - Fixed a bug in automatic detection mode of the style MoveByProgramMethod. - Fixed png detection when cross compiling. - Fixed keeping fullscreen window mode over a restart. - The style PositionPlacement now honours StartsOnPage. - Reset signal handlers for executed modules and programs. - Try to handle a bug an old version of the EWMH spec by honouring both, the _NET_WM_STATE_MAXIMIZED_HORIZ hint and the _NET_WM_STATE_MAXIMIZED_HORZ hitn. - Fix the GNOME location prefix to application .desktop files. - 'PositionPlacement UnderMouse' now forces the window on-screen, just like the old UnderMousePlacement style option used to. ------------------------------------------------------------------- Changes in beta release 2.5.26 (7-May-2008) * New features: - New MenuStyle option VerticalMargins. * New module features: - FvwmButtons: New button alignment option: top. * Bug fixes: - Fixed crash in ARGB visual detection code. - Fixed compilation without XRender support. - Fixed drawing of background pictures in menu items and titles. - Fixed handling of shaped windows. - Fixed a 64-bit bug in the EWMH code. ------------------------------------------------------------------- Changes in beta release 2.5.25 (26-Feb-2008) * New features: - Handle the STATE_ADD command of the EWMH _NET_WM_STATE message from version 1.3 of the EWMH spec. - Support transparency in ARGB windows * Bug Fixes: - Fixed problem with windows disappearing when created unless the style Unmanaged was used. - Edge move delay was used as resistance for the top edge. - Fixed a parsing problem of the screen argument of the SnapAttraction style. - Some html documentation files were not installed. - Fixed a memory leak in internationalized font handling. - Fixed a bug in MinOverlap placement. - Fixed the StickyAcrossPages style in the FvwmPager. - Fixed the determination of the X charset on UTF-8 systems. - Fixed a crash when certain EWMH messages were sent to unmanaged windows. - Fixed a memory leak in multibyte codepage code. - Ignore the EWMH staysontop and staysonbottom hints if the EWMHIgnoreStackingOrderHints style is used. - Fixed a sporadic crash when the root background set by gnome, fvwm-root, esetroot etc. changes and a root transparent colour set is used. - Fixed spradic crash in modules with root transparent background from colour sets. - Fixed a possible crash if the last active module fails. ------------------------------------------------------------------- Changes in beta release 2.5.24 (24-Nov-2007) * New features: - Disabled paging during interactive resize operations by default (see 2.5.20) as it is annoying to many people. - New style command options: EdgeMoveResistance EdgeMoveDelay EdgeResizeDelay SnapGrid SnapAttraction that replace the now obsolete commands EdgeResistance, SnapGrid and SnapAttraction. The EdgeResistance command has a new syntax with only one argument. - New command MenuCloseAndExec for menu bindinngs that can be used to trigger certain commands from a menu without an associated item. For example, with Key F1 MTI[]-_ A MenuCloseAndExec Menu RootMenu the RootMenu can be opened from any other menu by pressing F1. * Bug Fixes: - Sometimes a window jumped by half the screen's size when moving with the mouse and hitting the border of the desktop. - Fixed the "screen w" argument of the Move and other commands. - Clicking on a menu title did not close the menu by default. - Temporary files in FvwmPerl overwrote each other. ------------------------------------------------------------------- Changes in beta release 2.5.23 (1-Sep-2007) * New features: - New Style command options: StartShaded * Bug Fixes: - Fixed FvwmButton's button placement algorithm broken in 2.5.22. ------------------------------------------------------------------- Changes in beta release 2.5.22 (29-Aug-2007) * New features: - New Style command options: UnderMousePlacementHonorsStartsOnPage UnderMousePlacementIgnoresStartsOnPage !MinOverlapPlacementPenalties !MinOverlapPercentPlacementPenalties MinWindowSize - SVG (scalable vector graphics) image loading support. - New extended variables $[w.iconfile.svgopts] $[w.miniiconfile.svgopts]. - Added suffix 'w' to the arguments of the Move command and similar. It is now possible to add multiple shifts to a window position, e.g. "50-50w 50-50w" for the center of the screen. - Removed UnderMousePlacement and CenterPlacement. Use "PositionPlacement Center" and "PositionPlacement UnderMouse" instead. - Documentation in HTML format. - Replaced "UseListSkip" with "UseSkipList" & "OnlyListSkip" with "OnlySkipList" in WindowList command. (Old options deprecated.) - New subject ImageCache for PrintInfo command. - The new commad EchoFuncDefinition prints a function's definition to the console for debugging purposes. - The CursorStyle command can now load PNG and SVG images as mouse cursors. New x and y arguments to specify the hot spot. Also, it is now possible to load non-monochrome cursors and cursors with partial transparency. * New module features: - FvwmScript: New instructions: ChangeWindowTitle and ChangeWindowTitleFromArg. * Bug Fixes: - Windows with aspect ratio no longer maximize past the screen edges. - Fixed CenterPlacement with Xinerama screens. - Fixed CascadePlacement with title direction west and east - Windows no longer unstick when going to fullscreen mode. - Fixed crash when raising/lowering a destroyed window. - Fixed expansion of $[n-] and $[*], broken in 2.5.20. - Fixes for resizing shaded windows and windows with a gravity other than northwest. - Fixed CursorStyle POSITION, broken since 2.3.24. - The hi, sh and fgsh colors in colorsets are no longer replaced by computed values if not explicit set on the same line as the bg, or for fgsh fg, changes. (bug #3359) - FvwmButtons now redraws stretched button backgrounds correctly on partial expose. - Windows with circular transient for hints may no longer crash fvwm with StackTransientParent style. - FvwmPager now displays windows that are StickyAcrossPages correctly. - Fixed a possible crash with modules closing down. - Fixed broken demo script fvwm_make_browse_menu.sh. - The conditon following a comma separator without whitespace padding was previously ignored if the presiding condition was multi-worded. - Various FvwmButtons drawing problems. - Window movement or resizing triggered by an EWMH message now honours the FixedSize and FixedPosition window styles. - Properly generate leave_window and enter_window events for the root window in FvwmEvent. - Fixed crash in UTF8 code. - Fixed parsing of the PropertyChange command. - Fixed windowlist crash when combining CurrentAtEnd with IconifiedAtEnd and all windows are iconified. ------------------------------------------------------------------- Changes in beta release 2.5.21 (20-Jan-2007) * New features: - The command Scroll can now be used for interactive scrolling. * Bug Fixes: - Fixed Tile...Placement styles (SmartPlacement) that were broken in 2.5.20. ------------------------------------------------------------------- Changes in beta release 2.5.20 (15-Jan-2007) * New features: - New Style options: StippledIconTitle, !StickyStippledTitle, and !StickyStippledIconTitle. - Full support for menu context (M) key and mouse bindings. See the section Menu Bindings in the man page for details. - Hilighted menu backgrounds now use pixmaps gradients and transparency from their related colorset. - New window conditions: StickyIcon, StickyAcrossPagesIcon and StickyAcrossDesksIcon. * Changed features: - "Mouse n M N" is no longer used to disable or remap the builtin tear off menu button. See the section Tear Off Menus for details on replacement commands. * Bug Fixes: - FvwmWinList: fix problem with window name/button mixups during Init/Restart of fvwm. (bug #1393) - It is now possible to switch the viewport while resizing windows if "EdgeScroll 0 0" is set. - Fixed disappearing windows when aborting interactive resizing of maximized windows when unmaximizing them later. - Fixed disappearing windows when moving maximized windows and unmaximizing them later. - Fixed calculation of final location with MoveToPage and MoveToScreen with windows to the left or top of the viewport. - 64-bit architecture fix in FvwmProxy. - FvwmForm now work with balanced quoted command for Timeout. - FvwmPager correctly updates on window desk change. - FvwmIconBox: fixed problem with IconColorset's background color change not being applied immediately. - Allow FvwmConsole to run a terminal via rxvtc or urxvtc. FvwmConsole dies if no client connects within one minute. - Expansion of variables in FvwmTaskBar launch button commands fixed. - Fixed a race condition with applications raising their own transient windows in certain ways. (Apple Shake, kphotoalbum) - FvwmIdent reports the correct geometry if the window has its title at the left or right side. - Fixed an infinite loop when deiconifying windows in a group via a different window than the initially iconified. ------------------------------------------------------------------- Changes in beta release 2.5.19 (9-Dec-2006) * Bug Fixes: - FvwmCommand now reports "end windowlist" and "end configinfo". - FvwmCommand now prints config info split on lines. - FvwmTaskBar no longer gets lost with trailing whitespace after geometry specification. - Fixed a window size problem if the aspect ratio is set (e.g. mplayer). - Decorations now update when unmanaged windows take focus, and not FlickeringQtDialogsWorkaround is enabled. - FvwmPager again allows movement of windows added before a page change. - fvwm no longer crashes on 1 and 4 bit displays. (#1677) - EWMH desktops now correctly handles FPClickToFocus. (#1492) - Security fix in fvwm-menu-directory. (CVE-2006-5969) ------------------------------------------------------------------- Changes in beta release 2.5.18 (11-Sep-2006) * Bug Fixes: - If a window started fullscreen, leaving fullscreen state now properly unmaximizes and resizes the window. - Fixed the ForeColor/HilightFore styles that were broken in 2.5.17. - FvwmPager can now move icons with the !IconTitle style. - Fixed drawing of icons that are moved to a different desk. - FvwmPager no longer tries to move non-movable windows. - FvwmPager now moves all windows as user requests. - FvwmPager no longer displaces windows with title and border sizes on moves. - TestRc now correctly matches Break, and $[cond.rc] is expanded for Break. - Fixed several 64-bit architecture problems with XGetWindowProperty(). Xine works much better on 64-bit machines. - Fixed handling of ClickToFocusPassesClick with the EWMH desktop (e.g. using nautilus). - Fixed handling of windows that are unmapped and mapped again too fast (e.g. fpga_editor). ------------------------------------------------------------------- Changes in beta release 2.5.17 (19-Jul-2006) * New features: - New MenuStyle options TitleFont, TitleColorset and HilightTitleBack. - New command PressButton in module FvwmButtons for being able to emulate button press via other means than the mouse. - New wrap options to EdgeScroll command for wrapping with pixel distances. - New Style option UnderMousePlacement. - Unused arguments to Style options generate warnings. - The name style names match against can be augmented by the X-resource "fvwmstyle". - New options, Reverse and UseStack, to All command. - WindowShade can now reshade windows using the Last direction. - Positional parameters to complex functions can now be expanded using $[n], $[n-m], $[n-] and $[*] expressions. - The width and height arguments of the Resize command now accept the prefix 'w' to allow resizing relative to the current window size. - New command ModuleListenOnly. - New "Periodic" option added to Schedule command. * Bug Fixes: - Fixed detection of running non-ICCCM2 wm (bug #3151). - Fixed drawing of menus with the sidepic on the right. - EdgeScroll no longer divides pixel distances >1000 by 1000. (bug #3162) - The configure script can now cope with four-part version numbers when detecting some libraries. - The WarpToWindow command followed by Move in a complex function now uses the correct pointer position. - The menu style TitleWarp does no longer warp the pointer for root menus (as it is documented). - Fixed detection of safe system version of mkstemp. - Fixed the conditions Iconifiable, Fixed, FixedSize, Maximizable and Closable. - Fixed problem with window outline and placement position running out of sync. - FvwmConsole no longer conflicts with Cygwin stdio (bug #3772). - FvwmGtk now configures correctly on Cygwin (bug #3772). - Fixed tempfile vulnerabilities in FvwmCommand. ------------------------------------------------------------------- Changes in beta release 2.5.16 (20-Jan-2006) * New features: - If the pointer can not be grabbed in functions, a message is printed to the console instead of beeping. * Bug Fixes: - Fixed a couple of build problems introduced in 2.5.15. ------------------------------------------------------------------- Changes in beta release 2.5.15 (14-Jan-2006) * New features: - Variables can be nested, like $[desk.name$[desk.n]]. - Obsolete one-letter variables work, but generate warnings now. - Windows can be placed by any button (now also >3). - It is now possible to redefine the buttons usable to finish window movement and manual placement. - New window condition PlacedByButton. - MenuStyle pairs can be negated by prefixing '!'. - New generic tabbing module - FvwmTabs. - New Style option: EWMHIgnoreWindowType. - New MenuStyle options: MouseWheel, ScrollOffPage and TrianglesUseFore. - To compile from CVS, autoconf-2.53 or above is now required. This does not affect compiling the released tarballs. - New option "screen" to Move and ResizeMove commands to allow specifying the target Xinerama screen. * Bug Fixes: - Supported a new fribidi version 0.10.5 in addition to 0.10.4. - Better look for windows with "BorderStyle TiledPixmap". - Some EWMH-related 64-bit fixes. - Fixed segmentation fault when replacing title of title only menus (Bug #1121). - Fixes for resizing of shaded windows and resizing/moving windows with complex functions. ------------------------------------------------------------------- Changes in beta release 2.5.14 (24-Aug-2005) * New features: - Fvwm now officially supports 64-bit architectures. - New Test conditions EnvIsSet, EnvMatch, EdgeHasPointer and EdgeIsActive. - New window condition FixedPosition. * New module features: - FvwmPerl module supports window context when preprocessing. - FvwmPerl module accepts new --export option that by default defines two fvwm functions "Eval" and ".", to be used like: FvwmPerl -x Eval $a = $[desk.n] - 2; cmd("GotoDesk 0 $a") if $a >= 0 . Exec xmessage %{2 + cos(0)}% # embedded calculator - New FvwmProxy option ProxyIconified. - New FvwmTaskBar option Pad to control the gap between buttons. * Bug Fixes: - Fixed a Solaris compiler error introduced in 2.5.13. - Fixed a hang with layers set by applications (e.g. AbiWord). - GotoDesk with a relative page argument now wraps around at the end of the given range as documented. (Bug #1396). - PopupDelayed menu style option was not copied on CopyMenuStyle. - Transparent Animated menus with non-transparent popup were not animated correctly. - Supported euc-jp class of encodings. - A window's default layer is no longer set to 0 during a restart. - Fixed an annoying MouseFocus/SloppyFocus problem in conjunction with EdgeResistance + EdgeScroll (sometimes a window did not get the focus as it should have). This problem first occured in 2.5.11. ------------------------------------------------------------------- Changes in beta release 2.5.13 (16-Jul-2005) * Bug Fixes: - The MoveToPage command did not work without arguments in 2.5.11 and 2.5.12. - Mouse/Key command no args possible core dump. - Direction with no args possible core dump. - FvwmScript periodic tasks run too often. - Perl modules did not work on 64 machines. - FvwmDebug did not report any extended messages. - fvwm-menu-desktop supports mandriva. - fvwm-menu-desktop when verifying executable, allow full path. * New module features: - FvwmIconMan: MaxButtonWidth and MaxButtonWidthByColumns options. - FvwmIconMan: added tool tips with Tips, TipsDelays, TipsFont, TipsColorset, TipsFormat, TipsBorderWidth, TipsPlacement, TipsJustification and TipsOffsets options. - FvwmButtons: PressColorset & ActiveColorset options for _individual_ buttons. ------------------------------------------------------------------- Changes in alpha release 2.5.12 (6-Oct-2004) * New commands: - EdgeLeaveCommand * New module features: - FvwmIconMan: ShowOnlyFocused option. ------------------------------------------------------------------- Changes in alpha release 2.5.11 (30-Sep-2004) * Multiple window names can be specified in conditions. * Window-specific key/mouse bindings. (Bindings no longer have to be global.) * The default fvwm configuration files are now: ~/.fvwm/config and $FVWM_DATADIR/config. Five previously used config file locations are still searched as usual for backward compatibility. * New extended variables $[w.desk] and $[w.layer]. * New options GrowOnWindowLayer and GrowOnlayers to the Maximize command. * New Style option "State". * New Style option "CenterPlacement". * New option to FvwmIconMan: ShowNoIcons. * New WindowList tracker and other enhancements in Perl library. * New option to fvwm-menu-directory: --func-name. * Improved FvwmWindowMenu module. * Fluxbox-like Alt-Button3 resizing with the new Resize options Direction, WarpToBorder and FixedDirection * Enhanced "Test (Version >= x.y.z)" option to allow version comparisons. * New FvwmButtons options: ActiveColorset, ActiveIcon, ActiveTitle, PressColorset, PressIcon and PressTitle. * New FvwmButtons swallow option: SwallowNew. * The option CurrentGlobalPageAnyDesk was accidentally named CurrentGlobbalPageAnyDesk before. * New conditions AnyScreen and Overlapped. * The Read and PipeRead commands return 1 if the file or command could be read or executed and -1 otherwise. * New menu option TearOffImmediately. * Added support for Solaris' Xinerama. * New option MailDir in FvwmTaskBar. * MoveToPage command: New options wrapx, wrapy, nodesklimitx and nodesklimity. New suffix 'w' to allow for window relative movement. ------------------------------------------------------------------- Changes in alpha release 2.5.10 (19-Mar-2004) * New command FakeKeyPress. * New BugOpts option ExplainWindowPlacement. * Adjustable button reliefs in FvwmIconMan (option ReliefThickness). * Security patch in fvwm-bug. See http://securitytracker.com/alerts/2004/Jan/1008781.html * Security fixes in: fvwm-menu-directory (BugTraq id 9161) fvwm_make_directory_menu.sh fvwm_make_browse_menu.sh ------------------------------------------------------------------- Changes in alpha release 2.5.9 (2-Mar-2004) * New MenuStyle options PopupIgnore and PopupClose. * New configure option --disable-iconv to disable iconv support. * New extended variables $[w.iconfile] and $[w.miniiconfile]. * New Style option Unmanaged. Such windows are not managed by fvwm. * New binding context 'U' for unmanaged windows, similar to 'R'oot. * New option DisplayNewWindowNames to the BugOpts command. * Security fix for fvwm-menu-directory. See BugTraq id 9161. ------------------------------------------------------------------- Changes in development release 2.5.8 (31-Oct-2003) * New prefix command KeepRc. * Renamed the Cond command to TestRc, and the On command to Test. Removed the CondCase command. Use "KeepRc TestRc" instead. * The Break command can be told the number of nested function levels to break out of. Break now has a return code of -2 ("Break"). * Directions can be abbreviated with -, _, [, ], <, >, v or ^ like in key or mouse bindings. * New extended variable $[func.context]. * New Style option MoveByProgramMethod. Tries to autodetect whether application windows are moved honouring the ICCCM or not (default). The method can be overridden manually if the detection does not work. * fvwm supports tear off menus. See the "Tear Off Menus" section in the man page or press Backspace on any menu to try them out. * fvwm now handles what Unicode calls "combining characters" (i.e. marks drawn on top of other characters). * New commands WindowStyle and DestroyWindowStyle for individual (per window) styles. * The conditions !Current... and !Layer now work as expected. * Added a nice autohide script to the FAQ. * FvwmAnimate now supports dynamical commands "pause", "play", "push", "pop" and "reset" to manipulate the playing state. ------------------------------------------------------------------- Changes in development release 2.5.7 (30-May-2003) * The commands Cond and CondCase now support checking for inequality by prefixing the return code with '!'. * Schedule and Deschedule support hexadecimal and octal command ids. * In FvwmIconMan, windows can move from one manager to another according to the managers' Resolution options. * In order to fix a problem with StartsOnScreen and applications that set a user specified position hint, the StartsOnScreen style no longer works for the following modules: FvwmBanner, FvwmButtons, FvwmDragWell, FvwmIconBox, FvwmIconMan, FvwmIdent, FvwmPager, FvwmScroll, FvwmTaskBar, FvwmWharf, FvwmWinList. Use the '@' bit in the module geometry specification where applicable. * Documented variable $[gt.any_string] and LocalePath command (new in 2.5.5). * Added gettext support to FvwmScript. New head instruction UseGettext and WindowLocaleTitle. New widget instruction LocaleTitle. New instruction ChangeLocaleTitle and new function Gettext. * WindowListFunc is executed now within a window context, so a prefix "WindowId $0" is not needed in its definition anymore, and it is advised to remove it in user configs. * FvwmEvent now executes all window related events within a window context, so PassId is not needed anymore, and all prefixes "WindowId $0" may be removed in user event handlers. * New FvwmTaskBar option NoDefaultStartButton. ------------------------------------------------------------------- Changes in development release 2.5.6 (28-Feb-2003) * Fix button 3 drag in FvwmPager so that drag follows the mouse. * Fix for gmplayer launched by fvwm. Close stdin on Exec so the exec'd process knows it's not running interactively. * Improvement in MultiPixmap. In particular Colorset and Solid color can be specified. * New ButtonStyle and TitleStyle style options AdjustedPixmap, StretchedPixmap and ShrunkPixmap. * Use the MIT Shared Memory Extension for XImage. * The TitleStyle decor of a vertical window Title is rotated. This is controllable using a new style option: !UseTitleDecorRotation / UseTitleDecorRotation * New style options IconBackgroundColorset, IconTitleColorset, HilightIconTitleColorset, IconTitleRelief, IconBackgroundRelief and IconBackgroundPadding. * Minor incompatible improvements to the Perl library API. * Renamed FvwmWindowLister to FvwmWindowMenu. * New option to IconSize style: Adjusted, Stretched, Shrunk. * New shortcuts for button states: AllActiveUp, AllActiveDown, AllInactiveUp, AllInactiveDown. * New Style options: Closable, Iconifiable, Maximizable, AllowMaximizeFixedSize * New conditions for matching windows: Closable, Iconifiable, Maximizable, FixedSize and HasHandles * New conditional command On for non-window related conditions. * Removed --disable-gnome-hints and --disable-ewmh configure options. * All single letter variables are deprecated now; new variables: $[w.id], $[w.name], $[w.iconname], $[w.class], $[w.resource], $[desk.n], $[version.num], $[version.info], $[version.line], $[desk.pagesx], $[desk.pagesy] ------------------------------------------------------------------- Changes in development release 2.5.5 (2-Dec-2002) * Added support for joining and shaping in bi-directional languages that need this. * ButtonStyle and TitleStyle new style type Colorset. * New experimental module FvwmProxy. * New command RestackTransients. * Added a pixel offset to vector button definitions. * New command FocusStyle as a shorthand for setting the FP... styles with the Style command. * New option Locale to PrintInfo command. * The Next and Prev commands start looking for a matching window at the context window if there is any. * The MoveToPage command does nothing with sticky windows. * New module FvwmWindowLister, a WindowList substitute. * Sticky windows can be sticky across pages, across desks or both. Related to this are: - New commands StickAcrossPages and StickAcrossDesks. - New Style options StickyAcrossPages and StickyAcrossDesks. - New conditional command options StickyAcrossPages and StickyAcrossDesks. - New WindowList options NoStickyAcrossPages, NoStickyAcrossDesks, StickyAcrossPages, StickyAcrossDesks, OnlyStickyAcrossPages, OnlyStickyAcrossDesks. - New FvwmRearrange options -sp and -sd. * Fixed flickering in FvwmTaskBar, FvwmWinList, FvwmIconBox, FvwmForm, FvwmScript and FvwmScroll when xft fonts or icons with an alpha channel are used. * New Colorset option RootTransparent * The Transparent Colorset option can be tinted under certain conditions * New MinHeight option to TitleStyle * Added gettext support. New command LocalePath and new variable $[gt.string] ------------------------------------------------------------------- Changes in alpha release 2.5.4 (20-Oct-2002) * FvwmTaskBar may now include mini launch buttons using the Button command. Also has new options for spacing the buttons: WindowButtonsLeftMargin, WindowButtonsRightMargin, and StartButtonRightMargin. See man page for details. * Style switches can be prefixed with '!' to inverse their meaning. For example, "Style * Sticky" is the same as "Style * !Slippery". This works *only* for pairs of styles that take no arguments and for the Button and NoButton styles. * New button property Id in FvwmButtons. FvwmButtons now accepts dynamical actions using SendToModule, see the man page: ChangeButton ExpandButtonVars * New Colorset options bgTint, fgTint (which complete Tint), Alpha, IconTint and IconAlpha. * Alpha blending rendering is supported even without XRender support. * Enhanced commands [Add]ButtonStyle, [Add]TitleStyle. ButtonState. Titles and buttons now have 4 main states instead of 3: ActiveUp, ActiveDown, InactiveUp and InactiveDown, plus 4 Toggled variants. Several shortcuts added: Active means ActiveUp + ActiveDown, Inactive means InactiveUp + InactiveDown, similarly for shortcuts ToggledActive and ToggledInactive. * More shortcuts for button states added: AllNormal, AllToggled, AllActive, AllInactive, AllUp, AllDown. These six shortcuts are actually different masks for 4 individual states (from 8 total). * FPClickToFocus and FPClickToRaise work with any modifier by default. * Perl library API regarding event handlers is changed, so personal modules in Perl should be adjusted. * Allow the use of mouse buttons other than the first in FvwmWinList when invoked transient. * ImagePath now supports directories in form "/some/directory;.png" (where semicolon delimits a file extension that files in /some/directory have. This file extension replaces the original image extension (if any) or it is added if there is no extension. For example with: Style XTerm MiniIcon mini/xterm.xpm the file /some/directory/mini/xterm.png is searched. * New graphical debugger module FvwmGtkDebug. * New command NoWindow for removing the window context. * New FvwmIconMan option ShowTransient. * All conditions have a negation. * New FvwmBacker option RetainPixmap. * Fixed flickering in menus, icon title, FvwmButtons, FvwmIconMan and FvwmPager when xft fonts or icons with an alpha channel is used. * FvwmButtons redrawing improvement: colorsets are now usable with containers. * FvwmIconMan options PlainColorset, IconColorset, FocusColorset and SelectColorset are now strictly respected. * The HilightBack and ActiveFore menu styles are independent of each other. HilightBack without using ActiveFore does no longer hilight the item text. * New WindowList option SortByResource; the previously added SortClassName option is renamed to SortByClass. * New command PrintInfo for debugging. ------------------------------------------------------------------- Changes in alpha release 2.5.3 (25-Aug-2002) * TitleStyle MultiPixmap now works once again. * Removed the old module interface for ConfigureWindow packets. External modules relying on this interface no longer work. * Fixed interaction bug between CascadePlacement and StartsOnPage: if the target page was at a negative x or y page displacement from the current viewport, the window would be placed on the wrong page. * New Style option IconSize for restricting icon sizes. * New WindowList options SortClassName, MaxLabelWidth, NoLayer, ShowScreen, ShowPage, ShowPageX and ShowPageY. * Restored old way of handling clicks in windows with ClickToFocus and ClickToFocusPassesClickOff. This fixes a problem with click+drag in an unfocused rxvt or aterm window. * Fixed wrong warp coordinates when WarpToWindow was used with two arguments on an unmanaged window. * Vastly improved FvwmEvent performance. * FvwmAuto can operate on Enter and Leave events too. This makes it possible to have auto raising with ClickToFocus and NeverFocus. See -menter and -menterleave options and examples in the FvwmAuto man page. * The "hangon" strings in FvwmButtons support wild cards. * New option "Icon" to PlaceAgain command. * New option "FromPointer" and direction "Center" to the Direction command. * The styles ClickToFocusRaises(Off) and MouseFocusClickRaises(Off) are now different names for the same style. Configurations that used Style * ClickToFocus, ClickToFocusRaises Style * MouseFocusClickRaisesOff or vice versa no longer work as like before. Remove the second line to fix the problem. ClickToFocusRaises now works only on the client part of a window, not on the decorations as it did before. * New color limit method for screens that only display 256 colors (or less). * In depth less or equal to 16 image and gradient can be dithered. This can be enabled/disabled by using the new dither/nodither options to the Colorset command. * Removed the styles MouseFocusClickIgnoreMotion and MouseFocusClickIgnoreMotionOff again. * Many new focus policy styles "FP..." and "!FP...". ------------------------------------------------------------------- Changes in alpha release 2.5.2 (24-Jun-2002) * Fonts can have shadow effects, see the FONT SHADOW EFFECTS section of fvwm manual page. * New Colorset options: fgsh for shadow text and fg_alpha for merging text with the background. * New module FvwmPerl adds perl scripting ability to fvwm commands. * Provided powerful perl library for creating fvwm modules in perl. * New WindowList option IconifiedtAtEnd. * Always display the current desk number in the FvwmPager window title. * Allow to bind a function to the focus click and pass it to the application at the same time. * New styles !Borders and Borders to enable or disable window borders. * Removed the --enable-multibyte configure option. Multibyte support is now compiled in unconditionally. * New FvwmButtons option ActionOnPress enables execution of action on press rather than on release for any specific button. * Improved CascadePlacement, the last used position is reused if the last placed window does not exist any more. * FvwmIconMan may now change the resolution dynamically, just issue "*FvwmIconMan: resolution page" while FvwmIconMan is running. * New command XineramaSlsScreens. * MoveToPage and MoveToDesk no longer unstick windows. * It is possible to specify a string encoding in a font name, see the "FONT AND STRING ENCODINGS" section of fvwm manual page. ------------------------------------------------------------------- Changes in alpha release 2.5.1 (26-Apr-2002) * Changed the executable and the man page names from fvwm2 to fvwm. The old names are still supported by symlinking. * All fvwm utilities are renamed to conform to the "fvwm-" scheme. fvwm-bug, fvwm-root (was xpmroot), fvwm-config, fvwm-convert-2.4. * Added a full support for the side window titles. New Style options TitleAtLeft and TitleAtRight added to TitleAtTop and TitleAtBottom. * A title text may now be optionally rotated for both vertical and horizontal title directions, search for "Rotated" in the man page. * Added support for loading images in PNG (including alpha blending) and XBM formats anywhere. * New commands Schedule and Deschedule. * New command State. New conditions State and !State. * New commands XSync and XSynchronize for debugging purposes. * In interactive move/placement when Alt/Meta modifier is pressed, snap attraction (SnapAttraction, SnapGrid and EdgeResistance) is ignored. * New flags (No)FvwmModule to FvwmButtons Swallow option * The I18N_MB patch (--enable-multibyte) has been rewritten. MULTIBYTE is used to identify what is was I18N_MB. A set of locale functions (locale initialization, font loading, text drawing, ...etc.) is created in libs/Flocale.{c,h} and used in the entire fvwm code (but FvwmWharf). Font loading and memory management is improved in the multibyte case. * Better support of non ISO-8859-1 window and icon titles. See the --disable-compound-text option in INSTALL.fvwm for more details. * Added anti-aliased text rendering support using Xft (use --enable-xft to enable it). Recent versions of XFree and freetype2 are needed (see the FONT NAMES AND FONT LOADING section of the fvwm manual page). * Conditional commands now have a return code (Match, NoMatch or Error). This return code can be checked and tied to an action with the new commands Cond and CondCase. * Bindings can be made to the separate parts of the window border with the new contexts '[', ']', '-', '_', '<', '^', '>' and 'v'. * New parameters for FvwmRearange: -maximize and -animate. * New option StartCommand for FvwmTaskBar to allow placing the StartMenu correctly. *FvwmTaskBar: StartCommand Popup RootMenu \ rectangle $widthx$height+$left+$top 0 -100m Please refer to the FvwmTaskBar man page for details. * New extended variables pointer.x, pointer.y, pointer.wx, pointer.wy, pointer.cx and pointer.cy. * The Current command does not select a random window when no window has the focus. * New color '@4' (transparent) in button vectors. * New option "Frame" for the Resize and ResizeMove commands. * Added direction options to WindowShade command. Windows can be shaded in any of the eight compass directions. * Styles WindowShadeLazy (default), WindowShadeBusy and WindowShadeAlwaysLazy to optimize performance of the WindowShade command. * The DO_START_ICONIC flag is no longer supported in the module interface. * Added bi-directional text support for Asian charsets. * New option MinimalLayer for FvwmIdent to control window layer. * New FvwmIconMan configuration syntax now conforms to the syntax of other modules, see the man page. * FvwmForm can automatically run commands after a timeout interval. * Fvwm commands can be invoked when the edge of the screen is hit with the mouse. * New commands Colorset, ReadWriteColors and CleanupColorsets allow the colorset functionality previously available using FvwmTheme. * FvwmTheme is obsolete now, but still supported for some time. * New options Tint, TintMask and NoTint to colorsets. * New WindowList option CurrentAtEnd. * New weighted sorting in FvwmIconMan. * New conditional command ThisWindow. ------------------------------------------------------------------- Changes in alpha release 2.5.0 (27-Jan-2002) * New commands ResizeMaximize and ResizeMoveMaximize that modify the maximized geometry of windows and maximize them as necessary. Very useful to make a window larger manually and then get back the old geometry with a click. * New command ResizeMoveMaximize similarly. * New styles FixedPPosition, FixedUSPosition, FixedSize, FixedUSSize, FixedPSize, VariablePPosition, VariableUSPosition, VariableSize, VariableUSSize, and VariablePSize. * Actions can be bound to windows swallowed in FvwmButtons. To disable this feature for a specific button, the new option ActionIgnoresClientWindow can be used. * Fvwm respect the extended window manager hints specification. This allows fvwm to work with KDE version >= 2 and GNOME version 2. This support is configurable using a bunch of new commands and style options, search for "EWMH" in the man page. * New DateFormat option in FvwmTaskBar to change the date format in the clock's popup tip. * Window titlebars may now be designed using a new powerful TitleStyle option MultiPixmap, that enables to specify separate pixmaps for different parts of the titlebar: Main, LeftEnd, LeftOfText, UnderText, RightOfText, RightEnd and more. * New styles MinOverlapPlacementPenalties and MinOverlapPercentPlacementPenalties. * New styles IndexedWindowName / ExactWindowName and IndexedIconName / ExactIconName. * New command "DesktopName desk name" to define the name of a desktop for the FvwmPager, the WindowList and EWMH compliant pagers. New expanding variables $[desk.name] for the desktop names. * New window list options NoDeskNum, NoCurrentDeskTitle, TitleForAllDesks, NoNumInDeskTitle. * New emacs style bindings in menus. * New Maximize global flag "layer" which causes the various grow methods to ignore the windows with a layer less than or equal to the layer on the window which is maximized. * Better support of the Transparent colorset in the modules and in animated menus. * Amelioration of the WindowShade animation. * New ButtonStyle and TitleStyle option MwmDecorLayer. * New style BackingStoreWindowDefault which is the default now. Fvwm no longer disables backing store on windows by default. * New styles MouseFocusClickIgnoreMotion and MouseFocusClickIgnoreMotionOff. * The module interface now supports up to 62 message types. * New module messages MX_ENTER_WINDOW and MX_LEAVE_WINDOW. * New events "enter_window" and "leave_window" in FvwmEvent. * New MenuStyle PopupActiveArea. * New command line option -passid to FvwmAuto. * New conditional commands Any and PointerWindow. * New conditions Focused, !Focused, HasPointer and !HasPointer. * New commands EWMHBaseStruts and EWMHNumberOfDesktops. ------------------------------------------------------------------- Changes in stable release 2.4.20 (6-Dec-2006) * The configure script now correctly appends executable file extensions to conditionally built binaries. Fixes building on Cygwin. * FvwmConsole no longer conflicts with getline of Cygwin's stdio. * Fixed parsing of For loops in FvwmScript. * Fixed a possible endless loop when de-iconifying a transient window. * Reject some invalid GNOME hints. * Fixed a loop when xterm changes its "active icon" size. * The configure script can now cope with four-part version numbers when detecting some libraries. * Security fixes in fvwm-menu-directory. (CVE-2006-5969) FvwmCommand ------------------------------------------------------------------- Changes in stable release 2.4.19 (30-Sep-2004) * Fixed BackingStore style option. * Fixed MoveToDesk commend with a single argument. * Allow whitespace in menu names. * Fixed a hang when restarting FvwmCommand or FvwmConsole. * A double click no longer occurs when two different mouse buttons are pressed. * Fixed a relief drawing problem in FvwmWinList. * Fixed travelling windows on restart if a window used non NorthWest gravity and changed that before the restart. * Fixed installation of FvwmGtk.1 for debian (with DESTDIR set). * The clock in FvwmTaskBar is redrawn immediately when its colour changes. * The option CurrentGlobalPageAnyDesk was accidentally named CurrentGlobbalPageAnyDesk before. * Fixed a problem with fvwm startup and shutdown when the pointer was grabbed by another application. * Fixed parsing of the Pointer option to the Move command. * Fixed handling of MWM hints on 64 bit machines. ------------------------------------------------------------------- Changes in stable release 2.4.18 (19-Mar-2004) * Corrected rebooting the machine in FvwmScript-Quit. * Fixed the FlickeringMoveWorkaround option to the BugOpts command. * Security patch in fvwmbug.sh. See http://securitytracker.com/alerts/2004/Jan/1008781.html * Security fixes in fvwm-menu-directory (BugTraq id 9161) fvwm_make_directory_menu.sh fvwm_make_browse_menu.sh ------------------------------------------------------------------- Changes in stable release 2.4.17 (10-Oct-2003) * Fixed error message for incorrect --with-SOME-library argument. * It is now possible to suppress title action or title completely in menus created by fvwm-menu-directory. * Fixed a compile problem on QNX 4.25. * New configure switch --disable-gtk. * FvwmGtk.1 is not installed if FvwmGtk is not built. * The "Visible" condition does no longer select windows on different desks. * With the styles StartsOnPage, SkipMapping and UsePPosition, windows that request a specific position are still placed on the given page. * Fixed sending M_NEW_PAGE packets to the modules if the page did not change. * Added support for new BBC headlines in fvwm-menu-headlines, this replaces the old BBC-Worlds and BBC-SciTech headlines. ------------------------------------------------------------------- Changes in stable release 2.4.16 (30-May-2003) * Fixed a transparency problem in FvwmButtons. * The PageOnly option in FvwmTaskBar now works after a desk change too. * Fixed a possible core dump when more than 256 windows are on the desktop. * Initial drawing and final undrawing of wire frame no longer toggles the pixel in the top left corner of the screen. * Fixed parsing of button geometries in FvwmButtons when the geometry specification appeared after another option with a comma at the end. * FvwmCommand works too when invoked without the DISPLAY variable set. * Fixed displaying iconified windows without an icon in FvwmIconMan. * All single letter variables are deprecated now; new variables: $[w.id], $[w.name], $[w.iconname], $[w.class], $[w.resource], $[desk.n], $[version.num], $[version.info], $[version.line], $[desk.pagesx], $[desk.pagesy] * Fixed a bug with aspect pixmaps in colorsets. * Iconified windows without an icon do not receive focus. * Fixed a bug in FvwmPager that displayed iconified windows without icon title or picture as not iconified. * Fixed parsing of '@' Xinerama specification in the ButtonGeometry option of FvwmButtons. * The NoWarp menu position hint option works with root menus too. * Fixed a problem with styles not being properly applied after a DestroyStyle command. * Fixed a bug introduced in 2.4.14. The pointer was sometimes warped to another screen during a restart and command execution. * Fixed a crash when a window was destroyed twice in a complex function. * Fixed corruption of the window list when windows died at the wrong time. * Fixed problem with empty frame windows if X recycled the window id of a window that died recently. * Fixed loading of application supplied pixmap on 8/24 depth screen. * WindowListFunc is executed now within a window context, so a prefix "WindowId $0" is not needed in its definition anymore and it is advised to remove it in user configs. * FvwmEvent now executes all window related events within a window context, so PassId is not needed anymore, and all prefixes "WindowId $0" may be removed in user event handlers. * Fixed "GotoDeskAndPage prev" on desks larger than 2x2. * Expansion of variables like $[w.name] or $[EMPTY_STRING] that are empty works. ------------------------------------------------------------------- Changes in stable release 2.4.15 (24-Jan-2003) * Fix for gmplayer launched by fvwm. Close stdin on Exec so the exec'd process knows its not running interactively. * Windows using the WindowListSkip style do not appear in the FvwmTaskBar at random. * Fixed a memory leak in ChangeIcon, ChangeForeColor and ChangeBackColor FvwmScript Instruction. * Fixed a core dump in the parsing of FvwmAuto arguments. * Fixed screwed calculation of icon picture size when application specifies it explicitly. * The option ShowOnlyIcons now works as described in the FvwmIconMan man page. It was accidentally named ShowOnlyIconic before. ------------------------------------------------------------------- Changes in stable release 2.4.14 (29-Nov-2002) * Modules do not crash anymore when more than 126 windows are on the desktop. * FvwmIconMan displays windows correctly that were iconified and then moved to another page. * Application provided icon windows no longer appear at 0 0 when restarting. * The built-in session management can handle window names, classes etc. beginning with whitespace (textedit). * Removed the flawed "A"ny context key binding patch from 2.4.13. * The default EdgeScroll (if not specified) was incorrectly assumed to be 100 pixels instead of 100 percents. * Icons no longer appear on top of all other windows after a restart. ------------------------------------------------------------------- Changes in stable release 2.4.13 (1-Nov-2002) * Icon titles for windows with an icon position hint no longer appear at random places. * Fvwm no longer displays two icon pictures when switching from NoIconOverride to IconOverride with windows that provide their own icon window. * The Current, All, Pick, ThisWindow and PointerWindow commands work on shaded windows too. * Fixed a problem stacking iconified transients. * No more flickering when raising transients. * Fixed a number of problems with window stacking, some new in 2.4.10 or later, some older problems that have been around for a long time. * Windows starting lowered or on any layer other than the default layer are displayed at the right place in FvwmPager. * Bindings with the "A"ny context can not be overridden by Gnome panel or OpenOffice. ------------------------------------------------------------------- Changes in stable release 2.4.12 (10-Oct-2002) * Fixed drawing problems with TiledPixmap and Solid MenuFaces which appeared in 2.4.10, replacing the same problem with ?Gradient MenuFaces in 2.4.9. * Fixed accidental menu animation with certain menu position hints. * Increased maximum allowed key symbol name length to 200 characters. * Allow quotes in conditional command conditions. * Fixed starting Move at random position when pointer is on a different screen. * Transient windows do not appear in FvwmWinList after they have been moved on the desktop. ------------------------------------------------------------------- Changes in stable release 2.4.11 (20-Sep-2002) * Allow the use of mouse buttons other than the first in FvwmWinList when invoked transient. * Fixed a crash with ssh-askpass introduced in 2.4.10. ------------------------------------------------------------------- Changes in stable release 2.4.10 (15-Sep-2002) * The commands Maximize, Resize and ResizeMove can be used on icons as it was in 2.2.x. * Fixed hilighting of menu items with HGradient and VGradient MenuFace. Reduced flickering with these options. * Fixed a minor problem with entering submenus via keyboard. * Fixed race conditions in FvwmTaskBar with AutoStick that caused it to hang. * Fixed drawing of pager balloons with BalloonBack option. * Fixed drawing of SidePic menu background with B/D gradients. * Fixed drawing of menu item reliefs with gradient menu faces. * Fixed key bindings on window corners. * Fixed FvwmTaskBar i18n font loading * Fixed StackTransientParent style without RaiseTransient or LowerTransient on the parent window. * StackTransientParent works only on parent window if it is on the same layer. * Fixed handling of window group hint with the (De)Iconify command. * No more flickering when a transient overlapping its parent window is lowered. * Fixed hilighting of unfocused windows. ------------------------------------------------------------------- Changes in stable release 2.4.9 (11-Aug-2002) * Fixed interaction bug between CascadePlacement and StartsOnPage - if the target page was at a negative x or y page displacement from the current viewport, the window would be placed on the wrong page. * Fixed a problem with colormap transition when a transient window died. * Fixed a FvwmScript crash with Swallow widget and very long window names. * Restored old way of handling clicks in windows with ClickToFocus and ClickToFocusPassesClickOff. This fixes a problem with click+drag in an unfocused rxvt or aterm window. * Fixed problems with $fg and $bg variables in FvwmButtons when the UseOld option was used. * Fixed wrong warp coordinates when WarpToWindow was used with two arguments on an unmanaged window. * Added a workaround for popup menus in TK applications that appear on some random position. * Fixed problems with wish scripts creating windows that start iconic. * Fixed the NoClose option with unmapped panels in FvwmButtons. * A number of drawing fixes in FvwmPager. * Fixed a slight bug when waiting until all buttons are released, for example after executing a complex function. * Fixed potentially harmful change in module interface. * Fixed displaying menu items with icons when using the MenuStyle SubmenusLeft. * Fixed problems with the pointer moving off screen in a multi head setup. * Fixed a potential crash with windows being destroyed during a recapture operation. * Fixed a memory leak in some modules when not using glibc. * Applications using Mwm hints can now enforce that a window can not be moved. * Fixed negative arguments of WarpToWindow when used on an unmanaged window. * DESTDIR may be fully used again (only useful for distributors). * Fixed a key binding problem with key symbols that are generated by several keys. * Fixed a possible crash when a window was recaptured and the focus could not be transfered to another window. * Fixed a minor problem with clicks on focused windows being ignored. * fvwm-menu-headlines: added support for CNN and BBC headlines. * Fixed a performance problem with large numbers of mouse binding commands. ------------------------------------------------------------------- Changes in stable release 2.4.8 (11-Jun-2002) * A fix for switching between czech and us keyboard layout. * Remember the icon position when an icon is moved non-interactively. * Setup "fvwm" and "fvwm-root" name symlinks for the executable and the man page when installing, see INSTALL.fvwm. * Fixed another problem with the DeskOnly option and sticky icons in FvwmTaskBar. * New FvwmIconMan configuration syntax now conforms to the syntax of other modules, see the man page. * New WindowList option CurrentAtEnd. * Fixed maximal length of a named module packet * Fixed a crash on a config with a new 2.5.x Colorset command. * Always display the current desk number in the FvwmPager window title. * Allow to bind a function to the focus click and pass it to the application at the same time. * Fixed a problem with fvwm not accepting keyboard input when the application with the focus vanished at the start of a session. * A small security patch regarding TMPDIR. * Fixed a problem with colormap transition when a transient window died. * Fixed calculation of average bg colour in colour sets with large pictures. * Fixed some minor problems regarding the multibyte patch. * Fixed selection in FvwmScript List widget. * fvwm-menu-headlines: updated the site data, added a configurable timeout on socket reading (20 sec) to avoid fvwm hanging, new --icon-error option. * Fixed a problem with ClickToFocus + ClickToFocusRaisesOff and windows that are below others. * Fixed the ClickToFocusPassesClick style. * Fixed CascadePlacement for huge windows, so that the top-left corner is always visible. * Fixed parsing of SendToModule with the first parameter quoted. * Fonts in double quotes now should work in module configurations. * Fixed copying PopupOffset values in CopyMenuStyle. ------------------------------------------------------------------- Changes in stable release 2.4.7 (11-Apr-2002) * Fixed parsing of WindowList with conditions and a position at the same time that was broken in 2.4.6. * Fixed some problems with the DeskOnly option of FvwmTaskBar (windows were duplicated when moving to a different Desk; the StickyIcon style was ignored). * Fixed config.h warnings with some compilers introduced in 2.4.6. * Fixed icon titles being raised when they should not be. * Fixed initial drawing of the internals of the FvwmPager window. * Fixed the FvwmAudio compatible mode in FvwmEvent when external audio player is used. * Fixed execution on QNX. ------------------------------------------------------------------- Changes in stable release 2.4.6 (10-Mar-2002) * Better support of non ISO-8859-1 window and icon titles. See the --disable-compound-text option in INSTALL.fvwm for more details. * Improved speed of opaque window movement/resizing. * Fixed a bug that caused windows not being raised and lowered properly. * Suppress error message when using XBM icons. * Fixed a read descriptor problem in FvwmTaskBar * Fixed a minor colour update bug in the pager. * Fixed an fvwm crash when a module died at the wrong moment; specifically a transient FvwmPager or FvwmIconMan. * Fixed placement of WindowList on wrong Xinerama screen when called without any options on a screen other than the primary screen. * Fixed a problem with root bindings and xfishtank. * Fixed moving windows with the keyboard over the edge of the screen when the pointer remained of the previous page. * Do not hilight windows after ResizeMove. * New conditional command ThisWindow. * Some fixes in the configure script that caused some rare problems detecting gnome and ncurses. * Fixed a memory leak in the Pick command. * Allow to choose windows with CirculateSkip with the Pick command. * Fixed an FvwmScript compile problem on dec-osf5. * The window handles are now resizes as they should when the HandleWidth style changes. * The Current command does not select a random window when no window has the focus. * Fixed a rare menu placement problem with Xinerama. ------------------------------------------------------------------- Changes in stable release 2.4.5 (27-Jan-2002) * Fixed minor problems in popping sub menus up and down. * Fixed moving windows between pages with the keyboard. * Fixed the size of the geometry window that was broken sometimes. * Fixed problem with pointer warping to another screen on a dual head setup. * Fixed a problem with the focus in internal Ddd and Netscape windows. * Reduced the time in which fvwm attempts to grab the pointer. * Fixed unmanaged window when window was mapped/unmapped/mapped too fast. * Fixed MiniScroll's auto repeating in FvwmScript. * Fixed a crash with the UseStyle style in combination with HilightBack. * Fixed excessive redraws of the windows under a window being shaded. * Fixed a minor memory leak in the Style command. * Fixed pixmap background of FvwmButtons behind buttons with only text. * Fixed a crash in FvwmIconBox when the application provided an illegal icon. * Fixed a configure problem with libstroke-0.5.1. * New style BackingStoreWindowDefault which is the default now. Fvwm no longer disables backing store on windows by default. * Fixed bug that sometimes caused unnecessary redraws when a style was changed. * Fixed crash when something like "$[$v]" appeared in a command. * Fixed parsing of conditions with more than one comma. ------------------------------------------------------------------- Changes in stable release 2.4.4 (16-Dec-2001) * Minor title drawing fixes. * Fixed manual placement with Xinerama. * Minor button 3 handling fix in FvwmPager. * Fixed *FvwmIconMan*shaped option with empty managers. * Fixed ClickToFocusClickRaises style. * FvwmForm: Customize pointers, support ISO_Tab key, buttons can activate on press or release, special pointer during grab, arrow keys useful in form with one input field. * New OpaqueMoveSize argument "unlimited". * Fixed binding keys with and without "Shift" modifier under some circumstances. * Fixed binding actions to the client window with ClickToFocus. * Mouse bindings are activated without a recapture. * FvwmScript: new keyboard bindings. New flags NoFocus and Left, Center, and Right for text position. Amelioration of the Menu and PopupMenu Widgets. New functions GetPid, Parse, SendMsgAndGet and LastString. New instruction Key for key bindings. New command SendToModule ScriptName SendString. * Command "Silent" when precedes "Key", "Mouse" and "PointerKey" disables warning messages. * Restored the default Alt-Tab behaviour from 2.4.0. ------------------------------------------------------------------- Changes in stable release 2.4.3 (08-Oct-2001) * Fixed activation of shape extension. * Fixed problems with overriding key bindings. * Single letter key names are allowed in upper and lower case in key bindings as before 2.4.0. * Fixed WindowList placement with Xinerama. * Fixed flickering icon titles. * New X resource fvwmscreen to select the Xinerama screen on which to place new windows. * Coordinates of a window during motion are show relative to the Xinerama screen. * Some icon placement improvements with Xinerama. ------------------------------------------------------------------- Changes in stable release 2.4.2 (16-Sep-2001) * Desk and page can be given as X resources in .Xdefaults, for example: xterm.desk: 1 xterm.page: 1 2 3 * Several Shape compilation problems fixed. ------------------------------------------------------------------- Changes in stable release 2.4.1 (15-Sep-2001) * Added Xinerama and SingleLogicalScreen support. * New commands Xinerama, XineramaPrimaryScreen, XineramaSls, XineramaSlsSize and MoveToScreen. * New context rectangle option XineramaRoot for the menu commands. * New conditions CurrentGlobalPage, CurrentGlobalPageAnyDesk and AcceptsFocus for conditional commands. * The DestroyStyle command takes effect immediately. * New style option StartsOnScreen. * New style options NoUSPosition, UseUSPosition, NoTransientPPosition, UseTransientPPosition, NoTransientUSPosition, and UseTransientUSPosition. These work similar to the old styles NoPPosition and UsePPosition. * New option "screen" for Maximize command. * New option ReverseOrder for WindowList command. * The default Alt-Tab binding works more intuitive. * New condition "PlacedByFvwm" * New Geometry option for FvwmForm. * New Screen resolution and ShowOnlyIcons options for FvwmIconMan. * FvwmIconMan can be closed with Delete or Close too. * New options PageOnly and ScreenOnly for FvwmTaskBar. * FvwmIconBox, FvwmTaskBar and FvwmWinList support aliases. * Enhancements in fvwm-menu-headlines and support for 10 more sites. * Color enhancements in button vectors: @2 is bg color, @3 is fg color. * Improved detection of the Shape library. * Fixed FvwmButtons button titles not being erased for swallowed windows that showed up on certain setups. * Fixed bug that caused transient windows to be buried below their parents with the "BugOpts RaiseOverUnmanaged on". This occured with the system.fvwm2rc-sample-95 configuration. * The modules FvwmPager, FvwmIconMan, FvwmWinList and FvwmButtos set the transient_for hint when started with the "transient" option. * Fixed FvwmIconMan with the transient option when mapped off screen. * Fixed ClickToFocus focus policy when iconifying the focused window. * Fixed some focus problems in conjunction with unclutter vs xv/xmms and Open Look applications. * Fixed a problem that could cause windows to be lost off screen with interactive window motion. * Fixed some FvwmTaskBar autohide problem. * Fixed a display string problem in FvwmForm. * Fixed a problem with FvwmTheme shadow colours. * Fixed the CirculateSkipIcon and CirculateSkipShaded options in conditional commands. * Fixed a formatting problem of the man page on AIX, Solaris, and some other UNIX variants. * Fixed a problems with FvwmIconBox exiting on 64 bit platforms. * Fixed FvwmIconBox crashes with MaxIconSize dimensions 0. * Fixed parameters of fvwm24_convert. * Fixed a number of building problems related to old vendor unices, libstroke-0.5, autoconf-2.50, bogus gnome-config and imlib-config. * Fixed drawing of title bar buttons with MWMDecorStick. * Fixed missing button or key events over the pan frames. * Fixed placement of the FvwmDragWell, FvwmButtons and FvwmForm modules. * Fixed parsing double quotes in FvwmPager's Font and SmallFont options. Fixed FvwmPager crash with certain font strings. * Fixed drawing of the grid lines in an iconified FvwmPager window. * Fixed button grabbing problem for buttons > 3 in FvwmTaskBar. * Fixed some exotic problems with window gravity and resizing windows. * Fixed a problem with maximizing windows with the viewport not starting on a page boundary. * Fixed handling of parentheses in FvwmButtons button actions. * Work around a key binding problem with keys that generate the same symbol with more than one key code (e.g. Shift-F1 = F11). * The Desk option of FvwmBacker is compatible to earlier version. Desk or Page coordinates can be omitted to indicate that desk or page changes trigger no action at all. * Fixed double updating of background with FvwmBacker sometimes leading to the wrong background. * Fixed several escaping errors in fvwm-menu-directory, so files and directories containing special chars and spaces should work. * Fixed PlacedByButton3 condition. * Fixed vanishing windows when mapping/unmapping too fast. * Fixed prev option of the GotoDeskAndPage command. * Fixed calculations of X_RESOLUTION and Y_RESOLUTION for screen dimensions larger than 2147. * Fixed compatibility of the FvwmM4 modules on platforms that have a System V implementation of m4 (Solaris 2.6). * The SetEnv command without a value for a variable is the same as UnsetEnv. * Fixed shading/unshading shaped windows and windows without title and border. ------------------------------------------------------------------- Changes in stable release 2.4.0 (03-Jul-2001) * Finally released. :) ------------------------------------------------------------------- For older NEWS, read the ONEWS file. fvwm-2.6.5.orig/fvwm/0000755000175000017500000000000011744241477012614 5ustar vwcvwcfvwm-2.6.5.orig/fvwm/borders.c0000644000175000017500000035552411622413321014416 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* IMPORTANT NOTE: * * The functions in this module *must not* assume that the geometries in the * FvwmWindow structure reflect the desired geometry of the window or its * parts. While the window is resized or shaded, they may hold the old * geometry instead of the new one (but you can not rely on this). Therefore, * these geometries must not be accessed directly or indirectly (by the * functions from geometry,c). Use the geometries that are passed in via * structure pointers, e.d. "td". */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/Parse.h" #include "libs/Graphics.h" #include "libs/Picture.h" #include "libs/PictureGraphics.h" #include "libs/FRenderInit.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "fvwm.h" #include "execcontext.h" #include "externs.h" #include "misc.h" #include "screen.h" #include "geometry.h" #include "borders.h" #include "builtins.h" #include "icons.h" #include "frame.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ #define SWAP_ARGS(f,a1,a2) (f)?(a2):(a1),(f)?(a1):(a2) /* ---------------------------- imports ------------------------------------ */ extern Window PressedW; /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef struct { struct { unsigned use_pixmap : 1; } flags; Pixel pixel; struct { Pixmap p; Pixmap shape; Pixmap alpha; int depth; FvwmRenderAttributes fra; rectangle g; int stretch_w; int stretch_h; struct { unsigned is_tiled : 1; unsigned is_stretched : 1; } flags; } pixmap; } pixmap_background_type; typedef struct { Pixmap p; FvwmPicture *mp_created_pic; int cs; FvwmPicture *mp_pic; int mp_part; Bool created; } bar_pixmap; typedef struct { int count; bar_pixmap *bps; } bar_bs_pixmaps; /* for UseTitleStyle & Colorset */ typedef struct { Pixmap frame_pixmap; bar_bs_pixmaps bar_pixmaps[BS_MaxButtonState]; } dynamic_common_decorations; typedef struct { int relief_width; GC relief_gc; GC shadow_gc; Pixel fore_color; Pixel back_color; int cs; int border_cs; /* for UseBorderStyle */ int bg_border_cs; /* for UseBorderStyle */ Pixmap back_pixmap; XSetWindowAttributes attributes; unsigned long valuemask; Pixmap texture_pixmap; int texture_pixmap_width; int texture_pixmap_height; XSetWindowAttributes notex_attributes; unsigned long notex_valuemask; dynamic_common_decorations dynamic_cd; } common_decorations_type; typedef struct { GC relief; GC shadow; GC transparent; } draw_border_gcs; typedef struct { int offset_tl; int offset_br; int thickness; int length; unsigned has_x_marks : 1; unsigned has_y_marks : 1; } border_marks_descr; typedef struct { int w_dout; int w_hiout; int w_trout; int w_c; int w_trin; int w_shin; int w_din; int sum; int trim; unsigned is_flat : 1; } border_relief_size_descr; typedef struct { rectangle sidebar_g; border_relief_size_descr relief; border_marks_descr marks; draw_border_gcs gcs; } border_relief_descr; typedef struct { unsigned pressed_bmask : NUMBER_OF_TITLE_BUTTONS; unsigned lit_bmask : NUMBER_OF_TITLE_BUTTONS; unsigned toggled_bmask : NUMBER_OF_TITLE_BUTTONS; unsigned clear_bmask : NUMBER_OF_TITLE_BUTTONS; unsigned draw_bmask : NUMBER_OF_TITLE_BUTTONS; unsigned max_bmask : NUMBER_OF_TITLE_BUTTONS; ButtonState bstate[NUMBER_OF_TITLE_BUTTONS]; unsigned is_title_pressed : 1; unsigned is_title_lit : 1; unsigned do_clear_title : 1; ButtonState tstate; } border_titlebar_state; typedef struct { GC rgc; GC sgc; FlocaleWinString fstr; DecorFaceStyle *tstyle; DecorFace *df; unsigned is_toggled : 1; } title_draw_descr; typedef struct { common_decorations_type *cd; rectangle frame_g; rectangle bar_g; /* titlebar geo vs the frame */ rectangle left_buttons_g; /* vs the frame */ rectangle right_buttons_g; /* vs the frame */ frame_title_layout_t layout; frame_title_layout_t old_layout; border_titlebar_state tbstate; int length; /* text */ int offset; /* text offset */ /* MultiPixmap Geometries */ rectangle under_text_g; /* vs the titlebar */ rectangle left_main_g; /* vs the titlebar */ rectangle right_main_g; /* vs the titlebar */ rectangle full_left_main_g; /* vs the frame */ rectangle full_right_main_g; /* vs the frame */ int left_end_length; int left_of_text_length; int right_end_length; int right_of_text_length; rotation_t draw_rotation; rotation_t restore_rotation; unsigned td_is_rotated : 1; unsigned has_been_saved : 1; unsigned has_vt : 1; /* vertical title ? */ unsigned has_an_upsidedown_rotation : 1; /* 270 || 180 */ } titlebar_descr; /* ---------------------------- forward declarations ----------------------- */ /* forward declarations are not so good */ /* for grouping titlebar_descr computation */ static void border_rotate_titlebar_descr(FvwmWindow *fw, titlebar_descr *td); /* for grouping the MultiPixmap stuff */ static Bool border_mp_get_use_title_style_parts_and_geometry( titlebar_descr *td, FvwmPicture **pm, FvwmAcs *acs, unsigned short sf, int is_left, rectangle *g, int *part); /* ---------------------------- local variables ---------------------------- */ static const char ulgc[] = { 1, 0, 0, 0x7f, 2, 1, 1 }; static const char brgc[] = { 1, 1, 2, 0x7f, 0, 0, 3 }; /* ---------------------------- exported variables (globals) --------------- */ XGCValues Globalgcv; unsigned long Globalgcm; /* ---------------------------- local functions ---------------------------- */ static Bool is_button_toggled( FvwmWindow *fw, int button) { mwm_flags mf; if (!HAS_MWM_BUTTONS(fw)) { return False; } mf = TB_MWM_DECOR_FLAGS(GetDecor(fw, buttons[button])); if ((mf & MWM_DECOR_MAXIMIZE) && IS_MAXIMIZED(fw)) { return True; } if ((mf & MWM_DECOR_SHADE) && IS_SHADED(fw)) { return True; } if ((mf & MWM_DECOR_STICK) && (IS_STICKY_ACROSS_PAGES(fw) || IS_STICKY_ACROSS_DESKS(fw))) { return True; } if (TB_FLAGS(fw->decor->buttons[button]).has_layer && fw->layer == TB_LAYER(fw->decor->buttons[button])) { return True; } return False; } /* rules to get button state */ static ButtonState border_flags_to_button_state( int is_pressed, int is_lit, int is_toggled) { if (!is_lit && Scr.gs.use_inactive_buttons) { if (is_pressed && Scr.gs.use_inactive_down_buttons) { return (is_toggled) ? BS_ToggledInactiveDown : BS_InactiveDown; } else { return (is_toggled) ? BS_ToggledInactiveUp : BS_InactiveUp; } } else { if (is_pressed && Scr.gs.use_active_down_buttons) { return (is_toggled) ? BS_ToggledActiveDown : BS_ActiveDown; } else { return (is_toggled) ? BS_ToggledActiveUp : BS_ActiveUp; } } } static void get_common_decorations( common_decorations_type *cd, FvwmWindow *t, window_parts draw_parts, Bool has_focus, Bool is_border, Bool do_change_gcs) { DecorFace *df; color_quad *draw_colors; df = border_get_border_style(t, has_focus); cd->bg_border_cs = -1; cd->cs = -1; if (has_focus) { /* are we using textured borders? */ if (DFS_FACE_TYPE(df->style) == TiledPixmapButton && GetDecor(t, BorderStyle.active.u.p->depth) == Pdepth) { cd->texture_pixmap = GetDecor( t, BorderStyle.active.u.p->picture); cd->texture_pixmap_width = GetDecor( t, BorderStyle.active.u.p->width); cd->texture_pixmap_height = GetDecor( t, BorderStyle.active.u.p->height); } else if (DFS_FACE_TYPE(df->style) == ColorsetButton) { cd->bg_border_cs = GetDecor( t, BorderStyle.active.u.acs.cs); } cd->back_pixmap = Scr.gray_pixmap; if (is_border) { draw_colors = &(t->border_hicolors); cd->cs = t->border_cs_hi; } else { draw_colors = &(t->hicolors); cd->cs = t->cs_hi; } } else { if (DFS_FACE_TYPE(df->style) == TiledPixmapButton && GetDecor(t, BorderStyle.inactive.u.p->depth) == Pdepth) { cd->texture_pixmap = GetDecor( t, BorderStyle.inactive.u.p->picture); cd->texture_pixmap_width = GetDecor( t, BorderStyle.inactive.u.p->width); cd->texture_pixmap_height = GetDecor( t, BorderStyle.inactive.u.p->height); } else if (DFS_FACE_TYPE(df->style) == ColorsetButton) { cd->bg_border_cs = GetDecor( t, BorderStyle.inactive.u.acs.cs); } if (IS_STICKY_ACROSS_PAGES(t) || IS_STICKY_ACROSS_DESKS(t)) { cd->back_pixmap = Scr.sticky_gray_pixmap; } else { cd->back_pixmap = Scr.light_gray_pixmap; } if (is_border) { draw_colors = &(t->border_colors); cd->cs = t->border_cs; } else { draw_colors = &(t->colors); cd->cs = t->cs; } } cd->fore_color = draw_colors->fore; cd->back_color = draw_colors->back; if (do_change_gcs) { Globalgcv.foreground = draw_colors->hilight; Globalgcm = GCForeground; XChangeGC(dpy, Scr.ScratchGC1, Globalgcm, &Globalgcv); Globalgcv.foreground = draw_colors->shadow; XChangeGC(dpy, Scr.ScratchGC2, Globalgcm, &Globalgcv); cd->relief_gc = Scr.ScratchGC1; cd->shadow_gc = Scr.ScratchGC2; } /* MWMBorder style means thin 3d effects */ cd->relief_width = (HAS_MWM_BORDER(t) ? 1 : 2); if (cd->texture_pixmap) { cd->attributes.background_pixmap = cd->texture_pixmap; cd->valuemask = CWBackPixmap; } else { if (Pdepth < 2) { cd->attributes.background_pixmap = cd->back_pixmap; cd->valuemask = CWBackPixmap; } else { cd->attributes.background_pixel = cd->back_color; cd->valuemask = CWBackPixel; } } if (Pdepth < 2) { cd->notex_attributes.background_pixmap = cd->back_pixmap; cd->notex_valuemask = CWBackPixmap; } else { cd->notex_attributes.background_pixel = cd->back_color; cd->notex_valuemask = CWBackPixel; } return; } static window_parts border_get_changed_border_parts( FvwmWindow *fw, rectangle *old_sidebar_g, rectangle *new_sidebar_g, int cs) { window_parts changed_parts; changed_parts = PART_NONE; if (!CSET_IS_TRANSPARENT_PR(cs) && CSET_HAS_PIXMAP(cs) && (old_sidebar_g->x != new_sidebar_g->x || old_sidebar_g->y != new_sidebar_g->y || old_sidebar_g->width != new_sidebar_g->width || old_sidebar_g->height != new_sidebar_g->height)) { /* optimizable? */ changed_parts |= PART_FRAME; return changed_parts; } if (old_sidebar_g->x != new_sidebar_g->x) { changed_parts |= (PART_FRAME & (~PART_BORDER_W)); } if (old_sidebar_g->y != new_sidebar_g->y) { changed_parts |= (PART_FRAME & (~PART_BORDER_N)); } if (old_sidebar_g->width != new_sidebar_g->width) { changed_parts |= PART_BORDER_N | PART_BORDER_S; if (DFS_FACE_TYPE(GetDecor(fw, BorderStyle.active.style)) == TiledPixmapButton) { changed_parts |= PART_BORDER_NE | PART_BORDER_E | PART_BORDER_SE; } } if (old_sidebar_g->height != new_sidebar_g->height) { changed_parts |= PART_BORDER_W | PART_BORDER_E; if (DFS_FACE_TYPE(GetDecor(fw, BorderStyle.active.style)) == TiledPixmapButton) { changed_parts |= PART_BORDER_SW | PART_BORDER_S | PART_BORDER_SE; } } return changed_parts; } static int border_get_parts_and_pos_to_draw( common_decorations_type *cd, FvwmWindow *fw, window_parts pressed_parts, window_parts force_draw_parts, rectangle *old_g, rectangle *new_g, Bool do_hilight, border_relief_descr *br) { window_parts draw_parts; window_parts parts_to_light; rectangle sidebar_g_old; DecorFaceStyle *borderstyle; Bool has_x_marks; Bool has_x_marks_old; Bool has_y_marks; Bool has_y_marks_old; int cs = cd->bg_border_cs; draw_parts = 0; borderstyle = (do_hilight) ? &GetDecor(fw, BorderStyle.active.style) : &GetDecor(fw, BorderStyle.inactive.style); frame_get_sidebar_geometry( fw, borderstyle, new_g, &br->sidebar_g, &has_x_marks, &has_y_marks); if (has_x_marks == True) { draw_parts |= PART_X_HANDLES; br->marks.has_x_marks = 1; } else { br->marks.has_x_marks = 0; } if (has_y_marks == True) { draw_parts |= PART_Y_HANDLES; br->marks.has_y_marks = 1; } else { br->marks.has_y_marks = 0; } draw_parts |= (pressed_parts ^ fw->decor_state.parts_inverted); parts_to_light = (do_hilight == True) ? PART_FRAME : PART_NONE; draw_parts |= (parts_to_light ^ fw->decor_state.parts_lit); draw_parts |= (~(fw->decor_state.parts_drawn) & PART_FRAME); draw_parts |= force_draw_parts; if (old_g == NULL) { old_g = &fw->g.frame; } if ((draw_parts & PART_FRAME) == PART_FRAME) { draw_parts |= PART_FRAME; return draw_parts; } frame_get_sidebar_geometry( fw, borderstyle, old_g, &sidebar_g_old, &has_x_marks_old, &has_y_marks_old); if (has_x_marks_old != has_x_marks) { draw_parts |= (PART_FRAME & (~(PART_BORDER_N | PART_BORDER_S))); } if (has_y_marks_old != has_y_marks) { draw_parts |= (PART_FRAME & (~(PART_BORDER_W | PART_BORDER_E))); } draw_parts |= border_get_changed_border_parts( fw, &sidebar_g_old, &br->sidebar_g, cs); draw_parts &= (PART_FRAME | PART_HANDLES); return draw_parts; } static window_parts border_get_tb_parts_to_draw( FvwmWindow *fw, titlebar_descr *td, rectangle *old_g, rectangle *new_g, window_parts force_draw_parts) { window_parts draw_parts; ButtonState old_state; int i; DecorFace *df,*tdf; td->tbstate.draw_bmask = 0; draw_parts = PART_NONE; /* first time? */ draw_parts |= (~(fw->decor_state.parts_drawn) & PART_TITLE); td->tbstate.draw_bmask |= (~(fw->decor_state.buttons_drawn)); /* forced? */ draw_parts |= force_draw_parts; td->tbstate.draw_bmask |= (force_draw_parts & PART_BUTTONS) ? ~0 : 0; /* check if state changed */ old_state = border_flags_to_button_state( (fw->decor_state.parts_inverted & PART_TITLE), (fw->decor_state.parts_lit & PART_TITLE), 0); if (old_state != td->tbstate.tstate) { draw_parts |= PART_TITLE; } /* size changed? */ if ((td->old_layout.title_g.width != td->layout.title_g.width || td->old_layout.title_g.height != td->layout.title_g.height) && td->layout.title_g.x >= 0 && td->layout.title_g.y >= 0) { draw_parts |= PART_TITLE; } /* same for buttons */ for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { unsigned int mask = (1 << i); if (FW_W_BUTTON(fw, i) == None) { continue; } old_state = border_flags_to_button_state( (fw->decor_state.buttons_inverted & mask), (fw->decor_state.buttons_lit & mask), (fw->decor_state.buttons_toggled & mask)); if (old_state != td->tbstate.bstate[i]) { draw_parts |= PART_BUTTONS; td->tbstate.draw_bmask |= mask; } if ((td->old_layout.button_g[i].width != td->layout.button_g[i].width || td->old_layout.button_g[i].height != td->layout.button_g[i].height) && td->layout.button_g[i].x >= 0 && td->layout.button_g[i].y >= 0) { draw_parts |= PART_BUTTONS; td->tbstate.draw_bmask |= mask; } } /* position changed and background is tiled or a cset? */ if ((draw_parts & PART_TITLE) == PART_NONE && td->layout.title_g.x >= 0 && td->layout.title_g.y >= 0) { df = &TB_STATE(GetDecor(fw, titlebar))[td->tbstate.tstate]; if (DFS_USE_BORDER_STYLE(df->style) && (((td->old_layout.title_g.x != td->layout.title_g.x || td->old_layout.title_g.y != td->layout.title_g.y) && ((td->cd->valuemask & CWBackPixmap) || CSET_PIXMAP_IS_TILED(td->cd->bg_border_cs))) || (old_g->width != new_g->width && CSET_PIXMAP_IS_X_STRETCHED(td->cd->bg_border_cs)) || (old_g->height != new_g->height && CSET_PIXMAP_IS_Y_STRETCHED(td->cd->bg_border_cs)) || ((old_g->x != new_g->x || old_g->y != new_g->y) && CSET_IS_TRANSPARENT_ROOT(td->cd->bg_border_cs)))) { draw_parts |= PART_TITLE; } if ((draw_parts & PART_TITLE) == PART_NONE && (old_g->x != new_g->x || old_g->y != new_g->y)) { for (tdf = df; tdf != NULL; tdf = tdf->next) { if (DFS_FACE_TYPE(tdf->style) == ColorsetButton && CSET_IS_TRANSPARENT_ROOT(tdf->u.acs.cs)) { draw_parts |= PART_TITLE; break; } } } } for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { unsigned int mask; DecorFaceStyle *bs; mask = (1 << i); bs = &TB_STATE( GetDecor(fw, buttons[i]))[td->tbstate.bstate[i]].style; if ((td->tbstate.draw_bmask & mask) || td->layout.button_g[i].x < 0 || td->layout.button_g[i].y < 0) { continue; } if (DFS_USE_BORDER_STYLE(*bs) && (((td->old_layout.button_g[i].x != td->layout.button_g[i].x|| td->old_layout.button_g[i].y != td->layout.button_g[i].y) && ((td->cd->valuemask & CWBackPixmap) || CSET_PIXMAP_IS_TILED(td->cd->bg_border_cs))) || (old_g->width != new_g->width && CSET_PIXMAP_IS_X_STRETCHED(td->cd->bg_border_cs)) || (old_g->height != new_g->height && CSET_PIXMAP_IS_Y_STRETCHED(td->cd->bg_border_cs)) || ((old_g->x != new_g->x || old_g->y != new_g->y) && CSET_IS_TRANSPARENT_ROOT(td->cd->bg_border_cs)))) { td->tbstate.draw_bmask |= mask; } else if (DFS_USE_TITLE_STYLE(*bs)) { df = &TB_STATE(GetDecor( fw, titlebar))[td->tbstate.bstate[i]]; for(tdf = df; tdf != NULL; tdf = tdf->next) { int cs; if (DFS_FACE_TYPE(tdf->style) == MultiPixmap) { /* can be improved */ td->tbstate.draw_bmask |= mask; break; } if (DFS_FACE_TYPE(tdf->style) != ColorsetButton || !CSET_HAS_PIXMAP(tdf->u.acs.cs)) { continue; } cs = tdf->u.acs.cs; if(((td->old_layout.button_g[i].x != td->layout.button_g[i].x || td->old_layout.button_g[i].y != td->layout.button_g[i].y) || CSET_PIXMAP_IS_TILED(cs)) || (old_g->width != new_g->width && CSET_PIXMAP_IS_X_STRETCHED(cs)) || (old_g->height != new_g->height && CSET_PIXMAP_IS_Y_STRETCHED(cs)) || ((old_g->x != new_g->x || old_g->y != new_g->y) && CSET_IS_TRANSPARENT_ROOT(cs))) { td->tbstate.draw_bmask |= mask; break; } } } if (td->tbstate.draw_bmask & mask) { continue; } if (old_g->x != new_g->x || old_g->y != new_g->y) { df = &TB_STATE(GetDecor( fw, buttons[i]))[td->tbstate.bstate[i]]; for(tdf = df; tdf != NULL; tdf = tdf->next) { if (DFS_FACE_TYPE(tdf->style) == ColorsetButton && CSET_IS_TRANSPARENT_ROOT(tdf->u.acs.cs)) { td->tbstate.draw_bmask |= mask; break; } } } } td->tbstate.max_bmask = 0; for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { if (FW_W_BUTTON(fw, i) == None) { continue; } if ((i & 1) == 1 && i / 2 < Scr.nr_right_buttons) { td->tbstate.max_bmask |= (1 << i); } else if ((i & 1) == 0 && i / 2 < Scr.nr_left_buttons) { td->tbstate.max_bmask |= (1 << i); } } td->tbstate.draw_bmask &= td->tbstate.max_bmask; td->tbstate.pressed_bmask &= td->tbstate.max_bmask; td->tbstate.lit_bmask &= td->tbstate.max_bmask; td->tbstate.toggled_bmask &= td->tbstate.max_bmask; td->tbstate.clear_bmask &= td->tbstate.max_bmask; if (td->tbstate.draw_bmask == 0) { draw_parts &= ~PART_BUTTONS; } else { draw_parts |= PART_BUTTONS; } draw_parts &= PART_TITLEBAR; return draw_parts; } static void border_get_border_gcs( draw_border_gcs *ret_gcs, common_decorations_type *cd, FvwmWindow *fw, Bool do_hilight) { static GC transparent_gc = None; DecorFaceStyle *borderstyle; Bool is_reversed = False; if (transparent_gc == None && !HAS_NO_BORDER(fw) && !HAS_MWM_BORDER(fw)) { XGCValues xgcv; xgcv.function = GXnoop; xgcv.plane_mask = 0; transparent_gc = fvwmlib_XCreateGC( dpy, Scr.NoFocusWin, GCFunction | GCPlaneMask, &xgcv); } ret_gcs->transparent = transparent_gc; /* get the border style bits */ borderstyle = (do_hilight) ? &GetDecor(fw, BorderStyle.active.style) : &GetDecor(fw, BorderStyle.inactive.style); if (borderstyle->flags.button_relief == DFS_BUTTON_IS_SUNK) { is_reversed = True; } if (is_reversed) { ret_gcs->shadow = cd->relief_gc; ret_gcs->relief = cd->shadow_gc; } else { ret_gcs->relief = cd->relief_gc; ret_gcs->shadow = cd->shadow_gc; } return; } static void trim_border_layout( FvwmWindow *fw, DecorFaceStyle *borderstyle, border_relief_size_descr *ret_size_descr) { /* If the border is too thin to accomodate the standard look, we remove * parts of the border so that at least one pixel of the original * colour is visible. We make an exception for windows with a border * width of 2, though. */ if ((!IS_SHADED(fw) || HAS_TITLE(fw)) && fw->boundary_width == 2) { ret_size_descr->trim--; } if (ret_size_descr->trim < 0) { ret_size_descr->trim = 0; } for ( ; ret_size_descr->trim > 0; ret_size_descr->trim--) { if (ret_size_descr->w_hiout > 1) { ret_size_descr->w_hiout--; } else if (ret_size_descr->w_shin > 0) { ret_size_descr->w_shin--; } else if (ret_size_descr->w_hiout > 0) { ret_size_descr->w_hiout--; } else if (ret_size_descr->w_trout > 0) { ret_size_descr->w_trout = 0; ret_size_descr->w_trin = 0; ret_size_descr->w_din = 0; ret_size_descr->w_hiout = 1; } ret_size_descr->sum--; } ret_size_descr->w_c = fw->boundary_width - ret_size_descr->sum; return; } static void check_remove_inset( DecorFaceStyle *borderstyle, border_relief_size_descr *ret_size_descr) { if (!DFS_HAS_NO_INSET(*borderstyle)) { return; } ret_size_descr->w_shin = 0; ret_size_descr->sum--; ret_size_descr->trim--; if (ret_size_descr->w_trin) { ret_size_descr->w_trout = 0; ret_size_descr->w_trin = 0; ret_size_descr->w_din = 0; ret_size_descr->w_hiout = 1; ret_size_descr->sum -= 2; ret_size_descr->trim -= 2; } return; } static void border_fetch_mwm_layout( FvwmWindow *fw, DecorFaceStyle *borderstyle, border_relief_size_descr *ret_size_descr) { /* MWM borders look like this: * * HHCCCCS from outside to inside on the left and top border * SSCCCCH from outside to inside on the bottom and right border * ||||||| * |||||||__ w_shin (inner shadow area) * ||||||___ w_c (transparent area) * |||||____ w_c (transparent area) * ||||_____ w_c (transparent area) * |||______ w_c (transparent area) * ||_______ w_hiout (outer hilight area) * |________ w_hiout (outer hilight area) * * * C = original colour * H = hilight * S = shadow */ ret_size_descr->w_dout = 0; ret_size_descr->w_hiout = 2; ret_size_descr->w_trout = 0; ret_size_descr->w_trin = 0; ret_size_descr->w_shin = 1; ret_size_descr->w_din = 0; ret_size_descr->sum = 3; ret_size_descr->trim = ret_size_descr->sum - fw->boundary_width + 1; check_remove_inset(borderstyle, ret_size_descr); trim_border_layout(fw, borderstyle, ret_size_descr); return; } static void border_fetch_fvwm_layout( FvwmWindow *fw, DecorFaceStyle *borderstyle, border_relief_size_descr *ret_size_descr) { /* Fvwm borders look like this: * * SHHCCSS from outside to inside on the left and top border * SSCCHHS from outside to inside on the bottom and right border * ||||||| * |||||||__ w_din (inner dark area) * ||||||___ w_shin (inner shadow area) * |||||____ w_trin (inner transparent/shadow area) * ||||_____ w_c (transparent area) * |||______ w_trout (outer transparent/hilight area) * ||_______ w_hiout (outer hilight area) * |________ w_dout (outer dark area) * * C = original colour * H = hilight * S = shadow * * reduced to 5 pixels it looks like this: * * SHHCS * SSCHS * ||||| * |||||__ w_din (inner dark area) * ||||___ w_trin (inner transparent/shadow area) * |||____ w_trout (outer transparent/hilight area) * ||_____ w_hiout (outer hilight area) * |______ w_dout (outer dark area) */ ret_size_descr->w_dout = 1; ret_size_descr->w_hiout = 1; ret_size_descr->w_trout = 1; ret_size_descr->w_trin = 1; ret_size_descr->w_shin = 1; ret_size_descr->w_din = 1; /* w_trout + w_trin counts only as one pixel of border because * they let one pixel of the original colour shine through. */ ret_size_descr->sum = 6; ret_size_descr->trim = ret_size_descr->sum - fw->boundary_width; check_remove_inset(borderstyle, ret_size_descr); trim_border_layout(fw, borderstyle, ret_size_descr); return; } static void border_get_border_relief_size_descr( border_relief_size_descr *ret_size_descr, FvwmWindow *fw, Bool do_hilight) { DecorFaceStyle *borderstyle; if (is_window_border_minimal(fw)) { /* the border is too small, only a background but no relief */ ret_size_descr->is_flat = 1; return; } borderstyle = (do_hilight) ? &GetDecor(fw, BorderStyle.active.style) : &GetDecor(fw, BorderStyle.inactive.style); if (borderstyle->flags.button_relief == DFS_BUTTON_IS_FLAT) { ret_size_descr->is_flat = 1; return; } ret_size_descr->is_flat = 0; /* get the relief layout */ if (HAS_MWM_BORDER(fw)) { border_fetch_mwm_layout(fw, borderstyle, ret_size_descr); } else { border_fetch_fvwm_layout(fw, borderstyle, ret_size_descr); } return; } static void border_get_border_marks_descr( common_decorations_type *cd, border_relief_descr *br, FvwmWindow *fw) { int inset; /* get mark's length and thickness */ inset = (br->relief.w_shin != 0 || br->relief.w_din != 0); br->marks.length = fw->boundary_width - br->relief.w_dout - inset; if (br->marks.length <= 0) { br->marks.has_x_marks = 0; br->marks.has_y_marks = 0; return; } br->marks.thickness = cd->relief_width; if (br->marks.thickness > br->marks.length) { br->marks.thickness = br->marks.length; } /* get offsets from outer side of window */ br->marks.offset_tl = br->relief.w_dout; br->marks.offset_br = -br->relief.w_dout - br->marks.length - br->marks.offset_tl; return; } static Pixmap border_create_decor_pixmap( common_decorations_type *cd, rectangle *decor_g) { Pixmap p; p = XCreatePixmap( dpy, Scr.Root, decor_g->width, decor_g->height, Pdepth); return p; } static void border_draw_part_relief( border_relief_descr *br, rectangle *frame_g, rectangle *part_g, Pixmap dest_pix, Bool is_inverted) { int i; int off_x = 0; int off_y = 0; int width = frame_g->width - 1; int height = frame_g->height - 1; int w[7]; GC gc[4]; w[0] = br->relief.w_dout; w[1] = br->relief.w_hiout; w[2] = br->relief.w_trout; w[3] = br->relief.w_c; w[4] = br->relief.w_trin; w[5] = br->relief.w_shin; w[6] = br->relief.w_din; gc[(is_inverted == True)] = br->gcs.relief; gc[!(is_inverted == True)] = br->gcs.shadow; gc[2] = br->gcs.transparent; gc[3] = br->gcs.shadow; off_x = -part_g->x; off_y = -part_g->y; width = frame_g->width - 1; height = frame_g->height - 1; for (i = 0; i < 7; i++) { if (ulgc[i] != 0x7f && w[i] > 0) { do_relieve_rectangle( dpy, dest_pix, off_x, off_y, width, height, gc[(int)ulgc[i]], gc[(int)brgc[i]], w[i], False); } off_x += w[i]; off_y += w[i]; width -= 2 * w[i]; height -= 2 * w[i]; } return; } static void border_draw_x_mark( border_relief_descr *br, int x, int y, Pixmap dest_pix, Bool do_draw_shadow) { int k; int length; GC gc; if (br->marks.has_x_marks == 0) { return; } x += br->marks.offset_tl; gc = (do_draw_shadow) ? br->gcs.shadow : br->gcs.relief; /* draw it */ for (k = 0, length = br->marks.length - 1; k < br->marks.thickness; k++, length--) { int x1; int x2; int y1; int y2; if (length < 0) { break; } if (do_draw_shadow) { x1 = x + k; y1 = y - 1 - k; } else { x1 = x; y1 = y + k; } x2 = x1 + length; y2 = y1; XDrawLine(dpy, dest_pix, gc, x1, y1, x2, y2); } return; } static void border_draw_y_mark( border_relief_descr *br, int x, int y, Pixmap dest_pix, Bool do_draw_shadow) { int k; int length; GC gc; if (br->marks.has_y_marks == 0) { return; } y += br->marks.offset_tl; gc = (do_draw_shadow) ? br->gcs.shadow : br->gcs.relief; /* draw it */ for (k = 0, length = br->marks.length; k < br->marks.thickness; k++, length--) { int x1; int x2; int y1; int y2; if (length <= 0) { break; } if (do_draw_shadow) { x1 = x - 1 - k; y1 = y + k; } else { x1 = x + k; y1 = y; } x2 = x1; y2 = y1 + length - 1; XDrawLine(dpy, dest_pix, gc, x1, y1, x2, y2); } return; } static void border_draw_part_marks( border_relief_descr *br, rectangle *part_g, window_parts part, Pixmap dest_pix) { int l; int t; int w; int h; int o; l = br->sidebar_g.x; t = br->sidebar_g.y; w = part_g->width; h = part_g->height; o = br->marks.offset_br; switch (part) { case PART_BORDER_N: border_draw_y_mark(br, 0, 0, dest_pix, False); border_draw_y_mark(br, w, 0, dest_pix, True); break; case PART_BORDER_S: border_draw_y_mark(br, 0, h + o, dest_pix, False); border_draw_y_mark(br, w, h + o, dest_pix, True); break; case PART_BORDER_E: border_draw_x_mark(br, w + o, 0, dest_pix, False); border_draw_x_mark(br, w + o, h, dest_pix, True); break; case PART_BORDER_W: border_draw_x_mark(br, 0, 0, dest_pix, False); border_draw_x_mark(br, 0, h, dest_pix, True); break; case PART_BORDER_NW: border_draw_x_mark(br, 0, t, dest_pix, True); border_draw_y_mark(br, l, 0, dest_pix, True); break; case PART_BORDER_NE: border_draw_x_mark(br, l + o, t, dest_pix, True); border_draw_y_mark(br, 0, 0, dest_pix, False); break; case PART_BORDER_SW: border_draw_x_mark(br, 0, 0, dest_pix, False); border_draw_y_mark(br, l, t + o, dest_pix, True); break; case PART_BORDER_SE: border_draw_x_mark(br, l + o, 0, dest_pix, False); border_draw_y_mark(br, 0, t + o, dest_pix, False); break; default: return; } return; } inline static void border_set_part_background( Window w, Pixmap pix) { XSetWindowAttributes xswa; xswa.background_pixmap = pix; XChangeWindowAttributes(dpy, w, CWBackPixmap, &xswa); return; } /* render the an image into the pixmap */ static void border_fill_pixmap_background( Pixmap dest_pix, rectangle *dest_g, pixmap_background_type *bg, common_decorations_type *cd) { Bool do_tile; Bool do_stretch; XGCValues xgcv; unsigned long valuemask; Pixmap p = None, shape = None, alpha = None; int src_width, src_height; do_tile = (bg->flags.use_pixmap && bg->pixmap.flags.is_tiled) ? True : False; do_stretch = (bg->flags.use_pixmap && bg->pixmap.flags.is_stretched) ? True : False; xgcv.fill_style = FillSolid; valuemask = GCFillStyle; if (!bg->flags.use_pixmap) { /* solid pixel */ xgcv.foreground = bg->pixel; xgcv.clip_x_origin = 0; xgcv.clip_y_origin = 0; xgcv.clip_mask = None; valuemask |= GCForeground | GCClipMask | GCClipXOrigin | GCClipYOrigin; XChangeGC(dpy, Scr.BordersGC, valuemask, &xgcv); XFillRectangle( dpy, dest_pix, Scr.BordersGC, dest_g->x, dest_g->y, dest_g->width - dest_g->x, dest_g->height - dest_g->y); return; } if (do_stretch) { if (bg->pixmap.p) { p = CreateStretchPixmap( dpy, bg->pixmap.p, bg->pixmap.g.width, bg->pixmap.g.height, bg->pixmap.depth, bg->pixmap.stretch_w, bg->pixmap.stretch_h, (bg->pixmap.depth == 1)? Scr.MonoGC:Scr.BordersGC); } if (bg->pixmap.shape) { shape = CreateStretchPixmap( dpy, bg->pixmap.shape, bg->pixmap.g.width, bg->pixmap.g.height, 1, bg->pixmap.stretch_w, bg->pixmap.stretch_h, Scr.MonoGC); } if (bg->pixmap.alpha) { alpha = CreateStretchPixmap( dpy, bg->pixmap.alpha, bg->pixmap.g.width, bg->pixmap.g.height, FRenderGetAlphaDepth(), bg->pixmap.stretch_w, bg->pixmap.stretch_h, Scr.AlphaGC); } src_width = bg->pixmap.stretch_w; src_height = bg->pixmap.stretch_h; } else { p = bg->pixmap.p; shape = bg->pixmap.shape; alpha = bg->pixmap.alpha; src_width = bg->pixmap.g.width; src_height = bg->pixmap.g.height; } if (do_tile == False) { /* pixmap, offset stored in dest_g->x/y */ xgcv.foreground = cd->fore_color; xgcv.background = cd->back_color; valuemask |= GCForeground|GCBackground; XChangeGC(dpy, Scr.BordersGC, valuemask, &xgcv); PGraphicsRenderPixmaps( dpy, Scr.NoFocusWin, p, shape, alpha, bg->pixmap.depth, &(bg->pixmap.fra), dest_pix, Scr.BordersGC, Scr.MonoGC, Scr.AlphaGC, bg->pixmap.g.x, bg->pixmap.g.y, src_width, src_height, dest_g->x, dest_g->y, dest_g->width - dest_g->x, dest_g->height - dest_g->y, False); } else { /* tiled pixmap */ xgcv.foreground = cd->fore_color; xgcv.background = cd->back_color; valuemask |= GCForeground|GCBackground; XChangeGC(dpy, Scr.BordersGC, valuemask, &xgcv); PGraphicsRenderPixmaps( dpy, Scr.NoFocusWin, p, shape, alpha, bg->pixmap.depth, &(bg->pixmap.fra), dest_pix, Scr.BordersGC, Scr.MonoGC, Scr.AlphaGC, bg->pixmap.g.x, bg->pixmap.g.y, src_width, src_height, dest_g->x, dest_g->y, dest_g->width - dest_g->x, dest_g->height - dest_g->y, True); } if (p && p != bg->pixmap.p) { XFreePixmap(dpy, p); } if (shape && shape != bg->pixmap.shape) { XFreePixmap(dpy, shape); } if (alpha && alpha != bg->pixmap.alpha) { XFreePixmap(dpy, alpha); } return; } /* create a root transparent colorset bg, we take in account a possible * drawing rotation */ static Pixmap border_create_root_transparent_pixmap( titlebar_descr *td, Window w, int width, int height, int cs) { int my_w, my_h; Pixmap p; if (!CSET_IS_TRANSPARENT_ROOT(cs)) { return None; } if (td->td_is_rotated && (td->draw_rotation == ROTATION_90 || td->draw_rotation == ROTATION_270)) { my_h = width; my_w = height; } else { my_w = width; my_h = height; } p = CreateBackgroundPixmap( dpy, w, my_w, my_h, &Colorset[cs], Pdepth, Scr.BordersGC, False); if (p && td->td_is_rotated) { Pixmap tmp; tmp = CreateRotatedPixmap( dpy, p, my_w, my_h, Pdepth, Scr.BordersGC, td->restore_rotation); XFreePixmap(dpy, p); p = tmp; } return p; } static void border_get_frame_pixmap( common_decorations_type *cd, rectangle *frame_g) { dynamic_common_decorations *dcd = &(cd->dynamic_cd); if (dcd->frame_pixmap != None) { /* should not happen */ fprintf(stderr, "Bad use of border_get_frame_pixmap!!\n"); dcd->frame_pixmap = None; } if (cd->bg_border_cs < 0 || CSET_IS_TRANSPARENT(cd->bg_border_cs)) { /* should not happen */ } else { dcd->frame_pixmap = CreateBackgroundPixmap( dpy, Scr.NoFocusWin, frame_g->width, frame_g->height, &Colorset[cd->bg_border_cs], Pdepth, Scr.BordersGC, False); } return; } static void border_get_border_background( pixmap_background_type *bg, common_decorations_type *cd, rectangle *part_g, rectangle *relative_g, int *free_bg_pixmap, Window w) { *free_bg_pixmap = False; if (cd->texture_pixmap) { bg->flags.use_pixmap = 1; bg->pixmap.p = cd->texture_pixmap; bg->pixmap.g.width = cd->texture_pixmap_width; bg->pixmap.g.height = cd->texture_pixmap_height; bg->pixmap.shape = None; bg->pixmap.alpha = None; bg->pixmap.depth = Pdepth; bg->pixmap.flags.is_tiled = 1; bg->pixmap.flags.is_stretched = 0; bg->pixmap.fra.mask = 0; } else if (cd->bg_border_cs >= 0 && !CSET_IS_TRANSPARENT_PR(cd->bg_border_cs)) { colorset_t *cs_t = &Colorset[cd->bg_border_cs]; XGCValues xgcv; if (CSET_IS_TRANSPARENT_ROOT(cd->bg_border_cs)) { bg->pixmap.p = CreateBackgroundPixmap( dpy, w, part_g->width, part_g->height, cs_t, Pdepth, Scr.BordersGC, False); } else { /* FIXME */ if (cd->dynamic_cd.frame_pixmap == None) { border_get_frame_pixmap(cd, relative_g); } bg->pixmap.p = XCreatePixmap( dpy, cd->dynamic_cd.frame_pixmap, part_g->width, part_g->height, Pdepth); xgcv.fill_style = FillTiled; xgcv.tile = cd->dynamic_cd.frame_pixmap; xgcv.ts_x_origin = - relative_g->x; xgcv.ts_y_origin = - relative_g->y; XChangeGC( dpy, Scr.BordersGC, GCTile | GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle, &xgcv); XFillRectangle( dpy, bg->pixmap.p, Scr.BordersGC, 0, 0, part_g->width, part_g->height); xgcv.fill_style = FillSolid; XChangeGC(dpy, Scr.BordersGC, GCFillStyle, &xgcv); } bg->pixmap.g.width = part_g->width; bg->pixmap.g.height = part_g->height; bg->flags.use_pixmap = 1; bg->pixmap.shape = None; bg->pixmap.alpha = None; bg->pixmap.depth = Pdepth; bg->pixmap.flags.is_tiled = 1; bg->pixmap.flags.is_stretched = 0; bg->pixmap.fra.mask = 0; *free_bg_pixmap = True; } else { bg->flags.use_pixmap = 0; bg->pixel = cd->attributes.background_pixel; } return; } static void border_draw_one_border_part( common_decorations_type *cd, FvwmWindow *fw, rectangle *sidebar_g, rectangle *frame_g, border_relief_descr *br, window_parts part, window_parts draw_handles, Bool is_inverted, Bool do_clear) { pixmap_background_type bg; rectangle part_g; rectangle pix_g; rectangle relative_g; Pixmap p; Window w; Bool free_bg_pixmap = False; /* make a pixmap */ border_get_part_geometry(fw, part, sidebar_g, &part_g, &w); if (part_g.width <= 0 || part_g.height <= 0) { return; } p = border_create_decor_pixmap(cd, &part_g); /* set the background tile */ relative_g.width = fw->g.frame.width; relative_g.height = fw->g.frame.height; relative_g.x = part_g.x; relative_g.y = part_g.y; border_get_border_background( &bg, cd, &part_g, &relative_g, &free_bg_pixmap, w); if (cd->texture_pixmap) { switch (part) { case PART_BORDER_E: bg.pixmap.g.x = frame_g->width - fw->boundary_width; break; case PART_BORDER_NE: case PART_BORDER_SE: bg.pixmap.g.x = frame_g->width - fw->corner_width; break; case PART_BORDER_N: case PART_BORDER_S: bg.pixmap.g.x = fw->corner_width; break; default: bg.pixmap.g.x = 0; break; } switch (part) { case PART_BORDER_S: bg.pixmap.g.y = frame_g->height - fw->boundary_width; break; case PART_BORDER_SW: case PART_BORDER_SE: bg.pixmap.g.y = frame_g->height - fw->corner_width; break; case PART_BORDER_W: case PART_BORDER_E: bg.pixmap.g.y = fw->corner_width; break; default: bg.pixmap.g.y = 0; break; } } else { bg.pixmap.g.x = 0; bg.pixmap.g.y = 0; } /* set the geometry for drawing the Tiled pixmap; maybe add the relief * as offset? */ pix_g.x = 0; pix_g.y = 0; pix_g.width = part_g.width; pix_g.height = part_g.height; border_fill_pixmap_background(p, &pix_g, &bg, cd); if (free_bg_pixmap && bg.pixmap.p) { XFreePixmap(dpy, bg.pixmap.p); } /* draw the relief over the background */ if (!br->relief.is_flat) { border_draw_part_relief(br, frame_g, &part_g, p, is_inverted); /* draw the handle marks */ if (br->marks.has_x_marks || br->marks.has_y_marks) { border_draw_part_marks(br, &part_g, part, p); } } /* apply the pixmap and destroy it */ border_set_part_background(w, p); if (do_clear == True) { XClearWindow(dpy,w); } XFreePixmap(dpy, p); return; } static void border_draw_all_border_parts( common_decorations_type *cd, FvwmWindow *fw, border_relief_descr *br, rectangle *frame_g, window_parts draw_parts, window_parts pressed_parts, Bool do_hilight, Bool do_clear) { window_parts part; window_parts draw_handles; /* get the description of the drawing directives */ border_get_border_relief_size_descr(&br->relief, fw, do_hilight); border_get_border_marks_descr(cd, br, fw); /* fetch the gcs used to draw the border */ border_get_border_gcs(&br->gcs, cd, fw, do_hilight); /* draw everything in a big loop */ draw_parts &= (PART_FRAME | PART_HANDLES); draw_handles = (draw_parts & PART_HANDLES); for (part = PART_BORDER_N; (part & PART_FRAME); part <<= 1) { if (part & draw_parts) { border_draw_one_border_part( cd, fw, &br->sidebar_g, frame_g, br, part, draw_handles, (pressed_parts & part) ? True : False, do_clear); } } return; } /* * * Draws a little pattern within a window (more complex) * */ static void border_draw_vector_to_pixmap( Pixmap dest_pix, common_decorations_type *cd, int is_toggled, struct vector_coords *coords, rectangle *pixmap_g) { GC gcs[4]; int i; if (coords->use_fgbg == 1) { Globalgcv.foreground = cd->fore_color; Globalgcm = GCForeground; XChangeGC(dpy, Scr.ScratchGC3, Globalgcm, &Globalgcv); Globalgcv.foreground = cd->back_color; XChangeGC(dpy, Scr.ScratchGC4, Globalgcm, &Globalgcv); gcs[3] = Scr.ScratchGC3; /* @3 is fg */ gcs[2] = Scr.ScratchGC4; /* @2 is bg */ } if (is_toggled) { gcs[0] = cd->relief_gc; gcs[1] = cd->shadow_gc; } else { gcs[0] = cd->shadow_gc; gcs[1] = cd->relief_gc; } for (i = 1; i < coords->num; i++) { if (coords->c[i] < 0 || coords->c[i] >= 4) { /* don't draw a line */ continue; } XDrawLine( dpy, dest_pix, gcs[coords->c[i]], pixmap_g->width * coords->x[i-1] / 100 + coords->xoff[i-1], pixmap_g->height * coords->y[i-1] / 100 + coords->yoff[i-1], pixmap_g->width * coords->x[i] / 100 + coords->xoff[i], pixmap_g->height * coords->y[i] / 100 + coords->yoff[i]); } return; } /* * * Handle Title pixmaps used for UseTitleStyle * */ static void border_setup_bar_pixmaps( titlebar_descr *td, dynamic_common_decorations *dcd, DecorFace *df, ButtonState bs) { int count = dcd->bar_pixmaps[bs].count; DecorFace *tsdf; int i, j, mp_part_left, mp_part_right; if (count != 0) { /* ok */ return; } for (tsdf = df; tsdf != NULL; tsdf = tsdf->next) { if (DFS_FACE_TYPE(tsdf->style) == ColorsetButton) { count++; } else if (DFS_FACE_TYPE(tsdf->style) == MultiPixmap) { border_mp_get_use_title_style_parts_and_geometry( td, tsdf->u.mp.pixmaps, tsdf->u.mp.acs, tsdf->u.mp.solid_flags, True, NULL, &mp_part_left); border_mp_get_use_title_style_parts_and_geometry( td, tsdf->u.mp.pixmaps, tsdf->u.mp.acs, tsdf->u.mp.solid_flags, False, NULL, &mp_part_right); for (j = 0; j < UTS_TBMP_NUM_PIXMAPS; j++) { if (j != mp_part_left && j != mp_part_right) { continue; } if (tsdf->u.mp.acs[j].cs >= 0 || tsdf->u.mp.pixmaps[j]) { count++; } } } } if (count == 0) { dcd->bar_pixmaps[bs].count = -1; return; } else { dcd->bar_pixmaps[bs].bps = (bar_pixmap *)safemalloc(count*sizeof(bar_pixmap)); } dcd->bar_pixmaps[bs].count = count; i = 0; for (tsdf = df; tsdf != NULL; tsdf = tsdf->next) { if (DFS_FACE_TYPE(tsdf->style) == ColorsetButton) { dcd->bar_pixmaps[bs].bps[i].p = None; dcd->bar_pixmaps[bs].bps[i].mp_created_pic = NULL; dcd->bar_pixmaps[bs].bps[i].cs = tsdf->u.acs.cs; dcd->bar_pixmaps[bs].bps[i].mp_pic = NULL; dcd->bar_pixmaps[bs].bps[i].created = 0; dcd->bar_pixmaps[bs].bps[i].mp_part = TBMP_NONE; i++; } else if (DFS_FACE_TYPE(tsdf->style) == MultiPixmap) { border_mp_get_use_title_style_parts_and_geometry( td, tsdf->u.mp.pixmaps, tsdf->u.mp.acs, tsdf->u.mp.solid_flags, True, NULL, &mp_part_left); border_mp_get_use_title_style_parts_and_geometry( td, tsdf->u.mp.pixmaps, tsdf->u.mp.acs, tsdf->u.mp.solid_flags, False, NULL, &mp_part_right); for (j = 0; j < UTS_TBMP_NUM_PIXMAPS; j++) { if (j != mp_part_left && j != mp_part_right) { continue; } if (tsdf->u.mp.acs[j].cs >= 0 || tsdf->u.mp.pixmaps[j]) { dcd->bar_pixmaps[bs].bps[i].p = None; dcd->bar_pixmaps[bs].bps[i]. mp_created_pic = NULL; dcd->bar_pixmaps[bs].bps[i].cs = tsdf->u.mp.acs[j].cs; dcd->bar_pixmaps[bs].bps[i].mp_pic = tsdf->u.mp.pixmaps[j]; dcd->bar_pixmaps[bs].bps[i].created = 0; dcd->bar_pixmaps[bs].bps[i].mp_part = j; i++; } } } } } static Pixmap border_get_bar_pixmaps( dynamic_common_decorations *dcd, rectangle *bar_g, ButtonState bs, int cset, FvwmPicture *mp_pic, int mp_part, int stretch, FvwmPicture **mp_ret_pic) { ButtonState b; int i,j; int count = dcd->bar_pixmaps[bs].count; if (count <= 0) { return None; } i = 0; while(i < count && (dcd->bar_pixmaps[bs].bps[i].cs != cset || dcd->bar_pixmaps[bs].bps[i].mp_part != mp_part || dcd->bar_pixmaps[bs].bps[i].mp_pic != mp_pic)) { i++; } if (i == count) { return None; } if (mp_ret_pic) { *mp_ret_pic = dcd->bar_pixmaps[bs].bps[i].mp_created_pic; } if (dcd->bar_pixmaps[bs].bps[i].p == None) { /* see if we have it */ b = 0; while (b < BS_MaxButtonState) { int c = dcd->bar_pixmaps[b].count; j = 0; while(j < c && (dcd->bar_pixmaps[b].bps[j].cs != cset || dcd->bar_pixmaps[b].bps[j].mp_part != mp_part || dcd->bar_pixmaps[b].bps[j].mp_pic != mp_pic)) { j++; } if (j < c && dcd->bar_pixmaps[b].bps[j].p) { dcd->bar_pixmaps[bs].bps[i].p = dcd->bar_pixmaps[b].bps[j].p; if (mp_pic && mp_ret_pic) { *mp_ret_pic = dcd->bar_pixmaps[bs].bps[i]. mp_created_pic = dcd->bar_pixmaps[b].bps[j]. mp_created_pic; } break; } b++; } } if (dcd->bar_pixmaps[bs].bps[i].p == None) { if (cset >= 0) { dcd->bar_pixmaps[bs].bps[i].p = CreateBackgroundPixmap( dpy, Scr.NoFocusWin, bar_g->width, bar_g->height, &Colorset[cset], Pdepth, Scr.BordersGC, False); dcd->bar_pixmaps[bs].bps[i].created = True; } else if (mp_pic && mp_ret_pic) { if (stretch) { dcd->bar_pixmaps[bs].bps[i].mp_created_pic = PGraphicsCreateStretchPicture( dpy, Scr.NoFocusWin, mp_pic, bar_g->width, bar_g->height, Scr.BordersGC, Scr.MonoGC, Scr.AlphaGC); } else { dcd->bar_pixmaps[bs].bps[i].mp_created_pic = PGraphicsCreateTiledPicture( dpy, Scr.NoFocusWin, mp_pic, bar_g->width, bar_g->height, Scr.BordersGC, Scr.MonoGC, Scr.AlphaGC); } if (dcd->bar_pixmaps[bs].bps[i].mp_created_pic) { dcd->bar_pixmaps[bs].bps[i].created = True; *mp_ret_pic = dcd->bar_pixmaps[bs].bps[i]. mp_created_pic; dcd->bar_pixmaps[bs].bps[i].p = dcd->bar_pixmaps[bs].bps[i]. mp_created_pic->picture; } } } return dcd->bar_pixmaps[bs].bps[i].p; } static void border_free_bar_pixmaps( dynamic_common_decorations *dcd) { ButtonState bs; int i; for (bs = 0; bs < BS_MaxButtonState; bs++) { if (dcd->bar_pixmaps[bs].count < 1) { continue; } for (i = 0; i < dcd->bar_pixmaps[bs].count; i++) { if (dcd->bar_pixmaps[bs].bps[i].mp_created_pic && dcd->bar_pixmaps[bs].bps[i].created) { PDestroyFvwmPicture( dpy, dcd->bar_pixmaps[bs].bps[i]. mp_created_pic); } else if (dcd->bar_pixmaps[bs].bps[i].p != None && dcd->bar_pixmaps[bs].bps[i].created) { XFreePixmap( dpy, dcd->bar_pixmaps[bs].bps[i].p); } } free(dcd->bar_pixmaps[bs].bps); } } /* * * MultiPixmap (aka, fancy title bar) (tril@igs.net) * */ #define TBMP_HAS_PART(p, pm, acs, sf) \ (pm[p] || acs[p].cs >= 0 || (sf & (1 << p))) /* Tile or stretch src into dest, starting at the given location and * continuing for the given width and height. This is a utility function used * by border_mp_draw_mp_titlebar. (tril@igs.net) */ static void border_mp_render_into_pixmap( titlebar_descr *td, common_decorations_type *cd, FvwmPicture **src, FvwmAcs *acs, Pixel *pixels, unsigned short solid_flags, unsigned short stretch_flags, int part, Pixmap dest, Window w, rectangle *full_g, rectangle *title_g, ButtonState bs, rectangle *g) { int x = 0; int y = 0; pixmap_background_type bg; rectangle dest_g; dynamic_common_decorations *dcd; dcd = &cd->dynamic_cd; /* setup some default */ bg.pixmap.fra.mask = 0; bg.pixmap.flags.is_stretched = 0; bg.pixmap.flags.is_tiled = 0; bg.flags.use_pixmap = 1; bg.pixmap.p = bg.pixmap.alpha = bg.pixmap.shape = None; bg.pixmap.g.x = 0; bg.pixmap.g.y = 0; dest_g.width = g->width + g->x; dest_g.height = g->height + g->y; dest_g.x = g->x; dest_g.y = g->y; if (solid_flags & (1 << part)) { bg.flags.use_pixmap = 0; bg.pixel = pixels[part]; border_fill_pixmap_background(dest, &dest_g, &bg, cd); return; } else if (acs[part].cs >= 0) { Pixmap p = None; bg.pixmap.fra.mask = FRAM_HAVE_ADDED_ALPHA; bg.pixmap.fra.added_alpha_percent = acs[part].alpha_percent; if (CSET_IS_TRANSPARENT_PR(acs[part].cs)) { return; } if (CSET_IS_TRANSPARENT_ROOT(acs[part].cs)) { p = border_create_root_transparent_pixmap( td, w, g->width + g->x, g->height + g->y, acs[part].cs); bg.pixmap.p = p; bg.pixmap.depth = Pdepth; bg.pixmap.g.width = g->width; bg.pixmap.g.height = g->height; bg.pixmap.g.x = g->x; bg.pixmap.g.y = g->y; } else if (full_g != NULL) { bg.pixmap.p = border_get_bar_pixmaps( dcd, full_g, bs, acs[part].cs, NULL, part, (stretch_flags & (1 << part)), NULL); if (bg.pixmap.p) { if (part != TBMP_RIGHT_MAIN) { /* left buttons offset */ x = title_g->x - full_g->x; y = title_g->y - full_g->y; } bg.pixmap.g.width = full_g->width; bg.pixmap.g.height = full_g->height; bg.pixmap.flags.is_tiled = 1; bg.pixmap.g.x = x; bg.pixmap.g.y = y; bg.pixmap.depth = Pdepth; } } if (!bg.pixmap.p) { int bg_w, bg_h; p = CreateBackgroundPixmap( dpy, w, g->width, g->height, &Colorset[acs[part].cs], Pdepth, Scr.BordersGC, False); bg.pixmap.p = p; GetWindowBackgroundPixmapSize( &Colorset[acs[part].cs], g->width, g->height, &bg_w, &bg_h); bg.pixmap.g.width = bg_w; bg.pixmap.g.height = bg_h; bg.pixmap.depth = Pdepth; bg.pixmap.flags.is_tiled = 1; } if (bg.pixmap.p) { border_fill_pixmap_background(dest, &dest_g, &bg, cd); } if (p) { XFreePixmap(dpy, p); } } else if (src[part]) { FvwmPicture *full_pic = NULL; Pixmap p; if (full_g != NULL) { p = border_get_bar_pixmaps( dcd, full_g, bs, -1, src[part], part, (stretch_flags & (1 << part)), &full_pic); if (p && full_pic) { if (part != TBMP_RIGHT_MAIN) { /* left buttons offset */ x = title_g->x - full_g->x; y = title_g->y - full_g->y; } bg.pixmap.p = full_pic->picture; bg.pixmap.shape = full_pic->mask; bg.pixmap.alpha = full_pic->alpha; bg.pixmap.depth = full_pic->depth; bg.pixmap.g.width = full_pic->width; bg.pixmap.g.height = full_pic->height; bg.pixmap.g.x = x; bg.pixmap.g.y = y; } } if (!bg.pixmap.p) { if (stretch_flags & (1 << part)) { bg.pixmap.flags.is_stretched = 1; } else { bg.pixmap.flags.is_tiled = 1; } bg.pixmap.p = src[part]->picture; bg.pixmap.shape = src[part]->mask; bg.pixmap.alpha = src[part]->alpha; bg.pixmap.depth = src[part]->depth; bg.pixmap.g.width = src[part]->width; bg.pixmap.g.height = src[part]->height; bg.pixmap.stretch_w = dest_g.width - dest_g.x; bg.pixmap.stretch_h = dest_g.height - dest_g.y; } if (bg.pixmap.p) { border_fill_pixmap_background(dest, &dest_g, &bg, cd); } } return; } static int border_mp_get_length( titlebar_descr *td, FvwmPicture **pm, FvwmAcs *acs, unsigned int solid_flags, int part) { if (acs[part].cs >= 0 || (solid_flags & (1 << part))) { /* arbitrary */ if (td->has_vt) { return td->bar_g.width/2; } else { return td->bar_g.height/2; } } if (pm[part] == NULL) { return 0; } else if (td->has_vt) { return pm[part]->height; } else { return pm[part]->width; } } /* geometries relatively to the frame */ static void border_mp_get_titlebar_descr( FvwmWindow *fw, titlebar_descr *td, DecorFace *df) { DecorFace *tsdf; FvwmPicture **pm; FvwmAcs *acs; int add,tmpi; int left_of_text = 0; int right_of_text = 0; int left_end = 0; int right_end = 0; int before_space, after_space, under_offset, under_width; Bool has_mp = False; JustificationType just; unsigned short sf; int is_start = 0; just = TB_JUSTIFICATION(GetDecor(fw, titlebar)); /* first compute under text width */ if (td->length > 0) { under_width = td->length + 2*TBMP_TITLE_PADDING; } else { under_width = 0; } if (under_width > fw->title_length) { under_width = fw->title_length; td->offset = (fw->title_length - td->length) / 2; just = JUST_CENTER; } for (tsdf = df; tsdf != NULL; tsdf = tsdf->next) { if (tsdf->style.face_type != MultiPixmap) { continue; } has_mp = True; acs = tsdf->u.mp.acs; pm = tsdf->u.mp.pixmaps; sf = tsdf->u.mp.solid_flags; add = border_mp_get_length( td, pm, acs, sf, TBMP_LEFT_OF_TEXT); if (add > left_of_text && add + left_end + right_of_text + right_end + under_width + 2*TBMP_MIN_RL_TITLE_LENGTH <= fw->title_length) { left_of_text = add; } add = border_mp_get_length( td, pm, acs, sf, TBMP_RIGHT_OF_TEXT); if (add > right_of_text && add + left_end + left_of_text + right_end + under_width + 2*TBMP_MIN_RL_TITLE_LENGTH <= fw->title_length) { right_of_text = add; } add = border_mp_get_length( td, pm, acs, sf, TBMP_LEFT_END); if (add > left_end && add + right_of_text + left_of_text + right_end + under_width + 2*TBMP_MIN_RL_TITLE_LENGTH <= fw->title_length) { left_end = add; } add = border_mp_get_length( td, pm, acs, sf, TBMP_RIGHT_END); if (add > right_end && add + right_of_text + left_of_text + left_end + under_width + 2*TBMP_MIN_RL_TITLE_LENGTH <= fw->title_length) { right_end = add; } } if (!has_mp) { return; } switch (just) { case JUST_LEFT: is_start = 1; /* fall through */ case JUST_RIGHT: if (td->has_an_upsidedown_rotation) { is_start = !is_start; } if (is_start) { if (td->has_an_upsidedown_rotation) { td->offset = max( td->offset, right_of_text + right_end + TBMP_MIN_RL_TITLE_LENGTH + TBMP_TITLE_PADDING); } else { td->offset = max( td->offset, left_of_text + left_end + TBMP_MIN_RL_TITLE_LENGTH + TBMP_TITLE_PADDING); } } else { if (td->has_an_upsidedown_rotation) { td->offset = min( td->offset, fw->title_length - (td->length + left_of_text + left_end + TBMP_MIN_RL_TITLE_LENGTH + TBMP_TITLE_PADDING)); } else { td->offset = min( td->offset, fw->title_length - (td->length + right_of_text + right_end + TBMP_MIN_RL_TITLE_LENGTH + TBMP_TITLE_PADDING)); } } break; case JUST_CENTER: default: break; } under_offset = td->offset - (under_width - td->length)/2; before_space = under_offset; if (td->has_vt) { after_space = td->layout.title_g.height - before_space - under_width; } else { after_space = td->layout.title_g.width - before_space - under_width; } if (td->has_an_upsidedown_rotation) { td->left_end_length = right_end; td->left_of_text_length = right_of_text; td->right_of_text_length = left_of_text; td->right_end_length = left_end; tmpi = before_space; before_space = after_space; after_space = tmpi; } else { td->left_end_length = left_end; td->left_of_text_length = left_of_text; td->right_of_text_length = right_of_text; td->right_end_length = right_end; } if (td->has_vt) { td->under_text_g.width = td->bar_g.width; td->under_text_g.height = under_width; td->under_text_g.x = 0; td->under_text_g.y = under_offset; } else { td->under_text_g.height = td->bar_g.height; td->under_text_g.width = under_width; td->under_text_g.x = under_offset; td->under_text_g.y = 0; } /* width & height */ if (td->has_vt) { /* left */ td->full_left_main_g.width = td->bar_g.width; td->full_left_main_g.height = before_space + td->left_buttons_g.height; td->left_main_g.width = td->bar_g.width; td->left_main_g.height = before_space; /* right */ td->full_right_main_g.width = td->bar_g.width; td->full_right_main_g.height = after_space + td->right_buttons_g.height; td->right_main_g.width = td->bar_g.width; td->right_main_g.height = after_space; } else { /* left */ td->full_left_main_g.height = td->bar_g.height; td->full_left_main_g.width = before_space + td->left_buttons_g.width; td->left_main_g.height = td->bar_g.height; td->left_main_g.width = before_space; /* right */ td->full_right_main_g.height = td->bar_g.height; td->full_right_main_g.width = after_space + td->right_buttons_g.width; td->right_main_g.height = td->bar_g.height; td->right_main_g.width = after_space; } /* position */ if (td->has_an_upsidedown_rotation) { td->full_right_main_g.x = td->bar_g.x; td->full_right_main_g.y = td->bar_g.y; td->right_main_g.x = 0; td->right_main_g.y = 0; } else { td->full_left_main_g.x = td->bar_g.x; td->full_left_main_g.y = td->bar_g.y; td->left_main_g.x = 0; td->left_main_g.y = 0; } if (td->has_vt) { if (td->has_an_upsidedown_rotation) { td->full_left_main_g.x = td->bar_g.x; td->full_left_main_g.y = td->full_right_main_g.height + td->bar_g.y + td->under_text_g.height; td->left_main_g.y = td->under_text_g.y + td->under_text_g.height; td->left_main_g.x = 0; } else { td->full_right_main_g.x = td->bar_g.x; td->full_right_main_g.y = td->full_left_main_g.height + td->bar_g.y + td->under_text_g.height; td->right_main_g.y = td->under_text_g.y + td->under_text_g.height; td->right_main_g.x = 0; } } else { if (td->has_an_upsidedown_rotation) { td->full_left_main_g.x = td->full_right_main_g.width + td->bar_g.x + td->under_text_g.width; td->full_left_main_g.y = td->bar_g.y; td->left_main_g.x = td->under_text_g.x + td->under_text_g.width; td->left_main_g.y = 0; } else { td->full_right_main_g.x = td->full_left_main_g.width + td->bar_g.x + td->under_text_g.width; td->full_right_main_g.y = td->bar_g.y; td->right_main_g.x = td->under_text_g.x + td->under_text_g.width; td->right_main_g.y = 0; } } } /* the returned geometries are relative to the titlebar (not the frame) */ static void border_mp_get_extreme_geometry( titlebar_descr *td, FvwmPicture **pm, FvwmAcs *acs, unsigned short sf, rectangle *left_of_text_g, rectangle *right_of_text_g, rectangle *left_end_g, rectangle *right_end_g) { int left_of_text = 0; int right_of_text = 0; int left_end = 0; int right_end = 0; left_of_text = border_mp_get_length( td, pm, acs, sf, TBMP_LEFT_OF_TEXT); left_end = border_mp_get_length( td, pm, acs, sf, TBMP_LEFT_END); right_of_text = border_mp_get_length( td, pm, acs, sf, TBMP_RIGHT_OF_TEXT); right_end = border_mp_get_length( td, pm, acs, sf, TBMP_RIGHT_END); if (left_of_text > 0 && left_of_text <= td->left_of_text_length) { if (td->has_vt) { left_of_text_g->y = td->under_text_g.y - left_of_text; left_of_text_g->x = 0; left_of_text_g->height = left_of_text; left_of_text_g->width = td->bar_g.width; } else { left_of_text_g->x = td->under_text_g.x - left_of_text; left_of_text_g->y = 0; left_of_text_g->width = left_of_text; left_of_text_g->height = td->bar_g.height; } } else { left_of_text_g->x = 0; left_of_text_g->y = 0; left_of_text_g->width = 0; left_of_text_g->height = 0; } if (right_of_text > 0 && right_of_text <= td->right_of_text_length) { if (td->has_vt) { right_of_text_g->y = td->under_text_g.y + td->under_text_g.height; right_of_text_g->x = 0; right_of_text_g->height = right_of_text; right_of_text_g->width = td->bar_g.width; } else { right_of_text_g->x = td->under_text_g.x + td->under_text_g.width; right_of_text_g->y = 0; right_of_text_g->width = right_of_text; right_of_text_g->height = td->bar_g.height; } } else { right_of_text_g->x = 0; right_of_text_g->y = 0; right_of_text_g->width = 0; right_of_text_g->height = 0; } if (left_end > 0 && left_end <= td->left_end_length) { if (td->has_vt) { left_end_g->y = 0; left_end_g->x = 0; left_end_g->height = left_end; left_end_g->width = td->bar_g.width; } else { left_end_g->x = 0; left_end_g->y = 0; left_end_g->width = left_end; left_end_g->height = td->bar_g.height; } } else { left_end_g->x = 0; left_end_g->y = 0; left_end_g->width = 0; left_end_g->height = 0; } if (right_end > 0 && right_end <= td->right_end_length) { if (td->has_vt) { right_end_g->y = td->layout.title_g.height - right_end; right_end_g->x = 0; right_end_g->height = right_end; right_end_g->width = td->bar_g.width; } else { right_end_g->x = td->layout.title_g.width - right_end; right_end_g->y = 0; right_end_g->width = right_end; right_end_g->height = td->bar_g.height; } } else { right_end_g->x = 0; right_end_g->y = 0; right_end_g->width = 0; right_end_g->height = 0; } return; } static Bool border_mp_get_use_title_style_parts_and_geometry( titlebar_descr *td, FvwmPicture **pm, FvwmAcs *acs, unsigned short sf, int is_left, rectangle *g, int *part) { rectangle *tmp_g = NULL; Bool g_ok = True; if (is_left && TBMP_HAS_PART(TBMP_LEFT_BUTTONS, pm, acs, sf)) { *part = TBMP_LEFT_BUTTONS; tmp_g = &td->left_buttons_g; } else if (!is_left && TBMP_HAS_PART(TBMP_RIGHT_BUTTONS, pm, acs, sf)) { *part = TBMP_RIGHT_BUTTONS; tmp_g = &td->right_buttons_g; } else if (is_left && TBMP_HAS_PART(TBMP_LEFT_MAIN, pm, acs, sf)) { *part = TBMP_LEFT_MAIN; tmp_g = &td->full_left_main_g; } else if (!is_left && TBMP_HAS_PART(TBMP_RIGHT_MAIN, pm, acs, sf)) { *part = TBMP_RIGHT_MAIN; tmp_g = &td->full_right_main_g; } else if (TBMP_HAS_PART(TBMP_MAIN, pm, acs, sf)) { *part = TBMP_MAIN; tmp_g = &(td->bar_g); } else { *part = TBMP_NONE; } if (g && tmp_g) { g->x = tmp_g->x; g->y = tmp_g->y; g->width = tmp_g->width; g->height = tmp_g->height; g_ok = True; } return g_ok; } /* Redraws multi-pixmap titlebar (tril@igs.net) */ static void border_mp_draw_mp_titlebar( FvwmWindow *fw, titlebar_descr *td, DecorFace *df, Pixmap dest_pix, Window w) { FvwmPicture **pm; FvwmAcs *acs; Pixel *pixels; unsigned short solid_flags; unsigned short stretch_flags; rectangle tmp_g, left_of_text_g,left_end_g,right_of_text_g,right_end_g; ButtonState bs; bs = td->tbstate.tstate; pm = df->u.mp.pixmaps; acs = df->u.mp.acs; pixels = df->u.mp.pixels; stretch_flags = df->u.mp.stretch_flags; solid_flags = df->u.mp.solid_flags; tmp_g.x = 0; tmp_g.y = 0; tmp_g.width = td->layout.title_g.width; tmp_g.height = td->layout.title_g.height; if (TBMP_HAS_PART(TBMP_MAIN, pm, acs, solid_flags)) { border_mp_render_into_pixmap( td, td->cd, pm, acs, pixels, solid_flags, stretch_flags, TBMP_MAIN, dest_pix, w, &td->bar_g, &td->layout.title_g, bs, &tmp_g); } else if (td->length <= 0) { border_mp_render_into_pixmap( td, td->cd, pm, acs, pixels, solid_flags, stretch_flags, TBMP_LEFT_MAIN, dest_pix, w, NULL, &td->layout.title_g, bs, &tmp_g); } border_mp_get_extreme_geometry( td, pm, acs, solid_flags, &left_of_text_g, &right_of_text_g, &left_end_g, &right_end_g); if (td->length > 0) { if (TBMP_HAS_PART(TBMP_LEFT_MAIN, pm, acs, solid_flags) && td->left_main_g.width > 0 && td->left_main_g.height > 0) { border_mp_render_into_pixmap( td, td->cd, pm, acs, pixels, solid_flags, stretch_flags, TBMP_LEFT_MAIN, dest_pix, w, &td->full_left_main_g, &td->layout.title_g, bs, &td->left_main_g); } if (TBMP_HAS_PART(TBMP_RIGHT_MAIN, pm, acs, solid_flags) && td->right_main_g.width > 0 && td->right_main_g.height > 0) { border_mp_render_into_pixmap( td, td->cd, pm, acs, pixels, solid_flags, stretch_flags, TBMP_RIGHT_MAIN, dest_pix, w, &td->full_right_main_g, &td->layout.title_g, bs, &td->right_main_g); } if (TBMP_HAS_PART(TBMP_UNDER_TEXT, pm, acs, solid_flags) && td->under_text_g.width > 0 && td->under_text_g.height > 0) { border_mp_render_into_pixmap( td, td->cd, pm, acs, pixels, solid_flags, stretch_flags, TBMP_UNDER_TEXT, dest_pix, w, NULL, &td->layout.title_g, bs, &td->under_text_g); } if (left_of_text_g.width > 0 && left_of_text_g.height > 0) { border_mp_render_into_pixmap( td, td->cd, pm, acs, pixels, solid_flags, stretch_flags, TBMP_LEFT_OF_TEXT, dest_pix, w, NULL, &td->layout.title_g, bs, &left_of_text_g); } if (right_of_text_g.width > 0 && right_of_text_g.height > 0) { border_mp_render_into_pixmap( td, td->cd, pm, acs, pixels, solid_flags, stretch_flags, TBMP_RIGHT_OF_TEXT, dest_pix, w, NULL, &td->layout.title_g, bs, &right_of_text_g); } } if (left_end_g.width > 0 && left_end_g.height > 0) { border_mp_render_into_pixmap( td, td->cd, pm, acs, pixels, solid_flags, stretch_flags, TBMP_LEFT_END, dest_pix, w, NULL, &td->layout.title_g, bs, &left_end_g); } if (right_end_g.width > 0 && right_end_g.height > 0) { border_mp_render_into_pixmap( td, td->cd, pm, acs, pixels, solid_flags, stretch_flags, TBMP_RIGHT_END, dest_pix, w, NULL, &td->layout.title_g, bs, &right_end_g); } return; } /* * * draw title bar and buttons * */ static void border_draw_decor_to_pixmap( FvwmWindow *fw, Pixmap dest_pix, Window w, pixmap_background_type *solid_bg, rectangle *w_g, DecorFace *df, titlebar_descr *td, ButtonState bs, int use_title_style, int is_toggled, int left1right0) { register DecorFaceType type = DFS_FACE_TYPE(df->style); pixmap_background_type bg; rectangle dest_g; FvwmPicture *p; int width,height; int border; int lr_just, tb_just; common_decorations_type *cd; cd = td->cd; /* setup some default */ bg.pixmap.fra.mask = 0; bg.pixmap.flags.is_stretched = 0; bg.pixmap.flags.is_tiled = 0; bg.flags.use_pixmap = 0; bg.pixmap.g.x = 0; bg.pixmap.g.y = 0; if (DFS_BUTTON_RELIEF(df->style) == DFS_BUTTON_IS_FLAT) { border = 0; } else { border = HAS_MWM_BORDER(fw) ? 1 : 2; } dest_g.width = w_g->width; dest_g.height = w_g->height; dest_g.x = border; dest_g.y = border; switch (type) { case SimpleButton: /* do nothing */ break; case SolidButton: /* overwrite with the default background */ dest_g.x = 0; dest_g.y = 0; border_fill_pixmap_background(dest_pix, &dest_g, solid_bg, cd); break; case VectorButton: case DefaultVectorButton: border_draw_vector_to_pixmap( dest_pix, cd, is_toggled, &df->u.vector, w_g); break; case MiniIconButton: case PixmapButton: case ShrunkPixmapButton: case StretchedPixmapButton: if (w_g->width - 2*border <= 0 || w_g->height - 2*border <= 0) { break; } if (FMiniIconsSupported && type == MiniIconButton) { if (!fw->mini_icon) { break; } p = fw->mini_icon; if (cd->cs >= 0) { bg.pixmap.fra.mask |= FRAM_HAVE_ICON_CSET; bg.pixmap.fra.colorset = &Colorset[cd->cs]; } } else { p = df->u.p; } width = p->width; height = p->height; if ((type == ShrunkPixmapButton || type == MiniIconButton) && (p->width > w_g->width - 2*border || p->height > w_g->height - 2*border)) { /* do so that the picture fit into the destination */ bg.pixmap.stretch_w = width = min(w_g->width - 2*border, p->width); bg.pixmap.stretch_h = height = min(w_g->height - 2*border, p->height); bg.pixmap.flags.is_stretched = 1; } else if (type == StretchedPixmapButton && (p->width < w_g->width - 2*border || p->height < w_g->height - 2*border)) { /* do so that the picture fit into the destination */ bg.pixmap.stretch_w = width = max(w_g->width - 2*border, p->width); bg.pixmap.stretch_h = height = max(w_g->height - 2*border, p->height); bg.pixmap.flags.is_stretched = 1; } lr_just = DFS_H_JUSTIFICATION(df->style); tb_just = DFS_V_JUSTIFICATION(df->style); if (!td->td_is_rotated && fw->title_text_rotation != ROTATION_0) { if (fw->title_text_rotation == ROTATION_180) { switch (lr_just) { case JUST_LEFT: lr_just = JUST_RIGHT; break; case JUST_RIGHT: lr_just = JUST_LEFT; break; case JUST_CENTER: default: break; } switch (tb_just) { case JUST_TOP: tb_just = JUST_BOTTOM; break; case JUST_BOTTOM: tb_just = JUST_TOP; break; case JUST_CENTER: default: break; } } else if (fw->title_text_rotation == ROTATION_90) { switch (lr_just) { case JUST_LEFT: tb_just = JUST_TOP; break; case JUST_RIGHT: tb_just = JUST_BOTTOM; break; case JUST_CENTER: default: tb_just = JUST_CENTER; break; } switch (DFS_V_JUSTIFICATION(df->style)) { case JUST_TOP: lr_just = JUST_RIGHT; break; case JUST_BOTTOM: lr_just = JUST_LEFT; break; case JUST_CENTER: default: lr_just = JUST_CENTER; break; } } else if (fw->title_text_rotation == ROTATION_270) { switch (lr_just) { case JUST_LEFT: tb_just = JUST_BOTTOM; break; case JUST_RIGHT: tb_just = JUST_TOP; break; case JUST_CENTER: default: tb_just = JUST_CENTER; break; } switch (DFS_V_JUSTIFICATION(df->style)) { case JUST_TOP: lr_just = JUST_LEFT; break; case JUST_BOTTOM: lr_just = JUST_RIGHT; break; case JUST_CENTER: default: lr_just = JUST_CENTER; break; } } } switch (lr_just) { case JUST_LEFT: dest_g.x = border; break; case JUST_RIGHT: dest_g.x = (int)(w_g->width - width - border); break; case JUST_CENTER: default: /* round down */ dest_g.x = (int)(w_g->width - width) / 2; break; } switch (tb_just) { case JUST_TOP: dest_g.y = border; break; case JUST_BOTTOM: dest_g.y = (int)(w_g->height - height - border); break; case JUST_CENTER: default: /* round down */ dest_g.y = (int)(w_g->height - height) / 2; break; } if (dest_g.x < border) { dest_g.x = border; } if (dest_g.y < border) { dest_g.y = border; } bg.flags.use_pixmap = 1; bg.pixmap.p = p->picture; bg.pixmap.shape = p->mask; bg.pixmap.alpha = p->alpha; bg.pixmap.depth = p->depth; bg.pixmap.g.width = p->width; bg.pixmap.g.height = p->height; border_fill_pixmap_background(dest_pix, &dest_g, &bg, cd); break; case TiledPixmapButton: case AdjustedPixmapButton: if (w_g->width - 2*border <= 0 || w_g->height - 2*border <= 0) { break; } p = df->u.p; if (type == TiledPixmapButton) { bg.pixmap.flags.is_tiled = 1; } else { bg.pixmap.stretch_w = width = w_g->width - 2*dest_g.x; bg.pixmap.stretch_h = height = w_g->height - 2*dest_g.y; bg.pixmap.flags.is_stretched = 1; } bg.flags.use_pixmap = 1; bg.pixmap.p = p->picture; bg.pixmap.shape = p->mask; bg.pixmap.alpha = p->alpha; bg.pixmap.depth = p->depth; bg.pixmap.g.width = p->width; bg.pixmap.g.height = p->height; border_fill_pixmap_background(dest_pix, &dest_g, &bg, cd); break; case MultiPixmap: /* for UseTitleStyle only */ { int is_left = left1right0; int part = TBMP_NONE; int ap, cs; unsigned int stretch; Pixmap tmp = None; FvwmPicture *full_pic = NULL; rectangle g; dynamic_common_decorations *dcd = &(cd->dynamic_cd); FvwmPicture **pm; FvwmAcs *acs; Pixel *pixels; unsigned short sf; pm = df->u.mp.pixmaps; acs = df->u.mp.acs; pixels = df->u.mp.pixels; sf = df->u.mp.solid_flags; if (!border_mp_get_use_title_style_parts_and_geometry( td, pm, acs, sf, is_left, &g, &part)) { g.width = 0; g.height = 0; g.x = 0; g.y = 0; } if (part == TBMP_NONE) { break; } if (sf & (1 << part)) { bg.flags.use_pixmap = 0; bg.pixel = pixels[part]; border_fill_pixmap_background( dest_pix, &dest_g, &bg, cd); break; } cs = acs[part].cs; ap = acs[part].alpha_percent; if (CSET_IS_TRANSPARENT_PR(cs)) { break; } if (cs >= 0) { bg.pixmap.fra.mask = FRAM_HAVE_ADDED_ALPHA; bg.pixmap.fra.added_alpha_percent = ap; } stretch = !!(df->u.mp.stretch_flags & (1 << part)); bg.flags.use_pixmap = 1; dest_g.x = 0; dest_g.y = 0; if (cs >= 0 && use_title_style && g.width > 0 && g.height > 0 && !CSET_IS_TRANSPARENT_ROOT(cs) && (bg.pixmap.p = border_get_bar_pixmaps( dcd, &g, bs, cs, NULL, part, stretch, NULL)) != None) { bg.pixmap.g.width = g.width; bg.pixmap.g.height = g.height; bg.pixmap.flags.is_tiled = 1; bg.pixmap.g.x = w_g->x - g.x; bg.pixmap.g.y = w_g->y - g.y; bg.pixmap.shape = None; bg.pixmap.alpha = None; bg.pixmap.depth = Pdepth; } else if (CSET_IS_TRANSPARENT_ROOT(cs)) { tmp = border_create_root_transparent_pixmap( td, w, w_g->width, w_g->height, cs); bg.pixmap.p = tmp; bg.pixmap.g.width = w_g->width; bg.pixmap.g.height = w_g->height; bg.pixmap.shape = None; bg.pixmap.alpha = None; bg.pixmap.depth = Pdepth; } else if (cs >= 0) { int bg_w, bg_h; tmp = CreateBackgroundPixmap( dpy, w, w_g->width, w_g->height, &Colorset[cs], Pdepth, Scr.BordersGC, False); bg.pixmap.p = tmp; GetWindowBackgroundPixmapSize( &Colorset[cs], w_g->width, w_g->height, &bg_w, &bg_h); bg.pixmap.g.width = bg_w; bg.pixmap.g.height = bg_h; bg.pixmap.shape = None; bg.pixmap.alpha = None; bg.pixmap.depth = Pdepth; bg.pixmap.flags.is_tiled = 1; } else if (pm[part] && g.width > 0 && g.height > 0 && border_get_bar_pixmaps( dcd, &g, bs, -1, pm[part], part, stretch, &full_pic) != None && full_pic) { bg.pixmap.p = full_pic->picture; bg.pixmap.shape = full_pic->mask; bg.pixmap.alpha = full_pic->alpha; bg.pixmap.depth = full_pic->depth; bg.pixmap.g.width = full_pic->width; bg.pixmap.g.height = full_pic->height; bg.pixmap.g.x = w_g->x - g.x; bg.pixmap.g.y = w_g->y - g.y; } else if (pm[part]) { p = pm[part]; if (df->u.mp.stretch_flags & (1 << part)) { bg.pixmap.flags.is_stretched = 1; } else { bg.pixmap.flags.is_tiled = 1; } bg.pixmap.p = p->picture; bg.pixmap.shape = p->mask; bg.pixmap.alpha = p->alpha; bg.pixmap.depth = p->depth; bg.pixmap.g.width = p->width; bg.pixmap.g.height = p->height; bg.pixmap.stretch_w = dest_g.width - dest_g.x; bg.pixmap.stretch_h = dest_g.height - dest_g.y; } else { /* should not happen */ return; } if (bg.pixmap.p != None) { border_fill_pixmap_background( dest_pix, &dest_g, &bg, cd); } if (tmp != None) { XFreePixmap(dpy, tmp); } break; } case ColorsetButton: { colorset_t *cs_t = &Colorset[df->u.acs.cs]; int cs = df->u.acs.cs; Pixmap tmp = None; int bg_w, bg_h; if (CSET_IS_TRANSPARENT_PR(cs)) { break; } dest_g.x = 0; dest_g.y = 0; if (use_title_style && !CSET_IS_TRANSPARENT_ROOT(cs) && (bg.pixmap.p = border_get_bar_pixmaps( &(cd->dynamic_cd), &(td->bar_g), bs, cs, NULL, TBMP_NONE, 0, NULL)) != None) { bg.pixmap.g.width = td->bar_g.width; bg.pixmap.g.height = td->bar_g.height; bg.pixmap.g.x = w_g->x - td->bar_g.x; bg.pixmap.g.y = w_g->y - td->bar_g.y; } else if (CSET_IS_TRANSPARENT_ROOT(cs)) { tmp = border_create_root_transparent_pixmap( td, w, w_g->width, w_g->height, cs); if (tmp == None) { break; } bg.pixmap.p = tmp; bg.pixmap.g.width = w_g->width; bg.pixmap.g.height = w_g->height; bg.pixmap.shape = None; bg.pixmap.alpha = None; bg.pixmap.depth = Pdepth; } else { tmp = CreateBackgroundPixmap( dpy, w, w_g->width, w_g->height, cs_t, Pdepth, Scr.BordersGC, False); if (tmp == None) { break; } bg.pixmap.p = tmp; GetWindowBackgroundPixmapSize( cs_t, w_g->width, w_g->height, &bg_w, &bg_h); bg.pixmap.g.width = bg_w; bg.pixmap.g.height = bg_h; bg.pixmap.g.x = 0; bg.pixmap.g.y = 0; } bg.flags.use_pixmap = 1; bg.pixmap.shape = None; bg.pixmap.alpha = None; bg.pixmap.depth = Pdepth; bg.pixmap.flags.is_tiled = 1; bg.pixmap.fra.mask = FRAM_HAVE_ADDED_ALPHA; bg.pixmap.fra.added_alpha_percent = df->u.acs.alpha_percent; border_fill_pixmap_background(dest_pix, &dest_g, &bg, cd); if (tmp) { XFreePixmap(dpy, tmp); } break; } case GradientButton: /* draw the gradient into the pixmap */ CreateGradientPixmap( dpy, dest_pix, Scr.TransMaskGC, df->u.grad.gradient_type, 0, 0, df->u.grad.npixels, df->u.grad.xcs, df->u.grad.do_dither, &df->u.grad.d_pixels, &df->u.grad.d_npixels, dest_pix, 0, 0, w_g->width, w_g->height, NULL); break; default: fvwm_msg(ERR, "DrawButton", "unknown button type: %i", type); break; } return; } static void border_set_button_pixmap( FvwmWindow *fw, titlebar_descr *td, int button, Pixmap *dest_pix, Window w) { pixmap_background_type bg; unsigned int mask; int is_left_button; int do_reverse_relief; ButtonState bs; DecorFace *df; rectangle *button_g; GC rgc; GC sgc; Bool free_bg_pixmap = False; rectangle pix_g; /* prepare variables */ mask = (1 << button); if (td->has_an_upsidedown_rotation) { is_left_button = (button & 1); } else { is_left_button = !(button & 1); } button_g = &td->layout.button_g[button]; bs = td->tbstate.bstate[button]; df = &TB_STATE(GetDecor(fw, buttons[button]))[bs]; rgc = td->cd->relief_gc; sgc = td->cd->shadow_gc; /* prepare background, either from the window colour or from the * border style */ if (!DFS_USE_BORDER_STYLE(df->style)) { /* fill with the button background colour */ bg.flags.use_pixmap = 0; bg.pixel = td->cd->back_color; pix_g.x = 0; pix_g.y = 0; pix_g.width = button_g->width; pix_g.height = button_g->height; border_fill_pixmap_background(*dest_pix, &pix_g, &bg, td->cd); } else { /* draw pixmap background inherited from border style */ rectangle relative_g; relative_g.width = td->frame_g.width; relative_g.height = td->frame_g.height; relative_g.x = button_g->x; relative_g.y = button_g->y; border_get_border_background( &bg, td->cd, button_g, &relative_g, &free_bg_pixmap, w); bg.pixmap.g.x = 0; bg.pixmap.g.y = 0; /* set the geometry for drawing the Tiled pixmap; * FIXME: maybe add the relief as offset? */ pix_g.x = 0; pix_g.y = 0; pix_g.width = button_g->width; pix_g.height = button_g->height; border_fill_pixmap_background(*dest_pix, &pix_g, &bg, td->cd); if (free_bg_pixmap && bg.pixmap.p) { XFreePixmap(dpy, bg.pixmap.p); } } /* handle title style */ if (DFS_USE_TITLE_STYLE(df->style)) { /* draw background inherited from title style */ DecorFace *tsdf; Pixmap tmp; if (td->draw_rotation != ROTATION_0) { tmp = CreateRotatedPixmap( dpy, *dest_pix, td->layout.button_g[button].width, td->layout.button_g[button].height, Pdepth, Scr.BordersGC, td->restore_rotation); XFreePixmap(dpy, *dest_pix); *dest_pix = tmp; border_rotate_titlebar_descr(fw, td); button_g = &td->layout.button_g[button]; is_left_button = !(button & 1); } for (tsdf = &TB_STATE(GetDecor(fw, titlebar))[bs]; tsdf != NULL; tsdf = tsdf->next) { bg.pixel = tsdf->u.back; border_draw_decor_to_pixmap( fw, *dest_pix, w, &bg, button_g, tsdf, td, bs, True, (td->tbstate.toggled_bmask & mask), is_left_button); } if (td->draw_rotation != ROTATION_0) { tmp = CreateRotatedPixmap( dpy, *dest_pix, td->layout.button_g[button].width, td->layout.button_g[button].height, Pdepth, Scr.BordersGC, td->draw_rotation); XFreePixmap(dpy, *dest_pix); *dest_pix = tmp; border_rotate_titlebar_descr(fw, td); button_g = &td->layout.button_g[button]; if (td->has_an_upsidedown_rotation) { is_left_button = (button & 1); } else { is_left_button = !(button & 1); } } } /* handle button style */ for ( ; df; df = df->next) { /* draw background from button style */ bg.pixel = df->u.back; border_draw_decor_to_pixmap( fw, *dest_pix, w, &bg, button_g, df, td, bs, False, (td->tbstate.toggled_bmask & mask), is_left_button); } /* draw the button relief */ do_reverse_relief = !!(td->tbstate.pressed_bmask & mask); switch (DFS_BUTTON_RELIEF( TB_STATE(GetDecor(fw, buttons[button]))[bs].style)) { case DFS_BUTTON_IS_SUNK: do_reverse_relief ^= 1; /* fall through*/ case DFS_BUTTON_IS_UP: do_relieve_rectangle( dpy, *dest_pix, 0, 0, button_g->width - 1, button_g->height - 1, (do_reverse_relief) ? sgc : rgc, (do_reverse_relief) ? rgc : sgc, td->cd->relief_width, True); break; default: /* flat */ break; } return; } static void border_draw_one_button( FvwmWindow *fw, titlebar_descr *td, int button) { Pixmap p; /* make a pixmap */ if (td->layout.button_g[button].x < 0 || td->layout.button_g[button].y < 0) { return; } p = border_create_decor_pixmap(td->cd, &(td->layout.button_g[button])); /* set the background tile */ border_set_button_pixmap(fw, td, button, &p, FW_W_BUTTON(fw, button)); /* apply the pixmap and destroy it */ border_set_part_background(FW_W_BUTTON(fw, button), p); XFreePixmap(dpy, p); if ((td->tbstate.clear_bmask & (1 << button)) != 0) { XClearWindow(dpy, FW_W_BUTTON(fw, button)); } return; } static void border_draw_title_stick_lines( FvwmWindow *fw, titlebar_descr *td, title_draw_descr *tdd, Pixmap dest_pix) { int i; int num; int min; int max; int left_x; int left_w; int right_x; int right_w; int under_text_length = 0; int under_text_offset = 0; int right_length = 0; int left_length = 0; rotation_t rotation; if (!( (HAS_STICKY_STIPPLED_TITLE(fw) && (IS_STICKY_ACROSS_PAGES(fw) || IS_STICKY_ACROSS_DESKS(fw))) || HAS_STIPPLED_TITLE(fw))) { return; } if (td->td_is_rotated) { rotation = td->restore_rotation; } else { rotation = ROTATION_0; } if (td->has_vt && td->under_text_g.height > 0) { under_text_length = td->under_text_g.height; under_text_offset = td->under_text_g.y; left_length = td->left_main_g.height - td->left_of_text_length - td->left_end_length; right_length = td->right_main_g.height - td->right_of_text_length - td->right_end_length; } else if (!td->has_vt && td->under_text_g.width > 0) { under_text_length = td->under_text_g.width; under_text_offset = td->under_text_g.x; left_length = td->left_main_g.width - td->left_of_text_length - td->left_end_length; right_length = td->right_main_g.width - td->right_of_text_length - td->right_end_length; } /* If the window is sticky either across pages or * desks and it has a stippled title, but nothing for * sticky_stippled_title, then don't bother drawing them, just * return immediately. -- Thomas Adam */ if ( (IS_STICKY_ACROSS_PAGES(fw) || IS_STICKY_ACROSS_DESKS(fw)) && (!HAS_STICKY_STIPPLED_TITLE(fw) && HAS_STIPPLED_TITLE(fw)) ) { return; } num = (int)(fw->title_thickness / WINDOW_TITLE_STICK_VERT_DIST / 2) * 2 - 1; min = fw->title_thickness / 2 - num * 2 + 1; max = fw->title_thickness / 2 + num * 2 - WINDOW_TITLE_STICK_VERT_DIST + 1; left_x = WINDOW_TITLE_STICK_OFFSET + td->left_end_length; left_w = ((under_text_length == 0)? td->offset:under_text_offset) - left_x - WINDOW_TITLE_TO_STICK_GAP - td->left_of_text_length; right_x = ((under_text_length == 0)? td->offset + td->length : under_text_offset + under_text_length) + td->right_of_text_length + WINDOW_TITLE_TO_STICK_GAP - 1; right_w = fw->title_length - right_x - WINDOW_TITLE_STICK_OFFSET - td->right_end_length; /* an odd number of lines every WINDOW_TITLE_STICK_VERT_DIST pixels */ if (left_w < WINDOW_TITLE_STICK_MIN_WIDTH) { left_x = td->left_end_length + ((left_length > WINDOW_TITLE_STICK_MIN_WIDTH)? (left_length - WINDOW_TITLE_STICK_MIN_WIDTH)/2 : 0); left_w = WINDOW_TITLE_STICK_MIN_WIDTH; } if (right_w < WINDOW_TITLE_STICK_MIN_WIDTH) { right_w = WINDOW_TITLE_STICK_MIN_WIDTH; right_x = fw->title_length - WINDOW_TITLE_STICK_MIN_WIDTH - 1 - td->right_end_length - ((right_length > WINDOW_TITLE_STICK_MIN_WIDTH)? (right_length - WINDOW_TITLE_STICK_MIN_WIDTH)/2 : 0); } for (i = min; i <= max; i += WINDOW_TITLE_STICK_VERT_DIST) { if (left_w > 0) { do_relieve_rectangle_with_rotation( dpy, dest_pix, SWAP_ARGS(td->has_vt, left_x, i), SWAP_ARGS(td->has_vt, left_w, 1), tdd->sgc, tdd->rgc, 1, False, rotation); } if (right_w > 0) { do_relieve_rectangle_with_rotation( dpy, dest_pix, SWAP_ARGS(td->has_vt, right_x, i), SWAP_ARGS(td->has_vt, right_w, 1), tdd->sgc, tdd->rgc, 1, False, rotation); } } return; } static void border_draw_title_mono( FvwmWindow *fw, titlebar_descr *td, title_draw_descr *tdd, FlocaleWinString *fstr, Pixmap dest_pix) { int has_vt; has_vt = HAS_VERTICAL_TITLE(fw); XFillRectangle( dpy, dest_pix, td->cd->relief_gc, td->offset - 2, 0, td->length+4, fw->title_thickness); if (fw->visible_name != (char *)NULL) { FlocaleDrawString(dpy, fw->title_font, fstr, 0); } /* for mono, we clear an area in the title bar where the window * title goes, so that its more legible. For color, no need */ do_relieve_rectangle( dpy, dest_pix, 0, 0, SWAP_ARGS(has_vt, td->offset - 3, fw->title_thickness - 1), tdd->rgc, tdd->sgc, td->cd->relief_width, False); do_relieve_rectangle( dpy, dest_pix, SWAP_ARGS(has_vt, td->offset + td->length + 2, 0), SWAP_ARGS(has_vt, fw->title_length - td->length - td->offset - 3, fw->title_thickness - 1), tdd->rgc, tdd->sgc, td->cd->relief_width, False); XDrawLine( dpy, dest_pix, tdd->sgc, SWAP_ARGS(has_vt, 0, td->offset + td->length + 1), SWAP_ARGS(has_vt, td->offset + td->length + 1, fw->title_thickness)); return; } static void border_draw_title_relief( FvwmWindow *fw, titlebar_descr *td, title_draw_descr *tdd, Pixmap dest_pix) { int reverse = 0; rotation_t rotation; if (td->td_is_rotated) { rotation = td->restore_rotation; } else { rotation = ROTATION_0; } /* draw title relief */ switch (DFS_BUTTON_RELIEF(*tdd->tstyle)) { case DFS_BUTTON_IS_SUNK: reverse = 1; case DFS_BUTTON_IS_UP: do_relieve_rectangle_with_rotation( dpy, dest_pix, 0, 0, SWAP_ARGS( td->has_vt, fw->title_length - 1, fw->title_thickness - 1), (reverse) ? tdd->sgc : tdd->rgc, (reverse) ? tdd->rgc : tdd->sgc, td->cd->relief_width, True, rotation); break; default: /* flat */ break; } return; } static void border_draw_title_deep( FvwmWindow *fw, titlebar_descr *td, title_draw_descr *tdd, FlocaleWinString *fstr, Pixmap dest_pix, Window w) { DecorFace *df; pixmap_background_type bg; bg.flags.use_pixmap = 0; for (df = tdd->df; df != NULL; df = df->next) { if (df->style.face_type == MultiPixmap) { border_mp_draw_mp_titlebar( fw, td, df, dest_pix, w); } else { bg.pixel = df->u.back; border_draw_decor_to_pixmap( fw, dest_pix, w, &bg, &td->layout.title_g, df, td, td->tbstate.tstate, True, tdd->is_toggled, 1); } } FlocaleDrawString(dpy, fw->title_font, &tdd->fstr, 0); return; } static void border_get_titlebar_draw_descr( FvwmWindow *fw, titlebar_descr *td, title_draw_descr *tdd, Pixmap dest_pix) { memset(tdd, 0, sizeof(*tdd)); /* prepare the gcs and variables */ if (td->tbstate.is_title_pressed) { tdd->rgc = td->cd->shadow_gc; tdd->sgc = td->cd->relief_gc; } else { tdd->rgc = td->cd->relief_gc; tdd->sgc = td->cd->shadow_gc; } NewFontAndColor(fw->title_font, td->cd->fore_color, td->cd->back_color); tdd->tstyle = &TB_STATE( GetDecor(fw, titlebar))[td->tbstate.tstate].style; tdd->df = &TB_STATE(GetDecor(fw, titlebar))[td->tbstate.tstate]; /* fetch the title string */ tdd->fstr.str = fw->visible_name; tdd->fstr.win = dest_pix; if (td->td_is_rotated) { tdd->fstr.flags.text_rotation = ROTATION_0; } else { tdd->fstr.flags.text_rotation = fw->title_text_rotation; } if (td->has_vt) { tdd->fstr.y = td->offset; tdd->fstr.x = fw->title_text_offset + 1; } else { tdd->fstr.x = td->offset; tdd->fstr.y = fw->title_text_offset + 1; } if (td->cd->cs >= 0) { tdd->fstr.colorset = &Colorset[td->cd->cs]; tdd->fstr.flags.has_colorset = 1; } tdd->fstr.gc = Scr.TitleGC; return; } static void border_set_title_pixmap( FvwmWindow *fw, titlebar_descr *td, Pixmap *dest_pix, Window w) { pixmap_background_type bg; title_draw_descr tdd; FlocaleWinString fstr; Bool free_bg_pixmap = False; rectangle pix_g; border_get_titlebar_draw_descr(fw, td, &tdd, *dest_pix); /* prepare background, either from the window colour or from the * border style */ if (!DFS_USE_BORDER_STYLE(*tdd.tstyle)) { /* fill with the button background colour */ bg.flags.use_pixmap = 0; bg.pixel = td->cd->back_color; pix_g.x = 0; pix_g.y = 0; pix_g.width = td->layout.title_g.width; pix_g.height = td->layout.title_g.height; border_fill_pixmap_background( *dest_pix, &pix_g, &bg, td->cd); } else { /* draw pixmap background inherited from border style */ rectangle relative_g; Pixmap tmp; if (td->draw_rotation != ROTATION_0) { tmp = CreateRotatedPixmap( dpy, *dest_pix, td->layout.title_g.width, td->layout.title_g.height, Pdepth, Scr.BordersGC, td->restore_rotation); XFreePixmap(dpy, *dest_pix); *dest_pix = tmp; border_rotate_titlebar_descr(fw, td); } relative_g.width = td->frame_g.width; relative_g.height = td->frame_g.height; relative_g.x = td->layout.title_g.x; relative_g.y = td->layout.title_g.y; border_get_border_background( &bg, td->cd, &td->layout.title_g, &relative_g, &free_bg_pixmap, w); bg.pixmap.g.x = 0; bg.pixmap.g.y = 0; /* set the geometry for drawing the Tiled pixmap; * FIXME: maybe add the relief as offset? */ pix_g.x = 0; pix_g.y = 0; pix_g.width = td->layout.title_g.width; pix_g.height = td->layout.title_g.height; border_fill_pixmap_background( *dest_pix, &pix_g, &bg, td->cd); if (free_bg_pixmap && bg.pixmap.p) { XFreePixmap(dpy, bg.pixmap.p); } if (td->draw_rotation != ROTATION_0) { tmp = CreateRotatedPixmap( dpy, *dest_pix, td->layout.title_g.width, td->layout.title_g.height, Pdepth, Scr.BordersGC, td->draw_rotation); XFreePixmap(dpy, *dest_pix); *dest_pix = tmp; border_rotate_titlebar_descr(fw, td); } } if (Pdepth < 2) { border_draw_title_mono(fw, td, &tdd, &fstr, *dest_pix); } else { border_draw_title_deep(fw, td, &tdd, &fstr, *dest_pix, w); } border_draw_title_relief(fw, td, &tdd, *dest_pix); border_draw_title_stick_lines(fw, td, &tdd, *dest_pix); return; } static void border_draw_title( FvwmWindow *fw, titlebar_descr *td) { Pixmap p; if (td->layout.title_g.x < 0 || td->layout.title_g.y < 0) { return; } if (td->draw_rotation != ROTATION_0) { border_rotate_titlebar_descr(fw, td); } /* make a pixmap */ p = border_create_decor_pixmap(td->cd, &(td->layout.title_g)); /* set the background tile */ #if 0 fprintf(stderr,"drawing title\n"); #endif border_set_title_pixmap(fw, td, &p, FW_W_TITLE(fw)); if (td->draw_rotation != ROTATION_0) { Pixmap tmp; tmp = CreateRotatedPixmap( dpy, p, td->layout.title_g.width, td->layout.title_g.height, Pdepth, Scr.BordersGC, td->draw_rotation); XFreePixmap(dpy, p); p = tmp; border_rotate_titlebar_descr(fw, td); } /* apply the pixmap and destroy it */ border_set_part_background(FW_W_TITLE(fw), p); XFreePixmap(dpy, p); if (td->tbstate.do_clear_title) { XClearWindow(dpy, FW_W_TITLE(fw)); } return; } static void border_draw_buttons( FvwmWindow *fw, titlebar_descr *td) { int i; /* draw everything in a big loop */ #if 0 fprintf(stderr, "drawing buttons 0x%04x\n", td->tbstate.draw_bmask); #endif for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { unsigned int mask = (1 << i); if ((td->tbstate.draw_bmask & mask) != 0) { border_draw_one_button(fw, td, i); } } /* update the button states */ fw->decor_state.buttons_drawn |= td->tbstate.draw_bmask; fw->decor_state.buttons_inverted = td->tbstate.pressed_bmask; fw->decor_state.buttons_lit = td->tbstate.lit_bmask; fw->decor_state.buttons_toggled = td->tbstate.toggled_bmask; return; } static void border_setup_use_title_style( FvwmWindow *fw, titlebar_descr *td) { int i; DecorFace *df, *tsdf; ButtonState bs, tsbs; /* use a full bar pixmap (for Colorset) or non window size pixmaps * (for MultiPixmap) under certain condition: * - for the buttons which use title style * - for title which have a button with UseTitle style */ tsbs = td->tbstate.tstate; for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { bs = td->tbstate.bstate[i]; df = &TB_STATE(GetDecor(fw, buttons[i]))[bs]; tsdf = &TB_STATE(GetDecor(fw, buttons[i]))[tsbs]; if (FW_W_BUTTON(fw, i) != None) { if (DFS_USE_TITLE_STYLE(df->style)) { border_setup_bar_pixmaps( td, &(td->cd->dynamic_cd), &TB_STATE(GetDecor(fw, titlebar))[bs], bs); } if (DFS_USE_TITLE_STYLE(tsdf->style)) { border_setup_bar_pixmaps( td, &(td->cd->dynamic_cd), &TB_STATE(GetDecor(fw, titlebar))[tsbs], tsbs); } } } return; } static void border_rotate_titlebar_descr( FvwmWindow *fw, titlebar_descr *td) { rotation_t rotation; int i, tmpi; static titlebar_descr saved_td; if (td->draw_rotation == ROTATION_0) { return; } if (!td->has_been_saved) { td->has_been_saved = True; memcpy(&saved_td, td, sizeof(titlebar_descr)); } if (!td->td_is_rotated) { /* make the bar horizontal */ switch(td->draw_rotation) { case ROTATION_90: /* cw */ rotation = ROTATION_270; break; case ROTATION_270: /* ccw */ rotation = ROTATION_90; break; case ROTATION_180: rotation = ROTATION_180; break; default: return; } td->has_vt = 0; td->has_an_upsidedown_rotation = 0; td->td_is_rotated = 1; } else { /* restore */ memcpy(td, &saved_td, sizeof(titlebar_descr)); td->td_is_rotated = 0; return; } #define ROTATE_RECTANGLE(rot, r, vs_frame, vs_titlebar, vs_title) \ { \ rectangle tr; \ tr.x = r->x; \ tr.y = r->y; \ tr.width = r->width; \ tr.height = r->height; \ switch(rot) \ { \ case ROTATION_270: /* ccw */ \ tr.x = r->y; \ if (vs_frame) \ { \ tr.y = td->frame_g.width - (r->x+r->width); \ } \ else if (vs_titlebar) \ { \ tr.y = td->bar_g.width - \ (r->x+r->width); \ } \ else if (vs_title) \ { \ tr.y = td->layout.title_g.width - \ (r->x+r->width); \ } \ else \ { \ tr.y = r->x; \ } \ tr.width = r->height; \ tr.height = r->width; \ break; \ case ROTATION_90: /* cw */ \ if (vs_frame) \ { \ tr.x = td->frame_g.height - (r->y+r->height); \ } \ else if (vs_titlebar) \ { \ tr.x = td->bar_g.height - \ (r->y+r->height); \ } \ else if (vs_title) \ { \ tr.x = td->layout.title_g.height - \ (r->y+r->height); \ } \ else \ { \ tr.x = r->y; \ } \ tr.y = r->x; \ tr.width = r->height; \ tr.height = r->width; \ break; \ case ROTATION_180: \ if (vs_frame) \ { \ tr.x = td->frame_g.width - (r->x+r->width); \ } \ else if (vs_titlebar) \ { \ tr.x = td->bar_g.width - \ (r->x + r->width); \ } \ else if (vs_title) \ { \ tr.x = td->layout.title_g.width - \ (r->x + r->width); \ } \ else \ { \ tr.x = r->x; \ } \ break; \ case ROTATION_0: \ break; \ } \ r->x = tr.x; \ r->y = tr.y; \ r->width = tr.width; \ r->height = tr.height; \ } switch(rotation) { case ROTATION_90: td->offset = td->layout.title_g.height - td->offset - td->length; tmpi = td->left_end_length; td->left_end_length = td->right_end_length; td->right_end_length = tmpi; tmpi = td->left_of_text_length; td->left_of_text_length = td->right_of_text_length; td->right_of_text_length = tmpi; break; case ROTATION_270: break; case ROTATION_180: td->offset = td->layout.title_g.width - td->offset - td->length; tmpi = td->left_end_length; td->left_end_length = td->right_end_length; td->right_end_length = tmpi; tmpi = td->left_of_text_length; td->left_of_text_length = td->right_of_text_length; td->right_of_text_length = tmpi; break; case ROTATION_0: break; } ROTATE_RECTANGLE(rotation, (&td->left_buttons_g), True, False, False) ROTATE_RECTANGLE(rotation, (&td->right_buttons_g), True, False, False) for (i=0; i < NUMBER_OF_TITLE_BUTTONS; i++) { ROTATE_RECTANGLE( rotation, (&td->layout.button_g[i]), True, False, False) } ROTATE_RECTANGLE(rotation, (&td->under_text_g), False, False, True) ROTATE_RECTANGLE(rotation, (&td->left_main_g), False, False, True) ROTATE_RECTANGLE(rotation, (&td->right_main_g), False, False, True) ROTATE_RECTANGLE(rotation, (&td->full_left_main_g), True, False, False) ROTATE_RECTANGLE(rotation, (&td->full_right_main_g), True, False, False) ROTATE_RECTANGLE(rotation, (&td->layout.title_g), True, False, False) ROTATE_RECTANGLE(rotation, (&td->bar_g), True, False, False) ROTATE_RECTANGLE(rotation, (&td->frame_g), False, False, False); #undef ROTATE_RECTANGLE } static void border_get_titlebar_descr_state( FvwmWindow *fw, window_parts pressed_parts, int pressed_button, clear_window_parts clear_parts, Bool do_hilight, border_titlebar_state *tbstate) { int i; if ((pressed_parts & PART_BUTTONS) != PART_NONE && pressed_button >= 0) { tbstate->pressed_bmask = (1 << pressed_button); } else { tbstate->pressed_bmask = 0; } if ((clear_parts & CLEAR_BUTTONS) != CLEAR_NONE) { tbstate->clear_bmask = ~0; } else { tbstate->clear_bmask = 0; } tbstate->lit_bmask = (do_hilight == True) ? ~0 : 0; if ((pressed_parts & PART_TITLE) != PART_NONE) { tbstate->is_title_pressed = 1; } else { tbstate->is_title_pressed = 0; } if ((clear_parts & CLEAR_TITLE) != CLEAR_NONE) { tbstate->do_clear_title = 1; } else { tbstate->do_clear_title = 0; } tbstate->is_title_lit = (do_hilight == True) ? 1 : 0; tbstate->toggled_bmask = 0; for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { unsigned int mask = (1 << i); if (is_button_toggled(fw, i)) { tbstate->toggled_bmask |= mask; } tbstate->bstate[i] = border_flags_to_button_state( tbstate->pressed_bmask & mask, tbstate->lit_bmask & mask, tbstate->toggled_bmask & mask); } tbstate->tstate = border_flags_to_button_state( tbstate->is_title_pressed, tbstate->is_title_lit, 0); } static window_parts border_get_titlebar_descr( common_decorations_type *cd, FvwmWindow *fw, window_parts pressed_parts, int pressed_button, window_parts force_draw_parts, clear_window_parts clear_parts, rectangle *old_g, rectangle *new_g, Bool do_hilight, titlebar_descr *ret_td) { window_parts draw_parts; int i; DecorFace *df; int is_start = 0; JustificationType just; int lbl = 0; int rbl = 0; ret_td->cd = cd; ret_td->frame_g = *new_g; if (old_g == NULL) { old_g = &fw->g.frame; } frame_get_titlebar_dimensions(fw, old_g, NULL, &ret_td->old_layout); frame_get_titlebar_dimensions(fw, new_g, NULL, &ret_td->layout); ret_td->has_vt = HAS_VERTICAL_TITLE(fw); if (USE_TITLE_DECOR_ROTATION(fw)) { ret_td->draw_rotation = fw->title_text_rotation; switch(ret_td->draw_rotation) { case ROTATION_90: ret_td->restore_rotation = ROTATION_270; break; case ROTATION_270: /* ccw */ ret_td->restore_rotation = ROTATION_90; break; case ROTATION_180: ret_td->restore_rotation = ROTATION_180; break; default: break; } } if (fw->title_text_rotation == ROTATION_270 || fw->title_text_rotation == ROTATION_180) { ret_td->has_an_upsidedown_rotation = True; } /* geometry of the title bar title + buttons */ if (!ret_td->has_vt) { ret_td->bar_g.width = new_g->width - 2 * fw->boundary_width; ret_td->bar_g.height = ret_td->layout.title_g.height; ret_td->bar_g.x = fw->boundary_width; ret_td->bar_g.y = ret_td->layout.title_g.y; } else { ret_td->bar_g.width = ret_td->layout.title_g.width; ret_td->bar_g.height = new_g->height - 2 * fw->boundary_width; ret_td->bar_g.y = fw->boundary_width; ret_td->bar_g.x = ret_td->layout.title_g.x; } /* buttons geometries */ if (ret_td->has_vt) { ret_td->left_buttons_g.width = ret_td->bar_g.width; ret_td->right_buttons_g.width = ret_td->bar_g.width; } else { ret_td->left_buttons_g.height = ret_td->bar_g.height; ret_td->right_buttons_g.height = ret_td->bar_g.width; } for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { if (FW_W_BUTTON(fw, i) == None) { continue; } if (ret_td->has_vt) { if (i & 1) { rbl += ret_td->layout.button_g[i].height; } else { lbl += ret_td->layout.button_g[i].height; } } else { if (i & 1) { rbl += ret_td->layout.button_g[i].width; } else { lbl += ret_td->layout.button_g[i].width; } } } if (ret_td->has_an_upsidedown_rotation) { if (ret_td->has_vt) { ret_td->left_buttons_g.height = rbl; ret_td->right_buttons_g.height = lbl; ret_td->right_buttons_g.y = fw->boundary_width; ret_td->right_buttons_g.x = ret_td->bar_g.x; ret_td->left_buttons_g.y = ret_td->layout.title_g.y + ret_td->layout.title_g.height; ret_td->left_buttons_g.x = ret_td->bar_g.x; } else { ret_td->left_buttons_g.width = rbl; ret_td->right_buttons_g.width = lbl; ret_td->right_buttons_g.x = fw->boundary_width; ret_td->right_buttons_g.y = ret_td->bar_g.y; ret_td->left_buttons_g.x = ret_td->layout.title_g.x + ret_td->layout.title_g.width; ret_td->left_buttons_g.y = ret_td->bar_g.y; } } else { if (ret_td->has_vt) { ret_td->left_buttons_g.height = lbl; ret_td->right_buttons_g.height = rbl; ret_td->left_buttons_g.y = fw->boundary_width; ret_td->left_buttons_g.x = ret_td->bar_g.x; ret_td->right_buttons_g.y = ret_td->layout.title_g.y + ret_td->layout.title_g.height; ret_td->right_buttons_g.x = ret_td->bar_g.x; } else { ret_td->left_buttons_g.width = lbl; ret_td->right_buttons_g.width = rbl; ret_td->left_buttons_g.x = fw->boundary_width; ret_td->left_buttons_g.y = ret_td->bar_g.y; ret_td->right_buttons_g.x = ret_td->layout.title_g.x + ret_td->layout.title_g.width; ret_td->right_buttons_g.y = ret_td->bar_g.y; } } /* initialise flags */ border_get_titlebar_descr_state( fw, pressed_parts, pressed_button, clear_parts, do_hilight, &(ret_td->tbstate)); /* get the title string length and position * This is not in "tdd" (titlebar_draw_descr), because these are needed * to draw the buttons with UseTitleStyle */ just = TB_JUSTIFICATION(GetDecor(fw, titlebar)); if (fw->visible_name != (char *)NULL) { ret_td->length = FlocaleTextWidth( fw->title_font, fw->visible_name, (ret_td->has_vt) ? -strlen(fw->visible_name) : strlen(fw->visible_name)); if (ret_td->length > fw->title_length - 2*MIN_WINDOW_TITLE_TEXT_OFFSET) { ret_td->length = fw->title_length - 2*MIN_WINDOW_TITLE_TEXT_OFFSET; just = JUST_CENTER; } if (ret_td->length < 0) { ret_td->length = 0; } } else { ret_td->length = 0; } if (ret_td->length == 0) { just = JUST_CENTER; } df = &TB_STATE(GetDecor(fw, titlebar))[ret_td->tbstate.tstate]; switch (just) { case JUST_LEFT: is_start = 1; /* fall through */ case JUST_RIGHT: if (ret_td->has_an_upsidedown_rotation) { is_start = !is_start; } if (is_start) { if (WINDOW_TITLE_TEXT_OFFSET + ret_td->length <= fw->title_length) { ret_td->offset = WINDOW_TITLE_TEXT_OFFSET; } else { ret_td->offset = fw->title_length - ret_td->length; } } else { ret_td->offset = fw->title_length - ret_td->length - WINDOW_TITLE_TEXT_OFFSET; } break; case JUST_CENTER: default: ret_td->offset = (fw->title_length - ret_td->length) / 2; break; } if (ret_td->offset < MIN_WINDOW_TITLE_TEXT_OFFSET) { ret_td->offset = MIN_WINDOW_TITLE_TEXT_OFFSET; } /* setup MultiPixmap */ border_mp_get_titlebar_descr(fw, ret_td, df); /* determine the parts to draw */ draw_parts = border_get_tb_parts_to_draw( fw, ret_td, old_g, new_g, force_draw_parts); return draw_parts; } static void border_draw_titlebar( common_decorations_type *cd, FvwmWindow *fw, window_parts pressed_parts, int pressed_button, window_parts force_draw_parts, clear_window_parts clear_parts, rectangle *old_g, rectangle *new_g, Bool do_hilight) { window_parts draw_parts; titlebar_descr td; if (!HAS_TITLE(fw)) { /* just reset border states */ fw->decor_state.parts_drawn &= ~(PART_TITLE); fw->decor_state.parts_lit &= ~(PART_TITLE); fw->decor_state.parts_inverted &= ~(PART_TITLE); fw->decor_state.buttons_drawn = 0; fw->decor_state.buttons_lit = 0; fw->decor_state.buttons_inverted = 0; fw->decor_state.buttons_toggled = 0; return; } memset(&td, 0, sizeof(td)); draw_parts = border_get_titlebar_descr( cd, fw, pressed_parts, pressed_button, force_draw_parts, clear_parts, old_g, new_g, do_hilight, &td); if ((draw_parts & PART_TITLE) != PART_NONE || (draw_parts & PART_BUTTONS) != PART_NONE) { /* set up UseTitleStyle Colorset */ border_setup_use_title_style(fw, &td); } if ((draw_parts & PART_TITLE) != PART_NONE) { border_draw_title(fw, &td); } if ((draw_parts & PART_BUTTONS) != PART_NONE) { border_draw_buttons(fw, &td); } border_free_bar_pixmaps(&(td.cd->dynamic_cd)); /* update the decor states */ fw->decor_state.parts_drawn |= draw_parts; if (do_hilight) { fw->decor_state.parts_lit |= draw_parts; } else { fw->decor_state.parts_lit &= ~draw_parts; } fw->decor_state.parts_inverted &= ~draw_parts; fw->decor_state.parts_inverted |= (draw_parts & pressed_parts); if (draw_parts & PART_BUTTONS) { fw->decor_state.buttons_drawn |= td.tbstate.draw_bmask; fw->decor_state.parts_lit = (do_hilight) ? ~0 : 0; if (td.tbstate.pressed_bmask) { fw->decor_state.buttons_inverted = td.tbstate.pressed_bmask; } else { fw->decor_state.buttons_inverted &= ~td.tbstate.draw_bmask; } fw->decor_state.buttons_toggled = (fw->decor_state.buttons_toggled & ~td.tbstate.max_bmask) | td.tbstate.toggled_bmask; } return; } /* * * Redraws the windows borders * */ static void border_draw_border_parts( common_decorations_type *cd, FvwmWindow *fw, window_parts pressed_parts, window_parts force_draw_parts, clear_window_parts clear_parts, rectangle *old_g, rectangle *new_g, Bool do_hilight) { border_relief_descr br; window_parts draw_parts; Bool do_clear; if (HAS_NO_BORDER(fw)) { /* just reset border states */ fw->decor_state.parts_drawn &= ~(PART_FRAME | PART_HANDLES); fw->decor_state.parts_lit &= ~(PART_FRAME | PART_HANDLES); fw->decor_state.parts_inverted &= ~(PART_FRAME | PART_HANDLES); return; } do_clear = (clear_parts & CLEAR_FRAME) ? True : False; /* determine the parts to draw and the position to place them */ if (HAS_DEPRESSABLE_BORDER(fw)) { pressed_parts &= PART_FRAME; } else { pressed_parts = PART_NONE; } force_draw_parts &= PART_FRAME; memset(&br, 0, sizeof(br)); draw_parts = border_get_parts_and_pos_to_draw( cd, fw, pressed_parts, force_draw_parts, old_g, new_g, do_hilight, &br); if ((draw_parts & PART_FRAME) != PART_NONE) { border_draw_all_border_parts( cd, fw, &br, new_g, draw_parts, pressed_parts, do_hilight, do_clear); } /* update the decor states */ fw->decor_state.parts_drawn |= draw_parts; if (do_hilight) { fw->decor_state.parts_lit |= draw_parts; } else { fw->decor_state.parts_lit &= ~draw_parts; } fw->decor_state.parts_inverted &= ~draw_parts; fw->decor_state.parts_inverted |= (draw_parts & pressed_parts); return; } /* ---------------------------- interface functions ------------------------ */ DecorFace *border_get_border_style( FvwmWindow *fw, Bool has_focus) { DecorFace *df; if (has_focus == True) { df = &(GetDecor(fw, BorderStyle.active)); } else { df = &(GetDecor(fw, BorderStyle.inactive)); } return df; } int border_is_using_border_style( FvwmWindow *fw, Bool has_focus) { ButtonState bs; int is_pressed; int is_toggled; int i; /* title */ is_pressed = (FW_W_TITLE(fw) == PressedW); bs = border_flags_to_button_state(is_pressed, has_focus, 0); if (DFS_USE_BORDER_STYLE(TB_STATE(GetDecor(fw, titlebar))[bs].style)) { return 1; } for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { if (FW_W_BUTTON(fw, i) == None) { continue; } is_pressed = (FW_W_BUTTON(fw, i) == PressedW); is_toggled = (is_button_toggled(fw, i) == True); bs = border_flags_to_button_state( is_pressed, (has_focus == True), is_toggled); if (DFS_USE_BORDER_STYLE( TB_STATE(GetDecor(fw, buttons[i]))[bs].style)) { return 1; } } return 0; } int border_context_to_parts( int context) { if (context == C_FRAME || context == C_SIDEBAR || context == (C_FRAME | C_SIDEBAR)) { return PART_FRAME; } else if (context == C_F_TOPLEFT) { return PART_BORDER_NW; } else if (context == C_F_TOPRIGHT) { return PART_BORDER_NE; } else if (context == C_F_BOTTOMLEFT) { return PART_BORDER_SW; } else if (context == C_F_BOTTOMRIGHT) { return PART_BORDER_SE; } else if (context == C_SB_LEFT) { return PART_BORDER_W; } else if (context == C_SB_RIGHT) { return PART_BORDER_E; } else if (context == C_SB_TOP) { return PART_BORDER_N; } else if (context == C_SB_BOTTOM) { return PART_BORDER_S; } else if (context == C_TITLE) { return PART_TITLE; } else if (context & (C_LALL | C_RALL)) { return PART_BUTTONS; } return PART_NONE; } void border_get_part_geometry( FvwmWindow *fw, window_parts part, rectangle *sidebar_g, rectangle *ret_g, Window *ret_w) { int bw; bw = fw->boundary_width; /* ret_g->x and ret->y is just an offset relatively to the w, * maybe we can take the relief in account? */ switch (part) { case PART_BORDER_N: ret_g->x = sidebar_g->x; ret_g->y = 0; *ret_w = FW_W_SIDE(fw, 0); break; case PART_BORDER_E: ret_g->x = 2 * sidebar_g->x + sidebar_g->width - bw; ret_g->y = sidebar_g->y; *ret_w = FW_W_SIDE(fw, 1); break; case PART_BORDER_S: ret_g->x = sidebar_g->x; ret_g->y = 2 * sidebar_g->y + sidebar_g->height - bw; *ret_w = FW_W_SIDE(fw, 2); break; case PART_BORDER_W: ret_g->x = 0; ret_g->y = sidebar_g->y; *ret_w = FW_W_SIDE(fw, 3); break; case PART_BORDER_NW: ret_g->x = 0; ret_g->y = 0; *ret_w = FW_W_CORNER(fw, 0); break; case PART_BORDER_NE: ret_g->x = sidebar_g->x + sidebar_g->width; ret_g->y = 0; *ret_w = FW_W_CORNER(fw, 1); break; case PART_BORDER_SW: ret_g->x = 0; ret_g->y = sidebar_g->y + sidebar_g->height; *ret_w = FW_W_CORNER(fw, 2); break; case PART_BORDER_SE: ret_g->x = sidebar_g->x + sidebar_g->width; ret_g->y = sidebar_g->y + sidebar_g->height; *ret_w = FW_W_CORNER(fw, 3); break; default: break; } switch (part) { case PART_BORDER_N: case PART_BORDER_S: ret_g->width = sidebar_g->width; ret_g->height = bw; break; case PART_BORDER_E: case PART_BORDER_W: ret_g->width = bw; ret_g->height = sidebar_g->height; break; case PART_BORDER_NW: case PART_BORDER_NE: case PART_BORDER_SW: case PART_BORDER_SE: ret_g->width = sidebar_g->x; ret_g->height = sidebar_g->y; break; default: return; } return; } int get_button_number(int context) { int i; for (i = 0; (C_L1 << i) & (C_LALL | C_RALL); i++) { if (context & (C_L1 << i)) { return i; } } return -1; } void border_draw_decorations( FvwmWindow *fw, window_parts draw_parts, Bool has_focus, Bool do_force, clear_window_parts clear_parts, rectangle *old_g, rectangle *new_g) { common_decorations_type cd; Bool do_redraw_titlebar = False; window_parts pressed_parts; window_parts force_parts; int context; int item; if (fw == NULL) { return; } if (WAS_NEVER_DRAWN(fw)) { /* force drawing everything */ do_force = True; draw_parts = PART_ALL; SET_WAS_NEVER_DRAWN(fw, 0); } memset(&cd, 0, sizeof(cd)); /* can't compare with True here, old code calls this with value "2" */ if (do_force != False) { force_parts = draw_parts; } else { force_parts = PART_NONE; } if (has_focus) { /* don't re-draw just for kicks */ if (Scr.Hilite != fw && Scr.Hilite != NULL) { FvwmWindow *t = Scr.Hilite; Scr.Hilite = NULL; /* make sure that the previously highlighted * window got unhighlighted */ border_draw_decorations( t, PART_ALL, False, True, CLEAR_ALL, NULL, NULL); } Scr.Hilite = fw; } else if (fw == Scr.Hilite) { Scr.Hilite = NULL; } if (fw->Desk != Scr.CurrentDesk) { return; } if (IS_ICONIFIED(fw)) { DrawIconWindow(fw, True, True, True, False, NULL); return; } /* calculate some values and flags */ if ((draw_parts & PART_TITLEBAR) && HAS_TITLE(fw)) { do_redraw_titlebar = True; } get_common_decorations( &cd, fw, draw_parts, has_focus, False, do_redraw_titlebar); /* redraw */ context = frame_window_id_to_context(fw, PressedW, &item); if ((context & (C_LALL | C_RALL)) == 0) { item = -1; } pressed_parts = border_context_to_parts(context); if (new_g == NULL) { new_g = &fw->g.frame; } if (do_redraw_titlebar) { border_draw_titlebar( &cd, fw, pressed_parts & PART_TITLEBAR, item, force_parts & PART_TITLEBAR, clear_parts, old_g, new_g, has_focus); } if (draw_parts & PART_FRAME) { Pixmap save_pix = cd.dynamic_cd.frame_pixmap; memset(&cd, 0, sizeof(cd)); get_common_decorations( &cd, fw, draw_parts, has_focus, True, True); cd.dynamic_cd.frame_pixmap = save_pix; border_draw_border_parts( &cd, fw, (pressed_parts & (PART_FRAME | PART_HANDLES)), (force_parts & (PART_FRAME | PART_HANDLES)), clear_parts, old_g, new_g, has_focus); } if (cd.dynamic_cd.frame_pixmap != None) { XFreePixmap(dpy, cd.dynamic_cd.frame_pixmap); } return; } void border_undraw_decorations( FvwmWindow *fw) { memset(&fw->decor_state, 0, sizeof(fw->decor_state)); return; } /* * * redraw the decoration when style change * */ void border_redraw_decorations( FvwmWindow *fw) { FvwmWindow *u = Scr.Hilite; /* domivogt (6-Jun-2000): Don't check if the window is visible here. * If we do, some updates are not applied and when the window becomes * visible again, the X Server may not redraw the window. */ border_draw_decorations( fw, PART_ALL, (Scr.Hilite == fw), True, CLEAR_ALL, NULL, NULL); Scr.Hilite = u; return; } /* * * get the the root transparent parts of the decoration * */ unsigned int border_get_transparent_decorations_part(FvwmWindow *fw) { DecorFace *df,*tdf; unsigned int draw_parts = PART_NONE; int i; window_parts pressed_parts; int context; int item; border_titlebar_state tbstate; Bool title_use_borderstyle = False; Bool buttons_use_borderstyle = False; Bool buttons_use_titlestyle = False; context = frame_window_id_to_context(fw, PressedW, &item); if ((context & (C_LALL | C_RALL)) == 0) { item = -1; } pressed_parts = border_context_to_parts(context); memset(&tbstate, 0, sizeof(tbstate)); border_get_titlebar_descr_state( fw, pressed_parts & PART_TITLEBAR, item, CLEAR_ALL, (Scr.Hilite == fw), &tbstate); for(i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { df = &TB_STATE(GetDecor(fw, buttons[i]))[tbstate.bstate[i]]; if (DFS_USE_TITLE_STYLE(df->style)) { buttons_use_titlestyle = True; } if (DFS_USE_BORDER_STYLE(df->style)) { buttons_use_borderstyle = True; } for(tdf = df; tdf != NULL; tdf = tdf->next) { if (DFS_FACE_TYPE(tdf->style) == ColorsetButton && CSET_IS_TRANSPARENT_ROOT(tdf->u.acs.cs)) { draw_parts |= PART_BUTTONS; break; } } } df = &TB_STATE(GetDecor(fw, titlebar))[tbstate.tstate]; if (DFS_USE_BORDER_STYLE(df->style)) { title_use_borderstyle = True; } for(tdf = df; tdf != NULL; tdf = tdf->next) { if (DFS_FACE_TYPE(tdf->style) == ColorsetButton && CSET_IS_TRANSPARENT_ROOT(tdf->u.acs.cs)) { draw_parts |= PART_TITLE; break; } else if (DFS_FACE_TYPE(tdf->style) == MultiPixmap) { int i; for (i = 0; i < TBMP_NUM_PIXMAPS; i++) { if (CSET_IS_TRANSPARENT_ROOT( tdf->u.mp.acs[i].cs)) { draw_parts |= PART_TITLE; break; } } } } df = border_get_border_style(fw, (Scr.Hilite == fw)); if (DFS_FACE_TYPE(df->style) == ColorsetButton && CSET_IS_TRANSPARENT_ROOT(df->u.acs.cs)) { draw_parts |= PART_FRAME|PART_HANDLES; } if (draw_parts & PART_FRAME) { if (title_use_borderstyle) { draw_parts |= PART_TITLE; } if (buttons_use_borderstyle) { draw_parts |= PART_BUTTONS; } } if ((draw_parts & PART_TITLE) && buttons_use_titlestyle) { draw_parts |= PART_BUTTONS; } #if 0 fprintf(stderr,"Transparant Part: %u\n", draw_parts); #endif return draw_parts; } /* ---------------------------- builtin commands --------------------------- */ /* * * Sets the allowed button states * */ void CMD_ButtonState(F_CMD_ARGS) { char *token; while ((token = PeekToken(action, &action))) { static char first = True; if (!token && first) { Scr.gs.use_active_down_buttons = DEFAULT_USE_ACTIVE_DOWN_BUTTONS; Scr.gs.use_inactive_buttons = DEFAULT_USE_INACTIVE_BUTTONS; Scr.gs.use_inactive_down_buttons = DEFAULT_USE_INACTIVE_DOWN_BUTTONS; return; } first = False; if (StrEquals("activedown", token)) { Scr.gs.use_active_down_buttons = ParseToggleArgument( action, &action, DEFAULT_USE_ACTIVE_DOWN_BUTTONS, True); } else if (StrEquals("inactive", token)) { Scr.gs.use_inactive_buttons = ParseToggleArgument( action, &action, DEFAULT_USE_INACTIVE_BUTTONS, True); } else if (StrEquals("inactivedown", token)) { Scr.gs.use_inactive_down_buttons = ParseToggleArgument( action, &action, DEFAULT_USE_INACTIVE_DOWN_BUTTONS, True); } else { Scr.gs.use_active_down_buttons = DEFAULT_USE_ACTIVE_DOWN_BUTTONS; Scr.gs.use_inactive_buttons = DEFAULT_USE_INACTIVE_BUTTONS; Scr.gs.use_inactive_down_buttons = DEFAULT_USE_INACTIVE_DOWN_BUTTONS; fvwm_msg(ERR, "cmd_button_state", "Unknown button state %s", token); return; } } return; } /* * * Sets the border style (veliaa@rpi.edu) * */ void CMD_BorderStyle(F_CMD_ARGS) { char *parm; char *prev; #ifdef USEDECOR FvwmDecor *decor = Scr.cur_decor ? Scr.cur_decor : &Scr.DefaultDecor; #else FvwmDecor *decor = &Scr.DefaultDecor; #endif Scr.flags.do_need_window_update = 1; decor->flags.has_changed = 1; for (prev = action; (parm = PeekToken(action, &action)); prev = action) { if (StrEquals(parm, "active") || StrEquals(parm, "inactive")) { int len; char *end, *tmp; DecorFace tmpdf, *df; memset(&tmpdf.style, 0, sizeof(tmpdf.style)); DFS_FACE_TYPE(tmpdf.style) = SimpleButton; tmpdf.next = NULL; if (FMiniIconsSupported) { tmpdf.u.p = NULL; } if (StrEquals(parm,"active")) { df = &decor->BorderStyle.active; } else { df = &decor->BorderStyle.inactive; } df->flags.has_changed = 1; while (isspace(*action)) { ++action; } if (*action != '(') { if (!*action) { fvwm_msg( ERR, "SetBorderStyle", "error in %s border" " specification", parm); return; } while (isspace(*action)) { ++action; } if (ReadDecorFace(action, &tmpdf,-1,True)) { FreeDecorFace(dpy, df); *df = tmpdf; } break; } end = strchr(++action, ')'); if (!end) { fvwm_msg( ERR, "SetBorderStyle", "error in %s border specification", parm); return; } len = end - action + 1; tmp = safemalloc(len); strncpy(tmp, action, len - 1); tmp[len - 1] = 0; ReadDecorFace(tmp, df,-1,True); free(tmp); action = end + 1; } else if (strcmp(parm,"--")==0) { if (ReadDecorFace( prev, &decor->BorderStyle.active,-1,True)) { ReadDecorFace( prev, &decor->BorderStyle.inactive, -1, False); } decor->BorderStyle.active.flags.has_changed = 1; decor->BorderStyle.inactive.flags.has_changed = 1; break; } else { DecorFace tmpdf; memset(&tmpdf.style, 0, sizeof(tmpdf.style)); DFS_FACE_TYPE(tmpdf.style) = SimpleButton; tmpdf.next = NULL; if (FMiniIconsSupported) { tmpdf.u.p = NULL; } if (ReadDecorFace(prev, &tmpdf,-1,True)) { FreeDecorFace(dpy,&decor->BorderStyle.active); decor->BorderStyle.active = tmpdf; ReadDecorFace( prev, &decor->BorderStyle.inactive, -1, False); decor->BorderStyle.active.flags.has_changed = 1; decor->BorderStyle.inactive.flags.has_changed = 1; } break; } } return; } fvwm-2.6.5.orig/fvwm/placement.h0000644000175000017500000000172510557216362014736 0ustar vwcvwc/* -*-c-*- */ #ifndef PLACEMENT_H #define PLACEMENT_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef enum { PLACE_INITIAL, PLACE_AGAIN } placement_mode_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ extern const pl_penalty_struct default_pl_penalty; extern const pl_percent_penalty_struct default_pl_percent_penalty; /* ---------------------------- interface functions ------------------------ */ Bool setup_window_placement( FvwmWindow *fw, window_style *pstyle, rectangle *attr_g, initial_window_options_t *win_opts, placement_mode_t mode); #endif /* PLACEMENT_H */ fvwm-2.6.5.orig/fvwm/read.c0000644000175000017500000001733611321457334013675 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation * * Changed 09/24/98 by Dan Espen: * - remove logic that processed and saved module configuration commands. * Its now in "modconf.c". */ #include "config.h" #include #ifdef HAVE_FCNTL_H #include #endif #include "libs/Parse.h" #include "libs/Strings.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "functions.h" #include "events.h" #include "misc.h" #include "screen.h" #define MAX_READ_DEPTH 40 static char *curr_read_file = NULL; static char *curr_read_dir = NULL; static int curr_read_depth = 0; static char *prev_read_files[MAX_READ_DEPTH]; static int push_read_file(const char *file) { if (curr_read_depth >= MAX_READ_DEPTH) { fvwm_msg( ERR, "Read", "Nested Read limit %d is reached", MAX_READ_DEPTH); return 0; } prev_read_files[curr_read_depth++] = curr_read_file; curr_read_file = safestrdup(file); if (curr_read_dir) { free(curr_read_dir); } curr_read_dir = NULL; return 1; } static void pop_read_file(void) { if (curr_read_depth == 0) { return; } if (curr_read_file) { free(curr_read_file); } curr_read_file = prev_read_files[--curr_read_depth]; if (curr_read_dir) { free(curr_read_dir); } curr_read_dir = NULL; return; } const char *get_current_read_file(void) { return curr_read_file; } const char *get_current_read_dir(void) { if (!curr_read_dir) { char *dir_end; if (!curr_read_file) { return "."; } /* it should be a library function parse_file_dir() */ dir_end = strrchr(curr_read_file, '/'); if (!dir_end) { dir_end = curr_read_file; } curr_read_dir = safemalloc(dir_end - curr_read_file + 1); strncpy(curr_read_dir, curr_read_file, dir_end - curr_read_file); curr_read_dir[dir_end - curr_read_file] = '\0'; } return curr_read_dir; } /* * Read and execute each line from stream. */ void run_command_stream( cond_rc_t *cond_rc, FILE *f, const exec_context_t *exc) { char *tline; char line[1024]; /* Set close-on-exec flag */ fcntl(fileno(f), F_SETFD, 1); /* Update window decorations in case we were called from a menu that * has now popped down. */ handle_all_expose(); tline = fgets(line, (sizeof line) - 1, f); while (tline) { int l; while (tline && (l = strlen(line)) < sizeof(line) && l >= 2 && line[l-2]=='\\' && line[l-1]=='\n') { tline = fgets(line+l-2,sizeof(line)-l+1,f); } tline=line; while (isspace((unsigned char)*tline)) { tline++; } l = strlen(tline); if (l > 0 && tline[l - 1] == '\n') { tline[l - 1] = '\0'; } execute_function(cond_rc, exc, tline, 0); tline = fgets(line, (sizeof line) - 1, f); } return; } /** * Parse the action string. We expect a filename, and optionally, * the keyword "Quiet". The parameter `cmdname' is used for diagnostic * messages only. * * Returns true if the parse succeeded. * The filename and the presence of the quiet flag are returned * using the pointer arguments. **/ static int parse_filename( char *cmdname, char *action, char **filename, int *quiet_flag) { char *rest; char *option; /* fvwm_msg(INFO,cmdname,"action == '%s'",action); */ /* read file name arg */ rest = GetNextToken(action,filename); if (*filename == NULL) { fvwm_msg(ERR, cmdname, "missing filename parameter"); return 0; } /* optional "Quiet" argument -- flag defaults to `off' (noisy) */ *quiet_flag = 0; rest = GetNextToken(rest,&option); if (option != NULL) { *quiet_flag = strncasecmp(option, "Quiet", 5) == 0; free(option); } return 1; } /** * Returns 0 if file not found **/ int run_command_file( char *filename, const exec_context_t *exc) { char *full_filename; FILE* f = NULL; /* We attempt to open the filename by doing the following: * * - If the file does start with a "/" then it's treated as an * absolute path. * * - Otherwise, it's assumed to be in FVWM_USERDIR OR FVWM_DATADIR, * whichever comes first. * * - If the file starts with "./" or "../" then try and * open the file exactly as specified which means * things like: * * ../.././foo is catered for. At this point, we just try and open * the specified file regardless. * * - *Hidden* files in the CWD would have to be specified as: * * ./.foo */ full_filename = filename; if (full_filename[0] == '/') { /* It's an absolute path */ f = fopen(full_filename,"r"); } else { /* It's a relative path. Check in either FVWM_USERDIR or * FVWM_DATADIR. * */ full_filename = CatString3(fvwm_userdir, "/", filename); if((f = fopen(full_filename, "r")) == NULL) { full_filename = CatString3( FVWM_DATADIR, "/", filename); f = fopen(full_filename, "r"); } } if ((f == NULL) && (f = fopen(filename, "r")) == NULL) { /* We really couldn't open the file. */ return 0; } if (push_read_file(full_filename) == 0) { return 0; } run_command_stream(NULL, f, exc); fclose(f); pop_read_file(); return 1; } /** * Busy Cursor Stuff for Read **/ static void cursor_control(Bool grab) { static int read_depth = 0; static Bool need_ungrab = False; if (!(Scr.BusyCursor & BUSY_READ) && !need_ungrab) { return; } if (grab) { if (!read_depth && GrabEm(CRS_WAIT, GRAB_BUSY)) { need_ungrab = True; } if (need_ungrab) { read_depth++; } } else if (need_ungrab) { read_depth--; if (!read_depth || !(Scr.BusyCursor & BUSY_READ)) { UngrabEm(GRAB_BUSY); need_ungrab = False; read_depth = 0; } } return; } void CMD_Read(F_CMD_ARGS) { char* filename; int read_quietly; DoingCommandLine = False; if (cond_rc != NULL) { cond_rc->rc = COND_RC_OK; } if (!parse_filename("Read", action, &filename, &read_quietly)) { if (cond_rc != NULL) { cond_rc->rc = COND_RC_ERROR; } return; } cursor_control(True); if (!run_command_file(filename, exc)) { if (!read_quietly) { if (filename[0] == '/') { fvwm_msg( ERR, "Read", "file '%s' not found", filename); } else { fvwm_msg( ERR, "Read", "file '%s' not found in %s or " FVWM_DATADIR, filename, fvwm_userdir); } } if (cond_rc != NULL) { cond_rc->rc = COND_RC_ERROR; } } free(filename); cursor_control(False); return; } void CMD_PipeRead(F_CMD_ARGS) { char* command; int read_quietly; FILE* f; DoingCommandLine = False; if (cond_rc != NULL) { cond_rc->rc = COND_RC_OK; } if (!parse_filename("PipeRead", action, &command, &read_quietly)) { if (cond_rc != NULL) { cond_rc->rc = COND_RC_ERROR; } return; } cursor_control(True); f = popen(command, "r"); if (f == NULL) { if (cond_rc != NULL) { cond_rc->rc = COND_RC_ERROR; } if (!read_quietly) { fvwm_msg( ERR, "PipeRead", "command '%s' not run", command); } free(command); cursor_control(False); return; } free(command); run_command_stream(cond_rc,f, exc); pclose(f); cursor_control(False); return; } fvwm-2.6.5.orig/fvwm/module_list.h0000644000175000017500000000766310667325230015312 0ustar vwcvwc/* -*-c-*- */ #ifndef FVWM_MODULE_LIST_H #define FVWM_MODULE_LIST_H #include "libs/Module.h" #include "libs/queue.h" /* for F_CMD_ARGS */ #include "fvwm/fvwm.h" /* please don't use msg_masks_t and PipeMask outside of module_interface.c. * They are only global to allow to access the IS_MESSAGE_SELECTED macro without * having to call a function. */ typedef struct msg_masks_t { unsigned long m1; unsigned long m2; } msg_masks_t; /* module linked list record, only to be accessed by using the access macros * below */ typedef struct fmodule { struct { unsigned is_cmdline_module : 1; } xflags; int xreadPipe; int xwritePipe; fqueue xpipeQueue; msg_masks_t xPipeMask; msg_masks_t xNoGrabMask; msg_masks_t xSyncMask; char *xname; char *xalias; } fmodule; #define MOD_IS_CMDLINE(m) ((m)->xflags.is_cmdline_module) #define MOD_SET_CMDLINE(m,on) ((m)->xflags.is_cmdline_module = !!(on)) typedef struct fmodule_store { fmodule *module; struct fmodule_store *next; } fmodule_store; /* This defines the module list object */ typedef fmodule_store* fmodule_list; /* this objects allows safe iteration over a module list */ typedef fmodule_store* fmodule_list_itr; #define MOD_READFD(m) ((m)->xreadPipe) #define MOD_WRITEFD(m) ((m)->xwritePipe) #define MOD_PIPEQUEUE(m) ((m)->xpipeQueue) #define MOD_PIPEMASK(m) ((m)->xPipeMask) #define MOD_NAME(m) ((m)->xname) #define MOD_ALIAS(m) ((m)->xalias) /* this is a bit long winded to allow MAX_MESSAGE to be 32 and not get an * integer overflow with (1 << MAX_MESSAGES) and even with * (1<<(MAX_MESSAGES-1)) - 1 */ #define DEFAULT_MASK (MAX_MSG_MASK & ~(M_SENDCONFIG)) #define DEFAULT_XMASK (DEFAULT_XMSG_MASK) /* * Returns zero if the msg is not selected by the mask. Takes care of normal * and extended messages. */ #define IS_MESSAGE_IN_MASK(mask, msg) \ (((msg)&M_EXTENDED_MSG) ? ((mask)->m2 & (msg)) : ((mask)->m1 & (msg))) /* * Returns non zero if one of the specified messages is selected for the module */ #define IS_MESSAGE_SELECTED(module, msg_mask) \ IS_MESSAGE_IN_MASK(&(MOD_PIPEMASK(module)), (msg_mask)) /* * M_SENDCONFIG for modules to tell fvwm that they want to see each * module configuration command as it is entered. Causes modconf.c to * look at each active module, find the ones that sent M_SENDCONFIG, and * send a copy of the command in an M_CONFIG_INFO command. */ /* struct to store module input data */ typedef struct fmodule_input { Window window; fmodule *module; char *command; } fmodule_input; /* * Basic Module Handling Functions */ /* kill all modules */ void module_kill_all(void); /* kill a module */ void module_kill(fmodule *module); /* execute module wraper, desperate mode */ fmodule *executeModuleDesperate(F_CMD_ARGS); /* * Basic Module Communication Functions */ /* send "raw" data to the module */ /* module_send(fmodule *module, unsigned long *ptr, int size); */ void PositiveWrite(fmodule *module, unsigned long *ptr, int size); /* returns a dynamicaly allocated struct with the received data * or NULL on error */ fmodule_input *module_receive(fmodule *module); /* frees an input data struct */ void module_input_discard(fmodule_input *input); /* returns true if received the "expect" string, false otherwise */ Bool module_input_expect(fmodule_input *input, char *expect); /* * Utility Functions */ /* initializes the given iterator */ void module_list_itr_init(fmodule_list_itr *itr); /* gets the next module on the list */ fmodule *module_list_itr_next(fmodule_list_itr *itr); /* free modules in the deathrow */ void module_cleanup(void); /* * Message Queue Handling Functions */ /* message queues */ void FlushAllMessageQueues(void); void FlushMessageQueue(fmodule *module); /* * Misc Functions (should they be here?) */ /* * exposed to be used by modconf.c */ char *skipModuleAliasToken(const char *string); /* dead pipe signal handler - empty */ RETSIGTYPE DeadPipe(int nonsense); #endif /* MODULE_LIST_H */ fvwm-2.6.5.orig/fvwm/functable.c0000644000175000017500000005763111705516565014737 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include "fvwm.h" #include "execcontext.h" #include "commands.h" #include "cursor.h" #include "functions.h" #include "misc.h" #include "functable.h" /* ---------------------------- local definitions -------------------------- */ /* The function names in the first field *must* be in lowercase or else the * function cannot be called. The func parameter of the macro is also used * for parsing by modules that rely on the old case of the commands. */ #define CMD_ENT(cmd, func, cmd_id, flags, cursor) \ { cmd, func, cmd_id, flags, cursor } /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* IMPORTANT: command description should not be longer than 53 characters. */ /* If you change func_table format, change also perllib/FVWM/create-commands */ /* The next line must be blank for modules to properly parse this file. */ const func_t func_table[] = { /* CMD_ENT("#", CMD_Comment, 0, 0, 0), */ /* # - Comment line (ignored) */ /* CMD_ENT("*", CMD_Asterisk, 0, 0, 0), */ /* * - Module configuration line (no space after asterisk) */ CMD_ENT("+", CMD_Plus, F_ADDMENU2, 0, 0), /* + - Continue the last AddToFunc, AddToMenu or AddToDecor */ CMD_ENT("addbuttonstyle", CMD_AddButtonStyle, F_ADD_BUTTON_STYLE, FUNC_DECOR, 0), /* - Add to a button style (see ButtonStyle) */ CMD_ENT("addtitlestyle", CMD_AddTitleStyle, F_ADD_TITLE_STYLE, FUNC_DECOR, 0), /* - Add to a title style (see TitleStyle) */ #ifdef USEDECOR CMD_ENT("addtodecor", CMD_AddToDecor, F_ADD_DECOR, 0, 0), /* - Add a decor definition (will be obsolete) */ #endif /* USEDECOR */ CMD_ENT("addtofunc", CMD_AddToFunc, F_ADDFUNC, FUNC_ADD_TO, 0), /* - Add a function definition */ CMD_ENT("addtomenu", CMD_AddToMenu, F_ADDMENU, 0, 0), /* - Add a menu definition */ CMD_ENT("all", CMD_All, F_ALL, 0, 0), /* - Operate on all windows matching the given condition */ CMD_ENT("animatedmove", CMD_AnimatedMove, F_ANIMATED_MOVE, FUNC_NEEDS_WINDOW, CRS_MOVE), /* - Like Move, but uses animation to move windows */ CMD_ENT("any", CMD_Any, F_ANY, 0, 0), /* - Operate if there is any window matching the condition */ CMD_ENT("beep", CMD_Beep, F_BEEP, 0, 0), /* - Produce a bell */ CMD_ENT("borderstyle", CMD_BorderStyle, F_BORDERSTYLE, FUNC_DECOR, 0), /* - Define a window border look (will be reworked) */ CMD_ENT("break", CMD_Break, F_BREAK, 0, 0), /* - Stop executing the current (but not parent) function */ CMD_ENT("bugopts", CMD_BugOpts, F_BUG_OPTS, 0, 0), /* - Set some application bug workarounds */ CMD_ENT("busycursor", CMD_BusyCursor, F_BUSY_CURSOR, 0, 0), /* - Show/don't show the wait cursor in certain operations */ CMD_ENT("buttonstate", CMD_ButtonState, F_BUTTON_STATE, 0, 0), /* - Disable some titlebar button states (not recommended) */ CMD_ENT("buttonstyle", CMD_ButtonStyle, F_BUTTON_STYLE, FUNC_DECOR, 0), /* - Define a window button look (will be reworked) */ #ifdef USEDECOR CMD_ENT("changedecor", CMD_ChangeDecor, F_CHANGE_DECOR, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Attach decor to a window (will be obsolete) */ #endif /* USEDECOR */ CMD_ENT("changemenustyle", CMD_ChangeMenuStyle, F_CHANGE_MENUSTYLE, 0, 0), /* - Attach menu style to a menu (see MenuStyle) */ CMD_ENT("cleanupcolorsets", CMD_CleanupColorsets, F_NOP, 0, 0), /* - Reset all used colorsets with the default gray colors */ CMD_ENT("clicktime", CMD_ClickTime, F_CLICK, 0, 0), /* - Set a time in milliseconds for click and double click */ CMD_ENT("close", CMD_Close, F_CLOSE, FUNC_NEEDS_WINDOW, CRS_DESTROY), /* - Try to Delete a window, if this fails, Destroy it */ CMD_ENT("colorlimit", CMD_ColorLimit, F_COLOR_LIMIT, 0, 0), /* - Set limit on colors used (obsolete) */ CMD_ENT("colormapfocus", CMD_ColormapFocus, F_COLORMAP_FOCUS, 0, 0), /* - Change the colormap behaviour for low-depth X servers */ CMD_ENT("colorset", CMD_Colorset, F_NOP, 0, 0), /* - Manage colors used like fg, bg, image bg, gradient bg */ CMD_ENT("copymenustyle", CMD_CopyMenuStyle, F_COPY_MENU_STYLE, 0, 0), /* - Copy the existing menu style to new or existing one */ CMD_ENT("current", CMD_Current, F_CURRENT, 0, 0), /* - Operate on the currently focused window */ CMD_ENT("cursormove", CMD_CursorMove, F_MOVECURSOR, 0, 0), /* - Move the cursor pointer non interactively */ CMD_ENT("cursorstyle", CMD_CursorStyle, F_CURSOR_STYLE, 0, 0), /* - Define different cursor pointer shapes and colors */ CMD_ENT("defaultcolors", CMD_DefaultColors, F_DFLT_COLORS, 0, 0), /* - Set colors for the feedback window (will be obsolete) */ CMD_ENT("defaultcolorset", CMD_DefaultColorset, F_DFLT_COLORSET, 0, 0), /* - Set colors for the Move/Resize feedback window */ CMD_ENT("defaultfont", CMD_DefaultFont, F_DFLT_FONT, 0, 0), /* - The default font to use (mainly for feedback window) */ CMD_ENT("defaulticon", CMD_DefaultIcon, F_DFLT_ICON, 0, 0), /* - The default icon to use for iconified windows */ CMD_ENT("defaultlayers", CMD_DefaultLayers, F_DFLT_LAYERS, 0, 0), /* - Set StaysOnBottom, StaysPut, StaysOnTop layer numbers */ CMD_ENT("delete", CMD_Delete, F_DELETE, FUNC_NEEDS_WINDOW, CRS_DESTROY), /* - Try to delete a window using the X delete protocol */ CMD_ENT("deschedule", CMD_Deschedule, F_DESCHEDULE, 0, 0), /* - Remove commands sheduled earlier using Schedule */ CMD_ENT("desk", CMD_Desk, F_GOTO_DESK, 0, 0), /* - (obsolete, use GotoDesk instead) */ CMD_ENT("desktopname", CMD_DesktopName, F_DESKTOP_NAME, 0, 0), /* - Define the desktop names used in WindowList, modules */ CMD_ENT("desktopsize", CMD_DesktopSize, F_SETDESK, 0, 0), /* - Set virtual desktop size in units of physical pages */ CMD_ENT("destroy", CMD_Destroy, F_DESTROY, FUNC_NEEDS_WINDOW, CRS_DESTROY), /* - Kill a window without any warning to an application */ #ifdef USEDECOR CMD_ENT("destroydecor", CMD_DestroyDecor, F_DESTROY_DECOR, 0, 0), /* - Delete decor defined by AddToDecor (will be obsolete) */ #endif /* USEDECOR */ CMD_ENT("destroyfunc", CMD_DestroyFunc, F_DESTROY_FUNCTION, 0, 0), /* - Delete function defined using AddToFunc */ CMD_ENT("destroymenu", CMD_DestroyMenu, F_DESTROY_MENU, 0, 0), /* - Delete menu defined using AddToMenu */ CMD_ENT("destroymenustyle", CMD_DestroyMenuStyle, F_DESTROY_MENUSTYLE, 0, 0), /* - Delete menu style defined using MenuStyle */ CMD_ENT("destroymoduleconfig", CMD_DestroyModuleConfig, F_DESTROY_MOD, 0, 0), /* - Delete matching module config lines defined using "*" */ CMD_ENT("destroystyle", CMD_DestroyStyle, F_DESTROY_STYLE, 0, 0), /* - Delete style defined using Style */ CMD_ENT("destroywindowstyle", CMD_DestroyWindowStyle, F_DESTROY_WINDOW_STYLE, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Delete style defined using WindowStyle */ CMD_ENT("direction", CMD_Direction, F_DIRECTION, 0, 0), /* - Operate on the next window in the specified direction */ CMD_ENT("echo", CMD_Echo, F_ECHO, 0, 0), /* - Print message to stderr, mainly for debugging */ CMD_ENT("echofuncdefinition", CMD_EchoFuncDefinition, F_ECHO_FUNC_DEFINITION, 0, 0), /* - Print the definion of a function */ CMD_ENT("edgecommand", CMD_EdgeCommand, F_EDGE_COMMAND, 0, 0), /* - Bind one or another screen edge to an fvwm action */ CMD_ENT("edgeleavecommand", CMD_EdgeLeaveCommand, F_EDGE_LEAVE_COMMAND, 0, 0), /* - Bind one or another screen edge to an fvwm action */ CMD_ENT("edgeresistance", CMD_EdgeResistance, F_EDGE_RES, 0, 0), /* - Control viewport scrolling and window move over edge */ CMD_ENT("edgescroll", CMD_EdgeScroll, F_EDGE_SCROLL, 0, 0), /* - Control how much of the viewport is scrolled if any */ CMD_ENT("edgethickness", CMD_EdgeThickness, F_NOP, 0, 0), /* - Control how closely to edge to run command/scrolling */ CMD_ENT("emulate", CMD_Emulate, F_EMULATE, 0, 0), /* - Only used to position the position/size window */ CMD_ENT("escapefunc", CMD_EscapeFunc, F_ESCAPE_FUNC, 0, 0), /* - Abort a wait or ModuleSynchonous command */ CMD_ENT("ewmhbasestruts", CMD_EwmhBaseStruts, F_EWMH_BASE_STRUTS, 0, 0), /* - Define restricted areas of the screen */ CMD_ENT("ewmhnumberofdesktops", CMD_EwmhNumberOfDesktops, F_EWMH_NUMBER_OF_DESKTOPS, 0, 0), /* - For ewmh pager, define number of desktops */ CMD_ENT("exec", CMD_Exec, F_EXEC, 0, 0), /* - Execute an external command */ CMD_ENT("execuseshell", CMD_ExecUseShell, F_EXEC_SETUP, 0, 0), /* - The shell to use to execute an external command */ CMD_ENT("fakeclick", CMD_FakeClick, F_FAKE_CLICK, 0, 0), /* - Generate a mouse click */ CMD_ENT("fakekeypress", CMD_FakeKeypress, F_FAKE_KEYPRESS, 0, 0), /* - Send a keyboard event to a window */ CMD_ENT("flipfocus", CMD_FlipFocus, F_FLIP_FOCUS, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Focus a window without rotating windowlist order */ CMD_ENT("focus", CMD_Focus, F_FOCUS, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Give focus to a window */ CMD_ENT("focusstyle", CMD_FocusStyle, F_FOCUSSTYLE, 0, 0), /* - Configure focus and raise policy for windows */ CMD_ENT("function", CMD_Function, F_FUNCTION, 0, 0), /* Function - Execute a user defined function, see AddToFunc */ CMD_ENT("globalopts", CMD_GlobalOpts, F_GLOBAL_OPTS, 0, 0), /* - (obsolete, use corresponding Style * instead) */ CMD_ENT("gnomebutton", CMD_GnomeButton, F_MOUSE, 0, 0), /* - Pass mouse button presses on root to GNOME program */ CMD_ENT("gnomeshowdesks", CMD_GnomeShowDesks, F_GOTO_DESK, 0, 0), /* - Limit GNOME pager to the number of desks */ CMD_ENT("gotodesk", CMD_GotoDesk, F_GOTO_DESK, 0, 0), /* - Switch viewport to another desk same page */ CMD_ENT("gotodeskandpage", CMD_GotoDeskAndPage, F_GOTO_DESK, 0, 0), /* - Switch viewport to another desk and page */ CMD_ENT("gotopage", CMD_GotoPage, F_GOTO_PAGE, 0, 0), /* - Switch viewport to another page same desk */ CMD_ENT("hidegeometrywindow", CMD_HideGeometryWindow, F_HIDEGEOMWINDOW, 0, 0), /* - Hide/show the position/size window */ CMD_ENT("hilightcolor", CMD_HilightColor, F_HICOLOR, 0, 0), /* - (obsolete, use Style * HighlightFore/Back) */ CMD_ENT("hilightcolorset", CMD_HilightColorset, F_HICOLORSET, 0, 0), /* - (obsolete, use Style * HighlightColorset) */ CMD_ENT("iconfont", CMD_IconFont, F_ICONFONT, 0, 0), /* - (obsolete, use Style * IconFont) */ CMD_ENT("iconify", CMD_Iconify, F_ICONIFY, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Change iconification status of a window (minimize) */ CMD_ENT("iconpath", CMD_IconPath, F_ICON_PATH, 0, 0), /* - (obsolete, use ImagePath instead) */ CMD_ENT("ignoremodifiers", CMD_IgnoreModifiers, F_IGNORE_MODIFIERS, 0, 0), /* - Modifiers to ignore on mouse and key bindings */ CMD_ENT("imagepath", CMD_ImagePath, F_IMAGE_PATH, 0, 0), /* - Directories to search for images */ CMD_ENT("infostoreadd", CMD_InfoStoreAdd, F_INFOSTOREADD, 0, 0), /* Adds an entry (key/value pairs) to the infostore. */ CMD_ENT("infostoreremove", CMD_InfoStoreRemove, F_INFOSTOREREMOVE, 0, 0), /* Removes an entry from the infostore. */ CMD_ENT(PRE_KEEPRC, CMD_KeepRc, F_KEEPRC, 0, 0), /* KeepRc - Do not modify the previous command return code */ CMD_ENT("key", CMD_Key, F_KEY, 0, 0), /* - Bind or unbind a key to an fvwm action */ CMD_ENT("killmodule", CMD_KillModule, F_KILL_MODULE, 0, 0), /* - Stops an fvwm module */ CMD_ENT("layer", CMD_Layer, F_LAYER, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Change the layer of a window */ CMD_ENT("localepath", CMD_LocalePath, F_LOCALE_PATH, 0, 0), /* - Directories/domains to search for locale data */ CMD_ENT("lower", CMD_Lower, F_LOWER, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Lower a window within a layer */ CMD_ENT("maximize", CMD_Maximize, F_MAXIMIZE, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Toggle maximal-size status of a window */ CMD_ENT("menu", CMD_Menu, F_STAYSUP, 0, 0), /* - Display (post) a menu */ CMD_ENT("menustyle", CMD_MenuStyle, F_MENUSTYLE, 0, 0), /* - Control appearance and behavior of a menu */ CMD_ENT("module", CMD_Module, F_MODULE, 0, 0), /* - Invoke an fvwm module */ CMD_ENT("modulelistenonly", CMD_ModuleListenOnly, F_MODULE_LISTEN_ONLY, 0, 0), /* - Invoke an fvwm module */ CMD_ENT("modulepath", CMD_ModulePath, F_MODULE_PATH, 0, 0), /* - Modify the directories to search for an fvwm module */ CMD_ENT("modulesynchronous", CMD_ModuleSynchronous, F_MODULE_SYNC, 0, 0), /* - Invoke an fvwm module synchronously */ CMD_ENT("moduletimeout", CMD_ModuleTimeout, F_NOP, 0, 0), /* - Set timeout value for response from module */ CMD_ENT("mouse", CMD_Mouse, F_MOUSE, 0, 0), /* - Bind or unbind a mouse button press to an fvwm action */ CMD_ENT("move", CMD_Move, F_MOVE, FUNC_NEEDS_WINDOW, CRS_MOVE), /* - Move a window */ CMD_ENT("movethreshold", CMD_MoveThreshold, F_MOVE_THRESHOLD, 0, 0), /* - Set number of pixels in a click and a hold vs. a drag */ CMD_ENT("movetodesk", CMD_MoveToDesk, F_MOVE_TO_DESK, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Move a window to another desk same page */ CMD_ENT("movetopage", CMD_MoveToPage, F_MOVE_TO_PAGE, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Move a window to another page same desk */ CMD_ENT("movetoscreen", CMD_MoveToScreen, F_MOVE_TO_SCREEN, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Move a window to another Xinerama screen */ CMD_ENT("next", CMD_Next, F_NEXT, 0, 0), /* - Operate on the next window matching conditions */ CMD_ENT("none", CMD_None, F_NONE, 0, 0), /* - Perform command if no window matches conditions */ CMD_ENT("nop", CMD_Nop, F_NOP, FUNC_DONT_REPEAT, 0), /* - Do nothing (used internally) */ CMD_ENT("nowindow", CMD_NoWindow, F_NOP, 0, 0), /* - Prefix that runs a command without a window context */ CMD_ENT("opaquemovesize", CMD_OpaqueMoveSize, F_OPAQUE, 0, 0), /* - Set maximum size window fvwm should move opaquely */ CMD_ENT("pick", CMD_Pick, F_PICK, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Prefix to force a window context, prompted if needed */ CMD_ENT("piperead", CMD_PipeRead, F_READ, 0, 0), /* - Exec system command interpret output as fvwm commands */ CMD_ENT("pixmappath", CMD_PixmapPath, F_PIXMAP_PATH, 0, 0), /* - (obsolete, use ImagePath instead) */ CMD_ENT("placeagain", CMD_PlaceAgain, F_PLACEAGAIN, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Replace a window using initial window placement logic */ CMD_ENT("pointerkey", CMD_PointerKey, F_POINTERKEY, 0, 0), /* - Bind an action to a key based on pointer not focus */ CMD_ENT("pointerwindow", CMD_PointerWindow, F_POINTERWINDOW, 0, 0), /* - Operate on window under pointer if it meets conditions */ CMD_ENT("popup", CMD_Popup, F_POPUP, 0, 0), /* - Display (pop-up) a menu, see also Menu */ CMD_ENT("prev", CMD_Prev, F_PREV, 0, 0), /* - Operate on the precious window matching conditions */ CMD_ENT("printinfo", CMD_PrintInfo, F_PRINTINFO, 0, 0), /* - Print information about the state of fvwm */ CMD_ENT("propertychange", CMD_PropertyChange, F_NOP, 0, 0), /* - Internal, used for inter-module communication */ CMD_ENT("quit", CMD_Quit, F_QUIT, 0, 0), /* - Exit fvwm */ CMD_ENT("quitscreen", CMD_QuitScreen, F_QUIT_SCREEN, 0, 0), /* - Stop managing the specified screen */ CMD_ENT("quitsession", CMD_QuitSession, F_QUIT_SESSION, 0, 0), /* - Ask session manager to shut down itself and fvwm */ CMD_ENT("raise", CMD_Raise, F_RAISE, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Raise a window in a layer */ CMD_ENT("raiselower", CMD_RaiseLower, F_RAISELOWER, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Alternately raise or lower a window in a layer */ CMD_ENT("read", CMD_Read, F_READ, 0, 0), /* - Read fvwm commands from a file */ CMD_ENT("readwritecolors", CMD_ReadWriteColors, F_NOP, 0, 0), /* - Used for colorset speed hacks (will be removed?) */ CMD_ENT("recapture", CMD_Recapture, F_RECAPTURE, 0, 0), /* - Reapply styles to all windows (will be obsolete) */ CMD_ENT("recapturewindow", CMD_RecaptureWindow, F_RECAPTURE_WINDOW, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Reapply styles to one window (will be obsolete) */ CMD_ENT("refresh", CMD_Refresh, F_REFRESH, 0, 0), /* - Cause all windows to redraw themselves */ CMD_ENT("refreshwindow", CMD_RefreshWindow, F_REFRESH, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Cause one window to redraw itself */ CMD_ENT(PRE_REPEAT, CMD_Repeat, F_REPEAT, FUNC_DONT_REPEAT, 0), /* - Repeat (very unreliably) the last command, don't use */ CMD_ENT("resize", CMD_Resize, F_RESIZE, FUNC_NEEDS_WINDOW, CRS_RESIZE), /* - Cause a window to be resized */ CMD_ENT("resizemaximize", CMD_ResizeMaximize, F_RESIZE_MAXIMIZE, FUNC_NEEDS_WINDOW, CRS_RESIZE), /* - Resize a window and mark window as maximized */ CMD_ENT("resizemove", CMD_ResizeMove, F_RESIZEMOVE, FUNC_NEEDS_WINDOW, CRS_RESIZE), /* - Resize and move in one operation */ CMD_ENT("resizemovemaximize", CMD_ResizeMoveMaximize, F_RESIZEMOVE_MAXIMIZE, FUNC_NEEDS_WINDOW, CRS_RESIZE), /* - Resize and move in one operation and mark maximized */ CMD_ENT("restacktransients", CMD_RestackTransients, F_RESTACKTRANSIENTS, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Regroup the window transients in the stack */ CMD_ENT("restart", CMD_Restart, F_RESTART, 0, 0), /* - Restart itself or replace with another window manager */ CMD_ENT("savequitsession", CMD_SaveQuitSession, F_SAVE_QUIT_SESSION, 0, 0), /* - Cause session manager to save and shutdown fvwm */ CMD_ENT("savesession", CMD_SaveSession, F_SAVE_SESSION, 0, 0), /* - Cause session manager to save the session */ CMD_ENT("scanforwindow", CMD_ScanForWindow, F_SCANFORWINDOW, 0, 0), /* - Operate on the matching window in the given direction */ CMD_ENT("schedule", CMD_Schedule, F_SCHEDULE, 0, 0), /* - Run an fvwm command after a delay */ CMD_ENT("scroll", CMD_Scroll, F_SCROLL, 0, 0), /* - Scroll the desktop viewport */ CMD_ENT("send_configinfo", CMD_Send_ConfigInfo, F_CONFIG_LIST, FUNC_DONT_REPEAT, 0), /* - Internal, used for module communication */ CMD_ENT("send_reply", CMD_Send_Reply, F_SEND_REPLY, FUNC_DONT_REPEAT, 0), /* - Internal, used for module communication */ CMD_ENT("send_windowlist", CMD_Send_WindowList, F_SEND_WINDOW_LIST, FUNC_DONT_REPEAT, 0), /* - Internal, used for module communication */ CMD_ENT("sendtomodule", CMD_SendToModule, F_SEND_STRING, FUNC_DONT_REPEAT, 0), /* - Send a string (action) to a module */ CMD_ENT("set_mask", CMD_set_mask, F_SET_MASK, FUNC_DONT_REPEAT, 0), /* - Internal, used for module communication */ CMD_ENT("set_nograb_mask", CMD_set_nograb_mask, F_SET_NOGRAB_MASK, FUNC_DONT_REPEAT, 0), /* - Internal, used for module communication */ CMD_ENT("set_sync_mask", CMD_set_sync_mask, F_SET_SYNC_MASK, FUNC_DONT_REPEAT, 0), /* - Internal, used for module communication */ CMD_ENT("setanimation", CMD_SetAnimation, F_SET_ANIMATION, 0, 0), /* - Control animated moves and menus */ CMD_ENT("setenv", CMD_SetEnv, F_SETENV, 0, 0), /* - Set an environment variable */ CMD_ENT(PRE_SILENT, CMD_Silent, F_SILENT, 0, 0), /* Silent - Suppress errors on command, avoid window selection */ CMD_ENT("snapattraction", CMD_SnapAttraction, F_SNAP_ATT, 0, 0), /* - Control attraction of windows during move */ CMD_ENT("snapgrid", CMD_SnapGrid, F_SNAP_GRID, 0, 0), /* - Control grid used with SnapAttraction */ CMD_ENT("state", CMD_State, F_STATE, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Control user defined window states */ CMD_ENT("stick", CMD_Stick, F_STICK, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Change window stickyness */ CMD_ENT("stickacrossdesks", CMD_StickAcrossDesks, F_STICKACROSSDESKS, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Change window stickyness on a desk basis */ CMD_ENT("stickacrosspages", CMD_StickAcrossPages, F_STICKACROSSPAGES, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Change window stickyness on a page basis */ #ifdef HAVE_STROKE CMD_ENT("stroke", CMD_Stroke, F_STROKE, 0, 0), /* - Bind a stroke to an fvwm action */ CMD_ENT("strokefunc", CMD_StrokeFunc, F_STROKE_FUNC, 0, 0), /* - Record stroke and execute corresponding stroke action */ #endif /* HAVE_STROKE */ CMD_ENT("style", CMD_Style, F_STYLE, 0, 0), /* - Set attributes of windows that match a pattern */ CMD_ENT("tearmenuoff", CMD_TearMenuOff, F_TEARMENUOFF, 0, 0), /* TearMenuOff - Convert a menu to a window, for use in menu items */ CMD_ENT("test", CMD_Test, F_TEST_, 0, 0), /* - Execute command if conditions are met */ CMD_ENT("testrc", CMD_TestRc, F_TESTRC, 0, 0), /* - Conditional switch (may be changed) */ CMD_ENT("thiswindow", CMD_ThisWindow, F_THISWINDOW, 0, 0), /* - Operate on the context window if it meets conditions */ CMD_ENT("title", CMD_Title, F_TITLE, 0, 0), /* Title - Insert title into a menu */ CMD_ENT("titlestyle", CMD_TitleStyle, F_TITLESTYLE, FUNC_DECOR, 0), /* - Control window title */ CMD_ENT("unsetenv", CMD_UnsetEnv, F_SETENV, 0, 0), /* - Remove an environment variable */ CMD_ENT("updatedecor", CMD_UpdateDecor, F_UPDATE_DECOR, 0, 0), /* - Update window decor (obsolete and not needed anymore) */ CMD_ENT("updatestyles", CMD_UpdateStyles, F_UPDATE_STYLES, 0, 0), /* - Cause styles to update while still in a function */ CMD_ENT("wait", CMD_Wait, F_WAIT, 0, 0), /* - Pause until a matching window appears */ CMD_ENT("warptowindow", CMD_WarpToWindow, F_WARP, FUNC_NEEDS_WINDOW | FUNC_ALLOW_UNMANAGED, CRS_SELECT), /* - Warp the pointer to a window */ CMD_ENT("windowfont", CMD_WindowFont, F_WINDOWFONT, 0, 0), /* - (obsolete, use Style * Font) */ CMD_ENT("windowid", CMD_WindowId, F_WINDOWID, 0, 0), /* - Execute command for window matching the windowid */ CMD_ENT("windowlist", CMD_WindowList, F_WINDOWLIST, 0, 0), /* - Display the window list as a menu to select a window */ CMD_ENT("windowshade", CMD_WindowShade, F_WINDOW_SHADE, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Shade/unshade a window */ CMD_ENT("windowshadeanimate", CMD_WindowShadeAnimate, F_SHADE_ANIMATE, 0, 0), /* - (obsolete, use Style * WindowShadeSteps) */ CMD_ENT("windowstyle", CMD_WindowStyle, F_WINDOW_STYLE, FUNC_NEEDS_WINDOW, CRS_SELECT), /* - Set styles on the selected window */ CMD_ENT("xinerama", CMD_Xinerama, F_XINERAMA, 0, 0), /* - Control Xinerama support */ CMD_ENT("xineramaprimaryscreen", CMD_XineramaPrimaryScreen, F_XINERAMAPRIMARYSCREEN, 0, 0), /* - Identify Xinerama primary screen */ CMD_ENT("xineramasls", CMD_XineramaSls, F_XINERAMASLS, 0, 0), /* - Control single logical screen support */ CMD_ENT("xineramaslsscreens", CMD_XineramaSlsScreens, F_XINERAMASLSSCREENS, 0, 0), /* - Configure layout for single logical screen */ CMD_ENT("xineramaslssize", CMD_XineramaSlsSize, F_XINERAMASLSSIZE, 0, 0), /* - Configure layout for single logical screen sizes */ CMD_ENT("xorpixmap", CMD_XorPixmap, F_XOR, 0, 0), /* - Use a pixmap for move/resize rubber-band */ CMD_ENT("xorvalue", CMD_XorValue, F_XOR, 0, 0), /* - Change bits used for move/resize rubber-band */ CMD_ENT("xsync", CMD_XSync, F_XSYNC, 0, 0), /* - For debugging, send all pending requests to X server */ CMD_ENT("xsynchronize", CMD_XSynchronize, F_XSYNCHRONIZE, 0, 0), /* - For debugging, cause all X requests to be synchronous */ { "", 0, 0, 0, 0 } }; fvwm-2.6.5.orig/fvwm/infostore.h0000644000175000017500000000156411675742660015006 0ustar vwcvwc/* -*-c-*- */ #ifndef INFOSTORE_H #define INFOSTORE_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef struct MetaInfo { char *key; char *value; struct MetaInfo *next; } MetaInfo; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ MetaInfo *new_metainfo(void); void insert_metainfo(char *, char *); char *get_metainfo_value(const char *); void print_infostore(void); #endif /* INFOSTORE_H */ fvwm-2.6.5.orig/fvwm/eventhandler.h0000644000175000017500000000356510115757271015450 0ustar vwcvwc/* -*-c-*- */ #ifndef EVENTHANDLER_H #define EVENTHANDLER_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef struct { const exec_context_t *exc; } evh_args_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ /* ---------------------------- event handlers ----------------------------- */ void HandleEvents(void); void HandleExpose(const evh_args_t *ea); void HandleFocusIn(const evh_args_t *ea); void HandleFocusOut(const evh_args_t *ea); void HandleDestroyNotify(const evh_args_t *ea); void HandleMapRequest(const evh_args_t *ea); void HandleMapRequestKeepRaised( const evh_args_t *ea, Window KeepRaised, FvwmWindow *ReuseWin, initial_window_options_t *win_opts); void HandleMapNotify(const evh_args_t *ea); void HandleUnmapNotify(const evh_args_t *ea); void HandleMotionNotify(const evh_args_t *ea); void HandleButtonRelease(const evh_args_t *ea); void HandleButtonPress(const evh_args_t *ea); void HandleEnterNotify(const evh_args_t *ea); void HandleLeaveNotify(const evh_args_t *ea); void HandleConfigureRequest(const evh_args_t *ea); void HandleClientMessage(const evh_args_t *ea); void HandlePropertyNotify(const evh_args_t *ea); void HandleKeyPress(const evh_args_t *ea); void HandleKeyRelease(const evh_args_t *ea); void HandleVisibilityNotify(const evh_args_t *ea); STROKE_CODE(void HandleButtonRelease(const evh_args_t *ea)); STROKE_CODE(void HandleMotionNotify(const evh_args_t *ea)); #endif /* EVENTHANDLER_H */ fvwm-2.6.5.orig/fvwm/ewmh.c0000644000175000017500000013165111641302505013711 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2001 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * An implementation of the Extended Window Manager Hints specification * http://freedesktop.org/Standards/wm-spec/ * * Not Implemented (draft 1.3 - 2004-05-01): * * _NET_DESKTOP_LAYOUT (not useful for us) * _NET_VIRTUAL_ROOTS (not useful at all for us) * _NET_SHOWING_DESKTOP should be implemented * _NET_REQUEST_FRAME_EXTENTS may be implemented * * Some _NET_WINDOW_TYPE are simply ignored: * _NET_WM_WINDOW_TYPE_SPLASH * _NET_WM_WINDOW_TYPE_UTILITIES * _KDE_NET_WM_WINDOW_TYPE_OVERRIDE (deprecated) * * _NET_WM_STATE_DEMANDS_ATTENTION state * * _NET_WM_STRUT_PARTIAL should be implemented * * _NET_WM_USER_TIME can be used to decide if we give the focus to a newly * mapped window * * The kill huge process protocol: _NET_WM_PID and _NET_WM_PING * * _NET_WM_HANDLED_ICONS (what to do? Nothing?) * * "Source indication in requests" is not used but can be useful with some * "ignore styles" * * Problems: * - _NET_WM_WINDOW_TYPE_TOOLBAR is interpreted in a different way * in GNOME (the spec) and in KDE 2/3.0 (~ simple dock?). * */ #include "config.h" #include #include #include "libs/fvwmlib.h" #include "libs/FScreen.h" #include "fvwm.h" #include "execcontext.h" #include "functions.h" #include "commands.h" #include "misc.h" #include "screen.h" #include "update.h" #include "stack.h" #include "style.h" #include "externs.h" #include "decorations.h" #include "ewmh.h" #include "ewmh_intern.h" #include "geometry.h" #include "window_flags.h" typedef struct kst_item { Window w; struct kst_item *next; } KstItem; Atom XA_UTF8_STRING = None; KstItem *ewmh_KstWinList = NULL; /* * Default */ ewmhInfo ewmhc = { 4, /* NumberOfDesktops */ 0, /* MaxDesktops limit the number of desktops*/ 0, /* CurrentNumberOfDesktops */ False, /* NeedsToCheckDesk */ {0, 0, 0, 0}, /* BaseStrut */ }; /* * The ewmh atoms lists */ #define ENTRY(name, type, func) {name, None, type, func} /* WARNING: lists must be in "name" alphabetic order! */ /* EWMH_ATOM_LIST_CLIENT_ROOT * net atoms that can be send (Client Message) by a client and do not * need a window to operate */ ewmh_atom ewmh_atom_client_root[] = { ENTRY("_NET_CURRENT_DESKTOP", XA_CARDINAL, ewmh_CurrentDesktop), ENTRY("_NET_DESKTOP_GEOMETRY", XA_CARDINAL, ewmh_DesktopGeometry), ENTRY("_NET_DESKTOP_NAMES", None, None), ENTRY("_NET_DESKTOP_VIEWPORT", XA_CARDINAL, ewmh_DesktopViewPort), ENTRY("_NET_NUMBER_OF_DESKTOPS", XA_CARDINAL, ewmh_NumberOfDesktops), {NULL,0,0,0} }; /* EWMH_ATOM_LIST_CLIENT_WIN * net atoms that can be send (Client Message) by a client and do need * window to operate */ ewmh_atom ewmh_atom_client_win[] = { ENTRY("_NET_ACTIVE_WINDOW", XA_WINDOW, ewmh_ActiveWindow), ENTRY("_NET_CLOSE_WINDOW", XA_WINDOW, ewmh_CloseWindow), ENTRY("_NET_MOVERESIZE_WINDOW", XA_WINDOW, ewmh_MoveResizeWindow), ENTRY("_NET_RESTACK_WINDOW", XA_WINDOW, ewmh_RestackWindow), ENTRY("_NET_WM_DESKTOP", XA_CARDINAL, ewmh_WMDesktop), ENTRY("_NET_WM_MOVERESIZE", XA_WINDOW, ewmh_MoveResize), ENTRY("_NET_WM_STATE", XA_ATOM, ewmh_WMState), {NULL,0,0,0} }; /* EWMH_ATOM_LIST_WM_STATE * the different wm state, a client can ask to add, remove or toggle * via a _NET_WM_STATE Client message. fvwm must maintain these states * too */ ewmh_atom ewmh_atom_wm_state[] = { ENTRY( "_NET_WM_STATE_ABOVE", XA_ATOM, ewmh_WMStateStaysOnTop), ENTRY( "_NET_WM_STATE_BELOW", XA_ATOM, ewmh_WMStateStaysOnBottom), ENTRY( "_NET_WM_STATE_FULLSCREEN", XA_ATOM, ewmh_WMStateFullScreen), ENTRY("_NET_WM_STATE_HIDDEN", XA_ATOM, ewmh_WMStateHidden), ENTRY( "_NET_WM_STATE_MAXIMIZED_HORIZ", XA_ATOM, ewmh_WMStateMaxHoriz), ENTRY( "_NET_WM_STATE_MAXIMIZED_HORZ", XA_ATOM, ewmh_WMStateMaxHoriz), ENTRY("_NET_WM_STATE_MAXIMIZED_VERT", XA_ATOM, ewmh_WMStateMaxVert), ENTRY("_NET_WM_STATE_MODAL", XA_ATOM, ewmh_WMStateModal), ENTRY("_NET_WM_STATE_SHADED", XA_ATOM, ewmh_WMStateShaded), ENTRY( "_NET_WM_STATE_SKIP_PAGER", XA_ATOM, ewmh_WMStateSkipPager), ENTRY( "_NET_WM_STATE_SKIP_TASKBAR", XA_ATOM, ewmh_WMStateSkipTaskBar), ENTRY( "_NET_WM_STATE_STAYS_ON_TOP", XA_ATOM, ewmh_WMStateStaysOnTop), ENTRY("_NET_WM_STATE_STICKY", XA_ATOM, ewmh_WMStateSticky), {NULL,0,0,0} }; #define EWMH_NUMBER_OF_STATE sizeof(ewmh_atom_wm_state)/sizeof(ewmh_atom) - 1 /* EWMH ATOM_LIST_ALLOWED_ACTIONS: atom for _NET_WM_ALLOWED_ACTIONS */ ewmh_atom ewmh_atom_allowed_actions[] = { ENTRY("_NET_WM_ACTION_CHANGE_DESKTOP", XA_ATOM, ewmh_AllowsYes), ENTRY("_NET_WM_ACTION_CLOSE", XA_ATOM, ewmh_AllowsClose), ENTRY("_NET_WM_ACTION_FULLSCREEN", XA_ATOM, ewmh_AllowsFullScreen), ENTRY("_NET_WM_ACTION_MAXIMIZE_HORZ", XA_ATOM, ewmh_AllowsMaximize), ENTRY("_NET_WM_ACTION_MAXIMIZE_VERT", XA_ATOM, ewmh_AllowsMaximize), ENTRY("_NET_WM_ACTION_MINIMIZE", XA_ATOM, ewmh_AllowsMinimize), ENTRY("_NET_WM_ACTION_MOVE", XA_ATOM, ewmh_AllowsMove), ENTRY("_NET_WM_ACTION_RESIZE", XA_ATOM, ewmh_AllowsResize), ENTRY("_NET_WM_ACTION_SHADE", XA_ATOM, ewmh_AllowsYes), ENTRY("_NET_WM_ACTION_STICK", XA_ATOM, ewmh_AllowsYes), {NULL,0,0,0} }; #define EWMH_NUMBER_OF_ALLOWED_ACTIONS \ sizeof(ewmh_atom_allowed_actions)/sizeof(ewmh_atom) - 1 /* EWMH ATOM_LIST_WINDOW_TYPE: the various window type */ ewmh_atom ewmh_atom_window_type[] = { ENTRY("_NET_WM_WINDOW_TYPE_DESKTOP", XA_ATOM, ewmh_HandleDesktop), ENTRY("_NET_WM_WINDOW_TYPE_DIALOG", XA_ATOM, ewmh_HandleDialog), ENTRY("_NET_WM_WINDOW_TYPE_DOCK", XA_ATOM, ewmh_HandleDock), ENTRY("_NET_WM_WINDOW_TYPE_MENU", XA_ATOM, ewmh_HandleMenu), ENTRY("_NET_WM_WINDOW_TYPE_NORMAL", XA_ATOM, ewmh_HandleNormal), ENTRY("_NET_WM_WINDOW_TYPE_TOOLBAR", XA_ATOM, ewmh_HandleToolBar), ENTRY("_NET_WM_WINDOW_TYPE_NOTIFICATION", XA_ATOM, ewmh_HandleNotification), {NULL,0,0,0} }; /* EWMH ATOM_LIST_FIXED_PROPERTY * property that have a window at startup and which should not change */ ewmh_atom ewmh_atom_fixed_property[] = { ENTRY("_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", XA_WINDOW, None), ENTRY("_NET_WM_HANDLED_ICON", XA_ATOM, None), ENTRY("_NET_WM_PID", XA_ATOM, None), ENTRY("_NET_WM_WINDOW_TYPE", XA_ATOM, None), {NULL,0,0,0} }; /* EWMH ATOM_LIST_PROPERTY_NOTIFY * properties of a window which is updated by the window via a PropertyNotify * event */ ewmh_atom ewmh_atom_property_notify[] = { ENTRY("_NET_WM_ICON", XA_CARDINAL, ewmh_WMIcon), ENTRY("_NET_WM_ICON_GEOMETRY", XA_CARDINAL, ewmh_WMIconGeometry), ENTRY("_NET_WM_ICON_NAME", None, EWMH_WMIconName), ENTRY("_NET_WM_NAME", None, EWMH_WMName), ENTRY("_NET_WM_STRUT", XA_CARDINAL, ewmh_WMStrut), {NULL,0,0,0} }; /* EWMH_ATOM_LIST_FVWM_ROOT: root atom that should be maintained by fvwm only */ ewmh_atom ewmh_atom_fvwm_root[] = { ENTRY("_KDE_NET_SYSTEM_TRAY_WINDOWS", XA_WINDOW, None), ENTRY("_NET_CLIENT_LIST", XA_WINDOW, None), ENTRY("_NET_CLIENT_LIST_STACKING", XA_WINDOW, None), ENTRY("_NET_SUPPORTED", XA_ATOM, None), ENTRY("_NET_SUPPORTING_WM_CHECK", XA_WINDOW, None), ENTRY("_NET_VIRTUAL_ROOTS", XA_WINDOW, None), ENTRY("_NET_WORKAREA", XA_CARDINAL, None), {NULL,0,0,0} }; /* EWMH_ATOM_LIST_FVWM_WIN: window atom that should be maintained by fvwm * only */ ewmh_atom ewmh_atom_fvwm_win[] = { ENTRY("_KDE_NET_WM_FRAME_STRUT", XA_CARDINAL, None), ENTRY("_NET_FRAME_EXTENTS", XA_CARDINAL, None), ENTRY("_NET_WM_ALLOWED_ACTIONS", XA_ATOM, None), ENTRY("_NET_WM_ICON_VISIBLE_NAME", None, None), ENTRY("_NET_WM_VISIBLE_NAME", None, None), {NULL,0,0,0} }; #define NUMBER_OF_ATOM_LISTS 9 #define L_ENTRY(x,y) {x,y,sizeof(y)/sizeof(ewmh_atom)} ewmh_atom_list atom_list[] = { L_ENTRY(EWMH_ATOM_LIST_CLIENT_ROOT, ewmh_atom_client_root), L_ENTRY(EWMH_ATOM_LIST_CLIENT_WIN, ewmh_atom_client_win), L_ENTRY(EWMH_ATOM_LIST_WM_STATE, ewmh_atom_wm_state), L_ENTRY(EWMH_ATOM_LIST_ALLOWED_ACTIONS, ewmh_atom_allowed_actions), L_ENTRY(EWMH_ATOM_LIST_WINDOW_TYPE, ewmh_atom_window_type), L_ENTRY(EWMH_ATOM_LIST_FIXED_PROPERTY, ewmh_atom_fixed_property), L_ENTRY(EWMH_ATOM_LIST_PROPERTY_NOTIFY, ewmh_atom_property_notify), L_ENTRY(EWMH_ATOM_LIST_FVWM_ROOT, ewmh_atom_fvwm_root), L_ENTRY(EWMH_ATOM_LIST_FVWM_WIN, ewmh_atom_fvwm_win), L_ENTRY(EWMH_ATOM_LIST_END, NULL) }; /* * Atoms utilities */ static int compare(const void *a, const void *b) { return (strcmp((char *)a, ((ewmh_atom *)b)->name)); } static ewmh_atom *get_ewmh_atom_by_name( const char *atom_name, ewmh_atom_list_name list_name) { ewmh_atom *a = NULL; Bool done = 0; int i = 0; while(!done && atom_list[i].name != EWMH_ATOM_LIST_END) { if (atom_list[i].name == list_name || list_name == EWMH_ATOM_LIST_ALL) { a = (ewmh_atom *)bsearch( atom_name, atom_list[i].list, atom_list[i].size - 1, sizeof(ewmh_atom), compare); if (a != NULL || list_name != EWMH_ATOM_LIST_ALL) { done = 1; } } i++; } return a; } ewmh_atom *ewmh_GetEwmhAtomByAtom(Atom atom, ewmh_atom_list_name list_name) { Bool done = 0; int i = 0; while(!done && atom_list[i].name != EWMH_ATOM_LIST_END) { if (atom_list[i].name == list_name || list_name == EWMH_ATOM_LIST_ALL) { ewmh_atom *list = atom_list[i].list; while(list->name != NULL) { if (atom == list->atom) { return list; } list++; } if (atom_list[i].name == list_name) { return NULL; } } i++; } return NULL; } static int atom_size(int format) { if (format == 32) { return sizeof(long); } else { return (format >> 3); } } void ewmh_ChangeProperty( Window w, const char *atom_name, ewmh_atom_list_name list, unsigned char *data, int length) { ewmh_atom *a; int format = 32; if ((a = get_ewmh_atom_by_name(atom_name, list)) != NULL) { int asize; int free_data = 0; if (a->atom_type == XA_UTF8_STRING) { format = 8; } asize = atom_size(format); if ( format == 32 && asize * 8 != format && strcmp(atom_name, "_NET_WM_ICON") == 0) { long *datacopy = (long*)safemalloc(asize * length); int i; for (i = 0; i < length; i++) { datacopy[i] = ((CARD32 *)data)[i]; } data = (unsigned char*)datacopy; free_data = 1; } XChangeProperty( dpy, w, a->atom, a->atom_type , format, PropModeReplace, data, length); if (free_data) { free(data); } } return; } void ewmh_DeleteProperty( Window w, const char *atom_name, ewmh_atom_list_name list) { ewmh_atom *a; if ((a = get_ewmh_atom_by_name(atom_name, list)) != NULL) { XDeleteProperty(dpy, w, a->atom); } return; } static void *atom_get(Window win, Atom to_get, Atom type, int *size) { unsigned char *retval; Atom type_ret; unsigned long bytes_after, num_ret; long length; int format_ret; void *data; int ok; retval = NULL; length = 0x7fffffff; ok = XGetWindowProperty( dpy, win, to_get, 0L, length, False, type, &type_ret, &format_ret, &num_ret, &bytes_after, &retval); if ((ok == Success) && (retval) && (num_ret > 0) && (format_ret > 0)) { int asize; asize = atom_size(format_ret); data = safemalloc(num_ret * asize); if (format_ret == 32 && asize * 8 != format_ret) { int i; for (i = 0; i < num_ret; i++) { ((CARD32 *)data)[i] = ((long *)retval)[i]; } } else { if (data) { memcpy(data, retval, num_ret * asize); } } XFree(retval); *size = num_ret * (format_ret >> 3); return data; } if (retval) { XFree(retval); } return NULL; } void *ewmh_AtomGetByName( Window win, const char *atom_name, ewmh_atom_list_name list, int *size) { ewmh_atom *a; void *data = NULL; if ((a = get_ewmh_atom_by_name(atom_name, list)) != NULL) { data = atom_get(win, a->atom, a->atom_type, size); } return data; } /* * client_root: here the client is fvwm */ static int check_desk(void) { int d = -1; FvwmWindow *fw; for (fw = Scr.FvwmRoot.next; fw != NULL; fw = fw->next) { if (!IS_STICKY_ACROSS_DESKS(fw)) { d = max(d, fw->Desk); } } return d; } void EWMH_SetCurrentDesktop(void) { long val; val = Scr.CurrentDesk; if (val < 0 || (val >= ewmhc.MaxDesktops && ewmhc.MaxDesktops != 0)) { return; } if (val >= ewmhc.CurrentNumberOfDesktops || (ewmhc.NumberOfDesktops != ewmhc.CurrentNumberOfDesktops && val < ewmhc.CurrentNumberOfDesktops)) { EWMH_SetNumberOfDesktops(); } ewmh_ChangeProperty(Scr.Root,"_NET_CURRENT_DESKTOP", EWMH_ATOM_LIST_CLIENT_ROOT, (unsigned char *)&val, 1); return; } void EWMH_SetNumberOfDesktops(void) { long val; if (ewmhc.CurrentNumberOfDesktops < ewmhc.NumberOfDesktops) { ewmhc.CurrentNumberOfDesktops = ewmhc.NumberOfDesktops; } if (ewmhc.CurrentNumberOfDesktops > ewmhc.NumberOfDesktops || ewmhc.NeedsToCheckDesk) { int d = check_desk(); ewmhc.NeedsToCheckDesk = False; if (d >= ewmhc.MaxDesktops && ewmhc.MaxDesktops != 0) d = 0; ewmhc.CurrentNumberOfDesktops = max(ewmhc.NumberOfDesktops, d+1); } if (Scr.CurrentDesk >= ewmhc.CurrentNumberOfDesktops && (Scr.CurrentDesk < ewmhc.MaxDesktops || ewmhc.MaxDesktops == 0)) { ewmhc.CurrentNumberOfDesktops = Scr.CurrentDesk + 1; } val = (long)ewmhc.CurrentNumberOfDesktops; ewmh_ChangeProperty(Scr.Root, "_NET_NUMBER_OF_DESKTOPS", EWMH_ATOM_LIST_CLIENT_ROOT, (unsigned char *)&val, 1); ewmh_SetWorkArea(); return; } void EWMH_SetDesktopViewPort(void) { long val[256][2]; /* no more than 256 desktops */ int i = 0; while(i < ewmhc.NumberOfDesktops && i < 256) { val[i][0] = Scr.Vx; val[i][1] = Scr.Vy; i++; } ewmh_ChangeProperty( Scr.Root, "_NET_DESKTOP_VIEWPORT", EWMH_ATOM_LIST_CLIENT_ROOT, (unsigned char *)&val, i*2); return; } void EWMH_SetDesktopGeometry(void) { long val[2]; val[0] = Scr.VxMax + Scr.MyDisplayWidth; val[1] = Scr.VyMax + Scr.MyDisplayHeight; ewmh_ChangeProperty( Scr.Root,"_NET_DESKTOP_GEOMETRY", EWMH_ATOM_LIST_CLIENT_ROOT, (unsigned char *)&val, 2); return; } /* * client_win: here the client is fvwm */ void EWMH_SetActiveWindow(Window w) { ewmh_ChangeProperty( Scr.Root, "_NET_ACTIVE_WINDOW", EWMH_ATOM_LIST_CLIENT_WIN, (unsigned char *)&w, 1); return; } void EWMH_SetWMDesktop(FvwmWindow *fw) { long desk = fw->Desk; if (IS_STICKY_ACROSS_DESKS(fw)) { desk = (unsigned long)-1; } else if (desk >= ewmhc.CurrentNumberOfDesktops) { ewmhc.NeedsToCheckDesk = True; EWMH_SetNumberOfDesktops(); } ewmh_ChangeProperty( FW_W(fw), "_NET_WM_DESKTOP", EWMH_ATOM_LIST_CLIENT_WIN, (unsigned char *)&desk, 1); return; } /* * fvwm must maintain the _NET_WM_STATE */ void EWMH_SetWMState(FvwmWindow *fw, Bool do_restore) { Atom wm_state[EWMH_NUMBER_OF_STATE]; int i = 0; ewmh_atom *list = ewmh_atom_wm_state; while(list->name != NULL) { if (list->action(fw, NULL, NULL, do_restore)) { wm_state[i++] = list->atom; } list++; } if (i > 0) { ewmh_ChangeProperty( FW_W(fw), "_NET_WM_STATE", EWMH_ATOM_LIST_CLIENT_WIN, (unsigned char *)wm_state, i); } else { ewmh_DeleteProperty( FW_W(fw), "_NET_WM_STATE", EWMH_ATOM_LIST_CLIENT_WIN); } return; } /* * fvwm_root */ /*** kde system tray ***/ /* #define DEBUG_KST */ static void add_kst_item(Window w) { KstItem *t,**prev; t = ewmh_KstWinList; prev = &ewmh_KstWinList; while(t != NULL) { prev = &(t->next); t = t->next; } *prev = (KstItem *)safemalloc(sizeof(KstItem)); (*prev)->w = w; (*prev)->next = NULL; return; } static void delete_kst_item(Window w) { KstItem *t,**prev; t = ewmh_KstWinList; prev = &ewmh_KstWinList; while((t!= NULL)&&(t->w != w)) { prev = &(t->next); t = t->next; } if (t == NULL) { return; } if(prev != NULL) { *prev = t->next; } free(t); return; } static void set_kde_sys_tray(void) { Window *wins = NULL; KstItem *t; int i = 0, nbr = 0; t = ewmh_KstWinList; while(t != NULL) { nbr++; t = t->next; } if (nbr > 0) { wins = (Window *)safemalloc(sizeof(Window) * nbr); } t = ewmh_KstWinList; #ifdef DEBUG_KST fprintf(stderr,"ADD_TO_KST: "); #endif while (t != NULL) { #ifdef DEBUG_KST fprintf(stderr,"0x%lx ",t->w); #endif wins[i++] = t->w; t = t->next; } #ifdef DEBUG_KST fprintf(stderr,"\n"); #endif ewmh_ChangeProperty(Scr.Root,"_KDE_NET_SYSTEM_TRAY_WINDOWS", EWMH_ATOM_LIST_FVWM_ROOT, (unsigned char *)wins,i); if (wins != NULL) { free(wins); } return; } void ewmh_AddToKdeSysTray(FvwmWindow *fw) { int size = 0; CARD32 *val; KstItem *t; val = ewmh_AtomGetByName( FW_W(fw), "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", EWMH_ATOM_LIST_FIXED_PROPERTY, &size); if (val == NULL) { return; } free(val); t = ewmh_KstWinList; while(t != NULL && t->w != FW_W(fw)) t = t->next; if (t != NULL) { return; /* already in the list */ } add_kst_item(FW_W(fw)); set_kde_sys_tray(); return; } #if 0 /* not used at present time */ void ewmh_FreeKdeSysTray(void) { KstItem *t; t = ewmh_KstWinList; while(t != NULL) { XSelectInput(dpy, t->w, NoEventMask); delete_kst_item(t->w); t = ewmh_KstWinList; } set_kde_sys_tray(); return; } #endif int EWMH_IsKdeSysTrayWindow(Window w) { KstItem *t; t = ewmh_KstWinList; while(t != NULL && t->w != w) { t = t->next; } if (t == NULL) { return 0; } #ifdef DEBUG_KST fprintf(stderr,"IsKdeSysTrayWindow: 0x%lx\n", w); #endif return 1; } void EWMH_ManageKdeSysTray(Window w, int type) { KstItem *t; t = ewmh_KstWinList; while(t != NULL && t->w != w) { t = t->next; } if (t == NULL) { return; } switch(type) { case UnmapNotify: #ifdef DEBUG_KST fprintf(stderr,"KST_UNMAP: 0x%lx\n", w); #endif XSelectInput(dpy, w, StructureNotifyMask); XFlush(dpy); break; case DestroyNotify: #ifdef DEBUG_KST fprintf(stderr,"KST_DESTROY: 0x%lx\n", w); #endif XSelectInput(dpy, t->w, NoEventMask); XFlush(dpy); delete_kst_item(w); set_kde_sys_tray(); break; case ReparentNotify: #ifdef DEBUG_KST fprintf(stderr,"KST_Reparent: 0x%lx\n", w); #endif XSelectInput(dpy, w, StructureNotifyMask); XFlush(dpy); break; default: #ifdef DEBUG_KST fprintf(stderr,"KST_NO: 0x%lx\n", w); #endif break; } return; } /**** Client lists ****/ void EWMH_SetClientList(void) { Window *wl = NULL; FvwmWindow *fw; int nbr = 0; int i = 0; for (fw = Scr.FvwmRoot.next; fw != NULL; fw = fw->next) { nbr++; } if (nbr != 0) { wl = (Window *)safemalloc(sizeof(Window) * nbr); for (fw = Scr.FvwmRoot.next; fw != NULL; fw = fw->next) { wl[i++] = FW_W(fw); } } ewmh_ChangeProperty( Scr.Root,"_NET_CLIENT_LIST", EWMH_ATOM_LIST_FVWM_ROOT, (unsigned char *)wl, nbr); if (wl != NULL) { free (wl); } return; } void EWMH_SetClientListStacking(void) { Window *wl = NULL; FvwmWindow *fw; int nbr = 0; int i = 0; for ( fw = Scr.FvwmRoot.stack_next; fw != &Scr.FvwmRoot; fw = fw->stack_next) { nbr++; } i = nbr-1; if (nbr != 0) { wl = (Window *)safemalloc(sizeof(Window) * nbr); for ( fw = Scr.FvwmRoot.stack_next; fw != &Scr.FvwmRoot; fw = fw->stack_next) { wl[i--] = FW_W(fw); } } ewmh_ChangeProperty( Scr.Root,"_NET_CLIENT_LIST_STACKING", EWMH_ATOM_LIST_FVWM_ROOT, (unsigned char *)wl, nbr); if (wl != NULL) { free (wl); } return; } /**** Working Area stuff ****/ /**** At present time we support only sticky windows with strut ****/ void ewmh_SetWorkArea(void) { long val[256][4]; /* no more than 256 desktops */ int i = 0; while(i < ewmhc.NumberOfDesktops && i < 256) { val[i][0] = Scr.Desktops->ewmh_working_area.x; val[i][1] = Scr.Desktops->ewmh_working_area.y; val[i][2] = Scr.Desktops->ewmh_working_area.width; val[i][3] = Scr.Desktops->ewmh_working_area.height; i++; } ewmh_ChangeProperty( Scr.Root, "_NET_WORKAREA", EWMH_ATOM_LIST_FVWM_ROOT, (unsigned char *)&val, i*4); return; } void ewmh_ComputeAndSetWorkArea(void) { int left = ewmhc.BaseStrut.left; int right = ewmhc.BaseStrut.right; int top = ewmhc.BaseStrut.top; int bottom = ewmhc.BaseStrut.bottom; int x,y,width,height; FvwmWindow *fw; for (fw = Scr.FvwmRoot.next; fw != NULL; fw = fw->next) { if ( DO_EWMH_IGNORE_STRUT_HINTS(fw) || !IS_STICKY_ACROSS_PAGES(fw)) { continue; } left = max(left, fw->strut.left); right = max(right, fw->strut.right); top = max(top, fw->strut.top); bottom = max(bottom, fw->strut.bottom); } x = left; y = top; width = Scr.MyDisplayWidth - (left + right); height = Scr.MyDisplayHeight - (top + bottom); if ( Scr.Desktops->ewmh_working_area.x != x || Scr.Desktops->ewmh_working_area.y != y || Scr.Desktops->ewmh_working_area.width != width || Scr.Desktops->ewmh_working_area.height != height) { Scr.Desktops->ewmh_working_area.x = x; Scr.Desktops->ewmh_working_area.y = y; Scr.Desktops->ewmh_working_area.width = width; Scr.Desktops->ewmh_working_area.height = height; ewmh_SetWorkArea(); } return; } void ewmh_HandleDynamicWorkArea(void) { int dyn_left = ewmhc.BaseStrut.left; int dyn_right = ewmhc.BaseStrut.right; int dyn_top = ewmhc.BaseStrut.top; int dyn_bottom = ewmhc.BaseStrut.bottom; int x,y,width,height; FvwmWindow *fw; for (fw = Scr.FvwmRoot.next; fw != NULL; fw = fw->next) { if ( DO_EWMH_IGNORE_STRUT_HINTS(fw) || !IS_STICKY_ACROSS_PAGES(fw)) { continue; } dyn_left = max(dyn_left, fw->dyn_strut.left); dyn_right = max(dyn_right, fw->dyn_strut.right); dyn_top = max(dyn_top, fw->dyn_strut.top); dyn_bottom = max(dyn_bottom, fw->dyn_strut.bottom); } x = dyn_left; y = dyn_top; width = Scr.MyDisplayWidth - (dyn_left + dyn_right); height = Scr.MyDisplayHeight - (dyn_top + dyn_bottom); if ( Scr.Desktops->ewmh_dyn_working_area.x != x || Scr.Desktops->ewmh_dyn_working_area.y != y || Scr.Desktops->ewmh_dyn_working_area.width != width || Scr.Desktops->ewmh_dyn_working_area.height != height) { Scr.Desktops->ewmh_dyn_working_area.x = x; Scr.Desktops->ewmh_dyn_working_area.y = y; Scr.Desktops->ewmh_dyn_working_area.width = width; Scr.Desktops->ewmh_dyn_working_area.height = height; /* here we may update the maximized window ...etc */ } return; } void EWMH_UpdateWorkArea(void) { ewmh_ComputeAndSetWorkArea(); ewmh_HandleDynamicWorkArea(); return; } void EWMH_GetWorkAreaIntersection( FvwmWindow *fw, int *x, int *y, int *w, int *h, int type) { int nx,ny,nw,nh; int area_x = Scr.Desktops->ewmh_working_area.x; int area_y = Scr.Desktops->ewmh_working_area.y; int area_w = Scr.Desktops->ewmh_working_area.width; int area_h = Scr.Desktops->ewmh_working_area.height; Bool is_dynamic = False; switch(type) { case EWMH_IGNORE_WORKING_AREA: return; case EWMH_USE_WORKING_AREA: break; case EWMH_USE_DYNAMIC_WORKING_AREA: is_dynamic = True; break; default: break; } if (is_dynamic) { area_x = Scr.Desktops->ewmh_dyn_working_area.x; area_y = Scr.Desktops->ewmh_dyn_working_area.y; area_w = Scr.Desktops->ewmh_dyn_working_area.width; area_h = Scr.Desktops->ewmh_dyn_working_area.height; } nx = max(*x, area_x); ny = max(*y, area_y); nw = min(*x + *w, area_x + area_w) - nx; nh = min(*y + *h, area_y + area_h) - ny; *x = nx; *y = ny; *w = nw; *h = nh; return; } static float get_intersection( int x11, int y11, int x12, int y12, int x21, int y21, int x22, int y22, Bool use_percent) { float ret = 0; int xl, xr, yt, yb; if (x11 < x22 && x12 > x21 && y11 < y22 && y12 > y21) { xl = max(x11, x21); xr = min(x12, x22); yt = max(y11, y21); yb = min(y12, y22); ret = (xr - xl) * (yb - yt); } if (use_percent && (x22 - x21) * (y22 - y21) != 0 && (x12 - x11) * (y12 - y11) != 0) { ret = 100 * max(ret / ((x22 - x21) * (y22 - y21)), ret / ((x12 - x11) * (y12 - y11))); } return ret; } static float ewmh_GetStrutIntersection( int x11, int y11, int x12, int y12, int left, int right, int top, int bottom, Bool use_percent) { float ret = 0; int x21, y21, x22, y22; /* left */ x21 = 0; y21 = 0; x22 = left; y22 = Scr.MyDisplayHeight; ret += get_intersection( x11, y11, x12, y12, x21, y21, x22, y22, use_percent); /* right */ x21 = Scr.MyDisplayWidth - right; y21 = 0; x22 = Scr.MyDisplayWidth; y22 = Scr.MyDisplayHeight; ret += get_intersection( x11, y11, x12, y12, x21, y21, x22, y22, use_percent); /* top */ x21 = 0; y21 = 0; x22 = Scr.MyDisplayWidth; y22 = top; ret += get_intersection( x11, y11, x12, y12, x21, y21, x22, y22, use_percent); /* bottom */ x21 = 0; y21 = Scr.MyDisplayHeight - bottom; x22 = Scr.MyDisplayWidth; y22 = Scr.MyDisplayHeight; ret += get_intersection( x11, y11, x12, y12, x21, y21, x22, y22, use_percent); return ret; } float EWMH_GetBaseStrutIntersection( int x11, int y11, int x12, int y12, Bool use_percent) { return ewmh_GetStrutIntersection( x11, y11, x12, y12, ewmhc.BaseStrut.left, ewmhc.BaseStrut.right, ewmhc.BaseStrut.top, ewmhc.BaseStrut.bottom, use_percent); } float EWMH_GetStrutIntersection( int x11, int y11, int x12, int y12, Bool use_percent) { int left, right, top, bottom; left = Scr.Desktops->ewmh_working_area.x; right = Scr.MyDisplayWidth - (Scr.Desktops->ewmh_working_area.x + Scr.Desktops->ewmh_working_area.width); top = Scr.Desktops->ewmh_working_area.y; bottom = Scr.MyDisplayHeight - (Scr.Desktops->ewmh_working_area.y + Scr.Desktops->ewmh_working_area.height); return ewmh_GetStrutIntersection( x11, y11, x12, y12, left, right, top, bottom, use_percent); } /* * fvwm_win */ void EWMH_SetFrameStrut(FvwmWindow *fw) { long val[4]; size_borders b; if (EWMH_IsKdeSysTrayWindow(FW_W(fw))) { /* Fixed position of tray window in kicker */ return; } get_window_borders(fw, &b); /* left */ val[0] = b.top_left.width; /* right */ val[1] = b.bottom_right.width; /* top */ val[2] = b.top_left.height; /* bottom */ val[3] = b.bottom_right.height; ewmh_ChangeProperty( FW_W(fw), "_KDE_NET_WM_FRAME_STRUT", EWMH_ATOM_LIST_FVWM_WIN, (unsigned char *)&val, 4); ewmh_ChangeProperty( FW_W(fw), "_NET_FRAME_EXTENTS", EWMH_ATOM_LIST_FVWM_WIN, (unsigned char *)&val, 4); return; } /* * allowed actions */ Bool ewmh_AllowsYes(EWMH_CMD_ARGS) { return True; } Bool ewmh_AllowsClose(EWMH_CMD_ARGS) { return is_function_allowed( F_CLOSE, NULL, fw, RQORIG_PROGRAM_US, False); } Bool ewmh_AllowsFullScreen(EWMH_CMD_ARGS) { if ( !is_function_allowed( F_MAXIMIZE, NULL, fw, RQORIG_PROGRAM_US, False) || !is_function_allowed( F_MOVE, NULL, fw, RQORIG_PROGRAM_US, False) || !is_function_allowed( F_RESIZE, NULL, fw, RQORIG_PROGRAM_US, True)) { return False; } return True; } Bool ewmh_AllowsMinimize(EWMH_CMD_ARGS) { return is_function_allowed(F_ICONIFY, NULL, fw, RQORIG_PROGRAM_US, False); } Bool ewmh_AllowsMaximize(EWMH_CMD_ARGS) { return is_function_allowed(F_MAXIMIZE, NULL, fw, RQORIG_PROGRAM_US, False); } Bool ewmh_AllowsMove(EWMH_CMD_ARGS) { return is_function_allowed(F_MOVE, NULL, fw, RQORIG_PROGRAM_US, False); } Bool ewmh_AllowsResize(EWMH_CMD_ARGS) { return is_function_allowed(F_RESIZE, NULL, fw, RQORIG_PROGRAM_US, False); } void EWMH_SetAllowedActions(FvwmWindow *fw) { Atom wm_actions[EWMH_NUMBER_OF_ALLOWED_ACTIONS]; int i = 0; ewmh_atom *list = ewmh_atom_allowed_actions; while(list->name != NULL) { if (list->action(fw, NULL, NULL, 0)) wm_actions[i++] = list->atom; list++; } if (i > 0) { ewmh_ChangeProperty( FW_W(fw), "_NET_WM_ALLOWED_ACTIONS", EWMH_ATOM_LIST_FVWM_WIN, (unsigned char *)wm_actions, i); } else { ewmh_DeleteProperty( FW_W(fw), "_NET_WM_ALLOWED_ACTIONS", EWMH_ATOM_LIST_FVWM_WIN); } return; } /* * Window types */ int ewmh_HandleDesktop(EWMH_CMD_ARGS) { if (Scr.EwmhDesktop != NULL && FW_W(Scr.EwmhDesktop) != FW_W(fw)) { fvwm_msg( WARN,"ewmh_HandleDesktop", "A Desktop application (0x%lx) already runs! This" " can cause problems\n", FW_W(Scr.EwmhDesktop)); /* what to do ? */ } fw->ewmh_window_type = EWMH_WINDOW_TYPE_DESKTOP_ID; Scr.EwmhDesktop = fw; SSET_LAYER(*style, 0); style->flags.use_layer = 1; style->flag_mask.use_layer = 1; style->change_mask.use_layer = 1; S_SET_IS_STICKY_ACROSS_PAGES(SCF(*style), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCM(*style), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCC(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCF(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCM(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCC(*style), 1); S_SET_IS_FIXED(SCF(*style), 1); S_SET_IS_FIXED(SCM(*style), 1); S_SET_IS_FIXED(SCC(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCF(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCM(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCC(*style), 1); S_SET_DO_CIRCULATE_SKIP(SCF(*style), 1); S_SET_DO_CIRCULATE_SKIP(SCM(*style), 1); S_SET_DO_CIRCULATE_SKIP(SCC(*style), 1); S_SET_IS_UNICONIFIABLE(SCF(*style), 1); S_SET_IS_UNICONIFIABLE(SCM(*style), 1); S_SET_IS_UNICONIFIABLE(SCC(*style), 1); S_SET_IS_UNMAXIMIZABLE(SCF(*style), 1); S_SET_IS_UNMAXIMIZABLE(SCM(*style), 1); S_SET_IS_UNMAXIMIZABLE(SCC(*style), 1); /* No border */ SSET_BORDER_WIDTH(*style, 0); style->flags.has_border_width = 1; style->flag_mask.has_border_width = 1; style->change_mask.has_border_width = 1; SSET_HANDLE_WIDTH(*style, 0); style->flags.has_handle_width = 1; style->flag_mask.has_handle_width = 1; style->change_mask.has_handle_width = 1; /* no title */ style->flags.has_no_title = 1; style->flag_mask.has_no_title = 1; style->change_mask.has_no_title = 1; /* ClickToFocus, I do not think we should use NeverFocus */ FPS_FOCUS_CLICK_CLIENT(S_FOCUS_POLICY(SCF(*style)), 1); FPS_FOCUS_CLICK_CLIENT(S_FOCUS_POLICY(SCM(*style)), 1); FPS_FOCUS_CLICK_CLIENT(S_FOCUS_POLICY(SCC(*style)), 1); FPS_GRAB_FOCUS(S_FOCUS_POLICY(SCF(*style)), 1); FPS_GRAB_FOCUS(S_FOCUS_POLICY(SCM(*style)), 1); FPS_GRAB_FOCUS(S_FOCUS_POLICY(SCC(*style)), 1); /* ClickToFocusPassesClick */ FPS_PASS_FOCUS_CLICK(S_FOCUS_POLICY(SCF(*style)), 1); FPS_PASS_FOCUS_CLICK(S_FOCUS_POLICY(SCM(*style)), 1); FPS_PASS_FOCUS_CLICK(S_FOCUS_POLICY(SCC(*style)), 1); FPS_PASS_RAISE_CLICK(S_FOCUS_POLICY(SCF(*style)), 1); FPS_PASS_RAISE_CLICK(S_FOCUS_POLICY(SCM(*style)), 1); FPS_PASS_RAISE_CLICK(S_FOCUS_POLICY(SCC(*style)), 1); /* not useful */ FPS_RAISE_FOCUSED_CLIENT_CLICK(S_FOCUS_POLICY(SCF(*style)), 0); FPS_RAISE_FOCUSED_CLIENT_CLICK(S_FOCUS_POLICY(SCM(*style)), 1); FPS_RAISE_FOCUSED_CLIENT_CLICK(S_FOCUS_POLICY(SCC(*style)), 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK(S_FOCUS_POLICY(SCF(*style)), 0); FPS_RAISE_UNFOCUSED_CLIENT_CLICK(S_FOCUS_POLICY(SCM(*style)), 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK(S_FOCUS_POLICY(SCC(*style)), 1); FPS_RAISE_FOCUSED_DECOR_CLICK(S_FOCUS_POLICY(SCF(*style)), 0); FPS_RAISE_FOCUSED_DECOR_CLICK(S_FOCUS_POLICY(SCM(*style)), 1); FPS_RAISE_FOCUSED_DECOR_CLICK(S_FOCUS_POLICY(SCC(*style)), 1); FPS_RAISE_UNFOCUSED_DECOR_CLICK(S_FOCUS_POLICY(SCF(*style)), 0); FPS_RAISE_UNFOCUSED_DECOR_CLICK(S_FOCUS_POLICY(SCM(*style)), 1); FPS_RAISE_UNFOCUSED_DECOR_CLICK(S_FOCUS_POLICY(SCC(*style)), 1); return 1; } int ewmh_HandleDialog(EWMH_CMD_ARGS) { fw->ewmh_window_type = EWMH_WINDOW_TYPE_DIALOG_ID; return 0; } int ewmh_HandleDock(EWMH_CMD_ARGS) { fw->ewmh_window_type = EWMH_WINDOW_TYPE_DOCK_ID; S_SET_IS_STICKY_ACROSS_PAGES(SCF(*style), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCM(*style), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCC(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCF(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCM(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCC(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCF(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCM(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCC(*style), 1); S_SET_DO_CIRCULATE_SKIP(SCF(*style), 1); S_SET_DO_CIRCULATE_SKIP(SCM(*style), 1); S_SET_DO_CIRCULATE_SKIP(SCC(*style), 1); S_SET_IS_UNICONIFIABLE(SCF(*style), 1); S_SET_IS_UNICONIFIABLE(SCM(*style), 1); S_SET_IS_UNICONIFIABLE(SCC(*style), 1); S_SET_IS_UNMAXIMIZABLE(SCF(*style), 1); S_SET_IS_UNMAXIMIZABLE(SCM(*style), 1); S_SET_IS_UNMAXIMIZABLE(SCC(*style), 1); if (fw->ewmh_hint_layer == -1) { fw->ewmh_hint_layer = Scr.TopLayer; if (DO_EWMH_USE_STACKING_HINTS(style)) { SSET_LAYER(*style, Scr.TopLayer); style->flags.use_layer = 1; style->flag_mask.use_layer = 1; style->change_mask.use_layer = 1; } else if (!style->change_mask.use_layer) { SSET_LAYER(*style, Scr.DefaultLayer); style->flags.use_layer = 1; style->flag_mask.use_layer = 1; style->change_mask.use_layer = 1; } } /* no title ? MWM hints should be used by the app but ... */ return 1; } int ewmh_HandleMenu(EWMH_CMD_ARGS) { fw->ewmh_window_type = EWMH_WINDOW_TYPE_MENU_ID; /* tear off menu */ S_SET_DO_WINDOW_LIST_SKIP(SCF(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCM(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCC(*style), 1); S_SET_DO_CIRCULATE_SKIP(SCF(*style), 1); S_SET_DO_CIRCULATE_SKIP(SCM(*style), 1); S_SET_DO_CIRCULATE_SKIP(SCC(*style), 1); /* NeverFocus */ FPS_LENIENT(S_FOCUS_POLICY(SCF(*style)), 0); FPS_LENIENT(S_FOCUS_POLICY(SCM(*style)), 1); FPS_LENIENT(S_FOCUS_POLICY(SCC(*style)), 1); FPS_FOCUS_ENTER(S_FOCUS_POLICY(SCF(*style)), 0); FPS_UNFOCUS_LEAVE(S_FOCUS_POLICY(SCF(*style)), 0); FPS_FOCUS_CLICK_CLIENT(S_FOCUS_POLICY(SCF(*style)), 0); FPS_FOCUS_CLICK_DECOR(S_FOCUS_POLICY(SCF(*style)), 0); FPS_FOCUS_CLICK_ICON(S_FOCUS_POLICY(SCF(*style)), 0); FPS_FOCUS_BY_FUNCTION(S_FOCUS_POLICY(SCF(*style)), 0); FPS_FOCUS_ENTER(S_FOCUS_POLICY(SCM(*style)), 1); FPS_FOCUS_ENTER(S_FOCUS_POLICY(SCC(*style)), 1); FPS_UNFOCUS_LEAVE(S_FOCUS_POLICY(SCM(*style)), 1); FPS_UNFOCUS_LEAVE(S_FOCUS_POLICY(SCC(*style)), 1); FPS_FOCUS_CLICK_CLIENT(S_FOCUS_POLICY(SCM(*style)), 1); FPS_FOCUS_CLICK_CLIENT(S_FOCUS_POLICY(SCC(*style)), 1); FPS_FOCUS_CLICK_DECOR(S_FOCUS_POLICY(SCM(*style)), 1); FPS_FOCUS_CLICK_DECOR(S_FOCUS_POLICY(SCC(*style)), 1); FPS_FOCUS_CLICK_ICON(S_FOCUS_POLICY(SCM(*style)), 1); FPS_FOCUS_CLICK_ICON(S_FOCUS_POLICY(SCC(*style)), 1); FPS_FOCUS_BY_FUNCTION(S_FOCUS_POLICY(SCM(*style)), 1); FPS_FOCUS_BY_FUNCTION(S_FOCUS_POLICY(SCC(*style)), 1); return 1; } int ewmh_HandleNormal(EWMH_CMD_ARGS) { fw->ewmh_window_type = EWMH_WINDOW_TYPE_NORMAL_ID; return 0; } int ewmh_HandleToolBar(EWMH_CMD_ARGS) { fw->ewmh_window_type = EWMH_WINDOW_TYPE_TOOLBAR_ID; /* this ok for KDE 2 (and 3??) but I do not think that a toolbar should be sticky */ S_SET_IS_STICKY_ACROSS_PAGES(SCF(*style), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCM(*style), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCC(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCF(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCM(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCC(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCF(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCM(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCC(*style), 1); S_SET_DO_CIRCULATE_SKIP(SCF(*style), 1); S_SET_DO_CIRCULATE_SKIP(SCM(*style), 1); S_SET_DO_CIRCULATE_SKIP(SCC(*style), 1); /* no title ? MWM hints should be used by the app but ... */ return 1; } int ewmh_HandleNotification(EWMH_CMD_ARGS) { /* fw->ewmh_window_type is generally used by FvwmIdent, but for this * EWMH type it is not used. Reporting on unmanaged windows with * FvwmIdent won't work anyway as the click to the window is eaten. * So although setting this is a NOP, it might be useful for things in * the future. */ fw->ewmh_window_type = EWMH_WINDOW_TYPE_NOTIFICATION_ID; style->flags.is_unmanaged = 1; style->flag_mask.is_unmanaged = 1; style->change_mask.is_unmanaged = 1; return 1; } void ewmh_HandleWindowType(FvwmWindow *fw, window_style *style) { CARD32 *val; unsigned int nitems; ewmh_atom *list = ewmh_atom_window_type; int size = 0; int i = 0; Bool found = False; fw->ewmh_window_type = 0; if (DO_EWMH_IGNORE_WINDOW_TYPE(style)) { return; } val = ewmh_AtomGetByName( FW_W(fw), "_NET_WM_WINDOW_TYPE", EWMH_ATOM_LIST_FIXED_PROPERTY, &size); if (val == NULL) { return; } /* we support only one window type: the first that we support */ nitems = size / sizeof(CARD32); while(i < nitems && !found) { list = ewmh_atom_window_type; while(list->name != NULL && !found) { if (list->atom == val[i]) { list->action(fw, NULL, style, 0); found = True; } list++; } i++; } free(val); return; } /* * a workaround for ksmserver exit windows */ static int ksmserver_workarround(FvwmWindow *fw) { if (fw->name.name != NULL && fw->class.res_name != NULL && fw->icon_name.name != NULL && fw->class.res_class != NULL && strcmp(fw->name.name, "ksmserver") == 0 && strcmp(fw->class.res_class, "ksmserver") == 0 && strcmp(fw->icon_name.name, "ksmserver") == 0 && strcmp(fw->class.res_name, "unnamed") == 0) { int layer = 0; if (IS_TRANSIENT(fw)) { layer = Scr.TopLayer + 2; } else { layer = Scr.TopLayer + 1; } new_layer(fw, layer); return 1; } return 0; } /* * Window Initialisation / Destroy */ void EWMH_GetStyle(FvwmWindow *fw, window_style *style) { if (style->change_mask.use_layer) { fw->ewmh_normal_layer = SGET_LAYER(*style); } else if (fw->ewmh_normal_layer == 0) { fw->ewmh_normal_layer = Scr.DefaultLayer; } ewmh_WMState(fw, NULL, style, 0); ewmh_WMDesktop(fw, NULL, style, 0); /* the window type override the state hint */ ewmh_HandleWindowType(fw, style); return; } static void ewmh_check_wm_pid(FvwmWindow *fw) { int size = 0; CARD32 *val; fw->ewmh_window_type = 0; val = ewmh_AtomGetByName( FW_W(fw), "_NET_WM_PID", EWMH_ATOM_LIST_FIXED_PROPERTY, &size); if (val != NULL) { free(val); SET_HAS_EWMH_WM_PID(fw, 1); if (CR_MOTION_METHOD(fw) == CR_MOTION_METHOD_AUTO) { SET_CR_MOTION_METHOD(fw, CR_MOTION_METHOD_USE_GRAV); SET_CR_MOTION_METHOD_DETECTED(fw, 1); } } return; } /* see also EWMH_WMName and EWMH_WMIconName in add_window */ void EWMH_WindowInit(FvwmWindow *fw) { /*EWMH_DLOG("Init window 0x%lx",FW_W(fw));*/ EWMH_SetWMState(fw, False); EWMH_SetWMDesktop(fw); EWMH_SetAllowedActions(fw); ewmh_WMStrut(fw, NULL, NULL, 0); ewmh_WMIconGeometry(fw, NULL, NULL, 0); ewmh_AddToKdeSysTray(fw); EWMH_SetFrameStrut(fw); if (IS_EWMH_DESKTOP(FW_W(fw))) { return; } if (ksmserver_workarround(fw)) { return; } ewmh_WMIcon(fw, NULL, NULL, 0); ewmh_check_wm_pid(fw); /*EWMH_DLOG("window 0x%lx initialised",FW_W(fw));*/ return; } /* unmap or reparent: restore state */ void EWMH_RestoreInitialStates(FvwmWindow *fw, int event_type) { EWMH_SetWMState(fw, True); if (HAS_EWMH_INIT_WM_DESKTOP(fw) == EWMH_STATE_HAS_HINT) { ewmh_ChangeProperty( FW_W(fw), "_NET_WM_DESKTOP", EWMH_ATOM_LIST_CLIENT_WIN, (unsigned char *)&(fw->ewmh_hint_desktop), 1); } else { ewmh_DeleteProperty( FW_W(fw), "_NET_WM_DESKTOP", EWMH_ATOM_LIST_CLIENT_WIN); } if (HAS_EWMH_WM_ICON_HINT(fw) == EWMH_FVWM_ICON) { EWMH_DeleteWmIcon(fw, True, True); } return; } /* a window are going to be destroyed (in the add_window.c destroy_window * sens) */ void EWMH_DestroyWindow(FvwmWindow *fw) { if (IS_EWMH_DESKTOP(FW_W(fw))) { Scr.EwmhDesktop = NULL; } if (fw->Desk >= ewmhc.NumberOfDesktops) { ewmhc.NeedsToCheckDesk = True; } return; } /* a window has been destroyed (unmap/reparent/destroy) */ void EWMH_WindowDestroyed(void) { EWMH_SetClientList(); EWMH_SetClientListStacking(); if (ewmhc.NeedsToCheckDesk) { EWMH_SetNumberOfDesktops(); } ewmh_ComputeAndSetWorkArea(); ewmh_HandleDynamicWorkArea(); return; } /* * Init Stuff */ static int set_all_atom_in_list(ewmh_atom *list) { int l = 0; while(list->name != NULL) { list->atom = XInternAtom(dpy,list->name,False); if (list->atom_type == None) { list->atom_type = XA_UTF8_STRING; } l++; list++; } return l; } static void set_net_supported(int l) { Atom *supported; int i, k = 0; supported = (Atom *)safemalloc(l*sizeof(Atom)); for(i=0; i < NUMBER_OF_ATOM_LISTS; i++) { ewmh_atom *list = atom_list[i].list; while(list->name != NULL) { supported[k++] = list->atom; list++; } } ewmh_ChangeProperty( Scr.Root, "_NET_SUPPORTED", EWMH_ATOM_LIST_FVWM_ROOT, (unsigned char *)supported, k); free(supported); return; } static void clean_up(void) { ewmh_ChangeProperty( Scr.Root,"_KDE_NET_SYSTEM_TRAY_WINDOWS", EWMH_ATOM_LIST_FVWM_ROOT, NULL, 0); return; } void EWMH_Init(void) { int i; int supported_count = 0; long val; XTextProperty text; unsigned char utf_name[4]; char *names[1]; XClassHint classhints; /* initialisation of all the atoms */ XA_UTF8_STRING = XInternAtom(dpy,"UTF8_STRING",False); for(i=0; i < NUMBER_OF_ATOM_LISTS; i++) { supported_count += set_all_atom_in_list(atom_list[i].list); } /* the laws that we respect */ set_net_supported(supported_count); /* use the Scr.NoFocusWin as the WM_CHECK window */ val = Scr.NoFocusWin; ewmh_ChangeProperty( Scr.Root, "_NET_SUPPORTING_WM_CHECK", EWMH_ATOM_LIST_FVWM_ROOT, (unsigned char *)&val, 1); ewmh_ChangeProperty( Scr.NoFocusWin, "_NET_SUPPORTING_WM_CHECK", EWMH_ATOM_LIST_FVWM_ROOT, (unsigned char *)&val, 1); names[0] = "fvwm"; classhints.res_name= "fvwm"; classhints.res_class= "FVWM"; XSetClassHint(dpy, Scr.NoFocusWin, &classhints); if (XStringListToTextProperty(names, 1, &text)) { XSetWMName(dpy, Scr.NoFocusWin, &text); XFree(text.value); } /* FVWM in UTF8 */ utf_name[0] = 0x46; utf_name[1] = 0x56; utf_name[2] = 0x57; utf_name[3] = 0x4D; ewmh_ChangeProperty( Scr.NoFocusWin, "_NET_WM_NAME", EWMH_ATOM_LIST_PROPERTY_NOTIFY, (unsigned char *)&utf_name, 4); clean_up(); EWMH_SetDesktopNames(); EWMH_SetCurrentDesktop(); EWMH_SetNumberOfDesktops(); EWMH_SetDesktopViewPort(); EWMH_SetDesktopGeometry(); EWMH_SetClientList(); EWMH_SetClientListStacking(); ewmh_ComputeAndSetWorkArea(); return; } /* * Exit Stuff */ void EWMH_ExitStuff(void) { FvwmWindow *fw; for (fw = Scr.FvwmRoot.next; fw != NULL; fw = fw->next) { EWMH_RestoreInitialStates(fw, 0); } return; } #ifdef EWMH_DEBUG void EWMH_DLOG(char *msg, ...) { va_list args; clock_t time_val, time_taken; static clock_t start_time = 0; static clock_t prev_time = 0; struct tms not_used_tms; char buffer[200]; /* oversized */ time_t mytime; struct tm *t_ptr; time(&mytime); t_ptr = localtime(&mytime); if (start_time == 0) { /* get clock ticks */ prev_time = start_time = (unsigned int)times(¬_used_tms); } /* get clock ticks */ time_val = (unsigned int)times(¬_used_tms); time_taken = time_val - prev_time; prev_time = time_val; sprintf( buffer, "%.2d:%.2d:%.2d %6ld", t_ptr->tm_hour, t_ptr->tm_min, t_ptr->tm_sec, time_taken); fprintf(stderr, "EWMH DEBUG: "); va_start(args,msg); vfprintf(stderr, msg, args); va_end(args); fprintf(stderr, "\n"); fprintf(stderr, " [time]: %s\n",buffer); return; } #endif void EWMH_fullscreen(FvwmWindow *fw) { fscreen_scr_arg fscr; rectangle scr_g; size_borders b; int page_x; int page_y; char cmd[128] = "\0"; /* maximize with ResizeMoveMaximize */ if ( !is_function_allowed( F_MAXIMIZE, NULL, fw, RQORIG_PROGRAM_US, False) || !is_function_allowed( F_MOVE, NULL, fw, RQORIG_PROGRAM_US, False) || !is_function_allowed( F_RESIZE, NULL, fw, RQORIG_PROGRAM_US, True)) { return; } fw->fullscreen.was_maximized = 0; fw->fullscreen.is_shaded = 0; /* Keep the old geometry when restoring from fullscreen. */ memcpy(&fw->fullscreen.g, &fw->g, sizeof(struct window_g)); if (IS_MAXIMIZED(fw)) fw->fullscreen.was_maximized = 1; if (IS_ICONIFIED(fw)) { fw->fullscreen.is_iconified = 1; execute_function_override_window( NULL, NULL, "Iconify off", 0, fw); } if (IS_SHADED(fw)) { int sas = fw->shade_anim_steps; fw->fullscreen.is_shaded = 1; fw->shade_anim_steps = 0; execute_function_override_window( NULL, NULL, "WindowShade off", 0, fw); fw->shade_anim_steps = sas; } SET_EWMH_FULLSCREEN(fw,True); apply_decor_change(fw); fscr.xypos.x = fw->g.frame.x + fw->g.frame.width / 2; fscr.xypos.y = fw->g.frame.y + fw->g.frame.height / 2; FScreenGetScrRect( &fscr, FSCREEN_XYPOS, &scr_g.x, &scr_g.y, &scr_g.width, &scr_g.height); get_window_borders(fw, &b); get_page_offset_check_visible(&page_x, &page_y, fw); sprintf( cmd, "ResizeMoveMaximize %dp %dp +%dp +%dp ewmhiwa", scr_g.width, scr_g.height, scr_g.x - b.top_left.width + page_x, scr_g.y - b.top_left.height + page_y); if (DO_EWMH_USE_STACKING_HINTS(fw)) { int sl = fw->ewmh_normal_layer; new_layer(fw, Scr.TopLayer); if (sl == 0) { fw->ewmh_normal_layer = Scr.DefaultLayer; } else { fw->ewmh_normal_layer = sl; } } if (cmd[0] != 0) { SET_DISABLE_CONSTRAIN_SIZE_FULLSCREEN(fw, 1); execute_function_override_window(NULL, NULL, cmd, 0, fw); SET_DISABLE_CONSTRAIN_SIZE_FULLSCREEN(fw, 0); } return; } fvwm-2.6.5.orig/fvwm/conditional.c0000644000175000017500000013116011652476141015261 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "libs/fvwmlib.h" #include "libs/Parse.h" #include "libs/wild.h" #include "libs/FScreen.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "functions.h" #include "conditional.h" #include "misc.h" #include "screen.h" #include "update.h" #include "style.h" #include "focus.h" #include "geometry.h" #include "stack.h" #include "commands.h" #include "decorations.h" #include "virtual.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* * * Direction = 1 ==> "Next" operation * Direction = -1 ==> "Previous" operation * Direction = 0 ==> operation on current window (returns pass or fail) * */ static FvwmWindow *Circulate( FvwmWindow *sf, char *action, int Direction, char **restofline) { int pass = 0; FvwmWindow *fw, *found = NULL; WindowConditionMask mask; char *flags; /* Create window mask */ flags = CreateFlagString(action, restofline); DefaultConditionMask(&mask); if (Direction == 0) { /* override for Current [] */ mask.my_flags.use_circulate_hit = 1; mask.my_flags.use_circulate_hit_icon = 1; mask.my_flags.use_circulate_hit_shaded = 1; } CreateConditionMask(flags, &mask); if (flags) { free(flags); } if (sf == NULL || Direction == 0) { sf = get_focus_window(); } if (sf != NULL) { if (Direction > 0) { fw = sf->prev; } else if (Direction < 0) { fw = sf->next; } else { fw = sf; } } else { fw = NULL; if (Direction == 0) { FreeConditionMask(&mask); return NULL; } } for (pass = 0; pass < 3 && !found; pass++) { while (fw && !found && fw != &Scr.FvwmRoot) { /* Make CirculateUp and CirculateDown take args. by * Y.NOMURA */ if (MatchesConditionMask(fw, &mask)) { found = fw; } else { if (Direction > 0) { fw = fw->prev; } else { fw = fw->next; } } if (Direction == 0) { FreeConditionMask(&mask); return found; } } if (fw == NULL || fw == &Scr.FvwmRoot) { if (Direction > 0) { /* Go to end of list */ for (fw = Scr.FvwmRoot.next; fw && fw->next; fw = fw->next) { /* nop */ } } else { /* Go to top of list */ fw = Scr.FvwmRoot.next; } } } FreeConditionMask(&mask); return found; } static void circulate_cmd( F_CMD_ARGS, int new_context, int circ_dir, Bool do_use_found, Bool do_exec_on_match) { FvwmWindow *found; char *restofline; found = Circulate(exc->w.fw, action, circ_dir, &restofline); if (cond_rc != NULL) { cond_rc->rc = (found == NULL) ? COND_RC_NO_MATCH : COND_RC_OK; } if ((!found == !do_exec_on_match) && restofline) { const exec_context_t *exc2; exec_context_changes_t ecc; int flags; ecc.w.fw = (do_use_found == True) ? found : NULL; if (found != NULL) { ecc.w.w = FW_W(found); flags = FUNC_DONT_DEFER; } else { ecc.w.w = None; flags = 0; } ecc.w.wcontext = new_context; exc2 = exc_clone_context( exc, &ecc, ECC_FW | ECC_W | ECC_WCONTEXT); execute_function(cond_rc, exc2, restofline, flags); exc_destroy_context(exc2); } return; } static void select_cmd(F_CMD_ARGS) { char *restofline; char *flags; WindowConditionMask mask; FvwmWindow * const fw = exc->w.fw; if (!fw || IS_EWMH_DESKTOP(FW_W(fw))) { if (cond_rc != NULL) { cond_rc->rc = COND_RC_ERROR; } return; } flags = CreateFlagString(action, &restofline); DefaultConditionMask(&mask); mask.my_flags.use_circulate_hit = 1; mask.my_flags.use_circulate_hit_icon = 1; mask.my_flags.use_circulate_hit_shaded = 1; CreateConditionMask(flags, &mask); if (flags) { free(flags); } if (MatchesConditionMask(fw, &mask) && restofline) { if (cond_rc != NULL) { cond_rc->rc = COND_RC_OK; } execute_function_override_wcontext( cond_rc, exc, restofline, 0, C_WINDOW); } else if (cond_rc != NULL) { cond_rc->rc = COND_RC_NO_MATCH; } FreeConditionMask(&mask); return; } static Bool cond_check_access(char *file, int type, Bool im) { char *full_file; char *path = NULL; if (!file || *file == 0) { return False; } if (file[0] == '/') { if (access(file, type) == 0) { return True; } else { return False; } } if (type != X_OK && im == False) { return False; } if (im == False) { path = getenv("PATH"); } else { path = PictureGetImagePath(); } if (path == NULL || *path == 0) { return False; } full_file = searchPath(path, file, NULL, type); if (full_file) { free(full_file); return True; } return False; } /* ---------------------------- interface functions ------------------------ */ /* * Parses the flag string and returns the text between [ ] or ( ) * characters. The start of the rest of the line is put in restptr. * Note that the returned string is allocated here and it must be * freed when it is not needed anymore. * NOTE - exported via .h */ char *CreateFlagString(char *string, char **restptr) { char *retval; char *c; char *start; char closeopt; int length; c = string; while (isspace((unsigned char)*c) && (*c != 0)) { c++; } if (*c == '[' || *c == '(') { char *d; /* Get the text between [ ] or ( ) */ if (*c == '[') { closeopt = ']'; } else { closeopt = ')'; } c++; start = c; length = 0; while (*c != closeopt) { if (*c == 0) { fvwm_msg(ERR, "CreateFlagString", "Conditionals require closing " "parenthesis"); *restptr = NULL; return NULL; } /* skip quoted string */ d = SkipQuote(c, NULL, NULL, NULL); length += d - c; c = d; } /* We must allocate a new string because we null terminate the * string between the [ ] or ( ) characters. */ retval = safemalloc(length + 1); strncpy(retval, start, length); retval[length] = 0; *restptr = c + 1; } else { retval = NULL; *restptr = c; } return retval; } /* * The name_condition field of the mask is allocated in CreateConditionMask. * It must be freed. * NOTE - exported via .h */ void FreeConditionMask(WindowConditionMask *mask) { struct name_condition *pp,*pp2; struct namelist *p,*p2; for (pp=mask->name_condition; pp; ) { /* One malloc() is done for all the name strings. The string is tokenised & the name fields point to different parts of the one string. The start of the string is the first name in the string which is actually the last node in the linked list. */ for (p=pp->namelist; p; ) { p2=p->next; if(!p2) { free(p->name); } free(p); p=p2; } pp2=pp->next; free(pp); pp=pp2; } } /* Assign the default values for the window mask * NOTE - exported via .h */ void DefaultConditionMask(WindowConditionMask *mask) { memset(mask, 0, sizeof(WindowConditionMask)); /* -2 means no layer condition, -1 means current */ mask->layer = -2; return; } /* * Note that this function allocates the name field of the mask struct. * FreeConditionMask must be called for the mask when the mask is discarded. * NOTE - exported via .h */ void CreateConditionMask(char *flags, WindowConditionMask *mask) { char *allocated_condition; char *next_condition; char *condition; char *tmp; unsigned int state; if (flags == NULL) { return; } /* Next parse the flags in the string. */ next_condition = GetNextFullOption(flags, &allocated_condition); condition = PeekToken(allocated_condition, &tmp); while (condition) { char *cond; int on; cond = condition; on = 1; if (*cond == '!') { on = 0; cond++; } if (StrEquals(cond,"AcceptsFocus")) { mask->my_flags.do_accept_focus = on; mask->my_flags.use_do_accept_focus = 1; } else if (StrEquals(cond,"Focused")) { mask->my_flags.needs_focus = (on) ? NEEDS_TRUE : NEEDS_FALSE; } else if (StrEquals(cond,"HasPointer")) { mask->my_flags.needs_pointer = (on) ? NEEDS_TRUE : NEEDS_FALSE; } else if (StrEquals(cond,"Iconic")) { SET_ICONIFIED(mask, on); SETM_ICONIFIED(mask, 1); } else if (StrEquals(cond,"Visible")) { SET_PARTIALLY_VISIBLE(mask, on); SETM_PARTIALLY_VISIBLE(mask, 1); } else if (StrEquals(cond,"Overlapped")) { mask->my_flags.needs_overlapped = on; mask->my_flags.do_check_overlapped = 1; } else if (StrEquals(cond,"PlacedByButton")) { int button; int button_mask; if (sscanf(tmp, "%d", &button) && (button >= 1 && button <= NUMBER_OF_EXTENDED_MOUSE_BUTTONS)) { tmp = SkipNTokens(tmp, 1); button_mask = (1<<(button-1)); } else { button_mask = (1<placed_by_button_mask & mask->placed_by_button_set_mask & ~button_mask) { fvwm_msg(WARN, "PlacedByButton", "Condition always False."); } mask->placed_by_button_mask |= button_mask; } else { mask->placed_by_button_mask &= ~button_mask; } mask->placed_by_button_set_mask |= button_mask; } else if (StrEquals(cond,"PlacedByButton3")) { if (on) { if (mask->placed_by_button_mask & mask->placed_by_button_set_mask & ~(1<<2)) { fvwm_msg(WARN, "PlacedByButton3", "Condition always False."); } mask->placed_by_button_mask |= (1<<2); } else { mask->placed_by_button_mask &= ~(1<<2); } mask->placed_by_button_set_mask |= (1<<2); } else if (StrEquals(cond,"Raised")) { SET_FULLY_VISIBLE(mask, on); SETM_FULLY_VISIBLE(mask, 1); } else if (StrEquals(cond,"Sticky")) { SET_STICKY_ACROSS_PAGES(mask, on); SET_STICKY_ACROSS_DESKS(mask, on); SETM_STICKY_ACROSS_PAGES(mask, 1); SETM_STICKY_ACROSS_DESKS(mask, 1); } else if (StrEquals(cond,"StickyAcrossPages")) { SET_STICKY_ACROSS_PAGES(mask, on); SETM_STICKY_ACROSS_PAGES(mask, 1); } else if (StrEquals(cond,"StickyAcrossDesks")) { SET_STICKY_ACROSS_DESKS(mask, on); SETM_STICKY_ACROSS_DESKS(mask, 1); } else if (StrEquals(cond,"StickyIcon")) { SET_ICON_STICKY_ACROSS_PAGES(mask, on); SET_ICON_STICKY_ACROSS_DESKS(mask, on); SETM_ICON_STICKY_ACROSS_PAGES(mask, 1); SETM_ICON_STICKY_ACROSS_DESKS(mask, 1); } else if (StrEquals(cond,"StickyAcrossPagesIcon")) { SET_ICON_STICKY_ACROSS_PAGES(mask, on); SETM_ICON_STICKY_ACROSS_PAGES(mask, 1); } else if (StrEquals(cond,"StickyAcrossDesksIcon")) { SET_ICON_STICKY_ACROSS_DESKS(mask, on); SETM_ICON_STICKY_ACROSS_DESKS(mask, 1); } else if (StrEquals(cond,"Maximized")) { SET_MAXIMIZED(mask, on); SETM_MAXIMIZED(mask, 1); } else if (StrEquals(cond,"FixedSize")) { /* don't set mask here, because we make the test here (and don't compare against window's mask) by checking allowed function */ SET_SIZE_FIXED(mask, on); SETM_SIZE_FIXED(mask, 1); } else if (StrEquals(cond, "FixedPosition")) { SET_FIXED(mask, on); SETM_FIXED(mask, 1); } else if (StrEquals(cond,"HasHandles")) { SET_HAS_HANDLES(mask, on); SETM_HAS_HANDLES(mask, 1); } else if (StrEquals(cond,"Iconifiable")) { SET_IS_UNICONIFIABLE(mask, !on); SETM_IS_UNICONIFIABLE(mask, 1); } else if (StrEquals(cond,"Maximizable")) { SET_IS_UNMAXIMIZABLE(mask, !on); SETM_IS_UNMAXIMIZABLE(mask, 1); } else if (StrEquals(cond,"Closable")) { SET_IS_UNCLOSABLE(mask, !on); SETM_IS_UNCLOSABLE(mask, 1); } else if (StrEquals(cond,"Shaded")) { SET_SHADED(mask, on); SETM_SHADED(mask, 1); } else if (StrEquals(cond,"Transient")) { SET_TRANSIENT(mask, on); SETM_TRANSIENT(mask, 1); } else if (StrEquals(cond,"PlacedByFvwm")) { SET_PLACED_BY_FVWM(mask, on); SETM_PLACED_BY_FVWM(mask, 1); } else if (StrEquals(cond,"CurrentDesk")) { mask->my_flags.needs_current_desk = on; mask->my_flags.do_check_desk = 1; } else if (StrEquals(cond,"CurrentPage")) { mask->my_flags.needs_current_desk_and_page = on; mask->my_flags.do_check_desk_and_page = 1; } else if (StrEquals(cond,"CurrentGlobalPage")) { mask->my_flags.needs_current_desk_and_global_page = on; mask->my_flags.do_check_desk_and_global_page = 1; } else if (StrEquals(cond,"CurrentPageAnyDesk") || StrEquals(cond,"CurrentScreen")) { mask->my_flags.needs_current_page = on; mask->my_flags.do_check_page = 1; } else if (StrEquals(cond,"AnyScreen")) { mask->my_flags.do_not_check_screen = on; } else if (StrEquals(cond,"CurrentGlobalPageAnyDesk")) { mask->my_flags.needs_current_global_page = on; mask->my_flags.do_check_global_page = 1; } else if (StrEquals(cond,"CirculateHit")) { mask->my_flags.use_circulate_hit = on; } else if (StrEquals(cond,"CirculateHitIcon")) { mask->my_flags.use_circulate_hit_icon = on; } else if (StrEquals(cond,"CirculateHitShaded")) { mask->my_flags.use_circulate_hit_shaded = on; } else if (StrEquals(cond,"State")) { if (sscanf(tmp, "%u", &state) && state >= 0 && state <= 31) { state = (1 << state); if (on) { SET_USER_STATES(mask, state); } else { CLEAR_USER_STATES(mask, state); } SETM_USER_STATES(mask, state); tmp = SkipNTokens(tmp, 1); } } else if (StrEquals(cond, "Layer")) { if (sscanf(tmp, "%d", &mask->layer)) { tmp = SkipNTokens(tmp, 1); if (mask->layer < 0) { /* silently ignore invalid layers */ mask->layer = -2; } } else { /* needs current layer */ mask->layer = -1; } mask->my_flags.needs_same_layer = on; } else { struct name_condition *pp; struct namelist *p; char *condp = safestrdup(cond); pp = (struct name_condition *) safemalloc(sizeof(struct name_condition)); pp->invert = (!on ? True : False); pp->namelist = NULL; pp->next = mask->name_condition; mask->name_condition = pp; for (;;) { p = (struct namelist *) safemalloc(sizeof(struct namelist)); p->name=condp; p->next=pp->namelist; pp->namelist=p; while(*condp && *condp != '|') { condp++; } if(!*condp) { break; } *condp++='\0'; } } if (tmp && *tmp) { fvwm_msg(OLD, "CreateConditionMask", "Use comma instead of whitespace to " "separate conditions"); } else { if (allocated_condition != NULL) { free(allocated_condition); allocated_condition = NULL; } if (next_condition && *next_condition) { next_condition = GetNextFullOption( next_condition, &allocated_condition); } tmp = allocated_condition; } condition = PeekToken(tmp, &tmp); } return; } /* * Checks whether the given window matches the mask created with * CreateConditionMask. * NOTE - exported via .h */ Bool MatchesConditionMask(FvwmWindow *fw, WindowConditionMask *mask) { int does_match; int is_on_desk; int is_on_page; int is_on_global_page; FvwmWindow *sf = get_focus_window(); struct name_condition *pp; struct namelist *p; char *name; /* match FixedSize conditional */ /* special treatment for FixedSize, because more than just the is_size_fixed flag makes a window unresizable (width and height hints etc.) */ if (IS_SIZE_FIXED(mask) && mask->flag_mask.common.s.is_size_fixed && is_function_allowed(F_RESIZE, NULL, fw, RQORIG_PROGRAM_US, False)) { return False; } if (!IS_SIZE_FIXED(mask) && mask->flag_mask.common.s.is_size_fixed && !is_function_allowed(F_RESIZE, NULL, fw, RQORIG_PROGRAM_US, False)) { return False; } if (IS_FIXED(mask) && mask->flag_mask.common.s.is_fixed && is_function_allowed(F_MOVE, NULL, fw, RQORIG_PROGRAM_US, False)) { return False; } if (!IS_FIXED(mask) && mask->flag_mask.common.s.is_fixed && !is_function_allowed(F_MOVE, NULL, fw, RQORIG_PROGRAM_US, False)) { return False; } if (IS_UNICONIFIABLE(mask) && mask->flag_mask.common.s.is_uniconifiable && is_function_allowed(F_ICONIFY, NULL, fw, RQORIG_PROGRAM_US, False)) { return False; } if ( !IS_UNICONIFIABLE(mask) && mask->flag_mask.common.s.is_uniconifiable && !is_function_allowed( F_ICONIFY, NULL, fw, RQORIG_PROGRAM_US, False)) { return False; } if ( IS_UNMAXIMIZABLE(mask) && mask->flag_mask.common.s.is_unmaximizable && is_function_allowed( F_MAXIMIZE, NULL, fw, RQORIG_PROGRAM_US, False)) { return False; } if ( !IS_UNMAXIMIZABLE(mask) && mask->flag_mask.common.s.is_unmaximizable && !is_function_allowed( F_MAXIMIZE, NULL, fw, RQORIG_PROGRAM_US, False)) { return False; } if ( IS_UNCLOSABLE(mask) && mask->flag_mask.common.s.is_unclosable && (is_function_allowed( F_CLOSE, NULL, fw, RQORIG_PROGRAM_US,False) || is_function_allowed( F_DELETE, NULL, fw, RQORIG_PROGRAM_US,False) || is_function_allowed( F_DESTROY, NULL, fw, RQORIG_PROGRAM_US, False))) { return False; } if ( !IS_UNCLOSABLE(mask) && mask->flag_mask.common.s.is_unclosable && (!is_function_allowed( F_CLOSE, NULL, fw, RQORIG_PROGRAM_US,False) && !is_function_allowed( F_DELETE, NULL, fw, RQORIG_PROGRAM_US,False) && !is_function_allowed( F_DESTROY, NULL, fw, RQORIG_PROGRAM_US,False))) { return False; } if (!blockcmpmask((char *)&(fw->flags), (char *)&(mask->flags), (char *)&(mask->flag_mask), sizeof(fw->flags))) { return False; } if (!mask->my_flags.use_circulate_hit && DO_SKIP_CIRCULATE(fw)) { return False; } if (!mask->my_flags.use_circulate_hit_icon && IS_ICONIFIED(fw) && DO_SKIP_ICON_CIRCULATE(fw)) { return False; } if (!mask->my_flags.use_circulate_hit_shaded && IS_SHADED(fw) && DO_SKIP_SHADED_CIRCULATE(fw)) { return False; } if (IS_ICONIFIED(fw) && IS_TRANSIENT(fw) && IS_ICONIFIED_BY_PARENT(fw)) { return False; } /* desk and page matching */ is_on_desk = 1; if (mask->my_flags.do_check_desk || mask->my_flags.do_check_desk_and_page || mask->my_flags.do_check_desk_and_global_page) { is_on_desk = (fw->Desk == Scr.CurrentDesk); } is_on_page = 1; if (mask->my_flags.do_check_page || mask->my_flags.do_check_desk_and_page) { if (FScreenIsEnabled() && !mask->my_flags.do_not_check_screen) { is_on_page = !!FScreenIsRectangleOnScreen( NULL, FSCREEN_CURRENT, &(fw->g.frame)); } else { is_on_page = !!IsRectangleOnThisPage( &(fw->g.frame), Scr.CurrentDesk); } } is_on_global_page = 1; if (mask->my_flags.do_check_global_page || mask->my_flags.do_check_desk_and_global_page) { is_on_global_page = !!IsRectangleOnThisPage( &(fw->g.frame), Scr.CurrentDesk); } if (mask->my_flags.do_check_desk_and_page) { int is_on_desk_and_page; is_on_desk_and_page = (is_on_desk && is_on_page); if (mask->my_flags.needs_current_desk_and_page != is_on_desk_and_page) { return False; } } else if (mask->my_flags.do_check_desk_and_global_page) { int is_on_desk_and_global_page; is_on_desk_and_global_page = (is_on_desk && is_on_global_page); if (mask->my_flags.needs_current_desk_and_global_page != is_on_desk_and_global_page) { return False; } } if (mask->my_flags.do_check_desk && mask->my_flags.needs_current_desk != is_on_desk) { return False; } if (mask->my_flags.do_check_page) { if (mask->my_flags.needs_current_page != is_on_page) { return False; } } else if (mask->my_flags.do_check_global_page) { if (mask->my_flags.needs_current_global_page != is_on_global_page) { return False; } } for (pp = mask->name_condition; pp; pp = pp->next) { does_match = 0; for (p = pp->namelist; p; p = p->next) { name=p->name; does_match |= matchWildcards(name, fw->name.name); does_match |= matchWildcards(name, fw->icon_name.name); if(fw->class.res_class) does_match |= matchWildcards(name, fw->class.res_class); if(fw->class.res_name) does_match |= matchWildcards(name, fw->class.res_name); } if(( pp->invert && does_match) || (!pp->invert && !does_match)) { return False; } } if (mask->layer == -1 && sf) { int is_same_layer; is_same_layer = (fw->layer == sf->layer); if (mask->my_flags.needs_same_layer != is_same_layer) { return False; } } if (mask->layer >= 0) { int is_same_layer; is_same_layer = (fw->layer == mask->layer); if (mask->my_flags.needs_same_layer != is_same_layer) { return False; } } if (mask->placed_by_button_set_mask) { if (!((mask->placed_by_button_set_mask & (1<<(fw->placed_by_button - 1))) == (mask->placed_by_button_set_mask & mask->placed_by_button_mask))) { return False; } } if (GET_USER_STATES(mask) != (mask->flag_mask.common.user_states & GET_USER_STATES(fw))) { return False; } if (mask->my_flags.use_do_accept_focus) { Bool f; f = focus_does_accept_input_focus(fw); if (fw && !FP_DO_FOCUS_BY_FUNCTION(FW_FOCUS_POLICY(fw))) { f = False; } else if (fw && FP_IS_LENIENT(FW_FOCUS_POLICY(fw))) { f = True; } if (!f != !mask->my_flags.do_accept_focus) { return False; } } if (mask->my_flags.needs_focus != NEEDS_ANY) { int is_focused; is_focused = (fw == get_focus_window()); if (!is_focused && mask->my_flags.needs_focus == NEEDS_TRUE) { return False; } else if (is_focused && mask->my_flags.needs_focus == NEEDS_FALSE) { return False; } } if (mask->my_flags.needs_pointer != NEEDS_ANY) { int has_pointer; FvwmWindow *t; t = get_pointer_fvwm_window(); if (t != NULL && t == fw) { has_pointer = 1; } else { has_pointer = 0; } if (!has_pointer && mask->my_flags.needs_pointer == NEEDS_TRUE) { return False; } else if (has_pointer && mask->my_flags.needs_pointer == NEEDS_FALSE) { return False; } } if (mask->my_flags.do_check_overlapped) { int is_o; is_o = (is_on_top_of_layer(fw) == False); if (is_o != mask->my_flags.needs_overlapped) { return False; } } return True; } static void direction_cmd(F_CMD_ARGS, Bool is_scan) { rectangle my_g; rectangle his_g; int my_cx; int my_cy; int his_cx; int his_cy; int cross = 0; int offset = 0; int distance = 0; int cycle = False; int forward = False; int score; int best_cross = 0; int best_score; int worst_score = -1; FvwmWindow *tfw; FvwmWindow *fw_best; int dir; int dir2; Bool right_handed=False; char *flags; char *restofline; char *tmp; float tx; float ty; WindowConditionMask mask; Bool is_pointer_relative; FvwmWindow * const fw = exc->w.fw; /* Parse the direction. */ tmp = PeekToken(action, &action); if (StrEquals(tmp, "FromPointer")) { is_pointer_relative = True; tmp = PeekToken(action, &action); } else { is_pointer_relative = False; } dir = gravity_parse_dir_argument(tmp, NULL, -1); if (dir == -1 || dir > DIR_ALL_MASK) { fvwm_msg(ERR, "Direction", "Invalid direction %s", (tmp) ? tmp : ""); if (cond_rc != NULL) { cond_rc->rc = COND_RC_ERROR; } return; } if (is_scan) { cycle = True; tmp = PeekToken(action, &action); if ( ! tmp ) { fvwm_msg( ERR, "Direction", "Missing minor direction %s", (tmp) ? tmp : ""); if (cond_rc != NULL) { cond_rc->rc = COND_RC_ERROR; } return; } dir2 = gravity_parse_dir_argument(tmp, NULL, -1); /* if enum direction_t changes, this is trashed. */ if (dir2 == -1 || dir2 > DIR_NW || (dir < 4) != (dir2 < 4) || (abs(dir - dir2) & 1) != 1) { fvwm_msg( ERR, "Direction", "Invalid minor direction %s", (tmp) ? tmp : ""); if (cond_rc != NULL) { cond_rc->rc = COND_RC_ERROR; } return; } else if (dir2 - dir == 1 || dir2 - dir == -3) { right_handed=True; } } /* Create the mask for flags */ flags = CreateFlagString(action, &restofline); if (!restofline) { if (flags) { free(flags); } if (cond_rc != NULL) { cond_rc->rc = COND_RC_NO_MATCH; } return; } DefaultConditionMask(&mask); CreateConditionMask(flags, &mask); if (flags) { free(flags); } /* If there is a focused window, use that as a starting point. * Otherwise we use the pointer as a starting point. */ if (fw && is_pointer_relative == False) { get_visible_window_or_icon_geometry(fw, &my_g); my_cx = my_g.x + my_g.width / 2; my_cy = my_g.y + my_g.height / 2; } else { if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &my_g.x, &my_g.y, &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen */ my_g.x = 0; my_g.y = 0; } my_g.width = 1; my_g.height = 1; my_cx = my_g.x; my_cy = my_g.y; } /* Next we iterate through all windows and choose the closest one in * the wanted direction. */ fw_best = NULL; best_score = -1; for (tfw = Scr.FvwmRoot.next; tfw != NULL; tfw = tfw->next) { /* Skip every window that does not match conditionals. Also * skip the currently focused window. That would be too * close. :) */ if (tfw == fw || !MatchesConditionMask(tfw, &mask)) { continue; } /* Calculate relative location of the window. */ get_visible_window_or_icon_geometry(tfw, &his_g); his_g.x -= my_cx; his_g.y -= my_cy; his_cx = his_g.x + his_g.width / 2; his_cy = his_g.y + his_g.height / 2; if (dir > DIR_MAJOR_MASK && dir <= DIR_MINOR_MASK) { int tx; /* Rotate the diagonals 45 degrees counterclockwise. To * do this, multiply the matrix /+h +h\ with the vector * (x y). \-h +h/ * h = sqrt(0.5). We can set h := 1 since absolute * distance doesn't * matter here. */ tx = his_cx + his_cy; his_cy = -his_cx + his_cy; his_cx = tx; } /* Arrange so that distance and offset are positive in desired * direction. */ switch (dir) { case DIR_S: case DIR_SW: forward = True; case DIR_N: case DIR_NE: cross = -his_cx; offset = (his_cx < 0) ? -his_cx : his_cx; distance = (dir == DIR_N || dir == DIR_NE) ? -his_cy : his_cy; break; case DIR_E: /* E */ case DIR_SE: /* SE */ forward = True; case DIR_W: /* W */ case DIR_NW: /* NW */ cross = his_cy; offset = (his_cy < 0) ? -his_cy : his_cy; distance = (dir == DIR_W || dir == DIR_NW) ? -his_cx : his_cx; break; case DIR_C: offset = 0; tx = (float)his_cx; ty = (float)his_cy; distance = (int)sqrt(tx * tx + ty * ty); break; } if (cycle) { offset=0; } else if (distance < 0) { /* Target must be in given direction. */ continue; } else if (distance == 0 && dir != DIR_C) { continue; } /* Calculate score for this window. The smaller the better. */ score = distance + offset; if (!right_handed) { cross= -cross; } if (cycle) { int ordered = (forward == (cross < best_cross)); if (distance < 0 && best_score == -1 && (score < worst_score || (score == worst_score && ordered))) { fw_best = tfw; worst_score = score; best_cross = cross; } if (score == 0 && forward == (cross < 0) && dir != DIR_C) { continue; } if (distance >= 0 && (best_score == -1 || score < best_score || (score == best_score && ordered))) { fw_best = tfw; best_score = score; best_cross = cross; } } else { /* windows more than 45 degrees off the direction are * heavily penalized and will only be chosen if nothing * else within a million pixels */ if (offset > distance) { score += 1000000; } if (best_score == -1 || score < best_score || (score == best_score && dir == DIR_C)) { fw_best = tfw; best_score = score; } } } /* for */ if (fw_best) { if (cond_rc != NULL) { cond_rc->rc = COND_RC_OK; } execute_function_override_window( cond_rc, exc, restofline, 0, fw_best); } else if (cond_rc != NULL) { cond_rc->rc = COND_RC_NO_MATCH; } FreeConditionMask(&mask); return; } static int __rc_matches_rcstring_consume( char **ret_rest, cond_rc_t *cond_rc, char *action) { cond_rc_enum match_rc; char *orig_flags; char *flags; int is_not_reversed = 1; int ret; /* Create window mask */ orig_flags = CreateFlagString(action, ret_rest); flags = orig_flags; if (flags == NULL) { match_rc = COND_RC_NO_MATCH; } else { if (*flags == '!') { is_not_reversed = 0; flags++; } if (StrEquals(flags, "1") || StrEquals(flags, "match")) { match_rc = COND_RC_OK; } else if (StrEquals(flags, "0") || StrEquals(flags, "nomatch")) { match_rc = COND_RC_NO_MATCH; } else if (StrEquals(flags, "-1") || StrEquals(flags, "error")) { match_rc = COND_RC_ERROR; } else if (StrEquals(flags, "-2") || StrEquals(flags, "break")) { match_rc = COND_RC_BREAK; } else { match_rc = COND_RC_NO_MATCH; /* Does anyone check for other numerical returncode * values? If so, this might have to be changed. */ fprintf( stderr, "Unrecognised condition \"%s\" in" " TestRc command.\n", flags); } } if (orig_flags != NULL) { free(orig_flags); } ret = ((cond_rc->rc == match_rc) == is_not_reversed); return ret; } /* ---------------------------- builtin commands --------------------------- */ void CMD_Prev(F_CMD_ARGS) { circulate_cmd(F_PASS_ARGS, C_WINDOW, -1, True, True); return; } void CMD_Next(F_CMD_ARGS) { circulate_cmd(F_PASS_ARGS, C_WINDOW, 1, True, True); return; } void CMD_None(F_CMD_ARGS) { circulate_cmd(F_PASS_ARGS, C_ROOT, 1, False, False); /* invert return code */ switch (cond_rc->rc) { case COND_RC_OK: cond_rc->rc = COND_RC_NO_MATCH; break; case COND_RC_NO_MATCH: cond_rc->rc = COND_RC_OK; break; default: break; } return; } void CMD_Any(F_CMD_ARGS) { circulate_cmd(F_PASS_ARGS, exc->w.wcontext, 1, False, True); return; } void CMD_Current(F_CMD_ARGS) { circulate_cmd(F_PASS_ARGS, C_WINDOW, 0, True, True); return; } void CMD_PointerWindow(F_CMD_ARGS) { exec_context_changes_t ecc; ecc.w.fw = get_pointer_fvwm_window(); exc = exc_clone_context(exc, &ecc, ECC_FW); select_cmd(F_PASS_ARGS); exc_destroy_context(exc); return; } void CMD_ThisWindow(F_CMD_ARGS) { select_cmd(F_PASS_ARGS); return; } void CMD_Pick(F_CMD_ARGS) { select_cmd(F_PASS_ARGS); return; } void CMD_All(F_CMD_ARGS) { FvwmWindow *t, **g; char *restofline; WindowConditionMask mask; char *flags; int num, i; Bool does_any_window_match = False; char *token; Bool do_reverse = False; Bool use_stack = False; while (True) /* break when a non-option is found */ { token = PeekToken(action, &restofline); if (StrEquals(token, "Reverse")) { if (!*restofline) { /* if not any more actions, then Reverse * probably is some user function, so ignore * it and do the old behaviour */ break; } else { do_reverse = True; action = restofline; } } else if (StrEquals(token, "UseStack")) { if (!*restofline) { /* if not any more actions, then UseStack * probably is some user function, so ignore * it and do the old behaviour */ break; } else { use_stack = True; action = restofline; } } else { /* No more options -- continue with flags and * commands */ break; } } flags = CreateFlagString(action, &restofline); DefaultConditionMask(&mask); mask.my_flags.use_circulate_hit = 1; mask.my_flags.use_circulate_hit_icon = 1; mask.my_flags.use_circulate_hit_shaded = 1; CreateConditionMask(flags, &mask); if (flags) { free(flags); } num = 0; for (t = Scr.FvwmRoot.next; t; t = t->next) { num++; } g = (FvwmWindow **)safemalloc(num * sizeof(FvwmWindow *)); num = 0; if (!use_stack) { for (t = Scr.FvwmRoot.next; t; t = t->next) { if (MatchesConditionMask(t, &mask)) { g[num++] = t; does_any_window_match = True; } } } else { for (t = Scr.FvwmRoot.stack_next; t && t != &Scr.FvwmRoot; t = t->stack_next) { if (MatchesConditionMask(t, &mask)) { g[num++] = t; does_any_window_match = True; } } } if (do_reverse) { for (i = num-1; i >= 0; i--) { execute_function_override_window( cond_rc, exc, restofline, 0, g[i]); } } else { for (i = 0; i < num; i++) { execute_function_override_window( cond_rc, exc, restofline, 0, g[i]); } } if (cond_rc != NULL && cond_rc->rc != COND_RC_BREAK) { cond_rc->rc = (does_any_window_match == False) ? COND_RC_NO_MATCH : COND_RC_OK; } free(g); FreeConditionMask(&mask); return; } /* * Execute a function to the closest window in the given * direction. */ void CMD_Direction(F_CMD_ARGS) { direction_cmd(F_PASS_ARGS,False); } void CMD_ScanForWindow(F_CMD_ARGS) { direction_cmd(F_PASS_ARGS,True); } void CMD_WindowId(F_CMD_ARGS) { FvwmWindow *t; char *token; char *naction; unsigned long win; Bool use_condition = False; Bool use_screenroot = False; WindowConditionMask mask; char *flags, *restofline; /* Get window ID */ action = GetNextToken(action, &token); if (token && StrEquals(token, "root")) { int screen = Scr.screen; free(token); token = PeekToken(action, &naction); if (!token || GetIntegerArguments(token, NULL, &screen, 1) != 1) { screen = Scr.screen; } else { action = naction; } use_screenroot = True; if (screen < 0 || screen >= Scr.NumberOfScreens) { screen = 0; } win = XRootWindow(dpy, screen); if (win == None) { if (cond_rc != NULL) { cond_rc->rc = COND_RC_ERROR; } return; } } else if (token) { /* SunOS doesn't have strtoul */ win = (unsigned long)strtol(token, NULL, 0); free(token); } else { win = 0; } /* Look for condition - CreateFlagString returns NULL if no '(' or '[' */ if (!use_screenroot) { flags = CreateFlagString(action, &restofline); if (flags) { /* Create window mask */ use_condition = True; DefaultConditionMask(&mask); /* override for Current [] */ mask.my_flags.use_circulate_hit = 1; mask.my_flags.use_circulate_hit_icon = 1; mask.my_flags.use_circulate_hit_icon = 1; CreateConditionMask(flags, &mask); free(flags); /* Relocate action */ action = restofline; } } /* Search windows */ for (t = Scr.FvwmRoot.next; t; t = t->next) { if (FW_W(t) == win) { /* do it if no conditions or the conditions match */ if (action && (!use_condition || MatchesConditionMask(t, &mask))) { if (cond_rc != NULL) { cond_rc->rc = COND_RC_OK; } execute_function_override_window( cond_rc, exc, action, 0, t); } else if (cond_rc != NULL) { cond_rc->rc = COND_RC_NO_MATCH; } break; } } if (!t) { /* The window is not managed by fvwm. Still some functions may * work on it. */ if (use_condition) { if (cond_rc != NULL) { cond_rc->rc = COND_RC_ERROR; } } else if (XGetGeometry( dpy, win, &JunkRoot, &JunkX, &JunkY, (unsigned int*)&JunkWidth, (unsigned int*)&JunkHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth) != 0) { if (cond_rc != NULL) { cond_rc->rc = COND_RC_OK; } if (action != NULL) { const exec_context_t *exc2; exec_context_changes_t ecc; ecc.w.fw = NULL; ecc.w.w = win; ecc.w.wcontext = C_UNMANAGED; exc2 = exc_clone_context( exc, &ecc, ECC_FW | ECC_W | ECC_WCONTEXT); execute_function( cond_rc, exc2, action, FUNC_IS_UNMANAGED); exc_destroy_context(exc2); } } else { /* window id does not exist */ if (cond_rc != NULL) { cond_rc->rc = COND_RC_ERROR; } } } /* Tidy up */ if (use_condition) { FreeConditionMask(&mask); } return; } void CMD_TestRc(F_CMD_ARGS) { char *rest; if (cond_rc == NULL) { /* useless if no return code to compare to is given */ return; } if (__rc_matches_rcstring_consume(&rest, cond_rc, action) && rest != NULL) { /* execute the command in root window context; overwrite the * return code with the return code of the command */ execute_function(cond_rc, exc, rest, 0); } return; } void CMD_Break(F_CMD_ARGS) { int rc; if (cond_rc == NULL) { return; } rc = GetIntegerArguments(action, &action, &cond_rc->break_levels, 1); if (rc != 1 || cond_rc->break_levels <= 0) { cond_rc->break_levels = -1; } cond_rc->rc = COND_RC_BREAK; return; } void CMD_NoWindow(F_CMD_ARGS) { execute_function_override_window(cond_rc, exc, action, 0, NULL); return; } /* ver() - convert a version string to a floating-point number that * can be used to compare different versions. * ie. converts "2.5.11" to 2005011 */ static int ver (char *str) { char *n; int v; str = DoPeekToken(str, &n, NULL, ".", NULL); if (!n) { return -1.0; } v = atoi(n) * 1000000; str = DoPeekToken(str, &n, NULL, ".", NULL); if (!n) { return -1.0; } v += atoi(n) * 1000; str = DoPeekToken(str, &n, NULL, ".", NULL); if (!n) { return -1.0; } v += atoi(n); return v; } /* match_version() - compare $version against this version of fvwm * using the operator specified by $operator. */ static Bool match_version(char *version, char *operator) { static int fvwm_version = -1; const int v = ver(version); if (fvwm_version < 0) { char *tmp = safestrdup(VERSION); fvwm_version = ver(tmp); free(tmp); } if (v < 0) { fprintf( stderr, "match_version: Invalid version: %s\n", version); return False; } if (strcmp(operator, ">=") == 0) { return fvwm_version >= v; } else if (strcmp(operator, ">") == 0) { return fvwm_version > v; } else if (strcmp(operator, "<=") == 0) { return fvwm_version <= v; } else if (strcmp(operator, "<") == 0) { return fvwm_version < v; } else if (strcmp(operator, "==") == 0) { return (v == fvwm_version); } else if (strcmp(operator, "!=") == 0) { return (v != fvwm_version); } else { fprintf( stderr, "match_version: Invalid operator: %s\n", operator); } return False; } void CMD_Test(F_CMD_ARGS) { char *restofline; char *flags; char *condition; char *flags_ptr; int match; int error; flags = CreateFlagString(action, &restofline); /* Next parse the flags in the string. */ flags_ptr = flags; flags_ptr = GetNextSimpleOption(flags_ptr, &condition); match = 1; error = 0; while (condition) { char *cond; int reverse; cond = condition; reverse = 0; if (*cond == '!') { reverse = 1; cond++; } if (StrEquals(cond, "True")) { match = 1; } else if (StrEquals(cond, "False")) { match = 0; } else if (StrEquals(cond, "Version")) { char *pattern; flags_ptr = GetNextSimpleOption(flags_ptr, &pattern); if (pattern) { char *ver; flags_ptr = GetNextSimpleOption( flags_ptr, &ver); if (ver == NULL) { match = matchWildcards( pattern, VERSION); } else { match = match_version(ver, pattern); free(ver); } free(pattern); } else { error = 1; } } else if (StrEquals(cond, "Start")) { match = exc->type == EXCT_INIT || exc->type == EXCT_RESTART; } else if (StrEquals(cond, "Init")) { match = exc->type == EXCT_INIT; } else if (StrEquals(cond, "Restart")) { match = exc->type == EXCT_RESTART; } else if (StrEquals(cond, "Exit")) { match = exc->type == EXCT_QUIT || exc->type == EXCT_TORESTART; } else if (StrEquals(cond, "Quit")) { match = exc->type == EXCT_QUIT; } else if (StrEquals(cond, "ToRestart")) { match = exc->type == EXCT_TORESTART; } else if (StrEquals(cond, "x") || StrEquals(cond, "r") || StrEquals(cond, "w") || StrEquals(cond, "f") || StrEquals(cond, "i")) { char *pattern; int type = X_OK; Bool im = 0; switch(cond[0]) { case 'X': case 'x': type = X_OK; break; case 'R': case 'r': type = R_OK; break; case 'W': case 'w': type = W_OK; break; case 'f': case 'F': type = F_OK; break; case 'i': case 'I': im = True; type = R_OK; break; default: /* cannot happen */ break; } flags_ptr = GetNextSimpleOption(flags_ptr, &pattern); if (pattern) { match = cond_check_access(pattern, type, im); free(pattern); } else { error = 1; } } else if (StrEquals(cond, "EnvIsSet")) { char *var_name; flags_ptr = GetNextSimpleOption(flags_ptr, &var_name); if (var_name) { const char *value = getenv(var_name); match = (value != NULL) ? 1 : 0; } else { error = 1; } } else if (StrEquals(cond, "EnvMatch")) { char *var_name; flags_ptr = GetNextSimpleOption(flags_ptr, &var_name); if (var_name) { const char *value = getenv(var_name); char *pattern; /* unfortunately, GetNextSimpleOption is * broken, does not accept quoted empty "" */ flags_ptr = GetNextSimpleOption( flags_ptr, &pattern); if (!value) { value = ""; } if (pattern) { match = /* include empty string case */ (!pattern[0] && !value[0]) || matchWildcards(pattern, value); } else { error = 1; } } else { error = 1; } } else if (StrEquals(cond, "EdgeIsActive")) { direction_t dir= DIR_NONE; char *dirname; char *next; next = GetNextSimpleOption(flags_ptr, &dirname); if (dirname) { dir = gravity_parse_dir_argument( dirname, NULL, DIR_NONE); if (dir == DIR_NONE) { if (!StrEquals(dirname, "Any")) { next = flags_ptr; } } else if (dir > DIR_MAJOR_MASK) { error = 1; } free(dirname); } if (!error) { if (((dir == DIR_W || dir == DIR_NONE) && Scr.PanFrameLeft.isMapped) || ((dir == DIR_N || dir == DIR_NONE) && Scr.PanFrameTop.isMapped) || ((dir == DIR_S || dir == DIR_NONE) && Scr.PanFrameBottom.isMapped) || ((dir == DIR_E || dir == DIR_NONE) && Scr.PanFrameRight.isMapped)) { match = 1; } else { match = 0; } } flags_ptr = next; } else if (StrEquals(cond, "EdgeHasPointer")) { int x,y; Window win; direction_t dir = DIR_NONE; char *dirname; char *next; next = GetNextSimpleOption(flags_ptr, &dirname); if (dirname) { dir = gravity_parse_dir_argument( dirname, NULL, DIR_NONE); if (dir == DIR_NONE) { if (!StrEquals(dirname, "Any")) { next = flags_ptr; } } else if (dir > DIR_MAJOR_MASK) { error = 1; } free(dirname); } if (!error) { if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &win, &JunkX, &JunkY, &x, &y, &JunkMask) == False) { /* pointer is on a different screen */ match = 0; } else if (is_pan_frame(win)) { if (dir == DIR_NONE || (dir == DIR_N && win == Scr.PanFrameTop.win) || (dir == DIR_S && win == Scr.PanFrameBottom.win) || (dir == DIR_E && win == Scr.PanFrameRight.win) || (dir == DIR_W && win == Scr.PanFrameLeft.win)) { match = 1; } else { match = 0; } } else { match = 0; } } flags_ptr = next; } else { /* unrecognized condition */ error = 1; fprintf( stderr, "Unrecognised condition \"%s\" in" " Test command.\n", cond); } if (reverse) { match = !match; } free(condition); if (error || !match) { break; } flags_ptr = GetNextSimpleOption(flags_ptr, &condition); } if (flags != NULL) { free(flags); } if (!error && match) { execute_function(cond_rc, exc, restofline, 0); } if (cond_rc != NULL) { if (error) { cond_rc->rc = COND_RC_ERROR; } else if (match) { cond_rc->rc = COND_RC_OK; } else { cond_rc->rc = COND_RC_NO_MATCH; } } return; } fvwm-2.6.5.orig/fvwm/screen.h0000644000175000017500000003370211317160363014237 0ustar vwcvwc/* -*-c-*- */ /* This module is based on Twm, but has been siginificantly modified * by Rob Nation */ /* Copyright 1989 Massachusetts Institute of Technology * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of M.I.T. not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. M.I.T. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T. * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * * fvwm per-screen data include file * */ #ifndef _SCREEN_ #define _SCREEN_ #include "libs/flist.h" #include "libs/Bindings.h" #define SIZE_HINDENT 5 #define SIZE_VINDENT 3 /* colormap focus styes */ #define COLORMAP_FOLLOWS_MOUSE 1 /* default */ #define COLORMAP_FOLLOWS_FOCUS 2 /* title bar multi pixmap parts */ /* those which can be used as UseTitleStyle should be enum first */ typedef enum { TBMP_NONE = -1, TBMP_MAIN, TBMP_LEFT_MAIN, TBMP_RIGHT_MAIN, TBMP_LEFT_BUTTONS, TBMP_RIGHT_BUTTONS, TBMP_UNDER_TEXT, TBMP_LEFT_OF_TEXT, TBMP_RIGHT_OF_TEXT, TBMP_LEFT_END, TBMP_RIGHT_END, TBMP_BUTTONS, TBMP_NUM_PIXMAPS } TbmpParts; /* title bar multi pixmap parts which can be use for UseTitleStyle */ typedef enum { UTS_TBMP_NONE = -1, UTS_TBMP_MAIN, UTS_TBMP_LEFT_MAIN, UTS_TBMP_RIGHT_MAIN, UTS_TBMP_LEFT_BUTTONS, UTS_TBMP_RIGHT_BUTTONS, UTS_TBMP_NUM_PIXMAPS } UtsTbmpParts; typedef struct { int cs; int alpha_percent; } FvwmAcs; typedef struct { Window win; int isMapped; /* command which is executed when the pan frame is entered */ char *command; /* command which is executed when the pan frame is left*/ char *command_leave; } PanFrame; typedef enum { /* button types */ DefaultVectorButton, VectorButton, SimpleButton, GradientButton, PixmapButton, TiledPixmapButton, StretchedPixmapButton, AdjustedPixmapButton, ShrunkPixmapButton, MultiPixmap, MiniIconButton, SolidButton, ColorsetButton } DecorFaceType; typedef enum { JUST_CENTER = 0, JUST_LEFT = 1, JUST_TOP = 1, JUST_RIGHT = 2, JUST_BOTTOM = 2, JUST_MASK = 3 } JustificationType; typedef struct { unsigned face_type : 4; struct { unsigned h_justification : 2; unsigned v_justification : 2; #define DFS_BUTTON_IS_UP 0 #define DFS_BUTTON_IS_FLAT 1 #define DFS_BUTTON_IS_SUNK 2 #define DFS_BUTTON_MASK 3 unsigned int button_relief : 2; /* not used in border styles */ unsigned int use_title_style : 1; unsigned int use_border_style : 1; /* only used in border styles */ unsigned int has_hidden_handles : 1; unsigned int has_no_inset : 1; } flags; } DecorFaceStyle; #define DFS_FACE_TYPE(dfs) ((dfs).face_type) #define DFS_FLAGS(dfs) ((dfs).flags) #define DFS_H_JUSTIFICATION(dfs) ((dfs).flags.h_justification) #define DFS_V_JUSTIFICATION(dfs) ((dfs).flags.v_justification) #define DFS_BUTTON_RELIEF(dfs) ((dfs).flags.button_relief) #define DFS_USE_TITLE_STYLE(dfs) ((dfs).flags.use_title_style) #define DFS_USE_BORDER_STYLE(dfs) ((dfs).flags.use_border_style) #define DFS_HAS_HIDDEN_HANDLES(dfs) ((dfs).flags.has_hidden_handles) #define DFS_HAS_NO_INSET(dfs) ((dfs).flags.has_no_inset) typedef struct DecorFace { DecorFaceStyle style; struct { FvwmPicture *p; struct { FvwmPicture **pixmaps; unsigned short stretch_flags; FvwmAcs *acs; Pixel *pixels; unsigned short solid_flags; } mp; struct { int cs; int alpha_percent; } acs; Pixel back; struct { int npixels; XColor *xcs; int do_dither; Pixel *d_pixels; int d_npixels; char gradient_type; } grad; struct vector_coords { int num; signed char *x; signed char *y; signed char *xoff; signed char *yoff; signed char *c; unsigned use_fgbg : 1; } vector; } u; struct DecorFace *next; struct { unsigned has_changed : 1; } flags; } DecorFace; typedef enum { BS_All = -1, BS_ActiveUp, BS_ActiveDown, BS_InactiveUp, BS_InactiveDown, BS_ToggledActiveUp, BS_ToggledActiveDown, BS_ToggledInactiveUp, BS_ToggledInactiveDown, BS_MaxButtonState, BS_MaxButtonStateMask = BS_MaxButtonState - 1, BS_Active, BS_Inactive, BS_ToggledActive, BS_ToggledInactive, BS_AllNormal, BS_AllToggled, BS_AllActive, BS_AllInactive, BS_AllUp, BS_AllDown, BS_AllActiveUp, BS_AllActiveDown, BS_AllInactiveUp, BS_AllInactiveDown, BS_MaxButtonStateName } ButtonState; #define BS_MASK_DOWN (1 << 0) #define BS_MASK_INACTIVE (1 << 1) #define BS_MASK_TOGGLED (1 << 2) typedef enum { /* The first five are used in title buttons. These can't be * renumbered without extending the mwm_decor_flags member below and * adapting the style structure. */ MWM_DECOR_MENU = 0x1, MWM_DECOR_MINIMIZE = 0x2, MWM_DECOR_MAXIMIZE = 0x4, MWM_DECOR_SHADE = 0x8, MWM_DECOR_STICK = 0x10, /* --- */ MWM_DECOR_BORDER = 0x20, MWM_DECOR_RESIZEH = 0x40, MWM_DECOR_TITLE = 0x80, MWM_DECOR_ALL = 0x100, MWM_DECOR_EVERYTHING = 0xff } mwm_flags; typedef struct { unsigned just : 2; /* was JustificationType : 2 */ int layer; struct { unsigned has_changed : 1; mwm_flags mwm_decor_flags : 9; /* Support {ButtonStyle - Layer 4} construction, so * button can be rendered 'pressed in' when the window is * assigned to a particular layer. */ unsigned has_layer : 1; } flags; DecorFace state[BS_MaxButtonState]; } TitleButton; #define TB_FLAGS(tb) ((tb).flags) #define TB_STATE(tb) ((tb).state) #define TB_JUSTIFICATION(tb) ((tb).just) #define TB_LAYER(tb) ((tb).layer) #define TB_MWM_DECOR_FLAGS(tb) ((tb).flags.mwm_decor_flags) #define TB_HAS_CHANGED(tb) \ (!!((tb).flags.has_changed)) #define TB_HAS_MWM_DECOR_MENU(tb) \ (!!((tb).flags.mwm_decor_flags & MWM_DECOR_MENU)) #define TB_HAS_MWM_DECOR_MINIMIZE(tb) \ (!!((tb).flags.mwm_decor_flags & MWM_DECOR_MINIMIZE)) #define TB_HAS_MWM_DECOR_MAXIMIZE(tb) \ (!!((tb).flags.mwm_decor_flags & MWM_DECOR_MAXIMIZE)) #define TB_HAS_MWM_DECOR_SHADE(tb) \ (!!((tb).flags.mwm_decor_flags & MWM_DECOR_SHADE)) #define TB_HAS_MWM_DECOR_STICK(tb) \ (!!((tb).flags.mwm_decor_flags & MWM_DECOR_STICK)) typedef struct FvwmDecor { #ifdef USEDECOR char *tag; /* general style tag */ #endif int title_height; /* explicitly specified title bar height */ int min_title_height; /* titlebar buttons */ TitleButton buttons[NUMBER_OF_TITLE_BUTTONS]; TitleButton titlebar; struct BorderStyle { DecorFace active, inactive; } BorderStyle; #ifdef USEDECOR struct FvwmDecor *next; /* additional user-defined styles */ #endif struct { unsigned has_changed : 1; unsigned has_title_height_changed : 1; } flags; } FvwmDecor; typedef struct DesktopsInfo { int desk; char *name; struct { int x; int y; int width; int height; } ewmh_working_area; struct { int x; int y; int width; int height; } ewmh_dyn_working_area; struct DesktopsInfo *next; } DesktopsInfo; typedef struct ScreenInfo { unsigned long screen; Screen *pscreen; /* number of screens on display */ int NumberOfScreens; /* my copy of DisplayWidth(dpy, screen) */ int MyDisplayWidth; /* my copy of DisplayHeight(dpy, screen) */ int MyDisplayHeight; /* the head of the fvwm window list */ FvwmWindow FvwmRoot; /* the root window */ Window Root; /* the resize dimensions window */ Window SizeWindow; /* Window which will own focus when no other windows have it */ Window NoFocusWin; flist *FWScheduledForDestroy; PanFrame PanFrameTop; PanFrame PanFrameLeft; PanFrame PanFrameRight; PanFrame PanFrameBottom; /*dark gray pattern for shaded out menu items*/ Pixmap gray_bitmap; /* dark gray pattern for inactive borders */ Pixmap gray_pixmap; /* light gray pattern for inactive borders */ Pixmap light_gray_pixmap; /* light gray pattern for sticky borders */ Pixmap sticky_gray_pixmap; Binding *AllBindings; /* current push level to install root colormap windows */ int root_pushes; /* current push level to install fvwm colormap windows */ int fvwm_pushes; /* saved window to install when pushes drops to zero */ const FvwmWindow *pushed_window; Cursor *FvwmCursors; /* context where we display the busy cursor */ int BusyCursor; /* Icon to use when no other icons are found */ char *DefaultIcon; int TopLayer; int DefaultLayer; int BottomLayer; struct FvwmFunction *functions; /* font structure */ FlocaleFont *DefaultFont; /* GC for transparency masks */ GC TransMaskGC; /* don't change the order */ Pixel StdFore, StdBack, StdHilite, StdShadow; GC StdGC; GC StdReliefGC; GC StdShadowGC; /* A scratch 1x1x1 pixmap */ Pixmap ScratchMonoPixmap; /* GC for drawing into depth 1 drawables */ GC MonoGC; /* A scratch 1x1xalpha_depth pixmap */ Pixmap ScratchAlphaPixmap; /* GC for drawing into depth alpha_depth drawables */ GC AlphaGC; /* GC to draw lines for move and resize */ GC XorGC; GC ScratchGC1; GC ScratchGC2; GC ScratchGC3; GC ScratchGC4; GC TitleGC; GC BordersGC; /* minimum width of size window */ int SizeStringWidth; /* decoration style(s) */ FvwmDecor DefaultDecor; FvwmDecor *cur_decor; /* number of left-side title-bar buttons */ int nr_left_buttons; /* number of right-side title-bar buttons */ int nr_right_buttons; /* the fvwm window that is highlighted except for networking delays, * this is the window which REALLY has the focus */ FvwmWindow *Hilite; /* None, if the focus is nowhere or on an fvwm managed window. Set to * id of otherwindow with focus otherwise */ Window UnknownWinFocused; /* The window that the UnknownWinFocused window stole the focus from. */ Window StolenFocusWin; FvwmWindow *focus_in_pending_window; /* #pixels to scroll on screen edge */ int EdgeScrollX; /* #pixels to scroll on screen edge */ int EdgeScrollY; /* buttons to grab in click to focus mode */ unsigned short buttons2grab; int NumBoxes; /* values used for CascadePlacement */ int cascade_x; int cascade_y; FvwmWindow *cascade_window; /* Max location for top left of virt desk*/ int VxMax; int VyMax; /* Current loc for top left of virt desk */ int Vx; int Vy; /*Max button-click delay for Function built-in*/ int ClickTime; /* resistance to scrolling in desktop */ int ScrollDelay; int MoveThreshold; int OpaqueSize; /* The current desktop number */ int CurrentDesk; /* colormap focus style */ int ColormapFocus; /* Limit on colors used in pixmaps */ int ColorLimit; /* Default Colorset used by feedback window */ int DefaultColorset; int use_backing_store; /* some additional global options which will probably become window * specific options later on: */ struct { unsigned do_debug_cr_motion_method : 1; unsigned do_disable_configure_notify : 1; unsigned do_display_new_window_names : 1; unsigned do_enable_ewmh_iconic_state_workaround : 1; unsigned do_enable_flickering_qt_dialogs_workaround : 1; unsigned do_enable_qt_drag_n_drop_workaround : 1; unsigned do_explain_window_placement : 1; unsigned do_install_root_cmap : 1; unsigned do_raise_over_unmanaged : 1; unsigned is_modality_evil : 1; unsigned is_raise_hack_needed : 1; } bo; /* bug workaround control options */ struct { unsigned do_emulate_mwm : 1; unsigned do_emulate_win : 1; unsigned do_hide_position_window : 1; unsigned do_hide_resize_window : 1; unsigned use_active_down_buttons : 1; unsigned use_inactive_buttons : 1; unsigned use_inactive_down_buttons : 1; } gs; /* global style structure */ struct { unsigned are_functions_silent : 1; unsigned are_windows_captured : 1; unsigned do_edge_wrap_x : 1; unsigned do_edge_wrap_y : 1; unsigned do_need_style_list_update : 1; unsigned do_need_window_update : 1; unsigned do_save_under : 1; unsigned has_default_color_changed : 1; unsigned has_default_font_changed : 1; unsigned has_mouse_binding_changed : 1; unsigned has_nr_buttons_changed : 1; unsigned has_xinerama_state_changed : 1; unsigned is_executing_complex_function : 1; unsigned is_executing_menu_function : 1; unsigned is_map_desk_in_progress : 1; unsigned is_pointer_on_this_screen : 1; unsigned is_single_screen : 1; unsigned is_window_scheduled_for_destroy : 1; unsigned is_wire_frame_displayed : 1; } flags; /* info for some desktops; the first entries should be generic info * correct for any desktop not in the list */ DesktopsInfo *Desktops; /* the window of desktop type if any */ FvwmWindow *EwmhDesktop; struct { last_added_item_t type; void *item; } last_added_item; } ScreenInfo; /* A macro to to simplify he "ewmh desktop code" */ #define IS_EWMH_DESKTOP(win) \ (Scr.EwmhDesktop && win == Scr.EwmhDesktop->wins.client) #define IS_EWMH_DESKTOP_FW(fwin) \ (fwin && Scr.EwmhDesktop && Scr.EwmhDesktop == fwin) /* Macro which gets specific decor or default decor. * This saves an indirection in case you don't want * the UseDecor mechanism. */ #ifdef USEDECOR #define GetDecor(window,part) ((window)->decor->part) #else #define GetDecor(window,part) (Scr.DefaultDecor.part) #endif /* some protos for the decoration structures */ void LoadDefaultButton(DecorFace *bf, int i); void ResetAllButtons(FvwmDecor *decor); void DestroyAllButtons(FvwmDecor *decor); void simplify_style_list(void); /* * Diverts a style definition to an FvwmDecor structure (veliaa@rpi.edu) */ void AddToDecor(F_CMD_ARGS, FvwmDecor *decor); extern ScreenInfo Scr; #endif /* _SCREEN_ */ fvwm-2.6.5.orig/fvwm/focus_policy.h0000644000175000017500000001652310115361326015455 0ustar vwcvwc/* -*-c-*- */ #ifndef FOCUS_POLICY_H #define FOCUS_POLICY_H /* Note: focus_policy.[ch] is meant to manage structures of type focus_policy_t * only. No code dealing with *any* external data types belongs in here! Put * it in focus.[ch] instead. */ /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ #define FPOL_ANY_MODIFIER 0xff /* ---------------------------- access macros ------------------------------ */ #define FP_DO_RAISE_FOCUSED_CLICK(fp) \ ((fp).do_raise_focused_click) #define FP_DO_RAISE_UNFOCUSED_CLICK(fp) \ ((fp).do_raise_unfocused_click) #define FP_DO_FOCUS_CLICK(fp) \ ((fp).do_focus_click) #define FP_DO_RAISE_FOCUSED_CLIENT_CLICK(fp) \ ((fp).do_raise_focused_click.client) #define FPS_RAISE_FOCUSED_CLIENT_CLICK(fp,x) \ ((fp).do_raise_focused_click.client = !!(x)) #define FP_DO_RAISE_UNFOCUSED_CLIENT_CLICK(fp) \ ((fp).do_raise_unfocused_click.client) #define FPS_RAISE_UNFOCUSED_CLIENT_CLICK(fp,x) \ ((fp).do_raise_unfocused_click.client = !!(x)) #define FP_DO_RAISE_FOCUSED_DECOR_CLICK(fp) \ ((fp).do_raise_focused_click.decor) #define FPS_RAISE_FOCUSED_DECOR_CLICK(fp,x) \ ((fp).do_raise_focused_click.decor = !!(x)) #define FP_DO_RAISE_UNFOCUSED_DECOR_CLICK(fp) \ ((fp).do_raise_unfocused_click.decor) #define FPS_RAISE_UNFOCUSED_DECOR_CLICK(fp,x) \ ((fp).do_raise_unfocused_click.decor = !!(x)) #define FP_DO_RAISE_FOCUSED_ICON_CLICK(fp) \ ((fp).do_raise_focused_click.icon) #define FPS_RAISE_FOCUSED_ICON_CLICK(fp,x) \ ((fp).do_raise_focused_click.icon = !!(x)) #define FP_DO_RAISE_UNFOCUSED_ICON_CLICK(fp) \ ((fp).do_raise_unfocused_click.icon) #define FPS_RAISE_UNFOCUSED_ICON_CLICK(fp,x) \ ((fp).do_raise_unfocused_click.icon = !!(x)) #define FP_DO_FOCUS_ENTER(fp) \ ((fp).do_focus_enter) #define FPS_FOCUS_ENTER(fp,x) \ ((fp).do_focus_enter = !!(x)) #define FP_DO_UNFOCUS_LEAVE(fp) \ ((fp).do_unfocus_leave) #define FPS_UNFOCUS_LEAVE(fp,x) \ ((fp).do_unfocus_leave = !!(x)) #define FP_DO_FOCUS_CLICK_CLIENT(fp) \ ((fp).do_focus_click.client) #define FPS_FOCUS_CLICK_CLIENT(fp,x) \ ((fp).do_focus_click.client = !!(x)) #define FP_DO_FOCUS_CLICK_DECOR(fp) \ ((fp).do_focus_click.decor) #define FPS_FOCUS_CLICK_DECOR(fp,x) \ ((fp).do_focus_click.decor = !!(x)) #define FP_DO_FOCUS_CLICK_ICON(fp) \ ((fp).do_focus_click.icon) #define FPS_FOCUS_CLICK_ICON(fp,x) \ ((fp).do_focus_click.icon = !!(x)) #define FP_DO_FOCUS_BY_PROGRAM(fp) \ ((fp).do_focus_by_program) #define FPS_FOCUS_BY_PROGRAM(fp,x) \ ((fp).do_focus_by_program = !!(x)) #define FP_DO_FOCUS_BY_FUNCTION(fp) \ ((fp).do_focus_by_function) #define FPS_FOCUS_BY_FUNCTION(fp,x) \ ((fp).do_focus_by_function = !!(x)) #define FP_DO_WARP_POINTER_ON_FOCUS_FUNC(fp) \ ((fp).do_warp_pointer_on_focus_func) #define FPS_WARP_POINTER_ON_FOCUS_FUNC(fp,x) \ ((fp).do_warp_pointer_on_focus_func = !!(x)) #define FP_IS_LENIENT(fp) \ ((fp).is_lenient) #define FPS_LENIENT(fp,x) \ ((fp).is_lenient = !!(x)) #define FP_USE_MOUSE_BUTTONS(fp) \ ((fp).use_mouse_buttons) #define FPS_MOUSE_BUTTONS(fp,x) \ ((fp).use_mouse_buttons = (x)) #define FP_USE_MODIFIERS(fp) \ ((fp).use_modifiers) #define FPS_MODIFIERS(fp,x) \ ((fp).use_modifiers = (x)) #define FP_DO_PASS_FOCUS_CLICK(fp) \ ((fp).do_pass_focus_click) #define FPS_PASS_FOCUS_CLICK(fp,x) \ ((fp).do_pass_focus_click = !!(x)) #define FP_DO_PASS_RAISE_CLICK(fp) \ ((fp).do_pass_raise_click) #define FPS_PASS_RAISE_CLICK(fp,x) \ ((fp).do_pass_raise_click = !!(x)) #define FP_DO_IGNORE_FOCUS_CLICK_MOTION(fp) \ ((fp).do_ignore_focus_click_motion) #define FPS_IGNORE_FOCUS_CLICK_MOTION(fp,x) \ ((fp).do_ignore_focus_click_motion = !!(x)) #define FP_DO_IGNORE_RAISE_CLICK_MOTION(fp) \ ((fp).do_ignore_raise_click_motion) #define FPS_IGNORE_RAISE_CLICK_MOTION(fp,x) \ ((fp).do_ignore_raise_click_motion = !!(x)) #define FP_DO_ALLOW_FUNC_FOCUS_CLICK(fp) \ ((fp).do_allow_func_focus_click) #define FPS_ALLOW_FUNC_FOCUS_CLICK(fp,x) \ ((fp).do_allow_func_focus_click = !!(x)) #define FP_DO_ALLOW_FUNC_RAISE_CLICK(fp) \ ((fp).do_allow_func_raise_click) #define FPS_ALLOW_FUNC_RAISE_CLICK(fp,x) \ ((fp).do_allow_func_raise_click = !!(x)) #define FP_DO_GRAB_FOCUS(fp) \ ((fp).do_open_grabs_focus) #define FPS_GRAB_FOCUS(fp,x) \ ((fp).do_open_grabs_focus = !!(x)) #define FP_DO_GRAB_FOCUS_TRANSIENT(fp) \ ((fp).do_open_grabs_focus_transient) #define FPS_GRAB_FOCUS_TRANSIENT(fp,x) \ ((fp).do_open_grabs_focus_transient = !!(x)) #define FP_DO_OVERRIDE_GRAB_FOCUS(fp) \ ((fp).do_override_grab_focus) #define FPS_OVERRIDE_GRAB_FOCUS(fp,x) \ ((fp).do_override_grab_focus = !!(x)) #define FP_DO_RELEASE_FOCUS(fp) \ ((fp).do_close_releases_focus) #define FPS_RELEASE_FOCUS(fp,x) \ ((fp).do_close_releases_focus = !!(x)) #define FP_DO_RELEASE_FOCUS_TRANSIENT(fp) \ ((fp).do_close_releases_focus_transient) #define FPS_RELEASE_FOCUS_TRANSIENT(fp,x) \ ((fp).do_close_releases_focus_transient = !!(x)) #define FP_DO_OVERRIDE_RELEASE_FOCUS(fp) \ ((fp).do_override_release_focus) #define FPS_OVERRIDE_RELEASE_FOCUS(fp,x) \ ((fp).do_override_release_focus = !!(x)) #define FP_DO_SORT_WINDOWLIST_BY(fp) \ ((fp).do_sort_windowlist_by) #define FPS_SORT_WINDOWLIST_BY(fp,x) \ ((fp).do_sort_windowlist_by = !!(x)) /* ---------------------------- type definitions --------------------------- */ typedef enum { FPOL_SORT_WL_BY_FOCUS = 0, FPOL_SORT_WL_BY_OPEN = 1 } fpol_sort_windowlist_t; typedef enum { FOCUS_SET_BY_CLICK_CLIENT, FOCUS_SET_BY_CLICK_DECOR, FOCUS_SET_BY_CLICK_ICON, FOCUS_SET_BY_ENTER, FOCUS_SET_BY_PROGRAM, FOCUS_SET_BY_FUNCTION, /* used internally to restore the focus after certain actions */ FOCUS_SET_FORCE } fpol_set_focus_by_t; typedef struct { unsigned client : 1; unsigned decor : 1; unsigned icon : 1; } fpol_context_t; typedef struct { /* raising the window */ fpol_context_t do_raise_focused_click; fpol_context_t do_raise_unfocused_click; /* focus transition */ fpol_context_t do_focus_click; unsigned do_focus_enter : 1; unsigned do_unfocus_leave : 1; unsigned do_focus_by_program : 1; unsigned do_focus_by_function : 1; unsigned do_warp_pointer_on_focus_func : 1; /* application focus model */ unsigned is_lenient : 1; /* click configuration */ unsigned use_mouse_buttons : NUMBER_OF_EXTENDED_MOUSE_BUTTONS; unsigned use_modifiers : 8; /* recycling of focus and raise clicks */ unsigned do_pass_focus_click : 1; unsigned do_pass_raise_click : 1; unsigned do_ignore_focus_click_motion : 1; unsigned do_ignore_raise_click_motion : 1; unsigned do_allow_func_focus_click : 1; unsigned do_allow_func_raise_click : 1; /* keeping track of the focus */ unsigned do_open_grabs_focus : 1; unsigned do_open_grabs_focus_transient : 1; unsigned do_override_grab_focus : 1; unsigned do_close_releases_focus : 1; unsigned do_close_releases_focus_transient : 1; unsigned do_override_release_focus : 1; unsigned do_sort_windowlist_by : 1; } focus_policy_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void fpol_init_default_fp( focus_policy_t *fp); int fpol_query_allow_set_focus( focus_policy_t *fpol, fpol_set_focus_by_t set_by_mode); int fpol_query_allow_user_focus( focus_policy_t *fpol); int fpol_is_policy_changed( focus_policy_t *fpol); #endif /* FOCUS_POLICY_H */ fvwm-2.6.5.orig/fvwm/ewmh_events.c0000644000175000017500000010117311622413321015267 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2001 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include #include #include "libs/fvwmlib.h" #include "libs/FScreen.h" #include "libs/Strings.h" #include "fvwm.h" #include "execcontext.h" #include "functions.h" #include "misc.h" #include "screen.h" #include "virtual.h" #include "commands.h" #include "update.h" #include "style.h" #include "stack.h" #include "events.h" #include "ewmh.h" #include "ewmh_intern.h" #include "decorations.h" #include "geometry.h" #include "borders.h" extern ewmh_atom ewmh_atom_wm_state[]; #define DEBUG_EWMH_INIT_STATE 0 /* * root */ int ewmh_CurrentDesktop(EWMH_CMD_ARGS) { if (ev->xclient.data.l[0] < 0 || ev->xclient.data.l[0] > 0x7fffffff) { fvwm_msg( WARN, "ewmh_CurrentDesktop", "The application window (id %#lx)\n" " \"%s\" tried to switch to an invalid desktop (%ld)\n" " using an EWMH client message.\n" " fvwm is ignoring this request.\n", fw ? FW_W(fw) : 0, fw ? fw->name.name : "(none)", ev->xclient.data.l[0]); fvwm_msg_report_app_and_workers(); return -1; } goto_desk(ev->xclient.data.l[0]); return -1; } int ewmh_DesktopGeometry(EWMH_CMD_ARGS) { char action[256]; long width = ev->xclient.data.l[0]; long height = ev->xclient.data.l[1]; width = width / Scr.MyDisplayWidth; height = height / Scr.MyDisplayHeight; if (width <= 0 || height <= 0) { fvwm_msg( WARN, "ewmh_DesktopGeometry", "The application window (id %#lx)\n" " \"%s\" tried to set an invalid desktop geometry" " (%ldx%ld)\n" " using an EWMH client message.\n" " fvwm is ignoring this request.\n", fw ? FW_W(fw) : 0, fw ? fw->name.name : "(none)", ev->xclient.data.l[0], ev->xclient.data.l[1]); fvwm_msg_report_app_and_workers(); return -1; } sprintf(action, "DesktopSize %ld %ld", width, height); execute_function_override_window(NULL, NULL, action, 0, NULL); return -1; } int ewmh_DesktopViewPort(EWMH_CMD_ARGS) { if ( ev->xclient.data.l[0] < 0 || ev->xclient.data.l[0] > 0x7fffffff || ev->xclient.data.l[1] < 0 || ev->xclient.data.l[1] > 0x7fffffff) { fvwm_msg( WARN, "ewmh_DesktopViewPort", "The application window (id %#lx)\n" " \"%s\" tried to switch to an invalid page" " (%ldx%ld)\n" " using an EWMH client message.\n" " fvwm is ignoring this request.\n", fw ? FW_W(fw) : 0, fw ? fw->name.name : "(none)", ev->xclient.data.l[0], ev->xclient.data.l[1]); fvwm_msg_report_app_and_workers(); return -1; } MoveViewport(ev->xclient.data.l[0], ev->xclient.data.l[1], 1); return -1; } int ewmh_NumberOfDesktops(EWMH_CMD_ARGS) { int d = ev->xclient.data.l[0]; /* not a lot of sinification for fvwm */ if (d > 0 && (d <= ewmhc.MaxDesktops || ewmhc.MaxDesktops == 0)) { ewmhc.NumberOfDesktops = d; EWMH_SetNumberOfDesktops(); } else { fvwm_msg( WARN, "ewmh_NumberOfDesktops", "The application window (id %#lx)\n" " \"%s\" tried to set an invalid number of desktops" " (%ld)\n" " using an EWMH client message.\n" " fvwm is ignoring this request.\n", fw ? FW_W(fw) : 0, fw ? fw->name.name : "(none)", ev->xclient.data.l[0]); fvwm_msg_report_app_and_workers(); } return -1; } /* * window */ int ewmh_ActiveWindow(EWMH_CMD_ARGS) { if (ev == NULL) { return 0; } execute_function_override_window( NULL, NULL, "EWMHActivateWindowFunc", 0, fw); return 0; } int ewmh_CloseWindow(EWMH_CMD_ARGS) { if (ev == NULL) { return 0; } if (!is_function_allowed(F_CLOSE, NULL, fw, RQORIG_PROGRAM_US, False)) { return 0; } execute_function_override_window(NULL, NULL, "Close", 0, fw); return 0; } int ewmh_MoveResizeWindow(EWMH_CMD_ARGS) { XConfigureRequestEvent cre; int do_reconfigure; int win_gravity; int value_mask; if (ev == NULL) { return 0; } win_gravity = ev->xclient.data.l[0] & 0xff; value_mask = (ev->xclient.data.l[0] >> 8) & 0xf; if (fw == NULL) { /* unmanaged window */ do_reconfigure = 1; } else { int func; if ( ((value_mask & CWWidth) == 0 || ev->xclient.data.l[3] == fw->g.normal.width) && ((value_mask & CWHeight) == 0 || ev->xclient.data.l[4] == fw->g.normal.height)) { func = F_MOVE; } else { func = F_RESIZE; } do_reconfigure = !!is_function_allowed( func, NULL, fw, RQORIG_PROGRAM, False); } if (do_reconfigure == 1) { cre.value_mask = value_mask; cre.x = ev->xclient.data.l[1]; cre.y = ev->xclient.data.l[2]; cre.width = ev->xclient.data.l[3]; cre.height = ev->xclient.data.l[4]; cre.window = ev->xclient.window; events_handle_configure_request(cre, fw, True, win_gravity); } return 0; } int ewmh_RestackWindow(EWMH_CMD_ARGS) { XConfigureRequestEvent cre; int do_restack; if (ev == NULL) { return 0; } if (fw == NULL) { /* unmanaged window */ do_restack = 1; } else { do_restack = !!DO_EWMH_USE_STACKING_HINTS(fw); } if (do_restack == 1) { cre.value_mask = CWSibling | CWStackMode; cre.above = ev->xclient.data.l[1]; cre.detail = ev->xclient.data.l[2]; cre.window = ev->xclient.window; events_handle_configure_request(cre, fw, True, ForgetGravity); } return 0; } int ewmh_WMDesktop(EWMH_CMD_ARGS) { if (ev != NULL && style == NULL) { /* client message */ unsigned long d = (unsigned long)ev->xclient.data.l[0]; /* the spec says that if d = 0xFFFFFFFF then we have to Stick * the window however KDE use 0xFFFFFFFE :o) */ if (d == (unsigned long)-2 || d == (unsigned long)-1) { execute_function_override_window( NULL, NULL, "Stick on", 0, fw); } else if (d >= 0) { if (IS_STICKY_ACROSS_PAGES(fw) || IS_STICKY_ACROSS_DESKS(fw)) { execute_function_override_window( NULL, NULL, "Stick off", 0, fw); } if (fw->Desk != d) { do_move_window_to_desk(fw, (int)d); } } else { fvwm_msg( WARN, "ewmh_WMDesktop", "The application window (id %#lx)\n" " \"%s\" tried to move to an invalid desk" " (%ld)\n" " using an EWMH client message.\n" " fvwm is ignoring this request.\n", fw ? FW_W(fw) : 0, fw ? fw->name.name : "(none)", ev->xclient.data.l[0]); fvwm_msg_report_app_and_workers(); } return 0; } if (style != NULL && ev == NULL) { /* start on desk */ CARD32 *val; int size = 0; if (DO_EWMH_IGNORE_STATE_HINTS(style)) { SET_HAS_EWMH_INIT_WM_DESKTOP( fw, EWMH_STATE_UNDEFINED_HINT); return 0; } if (HAS_EWMH_INIT_WM_DESKTOP(fw) != EWMH_STATE_UNDEFINED_HINT) { return 0; } val = ewmh_AtomGetByName( FW_W(fw), "_NET_WM_DESKTOP", EWMH_ATOM_LIST_CLIENT_WIN, &size); if (val == NULL) { SET_HAS_EWMH_INIT_WM_DESKTOP(fw, EWMH_STATE_NO_HINT); return 0; } #if DEBUG_EWMH_INIT_STATE fprintf( stderr, "ewmh WM_DESKTOP hint for window 0x%lx " "(%i,%lu,%u)\n", FW_W(fw), HAS_EWMH_INIT_WM_DESKTOP(fw), fw->ewmh_hint_desktop, val[0]); #endif if (val[0] == (CARD32)-2 || val[0] == (CARD32)-1) { S_SET_IS_STICKY_ACROSS_PAGES(SCF(*style), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCM(*style), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCC(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCF(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCM(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCC(*style), 1); } else if (val[0] < 256) { /* prevent crazy hints ?? */ style->flags.use_start_on_desk = 1; style->flag_mask.use_start_on_desk = 1; style->change_mask.use_start_on_desk = 1; SSET_START_DESK(*style, val[0]); } SET_HAS_EWMH_INIT_WM_DESKTOP(fw, EWMH_STATE_HAS_HINT); fw->ewmh_hint_desktop = val[0]; free(val); } return 0; } int ewmh_MoveResize(EWMH_CMD_ARGS) { int dir = -1; int x_warp = 0; int y_warp = 0; Bool move = False; char cmd[256]; if (ev == NULL) { return 0; } dir = ev->xclient.data.l[2]; switch(dir) { case _NET_WM_MOVERESIZE_SIZE_TOPLEFT: break; case _NET_WM_MOVERESIZE_SIZE_TOP: x_warp = 50; break; case _NET_WM_MOVERESIZE_SIZE_TOPRIGHT: x_warp = 100; break; case _NET_WM_MOVERESIZE_SIZE_RIGHT: x_warp = 100; y_warp = 50; break; case _NET_WM_MOVERESIZE_SIZE_KEYBOARD: case _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT: x_warp = 100; y_warp = 100; break; case _NET_WM_MOVERESIZE_SIZE_BOTTOM: x_warp = 50; y_warp = 100; break; case _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT: y_warp = 100; break; case _NET_WM_MOVERESIZE_SIZE_LEFT: y_warp = 50; break; case _NET_WM_MOVERESIZE_MOVE_KEYBOARD: case _NET_WM_MOVERESIZE_MOVE: move = True; break; default: return 0; } if (move) { if ( !is_function_allowed( F_MOVE, NULL, fw, RQORIG_PROGRAM_US, False)) { return 0; } } else { if ( !is_function_allowed( F_RESIZE, NULL, fw, RQORIG_PROGRAM_US, False)) { return 0; } } if (!move) { sprintf(cmd, "WarpToWindow %i %i",x_warp,y_warp); execute_function_override_window(NULL, NULL, cmd, 0, fw); } if (move) { execute_function_override_window( NULL, NULL, "Move", 0, fw); } else { execute_function_override_window( NULL, NULL, "Resize", 0, fw); } return 0; } /* * WM_STATE* */ int ewmh_WMState(EWMH_CMD_ARGS) { unsigned long maximize = 0; if (ev != NULL) { ewmh_atom *a1,*a2; a1 = ewmh_GetEwmhAtomByAtom( ev->xclient.data.l[1], EWMH_ATOM_LIST_WM_STATE); a2 = ewmh_GetEwmhAtomByAtom( ev->xclient.data.l[2], EWMH_ATOM_LIST_WM_STATE); if (a1 != NULL) { maximize |= a1->action(fw, ev, NULL, 0); } if (a2 != NULL) { maximize |= a2->action(fw, ev, NULL, 0); } } else if (style != NULL) { CARD32 *val; unsigned int nitems; int size = 0; int i; ewmh_atom *list = ewmh_atom_wm_state; int has_hint = 0; val = ewmh_AtomGetByName( FW_W(fw), "_NET_WM_STATE", EWMH_ATOM_LIST_CLIENT_WIN, &size); if (val == NULL) { size = 0; } #if DEBUG_EWMH_INIT_STATE if (size != 0) { fprintf( stderr, "Window 0x%lx has an init" " _NET_WM_STATE hint\n",FW_W(fw)); } #endif nitems = size / sizeof(CARD32); while(list->name != NULL) { has_hint = 0; for(i = 0; i < nitems; i++) { if (list->atom == val[i]) { has_hint = 1; } } list->action(fw, NULL, style, has_hint); list++; } if (val != NULL) { free(val); } return 0; } if (maximize != 0) { int max_vert = (maximize & EWMH_MAXIMIZE_VERT)? 100:0; int max_horiz = (maximize & EWMH_MAXIMIZE_HORIZ)? 100:0; char cmd[256]; if (maximize & EWMH_MAXIMIZE_REMOVE) { sprintf(cmd,"Maximize off"); } else { if (!is_function_allowed( F_MAXIMIZE, NULL, fw, RQORIG_PROGRAM_US, False)) { return 0; } sprintf(cmd,"Maximize on %i %i", max_horiz, max_vert); } execute_function_override_window(NULL, NULL, cmd, 0, fw); } return 0; } int ewmh_WMStateFullScreen(EWMH_CMD_ARGS) { if (ev == NULL && style == NULL) { return (IS_EWMH_FULLSCREEN(fw)); } if (ev == NULL && style != NULL) { /* start full screen */ unsigned long has_hint = any; #if DEBUG_EWMH_INIT_STATE if (has_hint) { fprintf(stderr,"\tFullscreen\n"); } #endif if (DO_EWMH_IGNORE_STATE_HINTS(style)) { SET_HAS_EWMH_INIT_FULLSCREEN_STATE( fw, EWMH_STATE_UNDEFINED_HINT); return 0; } if (HAS_EWMH_INIT_FULLSCREEN_STATE(fw) != EWMH_STATE_UNDEFINED_HINT) { return 0; } if (!has_hint) { SET_HAS_EWMH_INIT_FULLSCREEN_STATE( fw, EWMH_STATE_NO_HINT); return 0; } SET_EWMH_FULLSCREEN(fw,True); SET_HAS_EWMH_INIT_FULLSCREEN_STATE(fw, EWMH_STATE_HAS_HINT); return 0; } if (ev != NULL) { /* client message */ int bool_arg = ev->xclient.data.l[0]; int is_full_screen; is_full_screen = IS_EWMH_FULLSCREEN(fw); if ((bool_arg == NET_WM_STATE_TOGGLE && !is_full_screen) || bool_arg == NET_WM_STATE_ADD) { EWMH_fullscreen(fw); } else { if (HAS_EWMH_INIT_FULLSCREEN_STATE(fw) == EWMH_STATE_HAS_HINT) { /* the application started fullscreen */ SET_HAS_EWMH_INIT_FULLSCREEN_STATE( fw, EWMH_STATE_NO_HINT); } /* unmaximize will restore is_ewmh_fullscreen, * layer and apply_decor_change */ execute_function_override_window( NULL, NULL, "Maximize off", 0, fw); } if ((IS_EWMH_FULLSCREEN(fw) && !DO_EWMH_USE_STACKING_HINTS(fw)) || (!IS_EWMH_FULLSCREEN(fw) && DO_EWMH_USE_STACKING_HINTS(fw))) { /* On: if not raised by a layer cmd raise * Off: if lowered by a layer cmd raise */ execute_function_override_window( NULL, NULL, "Raise", 0, fw); } } return 0; } int ewmh_WMStateHidden(EWMH_CMD_ARGS) { if (ev == NULL && style == NULL) { unsigned long do_restore = any; if (do_restore) { if (HAS_EWMH_INIT_HIDDEN_STATE(fw) == EWMH_STATE_HAS_HINT) { return True; } return False; } return IS_ICONIFIED(fw); } if (ev == NULL && style != NULL) { /* start iconified */ unsigned long has_hint = any; #if DEBUG_EWMH_INIT_STATE if (has_hint) fprintf(stderr,"\tHidden\n"); #endif if (DO_EWMH_IGNORE_STATE_HINTS(style)) { SET_HAS_EWMH_INIT_HIDDEN_STATE( fw, EWMH_STATE_UNDEFINED_HINT); return 0; } if (HAS_EWMH_INIT_HIDDEN_STATE(fw) != EWMH_STATE_UNDEFINED_HINT) { return 0; } if (!has_hint) { SET_HAS_EWMH_INIT_HIDDEN_STATE(fw, EWMH_STATE_NO_HINT); return 0; } style->flags.do_start_iconic = 1; style->flag_mask.do_start_iconic = 1; style->change_mask.do_start_iconic = 1; SET_HAS_EWMH_INIT_HIDDEN_STATE(fw, EWMH_STATE_HAS_HINT); return 0; } if (ev != NULL) { /* client message */ char cmd[16]; int bool_arg = ev->xclient.data.l[0]; if ((bool_arg == NET_WM_STATE_TOGGLE && !IS_ICONIFIED(fw)) || bool_arg == NET_WM_STATE_ADD) { /* iconify */ if ( !is_function_allowed( F_ICONIFY, NULL, fw, RQORIG_PROGRAM_US, False)) { return 0; } sprintf(cmd, "Iconify on"); } else { /* deiconify */ sprintf(cmd, "Iconify off"); } execute_function_override_window(NULL, NULL, cmd, 0, fw); } return 0; } int ewmh_WMStateMaxHoriz(EWMH_CMD_ARGS) { if (ev == NULL && style == NULL) { #if 0 return (IS_MAXIMIZED(fw) && !IS_EWMH_FULLSCREEN(fw)); #else /* DV: the notion of vertical/horizontal maximization does not * make any sense in fvwm, so just claim we're never maximized */ return 0; #endif } if (ev == NULL && style != NULL) { unsigned long has_hint = any; #if DEBUG_EWMH_INIT_STATE if (has_hint) { fprintf( stderr, "\t Maxhoriz %i\n", HAS_EWMH_INIT_MAXHORIZ_STATE(fw)); } #endif if (DO_EWMH_IGNORE_STATE_HINTS(style)) { SET_HAS_EWMH_INIT_MAXHORIZ_STATE( fw, EWMH_STATE_UNDEFINED_HINT); return 0; } /* If the initial state is STATE_NO_HINT we still want to * override it, since having just one of MAXIMIZED_HORIZ or * MAXIMIZED_HORZ is enough to make the window maximized. */ if (HAS_EWMH_INIT_MAXHORIZ_STATE(fw) == EWMH_STATE_HAS_HINT) { return 0; } if (!has_hint) { SET_HAS_EWMH_INIT_MAXHORIZ_STATE( fw, EWMH_STATE_NO_HINT); return 0; } SET_HAS_EWMH_INIT_MAXHORIZ_STATE(fw, EWMH_STATE_HAS_HINT); return 0; } if (ev != NULL) { /* client message */ int cmd_arg = ev->xclient.data.l[0]; if ( !IS_MAXIMIZED(fw) && (cmd_arg == NET_WM_STATE_TOGGLE || cmd_arg == NET_WM_STATE_ADD)) { return EWMH_MAXIMIZE_HORIZ; } else if ( IS_MAXIMIZED(fw) && (cmd_arg == NET_WM_STATE_TOGGLE || cmd_arg == NET_WM_STATE_REMOVE)) { return EWMH_MAXIMIZE_REMOVE; } } return 0; } int ewmh_WMStateMaxVert(EWMH_CMD_ARGS) { if (ev == NULL && style == NULL) { #if 0 return (IS_MAXIMIZED(fw) && !IS_EWMH_FULLSCREEN(fw)); #else /* DV: the notion of vertical/horizontal maximization does not * make any sense in fvwm, so just claim we're never maximized */ return 0; #endif } if (ev == NULL && style != NULL) { unsigned long has_hint = any; #if DEBUG_EWMH_INIT_STATE if (has_hint) { fprintf( stderr, "\t Maxvert %i\n", HAS_EWMH_INIT_MAXVERT_STATE(fw)); } #endif if (DO_EWMH_IGNORE_STATE_HINTS(style)) { SET_HAS_EWMH_INIT_MAXVERT_STATE( fw, EWMH_STATE_UNDEFINED_HINT); return 0; } if (HAS_EWMH_INIT_MAXVERT_STATE(fw) != EWMH_STATE_UNDEFINED_HINT) { return 0; } if (!has_hint) { SET_HAS_EWMH_INIT_MAXVERT_STATE( fw, EWMH_STATE_NO_HINT); return 0; } SET_HAS_EWMH_INIT_MAXVERT_STATE(fw, EWMH_STATE_HAS_HINT); return 0; } if (ev != NULL) { /* client message */ int cmd_arg = ev->xclient.data.l[0]; if ( !IS_MAXIMIZED(fw) && (cmd_arg == NET_WM_STATE_TOGGLE || cmd_arg == NET_WM_STATE_ADD)) { return EWMH_MAXIMIZE_VERT; } else if ( IS_MAXIMIZED(fw) && (cmd_arg == NET_WM_STATE_TOGGLE || cmd_arg == NET_WM_STATE_REMOVE)) { return EWMH_MAXIMIZE_REMOVE; } } return 0; } int ewmh_WMStateModal(EWMH_CMD_ARGS) { if (ev == NULL && style == NULL) { unsigned long do_restore = any; if (do_restore) { if (HAS_EWMH_INIT_MODAL_STATE(fw) == EWMH_STATE_HAS_HINT) { return True; } return False; } return IS_EWMH_MODAL(fw); } if (ev == NULL && style != NULL) { unsigned long has_hint = any; #if DEBUG_EWMH_INIT_STATE if (has_hint) { fprintf( stderr, "\t Modal %i\n", HAS_EWMH_INIT_MODAL_STATE(fw)); } #endif if (DO_EWMH_IGNORE_STATE_HINTS(style)) { SET_HAS_EWMH_INIT_MODAL_STATE( fw, EWMH_STATE_UNDEFINED_HINT); return 0; } if (HAS_EWMH_INIT_MODAL_STATE(fw) != EWMH_STATE_UNDEFINED_HINT) { return 0; } if (!has_hint) { SET_HAS_EWMH_INIT_MODAL_STATE(fw, EWMH_STATE_NO_HINT); return 0; } /* the window map or had mapped with a modal hint */ if (IS_TRANSIENT(fw)) { SET_EWMH_MODAL(fw, True); /* the window is a modal transient window so we grab * the focus it will be good to raise it but ... */ FPS_GRAB_FOCUS_TRANSIENT( S_FOCUS_POLICY(SCF(*style)), 1); FPS_GRAB_FOCUS_TRANSIENT( S_FOCUS_POLICY(SCM(*style)), 1); FPS_GRAB_FOCUS_TRANSIENT( S_FOCUS_POLICY(SCC(*style)), 1); SET_HAS_EWMH_INIT_MODAL_STATE( fw, EWMH_STATE_HAS_HINT); } else { SET_EWMH_MODAL(fw, False); if (!FP_DO_GRAB_FOCUS_TRANSIENT( S_FOCUS_POLICY(SCF(*style)))) { FPS_GRAB_FOCUS_TRANSIENT( S_FOCUS_POLICY(SCF(*style)), 0); FPS_GRAB_FOCUS_TRANSIENT( S_FOCUS_POLICY(SCM(*style)), 1); FPS_GRAB_FOCUS_TRANSIENT( S_FOCUS_POLICY(SCC(*style)), 1); } } return 0; } if (ev != NULL && fw != NULL) { /* client message: I do not think we can get such message */ /* java sends this message */ int cmd_arg = ev->xclient.data.l[0]; if ( !IS_EWMH_MODAL(fw) && (cmd_arg == NET_WM_STATE_TOGGLE || cmd_arg == NET_WM_STATE_ADD)) { /* ON */ } else if ( IS_EWMH_MODAL(fw) && (cmd_arg == NET_WM_STATE_TOGGLE || cmd_arg == NET_WM_STATE_REMOVE)) { /* OFF */ } /* !MODAL MODAL * CMD * STATE_ADD ON do nothing * STATE_TOGGLE ON OFF * STATE_REMOVE do nothing OFF */ } return 0; } int ewmh_WMStateShaded(EWMH_CMD_ARGS) { if (ev == NULL && style == NULL) { unsigned long do_restore = any; if (do_restore) { if (HAS_EWMH_INIT_SHADED_STATE(fw) == EWMH_STATE_HAS_HINT) { return True; } return False; } return IS_SHADED(fw); } if (ev == NULL && style != NULL) { /* start shaded */ unsigned long has_hint = any; #if DEBUG_EWMH_INIT_STATE if (has_hint) { fprintf( stderr, "\t Shaded %i\n", HAS_EWMH_INIT_SHADED_STATE(fw)); } #endif if (DO_EWMH_IGNORE_STATE_HINTS(style)) { SET_HAS_EWMH_INIT_SHADED_STATE( fw, EWMH_STATE_UNDEFINED_HINT); return 0; } if (HAS_EWMH_INIT_SHADED_STATE(fw) != EWMH_STATE_UNDEFINED_HINT) { return 0; } if (!has_hint) { SET_HAS_EWMH_INIT_SHADED_STATE( fw, EWMH_STATE_NO_HINT); return 0; } SET_SHADED(fw, 1); SET_SHADED_DIR(fw, GET_TITLE_DIR(fw)); SET_HAS_EWMH_INIT_SHADED_STATE(fw, EWMH_STATE_HAS_HINT); return 0; } if (ev != NULL) { /* client message */ int cmd_arg = ev->xclient.data.l[0]; if ( !IS_SHADED(fw) && (cmd_arg == NET_WM_STATE_TOGGLE || cmd_arg == NET_WM_STATE_ADD)) { execute_function_override_window( NULL, NULL, "Windowshade on", 0, fw); } else if ( IS_SHADED(fw) && (cmd_arg == NET_WM_STATE_TOGGLE || cmd_arg == NET_WM_STATE_REMOVE)) { execute_function_override_window( NULL, NULL, "Windowshade off", 0, fw); } } return 0; } int ewmh_WMStateSkipPager(EWMH_CMD_ARGS) { if (ev == NULL && style == NULL) { unsigned long do_restore = any; if (do_restore) { if (HAS_EWMH_INIT_SKIP_PAGER_STATE(fw) == EWMH_STATE_HAS_HINT) { return True; } return False; } return DO_SKIP_WINDOW_LIST(fw); } if (ev == NULL && style != NULL) { unsigned long has_hint = any; #if DEBUG_EWMH_INIT_STATE /*if (has_hint)*/ fprintf( stderr, "\t Skip_Pager %lu, %i, %i\n", has_hint, HAS_EWMH_INIT_SKIP_PAGER_STATE(fw), DO_EWMH_IGNORE_STATE_HINTS(style)); #endif if (DO_EWMH_IGNORE_STATE_HINTS(style)) { SET_HAS_EWMH_INIT_SKIP_PAGER_STATE( fw, EWMH_STATE_UNDEFINED_HINT); return 0; } if (HAS_EWMH_INIT_SKIP_PAGER_STATE(fw) != EWMH_STATE_UNDEFINED_HINT) { return 0; } if (!has_hint) { SET_HAS_EWMH_INIT_SKIP_PAGER_STATE( fw, EWMH_STATE_NO_HINT); return 0; } S_SET_DO_WINDOW_LIST_SKIP(SCF(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCM(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCC(*style), 1); SET_HAS_EWMH_INIT_SKIP_PAGER_STATE(fw, EWMH_STATE_HAS_HINT); return 0; } if (ev != NULL) { /* I do not think we can get such client message */ int bool_arg = ev->xclient.data.l[0]; if ((bool_arg == NET_WM_STATE_TOGGLE && !DO_SKIP_WINDOW_LIST(fw)) || bool_arg == NET_WM_STATE_ADD) { } else { } } return 0; } int ewmh_WMStateSkipTaskBar(EWMH_CMD_ARGS) { if (ev == NULL && style == NULL) { unsigned long do_restore = any; if (do_restore) { if (HAS_EWMH_INIT_SKIP_TASKBAR_STATE(fw) == EWMH_STATE_HAS_HINT) { return True; } return False; } return DO_SKIP_WINDOW_LIST(fw); } if (ev == NULL && style != NULL) { unsigned long has_hint = any; #if DEBUG_EWMH_INIT_STATE /*if (has_hint)*/ fprintf(stderr,"\t Skip_Taskbar %lu, %i, %i\n", has_hint, HAS_EWMH_INIT_SKIP_TASKBAR_STATE(fw), DO_EWMH_IGNORE_STATE_HINTS(style)); #endif if (DO_EWMH_IGNORE_STATE_HINTS(style)) { SET_HAS_EWMH_INIT_SKIP_TASKBAR_STATE( fw, EWMH_STATE_UNDEFINED_HINT); return 0; } if (HAS_EWMH_INIT_SKIP_TASKBAR_STATE(fw) != EWMH_STATE_UNDEFINED_HINT) { return 0; } if (!has_hint) { SET_HAS_EWMH_INIT_SKIP_TASKBAR_STATE( fw, EWMH_STATE_NO_HINT); return 0; } S_SET_DO_WINDOW_LIST_SKIP(SCF(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCM(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCC(*style), 1); SET_HAS_EWMH_INIT_SKIP_TASKBAR_STATE( fw, EWMH_STATE_HAS_HINT); return 0; } if (ev != NULL) { /* I do not think we can get such client message */ int bool_arg = ev->xclient.data.l[0]; if ((bool_arg == NET_WM_STATE_TOGGLE && !DO_SKIP_WINDOW_LIST(fw)) || bool_arg == NET_WM_STATE_ADD) { } else { } } return 0; } int ewmh_WMStateStaysOnTop(EWMH_CMD_ARGS) { if (ev == NULL && style == NULL) { unsigned long do_restore = any; if (do_restore) { if (fw->ewmh_hint_layer == Scr.TopLayer) { return True; } return False; } if (fw->layer >= Scr.TopLayer) { return True; } return False; } if (ev == NULL && style != NULL) { unsigned long has_hint = any; #if DEBUG_EWMH_INIT_STATE if (has_hint) { fprintf(stderr,"\tStaysOnTop\n"); } #endif if (!DO_EWMH_USE_STACKING_HINTS(style)) { return 0; } if (!has_hint && fw->ewmh_hint_layer == 0) { fw->ewmh_hint_layer = -1; return 0; } if (fw->ewmh_hint_layer == -1) { return 0; } fw->ewmh_hint_layer = Scr.TopLayer; SSET_LAYER(*style, Scr.TopLayer); style->flags.use_layer = 1; style->flag_mask.use_layer = 1; style->change_mask.use_layer = 1; return 0; } if (ev != NULL) { /* client message */ int cmd_arg = ev->xclient.data.l[0]; if (!DO_EWMH_USE_STACKING_HINTS(fw)) { /* if we don't pay attention to the hints, * I don't think we should honor this request also */ return 0; } if (fw->layer < Scr.TopLayer && (cmd_arg == NET_WM_STATE_TOGGLE || cmd_arg == NET_WM_STATE_ADD)) { new_layer(fw, Scr.TopLayer); } else if ( fw->layer == Scr.TopLayer && (cmd_arg == NET_WM_STATE_TOGGLE || cmd_arg == NET_WM_STATE_REMOVE)) { new_layer(fw, Scr.DefaultLayer); } /* layer < TopLayer layer == TopLayer * CMD * STATE_ADD new_layer(TOP) do nothing * STATE_TOGGLE new_layer(TOP) new_layer(DEFAULT) * STATE_REMOVE do nothing new_layer(DEFAULT) */ } return 0; } int ewmh_WMStateStaysOnBottom(EWMH_CMD_ARGS) { if (ev == NULL && style == NULL) { unsigned long do_restore = any; if (do_restore) { if (fw->ewmh_hint_layer == Scr.BottomLayer) { return True; } return False; } if (fw->layer <= Scr.BottomLayer) { return True; } return False; } if (ev == NULL && style != NULL) { unsigned long has_hint = any; #if DEBUG_EWMH_INIT_STATE if (has_hint) fprintf(stderr,"\tStaysOnBottom\n"); #endif if (!DO_EWMH_USE_STACKING_HINTS(style)) { return 0; } if (!has_hint && fw->ewmh_hint_layer == 0) { fw->ewmh_hint_layer = -1; return 0; } if (fw->ewmh_hint_layer == -1) { return 0; } fw->ewmh_hint_layer = Scr.BottomLayer; SSET_LAYER(*style, Scr.BottomLayer); style->flags.use_layer = 1; style->flag_mask.use_layer = 1; style->change_mask.use_layer = 1; return 0; } if (ev != NULL) { /* client message */ int cmd_arg = ev->xclient.data.l[0]; if (!DO_EWMH_USE_STACKING_HINTS(fw)) { /* if we don't pay attention to the hints, * I don't think we should honor this request also */ return 0; } if ( fw->layer > Scr.BottomLayer && (cmd_arg == NET_WM_STATE_TOGGLE || cmd_arg == NET_WM_STATE_ADD)) { new_layer(fw, Scr.BottomLayer); } else if ( fw->layer == Scr.BottomLayer && (cmd_arg == NET_WM_STATE_TOGGLE || cmd_arg == NET_WM_STATE_REMOVE)) { new_layer(fw, Scr.DefaultLayer); } /* layer > BottomLayer layer == BottomLayer * CMD * STATE_ADD new_layer(BOTTOM) do nothing * STATE_TOGGLE new_layer(BOTTOM) new_layer(DEFAULT) * STATE_REMOVE do nothing new_layer(DEFAULT) */ } return 0; } int ewmh_WMStateSticky(EWMH_CMD_ARGS) { if (ev == NULL && style == NULL) { unsigned long do_restore = any; if (do_restore) { if (HAS_EWMH_INIT_STICKY_STATE(fw) == EWMH_STATE_HAS_HINT) { return True; } return False; } return (IS_STICKY_ACROSS_PAGES(fw) && IS_STICKY_ACROSS_DESKS(fw)); } if (ev == NULL && style != NULL) { /* start sticky */ unsigned long has_hint = any; #if DEBUG_EWMH_INIT_STATE if (has_hint) { fprintf(stderr,"\t Sticky\n"); } #endif if (DO_EWMH_IGNORE_STATE_HINTS(style)) { SET_HAS_EWMH_INIT_STICKY_STATE( fw, EWMH_STATE_UNDEFINED_HINT); return 0; } if (HAS_EWMH_INIT_STICKY_STATE(fw) != EWMH_STATE_UNDEFINED_HINT) { return 0; } if (!has_hint) { SET_HAS_EWMH_INIT_STICKY_STATE( fw, EWMH_STATE_NO_HINT); return 0; } S_SET_IS_STICKY_ACROSS_PAGES(SCF(*style), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCM(*style), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCC(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCF(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCM(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCC(*style), 1); SET_HAS_EWMH_INIT_STICKY_STATE(fw, EWMH_STATE_HAS_HINT); return 0; } if (ev != NULL) { /* client message */ int bool_arg = ev->xclient.data.l[0]; if ((bool_arg == NET_WM_STATE_TOGGLE && (!IS_STICKY_ACROSS_PAGES(fw) || !IS_STICKY_ACROSS_DESKS(fw))) || bool_arg == NET_WM_STATE_ADD) { execute_function_override_window( NULL, NULL, "Stick on", 0, fw); } else { execute_function_override_window( NULL, NULL, "Stick on", 1, fw); } } return 0; } /* * Property Notify (_NET_WM_ICON is in ewmh_icon.c, _NET_WM_*NAME are in * ewmh_name) * */ int ewmh_WMIconGeometry(EWMH_CMD_ARGS) { int size; CARD32 *val; /* FIXME: After a (un)slide of kicker the geometry are wrong (not * because we set the geometry just after the property notify). This * does not happen with kwin */ val = ewmh_AtomGetByName( FW_W(fw), "_NET_WM_ICON_GEOMETRY", EWMH_ATOM_LIST_PROPERTY_NOTIFY, &size); if (val != NULL && size < 4 * sizeof(CARD32)) { fvwm_msg( WARN, "ewmh_WMIconGeometry", "The application window (id %#lx)\n" " \"%s\" tried to set to an icon geometry via EWMH\n" " but provided only %d of the 4 values required.\n" " fvwm is ignoring this request.\n", fw ? FW_W(fw) : 0, fw ? fw->name.name : "(none)", (int)(size / sizeof(CARD32))); fvwm_msg_report_app_and_workers(); free(val); val = NULL; } if (val == NULL) { fw->ewmh_icon_geometry.x = 0; fw->ewmh_icon_geometry.y = 0; fw->ewmh_icon_geometry.width = 0; fw->ewmh_icon_geometry.height = 0; return 0; } fw->ewmh_icon_geometry.x = val[0]; fw->ewmh_icon_geometry.y = val[1]; fw->ewmh_icon_geometry.width = val[2]; fw->ewmh_icon_geometry.height = val[3]; free(val); return 0; } /**** for animation ****/ void EWMH_GetIconGeometry(FvwmWindow *fw, rectangle *icon_rect) { if (!IS_ICON_SUPPRESSED(fw) || (fw->ewmh_icon_geometry.x == 0 && fw->ewmh_icon_geometry.y == 0 && fw->ewmh_icon_geometry.width == 0 && fw->ewmh_icon_geometry.height == 0)) { return; } icon_rect->x = fw->ewmh_icon_geometry.x; icon_rect->y = fw->ewmh_icon_geometry.y; icon_rect->width = fw->ewmh_icon_geometry.width; icon_rect->height = fw->ewmh_icon_geometry.height; return; } int ewmh_WMStrut(EWMH_CMD_ARGS) { int size = 0; CARD32 *val; if (ev == NULL) { fw->dyn_strut.left = fw->strut.left = 0; fw->dyn_strut.right = fw->strut.right = 0; fw->dyn_strut.top = fw->strut.top = 0; fw->dyn_strut.bottom = fw->strut.bottom = 0; } val = ewmh_AtomGetByName( FW_W(fw), "_NET_WM_STRUT", EWMH_ATOM_LIST_PROPERTY_NOTIFY, &size); if (val == NULL) { return 0; } if ((val[0] > 0 || val[1] > 0 || val[2] > 0 || val[3] > 0) && (val[0] != fw->strut.left || val[1] != fw->strut.right || val[2] != fw->strut.top || val[3] != fw->strut.bottom)) { fw->strut.left = val[0]; fw->strut.right = val[1]; fw->strut.top = val[2]; fw->strut.bottom = val[3]; ewmh_ComputeAndSetWorkArea(); } if (val[0] != fw->dyn_strut.left || val[1] != fw->dyn_strut.right || val[2] != fw->dyn_strut.top || val[3] != fw->dyn_strut.bottom) { fw->dyn_strut.left = val[0]; fw->dyn_strut.right = val[1]; fw->dyn_strut.top = val[2]; fw->dyn_strut.bottom = val[3]; ewmh_HandleDynamicWorkArea(); } free(val); return 0; } Bool EWMH_ProcessClientMessage(const exec_context_t *exc) { ewmh_atom *ewmh_a = NULL; FvwmWindow *fw = exc->w.fw; XEvent *ev = exc->x.elast; if ((ewmh_a = (ewmh_atom *)ewmh_GetEwmhAtomByAtom( ev->xclient.message_type, EWMH_ATOM_LIST_CLIENT_ROOT)) != NULL) { if (ewmh_a->action != None) { ewmh_a->action(fw, ev, NULL, 0); } return True; } if ((ewmh_a = (ewmh_atom *)ewmh_GetEwmhAtomByAtom( ev->xclient.message_type, EWMH_ATOM_LIST_CLIENT_WIN)) == NULL) { return False; } if (ev->xclient.window == None) { return False; } /* these one are special: we can get it on an unamaged window */ if (StrEquals(ewmh_a->name, "_NET_MOVERESIZE_WINDOW") || StrEquals(ewmh_a->name, "_NET_RESTACK_WINDOW")) { ewmh_a->action(fw, ev, NULL, 0); return True; } if (fw == NULL) { return False; } if ((ewmh_a = (ewmh_atom *)ewmh_GetEwmhAtomByAtom( ev->xclient.message_type, EWMH_ATOM_LIST_CLIENT_WIN)) != NULL) { if (ewmh_a->action != None) { ewmh_a->action(fw, ev, NULL, 0); } return True; } return False; } void EWMH_ProcessPropertyNotify(const exec_context_t *exc) { ewmh_atom *ewmh_a = NULL; FvwmWindow *fw = exc->w.fw; XEvent *ev = exc->x.elast; if ((ewmh_a = (ewmh_atom *)ewmh_GetEwmhAtomByAtom( ev->xproperty.atom, EWMH_ATOM_LIST_PROPERTY_NOTIFY)) != NULL) { if (ewmh_a->action != None) { flush_property_notify(ewmh_a->atom, FW_W(fw)); ewmh_a->action(fw, ev, NULL, 0); } } } fvwm-2.6.5.orig/fvwm/decorations.c0000644000175000017500000004616310656151547015303 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * * This is all original code by Robert Nation * which reads motif mwm window manager * hints from a window, and makes necessary adjustments for fvwm. * */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include "libs/fvwmlib.h" #include "libs/FShape.h" #include "libs/Parse.h" #include "libs/lang-strings.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "commands.h" #include "misc.h" #include "screen.h" #include "update.h" #include "style.h" #include "geometry.h" #include "decorations.h" /* ---------------------------- local definitions -------------------------- */ /* Motif window hints */ #define MWM_HINTS_FUNCTIONS (1L << 0) #define MWM_HINTS_DECORATIONS (1L << 1) /* bit definitions for MwmHints.functions */ #define MWM_FUNC_ALL (1L << 0) #define MWM_FUNC_RESIZE (1L << 1) #define MWM_FUNC_MOVE (1L << 2) #define MWM_FUNC_MINIMIZE (1L << 3) #define MWM_FUNC_MAXIMIZE (1L << 4) #define MWM_FUNC_CLOSE (1L << 5) /* bit definitions for MwmHints.decorations */ #if 0 #define MWM_DECOR_ALL (1L << 0) #define MWM_DECOR_BORDER (1L << 1) #define MWM_DECOR_RESIZEH (1L << 2) #define MWM_DECOR_TITLE (1L << 3) #define MWM_DECOR_MENU (1L << 4) #define MWM_DECOR_MINIMIZE (1L << 5) #define MWM_DECOR_MAXIMIZE (1L << 6) #endif #define PROP_MOTIF_WM_HINTS_ELEMENTS 4 #define PROP_MWM_HINTS_ELEMENTS PROP_MOTIF_WM_HINTS_ELEMENTS /* bit definitions for OL hints; I just * made these up, OL stores hints as atoms */ #define OL_DECOR_CLOSE (1L << 0) #define OL_DECOR_RESIZEH (1L << 1) #define OL_DECOR_HEADER (1L << 2) #define OL_DECOR_ICON_NAME (1L << 3) #define OL_DECOR_ALL \ (OL_DECOR_CLOSE | OL_DECOR_RESIZEH | OL_DECOR_HEADER | OL_DECOR_ICON_NAME) /* indicates if there are any OL hints */ #define OL_ANY_HINTS (1L << 7) /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ extern Atom _XA_MwmAtom; /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* Motif window hints */ typedef struct { long flags; long functions; long decorations; long inputMode; } PropMotifWmHints; typedef PropMotifWmHints PropMwmHints; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ /* * * Reads the property MOTIF_WM_HINTS * */ void GetMwmHints(FvwmWindow *t) { int actual_format; Atom actual_type; unsigned long nitems, bytesafter; if (t->mwm_hints) { XFree((char *)t->mwm_hints); t->mwm_hints = NULL; } if (XGetWindowProperty( dpy, FW_W(t), _XA_MwmAtom, 0L, 32L, False, _XA_MwmAtom, &actual_type, &actual_format, &nitems, &bytesafter,(unsigned char **)&t->mwm_hints)==Success) { if (nitems >= PROP_MOTIF_WM_HINTS_ELEMENTS) { return; } } t->mwm_hints = NULL; return; } /* * * Reads the openlook properties _OL_WIN_ATTR, _OL_DECOR_ADD, _OL_DECOR_DEL * * _OL_WIN_ATTR - the win_type field is the either the first atom if the * property has length three or the second atom if the property has * length five. It can be any of: * _OL_WT_BASE (no changes) * _OL_WT_CMD (no minimize decoration) * _OL_WT_HELP (no minimize, maximize or resize handle decorations) * _OL_WT_NOTICE (no minimize, maximize, system menu, resize handle * or titlebar decorations) * _OL_WT_OTHER (no minimize, maximize, system menu, resize handle * or titlebar decorations) * In addition, if the _OL_WIN_ATTR property is in the three atom format * or if the type is _OL_WT_OTHER, then the icon name is not displayed * (same behavior as olvwm). * * _OL_DECOR_ADD or _OL_DECOR_DEL - indivdually add or remove minimize * button (_OL_DECOR_CLOSE), resize handles (_OL_DECOR_RESIZE), title bar * (_OL_DECOR_HEADER), or icon name (_OL_DECOR_ICON_NAME). * * The documentation for the Open Look hints was taken from "Advanced X * Window Application Programming", Eric F. Johnson and Kevin Reichard * (M&T Books), and the olvwm source code (available at ftp.x.org in * /R5contrib). */ void GetOlHints(FvwmWindow *t) { int actual_format; Atom actual_type; unsigned long nitems, bytesafter; Atom *hints; int i; Atom win_type; t->ol_hints = OL_DECOR_ALL; if (XGetWindowProperty( dpy, FW_W(t), _XA_OL_WIN_ATTR, 0L, 32L, False, _XA_OL_WIN_ATTR, &actual_type, &actual_format, &nitems, &bytesafter, (unsigned char **)&hints) == Success) { if (nitems > 0) { t->ol_hints |= OL_ANY_HINTS; if (nitems == 3) { win_type = hints[0]; } else { win_type = hints[1]; } /* got this from olvwm and sort of mapped it to * fvwm/MWM hints */ if (win_type == _XA_OL_WT_BASE) { t->ol_hints = OL_DECOR_ALL; } else if (win_type == _XA_OL_WT_CMD) { t->ol_hints = OL_DECOR_ALL & ~OL_DECOR_CLOSE; } else if (win_type == _XA_OL_WT_HELP) { t->ol_hints = OL_DECOR_ALL & ~(OL_DECOR_CLOSE | OL_DECOR_RESIZEH); } else if (win_type == _XA_OL_WT_NOTICE) { t->ol_hints = OL_DECOR_ALL & ~(OL_DECOR_CLOSE | OL_DECOR_RESIZEH | OL_DECOR_HEADER | OL_DECOR_ICON_NAME); } else if (win_type == _XA_OL_WT_OTHER) { t->ol_hints = 0; } else { t->ol_hints = OL_DECOR_ALL; } if (nitems == 3) { t->ol_hints &= ~OL_DECOR_ICON_NAME; } } if (hints) { XFree (hints); } } if (XGetWindowProperty( dpy, FW_W(t), _XA_OL_DECOR_ADD, 0L, 32L, False, XA_ATOM, &actual_type, &actual_format, &nitems, &bytesafter,(unsigned char **)&hints)==Success) { for (i = 0; i < nitems; i++) { t->ol_hints |= OL_ANY_HINTS; if (hints[i] == _XA_OL_DECOR_CLOSE) { t->ol_hints |= OL_DECOR_CLOSE; } else if (hints[i] == _XA_OL_DECOR_RESIZE) { t->ol_hints |= OL_DECOR_RESIZEH; } else if (hints[i] == _XA_OL_DECOR_HEADER) { t->ol_hints |= OL_DECOR_HEADER; } else if (hints[i] == _XA_OL_DECOR_ICON_NAME) { t->ol_hints |= OL_DECOR_ICON_NAME; } } if (hints) { XFree (hints); } } if (XGetWindowProperty( dpy, FW_W(t), _XA_OL_DECOR_DEL, 0L, 32L, False, XA_ATOM, &actual_type, &actual_format, &nitems, &bytesafter,(unsigned char **)&hints)==Success) { for (i = 0; i < nitems; i++) { t->ol_hints |= OL_ANY_HINTS; if (hints[i] == _XA_OL_DECOR_CLOSE) { t->ol_hints &= ~OL_DECOR_CLOSE; } else if (hints[i] == _XA_OL_DECOR_RESIZE) { t->ol_hints &= ~OL_DECOR_RESIZEH; } else if (hints[i] == _XA_OL_DECOR_HEADER) { t->ol_hints &= ~OL_DECOR_HEADER; } else if (hints[i] == _XA_OL_DECOR_ICON_NAME) { t->ol_hints &= ~OL_DECOR_ICON_NAME; } } if (hints) { XFree (hints); } } return; } /* * * Interprets the property MOTIF_WM_HINTS, sets decoration and functions * accordingly * */ void SelectDecor(FvwmWindow *t, window_style *pstyle, short *buttons) { int decor; int i; int border_width; int handle_width; int used_width; PropMwmHints *prop; style_flags *sflags = &(pstyle->flags); border_width = (SHAS_BORDER_WIDTH(sflags)) ? SGET_BORDER_WIDTH(*pstyle) : DEFAULT_BORDER_WIDTH; if (border_width > MAX_BORDER_WIDTH) { border_width = MAX_BORDER_WIDTH; } handle_width = (SHAS_HANDLE_WIDTH(sflags)) ? SGET_HANDLE_WIDTH(*pstyle) : DEFAULT_HANDLE_WIDTH; if (handle_width > MAX_HANDLE_WIDTH) { handle_width = MAX_HANDLE_WIDTH; } *buttons = (1 << NUMBER_OF_TITLE_BUTTONS) - 1; decor = MWM_DECOR_ALL; t->functions = MWM_FUNC_ALL; if (t->mwm_hints) { prop = (PropMwmHints *)t->mwm_hints; if (SHAS_MWM_DECOR(sflags)) { if (prop->flags & MWM_HINTS_DECORATIONS) { decor = 0; if (prop->decorations & 0x1) { decor |= MWM_DECOR_ALL; } if (prop->decorations & 0x2) { decor |= MWM_DECOR_BORDER; } if (prop->decorations & 0x4) { decor |= MWM_DECOR_RESIZEH; } if (prop->decorations & 0x8) { decor |= MWM_DECOR_TITLE; } if (prop->decorations & 0x10) { decor |= MWM_DECOR_MENU; } if (prop->decorations & 0x20) { decor |= MWM_DECOR_MINIMIZE; } if (prop->decorations & 0x40) { decor |= MWM_DECOR_MAXIMIZE; } } } if (SHAS_MWM_FUNCTIONS(sflags)) { if (prop->flags & MWM_HINTS_FUNCTIONS) { t->functions = prop->functions; } } } /* functions affect the decorations! if the user says * no iconify function, then the iconify button doesn't show * up. */ if (t->functions & MWM_FUNC_ALL) { /* If we get ALL + some other things, that means to use * ALL except the other things... */ t->functions &= ~MWM_FUNC_ALL; t->functions = (MWM_FUNC_RESIZE | MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_FUNC_CLOSE) & (~(t->functions)); } if (SHAS_MWM_FUNCTIONS(sflags) && IS_TRANSIENT(t)) { t->functions &= ~(MWM_FUNC_MAXIMIZE|MWM_FUNC_MINIMIZE); } if (decor & MWM_DECOR_ALL) { /* If we get ALL + some other things, that means to use * ALL except the other things... */ decor &= ~MWM_DECOR_ALL; decor = MWM_DECOR_EVERYTHING & (~decor); } /* now add/remove any functions specified in the OL hints */ if (SHAS_OL_DECOR(sflags) && (t->ol_hints & OL_ANY_HINTS)) { if (t->ol_hints & OL_DECOR_CLOSE) { t->functions |= MWM_FUNC_MINIMIZE; decor |= MWM_FUNC_MINIMIZE; } else { t->functions &= ~MWM_FUNC_MINIMIZE; decor &= ~MWM_FUNC_MINIMIZE; } if (t->ol_hints & OL_DECOR_RESIZEH) { t->functions |= (MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE); decor |= (MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE); } else { t->functions &= ~(MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE); decor &= ~(MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE); } if (t->ol_hints & OL_DECOR_HEADER) { t->functions |= (MWM_DECOR_MENU | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_DECOR_TITLE); decor |= (MWM_DECOR_MENU | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_DECOR_TITLE); } else { t->functions &= ~(MWM_DECOR_MENU | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_DECOR_TITLE); decor &= ~(MWM_DECOR_MENU | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE | MWM_DECOR_TITLE); } if (t->ol_hints & OL_DECOR_ICON_NAME) { SET_HAS_NO_ICON_TITLE(t, 0); } else { SET_HAS_NO_ICON_TITLE(t, 1); } } /* Now I have the un-altered decor and functions, but with the * ALL attribute cleared and interpreted. I need to modify the * decorations that are affected by the functions */ if (!(t->functions & MWM_FUNC_RESIZE)) { decor &= ~MWM_DECOR_RESIZEH; } /* MWM_FUNC_MOVE has no impact on decorations. */ if (!(t->functions & MWM_FUNC_MINIMIZE)) { decor &= ~MWM_DECOR_MINIMIZE; } if (!(t->functions & MWM_FUNC_MAXIMIZE)) { decor &= ~MWM_DECOR_MAXIMIZE; } /* MWM_FUNC_CLOSE has no impact on decorations. */ /* This rule is implicit, but its easier to deal with if * I take care of it now */ if (decor & (MWM_DECOR_MENU| MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE)) { decor |= MWM_DECOR_TITLE; } /* Selected the mwm-decor field, now trim down, based on * .fvwmrc entries */ if (SHAS_NO_TITLE(sflags) || (!SDO_DECORATE_TRANSIENT(sflags) && IS_TRANSIENT(t))) { decor &= ~MWM_DECOR_TITLE; } if (SHAS_NO_HANDLES(sflags) || (!SDO_DECORATE_TRANSIENT(sflags) && IS_TRANSIENT(t))) { decor &= ~MWM_DECOR_RESIZEH; } if (SHAS_MWM_DECOR(sflags) && IS_TRANSIENT(t)) { decor &= ~(MWM_DECOR_MAXIMIZE|MWM_DECOR_MINIMIZE); } if (FShapesSupported) { if (t->wShaped) { decor &= ~(MWM_DECOR_BORDER|MWM_DECOR_RESIZEH); } } if (IS_EWMH_FULLSCREEN(t)) { decor &=~(MWM_DECOR_BORDER|MWM_DECOR_RESIZEH|MWM_DECOR_TITLE); } /* Assume no decorations, and build up */ SET_HAS_TITLE(t, 0); SET_HAS_HANDLES(t, 0); used_width = 0; if (decor & MWM_DECOR_BORDER) { /* A narrow border is displayed (5 pixels - 2 relief, 1 top, * (2 shadow) */ used_width = border_width; } if (decor & MWM_DECOR_TITLE) { /* A title bar with no buttons in it * window gets a 1 pixel wide black border. */ SET_HAS_TITLE(t, 1); } if (decor & MWM_DECOR_RESIZEH) { /* A wide border, with corner tiles is desplayed * (10 pixels - 2 relief, 2 shadow) */ SET_HAS_HANDLES(t, 1); used_width = handle_width; } SET_HAS_NO_BORDER(t, S_HAS_NO_BORDER(SFC(*sflags)) || used_width <= 0); if (HAS_NO_BORDER(t)) { used_width = 0; } SET_HAS_HANDLES(t, (!HAS_NO_BORDER(t) && HAS_HANDLES(t))); set_window_border_size(t, used_width); if (!(decor & MWM_DECOR_MENU)) { /* title-bar menu button omitted * window gets 1 pixel wide black border */ /* disable any buttons with the MWMDecorMenu flag */ int i; for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; ++i) { if (TB_HAS_MWM_DECOR_MENU(GetDecor(t, buttons[i]))) { *buttons &= ~(1 << i); } } } if (!(decor & MWM_DECOR_MINIMIZE)) { /* title-bar + iconify button, no menu button. * window gets 1 pixel wide black border */ /* disable any buttons with the MWMDecorMinimize/MWMDecorShaded * flag */ int i; for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; ++i) { if (TB_HAS_MWM_DECOR_MINIMIZE(GetDecor(t, buttons[i]))) { *buttons &= ~(1 << i); } } } if (!(decor & MWM_DECOR_MAXIMIZE)) { /* title-bar + maximize button, no menu button, no iconify. * window has 1 pixel wide black border */ /* disable any buttons with the MWMDecorMaximize flag */ int i; for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; ++i) { if (TB_HAS_MWM_DECOR_MAXIMIZE(GetDecor(t, buttons[i]))) { *buttons &= ~(1 << i); } } } for (i = (1 << (NUMBER_OF_TITLE_BUTTONS - 1)); i; i >>= 1) { if (t->buttons & i) *buttons &= ~i; } t->nr_left_buttons = Scr.nr_left_buttons; t->nr_right_buttons = Scr.nr_right_buttons; for (i = 0; i / 2 < Scr.nr_left_buttons; i += 2) { if ((*buttons & (1 << i)) == 0) t->nr_left_buttons--; } for (i = 1; i / 2 < Scr.nr_right_buttons; i += 2) { if ((*buttons & (1 << i)) == 0) t->nr_right_buttons--; } return; } static Bool __is_resize_allowed( const FvwmWindow *t, int functions, request_origin_t request_origin) { if (!HAS_OVERRIDE_SIZE_HINTS(t) && t->hints.min_width == t->hints.max_width && t->hints.min_height == t->hints.max_height) { return False; } if (request_origin && IS_SIZE_FIXED(t)) { return False; } else if (!request_origin && IS_PSIZE_FIXED(t)) { return False; } if (request_origin && !(functions & MWM_FUNC_RESIZE)) { return False; } return True; } /* ** seemed kind of silly to have check_allowed_function and ** check_allowed_function2 partially overlapping in their checks, so I ** combined them here and made them wrapper functions instead. */ Bool is_function_allowed( int function, char *action_string, const FvwmWindow *t, request_origin_t request_origin, Bool do_allow_override_mwm_hints) { unsigned int functions; char *functionlist[] = { MOVE_STRING, RESIZE_STRING1, RESIZE_STRING2, MINIMIZE_STRING, MINIMIZE_STRING2, MAXIMIZE_STRING, CLOSE_STRING1, CLOSE_STRING2, CLOSE_STRING3, CLOSE_STRING4, NULL }; if (t == NULL) { return True; /* this logic come from animated menu */ } if (do_allow_override_mwm_hints && HAS_MWM_OVERRIDE_HINTS(t)) { /* allow everything */ functions = ~0; } else { /* restrict by mwm hints */ functions = t->functions; } /* Hate to do it, but for lack of a better idea, check based on the * menu entry name */ /* Complex functions are a little tricky, ignore them if no menu item*/ if (function == F_FUNCTION && action_string != NULL) { int i; /* remap to regular actions */ i = GetTokenIndex(action_string, functionlist, -1, NULL); switch (i) { case 0: function = F_MOVE; break; case 1: function = F_RESIZE; break; case 2: function = F_RESIZE; break; case 3: function = F_ICONIFY; break; case 4: function = F_ICONIFY; break; case 5: function = F_MAXIMIZE; break; case 6: function = F_CLOSE; break; case 7: function = F_DELETE; break; case 8: function = F_DESTROY; break; case 9: function = F_QUIT; break; default: break; } } /* now do the real checks */ switch(function) { case F_DELETE: if (IS_UNCLOSABLE(t)) { return False; } if (IS_TEAR_OFF_MENU(t)) { /* always allow this on tear off menus */ break; } if (!WM_DELETES_WINDOW(t)) { return False; } /* fall through to close clause */ case F_CLOSE: if (IS_UNCLOSABLE(t)) { return False; } if (IS_TEAR_OFF_MENU(t)) { /* always allow this on tear off menus */ break; } if (!(functions & MWM_FUNC_CLOSE)) { return False; } break; case F_DESTROY: /* shouldn't destroy always be allowed??? */ if (IS_UNCLOSABLE(t)) { return False; } if (IS_TEAR_OFF_MENU(t)) { /* always allow this on tear off menus */ break; } if (!(functions & MWM_FUNC_CLOSE)) { return False; } break; case F_RESIZE: if(!__is_resize_allowed(t, functions, request_origin)) { return False; } break; case F_ICONIFY: if ((!IS_ICONIFIED(t) && !(functions & MWM_FUNC_MINIMIZE)) || IS_UNICONIFIABLE(t)) { return False; } break; case F_MAXIMIZE: if (IS_MAXIMIZE_FIXED_SIZE_DISALLOWED(t) && !__is_resize_allowed(t, functions, request_origin)) { return False; } if ((request_origin && !(functions & MWM_FUNC_MAXIMIZE)) || IS_UNMAXIMIZABLE(t)) { return False; } break; case F_MOVE: /* Move is a funny hint. Keeps it out of the menu, but you're * still allowed to move. */ if (request_origin && IS_FIXED(t)) { return False; } else if (!request_origin && IS_FIXED_PPOS(t)) { return False; } if (request_origin && !(functions & MWM_FUNC_MOVE)) { return False; } break; case F_FUNCTION: default: break; } /* end of switch */ /* if we fell through, just return True */ return True; } fvwm-2.6.5.orig/fvwm/schedule.h0000644000175000017500000000030407677641663014571 0ustar vwcvwc/* -*-c-*- */ #ifndef SCHEDULE_H #define SCHEDULE_H void squeue_execute(void); int squeue_get_next_ms(void); int squeue_get_next_id(void); int squeue_get_last_id(void); #endif /* SCHEDULE_H */ fvwm-2.6.5.orig/fvwm/repeat.c0000644000175000017500000001014410552172642014231 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 1999 Dominik Vogt */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include "libs/fvwmlib.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "functions.h" #include "repeat.h" #include "libs/Parse.h" /* If non-zero we are already repeating a function, so don't record the * command again. */ static int repeat_depth = 0; #if 0 typedef struct { char *start; char *end; } double_ended_string; static struct { double_ended_string string; double_ended_string old; double_ended_string builtin; double_ended_string function; double_ended_string top_function; double_ended_string module; double_ended_string menu; double_ended_string popup; double_ended_string menu_or_popup; int page_x; int page_y; int desk; FvwmWindow *fvwm_window; } last; #endif static struct { char *command_line; char *menu_name; } last = { NULL, NULL }; #if 0 char *repeat_last_function = NULL; char *repeat_last_complex_function = NULL; char *repeat_last_builtin_function = NULL; char *repeat_last_module = NULL; char *repeat_last_top_function = NULL; char *repeat_last_menu = NULL; FvwmWindow *repeat_last_fvwm_window = NULL; #endif /* Stores the contents of the data pointer internally for the repeat command. * The type of data is determined by the 'type' parameter. If this function is * called to set a string value representing an fvwm builtin function the * 'builtin' can be set to the F_... value in the function table in * functions.c. If this value is set certain functions are not recorded. * The 'depth' parameter indicates the recursion depth of the current data * pointer (i.e. the first function call has a depth of one, functions called * from within this function have depth 2 and higher, this may be applicable * to future enhancements like menus). * * TODO: [finish and update description] */ Bool set_repeat_data(void *data, repeat_t type, const func_t *builtin) { /* No history recording during startup. */ if (fFvwmInStartup) { return True; } switch(type) { case REPEAT_COMMAND: if (last.command_line == (char *)data) { /* Already stored, no need to free the data pointer. */ return False; } if (data == NULL || repeat_depth != 0) { /* Ignoring the data, must free it outside of this * call. */ return True; } if (builtin && (builtin->flags & FUNC_DONT_REPEAT)) { /* Dont' record functions that have the * FUNC_DONT_REPEAT flag set. */ return True; } if (last.command_line) { free(last.command_line); } /* Store a backup. */ last.command_line = (char *)data; /* Since we stored the pointer the caller must not free it. */ return False; case REPEAT_MENU: case REPEAT_POPUP: if (last.menu_name) { free(last.menu_name); } last.menu_name = (char *)data; /* Since we stored the pointer the caller must not free it. */ return False; case REPEAT_PAGE: case REPEAT_DESK: case REPEAT_DESK_AND_PAGE: return True; case REPEAT_FVWM_WINDOW: return True; case REPEAT_NONE: default: return True; } } void CMD_Repeat(F_CMD_ARGS) { int index; char *optlist[] = { "command", NULL }; repeat_depth++; /* Replay the backup, we don't want the repeat command recorded. */ GetNextTokenIndex(action, optlist, 0, &index); switch (index) { case 0: /* command */ default: action = last.command_line; execute_function( cond_rc, exc, action, FUNC_DONT_EXPAND_COMMAND); break; } repeat_depth--; return; } fvwm-2.6.5.orig/fvwm/execcontext.h0000644000175000017500000000525610546202602015310 0ustar vwcvwc/* -*-c-*- */ #ifndef EXECCONTEXT_H #define EXECCONTEXT_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* Inernal types */ typedef struct { XEvent te; } exec_context_privileged_t; /* Interface types */ typedef enum { EXCT_NULL = '-', EXCT_INIT = 'I', EXCT_RESTART = 'R', EXCT_QUIT = 'Q', EXCT_TORESTART = 'r', EXCT_EVENT ='E', EXCT_MODULE ='M', EXCT_MENULOOP ='m', EXCT_PAGING = 'P', EXCT_SCHEDULE = 'S' } exec_context_type_t; typedef struct { XEvent *etrigger; XEvent *elast; } x_context_t; typedef struct { FvwmWindow *fw; Window w; unsigned long wcontext; } window_context_t; struct fmodule; typedef struct { struct fmodule *module; } module_context_t; typedef struct { exec_context_type_t type; x_context_t x; window_context_t w; module_context_t m; /* for internal use *only*. *Never* acces this from outside! */ exec_context_privileged_t private_data; } exec_context_t; typedef enum { ECC_TYPE = 0x1, ECC_ETRIGGER = 0x2, ECC_FW = 0x4, ECC_W = 0x8, ECC_WCONTEXT = 0x10, ECC_MODULE = 0x20 } exec_context_change_mask_t; typedef struct { exec_context_type_t type; x_context_t x; window_context_t w; module_context_t m; } exec_context_changes_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ /* Creates a new exec_context from the passed in arguments in malloc'ed memory. * The context must later be destroyed with exc_destroy_context(). * * Args: * ecc * Pointer to a structure which specifies the initial values of the struct * members. * mask * The mask of members in ecc to use. */ const exec_context_t *exc_create_context( exec_context_changes_t *ecc, exec_context_change_mask_t mask); /* Similar to exc_create_context(), but the created context contains only dummy * information. */ const exec_context_t *exc_create_null_context(void); /* Works like exc_create_context(), but initialises all values with the data * from excin. The ecc/mask pair overrides these values. */ const exec_context_t *exc_clone_context( const exec_context_t *excin, exec_context_changes_t *ecc, exec_context_change_mask_t mask); /* Destroys an exec_context structure that was created with * exc_create_context(). */ void exc_destroy_context(const exec_context_t *exc); #endif /* EXECCONTEXT_H */ fvwm-2.6.5.orig/fvwm/module_interface.h0000644000175000017500000000273210557144316016271 0ustar vwcvwc/* -*-c-*- */ #ifndef FVWM_MODULE_INTERFACE_H #define FVWM_MODULE_INTERFACE_H #include "libs/Module.h" struct fmodule; struct fmodule_input; /* Packet sending functions */ void BroadcastPacket(unsigned long event_type, unsigned long num_datum, ...); void BroadcastConfig(unsigned long event_type, const FvwmWindow *t); void BroadcastName( unsigned long event_type, unsigned long data1, unsigned long data2, unsigned long data3, const char *name); void BroadcastWindowIconNames(FvwmWindow *t, Bool window, Bool icon); void BroadcastFvwmPicture( unsigned long event_type, unsigned long data1, unsigned long data2, unsigned long data3, FvwmPicture *picture, char *name); void BroadcastPropertyChange( unsigned long argument, unsigned long data1, unsigned long data2, char *string); void BroadcastColorset(int n); void BroadcastConfigInfoString(char *string); void broadcast_xinerama_state(void); void broadcast_ignore_modifiers(void); void SendPacket( struct fmodule *module, unsigned long event_type, unsigned long num_datum, ...); void SendConfig( struct fmodule *module, unsigned long event_type, const FvwmWindow *t); void SendName( struct fmodule *module, unsigned long event_type, unsigned long data1, unsigned long data2, unsigned long data3, const char *name); /* command queue - module input */ void module_input_enqueue(struct fmodule_input *input); void module_input_execute(struct fmodule_input *input); void ExecuteCommandQueue(void); #endif /* MODULE_INTERFACE_H */ fvwm-2.6.5.orig/fvwm/modconf.h0000644000175000017500000000015607677641663014427 0ustar vwcvwc/* -*-c-*- */ #ifndef MODCONF_H #define MODCONF_H void ModuleConfig(char *action); #endif /* MODCONF_H */ fvwm-2.6.5.orig/fvwm/fvwm.c0000644000175000017500000020031311720436066013730 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_GETPWUID # include #endif #if HAVE_SYS_SYSTEMINFO_H /* Solaris has sysinfo instead of gethostname. */ #include #endif #include #include #include "libs/fvwmlib.h" #include "libs/envvar.h" #include "libs/Strings.h" #include "libs/System.h" #include "libs/Grab.h" #include "libs/ColorUtils.h" #include "libs/Graphics.h" #include "libs/FScreen.h" #include "libs/FShape.h" #include "libs/PictureBase.h" #include "libs/PictureUtils.h" #include "libs/Fsvg.h" #include "libs/FRenderInit.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "functions.h" #include "misc.h" #include "screen.h" #include "builtins.h" #include "module_list.h" #include "colorset.h" #include "events.h" #include "eventhandler.h" #include "eventmask.h" #include "icccm2.h" #include "gnome.h" #include "ewmh.h" #include "add_window.h" #include "libs/fvwmsignal.h" #include "stack.h" #include "virtual.h" #include "session.h" #include "read.h" #include "focus.h" #include "update.h" #include "move_resize.h" #include "frame.h" #include "menus.h" #include "menubindings.h" #include "libs/FGettext.h" /* ---------------------------- local definitions -------------------------- */ #define MAXHOSTNAME 255 #define MAX_CFG_CMDS 10 #define MAX_ARG_SIZE 25 #define g_width 2 #define g_height 2 #define l_g_width 4 #define l_g_height 2 #define s_g_width 4 #define s_g_height 4 /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ extern int last_event_type; /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef enum { FVWM_RUNNING = 0, FVWM_DONE, FVWM_RESTART } fvwm_run_state_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static char *config_commands[MAX_CFG_CMDS]; static int num_config_commands=0; /* assorted gray bitmaps for decorative borders */ static char g_bits[] = {0x02, 0x01}; static char l_g_bits[] = {0x08, 0x02}; static char s_g_bits[] = {0x01, 0x02, 0x04, 0x08}; static char *home_dir; static volatile sig_atomic_t fvwmRunState = FVWM_RUNNING; static const char *init_function_names[4] = { "InitFunction", "RestartFunction", "ExitFunction", "Nop" }; /* ---------------------------- exported variables (globals) --------------- */ int master_pid; /* process number of 1st fvwm process */ ScreenInfo Scr; /* structures for the screen */ Display *dpy = NULL; /* which display are we talking to */ Bool fFvwmInStartup = True; /* Set to False when startup has finished */ Bool DoingCommandLine = False; /* Set True before each cmd line arg */ XContext FvwmContext; /* context for fvwm windows */ XContext MenuContext; /* context for fvwm menus */ int JunkX = 0, JunkY = 0; Window JunkRoot, JunkChild; /* junk window */ int JunkWidth, JunkHeight, JunkBW, JunkDepth; unsigned int JunkMask; Bool debugging = False; Bool debugging_stack_ring = False; Window bad_window = None; char **g_argv; int g_argc; char *state_filename = NULL; char *restart_state_filename = NULL; /* $HOME/.fs-restart */ Bool Restarting = False; int x_fd; char *display_name = NULL; char *fvwm_userdir; char const *Fvwm_VersionInfo; char const *Fvwm_LicenseInfo; char const *Fvwm_SupportInfo; Atom _XA_MIT_PRIORITY_COLORS; Atom _XA_WM_CHANGE_STATE; Atom _XA_WM_STATE; Atom _XA_WM_COLORMAP_WINDOWS; Atom _XA_WM_TAKE_FOCUS; Atom _XA_WM_DELETE_WINDOW; Atom _XA_WM_DESKTOP; Atom _XA_MwmAtom; Atom _XA_MOTIF_WM; Atom _XA_OL_WIN_ATTR; Atom _XA_OL_WT_BASE; Atom _XA_OL_WT_CMD; Atom _XA_OL_WT_HELP; Atom _XA_OL_WT_NOTICE; Atom _XA_OL_WT_OTHER; Atom _XA_OL_DECOR_ADD; Atom _XA_OL_DECOR_DEL; Atom _XA_OL_DECOR_CLOSE; Atom _XA_OL_DECOR_RESIZE; Atom _XA_OL_DECOR_HEADER; Atom _XA_OL_DECOR_ICON_NAME; Atom _XA_WM_WINDOW_ROLE; Atom _XA_WINDOW_ROLE; Atom _XA_WM_CLIENT_LEADER; Atom _XA_SM_CLIENT_ID; Atom _XA_XROOTPMAP_ID; Atom _XA_XSETROOT_ID; /* ---------------------------- local functions ---------------------------- */ static void SaveDesktopState(void) { FvwmWindow *t; unsigned long data[1]; for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { data[0] = (unsigned long) t->Desk; XChangeProperty( dpy, FW_W(t), _XA_WM_DESKTOP, _XA_WM_DESKTOP, 32, PropModeReplace, (unsigned char *)data, 1); } data[0] = (unsigned long) Scr.CurrentDesk; XChangeProperty( dpy, Scr.Root, _XA_WM_DESKTOP, _XA_WM_DESKTOP, 32, PropModeReplace, (unsigned char *) data, 1); XFlush(dpy); return; } static void InternUsefulAtoms (void) { /* Create priority colors if necessary. */ _XA_MIT_PRIORITY_COLORS = XInternAtom( dpy, "_MIT_PRIORITY_COLORS", False); _XA_WM_CHANGE_STATE = XInternAtom(dpy, "WM_CHANGE_STATE", False); _XA_WM_STATE = XInternAtom(dpy, "WM_STATE", False); _XA_WM_COLORMAP_WINDOWS = XInternAtom( dpy, "WM_COLORMAP_WINDOWS", False); _XA_WM_PROTOCOLS = XInternAtom(dpy, "WM_PROTOCOLS", False); _XA_WM_TAKE_FOCUS = XInternAtom(dpy, "WM_TAKE_FOCUS", False); _XA_WM_DELETE_WINDOW = XInternAtom(dpy, "WM_DELETE_WINDOW", False); _XA_WM_DESKTOP = XInternAtom(dpy, "WM_DESKTOP", False); _XA_MwmAtom=XInternAtom(dpy, "_MOTIF_WM_HINTS",False); _XA_MOTIF_WM=XInternAtom(dpy, "_MOTIF_WM_INFO",False); _XA_OL_WIN_ATTR=XInternAtom(dpy, "_OL_WIN_ATTR",False); _XA_OL_WT_BASE=XInternAtom(dpy, "_OL_WT_BASE",False); _XA_OL_WT_CMD=XInternAtom(dpy, "_OL_WT_CMD",False); _XA_OL_WT_HELP=XInternAtom(dpy, "_OL_WT_HELP",False); _XA_OL_WT_NOTICE=XInternAtom(dpy, "_OL_WT_NOTICE",False); _XA_OL_WT_OTHER=XInternAtom(dpy, "_OL_WT_OTHER",False); _XA_OL_DECOR_ADD=XInternAtom(dpy, "_OL_DECOR_ADD",False); _XA_OL_DECOR_DEL=XInternAtom(dpy, "_OL_DECOR_DEL",False); _XA_OL_DECOR_CLOSE=XInternAtom(dpy, "_OL_DECOR_CLOSE",False); _XA_OL_DECOR_RESIZE=XInternAtom(dpy, "_OL_DECOR_RESIZE",False); _XA_OL_DECOR_HEADER=XInternAtom(dpy, "_OL_DECOR_HEADER",False); _XA_OL_DECOR_ICON_NAME=XInternAtom(dpy, "_OL_DECOR_ICON_NAME",False); _XA_WM_WINDOW_ROLE=XInternAtom(dpy, "WM_WINDOW_ROLE",False); _XA_WINDOW_ROLE=XInternAtom(dpy, "WINDOW_ROLE",False); _XA_WM_CLIENT_LEADER=XInternAtom(dpy, "WM_CLIENT_LEADER",False); _XA_SM_CLIENT_ID=XInternAtom(dpy, "SM_CLIENT_ID",False); _XA_XROOTPMAP_ID=XInternAtom(dpy, "_XROOTPMAP_ID",False); _XA_XSETROOT_ID=XInternAtom(dpy, "_XSETROOT_ID",False); return; } /* exit handler that will try to release any grabs */ static void catch_exit(void) { if (dpy != NULL) { /* Don't care if this is called from an X error handler. We * *have* to try this, whatever happens. XFree 4.0 may freeze * if we don't do this. */ XUngrabServer(dpy); XUngrabPointer(dpy, CurrentTime); XUngrabKeyboard(dpy, CurrentTime); } return; } /* * Restart on a signal */ static RETSIGTYPE Restart(int sig) { fvwmRunState = FVWM_RESTART; /* This function might not return - it could "long-jump" * right out, so we need to do everything we need to do * BEFORE we call it ... */ fvwmSetTerminate(sig); SIGNAL_RETURN; } static RETSIGTYPE SigDone(int sig) { fvwmRunState = FVWM_DONE; /* This function might not return - it could "long-jump" * right out, so we need to do everything we need to do * BEFORE we call it ... */ fvwmSetTerminate(sig); SIGNAL_RETURN; } /* * parse_command_args - parses a given command string into a given limited * argument array suitable for execv*. The parsing is similar to shell's. * Returns: * positive number of parsed arguments - on success, * 0 - on empty command (only spaces), * negative - on no command or parsing error. * * Any character can be quoted with a backslash (even inside single quotes). * Every command argument is separated by a space/tab/new-line from both sizes * or is at the start/end of the command. Sequential spaces are ignored. * An argument can be enclosed into single quotes (no further expanding) * or double quotes (expending environmental variables $VAR or ${VAR}). * The character '~' is expanded into user home directory (if not in quotes). * * In the current implementation, parsed arguments are stored in one * large static string pointed by returned argv[0], so they will be lost * on the next function call. This can be changed using dynamic allocation, * in this case the caller must free the string pointed by argv[0]. */ static int parse_command_args( const char *command, char **argv, int max_argc, const char **error_msg) { /* It is impossible to guess the exact length because of expanding */ #define MAX_TOTAL_ARG_LEN 256 /* char *arg_string = safemalloc(MAX_TOTAL_ARG_LEN); */ static char arg_string[MAX_TOTAL_ARG_LEN]; int total_arg_len = 0; int error_code = 0; int argc; char *aptr = arg_string; const char *cptr = command; #define the_char (*cptr) #define adv_char (cptr++) #define top_char (*cptr == '\\' ? *(cptr + 1) : *cptr) #define pop_char (*(cptr++) == '\\' ? *(cptr++) : *(cptr - 1)) #define can_add_arg_char (total_arg_len < MAX_TOTAL_ARG_LEN-1) #define add_arg_char(ch) (++total_arg_len, *(aptr++) = ch) #define can_add_arg_str(str) (total_arg_len < MAX_TOTAL_ARG_LEN - strlen(str)) #define add_arg_str(str) \ {\ const char *tmp = str;\ while (*tmp)\ {\ add_arg_char(*(tmp++));\ }\ } *error_msg = ""; if (!command) { *error_msg = "No command"; return -1; } for (argc = 0; argc < max_argc - 1; argc++) { int s_quote = 0; argv[argc] = aptr; while (isspace(the_char)) { adv_char; } if (the_char == '\0') { break; } while ((s_quote || !isspace(the_char)) && the_char != '\0' && can_add_arg_char) { if (the_char == '"') { if (s_quote) { s_quote = 0; } else { s_quote = 1; } adv_char; } else if (!s_quote && the_char == '\'') { adv_char; while (the_char != '\'' && the_char != '\0' && can_add_arg_char) { add_arg_char(pop_char); } if (the_char == '\'') { adv_char; } else if (!can_add_arg_char) { break; } else { *error_msg = "No closing single quote"; error_code = -3; break; } } else if (!s_quote && the_char == '~') { if (!can_add_arg_str(home_dir)) { break; } add_arg_str(home_dir); adv_char; } else if (the_char == '$') { int beg, len; const char *str = getFirstEnv(cptr, &beg, &len); if (!str || beg) { add_arg_char(the_char); adv_char; continue; } if (!can_add_arg_str(str)) { break; } add_arg_str(str); cptr += len; } else { if (add_arg_char(pop_char) == '\0') { break; } } } if (*(aptr-1) == '\0') { *error_msg = "Unexpected last backslash"; error_code = -2; break; } if (error_code) { break; } if (the_char == '~' || the_char == '$' || !can_add_arg_char) { *error_msg = "The command is too long"; error_code = -argc - 100; break; } if (s_quote) { *error_msg = "No closing double quote"; error_code = -4; break; } add_arg_char('\0'); } #undef the_char #undef adv_char #undef top_char #undef pop_char #undef can_add_arg_char #undef add_arg_char #undef can_add_arg_str #undef add_arg_str argv[argc] = NULL; if (argc == 0 && !error_code) { *error_msg = "Void command"; } return error_code ? error_code : argc; } /* * */ static char *get_display_name(char *display_name, int screen_num) { char *msg; char *new_dn; char *cp; char string_screen_num[32]; CopyString(&msg, display_name); cp = strchr(msg, ':'); if (cp != NULL) { cp = strchr(cp, '.'); if (cp != NULL) { /* truncate at display part */ *cp = '\0'; } } sprintf(string_screen_num, ".%d", screen_num); new_dn = safemalloc( strlen(msg) + strlen(string_screen_num) + 1); new_dn[0] = '\0'; strcat(new_dn, msg); strcat(new_dn, string_screen_num); free(msg); return new_dn; } /* * * Procedure: * Done - tells fvwm to clean up and exit * */ /* if restart is true, command must not be NULL... */ void Done(int restart, char *command) { const char *exit_func_name; if (!restart) { MoveViewport(0,0,False); } /* migo (03/Jul/1999): execute [Session]ExitFunction */ exit_func_name = get_init_function_name(2); if (functions_is_complex_function(exit_func_name)) { const exec_context_t *exc; exec_context_changes_t ecc; char *action = safestrdup( CatString2("Function ", exit_func_name)); ecc.type = restart ? EXCT_TORESTART : EXCT_QUIT; ecc.w.wcontext = C_ROOT; exc = exc_create_context(&ecc, ECC_TYPE | ECC_WCONTEXT); execute_function(NULL, exc, action, 0); exc_destroy_context(exc); free(action); } /* XFree freeze hack */ XUngrabPointer(dpy, CurrentTime); XUngrabKeyboard(dpy, CurrentTime); XUngrabServer(dpy); if (!restart) { Reborder(); } EWMH_ExitStuff(); if (restart) { Bool do_preserve_state = True; SaveDesktopState(); if (command) { while (isspace(command[0])) { command++; } if (strncmp(command, "--dont-preserve-state", 21) == 0) { do_preserve_state = False; command += 21; while (isspace(command[0])) command++; } } if (command[0] == '\0') { command = NULL; /* native restart */ } /* won't return under SM on Restart without parameters */ RestartInSession( restart_state_filename, command == NULL, do_preserve_state); /* RBW - 06/08/1999 - without this, windows will wander to * other pages on a Restart/Recapture because Restart gets the * window position information out of sync. There may be a * better way to do this (i.e., adjust the Restart code), but * this works for now. */ MoveViewport(0,0,False); Reborder(); /* Really make sure that the connection is closed and cleared! */ CloseICCCM2(); catch_exit(); XCloseDisplay(dpy); dpy = NULL; /* really need to destroy all windows, explicitly, not sleep, * but this is adequate for now */ sleep(1); if (command) { char *my_argv[MAX_ARG_SIZE]; const char *error_msg; int n = parse_command_args( command, my_argv, MAX_ARG_SIZE, &error_msg); if (n <= 0) { fvwm_msg( ERR, "Done", "Restart command parsing error in" " (%s): [%s]", command, error_msg); } else if (strcmp(my_argv[0], "--pass-args") == 0) { if (n != 2) { fvwm_msg( ERR, "Done", "Restart --pass-args: single" " name expected. (restarting" " '%s' instead)", g_argv[0]); } else { int i; my_argv[0] = my_argv[1]; for (i = 1; i < g_argc && i < MAX_ARG_SIZE - 1; i++) { my_argv[i] = g_argv[i]; } my_argv[i] = NULL; execvp(my_argv[0], my_argv); fvwm_msg( ERR, "Done", "Call of '%s' failed!" " (restarting '%s' instead)", my_argv[0], g_argv[0]); perror(" system error description"); } } else { char *str = NULL; /* Warn against an old 'Restart fvwm2' usage */ if (n == 1 && strcmp(my_argv[0], "fvwm2") == 0) { str = "fvwm2"; } /* If we are at it, warn against a 'Restart * fvwm' usage as well */ else if (n == 1 && strcmp(my_argv[0], "fvwm") == 0) { str = "fvwm"; } if (str) { fvwm_msg( WARN, "Done", "`Restart %s' might not do" " what you want, see the man" " page.\n\tUse Restart without" " parameters if you mean to" " restart the same WM.", str); } execvp(my_argv[0], my_argv); fvwm_msg( ERR, "Done", "Call of '%s' failed!" " (restarting '%s' instead)", my_argv[0], g_argv[0]); perror(" system error description"); } } execvp(g_argv[0], g_argv); /* that _should_ work */ fvwm_msg(ERR, "Done", "Call of '%s' failed!", g_argv[0]); perror(" system error description"); } else { CloseICCCM2(); catch_exit(); XCloseDisplay(dpy); dpy = NULL; } /* dv (15-Jan-2000): This must be done after calling CloseICCCM2()! * Otherwise fvwm ignores map requests while it still has * SubstructureRedirect selected on the root window ==> windows end up * in nirvana. This explicitly happened with windows unswallowed by * FvwmButtons. */ module_kill_all(); exit(0); } /*********************************************************************** * * Procedure: * InstallSignals: install the signal handlers, using whatever * means we have at our disposal. The more POSIXy, the better * ************************************************************************/ static void InstallSignals(void) { #ifdef HAVE_SIGACTION struct sigaction sigact; /* * All signals whose handlers call fvwmSetTerminate() * must be mutually exclusive - we mustn't receive one * while processing any of the others ... */ sigemptyset(&sigact.sa_mask); sigaddset(&sigact.sa_mask, SIGINT); sigaddset(&sigact.sa_mask, SIGHUP); sigaddset(&sigact.sa_mask, SIGQUIT); sigaddset(&sigact.sa_mask, SIGTERM); sigaddset(&sigact.sa_mask, SIGUSR1); #ifdef SA_RESTART sigact.sa_flags = SA_RESTART; #else sigact.sa_flags = 0; #endif sigact.sa_handler = DeadPipe; sigaction(SIGPIPE, &sigact, NULL); sigact.sa_handler = Restart; sigaction(SIGUSR1, &sigact, NULL); sigact.sa_handler = SigDone; sigaction(SIGINT, &sigact, NULL); sigaction(SIGHUP, &sigact, NULL); sigaction(SIGQUIT, &sigact, NULL); sigaction(SIGTERM, &sigact, NULL); /* Unblock these signals so that we can process them again. */ sigprocmask(SIG_UNBLOCK, &sigact.sa_mask, NULL); /* Reap all zombies automatically! This signal handler will only be * called if a child process dies, not if someone sends a child a STOP * signal. Note that none of our "terminate" signals can be delivered * until the SIGCHLD handler completes, and this is a Good Thing * because the terminate handlers might exit abruptly via "siglongjmp". * This could potentially leave SIGCHLD handler with unfinished * business ... * * NOTE: We could still receive SIGPIPE signals within the SIGCHLD * handler, but the SIGPIPE handler has the SA_RESTART flag set and so * should not affect our "wait" system call. */ sigact.sa_flags |= SA_NOCLDSTOP; sigact.sa_handler = fvwmReapChildren; sigaction(SIGCHLD, &sigact, NULL); #else #ifdef USE_BSD_SIGNALS fvwmSetSignalMask( sigmask(SIGUSR1) | sigmask(SIGINT) | sigmask(SIGHUP) | sigmask(SIGQUIT) | sigmask(SIGTERM) ); #endif /* * We don't have sigaction(), so fall back on * less reliable methods ... */ signal(SIGPIPE, DeadPipe); signal(SIGUSR1, Restart); #ifdef HAVE_SIGINTERRUPT siginterrupt(SIGUSR1, 0); #endif signal(SIGINT, SigDone); #ifdef HAVE_SIGINTERRUPT siginterrupt(SIGINT, 0); #endif signal(SIGHUP, SigDone); #ifdef HAVE_SIGINTERRUPT siginterrupt(SIGHUP, 0); #endif signal(SIGQUIT, SigDone); #ifdef HAVE_SIGINTERRUPT siginterrupt(SIGQUIT, 0); #endif signal(SIGTERM, SigDone); #ifdef HAVE_SIGINTERRUPT siginterrupt(SIGTERM, 0); #endif signal(SIGCHLD, fvwmReapChildren); #ifdef HAVE_SIGINTERRUPT siginterrupt(SIGCHLD, 0); #endif #endif /* When fvwm restarts, the SIGCHLD handler is automatically reset * to the default handler. This means that Zombies left over from * the previous instance of fvwm could still be roaming the process * table if they exited while the default handler was in place. * We fix this by invoking the SIGCHLD handler NOW, so that they * may finally rest in peace. */ fvwmReapChildren(0); return; } void fvmm_deinstall_signals(void) { signal(SIGCHLD, SIG_DFL); signal(SIGHUP, SIG_DFL); signal(SIGINT, SIG_DFL); signal(SIGPIPE, SIG_DFL); signal(SIGQUIT, SIG_DFL); signal(SIGTERM, SIG_DFL); signal(SIGUSR1, SIG_DFL); return; } /*********************************************************************** * * LoadDefaultLeftButton -- loads default left button # into * assumes associated button memory is already free * ************************************************************************/ static void LoadDefaultLeftButton(DecorFace *df, int i) { struct vector_coords *v = &df->u.vector; int j = 0; memset(&df->style, 0, sizeof(df->style)); DFS_FACE_TYPE(df->style) = DefaultVectorButton; switch (i % 5) { case 0: case 4: v->num = 5; v->x = (signed char*)safemalloc(sizeof(char) * v->num); v->y = (signed char*)safemalloc(sizeof(char) * v->num); v->xoff = (signed char*)safemalloc(sizeof(char) * v->num); v->yoff = (signed char*)safemalloc(sizeof(char) * v->num); v->c = (signed char*)safecalloc(v->num, sizeof(char)); v->x[0] = 22; v->y[0] = 39; v->c[0] = 1; v->x[1] = 78; v->y[1] = 39; v->c[1] = 1; v->x[2] = 78; v->y[2] = 61; v->x[3] = 22; v->y[3] = 61; v->x[4] = 22; v->y[4] = 39; v->c[4] = 1; break; case 1: v->num = 5; v->x = (signed char*)safemalloc(sizeof(char) * v->num); v->y = (signed char*)safemalloc(sizeof(char) * v->num); v->xoff = (signed char*)safemalloc(sizeof(char) * v->num); v->yoff = (signed char*)safemalloc(sizeof(char) * v->num); v->c = (signed char*)safecalloc(v->num, sizeof(char)); v->x[0] = 32; v->y[0] = 45; v->x[1] = 68; v->y[1] = 45; v->x[2] = 68; v->y[2] = 55; v->c[2] = 1; v->x[3] = 32; v->y[3] = 55; v->c[3] = 1; v->x[4] = 32; v->y[4] = 45; break; case 2: v->num = 5; v->x = (signed char*)safemalloc(sizeof(char) * v->num); v->y = (signed char*)safemalloc(sizeof(char) * v->num); v->xoff = (signed char*)safemalloc(sizeof(char) * v->num); v->yoff = (signed char*)safemalloc(sizeof(char) * v->num); v->c = (signed char*)safecalloc(v->num, sizeof(char)); v->x[0] = 49; v->y[0] = 49; v->c[0] = 1; v->x[1] = 51; v->y[1] = 49; v->c[1] = 1; v->x[2] = 51; v->y[2] = 51; v->x[3] = 49; v->y[3] = 51; v->x[4] = 49; v->y[4] = 49; v->c[4] = 1; break; case 3: v->num = 5; v->x = (signed char*)safemalloc(sizeof(char) * v->num); v->y = (signed char*)safemalloc(sizeof(char) * v->num); v->xoff = (signed char*)safemalloc(sizeof(char) * v->num); v->yoff = (signed char*)safemalloc(sizeof(char) * v->num); v->c = (signed char*)safecalloc(v->num, sizeof(char)); v->x[0] = 32; v->y[0] = 45; v->c[0] = 1; v->x[1] = 68; v->y[1] = 45; v->c[1] = 1; v->x[2] = 68; v->y[2] = 55; v->x[3] = 32; v->y[3] = 55; v->x[4] = 32; v->y[4] = 45; v->c[4] = 1; break; } /* set offsets to 0, for all buttons */ for(j = 0 ; j < v->num ; j++) { v->xoff[j] = 0; v->yoff[j] = 0; } return; } /*********************************************************************** * * LoadDefaultRightButton -- loads default left button # into * assumes associated button memory is already free * ************************************************************************/ static void LoadDefaultRightButton(DecorFace *df, int i) { struct vector_coords *v = &df->u.vector; int j = 0; memset(&df->style, 0, sizeof(df->style)); DFS_FACE_TYPE(df->style) = DefaultVectorButton; switch (i % 5) { case 0: case 3: v->num = 5; v->x = (signed char*)safemalloc(sizeof(char) * v->num); v->y = (signed char*)safemalloc(sizeof(char) * v->num); v->xoff = (signed char*)safemalloc(sizeof(char) * v->num); v->yoff = (signed char*)safemalloc(sizeof(char) * v->num); v->c = (signed char*)safecalloc(v->num, sizeof(char)); v->x[0] = 25; v->y[0] = 25; v->c[0] = 1; v->x[1] = 75; v->y[1] = 25; v->c[1] = 1; v->x[2] = 75; v->y[2] = 75; v->x[3] = 25; v->y[3] = 75; v->x[4] = 25; v->y[4] = 25; v->c[4] = 1; break; case 1: v->num = 5; v->x = (signed char*)safemalloc(sizeof(char) * v->num); v->y = (signed char*)safemalloc(sizeof(char) * v->num); v->xoff = (signed char*)safemalloc(sizeof(char) * v->num); v->yoff = (signed char*)safemalloc(sizeof(char) * v->num); v->c = (signed char*)safecalloc(v->num, sizeof(char)); v->x[0] = 39; v->y[0] = 39; v->c[0] = 1; v->x[1] = 61; v->y[1] = 39; v->c[1] = 1; v->x[2] = 61; v->y[2] = 61; v->x[3] = 39; v->y[3] = 61; v->x[4] = 39; v->y[4] = 39; v->c[4] = 1; break; case 2: v->num = 5; v->x = (signed char*)safemalloc(sizeof(char) * v->num); v->y = (signed char*)safemalloc(sizeof(char) * v->num); v->xoff = (signed char*)safemalloc(sizeof(char) * v->num); v->yoff = (signed char*)safemalloc(sizeof(char) * v->num); v->c = (signed char*)safecalloc(v->num, sizeof(char)); v->x[0] = 49; v->y[0] = 49; v->c[0] = 1; v->x[1] = 51; v->y[1] = 49; v->c[1] = 1; v->x[2] = 51; v->y[2] = 51; v->x[3] = 49; v->y[3] = 51; v->x[4] = 49; v->y[4] = 49; v->c[4] = 1; break; case 4: v->num = 5; v->x = (signed char*)safemalloc(sizeof(char) * v->num); v->y = (signed char*)safemalloc(sizeof(char) * v->num); v->xoff = (signed char*)safemalloc(sizeof(char) * v->num); v->yoff = (signed char*)safemalloc(sizeof(char) * v->num); v->c = (signed char*)safecalloc(v->num, sizeof(char)); v->x[0] = 36; v->y[0] = 36; v->c[0] = 1; v->x[1] = 64; v->y[1] = 36; v->c[1] = 1; v->x[2] = 64; v->y[2] = 64; v->x[3] = 36; v->y[3] = 64; v->x[4] = 36; v->y[4] = 36; v->c[4] = 1; break; } /* set offsets to 0, for all buttons */ for(j = 0 ; j < v->num ; j++) { v->xoff[j] = 0; v->yoff[j] = 0; } return; } /*********************************************************************** * * Procedure: * CreateGCs - open fonts and create all the needed GC's. I only * want to do this once, hence the first_time flag. * ***********************************************************************/ static void CreateGCs(void) { XGCValues gcv; unsigned long gcm; /* create scratch GC's */ gcm = GCFunction|GCLineWidth; gcv.function = GXcopy; gcv.line_width = 0; Scr.ScratchGC1 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv); Scr.ScratchGC2 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv); Scr.ScratchGC3 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv); Scr.ScratchGC4 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv); Scr.TitleGC = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv); Scr.BordersGC = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv); Scr.TransMaskGC = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv); Scr.ScratchMonoPixmap = XCreatePixmap(dpy, Scr.Root, 1, 1, 1); Scr.MonoGC = fvwmlib_XCreateGC(dpy, Scr.ScratchMonoPixmap, gcm, &gcv); Scr.ScratchAlphaPixmap = XCreatePixmap( dpy, Scr.Root, 1, 1, FRenderGetAlphaDepth()); Scr.AlphaGC = fvwmlib_XCreateGC(dpy, Scr.ScratchAlphaPixmap, gcm, &gcv); return; } /*********************************************************************** * * Procedure: * InitVariables - initialize fvwm variables * ************************************************************************/ static void InitVariables(void) { FvwmContext = XUniqueContext(); MenuContext = XUniqueContext(); /* initialize some lists */ Scr.AllBindings = NULL; Scr.functions = NULL; menus_init(); Scr.last_added_item.type = ADDED_NONE; Scr.DefaultIcon = NULL; Scr.DefaultColorset = -1; Scr.StdGC = 0; Scr.StdReliefGC = 0; Scr.StdShadowGC = 0; Scr.XorGC = 0; /* zero all flags */ memset(&Scr.flags, 0, sizeof(Scr.flags)); /* create graphics contexts */ CreateGCs(); FW_W(&Scr.FvwmRoot) = Scr.Root; Scr.FvwmRoot.next = 0; init_stack_and_layers(); Scr.root_pushes = 0; Scr.fvwm_pushes = 0; Scr.pushed_window = &Scr.FvwmRoot; Scr.FvwmRoot.number_cmap_windows = 0; Scr.FvwmRoot.attr_backup.colormap = Pcmap; Scr.MyDisplayWidth = DisplayWidth(dpy, Scr.screen); Scr.MyDisplayHeight = DisplayHeight(dpy, Scr.screen); Scr.BusyCursor = BUSY_NONE; Scr.Hilite = NULL; Scr.DefaultFont = NULL; Scr.VxMax = 2*Scr.MyDisplayWidth; Scr.VyMax = 2*Scr.MyDisplayHeight; Scr.Vx = 0; Scr.Vy = 0; Scr.SizeWindow = None; /* Sets the current desktop number to zero */ /* Multiple desks are available even in non-virtual * compilations */ Scr.CurrentDesk = 0; Scr.EdgeScrollX = DEFAULT_EDGE_SCROLL * Scr.MyDisplayWidth / 100; Scr.EdgeScrollY = DEFAULT_EDGE_SCROLL * Scr.MyDisplayHeight / 100; Scr.ScrollDelay = DEFAULT_SCROLL_DELAY; Scr.OpaqueSize = DEFAULT_OPAQUE_MOVE_SIZE; Scr.MoveThreshold = DEFAULT_MOVE_THRESHOLD; /* ClickTime is set to the positive value upon entering the * event loop. */ Scr.ClickTime = -DEFAULT_CLICKTIME; Scr.ColormapFocus = COLORMAP_FOLLOWS_MOUSE; /* set major operating modes */ Scr.NumBoxes = 0; Scr.cascade_x = 0; Scr.cascade_y = 0; /* the last Cascade placed window or NULL, we don't want NULL * initially */ Scr.cascade_window = &Scr.FvwmRoot; Scr.buttons2grab = 0; /* initialisation of the head of the desktops info */ Scr.Desktops = (DesktopsInfo *)safemalloc(sizeof(DesktopsInfo)); Scr.Desktops->name = NULL; Scr.Desktops->desk = 0; /* not desk 0 */ Scr.Desktops->ewmh_dyn_working_area.x = Scr.Desktops->ewmh_working_area.x = 0; Scr.Desktops->ewmh_dyn_working_area.y = Scr.Desktops->ewmh_working_area.y = 0; Scr.Desktops->ewmh_dyn_working_area.width = Scr.Desktops->ewmh_working_area.width = Scr.MyDisplayWidth; Scr.Desktops->ewmh_dyn_working_area.height = Scr.Desktops->ewmh_working_area.height = Scr.MyDisplayHeight; Scr.Desktops->next = NULL; /* ewmh desktop */ Scr.EwmhDesktop = NULL; InitFvwmDecor(&Scr.DefaultDecor); #ifdef USEDECOR Scr.DefaultDecor.tag = "Default"; #endif /* Initialize RaiseHackNeeded by identifying X servers possibly running under NT. This is probably not an ideal solution, since eg NCD also produces X servers which do not run under NT. "Hummingbird Communications Ltd." is the ServerVendor string of the Exceed X server under NT, "Network Computing Devices Inc." is the ServerVendor string of the PCXware X server under Windows. "WRQ, Inc." is the ServerVendor string of the Reflection X server under Windows. */ Scr.bo.is_raise_hack_needed = (strcmp ( ServerVendor (dpy), "Hummingbird Communications Ltd.") == 0) || (strcmp ( ServerVendor (dpy), "Network Computing Devices Inc.") == 0) || (strcmp (ServerVendor (dpy), "WRQ, Inc.") == 0); Scr.bo.is_modality_evil = 0; Scr.bo.do_disable_configure_notify = 0; Scr.bo.do_install_root_cmap = 0; Scr.bo.do_enable_flickering_qt_dialogs_workaround = 1; Scr.bo.do_enable_qt_drag_n_drop_workaround = 0; Scr.bo.do_enable_ewmh_iconic_state_workaround = 0; Scr.gs.do_emulate_mwm = DEFAULT_EMULATE_MWM; Scr.gs.do_emulate_win = DEFAULT_EMULATE_WIN; Scr.gs.use_active_down_buttons = DEFAULT_USE_ACTIVE_DOWN_BUTTONS; Scr.gs.use_inactive_buttons = DEFAULT_USE_INACTIVE_BUTTONS; Scr.gs.use_inactive_down_buttons = DEFAULT_USE_INACTIVE_DOWN_BUTTONS; /* Not the right place for this, should only be called once * somewhere .. */ /* EdgeCommands - no edge commands by default */ Scr.PanFrameTop.command = NULL; Scr.PanFrameBottom.command = NULL; Scr.PanFrameRight.command = NULL; Scr.PanFrameLeft.command = NULL; /* EdgeLeaveCommands - no edge leave commands by default */ Scr.PanFrameTop.command_leave = NULL; Scr.PanFrameBottom.command_leave = NULL; Scr.PanFrameRight.command_leave = NULL; Scr.PanFrameLeft.command_leave = NULL; Scr.flags.is_pointer_on_this_screen = !!FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &JunkX, &JunkY, &JunkX, &JunkY, &JunkMask); /* make sure colorset 0 exists */ alloc_colorset(0); return; } static void usage(int is_verbose) { fprintf(stderr, "usage: %s", g_argv[0]); fprintf(stderr, " [-d display]" " [-f cfgfile]" " [-c cmd]" " [-s [screen_num]]" " [-I vis-id | -C vis-class]" " [-l colors" " [-L|A|S|P] ...]" " [-r]" " [OTHER OPTIONS] ..." "\n"); if (!is_verbose) { fprintf( stderr, "Try '%s --help' for more information.\n", g_argv[0]); return; } fprintf(stderr, " -A: allocate palette\n" " -c cmd: preprocess configuration file with \n" " -C vis-class: use visual class \n" " -d display: run fvwm on \n" " -D: enable debug oputput\n" " -f cfgfile: read configuration from \n" " -F file: used internally for session management\n" " -h, -?: print this help message\n" " -i client-id: used internally for session management\n" " -I vis-id: use visual \n" " -l colors: try to use no more than colors\n" " -L: strict color limit\n" " -P: visual palette\n" " -r: replace running window manager\n" " -s [screen]: manage a single screen\n" " -S: static palette\n" " -V: print version information\n" ); fprintf( stderr, "Try 'man %s' for more information.\n", PACKAGE); return; } static void setVersionInfo(void) { char version_str[256]; char license_str[512]; char support_str[512] = ""; int support_len; /* Set version information string */ sprintf(version_str, "fvwm %s%s compiled on %s at %s", VERSION, VERSIONINFO, __DATE__, __TIME__); Fvwm_VersionInfo = safestrdup(version_str); sprintf(license_str, "fvwm comes with NO WARRANTY, to the extent permitted by law. " "You may\nredistribute copies of fvwm under " "the terms of the GNU General Public License.\n" "For more information about these matters, see the file " "named COPYING."); Fvwm_LicenseInfo = safestrdup(license_str); #ifdef HAVE_READLINE strcat(support_str, " ReadLine,"); #endif #ifdef HAVE_RPLAY strcat(support_str, " RPlay,"); #endif #ifdef HAVE_STROKE strcat(support_str, " Stroke,"); #endif #ifdef XPM strcat(support_str, " XPM,"); #endif #ifdef HAVE_PNG strcat(support_str, " PNG,"); #endif #ifdef HAVE_RSVG strcat(support_str, " SVG,"); #endif if (FHaveShapeExtension) strcat(support_str, " Shape,"); #ifdef HAVE_XSHM strcat(support_str, " XShm,"); #endif #ifdef SESSION strcat(support_str, " SM,"); #endif #ifdef HAVE_BIDI strcat(support_str, " Bidi text,"); #endif #ifdef HAVE_XINERAMA strcat(support_str, " Xinerama,"); #endif #ifdef HAVE_XRENDER strcat(support_str, " XRender,"); #endif #ifdef HAVE_XCURSOR strcat(support_str, " XCursor,"); #endif #ifdef HAVE_XFT strcat(support_str, " XFT,"); #endif #ifdef HAVE_NLS strcat(support_str, " NLS,"); #endif support_len = strlen(support_str); if (support_len > 0) { /* strip last comma */ support_str[support_len - 1] = '\0'; Fvwm_SupportInfo = safestrdup( CatString2("with support for:", support_str)); } else { Fvwm_SupportInfo = "with no optional feature support"; } return; } /* Sets some initial style values & such */ static void SetRCDefaults(void) { #define RC_DEFAULTS_COMPLETE ((char *)-1) int i; /* set up default colors, fonts, etc */ const char *defaults[][3] = { { "XORValue 0", "", "" }, { "DefaultFont", "", "" }, { "DefaultColors black grey", "", "" }, { DEFAULT_MENU_STYLE, "", "" }, { "TitleStyle Centered -- Raised", "", "" }, { "Style * Color lightgrey/dimgrey", "", "" }, { "Style * HilightFore black, HilightBack grey", "", "" }, { "DestroyFunc FvwmMakeMissingDesktopMenu", "", "" }, { "AddToFunc FvwmMakeMissingDesktopMenu I PipeRead 'fvwm-menu-desktop --enable-mini-icons --fvwm-icons'", "", "" }, { "AddToMenu MenuFvwmRoot \"", _("Builtin Menu"), "\" Title" }, { "+ MissingSubmenuFunction FvwmMakeMissingDesktopMenu","",""}, { "+ \"&1. XTerm\" Exec xterm", "", ""}, { "+ \"&2. ", _("Setup Form"), "\" Module FvwmForm FvwmForm-Setup" }, { "+ \"&3. ", _("Setup 95 Script"), "\" Module FvwmScript FvwmScript-Setup95" }, { "+ \"&4. ", _("Issue fvwm commands"), "\" Module FvwmConsole" }, { "+ \"&D. ", _("Desktop Menu"), "\" Popup FvwmMenu" }, { "+ \"&R. ", _("Restart fvwm"), "\" Restart" }, { "+ \"&X. ", _("Exit fvwm"), "\" Quit" }, { "Mouse 1 R A Menu MenuFvwmRoot", "", "" }, /* default menu navigation */ { "Key Escape M A MenuClose", "", "" }, { "Key Return M A MenuSelectItem", "", "" }, { "Key Left M A MenuCursorLeft", "", "" }, { "Key Right M A MenuCursorRight", "", "" }, { "Key Up M A MenuMoveCursor -1", "", "" }, { "Key Down M A MenuMoveCursor 1", "", "" }, { "Mouse 1 MI A MenuSelectItem", "", "" }, /* don't add anything below */ { RC_DEFAULTS_COMPLETE, "", "" }, { "Read "FVWM_DATADIR"/ConfigFvwmDefaults", "", "" }, { NULL, NULL, NULL } }; for (i = 0; defaults[i][0] != NULL; i++) { const exec_context_t *exc; exec_context_changes_t ecc; char *cmd; if (defaults[i][0] == RC_DEFAULTS_COMPLETE) { menu_bindings_startup_complete(); continue; } ecc.type = Restarting ? EXCT_RESTART : EXCT_INIT; ecc.w.wcontext = C_ROOT; exc = exc_create_context(&ecc, ECC_TYPE | ECC_WCONTEXT); cmd = CatString3( defaults[i][0], defaults[i][1], defaults[i][2]); execute_function(NULL, exc, cmd, 0); exc_destroy_context(exc); } #undef RC_DEFAULTS_COMPLETE return; } static int CatchRedirectError(Display *dpy, XErrorEvent *event) { fvwm_msg(ERR, "CatchRedirectError", "another WM is running"); exit(1); /* to make insure happy */ return 0; } /* CatchFatal - Shuts down if the server connection is lost */ static int CatchFatal(Display *dpy) { /* No action is taken because usually this action is caused by someone using "xlogout" to be able to switch between multiple window managers */ module_kill_all(); exit(1); /* to make insure happy */ return 0; } /* FvwmErrorHandler - displays info on internal errors */ static int FvwmErrorHandler(Display *dpy, XErrorEvent *event) { if (event->error_code == BadWindow) { bad_window = event->resourceid; return 0; } /* some errors are acceptable, mostly they're caused by * trying to update a lost window or free'ing another modules colors */ if (event->error_code == BadWindow || event->request_code == X_GetGeometry || event->error_code == BadDrawable || event->request_code == X_ConfigureWindow || event->request_code == X_SetInputFocus|| event->request_code == X_GrabButton || event->request_code == X_ChangeWindowAttributes || event->request_code == X_InstallColormap || event->request_code == X_FreePixmap || event->request_code == X_FreeColors) { return 0; } fvwm_msg(ERR, "FvwmErrorHandler", "*** internal error ***"); fvwm_msg(ERR, "FvwmErrorHandler", "Request %d, Error %d, EventType: %d", event->request_code, event->error_code, last_event_type); return 0; } /* ---------------------------- interface functions ------------------------ */ /* Does initial window captures and runs init/restart function */ void StartupStuff(void) { #define start_func_name "StartFunction" const char *init_func_name; const exec_context_t *exc; exec_context_changes_t ecc; ecc.type = Restarting ? EXCT_RESTART : EXCT_INIT; ecc.w.wcontext = C_ROOT; exc = exc_create_context(&ecc, ECC_TYPE | ECC_WCONTEXT); CaptureAllWindows(exc, False); /* Turn off the SM stuff after the initial capture so that new windows * will not be matched by accident. */ if (Restarting) { DisableRestoringState(); } /* Have to do this here too because preprocessor modules have not run * to the end when HandleEvents is entered from the main loop. */ checkPanFrames(); fFvwmInStartup = False; /* Make sure the geometry window uses the current font */ resize_geometry_window(); /* Make sure we have the correct click time now. */ if (Scr.ClickTime < 0) { Scr.ClickTime = -Scr.ClickTime; } # if 0 /* It is safe to ungrab here: if not, and one of the init functions * does not finish, we've got a complete freeze! */ /* DV (15-Jul-2004): No, it is not safe to ungrab. If another * application grabs the pointer before execute_function gets it, the * start functions are not executed. And the pointer is grabbed * during function execution anyway, so releasing it here buys us * nothing. */ UngrabEm(GRAB_STARTUP); XUngrabPointer(dpy, CurrentTime); #endif /* migo (04-Sep-1999): execute StartFunction */ if (functions_is_complex_function(start_func_name)) { char *action = "Function " start_func_name; execute_function(NULL, exc, action, 0); } /* migo (03-Jul-1999): execute [Session]{Init|Restart}Function */ init_func_name = get_init_function_name(Restarting == True); if (functions_is_complex_function(init_func_name)) { char *action = safestrdup( CatString2("Function ", init_func_name)); execute_function(NULL, exc, action, 0); free(action); } /* see comment above */ UngrabEm(GRAB_STARTUP); XUngrabPointer(dpy, CurrentTime); /* This should be done after the initialization is finished, since * it directly changes the global state. */ LoadGlobalState(state_filename); /* ** migo (20-Jun-1999): Remove state file after usage. ** migo (09-Jul-1999): but only on restart, otherwise it can be reused. */ if (Restarting) { unlink(state_filename); } exc_destroy_context(exc); /* TA: 20091212: If we get here, we're done restarting, so reset the * flag back to False! */ Restarting = False; return; } /*********************************************************************** * * LoadDefaultButton -- loads default button # into button structure * assumes associated button memory is already free * ************************************************************************/ void LoadDefaultButton(DecorFace *df, int i) { if (i & 1) { LoadDefaultRightButton(df, i / 2); } else { LoadDefaultLeftButton(df, i / 2); } return; } /*********************************************************************** * * ResetOrDestroyAllButtons -- resets all buttons to defaults * destroys existing buttons * ************************************************************************/ void DestroyAllButtons(FvwmDecor *decor) { TitleButton *tbp; DecorFace *face; int i; int j; for (tbp = decor->buttons, i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++, tbp++) { for (j = 0, face = TB_STATE(*tbp); j < BS_MaxButtonState; j++, face++) { FreeDecorFace(dpy, face); } } return; } void ResetAllButtons(FvwmDecor *decor) { TitleButton *tbp; DecorFace *face; int i; int j; DestroyAllButtons(decor); for (tbp = decor->buttons, i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++, tbp++) { memset(&TB_FLAGS(*tbp), 0, sizeof(TB_FLAGS(*tbp))); TB_JUSTIFICATION(*tbp) = JUST_CENTER; for (face = TB_STATE(*tbp), j = 0; j < BS_MaxButtonState; j++, face++) { LoadDefaultButton(face, i); } } /* standard MWM decoration hint assignments (veliaa@rpi.edu) [Menu] - Title Bar - [Minimize] [Maximize] */ TB_MWM_DECOR_FLAGS(decor->buttons[0]) |= MWM_DECOR_MENU; TB_MWM_DECOR_FLAGS(decor->buttons[1]) |= MWM_DECOR_MAXIMIZE; TB_MWM_DECOR_FLAGS(decor->buttons[3]) |= MWM_DECOR_MINIMIZE; return; } void SetMWM_INFO(Window window) { struct mwminfo { long props[2]; /* prop[0]: flags */ /* prop[1]: win */ } motif_wm_info; static char set_yorn='n'; if (set_yorn=='y') { return; } if (Scr.bo.is_modality_evil) { /* Set Motif WM_INFO atom to make motif relinquish * broken handling of modal dialogs */ motif_wm_info.props[0] = 2; motif_wm_info.props[1] = window; XChangeProperty( dpy,Scr.Root, _XA_MOTIF_WM, _XA_MOTIF_WM,32, PropModeReplace, (unsigned char *)&motif_wm_info, 2); set_yorn='y'; } return; } /* * set_init_function_name - sets one of the init, restart or exit function names * get_init_function_name - gets one of the init, restart or exit function names * * First parameter defines a function type: 0 - init, 1 - restart, 2 - exit. */ void set_init_function_name(int n, const char *name) { init_function_names[n >= 0 && n < 3? n: 3] = name; return; } const char *get_init_function_name(int n) { return init_function_names[n >= 0 && n < 3? n: 3]; } #ifndef _PATH_DEVNULL # define _PATH_DEVNULL "/dev/null" #endif static void reopen_fd(int fd, char* mode, FILE *of) { struct stat sbuf; FILE *f; int rc; errno = 0; rc = fstat(fd, &sbuf); if (rc == 0) { return; } else if (errno != EBADF) { exit(77); } f = freopen(_PATH_DEVNULL, mode, of); if (f == 0 || fileno(f) != fd) { exit(88); } return; } /*********************************************************************** * * Procedure: * main - start of fvwm * ***********************************************************************/ int main(int argc, char **argv) { unsigned long valuemask; XSetWindowAttributes attributes; int i; int len; char *display_string; Bool do_force_single_screen = False; int single_screen_num = -1; Bool replace_wm = False; int visualClass = -1; int visualId = -1; PictureColorLimitOption colorLimitop = {-1, -1, -1, -1, -1}; const exec_context_t *exc; exec_context_changes_t ecc; DBUG("main", "Entered, about to parse args"); fvwmlib_init_max_fd(); /* close open fds */ for (i = 3; i < fvwmlib_max_fd; i++) { close(i); } /* reopen stdin, stdout and stderr if necessary */ reopen_fd(0, "rb", stdin); reopen_fd(1, "wb", stdout); reopen_fd(2, "wb", stderr); memset(&Scr, 0, sizeof(Scr)); /* for use on restart */ g_argv = (char **)safemalloc((argc + 4) * sizeof(char *)); g_argc = argc; for (i = 0; i < argc; i++) { g_argv[i] = argv[i]; } g_argv[g_argc] = NULL; FlocaleInit(LC_CTYPE, "", "", "fvwm"); FGettextInit("fvwm", LOCALEDIR, "fvwm"); setVersionInfo(); /* Put the default module directory into the environment so it can be * used later by the config file, etc. */ flib_putenv("FVWM_MODULEDIR", "FVWM_MODULEDIR=" FVWM_MODULEDIR); /* Figure out user's home directory */ home_dir = getenv("HOME"); #ifdef HAVE_GETPWUID if (home_dir == NULL) { struct passwd* pw = getpwuid(getuid()); if (pw != NULL) { home_dir = safestrdup(pw->pw_dir); } } #endif if (home_dir == NULL) { home_dir = "/"; /* give up and use root dir */ } /* Figure out where to read and write user's data files. */ fvwm_userdir = getenv("FVWM_USERDIR"); if (fvwm_userdir == NULL) { char *s; fvwm_userdir = safestrdup(CatString2(home_dir, "/.fvwm")); /* Put the user directory into the environment so it can be used * later everywhere. */ s = safestrdup(CatString2("FVWM_USERDIR=", fvwm_userdir)); flib_putenv("FVWM_USERDIR", s); free(s); } /* Create FVWM_USERDIR directory if needed */ if (access(fvwm_userdir, F_OK) != 0) { mkdir(fvwm_userdir, 0777); } if (access(fvwm_userdir, W_OK) != 0) { fvwm_msg( ERR, "main", "No write permissions in `%s/'.\n", fvwm_userdir); } for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-debug_stack_ring") == 0 || strcmp(argv[i], "--debug-stack-ring") == 0) { debugging_stack_ring = True; } else if (strcmp(argv[i], "-D") == 0 || strcmp(argv[i], "-debug") == 0 || strcmp(argv[i], "--debug") == 0) { debugging = True; } else if (strcmp(argv[i], "-i") == 0 || strcmp(argv[i], "-clientid") == 0 || strcmp(argv[i], "--clientid") == 0 || strcmp(argv[i], "-clientId") == 0 || strcmp(argv[i], "--clientId") == 0) { if (++i >= argc) { usage(0); exit(1); } SetClientID(argv[i]); } else if (strcmp(argv[i], "-F") == 0 || strcmp(argv[i], "-restore") == 0 || strcmp(argv[i], "--restore") == 0) { if (++i >= argc) { usage(0); exit(1); } state_filename = argv[i]; } else if (strcmp(argv[i], "-s") == 0 || strcmp(argv[i], "-single-screen") == 0 || strcmp(argv[i], "--single-screen") == 0) { do_force_single_screen = True; if (i+1 < argc && argv[i+1][0] != '-') { i++; if (sscanf(argv[i], "%d", &single_screen_num) == 0) { usage(0); exit(1); } } } else if (strcmp(argv[i], "-d") == 0 || strcmp(argv[i], "-display") == 0 || strcmp(argv[i], "--display") == 0) { if (++i >= argc) { usage(0); exit(1); } display_name = argv[i]; } else if (strcmp(argv[i], "-f") == 0) { if (++i >= argc) { usage(0); exit(1); } if (num_config_commands < MAX_CFG_CMDS) { config_commands[num_config_commands] = (char *)malloc(6+strlen(argv[i])); strcpy(config_commands[num_config_commands], "Read "); strcat(config_commands[num_config_commands], argv[i]); num_config_commands++; } else { fvwm_msg( ERR, "main", "only %d -f and -cmd parms allowed!", MAX_CFG_CMDS); } } else if (strcmp(argv[i], "-c") == 0 || strcmp(argv[i], "-cmd") == 0 || strcmp(argv[i], "--cmd") == 0) { if (++i >= argc) { usage(0); exit(1); } if (num_config_commands < MAX_CFG_CMDS) { config_commands[num_config_commands] = safestrdup(argv[i]); num_config_commands++; } else { fvwm_msg( ERR, "main", "only %d -f and -cmd parms allowed!", MAX_CFG_CMDS); } } else if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "-?") == 0 || strcmp(argv[i], "--help") == 0) { usage(1); exit(0); } else if (strcmp(argv[i], "-blackout") == 0) { /* obsolete option */ fvwm_msg( WARN, "main", "The -blackout option is obsolete, it will be " "removed in 3.0."); } else if (strcmp(argv[i], "-r") == 0 || strcmp(argv[i], "-replace") == 0 || strcmp(argv[i], "--replace") == 0) { replace_wm = True; } /* check for visualId before visual to remove ambiguity */ else if (strcmp(argv[i], "-I") == 0 || strcmp(argv[i], "-visualid") == 0 || strcmp(argv[i], "--visualid") == 0 || strcmp(argv[i], "-visualId") == 0 || strcmp(argv[i], "--visualId") == 0) { visualClass = -1; if (++i >= argc) { usage(0); exit(1); } if (sscanf(argv[i], "0x%x", &visualId) == 0) { if (sscanf(argv[i], "%d", &visualId) == 0) { usage(0); exit(1); } } } else if (strcmp(argv[i], "-C") == 0 || strcmp(argv[i], "-visual") == 0 || strcmp(argv[i], "--visual") == 0) { visualId = None; if (++i >= argc) { usage(0); exit(1); } if (strncasecmp(argv[i], "staticg", 7) == 0) { visualClass = StaticGray; } else if (strncasecmp(argv[i], "g", 1) == 0) { visualClass = GrayScale; } else if (strncasecmp(argv[i], "staticc", 7) == 0) { visualClass = StaticColor; } else if (strncasecmp(argv[i], "p", 1) == 0) { visualClass = PseudoColor; } else if (strncasecmp(argv[i], "t", 1) == 0) { visualClass = TrueColor; } else if (strncasecmp(argv[i], "d", 1) == 0) { visualClass = DirectColor; } else { usage(0); exit(1); } } else if (strcmp(argv[i], "-l") == 0 || strcmp(argv[i], "-color-limit") == 0 || strcmp(argv[i], "--color-limit") == 0) { if (++i >= argc) { usage(0); exit(1); } colorLimitop.color_limit = atoi(argv[i]); } else if (strcmp(argv[i], "-L") == 0 || strcmp(argv[i], "-strict-color-limit") == 0 || strcmp(argv[i], "--strict-color-limit") == 0) { colorLimitop.strict = True; } else if (strcmp(argv[i], "-A") == 0 || strcmp(argv[i], "-allocate-palette") == 0 || strcmp(argv[i], "--allocate-palette") == 0) { colorLimitop.allocate = True; } else if (strcmp(argv[i], "-S") == 0 || strcmp(argv[i], "-static-palette") == 0 || strcmp(argv[i], "--static-palette") == 0) { colorLimitop.not_dynamic = True; } else if (strcmp(argv[i], "-P") == 0 || strcmp(argv[i], "-visual-palette") == 0 || strcmp(argv[i], "--visual-palette") == 0) { colorLimitop.use_named_table = True; } else if (strcmp(argv[i], "-V") == 0 || strcmp(argv[i], "-version") == 0 || strcmp(argv[i], "--version") == 0) { printf("%s\n%s\n\n%s\n", Fvwm_VersionInfo, Fvwm_SupportInfo, Fvwm_LicenseInfo); exit(0); } else { usage(0); fprintf(stderr, "invalid option -- %s\n", argv[i]); exit(1); } } DBUG("main", "Done parsing args"); DBUG("main", "Installing signal handlers"); InstallSignals(); if (single_screen_num >= 0) { char *dn = NULL; if (display_name) { dn = display_name; } if (!dn) { dn = getenv("DISPLAY"); } if (!dn) { /* should never happen ? */ if (!(dpy = XOpenDisplay(dn))) { fvwm_msg( ERR, "main", "can't open display %s" "to get the default display", XDisplayName(dn)); } else { dn = XDisplayString(dpy); } } if (dn == NULL) { fvwm_msg( ERR, "main", "couldn't find default display (%s)", XDisplayName(dn)); } else { char *new_dn; new_dn = get_display_name(dn, single_screen_num); if (dpy && strcmp(new_dn, dn) == 0) { /* allready opened */ Pdpy = dpy; } else if (dpy) { XCloseDisplay(dpy); dpy = NULL; } if (!dpy && !(Pdpy = dpy = XOpenDisplay(new_dn))) { fvwm_msg( ERR, "main", "can't open display %s, single screen " "number %d maybe not correct", new_dn, single_screen_num); } Scr.screen = single_screen_num; Scr.NumberOfScreens = ScreenCount(dpy); free(new_dn); } } if (!dpy) { if(!(Pdpy = dpy = XOpenDisplay(display_name))) { fvwm_msg( ERR, "main", "can't open display %s", XDisplayName(display_name)); exit (1); } Scr.screen= DefaultScreen(dpy); Scr.NumberOfScreens = ScreenCount(dpy); } atexit(catch_exit); master_pid = getpid(); if (!do_force_single_screen) { int myscreen = 0; char *new_dn; char *dn; dn = XDisplayString(dpy); for (i=0;i Pdepth) { Pvisual = vinfo[i].visual; Pdepth = vinfo[i].depth; } } if (vinfo) { XFree(vinfo); } /* Detection of a card with 2 hardware colormaps (8+24) which * use depth 8 for the default. We can use our own depth 24 * cmap without affecting other applications. */ if (Pdepth == 0 && DefaultDepth(dpy, Scr.screen) <= 8) { template.class = TrueColor; vinfo = XGetVisualInfo( dpy, VisualScreenMask|VisualClassMask, &template, &total); for(i = 0; i 8) { Pvisual = vinfo[i].visual; Pdepth = vinfo[i].depth; } } if (vinfo) { XFree(vinfo); } } /* have to have a colormap for non-default visual windows */ if (Pdepth > 0) { if (Pvisual->class == DirectColor) { Pcmap = XCreateColormap( dpy, Scr.Root, Pvisual, AllocAll); } else { Pcmap = XCreateColormap( dpy, Scr.Root, Pvisual, AllocNone); } } /* use default visuals if none found so far */ else { Pvisual = DefaultVisual(dpy, Scr.screen); Pdepth = DefaultDepth(dpy, Scr.screen); Pcmap = DefaultColormap(dpy, Scr.screen); Pdefault = True; } } PictureSetupWhiteAndBlack(); /* make a copy of the visual stuff so that XorPixmap can swap with root */ PictureSaveFvwmVisual(); Scr.ColorLimit = 0; PUseDynamicColors = 0; Scr.ColorLimit = PictureInitColors( PICTURE_CALLED_BY_FVWM, True, &colorLimitop, True, True); Frsvg_init(); FShapeInit(dpy); FRenderInit(dpy); Scr.pscreen = XScreenOfDisplay(dpy, Scr.screen); Scr.use_backing_store = DoesBackingStore(Scr.pscreen); Scr.flags.do_save_under = DoesSaveUnders(Scr.pscreen); InternUsefulAtoms(); /* Make sure property priority colors is empty */ XChangeProperty(dpy, Scr.Root, _XA_MIT_PRIORITY_COLORS, XA_CARDINAL, 32, PropModeReplace, NULL, 0); Scr.FvwmCursors = CreateCursors(dpy); XDefineCursor(dpy, Scr.Root, Scr.FvwmCursors[CRS_ROOT]); /* create a window which will accept the keyboard focus when no other * windows have it */ /* do this before any RC parsing as some GC's are created from this * window rather than the root window */ attributes.event_mask = XEVMASK_NOFOCUSW; attributes.override_redirect = True; attributes.colormap = Pcmap; attributes.cursor = Scr.FvwmCursors[CRS_DEFAULT]; attributes.background_pixmap = None; attributes.border_pixel = 0; Scr.NoFocusWin=XCreateWindow( dpy, Scr.Root, -10, -10, 10, 10, 0, Pdepth, InputOutput, Pvisual, CWEventMask | CWOverrideRedirect | CWColormap | CWBackPixmap | CWBorderPixel | CWCursor, &attributes); XMapWindow(dpy, Scr.NoFocusWin); SetMWM_INFO(Scr.NoFocusWin); FOCUS_SET(Scr.NoFocusWin); frame_init(); XFlush(dpy); if (debugging) { sync_server(1); } SetupICCCM2(replace_wm); XSetIOErrorHandler(CatchFatal); { /* We need to catch any errors of XSelectInput on the root * window here. The event mask contains * SubstructureRedirectMask which can be acquired by exactly * one client (window manager). Synchronizing is necessary * here because Neither XSetErrorHandler nor XSelectInput * generate any protocol requests. */ XSync(dpy, 0); XSetErrorHandler(CatchRedirectError); XSelectInput(dpy, Scr.Root, XEVMASK_ROOTW); XSync(dpy, 0); XSetErrorHandler(FvwmErrorHandler); } { /* do not grab the pointer earlier because if fvwm exits with * the pointer grabbed while a different display is visible, * XFree 4.0 freezes. */ Cursor cursor = XCreateFontCursor(dpy, XC_watch); XGrabPointer( dpy, Scr.Root, 0, 0, GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime); } { Atom atype; int aformat; unsigned long nitems, bytes_remain; unsigned char *prop; if (XGetWindowProperty( dpy, Scr.Root, _XA_WM_DESKTOP, 0L, 1L, True, _XA_WM_DESKTOP, &atype, &aformat, &nitems, &bytes_remain, &prop) == Success) { if (prop != NULL) { Restarting = True; /* do_force_single_screen = True; */ } } } restart_state_filename = safestrdup( CatString3(fvwm_userdir, "/.fs-restart-", getenv("HOSTDISPLAY"))); if (!state_filename && Restarting) { state_filename = restart_state_filename; } /* This should be done early enough to have the window states loaded * before the first call to AddWindow. */ LoadWindowStates(state_filename); InitVariables(); if (visualClass != -1 || visualId != -1) { /* this is so that menus use the (non-default) fvwm colormap */ FW_W(&Scr.FvwmRoot) = Scr.NoFocusWin; Scr.FvwmRoot.number_cmap_windows = 1; Scr.FvwmRoot.cmap_windows = &Scr.NoFocusWin; } InitEventHandlerJumpTable(); Scr.gray_bitmap = XCreateBitmapFromData(dpy,Scr.Root,g_bits, g_width,g_height); EWMH_Init(); DBUG("main", "Setting up rc file defaults..."); SetRCDefaults(); flush_window_updates(); simplify_style_list(); DBUG("main", "Running config_commands..."); ecc.type = Restarting ? EXCT_RESTART : EXCT_INIT; ecc.w.wcontext = C_ROOT; exc = exc_create_context(&ecc, ECC_TYPE | ECC_WCONTEXT); if (num_config_commands > 0) { int i; for (i = 0; i < num_config_commands; i++) { DoingCommandLine = True; execute_function(NULL, exc, config_commands[i], 0); free(config_commands[i]); } DoingCommandLine = False; } else { /* Run startup command file in these places (default prefix): * ~/.fvwm/config * /usr/local/share/fvwm/config * and for compatibility: * ~/.fvwm/.fvwm2rc * /usr/local/share/fvwm/system.fvwm2rc * and for compatibility to be discontinued: * ~/.fvwm2rc, * /usr/local/share/fvwm/.fvwm2rc * /usr/local/etc/system.fvwm2rc */ if ( !run_command_file(CatString3( fvwm_userdir, "/", FVWM_CONFIG), exc) && !run_command_file(CatString3( FVWM_DATADIR, "/", FVWM_CONFIG), exc) && !run_command_file(CatString3( fvwm_userdir, "/", FVWM2RC), exc) && !run_command_file(CatString3( home_dir, "/", FVWM2RC), exc) && !run_command_file(CatString3( FVWM_DATADIR, "/", FVWM2RC), exc) && !run_command_file(CatString3( FVWM_DATADIR, "/system", FVWM2RC), exc) && !run_command_file(CatString3( FVWM_CONFDIR, "/system", FVWM2RC), exc)) { fvwm_msg( ERR, "main", "Cannot read startup config file," " tried: \n\t%s/%s\n\t%s/%s\n\t%s/%s\n\t" "%s/%s\n\t%s/%s\n\t%s/system%s\n\t%s/system%s", fvwm_userdir, FVWM_CONFIG, FVWM_DATADIR, FVWM_CONFIG, fvwm_userdir, FVWM2RC, home_dir, FVWM2RC, FVWM_DATADIR, FVWM2RC, FVWM_DATADIR, FVWM2RC, FVWM_CONFDIR, FVWM2RC); } } exc_destroy_context(exc); DBUG("main", "Done running config_commands"); if (Pdepth<2) { Scr.gray_pixmap = XCreatePixmapFromBitmapData( dpy, Scr.NoFocusWin, g_bits, g_width, g_height, PictureBlackPixel(), PictureWhitePixel(), Pdepth); Scr.light_gray_pixmap = XCreatePixmapFromBitmapData( dpy, Scr.NoFocusWin, l_g_bits, l_g_width, l_g_height, PictureBlackPixel(), PictureWhitePixel(), Pdepth); Scr.sticky_gray_pixmap = XCreatePixmapFromBitmapData( dpy, Scr.NoFocusWin, s_g_bits, s_g_width, s_g_height, PictureBlackPixel(), PictureWhitePixel(), Pdepth); } attributes.background_pixel = Scr.StdBack; attributes.colormap = Pcmap; attributes.border_pixel = 0; valuemask = CWBackPixel | CWColormap | CWBorderPixel; Scr.SizeWindow = XCreateWindow( dpy, Scr.Root, 0, 0, 1, 1, 0, Pdepth, InputOutput, Pvisual, valuemask, &attributes); resize_geometry_window(); initPanFrames(); MyXGrabServer(dpy); checkPanFrames(); MyXUngrabServer(dpy); CoerceEnterNotifyOnCurrentWindow(); SessionInit(); GNOME_Init(); DBUG("main", "Entering HandleEvents loop..."); HandleEvents(); switch (fvwmRunState) { case FVWM_DONE: Done(0, NULL); /* does not return */ case FVWM_RESTART: Done(1, ""); /* does not return */ default: DBUG("main", "Unknown fvwm run-state"); } exit(0); } fvwm-2.6.5.orig/fvwm/read.h0000644000175000017500000000154610554317724013703 0ustar vwcvwc/* -*-c-*- */ #ifndef FVWM_READ_H #define FVWM_READ_H #include /* for FILE below */ /** * Full pathname of file read in progress, or NULL. **/ extern const char *get_current_read_file(void); extern const char *get_current_read_dir(void); /** * Read and execute each line from stream. * * Parameters eventp, fw, context, and Module supply the context * for executing the commands. * cond_rc_t is passed thru incase piperead is running in a function. **/ void run_command_stream( cond_rc_t *cond_rc, FILE *f, const exec_context_t *exc); /** * Given a filename, open it and execute the commands therein. * * If the filename is not an absolute path, search for it in * fvwm_userdir (set in main()) or in FVWM_DATADIR. Return 1 * if the file was found and executed. **/ int run_command_file(char *filename, const exec_context_t *exc); #endif fvwm-2.6.5.orig/fvwm/functable.h0000644000175000017500000000130107677641663014736 0ustar vwcvwc/* -*-c-*- */ #ifndef FUNCTABLE_H #define FUNCTABLE_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ #define PRE_KEEPRC "keeprc" #define PRE_REPEAT "repeat" #define PRE_SILENT "silent" /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ extern const func_t func_table[]; /* ---------------------------- interface functions ------------------------ */ #endif /* FUNCTABLE_H */ fvwm-2.6.5.orig/fvwm/events.c0000644000175000017500000034653411744236501014273 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* This module is based on Twm, but has been siginificantly modified * by Rob Nation */ /* * Copyright 1988 by Evans & Sutherland Computer Corporation, * Salt Lake City, Utah * Portions Copyright 1989 by the Massachusetts Institute of Technology * Cambridge, Massachusetts * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permis- * sion notice appear in supporting documentation, and that the * names of Evans & Sutherland and M.I.T. not be used in advertising * in publicity pertaining to distribution of the software without * specific, written prior permission. * * EVANS & SUTHERLAND AND M.I.T. DISCLAIM ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- * ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND OR * M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- * AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA * OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE * OR PERFORMANCE OF THIS SOFTWARE. */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #if HAVE_SYS_BSDTYPES_H #include #endif #include #include #include #include "libs/ftime.h" #include "libs/fvwmlib.h" #include "libs/System.h" #include "libs/Grab.h" #include "libs/Parse.h" #include "libs/ColorUtils.h" #include "libs/FShape.h" #include "libs/PictureBase.h" #include "libs/Colorset.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "functions.h" #include "commands.h" #include "bindings.h" #include "misc.h" #include "screen.h" #include "events.h" #include "eventhandler.h" #include "eventmask.h" #include "libs/fvwmsignal.h" #include "module_list.h" #include "module_interface.h" #include "session.h" #include "borders.h" #include "frame.h" #include "add_window.h" #include "icccm2.h" #include "icons.h" #include "gnome.h" #include "ewmh.h" #include "update.h" #include "style.h" #include "stack.h" #include "geometry.h" #include "focus.h" #include "virtual.h" #include "decorations.h" #include "schedule.h" #include "menus.h" #include "colormaps.h" #include "colorset.h" #ifdef HAVE_STROKE #include "stroke.h" #endif /* HAVE_STROKE */ /* ---------------------------- local definitions -------------------------- */ #ifndef XUrgencyHint #define XUrgencyHint (1L << 8) #endif #define CR_MOVERESIZE_MASK (CWX | CWY | CWWidth | CWHeight | CWBorderWidth) /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ extern void StartupStuff(void); /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef void (*PFEH)(const evh_args_t *ea); typedef struct { Window w; Bool do_return_true; Bool do_return_true_cr; unsigned long cr_value_mask; Bool ret_does_match; unsigned long ret_type; } check_if_event_args; typedef struct { unsigned do_forbid_function : 1; unsigned do_focus : 1; unsigned do_swallow_click : 1; unsigned do_raise : 1; } hfrc_ret_t; typedef struct event_group { int base; int count; PFEH *jump_table; struct event_group *next; } event_group_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static int Button = 0; static const FvwmWindow *xcrossing_last_grab_window = NULL; STROKE_CODE(static int send_motion); STROKE_CODE(static char sequence[STROKE_MAX_SEQUENCE + 1]); static event_group_t *base_event_group = NULL; /* ---------------------------- exported variables (globals) --------------- */ int last_event_type = 0; Window PressedW = None; /* ---------------------------- local functions ---------------------------- */ static void fake_map_unmap_notify(const FvwmWindow *fw, int event_type) { XEvent client_event; XWindowAttributes winattrs = {0}; if (!XGetWindowAttributes(dpy, FW_W(fw), &winattrs)) { return; } XSelectInput( dpy, FW_W(fw), winattrs.your_event_mask & ~StructureNotifyMask); client_event.type = event_type; client_event.xmap.display = dpy; client_event.xmap.event = FW_W(fw); client_event.xmap.window = FW_W(fw); switch (event_type) { case MapNotify: client_event.xmap.override_redirect = False; break; case UnmapNotify: client_event.xunmap.from_configure = False; break; default: /* not possible if called correctly */ break; } FSendEvent( dpy, FW_W(fw), False, StructureNotifyMask, &client_event); XSelectInput(dpy, FW_W(fw), winattrs.your_event_mask); XFlush(dpy); return; } static Bool test_map_request( Display *display, XEvent *event, XPointer arg) { check_if_event_args *cie_args; Bool rc; cie_args = (check_if_event_args *)arg; cie_args->ret_does_match = False; if (event->type == MapRequest && event->xmaprequest.window == cie_args->w) { cie_args->ret_type = MapRequest; cie_args->ret_does_match = True; rc = cie_args->do_return_true; } else { cie_args->ret_type = 0; rc = False; } /* Yes, it is correct that this function always returns False. */ return rc; } /* Test for ICCCM2 withdraw requests by syntetic events on the root window */ static Bool test_withdraw_request( Display *display, XEvent *event, XPointer arg) { check_if_event_args *cie_args; Bool rc; cie_args = (check_if_event_args *)arg; cie_args->ret_does_match = False; if (event->type == UnmapNotify && event->xunmap.window == cie_args->w && event->xany.send_event == True && event->xunmap.event == FW_W(&Scr.FvwmRoot)) { cie_args->ret_type = UnmapNotify; cie_args->ret_does_match = True; rc = cie_args->do_return_true; } else { cie_args->ret_type = 0; rc = False; } return rc; } Bool test_button_event( Display *display, XEvent *event, XPointer arg) { if (event->type == ButtonPress || event->type == ButtonRelease) { return True; } return False; } Bool test_typed_window_event( Display *display, XEvent *event, XPointer arg) { test_typed_window_event_args *ta = (test_typed_window_event_args *)arg; if (event->xany.window == ta->w && event->xany.type == ta->event_type && event->xproperty.atom == ta->atom) { return True; } return False; } static Bool test_resizing_event( Display *display, XEvent *event, XPointer arg) { check_if_event_args *cie_args; Bool rc; cie_args = (check_if_event_args *)arg; cie_args->ret_does_match = False; if (event->xany.window != cie_args->w) { return False; } rc = False; switch (event->type) { case ConfigureRequest: if ((event->xconfigurerequest.value_mask & cie_args->cr_value_mask) != 0) { cie_args->ret_type = ConfigureRequest; cie_args->ret_does_match = True; rc = cie_args->do_return_true_cr; } break; case PropertyNotify: if (event->xproperty.atom == XA_WM_NORMAL_HINTS) { cie_args->ret_type = PropertyNotify; cie_args->ret_does_match = True; rc = cie_args->do_return_true; } default: break; } /* Yes, it is correct that this function may always returns False. */ return rc; } static inline void __handle_cr_on_unmanaged(XConfigureRequestEvent *cre) { XWindowChanges xwc; unsigned long xwcm; xwcm = (cre->value_mask & CR_MOVERESIZE_MASK); xwc.x = cre->x; xwc.y = cre->y; xwc.width = cre->width; xwc.height = cre->height; xwc.border_width = cre->border_width; XConfigureWindow(dpy, cre->window, xwcm, &xwc); return; } static inline void __handle_cr_on_icon( XConfigureRequestEvent *cre, FvwmWindow *fw) { XWindowChanges xwc; unsigned long xwcm; xwcm = (cre->value_mask & CR_MOVERESIZE_MASK); xwc.x = cre->x; xwc.y = cre->y; xwc.width = cre->width; xwc.height = cre->height; xwc.border_width = cre->border_width; if (FW_W_ICON_PIXMAP(fw) == cre->window) { int bw; if (cre->value_mask & CWBorderWidth) { fw->icon_border_width = cre->border_width; } bw = fw->icon_border_width; if ((cre->value_mask & (CWWidth | CWHeight)) == (CWWidth | CWHeight)) { set_icon_picture_size( fw, cre->width + 2 * bw, cre->height + 2 * bw); } } set_icon_position(fw, cre->x, cre->y); broadcast_icon_geometry(fw, False); XConfigureWindow(dpy, cre->window, xwcm, &xwc); if (cre->window != FW_W_ICON_PIXMAP(fw) && FW_W_ICON_PIXMAP(fw) != None) { rectangle g; get_icon_picture_geometry(fw, &g); xwc.x = g.x; xwc.y = g.y; xwcm = cre->value_mask & (CWX | CWY); XConfigureWindow( dpy, FW_W_ICON_PIXMAP(fw), xwcm, &xwc); } if (FW_W_ICON_TITLE(fw) != None) { rectangle g; get_icon_title_geometry(fw, &g); xwc.x = g.x; xwc.y = g.y; xwcm = cre->value_mask & (CWX | CWY); XConfigureWindow( dpy, FW_W_ICON_TITLE(fw), xwcm, &xwc); } return; } static inline void __handle_cr_on_shaped(FvwmWindow *fw) { /* suppress compiler warnings w/o shape extension */ int i = 0; unsigned int u = 0; Bool b = False; int boundingShaped; if (FShapeQueryExtents( dpy, FW_W(fw), &boundingShaped, &i, &i, &u, &u, &b, &i, &i, &u, &u)) { fw->wShaped = boundingShaped; } else { fw->wShaped = 0; } return; } static inline void __handle_cr_restack( int *ret_do_send_event, XConfigureRequestEvent *cre, FvwmWindow *fw) { XWindowChanges xwc; unsigned long xwcm; FvwmWindow *fw2 = NULL; if (cre->value_mask & CWSibling) { if (XFindContext( dpy, cre->above, FvwmContext, (caddr_t *)&fw2) == XCNOENT) { fw2 = NULL; } if (fw2 == fw) { fw2 = NULL; } } if (cre->detail != Above && cre->detail != Below) { HandleUnusualStackmodes( cre->detail, fw, cre->window, fw2, cre->above); } /* only allow clients to restack windows within their layer */ else if (fw2 == NULL || compare_window_layers(fw2, fw) != 0) { switch (cre->detail) { case Above: RaiseWindow(fw, True); break; case Below: LowerWindow(fw, True); break; } } else { xwc.sibling = FW_W_FRAME(fw2); xwc.stack_mode = cre->detail; xwcm = CWSibling | CWStackMode; XConfigureWindow(dpy, FW_W_FRAME(fw), xwcm, &xwc); /* Maintain the condition that icon windows are stacked * immediately below their frame * 1. for fw */ xwc.sibling = FW_W_FRAME(fw); xwc.stack_mode = Below; xwcm = CWSibling | CWStackMode; if (FW_W_ICON_TITLE(fw) != None) { XConfigureWindow( dpy, FW_W_ICON_TITLE(fw), xwcm, &xwc); } if (FW_W_ICON_PIXMAP(fw) != None) { XConfigureWindow( dpy, FW_W_ICON_PIXMAP(fw), xwcm, &xwc); } /* 2. for fw2 */ if (cre->detail == Below) { xwc.sibling = FW_W_FRAME(fw2); xwc.stack_mode = Below; xwcm = CWSibling | CWStackMode; if (FW_W_ICON_TITLE(fw2) != None) { XConfigureWindow( dpy, FW_W_ICON_TITLE(fw2), xwcm, &xwc); } if (FW_W_ICON_PIXMAP(fw2) != None) { XConfigureWindow( dpy, FW_W_ICON_PIXMAP(fw2), xwcm, &xwc); } } /* Maintain the stacking order ring */ if (cre->detail == Above) { remove_window_from_stack_ring(fw); add_window_to_stack_ring_after( fw, get_prev_window_in_stack_ring(fw2)); } else /* cre->detail == Below */ { remove_window_from_stack_ring(fw); add_window_to_stack_ring_after(fw, fw2); } BroadcastRestackThisWindow(fw); } /* srt (28-Apr-2001): Tk needs a ConfigureNotify event after a * raise, otherwise it would hang for two seconds */ *ret_do_send_event = 1; return; } static inline void __cr_get_static_position( rectangle *ret_g, FvwmWindow *fw, XConfigureRequestEvent *cre, size_borders *b) { if (cre->value_mask & CWX) { ret_g->x = cre->x - b->top_left.width; } else { ret_g->x = fw->g.frame.x; } if (cre->value_mask & CWY) { ret_g->y = cre->y - b->top_left.height; } else { ret_g->y = fw->g.frame.y; } return; } static inline void __cr_get_grav_position( rectangle *ret_g, FvwmWindow *fw, XConfigureRequestEvent *cre, size_borders *b) { int grav_x; int grav_y; gravity_get_offsets(fw->hints.win_gravity, &grav_x, &grav_y); if (cre->value_mask & CWX) { ret_g->x = cre->x - ((grav_x + 1) * b->total_size.width) / 2; } else { ret_g->x = fw->g.frame.x; } if (cre->value_mask & CWY) { ret_g->y = cre->y - ((grav_y + 1) * b->total_size.height) / 2; } else { ret_g->y = fw->g.frame.y; } return; } /* Try to detect whether the application uses the ICCCM way of moving its * window or the traditional way, always assuming StaticGravity. */ static inline void __cr_detect_icccm_move( FvwmWindow *fw, XConfigureRequestEvent *cre, size_borders *b) { rectangle grav_g; rectangle static_g; rectangle dg_g; rectangle ds_g; int mx; int my; int m; int w; int h; int has_x; int has_y; if (CR_MOTION_METHOD(fw) != CR_MOTION_METHOD_AUTO) { if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "_cdim: --- already detected (pid %d) %p" " '%s'\n", HAS_EWMH_WM_PID(fw), fw, fw->visible_name); } return; } if (HAS_EWMH_WM_PID(fw)) { if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr,"_cdim: +++ has ewmh_wm_pid: icccm" " %p '%s'\n", fw, fw->visible_name); } SET_CR_MOTION_METHOD(fw, CR_MOTION_METHOD_USE_GRAV); SET_CR_MOTION_METHOD_DETECTED(fw, 1); return; } if (fw->ewmh_window_type != EWMH_WINDOW_TYPE_NONE_ID) { if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "_cdim: +++ has ewmh_window_type:" " icccm %p '%s'\n", fw, fw->visible_name); } SET_CR_MOTION_METHOD(fw, CR_MOTION_METHOD_USE_GRAV); SET_CR_MOTION_METHOD_DETECTED(fw, 1); return; } if (FShapesSupported && fw->wShaped) { if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "_cdim: --- shaped window %p " "'%s'\n", fw, fw->visible_name); } /* no detection for shaped windows */ return; } if (fw->hints.win_gravity == StaticGravity) { if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "_cdim: --- using StaticGravity" " %p '%s'\n", fw, fw->visible_name); } return; } has_x = (cre->value_mask & CWX); has_y = (cre->value_mask & CWY); if (!has_x && !has_y) { if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "_cdim: --- not moved %p '%s'\n", fw, fw->visible_name); } return; } __cr_get_grav_position(&grav_g, fw, cre, b); __cr_get_static_position(&static_g, fw, cre, b); if (static_g.x == grav_g.x) { /* both methods have the same result; ignore */ has_x = 0; } if (static_g.y == grav_g.y) { /* both methods have the same result; ignore */ has_y = 0; } if (!has_x && !has_y) { if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "_cdim: --- not moved %p '%s'\n", fw, fw->visible_name); } return; } dg_g.x = grav_g.x - fw->g.frame.x; dg_g.y = grav_g.y - fw->g.frame.y; ds_g.x = static_g.x - fw->g.frame.x; ds_g.y = static_g.y - fw->g.frame.y; if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "s %3d/%3d %2d/%2d, g %3d/%3d %2d/%2d: ", static_g.x, static_g.y, ds_g.x, ds_g.y, grav_g.x, grav_g.y, dg_g.x, dg_g.y); } /* check full screen */ if ((cre->value_mask & (CWX | CWY)) == (CWX | CWY) && (has_x || has_y) && cre->width == Scr.MyDisplayWidth && cre->height == Scr.MyDisplayHeight) { if (grav_g.x == -b->top_left.width && grav_g.y == -b->top_left.height) { /* Window is fullscreen using the ICCCM way. */ SET_CR_MOTION_METHOD(fw, CR_MOTION_METHOD_USE_GRAV); SET_CR_MOTION_METHOD_DETECTED(fw, 1); if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "+++ fullscreen icccm %p" " '%s'\n", fw, fw->visible_name); } return; } else if (static_g.x == -b->top_left.width && static_g.y == -b->top_left.height) { /* Window is fullscreen using the traditional way. */ SET_CR_MOTION_METHOD(fw, CR_MOTION_METHOD_STATIC_GRAV); SET_CR_MOTION_METHOD_DETECTED(fw, 1); if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "+++ fullscreen traditional" " %p '%s'\n", fw, fw->visible_name); } return; } } /* check travelling across the screen */ if (has_x && dg_g.x == 0 && ds_g.x != 0 && has_y && dg_g.y == 0 && ds_g.y != 0) { /* The traditional way causes a shift by the border width or * height. Use ICCCM way. */ SET_CR_MOTION_METHOD(fw, CR_MOTION_METHOD_USE_GRAV); SET_CR_MOTION_METHOD_DETECTED(fw, 1); if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "+++ travelling icccm %p '%s'\n", fw, fw->visible_name); } return; } if (has_x && dg_g.x != 0 && ds_g.x == 0 && has_y && dg_g.y != 0 && ds_g.y == 0) { /* The ICCCM way causes a shift by the border width or height. * Use traditional way. */ SET_CR_MOTION_METHOD(fw, CR_MOTION_METHOD_STATIC_GRAV); SET_CR_MOTION_METHOD_DETECTED(fw, 1); if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "+++ travelling traditional %p" " '%s'\n", fw, fw->visible_name); } return; } /* check placement near border */ w = (cre->value_mask & CWWidth) ? cre->width + b->total_size.width : fw->g.frame.width; h = (cre->value_mask & CWHeight) ? cre->height + b->total_size.height : fw->g.frame.height; if (!has_x) { mx = CR_MOTION_METHOD_AUTO; } else if (static_g.x == 0 || static_g.x + w == Scr.MyDisplayWidth) { mx = CR_MOTION_METHOD_STATIC_GRAV; } else if (grav_g.x == 0 || grav_g.x + w == Scr.MyDisplayWidth) { mx = CR_MOTION_METHOD_USE_GRAV; } else { mx = CR_MOTION_METHOD_AUTO; } if (!has_y) { my = CR_MOTION_METHOD_AUTO; } else if (static_g.y == 0 || static_g.y + h == Scr.MyDisplayHeight) { my = CR_MOTION_METHOD_STATIC_GRAV; } else if (grav_g.y == 0 || grav_g.y + h == Scr.MyDisplayHeight) { my = CR_MOTION_METHOD_USE_GRAV; } else { my = CR_MOTION_METHOD_AUTO; } m = (mx != CR_MOTION_METHOD_AUTO) ? mx : my; if (m != CR_MOTION_METHOD_AUTO) { /* Window was placed next to the display border. */ if (m == my || my == CR_MOTION_METHOD_AUTO) { SET_CR_MOTION_METHOD(fw, m); SET_CR_MOTION_METHOD_DETECTED(fw, 1); if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "+++ near border %s %p " "'%s'\n", (m == CR_MOTION_METHOD_USE_GRAV) ? "icccm" : "traditional", fw, fw->visible_name); } return; } } if (Scr.bo.do_debug_cr_motion_method == 1) { fprintf( stderr, "--- not detected %p '%s'\n", fw, fw->visible_name); } return; } #define EXPERIMENTAL_ANTI_RACE_CONDITION_CODE /* This is not a good idea because this interferes with changes in the size * hints of the window. However, it is impossible to be completely safe here. * For example, if the client changes the size inc, then resizes the size of * its window and then changes the size inc again - all in one batch - then * the WM will read the *second* size inc upon the *first* event and use the * wrong one in the ConfigureRequest calculations. */ /* dv (31 Mar 2002): The code now handles these situations, so enable it * again. */ #ifdef EXPERIMENTAL_ANTI_RACE_CONDITION_CODE static inline int __merge_cr_moveresize( const evh_args_t *ea, XConfigureRequestEvent *cre, FvwmWindow *fw, size_borders *b) { int cn_count = 0; XEvent e; XConfigureRequestEvent *ecre; check_if_event_args args; args.w = cre->window; args.do_return_true = False; args.do_return_true_cr = True; args.cr_value_mask = CR_MOVERESIZE_MASK; args.ret_does_match = False; args.ret_type = 0; for (cn_count = 0; 1; ) { unsigned long vma; unsigned long vmo; unsigned long xm; unsigned long ym; evh_args_t ea2; exec_context_changes_t ecc; FCheckPeekIfEvent( dpy, &e, test_resizing_event, (XPointer)&args); ecre = &e.xconfigurerequest; if (args.ret_does_match == False) { break; } else if (args.ret_type == PropertyNotify) { /* Can't merge events with a PropertyNotify in * between. The event is still on the queue. */ break; } else if (args.ret_type != ConfigureRequest) { /* not good. unselected event type! */ continue; } /* Event was not yet removed from the queue but stored in e. */ xm = CWX | CWWidth; ym = CWY | CWHeight; vma = cre->value_mask & ecre->value_mask; vmo = cre->value_mask | ecre->value_mask; if (((vma & xm) == 0 && (vmo & xm) == xm) || ((vma & ym) == 0 && (vmo & ym) == ym)) { /* can't merge events since location of window might * get screwed up. */ break; } /* Finally remove the event from the queue */ FCheckIfEvent(dpy, &e, test_resizing_event, (XPointer)&args); /* partially handle the event */ ecre->value_mask &= ~args.cr_value_mask; ea2.exc = exc_clone_context(ea->exc, &ecc, ECC_ETRIGGER); HandleConfigureRequest(&ea2); exc_destroy_context(ea2.exc); /* collect the size/position changes */ if (ecre->value_mask & CWX) { cre->x = ecre->x; } if (ecre->value_mask & CWY) { cre->y = ecre->y; } if (ecre->value_mask & CWWidth) { cre->width = ecre->width; } if (ecre->value_mask & CWHeight) { cre->height = ecre->height; } if (ecre->value_mask & CWBorderWidth) { cre->border_width = ecre->border_width; } cre->value_mask |= (ecre->value_mask & CR_MOVERESIZE_MASK); cn_count++; } return cn_count; } #endif static inline int __handle_cr_on_client( int *ret_do_send_event, XConfigureRequestEvent cre, const evh_args_t *ea, FvwmWindow *fw, Bool force, int force_gravity) { rectangle current_g; rectangle new_g; rectangle d_g; size_rect constr_dim; size_rect oldnew_dim; size_borders b; int cn_count = 0; int gravity; if (ea) { cre = ea->exc->x.etrigger->xconfigurerequest; } if ((cre.value_mask & (CWWidth | CWHeight | CWX | CWY)) == 0) { return 0; } get_window_borders(fw, &b); #ifdef EXPERIMENTAL_ANTI_RACE_CONDITION_CODE /* Merge all pending ConfigureRequests for the window into a single * event. However, we can not do this if the window uses the motion * method autodetection because the merged event might confuse the * detection code. */ if (ea && CR_MOTION_METHOD(fw) != CR_MOTION_METHOD_AUTO) { cn_count = __merge_cr_moveresize(ea, &cre, fw, &b); } #endif #if 0 fprintf(stderr, "cre: %d(%d) %d(%d) %d(%d)x%d(%d) fw 0x%08x w 0x%08x " "ew 0x%08x '%s'\n", cre.x, (int)(cre.value_mask & CWX), cre.y, (int)(cre.value_mask & CWY), cre.width, (int)(cre.value_mask & CWWidth), cre.height, (int)(cre.value_mask & CWHeight), (int)FW_W_FRAME(fw), (int)FW_W(fw), (int)cre.window, (fw->name.name) ? fw->name.name : ""); #endif /* Don't modify frame_g fields before calling SetupWindow! */ memset(&d_g, 0, sizeof(d_g)); if (HAS_NEW_WM_NORMAL_HINTS(fw)) { /* get the latest size hints */ XSync(dpy, 0); GetWindowSizeHints(fw); SET_HAS_NEW_WM_NORMAL_HINTS(fw, 0); } if (!HAS_OVERRIDE_SIZE_HINTS(fw) && (fw->hints.flags & PMaxSize)) { /* Java workaround */ if (cre.height > fw->hints.max_height && fw->hints.max_height <= BROKEN_MAXSIZE_LIMIT) { fw->hints.max_height = DEFAULT_MAX_MAX_WINDOW_HEIGHT; cre.value_mask |= CWHeight; } if (cre.width > fw->hints.max_width && fw->hints.max_width <= BROKEN_MAXSIZE_LIMIT) { fw->hints.max_width = DEFAULT_MAX_MAX_WINDOW_WIDTH; cre.value_mask |= CWWidth; } } if (!HAS_OVERRIDE_SIZE_HINTS(fw) && (fw->hints.flags & PMinSize)) { if (cre.width < fw->hints.min_width && fw->hints.min_width >= BROKEN_MINSIZE_LIMIT) { fw->hints.min_width = 1; cre.value_mask |= CWWidth; } if (cre.height < fw->hints.min_height && fw->hints.min_height >= BROKEN_MINSIZE_LIMIT) { fw->hints.min_height = 1; cre.value_mask |= CWHeight; } } if (IS_SHADED(fw) || !is_function_allowed(F_MOVE, NULL, fw, RQORIG_PROGRAM, False)) { /* forbid shaded applications to move their windows */ cre.value_mask &= ~(CWX | CWY); /* resend the old geometry */ *ret_do_send_event = 1; } if (IS_MAXIMIZED(fw)) { /* dont allow clients to resize maximized windows */ cre.value_mask &= ~(CWWidth | CWHeight); /* resend the old geometry */ *ret_do_send_event = 1; d_g.width = 0; d_g.height = 0; } else if ( !is_function_allowed( F_RESIZE, NULL, fw, RQORIG_PROGRAM, False)) { cre.value_mask &= ~(CWWidth | CWHeight); *ret_do_send_event = 1; } if (cre.value_mask & CWBorderWidth) { /* for restoring */ fw->attr_backup.border_width = cre.border_width; } if (!force && CR_MOTION_METHOD(fw) == CR_MOTION_METHOD_AUTO) { __cr_detect_icccm_move(fw, &cre, &b); } if (force_gravity > ForgetGravity && force_gravity <= StaticGravity) { gravity = force_gravity; } else { gravity = fw->hints.win_gravity; } if (IS_SHADED(fw)) { direction_t gravity_dir; get_unshaded_geometry(fw, ¤t_g); /* the shade direction overrides the window's gravity */ gravity_dir = gravity_grav_to_dir(gravity); gravity_dir = gravity_override_dir( gravity_dir, SHADED_DIR(fw)); gravity = gravity_dir_to_grav(gravity_dir); } else { current_g = fw->g.frame; } if (!(cre.value_mask & (CWX | CWY))) { /* nothing */ } else if ((force || CR_MOTION_METHOD(fw) == CR_MOTION_METHOD_USE_GRAV) && gravity != StaticGravity) { int ref_x; int ref_y; int grav_x; int grav_y; gravity_get_offsets(gravity, &grav_x, &grav_y); if (cre.value_mask & CWX) { ref_x = cre.x - ((grav_x + 1) * b.total_size.width) / 2; d_g.x = ref_x - current_g.x; } if (cre.value_mask & CWY) { ref_y = cre.y - ((grav_y + 1) * b.total_size.height) / 2; d_g.y = ref_y - current_g.y; } } else /* ..._USE_GRAV or ..._AUTO */ { /* default: traditional cr handling */ if (cre.value_mask & CWX) { d_g.x = cre.x - current_g.x - b.top_left.width; } if (cre.value_mask & CWY) { d_g.y = cre.y - current_g.y - b.top_left.height; } } if (cre.value_mask & CWHeight) { if (cre.height < (WINDOW_FREAKED_OUT_SIZE - b.total_size.height)) { d_g.height = cre.height - (current_g.height - b.total_size.height); } else { /* Ignore height changes to astronomically large * windows (needed for XEmacs 20.4); don't care if the * window is shaded here - we won't use 'height' in * this case anyway. * Inform the buggy app about the size that *we* want */ d_g.height = 0; *ret_do_send_event = 1; } } if (cre.value_mask & CWWidth) { if (cre.width < (WINDOW_FREAKED_OUT_SIZE - b.total_size.width)) { d_g.width = cre.width - (current_g.width - b.total_size.width); } else { d_g.width = 0; *ret_do_send_event = 1; } } /* SetupWindow (x,y) are the location of the upper-left outer corner * and are passed directly to XMoveResizeWindow (frame). The * (width,height) are the inner size of the frame. The inner width is * the same as the requested client window width; the inner height is * the same as the requested client window height plus any title bar * slop. */ new_g = current_g; oldnew_dim.width = new_g.width + d_g.width; oldnew_dim.height = new_g.height + d_g.height; constr_dim.width = oldnew_dim.width; constr_dim.height = oldnew_dim.height; constrain_size( fw, NULL, &constr_dim.width, &constr_dim.height, 0, 0, CS_UPDATE_MAX_DEFECT); d_g.width += (constr_dim.width - oldnew_dim.width); d_g.height += (constr_dim.height - oldnew_dim.height); if ((cre.value_mask & CWX) && d_g.width) { new_g.x = current_g.x + d_g.x; new_g.width = current_g.width + d_g.width; } else if ((cre.value_mask & CWX) && !d_g.width) { new_g.x = current_g.x + d_g.x; } else if (!(cre.value_mask & CWX) && d_g.width) { gravity_resize(gravity, &new_g, d_g.width, 0); } if ((cre.value_mask & CWY) && d_g.height) { new_g.y = current_g.y + d_g.y; new_g.height = current_g.height + d_g.height; } else if ((cre.value_mask & CWY) && !d_g.height) { new_g.y = current_g.y + d_g.y; } else if (!(cre.value_mask & CWY) && d_g.height) { gravity_resize(gravity, &new_g, 0, d_g.height); } if (new_g.x == current_g.x && new_g.y == current_g.y && new_g.width == current_g.width && new_g.height == current_g.height) { /* Window will not be moved or resized; send a synthetic * ConfigureNotify. */ *ret_do_send_event = 1; } else if ((cre.value_mask & CWX) || (cre.value_mask & CWY) || d_g.width || d_g.height) { if (IS_SHADED(fw)) { fw->g.normal = new_g; get_shaded_geometry(fw, &new_g, &new_g); } frame_setup_window_app_request( fw, new_g.x, new_g.y, new_g.width, new_g.height, False); /* make sure the window structure has the new position */ update_absolute_geometry(fw); maximize_adjust_offset(fw); GNOME_SetWinArea(fw); } else if (DO_FORCE_NEXT_CR(fw)) { *ret_do_send_event = 1; } SET_FORCE_NEXT_CR(fw, 0); SET_FORCE_NEXT_PN(fw, 0); return cn_count; } void __handle_configure_request( XConfigureRequestEvent cre, const evh_args_t *ea, FvwmWindow *fw, Bool force, int force_gravity) { int do_send_event = 0; int cn_count = 0; /* According to the July 27, 1988 ICCCM draft, we should ignore size * and position fields in the WM_NORMAL_HINTS property when we map a * window. Instead, we'll read the current geometry. Therefore, we * should respond to configuration requests for windows which have * never been mapped. */ if (fw == NULL) { __handle_cr_on_unmanaged(&cre); return; } if (cre.window == FW_W_ICON_TITLE(fw) || cre.window == FW_W_ICON_PIXMAP(fw)) { __handle_cr_on_icon(&cre, fw); } if (FShapesSupported) { __handle_cr_on_shaped(fw); } if (fw != NULL && cre.window == FW_W(fw)) { cn_count = __handle_cr_on_client( &do_send_event, cre, ea, fw, force, force_gravity); } /* Stacking order change requested. Handle this *after* geometry * changes, since we need the new geometry in occlusion calculations */ if ((cre.value_mask & CWStackMode) && (!DO_IGNORE_RESTACK(fw) || force)) { __handle_cr_restack(&do_send_event, &cre, fw); } #if 1 /* This causes some ddd windows not to be drawn properly. Reverted back * to the old method in frame_setup_window. */ /* domivogt (15-Oct-1999): enabled this to work around buggy apps that * ask for a nonsense height and expect that they really get it. */ if (cn_count == 0 && do_send_event) { cn_count = 1; } else if (cn_count > 0) { do_send_event = 1; } for ( ; cn_count > 0; cn_count--) { SendConfigureNotify( fw, fw->g.frame.x, fw->g.frame.y, fw->g.frame.width, fw->g.frame.height, 0, True); } if (do_send_event) { XFlush(dpy); } #endif return; } static Bool __predicate_button_click( Display *display, XEvent *event, XPointer arg) { if (event->type == ButtonPress || event->type == ButtonRelease) { return True; } return False; } /* Helper function for __handle_focus_raise_click(). */ static Bool __test_for_motion(int x0, int y0) { int x; int y; unsigned int mask; XEvent e; /* Query the pointer to do this. We can't check for events here since * the events are still needed if the pointer moves. */ /* However, some special mouse (e.g., a touchpad with the * synaptic driver) may handle a double click in a special way * (for dragging through short touching and holding down the * finger on the touchpad). Bascially, when you execute a * double click the first button release is queued after the * second _physical_ mouse release happen. It seems that * FQueryPointer may not work as expected: it does not see * that the button is released on a double click. So, we need * to check for a button press in the future to avoid a fvwm * lockup! (olicha 2004-01-31) */ for (x = x0, y = y0; FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &JunkX, &JunkY, &x, &y, &mask) == True; usleep(20000)) { if ((mask & DEFAULT_ALL_BUTTONS_MASK) == 0) { /* all buttons are released */ return False; } else if (abs(x - x0) >= Scr.MoveThreshold || abs(y - y0) >= Scr.MoveThreshold) { /* the pointer has moved */ return True; } if (FCheckPeekIfEvent(dpy, &e, __predicate_button_click, NULL)) { /* click in the future */ return False; } else { /* The predicate procedure finds no match, no event * has been removed from the queue and XFlush was * called. Nothing to do */ } } /* pointer has moved off screen */ return True; } /* Helper function for __handle_focus_raise_click(). */ static void __check_click_to_focus_or_raise( hfrc_ret_t *ret_args, const exec_context_t *exc) { FvwmWindow * const fw = exc->w.fw; const XEvent *te = exc->x.etrigger; struct { unsigned is_client_click : 1; unsigned is_focused : 1; } f; f.is_focused = !!focus_is_focused(fw); f.is_client_click = (exc->w.wcontext == C_WINDOW || exc->w.wcontext == C_EWMH_DESKTOP); /* check if we need to raise and/or focus the window */ ret_args->do_focus = focus_query_click_to_focus(fw, exc->w.wcontext); if (f.is_client_click && !ret_args->do_focus && !f.is_focused && FP_DO_FOCUS_BY_PROGRAM(FW_FOCUS_POLICY(fw)) && !fpol_query_allow_user_focus(&FW_FOCUS_POLICY(fw))) { /* Give the window a chance to to take focus itself */ ret_args->do_focus = 1; } if (ret_args->do_focus && focus_is_focused(fw)) { ret_args->do_focus = 0; } ret_args->do_raise = focus_query_click_to_raise(fw, f.is_focused, exc->w.wcontext); #define EXPERIMENTAL_ROU_HANDLING_V2 #ifdef EXPERIMENTAL_ROU_HANDLING_V2 /* RBW -- Dang! This works without the one in HandleEnterNotify! */ if (ret_args->do_raise && is_on_top_of_layer_and_above_unmanaged(fw)) #else if (ret_args->do_raise && is_on_top_of_layer(fw)) #endif { ret_args->do_raise = 0; } if ((ret_args->do_focus && FP_DO_IGNORE_FOCUS_CLICK_MOTION(FW_FOCUS_POLICY(fw))) || (ret_args->do_raise && FP_DO_IGNORE_RAISE_CLICK_MOTION(FW_FOCUS_POLICY(fw)))) { /* Pass further events to the application and check if a button * release or motion event occurs next. If we don't do this * here, the pointer will seem to be frozen in * __test_for_motion(). */ XAllowEvents(dpy, ReplayPointer, CurrentTime); if (__test_for_motion(te->xbutton.x_root, te->xbutton.y_root)) { /* the pointer was moved, process event normally */ ret_args->do_focus = 0; ret_args->do_raise = 0; } } if (ret_args->do_focus || ret_args->do_raise) { if (!((ret_args->do_focus && FP_DO_ALLOW_FUNC_FOCUS_CLICK(FW_FOCUS_POLICY(fw))) || (ret_args->do_raise && FP_DO_ALLOW_FUNC_RAISE_CLICK(FW_FOCUS_POLICY(fw))))) { ret_args->do_forbid_function = 1; } if (!((ret_args->do_focus && FP_DO_PASS_FOCUS_CLICK(FW_FOCUS_POLICY(fw))) || (ret_args->do_raise && FP_DO_PASS_RAISE_CLICK(FW_FOCUS_POLICY(fw))))) { ret_args->do_swallow_click = 1; } } return; } /* Finds out if the click on a window must be used to focus or raise it. */ static void __handle_focus_raise_click( hfrc_ret_t *ret_args, const exec_context_t *exc) { memset(ret_args, 0, sizeof(*ret_args)); if (exc->w.fw == NULL) { return; } /* check for proper click button and modifiers*/ if (FP_USE_MOUSE_BUTTONS(FW_FOCUS_POLICY(exc->w.fw)) != 0 && !(FP_USE_MOUSE_BUTTONS(FW_FOCUS_POLICY(exc->w.fw)) & (1 << (exc->x.etrigger->xbutton.button - 1)))) { /* wrong button, handle click normally */ return; } else if (FP_USE_MODIFIERS(FW_FOCUS_POLICY(exc->w.fw)) != FPOL_ANY_MODIFIER && MaskUsedModifiers( FP_USE_MODIFIERS(FW_FOCUS_POLICY(exc->w.fw))) != MaskUsedModifiers(exc->x.etrigger->xbutton.state)) { /* right button but wrong modifiers, handle click normally */ return; } else { __check_click_to_focus_or_raise(ret_args, exc); } return; } /* Helper function for HandleButtonPress */ static Bool __is_bpress_window_handled(const exec_context_t *exc) { Window eventw; const XEvent *te = exc->x.etrigger; if (exc->w.fw == NULL) { if ((te->xbutton.window != Scr.Root || te->xbutton.subwindow != None) && !is_pan_frame(te->xbutton.window)) { /* Ignore events in unmanaged windows or subwindows of * a client */ return False; } else { return True; } } eventw = (te->xbutton.subwindow != None && te->xany.window != FW_W(exc->w.fw)) ? te->xbutton.subwindow : te->xany.window; if (is_frame_hide_window(eventw) || eventw == FW_W_FRAME(exc->w.fw)) { return False; } if (!XGetGeometry( dpy, eventw, &JunkRoot, &JunkX, &JunkY, (unsigned int*)&JunkWidth, (unsigned int*)&JunkHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth)) { /* The window has already died. */ return False; } return True; } /* Helper function for __handle_bpress_on_managed */ static Bool __handle_click_to_focus(const exec_context_t *exc) { fpol_set_focus_by_t set_by; switch (exc->w.wcontext) { case C_WINDOW: case C_EWMH_DESKTOP: set_by = FOCUS_SET_BY_CLICK_CLIENT; break; case C_ICON: set_by = FOCUS_SET_BY_CLICK_ICON; break; default: set_by = FOCUS_SET_BY_CLICK_DECOR; break; } SetFocusWindow(exc->w.fw, True, set_by); focus_grab_buttons(exc->w.fw); if (focus_is_focused(exc->w.fw) && !IS_ICONIFIED(exc->w.fw)) { border_draw_decorations( exc->w.fw, PART_ALL, True, True, CLEAR_ALL, NULL, NULL); } return focus_is_focused(exc->w.fw); } /* Helper function for __handle_bpress_on_managed */ static Bool __handle_click_to_raise(const exec_context_t *exc) { Bool rc = False; int is_focused; is_focused = focus_is_focused(exc->w.fw); if (focus_query_click_to_raise(exc->w.fw, is_focused, True)) { rc = True; } return rc; } /* Helper function for HandleButtonPress */ static void __handle_bpress_stroke(void) { STROKE_CODE(stroke_init()); STROKE_CODE(send_motion = True); return; } /* Helper function for __handle_bpress_on_managed */ static Bool __handle_bpress_action( const exec_context_t *exc, char *action) { window_parts part; Bool do_force; Bool rc = False; if (!action || *action == 0) { PressedW = None; return False; } /* draw pressed in decorations */ part = border_context_to_parts(exc->w.wcontext); do_force = (part & PART_TITLEBAR) ? True : False; border_draw_decorations( exc->w.fw, part, (Scr.Hilite == exc->w.fw), do_force, CLEAR_ALL, NULL, NULL); /* execute the action */ if (IS_ICONIFIED(exc->w.fw)) { /* release the pointer since it can't do harm over an icon */ XAllowEvents(dpy, AsyncPointer, CurrentTime); } execute_function(NULL, exc, action, 0); if (exc->w.wcontext != C_WINDOW && exc->w.wcontext != C_NO_CONTEXT) { WaitForButtonsUp(True); rc = True; } /* redraw decorations */ PressedW = None; if (check_if_fvwm_window_exists(exc->w.fw)) { part = border_context_to_parts(exc->w.wcontext); do_force = (part & PART_TITLEBAR) ? True : False; border_draw_decorations( exc->w.fw, part, (Scr.Hilite == exc->w.fw), do_force, CLEAR_ALL, NULL, NULL); } return rc; } /* Handles button presses on the root window. */ static void __handle_bpress_on_root(const exec_context_t *exc) { char *action; PressedW = None; __handle_bpress_stroke(); /* search for an appropriate mouse binding */ action = CheckBinding( Scr.AllBindings, STROKE_ARG(0) exc->x.etrigger->xbutton.button, exc->x.etrigger->xbutton.state, GetUnusedModifiers(), C_ROOT, BIND_BUTTONPRESS, NULL, NULL); if (action && *action) { const exec_context_t *exc2; exec_context_changes_t ecc; ecc.w.wcontext = C_ROOT; exc2 = exc_clone_context(exc, &ecc, ECC_WCONTEXT); execute_function(NULL, exc2, action, 0); exc_destroy_context(exc2); WaitForButtonsUp(True); } else { /* do gnome buttonpress forwarding if win == root */ GNOME_ProxyButtonEvent(exc->x.etrigger); } return; } /* Handles button presses on unmanaged windows */ static void __handle_bpress_on_unmanaged(const exec_context_t *exc) { /* Pass the event to the application. */ XAllowEvents(dpy, ReplayPointer, CurrentTime); XFlush(dpy); return; } /* Handles button presses on managed windows */ static void __handle_bpress_on_managed(const exec_context_t *exc) { char *action; hfrc_ret_t f; FvwmWindow * const fw = exc->w.fw; XEvent *e; e = exc->x.etrigger; /* Now handle click to focus and click to raise. */ __handle_focus_raise_click(&f, exc); PressedW = (f.do_forbid_function) ? None : exc->w.w; if (f.do_focus) { if (!__handle_click_to_focus(exc)) { /* Window didn't accept the focus; pass the click to * the application. */ f.do_swallow_click = 0; } } if (f.do_raise) { if (__handle_click_to_raise(exc) == True) { /* We can't raise the window immediately because the * action bound to the click might be "Lower" or * "RaiseLower". So mark the window as scheduled to be * raised after the binding is executed. Functions that * modify the stacking order will reset this flag. */ SET_SCHEDULED_FOR_RAISE(fw, 1); } } /* handle bindings */ if (!f.do_forbid_function) { /* stroke bindings */ __handle_bpress_stroke(); /* mouse bindings */ action = CheckBinding( Scr.AllBindings, STROKE_ARG(0) e->xbutton.button, e->xbutton.state, GetUnusedModifiers(), exc->w.wcontext, BIND_BUTTONPRESS, &fw->class, fw->name.name); if (__handle_bpress_action(exc, action)) { f.do_swallow_click = 1; } } /* raise the window */ if (IS_SCHEDULED_FOR_RAISE(fw)) { /* Now that we know the action did not restack the window we * can raise it. * dv (10-Aug-2002): We can safely raise the window after * redrawing it since all the decorations are drawn in the * window background and no Expose event is generated. */ RaiseWindow(fw, False); SET_SCHEDULED_FOR_RAISE(fw, 0); } /* clean up */ if (!f.do_swallow_click) { /* pass the click to the application */ XAllowEvents(dpy, ReplayPointer, CurrentTime); XFlush(dpy); } else if (f.do_focus || f.do_raise) { WaitForButtonsUp(True); } return; } /* restore focus stolen by unmanaged */ static void __refocus_stolen_focus_win(const evh_args_t *ea) { FOCUS_SET(Scr.StolenFocusWin); ea->exc->x.etrigger->xfocus.window = Scr.StolenFocusWin; ea->exc->x.etrigger->type = FocusIn; Scr.UnknownWinFocused = None; Scr.StolenFocusWin = None; dispatch_event(ea->exc->x.etrigger); return; } /* ---------------------------- event handlers ----------------------------- */ void HandleButtonPress(const evh_args_t *ea) { DBUG("HandleButtonPress", "Routine Entered"); GrabEm(CRS_NONE, GRAB_PASSIVE); if (__is_bpress_window_handled(ea->exc) == False) { __handle_bpress_on_unmanaged(ea->exc); } else if (ea->exc->w.fw != NULL) { __handle_bpress_on_managed(ea->exc); } else { __handle_bpress_on_root(ea->exc); } UngrabEm(GRAB_PASSIVE); return; } #ifdef HAVE_STROKE void HandleButtonRelease(const evh_args_t *ea) { char *action; char *name; int real_modifier; const XEvent *te = ea->exc->x.etrigger; XClassHint *class; DBUG("HandleButtonRelease", "Routine Entered"); send_motion = False; stroke_trans (sequence); DBUG("HandleButtonRelease",sequence); /* Allows modifier to work (Only R context works here). */ real_modifier = te->xbutton.state - (1 << (7 + te->xbutton.button)); if (ea->exc->w.fw == NULL) { class = NULL; name = NULL; } else { class = &ea->exc->w.fw->class; name = ea->exc->w.fw->name.name; } /* need to search for an appropriate stroke binding */ action = CheckBinding( Scr.AllBindings, sequence, te->xbutton.button, real_modifier, GetUnusedModifiers(), ea->exc->w.wcontext, BIND_STROKE, class, name); /* got a match, now process it */ if (action != NULL && (action[0] != 0)) { execute_function(NULL, ea->exc, action, 0); WaitForButtonsUp(True); } else { /* * do gnome buttonpress forwarding if win == root */ if (Scr.Root == te->xany.window) { GNOME_ProxyButtonEvent(te); } } return; } #endif /* HAVE_STROKE */ void HandleClientMessage(const evh_args_t *ea) { const XEvent *te = ea->exc->x.etrigger; FvwmWindow * const fw = ea->exc->w.fw; DBUG("HandleClientMessage", "Routine Entered"); /* Process GNOME and EWMH Messages */ if (GNOME_ProcessClientMessage(ea->exc)) { return; } else if (EWMH_ProcessClientMessage(ea->exc)) { return; } /* handle deletion of tear out menus */ if (fw && IS_TEAR_OFF_MENU(fw) && te->xclient.format == 32 && te->xclient.data.l[0] == _XA_WM_DELETE_WINDOW) { menu_close_tear_off_menu(fw); return; } if (te->xclient.message_type == _XA_WM_CHANGE_STATE && fw && te->xclient.data.l[0] == IconicState && !IS_ICONIFIED(fw)) { const exec_context_t *exc; exec_context_changes_t ecc; ecc.w.wcontext = C_WINDOW; exc = exc_clone_context(ea->exc, &ecc, ECC_WCONTEXT); execute_function(NULL, exc, "Iconify", 0); exc_destroy_context(exc); return; } /* FIXME: Is this safe enough ? I guess if clients behave * according to ICCCM and send these messages only if they * grabbed the pointer, it is OK */ { extern Atom _XA_WM_COLORMAP_NOTIFY; if (te->xclient.message_type == _XA_WM_COLORMAP_NOTIFY) { set_client_controls_colormaps(te->xclient.data.l[1]); return; } } /* CKH - if we get here, it was an unknown client message, so send * it to the client if it was in a window we know about. I'm not so * sure this should be done or not, since every other window manager * I've looked at doesn't. But it might be handy for a free drag and * drop setup being developed for Linux. */ /* TA: 20091231 - But this confuses QT Drag and Drop since it handles * processing XSendEvents in an odd order. For now, workaround this * by using a BugOpts option. */ if (fw) { if ((!Scr.bo.do_enable_qt_drag_n_drop_workaround) && (te->xclient.window != FW_W(fw))) { XEvent e; e = *te; e.xclient.window = FW_W(fw); FSendEvent(dpy, FW_W(fw), False, NoEventMask, &e); } } } void HandleColormapNotify(const evh_args_t *ea) { colormap_handle_colormap_notify(ea); return; } void HandleConfigureRequest(const evh_args_t *ea) { const XEvent *te = ea->exc->x.etrigger; XConfigureRequestEvent cre; FvwmWindow *fw = ea->exc->w.fw; DBUG("HandleConfigureRequest", "Routine Entered"); cre = te->xconfigurerequest; /* te->xany.window is te->.xconfigurerequest.parent, so the context * window may be wrong. */ if (XFindContext(dpy, cre.window, FvwmContext, (caddr_t *)&fw) == XCNOENT) { fw = NULL; } __handle_configure_request(cre, ea, fw, False, ForgetGravity); return; } void HandleDestroyNotify(const evh_args_t *ea) { DBUG("HandleDestroyNotify", "Routine Entered"); destroy_window(ea->exc->w.fw); EWMH_ManageKdeSysTray( ea->exc->x.etrigger->xdestroywindow.window, ea->exc->x.etrigger->type); EWMH_WindowDestroyed(); GNOME_SetClientList(); return; } #define DEBUG_ENTERNOTIFY 0 #if DEBUG_ENTERNOTIFY static int ecount=0; #define ENTER_DBG(x) fprintf x; #else #define ENTER_DBG(x) #endif void HandleEnterNotify(const evh_args_t *ea) { const XEnterWindowEvent *ewp; XEvent d; FvwmWindow *sf; static Bool is_initial_ungrab_pending = True; Bool is_tear_off_menu; const XEvent *te = ea->exc->x.etrigger; FvwmWindow * const fw = ea->exc->w.fw; DBUG("HandleEnterNotify", "Routine Entered"); ewp = &te->xcrossing; ENTER_DBG((stderr, "++++++++ en (%d): fw 0x%08x w 0x%08x sw 0x%08xmode 0x%x detail 0x%x '%s'\n", ++ecount, (int)fw, (int)ewp->window, (int)ewp->subwindow, ewp->mode, ewp->detail, fw?fw->visible_name:"(none)")); if ( ewp->window == Scr.Root && ewp->detail == NotifyInferior && ewp->mode == NotifyNormal) { /* pointer left subwindow */ BroadcastPacket( MX_ENTER_WINDOW, 3, (long)Scr.Root, (long)NULL, (long)NULL); } else if ( ewp->window == Scr.Root && ewp->detail == NotifyNonlinearVirtual) { /* pointer entered screen */ BroadcastPacket( MX_ENTER_WINDOW, 3, (long)Scr.Root, (long)NULL, (long)NULL); } if (Scr.ColormapFocus == COLORMAP_FOLLOWS_MOUSE) { if (fw && !IS_ICONIFIED(fw) && ewp->window == FW_W(fw)) { InstallWindowColormaps(fw); } else { /* make sure its for one of our windows */ /* handle a subwindow cmap */ InstallWindowColormaps(NULL); } } else if (!fw) { EnterSubWindowColormap(ewp->window); } if (Scr.flags.is_wire_frame_displayed) { ENTER_DBG((stderr, "en: exit: iwfd\n")); /* Ignore EnterNotify events while a window is resized or moved * as a wire frame; otherwise the window list may be screwed * up. */ return; } if (fw) { if (ewp->window != FW_W_FRAME(fw) && ewp->window != FW_W_PARENT(fw) && ewp->window != FW_W(fw) && ewp->window != FW_W_ICON_TITLE(fw) && ewp->window != FW_W_ICON_PIXMAP(fw)) { /* Ignore EnterNotify that received by any of the sub * windows that don't handle this event. unclutter * triggers these events sometimes, re focusing an * unfocused window under the pointer */ ENTER_DBG((stderr, "en: exit: funny window\n")); return; } } if (Scr.focus_in_pending_window != NULL) { ENTER_DBG((stderr, "en: exit: fipw\n")); /* Ignore EnterNotify event while we are waiting for a window to * receive focus via Focus or FlipFocus commands. */ focus_grab_buttons(fw); return; } if (ewp->mode == NotifyGrab) { ENTER_DBG((stderr, "en: exit: NotifyGrab\n")); return; } else if (ewp->mode == NotifyNormal) { ENTER_DBG((stderr, "en: NotifyNormal\n")); if (ewp->detail == NotifyNonlinearVirtual && ewp->focus == False && ewp->subwindow != None) { /* This takes care of some buggy apps that forget that * one of their dialog subwindows has the focus after * popping up a selection list several times (ddd, * netscape). I'm not convinced that this does not * break something else. */ ENTER_DBG((stderr, "en: NN: refreshing focus\n")); refresh_focus(fw); } } else if (ewp->mode == NotifyUngrab) { ENTER_DBG((stderr, "en: NotifyUngrab\n")); /* Ignore events generated by grabbing or ungrabbing the * pointer. However, there is no way to prevent the client * application from handling this event and, for example, * grabbing the focus. This will interfere with functions that * transferred the focus to a different window. */ if (is_initial_ungrab_pending) { ENTER_DBG((stderr, "en: NU: initial ungrab pending (lgw = NULL)\n")); is_initial_ungrab_pending = False; xcrossing_last_grab_window = NULL; } else { if (ewp->detail == NotifyNonlinearVirtual && ewp->focus == False && ewp->subwindow != None) { /* see comment above */ ENTER_DBG((stderr, "en: NU: refreshing focus\n")); refresh_focus(fw); } if (fw && fw == xcrossing_last_grab_window) { ENTER_DBG((stderr, "en: exit: NU: is last grab window\n")); if (ewp->window == FW_W_FRAME(fw) || ewp->window == FW_W_ICON_TITLE(fw) || ewp->window == FW_W_ICON_PIXMAP(fw)) { ENTER_DBG((stderr, "en: exit: NU: last grab window = NULL\n")); xcrossing_last_grab_window = NULL; } focus_grab_buttons(fw); return; } else if (fw) { if (ewp->window != FW_W_FRAME(fw) && ewp->window != FW_W_ICON_TITLE(fw) && ewp->window != FW_W_ICON_PIXMAP(fw)) { ENTER_DBG((stderr, "en: exit: NU: not frame window\n")); focus_grab_buttons(fw); return; } } } } if (fw) { is_initial_ungrab_pending = False; } /* look for a matching leaveNotify which would nullify this EnterNotify */ /* * RBW - if we're in startup, this is a coerced focus, so we don't * want to save the event time, or exit prematurely. * * Ignore LeaveNotify events for tear out menus - handled by menu code */ is_tear_off_menu = (fw && IS_TEAR_OFF_MENU(fw) && ewp->window == FW_W(fw)); if (!fFvwmInStartup && !is_tear_off_menu && FCheckTypedWindowEvent(dpy, ewp->window, LeaveNotify, &d)) { if (d.xcrossing.mode == NotifyNormal && d.xcrossing.detail != NotifyInferior) { ENTER_DBG((stderr, "en: exit: found LeaveNotify\n")); return; } } if (ewp->window == Scr.Root) { FvwmWindow *lf = get_last_screen_focus_window(); if (!Scr.flags.is_pointer_on_this_screen) { Scr.flags.is_pointer_on_this_screen = 1; if (lf && lf != &Scr.FvwmRoot && !FP_DO_UNFOCUS_LEAVE(FW_FOCUS_POLICY(lf))) { SetFocusWindow(lf, True, FOCUS_SET_FORCE); } else if (lf != &Scr.FvwmRoot) { ForceDeleteFocus(); } else { /* This was the first EnterNotify event for the * root window - ignore */ } set_last_screen_focus_window(NULL); } else if (!(sf = get_focus_window()) || FP_DO_UNFOCUS_LEAVE(FW_FOCUS_POLICY(sf))) { DeleteFocus(True); } else if ( Scr.UnknownWinFocused != None && sf != NULL && FW_W(sf) == Scr.StolenFocusWin) { __refocus_stolen_focus_win(ea); } if (Scr.ColormapFocus == COLORMAP_FOLLOWS_MOUSE) { InstallWindowColormaps(NULL); } focus_grab_buttons(lf); return; } else { Scr.flags.is_pointer_on_this_screen = 1; } /* An EnterEvent in one of the PanFrameWindows activates the Paging or an EdgeCommand. */ if (is_pan_frame(ewp->window)) { char *edge_command = NULL; if ( Scr.UnknownWinFocused != None && (sf = get_focus_window()) != NULL && FW_W(sf) == Scr.StolenFocusWin) { __refocus_stolen_focus_win(ea); } /* check for edge commands */ if (ewp->window == Scr.PanFrameTop.win) { edge_command = Scr.PanFrameTop.command; } else if (ewp->window == Scr.PanFrameBottom.win) { edge_command = Scr.PanFrameBottom.command; } else if (ewp->window == Scr.PanFrameLeft.win) { edge_command = Scr.PanFrameLeft.command; } else if (ewp->window == Scr.PanFrameRight.win) { edge_command = Scr.PanFrameRight.command; } if (edge_command && ewp->mode == NotifyUngrab && ewp->detail == NotifyAncestor) { /* nothing */ } else if (edge_command) { execute_function(NULL, ea->exc, edge_command, 0); } else { /* no edge command for this pan frame - so we do * HandlePaging */ int delta_x = 0; int delta_y = 0; XEvent e; /* this was in the HandleMotionNotify before, HEDU */ Scr.flags.is_pointer_on_this_screen = 1; e = *te; HandlePaging( &e, Scr.EdgeScrollX, Scr.EdgeScrollY, &JunkX, &JunkY, &delta_x, &delta_y, True, True, False, Scr.ScrollDelay); return; } } if (!fw) { return; } if (IS_EWMH_DESKTOP(FW_W(fw))) { BroadcastPacket( MX_ENTER_WINDOW, 3, (long)Scr.Root, (long)NULL, (long)NULL); return; } if (ewp->window == FW_W_FRAME(fw) || ewp->window == FW_W_ICON_TITLE(fw) || ewp->window == FW_W_ICON_PIXMAP(fw)) { BroadcastPacket( MX_ENTER_WINDOW, 3, (long)FW_W(fw), (long)FW_W_FRAME(fw), (unsigned long)fw); } sf = get_focus_window(); if (sf && fw != sf && FP_DO_UNFOCUS_LEAVE(FW_FOCUS_POLICY(sf))) { ENTER_DBG((stderr, "en: delete focus\n")); DeleteFocus(True); } focus_grab_buttons(fw); if (FP_DO_FOCUS_ENTER(FW_FOCUS_POLICY(fw))) { ENTER_DBG((stderr, "en: set mousey focus\n")); if (ewp->window == FW_W(fw)) { /* Event is for the client window...*/ #ifndef EXPERIMENTAL_ROU_HANDLING_V2 /* RBW -- This may still be needed at times, I'm not *sure yet. */ SetFocusWindowClientEntered( fw, True, FOCUS_SET_BY_ENTER); #else SetFocusWindow(fw, True, FOCUS_SET_BY_ENTER); #endif } else { /* Event is for the frame...*/ SetFocusWindow(fw, True, FOCUS_SET_BY_ENTER); } } else if (focus_is_focused(fw) && focus_does_accept_input_focus(fw)) { /* We have to refresh the focus window here in case we left the * focused fvwm window. Motif apps may lose the input focus * otherwise. But do not try to refresh the focus of * applications that want to handle it themselves. */ focus_force_refresh_focus(fw); } else if (sf != fw) { /* Give the window a chance to grab the buttons needed for * raise-on-click */ focus_grab_buttons(sf); } if ( Scr.UnknownWinFocused != None && sf != NULL && FW_W(sf) == Scr.StolenFocusWin) { __refocus_stolen_focus_win(ea); } /* We get an EnterNotify with mode == UnGrab when fvwm releases the * grab held during iconification. We have to ignore this, or icon * title will be initially raised. */ if (IS_ICONIFIED(fw) && (ewp->mode == NotifyNormal) && (ewp->window == FW_W_ICON_PIXMAP(fw) || ewp->window == FW_W_ICON_TITLE(fw)) && FW_W_ICON_PIXMAP(fw) != None) { SET_ICON_ENTERED(fw, 1); DrawIconWindow(fw, True, False, False, False, NULL); } /* Check for tear off menus */ if (is_tear_off_menu) { menu_enter_tear_off_menu(ea->exc); } return; } void HandleExpose(const evh_args_t *ea) { XEvent e; FvwmWindow * const fw = ea->exc->w.fw; e = *ea->exc->x.etrigger; #if 0 /* This doesn't work well. Sometimes, the expose count is zero although * dozens of expose events are pending. This happens all the time * during a shading animation. Simply flush expose events * unconditionally. */ if (e.xexpose.count != 0) { flush_accumulate_expose(e.xexpose.window, &e); } #else flush_accumulate_expose(e.xexpose.window, &e); #endif if (fw == NULL) { return; } if (e.xany.window == FW_W_ICON_TITLE(fw) || e.xany.window == FW_W_ICON_PIXMAP(fw)) { DrawIconWindow(fw, True, True, False, False, &e); return; } else if (IS_TEAR_OFF_MENU(fw) && e.xany.window == FW_W(fw)) { /* refresh the contents of the torn out menu */ menu_expose(&e, NULL); } return; } void HandleFocusIn(const evh_args_t *ea) { XEvent d; Window w = None; Window focus_w = None; Window focus_fw = None; Pixel fc = 0; Pixel bc = 0; FvwmWindow *ffw_old = get_focus_window(); FvwmWindow *sf; Bool do_force_broadcast = False; Bool is_unmanaged_focused = False; static Window last_focus_w = None; static Window last_focus_fw = None; static Bool was_nothing_ever_focused = True; FvwmWindow *fw = ea->exc->w.fw; DBUG("HandleFocusIn", "Routine Entered"); Scr.focus_in_pending_window = NULL; /* This is a hack to make the PointerKey command work */ if (ea->exc->x.etrigger->xfocus.detail != NotifyPointer) { /**/ w = ea->exc->x.etrigger->xany.window; } while (FCheckTypedEvent(dpy, FocusIn, &d)) { /* dito */ if (d.xfocus.detail != NotifyPointer) { /**/ w = d.xany.window; } } /* dito */ if (w == None) { return; } /**/ if (XFindContext(dpy, w, FvwmContext, (caddr_t *) &fw) == XCNOENT) { fw = NULL; } Scr.UnknownWinFocused = None; if (!fw) { if (w != Scr.NoFocusWin) { Scr.UnknownWinFocused = w; Scr.StolenFocusWin = (ffw_old != NULL) ? FW_W(ffw_old) : None; focus_w = w; is_unmanaged_focused = True; } /* Only show a non-focused window as focused, * if the focus is on unmanaged and flickering qt dialogs * workaround is on. */ if (!Scr.bo.do_enable_flickering_qt_dialogs_workaround || !is_unmanaged_focused) { border_draw_decorations( Scr.Hilite, PART_ALL, False, True, CLEAR_ALL, NULL, NULL); if (Scr.ColormapFocus == COLORMAP_FOLLOWS_FOCUS) { if ((Scr.Hilite)&&(!IS_ICONIFIED(Scr.Hilite))) { InstallWindowColormaps(Scr.Hilite); } else { InstallWindowColormaps(NULL); } } } /* Not very useful if no window that fvwm and its modules know * about has the focus. */ fc = GetColor(DEFAULT_FORE_COLOR); bc = GetColor(DEFAULT_BACK_COLOR); } else if (fw != Scr.Hilite || /* domivogt (16-May-2000): This check is necessary to force * sending a M_FOCUS_CHANGE packet after an unmanaged window * was focused. Otherwise fvwm would believe that Scr.Hilite * was still focused and not send any info to the modules. */ last_focus_fw == None || IS_FOCUS_CHANGE_BROADCAST_PENDING(fw) || fpol_query_allow_user_focus(&FW_FOCUS_POLICY(fw))) { do_force_broadcast = IS_FOCUS_CHANGE_BROADCAST_PENDING(fw); SET_FOCUS_CHANGE_BROADCAST_PENDING(fw, 0); if (fw != Scr.Hilite && fpol_query_allow_user_focus(&FW_FOCUS_POLICY(fw))) { border_draw_decorations( fw, PART_ALL, True, True, CLEAR_ALL, NULL, NULL); } focus_w = FW_W(fw); focus_fw = FW_W_FRAME(fw); fc = fw->hicolors.fore; bc = fw->hicolors.back; set_focus_window(fw); if (Scr.ColormapFocus == COLORMAP_FOLLOWS_FOCUS) { if ((Scr.Hilite)&&(!IS_ICONIFIED(Scr.Hilite))) { InstallWindowColormaps(Scr.Hilite); } else { InstallWindowColormaps(NULL); } } } else { return; } if (was_nothing_ever_focused || last_focus_fw == None || focus_w != last_focus_w || focus_fw != last_focus_fw || do_force_broadcast) { if (!Scr.bo.do_enable_flickering_qt_dialogs_workaround || !is_unmanaged_focused) { BroadcastPacket( M_FOCUS_CHANGE, 5, (long)focus_w, (long)focus_fw, (unsigned long)IsLastFocusSetByMouse(), (long)fc, (long)bc); EWMH_SetActiveWindow(focus_w); } last_focus_w = focus_w; last_focus_fw = focus_fw; was_nothing_ever_focused = False; } if ((sf = get_focus_window()) != ffw_old) { focus_grab_buttons(sf); focus_grab_buttons(ffw_old); } return; } void HandleFocusOut(const evh_args_t *ea) { if (Scr.UnknownWinFocused != None && Scr.StolenFocusWin != None && ea->exc->x.etrigger->xfocus.window == Scr.UnknownWinFocused) { __refocus_stolen_focus_win(ea); } return; } void __handle_key(const evh_args_t *ea, Bool is_press) { char *action; FvwmWindow *sf; KeyCode kc; int kcontext; const XEvent *te = ea->exc->x.etrigger; const FvwmWindow * const fw = ea->exc->w.fw; Bool is_second_binding; const XClassHint *winClass1, *winClass2; XClassHint tmp; char *name1, *name2; const exec_context_t *exc; exec_context_changes_t ecc; PressedW = None; /* Here's a real hack - some systems have two keys with the * same keysym and different keycodes. This converts all * the cases to one keycode. */ kc = XKeysymToKeycode(dpy, XKeycodeToKeysym(dpy, te->xkey.keycode, 0)); /* Check if there is something bound to the key */ sf = get_focus_window(); if (sf == NULL) { tmp.res_name = tmp.res_class = name1 = "root"; winClass1 = &tmp; kcontext = C_ROOT; } else { winClass1 = &sf->class; name1 = sf->name.name; kcontext = (sf == fw ? ea->exc->w.wcontext : C_WINDOW); } if (fw == NULL) { tmp.res_name = tmp.res_class = name2 = "root"; winClass2 = &tmp; } else { winClass2 = &fw->class; name2 = fw->name.name; } /* Searching the binding list with a different 'type' value * (ie. BIND_KEYPRESS vs BIND_PKEYPRESS) doesn't make a difference. * The different context value does though. */ action = CheckTwoBindings( &is_second_binding, Scr.AllBindings, STROKE_ARG(0) kc, te->xkey.state, GetUnusedModifiers(), kcontext, BIND_KEYPRESS, winClass1, name1, ea->exc->w.wcontext, BIND_PKEYPRESS, winClass2, name2); if (action != NULL) { if (!is_press) { XAllowEvents(dpy, AsyncKeyboard, CurrentTime); return; } exc = ea->exc; if (is_second_binding == False) { ecc.w.fw = sf; ecc.w.wcontext = kcontext; exc = exc_clone_context( ea->exc, &ecc, ECC_FW | ECC_WCONTEXT); } execute_function(NULL, exc, action, 0); if (is_second_binding == False) { exc_destroy_context(exc); } XAllowEvents(dpy, AsyncKeyboard, CurrentTime); return; } /* if we get here, no function key was bound to the key. Send it * to the client if it was in a window we know about. */ sf = get_focus_window(); if (sf && te->xkey.window != FW_W(sf)) { XEvent e; e = *te; e.xkey.window = FW_W(sf); FSendEvent( dpy, e.xkey.window, False, (is_press)? KeyPressMask:KeyReleaseMask, &e); } else if (fw && te->xkey.window != FW_W(fw)) { XEvent e; e = *te; e.xkey.window = FW_W(fw); FSendEvent( dpy, e.xkey.window, False, (is_press)? KeyPressMask:KeyReleaseMask, &e); } XAllowEvents(dpy, AsyncKeyboard, CurrentTime); return; } void HandleKeyPress(const evh_args_t *ea) { __handle_key(ea, True); } void HandleKeyRelease(const evh_args_t *ea) { __handle_key(ea, False); } void HandleLeaveNotify(const evh_args_t *ea) { const XLeaveWindowEvent *lwp; const XEvent *te = ea->exc->x.etrigger; FvwmWindow * const fw = ea->exc->w.fw; DBUG("HandleLeaveNotify", "Routine Entered"); ENTER_DBG((stderr, "-------- ln (%d): fw 0x%08x w 0x%08x sw 0x%08x mode 0x%x detail 0x%x '%s'\n", ++ecount, (int)fw, (int)te->xcrossing.window, (int)te->xcrossing.subwindow, te->xcrossing.mode, te->xcrossing.detail, fw?fw->visible_name:"(none)")); lwp = &te->xcrossing; if ( lwp->window == Scr.Root && lwp->detail == NotifyInferior && lwp->mode == NotifyNormal) { /* pointer entered subwindow */ BroadcastPacket( MX_LEAVE_WINDOW, 3, (long)Scr.Root, (long)NULL, (long)NULL); } else if ( lwp->window == Scr.Root && lwp->detail == NotifyNonlinearVirtual) { /* pointer left screen */ BroadcastPacket( MX_LEAVE_WINDOW, 3, (long)Scr.Root, (long)NULL, (long)NULL); } /* Ignore LeaveNotify events while a window is resized or moved as a * wire frame; otherwise the window list may be screwed up. */ if (Scr.flags.is_wire_frame_displayed) { return; } if (lwp->mode != NotifyNormal) { /* Ignore events generated by grabbing or ungrabbing the * pointer. However, there is no way to prevent the client * application from handling this event and, for example, * grabbing the focus. This will interfere with functions that * transferred the focus to a different window. It is * necessary to check for LeaveNotify events on the client * window too in case buttons are not grabbed on it. */ if (lwp->mode == NotifyGrab && fw && (lwp->window == FW_W_FRAME(fw) || lwp->window == FW_W(fw) || lwp->window == FW_W_ICON_TITLE(fw) || lwp->window == FW_W_ICON_PIXMAP(fw))) { ENTER_DBG((stderr, "ln: *** lgw = 0x%08x\n", (int)fw)); xcrossing_last_grab_window = fw; } #ifdef FOCUS_EXPANDS_TITLE if (fw && IS_ICONIFIED(fw)) { SET_ICON_ENTERED(fw, 0); DrawIconWindow( fw, True, False, False, False, NULL); } #endif return; } /* CDE-like behaviour of raising the icon title if the icon gets the focus (in particular if the cursor is over the icon) */ if (fw && IS_ICONIFIED(fw)) { SET_ICON_ENTERED(fw,0); DrawIconWindow(fw, True, False, False, False, NULL); } /* An LeaveEvent in one of the PanFrameWindows activates an EdgeLeaveCommand. */ if (is_pan_frame(lwp->window)) { char *edge_command_leave = NULL; /* check for edge commands */ if (lwp->window == Scr.PanFrameTop.win) { edge_command_leave = Scr.PanFrameTop.command_leave; } else if (lwp->window == Scr.PanFrameBottom.win) { edge_command_leave = Scr.PanFrameBottom.command_leave; } else if (lwp->window == Scr.PanFrameLeft.win) { edge_command_leave = Scr.PanFrameLeft.command_leave; } else if (lwp->window == Scr.PanFrameRight.win) { edge_command_leave = Scr.PanFrameRight.command_leave; } if (edge_command_leave && lwp->mode == NotifyUngrab && lwp->detail == NotifyAncestor) { /* nothing */ } else if (edge_command_leave) { execute_function(NULL, ea->exc, edge_command_leave, 0); } } /* If we leave the root window, then we're really moving * another screen on a multiple screen display, and we * need to de-focus and unhighlight to make sure that we * don't end up with more than one highlighted window at a time */ if (lwp->window == Scr.Root && /* domivogt (16-May-2000): added this test because somehow fvwm * sometimes gets a LeaveNotify on the root window although it is * single screen. */ Scr.NumberOfScreens > 1) { if (lwp->mode == NotifyNormal) { if (lwp->detail != NotifyInferior) { FvwmWindow *sf = get_focus_window(); Scr.flags.is_pointer_on_this_screen = 0; set_last_screen_focus_window(sf); if (sf != NULL) { DeleteFocus(True); } if (Scr.Hilite != NULL) { border_draw_decorations( Scr.Hilite, PART_ALL, False, True, CLEAR_ALL, NULL, NULL); } } } } else { /* handle a subwindow cmap */ LeaveSubWindowColormap(te->xany.window); } if (fw != NULL && (lwp->window == FW_W_FRAME(fw) || lwp->window == FW_W_ICON_TITLE(fw) || lwp->window == FW_W_ICON_PIXMAP(fw))) { BroadcastPacket( MX_LEAVE_WINDOW, 3, (long)FW_W(fw), (long)FW_W_FRAME(fw), (unsigned long)fw); } return; } void HandleMapNotify(const evh_args_t *ea) { Bool is_on_this_page = False; const XEvent *te = ea->exc->x.etrigger; FvwmWindow * const fw = ea->exc->w.fw; DBUG("HandleMapNotify", "Routine Entered"); if (!fw) { if (te->xmap.override_redirect == True && te->xmap.window != Scr.NoFocusWin) { XSelectInput(dpy, te->xmap.window, XEVMASK_ORW); XFlush(dpy); Scr.UnknownWinFocused = te->xmap.window; } return; } if (te->xmap.window == FW_W_FRAME(fw)) { /* Now that we know the frame is mapped after capturing the * window we do not need StructureNotifyMask events anymore. */ XSelectInput(dpy, FW_W_FRAME(fw), XEVMASK_FRAMEW); XFlush(dpy); } /* Except for identifying over-ride redirect window mappings, we * don't need or want windows associated with the * SubstructureNotifyMask */ if (te->xmap.event != te->xmap.window) { return; } SET_MAP_PENDING(fw, 0); /* don't map if the event was caused by a de-iconify */ if (IS_ICONIFY_PENDING(fw)) { return; } /* Make sure at least part of window is on this page before giving it * focus... */ is_on_this_page = IsRectangleOnThisPage(&(fw->g.frame), fw->Desk); /* * Need to do the grab to avoid race condition of having server send * MapNotify to client before the frame gets mapped; this is bad because * the client would think that the window has a chance of being viewable * when it really isn't. */ MyXGrabServer (dpy); if (FW_W_ICON_TITLE(fw)) { XUnmapWindow(dpy, FW_W_ICON_TITLE(fw)); } if (FW_W_ICON_PIXMAP(fw) != None) { XUnmapWindow(dpy, FW_W_ICON_PIXMAP(fw)); } XMapSubwindows(dpy, FW_W_FRAME(fw)); if (fw->Desk == Scr.CurrentDesk) { XMapWindow(dpy, FW_W_FRAME(fw)); } if (IS_ICONIFIED(fw)) { BroadcastPacket( M_DEICONIFY, 3, (long)FW_W(fw), (long)FW_W_FRAME(fw), (unsigned long)fw); } else { BroadcastPacket( M_MAP, 3, (long)FW_W(fw), (long)FW_W_FRAME(fw), (unsigned long)fw); } if (is_on_this_page && focus_query_open_grab_focus(fw, get_focus_window()) == True) { SetFocusWindow(fw, True, FOCUS_SET_FORCE); } border_draw_decorations( fw, PART_ALL, (fw == get_focus_window()) ? True : False, True, CLEAR_ALL, NULL, NULL); MyXUngrabServer (dpy); SET_MAPPED(fw, 1); SET_ICONIFIED(fw, 0); SET_ICON_UNMAPPED(fw, 0); if (DO_ICONIFY_AFTER_MAP(fw)) { initial_window_options_t win_opts; /* finally, if iconification was requested before the window * was mapped, request it now. */ memset(&win_opts, 0, sizeof(win_opts)); Iconify(fw, &win_opts); SET_ICONIFY_AFTER_MAP(fw, 0); } focus_grab_buttons_on_layer(fw->layer); return; } void HandleMappingNotify(const evh_args_t *ea) { XRefreshKeyboardMapping(&ea->exc->x.etrigger->xmapping); return; } void HandleMapRequest(const evh_args_t *ea) { DBUG("HandleMapRequest", "Routine Entered"); if (fFvwmInStartup) { /* Just map the damn thing, decorations are added later * in CaptureAllWindows. */ XMapWindow(dpy, ea->exc->x.etrigger->xmaprequest.window); return; } HandleMapRequestKeepRaised(ea, None, NULL, NULL); return; } void HandleMapRequestKeepRaised( const evh_args_t *ea, Window KeepRaised, FvwmWindow *ReuseWin, initial_window_options_t *win_opts) { Bool is_on_this_page = False; Bool is_new_window = False; FvwmWindow *tmp; FvwmWindow *sf; initial_window_options_t win_opts_bak; Window ew; FvwmWindow *fw; extern Bool Restarting; const char *initial_map_command; initial_map_command = NULL; if (win_opts == NULL) { memset(&win_opts_bak, 0, sizeof(win_opts_bak)); win_opts = &win_opts_bak; } ew = ea->exc->w.w; if (ReuseWin == NULL) { if (XFindContext(dpy, ew, FvwmContext, (caddr_t *)&fw) == XCNOENT) { fw = NULL; } if (fw != NULL && IS_MAP_PENDING(fw)) { /* The window is already going to be mapped, no need to * do that twice */ return; } } else { fw = ReuseWin; } if (fw == NULL && EWMH_IsKdeSysTrayWindow(ew)) { /* This means that the window is swallowed by kicker and that * kicker restart or exit. As we should assume that kicker * restart we should return here, if not we go into trouble * ... */ return; } if (!win_opts->flags.do_override_ppos) { XFlush(dpy); } /* If the window has never been mapped before ... */ if (!fw || (fw && DO_REUSE_DESTROYED(fw))) { check_if_event_args args; XEvent dummy; args.w = ew; args.do_return_true = True; args.do_return_true_cr = False; if ( FCheckIfEvent( dpy, &dummy, test_withdraw_request, (XPointer)&args)) { /* The window is moved back to the WithdrawnState * immideately. Don't map it. * * However, send make sure that a WM_STATE * PropertyNotify event is sent to the window. * QT needs this. */ Atom atype; int aformat; unsigned long nitems, bytes_remain; unsigned char *prop; if ( XGetWindowProperty( dpy, ew, _XA_WM_STATE, 0L, 3L, False, _XA_WM_STATE, &atype, &aformat, &nitems,&bytes_remain,&prop) == Success) { if (prop != NULL) { XFree(prop); XDeleteProperty(dpy, ew, _XA_WM_STATE); } else { XPropertyEvent ev; ev.type = PropertyNotify; ev.display = dpy; ev.window = ew; ev.atom = _XA_WM_STATE; ev.time = fev_get_evtime(); ev.state = PropertyDelete; FSendEvent( dpy, ew, True, PropertyChangeMask, (XEvent*)&ev); } } return; } /* Add decorations. */ fw = AddWindow( &initial_map_command, ea->exc, ReuseWin, win_opts); if (fw == AW_NO_WINDOW) { return; } else if (fw == AW_UNMANAGED) { XMapWindow(dpy, ew); return; } is_new_window = True; } /* * Make sure at least part of window is on this page * before giving it focus... */ is_on_this_page = IsRectangleOnThisPage(&(fw->g.frame), fw->Desk); if (KeepRaised != None) { XRaiseWindow(dpy, KeepRaised); } /* If it's not merely iconified, and we have hints, use them. */ if (IS_ICONIFIED(fw)) { /* If no hints, or currently an icon, just "deiconify" */ DeIconify(fw); } else if (IS_MAPPED(fw)) { /* the window is already mapped - fake a MapNotify event */ fake_map_unmap_notify(fw, MapNotify); } else { int state; if (fw->wmhints && (fw->wmhints->flags & StateHint)) { state = fw->wmhints->initial_state; } else { state = NormalState; } if (win_opts->initial_state != DontCareState) { state = win_opts->initial_state; } switch (state) { case DontCareState: case NormalState: case InactiveState: default: MyXGrabServer(dpy); if (fw->Desk == Scr.CurrentDesk) { Bool do_grab_focus; SET_MAP_PENDING(fw, 1); XMapWindow(dpy, FW_W_FRAME(fw)); XMapWindow(dpy, FW_W(fw)); SetMapStateProp(fw, NormalState); if (Scr.flags.is_map_desk_in_progress) { do_grab_focus = False; } else if (!is_on_this_page) { do_grab_focus = False; } else if (focus_query_open_grab_focus( fw, get_focus_window()) == True) { do_grab_focus = True; } else { do_grab_focus = False; } if (do_grab_focus) { SetFocusWindow( fw, True, FOCUS_SET_FORCE); } else { /* make sure the old focused window * still has grabbed all necessary * buttons. */ focus_grab_buttons( get_focus_window()); } } else { #ifndef ICCCM2_UNMAP_WINDOW_PATCH /* nope, this is forbidden by the ICCCM2 */ XMapWindow(dpy, FW_W(fw)); SetMapStateProp(fw, NormalState); #else /* Since we will not get a MapNotify, set the * IS_MAPPED flag manually. */ SET_MAPPED(fw, 1); SetMapStateProp(fw, IconicState); /* fake that the window was mapped to allow * modules to swallow it */ BroadcastPacket( M_MAP, 3, (long)FW_W(fw), (long)FW_W_FRAME(fw), (unsigned long)fw); #endif } /* TA: 20090125: We *have* to handle * InitialMapCommand here and not in AddWindow() to * allow for correct timings when the window is truly * mapped. (c.f. things like Iconify.) */ /* TA: 20091212: But only do this when we're *not* * restarting -- the window is still mapped, but gets * recaptured -- we don't want to trigger this event * again. Otherwise we end up toggling the state of * the window in situations where the * InitialMapCommand is Iconify or Maximize, for * instance. */ if ((initial_map_command != NULL) && (!Restarting && Scr.flags.are_windows_captured)) { execute_function_override_window( NULL, ea->exc, (char *)initial_map_command, 0, fw); } MyXUngrabServer(dpy); break; case IconicState: if (is_new_window) { /* the window will not be mapped - fake a * MapNotify and an UnmapNotify event. Can't * remember exactly why this is necessary, but * probably something w/ (de)iconify state * confusion. */ fake_map_unmap_notify(fw, MapNotify); fake_map_unmap_notify(fw, UnmapNotify); } if (win_opts->flags.is_iconified_by_parent || ((tmp = get_transientfor_fvwmwindow(fw)) && IS_ICONIFIED(tmp))) { win_opts->flags.is_iconified_by_parent = 0; SET_ICONIFIED_BY_PARENT(fw, 1); } if (USE_ICON_POSITION_HINT(fw) && fw->wmhints && (fw->wmhints->flags & IconPositionHint)) { win_opts->default_icon_x = fw->wmhints->icon_x; win_opts->default_icon_y = fw->wmhints->icon_y; } Iconify(fw, win_opts); break; } } if (IS_SHADED(fw)) { BroadcastPacket( M_WINDOWSHADE, 3, (long)FW_W(fw), (long)FW_W_FRAME(fw), (unsigned long)fw); } /* If the newly mapped window overlaps the focused window, make sure * ClickToFocusRaises and MouseFocusClickRaises work again. */ sf = get_focus_window(); if (sf != NULL) { focus_grab_buttons(sf); } if (win_opts->flags.is_menu) { SET_MAPPED(fw, 1); SET_MAP_PENDING(fw, 0); } EWMH_SetClientList(); EWMH_SetClientListStacking(); GNOME_SetClientList(); return; } #ifdef HAVE_STROKE void HandleMotionNotify(const evh_args_t *ea) { DBUG("HandleMotionNotify", "Routine Entered"); if (send_motion == True) { stroke_record( ea->exc->x.etrigger->xmotion.x, ea->exc->x.etrigger->xmotion.y); } return; } #endif /* HAVE_STROKE */ void HandlePropertyNotify(const evh_args_t *ea) { Bool OnThisPage = False; Bool has_icon_changed = False; Bool has_icon_pixmap_hint_changed = False; Bool has_icon_window_hint_changed = False; FlocaleNameString new_name = { NoName, NULL }; int old_wmhints_flags; const XEvent *te = ea->exc->x.etrigger; char *urgency_action = NULL; FvwmWindow * const fw = ea->exc->w.fw; DBUG("HandlePropertyNotify", "Routine Entered"); if (te->xproperty.window == Scr.Root && te->xproperty.state == PropertyNewValue && (te->xproperty.atom == _XA_XSETROOT_ID || te->xproperty.atom == _XA_XROOTPMAP_ID)) { /* background change */ /* _XA_XSETROOT_ID is used by fvwm-root, xli and more (xv sends * no property notify?). _XA_XROOTPMAP_ID is used by Esetroot * compatible program: the problem here is that with some * Esetroot compatible program we get the message _before_ the * background change. This is fixed with Esetroot 9.2 (not yet * released, 2002-01-14) */ /* update icon window with some alpha and tear-off menu */ FvwmWindow *t; for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { int cs; int t_cs = -1; int b_cs = t->icon_background_cs; Bool draw_picture = False; Bool draw_title = False; /* redraw ParentRelative tear-off menu */ menu_redraw_transparent_tear_off_menu(t, True); if (!IS_ICONIFIED(t) || IS_ICON_SUPPRESSED(t)) { continue; } if (Scr.Hilite == t) { if (t->icon_title_cs_hi >= 0) { t_cs = cs = t->icon_title_cs_hi; } else { cs = t->cs_hi; } } else { if (t->icon_title_cs >= 0) { t_cs = cs = t->icon_title_cs; } else { cs = t->cs; } } if (t->icon_alphaPixmap != None || (cs >= 0 && Colorset[cs].icon_alpha_percent < 100) || CSET_IS_TRANSPARENT_PR(b_cs) || (!IS_ICON_SHAPED(t) && t->icon_background_padding > 0)) { draw_picture = True; } if (CSET_IS_TRANSPARENT_PR(t_cs)) { draw_title = True; } if (draw_title || draw_picture) { DrawIconWindow( t, draw_title, draw_picture, False, draw_picture, NULL); } } if (te->xproperty.atom == _XA_XROOTPMAP_ID) { update_root_transparent_colorset(te->xproperty.atom); } BroadcastPropertyChange( MX_PROPERTY_CHANGE_BACKGROUND, 0, 0, ""); return; } if (!fw) { return; } if (XGetGeometry( dpy, FW_W(fw), &JunkRoot, &JunkX, &JunkY, (unsigned int*)&JunkWidth, (unsigned int*)&JunkHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth) == 0) { return; } /* * Make sure at least part of window is on this page * before giving it focus... */ OnThisPage = IsRectangleOnThisPage(&(fw->g.frame), fw->Desk); switch (te->xproperty.atom) { case XA_WM_TRANSIENT_FOR: flush_property_notify(XA_WM_TRANSIENT_FOR, FW_W(fw)); if (setup_transientfor(fw) == True) { RaiseWindow(fw, False); } break; case XA_WM_NAME: flush_property_notify(XA_WM_NAME, FW_W(fw)); if (HAS_EWMH_WM_NAME(fw)) { return; } FlocaleGetNameProperty(XGetWMName, dpy, FW_W(fw), &new_name); if (new_name.name == NULL) { FlocaleFreeNameProperty(&new_name); return; } if (strlen(new_name.name) > MAX_WINDOW_NAME_LEN) { /* limit to prevent hanging X server */ (new_name.name)[MAX_WINDOW_NAME_LEN] = 0; } if (fw->name.name && strcmp(new_name.name, fw->name.name) == 0) { /* migo: some apps update their names every second */ /* griph: make sure we don't free the property if it is THE same name */ if (new_name.name != fw->name.name) { FlocaleFreeNameProperty(&new_name); } return; } free_window_names(fw, True, False); fw->name = new_name; SET_NAME_CHANGED(fw, 1); if (fw->name.name == NULL) { fw->name.name = NoName; /* must not happen */ } setup_visible_name(fw, False); BroadcastWindowIconNames(fw, True, False); /* fix the name in the title bar */ if (!IS_ICONIFIED(fw)) { border_draw_decorations( fw, PART_TITLE, (Scr.Hilite == fw), True, CLEAR_ALL, NULL, NULL); } EWMH_SetVisibleName(fw, False); /* * if the icon name is NoName, set the name of the icon to be * the same as the window */ if (!WAS_ICON_NAME_PROVIDED(fw) || (fw->icon_name.name && (fw->icon_name.name != fw->name.name))) { fw->icon_name = fw->name; setup_visible_name(fw, True); BroadcastWindowIconNames(fw, False, True); RedoIconName(fw); } break; case XA_WM_ICON_NAME: flush_property_notify(XA_WM_ICON_NAME, FW_W(fw)); if (HAS_EWMH_WM_ICON_NAME(fw)) { return; } FlocaleGetNameProperty( XGetWMIconName, dpy, FW_W(fw), &new_name); if (new_name.name == NULL) { FlocaleFreeNameProperty(&new_name); return; } if (new_name.name && strlen(new_name.name) > MAX_ICON_NAME_LEN) { /* limit to prevent hanging X server */ (new_name.name)[MAX_ICON_NAME_LEN] = 0; } if (fw->icon_name.name && strcmp(new_name.name, fw->icon_name.name) == 0) { /* migo: some apps update their names every second */ /* griph: make sure we don't free the property if it is THE same name */ if (new_name.name != fw->icon_name.name) { FlocaleFreeNameProperty(&new_name); } return; } free_window_names(fw, False, True); fw->icon_name = new_name; SET_WAS_ICON_NAME_PROVIDED(fw, 1); if (fw->icon_name.name == NULL) { /* currently never happens */ fw->icon_name.name = fw->name.name; SET_WAS_ICON_NAME_PROVIDED(fw, 0); } setup_visible_name(fw, True); BroadcastWindowIconNames(fw, False, True); RedoIconName(fw); EWMH_SetVisibleName(fw, True); break; case XA_WM_HINTS: flush_property_notify(XA_WM_HINTS, FW_W(fw)); /* clasen@mathematik.uni-freiburg.de - 02/01/1998 - new - * the urgency flag is an ICCCM 2.0 addition to the WM_HINTS. */ old_wmhints_flags = 0; if (fw->wmhints) { old_wmhints_flags = fw->wmhints->flags; XFree ((char *) fw->wmhints); } setup_wm_hints(fw); if (fw->wmhints == NULL) { return; } /* * rebuild icon if the client either provides an icon * pixmap or window or has reset the hints to `no icon'. */ if ((fw->wmhints->flags & IconPixmapHint) || (old_wmhints_flags & IconPixmapHint)) { ICON_DBG((stderr, "hpn: iph changed (%d) '%s'\n", !!(int)(fw->wmhints->flags & IconPixmapHint), fw->name)); has_icon_pixmap_hint_changed = True; } if ((fw->wmhints->flags & IconWindowHint) || (old_wmhints_flags & IconWindowHint)) { ICON_DBG((stderr, "hpn: iwh changed (%d) '%s'\n", !!(int)(fw->wmhints->flags & IconWindowHint), fw->name)); has_icon_window_hint_changed = True; SET_USE_EWMH_ICON(fw, False); } increase_icon_hint_count(fw); if (has_icon_window_hint_changed || has_icon_pixmap_hint_changed) { if (ICON_OVERRIDE_MODE(fw) == ICON_OVERRIDE) { ICON_DBG((stderr, "hpn: icon override '%s'\n", fw->name)); has_icon_changed = False; } else if (ICON_OVERRIDE_MODE(fw) == NO_ACTIVE_ICON_OVERRIDE) { if (has_icon_pixmap_hint_changed) { if (WAS_ICON_HINT_PROVIDED(fw) == ICON_HINT_MULTIPLE) { ICON_DBG((stderr, "hpn: using further iph '%s'\n", fw->name)); has_icon_changed = True; } else if (fw->icon_bitmap_file == NULL || fw->icon_bitmap_file == Scr.DefaultIcon) { ICON_DBG((stderr, "hpn: using first iph '%s'\n", fw->name)); has_icon_changed = True; } else { /* ignore the first icon pixmap * hint if the application did * not provide it from the * start */ ICON_DBG((stderr, "hpn: first iph ignored '%s'\n", fw->name)); has_icon_changed = False; } } else if (has_icon_window_hint_changed) { ICON_DBG((stderr, "hpn: using iwh '%s'\n", fw->name)); has_icon_changed = True; } else { ICON_DBG((stderr, "hpn: iwh not changed, hint ignored '%s'\n", fw->name)); has_icon_changed = False; } } else /* NO_ICON_OVERRIDE */ { ICON_DBG((stderr, "hpn: using hint '%s'\n", fw->name)); has_icon_changed = True; } if (USE_EWMH_ICON(fw)) { has_icon_changed = False; } if (has_icon_changed) { ICON_DBG((stderr, "hpn: icon changed '%s'\n", fw->name)); /* Okay, the icon hint has changed and style * options tell us to honour this change. Now * let's see if we have to use the application * provided pixmap or window (if any), the icon * file provided by the window's style or the * default style's icon. */ if (fw->icon_bitmap_file == Scr.DefaultIcon) { fw->icon_bitmap_file = NULL; } if (!fw->icon_bitmap_file && !(fw->wmhints->flags & (IconPixmapHint|IconWindowHint))) { fw->icon_bitmap_file = (Scr.DefaultIcon) ? Scr.DefaultIcon : NULL; } fw->iconPixmap = (Window)NULL; ChangeIconPixmap(fw); } } /* clasen@mathematik.uni-freiburg.de - 02/01/1998 - new - * the urgency flag is an ICCCM 2.0 addition to the WM_HINTS. * Treat urgency changes by calling user-settable functions. * These could e.g. deiconify and raise the window or * temporarily change the decor. */ if (!(old_wmhints_flags & XUrgencyHint) && (fw->wmhints->flags & XUrgencyHint)) { urgency_action = "Function UrgencyFunc"; } if ((old_wmhints_flags & XUrgencyHint) && !(fw->wmhints->flags & XUrgencyHint)) { urgency_action = "Function UrgencyDoneFunc"; } if (urgency_action) { const exec_context_t *exc; exec_context_changes_t ecc; ecc.w.fw = fw; ecc.w.wcontext = C_WINDOW; exc = exc_clone_context( ea->exc, &ecc, ECC_FW | ECC_WCONTEXT); execute_function(NULL, exc, urgency_action, 0); exc_destroy_context(exc); } break; case XA_WM_NORMAL_HINTS: /* just mark wm normal hints as changed and look them up when * the next ConfigureRequest w/ x, y, width or height set * arrives. */ SET_HAS_NEW_WM_NORMAL_HINTS(fw, 1); /* TA: 20120317: Always set the size hints here, regardless * of them possibly being modified by a ConfigureNotify * request, due to XSizeHints disallowing resize -- FVWM would * always use old values if the application decided to toggle * such things, and FVWM would then never resize the window. * * Note that SET_HAS_NEW_WM_NORMAL_HINTS being set here to * true is still valid. */ GetWindowSizeHints(fw); break; default: if (te->xproperty.atom == _XA_WM_PROTOCOLS) { FetchWmProtocols (fw); } else if (te->xproperty.atom == _XA_WM_COLORMAP_WINDOWS) { FetchWmColormapWindows (fw); /* frees old data */ ReInstallActiveColormap(); } else if (te->xproperty.atom == _XA_WM_STATE) { if (fw && OnThisPage && focus_is_focused(fw) && FP_DO_FOCUS_ENTER(FW_FOCUS_POLICY(fw))) { /* refresh the focus - why? */ focus_force_refresh_focus(fw); } } else { EWMH_ProcessPropertyNotify(ea->exc); } break; } } void HandleReparentNotify(const evh_args_t *ea) { const XEvent *te = ea->exc->x.etrigger; FvwmWindow * const fw = ea->exc->w.fw; if (!fw) { return; } if (te->xreparent.parent == Scr.Root) { /* Ignore reparenting to the root window. In some cases these * events are selected although the window is no longer * managed. */ return; } if (te->xreparent.parent != FW_W_FRAME(fw)) { /* window was reparented by someone else, destroy the frame */ SetMapStateProp(fw, WithdrawnState); EWMH_RestoreInitialStates(fw, te->type); if (!IS_TEAR_OFF_MENU(fw)) { XRemoveFromSaveSet(dpy, te->xreparent.window); XSelectInput(dpy, te->xreparent.window, NoEventMask); } else { XSelectInput(dpy, te->xreparent.window, XEVMASK_MENUW); } discard_events(XEVMASK_FRAMEW); destroy_window(fw); EWMH_ManageKdeSysTray(te->xreparent.window, te->type); EWMH_WindowDestroyed(); } return; } void HandleSelectionRequest(const evh_args_t *ea) { icccm2_handle_selection_request(ea->exc->x.etrigger); return; } void HandleSelectionClear(const evh_args_t *ea) { icccm2_handle_selection_clear(); return; } void HandleShapeNotify(const evh_args_t *ea) { FvwmWindow * const fw = ea->exc->w.fw; DBUG("HandleShapeNotify", "Routine Entered"); if (FShapesSupported) { const FShapeEvent *sev = (const FShapeEvent *)(ea->exc->x.etrigger); if (!fw) { return; } if (sev->kind != FShapeBounding) { return; } frame_setup_shape( fw, fw->g.frame.width, fw->g.frame.height, sev->shaped); GNOME_SetWinArea(fw); EWMH_SetFrameStrut(fw); if (!IS_ICONIFIED(fw)) { border_redraw_decorations(fw); } } return; } void HandleUnmapNotify(const evh_args_t *ea) { int dstx, dsty; Window dumwin; XEvent dummy; XEvent map_event; const XEvent *te = ea->exc->x.etrigger; int weMustUnmap; Bool focus_grabbed; Bool must_return = False; Bool do_map = False; FvwmWindow * const fw = ea->exc->w.fw; Window pw; Window cw; DBUG("HandleUnmapNotify", "Routine Entered"); /* Don't ignore events as described below. */ if (te->xunmap.event != te->xunmap.window && (te->xunmap.event != Scr.Root || !te->xunmap.send_event)) { must_return = True; } /* * The July 27, 1988 ICCCM spec states that a client wishing to switch * to WithdrawnState should send a synthetic UnmapNotify with the * event field set to (pseudo-)root, in case the window is already * unmapped (which is the case for fvwm for IconicState). * Unfortunately, we looked for the FvwmContext using that field, so * try the window field also. */ weMustUnmap = 0; if (!fw) { weMustUnmap = 1; if (XFindContext( dpy, te->xunmap.window, FvwmContext, (caddr_t *)&fw) == XCNOENT) { return; } } cw = FW_W(fw); pw = FW_W_PARENT(fw); if (te->xunmap.window == FW_W_FRAME(fw)) { SET_ICONIFY_PENDING(fw , 0); return; } if (must_return) { return; } if (weMustUnmap) { Bool is_map_request_pending; check_if_event_args args; args.w = te->xunmap.window; args.do_return_true = False; args.do_return_true_cr = False; /* Using FCheckTypedWindowEvent() does not work here. I don't * have the slightest idea why, but using FCheckIfEvent() with * the appropriate predicate procedure works fine. */ FCheckIfEvent(dpy, &dummy, test_map_request, (XPointer)&args); /* Unfortunately, there is no procedure in X that simply tests * if an event of a certain type in on the queue without * waiting and without removing it from the queue. * XCheck...Event() does not wait but removes the event while * XPeek...() does not remove the event but waits. To solve * this, the predicate procedure sets a flag in the passed in * structure and returns False unconditionally. */ is_map_request_pending = (args.ret_does_match == True); if (!is_map_request_pending) { XUnmapWindow(dpy, te->xunmap.window); } } if (fw == Scr.Hilite) { Scr.Hilite = NULL; } focus_grabbed = focus_query_close_release_focus(fw); restore_focus_after_unmap(fw, False); if (!IS_MAPPED(fw) && !IS_ICONIFIED(fw)) { return; } /* * The program may have unmapped the client window, from either * NormalState or IconicState. Handle the transition to WithdrawnState. * * We need to reparent the window back to the root (so that fvwm exiting * won't cause it to get mapped) and then throw away all state (pretend * that we've received a DestroyNotify). */ if (!FCheckTypedWindowEvent( dpy, te->xunmap.window, DestroyNotify, &dummy) && XTranslateCoordinates( dpy, te->xunmap.window, Scr.Root, 0, 0, &dstx, &dsty, &dumwin)) { MyXGrabServer(dpy); SetMapStateProp(fw, WithdrawnState); EWMH_RestoreInitialStates(fw, te->type); if (FCheckTypedWindowEvent( dpy, te->xunmap.window, ReparentNotify, &dummy)) { if (fw->attr_backup.border_width) { XSetWindowBorderWidth( dpy, te->xunmap.window, fw->attr_backup.border_width); } if ((!IS_ICON_SUPPRESSED(fw))&& (fw->wmhints && (fw->wmhints->flags & IconWindowHint))) { XUnmapWindow(dpy, fw->wmhints->icon_window); } } else { RestoreWithdrawnLocation(fw, False, Scr.Root); } if (!IS_TEAR_OFF_MENU(fw)) { XRemoveFromSaveSet(dpy, te->xunmap.window); XSelectInput(dpy, te->xunmap.window, NoEventMask); } XSync(dpy, 0); MyXUngrabServer(dpy); if (FCheckTypedWindowEvent(dpy, pw, MapRequest, &map_event)) { /* the client tried to map the window again while it * was still inside the decoration windows */ do_map = True; } } destroy_window(fw); if (focus_grabbed == True) { CoerceEnterNotifyOnCurrentWindow(); } EWMH_ManageKdeSysTray(te->xunmap.window, te->type); EWMH_WindowDestroyed(); GNOME_SetClientList(); if (do_map == True) { map_event.xmaprequest.window = cw; map_event.xmaprequest.parent = Scr.Root; dispatch_event(&map_event); /* note: we really should handle all map and unmap notify * events for that window in a loop here */ } return; } void HandleVisibilityNotify(const evh_args_t *ea) { FvwmWindow * const fw = ea->exc->w.fw; DBUG("HandleVisibilityNotify", "Routine Entered"); if (fw && ea->exc->x.etrigger->xvisibility.window == FW_W_FRAME(fw)) { switch (ea->exc->x.etrigger->xvisibility.state) { case VisibilityUnobscured: SET_FULLY_VISIBLE(fw, 1); SET_PARTIALLY_VISIBLE(fw, 1); break; case VisibilityPartiallyObscured: SET_FULLY_VISIBLE(fw, 0); SET_PARTIALLY_VISIBLE(fw, 1); break; default: SET_FULLY_VISIBLE(fw, 0); SET_PARTIALLY_VISIBLE(fw, 0); break; } /* Make sure the button grabs are up to date */ focus_grab_buttons(fw); } return; } /* ---------------------------- interface functions ------------------------ */ /* Inform a client window of its geometry. * * The input (frame) geometry will be translated to client geometry * before sending. */ void SendConfigureNotify( FvwmWindow *fw, int x, int y, int w, int h, int bw, Bool send_for_frame_too) { XEvent client_event; size_borders b; if (!fw || IS_SHADED(fw)) { return; } client_event.type = ConfigureNotify; client_event.xconfigure.display = dpy; client_event.xconfigure.event = FW_W(fw); client_event.xconfigure.window = FW_W(fw); get_window_borders(fw, &b); client_event.xconfigure.x = x + b.top_left.width; client_event.xconfigure.y = y + b.top_left.height; client_event.xconfigure.width = w - b.total_size.width; client_event.xconfigure.height = h - b.total_size.height; client_event.xconfigure.border_width = bw; client_event.xconfigure.above = FW_W_FRAME(fw); client_event.xconfigure.override_redirect = False; #if 0 fprintf(stderr, "send cn: %d %d %dx%d fw 0x%08x w 0x%08x ew 0x%08x '%s'\n", client_event.xconfigure.x, client_event.xconfigure.y, client_event.xconfigure.width, client_event.xconfigure.height, (int)FW_W_FRAME(fw), (int)FW_W(fw), (int)client_event.xconfigure.window, (fw->name.name) ? fw->name.name : ""); #endif FSendEvent( dpy, FW_W(fw), False, StructureNotifyMask, &client_event); if (send_for_frame_too) { /* This is for buggy tk, which waits for the real * ConfigureNotify on frame instead of the synthetic one on w. * The geometry data in the event will not be correct for the * frame, but tk doesn't look at that data anyway. */ client_event.xconfigure.event = FW_W_FRAME(fw); client_event.xconfigure.window = FW_W_FRAME(fw); FSendEvent( dpy, FW_W_FRAME(fw), False, StructureNotifyMask, &client_event); } return; } /* Add an event group to the event handler */ int register_event_group(int event_base, int event_count, PFEH *jump_table) { /* insert into the list */ event_group_t *group; event_group_t *position = base_event_group; event_group_t *prev_position = NULL; while ( position != NULL && position->base + position->count < event_base) { prev_position = position; position = position->next; } if ((position != NULL && position->base < event_base + event_count)) { /* there is already an event group registered at the specified * event range, or the base is before the base X events */ return 1; } /* create the group structure (these are not freed until fvwm exits) */ group = (event_group_t*)safemalloc(sizeof(event_group_t)); group->base = event_base; group->count = event_count; group->jump_table = jump_table; group->next = position; if (prev_position != NULL) { prev_position->next = group; } else { base_event_group = group; } return 0; } /* ** Procedure: ** InitEventHandlerJumpTable */ void InitEventHandlerJumpTable(void) { static PFEH EventHandlerJumpTable[LASTEvent]; int i; for (i=0; ixany.window; FvwmWindow *fw; event_group_t *event_group; DBUG("dispatch_event", "Routine Entered"); XFlush(dpy); if (w == Scr.Root) { switch (e->type) { case ButtonPress: case ButtonRelease: if (e->xbutton.subwindow != None) { w = e->xbutton.subwindow; } case MapRequest: w = e->xmaprequest.window; break; default: break; } } if (w == Scr.Root || XFindContext(dpy, w, FvwmContext, (caddr_t *)&fw) == XCNOENT) { fw = NULL; } last_event_type = e->type; event_group = base_event_group; while ( event_group != NULL && event_group->base + event_group->count < e->type) { event_group = event_group->next; } if ( event_group != NULL && e->type - event_group->base < event_group->count && event_group->jump_table[e->type - event_group->base] != NULL) { evh_args_t ea; exec_context_changes_t ecc; Window dummyw; ecc.type = EXCT_EVENT; ecc.x.etrigger = e; ecc.w.wcontext = GetContext(&fw, fw, e, &dummyw); ecc.w.w = w; ecc.w.fw = fw; ea.exc = exc_create_context( &ecc, ECC_TYPE | ECC_ETRIGGER | ECC_FW | ECC_W | ECC_WCONTEXT); (*event_group->jump_table[e->type - event_group->base])(&ea); exc_destroy_context(ea.exc); } #ifdef C_ALLOCA /* If we're using the C version of alloca, see if anything needs to be * freed up. */ alloca(0); #endif DBUG("dispatch_event", "Leaving Routine"); return; } /* ewmh configure request */ void events_handle_configure_request( XConfigureRequestEvent cre, FvwmWindow *fw, Bool force, int force_gravity) { __handle_configure_request(cre, NULL, fw, force, force_gravity); return; } void HandleEvents(void) { XEvent ev; DBUG("HandleEvents", "Routine Entered"); STROKE_CODE(send_motion = False); while (!isTerminated) { last_event_type = 0; if (Scr.flags.is_window_scheduled_for_destroy) { destroy_scheduled_windows(); } if (Scr.flags.do_need_window_update) { flush_window_updates(); } if (My_XNextEvent(dpy, &ev)) { dispatch_event(&ev); } if (Scr.flags.do_need_style_list_update) { simplify_style_list(); } } return; } /* * * Waits for next X or module event, fires off startup routines when startup * modules have finished or after a timeout if the user has specified a * command line module that doesn't quit or gets stuck. * */ int My_XNextEvent(Display *dpy, XEvent *event) { fd_set in_fdset, out_fdset; int num_fd; fmodule_list_itr moditr; fmodule *module; fmodule_input *input; static struct timeval timeout; static struct timeval *timeoutP = &timeout; DBUG("My_XNextEvent", "Routine Entered"); /* check for any X events already queued up. * Side effect: this does an XFlush if no events are queued * Make sure nothing between here and the select causes further * X requests to be sent or the select may block even though * there are events in the queue */ if (FPending(dpy)) { DBUG( "My_XNextEvent", "taking care of queued up events" " & returning (1)"); FNextEvent(dpy, event); return 1; } /* check for termination of all startup modules */ if (fFvwmInStartup) { module_list_itr_init(&moditr); module = module_list_itr_next(&moditr); for (; module != NULL; module = module_list_itr_next(&moditr)) { if (MOD_IS_CMDLINE(module) == 1) { break; } } module_cleanup(); if (module == NULL) { /* last module */ DBUG( "My_XNextEvent", "Starting up after command lines modules"); /* set an infinite timeout to stop ticking */ timeoutP = NULL; /* This may cause X requests to be sent */ StartupStuff(); return 0; /* so return without select()ing */ } } /* Some signals can interrupt us while we wait for any action * on our descriptors. While some of these signals may be asking * fvwm to die, some might be harmless. Harmless interruptions * mean we have to start waiting all over again ... */ do { int ms; Bool is_waiting_for_scheduled_command = False; static struct timeval *old_timeoutP = NULL; /* The timeouts become undefined whenever the select returns, * and so we have to reinitialise them */ ms = squeue_get_next_ms(); if (ms == 0) { /* run scheduled commands */ squeue_execute(); ms = squeue_get_next_ms(); /* should not happen anyway. * get_next_schedule_queue_ms() can't return 0 after a * call to execute_schedule_queue(). */ if (ms == 0) { ms = 1; } } if (ms < 0) { timeout.tv_sec = 42; timeout.tv_usec = 0; } else { /* scheduled commands are pending - don't wait too * long */ timeout.tv_sec = ms / 1000; timeout.tv_usec = 1000 * (ms % 1000); old_timeoutP = timeoutP; timeoutP = &timeout; is_waiting_for_scheduled_command = True; } FD_ZERO(&in_fdset); FD_ZERO(&out_fdset); FD_SET(x_fd, &in_fdset); /* nothing is done here if fvwm was compiled without session * support */ if (sm_fd >= 0) { FD_SET(sm_fd, &in_fdset); } module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { FD_SET(MOD_READFD(module), &in_fdset); if (!FQUEUE_IS_EMPTY(&MOD_PIPEQUEUE(module))) { FD_SET(MOD_WRITEFD(module), &out_fdset); } } DBUG("My_XNextEvent", "waiting for module input/output"); num_fd = fvwmSelect( fvwmlib_max_fd, &in_fdset, &out_fdset, 0, timeoutP); if (is_waiting_for_scheduled_command) { timeoutP = old_timeoutP; } /* Express route out of fvwm ... */ if (isTerminated) { return 0; } } while (num_fd < 0); if (num_fd > 0) { /* Check for module input. */ module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { if (FD_ISSET(MOD_READFD(module), &in_fdset)) { input = module_receive(module); /* enqueue the received command */ module_input_enqueue(input); } if ( MOD_WRITEFD(module) >= 0 && FD_ISSET(MOD_WRITEFD(module), &out_fdset)) { DBUG("My_XNextEvent", "calling FlushMessageQueue"); FlushMessageQueue(module); } } /* execute any commands queued up */ DBUG("My_XNextEvent", "executing module comand queue"); ExecuteCommandQueue(); /* cleanup dead modules */ module_cleanup(); /* nothing is done here if fvwm was compiled without session * support */ if ((sm_fd >= 0) && (FD_ISSET(sm_fd, &in_fdset))) { ProcessICEMsgs(); } } else { /* select has timed out, things must have calmed down so let's * decorate */ if (fFvwmInStartup) { fvwm_msg(ERR, "My_XNextEvent", "Some command line modules have not quit, " "Starting up after timeout.\n"); StartupStuff(); timeoutP = NULL; /* set an infinite timeout to stop * ticking */ reset_style_changes(); Scr.flags.do_need_window_update = 0; } /* run scheduled commands if necessary */ squeue_execute(); } /* check for X events again, rather than return 0 and get called again */ if (FPending(dpy)) { DBUG("My_XNextEvent", "taking care of queued up events & returning (2)"); FNextEvent(dpy,event); return 1; } DBUG("My_XNextEvent", "leaving My_XNextEvent"); return 0; } /* * * Procedure: * Find the Fvwm context for the event. * */ int GetContext(FvwmWindow **ret_fw, FvwmWindow *t, const XEvent *e, Window *w) { int context; Window win; Window subw = None; int x = 0; int y = 0; Bool is_key_event = False; win = e->xany.window; context = C_NO_CONTEXT; switch (e->type) { case KeyPress: case KeyRelease: x = e->xkey.x; y = e->xkey.y; subw = e->xkey.subwindow; if (win == Scr.Root && subw != None) { /* Translate root coordinates into subwindow * coordinates. Necessary for key bindings that work * over unfocused windows. */ win = subw; XTranslateCoordinates( dpy, Scr.Root, subw, x, y, &x, &y, &subw); XFindContext(dpy, win, FvwmContext, (caddr_t *) &t); } is_key_event = True; /* fall through */ case ButtonPress: case ButtonRelease: if (!is_key_event) { x = e->xbutton.x; y = e->xbutton.y; subw = e->xbutton.subwindow; } if (t && win == FW_W_FRAME(t) && subw != None) { /* Translate frame coordinates into subwindow * coordinates. */ win = subw; XTranslateCoordinates( dpy, FW_W_FRAME(t), subw, x, y, &x, &y, &subw); if (win == FW_W_PARENT(t)) { win = subw; XTranslateCoordinates( dpy, FW_W_PARENT(t), subw, x, y, &x, &y, &subw); } } break; default: XFindContext(dpy, win, FvwmContext, (caddr_t *)&t); break; } if (ret_fw != NULL) { *ret_fw = t; } if (!t) { return C_ROOT; } *w = win; if (*w == Scr.NoFocusWin) { return C_ROOT; } if (subw != None) { if (win == FW_W_PARENT(t)) { *w = subw; } } if (*w == Scr.Root) { return C_ROOT; } context = frame_window_id_to_context(t, *w, &Button); return context; } /* * * Removes expose events for a specific window from the queue * */ int flush_expose(Window w) { XEvent dummy; int i=0; while (FCheckTypedWindowEvent(dpy, w, Expose, &dummy)) { i++; } return i; } /* same as above, but merges the expose rectangles into a single big one */ int flush_accumulate_expose(Window w, XEvent *e) { XEvent dummy; int i = 0; int x1 = e->xexpose.x; int y1 = e->xexpose.y; int x2 = x1 + e->xexpose.width; int y2 = y1 + e->xexpose.height; while (FCheckTypedWindowEvent(dpy, w, Expose, &dummy)) { x1 = min(x1, dummy.xexpose.x); y1 = min(y1, dummy.xexpose.y); x2 = max(x2, dummy.xexpose.x + dummy.xexpose.width); y2 = max(y2, dummy.xexpose.y + dummy.xexpose.height); i++; } e->xexpose.x = x1; e->xexpose.y = y1; e->xexpose.width = x2 - x1; e->xexpose.height = y2 - y1; return i; } /* * * Removes all expose events from the queue and does the necessary redraws * */ void handle_all_expose(void) { void *saved_event; XEvent evdummy; saved_event = fev_save_event(); FPending(dpy); while (FCheckMaskEvent(dpy, ExposureMask, &evdummy)) { dispatch_event(&evdummy); } fev_restore_event(saved_event); return; } /* CoerceEnterNotifyOnCurrentWindow() * Pretends to get a HandleEnterNotify on the window that the pointer * currently is in so that the focus gets set correctly from the beginning. * Note that this presently only works if the current window is not * click_to_focus; I think that that behaviour is correct and desirable. * --11/08/97 gjb */ void CoerceEnterNotifyOnCurrentWindow(void) { Window child; Window root; Bool f; evh_args_t ea; exec_context_changes_t ecc; XEvent e; FvwmWindow *fw; f = FQueryPointer( dpy, Scr.Root, &root, &child, &e.xcrossing.x_root, &e.xcrossing.y_root, &e.xcrossing.x, &e.xcrossing.y, &JunkMask); if (f == False || child == None) { return; } e.xcrossing.type = EnterNotify; e.xcrossing.window = child; e.xcrossing.subwindow = None; e.xcrossing.mode = NotifyNormal; e.xcrossing.detail = NotifyAncestor; e.xcrossing.same_screen = True; if (XFindContext(dpy, child, FvwmContext, (caddr_t *)&fw) == XCNOENT) { fw = NULL; } else { XTranslateCoordinates( dpy, Scr.Root, child, e.xcrossing.x_root, e.xcrossing.y_root, &JunkX, &JunkY, &child); if (child == FW_W_PARENT(fw)) { child = FW_W(fw); } if (child != None) { e.xany.window = child; } } e.xcrossing.focus = (fw == get_focus_window()) ? True : False; ecc.type = EXCT_NULL; ecc.x.etrigger = &e; ea.exc = exc_create_context(&ecc, ECC_TYPE | ECC_ETRIGGER); HandleEnterNotify(&ea); exc_destroy_context(ea.exc); return; } /* This function discards all queued up ButtonPress, ButtonRelease and * ButtonMotion events. */ int discard_events(long event_mask) { XEvent e; int count; XSync(dpy, 0); for (count = 0; FCheckMaskEvent(dpy, event_mask, &e); count++) { /* nothing */ } return count; } /* This function discards all queued up ButtonPress, ButtonRelease and * ButtonMotion events. */ int discard_window_events(Window w, long event_mask) { XEvent e; int count; XSync(dpy, 0); for (count = 0; FCheckWindowEvent(dpy, w, event_mask, &e); count++) { /* nothing */ } return count; } /* Similar function for certain types of PropertyNotify. */ int flush_property_notify(Atom atom, Window w) { XEvent e; int count; test_typed_window_event_args args; count = 0; XSync(dpy, 0); args.w = w; args.atom = atom; args.event_type = PropertyNotify; /* Get rid of the events. */ while (FCheckIfEvent(dpy, &e, test_typed_window_event, (XPointer)&args)) count++; return count; } /* Wait for all mouse buttons to be released * This can ease some confusion on the part of the user sometimes * * Discard superflous button events during this wait period. */ void WaitForButtonsUp(Bool do_handle_expose) { unsigned int mask; unsigned int bmask; long evmask = ButtonPressMask|ButtonReleaseMask|ButtonMotionMask| KeyPressMask|KeyReleaseMask; int count; int use_wait_cursor; XEvent e; if (FQueryPointer(dpy, Scr.Root, &JunkRoot, &JunkChild, &JunkX, &JunkY, &JunkX, &JunkY, &mask) == False) { /* pointer is on a different screen - that's okay here */ } mask &= DEFAULT_ALL_BUTTONS_MASK; if (mask == 0) { return; } if (do_handle_expose) { evmask |= ExposureMask; } GrabEm(None, GRAB_NORMAL); for (count = 0, use_wait_cursor = 0; mask != 0; count++) { /* handle expose events */ XAllowEvents(dpy, SyncPointer, CurrentTime); if (FCheckMaskEvent(dpy, evmask, &e)) { switch (e.type) { case ButtonRelease: if (e.xbutton.button <= NUMBER_OF_MOUSE_BUTTONS) { bmask = (Button1Mask << (e.xbutton.button - 1)); mask = e.xbutton.state & ~bmask; } break; case Expose: dispatch_event(&e); break; default: break; } } else { if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &JunkX, &JunkY, &JunkX, &JunkY, &mask) == False) { /* pointer is on a different screen - that's * okay here */ } mask &= DEFAULT_ALL_BUTTONS_MASK; usleep(1); } if (use_wait_cursor == 0 && count == 20) { GrabEm(CRS_WAIT, GRAB_NORMAL); use_wait_cursor = 1; } } UngrabEm(GRAB_NORMAL); if (use_wait_cursor) { UngrabEm(GRAB_NORMAL); XFlush(dpy); } return; } void sync_server(int toggle) { static Bool synced = False; if (toggle == -1) { toggle = (synced == False); } if (toggle == 1) { synced = True; } else { synced = False; } XSynchronize(dpy, synced); XFlush(dpy); return; } Bool is_resizing_event_pending( FvwmWindow *fw) { XEvent e; check_if_event_args args; args.w = FW_W(fw); args.do_return_true = False; args.do_return_true_cr = False; args.cr_value_mask = 0; args.ret_does_match = False; args.ret_type = 0; FCheckIfEvent(dpy, &e, test_resizing_event, (XPointer)&args); return args.ret_does_match; } /* ---------------------------- builtin commands --------------------------- */ void CMD_XSynchronize(F_CMD_ARGS) { int toggle; toggle = ParseToggleArgument(action, NULL, -1, 0); sync_server(toggle); return; } void CMD_XSync(F_CMD_ARGS) { XSync(dpy, 0); return; } fvwm-2.6.5.orig/fvwm/windowlist.c0000644000175000017500000006051411376006244015161 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all new * by Rob Nation * A little of it is borrowed from ctwm. * Copyright 1993 Robert Nation. No restrictions are placed on this code, * as long as the copyright notice is preserved */ /* * * fvwm window-list popup code * */ #include "config.h" #include #include #include "libs/fvwmlib.h" #include "libs/FScreen.h" #include "libs/FGettext.h" #include "libs/Parse.h" #include "libs/Strings.h" #include "fvwm.h" #include "externs.h" #include "functions.h" #include "misc.h" #include "screen.h" #include "menudim.h" #include "menuitem.h" #include "menuroot.h" #include "menustyle.h" #include "menus.h" #include "menuparameters.h" #include "conditional.h" #include "stack.h" #include "focus.h" #include "virtual.h" #include "geometry.h" #define SHOW_GEOMETRY (1<<0) #define SHOW_ALLDESKS (1<<1) #define SHOW_NORMAL (1<<2) #define SHOW_ICONIC (1<<3) #define SHOW_STICKY_ACROSS_PAGES (1<<4) #define SHOW_STICKY_ACROSS_DESKS (1<<5) #define NO_DESK_SORT (1<<6) #define SHOW_ICONNAME (1<<7) #define SHOW_ALPHABETIC (1<<8) #define SORT_BYCLASS (1<<9) #define SORT_BYRESOURCE (1<<10) #define SORT_REVERSE (1<<11) #define SHOW_INFONOTGEO (1<<12) #define NO_DESK_NUM (1<<13) #define NO_CURRENT_DESK_TITLE (1<<14) #define TITLE_FOR_ALL_DESKS (1<<15) #define NO_NUM_IN_DESK_TITLE (1<<16) #define SHOW_PAGE_X (1<<17) #define SHOW_PAGE_Y (1<<18) #define NO_LAYER (1<<19) #define SHOW_SCREEN (1<<20) #define SHOW_DEFAULT (SHOW_GEOMETRY | SHOW_ALLDESKS | SHOW_NORMAL | \ SHOW_ICONIC | SHOW_STICKY_ACROSS_PAGES | SHOW_STICKY_ACROSS_DESKS) static char *get_desk_title(int desk, unsigned long flags, Bool is_top_title) { char *desk_name; char *tlabel; desk_name = GetDesktopName(desk); if (desk_name != NULL) { tlabel = (char *)safemalloc(strlen(desk_name)+50); } else { tlabel = (char *)safemalloc(50); } if (desk_name != NULL) { if (flags & NO_NUM_IN_DESK_TITLE) { sprintf(tlabel, "%s%s", desk_name, (is_top_title && (flags & SHOW_GEOMETRY)) ? _("\tGeometry") : ""); } else { sprintf(tlabel,"%d: %s%s", desk, desk_name, (is_top_title && (flags & SHOW_GEOMETRY)) ? _("\tGeometry") : ""); } } else { sprintf(tlabel,_("Desk: %d%s"),desk, (is_top_title && (flags & SHOW_GEOMETRY)) ? _("\tGeometry") : ""); } return tlabel; } /* Function to compare window title names */ static int visibleCompare(const FvwmWindow **a, const FvwmWindow **b) { return strcasecmp((*a)->visible_name, (*b)->visible_name); } static int iconCompare(const FvwmWindow **a, const FvwmWindow **b) { return strcasecmp((*a)->visible_icon_name, (*b)->visible_icon_name); } /* Which of the compare functions to sort on. */ static int (*compare)(const FvwmWindow **a, const FvwmWindow **b); static int classCompare(const FvwmWindow **a, const FvwmWindow **b) { int result = strcasecmp((*a)->class.res_class, (*b)->class.res_class); if (result) { return result; } return strcasecmp((*a)->visible_name, (*b)->visible_name); } static int resourceCompare(const FvwmWindow **a, const FvwmWindow **b) { int result = strcasecmp((*a)->class.res_class, (*b)->class.res_class); if (result) { return result; } result = strcasecmp((*a)->class.res_name, (*b)->class.res_name); if (result) { return result; } return strcasecmp((*a)->visible_name, (*b)->visible_name); } static int classIconCompare(const FvwmWindow **a, const FvwmWindow **b) { int result = strcasecmp((*a)->class.res_class, (*b)->class.res_class); if (result) { return result; } return strcasecmp((*a)->visible_icon_name, (*b)->visible_icon_name); } static int resourceIconCompare(const FvwmWindow **a, const FvwmWindow **b) { int result = strcasecmp((*a)->class.res_class, (*b)->class.res_class); if (result) { return result; } result = strcasecmp((*a)->class.res_name, (*b)->class.res_name); if (result) { return result; } return strcasecmp((*a)->visible_icon_name, (*b)->visible_icon_name); } static int compareReverse(const FvwmWindow **a, const FvwmWindow **b) { return -compare(a, b); } /* * Change by PRB (pete@tecc.co.uk), 31/10/93. Prepend a hot key * specifier to each item in the list. This means allocating the * memory for each item (& freeing it) rather than just using the window * title directly. */ void CMD_WindowList(F_CMD_ARGS) { struct MenuRoot *mr; struct MenuParameters mp; char* ret_action = NULL; FvwmWindow *t; FvwmWindow **windowList; FvwmWindow **iconifiedList = NULL; int numWindows; int ii; char tname[128]; char loc[64]; char *name=NULL; Bool free_name = False; int dwidth; int dheight; char *tlabel; int last_desk_done = INT_MIN; int last_desk_displayed = INT_MIN; int next_desk = 0; char *t_hot=NULL; /* Menu label with hotkey added */ char scut = '0'; /* Current short cut key */ char *opts=NULL; char *tok=NULL; int desk = Scr.CurrentDesk; unsigned long flags = SHOW_DEFAULT; char *func = NULL; char *ffunc = NULL; char *tfunc = NULL; char *default_action = NULL; MenuReturn mret; MenuOptions mops; int low_layer = 0; /* show all layers by default */ int high_layer = INT_MAX; int max_label_width = 0; int skiplist_mode = 0; /* do not show skiplist by default */ Bool use_hotkey = True; KeyCode old_sor_keycode; char sor_default_keyname[8] = { 'M', 'e', 't', 'a', '_', 'L' }; char *sor_keyname = sor_default_keyname; /* Condition vars. */ Bool use_condition = False; Bool current_at_end = False; Bool iconified_at_end = False; int ic = 0; int ij; WindowConditionMask mask; char *cond_flags; Bool first_desk = True; Bool empty_menu = True; Bool was_get_menu_opts_called = False; FvwmWindow * const fw = exc->w.fw; const Window w = exc->w.w; const exec_context_t *exc2; memset(&mops, 0, sizeof(mops)); memset(&mret, 0, sizeof(MenuReturn)); /* parse postitioning args - must call this even if no action is given * because it sets the xinerama screen origin */ if (action && *action) { /* Look for condition - CreateFlagString returns NULL if no '(' * or '[' */ cond_flags = CreateFlagString(action, &action); if (cond_flags) { /* Create window mask */ use_condition = True; DefaultConditionMask(&mask); /* override for Current [] */ mask.my_flags.use_circulate_hit = 1; mask.my_flags.use_circulate_hit_icon = 1; CreateConditionMask(cond_flags, &mask); free(cond_flags); } opts = get_menu_options( action, w, fw, NULL, NULL, NULL, &mops); was_get_menu_opts_called = True; /* parse options */ while (opts && *opts) { opts = GetNextSimpleOption(opts, &tok); if (!tok) { break; } if (StrEquals(tok,"NoHotkeys")) { use_hotkey = False; } else if (StrEquals(tok,"Function")) { opts = GetNextSimpleOption(opts, &func); } else if (StrEquals(tok,"Desk")) { free(tok); opts = GetNextSimpleOption(opts, &tok); if (tok) { desk = atoi(tok); flags &= ~SHOW_ALLDESKS; } } else if (StrEquals(tok,"CurrentDesk")) { desk = Scr.CurrentDesk; flags &= ~SHOW_ALLDESKS; } else if (StrEquals(tok,"NotAlphabetic")) { flags &= ~SHOW_ALPHABETIC; } else if (StrEquals(tok,"Alphabetic")) { flags |= SHOW_ALPHABETIC; } else if (StrEquals(tok,"SortByClass")) { flags |= SORT_BYCLASS; } else if (StrEquals(tok,"SortByResource")) { flags |= SORT_BYRESOURCE; } else if (StrEquals(tok,"ReverseOrder")) { flags |= SORT_REVERSE; } else if (StrEquals(tok,"CurrentAtEnd")) { current_at_end = True; } else if (StrEquals(tok,"IconifiedAtEnd")) { iconified_at_end = True; } else if (StrEquals(tok,"NoDeskSort")) { flags |= NO_DESK_SORT; } else if (StrEquals(tok,"ShowPage")) { flags |= SHOW_PAGE_X | SHOW_PAGE_Y; } else if (StrEquals(tok,"ShowPageX")) { flags |= SHOW_PAGE_X; } else if (StrEquals(tok,"ShowPageY")) { flags |= SHOW_PAGE_Y; } else if (StrEquals(tok,"ShowScreen")) { flags |= SHOW_SCREEN; } else if (StrEquals(tok,"UseIconName")) { flags |= SHOW_ICONNAME; } else if (StrEquals(tok,"NoGeometry")) { flags &= ~SHOW_GEOMETRY; flags &= ~SHOW_INFONOTGEO; } else if (StrEquals(tok,"NoGeometryWithInfo")) { flags &= ~SHOW_GEOMETRY; flags |= SHOW_INFONOTGEO; } else if (StrEquals(tok,"Geometry")) { flags |= SHOW_GEOMETRY; flags &= ~SHOW_INFONOTGEO; } else if (StrEquals(tok,"NoIcons")) { flags &= ~SHOW_ICONIC; } else if (StrEquals(tok,"Icons")) { flags |= SHOW_ICONIC; } else if (StrEquals(tok,"OnlyIcons")) { flags = SHOW_ICONIC; } else if (StrEquals(tok,"NoNormal")) { flags &= ~SHOW_NORMAL; } else if (StrEquals(tok,"Normal")) { flags |= SHOW_NORMAL; } else if (StrEquals(tok,"OnlyNormal")) { flags = SHOW_NORMAL; } else if (StrEquals(tok,"NoSticky")) { flags &= ~(SHOW_STICKY_ACROSS_PAGES); flags &= ~(SHOW_STICKY_ACROSS_DESKS); } else if (StrEquals(tok,"NoStickyPage")) { flags &= ~(SHOW_STICKY_ACROSS_PAGES); } else if (StrEquals(tok,"NoStickyDesk")) { flags &= ~(SHOW_STICKY_ACROSS_DESKS); } else if (StrEquals(tok,"Sticky")) { flags |= SHOW_STICKY_ACROSS_PAGES; flags |= SHOW_STICKY_ACROSS_DESKS; } else if (StrEquals(tok,"StickyPage")) { flags |= SHOW_STICKY_ACROSS_PAGES; } else if (StrEquals(tok,"StickyDesk")) { flags |= SHOW_STICKY_ACROSS_DESKS; } else if (StrEquals(tok,"OnlySticky")) { flags = SHOW_STICKY_ACROSS_PAGES; flags = SHOW_STICKY_ACROSS_DESKS; } else if (StrEquals(tok,"OnlyStickyPage")) { flags = SHOW_STICKY_ACROSS_PAGES; } else if (StrEquals(tok,"OnlyStickyDesk")) { flags = SHOW_STICKY_ACROSS_DESKS; } else if (StrEquals(tok,"UseListSkip")) { /* deprecated as of 02-May-2007 (SS) */ fprintf(stderr, "UseListSkip is deprecated. Please use \"UseSkipList\".\n"); skiplist_mode = 1; } else if (StrEquals(tok,"UseSkipList")) { skiplist_mode = 1; } else if (StrEquals(tok,"OnlyListSkip")) { /* deprecated as of 02-May-2007 (SS) */ fprintf(stderr, "OnlyListSkip is deprecated. Please use \"OnlySkipList\".\n"); skiplist_mode = 2; } else if (StrEquals(tok,"OnlySkipList")) { skiplist_mode = 2; } else if (StrEquals(tok,"NoDeskNum")) { flags |= NO_DESK_NUM; } else if (StrEquals(tok,"NoLayer")) { flags |= NO_LAYER; } else if (StrEquals(tok,"NoCurrentDeskTitle")) { flags |= NO_CURRENT_DESK_TITLE; } else if (StrEquals(tok,"TitleForAllDesks")) { flags |= TITLE_FOR_ALL_DESKS; } else if (StrEquals(tok,"NoNumInDeskTitle")) { flags |= NO_NUM_IN_DESK_TITLE; } /* these are a bit dubious, but we should keep the * OnTop options for compatibility */ else if (StrEquals(tok, "NoOnTop")) { if (high_layer >= Scr.TopLayer) { high_layer = Scr.TopLayer - 1; } } else if (StrEquals(tok, "OnTop")) { if (high_layer < Scr.TopLayer) { high_layer = Scr.TopLayer; } } else if (StrEquals(tok, "OnlyOnTop")) { high_layer = low_layer = Scr.TopLayer; } else if (StrEquals(tok, "NoOnBottom")) { if (low_layer <= Scr.BottomLayer) { low_layer = Scr.BottomLayer - 1; } } else if (StrEquals(tok, "OnBottom")) { if (low_layer > Scr.BottomLayer) { low_layer = Scr.BottomLayer; } } else if (StrEquals(tok, "OnlyOnBottom")) { high_layer = low_layer = Scr.BottomLayer; } else if (StrEquals(tok, "Layer")) { free(tok); opts = GetNextSimpleOption(opts, &tok); if (tok) { low_layer = high_layer = atoi(tok); free(tok); opts = GetNextSimpleOption(opts, &tok); if (tok) { high_layer = atoi(tok); } } } else if (StrEquals(tok, "SelectOnRelease")) { if (sor_keyname != sor_default_keyname) { free(sor_keyname); } sor_keyname = NULL; opts = GetNextSimpleOption(opts, &sor_keyname); } else if (StrEquals(tok, "MaxLabelWidth")) { char *wid; opts = GetNextSimpleOption(opts, &wid); if (wid) { max_label_width = atoi(wid); if (max_label_width < 1) { max_label_width = 1; } free(wid); } } else if (!opts || !*opts) { default_action = safestrdup(tok); } else { fvwm_msg( ERR, "WindowList","Unknown option '%s'", tok); } if (tok) { free(tok); } } } if (was_get_menu_opts_called == False) { opts = get_menu_options( action, w, fw, NULL, NULL, NULL, &mops); } tlabel = get_desk_title(desk, flags, True); mr = NewMenuRoot(tlabel); if (!(flags & NO_CURRENT_DESK_TITLE)) { AddToMenu(mr, tlabel, "TITLE", False, False, False); empty_menu = False; } free(tlabel); numWindows = 0; for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { numWindows++; } windowList = malloc(numWindows*sizeof(t)); if (windowList == NULL) { return; } if (iconified_at_end) { iconifiedList = malloc(numWindows*sizeof(t)); if (iconifiedList == NULL) { free(windowList); return; } } /* get the windowlist starting from the current window (if any)*/ t = get_focus_window(); if (t == NULL) { t = Scr.FvwmRoot.next; } else if (current_at_end) { if (t->next) { t = t->next; } else { t = Scr.FvwmRoot.next; } } for (ii = 0; ii < numWindows; ii++) { if (flags & SORT_REVERSE) { windowList[numWindows - ii - 1] = t; } else if (iconified_at_end && IS_ICONIFIED(t)) { iconifiedList[ic++] = t; } else { windowList[ii - ic] = t; } if (t->next) { t = t->next; } else { t = Scr.FvwmRoot.next; } } if (iconified_at_end && ic > 0) { if (current_at_end && ii > ic) { windowList[numWindows - 1] = windowList[--ii - ic]; } for (ij = 0; ij < ic; ij++) { windowList[ij + (ii - ic)] = iconifiedList[ij]; } } /* Do alphabetic sort */ if (flags & (SHOW_ALPHABETIC | SORT_BYCLASS | SORT_BYRESOURCE)) { /* This will be compare or compareReverse if a reverse order * is selected. */ int (*sort)(const FvwmWindow **a, const FvwmWindow **b); switch (flags & (SHOW_ALPHABETIC | SHOW_ICONNAME | \ SORT_BYCLASS | SORT_BYRESOURCE)) { case SHOW_ALPHABETIC: compare = visibleCompare; break; case SHOW_ALPHABETIC | SHOW_ICONNAME: compare = iconCompare; break; /* Sorting based on class name produces an alphabetic * order so the keyword alphabetic is redundant. */ case SORT_BYCLASS: case SORT_BYCLASS | SHOW_ALPHABETIC: compare = classCompare; break; case SORT_BYCLASS | SHOW_ICONNAME: case SORT_BYCLASS | SHOW_ICONNAME | SHOW_ALPHABETIC: compare = classIconCompare; break; case SORT_BYRESOURCE: case SORT_BYRESOURCE | SORT_BYCLASS: case SORT_BYRESOURCE | SORT_BYCLASS | SHOW_ALPHABETIC: compare = resourceCompare; break; case SORT_BYRESOURCE | SHOW_ICONNAME: case SORT_BYRESOURCE | SHOW_ICONNAME | SORT_BYCLASS: case SORT_BYRESOURCE | SHOW_ICONNAME | SORT_BYCLASS | \ SHOW_ALPHABETIC: compare = resourceIconCompare; break; /* All current cases are covered, but if something * changes in the future we leave compare valid even if * it isn't what is expected. */ default: compare = visibleCompare; break; } if ( flags & SORT_REVERSE ) { sort = compareReverse; } else { sort = compare; } qsort(windowList, numWindows, sizeof(t), (int(*)(const void*, const void*))sort); } while(next_desk != INT_MAX) { /* Sort window list by desktop number */ if ((flags & SHOW_ALLDESKS) && !(flags & NO_DESK_SORT)) { /* run through the windowlist finding the first desk * not already processed */ next_desk = INT_MAX; for (ii = 0; ii < numWindows; ii++) { t = windowList[ii]; if (t->Desk >last_desk_done && t->Desk < next_desk) { next_desk = t->Desk; } } } if (!(flags & SHOW_ALLDESKS)) { /* if only doing one desk and it hasn't been done */ if (last_desk_done == INT_MIN) next_desk = desk; /* select the desk */ else next_desk = INT_MAX; /* flag completion */ } if (flags & NO_DESK_SORT) next_desk = INT_MAX; /* only go through loop once */ last_desk_done = next_desk; for (ii = 0; ii < numWindows; ii++) { t = windowList[ii]; if (t->Desk != next_desk && !(flags & NO_DESK_SORT)) { continue; } if (skiplist_mode == 0 && DO_SKIP_WINDOW_LIST(t)) { /* don't want skiplist windows - skip */ continue; } if (skiplist_mode == 2 && !DO_SKIP_WINDOW_LIST(t)) { /* don't want no skiplist one - skip */ continue; } if (use_condition && !MatchesConditionMask(t, &mask)) { /* doesn't match specified condition */ continue; } if (!(flags & SHOW_ICONIC) && (IS_ICONIFIED(t))) { /* don't want icons - skip */ continue; } if (!(flags & SHOW_STICKY_ACROSS_PAGES) && (IS_STICKY_ACROSS_PAGES(t))) { /* don't want sticky ones - skip */ continue; } if (!(flags & SHOW_STICKY_ACROSS_DESKS) && (IS_STICKY_ACROSS_DESKS(t))) { /* don't want sticky ones - skip */ continue; } if (!(flags & SHOW_NORMAL) && !(IS_ICONIFIED(t) || IS_STICKY_ACROSS_PAGES(t) || IS_STICKY_ACROSS_DESKS(t))) { /* don't want "normal" ones - skip */ continue; } if (get_layer(t) < low_layer || get_layer(t) > high_layer) { /* don't want this layer */ continue; } empty_menu = False; /* add separator between desks when geometry * shown but not at the top*/ if (t->Desk != last_desk_displayed) { if (last_desk_displayed != INT_MIN) { if (((flags & SHOW_GEOMETRY) || (flags & SHOW_INFONOTGEO)) && !(flags & TITLE_FOR_ALL_DESKS)) { AddToMenu( mr, NULL, NULL, False, False, False); } if (flags & TITLE_FOR_ALL_DESKS) { tlabel = get_desk_title( t->Desk, flags, False); AddToMenu( mr, tlabel, "TITLE", False, False, False); free(tlabel); } } last_desk_displayed = t->Desk; } if (first_desk && flags & TITLE_FOR_ALL_DESKS) { tlabel = get_desk_title(t->Desk, flags, False); AddToMenu( mr, tlabel, "TITLE", False, False, False); free(tlabel); } first_desk = False; if (flags & SHOW_ICONNAME) { name = t->visible_icon_name; } else { name = t->visible_name; } free_name = False; if (!name) { name = "NULL_NAME"; } else if (max_label_width > 0 && strlen(name) > max_label_width) { name = strdup(name); name[max_label_width] = '\0'; free_name = True; } t_hot = safemalloc(strlen(name) + 80); if (use_hotkey) { /* Generate label */ sprintf(t_hot, "&%c. ", scut); } else { *t_hot = 0; } if (!(flags & SHOW_INFONOTGEO)) { strcat(t_hot, name); } if (*t_hot == 0) { strcpy(t_hot, " "); } /* Next shortcut key */ if (scut == '9') { scut = 'A'; } else if (scut == 'Z') { scut = '0'; } else { scut++; } if (flags & SHOW_INFONOTGEO) { tname[0]=0; if (!IS_ICONIFIED(t) && !(flags & NO_DESK_NUM)) { sprintf(loc,"%d:", t->Desk); strcat(tname,loc); } if (IS_ICONIFIED(t)) { strcat(tname, "("); } strcat(t_hot,"\t"); strcat(t_hot,tname); strcat(t_hot, name); if (IS_ICONIFIED(t)) { strcat(t_hot, ")"); } } else if (flags & SHOW_GEOMETRY) { size_borders b; tname[0]=0; if (IS_ICONIFIED(t)) { strcpy(tname, "("); } if (!(flags & NO_DESK_NUM)) { sprintf(loc, "%d", t->Desk); strcat(tname, loc); } if (flags & SHOW_SCREEN) { fscreen_scr_arg fscr; int scr; fscr.xypos.x = Scr.Vx + t->g.frame.x + t->g.frame.width / 2; fscr.xypos.y = Scr.Vy + t->g.frame.y + t->g.frame.height / 2; scr = FScreenGetScrId( &fscr, FSCREEN_XYPOS); sprintf(loc, "@%d", scr); strcat(tname, loc); } if (flags & SHOW_PAGE_X) { sprintf(loc, "+%d", (Scr.Vx + t->g.frame.x + t->g.frame.width / 2) / Scr.MyDisplayWidth); strcat(tname, loc); } if (flags & SHOW_PAGE_Y) { sprintf(loc, "+%d", (Scr.Vy + t->g.frame.y + t->g.frame.height/2) / Scr.MyDisplayHeight); strcat(tname, loc); } if (!(flags & NO_LAYER)) { sprintf(loc, "(%d)", (get_layer(t))); strcat(tname, loc); } strcat(tname, ":"); get_window_borders(t, &b); dheight = t->g.frame.height - b.total_size.height; dwidth = t->g.frame.width - b.total_size.width; dwidth = (dwidth - t->hints.base_width) /t->orig_hints.width_inc; dheight = (dheight - t->hints.base_height) /t->orig_hints.height_inc; sprintf(loc,"%d",dwidth); strcat(tname, loc); sprintf(loc,"x%d",dheight); strcat(tname, loc); if (t->g.frame.x >=0) { sprintf(loc,"+%d",t->g.frame.x); } else { sprintf(loc,"%d",t->g.frame.x); } strcat(tname, loc); if (t->g.frame.y >=0) { sprintf(loc,"+%d",t->g.frame.y); } else { sprintf(loc,"%d",t->g.frame.y); } strcat(tname, loc); if (IS_STICKY_ACROSS_PAGES(t) || IS_STICKY_ACROSS_DESKS(t)) { strcat(tname, " S"); } if (IS_ICONIFIED(t)) { strcat(tname, ")"); } strcat(t_hot,"\t"); strcat(t_hot,tname); } ffunc = func ? func : "WindowListFunc"; tfunc = safemalloc(strlen(ffunc) + 36); /* support two ways for now: window context * (new) and window id param (old) */ sprintf(tfunc, "WindowId %lu %s %lu", FW_W(t), ffunc, FW_W(t)); AddToMenu( mr, t_hot, tfunc, False, False, False); free(tfunc); /* Add the title pixmap */ if (FMiniIconsSupported && t->mini_icon) { MI_MINI_ICON(MR_LAST_ITEM(mr))[0] = t->mini_icon; /* increase the cache count. Otherwise the * pixmap will be eventually removed from the * cache by DestroyMenu */ t->mini_icon->count++; } if (t_hot) { free(t_hot); } if (free_name) { free(name); } } } if (empty_menu) { /* force current desk title */ tlabel = get_desk_title(desk, flags, True); AddToMenu(mr, tlabel, "TITLE", False, False, False); free(tlabel); } if (func) { free(func); } free(windowList); if (iconified_at_end) { free(iconifiedList); } /* Use the WindowList menu style if there is one */ change_mr_menu_style(mr, "WindowList"); /* Activate select_on_release style */ old_sor_keycode = MST_SELECT_ON_RELEASE_KEY(mr); if (sor_keyname && (!MST_SELECT_ON_RELEASE_KEY(mr) || sor_keyname != sor_default_keyname)) { MST_SELECT_ON_RELEASE_KEY(mr) = XKeysymToKeycode( dpy, FvwmStringToKeysym(dpy, sor_keyname)); } memset(&mp, 0, sizeof(mp)); mp.menu = mr; exc2 = exc_clone_context(exc, NULL, 0); mp.pexc = &exc2; mp.flags.has_default_action = (default_action && *default_action != 0); mp.flags.is_sticky = 1; mp.flags.is_submenu = 0; mp.flags.is_already_mapped = 0; mp.flags.is_triggered_by_keypress = (!default_action && exc->x.etrigger->type == KeyPress); mp.pops = &mops; mp.ret_paction = &ret_action; do_menu(&mp, &mret); /* Restore old menu style */ MST_SELECT_ON_RELEASE_KEY(mr) = old_sor_keycode; if (ret_action) { free(ret_action); } DestroyMenu(mr, False, False); if (mret.rc == MENU_DOUBLE_CLICKED && default_action && *default_action) { execute_function(cond_rc, exc2, default_action, 0); } if (default_action != NULL) { free(default_action); } if (use_condition) { FreeConditionMask(&mask); } if (sor_keyname && sor_keyname != sor_default_keyname) { free(sor_keyname); } exc_destroy_context(exc2); return; } fvwm-2.6.5.orig/fvwm/window_flags.h0000644000175000017500000007344210542534242015450 0ustar vwcvwc/* -*-c-*- */ #ifndef _WINDOW_FLAGS_ #define _WINDOW_FLAGS_ #include "focus_policy.h" /* access to the common flags of a window */ #define FW_COMMON_FLAGS(fw) \ ((fw)->flags.common) #define FW_COMMON_STATIC_FLAGS(fw) \ ((fw)->flags.common.s) #define FW_FOCUS_POLICY(fw) \ ((fw)->flags.common.s.focus_policy) #define DO_LOWER_TRANSIENT(fw) \ ((fw)->flags.common.s.do_lower_transient) #define DO_NOT_SHOW_ON_MAP(fw) \ ((fw)->flags.common.s.do_not_show_on_map) #define DO_RAISE_TRANSIENT(fw) \ ((fw)->flags.common.s.do_raise_transient) #define DO_RESIZE_OPAQUE(fw) \ ((fw)->flags.common.s.do_resize_opaque) #define DO_SHRINK_WINDOWSHADE(fw) \ ((fw)->flags.common.s.do_shrink_windowshade) #define SET_DO_SHRINK_WINDOWSHADE(fw,x) \ (fw)->flags.common.s.do_shrink_windowshade = !!(x) #define SETM_DO_SHRINK_WINDOWSHADE(fw,x) \ (fw)->flag_mask.common.s.do_shrink_windowshade = !!(x) #define DO_SKIP_CIRCULATE(fw) \ ((fw)->flags.common.s.do_circulate_skip) #define SET_DO_SKIP_CIRCULATE(fw,x) \ (fw)->flags.common.s.do_circulate_skip = !!(x) #define SETM_DO_SKIP_CIRCULATE(fw,x) \ (fw)->flag_mask.common.s.do_circulate_skip = !!(x) #define DO_SKIP_ICON_CIRCULATE(fw) \ ((fw)->flags.common.s.do_circulate_skip_icon) #define SET_DO_SKIP_ICON_CIRCULATE(fw,x) \ (fw)->flags.common.s.do_circulate_skip_icon = !!(x) #define SETM_DO_SKIP_ICON_CIRCULATE(fw,x) \ (fw)->flag_mask.common.s.do_circulate_skip_icon = !!(x) #define DO_SKIP_SHADED_CIRCULATE(fw) \ ((fw)->flags.common.s.do_circulate_skip_shaded) #define SET_DO_SKIP_SHADED_CIRCULATE(fw,x) \ (fw)->flags.common.s.do_circulate_skip_shaded = !!(x) #define SETM_DO_SKIP_SHADED_CIRCULATE(fw,x) \ (fw)->flag_mask.common.s.do_circulate_skip_shaded = !!(x) #define DO_SKIP_WINDOW_LIST(fw) \ ((fw)->flags.common.s.do_window_list_skip) #define SET_DO_SKIP_WINDOW_LIST(fw,x) \ (fw)->flags.common.s.do_window_list_skip = !!(x) #define SETM_DO_SKIP_WINDOW_LIST(fw,x) \ (fw)->flag_mask.common.s.do_window_list_skip = !!(x) #define DO_STACK_TRANSIENT_PARENT(fw) \ ((fw)->flags.common.s.do_stack_transient_parent) #define GET_TITLE_DIR(fw) \ ((fw)->flags.common.title_dir) #define HAS_TITLE_DIR(fw,x) \ ((fw)->flags.common.title_dir == x) #define SET_TITLE_DIR(fw,x) \ ((fw)->flags.common.title_dir = x) #define SETM_TITLE_DIR(fw,x) \ ((fw)->flag_mask.common.title_dir = ((x) ? DIR_MAJOR_MASK : 0)) #define SET_USER_STATES(fw, mask) \ ((fw)->flags.common.user_states |= (mask)) #define CLEAR_USER_STATES(fw, mask) \ ((fw)->flags.common.user_states &= ~(mask)) #define TOGGLE_USER_STATES(fw, mask) \ ((fw)->flags.common.user_states ^= (mask)) #define SETM_USER_STATES(fw, mask) \ ((fw)->flag_mask.common.user_states |= (mask)) #define GET_USER_STATES(fw) \ ((fw)->flags.common.user_states) #define GETM_USER_STATES(fw) \ ((fw)->flag_mask.common.user_states) #define HAS_VERTICAL_TITLE(fw) \ ((HAS_TITLE_DIR(fw,DIR_W) || HAS_TITLE_DIR(fw,DIR_E))) #define HAS_STIPPLED_TITLE(fw) \ ((fw)->flags.common.s.has_stippled_title) #define SET_HAS_STIPPLED_TITLE(fw,x) \ (fw)->flags.common.s.has_stippled_title = !!(x) #define SETM_HAS_STIPPLED_TITLE(fw,x) \ (fw)->flag_mask.common.s.has_stippled_title = !!(x) #define HAS_STICKY_STIPPLED_TITLE(fw) \ !((fw)->flags.common.s.has_no_sticky_stippled_title) #define SET_HAS_STICKY_STIPPLED_TITLE(fw,x) \ (fw)->flags.common.s.has_no_sticky_stippled_title = !(x) #define SETM_HAS_STICKY_STIPPLED_TITLE(fw,x) \ (fw)->flag_mask.common.s.has_no_sticky_stippled_title = !!(x) #define HAS_STICKY_STIPPLED_ICON_TITLE(fw) \ !((fw)->flags.common.s.has_no_sticky_stippled_icon_title) #define SET_HAS_STICKY_STIPPLED_ICON_TITLE(fw,x) \ (fw)->flags.common.s.has_no_sticky_stippled_icon_title = !(x) #define SETM_HAS_STICKY_STIPPLED_ICON_TITLE(fw,x) \ (fw)->flag_mask.common.s.has_no_sticky_stippled_icon_title = !!(x) #define HAS_STIPPLED_ICON_TITLE(fw) \ ((fw)->flags.common.s.has_stippled_icon_title) #define SET_HAS_STIPPLED_ICON_TITLE(fw,x) \ (fw)->flags.common.s.has_stippled_icon_title = !!(x) #define SETM_HAS_STIPPLED_ICON_TITLE(fw,x) \ (fw)->flag_mask.common.s.has_stippled_icon_title = !!(x) #define ICON_OVERRIDE_MODE(fw) \ ((fw)->flags.common.s.icon_override) #define SET_ICON_OVERRIDE_MODE(fw,x) \ (fw)->flags.common.s.icon_override = ((x) & ICON_OVERRIDE_MASK) #define SETM_ICON_OVERRIDE_MODE(fw,x) \ (fw)->flag_mask.common.s.icon_override = ((x) ? ICON_OVERRIDE_MASK : 0) #define IS_ICON_STICKY_ACROSS_PAGES(fw) \ ((fw)->flags.common.s.is_icon_sticky_across_pages) #define SET_ICON_STICKY_ACROSS_PAGES(fw,x) \ (fw)->flags.common.s.is_icon_sticky_across_pages = !!(x) #define SETM_ICON_STICKY_ACROSS_PAGES(fw,x) \ (fw)->flag_mask.common.s.is_icon_sticky_across_pages = !!(x) #define IS_ICON_STICKY_ACROSS_DESKS(fw) \ ((fw)->flags.common.s.is_icon_sticky_across_desks) #define SET_ICON_STICKY_ACROSS_DESKS(fw,x) \ (fw)->flags.common.s.is_icon_sticky_across_desks = !!(x) #define SETM_ICON_STICKY_ACROSS_DESKS(fw,x) \ (fw)->flag_mask.common.s.is_icon_sticky_across_desks = !!(x) #define USE_ICON_POSITION_HINT(fw) \ ((fw)->flags.common.s.use_icon_position_hint) #define SET_USE_ICON_POSITION_HINT(fw,x) \ (fw)->flags.common.s.use_icon_position_hint = !!(x) #define SETM_USE_ICON_POSITION_HINT(fw,x) \ (fw)->flag_mask.common.s.use_icon_position_hint = !!(x) #define USE_INDEXED_WINDOW_NAME(fw) \ ((fw)->flags.common.s.use_indexed_window_name) #define SET_USE_INDEXED_WINDOW_NAME(fw,x) \ (fw)->flags.common.s.use_indexed_window_name = !!(x) #define SETM_USE_INDEXED_WINDOW_NAME(fw,x) \ (fw)->flag_mask.common.s.use_indexed_window_name = !!(x) #define USE_INDEXED_ICON_NAME(fw) \ ((fw)->flags.common.s.use_indexed_icon_name) #define SET_USE_INDEXED_ICON_NAME(fw,x) \ (fw)->flags.common.s.use_indexed_icon_name = !!(x) #define SETM_USE_INDEXED_ICON_NAME(fw,x) \ (fw)->flag_mask.common.s.use_indexed_icon_name = !!(x) #define WINDOWSHADE_LAZINESS(fw) \ ((fw)->flags.common.s.windowshade_laziness) #define SET_WINDOWSHADE_LAZINESS(fw,x) \ (fw)->flags.common.s.windowshade_laziness = \ ((x) & WINDOWSHADE_LAZY_MASK) #define SETM_WINDOWSHADE_LAZINESS(fw,x) \ (fw)->flag_mask.common.s.windowshade_laziness = \ ((x) ? WINDOWSHADE_LAZY_MASK : 0) #define DO_EWMH_MINI_ICON_OVERRIDE(fw) \ ((fw)->flags.common.s.do_ewmh_mini_icon_override) #define SET_DO_EWMH_MINI_ICON_OVERRIDE(fw,x) \ (fw)->flags.common.s.do_ewmh_mini_icon_override = !!(x) #define SETM_DO_EWMH_MINI_ICON_OVERRIDE(fw,x) \ (fw)->flag_mask.common.s.do_ewmh_mini_icon_override = !!(x) #define DO_EWMH_DONATE_ICON(fw) \ ((fw)->flags.common.s.do_ewmh_donate_icon) #define SET_DO_EWMH_DONATE_ICON(fw,x) \ (fw)->flags.common.s.do_ewmh_donate_icon = !!(x) #define SETM_DO_EWMH_DONATE_ICON(fw,x) \ (fw)->flag_mask.common.s.do_ewmh_donate_icon = !!(x) #define DO_EWMH_DONATE_MINI_ICON(fw) \ ((fw)->flags.common.s.do_ewmh_donate_mini_icon) #define SET_DO_EWMH_DONATE_MINI_ICON(fw,x) \ (fw)->flags.common.s.do_ewmh_donate_mini_icon = !!(x) #define SETM_DO_EWMH_DONATE_MINI_ICON(fw,x) \ (fw)->flag_mask.common.s.do_ewmh_donate_mini_icon = !!(x) #define DO_EWMH_USE_STACKING_HINTS(fw) \ ((fw)->flags.common.s.do_ewmh_use_stacking_hints) #define SET_DO_EWMH_USE_STACKING_HINTS(fw,x) \ (fw)->flags.common.s.do_ewmh_use_stacking_hints = !!(x) #define SETM_DO_EWMH_USE_STACKING_HINTS(fw,x) \ (fw)->flag_mask.common.s.do_ewmh_use_stacking_hints = !!(x) #define DO_EWMH_IGNORE_STRUT_HINTS(fw) \ ((fw)->flags.common.s.do_ewmh_ignore_strut_hints) #define SET_DO_EWMH_IGNORE_STRUT_HINTS(fw,x) \ (fw)->flags.common.s.do_ewmh_ignore_strut_hints = !!(x) #define SETM_DO_EWMH_IGNORE_STRUT_HINTS(fw,x) \ (fw)->flag_mask.common.s.do_ewmh_ignore_strut_hints = !!(x) #define DO_EWMH_IGNORE_STATE_HINTS(fw) \ ((fw)->flags.common.s.do_ewmh_ignore_state_hints) #define SET_DO_EWMH_IGNORE_STATE_HINTS(fw,x) \ (fw)->flags.common.s.do_ewmh_ignore_state_hints = !!(x) #define SETM_DO_EWMH_IGNORE_STATE_HINTS(fw,x) \ (fw)->flag_mask.common.s.do_ewmh_ignore_state_hints = !!(x) #define DO_EWMH_IGNORE_WINDOW_TYPE(fw) \ ((fw)->flags.common.s.do_ewmh_ignore_window_type) #define SET_DO_EWMH_IGNORE_WINDOW_TYPE(fw,x) \ (fw)->flags.common.s.do_ewmh_ignore_window_type = !!(x) #define SETM_DO_EWMH_IGNORE_WINDOW_TYPE(fw,x) \ (fw)->flag_mask.common.s.do_ewmh_ignore_window_type = !!(x) #define EWMH_MAXIMIZE_MODE(fw) \ ((fw)->flags.common.s.ewmh_maximize_mode) #define SET_EWMH_MAXIMIZE_MODE(fw,x) \ (fw)->flags.common.s.ewmh_maximize_mode = (x) #define SETM_EWMH_MAXIMIZE_MODE(fw,x) \ (fw)->flag_mask.common.s.ewmh_maximize_mode = (x) #define IS_ICON_SUPPRESSED(fw) \ ((fw)->flags.common.s.is_icon_suppressed) #define SET_ICON_SUPPRESSED(fw,x) \ (fw)->flags.common.s.is_icon_suppressed = !!(x) #define SETM_ICON_SUPPRESSED(fw,x) \ (fw)->flag_mask.common.s.is_icon_suppressed = !!(x) #define IS_STICKY_ACROSS_PAGES(fw) \ ((fw)->flags.common.is_sticky_across_pages) #define SET_STICKY_ACROSS_PAGES(fw,x) \ (fw)->flags.common.is_sticky_across_pages = !!(x) #define SETM_STICKY_ACROSS_PAGES(fw,x) \ (fw)->flag_mask.common.is_sticky_across_pages = !!(x) #define IS_STICKY_ACROSS_DESKS(fw) \ ((fw)->flags.common.is_sticky_across_desks) #define SET_STICKY_ACROSS_DESKS(fw,x) \ (fw)->flags.common.is_sticky_across_desks = !!(x) #define SETM_STICKY_ACROSS_DESKS(fw,x) \ (fw)->flag_mask.common.is_sticky_across_desks = !!(x) #define HAS_ICON_FONT(fw) \ ((fw)->flags.common.has_icon_font) #define SET_HAS_ICON_FONT(fw,x) \ (fw)->flags.common.has_icon_font = !!(x) #define SETM_HAS_ICON_FONT(fw,x) \ (fw)->flag_mask.common.has_icon_font = !!(x) #define HAS_NO_ICON_TITLE(fw) \ ((fw)->flags.common.s.has_no_icon_title) #define SET_HAS_NO_ICON_TITLE(fw,x) \ (fw)->flags.common.s.has_no_icon_title = !!(x) #define SETM_HAS_NO_ICON_TITLE(fw,x) \ (fw)->flag_mask.common.s.has_no_icon_title = !!(x) #define HAS_WINDOW_FONT(fw) \ ((fw)->flags.common.has_window_font) #define SET_HAS_WINDOW_FONT(fw,x) \ (fw)->flags.common.has_window_font = !!(x) #define SETM_HAS_WINDOW_FONT(fw,x) \ (fw)->flag_mask.common.has_window_font = !!(x) #define HAS_MWM_BORDER(fw) \ ((fw)->flags.common.s.has_mwm_border) #define HAS_MWM_BUTTONS(fw) \ ((fw)->flags.common.s.has_mwm_buttons) #define HAS_MWM_OVERRIDE_HINTS(fw) \ ((fw)->flags.common.s.has_mwm_override) #define HAS_OVERRIDE_SIZE_HINTS(fw) \ ((fw)->flags.common.s.has_override_size) #define DO_ICONIFY_WINDOW_GROUPS(fw) \ ((fw)->flags.common.s.do_iconify_window_groups) #define DO_IGNORE_GNOME_HINTS(fw) \ ((fw)->flags.common.s.do_ignore_gnome_hints) #define DO_IGNORE_RESTACK(fw) \ ((fw)->flags.common.s.do_ignore_restack) #define DO_IGNORE_ICON_BOXES(fw) \ ((fw)->flags.common.s.do_ignore_icon_boxes) #define DO_USE_WINDOW_GROUP_HINT(fw) \ ((fw)->flags.common.s.do_use_window_group_hint) #define IS_FIXED(fw) \ ((fw)->flags.common.s.is_fixed) #define SET_FIXED(fw,x) \ (fw)->flags.common.s.is_fixed = !!(x) #define SETM_FIXED(fw,x) \ (fw)->flag_mask.common.s.is_fixed = !!(x) #define IS_FIXED_PPOS(fw) \ ((fw)->flags.common.s.is_fixed_ppos) #define SET_FIXED_PPOS(fw,x) \ (fw)->flags.common.s.is_fixed_ppos = !!(x) #define SETM_FIXED_PPOS(fw,x) \ (fw)->flag_mask.common.s.is_fixed_ppos = !!(x) #define IS_SIZE_FIXED(fw) \ ((fw)->flags.common.s.is_size_fixed) #define SET_SIZE_FIXED(fw,x) \ (fw)->flags.common.s.is_size_fixed = !!(x) #define SETM_SIZE_FIXED(fw,x) \ (fw)->flag_mask.common.s.is_size_fixed = !!(x) #define IS_PSIZE_FIXED(fw) \ ((fw)->flags.common.s.is_psize_fixed) #define SET_PSIZE_FIXED(fw,x) \ (fw)->flags.common.s.is_psize_fixed = !!(x) #define SETM_PSIZE_FIXED(fw,x) \ (fw)->flag_mask.common.s.is_psize_fixed = !!(x) #define IS_UNICONIFIABLE(fw) \ ((fw)->flags.common.s.is_uniconifiable) #define SET_IS_UNICONIFIABLE(fw,x) \ (fw)->flags.common.s.is_uniconifiable = !!(x) #define SETM_IS_UNICONIFIABLE(fw,x) \ (fw)->flag_mask.common.s.is_uniconifiable = !!(x) #define IS_UNMAXIMIZABLE(fw) \ ((fw)->flags.common.s.is_unmaximizable) #define SET_IS_UNMAXIMIZABLE(fw,x) \ (fw)->flags.common.s.is_unmaximizable = !!(x) #define SETM_IS_UNMAXIMIZABLE(fw,x) \ (fw)->flag_mask.common.s.is_unmaximizable = !!(x) #define IS_UNCLOSABLE(fw) \ ((fw)->flags.common.s.is_unclosable) #define SET_IS_UNCLOSABLE(fw,x) \ (fw)->flags.common.s.is_unclosable = !!(x) #define SETM_IS_UNCLOSABLE(fw,x) \ (fw)->flag_mask.common.s.is_unclosable = !!(x) #define IS_MAXIMIZE_FIXED_SIZE_DISALLOWED(fw) \ ((fw)->flags.common.s.is_maximize_fixed_size_disallowed) #define SET_MAXIMIZE_FIXED_SIZE_DISALLOWED(fw,x) \ (fw)->flags.common.s.is_maximize_fixed_size_disallowed = !!(x) #define SETM_MAXIMIZE_FIXED_SIZE_DISALLOWED(fw,x) \ (fw)->flag_mask.common.s.is_maximize_fixed_size_disallowed = !!(x) #define HAS_DEPRESSABLE_BORDER(fw) \ ((fw)->flags.common.s.has_depressable_border) #define IS_LEFT_TITLE_ROTATED_CW(fw) \ ((fw)->flags.common.s.is_left_title_rotated_cw) #define SET_IS_LEFT_TITLE_ROTATED_CW(fw,x) \ (fw)->flags.common.s.is_left_title_rotated_cw = !!(x) #define SETM_IS_LEFT_TITLE_ROTATED_CW(fw,x) \ (fw)->flag_mask.common.s.is_left_title_rotated_cw = !!(x) #define IS_RIGHT_TITLE_ROTATED_CW(fw) \ ((fw)->flags.common.s.is_right_title_rotated_cw) #define SET_IS_RIGHT_TITLE_ROTATED_CW(fw,x) \ (fw)->flags.common.s.is_right_title_rotated_cw = !!(x) #define SETM_IS_RIGHT_TITLE_ROTATED_CW(fw,x) \ (fw)->flag_mask.common.s.is_right_title_rotated_cw = !!(x) #define IS_BOTTOM_TITLE_ROTATED(fw) \ ((fw)->flags.common.s.is_bottom_title_rotated) #define SET_IS_BOTTOM_TITLE_ROTATED(fw,x) \ (fw)->flags.common.s.is_bottom_title_rotated = !!(x) #define SETM_IS_BOTTOM_TITLE_ROTATED(fw,x) \ (fw)->flag_mask.common.s.is_bottom_title_rotated = !!(x) #define IS_BOTTOM_TITLE_ROTATED(fw) \ ((fw)->flags.common.s.is_bottom_title_rotated) #define SET_IS_BOTTOM_TITLE_ROTATED(fw,x) \ (fw)->flags.common.s.is_bottom_title_rotated = !!(x) #define SETM_IS_BOTTOM_TITLE_ROTATED(fw,x) \ (fw)->flag_mask.common.s.is_bottom_title_rotated = !!(x) #define USE_TITLE_DECOR_ROTATION(fw) \ ((fw)->flags.common.s.use_title_decor_rotation) #define SET_USE_TITLE_DECOR_ROTATION(fw,x) \ (fw)->flags.common.s.use_title_decor_rotation = !!(x) #define SETM_USE_TITLE_DECOR_ROTATION(fw,x) \ (fw)->flag_mask.common.s.use_title_decor_rotation = !!(x) /* access to the special flags of a window */ #define DO_REUSE_DESTROYED(fw) \ ((fw)->flags.do_reuse_destroyed) #define SET_DO_REUSE_DESTROYED(fw,x) \ (fw)->flags.do_reuse_destroyed = !!(x) #define SETM_DO_REUSE_DESTROYED(fw,x) \ (fw)->flag_mask.do_reuse_destroyed = !!(x) #define HAS_NO_BORDER(fw) \ ((fw)->flags.common.has_no_border) #define SET_HAS_NO_BORDER(fw,x) \ (fw)->flags.common.has_no_border = !!(x) #define SETM_HAS_NO_BORDER(fw,x) \ (fw)->flag_mask.common.has_no_border = !!(x) #define HAS_HANDLES(fw) \ ((fw)->flags.has_handles) #define SET_HAS_HANDLES(fw,x) \ (fw)->flags.has_handles = !!(x) #define SETM_HAS_HANDLES(fw,x) \ (fw)->flag_mask.has_handles = !!(x) #define HAS_ICON_CHANGED(fw) \ ((fw)->flags.has_icon_changed) #define SET_HAS_ICON_CHANGED(fw,x) \ (fw)->flags.has_icon_changed = !!(x) #define SETM_HAS_ICON_CHANGED(fw,x) \ (fw)->flag_mask.has_icon_changed = !!(x) #define HAS_TITLE(fw) \ ((fw)->flags.has_title) #define SET_HAS_TITLE(fw,x) \ (fw)->flags.has_title = !!(x) #define SETM_HAS_TITLE(fw,x) \ (fw)->flag_mask.has_title = !!(x) #define HAS_NEW_WM_NORMAL_HINTS(fw) \ ((fw)->flags.has_new_wm_normal_hints) #define SET_HAS_NEW_WM_NORMAL_HINTS(fw,x) \ (fw)->flags.has_new_wm_normal_hints = !!(x) #define SETM_HAS_NEW_WM_NORMAL_HINTS(fw,x) \ (fw)->flag_mask.has_new_wm_normal_hints = !!(x) #define IS_MAPPED(fw) \ ((fw)->flags.is_mapped) #define SET_MAPPED(fw,x) \ (fw)->flags.is_mapped = !!(x) #define SETM_MAPPED(fw,x) \ (fw)->flag_mask.is_mapped = !!(x) #define IS_DECOR_CHANGED(fw) \ ((fw)->flags.is_decor_changed) #define SET_DECOR_CHANGED(fw,x) \ (fw)->flags.is_decor_changed = !!(x) #define SETM_DECOR_CHANGED(fw,x) \ (fw)->flag_mask.is_decor_changed = !!(x) #define IS_ICON_FONT_LOADED(fw) \ ((fw)->flags.is_icon_font_loaded) #define SET_ICON_FONT_LOADED(fw,x) \ (fw)->flags.is_icon_font_loaded = !!(x) #define SETM_ICON_FONT_LOADED(fw,x) \ (fw)->flag_mask.is_icon_font_loaded = !!(x) #define IS_ICONIFIED(fw) \ ((fw)->flags.is_iconified) #define SET_ICONIFIED(fw,x) \ (fw)->flags.is_iconified = !!(x) #define SETM_ICONIFIED(fw,x) \ (fw)->flag_mask.is_iconified = !!(x) #define IS_ICONIFIED_BY_PARENT(fw) \ ((fw)->flags.is_iconified_by_parent) #define SET_ICONIFIED_BY_PARENT(fw,x) \ (fw)->flags.is_iconified_by_parent = !!(x) #define SETM_ICONIFIED_BY_PARENT(fw,x) \ (fw)->flag_mask.is_iconified_by_parent = !!(x) #define IS_ICON_ENTERED(fw) \ ((fw)->flags.is_icon_entered) #define SET_ICON_ENTERED(fw,x) \ (fw)->flags.is_icon_entered = !!(x) #define SETM_ICON_ENTERED(fw,x) \ (fw)->flag_mask.is_icon_entered = !!(x) #define IS_ICON_OURS(fw) \ ((fw)->flags.is_icon_ours) #define SET_ICON_OURS(fw,x) \ (fw)->flags.is_icon_ours = !!(x) #define SETM_ICON_OURS(fw,x) \ (fw)->flag_mask.is_icon_ours = !!(x) #define IS_ICON_SHAPED(fw) \ ((fw)->flags.is_icon_shaped) #define SET_ICON_SHAPED(fw,x) \ (fw)->flags.is_icon_shaped = !!(x) #define SETM_ICON_SHAPED(fw,x) \ (fw)->flag_mask.is_icon_shaped = !!(x) #define IS_ICON_MOVED(fw) \ ((fw)->flags.is_icon_moved) #define SET_ICON_MOVED(fw,x) \ (fw)->flags.is_icon_moved = !!(x) #define SETM_ICON_MOVED(fw,x) \ (fw)->flag_mask.is_icon_moved = !!(x) #define IS_ICON_UNMAPPED(fw) \ ((fw)->flags.is_icon_unmapped) #define SET_ICON_UNMAPPED(fw,x) \ (fw)->flags.is_icon_unmapped = !!(x) #define SETM_ICON_UNMAPPED(fw,x) \ (fw)->flag_mask.is_icon_unmapped = !!(x) #define IS_IN_TRANSIENT_SUBTREE(fw) \ ((fw)->flags.is_in_transient_subtree) #define SET_IN_TRANSIENT_SUBTREE(fw,x) \ (fw)->flags.is_in_transient_subtree = !!(x) #define IS_MAP_PENDING(fw) \ ((fw)->flags.is_map_pending) #define SET_MAP_PENDING(fw,x) \ (fw)->flags.is_map_pending = !!(x) #define SETM_MAP_PENDING(fw,x) \ (fw)->flag_mask.is_map_pending = !!(x) #define IS_MAXIMIZED(fw) \ ((fw)->flags.is_maximized) #define SET_MAXIMIZED(fw,x) \ (fw)->flags.is_maximized = !!(x) #define SETM_MAXIMIZED(fw,x) \ (fw)->flag_mask.is_maximized = !!(x) #define IS_NAME_CHANGED(fw) \ ((fw)->flags.is_name_changed) #define SET_NAME_CHANGED(fw,x) \ (fw)->flags.is_name_changed = !!(x) #define SETM_NAME_CHANGED(fw,x) \ (fw)->flag_mask.is_name_changed = !!(x) #define IS_PIXMAP_OURS(fw) \ ((fw)->flags.is_pixmap_ours) #define SET_PIXMAP_OURS(fw,x) \ (fw)->flags.is_pixmap_ours = !!(x) #define SETM_PIXMAP_OURS(fw,x) \ (fw)->flag_mask.is_pixmap_ours = !!(x) #define IS_PLACED_BY_FVWM(fw) \ ((fw)->flags.is_placed_by_fvwm) #define SET_PLACED_BY_FVWM(fw,x) \ (fw)->flags.is_placed_by_fvwm = (x) #define SETM_PLACED_BY_FVWM(fw,x) \ (fw)->flag_mask.is_placed_by_fvwm = (x) #define IS_SCHEDULED_FOR_DESTROY(fw) \ ((fw)->flags.is_scheduled_for_destroy) #define SET_SCHEDULED_FOR_DESTROY(fw,x) \ (fw)->flags.is_scheduled_for_destroy = !!(x) #define IS_SCHEDULED_FOR_RAISE(fw) \ ((fw)->flags.is_scheduled_for_raise) #define SET_SCHEDULED_FOR_RAISE(fw,x) \ (fw)->flags.is_scheduled_for_raise = !!(x) #define IS_SHADED(fw) \ ((fw)->flags.is_window_shaded) #define USED_TITLE_DIR_FOR_SHADING(fw) \ ((fw)->flags.used_title_dir_for_shading) #define SET_USED_TITLE_DIR_FOR_SHADING(fw,x) \ ((fw)->flags.used_title_dir_for_shading = !!(x)) #define SHADED_DIR(fw) \ ((fw)->flags.shaded_dir) #define SET_SHADED(fw,x) \ (fw)->flags.is_window_shaded = !!(x) #define SET_SHADED_DIR(fw,x) \ (fw)->flags.shaded_dir = (x) #define SETM_SHADED(fw,x) \ (fw)->flag_mask.is_window_shaded = !!(x) #define IS_TEAR_OFF_MENU(fw) \ ((fw)->flags.is_tear_off_menu) #define SET_TEAR_OFF_MENU(fw,x) \ (fw)->flags.is_tear_off_menu = !!(x) #define SETM_TEAR_OFF_MENU(fw,x) \ (fw)->flag_mask.is_tear_off_menu = !!(x) #define IS_TRANSIENT(fw) \ ((fw)->flags.is_transient) #define SET_TRANSIENT(fw,x) \ (fw)->flags.is_transient = !!(x) #define SETM_TRANSIENT(fw,x) \ (fw)->flag_mask.is_transient = !!(x) #define IS_ICONIFY_PENDING(fw) \ ((fw)->flags.is_iconify_pending) #define SET_ICONIFY_PENDING(fw,x) \ (fw)->flags.is_iconify_pending = !!(x) #define SETM_ICONIFY_PENDING(fw,x) \ (fw)->flag_mask.is_iconify_pending = !!(x) #define DO_ICONIFY_AFTER_MAP(fw) \ ((fw)->flags.do_iconify_after_map) #define SET_ICONIFY_AFTER_MAP(fw,x) \ (fw)->flags.do_iconify_after_map = !!(x) #define SETM_ICONIFY_AFTER_MAP(fw,x) \ (fw)->flag_mask.do_iconify_after_map = !!(x) #define DO_DISABLE_CONSTRAIN_SIZE_FULLSCREEN(fw) \ ((fw)->flags.do_disable_constrain_size_fullscreen) #define SET_DISABLE_CONSTRAIN_SIZE_FULLSCREEN(fw,x) \ (fw)->flags.do_disable_constrain_size_fullscreen = !!(x) #define SETM_DISABLE_CONSTRAIN_SIZE_FULLSCREEN(fw,x) \ (fw)->flag_mask.do_disable_constrain_size_fullscreen = !!(x) #define IS_SIZE_INC_SET(fw) \ ((fw)->flags.is_size_inc_set) #define SET_SIZE_INC_SET(fw,x) \ (fw)->flags.is_size_inc_set = !!(x) #define SETM_SIZE_INC_SET(fw,x) \ (fw)->flag_mask.is_size_inc_set = !!(x) #define IS_STYLE_DELETED(fw) \ ((fw)->flags.is_style_deleted) #define SET_STYLE_DELETED(fw,x) \ (fw)->flags.is_style_deleted = !!(x) #define SETM_STYLE_DELETED(fw,x) \ (fw)->flag_mask.is_style_deleted = !!(x) #define IS_VIEWPORT_MOVED(fw) \ ((fw)->flags.is_viewport_moved) #define SET_VIEWPORT_MOVED(fw,x) \ (fw)->flags.is_viewport_moved = !!(x) #define SETM_VIEWPORT_MOVED(fw,x) \ (fw)->flag_mask.is_viewport_moved = !!(x) #define IS_VIEWPORT_MOVED(fw) \ ((fw)->flags.is_viewport_moved) #define IS_FOCUS_CHANGE_BROADCAST_PENDING(fw) \ ((fw)->flags.is_focus_change_broadcast_pending) #define SET_FOCUS_CHANGE_BROADCAST_PENDING(fw,x) \ (fw)->flags.is_focus_change_broadcast_pending = !!(x) #define SETM_FOCUS_CHANGE_BROADCAST_PENDING(fw,x) \ (fw)->flag_mask.is_focus_change_broadcast_pending = !!(x) #define IS_FULLY_VISIBLE(fw) \ ((fw)->flags.is_fully_visible) #define SET_FULLY_VISIBLE(fw,x) \ (fw)->flags.is_fully_visible = !!(x) #define SETM_FULLY_VISIBLE(fw,x) \ (fw)->flag_mask.is_fully_visible = !!(x) #define IS_PARTIALLY_VISIBLE(fw) \ ((fw)->flags.is_partially_visible) #define SET_PARTIALLY_VISIBLE(fw,x) \ (fw)->flags.is_partially_visible = !!(x) #define SETM_PARTIALLY_VISIBLE(fw,x) \ (fw)->flag_mask.is_partially_visible = !!(x) #define IS_WINDOW_DRAWN_ONCE(fw) \ ((fw)->flags.is_window_drawn_once) #define SET_WINDOW_DRAWN_ONCE(fw,x) \ (fw)->flags.is_window_drawn_once = !!(x) #define SETM_WINDOW_DRAWN_ONCE(fw,x) \ (fw)->flag_mask.is_window_drawn_once = !!(x) #define IS_WINDOW_BEING_MOVED_OPAQUE(fw) \ ((fw)->flags.is_window_being_moved_opaque) #define SET_WINDOW_BEING_MOVED_OPAQUE(fw,x) \ (fw)->flags.is_window_being_moved_opaque = !!(x) #define SETM_WINDOW_BEING_MOVED_OPAQUE(fw,x) \ (fw)->flag_mask.is_window_being_moved_opaque = !!(x) #define IS_WINDOW_BORDER_DRAWN(fw) \ ((fw)->flags.is_window_border_drawn) #define SET_WINDOW_BORDER_DRAWN(fw,x) \ (fw)->flags.is_window_border_drawn = !!(x) #define SETM_WINDOW_BORDER_DRAWN(fw,x) \ (fw)->flag_mask.is_window_border_drawn = !!(x) #define IS_WINDOW_FONT_LOADED(fw) \ ((fw)->flags.is_window_font_loaded) #define SET_WINDOW_FONT_LOADED(fw,x) \ (fw)->flags.is_window_font_loaded = !!(x) #define SETM_WINDOW_FONT_LOADED(fw,x) \ (fw)->flag_mask.is_window_font_loaded = !!(x) #define CR_MOTION_METHOD(fw) \ ((fw)->flags.cr_motion_method) #define SET_CR_MOTION_METHOD(fw,x) \ (fw)->flags.cr_motion_method = ((x) & CR_MOTION_METHOD_MASK) #define SETM_CR_MOTION_METHOD(fw,x) \ (fw)->flag_mask.cr_motion_method = ((x) ? CR_MOTION_METHOD_MASK : 0) #define WAS_CR_MOTION_METHOD_DETECTED(fw) \ ((fw)->flags.was_cr_motion_method_detected) #define SET_CR_MOTION_METHOD_DETECTED(fw,x) \ (fw)->flags.was_cr_motion_method_detected = !!(x) #define SETM_CR_MOTION_METHOD_DETECTED(fw,x) \ (fw)->flag_mask.was_cr_motion_method_detected = !!(x) #define WM_DELETES_WINDOW(fw) \ ((fw)->flags.does_wm_delete_window) #define SET_WM_DELETES_WINDOW(fw,x) \ (fw)->flags.does_wm_delete_window = !!(x) #define SETM_WM_DELETES_WINDOW(fw,x) \ (fw)->flag_mask.does_wm_delete_window = !!(x) #define WM_TAKES_FOCUS(fw) \ ((fw)->flags.does_wm_take_focus) #define SET_WM_TAKES_FOCUS(fw,x) \ (fw)->flags.does_wm_take_focus = !!(x) #define SETM_WM_TAKES_FOCUS(fw,x) \ (fw)->flag_mask.does_wm_take_focus = !!(x) #define DO_FORCE_NEXT_CR(fw) \ ((fw)->flags.do_force_next_cr) #define SET_FORCE_NEXT_CR(fw,x) \ (fw)->flags.do_force_next_cr = !!(x) #define SETM_FORCE_NEXT_CR(fw,x) \ (fw)->flag_mask.do_force_next_cr = !!(x) #define DO_FORCE_NEXT_PN(fw) \ ((fw)->flags.do_force_next_pn) #define SET_FORCE_NEXT_PN(fw,x) \ (fw)->flags.do_force_next_pn = !!(x) #define SETM_FORCE_NEXT_PN(fw,x) \ (fw)->flag_mask.do_force_next_pn = !!(x) #define USING_DEFAULT_WINDOW_FONT(fw) \ ((fw)->flags.using_default_window_font) #define SET_USING_DEFAULT_WINDOW_FONT(fw,x) \ (fw)->flags.using_default_window_font = !!(x) #define SETM_USING_DEFAULT_WINDOW_FONT(fw,x) \ (fw)->flag_mask.using_default_window_font = !!(x) #define USING_DEFAULT_ICON_FONT(fw) \ ((fw)->flags.using_default_icon_font) #define SET_USING_DEFAULT_ICON_FONT(fw,x) \ (fw)->flags.using_default_icon_font = !!(x) #define SETM_USING_DEFAULT_ICON_FONT(fw,x) \ (fw)->flag_mask.using_default_icon_font = !!(x) #define WAS_ICON_HINT_PROVIDED(fw) \ ((fw)->flags.was_icon_hint_provided) #define SET_WAS_ICON_HINT_PROVIDED(fw,x) \ (fw)->flags.was_icon_hint_provided = (x) #define SETM_WAS_ICON_HINT_PROVIDED(fw,x) \ (fw)->flag_mask.was_icon_hint_provided = (x) #define WAS_ICON_NAME_PROVIDED(fw) \ ((fw)->flags.was_icon_name_provided) #define SET_WAS_ICON_NAME_PROVIDED(fw,x) \ (fw)->flags.was_icon_name_provided = (x) #define SETM_WAS_ICON_NAME_PROVIDED(fw,x) \ (fw)->flag_mask.was_icon_name_provided = (x) #define WAS_NEVER_DRAWN(fw) \ ((fw)->flags.was_never_drawn) #define SET_WAS_NEVER_DRAWN(fw,x) \ (fw)->flags.was_never_drawn = (x) #define SETM_WAS_NEVER_DRAWN(fw,x) \ (fw)->flag_mask.was_never_drawn = (x) #define HAS_EWMH_WM_NAME(fw) \ ((fw)->flags.has_ewmh_wm_name) #define SET_HAS_EWMH_WM_NAME(fw,x) \ (fw)->flags.has_ewmh_wm_name = !!(x) #define SETM_HAS_EWMH_WM_NAME(fw,x) \ (fw)->flag_mask.has_ewmh_wm_name = !!(x) #define HAS_EWMH_WM_ICON_NAME(fw) \ ((fw)->flags.has_ewmh_wm_icon_name) #define SET_HAS_EWMH_WM_ICON_NAME(fw,x) \ (fw)->flags.has_ewmh_wm_icon_name = !!(x) #define SETM_HAS_EWMH_WM_ICON_NAME(fw,x) \ (fw)->flag_mask.has_ewmh_wm_icon_name = !!(x) #define HAS_EWMH_WM_ICON_HINT(fw) \ ((fw)->flags.has_ewmh_wm_icon_hint) #define SET_HAS_EWMH_WM_ICON_HINT(fw,x) \ (fw)->flags.has_ewmh_wm_icon_hint = (x) #define SETM_HAS_EWMH_WM_ICON_HINT(fw,x) \ (fw)->flag_mask.has_ewmh_wm_icon_hint = (x) #define USE_EWMH_ICON(fw) \ ((fw)->flags.use_ewmh_icon) #define SET_USE_EWMH_ICON(fw,x) \ (fw)->flags.use_ewmh_icon = !!(x) #define SETM_USE_EWMH_ICON(fw,x) \ (fw)->flag_mask.use_ewmh_icon = !!(x) #define HAS_EWMH_MINI_ICON(fw) \ ((fw)->flags.has_ewmh_mini_icon) #define SET_HAS_EWMH_MINI_ICON(fw,x) \ (fw)->flags.has_ewmh_mini_icon = !!(x) #define SETM_HAS_EWMH_MINI_ICON(fw,x) \ (fw)->flag_mask.has_ewmh_mini_icon = !!(x) #define HAS_EWMH_WM_PID(fw) \ ((fw)->flags.has_ewmh_wm_pid) #define SET_HAS_EWMH_WM_PID(fw,x) \ (fw)->flags.has_ewmh_wm_pid = !!(x) #define SETM_HAS_EWMH_WM_PID(fw,x) \ (fw)->flag_mask.has_ewmh_wm_pid = !!(x) #define IS_EWMH_MODAL(fw) \ ((fw)->flags.is_ewmh_modal) #define SET_EWMH_MODAL(fw,x) \ (fw)->flags.is_ewmh_modal = !!(x) #define SETM_EWMH_MODAL(fw,x) \ (fw)->flag_mask.is_ewmh_modal = !!(x) #define IS_EWMH_FULLSCREEN(fw) \ ((fw)->flags.is_ewmh_fullscreen) #define SET_EWMH_FULLSCREEN(fw,x) \ (fw)->flags.is_ewmh_fullscreen = !!(x) #define SETM_EWMH_FULLSCREEN(fw,x) \ (fw)->flag_mask.is_ewmh_fullscreen = !!(x) #define SET_HAS_EWMH_INIT_FULLSCREEN_STATE(fw,x) \ (fw)->flags.has_ewmh_init_fullscreen_state = (x) #define SETM_HAS_EWMH_INIT_FULLSCREEN_STATE(fw,x) \ (fw)->flag_mask.has_ewmh_init_fullscreen_state = (x) #define HAS_EWMH_INIT_FULLSCREEN_STATE(fw) \ ((fw)->flags.has_ewmh_init_fullscreen_state) #define SET_HAS_EWMH_INIT_HIDDEN_STATE(fw,x) \ (fw)->flags.has_ewmh_init_hidden_state = (x) #define SETM_HAS_EWMH_INIT_HIDDEN_STATE(fw,x) \ (fw)->flag_mask.has_ewmh_init_hidden_state = (x) #define HAS_EWMH_INIT_HIDDEN_STATE(fw) \ ((fw)->flags.has_ewmh_init_hidden_state) #define SET_HAS_EWMH_INIT_MAXHORIZ_STATE(fw,x) \ (fw)->flags.has_ewmh_init_maxhoriz_state = (x) #define SETM_HAS_EWMH_INIT_MAXHORIZ_STATE(fw,x) \ (fw)->flag_mask.has_ewmh_init_maxhoriz_state = (x) #define HAS_EWMH_INIT_MAXHORIZ_STATE(fw) \ ((fw)->flags.has_ewmh_init_maxhoriz_state) #define SET_HAS_EWMH_INIT_MAXVERT_STATE(fw,x) \ (fw)->flags.has_ewmh_init_maxvert_state = (x) #define SETM_HAS_EWMH_INIT_MAXVERT_STATE(fw,x) \ (fw)->flag_mask.has_ewmh_init_maxvert_state = (x) #define HAS_EWMH_INIT_MAXVERT_STATE(fw) \ ((fw)->flags.has_ewmh_init_maxvert_state) #define SET_HAS_EWMH_INIT_MODAL_STATE(fw,x) \ (fw)->flags.has_ewmh_init_modal_state = (x) #define SETM_HAS_EWMH_INIT_MODAL_STATE(fw,x) \ (fw)->flag_mask.has_ewmh_init_modal_state = (x) #define HAS_EWMH_INIT_MODAL_STATE(fw) \ ((fw)->flags.has_ewmh_init_modal_state) #define SET_HAS_EWMH_INIT_SHADED_STATE(fw,x) \ (fw)->flags.has_ewmh_init_shaded_state = (x) #define SETM_HAS_EWMH_INIT_SHADED_STATE(fw,x) \ (fw)->flag_mask.has_ewmh_init_shaded_state = (x) #define HAS_EWMH_INIT_SHADED_STATE(fw) \ ((fw)->flags.has_ewmh_init_shaded_state) #define SET_HAS_EWMH_INIT_SKIP_PAGER_STATE(fw,x) \ (fw)->flags.has_ewmh_init_skip_pager_state = (x) #define SETM_HAS_EWMH_INIT_SKIP_PAGER_STATE(fw,x) \ (fw)->flag_mask.has_ewmh_init_skip_pager_state = (x) #define HAS_EWMH_INIT_SKIP_PAGER_STATE(fw) \ ((fw)->flags.has_ewmh_init_skip_pager_state) #define SET_HAS_EWMH_INIT_SKIP_TASKBAR_STATE(fw,x) \ (fw)->flags.has_ewmh_init_skip_taskbar_state = (x) #define SETM_HAS_EWMH_INIT_SKIP_TASKBAR_STATE(fw,x) \ (fw)->flag_mask.has_ewmh_init_skip_taskbar_state = (x) #define HAS_EWMH_INIT_SKIP_TASKBAR_STATE(fw) \ ((fw)->flags.has_ewmh_init_skip_taskbar_state) #define SET_HAS_EWMH_INIT_STICKY_STATE(fw,x) \ (fw)->flags.has_ewmh_init_sticky_state = (x) #define SETM_HAS_EWMH_INIT_STICKY_STATE(fw,x) \ (fw)->flag_mask.has_ewmh_init_sticky_state = (x) #define HAS_EWMH_INIT_STICKY_STATE(fw) \ ((fw)->flags.has_ewmh_init_sticky_state) #define SET_HAS_EWMH_INIT_WM_DESKTOP(fw,x) \ (fw)->flags.has_ewmh_init_wm_desktop = (x) #define SETM_HAS_EWMH_INIT_WM_DESKTOP(fw,x) \ (fw)->flag_mask.has_ewmh_init_wm_desktop = (x) #define HAS_EWMH_INIT_WM_DESKTOP(fw) \ ((fw)->flags.has_ewmh_init_wm_desktop) #endif /* _WINDOW_FLAGS_ */ fvwm-2.6.5.orig/fvwm/colormaps.c0000644000175000017500000002474610552162474014767 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* This module is all new * by Rob Nation * * This code handles colormaps for fvwm. * * Copyright 1994 Robert Nation. No restrictions are placed on this code, * as long as the copyright notice is preserved . No guarantees or * warrantees of any sort whatsoever are given or implied or anything. */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/fvwmlib.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "execcontext.h" #include "eventhandler.h" #include "functions.h" #include "bindings.h" #include "misc.h" #include "screen.h" #include "colormaps.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static Bool client_controls_colormaps = False; static Colormap last_cmap = None; /* ---------------------------- exported variables (globals) --------------- */ const FvwmWindow *colormap_win; /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ void set_client_controls_colormaps(Bool flag) { client_controls_colormaps = flag; return; } /* HandleColormapNotify - colormap notify event handler * * This procedure handles both a client changing its own colormap, and * a client explicitly installing its colormap itself (only the window * manager should do that, so we must set it correctly). */ void colormap_handle_colormap_notify(const evh_args_t *ea) { XEvent evdummy; XColormapEvent *cevent = (XColormapEvent *)ea->exc->x.etrigger; Bool ReInstall = False; XWindowAttributes attr; FvwmWindow *fw = ea->exc->w.fw; if (!fw) { return; } if (cevent->new) { if (XGetWindowAttributes(dpy, FW_W(fw), &attr) != 0) { fw->attr_backup.colormap = attr.colormap; if (fw == colormap_win && fw->number_cmap_windows == 0) { last_cmap = attr.colormap; } ReInstall = True; } } else if ((cevent->state == ColormapUninstalled)&& (last_cmap == cevent->colormap)) { /* Some window installed its colormap, change it back */ ReInstall = True; } while (FCheckTypedEvent(dpy, ColormapNotify, &evdummy)) { if (XFindContext( dpy, cevent->window, FvwmContext, (caddr_t *) &fw) == XCNOENT) { fw = NULL; } if ((fw)&&(cevent->new)) { if (XGetWindowAttributes(dpy, FW_W(fw), &attr) != 0) { fw->attr_backup.colormap = attr.colormap; if (fw == colormap_win && fw->number_cmap_windows == 0) { last_cmap = attr.colormap; } ReInstall = True; } } else if ((fw)&& (cevent->state == ColormapUninstalled)&& (last_cmap == cevent->colormap)) { /* Some window installed its colormap, change it back */ ReInstall = True; } else if ((fw)&& (cevent->state == ColormapInstalled)&& (last_cmap == cevent->colormap)) { /* The last color map installed was the correct one. * Do not change anything */ ReInstall = False; } } /* Reinstall the colormap that we think should be installed, * UNLESS and unrecognized window has the focus - it might be * an override-redirect window that has its own colormap. */ if (ReInstall && Scr.UnknownWinFocused == None && !client_controls_colormaps) { XInstallColormap(dpy,last_cmap); } return; } /* Re-Install the active colormap */ void ReInstallActiveColormap(void) { InstallWindowColormaps(colormap_win); return; } /* Procedure: * InstallWindowColormaps - install the colormaps for one fvwm window * * Inputs: * type - type of event that caused the installation * tmp - for a subset of event types, the address of the * window structure, whose colormaps are to be installed. */ void InstallWindowColormaps(const FvwmWindow *fw) { int i; XWindowAttributes attributes; Window w; Bool ThisWinInstalled = False; /* If no window, then install fvwm colormap */ if (!fw) { fw = &Scr.FvwmRoot; } colormap_win = fw; /* Save the colormap to be loaded for when force loading of * root colormap(s) ends. */ Scr.pushed_window = fw; /* Don't load any new colormap if root/fvwm colormap(s) has been * force loaded. */ if (Scr.root_pushes || Scr.fvwm_pushes || client_controls_colormaps) { return; } if (fw->number_cmap_windows > 0) { for (i=fw->number_cmap_windows -1; i>=0;i--) { w = fw->cmap_windows[i]; if (w == FW_W(fw)) { ThisWinInstalled = True; } if (!XGetWindowAttributes(dpy,w,&attributes)) { attributes.colormap = last_cmap; } /* * On Sun X servers, don't install 24 bit TrueColor * colourmaps. Despite what the server says, these * colourmaps are always installed. */ if (last_cmap != attributes.colormap #if defined(sun) && defined(TRUECOLOR_ALWAYS_INSTALLED) && !(attributes.depth == 24 && attributes.visual->class == TrueColor) #endif ) { last_cmap = attributes.colormap; XInstallColormap(dpy, last_cmap); } } } if (!ThisWinInstalled) { if (last_cmap != fw->attr_backup.colormap #if defined(sun) && defined(TRUECOLOR_ALWAYS_INSTALLED) && !(fw->attr_backup.depth == 24 && fw->attr_backup.visual->class == TrueColor) #endif ) { last_cmap = fw->attr_backup.colormap; XInstallColormap(dpy, last_cmap); } } return; } /* Force (un)loads root colormap(s) * * These matching routines provide a mechanism to insure that * the root colormap(s) is installed during operations like * rubber banding that require colors from * that colormap. Calls may be nested arbitrarily deeply, * as long as there is one UninstallRootColormap call per * InstallRootColormap call. * * {Uni,I}nstall{Root,Fvwm}Colormap calls may be freely intermixed */ void InstallRootColormap(void) { if (last_cmap != DefaultColormap(dpy, Scr.screen)) { last_cmap = DefaultColormap(dpy, Scr.screen); XInstallColormap(dpy, last_cmap); } Scr.root_pushes++; return; } /* Unstacks one layer of root colormap pushing * If we peel off the last layer, re-install the application colormap * or the fvwm colormap if fvwm has a menu posted */ void UninstallRootColormap(void) { if (Scr.root_pushes) { Scr.root_pushes--; } if (!Scr.root_pushes) { if (!Scr.fvwm_pushes) { InstallWindowColormaps(Scr.pushed_window); } else if (last_cmap != Pcmap) { last_cmap = Pcmap; XInstallColormap(dpy, last_cmap); } } return; } /* Procedures: * {Uni/I}nstallFvwmColormap - Force (un)loads fvwm colormap(s) * This is used to ensure the fvwm colormap is installed during * menu operations */ void InstallFvwmColormap(void) { if (last_cmap != Pcmap) { last_cmap = Pcmap; XInstallColormap(dpy, last_cmap); } Scr.fvwm_pushes++; return; } void UninstallFvwmColormap(void) { if (Scr.fvwm_pushes) { Scr.fvwm_pushes--; } if (!Scr.fvwm_pushes) { if (!Scr.root_pushes) { InstallWindowColormaps(Scr.pushed_window); } else if (last_cmap != DefaultColormap(dpy, Scr.screen)) { last_cmap = DefaultColormap(dpy, Scr.screen); XInstallColormap(dpy, last_cmap); } } return; } /* Gets the WM_COLORMAP_WINDOWS property from the window * * This property typically doesn't exist, but a few applications * use it. These seem to occur mostly on SGI machines. */ void FetchWmColormapWindows (FvwmWindow *fw) { XWindowAttributes getattribs; XSetWindowAttributes setattribs; long i; unsigned long valuemask; if (fw->cmap_windows != (Window *)NULL) { XFree((void *)fw->cmap_windows); } if (!XGetWMColormapWindows (dpy, FW_W(fw), &(fw->cmap_windows), &(fw->number_cmap_windows))) { fw->number_cmap_windows = 0; fw->cmap_windows = NULL; } /* we need to be notified of Enter events into these subwindows * so we can set their colormaps */ if (fw->number_cmap_windows != 0) { for (i = 0; i < fw->number_cmap_windows; i++) { if (XGetWindowAttributes( dpy, fw->cmap_windows[i], &getattribs)) { valuemask = CWEventMask; setattribs.event_mask = getattribs.your_event_mask | EnterWindowMask | LeaveWindowMask; XChangeWindowAttributes( dpy, fw->cmap_windows[i], valuemask, &setattribs); } } } return; } /* Looks through the window list for any matching COLORMAP_WINDOWS * windows and installs the colormap if one exists. */ void EnterSubWindowColormap(Window win) { FvwmWindow *t; long i; XWindowAttributes attribs; for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if (t->number_cmap_windows != 0) { for (i = 0; i < t->number_cmap_windows; i++) { if (t->cmap_windows[i] == win) { if (XGetWindowAttributes( dpy,win,&attribs)) { last_cmap = attribs.colormap; XInstallColormap( dpy, last_cmap); } return; } } } } return; } void LeaveSubWindowColormap(Window win) { FvwmWindow *t; long i; int bWinInList, bParentInList; for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if (t->number_cmap_windows != 0) { bWinInList = 0; bParentInList = 0; for (i=0;inumber_cmap_windows;i++) { if (t->cmap_windows[i] == win) { bWinInList = 1; } if (t->cmap_windows[i] == FW_W(t)) { bParentInList = 1; } } if (bWinInList) { if (bParentInList) { InstallWindowColormaps(t); } else { InstallWindowColormaps(NULL); } return; } } } return; } fvwm-2.6.5.orig/fvwm/style.h0000644000175000017500000005444711622413321014123 0ustar vwcvwc/* -*-c-*- */ #ifndef _STYLE_ #define _STYLE_ /* The default title in case the user doesn't supply one. */ #define DEFAULT_TITLE_FORMAT "%n" /* access to the special flags of a style */ /* call these with a pointer to a style_flags struct */ #define SDO_DECORATE_TRANSIENT(sf) \ ((sf)->do_decorate_transient) #define SDO_SAVE_UNDER(sf) \ ((sf)->do_save_under) #define SDO_START_LOWERED(sf) \ ((sf)->do_start_lowered) #define SDO_START_SHADED(sf) \ ((sf)->do_start_shaded) #define SHAS_BORDER_WIDTH(sf) \ ((sf)->has_border_width) #define SHAS_COLOR_BACK(sf) \ ((sf)->has_color_back) #define SHAS_COLOR_FORE(sf) \ ((sf)->has_color_fore) #define SHAS_HANDLE_WIDTH(sf) \ ((sf)->has_handle_width) #define SHAS_ICON(sf) \ ((sf)->has_icon) #define SHAS_ICON_BOXES(sf) \ ((sf)->has_icon_boxes) #define SHAS_ICON_SIZE_LIMITS(sf) \ ((sf)->has_icon_size_limits) #define SHAS_ICON_BACKGROUND_PADDING(sf) \ ((sf)->has_icon_background_padding) #define SHAS_ICON_BACKGROUND_RELIEF(sf) \ ((sf)->has_icon_background_relief) #define SHAS_ICON_TITLE_RELIEF(sf) \ ((sf)->has_icon_title_relief) #define SHAS_MIN_WINDOW_SIZE(sf) \ ((sf)->has_min_window_size) #define SHAS_MAX_WINDOW_SIZE(sf) \ ((sf)->has_max_window_size) #define SHAS_WINDOW_SHADE_STEPS(sf) \ ((sf)->has_window_shade_steps) #define SHAS_MINI_ICON(sf) \ ((sf)->has_mini_icon) #define SHAS_MWM_DECOR(sf) \ ((sf)->has_mwm_decor) #define SHAS_MWM_FUNCTIONS(sf) \ ((sf)->has_mwm_functions) #define SHAS_NO_HANDLES(sf) \ ((sf)->has_no_handles) #define SHAS_NO_TITLE(sf) \ ((sf)->has_no_title) #define SHAS_OL_DECOR(sf) \ ((sf)->has_ol_decor) #define SIS_BUTTON_DISABLED(sf) \ ((sf)->is_button_disabled) #define SIS_UNMANAGED(sf) \ ((sf)->is_unmanaged) #define SPLACEMENT_MODE(sf) \ ((sf)->placement_mode) #define SEWMH_PLACEMENT_MODE(sf) \ ((sf)->ewmh_placement_mode) #define SUSE_BACKING_STORE(sf) \ ((sf)->use_backing_store) #define SUSE_PARENT_RELATIVE(sf) \ ((sf)->use_parent_relative) #define SUSE_COLORSET(sf) \ ((sf)->use_colorset) #define SUSE_COLORSET_HI(sf) \ ((sf)->use_colorset_hi) #define SUSE_BORDER_COLORSET(sf) \ ((sf)->use_border_colorset) #define SUSE_BORDER_COLORSET_HI(sf) \ ((sf)->use_border_colorset_hi) #define SUSE_ICON_TITLE_COLORSET(sf) \ ((sf)->use_icon_title_colorset) #define SUSE_ICON_TITLE_COLORSET_HI(sf) \ ((sf)->use_icon_title_colorset_hi) #define SUSE_ICON_BACKGROUND_COLORSET(sf) \ ((sf)->use_icon_background_colorset) #define SUSE_LAYER(sf) \ ((sf)->use_layer) #define SUSE_NO_PPOSITION(sf) \ ((sf)->use_no_pposition) #define SUSE_NO_USPOSITION(sf) \ ((sf)->use_no_usposition) #define SUSE_NO_TRANSIENT_PPOSITION(sf) \ ((sf)->use_no_transient_pposition) #define SUSE_NO_TRANSIENT_USPOSITION(sf) \ ((sf)->use_no_transient_usposition) #define SUSE_START_ON_DESK(sf) \ ((sf)->use_start_on_desk) #define SUSE_START_ON_PAGE_FOR_TRANSIENT(sf) \ ((sf)->use_start_on_page_for_transient) #define SUSE_START_ON_SCREEN(sf) \ ((sf)->use_start_on_screen) #define SMANUAL_PLACEMENT_HONORS_STARTS_ON_PAGE(sf) \ ((sf)->manual_placement_honors_starts_on_page) #define SCAPTURE_HONORS_STARTS_ON_PAGE(sf) \ ((sf)->capture_honors_starts_on_page) #define SRECAPTURE_HONORS_STARTS_ON_PAGE(sf) \ ((sf)->recapture_honors_starts_on_page) #define SHAS_PLACEMENT_PENALTY(sf) \ ((sf)->has_placement_penalty) #define SHAS_PLACEMENT_PERCENTAGE_PENALTY(sf) \ ((sf)->has_placement_percentage_penalty) #define SHAS_PLACEMENT_POSITION_STRING(sf) \ ((sf)->has_placement_position_string #define SCR_MOTION_METHOD(sf) \ ((sf)->ws_cr_motion_method) /* access the various copies of the common flags structure. */ #define SCF(st) \ ((st).flags.common) #define SCFS(st) \ ((st).flags.common.s) #define SCM(st) \ ((st).flag_mask.common) #define SCMS(st) \ ((st).flag_mask.common.s) #define SCD(st) \ ((st).flag_default.common) #define SCDS(st) \ ((st).flag_default.common.s) #define SCC(st) \ ((st).change_mask.common) #define SCCS(st) \ ((st).change_mask.common.s) #define SFC(sf) \ ((sf).common) /* access to common flags */ #define S_FOCUS_POLICY(c) \ ((c).s.focus_policy) #define S_TITLE_DIR(c) \ ((c).title_dir) #define S_SET_TITLE_DIR(c,x) \ ((c).title_dir = (x)) #define S_USER_STATES(c) \ ((c).user_states) #define S_SET_USER_STATES(c,x) \ ((c).user_states = (x)) #define S_ADD_USER_STATES(c,x) \ ((c).user_states = ((c).user_states | (x))) #define S_IS_STICKY_ACROSS_PAGES(c) \ ((c).is_sticky_across_pages) #define S_SET_IS_STICKY_ACROSS_PAGES(c,x) \ ((c).is_sticky_across_pages = !!(x)) #define S_IS_STICKY_ACROSS_DESKS(c) \ ((c).is_sticky_across_desks) #define S_SET_IS_STICKY_ACROSS_DESKS(c,x) \ ((c).is_sticky_across_desks = !!(x)) #define S_DO_CIRCULATE_SKIP(c) \ ((c).s.do_circulate_skip) #define S_SET_DO_CIRCULATE_SKIP(c,x) \ ((c).s.do_circulate_skip = !!(x)) #define S_DO_CIRCULATE_SKIP_ICON(c) \ ((c).s.do_circulate_skip_icon) #define S_SET_DO_CIRCULATE_SKIP_ICON(c,x) \ ((c).s.do_circulate_skip_icon = !!(x)) #define S_DO_CIRCULATE_SKIP_SHADED(c) \ ((c).s.do_circulate_skip_shaded) #define S_SET_DO_CIRCULATE_SKIP_SHADED(c,x) \ ((c).s.do_circulate_skip_shaded = !!(x)) #define S_DO_ICONIFY_WINDOW_GROUPS(c) \ ((c).s.do_iconify_window_groups) #define S_SET_DO_ICONIFY_WINDOW_GROUPS(c,x) \ ((c).s.do_iconify_window_groups = !!(x)) #define S_DO_IGNORE_GNOME_HINTS(c) \ ((c).s.do_ignore_gnome_hints) #define S_SET_DO_IGNORE_GNOME_HINTS(c,x) \ ((c).s.do_ignore_gnome_hints = !!(x)) #define S_DO_IGNORE_ICON_BOXES(c) \ ((c).s.do_ignore_icon_boxes) #define S_SET_DO_IGNORE_ICON_BOXES(c,x) \ ((c).s.do_ignore_icon_boxes = !!(x)) #define S_DO_IGNORE_RESTACK(c) \ ((c).s.do_ignore_restack) #define S_SET_DO_IGNORE_RESTACK(c,x) \ ((c).s.do_ignore_restack = !!(x)) #define S_DO_USE_WINDOW_GROUP_HINT(c) \ ((c).s.do_use_window_group_hint) #define S_SET_DO_USE_WINDOW_GROUP_HINT(c,x) \ ((c).s.do_use_window_group_hint = !!(x)) #define S_DO_LOWER_TRANSIENT(c) \ ((c).s.do_lower_transient) #define S_SET_DO_LOWER_TRANSIENT(c,x) \ ((c).s.do_lower_transient = !!(x)) #define S_DO_NOT_SHOW_ON_MAP(c) \ ((c).s.do_not_show_on_map) #define S_SET_DO_NOT_SHOW_ON_MAP(c,x) \ ((c).s.do_not_show_on_map = !!(x)) #define S_DO_RAISE_TRANSIENT(c) \ ((c).s.do_raise_transient) #define S_SET_DO_RAISE_TRANSIENT(c,x) \ ((c).s.do_raise_transient = !!(x)) #define S_DO_RESIZE_OPAQUE(c) \ ((c).s.do_resize_opaque) #define S_SET_DO_RESIZE_OPAQUE(c,x) \ ((c).s.do_resize_opaque = !!(x)) #define S_DO_SHRINK_WINDOWSHADE(c) \ ((c).s.do_shrink_windowshade) #define S_SET_DO_SHRINK_WINDOWSHADE(c,x) \ ((c).s.do_shrink_windowshade = !!(x)) #define S_DO_STACK_TRANSIENT_PARENT(c) \ ((c).s.do_stack_transient_parent) #define S_SET_DO_STACK_TRANSIENT_PARENT(c,x) \ ((c).s.do_stack_transient_parent = !!(x)) #define S_DO_WINDOW_LIST_SKIP(c) \ ((c).s.do_window_list_skip) #define S_SET_DO_WINDOW_LIST_SKIP(c,x) \ ((c).s.do_window_list_skip = !!(x)) #define S_HAS_NO_BORDER(c) \ ((c).has_no_border) #define S_SET_HAS_NO_BORDER(c,x) \ ((c).has_no_border = !!(x)) #define S_HAS_DEPRESSABLE_BORDER(c) \ ((c).s.has_depressable_border) #define S_SET_HAS_DEPRESSABLE_BORDER(c,x) \ ((c).s.has_depressable_border = !!(x)) #define S_HAS_ICON_FONT(c) \ ((c).has_icon_font) #define S_SET_HAS_ICON_FONT(c,x) \ ((c).has_icon_font = !!(x)) #define S_HAS_MWM_BORDER(c) \ ((c).s.has_mwm_border) #define S_SET_HAS_MWM_BORDER(c,x) \ ((c).s.has_mwm_border = !!(x)) #define S_HAS_MWM_BUTTONS(c) \ ((c).s.has_mwm_buttons) #define S_SET_HAS_MWM_BUTTONS(c,x) \ ((c).s.has_mwm_buttons = !!(x)) #define S_HAS_MWM_OVERRIDE(c) \ ((c).s.has_mwm_override) #define S_SET_HAS_MWM_OVERRIDE(c,x) \ ((c).s.has_mwm_override = !!(x)) #define S_HAS_NO_STICKY_STIPPLED_ICON_TITLE(c) \ ((c).s.has_no_sticky_stippled_icon_title) #define S_SET_HAS_NO_STICKY_STIPPLED_ICON_TITLE(c,x) \ ((c).s.has_no_sticky_stippled_icon_title = !!(x)) #define S_HAS_NO_ICON_TITLE(c) \ ((c).s.has_no_icon_title) #define S_SET_HAS_NO_ICON_TITLE(c,x) \ ((c).s.has_no_icon_title = !!(x)) #define S_HAS_OVERRIDE_SIZE(c) \ ((c).s.has_override_size) #define S_SET_HAS_OVERRIDE_SIZE(c,x) \ ((c).s.has_override_size = !!(x)) #define S_HAS_STIPPLED_TITLE(c) \ ((c).s.has_stippled_title) #define S_SET_HAS_STIPPLED_TITLE(c,x) \ ((c).s.has_stippled_title = !!(x)) #define S_HAS_NO_STICKY_STIPPLED_TITLE(c) \ ((c).s.has_no_sticky_stippled_title) #define S_SET_HAS_NO_STICKY_STIPPLED_TITLE(c,x) \ ((c).s.has_no_sticky_stippled_title = !!(x)) #define S_HAS_STIPPLED_ICON_TITLE(c) \ ((c).s.has_stippled_icon_title) #define S_SET_HAS_STIPPLED_ICON_TITLE(c,x) \ ((c).s.has_stippled_icon_title = !!(x)) #define S_HAS_WINDOW_FONT(c) \ ((c).has_window_font) #define S_SET_HAS_WINDOW_FONT(c,x) \ ((c).has_window_font = !!(x)) #define S_ICON_OVERRIDE(c) \ ((c).s.icon_override) #define S_SET_ICON_OVERRIDE(c,x) \ ((c).s.icon_override = (x)) #define S_IS_BOTTOM_TITLE_ROTATED(c) \ ((c).s.is_bottom_title_rotated) #define S_SET_IS_BOTTOM_TITLE_ROTATED(c,x) \ ((c).s.is_bottom_title_rotated = !!(x)) #define S_IS_FIXED(c) \ ((c).s.is_fixed) #define S_SET_IS_FIXED(c,x) \ ((c).s.is_fixed = !!(x)) #define S_IS_FIXED_PPOS(c) \ ((c).s.is_fixed_ppos) #define S_SET_IS_FIXED_PPOS(c,x) \ ((c).s.is_fixed_ppos = !!(x)) #define S_SET_IS_UNICONIFIABLE(c,x) \ ((c).s.is_uniconifiable = !!(x)) #define S_SET_IS_UNMAXIMIZABLE(c,x) \ ((c).s.is_unmaximizable = !!(x)) #define S_SET_IS_UNCLOSABLE(c,x) \ ((c).s.is_unclosable = !!(x)) #define S_SET_MAXIMIZE_FIXED_SIZE_DISALLOWED(c,x) \ ((c).s.is_maximize_fixed_size_disallowed = !!(x)) #define S_IS_ICON_STICKY_ACROSS_PAGES(c) \ ((c).s.is_icon_sticky_across_pages) #define S_SET_IS_ICON_STICKY_ACROSS_PAGES(c,x) \ ((c).s.is_icon_sticky_across_pages = !!(x)) #define S_IS_ICON_STICKY_ACROSS_DESKS(c) \ ((c).s.is_icon_sticky_across_desks) #define S_SET_IS_ICON_STICKY_ACROSS_DESKS(c,x) \ ((c).s.is_icon_sticky_across_desks = !!(x)) #define S_IS_ICON_SUPPRESSED(c) \ ((c).s.is_icon_suppressed) #define S_SET_IS_ICON_SUPPRESSED(c,x) \ ((c).s.is_icon_suppressed = !!(x)) #define S_IS_LEFT_TITLE_ROTATED_CW(c) \ ((c).s.is_left_title_rotated_cw) #define S_SET_IS_LEFT_TITLE_ROTATED_CW(c,x) \ ((c).s.is_left_title_rotated_cw = !!(x)) #define S_IS_SIZE_FIXED(c) \ ((c).s.is_size_fixed) #define S_SET_IS_SIZE_FIXED(c,x) \ ((c).s.is_size_fixed = !!(x)) #define S_IS_PSIZE_FIXED(c) \ ((c).s.is_psize_fixed) #define S_SET_IS_PSIZE_FIXED(c,x) \ ((c).s.is_psize_fixed = !!(x)) #define S_IS_RIGHT_TITLE_ROTATED_CW(c) \ ((c).s.is_right_title_rotated_cw) #define S_SET_IS_RIGHT_TITLE_ROTATED_CW(c,x) \ ((c).s.is_right_title_rotated_cw = !!(x)) #define S_IS_TOP_TITLE_ROTATED(c) \ ((c).s.is_top_title_rotated) #define S_SET_IS_TOP_TITLE_ROTATED(c,x) \ ((c).s.is_top_title_rotated = !!(x)) #define S_USE_ICON_POSITION_HINT(c) \ ((c).s.use_icon_position_hint) #define S_SET_USE_ICON_POSITION_HINT(c,x) \ ((c).s.use_icon_position_hint = !!(x)) #define S_USE_INDEXED_WINDOW_NAME(c) \ ((c).s.use_indexed_window_name) #define S_SET_USE_INDEXED_WINDOW_NAME(c,x) \ ((c).s.use_indexed_window_name = !!(x)) #define S_USE_INDEXED_ICON_NAME(c) \ ((c).s.use_indexed_icon_name) #define S_SET_USE_INDEXED_ICON_NAME(c,x) \ ((c).s.use_indexed_icon_name = !!(x)) #define S_WINDOWSHADE_LAZINESS(c) \ ((c).s.windowshade_laziness) #define S_SET_WINDOWSHADE_LAZINESS(c,x) \ ((c).s.windowshade_laziness = (x)) #define S_USE_TITLE_DECOR_ROTATION(c) \ ((c).s.use_title_decor_rotation) #define S_SET_USE_TITLE_DECOR_ROTATION(c,x) \ ((c).s.use_title_decor_rotation = !!(x)) #define S_DO_EWMH_MINI_ICON_OVERRIDE(c) \ ((c).s.do_ewmh_mini_icon_override) #define S_SET_DO_EWMH_MINI_ICON_OVERRIDE(c,x) \ ((c).s.do_ewmh_mini_icon_override = !!(x)) #define S_DO_EWMH_DONATE_ICON(c) \ ((c).s.do_ewmh_donate_icon) #define S_SET_DO_EWMH_DONATE_ICON(c,x) \ ((c).s.do_ewmh_donate_icon = !!(x)) #define S_DO_EWMH_DONATE_MINI_ICON(c) \ ((c).s.do_ewmh_donate_mini_icon) #define S_SET_DO_EWMH_DONATE_MINI_ICON(c,x) \ ((c).s.do_ewmh_donate_mini_icon = !!(x)) #define S_DO_EWMH_USE_STACKING_HINTS(c) \ ((c).s.do_ewmh_use_stacking_hints) #define S_SET_DO_EWMH_USE_STACKING_HINTS(c,x) \ ((c).s.do_ewmh_use_stacking_hints = !!(x)) #define S_DO_EWMH_IGNORE_STRUT_HINTS(c) \ ((c).s.do_ewmh_ignore_strut_hints) #define S_SET_DO_EWMH_IGNORE_STRUT_HINTS(c,x) \ ((c).s.do_ewmh_ignore_strut_hints = !!(x)) #define S_DO_EWMH_IGNORE_STATE_HINTS(c) \ ((c).s.do_ewmh_ignore_state_hints) #define S_SET_DO_EWMH_IGNORE_STATE_HINTS(c,x) \ ((c).s.do_ewmh_ignore_state_hints = !!(x)) #define S_DO_EWMH_IGNORE_WINDOW_TYPE(c) \ ((c).s.do_ewmh_ignore_window_type) #define S_SET_DO_EWMH_IGNORE_WINDOW_TYPE(c,x) \ ((c).s.do_ewmh_ignore_window_type = !!(x)) #define S_EWMH_MAXIMIZE_MODE(c) \ ((c).s.ewmh_maximize_mode) #define S_SET_EWMH_MAXIMIZE_MODE(c,x) \ ((c).s.ewmh_maximize_mode = (x)) /* access to style_id */ #define SID_GET_NAME(id) \ ((id).name) #define SID_SET_NAME(id,x) \ ((id).name = (x)) #define SID_GET_WINDOW_ID(id) \ ((id).window_id) #define SID_SET_WINDOW_ID(id,x) \ ((id).window_id = (x)) #define SID_SET_HAS_NAME(id,x) \ ((id).flags.has_name = !!(x)) #define SID_GET_HAS_NAME(id) \ ((id).flags.has_name) #define SID_SET_HAS_WINDOW_ID(id,x) \ ((id).flags.has_window_id = !!(x)) #define SID_GET_HAS_WINDOW_ID(id) \ ((id).flags.has_window_id) /* access to other parts of a style (call with the style itself) */ #define SGET_NEXT_STYLE(s) \ ((s).next) #define SSET_NEXT_STYLE(s,x) \ ((s).next = (x)) #define SGET_PREV_STYLE(s) \ ((s).prev) #define SSET_PREV_STYLE(s,x) \ ((s).prev = (x)) #define SGET_ID(s) \ ((s).id) #define SGET_NAME(s) \ SID_GET_NAME(SGET_ID(s)) #define SSET_NAME(s,x) \ SID_SET_NAME(SGET_ID(s),x) #define SGET_WINDOW_ID(s) \ SID_GET_WINDOW_ID(SGET_ID(s)) #define SSET_WINDOW_ID(s,x) \ SID_SET_WINDOW_ID(SGET_ID(s),x) #define SSET_ID_HAS_NAME(s,x) \ SID_SET_HAS_NAME(SGET_ID(s), x) #define SGET_ID_HAS_NAME(s) \ SID_GET_HAS_NAME(SGET_ID(s)) #define SSET_ID_HAS_WINDOW_ID(s,x) \ SID_SET_HAS_WINDOW_ID(SGET_ID(s),x) #define SGET_ID_HAS_WINDOW_ID(s) \ SID_GET_HAS_WINDOW_ID(SGET_ID(s)) #define SGET_ICON_NAME(s) \ ((s).icon_name) #define SSET_ICON_NAME(s,x) \ ((s).icon_name = (x)) #define SGET_MINI_ICON_NAME(s) \ ((s).mini_icon_name) #define SSET_MINI_ICON_NAME(s,x) \ ((s).mini_icon_name = (x)) #ifdef USEDECOR #define SGET_DECOR_NAME(s) \ ((s).decor_name) #define SSET_DECOR_NAME(s,x) \ ((s).decor_name = (x)) #endif #define SGET_FORE_COLOR_NAME(s) \ ((s).fore_color_name) #define SSET_FORE_COLOR_NAME(s,x) \ ((s).fore_color_name = (x)) #define SGET_BACK_COLOR_NAME(s) \ ((s).back_color_name) #define SSET_BACK_COLOR_NAME(s,x) \ ((s).back_color_name = (x)) #define SGET_FORE_COLOR_NAME_HI(s) \ ((s).fore_color_name_hi) #define SSET_FORE_COLOR_NAME_HI(s,x) \ ((s).fore_color_name_hi = (x)) #define SGET_BACK_COLOR_NAME_HI(s) \ ((s).back_color_name_hi) #define SSET_BACK_COLOR_NAME_HI(s,x) \ ((s).back_color_name_hi = (x)) #define SGET_ICON_FONT(s) \ ((s).icon_font) #define SSET_ICON_FONT(s,x) \ ((s).icon_font = (x)) #define SGET_WINDOW_FONT(s) \ ((s).window_font) #define SSET_WINDOW_FONT(s,x) \ ((s).window_font = (x)) #define SGET_COLORSET(s) \ ((s).colorset) #define SSET_COLORSET(s,x) \ ((s).colorset = (x)) #define SSET_BORDER_COLORSET(s,x) \ ((s).border_colorset = (x)) #define SGET_BORDER_COLORSET(s) \ ((s).border_colorset) #define SGET_COLORSET_HI(s) \ ((s).colorset_hi) #define SSET_COLORSET_HI(s,x) \ ((s).colorset_hi = (x)) #define SGET_BORDER_COLORSET_HI(s) \ ((s).border_colorset_hi) #define SSET_BORDER_COLORSET_HI(s,x) \ ((s).border_colorset_hi = (x)) #define SSET_ICON_TITLE_COLORSET(s,x) \ ((s).icon_title_colorset = (x)) #define SGET_ICON_TITLE_COLORSET(s) \ ((s).icon_title_colorset) #define SSET_ICON_TITLE_COLORSET_HI(s,x) \ ((s).icon_title_colorset_hi = (x)) #define SGET_ICON_TITLE_COLORSET_HI(s) \ ((s).icon_title_colorset_hi) #define SSET_ICON_BACKGROUND_COLORSET(s,x) \ ((s).icon_background_colorset = (x)) #define SGET_ICON_BACKGROUND_COLORSET(s) \ ((s).icon_background_colorset) #define SGET_FLAGS_POINTER(s) \ (&((s).flags)) #define SGET_BORDER_WIDTH(s) \ ((s).border_width) #define SSET_BORDER_WIDTH(s,x) \ ((s).border_width = (x)) #define SGET_HANDLE_WIDTH(s) \ ((s).handle_width) #define SSET_HANDLE_WIDTH(s,x) \ ((s).handle_width = (x)) #define SGET_LAYER(s) \ ((s).layer) #define SSET_LAYER(s,x) \ ((s).layer = (x)) #define SGET_START_DESK(s) \ ((s).start_desk) #define SSET_START_DESK(s,x) \ ((s).start_desk = (x)) #define SGET_START_PAGE_X(s) \ ((s).start_page_x) #define SSET_START_PAGE_X(s,x) \ ((s).start_page_x = (x)) #define SGET_START_PAGE_Y(s) \ ((s).start_page_y) #define SSET_START_PAGE_Y(s,x) \ ((s).start_page_y = (x)) #define SGET_START_SCREEN(s) \ ((s).start_screen) #define SSET_START_SCREEN(s,x) \ ((s).start_screen = (x)) #define SSET_STARTS_SHADED_DIR(s,x) \ ((s).flags.start_shaded_dir = (x)) #define SGET_STARTS_SHADED_DIR(s) \ ((s).flags.start_shaded_dir) #define SGET_MIN_ICON_WIDTH(s) \ ((s).min_icon_width) #define SSET_MIN_ICON_WIDTH(s,x) \ ((s).min_icon_width = (x)) #define SGET_MIN_ICON_HEIGHT(s) \ ((s).min_icon_height) #define SSET_MIN_ICON_HEIGHT(s,x) \ ((s).min_icon_height = (x)) #define SGET_MAX_ICON_WIDTH(s) \ ((s).max_icon_width) #define SSET_MAX_ICON_WIDTH(s,x) \ ((s).max_icon_width = (x)) #define SGET_MAX_ICON_HEIGHT(s) \ ((s).max_icon_height) #define SSET_MAX_ICON_HEIGHT(s,x) \ ((s).max_icon_height = (x)) #define SGET_ICON_RESIZE_TYPE(s) \ ((s).icon_resize_type) #define SSET_ICON_RESIZE_TYPE(s,x) \ ((s).icon_resize_type = (x)) #define SGET_ICON_BACKGROUND_RELIEF(s) \ ((s).icon_background_relief) #define SSET_ICON_BACKGROUND_RELIEF(s,x) \ ((s).icon_background_relief = (x)) #define SGET_ICON_BACKGROUND_PADDING(s) \ ((s).icon_background_padding) #define SSET_ICON_BACKGROUND_PADDING(s,x) \ ((s).icon_background_padding = (x)) #define SGET_ICON_TITLE_RELIEF(s) \ ((s).icon_title_relief) #define SSET_ICON_TITLE_RELIEF(s,x) \ ((s).icon_title_relief = (x)) #define SGET_MIN_WINDOW_WIDTH(s) \ ((s).min_window_width) #define SSET_MIN_WINDOW_WIDTH(s,x) \ ((s).min_window_width = (x)) #define SGET_MAX_WINDOW_WIDTH(s) \ ((s).max_window_width) #define SSET_MAX_WINDOW_WIDTH(s,x) \ ((s).max_window_width = (x)) #define SGET_MIN_WINDOW_HEIGHT(s) \ ((s).min_window_height) #define SSET_MIN_WINDOW_HEIGHT(s,x) \ ((s).min_window_height = (x)) #define SGET_MAX_WINDOW_HEIGHT(s) \ ((s).max_window_height) #define SSET_MAX_WINDOW_HEIGHT(s,x) \ ((s).max_window_height = (x)) #define SGET_WINDOW_SHADE_STEPS(s) \ ((s).shade_anim_steps) #define SSET_WINDOW_SHADE_STEPS(s,x) \ ((s).shade_anim_steps = (x)) #define SGET_SNAP_PROXIMITY(s) \ ((s).snap_attraction.proximity) #define SSET_SNAP_PROXIMITY(s,x) \ ((s).snap_attraction.proximity = (x)) #define SGET_SNAP_MODE(s) \ ((s).snap_attraction.mode) #define SSET_SNAP_MODE(s,x) \ ((s).snap_attraction.mode = (x)) #define SGET_SNAP_GRID_X(s) \ ((s).snap_grid_x) #define SSET_SNAP_GRID_X(s,x) \ ((s).snap_grid_x = (x)) #define SGET_SNAP_GRID_Y(s) \ ((s).snap_grid_y) #define SSET_SNAP_GRID_Y(s,x) \ ((s).snap_grid_y = (x)) #define SGET_EDGE_DELAY_MS_MOVE(s) \ ((s).edge_delay_ms_move) #define SSET_EDGE_DELAY_MS_MOVE(s,x) \ ((s).edge_delay_ms_move = (x)) #define SGET_EDGE_DELAY_MS_RESIZE(s) \ ((s).edge_delay_ms_resize) #define SSET_EDGE_DELAY_MS_RESIZE(s,x) \ ((s).edge_delay_ms_resize = (x)) #define SGET_EDGE_RESISTANCE_MOVE(s) \ ((s).edge_resistance_move) #define SSET_EDGE_RESISTANCE_MOVE(s,x) \ ((s).edge_resistance_move = (x)) #define SGET_EDGE_RESISTANCE_XINERAMA_MOVE(s) \ ((s).edge_resistance_xinerama_move) #define SSET_EDGE_RESISTANCE_XINERAMA_MOVE(s,x) \ ((s).edge_resistance_xinerama_move = (x)) #define SGET_ICON_BOXES(s) \ ((s).icon_boxes) #define SSET_ICON_BOXES(s,x) \ ((s).icon_boxes = (x)) #define SGET_PLACEMENT_PENALTY_PTR(s) \ (&(s).pl_penalty) #define SGET_NORMAL_PLACEMENT_PENALTY(s) \ ((s).pl_penalty.normal) #define SGET_ONTOP_PLACEMENT_PENALTY(s) \ ((s).pl_penalty.ontop) #define SGET_ICON_PLACEMENT_PENALTY(s) \ ((s).pl_penalty.icon) #define SGET_STICKY_PLACEMENT_PENALTY(s) \ ((s).pl_penalty.sticky) #define SGET_BELOW_PLACEMENT_PENALTY(s) \ ((s).pl_penalty.below) #define SGET_EWMH_STRUT_PLACEMENT_PENALTY(s) \ ((s).pl_penalty.strut) #define SSET_NORMAL_PLACEMENT_PENALTY(s,x) \ ((s).pl_penalty.normal = (x)) #define SSET_ONTOP_PLACEMENT_PENALTY(s,x) \ ((s).pl_penalty.ontop = (x)) #define SSET_ICON_PLACEMENT_PENALTY(s,x) \ ((s).pl_penalty.icon = (x)) #define SSET_STICKY_PLACEMENT_PENALTY(s,x) \ ((s).pl_penalty.sticky = (x)) #define SSET_BELOW_PLACEMENT_PENALTY(s,x) \ ((s).pl_penalty.below = (x)) #define SSET_EWMH_STRUT_PLACEMENT_PENALTY(s,x) \ ((s).pl_penalty.strut = (x)) #define SGET_PLACEMENT_PERCENTAGE_PENALTY_PTR(s) \ (&(s).pl_percent_penalty) #define SGET_99_PLACEMENT_PERCENTAGE_PENALTY(s) \ ((s).pl_percent_penalty.p99) #define SGET_95_PLACEMENT_PERCENTAGE_PENALTY(s) \ ((s).pl_percent_penalty.p95) #define SGET_85_PLACEMENT_PERCENTAGE_PENALTY(s) \ ((s).pl_percent_penalty.p85) #define SGET_75_PLACEMENT_PERCENTAGE_PENALTY(s) \ ((s).pl_percent_penalty.p75) #define SSET_99_PLACEMENT_PERCENTAGE_PENALTY(s,x) \ ((s).pl_percent_penalty.p99 = (x)) #define SSET_95_PLACEMENT_PERCENTAGE_PENALTY(s,x) \ ((s).pl_percent_penalty.p95 = (x)) #define SSET_85_PLACEMENT_PERCENTAGE_PENALTY(s,x) \ ((s).pl_percent_penalty.p85 = (x)) #define SSET_75_PLACEMENT_PERCENTAGE_PENALTY(s,x) \ ((s).pl_percent_penalty.p75 = (x)) #define SGET_PLACEMENT_POSITION_STRING(s) \ ((s).pl_position_string) #define SSET_PLACEMENT_POSITION_STRING(s,x) \ ((s).pl_position_string = (x)) #define SGET_INITIAL_MAP_COMMAND_STRING(s) \ ((s).initial_map_command_string) #define SSET_INITIAL_MAP_COMMAND_STRING(s,x) \ ((s).initial_map_command_string = (x)) #define SGET_TITLE_FORMAT_STRING(s) \ ((s).title_format_string) #define SSET_TITLE_FORMAT_STRING(s,x) \ ((s).title_format_string = (x)) #define SGET_ICON_TITLE_FORMAT_STRING(s) \ ((s).icon_title_format_string) #define SSET_ICON_TITLE_FORMAT_STRING(s,x) \ ((s).icon_title_format_string = (x)) /* function prototypes */ void lookup_style(FvwmWindow *fw, window_style *styles); Bool blockcmpmask(char *blk1, char *blk2, char *mask, int length); void check_window_style_change( FvwmWindow *t, update_win *flags, window_style *ret_style); void reset_style_changes(void); void update_style_colorset(int colorset); void update_window_color_style(FvwmWindow *fw, window_style *style); void update_window_color_hi_style(FvwmWindow *fw, window_style *style); void update_icon_title_cs_style(FvwmWindow *fw, window_style *pstyle); void update_icon_title_cs_hi_style(FvwmWindow *fw, window_style *pstyle); void update_icon_background_cs_style(FvwmWindow *fw, window_style *pstyle); void free_icon_boxes(icon_boxes *ib); void style_destroy_style(style_id_t s_id); void print_styles(int verbose); #endif /* _STYLE_ */ fvwm-2.6.5.orig/fvwm/Makefile.in0000644000175000017500000006415511744241233014662 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = fvwm$(EXEEXT) subdir = fvwm DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(configdir)" PROGRAMS = $(bin_PROGRAMS) am_fvwm_OBJECTS = menus.$(OBJEXT) style.$(OBJEXT) borders.$(OBJEXT) \ events.$(OBJEXT) move_resize.$(OBJEXT) builtins.$(OBJEXT) \ add_window.$(OBJEXT) icons.$(OBJEXT) fvwm.$(OBJEXT) \ frame.$(OBJEXT) placement.$(OBJEXT) virtual.$(OBJEXT) \ menustyle.$(OBJEXT) conditional.$(OBJEXT) ewmh.$(OBJEXT) \ stack.$(OBJEXT) session.$(OBJEXT) colorset.$(OBJEXT) \ functions.$(OBJEXT) ewmh_events.$(OBJEXT) gnome.$(OBJEXT) \ geometry.$(OBJEXT) module_list.$(OBJEXT) focus.$(OBJEXT) \ windowlist.$(OBJEXT) functable.$(OBJEXT) menuitem.$(OBJEXT) \ expand.$(OBJEXT) module_interface.$(OBJEXT) \ menubindings.$(OBJEXT) decorations.$(OBJEXT) \ ewmh_icons.$(OBJEXT) update.$(OBJEXT) bindings.$(OBJEXT) \ misc.$(OBJEXT) cursor.$(OBJEXT) colormaps.$(OBJEXT) \ modconf.$(OBJEXT) ewmh_conf.$(OBJEXT) read.$(OBJEXT) \ schedule.$(OBJEXT) menucmd.$(OBJEXT) ewmh_names.$(OBJEXT) \ icccm2.$(OBJEXT) windowshade.$(OBJEXT) focus_policy.$(OBJEXT) \ repeat.$(OBJEXT) execcontext.$(OBJEXT) menugeometry.$(OBJEXT) \ menudim.$(OBJEXT) condrc.$(OBJEXT) infostore.$(OBJEXT) fvwm_OBJECTS = $(am_fvwm_OBJECTS) fvwm_LDADD = $(LDADD) am__DEPENDENCIES_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(fvwm_SOURCES) DIST_SOURCES = $(fvwm_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' DATA = $(config_DATA) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ configdir = @FVWM_DATADIR@ EXTRA_DIST = $(config_DATA) config_DATA = ConfigFvwmDefaults ConfigFvwmSetup fvwm_SOURCES = \ add_window.h bindings.h borders.h builtins.h colormaps.h colorset.h \ commands.h conditional.h condrc.h cursor.h decorations.h events.h \ eventhandler.h eventmask.h ewmh.h ewmh_intern.h expand.h externs.h \ focus.h functable.h functions.h fvwm.h geometry.h focus_policy.h \ gnome.h icccm2.h icons.h menubindings.h menudim.h menugeometry.h \ menuitem.h menuroot.h menuparameters.h menus.h menustyle.h misc.h \ modconf.h module_interface.h module_list.h move_resize.h \ placement.h read.h repeat.h execcontext.h schedule.h screen.h \ session.h stack.h style.h update.h virtual.h window_flags.h frame.h \ infostore.h \ \ menus.c style.c borders.c events.c move_resize.c builtins.c \ add_window.c icons.c fvwm.c frame.c placement.c virtual.c \ menustyle.c conditional.c ewmh.c stack.c session.c colorset.c \ functions.c ewmh_events.c gnome.c geometry.c module_list.c focus.c \ windowlist.c functable.c menuitem.c expand.c module_interface.c \ menubindings.c decorations.c ewmh_icons.c update.c bindings.c misc.c \ cursor.c colormaps.c modconf.c ewmh_conf.c read.c schedule.c \ menucmd.c ewmh_names.c icccm2.c windowshade.c focus_policy.c repeat.c \ execcontext.c menugeometry.c menudim.c condrc.c infostore.c fvwm_DEPENDENCIES = $(top_builddir)/libs/libfvwm.a LDADD = \ -L$(top_builddir)/libs -lfvwm $(Xft_LIBS) $(X_LIBS) $(xpm_LIBS) \ $(stroke_LIBS) $(X_PRE_LIBS) $(Xinerama_LIBS) -lXext -lX11 \ $(X_EXTRA_LIBS) -lm $(iconv_LIBS) $(Xrender_LIBS) $(Xcursor_LIBS) \ $(Bidi_LIBS) $(png_LIBS) $(rsvg_LIBS) $(intl_LIBS) INCLUDES = \ -I$(top_srcdir) $(stroke_CFLAGS) $(Xft_CFLAGS) \ $(xpm_CFLAGS) $(X_CFLAGS) $(iconv_CFLAGS) $(Xrender_CFLAGS) \ $(Bidi_CFLAGS) $(png_CFLAGS) $(rsvg_CFLAGS) $(intl_CFLAGS) AM_CFLAGS = \ -DFVWM_MODULEDIR=\"$(FVWM_MODULEDIR)\" \ -DFVWM_DATADIR=\"$(FVWM_DATADIR)\" \ -DFVWM_CONFDIR=\"$(FVWM_CONFDIR)\" \ -DFVWM_COLORSET_PRIVATE=1 \ -DLOCALEDIR=\"$(LOCALEDIR)\" all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu fvwm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu fvwm/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) fvwm$(EXEEXT): $(fvwm_OBJECTS) $(fvwm_DEPENDENCIES) @rm -f fvwm$(EXEEXT) $(LINK) $(fvwm_OBJECTS) $(fvwm_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_window.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bindings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/borders.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/builtins.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colormaps.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/colorset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conditional.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/condrc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cursor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decorations.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/events.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewmh.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewmh_conf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewmh_events.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewmh_icons.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ewmh_names.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execcontext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/expand.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/focus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/focus_policy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frame.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/functable.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/functions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvwm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geometry.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnome.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icccm2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icons.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/infostore.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menubindings.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menucmd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menudim.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menugeometry.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menuitem.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menustyle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modconf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_interface.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_resize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/placement.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repeat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/schedule.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/style.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/update.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virtual.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windowlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windowshade.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` install-configDATA: $(config_DATA) @$(NORMAL_INSTALL) test -z "$(configdir)" || $(MKDIR_P) "$(DESTDIR)$(configdir)" @list='$(config_DATA)'; test -n "$(configdir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(configdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(configdir)" || exit $$?; \ done uninstall-configDATA: @$(NORMAL_UNINSTALL) @list='$(config_DATA)'; test -n "$(configdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(configdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(configdir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(configdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-configDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-exec-local install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-configDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-configDATA install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-exec-local \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-configDATA install-exec-local: @rm -f $(DESTDIR)$(bindir)/fvwm2 @$(LN_S) fvwm $(DESTDIR)$(bindir)/fvwm2 || \ echo "Minor warning: $(bindir)/fvwm2 symlink was not created" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/fvwm/infostore.c0000644000175000017500000001065711744236501014771 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "fvwm.h" #include "externs.h" #include "libs/FGettext.h" #include "libs/Parse.h" #include "libs/Strings.h" #include "infostore.h" #include "misc.h" #include "functions.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ static MetaInfo *mi_store; /* ---------------------------- forward declarations ----------------------- */ static void delete_metainfo(const char *); static int get_metainfo_length(void); /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ MetaInfo *new_metainfo(void) { MetaInfo *mi; mi = (MetaInfo *)safemalloc(sizeof(MetaInfo)); memset(mi, '\0', sizeof(MetaInfo)); return mi; } void insert_metainfo(char *key, char *value) { MetaInfo *mi; MetaInfo *mi_new; for (mi = mi_store; mi; mi = mi->next) { if (StrEquals(mi->key, key)) { /* We already have an entry in the list with that key, so * update the value of it only. */ free (mi->value); CopyString(&mi->value, value); return; } } /* It's a new item, add it to the list. */ mi_new = new_metainfo(); mi_new->key = key; CopyString(&mi_new->value, value); mi_new->next = mi_store; mi_store = mi_new; return; } static void delete_metainfo(const char *key) { MetaInfo *mi_current, *mi_prev; mi_prev = NULL; for(mi_current = mi_store; mi_current != NULL; mi_prev = mi_current, mi_current = mi_current->next) { if (StrEquals(mi_current->key, key)) { if (mi_prev == NULL) mi_store = mi_current->next; else mi_prev->next = mi_current->next; free(mi_current->key); free(mi_current->value); free(mi_current); break; } } return; } inline char *get_metainfo_value(const char *key) { MetaInfo *mi_current; for(mi_current = mi_store; mi_current; mi_current = mi_current->next) { if (StrEquals(mi_current->key, key)) return mi_current->value; } return NULL; } static inline int get_metainfo_length(void) { MetaInfo *mi; int count; count = 0; for(mi = mi_store; mi; mi = mi->next) count++; return count; } void print_infostore(void) { MetaInfo *mi; fprintf(stderr, "Current items in infostore (key, value):\n\n"); if (get_metainfo_length() == 0) { fprintf(stderr, "No items are currently stored in the infostore.\n"); return; } for(mi = mi_store; mi; mi = mi->next) { fprintf(stderr, "%s\t%s\n", mi->key, mi->value); } return; } /* ---------------------------- interface functions ------------------------ */ /* ---------------------------- builtin commands --------------------------- */ void CMD_InfoStoreAdd(F_CMD_ARGS) { char *key, *value; char *token; token = PeekToken(action, &action); key = value = NULL; if (token) key = strdup(token); token = PeekToken(action, &action); if (token) value = strdup(token); if (!key || !value) { fvwm_msg(ERR, "CMD_InfoStore", "Bad arguments given."); return; } insert_metainfo(key, value); free(value); return; } void CMD_InfoStoreRemove(F_CMD_ARGS) { char *token; token = PeekToken(action, &action); if (!token) { fvwm_msg(ERR, "CMD_InfoStoreRemove", "No key given to remove item."); return; } delete_metainfo(token); return; } fvwm-2.6.5.orig/fvwm/modconf.c0000644000175000017500000002125210655477602014410 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * * code for processing module configuration commands * * Modification History * * Created 09/23/98 by Dan Espen: * * - Some of this logic used to reside in "read.c", preceeded by a * comment about whether it belonged there. Time tells. * * - Added logic to execute module config commands by passing to the * modules that want "active command pipes". * * ******************************************************************** */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/Parse.h" #include "libs/Strings.h" #include "libs/wild.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "functions.h" #include "bindings.h" #include "misc.h" #include "screen.h" #include "module_list.h" #include "module_interface.h" #include "colorset.h" #include "libs/FScreen.h" extern int nColorsets; /* in libs/Colorset.c */ /* do not send ColorLimit, it is not used anymore but maybe by non * "official" modules */ #define DISABLE_COLORLIMIT_CONFIG_INFO #define MODULE_CONFIG_DELIM ':' struct moduleInfoList { char *data; unsigned char alias_len; struct moduleInfoList *next; }; struct moduleInfoList *modlistroot = NULL; static struct moduleInfoList *AddToModList(char *tline); static void SendConfigToModule( fmodule *module, const struct moduleInfoList *entry, char *match, int match_len); /* * ModuleConfig handles commands starting with "*". * * Each command is added to a list from which modules request playback * thru "sendconfig". * * Some modules request that module config commands be sent to them * as the commands are entered. Send to modules that want it. */ void ModuleConfig(char *action) { int end; fmodule_list_itr moditr; fmodule *module; struct moduleInfoList *new_entry; end = strlen(action) - 1; if (action[end] == '\n') action[end] = '\0'; /* save for config request */ new_entry = AddToModList(action); /* look at all possible pipes */ module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { if (IS_MESSAGE_SELECTED(module, M_SENDCONFIG)) { /* module wants config cmds */ char *name = MOD_NAME(module); if (MOD_ALIAS(module)) { name = MOD_ALIAS(module); } SendConfigToModule( module, new_entry, CatString2("*", name), 0); } } return; } static struct moduleInfoList *AddToModList(char *tline) { struct moduleInfoList *t, *prev, *this; char *rline = tline; char *alias_end = skipModuleAliasToken(tline + 1); /* Find end of list */ t = modlistroot; prev = NULL; while(t != NULL) { prev = t; t = t->next; } this = (struct moduleInfoList *)safemalloc( sizeof(struct moduleInfoList)); this->alias_len = 0; if (alias_end && alias_end[0] == MODULE_CONFIG_DELIM) { /* migo (01-Sep-2000): construct an old-style config line */ char *conf_start = alias_end + 1; while (isspace(*conf_start)) conf_start++; *alias_end = '\0'; rline = CatString2(tline, conf_start); *alias_end = MODULE_CONFIG_DELIM; this->alias_len = alias_end - tline; } this->data = (char *)safemalloc(strlen(rline)+1); strcpy(this->data, rline); this->next = NULL; if(prev == NULL) { modlistroot = this; } else { prev->next = this; } return this; } /* * delete from module configuration */ void CMD_DestroyModuleConfig(F_CMD_ARGS) { struct moduleInfoList *current, *next, *prev; char *info; /* info to be deleted - may contain wildcards */ char *mi; char *alias_end; int alias_len = 0; while (isspace(*action)) { action++; } alias_end = skipModuleAliasToken(action); if (alias_end && alias_end[0] == MODULE_CONFIG_DELIM) { /* migo: construct an old-style config line */ char *conf_start = alias_end + 1; while (isspace(*conf_start)) conf_start++; *alias_end = '\0'; GetNextToken(conf_start, &conf_start); if (conf_start == NULL) { return; } info = stripcpy(CatString2(action, conf_start)); *alias_end = MODULE_CONFIG_DELIM; /* +1 for a leading '*' */ alias_len = alias_end - action + 1; free(conf_start); } else { GetNextToken(action, &info); if (info == NULL) { return; } } current = modlistroot; prev = NULL; while (current != NULL) { GetNextToken(current->data, &mi); next = current->next; if ((!alias_len || !current->alias_len || alias_len == current->alias_len) && matchWildcards(info, mi+1)) { free(current->data); free(current); if( prev ) { prev->next = next; } else { modlistroot = next; } } else { prev = current; } current = next; if (mi) { free(mi); } } free(info); return; } static void send_xinerama_state(fmodule *module) { SendName(module, M_CONFIG_INFO, 0, 0, 0, FScreenGetConfiguration()); return; } static void send_desktop_names(fmodule *module) { DesktopsInfo *d; char *name; for (d = Scr.Desktops->next; d != NULL; d = d->next) { if (d->name != NULL) { name = (char *)safemalloc(strlen(d->name) + 44); sprintf(name,"DesktopName %d %s", d->desk, d->name); SendName(module, M_CONFIG_INFO, 0, 0, 0, name); free(name); } } return; } static void send_desktop_geometry(fmodule *module) { char msg[64]; sprintf(msg, "DesktopSize %d %d\n", Scr.VxMax / Scr.MyDisplayWidth + 1, Scr.VyMax / Scr.MyDisplayHeight + 1); SendName(module, M_CONFIG_INFO, 0, 0, 0, msg); return; } static void send_image_path(fmodule *module) { char *msg; char *ImagePath = PictureGetImagePath(); if (ImagePath && *ImagePath != 0) { msg = safemalloc(strlen(ImagePath) + 12); sprintf(msg, "ImagePath %s\n", ImagePath); SendName(module, M_CONFIG_INFO, 0, 0, 0, msg); free(msg); } return; } static void send_color_limit(fmodule *module) { #ifndef DISABLE_COLORLIMIT_CONFIG_INFO char msg[64]; sprintf(msg, "ColorLimit %d\n", Scr.ColorLimit); SendName(module, M_CONFIG_INFO, 0, 0, 0, msg); #endif return; } static void send_colorsets(fmodule *module) { int n; /* dump the colorsets (0 first as others copy it) */ for (n = 0; n < nColorsets; n++) { SendName( module, M_CONFIG_INFO, 0, 0, 0, DumpColorset(n, &Colorset[n])); } return; } static void send_click_time(fmodule *module) { char msg[64]; /* Dominik Vogt (8-Nov-1998): Scr.ClickTime patch to set ClickTime to * 'not at all' during InitFunction and RestartFunction. */ sprintf(msg,"ClickTime %d\n", (Scr.ClickTime < 0) ? -Scr.ClickTime : Scr.ClickTime); SendName(module, M_CONFIG_INFO, 0, 0, 0, msg); return; } static void send_move_threshold(fmodule *module) { char msg[64]; sprintf(msg, "MoveThreshold %d\n", Scr.MoveThreshold); SendName(module, M_CONFIG_INFO, 0, 0, 0, msg); return; } void send_ignore_modifiers(fmodule *module) { char msg[64]; sprintf(msg, "IgnoreModifiers %d\n", GetUnusedModifiers()); SendName(module, M_CONFIG_INFO, 0, 0, 0, msg); return; } void CMD_Send_ConfigInfo(F_CMD_ARGS) { struct moduleInfoList *t; /* matching criteria for module cmds */ char *match; /* get length once for efficiency */ int match_len = 0; fmodule *mod = exc->m.module; send_desktop_geometry(mod); /* send ImagePath and ColorLimit first */ send_image_path(mod); send_color_limit(mod); send_xinerama_state(mod); send_colorsets(mod); send_click_time(mod); send_move_threshold(mod); match = PeekToken(action, &action); if (match) { match_len = strlen(match); } for (t = modlistroot; t != NULL; t = t->next) { SendConfigToModule(mod, t, match, match_len); } send_desktop_names(mod); send_ignore_modifiers(mod); SendPacket( mod, M_END_CONFIG_INFO, (long)0, (long)0, (long)0, (long)0, (long)0, (long)0, (long)0, (long)0); return; } static void SendConfigToModule( fmodule *module, const struct moduleInfoList *entry, char *match, int match_len) { if (match) { if (match_len == 0) { match_len = strlen(match); } if (entry->alias_len > 0 && entry->alias_len != match_len) { return; } /* migo: this should be strncmp not strncasecmp probably. */ if (strncasecmp(entry->data, match, match_len) != 0) { return; } } SendName(module, M_CONFIG_INFO, 0, 0, 0, entry->data); return; } fvwm-2.6.5.orig/fvwm/add_window.h0000644000175000017500000000513711143535631015101 0ustar vwcvwc/* -*-c-*- */ #ifndef ADD_WINDOW_H #define ADD_WINDOW_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ #define AW_NO_WINDOW NULL #define AW_UNMANAGED ((void *)1) /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void setup_visible_name(FvwmWindow *fw, Bool is_icon); void setup_wm_hints(FvwmWindow *fw); void setup_snapping(FvwmWindow *fw, window_style *pstyle); void setup_placement_penalty(FvwmWindow *fw, window_style *pstyle); void setup_focus_policy(FvwmWindow *fw); Bool setup_transientfor(FvwmWindow *fw); void setup_icon_size_limits(FvwmWindow *fw, window_style *pstyle); void setup_icon_background_parameters(FvwmWindow *fw, window_style *pstyle); void setup_icon_title_parameters(FvwmWindow *fw, window_style *pstyle); void setup_numeric_vals(FvwmWindow *fw, window_style *pstyle); Bool validate_transientfor(FvwmWindow *fw); void setup_title_geometry( FvwmWindow *fw, window_style *pstyle); void setup_window_font( FvwmWindow *fw, window_style *pstyle, Bool do_destroy); void setup_icon_font( FvwmWindow *fw, window_style *pstyle, Bool do_destroy); void setup_style_and_decor( FvwmWindow *fw, window_style *pstyle, short *buttons); void setup_frame_attributes( FvwmWindow *fw, window_style *pstyle); void change_auxiliary_windows( FvwmWindow *fw, short buttons); void setup_frame_geometry( FvwmWindow *fw); void setup_frame_size_limits( FvwmWindow *fw, window_style *pstyle); void increase_icon_hint_count( FvwmWindow *fw); void change_icon( FvwmWindow *fw, window_style *pstyle); void change_mini_icon( FvwmWindow *fw, window_style *pstyle); void change_icon_boxes( FvwmWindow *fw, window_style *pstyle); void FetchWmProtocols( FvwmWindow *); FvwmWindow *AddWindow( const char **ret_initial_map_command, const exec_context_t *exc, FvwmWindow *ReuseWin, initial_window_options_t * win_opts); void GetWindowSizeHints( FvwmWindow *); void free_window_names( FvwmWindow *tmp, Bool nukename, Bool nukeicon); void destroy_window( FvwmWindow *); void RestoreWithdrawnLocation( FvwmWindow *tmp, Bool is_restart_or_recapture, Window parent); void Reborder(void); void CaptureAllWindows(const exec_context_t *exc, Bool is_recapture); #endif /* ADD_WINDOW_H */ fvwm-2.6.5.orig/fvwm/stack.c0000644000175000017500000013602211237545761014071 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include #include "libs/ftime.h" #include "libs/fvwmlib.h" #include "libs/gravity.h" #include "libs/Grab.h" #include "libs/Parse.h" #include "libs/defaults.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "functions.h" #include "bindings.h" #include "misc.h" #include "screen.h" #include "module_list.h" #include "module_interface.h" #include "focus.h" #include "stack.h" #include "events.h" #include "borders.h" #include "virtual.h" #include "geometry.h" #include "icons.h" #include "gnome.h" #include "ewmh.h" #include "frame.h" /* ---------------------------- local definitions -------------------------- */ /* If more than this many transients are in a single branch of a transient * tree, they will end up in more or less random stacking order. */ #define MAX_TRANSIENTS_IN_BRANCH 200000 /* Same for total levels of transients. */ #define MAX_TRANSIENT_LEVELS 10000 /* This number must fit in a signed int! */ #define LOWER_PENALTY (MAX_TRANSIENTS_IN_BRANCH * MAX_TRANSIENT_LEVELS) /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef enum { SM_RAISE = MARK_RAISE, SM_LOWER = MARK_LOWER, SM_RESTACK = MARK_RESTACK } stack_mode_t; /* ---------------------------- forward declarations ----------------------- */ static void __raise_or_lower_window( FvwmWindow *t, stack_mode_t mode, Bool allow_recursion, Bool is_new_window, Bool is_client_request); static void raise_or_lower_window( FvwmWindow *t, stack_mode_t mode, Bool allow_recursion, Bool is_new_window, Bool is_client_request); #if 0 static void ResyncFvwmStackRing(void); #endif static void ResyncXStackingOrder(void); static void BroadcastRestack(FvwmWindow *s1, FvwmWindow *s2); static Bool is_above_unmanaged(FvwmWindow *fw, Window *umtop); static int collect_transients_recursive( FvwmWindow *t, FvwmWindow *list_head, int layer, stack_mode_t mode, Bool do_include_target_window); /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ #define DEBUG_STACK_RING 1 #ifdef DEBUG_STACK_RING /* debugging function */ static void dump_stack_ring(void) { FvwmWindow *t1; if (!debugging_stack_ring) { return; } XBell(dpy, 0); fprintf(stderr,"dumping stack ring:\n"); for ( t1 = Scr.FvwmRoot.stack_next; t1 != &Scr.FvwmRoot; t1 = t1->stack_next) { fprintf(stderr," l=%d fw=%p f=0x%08x '%s'\n", t1->layer, t1, (int)FW_W_FRAME(t1), t1->name.name); } return; } /* debugging function */ void verify_stack_ring_consistency(void) { Window root, parent, *children; unsigned int nchildren; int i; FvwmWindow *t1, *t2; int last_layer; int last_index; if (!debugging_stack_ring) { return; } XFlush(dpy); t2 = Scr.FvwmRoot.stack_next; if (t2 == &Scr.FvwmRoot) { return; } last_layer = t2->layer; for ( t1 = t2->stack_next; t1 != &Scr.FvwmRoot; t2 = t1, t1 = t1->stack_next) { if (t1->layer > last_layer) { fprintf( stderr, "vsrc: stack ring is corrupt! '%s' (layer %d)" " is above '%s' (layer %d/%d)\n", t1->name.name, t1->layer, t2->name.name, t2->layer, last_layer); dump_stack_ring(); return; } last_layer = t1->layer; } t2 = &Scr.FvwmRoot; for ( t1 = t2->stack_next; t1 != &Scr.FvwmRoot; t2 = t1, t1 = t1->stack_next) { if (t1->stack_prev != t2) { break; } } if (t1 != &Scr.FvwmRoot || t1->stack_prev != t2) { fprintf( stderr, "vsrc: stack ring is corrupt -" " fvwm will probably crash! %p -> %p but %p <- %p", t2, t1, t1->stack_prev, t1); dump_stack_ring(); return; } MyXGrabServer(dpy); if (!XQueryTree(dpy, Scr.Root, &root, &parent, &children, &nchildren)) { MyXUngrabServer(dpy); return; } last_index = nchildren; for ( t1 = Scr.FvwmRoot.stack_next; t1 != &Scr.FvwmRoot; t1 = t1->stack_next) { /* find window in window list */ for ( i = 0; i < nchildren && FW_W_FRAME(t1) != children[i]; i++) { /* nothing to do here */ } if (i == nchildren) { fprintf( stderr,"vsrc: window already died:" " fw=%p w=0x%08x '%s'\n", t1, (int)FW_W_FRAME(t1), t1->name.name); } else if (i >= last_index) { fprintf( stderr, "vsrc: window is at wrong position" " in stack ring: fw=%p f=0x%08x '%s'\n", t1, (int)FW_W_FRAME(t1), t1->name.name); dump_stack_ring(); fprintf(stderr,"dumping X stacking order:\n"); for (i = nchildren; i-- > 0; ) { for ( t1 = Scr.FvwmRoot.stack_next; t1 != &Scr.FvwmRoot; t1 = t1->stack_next) { /* only dump frame windows */ if (FW_W_FRAME(t1) == children[i]) { fprintf( stderr, " f=0x%08x\n", (int)children[i]); break; } } } MyXUngrabServer(dpy); XFree(children); return; } last_index = i; } MyXUngrabServer(dpy); XFree(children); return; } #endif /* Add a whole ring of windows. The list_head itself will not be added. */ static void add_windowlist_to_stack_ring_after( FvwmWindow *list_head, FvwmWindow *add_after_win) { add_after_win->stack_next->stack_prev = list_head->stack_prev; list_head->stack_prev->stack_next = add_after_win->stack_next; add_after_win->stack_next = list_head->stack_next; list_head->stack_next->stack_prev = add_after_win; return; } static FvwmWindow *get_transientfor_top_fvwmwindow(FvwmWindow *t) { FvwmWindow *s; s = t; while (s && IS_TRANSIENT(s) && DO_STACK_TRANSIENT_PARENT(s)) { s = get_transientfor_fvwmwindow(s); if (s) { t = s; } } return t; } /* * Raise a target and all higher fvwm-managed windows above any * override_redirects: * - locate the highest override_redirect above our target * - put all the FvwmWindows from the target to the highest FvwmWindow * below the highest override_redirect in the restack list * - configure our target window above the override_redirect sibling, * and restack. */ static void raise_over_unmanaged(FvwmWindow *t) { int i; Window OR_Above = None; Window *wins; int count = 0; FvwmWindow *t2 = NULL; unsigned int flags; XWindowChanges changes; /* * Locate the highest override_redirect window above our target, and * the highest of our windows below it. * * Count the windows we need to restack, then build the stack list. */ if (!is_above_unmanaged(t, &OR_Above)) { for ( count = 0, t2 = Scr.FvwmRoot.stack_next; t2 != &Scr.FvwmRoot; t2 = t2->stack_next) { count++; count += get_visible_icon_window_count(t2); if (t2 == t) { break; } } if (count > 0) { wins = (Window*) safemalloc (count * sizeof (Window)); for ( i = 0, t2 = Scr.FvwmRoot.stack_next; t2 != &Scr.FvwmRoot; t2 = t2->stack_next) { wins[i++] = FW_W_FRAME(t2); if (IS_ICONIFIED(t2) && ! IS_ICON_SUPPRESSED(t2)) { if (FW_W_ICON_TITLE(t2) != None) { wins[i++] = FW_W_ICON_TITLE(t2); } if (FW_W_ICON_PIXMAP(t2) != None) { wins[i++] = FW_W_ICON_PIXMAP(t2); } } if (t2 == t) { break; } } memset(&changes, '\0', sizeof(changes)); changes.sibling = OR_Above; changes.stack_mode = Above; flags = CWSibling|CWStackMode; XConfigureWindow( dpy, FW_W_FRAME(t)/*topwin*/, flags, &changes); if (i > 1) { XRestackWindows(dpy, wins, i); } free (wins); } }/* end - we found an OR above our target */ return; } static Bool __is_restack_transients_needed( FvwmWindow *t, stack_mode_t mode) { if (DO_RAISE_TRANSIENT(t)) { if (mode == SM_RAISE || mode == SM_RESTACK) { return True; } } if (DO_LOWER_TRANSIENT(t)) { if (mode == SM_LOWER || mode == SM_RESTACK) { return True; } } return False; } static Bool __must_move_transients( FvwmWindow *t, stack_mode_t mode) { if (IS_ICONIFIED(t)) { return False; } /* raise */ if (__is_restack_transients_needed(t, mode) == True) { Bool scanning_above_window = True; FvwmWindow *q; for ( q = Scr.FvwmRoot.stack_next; q != &Scr.FvwmRoot && t->layer <= q->layer; q = q->stack_next) { if (t->layer < q->layer) { /* We're not interested in higher layers. */ continue; } else if (mode == SM_RESTACK && IS_TRANSIENT(q) && FW_W_TRANSIENTFOR(q) == FW_W(t)) { return True; } else if (t == q) { /* We found our window. All further transients * are below it. */ scanning_above_window = False; } else if (IS_TRANSIENT(q) && FW_W_TRANSIENTFOR(q) == FW_W(t)) { return True; } else if (scanning_above_window && mode == SM_RAISE) { /* raise: The window is not raised, so itself * and all transients will be raised. */ return True; } } } return False; } static Window __get_stacking_sibling(FvwmWindow *fw, Bool do_stack_below) { Window w; /* default to frame window */ w = FW_W_FRAME(fw); if (IS_ICONIFIED(fw) && do_stack_below == True) { /* override with icon windows when stacking below */ if (FW_W_ICON_PIXMAP(fw) != None) { w = FW_W_ICON_PIXMAP(fw); } else if (FW_W_ICON_TITLE(fw) != None) { w = FW_W_ICON_TITLE(fw); } } return w; } static void __sort_transient_ring(FvwmWindow *ring) { FvwmWindow *s; FvwmWindow *t; FvwmWindow *u; FvwmWindow *prev; if (ring->stack_next->stack_next == ring) { /* only one or zero windows */ return; } /* Implementation note: this sorting algorithm is about the most * inefficient possible. It just swaps the position of two adjacent * windows in the ring if they are in the wrong order. Since * transient windows are rare, this should not cause any notable * performance hit. Because it is important that the order of windows * with the same key is not changed, we can not just use qsort() here. */ for ( t = ring->stack_next, prev = ring; t->stack_next != ring; prev = t->stack_prev) { s = t->stack_next; if (t->scratch.i < s->scratch.i) { /* swap windows */ u = s->stack_next; s->stack_next = t; t->stack_next = u; u = t->stack_prev; t->stack_prev = s; s->stack_prev = u; s->stack_prev->stack_next = s; t->stack_next->stack_prev = t; if (prev != ring) { /* move further up the ring? */ t = prev; } else { /* hit start of ring */ } } else { /* correct order, advance one window */ t = t->stack_next; } } return; } static void __restack_window_list( FvwmWindow *r, FvwmWindow *s, int count, Bool do_broadcast_all, Bool do_lower) { FvwmWindow *t; unsigned int flags; int i; XWindowChanges changes; Window *wins; int do_stack_above; int is_reversed; if (count <= 0) { for (count = 0, t = r->stack_next; t != s; t = t->stack_next) { count++; count += get_visible_icon_window_count(t); } } /* restack the windows between r and s */ wins = (Window *)safemalloc((count + 3) * sizeof(Window)); for (t = r->stack_next, i = 0; t != s; t = t->stack_next) { if (i > count) { fvwm_msg( ERR, "__restack_window_list", "more transients than expected"); break; } wins[i++] = FW_W_FRAME(t); if (IS_ICONIFIED(t) && !IS_ICON_SUPPRESSED(t)) { if (FW_W_ICON_TITLE(t) != None) { wins[i++] = FW_W_ICON_TITLE(t); } if (FW_W_ICON_PIXMAP(t) != None) { wins[i++] = FW_W_ICON_PIXMAP(t); } } } changes.sibling = __get_stacking_sibling(r, True); if (changes.sibling == None) { changes.sibling = __get_stacking_sibling(s, False); is_reversed = 1; } else { is_reversed = 0; } if (changes.sibling == None) { do_stack_above = !do_lower; flags = CWStackMode; } else { do_stack_above = 0; flags = CWStackMode | CWSibling; } changes.stack_mode = (do_stack_above ^ is_reversed) ? Above : Below; XConfigureWindow(dpy, FW_W_FRAME(r->stack_next), flags, &changes); if (count > 1) { XRestackWindows(dpy, wins, count); } free(wins); EWMH_SetClientListStacking(); if (do_broadcast_all) { /* send out M_RESTACK for all windows, to make sure we don't * forget anything. */ BroadcastRestackAllWindows(); } else { /* send out (one or more) M_RESTACK packets for windows * between r and s */ BroadcastRestack(r, s); } return; } FvwmWindow *__get_window_to_insert_after(FvwmWindow *fw, stack_mode_t mode) { int test_layer; FvwmWindow *s; switch (mode) { case SM_LOWER: test_layer = fw->layer - 1; break; default: case SM_RAISE: case SM_RESTACK: test_layer = fw->layer; break; } for ( s = Scr.FvwmRoot.stack_next; s != &Scr.FvwmRoot; s = s->stack_next) { if (s == fw) { continue; } if (test_layer >= s->layer) { break; } } return s; } static void __mark_group_member( FvwmWindow *fw, FvwmWindow *start, FvwmWindow *end) { FvwmWindow *t; for (t = start; t != end; t = t->stack_next) { if (FW_W(t) == fw->wmhints->window_group || (t->wmhints && (t->wmhints->flags & WindowGroupHint) && t->wmhints->window_group == fw->wmhints->window_group)) { if (IS_IN_TRANSIENT_SUBTREE(t)) { /* have to move this one too */ SET_IN_TRANSIENT_SUBTREE(fw, 1); } } } return; } static Bool __mark_transient_subtree_test( FvwmWindow *s, FvwmWindow *start, FvwmWindow *end, int mark_mode, Bool do_ignore_icons, Bool use_window_group_hint) { Bool use_group_hint = False; FvwmWindow *r; if (IS_IN_TRANSIENT_SUBTREE(s)) { return False; } if (use_window_group_hint && DO_ICONIFY_WINDOW_GROUPS(s) && s->wmhints && (s->wmhints->flags & WindowGroupHint) && (s->wmhints->window_group != None) && (s->wmhints->window_group != FW_W(s)) && (s->wmhints->window_group != Scr.Root)) { use_group_hint = True; } if (!IS_TRANSIENT(s) && !use_group_hint) { return False; } if (do_ignore_icons && IS_ICONIFIED(s)) { return False; } r = (FvwmWindow *)s->scratch.p; if (IS_TRANSIENT(s)) { if (r && IS_IN_TRANSIENT_SUBTREE(r) && ((mark_mode == MARK_ALL) || __is_restack_transients_needed( r, (stack_mode_t)mark_mode) == True)) { /* have to move this one too */ SET_IN_TRANSIENT_SUBTREE(s, 1); /* used for stacking transients */ s->scratch.i += r->scratch.i + 1; return True; } } if (use_group_hint && !IS_IN_TRANSIENT_SUBTREE(s)) { __mark_group_member(s, start, end); if (IS_IN_TRANSIENT_SUBTREE(s)) { /* need another scan through the list */ return True; } } return False; } /* heavaly borrowed from mark_transient_subtree. This will mark a subtree as * long as it is straight, and return true if the operation is succussful. It * will abort and return False as soon as some inconsitance is hit. */ static Bool is_transient_subtree_straight( FvwmWindow *t, int layer, stack_mode_t mode, Bool do_ignore_icons, Bool use_window_group_hint) { FvwmWindow *s; FvwmWindow *start; FvwmWindow *end; int min_i; Bool is_in_gap; int mark_mode; switch (mode) { case SM_RAISE: mark_mode = MARK_RAISE; break; case SM_LOWER: mark_mode = MARK_LOWER; break; default: return False; } if (layer >= 0 && t->layer != layer) { return True; } if (t->stack_prev == NULL || t->stack_next == NULL) { /* the window is not placed correctly in the stack ring * (probably about to be destroyed) */ return False; } /* find out on which windows to operate */ /* iteration are done reverse (bottom up, since that's the way the * transients wil be stacked if all is well */ if (layer >= 0) { /* only work on the given layer */ start = &Scr.FvwmRoot; end = &Scr.FvwmRoot; for ( s = Scr.FvwmRoot.stack_prev; s != &Scr.FvwmRoot && s->layer <= layer; s = s->stack_prev) { if (s->layer == layer) { if (start == &Scr.FvwmRoot) { start = s; } end = s->stack_prev; } } } else { /* work on complete window list */ start = Scr.FvwmRoot.stack_prev; end = &Scr.FvwmRoot; } /* clean the temporary flag in all windows and precalculate the * transient frame windows */ for ( s = Scr.FvwmRoot.stack_next; s != &Scr.FvwmRoot; s = s->stack_next) { SET_IN_TRANSIENT_SUBTREE(s, 0); if (IS_TRANSIENT(s) && (layer < 0 || layer == s->layer)) { s->scratch.p = get_transientfor_fvwmwindow(s); } else { s->scratch.p = NULL; } } /* Indicate that no cleening is needed */ Scr.FvwmRoot.scratch.i = 1; /* now loop over the windows and mark the ones we need to move */ SET_IN_TRANSIENT_SUBTREE(t, 1); min_i = INT_MIN; is_in_gap = False; if (mode == SM_LOWER && t != start) { return False; } /* check that all transients above the window are in a sorted line * with no other windows between them */ for (s = t->stack_prev; s != end && !(is_in_gap && mode == SM_RAISE); s = s->stack_prev) { if ( __mark_transient_subtree_test( s, start, end, mark_mode, do_ignore_icons, use_window_group_hint)) { if (is_in_gap) { return False; } else if (s->scratch.i < min_i) { return False; } min_i = s->scratch.i; } else { is_in_gap = True; } } /* for */ if (is_in_gap && mode == SM_RAISE) { return False; } /* check that there are no transients left beneth the window */ for (s = start; s != t; s = s->stack_prev) { if ( __mark_transient_subtree_test( s, start, end, mark_mode, do_ignore_icons, use_window_group_hint)) { return False; } } return True; } /* function to test if all windows are at correct place from start. */ static Bool __is_restack_needed( FvwmWindow *t, stack_mode_t mode, Bool do_restack_transients, Bool is_new_window) { if (is_new_window) { return True; } else if (t->stack_prev == NULL || t->stack_next == NULL) { /* the window is about to be destroyed, and has been removed * from the stack ring. No need to restack. */ return False; } if (mode == SM_RESTACK) { return True; } if (do_restack_transients) { return !is_transient_subtree_straight( t, t->layer, mode, True, False); } else if (mode == SM_LOWER) { return (t->stack_next != &Scr.FvwmRoot && t->stack_next->layer == t->layer); } else if (mode == SM_RAISE) { return (t->stack_prev != &Scr.FvwmRoot && t->stack_prev->layer == t->layer); } return True; } static Bool __restack_window( FvwmWindow *t, stack_mode_t mode, Bool do_restack_transients, Bool is_new_window, Bool is_client_request) { FvwmWindow *s = NULL; FvwmWindow *r = NULL; FvwmWindow tmp_r; int count; if (!__is_restack_needed( t, mode, do_restack_transients, is_new_window)) { /* need to cancel out the effect of any M_RAISE/M_LOWER that * might already be send out. This is ugly. Better would be to * not send the messages in the first place. */ if (do_restack_transients) { s = t->stack_next; if (s == NULL) { return True; } while (IS_IN_TRANSIENT_SUBTREE(s)) { s = s->stack_next; } BroadcastRestack(t->stack_prev, s); } /* native/unmanaged windows might have raised. However some * buggy clients will keep issuing requests if the raise hacks * are done after processing their requests. */ return is_client_request; } count = 0; if (do_restack_transients) { /* collect the transients in a temp list */ tmp_r.stack_prev = &tmp_r; tmp_r.stack_next = &tmp_r; count = collect_transients_recursive( t, &tmp_r, t->layer, mode, False); if (count == 0) { do_restack_transients = False; } } count += 1 + get_visible_icon_window_count(t); /* now find the place to reinsert t and friends */ if (mode == SM_RESTACK) { s = t->stack_next; } else { s = __get_window_to_insert_after(t, mode); } remove_window_from_stack_ring(t); r = s->stack_prev; if (do_restack_transients) { /* re-sort the transient windows according to their scratch.i * register */ __sort_transient_ring(&tmp_r); /* insert all transients between r and s. */ add_windowlist_to_stack_ring_after(&tmp_r, r); } /* ** Re-insert t - below transients */ add_window_to_stack_ring_after(t, s->stack_prev); if (is_new_window && IS_TRANSIENT(t) && DO_STACK_TRANSIENT_PARENT(t) && !IS_ICONIFIED(t)) { /* now that the new transient is properly positioned in the * stack ring, raise/lower it again so that its parent is * raised/lowered too */ raise_or_lower_window(t, mode, True, False, is_client_request); /* make sure the stacking order is correct - may be the * sledge-hammer method, but the recursion ist too hard to * understand. */ ResyncXStackingOrder(); /* if the transient is on the top of the top layer pan frames * will have ended up under all windows after this. */ return (t->stack_prev != &Scr.FvwmRoot); } else { /* restack the windows between r and s */ __restack_window_list( r, s, count, do_restack_transients, mode == (SM_LOWER) ? True : False); } return False; } static Bool __raise_lower_recursion( FvwmWindow *t, stack_mode_t mode, Bool is_client_request) { FvwmWindow *t2; for ( t2 = Scr.FvwmRoot.stack_next; t2 != &Scr.FvwmRoot; t2 = t2->stack_next) { if (FW_W(t2) == FW_W_TRANSIENTFOR(t)) { if (t2 == t) { return False; } if (IS_ICONIFIED(t2) || t->layer != t2->layer) { break; } if (mode == SM_LOWER && (!IS_TRANSIENT(t2) || !DO_STACK_TRANSIENT_PARENT(t2))) { /* hit the highest level transient; lower this * subtree below all other subtrees of the * same window */ t->scratch.i = -LOWER_PENALTY; } else { /* Add a bonus to the stack ring position for * this branch of the transient tree over all * other branches. */ t->scratch.i = MAX_TRANSIENTS_IN_BRANCH; } __raise_or_lower_window( t2, mode, True, False, is_client_request); if (__is_restack_transients_needed(t2, mode)) { /* moving the parent moves our window already */ return True; } } } return False; } static void __raise_or_lower_window( FvwmWindow *t, stack_mode_t mode, Bool allow_recursion, Bool is_new_window, Bool is_client_request) { FvwmWindow *t2; Bool do_move_transients; /* Do not raise this window after command execution (see * HandleButtonPress()). */ SET_SCHEDULED_FOR_RAISE(t, 0); /* New windows are simply raised/lowered without touching the * transientfor at first. Then, further down in the code, * __raise_or_lower_window() is called again to raise/lower the * transientfor if necessary. We can not do the recursion stuff for * new windows because the __must_move_transients() call needs a * properly ordered stack ring - but the new window is still at the * front of the stack ring. */ if (allow_recursion && !is_new_window && !IS_ICONIFIED(t)) { /* This part makes Raise/Lower on a Transient act on its Main * and sibling Transients. * * The recursion is limited to one level - which caters for * most cases. This code does not handle the case where there * are trees of Main + Transient (i.e. where a * Main_window_with_Transients is itself Transient for another * window). */ if (IS_TRANSIENT(t) && DO_STACK_TRANSIENT_PARENT(t)) { if (__raise_lower_recursion( t, mode, is_client_request) == True) { return; } } } if (is_new_window) { do_move_transients = False; } else { do_move_transients = __must_move_transients(t, mode); } if (__restack_window( t, mode, do_move_transients, is_new_window, is_client_request) == True) { return; } if (mode == SM_RAISE) { /* This hack raises the target and all higher fvwm windows over * any style grabfocusoff override_redirect windows that may be * above it. This is used to cope with ill-behaved applications * that insist on using long-lived override_redirects. */ if (Scr.bo.do_raise_over_unmanaged) { raise_over_unmanaged(t); } /* * The following is a hack to raise X windows over native * windows which is needed for some (all ?) X servers running * under Windows or Windows NT. */ if (Scr.bo.is_raise_hack_needed) { /* RBW - 09/20/1999. I find that trying to raise * unmanaged windows causes problems with some apps. If * this seems to work well for everyone, I'll remove * the #if 0. */ #if 0 /* get *all* toplevels (even including * override_redirects) */ XQueryTree(dpy, Scr.Root, &junk, &junk, &tops, &num); /* raise from fw upwards to get them above NT windows */ for (i = 0; i < num; i++) { if (tops[i] == FW_W_FRAME(t)) { found = True; } if (found) { XRaiseWindow (dpy, tops[i]); } } XFree (tops); #endif for (t2 = t; t2 != &Scr.FvwmRoot; t2 = t2->stack_prev) { XRaiseWindow(dpy, FW_W_FRAME(t2)); } } /* This needs to be done after all the raise hacks. */ raisePanFrames(); /* If the window has been raised, make sure the decorations are * updated immediately in case we are in a complex function * (e.g. raise, unshade). */ XFlush(dpy); handle_all_expose(); } return; } static void raise_or_lower_window( FvwmWindow *t, stack_mode_t mode, Bool allow_recursion, Bool is_new_window, Bool is_client_request) { FvwmWindow *fw; /* clean the auxiliary registers used in stacking transients */ for (fw = Scr.FvwmRoot.next; fw != NULL; fw = fw->next) { fw->scratch.i = 0; } __raise_or_lower_window( t, mode, allow_recursion, is_new_window, is_client_request); return; } static Bool intersect( int x0, int y0, int w0, int h0, int x1, int y1, int w1, int h1) { return !((x0 >= x1 + w1) || (x0 + w0 <= x1) || (y0 >= y1 + h1) || (y0 + h0 <= y1)); } static Bool overlap(FvwmWindow *r, FvwmWindow *s) { rectangle g1; rectangle g2; Bool rc; if (r->Desk != s->Desk) { return False; } rc = get_visible_window_or_icon_geometry(r, &g1); if (rc == False) { return False; } rc = get_visible_window_or_icon_geometry(s, &g2); if (rc == False) { return False; } rc = intersect( g1.x, g1.y, g1.width, g1.height, g2.x, g2.y, g2.width, g2.height); return rc; } #if 0 /* ResyncFvwmStackRing - Rebuilds the stacking order ring of fvwm-managed windows. For use in cases where apps raise/lower their own windows in a way that makes it difficult to determine exactly where they ended up in the stacking order. - Based on code from Matthias Clasen. */ static void ResyncFvwmStackRing (void) { Window root, parent, *children; unsigned int nchildren; int i; FvwmWindow *t1, *t2; MyXGrabServer (dpy); if (!XQueryTree (dpy, Scr.Root, &root, &parent, &children, &nchildren)) { MyXUngrabServer (dpy); return; } t2 = &Scr.FvwmRoot; for (i = 0; i < nchildren; i++) { for (t1 = Scr.FvwmRoot.next; t1 != NULL; t1 = t1->next) { if (IS_ICONIFIED(t1) && !IS_ICON_SUPPRESSED(t1)) { if (FW_W_ICON_TITLE(t1) == children[i] || FW_W_ICON_PIXMAP(t1) == children[i]) { break; } } else { if (FW_W_FRAME(t1) == children[i]) { break; } } } if (t1 != NULL && t1 != t2) { /* Move the window to its new position, working from * the bottom up (that's the way XQueryTree presents * the list). */ /* Pluck from chain. */ remove_window_from_stack_ring(t1); add_window_to_stack_ring_after(t1, t2->stack_prev); if (t2 != &Scr.FvwmRoot && t2->layer > t1->layer) { /* oops, now our stack ring is out of order! */ /* emergency fix */ t1->layer = t2->layer; } t2 = t1; } } MyXUngrabServer (dpy); XFree (children); } #endif /* same as above but synchronizes the stacking order in X from the stack ring. */ static void ResyncXStackingOrder(void) { Window *wins; FvwmWindow *t; int count; int i; for (count = 0, t = Scr.FvwmRoot.next; t != NULL; count++, t = t->next) { /* nothing to do here */ } if (count > 0) { wins = (Window *)safemalloc(3 * count * sizeof (Window)); for ( i = 0, t = Scr.FvwmRoot.stack_next; count--; t = t->stack_next) { wins[i++] = FW_W_FRAME(t); if (IS_ICONIFIED(t) && !IS_ICON_SUPPRESSED(t)) { if (FW_W_ICON_TITLE(t) != None) { wins[i++] = FW_W_ICON_TITLE(t); } if (FW_W_ICON_PIXMAP(t) != None) { wins[i++] = FW_W_ICON_PIXMAP(t); } } } XRestackWindows(dpy, wins, i); free(wins); /* send out M_RESTACK for all windows, to make sure we don't * forget anything. */ BroadcastRestackAllWindows(); } return; } /* send RESTACK packets for all windows between s1 and s2 */ static void BroadcastRestack(FvwmWindow *s1, FvwmWindow *s2) { FvwmWindow *fw; int num; int i; int n; fmodule_list_itr moditr; fmodule *module; unsigned long *body, *bp, length; unsigned long max_wins_per_packet; if (s2 == &Scr.FvwmRoot) { s2 = s2->stack_prev; if (s2 == &Scr.FvwmRoot) { return; } } if (s1 == &Scr.FvwmRoot) { s1 = s1->stack_next; if (s1 == &Scr.FvwmRoot) { return; } /* s1 has been moved to the top of stack */ BroadcastPacket( M_RAISE_WINDOW, 3, (long)FW_W(s1), (long)FW_W_FRAME(s1), (unsigned long)s1); if (s1->stack_next == s2) { /* avoid sending empty RESTACK packet */ return; } } if (s1 == s2) { /* A useful M_RESTACK packet must contain at least two windows. */ return; } for ( fw = s1, num = 1; fw != s2 && fw != &Scr.FvwmRoot; fw = fw->stack_next, num++) { /* nothing */ } max_wins_per_packet = (FvwmPacketMaxSize - FvwmPacketHeaderSize) / 3; /* split packet if it is too long */ for ( ; num > 1; s1 = fw, num -= n) { n = min(num, max_wins_per_packet) - 1; length = FvwmPacketHeaderSize + 3 * (n + 1); body = (unsigned long *)safemalloc( length * sizeof(unsigned long)); bp = body; *(bp++) = START_FLAG; *(bp++) = M_RESTACK; *(bp++) = length; *(bp++) = fev_get_evtime(); for (fw = s1, i = 0; i <= n; i++, fw = fw->stack_next) { *(bp++) = FW_W(fw); *(bp++) = FW_W_FRAME(fw); *(bp++) = (unsigned long)fw; } /* The last window has to be in the header of the next part */ fw = fw->stack_prev; module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { PositiveWrite( module,body,length*sizeof(unsigned long)); } free(body); } #ifdef DEBUG_STACK_RING verify_stack_ring_consistency(); #endif return; } static int collect_transients_recursive( FvwmWindow *t, FvwmWindow *list_head, int layer, stack_mode_t mode, Bool do_include_target_window) { FvwmWindow *s; int count = 0; int m; switch (mode) { case SM_LOWER: m = MARK_LOWER; break; case SM_RAISE: m = MARK_RAISE; break; case SM_RESTACK: m = MARK_RESTACK; break; default: /* can not happen */ m = MARK_RAISE; break; } mark_transient_subtree(t, layer, m, True, False); /* now collect the marked windows in a separate list */ for (s = Scr.FvwmRoot.stack_next; s != &Scr.FvwmRoot; ) { FvwmWindow *tmp; if (s == t && do_include_target_window == False) { /* ignore the target window */ s = s->stack_next; continue; } tmp = s->stack_next; if (IS_IN_TRANSIENT_SUBTREE(s)) { remove_window_from_stack_ring(s); add_window_to_stack_ring_after( s, list_head->stack_prev); count++; count += get_visible_icon_window_count(t); } s = tmp; } return count; } static Bool is_above_unmanaged(FvwmWindow *fw, Window *umtop) { /* Chase through the entire stack of the server's windows looking for any unmanaged window that's higher than the target. Called from raise_over_unmanaged and is_on_top_of_layer. */ Bool ontop = True; Window junk; Window *tops; int i; unsigned int num; Window OR_Above = None; XWindowAttributes wa; if (fw->Desk != Scr.CurrentDesk) { return True; } if (!XQueryTree(dpy, Scr.Root, &junk, &junk, &tops, &num)) { return ontop; } /* * Locate the highest override_redirect window above our target, and * the highest of our windows below it. */ for (i = 0; i < num && tops[i] != FW_W_FRAME(fw); i++) { /* look for target window in list */ } for (; i < num; i++) { /* It might be just as well (and quicker) just to check for the * absence of an FvwmContext instead of for * override_redirect... */ if (!XGetWindowAttributes(dpy, tops[i], &wa)) { continue; } /* Don't forget to ignore the hidden frame resizing windows... */ if (wa.override_redirect == True && wa.class != InputOnly && tops[i] != Scr.NoFocusWin && (!is_frame_hide_window(tops[i]))) { OR_Above = tops[i]; } } /* end for */ if (OR_Above) { *umtop = OR_Above; ontop = False; } XFree (tops); return ontop; } static Bool is_on_top_of_layer_ignore_rom(FvwmWindow *fw) { FvwmWindow *t; Bool ontop = True; if (IS_SCHEDULED_FOR_DESTROY(fw)) { /* stack ring members are no longer valid */ return False; } if (DO_RAISE_TRANSIENT(fw)) { mark_transient_subtree(fw, fw->layer, MARK_RAISE, True, False); } for (t = fw->stack_prev; t != &Scr.FvwmRoot; t = t->stack_prev) { if (t->layer > fw->layer) { break; } if (t->Desk != fw->Desk) { continue; } /* For RaiseOverUnmanaged we can not determine if the window is * on top by checking if the window overlaps another one. If * it was below unmanaged windows, but on top of its layer, it * would be considered on top. */ if (Scr.bo.do_raise_over_unmanaged || overlap(fw, t)) { if (!DO_RAISE_TRANSIENT(fw) || (!IS_IN_TRANSIENT_SUBTREE(t) && t != fw)) { ontop = False; break; } } } return ontop; } static Bool __is_on_top_of_layer(FvwmWindow *fw, Bool client_entered) { Window junk; Bool ontop = False; if (Scr.bo.do_raise_over_unmanaged) { #define EXPERIMENTAL_ROU_HANDLING #ifdef EXPERIMENTAL_ROU_HANDLING /* RBW - 2002/08/15 - RaiseOverUnmanaged adds some overhead. The only way to let our caller know for sure whether we need to grab the mouse buttons because we may need to raise this window is to query the server's tree and look for any override_redirect windows above this one. But this function is called far too often to do this every time. Only if the window is at the top of the FvwmWindow stack do we need more information from the server; and then only at the last moment in HandleEnterNotify when we really need to know whether a raise will be needed if the user clicks in the client window. is_on_top_of_layer_and_above_unmanaged is called in that case. */ if (is_on_top_of_layer_ignore_rom(fw)) { if (client_entered) /* FIXME! - perhaps we should only do if MFCR */ { #ifdef ROUDEBUG printf("RBW-iotol - %8.8lx is on top," " checking server tree. ***\n", FW_W_CLIENT(fw)); #endif ontop = is_above_unmanaged(fw, &junk); #ifdef ROUDEBUG printf(" returning %d\n", (int) ontop); #endif } else { #ifdef ROUDEBUG printf("RBW-iotol - %8.8lx is on top," " *** NOT checking server tree.\n", FW_W_CLIENT(fw)); #endif ontop = True; } return ontop; } else { return False; } #else return False; /* Old pre-2002/08/22 handling. */ #endif } else { return is_on_top_of_layer_ignore_rom(fw); } } /* ---------------------------- interface functions ------------------------ */ /* Remove a window from the stack ring */ void remove_window_from_stack_ring(FvwmWindow *t) { if (IS_SCHEDULED_FOR_DESTROY(t)) { return; } t->stack_prev->stack_next = t->stack_next; t->stack_next->stack_prev = t->stack_prev; /* not really necessary, but gives a little more saftey */ t->stack_prev = NULL; t->stack_next = NULL; return; } /* Add window t to the stack ring after window t */ void add_window_to_stack_ring_after(FvwmWindow *t, FvwmWindow *add_after_win) { if (IS_SCHEDULED_FOR_DESTROY(t)) { return; } if (t == add_after_win || t == add_after_win->stack_next) { /* tried to add the window before or after itself */ fvwm_msg( ERR, "add_window_to_stack_ring_after", "BUG: tried to add window '%s' %s itself in stack" " ring\n", t->name.name, (t == add_after_win) ? "after" : "before"); return; } t->stack_next = add_after_win->stack_next; add_after_win->stack_next->stack_prev = t; t->stack_prev = add_after_win; add_after_win->stack_next = t; return; } FvwmWindow *get_next_window_in_stack_ring(const FvwmWindow *t) { return t->stack_next; } FvwmWindow *get_prev_window_in_stack_ring(const FvwmWindow *t) { return t->stack_prev; } FvwmWindow *get_transientfor_fvwmwindow(const FvwmWindow *t) { FvwmWindow *s; if (!t || !IS_TRANSIENT(t) || FW_W_TRANSIENTFOR(t) == Scr.Root || FW_W_TRANSIENTFOR(t) == None) { return NULL; } for (s = Scr.FvwmRoot.next; s != NULL; s = s->next) { if (FW_W(s) == FW_W_TRANSIENTFOR(t)) { return (s == t) ? NULL : s; } } return NULL; } /* Takes a window from the top of the stack ring and puts it at the appropriate * place. Called when new windows are created. */ Bool position_new_window_in_stack_ring(FvwmWindow *t, Bool do_lower) { if (t->stack_prev != &Scr.FvwmRoot) { /* Not at top of stack ring, so it is already in place. * add_window.c relies on this. */ return False; } /* RaiseWindow/LowerWindow will put the window in its layer */ raise_or_lower_window( t, (do_lower) ? SM_LOWER : SM_RAISE, False, True, False); return True; } /* Raise t and its transients to the top of its layer. For the pager to work * properly it is necessary that RaiseWindow *always* sends a proper M_RESTACK * packet, even if the stacking order didn't change. */ void RaiseWindow(FvwmWindow *t, Bool is_client_request) { BroadcastPacket( M_RAISE_WINDOW, 3, (long)FW_W(t), (long)FW_W_FRAME(t), (unsigned long)t); raise_or_lower_window(t, SM_RAISE, True, False, is_client_request); focus_grab_buttons_on_layer(t->layer); #ifdef DEBUG_STACK_RING verify_stack_ring_consistency(); #endif return; } void LowerWindow(FvwmWindow *t, Bool is_client_request) { BroadcastPacket( M_LOWER_WINDOW, 3, (long)FW_W(t), (long)FW_W_FRAME(t), (unsigned long)t); raise_or_lower_window(t, SM_LOWER, True, False, is_client_request); focus_grab_buttons_on_layer(t->layer); #ifdef DEBUG_STACK_RING verify_stack_ring_consistency(); #endif return; } void RestackWindow(FvwmWindow *t, Bool is_client_request) { raise_or_lower_window(t, SM_RESTACK, True, False, is_client_request); focus_grab_buttons_on_layer(t->layer); #ifdef DEBUG_STACK_RING verify_stack_ring_consistency(); #endif return; } /* return true if stacking order changed */ Bool HandleUnusualStackmodes( unsigned int stack_mode, FvwmWindow *r, Window rw, FvwmWindow *s, Window sw) { int do_restack = 0; FvwmWindow *t; /* DBUG("HandleUnusualStackmodes", "called with %d, %lx\n", stack_mode, s);*/ if ( ((rw != FW_W(r)) ^ IS_ICONIFIED(r)) || (s && (((sw != FW_W(s)) ^ IS_ICONIFIED(s)) || (r->Desk != s->Desk)))) { /* one of the relevant windows is unmapped */ return 0; } switch (stack_mode) { case TopIf: for ( t = r->stack_prev; t != &Scr.FvwmRoot && !do_restack; t = t->stack_prev) { do_restack = ((s == NULL || s == t) && overlap(t, r)); } if (do_restack) { RaiseWindow (r, True); } break; case BottomIf: for ( t = r->stack_next; t != &Scr.FvwmRoot && !do_restack; t = t->stack_next) { do_restack = ((s == NULL || s == t) && overlap(t, r)); } if (do_restack) { LowerWindow (r, True); } break; case Opposite: do_restack = ( HandleUnusualStackmodes(TopIf, r, rw, s, sw) || HandleUnusualStackmodes(BottomIf, r, rw, s, sw)); break; } /* DBUG("HandleUnusualStackmodes", "\t---> %d\n", do_restack);*/ #ifdef DEBUG_STACK_RING verify_stack_ring_consistency(); #endif return do_restack; } /* RBW - 01/07/1998 - this is here temporarily - I mean to move it to libfvwm eventually, along with some other chain manipulation functions. */ void BroadcastRestackAllWindows(void) { BroadcastRestack(Scr.FvwmRoot.stack_next, Scr.FvwmRoot.stack_prev); return; } /* send RESTACK packets for t, t->stack_prev and t->stack_next */ void BroadcastRestackThisWindow(FvwmWindow *t) { BroadcastRestack(t->stack_prev, t->stack_next); return; } /* returns 0 if s and t are on the same layer, <1 if t is on a lower layer and * >1 if t is on a higher layer. */ int compare_window_layers(FvwmWindow *t, FvwmWindow *s) { return t->layer - s->layer; } void set_default_layer(FvwmWindow *t, int layer) { t->default_layer = layer; return; } void set_layer(FvwmWindow *t, int layer) { t->layer = layer; return; } int get_layer(FvwmWindow *t) { return t->layer; } /* This function recursively finds the transients of the window t and sets their * is_in_transient_subtree flag. If a layer is given, only windows in this * layer are checked. If the layer is < 0, all windows are considered. */ void mark_transient_subtree( FvwmWindow *t, int layer, int mark_mode, Bool do_ignore_icons, Bool use_window_group_hint) { FvwmWindow *s; FvwmWindow *start; FvwmWindow *end; Bool is_finished; if (layer >= 0 && t->layer != layer) { return; } /* find out on which windows to operate */ if (layer >= 0) { /* only work on the given layer */ start = &Scr.FvwmRoot; end = &Scr.FvwmRoot; for ( s = Scr.FvwmRoot.stack_next; s != &Scr.FvwmRoot && s->layer >= layer; s = s->stack_next) { if (s == t) { /* ignore the target window */ continue; } if (s->layer == layer) { if (start == &Scr.FvwmRoot) { start = s; } end = s->stack_next; } } } else { /* work on complete window list */ start = Scr.FvwmRoot.stack_next; end = &Scr.FvwmRoot; } /* clean the temporary flag in all windows and precalculate the * transient frame windows */ if (Scr.FvwmRoot.scratch.i == 0) { for ( s = Scr.FvwmRoot.stack_next; s != &Scr.FvwmRoot; s = s->stack_next) { SET_IN_TRANSIENT_SUBTREE(s, 0); if ( IS_TRANSIENT(s) && (layer < 0 || layer == s->layer)) { s->scratch.p = get_transientfor_fvwmwindow(s); } else { s->scratch.p = NULL; } } } Scr.FvwmRoot.scratch.i = 0; /* now loop over the windows and mark the ones we need to move */ SET_IN_TRANSIENT_SUBTREE(t, 1); is_finished = False; while (!is_finished) { /* recursively search for all transient windows */ is_finished = True; for (s = start; s != end; s = s->stack_next) { if ( __mark_transient_subtree_test( s, start, end, mark_mode, do_ignore_icons, use_window_group_hint)) { is_finished = False; } } /* for */ } /* while */ return; } void new_layer(FvwmWindow *fw, int layer) { FvwmWindow *s; FvwmWindow *target; FvwmWindow *prev; FvwmWindow list_head; int add_after_layer; int count; int old_layer; Bool do_lower; if (layer < 0) { layer = 0; } fw = get_transientfor_top_fvwmwindow(fw); if (layer == fw->layer) { return; } old_layer = fw->layer; list_head.stack_next = &list_head; list_head.stack_prev = &list_head; count = collect_transients_recursive( fw, &list_head, fw->layer, (layer < fw->layer) ? SM_LOWER : SM_RAISE, True); if (count == 0) { /* no windows to move */ return; } add_after_layer = layer; if (layer < fw->layer) { /* lower below the windows in the new (lower) layer */ add_after_layer = layer; do_lower = True; } else { /* raise above the windows in the new (higher) layer */ add_after_layer = layer + 1; do_lower = False; } /* find the place to insert the windows */ for ( target = Scr.FvwmRoot.stack_next; target != &Scr.FvwmRoot; target = target->stack_next) { if (target->layer < add_after_layer) { /* add all windows before the current window */ break; } } /* insert windows at new position */ add_windowlist_to_stack_ring_after(&list_head, target->stack_prev); prev = NULL; for ( s = list_head.stack_next; prev != list_head.stack_prev; prev = s, s = s->stack_next) { s->layer = layer; /* redraw title and buttons to update layer buttons */ border_draw_decorations( s, PART_TITLEBAR, (Scr.Hilite == fw), True, CLEAR_NONE, NULL, NULL); GNOME_SetLayer(fw); EWMH_SetWMState(fw, False); } /* move the windows without modifying their stacking order */ __restack_window_list( list_head.stack_next->stack_prev, target, count, (count > 1), do_lower); focus_grab_buttons_on_layer(layer); focus_grab_buttons_on_layer(old_layer); return; } /* RBW - 11/13/1998 - 2 new fields to init - stacking order chain. */ void init_stack_and_layers(void) { Scr.BottomLayer = DEFAULT_BOTTOM_LAYER; Scr.DefaultLayer = DEFAULT_DEFAULT_LAYER; Scr.TopLayer = DEFAULT_TOP_LAYER; Scr.FvwmRoot.stack_next = &Scr.FvwmRoot; Scr.FvwmRoot.stack_prev = &Scr.FvwmRoot; set_layer(&Scr.FvwmRoot, DEFAULT_ROOT_WINDOW_LAYER); return; } Bool is_on_top_of_layer(FvwmWindow *fw) { return __is_on_top_of_layer(fw, False); } Bool is_on_top_of_layer_and_above_unmanaged(FvwmWindow *fw) { return __is_on_top_of_layer(fw, True); } /* ----------------------------- built in functions ----------------------- */ void CMD_Raise(F_CMD_ARGS) { RaiseWindow(exc->w.fw, False); return; } void CMD_Lower(F_CMD_ARGS) { LowerWindow(exc->w.fw, False); return; } void CMD_RestackTransients(F_CMD_ARGS) { RestackWindow(exc->w.fw, False); return; } void CMD_RaiseLower(F_CMD_ARGS) { Bool ontop; FvwmWindow * const fw = exc->w.fw; ontop = is_on_top_of_layer_ignore_rom(fw); if (ontop) { LowerWindow(fw, False); } else { RaiseWindow(fw, False); } return; } void CMD_Layer(F_CMD_ARGS) { int n, layer, val[2]; char *token; FvwmWindow * const fw = exc->w.fw; if (fw == NULL) { return; } token = PeekToken(action, NULL); if (StrEquals("default", token)) { layer = fw->default_layer; } else { n = GetIntegerArguments(action, NULL, val, 2); layer = fw->layer; if ((n == 1) || ((n == 2) && (val[0] != 0))) { layer += val[0]; } else if ((n == 2) && (val[1] >= 0)) { layer = val[1]; } else { layer = fw->default_layer; } } if (layer < 0) { layer = 0; } new_layer(fw, layer); #ifdef DEBUG_STACK_RING verify_stack_ring_consistency(); #endif return; } void CMD_DefaultLayers(F_CMD_ARGS) { char *bot = NULL; char *def = NULL; char *top = NULL; int i; bot = PeekToken(action, &action); if (bot) { i = atoi (bot); if (i < 0) { fvwm_msg( ERR, "DefaultLayers", "Layer must be non-negative." ); } else { Scr.BottomLayer = i; } } def = PeekToken(action, &action); if (def) { i = atoi (def); if (i < 0) { fvwm_msg( ERR, "DefaultLayers", "Layer must be non-negative." ); } else { Scr.DefaultLayer = i; } } top = PeekToken(action, &action); if (top) { i = atoi (top); if (i < 0) { fvwm_msg( ERR, "DefaultLayers", "Layer must be non-negative." ); } else { Scr.TopLayer = i; } } #ifdef DEBUG_STACK_RING verify_stack_ring_consistency(); #endif return; } fvwm-2.6.5.orig/fvwm/execcontext.c0000644000175000017500000001011010556634173015301 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #define FEVENT_PRIVILEGED_ACCESS #include "config.h" #undef FEVENT_PRIVILEGED_ACCESS #include #include "fvwm.h" #include "externs.h" #include "execcontext.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ #undef DEBUG_EXECCONTEXT #ifdef DEBUG_EXECCONTEXT static exec_context_t *x[256]; static int nx = 0; #endif /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static void __exc_change_context( exec_context_t *exc, exec_context_changes_t *ecc, exec_context_change_mask_t mask) { if (mask & ECC_TYPE) { exc->type = ecc->type; } if (mask & ECC_ETRIGGER) { if (ecc->x.etrigger == NULL) { fev_copy_last_event(&exc->private_data.te); } else { exc->private_data.te = *ecc->x.etrigger; } exc->x.etrigger = &(exc->private_data.te); } if (mask & ECC_FW) { exc->w.fw = ecc->w.fw; } if (mask & ECC_W) { exc->w.w = ecc->w.w; } if (mask & ECC_WCONTEXT) { exc->w.wcontext = ecc->w.wcontext; } if (mask & ECC_MODULE) { exc->m.module = ecc->m.module; } return; } /* ---------------------------- interface functions ------------------------ */ const exec_context_t *exc_create_null_context(void) { exec_context_t *exc; #ifdef DEBUG_EXECCONTEXT int i; #endif exc = (exec_context_t *)safecalloc(1, sizeof(exec_context_t)); #ifdef DEBUG_EXECCONTEXT fprintf(stderr, "xxx+0 "); for(i=0;itype = EXCT_NULL; fev_make_null_event(&exc->private_data.te, dpy); exc->x.etrigger = &exc->private_data.te; exc->x.elast = fev_get_last_event_address(); exc->m.module = NULL; return exc; } const exec_context_t *exc_create_context( exec_context_changes_t *ecc, exec_context_change_mask_t mask) { exec_context_t *exc; #ifdef DEBUG_EXECCONTEXT if (!(mask & ECC_TYPE)) abort(); #endif exc = (exec_context_t *)exc_create_null_context(); __exc_change_context(exc, ecc, mask); return exc; } const exec_context_t *exc_clone_context( const exec_context_t *excin, exec_context_changes_t *ecc, exec_context_change_mask_t mask) { exec_context_t *exc; #ifdef DEBUG_EXECCONTEXT int i; #endif exc = (exec_context_t *)safemalloc(sizeof(exec_context_t)); #ifdef DEBUG_EXECCONTEXT fprintf(stderr, "xxx+= "); for(i=0;i #include "libs/fvwmlib.h" #include "libs/FShape.h" #include "libs/FScreen.h" #include "libs/Picture.h" #include "libs/PictureUtils.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "libs/Grab.h" #include "libs/Strings.h" #include "libs/XResource.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "execcontext.h" #include "commands.h" #include "bindings.h" #include "misc.h" #include "screen.h" #include "add_window.h" #include "events.h" #include "eventhandler.h" #include "eventmask.h" #include "module_interface.h" #include "stack.h" #include "update.h" #include "style.h" #include "icons.h" #include "gnome.h" #include "ewmh.h" #include "focus.h" #include "placement.h" #include "geometry.h" #include "session.h" #include "move_resize.h" #include "borders.h" #include "frame.h" #include "colormaps.h" #include "decorations.h" #include "functions.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ char NoName[] = "Untitled"; /* name if no name in XA_WM_NAME */ char NoClass[] = "NoClass"; /* Class if no res_class in class hints */ char NoResource[] = "NoResource"; /* Class if no res_name in class hints */ /* ---------------------------- local functions ---------------------------- */ static void delete_client_context(FvwmWindow *fw) { FvwmWindow *cw; /* We can not simply delete the context. X might have reused the * window structure so we would delete the context that was established * by another FvwmWindow structure in the mean time. */ if (XFindContext( dpy, FW_W(fw), FvwmContext, (caddr_t *)&cw) != XCNOENT && cw == fw) { XDeleteContext(dpy, FW_W(fw), FvwmContext); } return; } /* * * Procedure: * CaptureOneWindow * CaptureAllWindows * * Decorates windows at start-up and during recaptures * */ static void CaptureOneWindow( const exec_context_t *exc, FvwmWindow *fw, Window window, Window keep_on_top_win, Window parent_win, Bool is_recapture) { Window w; unsigned long data[1]; initial_window_options_t win_opts; evh_args_t ea; exec_context_changes_t ecc; XEvent e; if (fw == NULL) { return; } if (IS_SCHEDULED_FOR_DESTROY(fw)) { /* Fvwm might crash in complex functions if we really try to * the dying window here because AddWindow() may fail and leave * a destroyed window in some structures. By the way, it is * pretty useless to recapture a window that will vanish in a * moment. */ return; } /* Grab the server to make sure the window does not die during the * recapture. */ MyXGrabServer(dpy); if ( !XGetGeometry( dpy, FW_W(fw), &JunkRoot, &JunkX, &JunkY, (unsigned int*)&JunkWidth, (unsigned int*)&JunkHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth)) { /* The window has already died, do not recapture it! */ MyXUngrabServer(dpy); return; } if (XFindContext(dpy, window, FvwmContext, (caddr_t *)&fw) != XCNOENT) { Bool is_mapped = IS_MAPPED(fw); memset(&win_opts, 0, sizeof(win_opts)); win_opts.initial_state = DontCareState; win_opts.flags.do_override_ppos = 1; win_opts.flags.is_recapture = 1; if (IS_ICONIFIED(fw)) { win_opts.initial_state = IconicState; win_opts.flags.is_iconified_by_parent = IS_ICONIFIED_BY_PARENT(fw); } else { win_opts.initial_state = NormalState; win_opts.flags.is_iconified_by_parent = 0; if (Scr.CurrentDesk != fw->Desk) { SetMapStateProp(fw, NormalState); } } data[0] = (unsigned long) fw->Desk; XChangeProperty( dpy, FW_W(fw), _XA_WM_DESKTOP, _XA_WM_DESKTOP, 32, PropModeReplace, (unsigned char *) data, 1); /* are all these really needed ? */ /* EWMH_SetWMDesktop(fw); */ GNOME_SetHints(fw); GNOME_SetDesk(fw); GNOME_SetLayer(fw); GNOME_SetWinArea(fw); XSelectInput(dpy, FW_W(fw), NoEventMask); w = FW_W(fw); XUnmapWindow(dpy, FW_W_FRAME(fw)); border_undraw_decorations(fw); RestoreWithdrawnLocation(fw, is_recapture, parent_win); SET_DO_REUSE_DESTROYED(fw, 1); /* RBW - 1999/03/20 */ destroy_window(fw); win_opts.flags.is_menu = (is_recapture && fw != NULL && IS_TEAR_OFF_MENU(fw)); fev_make_null_event(&e, dpy); e.xmaprequest.window = w; e.xmaprequest.parent = Scr.Root; ecc.x.etrigger = &e; ecc.w.fw = NULL; ecc.w.w = w; ecc.w.wcontext = C_ROOT; ea.exc = exc_clone_context( exc, &ecc, ECC_ETRIGGER | ECC_FW | ECC_W | ECC_WCONTEXT); HandleMapRequestKeepRaised(&ea, keep_on_top_win, fw, &win_opts); exc_destroy_context(ea.exc); /* HandleMapRequestKeepRaised may have destroyed the fw if the * window vanished while in AddWindow(), so don't access fw * anymore before checking if it is a valid window. */ if (check_if_fvwm_window_exists(fw)) { if (!fFvwmInStartup) { SET_MAP_PENDING(fw, 0); SET_MAPPED(fw, is_mapped); } } } MyXUngrabServer(dpy); return; } /* Put a transparent window all over the screen to hide what happens below. */ static void hide_screen( Bool do_hide, Window *ret_hide_win, Window *ret_parent_win) { static Bool is_hidden = False; static Window hide_win = None; static Window parent_win = None; XSetWindowAttributes xswa; unsigned long valuemask; if (do_hide == is_hidden) { /* nothing to do */ if (ret_hide_win) { *ret_hide_win = hide_win; } if (ret_parent_win) { *ret_parent_win = parent_win; } return; } is_hidden = do_hide; if (do_hide) { xswa.override_redirect = True; xswa.cursor = Scr.FvwmCursors[CRS_WAIT]; xswa.backing_store = NotUseful; xswa.save_under = False; xswa.background_pixmap = None; valuemask = CWOverrideRedirect | CWCursor | CWSaveUnder | CWBackingStore | CWBackPixmap; hide_win = XCreateWindow( dpy, Scr.Root, 0, 0, Scr.MyDisplayWidth, Scr.MyDisplayHeight, 0, Pdepth, InputOutput, Pvisual, valuemask, &xswa); if (hide_win) { /* When recapturing, all windows are reparented to this * window. If they are reparented to the root window, * they will flash over the hide_win with XFree. So * reparent them to an unmapped window that looks like * the root window. */ parent_win = XCreateWindow( dpy, Scr.Root, 0, 0, Scr.MyDisplayWidth, Scr.MyDisplayHeight, 0, CopyFromParent, InputOutput, CopyFromParent, valuemask, &xswa); if (!parent_win) { XDestroyWindow(dpy, hide_win); hide_win = None; } else { XMapWindow(dpy, hide_win); XFlush(dpy); } } } else { if (hide_win != None) { XDestroyWindow(dpy, hide_win); } if (parent_win != None) { XDestroyWindow(dpy, parent_win); } XFlush(dpy); hide_win = None; parent_win = None; } if (ret_hide_win) { *ret_hide_win = hide_win; } if (ret_parent_win) { *ret_parent_win = parent_win; } return; } /* * * Procedure: * MappedNotOverride - checks to see if we should really * put a fvwm frame on the window * * Returned Value: * 1 - go ahead and frame the window * 0 - don't frame the window * * Inputs: * w - the window to check * */ static int MappedNotOverride( Window w, initial_window_options_t *win_opts) { XWindowAttributes wa; Atom atype; int aformat; unsigned long nitems, bytes_remain; unsigned char *prop; win_opts->initial_state = DontCareState; if ((w==Scr.NoFocusWin)||(!XGetWindowAttributes(dpy, w, &wa))) { return 0; } if (XGetWindowProperty( dpy,w,_XA_WM_STATE,0L,3L,False,_XA_WM_STATE, &atype,&aformat,&nitems,&bytes_remain,&prop)==Success) { if (prop != NULL) { win_opts->initial_state = *(long *)prop; XFree(prop); } } if (wa.override_redirect == True) { XSelectInput(dpy, w, XEVMASK_ORW); XFlush(dpy); } return (((win_opts->initial_state == IconicState) || (wa.map_state != IsUnmapped)) && (wa.override_redirect != True)); } static void do_recapture(F_CMD_ARGS, Bool fSingle) { FvwmWindow *fw = exc->w.fw; MyXGrabServer(dpy); if (fSingle) { CaptureOneWindow( exc, fw, FW_W(fw), None, None, True); } else { CaptureAllWindows(exc, True); } /* Throw away queued up events. We don't want user input during a * recapture. The window the user clicks in might disapper at the very * same moment and the click goes through to the root window. Not good */ XAllowEvents(dpy, AsyncPointer, CurrentTime); discard_events( ButtonPressMask|ButtonReleaseMask|ButtonMotionMask| \ PointerMotionMask|KeyPressMask|KeyReleaseMask); #ifdef DEBUG_STACK_RING verify_stack_ring_consistency(); #endif MyXUngrabServer(dpy); return; } static void setup_window_structure( FvwmWindow **pfw, Window w, FvwmWindow *ReuseWin) { FvwmWindow save_state; FvwmWindow *savewin = NULL; /* Allocate space for the FvwmWindow struct, or reuse an old one (on Recapture). */ if (ReuseWin == NULL) { *pfw = (FvwmWindow *)safemalloc(sizeof(FvwmWindow)); } else { *pfw = ReuseWin; savewin = &save_state; memcpy(savewin, ReuseWin, sizeof(FvwmWindow)); } /* RBW - 1999/05/28 - modify this when we implement the preserving of various states across a Recapture. The Destroy function in misc.c may also need tweaking, depending on what you want to preserve. For now, just zap any old information, except the desk. */ memset(*pfw, '\0', sizeof(FvwmWindow)); FW_W(*pfw) = w; if (savewin != NULL) { (*pfw)->Desk = savewin->Desk; SET_SHADED(*pfw, IS_SHADED(savewin)); SET_USED_TITLE_DIR_FOR_SHADING( *pfw, USED_TITLE_DIR_FOR_SHADING(savewin)); SET_SHADED_DIR(*pfw, SHADED_DIR(savewin)); SET_NAME_CHANGED(*pfw,IS_NAME_CHANGED(savewin)); (*pfw)->placed_by_button = savewin->placed_by_button; SET_PLACED_BY_FVWM(*pfw, IS_PLACED_BY_FVWM(savewin)); SET_HAS_EWMH_WM_ICON_HINT(*pfw, HAS_EWMH_WM_ICON_HINT(savewin)); (*pfw)->ewmh_mini_icon_width = savewin->ewmh_mini_icon_width; (*pfw)->ewmh_mini_icon_height = savewin->ewmh_mini_icon_height; (*pfw)->ewmh_icon_width = savewin->ewmh_icon_width; (*pfw)->ewmh_icon_height = savewin->ewmh_icon_height; (*pfw)->ewmh_hint_desktop = savewin->ewmh_hint_desktop; /* restore ewmh state */ EWMH_SetWMState(savewin, True); SET_HAS_EWMH_INIT_WM_DESKTOP( *pfw, HAS_EWMH_INIT_WM_DESKTOP(savewin)); SET_HAS_EWMH_INIT_FULLSCREEN_STATE( *pfw, HAS_EWMH_INIT_FULLSCREEN_STATE(savewin)); SET_HAS_EWMH_INIT_HIDDEN_STATE( *pfw, HAS_EWMH_INIT_HIDDEN_STATE(savewin)); SET_HAS_EWMH_INIT_MAXHORIZ_STATE( *pfw, HAS_EWMH_INIT_MAXHORIZ_STATE(savewin)); SET_HAS_EWMH_INIT_MAXVERT_STATE( *pfw, HAS_EWMH_INIT_MAXVERT_STATE(savewin)); SET_HAS_EWMH_INIT_SHADED_STATE( *pfw, HAS_EWMH_INIT_SHADED_STATE(savewin)); SET_HAS_EWMH_INIT_STICKY_STATE( *pfw, HAS_EWMH_INIT_STICKY_STATE(savewin)); CLEAR_USER_STATES(*pfw, ~0); SET_USER_STATES(*pfw, GET_USER_STATES(savewin)); } else { /* make sure that new windows *remember* being shaded with * title dir last */ SET_USED_TITLE_DIR_FOR_SHADING(*pfw,1); } (*pfw)->cmap_windows = (Window *)NULL; if (FMiniIconsSupported) { (*pfw)->mini_pixmap_file = NULL; (*pfw)->mini_icon = NULL; } return; } static void setup_name_count(FvwmWindow *fw, Bool is_icon) { FvwmWindow *t; int count = 0; int win_count; int win_count_counterpart; Bool done = False; FlocaleNameString *titlename, *title_counterpart; FlocaleNameString *t_titlename, *t_title_counterpart; titlename = (is_icon) ? &(fw->icon_name) : &(fw->name); title_counterpart = (is_icon) ? &(fw->name) : &(fw->icon_name); if (!titlename->name) { done = True; } if (titlename->name && title_counterpart->name && strcmp(titlename->name, title_counterpart->name) == 0) { count = is_icon ? fw->icon_name_count : fw->name_count; } while (!done) { done = True; for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if (t == fw) { continue; } win_count = is_icon ? t->icon_name_count : t->name_count; win_count_counterpart = is_icon ? t->name_count : t->icon_name_count; t_titlename = is_icon ? &(t->icon_name) : &(t->name); t_title_counterpart = is_icon ? &(t->name) : &(t->icon_name); if ((t_titlename->name && strcmp(titlename->name, t_titlename->name) == 0 && win_count == count) || (t_title_counterpart->name && strcmp(t_title_counterpart->name, titlename->name) == 0 && win_count_counterpart == count)) { count++; done = False; } } } if (is_icon) { fw->icon_name_count = count; } else { fw->name_count = count; } return; } static char *interpolate_titleformat_name(FvwmWindow *fw, window_style *style, Bool is_icon) { char stringbuf[MAX_VISIBLE_NAME_LEN] = ""; /* Get the title format string. This check should be redundant thanks * to the checking done in style.c */ const char *format; int count; /* MAX_WINDOW_NAME_NUMBER is defined as "999" -- that's three * characters maximum. */ char win_name_len[MAX_WINDOW_NAME_NUMBER_DIGITS]; char w_id[12]; if (is_icon) { format = (style->flags.has_icon_title_format_string) ? SGET_ICON_TITLE_FORMAT_STRING(*style) : DEFAULT_TITLE_FORMAT; } else { format = (style->flags.has_title_format_string) ? SGET_TITLE_FORMAT_STRING(*style) : DEFAULT_TITLE_FORMAT; } while (*format) { int pos; for (pos = 0; format[pos] && format[pos] != '%'; pos++); strncat(stringbuf, format, pos); format += pos; if (*format != '%') continue; format++; switch (*format) { case 'n': if (strlen(stringbuf) + strlen(fw->name.name) > MAX_VISIBLE_NAME_LEN) { fvwm_msg(WARN, "interpolate_titleformat_name", "Visible name is too long based on " "TitleFormat. Not expanding further."); break; } strcat(stringbuf, fw->name.name); break; case 'c': if (strlen(stringbuf) + strlen(fw->class.res_class) > MAX_VISIBLE_NAME_LEN) { fvwm_msg(WARN, "interpolate_titleformat_name", "Visible name is too long based on " "TitleFormat. Not expanding further."); break; } strcat(stringbuf, fw->class.res_class); break; case 'i': if (strlen(stringbuf) + strlen(fw->icon_name.name) > MAX_VISIBLE_NAME_LEN) { fvwm_msg(WARN, "interpolate_titleformat_name", "Visible name is too long based on " "TitleFormat. Not expanding further."); break; } strcat(stringbuf, fw->icon_name.name); break; case 'r': if (strlen(stringbuf) + strlen(fw->class.res_name) > MAX_VISIBLE_NAME_LEN) { fvwm_msg(WARN, "interpolate_titleformat_name", "Visible name is too long based on " "TitleFormat. Not expanding further."); break; } strcat(stringbuf, fw->class.res_name); break; case 't': setup_name_count(fw, is_icon); count = is_icon ? fw->icon_name_count : fw->name_count; if (count > (MAX_WINDOW_NAME_NUMBER - 1)) count = MAX_WINDOW_NAME_NUMBER - 1; sprintf(win_name_len, "%d", ++count); strcat(stringbuf, win_name_len); break; case 'I': sprintf(w_id, "0x%x", (int)FW_W(fw)); strcat(stringbuf, w_id); break; case '%': strcat(stringbuf, "%"); break; default: break; } if (*format) format++; } /* Now allocate our string. */ return strdup(stringbuf); } static void setup_class_and_resource(FvwmWindow *fw) { /* removing NoClass change for now... */ fw->class.res_name = NoResource; fw->class.res_class = NoClass; XGetClassHint(dpy, FW_W(fw), &fw->class); if (fw->class.res_name == NULL) { fw->class.res_name = NoResource; } if (fw->class.res_class == NULL) { fw->class.res_class = NoClass; } FetchWmProtocols (fw); FetchWmColormapWindows (fw); return; } static void setup_window_attr( FvwmWindow *fw, XWindowAttributes *ret_attr) { if (XGetWindowAttributes(dpy, FW_W(fw), ret_attr) == 0) { /* can't happen because fvwm has grabbed the server and does * not destroy the window itself */ } fw->attr_backup.backing_store = ret_attr->backing_store; fw->attr_backup.border_width = ret_attr->border_width; fw->attr_backup.depth = ret_attr->depth; fw->attr_backup.bit_gravity = ret_attr->bit_gravity; fw->attr_backup.is_bit_gravity_stored = 0; fw->attr_backup.visual = ret_attr->visual; fw->attr_backup.colormap = ret_attr->colormap; return; } static void destroy_window_font(FvwmWindow *fw) { if (IS_WINDOW_FONT_LOADED(fw) && !USING_DEFAULT_WINDOW_FONT(fw) && fw->title_font != Scr.DefaultFont) { FlocaleUnloadFont(dpy, fw->title_font); } SET_WINDOW_FONT_LOADED(fw, 0); /* Fall back to default font. There are some race conditions when a * window is destroyed and recaptured where an invalid font might be * accessed otherwise. */ fw->title_font = Scr.DefaultFont; SET_USING_DEFAULT_WINDOW_FONT(fw, 1); return; } static void destroy_icon_font(FvwmWindow *fw) { if (IS_ICON_FONT_LOADED(fw) && !USING_DEFAULT_ICON_FONT(fw) && fw->icon_font != Scr.DefaultFont) { FlocaleUnloadFont(dpy, fw->icon_font); } SET_ICON_FONT_LOADED(fw, 0); /* Fall back to default font (see comment above). */ fw->icon_font = Scr.DefaultFont; SET_USING_DEFAULT_ICON_FONT(fw, 1); return; } static void adjust_fvwm_internal_windows(FvwmWindow *fw) { if (fw == Scr.Hilite) { Scr.Hilite = NULL; } update_last_screen_focus_window(fw); restore_focus_after_unmap(fw, False); frame_destroyed_frame(FW_W(fw)); if (FW_W(fw) == Scr.StolenFocusWin) { Scr.StolenFocusWin = None; } if (Scr.focus_in_pending_window == fw) { Scr.focus_in_pending_window = NULL; } if (Scr.cascade_window == fw) { Scr.cascade_window = NULL; } return; } static void broadcast_mini_icon(FvwmWindow *fw) { if (!FMiniIconsSupported) { return; } if (fw->mini_pixmap_file && fw->mini_icon) { BroadcastFvwmPicture( M_MINI_ICON, FW_W(fw), FW_W_FRAME(fw), (unsigned long)fw, fw->mini_icon, fw->mini_pixmap_file); } return; } static void setup_mini_icon(FvwmWindow *fw, window_style *pstyle) { FvwmPictureAttributes fpa; if (!FMiniIconsSupported) { return; } if (SHAS_MINI_ICON(&pstyle->flags)) { fw->mini_pixmap_file = SGET_MINI_ICON_NAME(*pstyle); } else { fw->mini_pixmap_file = NULL; } if (fw->mini_pixmap_file) { fpa.mask = 0; fw->mini_icon = PCacheFvwmPicture( dpy, Scr.NoFocusWin, NULL, fw->mini_pixmap_file, fpa); } else { fw->mini_icon = NULL; } return; } /* * Copy icon size limits from window_style structure to FvwmWindow * structure. */ void setup_icon_size_limits(FvwmWindow *fw, window_style *pstyle) { if (SHAS_ICON_SIZE_LIMITS(&pstyle->flags)) { fw->min_icon_width = SGET_MIN_ICON_WIDTH(*pstyle); fw->min_icon_height = SGET_MIN_ICON_HEIGHT(*pstyle); fw->max_icon_width = SGET_MAX_ICON_WIDTH(*pstyle); fw->max_icon_height = SGET_MAX_ICON_HEIGHT(*pstyle); fw->icon_resize_type = SGET_ICON_RESIZE_TYPE(*pstyle); } else { fw->min_icon_width = MIN_ALLOWABLE_ICON_DIMENSION; fw->min_icon_height = MIN_ALLOWABLE_ICON_DIMENSION; fw->max_icon_width = MAX_ALLOWABLE_ICON_DIMENSION; fw->max_icon_height = MAX_ALLOWABLE_ICON_DIMENSION; fw->icon_resize_type = ICON_RESIZE_TYPE_NONE; } return; } void setup_icon_background_parameters(FvwmWindow *fw, window_style *pstyle) { if (SHAS_ICON_BACKGROUND_PADDING(&pstyle->flags)) { fw->icon_background_padding = SGET_ICON_BACKGROUND_PADDING(*pstyle); } else { fw->icon_background_padding = ICON_BACKGROUND_PADDING; } if (SHAS_ICON_BACKGROUND_RELIEF(&pstyle->flags)) { fw->icon_background_relief = SGET_ICON_BACKGROUND_RELIEF(*pstyle); } else { fw->icon_background_relief = ICON_RELIEF_WIDTH; } return; } void setup_icon_title_parameters(FvwmWindow *fw, window_style *pstyle) { if (SHAS_ICON_TITLE_RELIEF(&pstyle->flags)) { fw->icon_title_relief = SGET_ICON_TITLE_RELIEF(*pstyle); } else { fw->icon_title_relief = ICON_RELIEF_WIDTH; } return; } void setup_numeric_vals(FvwmWindow *fw, window_style *pstyle) { /****** window shading ******/ fw->shade_anim_steps = pstyle->shade_anim_steps; /****** snapattraction, snapgrid, paging ******/ fw->snap_attraction.proximity = pstyle->snap_attraction.proximity; fw->snap_attraction.mode = pstyle->snap_attraction.mode; fw->snap_grid_x = pstyle->snap_grid_x; fw->snap_grid_y = pstyle->snap_grid_y; if (pstyle->flags.has_edge_delay_ms_move) { fw->edge_delay_ms_move = pstyle->edge_delay_ms_move; } else { fw->edge_delay_ms_move = DEFAULT_MOVE_DELAY; } if (pstyle->flags.has_edge_delay_ms_resize) { fw->edge_delay_ms_resize = pstyle->edge_delay_ms_resize; } else { fw->edge_delay_ms_resize = DEFAULT_RESIZE_DELAY; } fw->edge_resistance_move = pstyle->edge_resistance_move; fw->edge_resistance_xinerama_move = pstyle->edge_resistance_xinerama_move; return; } static void setup_frame_window( FvwmWindow *fw) { XSetWindowAttributes attributes; int valuemask; int depth; Visual *visual; FRenderPictFormat *format; valuemask = CWBackingStore | CWBackPixmap | CWEventMask | CWSaveUnder | CWCursor; /* This adds preliminary support for ARGB windows in fvwm. It should evolve to proper ARGB support in frames, menus and modules */ format=FRenderFindVisualFormat(dpy, fw->attr_backup.visual); if (format != NULL && format->type == FRenderPictTypeDirect && format->direct.alphaMask > 0) { depth = fw->attr_backup.depth; visual = fw->attr_backup.visual; attributes.colormap = fw->attr_backup.colormap; attributes.background_pixel = -1; attributes.border_pixel = -1; valuemask |= CWColormap | CWBackPixel | CWBorderPixel; } else { depth = CopyFromParent; visual = CopyFromParent; } attributes.backing_store = NotUseful; attributes.background_pixmap = None; attributes.cursor = Scr.FvwmCursors[CRS_DEFAULT]; attributes.event_mask = XEVMASK_FRAMEW_CAPTURE; attributes.save_under = False; /* create the frame window, child of root, grandparent of client */ FW_W_FRAME(fw) = XCreateWindow( dpy, Scr.Root, fw->g.frame.x, fw->g.frame.y, fw->g.frame.width, fw->g.frame.height, 0, depth, InputOutput, visual, valuemask, &attributes); XSaveContext(dpy, FW_W(fw), FvwmContext, (caddr_t) fw); XSaveContext(dpy, FW_W_FRAME(fw), FvwmContext, (caddr_t) fw); return; } static void setup_title_window( FvwmWindow *fw, int valuemask, XSetWindowAttributes *pattributes) { valuemask |= CWCursor | CWEventMask; pattributes->cursor = Scr.FvwmCursors[CRS_TITLE]; pattributes->event_mask = XEVMASK_TITLEW; FW_W_TITLE(fw) = XCreateWindow( dpy, FW_W_FRAME(fw), 0, 0, 1, 1, 0, Pdepth, InputOutput, Pvisual, valuemask, pattributes); XSaveContext(dpy, FW_W_TITLE(fw), FvwmContext, (caddr_t) fw); return; } static void destroy_title_window(FvwmWindow *fw, Bool do_only_delete_context) { if (!do_only_delete_context) { XDestroyWindow(dpy, FW_W_TITLE(fw)); FW_W_TITLE(fw) = None; } XDeleteContext(dpy, FW_W_TITLE(fw), FvwmContext); XFlush(dpy); FW_W_TITLE(fw) = None; return; } static void change_title_window( FvwmWindow *fw, int valuemask, XSetWindowAttributes *pattributes) { if (HAS_TITLE(fw) && FW_W_TITLE(fw) == None) { setup_title_window(fw, valuemask, pattributes); } else if (!HAS_TITLE(fw) && FW_W_TITLE(fw) != None) { destroy_title_window(fw, False); } return; } static void setup_button_windows( FvwmWindow *fw, int valuemask, XSetWindowAttributes *pattributes, short buttons) { int i; Bool has_button; Bool is_deleted = False; valuemask |= CWCursor | CWEventMask; pattributes->cursor = Scr.FvwmCursors[CRS_SYS]; pattributes->event_mask = XEVMASK_BUTTONW; for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { has_button = (((!(i & 1) && i / 2 < Scr.nr_left_buttons) || ( (i & 1) && i / 2 < Scr.nr_right_buttons)) && (buttons & (1 << i))); if (FW_W_BUTTON(fw, i) == None && has_button) { FW_W_BUTTON(fw, i) = XCreateWindow( dpy, FW_W_FRAME(fw), 0, 0, 1, 1, 0, Pdepth, InputOutput, Pvisual, valuemask, pattributes); XSaveContext( dpy, FW_W_BUTTON(fw, i), FvwmContext, (caddr_t)fw); } else if (FW_W_BUTTON(fw, i) != None && !has_button) { /* destroy the current button window */ XDestroyWindow(dpy, FW_W_BUTTON(fw, i)); XDeleteContext(dpy, FW_W_BUTTON(fw, i), FvwmContext); is_deleted = True; FW_W_BUTTON(fw, i) = None; } } if (is_deleted == True) { XFlush(dpy); } return; } static void destroy_button_windows(FvwmWindow *fw, Bool do_only_delete_context) { int i; Bool is_deleted = False; for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { if (FW_W_BUTTON(fw, i) != None) { if (!do_only_delete_context) { XDestroyWindow(dpy, FW_W_BUTTON(fw, i)); FW_W_BUTTON(fw, i) = None; } XDeleteContext(dpy, FW_W_BUTTON(fw, i), FvwmContext); is_deleted = True; FW_W_BUTTON(fw, i) = None; } } if (is_deleted == True) { XFlush(dpy); } return; } static void change_button_windows( FvwmWindow *fw, int valuemask, XSetWindowAttributes *pattributes, short buttons) { if (HAS_TITLE(fw)) { setup_button_windows( fw, valuemask, pattributes, buttons); } else { destroy_button_windows(fw, False); } return; } static void setup_parent_window(FvwmWindow *fw) { size_borders b; XSetWindowAttributes attributes; int valuemask; valuemask = CWBackingStore | CWBackPixmap | CWCursor | CWEventMask | CWSaveUnder; attributes.backing_store = NotUseful; attributes.background_pixmap = None; attributes.cursor = Scr.FvwmCursors[CRS_DEFAULT]; attributes.event_mask = XEVMASK_PARENTW; attributes.save_under = False; /* This window is exactly the same size as the client for the benefit * of some clients */ get_window_borders(fw, &b); FW_W_PARENT(fw) = XCreateWindow( dpy, FW_W_FRAME(fw), b.top_left.width, b.top_left.height, fw->g.frame.width - b.total_size.width, fw->g.frame.height - b.total_size.height, 0, CopyFromParent, InputOutput, CopyFromParent, valuemask, &attributes); XSaveContext(dpy, FW_W_PARENT(fw), FvwmContext, (caddr_t) fw); return; } static void setup_resize_handle_cursors(FvwmWindow *fw) { unsigned long valuemask; XSetWindowAttributes attributes; int i; if (HAS_NO_BORDER(fw)) { return; } valuemask = CWCursor; attributes.cursor = Scr.FvwmCursors[CRS_DEFAULT]; for (i = 0; i < 4; i++) { if (HAS_HANDLES(fw)) { attributes.cursor = Scr.FvwmCursors[CRS_TOP_LEFT + i]; } XChangeWindowAttributes( dpy, FW_W_CORNER(fw, i), valuemask, &attributes); if (HAS_HANDLES(fw)) { attributes.cursor = Scr.FvwmCursors[CRS_TOP + i]; } XChangeWindowAttributes( dpy, FW_W_SIDE(fw, i), valuemask, &attributes); } return; } static void setup_resize_handle_windows(FvwmWindow *fw) { unsigned long valuemask; XSetWindowAttributes attributes; int i; int c_grav[4] = { NorthWestGravity, NorthEastGravity, SouthWestGravity, SouthEastGravity }; int s_grav[4] = { NorthWestGravity, NorthEastGravity, SouthWestGravity, NorthWestGravity }; if (HAS_NO_BORDER(fw)) { return; } valuemask = CWEventMask | CWBackingStore | CWSaveUnder | CWWinGravity | CWBorderPixel | CWColormap; attributes.event_mask = XEVMASK_BORDERW; attributes.backing_store = NotUseful; attributes.save_under = False; attributes.border_pixel = 0; attributes.colormap = Pcmap; /* Just dump the windows any old place and let frame_setup_window take * care of the mess */ for (i = 0; i < 4; i++) { attributes.win_gravity = c_grav[i]; FW_W_CORNER(fw, i) = XCreateWindow( dpy, FW_W_FRAME(fw), -1, -1, 1, 1, 0, Pdepth, InputOutput, Pvisual, valuemask, &attributes); XSaveContext( dpy, FW_W_CORNER(fw, i), FvwmContext, (caddr_t)fw); attributes.win_gravity = s_grav[i]; FW_W_SIDE(fw, i) = XCreateWindow( dpy, FW_W_FRAME(fw), -1, -1, 1, 1, 0, Pdepth, InputOutput, Pvisual, valuemask, &attributes); XSaveContext(dpy, FW_W_SIDE(fw, i), FvwmContext, (caddr_t)fw); } setup_resize_handle_cursors(fw); return; } static void destroy_resize_handle_windows( FvwmWindow *fw, Bool do_only_delete_context) { int i; for (i = 0; i < 4 ; i++) { XDeleteContext(dpy, FW_W_SIDE(fw, i), FvwmContext); XDeleteContext(dpy, FW_W_CORNER(fw, i), FvwmContext); if (!do_only_delete_context) { XDestroyWindow(dpy, FW_W_SIDE(fw, i)); XDestroyWindow(dpy, FW_W_CORNER(fw, i)); FW_W_SIDE(fw, i) = None; FW_W_CORNER(fw, i) = None; } } XFlush(dpy); return; } static void change_resize_handle_windows(FvwmWindow *fw) { if (!HAS_NO_BORDER(fw) && FW_W_SIDE(fw, 0) == None) { setup_resize_handle_windows(fw); } else if (HAS_NO_BORDER(fw) && FW_W_SIDE(fw, 0) != None) { destroy_resize_handle_windows(fw, False); } else { setup_resize_handle_cursors(fw); } return; } static void setup_frame_stacking(FvwmWindow *fw) { int i; int n; Window w[10 + NUMBER_OF_TITLE_BUTTONS]; /* Stacking order (top to bottom): * - Parent window * - Title and buttons * - Corner handles * - Side handles */ n = 0; if (!IS_SHADED(fw)) { w[n] = FW_W_PARENT(fw); n++; } if (HAS_TITLE(fw)) { for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i += 2) { if (FW_W_BUTTON(fw, i) != None) { w[n] = FW_W_BUTTON(fw, i); n++; } } for (i = 2 * NR_RIGHT_BUTTONS - 1; i > 0; i -= 2) { if (FW_W_BUTTON(fw, i) != None) { w[n] = FW_W_BUTTON(fw, i); n++; } } if (FW_W_TITLE(fw) != None) { w[n] = FW_W_TITLE(fw); n++; } } for (i = 0; i < 4; i++) { if (FW_W_CORNER(fw, i) != None) { w[n] = FW_W_CORNER(fw, i); n++; } } for (i = 0; i < 4; i++) { if (FW_W_SIDE(fw, i) != None) { w[n] = FW_W_SIDE(fw, i); n++; } } if (IS_SHADED(fw)) { w[n] = FW_W_PARENT(fw); n++; } XRestackWindows(dpy, w, n); return; } static void get_default_window_attributes( FvwmWindow *fw, unsigned long *pvaluemask, XSetWindowAttributes *pattributes) { *pvaluemask |= CWBackingStore | CWCursor | CWSaveUnder | CWBorderPixel | CWColormap | CWBackPixmap; pattributes->background_pixel = 0; pattributes->background_pixmap = None; pattributes->backing_store = NotUseful; pattributes->cursor = Scr.FvwmCursors[CRS_DEFAULT]; pattributes->save_under = False; pattributes->border_pixel = 0; pattributes->colormap = Pcmap; return; } static void setup_auxiliary_windows( FvwmWindow *fw, Bool setup_frame_and_parent, short buttons) { unsigned long valuemask_save = 0; XSetWindowAttributes attributes; get_default_window_attributes(fw, &valuemask_save, &attributes); if (setup_frame_and_parent) { setup_frame_window(fw); setup_parent_window(fw); } setup_resize_handle_windows(fw); if (HAS_TITLE(fw)) { setup_title_window(fw, valuemask_save, &attributes); setup_button_windows(fw, valuemask_save, &attributes, buttons); } setup_frame_stacking(fw); XMapSubwindows (dpy, FW_W_FRAME(fw)); return; } static void destroy_auxiliary_windows( FvwmWindow *fw, Bool destroy_frame_and_parent) { if (destroy_frame_and_parent) { XDeleteContext(dpy, FW_W_FRAME(fw), FvwmContext); XDeleteContext(dpy, FW_W_PARENT(fw), FvwmContext); delete_client_context(fw); XDestroyWindow(dpy, FW_W_FRAME(fw)); } if (HAS_TITLE(fw)) { destroy_title_window(fw, True); } if (HAS_TITLE(fw)) { destroy_button_windows(fw, True); } if (!HAS_NO_BORDER(fw)) { destroy_resize_handle_windows(fw, True); } XFlush(dpy); return; } static void setup_icon(FvwmWindow *fw, window_style *pstyle) { increase_icon_hint_count(fw); /* find a suitable icon pixmap */ if ((fw->wmhints) && (fw->wmhints->flags & IconWindowHint)) { if (SHAS_ICON(&pstyle->flags) && S_ICON_OVERRIDE(SCF(*pstyle)) == ICON_OVERRIDE) { ICON_DBG((stderr,"si: iwh ignored '%s'\n", fw->name.name)); fw->icon_bitmap_file = SGET_ICON_NAME(*pstyle); } else { ICON_DBG((stderr,"si: using iwh '%s'\n", fw->name.name)); fw->icon_bitmap_file = NULL; } } else if ((fw->wmhints) && (fw->wmhints->flags & IconPixmapHint)) { if (SHAS_ICON(&pstyle->flags) && S_ICON_OVERRIDE(SCF(*pstyle)) != NO_ICON_OVERRIDE) { ICON_DBG((stderr,"si: iph ignored '%s'\n", fw->name.name)); fw->icon_bitmap_file = SGET_ICON_NAME(*pstyle); } else { ICON_DBG((stderr,"si: using iph '%s'\n", fw->name.name)); fw->icon_bitmap_file = NULL; } } else if (SHAS_ICON(&pstyle->flags)) { /* an icon was specified */ ICON_DBG((stderr,"si: using style '%s'\n", fw->name.name)); fw->icon_bitmap_file = SGET_ICON_NAME(*pstyle); } else { /* use default icon */ ICON_DBG((stderr,"si: using default '%s'\n", fw->name.name)); fw->icon_bitmap_file = Scr.DefaultIcon; } /* icon name */ if (!EWMH_WMIconName(fw, NULL, NULL, 0)) { fw->icon_name.name = NoName; fw->icon_name.name_list = NULL; FlocaleGetNameProperty( XGetWMIconName, dpy, FW_W(fw), &(fw->icon_name)); } if (fw->icon_name.name == NoName) { fw->icon_name.name = fw->name.name; SET_WAS_ICON_NAME_PROVIDED(fw, 0); } setup_visible_name(fw, True); /* wait until the window is iconified and the icon window is mapped * before creating the icon window */ FW_W_ICON_TITLE(fw) = None; EWMH_SetVisibleName(fw, True); BroadcastWindowIconNames(fw, False, True); if (fw->icon_bitmap_file != NULL && fw->icon_bitmap_file != Scr.DefaultIcon) { BroadcastName(M_ICON_FILE,FW_W(fw),FW_W_FRAME(fw), (unsigned long)fw,fw->icon_bitmap_file); } return; } static void destroy_icon(FvwmWindow *fw) { free_window_names(fw, False, True); if (IS_PIXMAP_OURS(fw)) { XFreePixmap(dpy, fw->iconPixmap); fw->iconPixmap = None; if (fw->icon_maskPixmap != None) { XFreePixmap(dpy, fw->icon_maskPixmap); fw->icon_maskPixmap = None; } if (fw->icon_alphaPixmap != None) { XFreePixmap(dpy, fw->icon_alphaPixmap); fw->icon_alphaPixmap = None; } if (fw->icon_alloc_pixels != NULL) { if (fw->icon_nalloc_pixels != 0) { PictureFreeColors( dpy, Pcmap, fw->icon_alloc_pixels, fw->icon_nalloc_pixels, 0, fw->icon_no_limit); } free(fw->icon_alloc_pixels); fw->icon_alloc_pixels = NULL; fw->icon_nalloc_pixels = 0; fw->icon_no_limit = 0; } } if (FW_W_ICON_TITLE(fw)) { XDestroyWindow(dpy, FW_W_ICON_TITLE(fw)); XDeleteContext(dpy, FW_W_ICON_TITLE(fw), FvwmContext); XFlush(dpy); } if (FW_W_ICON_PIXMAP(fw) != None) { if (IS_ICON_OURS(fw)) { XDestroyWindow(dpy, FW_W_ICON_PIXMAP(fw)); } else { XUnmapWindow(dpy, FW_W_ICON_PIXMAP(fw)); } XDeleteContext(dpy, FW_W_ICON_PIXMAP(fw), FvwmContext); } clear_icon(fw); XFlush(dpy); return; } static void setup_icon_boxes(FvwmWindow *fw, window_style *pstyle) { icon_boxes *ib; /* copy iconboxes ptr (if any) */ if (SHAS_ICON_BOXES(&pstyle->flags)) { fw->IconBoxes = SGET_ICON_BOXES(*pstyle); for (ib = fw->IconBoxes; ib; ib = ib->next) { ib->use_count++; } } else { fw->IconBoxes = NULL; } return; } static void destroy_icon_boxes(FvwmWindow *fw) { if (fw->IconBoxes) { fw->IconBoxes->use_count--; if (fw->IconBoxes->use_count == 0 && fw->IconBoxes->is_orphan) { /* finally destroy the icon box */ free_icon_boxes(fw->IconBoxes); fw->IconBoxes = NULL; } } return; } static void setup_layer(FvwmWindow *fw, window_style *pstyle) { FvwmWindow *tf; int layer; if (SUSE_LAYER(&pstyle->flags)) { /* use layer from style */ layer = SGET_LAYER(*pstyle); } else if ((tf = get_transientfor_fvwmwindow(fw)) != NULL) { /* inherit layer from transientfor window */ layer = get_layer(tf); } else { /* use default layer */ layer = Scr.DefaultLayer; } set_default_layer(fw, layer); set_layer(fw, layer); return; } static void destroy_mini_icon(FvwmWindow *fw) { if (fw->mini_icon) { PDestroyFvwmPicture(dpy, fw->mini_icon); fw->mini_icon = 0; } return; } static void setup_key_and_button_grabs(FvwmWindow *fw) { #ifdef BUGS_ARE_COOL /* dv (29-May-2001): If keys are grabbed separately for C_WINDOW and * the other contexts, new windows have problems when bindings are * removed. Therefore, grab all keys in a single pass through the * list. */ GrabAllWindowKeys( dpy, FW_W_FRAME(fw), Scr.AllBindings, C_WINDOW|C_TITLE|C_RALL|C_LALL|C_SIDEBAR, GetUnusedModifiers(), True); #endif GrabAllWindowKeys( dpy, FW_W_FRAME(fw), Scr.AllBindings, C_TITLE|C_RALL|C_LALL|C_SIDEBAR|C_WINDOW, GetUnusedModifiers(), True); setup_focus_policy(fw); return; } static void __add_window_handle_x_resources(FvwmWindow *fw) { int client_argc = 0; char **client_argv = NULL; XrmValue rm_value; XrmDatabase db = NULL; static XrmOptionDescRec table [] = { {"-xrn", NULL, XrmoptionResArg, (caddr_t) NULL}, {"-xrm", NULL, XrmoptionResArg, (caddr_t) NULL}, }; /* Get global X resources */ MergeXResources(dpy, &db, False); /* Find out if the client requested a specific style on the command * line. */ if (XGetCommand(dpy, FW_W(fw), &client_argv, &client_argc)) { if (client_argc > 0 && client_argv != NULL) { /* command line takes precedence over all */ MergeCmdLineResources( &db, table, 2, fw->class.res_name, &client_argc, client_argv, True); } } /* parse the database values */ if (GetResourceString(db, "fvwmstyle", fw->class.res_name, &rm_value) && rm_value.size != 0) { char *style_name; int name_len; style_name = rm_value.addr; name_len = rm_value.size-1; /* Trim spaces at the start of the name */ while (name_len>0 && isspace(*style_name)) { style_name++; name_len--; } /* Trim spaces at the end of the name */ while (name_len>0 && isspace(*(style_name+name_len-1))) { name_len--; } if (name_len>0) { fw->style_name = (char*)safemalloc(sizeof(char)* (name_len+1)); memcpy(fw->style_name,style_name,name_len); fw->style_name[name_len] = 0; } } XFreeStringList(client_argv); XrmDestroyDatabase(db); return; } /* ---------------------------- interface functions ------------------------ */ void setup_visible_name(FvwmWindow *fw, Bool is_icon) { char *ext_name; window_style style; if (fw == NULL) { /* should never happen */ return; } /* TA: Get the window style. */ lookup_style(fw, &style); ext_name = interpolate_titleformat_name(fw, &style, is_icon); if (is_icon) { fw->visible_icon_name = strdup(ext_name); } else { fw->visible_name = strdup(ext_name); } free(ext_name); return; } void setup_window_name(FvwmWindow *fw) { if (!EWMH_WMName(fw, NULL, NULL, 0)) { fw->name.name = NoName; fw->name.name_list = NULL; FlocaleGetNameProperty(XGetWMName, dpy, FW_W(fw), &(fw->name)); } return; } void setup_wm_hints(FvwmWindow *fw) { fw->wmhints = XGetWMHints(dpy, FW_W(fw)); set_focus_model(fw); return; } void setup_title_geometry( FvwmWindow *fw, window_style *pstyle) { int width; int offset; get_title_font_size_and_offset( fw, S_TITLE_DIR(SCF(*pstyle)), S_IS_LEFT_TITLE_ROTATED_CW(SCF(*pstyle)), S_IS_RIGHT_TITLE_ROTATED_CW(SCF(*pstyle)), S_IS_TOP_TITLE_ROTATED(SCF(*pstyle)), S_IS_BOTTOM_TITLE_ROTATED(SCF(*pstyle)), &width, &offset); fw->title_thickness = width; fw->title_text_offset = offset; fw->corner_width = fw->title_thickness + fw->boundary_width; if (!HAS_TITLE(fw)) { fw->title_thickness = 0; } return; } void setup_window_font( FvwmWindow *fw, window_style *pstyle, Bool do_destroy) { /* get rid of old font */ if (do_destroy) { destroy_window_font(fw); /* destroy_window_font resets the IS_WINDOW_FONT_LOADED flag */ } /* load new font */ if (!IS_WINDOW_FONT_LOADED(fw)) { if (S_HAS_WINDOW_FONT(SCF(*pstyle)) && SGET_WINDOW_FONT(*pstyle) && (fw->title_font = FlocaleLoadFont(dpy, SGET_WINDOW_FONT(*pstyle), "fvwm"))) { SET_USING_DEFAULT_WINDOW_FONT(fw, 0); } else { /* no explicit font or failed to load, use default font * instead */ fw->title_font = Scr.DefaultFont; SET_USING_DEFAULT_WINDOW_FONT(fw, 1); } SET_WINDOW_FONT_LOADED(fw, 1); } setup_title_geometry(fw, pstyle); return; } void setup_icon_font( FvwmWindow *fw, window_style *pstyle, Bool do_destroy) { int height = 0; if (IS_ICON_SUPPRESSED(fw) || HAS_NO_ICON_TITLE(fw)) { if (IS_ICON_FONT_LOADED(fw)) { destroy_icon_font(fw); /* destroy_icon_font resets the IS_ICON_FONT_LOADED * flag */ } return; } /* get rid of old font */ if (do_destroy && IS_ICON_FONT_LOADED(fw)) { destroy_icon_font(fw); /* destroy_icon_font resets the IS_ICON_FONT_LOADED flag */ } /* load new font */ if (!IS_ICON_FONT_LOADED(fw)) { if (S_HAS_ICON_FONT(SCF(*pstyle)) && SGET_ICON_FONT(*pstyle) && (fw->icon_font = FlocaleLoadFont(dpy, SGET_ICON_FONT(*pstyle), "fvwm"))) { SET_USING_DEFAULT_ICON_FONT(fw, 0); } else { /* no explicit font or failed to load, use default font * instead */ fw->icon_font = Scr.DefaultFont; SET_USING_DEFAULT_ICON_FONT(fw, 1); } SET_ICON_FONT_LOADED(fw, 1); } /* adjust y position of existing icons */ height = (IS_ICON_FONT_LOADED(fw)) ? fw->icon_font->height : 0; if (height) { resize_icon_title_height(fw, height - fw->icon_font->height); /* this repositions the icon even if the window is not * iconified */ DrawIconWindow(fw, True, True, False, False, NULL); } return; } void setup_style_and_decor( FvwmWindow *fw, window_style *pstyle, short *buttons) { /* first copy the static styles into the window struct */ memcpy(&(FW_COMMON_FLAGS(fw)), &(SCF(*pstyle)), sizeof(common_flags_t)); fw->wShaped = None; if (FShapesSupported) { int i; unsigned int u; Bool b; int boundingShaped; /* suppress compiler warnings w/o shape extension */ i = 0; u = 0; b = False; FShapeSelectInput(dpy, FW_W(fw), FShapeNotifyMask); if (FShapeQueryExtents( dpy, FW_W(fw), &boundingShaped, &i, &i, &u, &u, &b, &i, &i, &u, &u)) { fw->wShaped = boundingShaped; } } #ifdef USEDECOR /* search for a UseDecor tag in the style */ if (!IS_DECOR_CHANGED(fw)) { FvwmDecor *decor = &Scr.DefaultDecor; for (; decor; decor = decor->next) { if (StrEquals(SGET_DECOR_NAME(*pstyle), decor->tag)) { fw->decor = decor; break; } } } if (fw->decor == NULL) { fw->decor = &Scr.DefaultDecor; } #endif GetMwmHints(fw); GetOlHints(fw); fw->buttons = SIS_BUTTON_DISABLED(&pstyle->flags); SelectDecor(fw, pstyle, buttons); if (IS_TRANSIENT(fw) && !pstyle->flags.do_decorate_transient) { SET_HAS_HANDLES(fw, 0); SET_HAS_TITLE(fw, 0); } /* set boundary width to zero for shaped windows */ if (FHaveShapeExtension) { if (fw->wShaped) { set_window_border_size(fw, fw->unshaped_boundary_width); SET_HAS_NO_BORDER(fw, 1); SET_HAS_HANDLES(fw, 0); } } /****** window colors ******/ update_window_color_style(fw, pstyle); update_window_color_hi_style(fw, pstyle); /***** icons colorsets *****/ update_icon_title_cs_style(fw, pstyle); update_icon_title_cs_hi_style(fw, pstyle); update_icon_background_cs_style(fw, pstyle); /***** icons title/background parameters ****/ setup_icon_background_parameters(fw, pstyle); setup_icon_title_parameters(fw, pstyle); /****** some numeric values ******/ setup_numeric_vals(fw, pstyle); /****** GNOME style hints ******/ if (!S_DO_IGNORE_GNOME_HINTS(SCF(*pstyle))) { GNOME_GetStyle(fw, pstyle); } /* ConfigureNotify motion method */ if (SCR_MOTION_METHOD(&pstyle->flag_mask)) { CR_MOTION_METHOD(fw) = SCR_MOTION_METHOD(&pstyle->flags); } return; } void change_icon_boxes(FvwmWindow *fw, window_style *pstyle) { destroy_icon_boxes(fw); setup_icon_boxes(fw, pstyle); return; } void setup_frame_size_limits(FvwmWindow *fw, window_style *pstyle) { if (SHAS_MIN_WINDOW_SIZE(&pstyle->flags)) { fw->min_window_width = SGET_MIN_WINDOW_WIDTH(*pstyle); fw->min_window_height = SGET_MIN_WINDOW_HEIGHT(*pstyle); } else { fw->min_window_width = 0; fw->min_window_height = 0; } if (SHAS_MAX_WINDOW_SIZE(&pstyle->flags)) { fw->max_window_width = SGET_MAX_WINDOW_WIDTH(*pstyle); fw->max_window_height = SGET_MAX_WINDOW_HEIGHT(*pstyle); } else { fw->max_window_width = DEFAULT_MAX_MAX_WINDOW_WIDTH; fw->max_window_height = DEFAULT_MAX_MAX_WINDOW_HEIGHT; } return; } void setup_placement_penalty(FvwmWindow *fw, window_style *pstyle) { if (!SHAS_PLACEMENT_PENALTY(&pstyle->flags)) { pl_penalty_struct *p; p = SGET_PLACEMENT_PENALTY_PTR(*pstyle); *p = default_pl_penalty; } if (!SHAS_PLACEMENT_PERCENTAGE_PENALTY(&pstyle->flags)) { pl_percent_penalty_struct *p; p = SGET_PLACEMENT_PERCENTAGE_PENALTY_PTR(*pstyle); *p = default_pl_percent_penalty; } fw->pl_penalty = (*pstyle).pl_penalty; fw->pl_percent_penalty = (*pstyle).pl_percent_penalty; return; } void setup_frame_attributes( FvwmWindow *fw, window_style *pstyle) { XSetWindowAttributes xswa; /* Backing_store is controlled on the client, borders, title & buttons */ switch (pstyle->flags.use_backing_store) { case BACKINGSTORE_DEFAULT: xswa.backing_store = fw->attr_backup.backing_store; break; case BACKINGSTORE_ON: xswa.backing_store = Scr.use_backing_store; break; case BACKINGSTORE_OFF: default: xswa.backing_store = NotUseful; break; } /* parent_relative is applied to the frame and the parent */ xswa.background_pixmap = pstyle->flags.use_parent_relative ? ParentRelative : None; /* Save_under is only useful on the frame */ xswa.save_under = pstyle->flags.do_save_under ? Scr.flags.do_save_under : NotUseful; XChangeWindowAttributes(dpy, FW_W(fw), CWBackingStore, &xswa); XChangeWindowAttributes( dpy, FW_W_PARENT(fw), CWBackPixmap | CWBackingStore, &xswa); XChangeWindowAttributes( dpy, FW_W_FRAME(fw), CWBackPixmap | CWBackingStore | CWSaveUnder, &xswa); return; } void change_auxiliary_windows(FvwmWindow *fw, short buttons) { unsigned long valuemask_save = 0; XSetWindowAttributes attributes; get_default_window_attributes(fw, &valuemask_save, &attributes); change_title_window(fw, valuemask_save, &attributes); change_button_windows(fw, valuemask_save, &attributes, buttons); change_resize_handle_windows(fw); setup_frame_stacking(fw); XMapSubwindows (dpy, FW_W_FRAME(fw)); return; } void increase_icon_hint_count(FvwmWindow *fw) { if (fw->wmhints && (fw->wmhints->flags & (IconWindowHint | IconPixmapHint))) { switch (WAS_ICON_HINT_PROVIDED(fw)) { case ICON_HINT_NEVER: SET_WAS_ICON_HINT_PROVIDED(fw, ICON_HINT_ONCE); break; case ICON_HINT_ONCE: SET_WAS_ICON_HINT_PROVIDED(fw, ICON_HINT_MULTIPLE); break; case ICON_HINT_MULTIPLE: default: break; } ICON_DBG((stderr,"icon hint count++ (%d) '%s'\n", (int)WAS_ICON_HINT_PROVIDED(fw), fw->name.name)); } return; } void change_icon(FvwmWindow *fw, window_style *pstyle) { destroy_icon(fw); setup_icon(fw, pstyle); return; } void change_mini_icon(FvwmWindow *fw, window_style *pstyle) { FvwmPicture *old_mi = fw->mini_icon; destroy_mini_icon(fw); setup_mini_icon(fw, pstyle); broadcast_mini_icon(fw); if (old_mi != NULL && fw->mini_icon == 0) { /* this case is not handled in setup_mini_icon, so we must * broadcast here explicitly */ BroadcastFvwmPicture( M_MINI_ICON, FW_W(fw), FW_W_FRAME(fw), (unsigned long)fw, NULL, ""); } return; } void setup_focus_policy(FvwmWindow *fw) { focus_grab_buttons(fw); return; } Bool validate_transientfor(FvwmWindow *fw) { XWindowAttributes wa; FvwmWindow *cw; Window w; w = FW_W_TRANSIENTFOR(fw); if (w == None || w == FW_W(fw) || w == IS_EWMH_DESKTOP(w)) { FW_W_TRANSIENTFOR(fw) = Scr.Root; return False; } else if (XFindContext(dpy, w, FvwmContext, (caddr_t *)&cw) != XCNOENT) { if (cw == fw) { /* It's a transient of itself, ignore the hint */ FW_W_TRANSIENTFOR(fw) = Scr.Root; return False; } /* Check for transient loops */ while (XFindContext( dpy, FW_W_TRANSIENTFOR(cw), FvwmContext, (caddr_t *)&cw) != XCNOENT && IS_TRANSIENT(cw)) { if (FW_W_TRANSIENTFOR(cw) == FW_W(fw) || cw == fw) { /* loop detected, ignore the hint */ FW_W_TRANSIENTFOR(fw) = Scr.Root; return False; } } } else if (!XGetWindowAttributes(dpy, w, &wa) || wa.map_state != IsViewable) { /* transientfor does not exist or is not viewable or unmapped */ FW_W_TRANSIENTFOR(fw) = Scr.Root; return False; } return True; } Bool setup_transientfor(FvwmWindow *fw) { Bool rc; rc = XGetTransientForHint(dpy, FW_W(fw), &FW_W_TRANSIENTFOR(fw)); SET_TRANSIENT(fw, rc); if (rc == False) { FW_W_TRANSIENTFOR(fw) = Scr.Root; } validate_transientfor(fw); return rc; } /* * * Procedure: * AddWindow - add a new window to the fvwm list * */ FvwmWindow *AddWindow( const char **ret_initial_map_command, const exec_context_t *exc, FvwmWindow *ReuseWin, initial_window_options_t * win_opts) { /* new fvwm window structure */ register FvwmWindow *fw; FvwmWindow *tmp; /* mask for create windows */ unsigned long valuemask; /* attributes for create windows */ XSetWindowAttributes attributes; XWindowAttributes wattr; /* area for merged styles */ window_style style; /* used for faster access */ style_flags *sflags; short buttons; Bool used_sm = False; Bool do_resize_too = False; size_borders b; frame_move_resize_args mr_args; mwtsm_state_args state_args; Window w = exc->w.w; const exec_context_t *exc2; exec_context_changes_t ecc; /****** init window structure ******/ setup_window_structure(&tmp, w, ReuseWin); fw = tmp; /****** Make sure the client window still exists. We don't want to * leave an orphan frame window if it doesn't. Since we now have the * server grabbed, the window can't disappear later without having been * reparented, so we'll get a DestroyNotify for it. We won't have * gotten one for anything up to here, however. ******/ MyXGrabServer(dpy); if (XGetGeometry( dpy, w, &JunkRoot, &JunkX, &JunkY, (unsigned int*)&JunkWidth, (unsigned int*)&JunkHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth) == 0) { if (Scr.bo.do_display_new_window_names) { fvwm_msg(INFO, "AddWindow", "new window disappeared"); } free(fw); MyXUngrabServer(dpy); return NULL; } /****** window name ******/ setup_window_name(fw); setup_class_and_resource(fw); /****** style setup ******/ __add_window_handle_x_resources(fw); /* get merged styles */ lookup_style(fw, &style); sflags = SGET_FLAGS_POINTER(style); if (SIS_UNMANAGED(sflags)) { if (Scr.bo.do_display_new_window_names) { fvwm_msg( INFO, "AddWindow", "new window is unmanaged:\n" " name: %s\n" " icon name: (unknown)\n" " resource: %s\n" " class: %s", fw->name.name, fw->class.res_name, fw->class.res_class); } free_window_names(fw, True, True); if (fw->style_name) { free(fw->style_name); } free(fw); MyXUngrabServer(dpy); return AW_UNMANAGED; } /****** window attributes and hints ******/ setup_window_attr(fw, &wattr); setup_wm_hints(fw); /****** basic style and decor ******/ /* If the window is in the NoTitle list, or is a transient, dont * decorate it. If its a transient, and DecorateTransients was * specified, decorate anyway. */ setup_transientfor(fw); if (win_opts->flags.is_menu) { SET_TEAR_OFF_MENU(fw, 1); } fw->decor = NULL; setup_style_and_decor(fw, &style, &buttons); /****** fonts ******/ setup_window_font(fw, &style, False); setup_icon_font(fw, &style, False); /***** visible window name ****/ setup_visible_name(fw, False); EWMH_SetVisibleName(fw, False); if (Scr.bo.do_display_new_window_names) { fvwm_msg( INFO, "AddWindow", "new window:\n" " name: %s\n" " icon name: %s\n" " resource: %s\n" " class: %s", fw->name.name, (fw->icon_name.name == NULL) ? "(unknown)" : fw->icon_name.name, fw->class.res_name, fw->class.res_class); } /****** InitialMapCommand ******/ *ret_initial_map_command = (style.flags.has_initial_map_command_string) ? SGET_INITIAL_MAP_COMMAND_STRING(style) : NULL; /****** state setup ******/ setup_icon_boxes(fw, &style); SET_ICONIFIED(fw, 0); SET_ICON_UNMAPPED(fw, 0); SET_MAXIMIZED(fw, 0); /* * Reparenting generates an UnmapNotify event, followed by a MapNotify. * Set the map state to 0 to prevent a transition back to * WithdrawnState in HandleUnmapNotify. Map state gets set corrected * again in HandleMapNotify. */ SET_MAPPED(fw, 0); /****** window list and stack ring ******/ /* add the window to the end of the fvwm list */ fw->next = Scr.FvwmRoot.next; fw->prev = &Scr.FvwmRoot; while (fw->next != NULL) { fw->prev = fw->next; fw->next = fw->next->next; } /* fw->prev points to the last window in the list, fw->next is * NULL. Now fix the last window to point to fw */ fw->prev->next = fw; /* * RBW - 11/13/1998 - add it into the stacking order chain also. * This chain is anchored at both ends on Scr.FvwmRoot, there are * no null pointers. */ add_window_to_stack_ring_after(fw, &Scr.FvwmRoot); /****** calculate frame size ******/ fw->hints.win_gravity = NorthWestGravity; GetWindowSizeHints(fw); /****** border width ******/ XSetWindowBorderWidth(dpy, FW_W(fw), 0); /****** icon size limits ******/ setup_icon_size_limits(fw, &style); /***** placement penalities *****/ setup_placement_penalty(fw, &style); /* * MatchWinToSM changes fw->attr and the stacking order. * Thus it is important have this call *after* PlaceWindow and the * stacking order initialization. */ get_window_borders(fw, &b); memset(&state_args, 0, sizeof(state_args)); used_sm = MatchWinToSM(fw, &state_args, win_opts); if (used_sm) { /* read the requested absolute geometry */ gravity_translate_to_northwest_geometry_no_bw( fw->hints.win_gravity, fw, &fw->g.normal, &fw->g.normal); gravity_resize( fw->hints.win_gravity, &fw->g.normal, b.total_size.width, b.total_size.height); fw->g.frame = fw->g.normal; fw->g.frame.x -= Scr.Vx; fw->g.frame.y -= Scr.Vy; /****** calculate frame size ******/ setup_frame_size_limits(fw, &style); constrain_size( fw, NULL, &fw->g.frame.width, &fw->g.frame.height, 0, 0, 0); /****** maximize ******/ if (state_args.do_max) { SET_MAXIMIZED(fw, 1); constrain_size( fw, NULL, &fw->g.max.width, &fw->g.max.height, 0, 0, CS_UPDATE_MAX_DEFECT); get_relative_geometry(&fw->g.frame, &fw->g.max); } else { get_relative_geometry(&fw->g.frame, &fw->g.normal); } } else { rectangle attr_g; if (IS_SHADED(fw)) { state_args.do_shade = 1; state_args.used_title_dir_for_shading = USED_TITLE_DIR_FOR_SHADING(fw); state_args.shade_dir = SHADED_DIR(fw); SET_SHADED(fw, 0); } /* Tentative size estimate */ fw->g.frame.width = wattr.width + b.total_size.width; fw->g.frame.height = wattr.height + b.total_size.height; /****** calculate frame size ******/ setup_frame_size_limits(fw, &style); /****** layer ******/ setup_layer(fw, &style); /****** window placement ******/ attr_g.x = wattr.x; attr_g.y = wattr.y; attr_g.width = wattr.width; attr_g.height = wattr.height; do_resize_too = setup_window_placement( fw, &style, &attr_g, win_opts, PLACE_INITIAL); wattr.x = attr_g.x; wattr.y = attr_g.y; /* set up geometry */ fw->g.frame.x = wattr.x; fw->g.frame.y = wattr.y; fw->g.frame.width = wattr.width + b.total_size.width; fw->g.frame.height = wattr.height + b.total_size.height; gravity_constrain_size( fw->hints.win_gravity, fw, &fw->g.frame, 0); update_absolute_geometry(fw); } /****** auxiliary window setup ******/ setup_auxiliary_windows(fw, True, buttons); /****** 'backing store' and 'save under' window setup ******/ setup_frame_attributes(fw, &style); /****** reparent the window ******/ XReparentWindow(dpy, FW_W(fw), FW_W_PARENT(fw), 0, 0); /****** select events ******/ valuemask = CWEventMask | CWDontPropagate; if (IS_TEAR_OFF_MENU(fw)) { attributes.event_mask = XEVMASK_TEAR_OFF_MENUW; } else { attributes.event_mask = XEVMASK_CLIENTW; } attributes.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask; XChangeWindowAttributes(dpy, FW_W(fw), valuemask, &attributes); /****** make sure the window is not destroyed when fvwm dies ******/ if (!IS_TEAR_OFF_MENU(fw)) { /* menus were created by fvwm itself, don't add them to the * save set */ XAddToSaveSet(dpy, FW_W(fw)); } /****** now we can sefely ungrab the server ******/ MyXUngrabServer(dpy); /* need to set up the mini icon before drawing */ if (FMiniIconsSupported) { setup_mini_icon(fw, &style); } /****** arrange the frame ******/ if (is_resizing_event_pending(fw) == True) { SET_FORCE_NEXT_CR(fw, 1); SET_FORCE_NEXT_PN(fw, 1); mr_args = frame_create_move_resize_args( fw, FRAME_MR_FORCE_SETUP_NO_W | FRAME_MR_DONT_DRAW, NULL, &fw->g.frame, 0, DIR_NONE); } else { mr_args = frame_create_move_resize_args( fw, FRAME_MR_FORCE_SETUP | FRAME_MR_DONT_DRAW, NULL, &fw->g.frame, 0, DIR_NONE); } frame_move_resize(fw, mr_args); frame_free_move_resize_args(fw, mr_args); /* draw later */ SET_WAS_NEVER_DRAWN(fw, 1); /****** grab keys and buttons ******/ setup_key_and_button_grabs(fw); /****** inform modules of new window ******/ BroadcastConfig(M_ADD_WINDOW,fw); BroadcastWindowIconNames(fw, True, False); /****** place the window in the stack ring ******/ if (!position_new_window_in_stack_ring(fw, SDO_START_LOWERED(sflags))) { XWindowChanges xwc; xwc.sibling = FW_W_FRAME(get_next_window_in_stack_ring(fw)); xwc.stack_mode = Above; XConfigureWindow( dpy, FW_W_FRAME(fw), CWSibling|CWStackMode, &xwc); } /* these are sent and broadcast before res_{class,name} for the benefit * of FvwmIconBox which can't handle M_ICON_FILE after M_RES_NAME */ /****** icon and mini icon ******/ /* migo (20-Jan-2000): the logic is to unset this flag on NULL values */ SET_WAS_ICON_NAME_PROVIDED(fw, 1); setup_icon(fw, &style); if (FMiniIconsSupported) { broadcast_mini_icon(fw); } BroadcastName(M_RES_CLASS,FW_W(fw),FW_W_FRAME(fw), (unsigned long)fw,fw->class.res_class); BroadcastName(M_RES_NAME,FW_W(fw),FW_W_FRAME(fw), (unsigned long)fw,fw->class.res_name); /****** stick window ******/ if (!(fw->hints.flags & USPosition) || used_sm) { int stick_page; int stick_desk; stick_page = is_window_sticky_across_pages(fw); stick_desk = is_window_sticky_across_desks(fw); if ((stick_page && !IsRectangleOnThisPage(&fw->g.frame, Scr.CurrentDesk)) || (stick_desk && fw->Desk != Scr.CurrentDesk)) { /* If it's sticky and the user didn't ask for an * explicit position, force it on screen now. Don't do * that with USPosition because we have to assume the * user knows what (s)he is doing. This is necessary * e.g. if we want a sticky 'panel' in FvwmButtons but * don't want to see when it's mapped in the void. */ ecc.w.fw = fw; ecc.w.w = FW_W_FRAME(fw); ecc.w.wcontext = C_FRAME; exc2 = exc_clone_context( exc, &ecc, ECC_FW | ECC_W | ECC_WCONTEXT); SET_STICKY_ACROSS_PAGES(fw, 0); SET_STICKY_ACROSS_DESKS(fw, 0); handle_stick( NULL, exc2, "", stick_page, stick_desk, 1, 0); exc_destroy_context(exc2); } } /****** resize window ******/ if (do_resize_too) { XEvent e; memset(&e, 0, sizeof(e)); FWarpPointer( dpy, Scr.Root, Scr.Root, 0, 0, Scr.MyDisplayWidth, Scr.MyDisplayHeight, fw->g.frame.x + (fw->g.frame.width>>1), fw->g.frame.y + (fw->g.frame.height>>1)); e.xany.type = ButtonPress; e.xbutton.button = 1; e.xbutton.state = Button1Mask; e.xbutton.x_root = fw->g.frame.x + (fw->g.frame.width>>1); e.xbutton.y_root = fw->g.frame.y + (fw->g.frame.height>>1); e.xbutton.x = (fw->g.frame.width>>1); e.xbutton.y = (fw->g.frame.height>>1); e.xbutton.subwindow = None; e.xany.window = FW_W(fw); fev_fake_event(&e); ecc.x.etrigger = &e; ecc.w.fw = fw; ecc.w.wcontext = C_WINDOW; exc2 = exc_clone_context( exc, &ecc, ECC_ETRIGGER | ECC_FW | ECC_WCONTEXT); CMD_Resize(NULL, exc2, ""); exc_destroy_context(exc2); } /****** window colormap ******/ ReInstallActiveColormap(); /****** ewmh setup *******/ EWMH_WindowInit(fw); /****** gnome setup ******/ /* set GNOME hints on the window from flags set on fw */ GNOME_SetHints(fw); GNOME_SetLayer(fw); GNOME_SetDesk(fw); GNOME_SetWinArea(fw); /****** windowshade ******/ if (state_args.do_shade || SDO_START_SHADED(sflags)) { rectangle big_g; rectangle new_g; frame_move_resize_args mr_args; if (state_args.used_title_dir_for_shading) { state_args.shade_dir = GET_TITLE_DIR(fw); } /* If we've set a style for StartShaded, ensure we override * the state for it here. -- TA. */ if (SDO_START_SHADED(sflags) && !state_args.do_shade) { state_args.shade_dir = SGET_STARTS_SHADED_DIR(style); } big_g = (IS_MAXIMIZED(fw)) ? fw->g.max : fw->g.frame; new_g = big_g; get_shaded_geometry_with_dir( fw, &new_g, &new_g, state_args.shade_dir); mr_args = frame_create_move_resize_args( fw, FRAME_MR_SHRINK | FRAME_MR_DONT_DRAW, &big_g, &new_g, 0, state_args.shade_dir); frame_move_resize(fw, mr_args); SET_SHADED(fw, 1); SET_SHADED_DIR(fw, state_args.shade_dir); frame_free_move_resize_args(fw, mr_args); } if (!IS_SHADED(fw) && !IS_ICONIFIED(fw)) { /* TK always wants some special treatment: If the window is * simply mapped, the tk menus come up at funny Y coordinates. * Tell it it's geometry *again* to work around this problem. */ SendConfigureNotify( fw, fw->g.frame.x, fw->g.frame.y, fw->g.frame.width, fw->g.frame.height, 0, False); } if ( HAS_EWMH_INIT_MAXVERT_STATE(fw) == EWMH_STATE_HAS_HINT || HAS_EWMH_INIT_MAXHORIZ_STATE(fw) == EWMH_STATE_HAS_HINT) { int h; int v; char cmd[256]; if ( is_function_allowed( F_MAXIMIZE, NULL, fw, RQORIG_PROGRAM_US, False)) { h = (HAS_EWMH_INIT_MAXHORIZ_STATE(fw) == EWMH_STATE_HAS_HINT) ? 100 : 0; v = (HAS_EWMH_INIT_MAXVERT_STATE(fw) == EWMH_STATE_HAS_HINT) ? 100 : 0; sprintf(cmd,"Maximize on %i %i", h, v); execute_function_override_window( NULL, NULL, cmd, 0, fw); } } if (HAS_EWMH_INIT_FULLSCREEN_STATE(fw) == EWMH_STATE_HAS_HINT) { EWMH_fullscreen(fw); } if (!XGetGeometry( dpy, FW_W(fw), &JunkRoot, &JunkX, &JunkY, (unsigned int*)&JunkWidth, (unsigned int*)&JunkHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth)) { /* The window has disappeared somehow. For some reason we do * not always get a DestroyNotify on the window, so make sure * it is destroyed. */ destroy_window(fw); fw = NULL; } return fw; } /* * * Procedure: * FetchWMProtocols - finds out which protocols the window supports * * Inputs: * tmp - the fvwm window structure to use * */ void FetchWmProtocols(FvwmWindow *tmp) { Atom *protocols = NULL, *ap; unsigned long *l_protocols; int i, n; Atom atype; int aformat; unsigned long bytes_remain,nitems; if (tmp == NULL) { return; } /* First, try the Xlib function to read the protocols. * This is what Twm uses. */ if (XGetWMProtocols (dpy, FW_W(tmp), &protocols, &n)) { for (i = 0, ap = protocols; i < n; i++, ap++) { if (*ap == (Atom)_XA_WM_TAKE_FOCUS) { SET_WM_TAKES_FOCUS(tmp, 1); set_focus_model(tmp); } if (*ap == (Atom)_XA_WM_DELETE_WINDOW) { SET_WM_DELETES_WINDOW(tmp, 1); } } if (protocols) { XFree((char *)protocols); } } else { /* Next, read it the hard way. mosaic from Coreldraw needs to * be read in this way. */ if ((XGetWindowProperty( dpy, FW_W(tmp), _XA_WM_PROTOCOLS, 0L, 10L, False, _XA_WM_PROTOCOLS, &atype, &aformat, &nitems, &bytes_remain, (unsigned char **)&l_protocols)) == Success) { for (i = 0; i < nitems; i++) { ap = &(l_protocols[i]); if (*ap == (Atom)_XA_WM_TAKE_FOCUS) { SET_WM_TAKES_FOCUS(tmp, 1); set_focus_model(tmp); } if (*ap == (Atom)_XA_WM_DELETE_WINDOW) { SET_WM_DELETES_WINDOW(tmp, 1); } } if (protocols) { XFree((char *)protocols); } } } return; } /* * * Procedure: * GetWindowSizeHints - gets application supplied size info * * Inputs: * tmp - the fvwm window structure to use * */ void GetWindowSizeHints(FvwmWindow *fw) { long supplied = 0; char *broken_cause =""; XSizeHints orig_hints; Status rc; fw->orig_hints.width_inc = 1; fw->orig_hints.height_inc = 1; rc = XGetWMNormalHints(dpy, FW_W(fw), &orig_hints, &supplied); if (rc == 0) { fw->hints.flags = 0; memset(&orig_hints, 0, sizeof(orig_hints)); } else { fw->hints = orig_hints; if (fw->hints.flags & PResizeInc) { fw->orig_hints.width_inc = fw->hints.width_inc; fw->orig_hints.height_inc = fw->hints.height_inc; } if (HAS_OVERRIDE_SIZE_HINTS(fw)) { /* ignore the WMNormal hints */ fw->hints.flags &= ~(PMinSize | PMaxSize | PResizeInc); fw->hints.min_width = 0; fw->hints.min_height = 0; fw->hints.max_width = 0; fw->hints.max_height = 0; fw->hints.width_inc = 1; fw->hints.height_inc = 1; } } /* Beat up our copy of the hints, so that all important field are * filled in! */ if (fw->hints.flags & PResizeInc) { SET_SIZE_INC_SET(fw, 1); if (fw->hints.width_inc <= 0) { if (fw->hints.width_inc < 0 || (fw->hints.width_inc == 0 && (fw->hints.flags & PMinSize) && (fw->hints.flags & PMaxSize) && fw->hints.min_width != fw->hints.max_width)) { broken_cause = "width_inc"; } fw->hints.width_inc = 1; SET_SIZE_INC_SET(fw, 0); } if (fw->hints.height_inc <= 0) { if (fw->hints.height_inc < 0 || (fw->hints.height_inc == 0 && (fw->hints.flags & PMinSize) && (fw->hints.flags & PMaxSize) && fw->hints.min_height != fw->hints.max_height)) { if (!*broken_cause) { broken_cause = "height_inc"; } } fw->hints.height_inc = 1; SET_SIZE_INC_SET(fw, 0); } } else { SET_SIZE_INC_SET(fw, 0); fw->hints.width_inc = 1; fw->hints.height_inc = 1; } if (fw->hints.flags & PMinSize) { if (fw->hints.min_width < 0 && !*broken_cause) { broken_cause = "min_width"; } if (fw->hints.min_height < 0 && !*broken_cause) { broken_cause = "min_height"; } } else { if (fw->hints.flags & PBaseSize) { fw->hints.min_width = fw->hints.base_width; fw->hints.min_height = fw->hints.base_height; } else { fw->hints.min_width = 1; fw->hints.min_height = 1; } } if (fw->hints.min_width <= 0) { fw->hints.min_width = 1; } if (fw->hints.min_height <= 0) { fw->hints.min_height = 1; } if (fw->hints.flags & PMaxSize) { if (fw->hints.max_width < fw->hints.min_width) { fw->hints.max_width = DEFAULT_MAX_MAX_WINDOW_WIDTH; if (!*broken_cause) { broken_cause = "max_width"; } } if (fw->hints.max_height < fw->hints.min_height) { fw->hints.max_height = DEFAULT_MAX_MAX_WINDOW_HEIGHT; if (!*broken_cause) { broken_cause = "max_height"; } } } else { fw->hints.max_width = DEFAULT_MAX_MAX_WINDOW_WIDTH; fw->hints.max_height = DEFAULT_MAX_MAX_WINDOW_HEIGHT; } /* * ICCCM says that PMinSize is the default if no PBaseSize is given, * and vice-versa. */ if (fw->hints.flags & PBaseSize) { if (fw->hints.base_width < 0) { fw->hints.base_width = 0; if (!*broken_cause) { broken_cause = "base_width"; } } if (fw->hints.base_height < 0) { fw->hints.base_height = 0; if (!*broken_cause) { broken_cause = "base_height"; } } if ((fw->hints.base_width > fw->hints.min_width) || (fw->hints.base_height > fw->hints.min_height)) { /* In this case, doing the aspect ratio calculation for window_size - base_size as prescribed by the ICCCM is going to fail. Resetting the flag disables the use of base_size in aspect ratio calculation while it is still used for grid sizing. */ fw->hints.flags &= ~PBaseSize; #if 0 /* Keep silent about this, since the Xlib manual * actually recommends making min <= base <= max ! */ broken_cause = ""; #endif } } else { if (fw->hints.flags & PMinSize) { fw->hints.base_width = fw->hints.min_width; fw->hints.base_height = fw->hints.min_height; } else { fw->hints.base_width = 0; fw->hints.base_height = 0; } } if (!(fw->hints.flags & PWinGravity)) { fw->hints.win_gravity = NorthWestGravity; } if ((fw->hints.flags & PMaxSize) && ((fw->hints.flags & PMinSize) || (fw->hints.flags & PBaseSize))) { if (fw->hints.max_width < fw->hints.base_width) { fw->hints.max_width = DEFAULT_MAX_MAX_WINDOW_WIDTH; if (!*broken_cause) { broken_cause = "max_width"; } } if (fw->hints.max_height < fw->hints.base_height) { fw->hints.max_height = DEFAULT_MAX_MAX_WINDOW_HEIGHT; if (!*broken_cause) { broken_cause = "max_height"; } } } if (fw->hints.flags & PAspect) { /* ** check to make sure min/max aspect ratios look valid */ #define maxAspectX fw->hints.max_aspect.x #define maxAspectY fw->hints.max_aspect.y #define minAspectX fw->hints.min_aspect.x #define minAspectY fw->hints.min_aspect.y /* ** The math looks like this: ** ** minAspectX maxAspectX ** ---------- <= ---------- ** minAspectY maxAspectY ** ** If that is multiplied out, this must be satisfied: ** ** minAspectX * maxAspectY <= maxAspectX * minAspectY ** ** So, what to do if this isn't met? Ignoring it entirely ** seems safest. ** */ /* We also ignore people who put negative entries into * their aspect ratios. They deserve it. * * We cast to double here, since the values may be large. */ if ((maxAspectX < 0) || (maxAspectY < 0) || (minAspectX < 0) || (minAspectY < 0) || (((double)minAspectX * (double)maxAspectY) > ((double)maxAspectX * (double)minAspectY))) { if (!*broken_cause) { broken_cause = "aspect ratio"; } fw->hints.flags &= ~PAspect; fvwm_msg( WARN, "GetWindowSizeHints", "The applicaton window (window id %#lx)\n" " \"%s\" has broken aspect ratio: " "%d/%d - %d/%d\n" " fvwm is ignoring this aspect ratio. ", FW_W(fw), fw->name.name, minAspectX, minAspectY, maxAspectX, maxAspectY); fvwm_msg_report_app(); } else { /* protect against overflow */ if ((maxAspectX > 65536) || (maxAspectY > 65536)) { double ratio = (double) maxAspectX / (double) maxAspectY; if (ratio > 1.0) { maxAspectX = 65536; maxAspectY = 65536 / ratio; } else { maxAspectX = 65536 * ratio; maxAspectY = 65536; } } if ((minAspectX > 65536) || (minAspectY > 65536)) { double ratio = (double) minAspectX / (double) minAspectY; if (ratio > 1.0) { minAspectX = 65536; minAspectY = 65536 / ratio; } else { minAspectX = 65536 * ratio; minAspectY = 65536; } } } #undef maxAspectX #undef maxAspectY #undef minAspectX #undef minAspectY } if (*broken_cause != 0) { fvwm_msg( WARN, "GetWindowSizeHints", "The application window (id %#lx)\n" " \"%s\" has broken size hints (%s).\n" " fvwm is ignoring those hints. " " hint override = %d, flags = %lx\n" " min_width = %d, min_height = %d, " "max_width = %d, max_height = %d\n" " width_inc = %d, height_inc = %d\n" " min_aspect = %d/%d, max_aspect = %d/%d\n" " base_width = %d, base_height = %d\n" " win_gravity = %d\n", FW_W(fw), fw->name.name, broken_cause, HAS_OVERRIDE_SIZE_HINTS(fw), orig_hints.flags, orig_hints.min_width, orig_hints.min_height, orig_hints.max_width, orig_hints.max_height, orig_hints.width_inc, orig_hints.height_inc, orig_hints.min_aspect.x, orig_hints.min_aspect.y, orig_hints.max_aspect.x, orig_hints.max_aspect.y, orig_hints.base_width, orig_hints.base_height, orig_hints.win_gravity); fvwm_msg_report_app(); } return; } /* * * Releases dynamically allocated space used to store window/icon names * */ void free_window_names(FvwmWindow *fw, Bool nukename, Bool nukeicon) { if (!fw) { return; } if (nukename) { if (fw->visible_name && fw->visible_name != fw->name.name && fw->visible_name != NoName) { free(fw->visible_name); } fw->visible_name = NoName; if (fw->name.name) { if (fw->icon_name.name == fw->name.name) { fw->icon_name.name = NoName; } if (fw->visible_icon_name == fw->name.name) { fw->visible_icon_name = fw->icon_name.name; } if (fw->name.name != NoName) { FlocaleFreeNameProperty(&(fw->name)); fw->visible_name = NULL; } } } if (nukeicon) { if (fw->visible_icon_name && fw->visible_icon_name != fw->name.name && fw->visible_icon_name != fw->icon_name.name && fw->visible_icon_name != NoName) { free(fw->visible_icon_name); } fw->visible_icon_name = NoName; if (fw->icon_name.name) { if ((fw->icon_name.name != fw->name.name) && fw->icon_name.name != NoName) { FlocaleFreeNameProperty(&(fw->icon_name)); fw->visible_icon_name = NULL; } } } return; } /* * * Handles destruction of a window * */ void destroy_window(FvwmWindow *fw) { /* Warning, this is also called by HandleUnmapNotify; if it ever needs * to look at the event, HandleUnmapNotify will have to mash the * UnmapNotify into a DestroyNotify. */ if (!fw) { return; } /* remove window style */ if (!IS_SCHEDULED_FOR_DESTROY(fw) && !DO_REUSE_DESTROYED(fw)) { style_id_t s_id; memset(&s_id, 0, sizeof(style_id_t)); SID_SET_WINDOW_ID(s_id, (XID)FW_W(fw)); SID_SET_HAS_WINDOW_ID(s_id, True); style_destroy_style(s_id); } /****** remove from window list ******/ /* if the window is sheduled fro destroy the window has been already * removed from list */ if (!IS_SCHEDULED_FOR_DESTROY(fw)) { /* first, remove the window from the list of all windows! */ if (fw->prev != NULL) { fw->prev->next = fw->next; } if (fw->next != NULL) { fw->next->prev = fw->prev; } fw->next = NULL; fw->prev = NULL; /****** also remove it from the stack ring ******/ /* * RBW - 11/13/1998 - new: have to unhook the stacking order chain also. There's always a prev and next, since this is a ring anchored on Scr.FvwmRoot */ remove_window_from_stack_ring(fw); } /****** check if we have to delay window destruction ******/ if ((Scr.flags.is_executing_complex_function || Scr.flags.is_executing_menu_function) && !DO_REUSE_DESTROYED(fw)) { if (IS_SCHEDULED_FOR_DESTROY(fw)) { return; } /* mark window for destruction */ SET_SCHEDULED_FOR_DESTROY(fw, 1); Scr.flags.is_window_scheduled_for_destroy = 1; /* this is necessary in case the application destroys the * client window and a new window is created with the same * window id */ delete_client_context(fw); XFlush(dpy); /* unmap the the window to fake that it was already removed */ if (IS_ICONIFIED(fw)) { if (FW_W_ICON_TITLE(fw)) { XUnmapWindow(dpy, FW_W_ICON_TITLE(fw)); } if (FW_W_ICON_PIXMAP(fw) != None) { XUnmapWindow(dpy, FW_W_ICON_PIXMAP(fw)); } } else { XUnmapWindow(dpy, FW_W_FRAME(fw)); } adjust_fvwm_internal_windows(fw); BroadcastPacket( M_DESTROY_WINDOW, 3, (long)FW_W(fw), (long)FW_W_FRAME(fw), (unsigned long)fw); EWMH_DestroyWindow(fw); focus_grab_buttons_on_layer(fw->layer); Scr.FWScheduledForDestroy = flist_append_obj( Scr.FWScheduledForDestroy, fw); return; } /****** unmap the frame ******/ XUnmapWindow(dpy, FW_W_FRAME(fw)); XFlush(dpy); /* already done above? */ if (!IS_SCHEDULED_FOR_DESTROY(fw)) { SET_SCHEDULED_FOR_DESTROY(fw, 1); adjust_fvwm_internal_windows(fw); BroadcastPacket( M_DESTROY_WINDOW, 3, (long)FW_W(fw), (long)FW_W_FRAME(fw), (unsigned long)fw); EWMH_DestroyWindow(fw); } focus_grab_buttons_on_layer(fw->layer); /****** destroy auxiliary windows ******/ destroy_auxiliary_windows(fw, True); /****** destroy icon ******/ destroy_icon_boxes(fw); destroy_icon(fw); /****** destroy mini icon ******/ #ifdef MINI_ICON destroy_mini_icon(fw); #endif /****** free strings ******/ free_window_names(fw, True, True); if (fw->style_name) { free(fw->style_name); fw->style_name = NULL; } if (fw->class.res_name && fw->class.res_name != NoResource) { XFree ((char *)fw->class.res_name); fw->class.res_name = NoResource; } if (fw->class.res_class && fw->class.res_class != NoClass) { XFree ((char *)fw->class.res_class); fw->class.res_class = NoClass; } if (fw->mwm_hints) { XFree((char *)fw->mwm_hints); fw->mwm_hints = NULL; } /****** free fonts ******/ destroy_window_font(fw); destroy_icon_font(fw); /****** free wmhints ******/ if (fw->wmhints) { XFree ((char *)fw->wmhints); fw->wmhints = NULL; } /****** free colormap windows ******/ if (fw->cmap_windows != (Window *)NULL) { XFree((void *)fw->cmap_windows); fw->cmap_windows = NULL; } /****** throw away the structure ******/ /* Recapture reuses this struct, so don't free it. */ if (!DO_REUSE_DESTROYED(fw)) { free((char *)fw); } /****** cleanup ******/ XFlush(dpy); return; } /* * * Procedure: * RestoreWithdrawnLocation * * Puts windows back where they were before fvwm took over * */ void RestoreWithdrawnLocation( FvwmWindow *fw, Bool is_restart_or_recapture, Window parent) { int w2,h2; unsigned int mask; XWindowChanges xwc; rectangle naked_g; rectangle unshaded_g; XSetWindowAttributes xswa; if (!fw) { return; } /* always get the latest size hints in case the application changed * the gravity and we do not yet know about it */ XSync(dpy, 0); GetWindowSizeHints(fw); SET_HAS_NEW_WM_NORMAL_HINTS(fw, 0); get_unshaded_geometry(fw, &unshaded_g); gravity_get_naked_geometry( fw->hints.win_gravity, fw, &naked_g, &unshaded_g); gravity_translate_to_northwest_geometry( fw->hints.win_gravity, fw, &naked_g, &naked_g); xwc.x = naked_g.x; xwc.y = naked_g.y; xwc.width = naked_g.width; xwc.height = naked_g.height; xwc.border_width = fw->attr_backup.border_width; mask = (CWX | CWY | CWWidth | CWHeight | CWBorderWidth); /* We can not assume that the window is currently on the screen. * Although this is normally the case, it is not always true. The * most common example is when the user does something in an * application which will, after some amount of computational delay, * cause the window to be unmapped, but then switches screens before * this happens. The XTranslateCoordinates call above will set the * window coordinates to either be larger than the screen, or negative. * This will result in the window being placed in odd, or even * unviewable locations when the window is remapped. The following * code forces the "relative" location to be within the bounds of the * display. * * gpw -- 11/11/93 * * Unfortunately, this does horrendous things during re-starts, * hence the "if (restart)" clause (RN) * * Also, fixed so that it only does this stuff if a window is more than * half off the screen. (RN) */ if (!is_restart_or_recapture) { /* Don't mess with it if its partially on the screen now */ if (unshaded_g.x < 0 || unshaded_g.y < 0 || unshaded_g.x >= Scr.MyDisplayWidth || unshaded_g.y >= Scr.MyDisplayHeight) { w2 = (unshaded_g.width >> 1); h2 = (unshaded_g.height >> 1); if ( xwc.x < -w2 || xwc.x > Scr.MyDisplayWidth - w2) { xwc.x = xwc.x % Scr.MyDisplayWidth; if (xwc.x < -w2) { xwc.x += Scr.MyDisplayWidth; } } if (xwc.y < -h2 || xwc.y > Scr.MyDisplayHeight - h2) { xwc.y = xwc.y % Scr.MyDisplayHeight; if (xwc.y < -h2) { xwc.y += Scr.MyDisplayHeight; } } } } /* restore initial backing store setting on window */ xswa.backing_store = fw->attr_backup.backing_store; XChangeWindowAttributes(dpy, FW_W(fw), CWBackingStore, &xswa); /* reparent to root window */ XReparentWindow( dpy, FW_W(fw), (parent == None) ? Scr.Root : parent, xwc.x, xwc.y); if (IS_ICONIFIED(fw) && !IS_ICON_SUPPRESSED(fw)) { if (FW_W_ICON_TITLE(fw)) { XUnmapWindow(dpy, FW_W_ICON_TITLE(fw)); } if (FW_W_ICON_PIXMAP(fw)) { XUnmapWindow(dpy, FW_W_ICON_PIXMAP(fw)); } } XConfigureWindow(dpy, FW_W(fw), mask, &xwc); if (!is_restart_or_recapture) { /* must be initial capture */ XFlush(dpy); } return; } /* * * Procedure: * Reborder - Removes fvwm border windows * */ void Reborder(void) { FvwmWindow *fw; /* put a border back around all windows */ MyXGrabServer (dpy); /* force reinstall */ InstallWindowColormaps (&Scr.FvwmRoot); /* RBW - 05/15/1998 * Grab the last window and work backwards: preserve stacking order on * restart. */ for (fw = get_prev_window_in_stack_ring(&Scr.FvwmRoot); fw != &Scr.FvwmRoot; fw = get_prev_window_in_stack_ring(fw)) { if (!IS_ICONIFIED(fw) && Scr.CurrentDesk != fw->Desk) { XMapWindow(dpy, FW_W(fw)); SetMapStateProp(fw, NormalState); } RestoreWithdrawnLocation (fw, True, Scr.Root); XUnmapWindow(dpy,FW_W_FRAME(fw)); XDestroyWindow(dpy,FW_W_FRAME(fw)); } MyXUngrabServer (dpy); FOCUS_RESET(); XFlush(dpy); return; } void CaptureAllWindows(const exec_context_t *exc, Bool is_recapture) { int i,j; unsigned int nchildren; Window root, parent, *children; initial_window_options_t win_opts; FvwmWindow *fw; MyXGrabServer(dpy); if (!XQueryTree(dpy, Scr.Root, &root, &parent, &children, &nchildren)) { MyXUngrabServer(dpy); return; } memset(&win_opts, 0, sizeof(win_opts)); win_opts.flags.do_override_ppos = 1; win_opts.flags.is_recapture = 1; if (!(Scr.flags.are_windows_captured)) /* initial capture? */ { evh_args_t ea; exec_context_changes_t ecc; XEvent e; /* weed out icon windows */ for (i = 0; i < nchildren; i++) { if (children[i]) { XWMHints *wmhintsp = XGetWMHints( dpy, children[i]); if (wmhintsp && wmhintsp->flags & IconWindowHint) { for (j = 0; j < nchildren; j++) { if (children[j] == wmhintsp->icon_window) { children[j] = None; break; } } } if (wmhintsp) { XFree ((char *) wmhintsp); } } } /* map all of the non-override, non-icon windows */ e.type = MapRequest; ecc.x.etrigger = &e; for (i = 0; i < nchildren; i++) { if (children[i] && MappedNotOverride(children[i], &win_opts)) { XUnmapWindow(dpy, children[i]); e.xmaprequest.window = children[i]; e.xmaprequest.parent = Scr.Root; ecc.w.fw = NULL; ecc.w.w = children[i]; ecc.w.wcontext = C_ROOT; ea.exc = exc_clone_context( exc, &ecc, ECC_ETRIGGER | ECC_FW | ECC_W | ECC_WCONTEXT); HandleMapRequestKeepRaised( &ea, None, NULL, &win_opts); exc_destroy_context(ea.exc); } } Scr.flags.are_windows_captured = 1; } else /* must be recapture */ { Window keep_on_top_win; Window parent_win; Window focus_w; FvwmWindow *t; t = get_focus_window(); focus_w = (t) ? FW_W(t) : None; hide_screen(True, &keep_on_top_win, &parent_win); /* reborder all windows */ for (i=0;inext) { ; } if (t) { SetFocusWindow(t, True, FOCUS_SET_FORCE); } } } if (nchildren > 0) { XFree((char *)children); } MyXUngrabServer(dpy); return; } /* ---------------------------- builtin commands --------------------------- */ void CMD_Recapture(F_CMD_ARGS) { do_recapture(F_PASS_ARGS, False); return; } void CMD_RecaptureWindow(F_CMD_ARGS) { do_recapture(F_PASS_ARGS, True); return; } fvwm-2.6.5.orig/fvwm/menudim.c0000644000175000017500000000351610545307407014415 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "menudim.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ /* * functions dealing with coordinates */ int menudim_middle_x_offset(struct MenuDimensions *mdim) { return MDIM_ITEM_X_OFFSET(*mdim) + MDIM_ITEM_WIDTH(*mdim) / 2; } /* hallo */ fvwm-2.6.5.orig/fvwm/ConfigFvwmDefaults0000644000175000017500000001351311705516565016277 0ustar vwcvwc# This file gets installed in the "datadir" during fvwm # installation. Do not remove or change this file. # # Created on 21/Mar/1999 by DanEspen (dje): # - FvwmDefaults file. Contains fvwm defaults, and enough to help out # the new user with no configuration file. # This picks up from where the builtin table in fvwm.c SetRCDefaults ends. # TA: 2012-01-02: Set the default cursor style to a dot, if FVWM is busy # in a PipeRead or Read operation. BusyCursor Read True CursorStyle Wait Dot # Set at least 2 root keys to bring up the builtin menu: Silent Key Help R A Popup MenuFvwmRoot Key F1 R A Popup MenuFvwmRoot # Ctrl-Alt-Escape for aborting Wait pause and ModuleSynchronous command Key Escape A MC EscapeFunc # Needed by the builtin WindowList command, this should match the manpage AddToFunc WindowListFunc + I Iconify off + I FlipFocus + I Raise + I WarpToWindow 5p 5p # Needed by the ewmh support AddToFunc EWMHActivateWindowFunc + I Iconify off + I Focus + I Raise # Also in the fvwm man page AddToFunc UrgencyFunc + I Iconify off + I FlipFocus + I Raise + I WarpToWindow 5p 5p AddToFunc UrgencyDoneFunc I Nop # Needed by modules which use session management # FSMExecFuncWithSessionManagment "module_sm_env" "action" "orig_sm_env" AddToFunc FSMExecFuncWithSessionManagment + I Setenv SESSION_MANAGER $0 + I $1 + I Setenv SESSION_MANAGER $2 # Default styles Style * LowerTransient, RaiseTransient, StackTransientParent Style * TileCascadePlacement, Title, MouseFocus Style * UseIconPosition, RightTitleRotatedCW, UseTitleDecorRotation Style * EWMHPlacementUseDynamicWorkingArea, EWMHMaximizeUseDynamicWorkingArea # Default styles for tear off menus Style fvwm_menu NoPPosition, NeverFocus, NoLenience, \ WindowListSkip, CirculateSkip # Alt-Tab: Key Tab A M WindowList Root c c NoDeskSort # Basic Mouse controls: Mouse 1 T A FuncFvwmRaiseLowerX Move Mouse 1 FS A FuncFvwmRaiseLowerX Resize Mouse 2 FST A FuncFvwmRaiseLowerX Move AddToFunc FuncFvwmRaiseLowerX + I Raise + M $0 + D Lower ###################### # BEGIN MENU BINDINGS # # # hard coded defaults that can not be deleted #Key Escape M A MenuClose #Key Return M A MenuSelectItem #Key Left M A MenuCursorLeft #Key Right M A MenuCursorRight #Key Up M A MenuMoveCursor -1 #Key Down M A MenuMoveCursor 1 #Mouse 1 M A MenuSelectItem # Normal bindings Silent Key Delete M A MenuClose Silent Key KP_Separator M A MenuClose Silent Key KP_Decimal M A MenuClose Silent Key Space M A MenuSelectItem Silent Key KP_Enter M A MenuSelectItem # move to last entry of menu ('More...' if this exists) and # try to enter the menu. Otherwise try to enter the current # submenu Silent Key Insert M A MenuEnterContinuation Silent Key KP_Insert M A MenuEnterContinuation Silent Key KP_0 M A MenuEnterContinuation Silent Key KP_Left M A MenuCursorLeft Silent Key KP_4 M A MenuCursorLeft Silent Key KP_Right M A MenuCursorRight Silent Key KP_6 M A MenuCursorRight #back Silent Key b M A MenuLeaveSubmenu #forward Silent Key f M A MenuEnterSubmenu Silent Key Page_Up M A MenuMoveCursor -5 Silent Key KP_Prior M A MenuMoveCursor -5 Silent Key KP_9 M A MenuMoveCursor -5 Silent Key Page_Down M A MenuMoveCursor +5 Silent Key KP_Next M A MenuMoveCursor +5 Silent Key KP_3 M A MenuMoveCursor +5 # Up Silent Key KP_Up M A MenuMoveCursor -1 Silent Key KP_8 M A MenuMoveCursor -1 #prior Silent Key p M A MenuMoveCursor -1 Silent Key Up M S MenuMoveCursor 0 0 Silent Key KP_Up M S MenuMoveCursor 0 0 Silent Key KP_8 M S MenuMoveCursor 0 0 #prior Silent Key p M S MenuMoveCursor 0 0 Silent Key Up M C MenuMoveCursor -5 Silent Key KP_Up M C MenuMoveCursor -5 Silent Key KP_8 M C MenuMoveCursor -5 #prior Silent Key p M C MenuMoveCursor -5 Silent Key Up M M MenuMoveCursor -1s Silent Key KP_Up M M MenuMoveCursor -1s Silent Key KP_8 M M MenuMoveCursor -1s #prior Silent Key p M M MenuMoveCursor -1s # Down Silent Key KP_Down M A MenuMoveCursor 1 Silent Key KP_2 M A MenuMoveCursor 1 #next Silent Key n M A MenuMoveCursor 1 Silent Key Down M S MenuMoveCursor 0 -1 Silent Key KP_Down M S MenuMoveCursor 0 -1 Silent Key KP_2 M S MenuMoveCursor 0 -1 #next Silent Key n M S MenuMoveCursor 0 -1 Silent Key Down M C MenuMoveCursor +5 Silent Key KP_Down M C MenuMoveCursor +5 Silent Key KP_2 M C MenuMoveCursor +5 #next Silent Key n M C MenuMoveCursor +5 Silent Key Down M M MenuMoveCursor +1s Silent Key KP_Down M M MenuMoveCursor +1s Silent Key KP_2 M M MenuMoveCursor +1s #next Silent Key n M M MenuMoveCursor +1s Silent Key Tab M A MenuMoveCursor +1 Silent Key Tab M C MenuMoveCursor +1s Silent Key Tab M MC MenuMoveCursor +5 Silent Key Tab M S MenuMoveCursor -1 Silent Key Tab M SM MenuMoveCursor -1 Silent Key Tab M SC MenuMoveCursor -1s Silent Key Tab M SMC MenuMoveCursor -5 Silent Key Home M A MenuMoveCursor 0 0 Silent Key KP_Home M A MenuMoveCursor 0 0 Silent Key KP_7 M A MenuMoveCursor 0 0 Silent Key End M A MenuMoveCursor 0 -1 Silent Key KP_End M A MenuMoveCursor 0 -1 Silent Key KP_1 M A MenuMoveCursor 0 -1 Silent Key BackSpace M A MenuTearOff Silent Key KP_Add M A MenuScroll 1 Silent Key KP_Subtract M A MenuScroll -1 # vi bindings Silent Key h M A MenuCursorLeft Silent Key l M A MenuCursorRight Silent Key k M A MenuMoveCursor -1 Silent Key k M C MenuMoveCursor -5 Silent Key j M A MenuMoveCursor 1 Silent Key j M C MenuMoveCursor 5 # emacs bindings Silent Key a M C MenuMoveCursor 0 0 Silent Key e M C MenuMoveCursor 0 -1 Silent Key b M C MenuMoveCursor -1 Silent Key f M C MenuMoveCursor +1 Silent Key Left M C MenuMoveCursor -1s Silent Key Right M C MenuMoveCursor +1s Silent Key g M C MenuClose # Mouse bindings Mouse 0 MI A MenuSelectItem Mouse 0 MTS A MenuLeaveSubmenu Silent Mouse 4 MIT A MenuScroll -1 Silent Mouse 5 MIT A MenuScroll +1 # NB: Only on title -- changes syntax for remapping the TearOff functionality Mouse 2 MT A MenuTearOff # # # END MENU BINDINGS #################### fvwm-2.6.5.orig/fvwm/decorations.h0000644000175000017500000000206010652052252015261 0ustar vwcvwc/* -*-c-*- */ #ifndef DECORATIONS_H #define DECORATIONS_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef enum { RQORIG_PROGRAM = False, RQORIG_PROGRAM_US = True, RQORIG_MODULE_INPUT, RQORIG_FVWM_USER, } request_origin_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void GetMwmHints(FvwmWindow *t); void GetOlHints(FvwmWindow *t); void SelectDecor(FvwmWindow *t, window_style *pstyle, short *buttons); Bool is_function_allowed( int function, char *action_string, const FvwmWindow *t, request_origin_t request_origin, Bool do_allow_override_mwm_hints); #endif /* DECORATIONS_H */ fvwm-2.6.5.orig/fvwm/expand.c0000644000175000017500000006017611705516565014251 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "libs/fvwmlib.h" #include "libs/Parse.h" #include "libs/Strings.h" #include "libs/ColorUtils.h" #include "libs/FScreen.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "functions.h" #include "misc.h" #include "move_resize.h" #include "screen.h" #include "geometry.h" #include "read.h" #include "virtual.h" #include "colorset.h" #include "schedule.h" #include "infostore.h" #include "libs/FGettext.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "libs/Fsvg.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ extern char const * const Fvwm_VersionInfo; /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static char *partial_function_vars[] = { "bg.cs", "desk.name", "fg.cs", "fgsh.cs", "gt.", "hilight.cs", "infostore.", "shadow.cs", NULL }; static char *function_vars[] = { "cond.rc", "cw.height", "cw.width", "cw.x", "cw.y", "desk.height", "desk.n", "desk.pagesx", "desk.pagesy", "desk.width", "func.context", "i.height", "i.width", "i.x", "i.y", "ip.height", "ip.width", "ip.x", "ip.y", "it.height", "it.width", "it.x", "it.y", "page.nx", "page.ny", "pointer.cx", "pointer.cy", "pointer.wx", "pointer.wy", "pointer.x", "pointer.y", "pointer.screen", "schedule.last", "schedule.next", "screen", "version.info", "version.line", "version.num", "vp.height", "vp.width", "vp.x", "vp.y", "w.class", "w.height", "w.iconname", "w.iconfile", "w.miniiconfile", "w.iconfile.svgopts", "w.miniiconfile.svgopts", "w.id", "w.name", "w.resource", "w.visiblename", "w.width", "w.x", "w.y", "w.desk", "w.layer", NULL }; enum { VAR_BG_CS, VAR_DESK_NAME, VAR_FG_CS, VAR_FGSH_CS, VAR_GT_, VAR_HILIGHT_CS, VAR_INFOSTORE_, VAR_SHADOW_CS } partial_extended_vars; enum { VAR_COND_RC, VAR_CW_HEIGHT, VAR_CW_WIDTH, VAR_CW_X, VAR_CW_Y, VAR_DESK_HEIGHT, VAR_DESK_N, VAR_DESK_PAGESX, VAR_DESK_PAGESY, VAR_DESK_WIDTH, VAR_FUNC_CONTEXT, VAR_I_HEIGHT, VAR_I_WIDTH, VAR_I_X, VAR_I_Y, VAR_IP_HEIGHT, VAR_IP_WIDTH, VAR_IP_X, VAR_IP_Y, VAR_IT_HEIGHT, VAR_IT_WIDTH, VAR_IT_X, VAR_IT_Y, VAR_PAGE_NX, VAR_PAGE_NY, VAR_POINTER_CX, VAR_POINTER_CY, VAR_POINTER_WX, VAR_POINTER_WY, VAR_POINTER_X, VAR_POINTER_Y, VAR_POINTER_SCREEN, VAR_SCHEDULE_LAST, VAR_SCHEDULE_NEXT, VAR_SCREEN, VAR_VERSION_INFO, VAR_VERSION_LINE, VAR_VERSION_NUM, VAR_VP_HEIGHT, VAR_VP_WIDTH, VAR_VP_X, VAR_VP_Y, VAR_W_CLASS, VAR_W_HEIGHT, VAR_W_ICONNAME, VAR_W_ICONFILE, VAR_W_MINIICONFILE, VAR_W_ICONFILE_SVGOPTS, VAR_W_MINIICONFILE_SVGOPTS, VAR_W_ID, VAR_W_NAME, VAR_W_RESOURCE, VAR_W_VISIBLE_NAME, VAR_W_WIDTH, VAR_W_X, VAR_W_Y, VAR_W_DESK, VAR_W_LAYER } extended_vars; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ int __eae_parse_range(char *input, int *lower, int *upper) { int rc; int n; *lower = 0; *upper = INT_MAX; if (*input == '*') { return 0; } if (!isdigit(*input)) { return -1; } rc = sscanf(input, "%d-%d%n", lower, upper, &n); if (rc < 2) { rc = sscanf(input, "%d%n", lower, &n); if (rc < 1) { /* not a positional argument */ return -1; } if (input[n] == '-') { /* $[n- */ n++; } else { /* $[n */ *upper = *lower; } } input += n; if (*input != 0) { /* trailing characters - not good */ return -1; } if (*upper < *lower) { /* the range is reverse - not good */ return -1; } return 0; } static signed int expand_args_extended( char *input, char *argument_string, char *output) { int rc; int lower; int upper; int i; size_t len; rc = __eae_parse_range(input, &lower, &upper); if (rc == -1) { return -1; } /* Skip to the start of the requested argument range */ if (lower > 0) { argument_string = SkipNTokens(argument_string, lower); } if (!argument_string) { /* replace with empty string */ return 0; } /* TODO: optimise handling of $[0] to $[9] which have already been * parsed */ for (i = lower, len = 0; i <= upper; i++) { char *token; size_t tlen; token = PeekToken(argument_string, &argument_string); if (token == NULL) { break; } /* copy the token */ if (i > lower) { if (output != NULL) { *output = ' '; output++; } len++; } tlen = strlen(token); if (output != NULL && tlen > 0) { memcpy(output, token, tlen); output += tlen; } len += tlen; } return (int)len; } static signed int expand_vars_extended( char *var_name, char *output, cond_rc_t *cond_rc, const exec_context_t *exc) { char *rest; char dummy[64] = "\0"; char *target = (output) ? output : dummy; int cs = -1; int n; int i; int l; int x; int y; Pixel pixel = 0; int val = -12345678; const char *string = NULL; char *allocated_string = NULL; char *quoted_string = NULL; Bool should_quote = False; Bool is_numeric = False; Bool is_target = False; Bool is_x; Window context_w = Scr.Root; FvwmWindow *fw = exc->w.fw; signed int len = -1; /* allow partial matches for *.cs, gt, ... etc. variables */ switch ((i = GetTokenIndex(var_name, partial_function_vars, -1, &rest))) { case VAR_FG_CS: case VAR_BG_CS: case VAR_HILIGHT_CS: case VAR_SHADOW_CS: case VAR_FGSH_CS: if (!isdigit(*rest) || (*rest == '0' && *(rest + 1) != 0)) { /* not a non-negative integer without leading zeros */ return -1; } if (sscanf(rest, "%d%n", &cs, &n) < 1) { return -1; } if (*(rest + n) != 0) { /* trailing characters */ return -1; } if (cs < 0) { return -1; } alloc_colorset(cs); switch (i) { case VAR_FG_CS: pixel = Colorset[cs].fg; break; case VAR_BG_CS: pixel = Colorset[cs].bg; break; case VAR_HILIGHT_CS: pixel = Colorset[cs].hilite; break; case VAR_SHADOW_CS: pixel = Colorset[cs].shadow; break; case VAR_FGSH_CS: pixel = Colorset[cs].fgsh; break; } is_target = True; len = pixel_to_color_string(dpy, Pcmap, pixel, target, False); goto GOT_STRING; case VAR_GT_: if (rest == NULL) { return -1; } string = _(rest); goto GOT_STRING; case VAR_INFOSTORE_: if (rest == NULL) return -1; if ((string = get_metainfo_value(rest)) == NULL) return -1; goto GOT_STRING; case VAR_DESK_NAME: if (sscanf(rest, "%d%n", &cs, &n) < 1) { return -1; } if (*(rest + n) != 0) { /* trailing characters */ return -1; } string = GetDesktopName(cs); if (string == NULL) { const char *ddn = _("Desk"); allocated_string = (char *)safemalloc(19 + strlen(ddn)); sprintf(allocated_string, "%s %i", ddn, cs); string = allocated_string; } goto GOT_STRING; default: break; } /* only exact matches for all other variables */ switch ((i = GetTokenIndex(var_name, function_vars, 0, &rest))) { case VAR_DESK_N: is_numeric = True; val = Scr.CurrentDesk; break; case VAR_DESK_WIDTH: is_numeric = True; val = Scr.VxMax + Scr.MyDisplayWidth; break; case VAR_DESK_HEIGHT: is_numeric = True; val = Scr.VyMax + Scr.MyDisplayHeight; break; case VAR_DESK_PAGESX: is_numeric = True; val = (int)(Scr.VxMax / Scr.MyDisplayWidth) + 1; break; case VAR_DESK_PAGESY: is_numeric = True; val = (int)(Scr.VyMax / Scr.MyDisplayHeight) + 1; break; case VAR_VP_X: is_numeric = True; val = Scr.Vx; break; case VAR_VP_Y: is_numeric = True; val = Scr.Vy; break; case VAR_VP_WIDTH: is_numeric = True; val = Scr.MyDisplayWidth; break; case VAR_VP_HEIGHT: is_numeric = True; val = Scr.MyDisplayHeight; break; case VAR_PAGE_NX: is_numeric = True; val = (int)(Scr.Vx / Scr.MyDisplayWidth); break; case VAR_PAGE_NY: is_numeric = True; val = (int)(Scr.Vy / Scr.MyDisplayHeight); break; case VAR_W_ID: if (fw && !IS_EWMH_DESKTOP(FW_W(fw))) { is_target = True; sprintf(target, "0x%x", (int)FW_W(fw)); } break; case VAR_W_NAME: if (fw && !IS_EWMH_DESKTOP(FW_W(fw))) { string = fw->name.name; should_quote = True; } break; case VAR_W_ICONNAME: if (fw && !IS_EWMH_DESKTOP(FW_W(fw))) { string = fw->icon_name.name; should_quote = True; } break; case VAR_W_ICONFILE: case VAR_W_MINIICONFILE: if (fw && !IS_EWMH_DESKTOP(FW_W(fw))) { char *t; t = (i == VAR_W_ICONFILE) ? fw->icon_bitmap_file : fw->mini_pixmap_file; /* expand the path if possible */ allocated_string = PictureFindImageFile(t, NULL, R_OK); if (allocated_string == NULL) { string = t; } else if (USE_SVG && *allocated_string == ':' && (string = strchr(allocated_string + 1, ':'))) { string++; } else { string = allocated_string; } } break; case VAR_W_ICONFILE_SVGOPTS: case VAR_W_MINIICONFILE_SVGOPTS: if (fw && !IS_EWMH_DESKTOP(FW_W(fw))) { char *t; if (!USE_SVG) { return -1; } t = (i == VAR_W_ICONFILE_SVGOPTS) ? fw->icon_bitmap_file : fw->mini_pixmap_file; /* expand the path if possible */ allocated_string = PictureFindImageFile(t, NULL, R_OK); string = allocated_string; if (string && *string == ':' && (t = strchr(string + 1, ':'))) { *t = 0; } else { string = ""; } } break; case VAR_W_CLASS: if (fw && !IS_EWMH_DESKTOP(FW_W(fw))) { string = fw->class.res_class; should_quote = True; } break; case VAR_W_RESOURCE: if (fw && !IS_EWMH_DESKTOP(FW_W(fw))) { string = fw->class.res_name; should_quote = True; } break; case VAR_W_VISIBLE_NAME: if (fw && !IS_EWMH_DESKTOP(FW_W(fw))) { string = fw->visible_name; should_quote = True; } break; case VAR_W_X: case VAR_W_Y: case VAR_W_WIDTH: case VAR_W_HEIGHT: if (!fw || IS_ICONIFIED(fw) || IS_EWMH_DESKTOP(FW_W(fw))) { return -1; } else { rectangle g; is_numeric = True; get_unshaded_geometry(fw, &g); switch (i) { case VAR_W_X: val = g.x; break; case VAR_W_Y: val = g.y; break; case VAR_W_WIDTH: val = g.width; break; case VAR_W_HEIGHT: val = g.height; break; default: return -1; } } break; case VAR_CW_X: case VAR_CW_Y: case VAR_CW_WIDTH: case VAR_CW_HEIGHT: if (!fw || IS_ICONIFIED(fw) || IS_EWMH_DESKTOP(FW_W(fw))) { return -1; } else { rectangle g; is_numeric = True; get_client_geometry(fw, &g); switch (i) { case VAR_CW_X: val = g.x; break; case VAR_CW_Y: val = g.y; break; case VAR_CW_WIDTH: val = g.width; break; case VAR_CW_HEIGHT: val = g.height; break; default: return -1; } } break; case VAR_IT_X: case VAR_IT_Y: case VAR_IT_WIDTH: case VAR_IT_HEIGHT: if (!fw || IS_EWMH_DESKTOP(FW_W(fw))) { return -1; } else { rectangle g; if (get_visible_icon_title_geometry(fw, &g) == False) { return -1; } is_numeric = True; switch (i) { case VAR_IT_X: val = g.x; break; case VAR_IT_Y: val = g.y; break; case VAR_IT_WIDTH: val = g.width; break; case VAR_IT_HEIGHT: val = g.height; break; default: return -1; } } break; case VAR_IP_X: case VAR_IP_Y: case VAR_IP_WIDTH: case VAR_IP_HEIGHT: if (!fw || IS_EWMH_DESKTOP(FW_W(fw))) { return -1; } else { rectangle g; if (get_visible_icon_picture_geometry(fw, &g) == False) { return -1; } is_numeric = True; switch (i) { case VAR_IP_X: val = g.x; break; case VAR_IP_Y: val = g.y; break; case VAR_IP_WIDTH: val = g.width; break; case VAR_IP_HEIGHT: val = g.height; break; default: return -1; } } break; case VAR_I_X: case VAR_I_Y: case VAR_I_WIDTH: case VAR_I_HEIGHT: if (!fw || IS_EWMH_DESKTOP(FW_W(fw))) { return -1; } else { rectangle g; if (get_visible_icon_geometry(fw, &g) == False) { return -1; } is_numeric = True; switch (i) { case VAR_I_X: val = g.x; break; case VAR_I_Y: val = g.y; break; case VAR_I_WIDTH: val = g.width; break; case VAR_I_HEIGHT: val = g.height; break; default: return -1; } } break; case VAR_W_DESK: if (!fw || IS_EWMH_DESKTOP(FW_W(fw))) { return -1; } is_numeric = True; if (is_window_sticky_across_desks(fw)) { val = Scr.CurrentDesk; } else { val = fw->Desk; } break; case VAR_W_LAYER: if (!fw || IS_EWMH_DESKTOP(FW_W(fw))) { return -1; } is_numeric = True; val = fw->layer; break; case VAR_SCREEN: is_numeric = True; val = Scr.screen; break; case VAR_SCHEDULE_LAST: is_numeric = True; val = squeue_get_last_id(); break; case VAR_SCHEDULE_NEXT: is_numeric = True; val = squeue_get_next_id(); break; case VAR_COND_RC: if (cond_rc == NULL) { return -1; } switch (cond_rc->rc) { case COND_RC_OK: case COND_RC_NO_MATCH: case COND_RC_ERROR: case COND_RC_BREAK: val = (int)(cond_rc->rc); break; default: return -1; } is_numeric = True; break; case VAR_POINTER_X: case VAR_POINTER_Y: if (is_numeric == False) { is_numeric = True; context_w = Scr.Root; } /* fall through */ case VAR_POINTER_WX: case VAR_POINTER_WY: if (is_numeric == False) { if (!fw || IS_ICONIFIED(fw) || IS_EWMH_DESKTOP(FW_W(fw))) { return -1; } is_numeric = True; context_w = FW_W_FRAME(fw); } /* fall through */ case VAR_POINTER_CX: case VAR_POINTER_CY: if (is_numeric == False) { if (!fw || IS_ICONIFIED(fw) || IS_SHADED(fw) || IS_EWMH_DESKTOP(FW_W(fw))) { return -1; } is_numeric = True; context_w = FW_W(fw); } is_x = False; switch (i) { case VAR_POINTER_X: case VAR_POINTER_WX: case VAR_POINTER_CX: is_x = True; } if (FQueryPointer(dpy, context_w, &JunkRoot, &JunkChild, &JunkX, &JunkY, &x, &y, &JunkMask) == False) { /* pointer is on a different screen, don't expand */ return -1; } val = (is_x) ? x : y; break; case VAR_POINTER_SCREEN: is_numeric = True; FQueryPointer(dpy, context_w, &JunkRoot, &JunkChild, &JunkX, &JunkY, &x, &y, &JunkMask); val = FScreenOfPointerXY(x, y); break; case VAR_VERSION_NUM: string = VERSION; break; case VAR_VERSION_INFO: string = VERSIONINFO; break; case VAR_VERSION_LINE: string = Fvwm_VersionInfo; break; case VAR_FUNC_CONTEXT: is_target = True; target[0] = wcontext_wcontext_to_char(exc->w.wcontext); target[1] = '\0'; break; default: /* unknown variable - try to find it in the environment */ string = getenv(var_name); if (!string) { /* Replace it with unexpanded variable. This is needed * since var_name might have been expanded */ l = strlen(var_name) + 3; if (output) { strcpy(output, "$["); strcpy(output + 2, var_name); output[l - 1] = ']'; output[l] = 0; } return l; } } GOT_STRING: if (is_numeric) { is_target = True; sprintf(target, "%d", val); } if (is_target) { string = target; } else { if (!string) { return -1; } if (output) { strcpy(output, string); } } if (len < 0) { len = strlen(string); } if (should_quote) { quoted_string = (char *)safemalloc(len * 2 + 3); len = QuoteString(quoted_string, string) - quoted_string; if (output) { strcpy(output, quoted_string); } free(quoted_string); } if (allocated_string) { free(allocated_string); } return len; } /* ---------------------------- interface functions ------------------------ */ char *expand_vars( char *input, char *arguments[], Bool addto, Bool ismod, cond_rc_t *cond_rc, const exec_context_t *exc) { int l, i, l2, n, k, j, m; int xlen, xlevel; Bool name_has_dollar; char *out; char *var; const char *string = NULL; Bool is_string = False; FvwmWindow *fw = exc->w.fw; l = strlen(input); l2 = l; if (input[0] == '+' && Scr.last_added_item.type == ADDED_FUNCTION) { addto = 1; } /* Calculate best guess at length of expanded string */ i = 0; while (i < l) { if (input[i] == '$' && (!ismod || !isalpha(input[i + 1]))) { switch (input[i + 1]) { case '$': /* skip the second $, it is not a part of * variable */ i++; break; case '[': /* extended variables */ m = i + 2; var = &input[m]; xlevel = 1; name_has_dollar = False; while (m < l && xlevel && input[m]) { /* handle nested variables */ if (input[m] == ']') { xlevel--; } else if (input[m] == '[') { xlevel++; } else if (input[m] == '$') { name_has_dollar = True; } if (xlevel) { m++; } } if (input[m] == ']') { input[m] = 0; /* handle variable name */ k = strlen(var); if (addto) { i += k + 2; input[m] = ']'; break; } if (name_has_dollar) { var = expand_vars( var, arguments, addto, ismod, cond_rc, exc); } xlen = expand_args_extended( var, arguments ? arguments[0] : NULL, NULL); if (xlen < 0) { xlen = expand_vars_extended( var, NULL, cond_rc, exc); } if (name_has_dollar) { free(var); } if (xlen >= 0) { l2 += xlen - (k + 2); } i += k + 2; input[m] = ']'; } break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '*': if (input[i + 1] == '*') { n = 0; } else { n = input[i + 1] - '0' + 1; } if (arguments[n] != NULL) { l2 += strlen(arguments[n]) - 2; i++; } break; case '.': string = get_current_read_dir(); break; case 'w': case 'd': case 'x': case 'y': l2 += 16; i++; break; case 'c': case 'r': case 'n': if (fw && !IS_EWMH_DESKTOP(FW_W(fw))) { switch(input[i + 1]) { case 'c': if (fw->class.res_class && fw->class.res_class[0]) { string = fw->class. res_class; } break; case 'r': if (fw->class.res_name && fw->class.res_name[0]) { string = fw->class. res_name; } break; case 'n': if (fw->name.name && fw->name.name[0]) { string = fw->name.name; } break; } } break; case 'v': if (fw && !IS_EWMH_DESKTOP(FW_W(fw))) { switch(input[i + 1]) { case 'v': if(fw->visible_name) { string = fw->visible_name; } break; } } if (Fvwm_VersionInfo) { l2 += strlen(Fvwm_VersionInfo) + 2; } break; } if (string) { for (k = 0; string[k] != 0; k++, l2++) { if (string[k] == '\'') { l2++; } } string = NULL; } } i++; } /* Actually create expanded string */ i = 0; out = safemalloc(l2 + 1); j = 0; while (i < l) { if (input[i] == '$' && (!ismod || !isalpha(input[i + 1]))) { switch (input[i + 1]) { case '[': /* extended variables */ if (addto) { /* Don't expand these in an 'AddToFunc' * command */ out[j++] = input[i]; break; } m = i + 2; var = &input[m]; xlevel = 1; name_has_dollar = False; while (m < l && xlevel && input[m]) { /* handle nested variables */ if (input[m] == ']') { xlevel--; } else if (input[m] == '[') { xlevel++; } else if (input[m] == '$') { name_has_dollar = True; } if (xlevel) { m++; } } if (input[m] == ']') { input[m] = 0; /* handle variable name */ k = strlen(var); if (name_has_dollar) { var = expand_vars( var, arguments, addto, ismod, cond_rc, exc); } xlen = expand_args_extended( var, arguments ? arguments[0] : NULL, &out[j]); if (xlen < 0) { xlen = expand_vars_extended( var, &out[j], cond_rc, exc); } if (name_has_dollar) { free(var); } input[m] = ']'; if (xlen >= 0) { j += xlen; i += k + 2; } else { /* copy the whole string in * square brackets */ for ( ; i <= m; i++, j++) { out[j] = input[i]; } i--; } } else { out[j++] = input[i]; } break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '*': if (input[i + 1] == '*') { n = 0; } else { n = input[i + 1] - '0' + 1; } if (arguments[n] != NULL) { for (k = 0; arguments[n][k]; k++) { out[j++] = arguments[n][k]; } i++; } else if (addto == 1) { out[j++] = '$'; } else { i++; } break; case '.': string = get_current_read_dir(); is_string = True; break; case 'w': if (fw && !IS_EWMH_DESKTOP(FW_W(fw))) { fvwm_msg(OLD, "expand_vars", "Use $[w.id] instead of $w"); sprintf(&out[j], "0x%x", (int)FW_W(fw)); } else { sprintf(&out[j], "$w"); } j += strlen(&out[j]); i++; break; case 'd': fvwm_msg(OLD, "expand_vars", "Use $[desk.n] instead of $d"); sprintf(&out[j], "%d", Scr.CurrentDesk); j += strlen(&out[j]); i++; break; case 'x': fvwm_msg(OLD, "expand_vars", "Use $[vp.x] instead of $x"); sprintf(&out[j], "%d", Scr.Vx); j += strlen(&out[j]); i++; break; case 'y': fvwm_msg(OLD, "expand_vars", "Use $[vp.y] instead of $y"); sprintf(&out[j], "%d", Scr.Vy); j += strlen(&out[j]); i++; break; case 'c': case 'r': case 'n': if (fw && !IS_EWMH_DESKTOP(FW_W(fw))) { switch(input[i + 1]) { case 'c': fvwm_msg(OLD, "expand_vars", "Use $[w.class] " "instead of $c"); if (fw->class.res_class && fw->class.res_class[0]) { string = fw->class. res_class; } break; case 'r': fvwm_msg(OLD, "expand_vars", "Use $[w.resource] " "instead of $r"); if (fw->class.res_name && fw->class.res_name[0]) { string = fw->class. res_name; } break; case 'n': fvwm_msg(OLD, "expand_vars", "Use $[w.name] " "instead of $n"); if (fw->name.name && fw->name.name[0]) { string = fw->name.name; } break; } } is_string = True; break; case 'v': fvwm_msg(OLD, "expand_vars", "Use $[version.line] instead of $v"); sprintf(&out[j], "%s", (Fvwm_VersionInfo) ? Fvwm_VersionInfo : ""); j += strlen(&out[j]); i++; break; case '$': out[j++] = '$'; i++; break; default: out[j++] = input[i]; break; } /* switch */ if (is_string && string) { j = QuoteString(&out[j], string) - out; string = NULL; is_string = False; i++; } else if (is_string) { out[j++] = '$'; is_string = False; } } /* if '$' */ else { out[j++] = input[i]; } i++; } out[j] = 0; return out; } fvwm-2.6.5.orig/fvwm/ewmh.h0000644000175000017500000000476210552172642013727 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2001 Olivier Chapuis */ #ifndef _EWMH_ #define _EWMH_ /* Extended window manager hints support */ /* ewmh_conf.c */ Bool EWMH_BugOpts(char *opt, Bool toggle); void CMD_EwmhNumberOfDesktops(F_CMD_ARGS); void CMD_EwmhBaseStrut(F_CMD_ARGS); Bool EWMH_CMD_Style(char *token, window_style *ptmpstyle, int on); /* for maximize and placement ewmh style */ #define EWMH_IGNORE_WORKING_AREA 0 #define EWMH_USE_WORKING_AREA 1 #define EWMH_USE_DYNAMIC_WORKING_AREA 2 #define EWMH_WORKING_AREA_MASK 3 /* Extended window manager hints support */ #include void EWMH_SetCurrentDesktop(void); void EWMH_SetNumberOfDesktops(void); void EWMH_SetDesktopViewPort(void); void EWMH_SetDesktopGeometry(void); void EWMH_SetActiveWindow(Window w); void EWMH_SetWMDesktop(FvwmWindow *fw); void EWMH_SetWMState(FvwmWindow *fw, Bool do_restore); int EWMH_IsKdeSysTrayWindow(Window w); void EWMH_ManageKdeSysTray(Window w, int type); void EWMH_SetClientList(void); void EWMH_SetClientListStacking(void); void EWMH_UpdateWorkArea(void); void EWMH_GetWorkAreaIntersection( FvwmWindow *fw, int *x, int *y, int *w, int *h, int type); float EWMH_GetBaseStrutIntersection( int x11, int y11, int x12, int y12, Bool use_percent); float EWMH_GetStrutIntersection( int x11, int y11, int x12, int y12, Bool use_percent); void EWMH_SetFrameStrut(FvwmWindow *fw); void EWMH_SetAllowedActions(FvwmWindow *fw); void EWMH_GetIconGeometry(FvwmWindow *fw, rectangle *icon_rect); void EWMH_GetStyle(FvwmWindow *fw, window_style *style); void EWMH_WindowInit(FvwmWindow *fw); void EWMH_RestoreInitialStates(FvwmWindow *fw, int event_type); void EWMH_DestroyWindow(FvwmWindow *fw); void EWMH_WindowDestroyed(void); void EWMH_Init(void); void EWMH_ExitStuff(void); /* ewmh_conf.c */ /* ewmh_events.c */ Bool EWMH_ProcessClientMessage(const exec_context_t *exc); void EWMH_ProcessPropertyNotify(const exec_context_t *exc); /* ewmh_icon.c */ void EWMH_DeleteWmIcon(FvwmWindow *fw, Bool mini_icon, Bool icon); int EWMH_SetIconFromWMIcon( FvwmWindow *fw, CARD32 *list, int size, Bool is_mini_icon); void EWMH_DoUpdateWmIcon(FvwmWindow *fw, Bool mini_icon, Bool icon); /* ewmh_name.c */ void EWMH_SetVisibleName(FvwmWindow *fw, Bool is_icon_name); int EWMH_WMName( FvwmWindow *fw, XEvent *ev, window_style *style, unsigned long any); int EWMH_WMIconName( FvwmWindow *fw, XEvent *ev, window_style *style, unsigned long any); void EWMH_SetDesktopNames(void); void EWMH_fullscreen(FvwmWindow *fw); #endif /* _EWMH_ */ fvwm-2.6.5.orig/fvwm/update.h0000644000175000017500000000371011333351742014237 0ustar vwcvwc/* -*-c-*- */ #ifndef _UPDATE_ #define _UPDATE_ /* Ipmortant not: All the flags below must have a positive syntax. If a flag * is set, this indicates that something has to happen with the window. */ typedef struct { unsigned do_broadcast_focus : 1; unsigned do_redecorate : 1; unsigned do_redecorate_transient : 1; unsigned do_redraw_decoration : 1; unsigned do_redraw_icon : 1; unsigned do_refresh : 1; unsigned do_resize_window : 1; unsigned do_setup_focus_policy : 1; unsigned do_setup_frame : 1; unsigned do_update_cr_motion_method : 1; unsigned do_update_ewmh_allowed_actions : 1; unsigned do_update_ewmh_icon : 1; unsigned do_update_ewmh_mini_icon : 1; unsigned do_update_ewmh_stacking_hints : 1; unsigned do_update_ewmh_state_hints : 1; unsigned do_update_frame_attributes : 1; unsigned do_update_gnome_styles : 1; unsigned do_update_icon : 1; unsigned do_update_icon_background_cs : 1; unsigned do_update_icon_boxes : 1; unsigned do_update_icon_font : 1; unsigned do_update_icon_placement : 1; unsigned do_update_icon_size_limits : 1; unsigned do_update_icon_title : 1; unsigned do_update_icon_title_cs : 1; unsigned do_update_icon_title_cs_hi : 1; unsigned do_update_mini_icon : 1; unsigned do_update_layer : 1; unsigned do_update_modules_flags : 1; unsigned do_update_placement_penalty : 1; unsigned do_update_rotated_title : 1; unsigned do_update_stick : 1; unsigned do_update_stick_icon : 1; unsigned do_update_title_dir : 1; unsigned do_update_title_text_dir : 1; unsigned do_update_visible_icon_name : 1; unsigned do_update_visible_window_name : 1; unsigned do_update_window_color : 1; unsigned do_update_window_color_hi : 1; unsigned do_update_window_font : 1; unsigned do_update_window_font_height : 1; unsigned do_update_window_grabs : 1; unsigned do_update_working_area : 1; } update_win; void destroy_scheduled_windows(void); void apply_decor_change(FvwmWindow *fw); void flush_window_updates(void); #endif /* _UPDATE_ */ fvwm-2.6.5.orig/fvwm/colorset.c0000644000175000017500000011746111366064172014617 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2002 the late Joey Shutup. * * http://www.streetmap.co.uk/streetmap.dll?postcode2map?BS24+9TZ * * No guarantees or warranties or anything are provided or implied in any way * whatsoever. Use this program at your own risk. Permission to use this * program for any purpose is given, as long as the copyright is kept intact. */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "libs/fvwmlib.h" #include "libs/Parse.h" #include "libs/PictureBase.h" #include "libs/FShape.h" #include "libs/ColorUtils.h" #include "libs/Picture.h" #include "libs/PictureUtils.h" #include "libs/Graphics.h" #include "libs/PictureGraphics.h" #include "libs/FRenderInit.h" #include "libs/Strings.h" #include "libs/Grab.h" #include "colorset.h" #include "externs.h" #include "fvwm.h" #include "cursor.h" #include "functions.h" #include "commands.h" #include "misc.h" #include "screen.h" #include "module_interface.h" #include "execcontext.h" #include "builtins.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ extern int nColorsets; /* in libs/Colorset.c */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* When fvwm destroys pixmaps it puts them on a list and only destroys them * after some period of inactivity. This is necessary because changing colorset * options rapidly may result in a module redrawing itself due to the first * change while the second change is happening. If the module renders something * with the colorset affected by the second change there is a chance it may * reference pixmaps that FvwmTheme has destroyed, bad things would happen */ struct junklist { struct junklist *prev; Pixmap pixmap; }; struct root_pic { Pixmap pixmap; Pixmap old_pixmap; int width; int height; }; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static char *black = "black"; static char *white = "white"; static char *gray = "gray"; static struct junklist *junk = NULL; static Bool cleanup_scheduled = False; static struct root_pic root_pic = {None, None, 0, 0}; static char *csetopts[] = { "Foreground", "Fore", "fg", "Background", "Back", "bg", "Hilight", "Hilite", "hi", "Shadow", "Shade", "sh", "fgsh", "fg_alpha", "fgAlpha", /* these strings are used inside the cases in the switch below! */ "Pixmap", "TiledPixmap", "AspectPixmap", /* these strings are used inside the cases in the switch below! */ "Shape", "TiledShape", "AspectShape", /* switch off pixmaps and gradients */ "Plain", /* switch off shape */ "NoShape", /* Make the background transparent, copies the root window background */ "Transparent", "RootTransparent", /* tint for the Pixmap or the gradient */ "Tint", "PixmapTint", /* ~ Tint */ "ImageTint", /* ~ Tint */ "TintMask", /* ~ Tint (backward compatibility) */ "NoTint", /* ~ Tint without argument */ "fgTint", "bgTint", /* Dither the Pixmap or the gradient */ "Dither", "NoDither", /* alpha for the Pixmap or the gradient */ "Alpha", "PixmapAlpha", /* ~ Alpha */ "ImageAlpha", /* ~ Alpha */ /* Icon stuff */ "DitherIcon", "NoDitherIcon", "IconTint", "NoIconTint", "IconAlpha", NULL }; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static Pixmap get_root_pixmap(Atom prop) { Atom type; int format; unsigned long length, after; unsigned char *reteval = NULL; int ret; Pixmap pix = None; ret = XGetWindowProperty( dpy, Scr.Root, prop, 0L, 1L, False, XA_PIXMAP, &type, &format, &length, &after, &reteval); if ( ret == Success && type == XA_PIXMAP && format == 32 && length == 1 && after == 0) { pix = (Pixmap)(*(long *)reteval); } if (reteval) { XFree(reteval); } return pix; } void update_root_pixmap(Atom prop) { static Atom a_rootpix = None; int w = 0; int h = 0; XID dummy; Pixmap pix; if (a_rootpix == None) { a_rootpix = XInternAtom(dpy,"_XROOTPMAP_ID", False); } XSync(dpy, False); if (prop != 0) { pix = get_root_pixmap(prop); if (pix && !XGetGeometry( dpy, pix, &dummy, (int *)&dummy, (int *)&dummy, (unsigned int *)&w, (unsigned int *)&h, (unsigned int *)&dummy, (unsigned int *)&dummy)) { pix = None; } } else { pix = get_root_pixmap(a_rootpix); if (pix && !XGetGeometry( dpy, pix, &dummy, (int *)&dummy, (int *)&dummy, (unsigned int *)&w, (unsigned int *)&h, (unsigned int *)&dummy, (unsigned int *)&dummy)) { pix = None; } } root_pic.pixmap = pix; root_pic.width = w; root_pic.height = h; #if 0 fprintf(stderr,"Get New Root Pixmap: 0x%lx %i,%i\n", root_pic.pixmap, w, h); #endif } static void add_to_junk(Pixmap pixmap) { struct junklist *oldjunk = junk; junk = (struct junklist *)safemalloc(sizeof(struct junklist)); junk->prev = oldjunk; junk->pixmap = pixmap; if (!cleanup_scheduled) { const exec_context_t *exc; exc = exc_create_null_context(); CMD_Schedule(NULL, exc, "3000 CleanupColorsets"); exc_destroy_context(exc); cleanup_scheduled = True; } return; } static char *get_simple_color( char *string, char **color, colorset_t *cs, int supplied_color, int special_flag, char *special_string) { char *rest; if (*color) { free(*color); *color = NULL; } rest = GetNextToken(string, color); if (*color) { if (special_string && StrEquals(*color, special_string)) { free(*color); *color = NULL; cs->color_flags |= special_flag; cs->color_flags &= ~supplied_color; } else { cs->color_flags |= supplied_color; cs->color_flags &= ~special_flag; } } else { cs->color_flags &= ~(supplied_color | special_flag); } return rest; } static void SafeDestroyPicture(Display *dpy, FvwmPicture *picture) { /* have to subvert destroy picture so that it doesn't free pixmaps, * these are added to the junk list to be cleaned up after a timeout */ if (picture->count < 2) { if (picture->picture) { add_to_junk(picture->picture); picture->picture = None; } if (picture->mask) { add_to_junk(picture->mask); picture->mask = None; } if (picture->alpha) { add_to_junk(picture->alpha); picture->alpha = None; } } /* all that this will now do is free the colors and the name */ PDestroyFvwmPicture(dpy, picture); return; } static void free_colorset_background(colorset_t *cs, Bool do_free_args) { if (cs->picture != NULL) { if (cs->picture->picture != cs->pixmap) { add_to_junk(cs->pixmap); } SafeDestroyPicture(dpy, cs->picture); cs->picture = NULL; cs->pixmap = None; cs->alpha_pixmap = None; /* alaways equal to picture->alpha */ } if (cs->pixmap && cs->pixmap != ParentRelative && cs->pixmap != root_pic.pixmap && cs->pixmap != root_pic.old_pixmap) { add_to_junk(cs->pixmap); } cs->pixmap = None; if (cs->mask) { add_to_junk(cs->mask); cs->mask = None; } if (cs->alpha_pixmap) { add_to_junk(cs->alpha_pixmap); cs->alpha_pixmap = None; } if (cs->pixels && cs->nalloc_pixels) { PictureFreeColors( dpy, Pcmap, cs->pixels, cs->nalloc_pixels, 0, False); free(cs->pixels); cs->pixels = NULL; cs->nalloc_pixels = 0; } if (do_free_args) { if (cs->pixmap_args != NULL) { free(cs->pixmap_args); cs->pixmap_args = NULL; } if (cs->gradient_args != NULL) { free(cs->gradient_args); cs->gradient_args = NULL; } cs->is_maybe_root_transparent = False; cs->pixmap_type = 0; } } static void reset_cs_pixmap(colorset_t *cs, GC gc) { if (Pdepth == cs->picture->depth) { XCopyArea(dpy, cs->picture->picture, cs->pixmap, gc, 0, 0, cs->width, cs->height, 0, 0); } else { XCopyPlane(dpy, cs->picture->picture, cs->pixmap, gc, 0, 0, cs->width, cs->height, 0, 0, 1); } return; } static void parse_pixmap( Window win, GC gc, colorset_t *cs, Bool *pixmap_is_a_bitmap) { static char *name = "parse_colorset(pixmap)"; FvwmPictureAttributes fpa; /* dither */ fpa.mask = 0; if (cs->dither) { fpa.mask = FPAM_DITHER; } /* read filename */ if (!cs->pixmap_args) { return; } /* load the file */ cs->picture = PCacheFvwmPicture(dpy, win, NULL, cs->pixmap_args, fpa); if (cs->picture == NULL) { fvwm_msg(ERR, name, "can't load picture %s", cs->pixmap_args); return; } if (cs->picture->depth != Pdepth) { *pixmap_is_a_bitmap = True; cs->pixmap = None; /* build cs->pixmap later */ } /* copy the picture pixmap into the public structure */ cs->width = cs->picture->width; cs->height = cs->picture->height; cs->alpha_pixmap = cs->picture->alpha; if (!*pixmap_is_a_bitmap) { cs->pixmap = XCreatePixmap(dpy, win, cs->width, cs->height, Pdepth); XSetClipMask(dpy, gc, cs->picture->mask); XCopyArea(dpy, cs->picture->picture, cs->pixmap, gc, 0, 0, cs->width, cs->height, 0, 0); XSetClipMask(dpy, gc, None); } if (cs->pixmap) { if (cs->picture->mask != None) { /* make an inverted copy of the mask */ cs->mask = XCreatePixmap(dpy, win, cs->width, cs->height, 1); if (cs->mask) { XCopyArea(dpy, cs->picture->mask, cs->mask, Scr.MonoGC, 0, 0, cs->width, cs->height, 0, 0); /* Invert the mask. We use it to draw the * background. */ XSetFunction(dpy, Scr.MonoGC, GXinvert); XFillRectangle(dpy, cs->mask, Scr.MonoGC, 0, 0, cs->width, cs->height); XSetFunction(dpy, Scr.MonoGC, GXcopy); } } } } static void parse_shape(Window win, colorset_t *cs, int i, char *args, int *has_shape_changed) { char *token; static char *name = "parse_colorset(shape)"; FvwmPicture *picture; FvwmPictureAttributes fpa; if (!FHaveShapeExtension) { cs->shape_mask = None; return; } /* read filename */ token = PeekToken(args, &args); *has_shape_changed = True; if (cs->shape_mask) { add_to_junk(cs->shape_mask); cs->shape_mask = None; } /* set the flags */ if (csetopts[i][0] == 'T') { cs->shape_type = SHAPE_TILED; } else if (csetopts[i][0] == 'A') { cs->shape_type = SHAPE_STRETCH_ASPECT; } else { cs->shape_type = SHAPE_STRETCH; } fpa.mask = FPAM_NO_ALPHA; /* try to load the shape mask */ if (!token) { return; } /* load the shape mask */ picture = PCacheFvwmPicture(dpy, win, NULL, token, fpa); if (!picture) { fvwm_msg(ERR, name, "can't load picture %s", token); } else if (picture->depth != 1 && picture->mask == None) { fvwm_msg(ERR, name, "shape pixmap must be of depth 1"); SafeDestroyPicture(dpy, picture); } else { Pixmap mask; /* okay, we have what we want */ if (picture->mask != None) { mask = picture->mask; } else { mask = picture->picture; } cs->shape_width = picture->width; cs->shape_height = picture->height; if (mask != None) { cs->shape_mask = XCreatePixmap( dpy, mask, picture->width, picture->height, 1); if (cs->shape_mask != None) { XCopyPlane(dpy, mask, cs->shape_mask, Scr.MonoGC, 0, 0, picture->width, picture->height, 0, 0, 1); } } } if (picture) { SafeDestroyPicture(dpy, picture); picture = None; } return; } static void parse_simple_tint( colorset_t *cs, char *args, char **tint, int supplied_color, int *changed, int *percent, char *cmd) { char *rest; static char *name = "parse_colorset (tint)"; *changed = False; rest = get_simple_color(args, tint, cs, supplied_color, 0, NULL); if (!(cs->color_flags & supplied_color)) { /* restore to default */ *percent = 0; *changed = True; cs->color_flags &= ~(supplied_color); } else if (!GetIntegerArguments(rest, NULL, percent, 1)) { fvwm_msg(WARN, name, "%s must have two arguments a color and an integer", cmd); return; } *changed = True; if (*percent > 100) { *percent = 100; } else if (*percent < 0) { *percent = 0; } } /* ---------------------------- interface functions ------------------------ */ void cleanup_colorsets(void) { struct junklist *oldjunk = junk; while (junk) { XFreePixmap(dpy, junk->pixmap); oldjunk = junk; junk = junk->prev; free(oldjunk); } cleanup_scheduled = False; } /* translate a colorset spec into a colorset structure */ void parse_colorset(int n, char *line) { int i; int w; int h; int tmp; int percent; colorset_t *cs; char *optstring; char *args; char *option; char *tmp_str; char *fg = NULL; char *bg = NULL; char *hi = NULL; char *sh = NULL; char *fgsh = NULL; char *tint = NULL; char *fg_tint = NULL; char *bg_tint = NULL; char *icon_tint = NULL; Bool have_pixels_changed = False; Bool has_icon_pixels_changed = False; Bool has_fg_changed = False; Bool has_bg_changed = False; Bool has_sh_changed = False; Bool has_hi_changed = False; Bool has_fgsh_changed = False; Bool has_fg_alpha_changed = False; Bool has_tint_changed = False; Bool has_fg_tint_changed = False; Bool has_bg_tint_changed = False; Bool has_icon_tint_changed = False; Bool has_pixmap_changed = False; Bool has_shape_changed = False; Bool has_image_alpha_changed = False; Bool pixmap_is_a_bitmap = False; Bool do_reload_pixmap = False; Bool is_server_grabbed = False; XColor color; XGCValues xgcv; static char *name = "parse_colorset"; Window win = Scr.NoFocusWin; static GC gc = None; /* initialize statics */ if (gc == None) { gc = fvwmlib_XCreateGC(dpy, win, 0, &xgcv); } /* make sure it exists and has sensible contents */ alloc_colorset(n); cs = &Colorset[n]; /*** Parse the options ***/ while (line && *line) { /* Read next option specification delimited by a comma or \0. */ line = GetQuotedString( line, &optstring, ",", NULL, NULL, NULL); if (!optstring) break; args = GetNextToken(optstring, &option); if (!option) { free(optstring); break; } switch((i = GetTokenIndex(option, csetopts, 0, NULL))) { case 0: /* Foreground */ case 1: /* Fore */ case 2: /* fg */ get_simple_color( args, &fg, cs, FG_SUPPLIED, FG_CONTRAST, "contrast"); has_fg_changed = True; break; case 3: /* Background */ case 4: /* Back */ case 5: /* bg */ get_simple_color( args, &bg, cs, BG_SUPPLIED, BG_AVERAGE, "average"); has_bg_changed = True; break; case 6: /* Hilight */ case 7: /* Hilite */ case 8: /* hi */ get_simple_color(args, &hi, cs, HI_SUPPLIED, 0, NULL); has_hi_changed = True; break; case 9: /* Shadow */ case 10: /* Shade */ case 11: /* sh */ get_simple_color(args, &sh, cs, SH_SUPPLIED, 0, NULL); has_sh_changed = True; break; case 12: /* fgsh */ get_simple_color( args, &fgsh, cs, FGSH_SUPPLIED, 0,NULL); has_fgsh_changed = True; break; case 13: /* fg_alpha */ case 14: /* fgAlpha */ if (GetIntegerArguments(args, NULL, &tmp, 1)) { if (tmp > 100) tmp = 100; else if (tmp < 0) tmp = 0; } else { tmp = 100; } if (tmp != cs->fg_alpha_percent) { cs->fg_alpha_percent = tmp; has_fg_alpha_changed = True; } break; case 15: /* TiledPixmap */ case 16: /* Pixmap */ case 17: /* AspectPixmap */ has_pixmap_changed = True; free_colorset_background(cs, True); tmp_str = PeekToken(args, &args); if (tmp_str) { CopyString(&cs->pixmap_args, tmp_str); do_reload_pixmap = True; cs->gradient_type = 0; /* set the flags */ if (csetopts[i][0] == 'T') { cs->pixmap_type = PIXMAP_TILED; } else if (csetopts[i][0] == 'A') { cs->pixmap_type = PIXMAP_STRETCH_ASPECT; } else { cs->pixmap_type = PIXMAP_STRETCH; } } /* the pixmap is build later */ break; case 18: /* Shape */ case 19: /* TiledShape */ case 20: /* AspectShape */ parse_shape(win, cs, i, args, &has_shape_changed); break; case 21: /* Plain */ has_pixmap_changed = True; free_colorset_background(cs, True); break; case 22: /* NoShape */ has_shape_changed = True; if (cs->shape_mask) { add_to_junk(cs->shape_mask); cs->shape_mask = None; } break; case 23: /* Transparent */ /* This is only allowable when the root depth == fvwm * visual depth otherwise bad match errors happen, * it may be even more restrictive but my tests (on * exceed 6.2) show that only == depth is necessary */ if (Pdepth != DefaultDepth(dpy, (DefaultScreen(dpy)))) { fvwm_msg( ERR, name, "can't do Transparent " "when root_depth!=fvwm_depth"); break; } has_pixmap_changed = True; free_colorset_background(cs, True); cs->pixmap = ParentRelative; cs->pixmap_type = PIXMAP_STRETCH; break; case 24: /* RootTransparent */ if (Pdepth != DefaultDepth(dpy, (DefaultScreen(dpy)))) { fvwm_msg( ERR, name, "can't do RootTransparent " "when root_depth!=fvwm_depth"); break; } free_colorset_background(cs, True); has_pixmap_changed = True; cs->pixmap_type = PIXMAP_ROOT_PIXMAP_PURE; do_reload_pixmap = True; tmp_str = PeekToken(args, &args); if (StrEquals(tmp_str, "buffer")) { cs->allows_buffered_transparency = True; } else { cs->allows_buffered_transparency = False; } cs->is_maybe_root_transparent = True; break; case 25: /* Tint */ case 26: /* PixmapTint */ case 27: /* ImageTint */ case 28: /* TintMask */ parse_simple_tint( cs, args, &tint, TINT_SUPPLIED, &has_tint_changed, &percent, "tint"); if (has_tint_changed) { cs->tint_percent = percent; } break; case 29: /* NoTint */ has_tint_changed = True; cs->tint_percent = 0; cs->color_flags &= ~TINT_SUPPLIED; break; case 30: /* fgTint */ parse_simple_tint( cs, args, &fg_tint, FG_TINT_SUPPLIED, &has_fg_tint_changed, &percent, "fgTint"); if (has_fg_tint_changed) { cs->fg_tint_percent = percent; } break; case 31: /* bgTint */ parse_simple_tint( cs, args, &bg_tint, BG_TINT_SUPPLIED, &has_bg_tint_changed, &percent, "bgTint"); if (has_bg_tint_changed) { cs->bg_tint_percent = percent; } break; case 32: /* dither */ if (cs->pixmap_args || cs->gradient_args) { has_pixmap_changed = True; do_reload_pixmap = True; } cs->dither = True; break; case 33: /* nodither */ if (cs->pixmap_args || cs->gradient_args) { has_pixmap_changed = True; do_reload_pixmap = True; } cs->dither = False; break; case 34: /* Alpha */ case 35: /* PixmapAlpha */ case 36: /* ImageAlpha */ if (GetIntegerArguments(args, NULL, &tmp, 1)) { if (tmp > 100) tmp = 100; else if (tmp < 0) tmp = 0; } else { tmp = 100; } if (tmp != cs->image_alpha_percent) { has_image_alpha_changed = True; cs->image_alpha_percent = tmp; } break; /* dither icon is not dynamic (yet) maybe a bad opt: default * to False ? */ case 37: /* ditherIcon */ cs->do_dither_icon = True; break; case 38: /* DoNotDitherIcon */ cs->do_dither_icon = False; break; case 39: /* IconTint */ parse_simple_tint( cs, args, &icon_tint, ICON_TINT_SUPPLIED, &has_icon_tint_changed, &percent, "IconTint"); if (has_icon_tint_changed) { cs->icon_tint_percent = percent; has_icon_pixels_changed = True; } break; case 40: /* NoIconTint */ has_icon_tint_changed = True; if (cs->icon_tint_percent != 0) { has_icon_pixels_changed = True; } cs->icon_tint_percent = 0; break; case 41: /* IconAlpha */ if (GetIntegerArguments(args, NULL, &tmp, 1)) { if (tmp > 100) tmp = 100; else if (tmp < 0) tmp = 0; } else { tmp = 100; } if (tmp != cs->icon_alpha_percent) { has_icon_pixels_changed = True; cs->icon_alpha_percent = tmp; } break; default: /* test for ?Gradient */ if (option[0] && StrEquals(&option[1], "Gradient")) { cs->gradient_type = toupper(option[0]); if (!IsGradientTypeSupported(cs->gradient_type)) break; has_pixmap_changed = True; free_colorset_background(cs, True); CopyString(&cs->gradient_args, args); do_reload_pixmap = True; if (cs->gradient_type == V_GRADIENT) { cs->pixmap_type = PIXMAP_STRETCH_Y; } else if (cs->gradient_type == H_GRADIENT) cs->pixmap_type = PIXMAP_STRETCH_X; else cs->pixmap_type = PIXMAP_STRETCH; } else { fvwm_msg( WARN, name, "bad colorset pixmap " "specifier %s %s", option, line); } break; } /* switch */ if (option) { free(option); option = NULL; } free(optstring); optstring = NULL; } /* while (line && *line) */ /* * ---------- change the "pixmap" tint colour ---------- */ if (has_tint_changed) { /* user specified colour */ if (tint != NULL) { Pixel old_tint = cs->tint; PictureFreeColors(dpy, Pcmap, &cs->tint, 1, 0, True); cs->tint = GetColor(tint); if (old_tint != cs->tint) { have_pixels_changed = True; } } else if (tint == NULL) { /* default */ Pixel old_tint = cs->tint; PictureFreeColors(dpy, Pcmap, &cs->tint, 1, 0, True); cs->tint = GetColor(black); if (old_tint != cs->tint) { have_pixels_changed = True; } } } /* * reload the gradient if the tint or the alpha have changed. * Do this too if we need to recompute the bg average and the * gradient is tinted (perforemence issue). */ if ((has_tint_changed || has_image_alpha_changed || (has_bg_changed && (cs->color_flags & BG_AVERAGE) && cs->tint_percent > 0)) && cs->gradient_args) { do_reload_pixmap = True; } /* * reset the pixmap if the tint or the alpha has changed */ if (!do_reload_pixmap && (has_tint_changed || has_image_alpha_changed || (has_bg_changed && cs->alpha_pixmap != None))) { if (cs->pixmap_type == PIXMAP_ROOT_PIXMAP_PURE || cs->pixmap_type == PIXMAP_ROOT_PIXMAP_TRAN) { do_reload_pixmap = True; } else if (cs->picture != NULL && cs->pixmap) { XSetClipMask(dpy, gc, cs->picture->mask); reset_cs_pixmap(cs, gc); XSetClipMask(dpy, gc, None); has_pixmap_changed = True; } } /* * (re)build the pixmap or the gradient */ if (do_reload_pixmap) { free_colorset_background(cs, False); has_pixmap_changed = True; if (cs->pixmap_type == PIXMAP_ROOT_PIXMAP_PURE || cs->pixmap_type == PIXMAP_ROOT_PIXMAP_TRAN) { cs->pixmap_type = 0; if (root_pic.pixmap) { cs->pixmap = root_pic.pixmap; cs->width = root_pic.width; cs->height = root_pic.height; cs->pixmap_type = PIXMAP_ROOT_PIXMAP_PURE; #if 0 fprintf(stderr,"Cset %i LoadRoot 0x%lx\n", n, cs->pixmap); #endif } } else if (cs->pixmap_args) { parse_pixmap(win, gc, cs, &pixmap_is_a_bitmap); } else if (cs->gradient_args) { cs->pixmap = CreateGradientPixmapFromString( dpy, win, gc, cs->gradient_type, cs->gradient_args, &w, &h, &cs->pixels, &cs->nalloc_pixels, cs->dither); cs->width = w; cs->height = h; } has_pixmap_changed = True; } if (cs->picture != NULL && cs->picture->depth != Pdepth) { pixmap_is_a_bitmap = True; } /* * ---------- change the background colour ---------- */ if (has_bg_changed || (has_pixmap_changed && (cs->color_flags & BG_AVERAGE) && cs->pixmap != None && cs->pixmap != ParentRelative && !pixmap_is_a_bitmap)) { Bool do_set_default_background = False; Pixmap average_pix = None; if (cs->color_flags & BG_AVERAGE) { if (cs->picture != NULL && cs->picture->picture != None) { average_pix = cs->picture->picture; } else if (cs->pixmap != ParentRelative) { average_pix = cs->pixmap; } if (average_pix == root_pic.pixmap) { int w; int h; XID dummy; MyXGrabServer(dpy); is_server_grabbed = True; if (!XGetGeometry( dpy, average_pix, &dummy, (int *)&dummy, (int *)&dummy, (unsigned int *)&w, (unsigned int *)&h, (unsigned int *)&dummy, (unsigned int *)&dummy)) { average_pix = None; } else { if (w != cs->width || h != cs->height) { average_pix = None; } } if (average_pix == None) { MyXUngrabServer(dpy); is_server_grabbed = False; } } } /* note: no average for bitmap */ if ((cs->color_flags & BG_AVERAGE) && average_pix) { /* calculate average background color */ XColor *colors; XImage *image; XImage *mask_image = None; unsigned int i, j, k = 0; unsigned long red = 0, blue = 0, green = 0; unsigned long tred, tblue, tgreen; double dred = 0.0, dblue = 0.0, dgreen = 0.0; has_bg_changed = True; /* create an array to store all the pixmap colors in */ /* Note: this may allocate a lot of memory: * cs->width * cs->height * 12 and then the rest of the * procedure can take a lot of times */ colors = (XColor *)safemalloc( cs->width * cs->height * sizeof(XColor)); /* get the pixmap and mask into an image */ image = XGetImage( dpy, average_pix, 0, 0, cs->width, cs->height, AllPlanes, ZPixmap); if (cs->mask != None) { mask_image = XGetImage( dpy, cs->mask, 0, 0, cs->width, cs->height, AllPlanes, ZPixmap); } if (is_server_grabbed == True) { MyXUngrabServer(dpy); } if (image != None && mask_image != None) { /* only fetch the pixels that are not masked * out */ for (i = 0; i < cs->width; i++) { for (j = 0; j < cs->height; j++) { if ( cs->mask == None || XGetPixel( mask_image, i, j) == 0) { colors[k++].pixel = XGetPixel( image, i, j); } } } } if (image != None) { XDestroyImage(image); } if (mask_image != None) { XDestroyImage(mask_image); } if (k == 0) { do_set_default_background = True; } else { /* look them all up, XQueryColors() can't * handle more than 256 */ for (i = 0; i < k; i += 256) { XQueryColors( dpy, Pcmap, &colors[i], min(k - i, 256)); } /* calculate average, add overflows in a double * .red is short, red is long */ for (i = 0; i < k; i++) { tred = red; red += colors[i].red; if (red < tred) { dred += (double)tred; red = colors[i].red; } tgreen = green; green += colors[i].green; if (green < tgreen) { dgreen += (double)tgreen; green = colors[i].green; } tblue = blue; blue += colors[i].blue; if (blue < tblue) { dblue += (double)tblue; blue = colors[i].blue; } } dred += red; dgreen += green; dblue += blue; /* get it */ color.red = dred / k; color.green = dgreen / k; color.blue = dblue / k; { Pixel old_bg = cs->bg; PictureFreeColors( dpy, Pcmap, &cs->bg, 1, 0, True); PictureAllocColor( dpy, Pcmap, &color, True); cs->bg = color.pixel; if (old_bg != cs->bg) { have_pixels_changed = True; } } } free(colors); } /* average */ else if ((cs->color_flags & BG_SUPPLIED) && bg != NULL) { /* user specified colour */ Pixel old_bg = cs->bg; PictureFreeColors(dpy, Pcmap, &cs->bg, 1, 0, True); cs->bg = GetColor(bg); if (old_bg != cs->bg) { have_pixels_changed = True; } } /* user specified */ else if (bg == NULL && has_bg_changed) { /* default */ do_set_default_background = True; } /* default */ if (do_set_default_background) { Pixel old_bg = cs->bg; PictureFreeColors(dpy, Pcmap, &cs->bg, 1, 0, True); cs->bg = GetColor(white); if (old_bg != cs->bg) { have_pixels_changed = True; } has_bg_changed = True; } if (has_bg_changed) { /* save the bg color for tinting */ cs->bg_saved = cs->bg; } } /* has_bg_changed */ /* * ---------- setup the bg tint colour ---------- */ if (has_bg_tint_changed && cs->bg_tint_percent > 0 && bg_tint != NULL) { PictureFreeColors(dpy, Pcmap, &cs->bg_tint, 1, 0, True); cs->bg_tint = GetColor(bg_tint); } /* * ---------- tint the bg colour ---------- */ if (has_bg_tint_changed || (has_bg_changed && cs->bg_tint_percent > 0)) { if (cs->bg_tint_percent == 0) { Pixel old_bg = cs->bg; PictureFreeColors(dpy, Pcmap, &cs->bg, 1, 0, True); cs->bg = cs->bg_saved; if (old_bg != cs->bg) { have_pixels_changed = True; has_bg_changed = True; } } else { Pixel old_bg = cs->bg; PictureFreeColors(dpy, Pcmap, &cs->bg, 1, 0, True); cs->bg = GetTintedPixel( cs->bg_saved, cs->bg_tint, cs->bg_tint_percent); if (old_bg != cs->bg) { have_pixels_changed = True; has_bg_changed = True; } } } /* * ---------- setup the fg tint colour ---------- */ if (has_fg_tint_changed && cs->fg_tint_percent > 0 && fg_tint != NULL) { PictureFreeColors(dpy, Pcmap, &cs->fg_tint, 1, 0, True); cs->fg_tint = GetColor(fg_tint); } /* * ---------- change the foreground colour ---------- */ if (has_fg_changed || (has_bg_changed && (cs->color_flags & FG_CONTRAST))) { if (cs->color_flags & FG_CONTRAST) { Pixel old_fg = cs->fg; /* calculate contrasting foreground color */ color.pixel = cs->bg; XQueryColor(dpy, Pcmap, &color); color.red = (color.red > 32767) ? 0 : 65535; color.green = (color.green > 32767) ? 0 : 65535; color.blue = (color.blue > 32767) ? 0 : 65535; PictureFreeColors(dpy, Pcmap, &cs->fg, 1, 0, True); PictureAllocColor(dpy, Pcmap, &color, True); cs->fg = color.pixel; if (old_fg != cs->fg) { have_pixels_changed = True; has_fg_changed = 1; } } /* contrast */ else if ((cs->color_flags & FG_SUPPLIED) && fg != NULL) { /* user specified colour */ Pixel old_fg = cs->fg; PictureFreeColors(dpy, Pcmap, &cs->fg, 1, 0, True); cs->fg = GetColor(fg); if (old_fg != cs->fg) { have_pixels_changed = True; has_fg_changed = 1; } } /* user specified */ else if (fg == NULL) { /* default */ Pixel old_fg = cs->fg; PictureFreeColors(dpy, Pcmap, &cs->fg, 1, 0, True); cs->fg = GetColor(black); if (old_fg != cs->fg) { have_pixels_changed = True; has_fg_changed = 1; } } /* save the fg color for tinting */ cs->fg_saved = cs->fg; } /* has_fg_changed */ /* * ---------- tint the foreground colour ---------- */ if (has_fg_tint_changed || (has_fg_changed && cs->fg_tint_percent > 0)) { if (cs->fg_tint_percent == 0) { Pixel old_fg = cs->fg; PictureFreeColors(dpy, Pcmap, &cs->fg, 1, 0, True); cs->fg = cs->fg_saved; if (old_fg != cs->fg) { have_pixels_changed = True; has_fg_changed = 1; } } else { Pixel old_fg = cs->fg; PictureFreeColors(dpy, Pcmap, &cs->fg, 1, 0, True); cs->fg = GetTintedPixel( cs->fg_saved, cs->fg_tint, cs->fg_tint_percent); if (old_fg != cs->fg) { have_pixels_changed = True; has_fg_changed = 1; } } } /* * ---------- change the hilight colour ---------- */ if (has_hi_changed || (has_bg_changed && !(cs->color_flags & HI_SUPPLIED))) { has_hi_changed = 1; if ((cs->color_flags & HI_SUPPLIED) && hi != NULL) { /* user specified colour */ Pixel old_hilite = cs->hilite; PictureFreeColors(dpy, Pcmap, &cs->hilite, 1, 0, True); cs->hilite = GetColor(hi); if (old_hilite != cs->hilite) { have_pixels_changed = True; } } /* user specified */ else if (hi == NULL) { Pixel old_hilite = cs->hilite; PictureFreeColors(dpy, Pcmap, &cs->hilite, 1, 0, True); cs->hilite = GetHilite(cs->bg); if (old_hilite != cs->hilite) { have_pixels_changed = True; } } } /* has_hi_changed */ /* * ---------- change the shadow colour ---------- */ if (has_sh_changed || (has_bg_changed && !(cs->color_flags & SH_SUPPLIED))) { has_sh_changed = 1; if ((cs->color_flags & SH_SUPPLIED) && sh != NULL) { /* user specified colour */ Pixel old_shadow = cs->shadow; PictureFreeColors(dpy, Pcmap, &cs->shadow, 1, 0, True); cs->shadow = GetColor(sh); if (old_shadow != cs->shadow) { have_pixels_changed = True; } } /* user specified */ else if (sh == NULL) { Pixel old_shadow = cs->shadow; PictureFreeColors(dpy, Pcmap, &cs->shadow, 1, 0, True); cs->shadow = GetShadow(cs->bg); if (old_shadow != cs->shadow) { have_pixels_changed = True; } } } /* has_sh_changed */ /* * ---------- change the shadow foreground colour ---------- */ if (has_fgsh_changed || ((has_fg_changed || has_bg_changed) && !(cs->color_flags & FGSH_SUPPLIED))) { has_fgsh_changed = 1; if ((cs->color_flags & FGSH_SUPPLIED) && fgsh != NULL) { /* user specified colour */ Pixel old_fgsh = cs->fgsh; PictureFreeColors(dpy, Pcmap, &cs->fgsh, 1, 0, True); cs->fgsh = GetColor(fgsh); if (old_fgsh != cs->fgsh) { have_pixels_changed = True; } } /* user specified */ else if (fgsh == NULL) { Pixel old_fgsh = cs->fgsh; PictureFreeColors(dpy, Pcmap, &cs->fgsh, 1, 0, True); cs->fgsh = GetForeShadow(cs->fg, cs->bg); if (old_fgsh != cs->fgsh) { have_pixels_changed = True; } } } /* has_fgsh_changed */ /* * ------- the pixmap is a bitmap: create here cs->pixmap ------- */ if (cs->picture != None && pixmap_is_a_bitmap && (has_pixmap_changed || has_bg_changed)) { cs->pixmap = XCreatePixmap( dpy, win, cs->width, cs->height, Pdepth); XSetBackground(dpy, gc, cs->bg); XSetForeground(dpy, gc, cs->fg); reset_cs_pixmap(cs, gc); } /* * ------- change the masked out parts of the background pixmap ------- */ if (cs->pixmap != None && cs->pixmap != ParentRelative && (!CSETS_IS_TRANSPARENT_ROOT(cs)|| cs->allows_buffered_transparency) && (cs->mask != None || cs->alpha_pixmap != None || cs->image_alpha_percent < 100 || cs->tint_percent > 0) && (has_pixmap_changed || has_bg_changed || has_image_alpha_changed || has_tint_changed)) { /* Now that we know the background colour we can update the * pixmap background. */ FvwmRenderAttributes fra; Pixmap temp, mask, alpha; memset(&fra, 0, sizeof(fra)); temp = XCreatePixmap(dpy, win, cs->width, cs->height, Pdepth); if (cs->picture != NULL) { mask = cs->picture->mask; alpha = cs->picture->alpha; } else { mask = None; alpha = None; } XSetForeground(dpy, gc, cs->bg); XFillRectangle( dpy, temp, gc, 0, 0, cs->width, cs->height); fra.mask = FRAM_HAVE_ADDED_ALPHA | FRAM_HAVE_TINT; fra.added_alpha_percent = cs->image_alpha_percent; fra.tint = cs->tint; fra.tint_percent = cs->tint_percent; PGraphicsRenderPixmaps( dpy, win, cs->pixmap, mask, alpha, Pdepth, &fra, temp, gc, Scr.MonoGC, Scr.AlphaGC, 0, 0, cs->width, cs->height, 0, 0, cs->width, cs->height, False); if (cs->pixmap != root_pic.pixmap) { add_to_junk(cs->pixmap); } cs->pixmap = temp; has_pixmap_changed = True; if (CSETS_IS_TRANSPARENT_ROOT(cs)) { cs->pixmap_type = PIXMAP_ROOT_PIXMAP_TRAN; } } /* has_pixmap_changed */ /* * ---------- change the icon tint colour ---------- */ if (has_icon_tint_changed) { /* user specified colour */ if (icon_tint != NULL) { Pixel old_tint = cs->icon_tint; PictureFreeColors( dpy, Pcmap, &cs->icon_tint, 1, 0, True); cs->icon_tint = GetColor(icon_tint); if (old_tint != cs->icon_tint) { has_icon_pixels_changed = True; } } else { /* default */ Pixel old_tint = cs->icon_tint; PictureFreeColors( dpy, Pcmap, &cs->icon_tint, 1, 0, True); cs->icon_tint = GetColor(black); if (old_tint != cs->icon_tint) { has_icon_pixels_changed = True; } } } /* * ---------- send new colorset to fvwm and clean up ---------- */ /* make sure the server has this to avoid races */ XSync(dpy, False); /* inform modules of the change */ if (have_pixels_changed || has_pixmap_changed || has_shape_changed || has_fg_alpha_changed || has_icon_pixels_changed) { BroadcastColorset(n); } if (fg) { free(fg); } if (bg) { free(bg); } if (hi) { free(hi); } if (sh) { free(sh); } if (fgsh) { free(fgsh); } if (tint) { free(tint); } if (fg_tint) { free(fg_tint); } if (bg_tint) { free(bg_tint); } if (icon_tint) { free(icon_tint); } return; } /* * alloc_colorset() grows the size of the Colorset array to include set n * colorset_t *Colorset will be altered * returns the address of the member */ void alloc_colorset(int n) { /* do nothing if it already exists */ if (n < nColorsets) { return; } else { Colorset = (colorset_t *)saferealloc( (char *)Colorset, (n + 1) * sizeof(colorset_t)); memset( &Colorset[nColorsets], 0, (n + 1 - nColorsets) * sizeof(colorset_t)); } if (n == 0) { update_root_pixmap(0); } /* initialize new colorsets to black on gray */ while (nColorsets <= n) { colorset_t *ncs = &Colorset[nColorsets]; if (PictureUseBWOnly()) { char g_bits[] = {0x0a, 0x05, 0x0a, 0x05, 0x08, 0x02, 0x08, 0x02, 0x01, 0x02, 0x04, 0x08}; /* monochrome monitors get black on white */ /* with a gray pixmap background */ ncs->fg = GetColor(black); ncs->bg = GetColor(white); ncs->hilite = GetColor(white); ncs->shadow = GetColor(black); ncs->fgsh = GetColor(white); ncs->tint = GetColor(black); ncs->icon_tint = GetColor(black); ncs->pixmap = XCreatePixmapFromBitmapData( dpy, Scr.NoFocusWin, &g_bits[4 * (nColorsets % 3)], 4, 4, PictureBlackPixel(), PictureWhitePixel(), Pdepth); ncs->width = 4; ncs->height = 4; } else { ncs->fg = GetColor(black); ncs->bg = GetColor(gray); ncs->hilite = GetHilite(ncs->bg); ncs->shadow = GetShadow(ncs->bg); ncs->fgsh = GetForeShadow(ncs->fg, ncs->bg); ncs->tint = GetColor(black); ncs->icon_tint = GetColor(black); } ncs->fg_tint = ncs->bg_tint = GetColor(black); /* set flags for fg contrast, bg average */ /* in case just a pixmap is given */ ncs->color_flags = FG_CONTRAST | BG_AVERAGE; ncs->fg_saved = ncs->fg; ncs->fg_alpha_percent = 100; ncs->image_alpha_percent = 100; ncs->icon_alpha_percent = 100; ncs->tint_percent = 0; ncs->icon_tint_percent = 0; ncs->fg_tint_percent = ncs->bg_tint_percent = 0; ncs->dither = (PictureDitherByDefault())? True:False; nColorsets++; } } void update_root_transparent_colorset(Atom prop) { int i; colorset_t *cs; root_pic.old_pixmap = root_pic.pixmap; update_root_pixmap(prop); #if 0 if (!root_pic.pixmap) { return; } #endif for (i=0; i < nColorsets; i++) { Bool root_trans = False; cs = &Colorset[i]; if (cs->is_maybe_root_transparent && cs->allows_buffered_transparency) { parse_colorset(i, "RootTransparent buffer"); root_trans = True; } else if (cs->is_maybe_root_transparent) { parse_colorset(i, "RootTransparent"); root_trans = True; } if (root_trans) { update_fvwm_colorset(i); } } } /* ---------------------------- builtin commands ---------------------------- */ void CMD_ReadWriteColors(F_CMD_ARGS) { fvwm_msg(WARN, "CMD_ReadWriteColors", "ReadWriteColors is obsolete"); return; } void CMD_Colorset(F_CMD_ARGS) { int n; char *token; if (GetIntegerArguments(action, &token, &n, 1) != 1) { return; } if (n < 0) { return; } if (token == NULL) { return; } parse_colorset(n, token); update_fvwm_colorset(n); return; } void CMD_CleanupColorsets(F_CMD_ARGS) { cleanup_colorsets(); } fvwm-2.6.5.orig/fvwm/cursor.h0000644000175000017500000000326707677641663014325 0ustar vwcvwc/* -*-c-*- */ #ifndef CURSOR_H #define CURSOR_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* Cursor types */ typedef enum { CRS_NONE = 0, CRS_POSITION, /* upper Left corner cursor */ CRS_TITLE, /* title-bar cursor */ CRS_DEFAULT, /* cursor for apps to inherit */ CRS_SYS, /* sys-menu and iconify boxes cursor */ CRS_MOVE, /* move cursor */ CRS_RESIZE, /* resize cursor */ CRS_WAIT, /* wait a while cursor */ CRS_MENU, /* menu cursor */ CRS_SELECT, /* dot cursor for selecting windows */ CRS_DESTROY, /* skull and cross bones */ CRS_TOP, CRS_RIGHT, CRS_BOTTOM, CRS_LEFT, CRS_TOP_LEFT, CRS_TOP_RIGHT, CRS_BOTTOM_LEFT, CRS_BOTTOM_RIGHT, CRS_TOP_EDGE, CRS_RIGHT_EDGE, CRS_BOTTOM_EDGE, CRS_LEFT_EDGE, CRS_ROOT, CRS_STROKE, CRS_MAX } cursor_t; typedef enum { /* busy cursor bits */ BUSY_NONE = 0, BUSY_READ = (1<<0), BUSY_WAIT = (1<<1), BUSY_MODULESYNCHRONOUS = (1<<2), BUSY_DYNAMICMENU = (1<<3), BUSY_ALL = (BUSY_READ|BUSY_WAIT|BUSY_MODULESYNCHRONOUS|BUSY_DYNAMICMENU) } busy_cursor_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ Cursor *CreateCursors(Display *dpy); #endif /* CURSOR_H */ fvwm-2.6.5.orig/fvwm/geometry.c0000644000175000017500000007254511244012637014615 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "misc.h" #include "screen.h" #include "geometry.h" #include "module_interface.h" #include "borders.h" #include "icons.h" #include "add_window.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ /* Removes decorations from the source rectangle and moves it according to the * gravity specification. */ void gravity_get_naked_geometry( int gravity, FvwmWindow *t, rectangle *dest_g, rectangle *orig_g) { int xoff; int yoff; size_borders b; get_window_borders(t, &b); gravity_get_offsets(gravity, &xoff, &yoff); dest_g->x = orig_g->x + ((xoff + 1) * (orig_g->width - 1)) / 2; dest_g->y = orig_g->y + ((yoff + 1) * (orig_g->height - 1)) / 2; dest_g->width = orig_g->width - b.total_size.width; dest_g->height = orig_g->height - b.total_size.height; return; } /* Decorate the rectangle. Resize and shift it according to gravity. */ void gravity_add_decoration( int gravity, FvwmWindow *t, rectangle *dest_g, rectangle *orig_g) { size_borders b; get_window_borders(t, &b); *dest_g = *orig_g; gravity_resize( gravity, dest_g, b.total_size.width, b.total_size.height); return; } void get_relative_geometry(rectangle *rel_g, rectangle *abs_g) { rel_g->x = abs_g->x - Scr.Vx; rel_g->y = abs_g->y - Scr.Vy; rel_g->width = abs_g->width; rel_g->height = abs_g->height; return; } void get_absolute_geometry(rectangle *abs_g, rectangle *rel_g) { abs_g->x = rel_g->x + Scr.Vx; abs_g->y = rel_g->y + Scr.Vy; abs_g->width = rel_g->width; abs_g->height = rel_g->height; return; } void gravity_translate_to_northwest_geometry( int gravity, FvwmWindow *t, rectangle *dest_g, rectangle *orig_g) { int xoff; int yoff; gravity_get_offsets(gravity, &xoff, &yoff); dest_g->x = orig_g->x - ((xoff + 1) * (orig_g->width - 1 + 2 * t->attr_backup.border_width)) / 2; dest_g->y = orig_g->y - ((yoff + 1) * (orig_g->height - 1 + 2 * t->attr_backup.border_width)) / 2; dest_g->width = orig_g->width; dest_g->height = orig_g->height; return; } void gravity_translate_to_northwest_geometry_no_bw( int gravity, FvwmWindow *t, rectangle *dest_g, rectangle *orig_g) { int bw = t->attr_backup.border_width; t->attr_backup.border_width = 0; gravity_translate_to_northwest_geometry(gravity, t, dest_g, orig_g); t->attr_backup.border_width = bw; return; } void get_title_geometry( FvwmWindow *fw, rectangle *ret_g) { size_borders b; size_borders nt; int w; int h; get_window_borders(fw, &b); get_window_borders_no_title(fw, &nt); w = (ret_g->width > 0) ? ret_g->width : fw->g.frame.width; h = (ret_g->height > 0) ? ret_g->height : fw->g.frame.height; ret_g->x = nt.top_left.width; ret_g->y = nt.top_left.height; switch (GET_TITLE_DIR(fw)) { case DIR_S: ret_g->y = h - b.bottom_right.height; /* fall through */ case DIR_N: ret_g->width = w - b.total_size.width; ret_g->height = fw->title_thickness; break; case DIR_E: ret_g->x = w - b.bottom_right.width; /* fall through */ case DIR_W: ret_g->width = fw->title_thickness; ret_g->height = h - b.total_size.height; break; default: break; } return; } void get_title_gravity_factors( FvwmWindow *fw, int *ret_fx, int *ret_fy) { switch (GET_TITLE_DIR(fw)) { case DIR_N: *ret_fx = 0; *ret_fy = 1; break; case DIR_S: *ret_fx = 0; *ret_fy = -1; break; case DIR_W: *ret_fx = 1; *ret_fy = 0; break; case DIR_E: *ret_fx = -1; *ret_fy = 0; break; } return; } Bool get_title_button_geometry( FvwmWindow *fw, rectangle *ret_g, int context) { int bnum; if (context & C_TITLE) { ret_g->width = 0; ret_g->height = 0; get_title_geometry(fw, ret_g); ret_g->x += fw->g.frame.x; ret_g->y += fw->g.frame.y; return True; } bnum = get_button_number(context); if (bnum < 0 || FW_W_BUTTON(fw, bnum) == None) { return False; } if (XGetGeometry( dpy, FW_W_BUTTON(fw, bnum), &JunkRoot, &ret_g->x, &ret_g->y, (unsigned int*)&ret_g->width, (unsigned int*)&ret_g->height, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth) == 0) { return False; } XTranslateCoordinates( dpy, FW_W_FRAME(fw), Scr.Root, ret_g->x, ret_g->y, &ret_g->x, &ret_g->y, &JunkChild); return True; } void get_title_font_size_and_offset( FvwmWindow *fw, direction_t title_dir, Bool is_left_title_rotated_cw, Bool is_right_title_rotated_cw, Bool is_top_title_rotated, Bool is_bottom_title_rotated, int *size, int *offset) { int decor_size; int extra_size; int font_size; int min_offset; Bool is_rotated_cw, is_rotated; rotation_t draw_rotation; /* adjust font offset according to height specified in title style */ decor_size = fw->decor->title_height; font_size = fw->title_font->height + EXTRA_TITLE_FONT_HEIGHT; switch (title_dir) { case DIR_W: case DIR_E: is_rotated_cw = (title_dir == DIR_W) ? is_left_title_rotated_cw : is_right_title_rotated_cw; if (is_rotated_cw) { fw->title_text_rotation = ROTATION_90; } else { fw->title_text_rotation = ROTATION_270; } break; case DIR_N: case DIR_S: default: is_rotated = (title_dir == DIR_N) ? is_top_title_rotated : is_bottom_title_rotated; if (is_rotated) { fw->title_text_rotation = ROTATION_180; } else { fw->title_text_rotation = ROTATION_0; } break; } if (USE_TITLE_DECOR_ROTATION(fw)) { draw_rotation = ROTATION_0; } else { draw_rotation = fw->title_text_rotation; } min_offset = FlocaleGetMinOffset( fw->title_font, draw_rotation); extra_size = (decor_size > 0) ? decor_size - font_size : 0; *offset = min_offset; if (fw->decor->min_title_height > 0 && font_size + extra_size < fw->decor->min_title_height) { extra_size = fw->decor->min_title_height - font_size; } if (extra_size > 0) { *offset += extra_size / 2; } *size = font_size + extra_size; return; } void get_icon_corner( FvwmWindow *fw, rectangle *ret_g) { switch (GET_TITLE_DIR(fw)) { case DIR_N: case DIR_W: ret_g->x = fw->g.frame.x; ret_g->y = fw->g.frame.y; break; case DIR_S: ret_g->x = fw->g.frame.x; ret_g->y = fw->g.frame.y + fw->g.frame.height - ret_g->height; break; case DIR_E: ret_g->x = fw->g.frame.x + fw->g.frame.width - ret_g->width; ret_g->y = fw->g.frame.y; break; } return; } void get_shaded_geometry( FvwmWindow *fw, rectangle *small_g, rectangle *big_g) { size_borders b; /* this variable is necessary so the function can be called with * small_g == big_g */ int big_width = big_g->width; int big_height = big_g->height; int d; get_window_borders(fw, &b); *small_g = *big_g; d = 0; switch (SHADED_DIR(fw)) { case DIR_S: case DIR_SW: case DIR_SE: small_g->y = big_g->y + big_height - b.total_size.height; d = 1; /* fall through */ case DIR_N: case DIR_NW: case DIR_NE: small_g->height = b.total_size.height; if (small_g->height == 0) { small_g->height = 1; small_g->y -= d; } break; default: break; } d = 0; switch (SHADED_DIR(fw)) { case DIR_E: case DIR_NE: case DIR_SE: small_g->x = big_g->x + big_width - b.total_size.width; d = 1; /* fall through */ case DIR_W: case DIR_NW: case DIR_SW: small_g->width = b.total_size.width; if (small_g->width == 0) { small_g->width = 1; small_g->x -= d; } break; default: break; } return; } void get_shaded_geometry_with_dir( FvwmWindow *fw, rectangle *small_g, rectangle *big_g, direction_t shade_dir) { direction_t old_shade_dir; old_shade_dir = SHADED_DIR(fw); SET_SHADED_DIR(fw, shade_dir); get_shaded_geometry(fw, small_g, big_g); SET_SHADED_DIR(fw, old_shade_dir); return; } void get_unshaded_geometry( FvwmWindow *fw, rectangle *ret_g) { if (IS_SHADED(fw)) { if (IS_MAXIMIZED(fw)) { *ret_g = fw->g.max; } else { *ret_g = fw->g.normal; } get_relative_geometry(ret_g, ret_g); } else { *ret_g = fw->g.frame; } return; } void get_shaded_client_window_pos( FvwmWindow *fw, rectangle *ret_g) { rectangle big_g; size_borders b; get_window_borders(fw, &b); big_g = (IS_MAXIMIZED(fw)) ? fw->g.max : fw->g.normal; get_relative_geometry(&big_g, &big_g); switch (SHADED_DIR(fw)) { case DIR_S: case DIR_SW: case DIR_SE: ret_g->y = 1 - big_g.height + b.total_size.height; break; default: ret_g->y = 0; break; } switch (SHADED_DIR(fw)) { case DIR_E: case DIR_NE: case DIR_SE: ret_g->x = 1 - big_g.width + b.total_size.width; break; default: ret_g->x = 0; break; } return; } /* returns the dimensions of the borders */ void get_window_borders( const FvwmWindow *fw, size_borders *borders) { borders->top_left.width = fw->boundary_width; borders->bottom_right.width = fw->boundary_width; borders->top_left.height = fw->boundary_width; borders->bottom_right.height = fw->boundary_width; switch (GET_TITLE_DIR(fw)) { case DIR_N: borders->top_left.height += fw->title_thickness; break; case DIR_S: borders->bottom_right.height += fw->title_thickness; break; case DIR_W: borders->top_left.width += fw->title_thickness; break; case DIR_E: borders->bottom_right.width += fw->title_thickness; break; } borders->total_size.width = borders->top_left.width + borders->bottom_right.width; borders->total_size.height = borders->top_left.height + borders->bottom_right.height; return; } /* returns the dimensions of the borders without the title */ void get_window_borders_no_title( const FvwmWindow *fw, size_borders *borders) { borders->top_left.width = fw->boundary_width; borders->bottom_right.width = fw->boundary_width; borders->top_left.height = fw->boundary_width; borders->bottom_right.height = fw->boundary_width; borders->total_size.width = borders->top_left.width + borders->bottom_right.width; borders->total_size.height = borders->top_left.height + borders->bottom_right.height; return; } void set_window_border_size( FvwmWindow *fw, int used_width) { if (used_width <= 0) { fw->boundary_width = 0; fw->unshaped_boundary_width = 0; } else { fw->unshaped_boundary_width = used_width; fw->boundary_width = (fw->wShaped) ? 0 : used_width; } return; } /* Returns True if all window borders are only 1 pixel thick (or less). */ Bool is_window_border_minimal( FvwmWindow *fw) { size_borders nt; get_window_borders_no_title(fw, &nt); if (nt.top_left.width > 1 || nt.top_left.height > 1 || nt.bottom_right.width > 1 || nt.bottom_right.height > 1) { return False; } return True; } /* This function returns the geometry of the client window. If the window is * shaded, the unshaded geometry is used instead. */ void get_client_geometry( FvwmWindow *fw, rectangle *ret_g) { size_borders borders; get_unshaded_geometry(fw, ret_g); get_window_borders(fw, &borders); ret_g->x += borders.top_left.width; ret_g->y += borders.top_left.height; ret_g->width -= borders.total_size.width; ret_g->height -= borders.total_size.height; return; } /* update the frame_g according to the window's g.normal or g.max and shaded * state */ void update_relative_geometry(FvwmWindow *fw) { get_relative_geometry( &fw->g.frame, (IS_MAXIMIZED(fw)) ? &fw->g.max : &fw->g.normal); if (IS_SHADED(fw)) { get_shaded_geometry( fw, &fw->g.frame, &fw->g.frame); } return; } /* update the g.normal or g.max according to the window's current position */ void update_absolute_geometry(FvwmWindow *fw) { rectangle *dest_g; rectangle frame_g; /* store orig values in absolute coords */ dest_g = (IS_MAXIMIZED(fw)) ? &fw->g.max : &fw->g.normal; frame_g = *dest_g; dest_g->x = fw->g.frame.x + Scr.Vx; dest_g->y = fw->g.frame.y + Scr.Vy; dest_g->width = fw->g.frame.width; dest_g->height = fw->g.frame.height; if (IS_SHADED(fw)) { switch (SHADED_DIR(fw)) { case DIR_SW: case DIR_S: case DIR_SE: dest_g->y += fw->g.frame.height - frame_g.height; /* fall through */ case DIR_NW: case DIR_N: case DIR_NE: dest_g->height = frame_g.height; break; } switch (SHADED_DIR(fw)) { case DIR_NE: case DIR_E: case DIR_SE: dest_g->x += fw->g.frame.width - frame_g.width; /* fall through */ case DIR_NW: case DIR_W: case DIR_SW: dest_g->width = frame_g.width; break; } } return; } /* make sure a maximized window and it's normal version are never a page or * more apart. */ void maximize_adjust_offset(FvwmWindow *fw) { int off_x; int off_y; int dh; int dw; if (!IS_MAXIMIZED(fw)) { /* otherwise we might corrupt the g.normal */ return; } off_x = fw->g.normal.x - fw->g.max.x - fw->g.max_offset.x; off_y = fw->g.normal.y - fw->g.max.y - fw->g.max_offset.y; dw = Scr.MyDisplayWidth; dh = Scr.MyDisplayHeight; if (off_x >= dw) { fw->g.normal.x -= (off_x / dw) * dw; } else if (off_x <= -dw) { fw->g.normal.x += (-off_x / dw) * dw; } if (off_y >= dh) { fw->g.normal.y -= (off_y / dh) * dh; } else if (off_y <= -dh) { fw->g.normal.y += (-off_y / dh) * dh; } return; } #define MAKEMULT(a,b) ((b==1) ? (a) : (((int)((a)/(b))) * (b)) ) static void __cs_handle_aspect_ratio( size_rect *ret_s, FvwmWindow *fw, size_rect s, const size_rect base, const size_rect inc, size_rect min, size_rect max, int xmotion, int ymotion, int flags) { volatile double odefect; volatile double defect; volatile double rmax; volatile double rmin; volatile int delta; volatile int ow; volatile int oh; if (fw->hints.flags & PBaseSize) { /* * ICCCM 2 demands that aspect ratio should apply to width - * base_width. To prevent funny results, we reset PBaseSize in * GetWindowSizeHints, if base is not smaller than min. */ s.width -= base.width; max.width -= base.width; min.width -= base.width; s.height -= base.height; max.height -= base.height; min.height -= base.height; } rmin = (double)fw->hints.min_aspect.x / (double)fw->hints.min_aspect.y; rmax = (double)fw->hints.max_aspect.x / (double)fw->hints.max_aspect.y; do { double r; r = (double)s.width / (double)s.height; ow = s.width; oh = s.height; odefect = 0; if (r < rmin) { odefect = rmin - r; } else if (r > rmax) { odefect = r - rmax; } if (r < rmin && (flags & CS_ROUND_UP) && xmotion == 0) { /* change width to match */ delta = MAKEMULT(s.height * rmin - s.width, inc.width); if (s.width + delta <= max.width) { s.width += delta; } r = (double)s.width / (double)s.height; } if (r < rmin) { /* change height to match */ delta = MAKEMULT( s.height - s.width / rmin, inc.height); if (s.height - delta >= min.height) { s.height -= delta; } else { delta = MAKEMULT( s.height * rmin - s.width, inc.width); if (s.width + delta <= max.width) { s.width += delta; } } r = (double)s.width / (double)s.height; } if (r > rmax && (flags & CS_ROUND_UP) && ymotion == 0) { /* change height to match */ delta = MAKEMULT(s.width /rmax - s.height, inc.height); if (s.height + delta <= max.height) { s.height += delta; } r = (double)s.width / (double)s.height; } if (r > rmax) { /* change width to match */ delta = MAKEMULT(s.width - s.height * rmax, inc.width); if (s.width - delta >= min.width) { s.width -= delta; } else { delta = MAKEMULT( s.width / rmax - s.height, inc.height); if (s.height + delta <= max.height) { s.height += delta; } } r = (double)s.width / (double)s.height; } defect = 0; if (r < rmin) { defect = rmin - r; } else if (r > rmax) { defect = r - rmax; } } while (odefect > defect); if (fw->hints.flags & PBaseSize) { ow += base.width; oh += base.height; } ret_s->width = ow; ret_s->height = oh; return; } /* * * Procedure: * constrain_size - adjust the given width and height to account for the * constraints imposed by size hints */ void constrain_size( FvwmWindow *fw, const XEvent *e, int *widthp, int *heightp, int xmotion, int ymotion, int flags) { size_rect min; size_rect max; size_rect inc; size_rect base; size_rect round_up; size_rect d; size_rect old; size_borders b; if (DO_DISABLE_CONSTRAIN_SIZE_FULLSCREEN(fw) == 1) { return; } if (HAS_NEW_WM_NORMAL_HINTS(fw)) { /* get the latest size hints */ XSync(dpy, 0); GetWindowSizeHints(fw); SET_HAS_NEW_WM_NORMAL_HINTS(fw, 0); } if (IS_MAXIMIZED(fw) && (flags & CS_UPDATE_MAX_DEFECT)) { *widthp += fw->g.max_defect.width; *heightp += fw->g.max_defect.height; } /* gcc 4.1.1 warns about these not being initialized at the end, * but the conditions for the use are the same...*/ old.width = *widthp; old.height = *heightp; d.width = *widthp; d.height = *heightp; get_window_borders(fw, &b); d.width -= b.total_size.width; d.height -= b.total_size.height; min.width = fw->hints.min_width; min.height = fw->hints.min_height; if (min.width < fw->min_window_width - b.total_size.width) { min.width = fw->min_window_width - b.total_size.width; } if (min.height < fw->min_window_height - b.total_size.height) { min.height = fw->min_window_height - b.total_size.height; } max.width = fw->hints.max_width; max.height = fw->hints.max_height; if (max.width > fw->max_window_width - b.total_size.width) { max.width = fw->max_window_width - b.total_size.width; } if (max.height > fw->max_window_height - b.total_size.height) { max.height = fw->max_window_height - b.total_size.height; } if (min.width > max.width) { min.width = max.width; } if (min.height > max.height) { min.height = max.height; } base.width = fw->hints.base_width; base.height = fw->hints.base_height; inc.width = fw->hints.width_inc; inc.height = fw->hints.height_inc; /* * First, clamp to min and max values */ if (d.width < min.width) { d.width = min.width; } if (d.height < min.height) { d.height = min.height; } if (d.width > max.width) { d.width = max.width; } if (d.height > max.height) { d.height = max.height; } /* * Second, round to base + N * inc (up or down depending on resize * type) if rounding up store amount */ if (!(flags & CS_ROUND_UP)) { d.width = ((d.width - base.width) / inc.width) * inc.width + base.width; d.height = ((d.height - base.height) / inc.height) * inc.height + base.height; } else { round_up.width = d.width; round_up.height = d.height; d.width = ((d.width - base.width + inc.width - 1) / inc.width) * inc.width + base.width; d.height = ((d.height - base.height + inc.height - 1) / inc.height) * inc.height + base.height; round_up.width = d.width - round_up.width; round_up.height = d.height - round_up.height; } /* * Step 2a: check we didn't move the edge off screen in interactive * moves */ if ((flags & CS_ROUND_UP) && e != NULL && e->type == MotionNotify) { if (xmotion > 0 && e->xmotion.x_root < round_up.width) { d.width -= inc.width; } else if ( xmotion < 0 && e->xmotion.x_root >= Scr.MyDisplayWidth - round_up.width) { d.width -= inc.width; } if (ymotion > 0 && e->xmotion.y_root < round_up.height) { d.height -= inc.height; } else if ( ymotion < 0 && e->xmotion.y_root >= Scr.MyDisplayHeight - round_up.height) { d.height -= inc.height; } } /* * Step 2b: Check that we didn't violate min and max. */ if (d.width < min.width) { d.width += inc.width; } if (d.height < min.height) { d.height += inc.height; } if (d.width > max.width) { d.width -= inc.width; } if (d.height > max.height) { d.height -= inc.height; } /* * Third, adjust for aspect ratio */ if (fw->hints.flags & PAspect) { __cs_handle_aspect_ratio( &d, fw, d, base, inc, min, max, xmotion, ymotion, flags); } /* * Fourth, account for border width and title height */ *widthp = d.width + b.total_size.width; *heightp = d.height + b.total_size.height; if (IS_MAXIMIZED(fw) && (flags & CS_UPDATE_MAX_DEFECT)) { /* update size defect for maximized window */ fw->g.max_defect.width = old.width - *widthp; fw->g.max_defect.height = old.height - *heightp; } return; } /* This function does roughly the same as constrain_size, but takes into account * that the window shifts according to gravity if constrain_size actually * changes the width or height. The frame_g of the window is not changed. The * target geometry is expected to be in *rect and will be retured through rect. */ void gravity_constrain_size( int gravity, FvwmWindow *t, rectangle *rect, int flags) { int new_width = rect->width; int new_height = rect->height; if (IS_MAXIMIZED(t) && (flags & CS_UPDATE_MAX_DEFECT)) { gravity_resize( gravity, rect, t->g.max_defect.width, t->g.max_defect.height); t->g.max_defect.width = 0; t->g.max_defect.height = 0; new_width = rect->width; new_height = rect->height; } constrain_size( t, NULL, &new_width, &new_height, 0, 0, flags); if (rect->width != new_width || rect->height != new_height) { gravity_resize( gravity, rect, new_width - rect->width, new_height - rect->height); } return; } /* returns the icon title geometry if it is visible */ Bool get_visible_icon_title_geometry( FvwmWindow *fw, rectangle *ret_g) { if (HAS_NO_ICON_TITLE(fw) || IS_ICON_UNMAPPED(fw) || !IS_ICONIFIED(fw)) { memset(ret_g, 0, sizeof(*ret_g)); return False; } *ret_g = fw->icon_g.title_w_g; return True; } /* returns the icon title geometry if it the icon title window exists */ Bool get_icon_title_geometry( FvwmWindow *fw, rectangle *ret_g) { if (HAS_NO_ICON_TITLE(fw)) { memset(ret_g, 0, sizeof(*ret_g)); return False; } *ret_g = fw->icon_g.title_w_g; return True; } /* returns the icon picture geometry if it is visible */ Bool get_visible_icon_picture_geometry( FvwmWindow *fw, rectangle *ret_g) { if (fw->icon_g.picture_w_g.width == 0 || IS_ICON_UNMAPPED(fw) || !IS_ICONIFIED(fw)) { memset(ret_g, 0, sizeof(*ret_g)); return False; } *ret_g = fw->icon_g.picture_w_g; return True; } /* returns the icon picture geometry if it is exists */ Bool get_icon_picture_geometry( FvwmWindow *fw, rectangle *ret_g) { if (fw->icon_g.picture_w_g.width == 0) { memset(ret_g, 0, sizeof(*ret_g)); return False; } *ret_g = fw->icon_g.picture_w_g; return True; } /* returns the icon geometry (unexpanded title plus pixmap) if it is visible */ Bool get_visible_icon_geometry( FvwmWindow *fw, rectangle *ret_g) { if (IS_ICON_UNMAPPED(fw) || !IS_ICONIFIED(fw)) { memset(ret_g, 0, sizeof(*ret_g)); return False; } if (fw->icon_g.picture_w_g.width > 0) { *ret_g = fw->icon_g.picture_w_g; if (!HAS_NO_ICON_TITLE(fw)) { ret_g->height += fw->icon_g.title_w_g.height; } } else if (!HAS_NO_ICON_TITLE(fw)) { *ret_g = fw->icon_g.title_w_g; } else { memset(ret_g, 0, sizeof(*ret_g)); return False; } return True; } /* returns the icon geometry (unexpanded title plus pixmap) if it exists */ void get_icon_geometry( FvwmWindow *fw, rectangle *ret_g) { /* valid geometry? */ if (fw->icon_g.picture_w_g.width > 0) { *ret_g = fw->icon_g.picture_w_g; if (!HAS_NO_ICON_TITLE(fw)) { ret_g->height += fw->icon_g.title_w_g.height; } } else if (fw->icon_g.title_w_g.width > 0) { *ret_g = fw->icon_g.title_w_g; } /* valid position? */ else if (fw->icon_g.picture_w_g.x != 0 || fw->icon_g.picture_w_g.y != 0) { *ret_g = fw->icon_g.picture_w_g; } else if (fw->icon_g.title_w_g.x != 0 || fw->icon_g.title_w_g.y != 0) { *ret_g = fw->icon_g.title_w_g; } else { memset(ret_g, 0, sizeof(*ret_g)); } return; } /* Returns the visible geometry of a window or icon. This can be used to test * if this region overlaps other windows. */ Bool get_visible_window_or_icon_geometry( FvwmWindow *fw, rectangle *ret_g) { if (IS_ICONIFIED(fw)) { return get_visible_icon_geometry(fw, ret_g); } *ret_g = fw->g.frame; return True; } void move_icon_to_position( FvwmWindow *fw) { Bool draw_picture_w = False; Bool draw_title_w = False; if (fw->icon_g.picture_w_g.width > 0) { int cs; if (Scr.Hilite == fw) { cs = fw->cs_hi; } else { cs = fw->cs; } XMoveWindow( dpy, FW_W_ICON_PIXMAP(fw), fw->icon_g.picture_w_g.x, fw->icon_g.picture_w_g.y); if (fw->icon_alphaPixmap || (cs >= 0 && Colorset[cs].icon_alpha_percent < 100) || CSET_IS_TRANSPARENT(fw->icon_background_cs) || (!IS_ICON_SHAPED(fw) && fw->icon_background_padding > 0)) { draw_picture_w = True; } } if (!HAS_NO_ICON_TITLE(fw)) { int cs; rectangle dummy; if (Scr.Hilite == fw) { cs = fw->icon_title_cs_hi; } else { cs = fw->icon_title_cs; } XMoveWindow( dpy, FW_W_ICON_TITLE(fw), fw->icon_g.title_w_g.x, fw->icon_g.title_w_g.y); if (CSET_IS_TRANSPARENT(cs) && !get_visible_icon_picture_geometry(fw, &dummy) && get_visible_icon_title_geometry(fw, &dummy)) { draw_title_w = True; } } if (draw_title_w || draw_picture_w) { DrawIconWindow( fw, draw_title_w, draw_picture_w, False, draw_picture_w, NULL); } return; } void broadcast_icon_geometry( FvwmWindow *fw, Bool do_force) { rectangle g; Bool rc; rc = get_visible_icon_geometry(fw, &g); if (rc == True && (!IS_ICON_UNMAPPED(fw) || do_force == True)) { BroadcastPacket( M_ICON_LOCATION, 7, (long)FW_W(fw), (long)FW_W_FRAME(fw), (unsigned long)fw, (long)g.x, (long)g.y, (long)g.width, (long)g.height); } return; } void modify_icon_position( FvwmWindow *fw, int dx, int dy) { if (fw->icon_g.picture_w_g.width > 0 || HAS_NO_ICON_TITLE(fw)) { /* picture position is also valid if there is neither a picture * nor a title */ fw->icon_g.picture_w_g.x += dx; fw->icon_g.picture_w_g.y += dy; } if (!HAS_NO_ICON_TITLE(fw)) { fw->icon_g.title_w_g.x += dx; fw->icon_g.title_w_g.y += dy; } return; } /* set the icon position to the specified value. take care of the actual icon * layout */ void set_icon_position( FvwmWindow *fw, int x, int y) { if (fw->icon_g.picture_w_g.width > 0) { fw->icon_g.picture_w_g.x = x; fw->icon_g.picture_w_g.y = y; } else { fw->icon_g.picture_w_g.x = 0; fw->icon_g.picture_w_g.y = 0; } if (!HAS_NO_ICON_TITLE(fw)) { fw->icon_g.title_w_g.x = x; fw->icon_g.title_w_g.y = y; } else { fw->icon_g.title_w_g.x = 0; fw->icon_g.title_w_g.y = 0; } if (fw->icon_g.picture_w_g.width > 0 && !HAS_NO_ICON_TITLE(fw)) { fw->icon_g.title_w_g.x -= (fw->icon_g.title_w_g.width - fw->icon_g.picture_w_g.width) / 2; fw->icon_g.title_w_g.y += fw->icon_g.picture_w_g.height; } else if (fw->icon_g.picture_w_g.width <= 0 && HAS_NO_ICON_TITLE(fw)) { /* In case there is no icon, fake the icon position so the * modules know where its window was iconified. */ fw->icon_g.picture_w_g.x = x; fw->icon_g.picture_w_g.y = y; } return; } void set_icon_picture_size( FvwmWindow *fw, int w, int h) { if (fw->icon_g.picture_w_g.width > 0) { fw->icon_g.picture_w_g.width = w; fw->icon_g.picture_w_g.height = h; } else { fw->icon_g.picture_w_g.width = 0; fw->icon_g.picture_w_g.height = 0; } return; } void resize_icon_title_height(FvwmWindow *fw, int dh) { if (!HAS_NO_ICON_TITLE(fw)) { fw->icon_g.title_w_g.height += dh; } return; } void get_page_offset_rectangle( int *ret_page_x, int *ret_page_y, rectangle *r) { int xoff = Scr.Vx % Scr.MyDisplayWidth; int yoff = Scr.Vy % Scr.MyDisplayHeight; /* maximize on the page where the center of the window is */ *ret_page_x = truncate_to_multiple( r->x + r->width / 2 + xoff, Scr.MyDisplayWidth) - xoff; *ret_page_y = truncate_to_multiple( r->y + r->height / 2 + yoff, Scr.MyDisplayHeight) - yoff; return; } void get_page_offset( int *ret_page_x, int *ret_page_y, FvwmWindow *fw) { rectangle r; r.x = fw->g.frame.x; r.y = fw->g.frame.y; r.width = fw->g.frame.width; r.height = fw->g.frame.height; get_page_offset_rectangle(ret_page_x, ret_page_y, &r); return; } void get_page_offset_check_visible( int *ret_page_x, int *ret_page_y, FvwmWindow *fw) { if (IsRectangleOnThisPage(&fw->g.frame, fw->Desk)) { /* maximize on visible page if any part of the window is * visible */ *ret_page_x = 0; *ret_page_y = 0; } else { get_page_offset(ret_page_x, ret_page_y, fw); } return; } /* ---------------------------- builtin commands --------------------------- */ fvwm-2.6.5.orig/fvwm/builtins.h0000644000175000017500000000061107677641663014627 0ustar vwcvwc/* -*-c-*- */ #ifndef BUILTINS_H #define BUILTINS_H void refresh_window(Window w, Bool window_update); void ApplyDefaultFontAndColors(void); void InitFvwmDecor(FvwmDecor *decor); void reset_decor_changes(void); Bool ReadDecorFace(char *s, DecorFace *df, int button, int verbose); void FreeDecorFace(Display *dpy, DecorFace *df); void update_fvwm_colorset(int cset); #endif /* BUILTINS_H */ fvwm-2.6.5.orig/fvwm/windowshade.c0000644000175000017500000001353110556634174015277 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/Parse.h" #include "libs/Strings.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "misc.h" #include "commands.h" #include "screen.h" #include "module_list.h" #include "module_interface.h" #include "geometry.h" #include "gnome.h" #include "ewmh.h" #include "borders.h" #include "frame.h" #include "focus.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ /* ---------------------------- builtin commands --------------------------- */ /* * * WindowShade -- shades or unshades a window (veliaa@rpi.edu) * * Args: 1 -- shade, 2 -- unshade No Arg: toggle * */ void CMD_WindowShade(F_CMD_ARGS) { direction_t shade_dir; int toggle; frame_move_resize_mode resize_mode; rectangle start_g; rectangle end_g; frame_move_resize_args mr_args; char *token; char *naction; Bool do_force_shading; Bool has_dir; FvwmWindow * const fw = exc->w.fw; if (IS_ICONIFIED(fw) || IS_EWMH_FULLSCREEN(fw)) { return; } token = PeekToken(action, &naction); if (StrEquals("shadeagain", token)) { do_force_shading = True; action = naction; token = PeekToken(action, &naction); } else { do_force_shading = False; } /* parse arguments */ if (StrEquals("Last", token)) { /* last given instead of a direction will make * fvwm to reuse the last used shading direction. * A new, nevershaded window will have * USED_TITLE_DIR_FOR_SHADING set (in add_window.c: * setup_window_structure) */ action = naction; if (!USED_TITLE_DIR_FOR_SHADING(fw)) { shade_dir = SHADED_DIR(fw); } else { shade_dir = DIR_NONE; } } else { /* parse normal direction if last was not given */ shade_dir = gravity_parse_dir_argument(action, NULL, -1); } if (shade_dir >= 0 && shade_dir <= DIR_MASK) { has_dir = True; toggle = (!IS_SHADED(fw) || SHADED_DIR(fw) != shade_dir); } else { has_dir = False; toggle = ParseToggleArgument(action, NULL, -1, 0); if (toggle == -1 && GetIntegerArguments(action, NULL, &toggle, 1) > 0) { if (toggle == 1) { toggle = 1; } else if (toggle == 2) { toggle = 0; } else { toggle = -1; } } if (toggle == -1) { toggle = !(IS_SHADED(fw)); } if (!IS_SHADED(fw) && toggle == 1) { shade_dir = GET_TITLE_DIR(fw); } else if (IS_SHADED(fw) && toggle == 0) { shade_dir = SHADED_DIR(fw); } else { shade_dir = -1; } } if (!IS_SHADED(fw) && toggle == 0) { /* nothing to do */ return; } if (IS_SHADED(fw) && toggle == 1) { if (has_dir == False) { /* nothing to do */ return; } else if (do_force_shading == False) { toggle = 0; } else if (shade_dir == SHADED_DIR(fw)) { return; } } if (toggle == 1) { SET_USED_TITLE_DIR_FOR_SHADING(fw, !has_dir); } /* draw the animation */ start_g = fw->g.frame; get_unshaded_geometry(fw, &end_g); if (toggle == 1) { get_shaded_geometry_with_dir(fw, &end_g, &end_g, shade_dir); } resize_mode = (DO_SHRINK_WINDOWSHADE(fw)) ? FRAME_MR_SHRINK : FRAME_MR_SCROLL; mr_args = frame_create_move_resize_args( fw, resize_mode, &start_g, &end_g, fw->shade_anim_steps, shade_dir); frame_move_resize(fw, mr_args); /* Set the new shade value before destroying the args but after the * animation. */ SET_SHADED(fw, toggle); if (toggle == 1) { SET_SHADED_DIR(fw, shade_dir); } frame_free_move_resize_args(fw, mr_args); border_draw_decorations( fw, PART_TITLEBAR, (fw == get_focus_window()) ? True : False, 0, CLEAR_BUTTONS, NULL, NULL); /* update hints and inform modules */ BroadcastConfig(M_CONFIGURE_WINDOW, fw); BroadcastPacket( (toggle == 1) ? M_WINDOWSHADE : M_DEWINDOWSHADE, 3, (long)FW_W(fw), (long)FW_W_FRAME(fw), (unsigned long)fw); FlushAllMessageQueues(); XFlush(dpy); EWMH_SetWMState(fw, False); GNOME_SetHints(fw); GNOME_SetWinArea(fw); return; } /* set the number or size of shade animation steps, N => steps, Np => pixels */ void CMD_WindowShadeAnimate(F_CMD_ARGS) { char *buf; if (!action) { action = ""; } fvwm_msg( ERR, "CMD_WindowShadeAnimate", "The WindowShadeAnimate command is obsolete. " "Please use 'Style * WindowShadeSteps %s' instead.", action); buf = safemalloc(strlen(action) + 32); sprintf(buf, "* WindowShadeSteps %s", action); action = buf; CMD_Style(F_PASS_ARGS); free(buf); return; } fvwm-2.6.5.orig/fvwm/bindings.c0000644000175000017500000004043111150341107014535 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "libs/modifiers.h" #include "libs/Parse.h" #include "libs/Strings.h" #include "libs/defaults.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "functions.h" #include "bindings.h" #include "module_interface.h" #include "misc.h" #include "screen.h" #include "focus.h" #include "menubindings.h" #include "move_resize.h" /* for placement_binding */ #ifdef HAVE_STROKE #include "stroke.h" #endif /* HAVE_STROKE */ /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static int mods_unused = DEFAULT_MODS_UNUSED; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static void update_nr_buttons( int contexts, int *nr_left_buttons, int *nr_right_buttons, Bool do_set) { int i; int l = *nr_left_buttons; int r = *nr_right_buttons; if (contexts == C_ALL) { return; } /* check for nr_left_buttons */ for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i += 2) { if ((contexts & (C_L1 << i))) { if (do_set || *nr_left_buttons <= i / 2) { *nr_left_buttons = i / 2 + 1; } } } /* check for nr_right_buttons */ for (i = 1; i < NUMBER_OF_TITLE_BUTTONS; i += 2) { if ((contexts & (C_L1 << i))) { if (do_set || *nr_right_buttons <= i / 2) { *nr_right_buttons = i / 2 + 1; } } } if (*nr_left_buttons != l || *nr_right_buttons != r) { Scr.flags.do_need_window_update = 1; Scr.flags.has_nr_buttons_changed = 1; } return; } static int activate_binding(Binding *binding, binding_t type, Bool do_grab) { FvwmWindow *t; Bool rc = 0; if (binding == NULL) { return rc; } if (BIND_IS_PKEY_BINDING(type) || binding->Context == C_ALL) { /* necessary for key bindings that work over unfocused windows */ GrabWindowKeyOrButton( dpy, Scr.Root, binding, C_WINDOW | C_DECOR | C_ROOT | C_ICON | C_EWMH_DESKTOP, GetUnusedModifiers(), None, do_grab); if (do_grab == False) { rc = 1; } } if (do_grab == False && BIND_IS_KEY_BINDING(type) && (binding->Context & C_ROOT)) { rc = 1; } if (fFvwmInStartup == True) { return rc; } /* grab keys immediately */ for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if (!IS_EWMH_DESKTOP(FW_W(t)) && (binding->Context & (C_WINDOW | C_DECOR)) && BIND_IS_KEY_BINDING(type)) { GrabWindowKey( dpy, FW_W_FRAME(t), binding, C_WINDOW | C_DECOR, GetUnusedModifiers(), do_grab); } if (binding->Context & C_ICON) { if (FW_W_ICON_TITLE(t) != None) { GrabWindowKeyOrButton( dpy, FW_W_ICON_TITLE(t), binding, C_ICON, GetUnusedModifiers(), None, do_grab); } if (FW_W_ICON_PIXMAP(t) != None) { GrabWindowKeyOrButton( dpy, FW_W_ICON_PIXMAP(t), binding, C_ICON, GetUnusedModifiers(), None, do_grab); } } if (IS_EWMH_DESKTOP(FW_W(t)) && (binding->Context & C_EWMH_DESKTOP)) { GrabWindowKeyOrButton( dpy, FW_W_PARENT(t), binding, C_EWMH_DESKTOP, GetUnusedModifiers(), None, do_grab); } } return rc; } static int bind_get_bound_button_contexts( Binding **pblist, unsigned short *buttons_grabbed) { int bcontext = 0; Binding *b; if (buttons_grabbed) { *buttons_grabbed = 0; } for (b = *pblist; b != NULL; b = b->NextBinding) { if (!BIND_IS_MOUSE_BINDING(b->type) && !BIND_IS_STROKE_BINDING(b->type)) { continue; } if ((b->Context & (C_WINDOW | C_EWMH_DESKTOP)) && !(BIND_IS_STROKE_BINDING(b->type) && b->Button_Key == 0) && buttons_grabbed != NULL) { if (b->Button_Key == 0) { *buttons_grabbed |= ((1 << NUMBER_OF_EXTENDED_MOUSE_BUTTONS) - 1); } else { *buttons_grabbed |= (1 << (b->Button_Key - 1)); } } if (b->Context != C_ALL && (b->Context & (C_LALL | C_RALL))) { bcontext |= b->Context; } } return bcontext; } static void __rebind_global_key(Binding **pblist, int Button_Key) { Binding *b; for (b = *pblist; b != NULL; b = b->NextBinding) { if (b->Button_Key == Button_Key && (BIND_IS_PKEY_BINDING(b->type) || b->Context == C_ALL)) { activate_binding(b, b->type, True); return; } } return; } /* Parses a mouse or key binding */ static int ParseBinding( Display *dpy, Binding **pblist, char *tline, binding_t type, int *nr_left_buttons, int *nr_right_buttons, unsigned short *buttons_grabbed, Bool is_silent) { char *action; char context_string[20]; char modifier_string[20]; char *ptr; char *token; char key_string[201] = ""; char buffer[80]; char *window_name = NULL; char *p; int button = 0; int n1 = 0; int n2 = 0; int n3 = 0; int context; int modifier; int rc; KeySym keysym = NoSymbol; Bool is_unbind_request = False; Bool is_pass_through = False; Bool is_binding_removed = False; Binding *b; Binding *rmlist = NULL; STROKE_CODE(char stroke[STROKE_MAX_SEQUENCE + 1] = ""); STROKE_CODE(int n4 = 0); STROKE_CODE(int i); /* tline points after the key word "Mouse" or "Key" */ token = p = PeekToken(tline, &ptr); /* check to see if a window name has been specified. */ if (p == NULL) { fvwm_msg( ERR, "ParseBinding", "empty %s binding, ignored\n", tline); return 0; } if (*p == '(') { /* A window name has been specified for the binding. */ sscanf(p + 1, "%79s", buffer); p = buffer; while (*p != ')') { if (*p == '\0') { if (!is_silent) { fvwm_msg( ERR, "ParseBinding", "Syntax error in line %s -" " missing ')'", tline); } return 0; } ++p; } *p++ = '\0'; window_name = buffer; if (*p != '\0') { if (!is_silent) { fvwm_msg( ERR, "ParseBinding", "Syntax error in line %s - trailing" " text after specified window", tline); } return 0; } token = PeekToken(ptr, &ptr); } if (token != NULL) { if (BIND_IS_KEY_BINDING(type)) { /* see len of key_string above */ n1 = sscanf(token,"%200s", key_string); } #ifdef HAVE_STROKE else if (BIND_IS_STROKE_BINDING(type)) { int num = 0; int j; n1 = 1; i = 0; if (token[0] == 'N' && token[1] != '\0') { num = 1; } j=i+num; while (n1 && token[j] != '\0' && i < STROKE_MAX_SEQUENCE) { if (!isdigit(token[j])) { n1 = 0; } if (num) { /* Numeric pad to Telephone */ if ('7' <= token[j] && token[j] <= '9') { token[j] -= 6; } else if ('1' <= token[j] && token[j] <= '3') { token[j] += 6; } } stroke[i] = token[j]; i++; j=i+num; } stroke[i] = '\0'; if (strlen(token) > STROKE_MAX_SEQUENCE + num) { if (!is_silent) { fvwm_msg( WARN, "ParseBinding", "Too long stroke sequence in" " line %s. Only %i elements" " will be taken into" " account.\n", tline, STROKE_MAX_SEQUENCE); } } } #endif /* HAVE_STROKE */ else { n1 = sscanf(token, "%d", &button); if (button < 0) { if (!is_silent) { fvwm_msg( ERR, "ParseBinding", "Illegal mouse button in line" " %s", tline); } return 0; } if (button > NUMBER_OF_MOUSE_BUTTONS) { if (!is_silent) { fvwm_msg( WARN, "ParseBinding", "Got mouse button %d when the" " maximum is %d.\n You can't" " bind complex functions to" " this button. To suppress" " this warning, use:\n" " Silent Mouse %s", button, NUMBER_OF_MOUSE_BUTTONS, tline); } } } } #ifdef HAVE_STROKE if (BIND_IS_STROKE_BINDING(type)) { token = PeekToken(ptr, &ptr); if (token != NULL) { n4 = sscanf(token,"%d", &button); } } #endif /* HAVE_STROKE */ token = PeekToken(ptr, &ptr); if (token != NULL) { n2 = sscanf(token, "%19s", context_string); } token = PeekToken(ptr, &action); if (token != NULL) { n3 = sscanf(token, "%19s", modifier_string); } if (n1 != 1 || n2 != 1 || n3 != 1 STROKE_CODE(|| (BIND_IS_STROKE_BINDING(type) && n4 != 1))) { if (!is_silent) { fvwm_msg( ERR, "ParseBinding", "Syntax error in line %s", tline); } return 0; } if (wcontext_string_to_wcontext( context_string, &context) && !is_silent) { fvwm_msg( WARN, "ParseBinding", "Illegal context in line %s", tline); } if (modifiers_string_to_modmask(modifier_string, &modifier) && !is_silent) { fvwm_msg( WARN, "ParseBinding", "Illegal modifier in line %s", tline); } if (BIND_IS_KEY_BINDING(type)) { keysym = FvwmStringToKeysym(dpy, key_string); /* Don't let a 0 keycode go through, since that means AnyKey * to the XGrabKey call. */ if (keysym == 0) { if (!is_silent) { fvwm_msg( ERR, "ParseBinding", "No such key: %s", key_string); } return 0; } } /* ** strip leading whitespace from action if necessary */ while (*action && (*action == ' ' || *action == '\t')) { action++; } if (action) { is_pass_through = is_pass_through_action(action); if (is_pass_through) { /* pass-through actions indicate that the event be * allowed to pass through to the underlying window. */ if (window_name == NULL) { /* It doesn't make sense to have a pass-through * action on global bindings. */ if (!is_silent) { fvwm_msg( ERR, "ParseBinding", "Invalid action for global " "binding: %s", tline); } return 0; } } } /* see if it is an unbind request */ if (!action || (action[0] == '-' && !is_pass_through)) { is_unbind_request = True; } /* short circuit menu bindings for now. */ if ((context & C_MENU) == C_MENU) { menu_binding( dpy, type, button, keysym, context, modifier, action, window_name); /* ParseBinding returns the number of new bindings in pblist * menu bindings does not add to pblist, and should return 0 */ return 0; } /* short circuit placement bindings for now. */ if ((context & C_PLACEMENT) == C_PLACEMENT) { placement_binding(button,keysym,modifier,action); /* ParseBinding returns the number of new bindings in pblist * placement bindings does not add to pblist, and should * return 0 */ return 0; } /* ** Remove the "old" bindings if any */ /* BEGIN remove */ CollectBindingList( dpy, pblist, &rmlist, type, STROKE_ARG((void *)stroke) button, keysym, modifier, context, window_name); if (rmlist != NULL) { is_binding_removed = True; if (is_unbind_request) { int rc = 0; /* remove the grabs for the key for unbind * requests */ for (b = rmlist; b != NULL; b = b->NextBinding) { /* release the grab */ rc |= activate_binding(b, type, False); } if (rc) { __rebind_global_key( pblist, rmlist->Button_Key); } } FreeBindingList(rmlist); } if (is_binding_removed) { int bcontext; bcontext = bind_get_bound_button_contexts( pblist, buttons_grabbed); update_nr_buttons( bcontext, nr_left_buttons, nr_right_buttons, True); } /* return if it is an unbind request */ if (is_unbind_request) { return 0; } /* END remove */ update_nr_buttons(context, nr_left_buttons, nr_right_buttons, False); if ((modifier & AnyModifier)&&(modifier&(~AnyModifier))) { fvwm_msg( WARN, "ParseBinding", "Binding specified AnyModifier" " and other modifers too. Excess modifiers are" " ignored."); modifier = AnyModifier; } if ( (BIND_IS_MOUSE_BINDING(type) || (BIND_IS_STROKE_BINDING(type) && button != 0)) && (context & (C_WINDOW | C_EWMH_DESKTOP)) && buttons_grabbed != NULL) { if (button == 0) { *buttons_grabbed |= ((1 << NUMBER_OF_EXTENDED_MOUSE_BUTTONS) - 1); } else { *buttons_grabbed |= (1 << (button - 1)); } } rc = AddBinding( dpy, pblist, type, STROKE_ARG((void *)stroke) button, keysym, key_string, modifier, context, (void *)action, NULL, window_name); return rc; } static void binding_cmd(F_CMD_ARGS, binding_t type) { Binding *b; int count; unsigned short btg = Scr.buttons2grab; count = ParseBinding( dpy, &Scr.AllBindings, action, type, &Scr.nr_left_buttons, &Scr.nr_right_buttons, &btg, Scr.flags.are_functions_silent); if (btg != Scr.buttons2grab) { Scr.flags.do_need_window_update = 1; Scr.flags.has_mouse_binding_changed = 1; Scr.buttons2grab = btg; } for ( b = Scr.AllBindings; count > 0 && b != NULL; count--, b = b->NextBinding) { activate_binding(b, type, True); } return; } void print_bindings(void) { Binding *b; fprintf(stderr, "Current list of bindings:\n\n"); for (b = Scr.AllBindings; b != NULL; b = b->NextBinding) { switch (b->type) { case BIND_KEYPRESS: fprintf(stderr, "Key"); break; case BIND_PKEYPRESS: fprintf(stderr, "PointerKey"); break; case BIND_BUTTONPRESS: case BIND_BUTTONRELEASE: fprintf(stderr, "Mouse"); break; case BIND_STROKE: fprintf(stderr, "Stroke"); break; default: fvwm_msg( ERR, "print_bindings", "invalid binding type %d", b->type); continue; } if (b->windowName != NULL) { fprintf(stderr, " (%s)", b->windowName); } switch (b->type) { case BIND_KEYPRESS: case BIND_PKEYPRESS: fprintf(stderr, "\t%s", b->key_name); break; case BIND_BUTTONPRESS: case BIND_BUTTONRELEASE: fprintf(stderr, "\t%d", b->Button_Key); break; case BIND_STROKE: STROKE_CODE( fprintf( stderr, "\t%s\t%d", (char *)b->Stroke_Seq, b->Button_Key)); break; } { char *mod_string; char *context_string; mod_string = charmap_table_to_string( MaskUsedModifiers(b->Modifier),key_modifiers); context_string = charmap_table_to_string( b->Context, win_contexts); fprintf( stderr, "\t%s\t%s\t%s\n", context_string, mod_string, (char *)b->Action); free(mod_string); free(context_string); } } return; } /* ---------------------------- interface functions ------------------------ */ /* Removes all unused modifiers from in_modifiers */ unsigned int MaskUsedModifiers(unsigned int in_modifiers) { return in_modifiers & ~mods_unused; } unsigned int GetUnusedModifiers(void) { return mods_unused; } /* ---------------------------- builtin commands --------------------------- */ void CMD_Key(F_CMD_ARGS) { binding_cmd(F_PASS_ARGS, BIND_KEYPRESS); return; } void CMD_PointerKey(F_CMD_ARGS) { binding_cmd(F_PASS_ARGS, BIND_PKEYPRESS); return; } void CMD_Mouse(F_CMD_ARGS) { binding_cmd(F_PASS_ARGS, BIND_BUTTONPRESS); return; } #ifdef HAVE_STROKE void CMD_Stroke(F_CMD_ARGS) { binding_cmd(F_PASS_ARGS, BIND_STROKE); return; } #endif /* HAVE_STROKE */ /* Declares which X modifiers are actually locks and should be ignored when * testing mouse/key binding modifiers. */ void CMD_IgnoreModifiers(F_CMD_ARGS) { char *token; int mods_unused_old = mods_unused; token = PeekToken(action, &action); if (!token) { mods_unused = 0; } else if (StrEquals(token, "default")) { mods_unused = DEFAULT_MODS_UNUSED; } else if (modifiers_string_to_modmask(token, &mods_unused)) { fvwm_msg( ERR, "ignore_modifiers", "illegal modifier in line %s\n", action); } if (mods_unused != mods_unused_old) { /* broadcast config to modules */ broadcast_ignore_modifiers(); } return; } fvwm-2.6.5.orig/fvwm/fvwm.h0000644000175000017500000007367211641302505013745 0ustar vwcvwc/* -*-c-*- */ /* This module is based on Twm, but has been siginificantly modified * by Rob Nation */ /* * Copyright 1988 by Evans & Sutherland Computer Corporation, * Salt Lake City, Utah * Portions Copyright 1989 by the Massachusetts Institute of Technology * Cambridge, Massachusetts * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permis- * sion notice appear in supporting documentation, and that the * names of Evans & Sutherland and M.I.T. not be used in advertising * in publicity pertaining to distribution of the software without * specific, written prior permission. * * EVANS & SUTHERLAND AND M.I.T. DISCLAIM ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- * ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND OR * M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- * AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA * OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE * OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef FVWM_H #define FVWM_H /* ---------------------------- included header files ---------------------- */ #include #include #include #include #include "libs/PictureBase.h" #include "libs/Flocale.h" #include "libs/fvwmrect.h" #include "window_flags.h" #include "condrc.h" /* ---------------------------- global definitions ------------------------- */ #ifndef WithdrawnState #define WithdrawnState 0 #endif /* ---------------------------- global macros ------------------------------ */ /* * Fvwm trivia: There were 97 commands in the fvwm command table * when the F_CMD_ARGS macro was written. * dje 12/19/98. */ /* Macro for args passed to fvwm commands... */ #define F_CMD_ARGS \ cond_rc_t *cond_rc, const exec_context_t *exc, char *action #define F_PASS_ARGS cond_rc, exc, action #define FUNC_FLAGS_TYPE unsigned char /* access macros */ #define FW_W_FRAME(fw) ((fw)->wins.frame) #define FW_W_PARENT(fw) ((fw)->wins.parent) #define FW_W_CLIENT(fw) ((fw)->wins.client) #define FW_W(fw) FW_W_CLIENT(fw) #define FW_W_TITLE(fw) ((fw)->wins.title) #define FW_W_BUTTON(fw,i) ((fw)->wins.button_w[(i)]) #define FW_W_SIDE(fw,i) ((fw)->wins.sides[(i)]) #define FW_W_CORNER(fw,i) ((fw)->wins.corners[(i)]) #define FW_W_ICON_TITLE(fw) ((fw)->wins.icon_title_w) #define FW_W_ICON_PIXMAP(fw) ((fw)->wins.icon_pixmap_w) #define FW_W_TRANSIENTFOR(fw) ((fw)->wins.transientfor) /* ---------------------------- forward declarations ----------------------- */ struct size_borders; struct exec_context_t; #ifdef USEDECOR /* definition in screen.h */ struct FvwmDecor; #endif /* ---------------------------- type definitions --------------------------- */ /* This structure carries information about the initial window state and * placement. This information is gathered at various places: the (re)capture * code, AddToWindow(), HandleMapRequestRaised(), ewmh_events.c and others. * * initial_state * The initial window state. By default it carries the value DontCareState. * Other states can be set if * - an icon is recaptured or restarted with session management * - the StartIconic style is set * - GNOME, EWMH, foobar hints demand that the icon starts iconic * The final value is calculated in HandleMapRequestRaised(). * * do_override_ppos * This flag is used in PlaceWindow(). If it is set, the position requested * by the program is ignored unconditionally. This is used during the * initial capture and later recapture operations. * * is_iconified_by_parent * Preserves the information if the window is a transient window that was * iconified along with its transientfor window. Set when the window is * recaptured and used in HandleMapRequestRaised() to set the according * window state flag. Deleted afterwards. * * is_menu * Set in menus.c or in the recapture code if the new window is a tear off * menu. Such windows get special treatment in AddWindow() and events.c. * * is_recapture * Set for the initial capture and later recaptures. * * default_icon_x/y * The icon position that was requested by the application in the icon * position hint. May be overridden by a style (0/0 then). Set in * HandleMapRequestRaised() and used in the icon placement code. * * initial_icon_x/y * The icon position that is forced during a restart with SM. If set it * overrides all other methods of icon placement. Set by session.c and used * in the icon placement code. * * use_initial_icon_xy * If set, the initial_icon_x/y values are used. Other wise they are * ignored. */ typedef struct { long initial_state; struct { unsigned do_override_ppos : 1; unsigned is_iconified_by_parent : 1; unsigned is_menu : 1; unsigned is_recapture : 1; unsigned use_initial_icon_xy : 1; } flags; int initial_icon_x; int initial_icon_y; int default_icon_x; int default_icon_y; } initial_window_options_t; /* For 1 style statement, there can be any number of IconBoxes. The name list points at the first one in the chain. */ typedef struct icon_boxes_struct { struct icon_boxes_struct *next; /* next icon_boxes or zero */ unsigned int use_count; int IconBox[4]; /* x/y x/y for iconbox */ int IconScreen; /* Xinerama screen */ short IconGrid[2]; /* x incr, y incr */ char IconSign[4]; /* because of -0, need to save */ unsigned is_orphan : 1; unsigned IconFlags : 3; /* some bits */ /* IconFill only takes 3 bits. Defaults are top, left, vert co-ord * first eg: t l = 0,0,0; l t = 0,0,1; b r = 1,1,0 */ #define ICONFILLBOT (1<<0) #define ICONFILLRGT (1<<1) #define ICONFILLHRZ (1<<2) } icon_boxes; typedef struct { Pixel fore; Pixel back; } ColorPair; typedef struct { Pixel fore; Pixel back; Pixel hilight; Pixel shadow; } color_quad; typedef struct { int left; int right; int top; int bottom; } ewmh_strut; typedef struct { /* common flags (former flags in bits 0-12) */ unsigned is_sticky_across_pages : 1; unsigned is_sticky_across_desks : 1; unsigned has_icon_font : 1; unsigned has_no_border : 1; unsigned has_window_font : 1; unsigned title_dir : 2; unsigned user_states : 32; /* static flags that do not change dynamically after the window has * been created */ struct { unsigned do_circulate_skip : 1; unsigned do_circulate_skip_icon : 1; unsigned do_circulate_skip_shaded : 1; unsigned do_ewmh_donate_icon : 1; unsigned do_ewmh_donate_mini_icon : 1; unsigned do_ewmh_ignore_state_hints : 1; unsigned do_ewmh_ignore_strut_hints : 1; unsigned do_ewmh_mini_icon_override : 1; unsigned do_ewmh_use_stacking_hints : 1; unsigned do_ewmh_ignore_window_type : 1; unsigned do_iconify_window_groups : 1; unsigned do_ignore_gnome_hints : 1; unsigned do_ignore_icon_boxes : 1; unsigned do_ignore_restack : 1; unsigned do_use_window_group_hint : 1; unsigned do_lower_transient : 1; unsigned do_not_show_on_map : 1; unsigned do_raise_transient : 1; unsigned do_resize_opaque : 1; unsigned do_shrink_windowshade : 1; unsigned do_stack_transient_parent : 1; unsigned do_window_list_skip : 1; unsigned ewmh_maximize_mode : 2; /* see ewmh.h */ unsigned has_depressable_border : 1; unsigned has_mwm_border : 1; unsigned has_mwm_buttons : 1; unsigned has_mwm_override : 1; unsigned has_no_icon_title : 1; unsigned has_override_size : 1; unsigned has_stippled_title : 1; unsigned has_stippled_icon_title : 1; /* default has to be 0, therefore no_, not in macros */ unsigned has_no_sticky_stippled_title : 1; unsigned has_no_sticky_stippled_icon_title : 1; unsigned icon_override : 2; #define NO_ACTIVE_ICON_OVERRIDE 0 #define ICON_OVERRIDE 1 #define NO_ICON_OVERRIDE 2 #define ICON_OVERRIDE_MASK 0x3 unsigned is_bottom_title_rotated : 1; unsigned is_fixed : 1; unsigned is_fixed_ppos : 1; unsigned is_uniconifiable : 1; unsigned is_unmaximizable : 1; unsigned is_unclosable : 1; unsigned is_maximize_fixed_size_disallowed : 1; unsigned is_icon_sticky_across_pages : 1; unsigned is_icon_sticky_across_desks : 1; unsigned is_icon_suppressed : 1; unsigned is_left_title_rotated_cw : 1; /* cw = clock wise */ unsigned is_lenient : 1; unsigned is_size_fixed : 1; unsigned is_psize_fixed : 1; unsigned is_right_title_rotated_cw : 1; unsigned is_top_title_rotated : 1; unsigned use_icon_position_hint : 1; unsigned use_indexed_window_name : 1; unsigned use_indexed_icon_name : 1; #define WINDOWSHADE_LAZY 0 #define WINDOWSHADE_ALWAYS_LAZY 1 #define WINDOWSHADE_BUSY 2 #define WINDOWSHADE_LAZY_MASK 0x3 unsigned windowshade_laziness : 2; unsigned use_title_decor_rotation : 1; focus_policy_t focus_policy; } s; } common_flags_t; typedef struct { common_flags_t common; #define CR_MOTION_METHOD_AUTO 0 #define CR_MOTION_METHOD_USE_GRAV 1 #define CR_MOTION_METHOD_STATIC_GRAV 2 #define CR_MOTION_METHOD_MASK 0x3 unsigned cr_motion_method : 2; unsigned was_cr_motion_method_detected : 1; unsigned does_wm_delete_window : 1; unsigned does_wm_take_focus : 1; unsigned do_force_next_cr : 1; unsigned do_force_next_pn : 1; unsigned do_iconify_after_map : 1; unsigned do_disable_constrain_size_fullscreen : 1; /* Reuse this struct, don't free it, when destroying/recapturing * window. */ unsigned do_reuse_destroyed : 1; /* Does it have resize handles? */ unsigned has_handles : 1; /* Icon change is pending */ unsigned has_icon_changed : 1; /* Is this decorated with title */ unsigned has_title : 1; /* wm_normal_hints update is pending? */ unsigned has_new_wm_normal_hints : 1; /* ChangeDecor was used for window */ unsigned is_decor_changed : 1; /* Sent an XUnmapWindow for iconifying, but didn't receive an * UnmapNotify yet.*/ unsigned is_iconify_pending : 1; /* window had the focus when the desk was switched. set if the window * was mapped and got focused but the focus change was not announced * to the modules yet. */ unsigned is_focused_on_other_desk : 1; unsigned is_focus_change_broadcast_pending : 1; /* is the window fully visible */ unsigned is_fully_visible : 1; /* is it an icon now? */ unsigned is_iconified : 1; /* To prevent iconified transients in a parent icon from counting for * Next */ unsigned is_iconified_by_parent : 1; /* is the pointer over the icon? */ unsigned is_icon_entered : 1; unsigned is_icon_font_loaded : 1; /* has the icon been moved by the user? */ unsigned is_icon_moved : 1; /* is the icon window supplied by the app? */ unsigned is_icon_ours : 1; /* is the icon shaped? */ unsigned is_icon_shaped : 1; /* was the icon unmapped, even though the window is still iconified * (Transients) */ unsigned is_icon_unmapped : 1; /* temporary flag used in stack.c */ unsigned is_in_transient_subtree : 1; /* is it mapped? */ unsigned is_mapped : 1; /* Sent an XMapWindow, but didn't receive a MapNotify yet.*/ unsigned is_map_pending : 1; /* is the window maximized? */ unsigned is_maximized : 1; /* Set if the client changes its WM_NAME. The source of twm contains * an explanation why we need this information. */ unsigned is_name_changed : 1; /* is the window partially visible */ unsigned is_partially_visible : 1; /* is the icon pixmap ours to free? */ unsigned is_pixmap_ours : 1; /* fvwm places the window itself */ unsigned is_placed_by_fvwm : 1; /* mark window to be destroyed after last complex func has finished. */ unsigned is_scheduled_for_destroy : 1; /* mark window to be raised after function execution. */ unsigned is_scheduled_for_raise : 1; unsigned is_size_inc_set : 1; unsigned is_style_deleted : 1; /* the window is a torn out fvwm menu */ unsigned is_tear_off_menu : 1; /* is it a transient window? */ unsigned is_transient : 1; unsigned is_window_drawn_once : 1; /* To prevent double move in MoveViewport.*/ unsigned is_viewport_moved : 1; unsigned is_window_being_moved_opaque : 1; unsigned is_window_font_loaded : 1; unsigned is_window_shaded : 1; unsigned used_title_dir_for_shading : 1; unsigned shaded_dir : 3; unsigned using_default_icon_font : 1; unsigned using_default_window_font : 1; #define ICON_HINT_NEVER 0 #define ICON_HINT_ONCE 1 #define ICON_HINT_MULTIPLE 2 unsigned was_icon_hint_provided : 2; unsigned was_icon_name_provided : 1; unsigned was_never_drawn : 1; unsigned has_ewmh_wm_name : 1; unsigned has_ewmh_wm_icon_name : 1; #define EWMH_NO_ICON 0 /* the application does not provide an ewmh icon */ #define EWMH_TRUE_ICON 1 /* the application does provide an ewmh icon */ #define EWMH_FVWM_ICON 2 /* the ewmh icon has been set by fvwm */ unsigned has_ewmh_wm_icon_hint : 2; /* says if the app have an ewmh icon of acceptable size for a mini * icon in its list of icons */ unsigned has_ewmh_mini_icon : 1; unsigned has_ewmh_wm_pid : 1; /* the ewmh icon is used as icon pixmap */ unsigned use_ewmh_icon : 1; unsigned is_ewmh_modal : 1; unsigned is_ewmh_fullscreen : 1; #define EWMH_STATE_UNDEFINED_HINT 0 #define EWMH_STATE_NO_HINT 1 #define EWMH_STATE_HAS_HINT 2 unsigned has_ewmh_init_fullscreen_state : 2; unsigned has_ewmh_init_hidden_state : 2; unsigned has_ewmh_init_maxhoriz_state : 2; unsigned has_ewmh_init_maxvert_state : 2; unsigned has_ewmh_init_modal_state : 2; unsigned has_ewmh_init_shaded_state : 2; unsigned has_ewmh_init_skip_pager_state : 2; unsigned has_ewmh_init_skip_taskbar_state : 2; unsigned has_ewmh_init_sticky_state : 2; unsigned has_ewmh_init_wm_desktop : 2; } window_flags; /* Actions allowed by modules. */ typedef struct action_flags { unsigned is_movable : 1; unsigned is_deletable : 1; unsigned is_destroyable : 1; unsigned is_closable : 1; unsigned is_maximizable : 1; unsigned is_resizable : 1; unsigned is_iconifiable : 1; } action_flags; /* Window name data structure for window conditions: a list of lists of names to match, the boolean operation on the matches being an AND of ORs. */ struct namelist /* matches to names in this list are ORed */ { char *name; struct namelist *next; }; struct name_condition /* matches to namelists in this list are ANDed, after possibly inverting each */ { Bool invert; struct namelist *namelist; struct name_condition *next; }; /* Window mask for Circulate and Direction functions */ typedef struct WindowConditionMask { struct { unsigned do_accept_focus : 1; unsigned do_check_desk : 1; unsigned do_check_desk_and_global_page : 1; unsigned do_check_desk_and_page : 1; unsigned do_check_global_page : 1; unsigned do_check_overlapped : 1; unsigned do_check_page : 1; unsigned do_not_check_screen : 1; unsigned needs_current_desk : 1; unsigned needs_current_desk_and_global_page : 1; unsigned needs_current_desk_and_page : 1; unsigned needs_current_global_page : 1; unsigned needs_current_page : 1; #define NEEDS_ANY 0 #define NEEDS_TRUE 1 #define NEEDS_FALSE 2 unsigned needs_focus : 2; unsigned needs_overlapped : 2; unsigned needs_pointer : 2; unsigned needs_same_layer : 1; unsigned use_circulate_hit : 1; unsigned use_circulate_hit_icon : 1; unsigned use_circulate_hit_shaded : 1; unsigned use_do_accept_focus : 1; } my_flags; window_flags flags; window_flags flag_mask; struct name_condition *name_condition; int layer; int placed_by_button_mask; int placed_by_button_set_mask; } WindowConditionMask; typedef struct pl_penalty_struct { float normal; float ontop; float icon; float sticky; float below; float strut; } pl_penalty_struct; typedef struct pl_percent_penalty_struct { int p99; int p95; int p85; int p75; } pl_percent_penalty_struct; /* only style.c and add_window.c are allowed to access this struct! */ typedef struct style_flags { common_flags_t common; unsigned do_decorate_transient : 1; /* old placement flags */ #define PLACE_DUMB 0x0 #define PLACE_SMART 0x1 #define PLACE_CLEVER 0x2 #define PLACE_CLEVERNESS_MASK 0x3 #define PLACE_RANDOM 0x4 /* new placements value, try to get a minimal backward compatibility * with the old flags: * Dumb+Active = Manual, * Dumb+Random = Cascade, * Smart+Random = TileCascade, * Smart+Active = TileManual, * Random+Smart+Clever = MINOVERLAP which is the original Clever * placement code, * Active+Smart+Clever = MINOVERLAPPERCENT which is the "new" Clever * placement code and was the original Clever placement code. Now the * original placement code said: * Active/Random+Dumb+Clever = Active/Random+Dumb (with Dumb Clever is * ignored); These represent the not use value: 0x2=Active+Dumb+Clever, * 0x6=Random+Dumb+Clever */ #define PLACE_MANUAL 0x0 #define PLACE_TILEMANUAL 0x1 #define PLACE_MANUAL_B 0x2 #define PLACE_MINOVERLAPPERCENT 0x3 #define PLACE_CASCADE 0x4 #define PLACE_TILECASCADE 0x5 #define PLACE_CASCADE_B 0x6 #define PLACE_MINOVERLAP 0x7 #define PLACE_POSITION 0x8 #define PLACE_MASK 0xF unsigned placement_mode : 4; unsigned ewmh_placement_mode : 2; /* see ewmh.h */ #define WS_CR_MOTION_METHOD_AUTO CR_MOTION_METHOD_AUTO #define WS_CR_MOTION_METHOD_USE_GRAV CR_MOTION_METHOD_USE_GRAV #define WS_CR_MOTION_METHOD_STATIC_GRAV CR_MOTION_METHOD_STATIC_GRAV #define WS_CR_MOTION_METHOD_MASK CR_MOTION_METHOD_MASK unsigned ws_cr_motion_method : 2; unsigned do_save_under : 1; unsigned do_start_iconic : 1; unsigned do_start_lowered : 1; unsigned do_start_shaded : 1; unsigned start_shaded_dir : 3; unsigned has_border_width : 1; unsigned has_color_back : 1; unsigned has_color_fore : 1; unsigned has_color_back_hi : 1; unsigned has_color_fore_hi : 1; unsigned has_decor : 1; unsigned has_edge_delay_ms_move : 1; unsigned has_edge_delay_ms_resize : 1; unsigned has_edge_resistance_move : 1; unsigned has_edge_resistance_xinerama_move : 1; unsigned has_handle_width : 1; unsigned has_icon : 1; unsigned has_icon_boxes : 1; unsigned has_icon_size_limits : 1; unsigned has_min_window_size : 1; unsigned has_max_window_size : 1; unsigned has_icon_background_padding : 1; unsigned has_icon_background_relief : 1; unsigned has_icon_title_relief : 1; unsigned has_window_shade_steps : 1; unsigned has_mini_icon : 1; unsigned has_mwm_decor : 1; unsigned has_mwm_functions : 1; unsigned has_no_handles : 1; unsigned has_no_title : 1; unsigned has_ol_decor : 1; unsigned has_snap_grid : 1; unsigned has_snap_attraction : 1; #if 0 unsigned has_condition_mask : 1; #endif unsigned is_button_disabled : NUMBER_OF_TITLE_BUTTONS; unsigned is_unmanaged : 1; #define BACKINGSTORE_DEFAULT 0 #define BACKINGSTORE_ON 1 #define BACKINGSTORE_OFF 2 #define BACKINGSTORE_MASK 0x3 unsigned use_backing_store : 2; unsigned use_parent_relative : 1; unsigned use_colorset : 1; unsigned use_colorset_hi : 1; unsigned use_border_colorset : 1; unsigned use_border_colorset_hi : 1; unsigned use_icon_title_colorset : 1; unsigned use_icon_title_colorset_hi : 1; unsigned use_icon_background_colorset : 1; unsigned use_layer : 1; unsigned use_no_pposition : 1; unsigned use_no_usposition : 1; unsigned use_no_transient_pposition : 1; unsigned use_no_transient_usposition : 1; unsigned use_start_on_desk : 1; unsigned use_start_on_page_for_transient : 1; unsigned use_start_on_screen : 1; unsigned manual_placement_honors_starts_on_page : 1; unsigned um_placement_honors_starts_on_page : 1; unsigned capture_honors_starts_on_page : 1; unsigned recapture_honors_starts_on_page : 1; unsigned has_placement_penalty : 1; unsigned has_placement_percentage_penalty : 1; unsigned has_placement_position_string : 1; unsigned has_initial_map_command_string : 1; unsigned has_title_format_string : 1; unsigned has_icon_title_format_string : 1; } style_flags; typedef struct style_id_t { char *name; XID window_id; struct { unsigned has_name:1; unsigned has_window_id:1; } flags; } style_id_t; typedef struct snap_attraction_t { /* attractiveness of window edges */ int proximity; /* mode of snap attraction */ int mode; /* mode flags to do bit manipulation */ enum { SNAP_NONE = 0x00, SNAP_WINDOWS = 0x01, SNAP_ICONS = 0x02, SNAP_SAME = 0x04, SNAP_SCREEN = 0x08, SNAP_SCREEN_WINDOWS = 0x10, SNAP_SCREEN_ICONS = 0x20, SNAP_SCREEN_ALL = 0x40, } types; } snap_attraction_t; /* only style.c and add_window.c are allowed to access this struct! */ typedef struct window_style { struct window_style *next; struct window_style *prev; style_id_t id; #if 0 WindowConditionMask *condition_mask; #endif char *icon_name; char *mini_icon_name; #ifdef USEDECOR char *decor_name; #endif unsigned char min_icon_width; unsigned char max_icon_width; unsigned char min_icon_height; unsigned char max_icon_height; #define ICON_RESIZE_TYPE_NONE 0x0 #define ICON_RESIZE_TYPE_STRETCHED 0x1 #define ICON_RESIZE_TYPE_ADJUSTED 0x2 #define ICON_RESIZE_TYPE_SHRUNK 0x3 #define ICON_RESIZE_TYPE_MASK 0x3 unsigned icon_resize_type : 2; unsigned char icon_background_padding; signed char icon_background_relief; signed char icon_title_relief; char *icon_font; char *window_font; char *fore_color_name; char *back_color_name; char *fore_color_name_hi; char *back_color_name_hi; int colorset; int colorset_hi; int border_colorset; int border_colorset_hi; int icon_title_colorset; int icon_title_colorset_hi; int icon_background_colorset; short border_width; /* resize handle width */ short handle_width; int layer; int start_desk; int start_page_x; int start_page_y; int start_screen; int min_window_width; int min_window_height; int max_window_width; int max_window_height; int shade_anim_steps; #if 1 /*!!!*/ snap_attraction_t snap_attraction; /* snap grid size */ int snap_grid_x; int snap_grid_y; int edge_delay_ms_move; int edge_delay_ms_resize; int edge_resistance_move; int edge_resistance_xinerama_move; #endif icon_boxes *icon_boxes; float norm_placement_penalty; pl_penalty_struct pl_penalty; pl_percent_penalty_struct pl_percent_penalty; char *pl_position_string; char *initial_map_command_string; char *title_format_string; char *icon_title_format_string; style_flags flags; style_flags flag_default; style_flags flag_mask; style_flags change_mask; unsigned has_style_changed : 1; unsigned has_title_format_string : 1; unsigned has_icon_title_format_string : 1; } window_style; typedef struct window_g { rectangle frame; /* absolute geometry when not maximized */ rectangle normal; /* maximized window geometry */ rectangle max; /* defect between maximized geometry before and after * constraining size. */ size_rect max_defect; /* original delta between normalized and maximized window, * used to keep unmaximized window at same screen position */ position max_offset; } window_g; /* for each window that is on the display, one of these structures * is allocated and linked into a list */ typedef struct FvwmWindow { /* name of the window */ FlocaleNameString name; /* name of the icon */ FlocaleNameString icon_name; char *visible_name; char *visible_icon_name; /* if non-null: Use this instead of any other names for matching styles */ char *style_name; int name_count; int icon_name_count; /* next fvwm window */ struct FvwmWindow *next; /* prev fvwm window */ struct FvwmWindow *prev; /* next (lower) fvwm window in stacking order*/ struct FvwmWindow *stack_next; /* prev (higher) fvwm window in stacking order */ struct FvwmWindow *stack_prev; /* border width before reparenting */ struct { /* the frame window */ Window frame; /* It looks like you HAVE to reparent the app window into a * window whose size = app window, or else you can't keep xv * and matlab happy at the same time! */ Window parent; /* the child window */ Window client; /* the title bar window and button windows */ Window title; Window button_w[NUMBER_OF_TITLE_BUTTONS]; /* sides of the border */ Window sides[4]; /* corner pieces */ Window corners[4]; /* icon title window */ Window icon_title_w; /* icon picture window */ Window icon_pixmap_w; Window transientfor; } wins; window_flags flags; struct { unsigned buttons_drawn : NUMBER_OF_TITLE_BUTTONS; unsigned buttons_lit : NUMBER_OF_TITLE_BUTTONS; unsigned buttons_inverted : NUMBER_OF_TITLE_BUTTONS; unsigned buttons_toggled : NUMBER_OF_TITLE_BUTTONS; unsigned parts_drawn : 12; unsigned parts_lit : 12; unsigned parts_inverted : 12; } decor_state; int nr_left_buttons; int nr_right_buttons; #define BUTTON_INDEX(b) \ (((b) == 0) ? (NUMBER_OF_TITLE_BUTTONS - 1) : ((b) - 1)) #ifdef USEDECOR struct FvwmDecor *decor; #endif /* is this a shaped window */ int wShaped; Pixmap title_background_pixmap; /* Note: if the type of this variable is changed, do update the * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h too! */ short boundary_width; short unshaped_boundary_width; short corner_width; short visual_corner_width; /* title font */ FlocaleFont *title_font; /* /Y coordinate to draw the title name */ short title_text_offset; short title_length; /* Note: if the type of this variable is changed, do update the * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too! */ short title_thickness; rotation_t title_text_rotation; struct { /* geometry of the icon picture window */ rectangle picture_w_g; /* geometry of the icon title window */ rectangle title_w_g; /* width of the text in the icon title */ int title_text_width; } icon_g; short icon_border_width; /* Drawable depth for the icon */ int iconDepth; /* pixmap for the icon */ Pixmap iconPixmap; /* pixmap for the icon mask */ Pixmap icon_maskPixmap; Pixmap icon_alphaPixmap; int icon_nalloc_pixels; Pixel *icon_alloc_pixels; int icon_no_limit; FlocaleFont *icon_font; /* some parts of the window attributes */ struct { int backing_store; int border_width; int depth; int bit_gravity; unsigned is_bit_gravity_stored : 1; Visual *visual; Colormap colormap; } attr_backup; /* normal hints */ XSizeHints hints; struct { int width_inc; int height_inc; } orig_hints; /* WM hints */ XWMHints *wmhints; XClassHint class; /* Tells which desktop this window is on */ /* Note: if the type of this variable is changed, do update the * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too! */ int Desk; /* Where (if at all) was it focused */ int FocusDesk; /* Desk to deiconify to, for StubbornIcons */ int DeIconifyDesk; char *mini_pixmap_file; FvwmPicture *mini_icon; char *icon_bitmap_file; struct window_g g; long *mwm_hints; int ol_hints; int functions; /* Colormap windows property */ Window *cmap_windows; /* Should generally be 0 */ int number_cmap_windows; color_quad colors; color_quad hicolors; color_quad border_colors; color_quad border_hicolors; int cs; int cs_hi; int border_cs; int border_cs_hi; int icon_title_cs; int icon_title_cs_hi; int icon_background_cs; unsigned long buttons; /* zero or more iconboxes */ icon_boxes *IconBoxes; int default_layer; /* Note: if the type of this variable is changed, do update the * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too! */ int layer; unsigned char min_icon_width; unsigned char max_icon_width; unsigned char min_icon_height; unsigned char max_icon_height; unsigned short icon_resize_type; unsigned char icon_background_padding; char icon_background_relief; char icon_title_relief; int min_window_width; int min_window_height; int max_window_width; int max_window_height; int shade_anim_steps; unsigned char grabbed_buttons; #if 1 /*!!!*/ snap_attraction_t snap_attraction; /* snap grid size */ int snap_grid_x; int snap_grid_y; int edge_delay_ms_move; int edge_delay_ms_resize; int edge_resistance_move; int edge_resistance_xinerama_move; #endif #define FM_NO_INPUT 0 #define FM_PASSIVE 1 #define FM_LOCALLY_ACTIVE 2 #define FM_GLOBALLY_ACTIVE 3 unsigned char focus_model; pl_penalty_struct pl_penalty; pl_percent_penalty_struct pl_percent_penalty; unsigned char placed_by_button; #define EWMH_WINDOW_TYPE_NONE_ID 0 #define EWMH_WINDOW_TYPE_DESKTOP_ID 1 #define EWMH_WINDOW_TYPE_DIALOG_ID 2 #define EWMH_WINDOW_TYPE_DOCK_ID 3 #define EWMH_WINDOW_TYPE_MENU_ID 4 #define EWMH_WINDOW_TYPE_NORMAL_ID 5 #define EWMH_WINDOW_TYPE_TOOLBAR_ID 6 #define EWMH_WINDOW_TYPE_NOTIFICATION_ID 7 /* Note: if the type of this variable is changed, do update the * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too! */ int ewmh_window_type; /* icon geometry */ rectangle ewmh_icon_geometry; /* for computing the working area */ ewmh_strut strut; /* for the dynamic working area */ ewmh_strut dyn_strut; /* memories for the icons we set on the */ int ewmh_icon_height; /* _NET_WM_ICON */ int ewmh_icon_width; int ewmh_mini_icon_height; int ewmh_mini_icon_width; /* memory for the initial _NET_WM_STATE */ /* Note: if the type of this variable is changed, do update the * CONFIGARGSNEW macro in module_interface.c, libs/vpacket.h and too! */ int ewmh_hint_layer; int ewmh_normal_layer; /* for restoring non ewmh layer */ /* memory for the initial _NET_WM_STATE */ unsigned long ewmh_hint_desktop; /* For the purposes of restoring attributes before/after a window goes * into fullscreen. */ struct { struct window_g g; int is_iconified; int is_shaded; int was_maximized; } fullscreen; /* multi purpose scratch structure */ struct { void *p; int i; } scratch; } FvwmWindow; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void SetMWM_INFO(Window window); void fvmm_deinstall_signals(void); #endif /* FVWM_H */ fvwm-2.6.5.orig/fvwm/gnome.c0000644000175000017500000007240410656151547014073 0ustar vwcvwc/* -*-c-*- */ /* * GNOME WM Compliance adapted for fvwm * Properties set on the root window (or desktop window) * * Even though the rest of fvwm is GPL consider this file * Public Domain - use it however you see fit to make * your WM GNOME compiant * * written by Raster * adapted for fvwm by Jay Painter */ #include "config.h" #include #ifdef HAVE_FCNTL_H #include #endif #include #include #include #include "libs/fvwmlib.h" #include "libs/Parse.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "functions.h" #include "commands.h" #include "misc.h" #include "screen.h" #include "gnome.h" #include "move_resize.h" #include "stack.h" #include "update.h" #include "style.h" #include "virtual.h" #include "window_flags.h" #include "borders.h" #include "decorations.h" /* * Properties set on the root window (or desktop window) */ /* WIN_AREA CARD32[2] contains the current desktop area X,Y */ #define XA_WIN_AREA "_WIN_AREA" /* WIN_AREA CARD32[2] contains the current desktop area size WxH */ #define XA_WIN_AREA_COUNT "_WIN_AREA_COUNT" /* array of atoms - atom being one of the following atoms */ #define XA_WIN_PROTOCOLS "_WIN_PROTOCOLS" /* array of iocn in various sizes */ /* Type: array of CARD32 */ /* first item is icon count (n) */ /* second item is icon record length (in CARD32s) */ /* this is followed by (n) icon records as follows */ /* pixmap (XID) */ /* mask (XID) */ /* width (CARD32) */ /* height (CARD32) */ /* depth (of pixmap, mask is assumed to be of depth 1) (CARD32) */ /* drawable (screen root drawable of pixmap) (XID) */ /* ... additional fields can be added at the end of this list */ #define XA_WIN_ICONS "_WIN_ICONS" /* WIN_WORKSPACE CARD32 contains the current desktop number */ #define XA_WIN_WORKSPACE "_WIN_WORKSPACE" /* WIN_WORKSPACE_COUNT CARD32 contains the number of desktops */ #define XA_WIN_WORKSPACE_COUNT "_WIN_WORKSPACE_COUNT" /* WIN_WORKSPACE_NAMES StringList (Text Property) of workspace names */ /* unused by enlightenment */ #define XA_WIN_WORKSPACE_NAMES "_WIN_WORKSPACE_NAMES" /* *** Don't use this.. iffy at best. ** */ /* The available work area for client windows. The WM can set this and the WM */ /* and/or clients may change it at any time. If it is changed the WM and/or */ /* clients should honor the changes. If this property does not exist a client */ /* or WM can create it. */ /* * CARD32 min_x; * CARD32 min_y; * CARD32 max_x; * CARD32 max_y; */ #define XA_WIN_WORKAREA "_WIN_WORKAREA" /* array of 4 CARD32's */ /* This is a list of window id's the WM is currently managing - primarily */ /* for being able to have external "tasklist" apps */ #define XA_WIN_CLIENT_LIST "_WIN_CLIENT_LIST" /* array of N XID's */ /* * Properties on client windows */ /* The layer the window exists in */ /* 0 = Desktop */ /* 1 = Below */ /* 2 = Normal (default app layer) */ /* 4 = OnTop */ /* 6 = Dock (always on top - for panel) */ /* The app sets this alone, not the WM. If this property changes the WM */ /* should comply and change the appearance/behavior of the Client window */ /* if this hint does not exist the WM Will create it on the Client window */ #define WIN_LAYER_DESKTOP 0 #define WIN_LAYER_BELOW 2 #define WIN_LAYER_NORMAL 4 #define WIN_LAYER_ONTOP 6 #define WIN_LAYER_DOCK 8 #define WIN_LAYER_ABOVE_DOCK 10 #define WIN_LAYER_MENU 12 #define XA_WIN_LAYER "_WIN_LAYER" /* WIN_LAYER = CARD32 */ /* flags for the window's state. The WM will change these as needed when */ /* state changes. If the property contains info on client map, E will modify */ /* the windows state accordingly. if the Hint does not exist the WM will */ /* create it on the client window. 0 for the bit means off, 1 means on. */ /* unused (default) values are 0 */ /* removed Minimized - no explanation of what it really means - ambiguity */ /* should not be here if not clear */ #define WIN_STATE_STICKY (1<<0) /* everyone knows sticky */ #define WIN_STATE_RESERVED_BIT1 (1<<1) /* removed minimize here */ #define WIN_STATE_MAXIMIZED_VERT (1<<2) /* window in maximized V state */ #define WIN_STATE_MAXIMIZED_HORIZ (1<<3) /* window in maximized H state */ #define WIN_STATE_HIDDEN (1<<4) /* not on taskbar but window visible */ #define WIN_STATE_SHADED (1<<5) /* shaded (NeXT style) */ #define WIN_STATE_HID_WORKSPACE (1<<6) /* not on current desktop */ #define WIN_STATE_HID_TRANSIENT (1<<7) /* Owner of transient is hidden */ #define WIN_STATE_FIXED_POSITION (1<<8) /* window is fixed in position even */ #define WIN_STATE_ARRANGE_IGNORE (1<<9) /* ignore for auto arranging */ /* when scrolling about large */ /* virtual desktops ala fvwm */ #define XA_WIN_STATE "_WIN_STATE" /* WIN_STATE = CARD32 */ /* 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 XA_WIN_HINTS "_WIN_HINTS" /* WIN_HINTS = CARD32 */ /* Application state - also "color reactiveness" - the app can keep changing */ /* this property when it changes its state and the WM or monitoring program */ /* will pick this up and dpylay somehting accordingly. ONLY the client sets */ /* this. */ #define WIN_APP_STATE_NONE 0 #define WIN_APP_STATE_ACTIVE1 1 #define WIN_APP_STATE_ACTIVE2 2 #define WIN_APP_STATE_ERROR1 3 #define WIN_APP_STATE_ERROR2 4 #define WIN_APP_STATE_FATAL_ERROR1 5 #define WIN_APP_STATE_FATAL_ERROR2 6 #define WIN_APP_STATE_IDLE1 7 #define WIN_APP_STATE_IDLE2 8 #define WIN_APP_STATE_WAITING1 9 #define WIN_APP_STATE_WAITING2 10 #define WIN_APP_STATE_WORKING1 11 #define WIN_APP_STATE_WORKING2 12 #define WIN_APP_STATE_NEED_USER_INPUT1 13 #define WIN_APP_STATE_NEED_USER_INPUT2 14 #define WIN_APP_STATE_STRUGGLING1 15 #define WIN_APP_STATE_STRUGGLING2 16 #define WIN_APP_STATE_DISK_TRAFFIC1 17 #define WIN_APP_STATE_DISK_TRAFFIC2 18 #define WIN_APP_STATE_NETWORK_TRAFFIC1 19 #define WIN_APP_STATE_NETWORK_TRAFFIC2 20 #define WIN_APP_STATE_OVERLOADED1 21 #define WIN_APP_STATE_OVERLOADED2 22 #define WIN_APP_STATE_PERCENT000_1 23 #define WIN_APP_STATE_PERCENT000_2 24 #define WIN_APP_STATE_PERCENT010_1 25 #define WIN_APP_STATE_PERCENT010_2 26 #define WIN_APP_STATE_PERCENT020_1 27 #define WIN_APP_STATE_PERCENT020_2 28 #define WIN_APP_STATE_PERCENT030_1 29 #define WIN_APP_STATE_PERCENT030_2 30 #define WIN_APP_STATE_PERCENT040_1 31 #define WIN_APP_STATE_PERCENT040_2 32 #define WIN_APP_STATE_PERCENT050_1 33 #define WIN_APP_STATE_PERCENT050_2 34 #define WIN_APP_STATE_PERCENT060_1 35 #define WIN_APP_STATE_PERCENT060_2 36 #define WIN_APP_STATE_PERCENT070_1 37 #define WIN_APP_STATE_PERCENT070_2 38 #define WIN_APP_STATE_PERCENT080_1 39 #define WIN_APP_STATE_PERCENT080_2 40 #define WIN_APP_STATE_PERCENT090_1 41 #define WIN_APP_STATE_PERCENT090_2 42 #define WIN_APP_STATE_PERCENT100_1 43 #define WIN_APP_STATE_PERCENT100_2 44 #define XA_WIN_APP_STATE "_WIN_APP_STATE" /* WIN_APP_STATE = CARD32 */ /* Expanded space occupied - this is the area on screen the app's window */ /* will occupy when "expanded" - ie if you have a button on an app that */ /* "hides" it by reducing its size, this is the geometry of the expanded */ /* window - so the window manager can allow for this when doign auto */ /* positioing of client windows assuming the app can at any point use this */ /* this area and thus try and keep it clear. ONLY the client sets this */ /* * CARD32 x; * CARD32 y; * CARD32 width; * CARD32 height; */ #define XA_WIN_EXPANDED_SIZE "_WIN_EXPANDED_SIZE" /* array of 4 CARD32's */ /* CARD32 that contians the desktop number the application is on If the */ /* application's state is "sticky" it is irrelevant. Only the WM should */ /* change this. */ #define XA_WIN_WORKSPACE "_WIN_WORKSPACE" /* This atom is a 32-bit integer that is either 0 or 1 (currently). */ /* 0 denotes everything is as per usual but 1 denotes that ALL configure */ /* requests by the client on the client window with this property are */ /* not just a simple "moving" of the window, but the result of a user */ /* moving the window BUT the client handling that interaction by moving */ /* its own window. The window manager should respond accordingly by assuming */ /* any configure requests for this window whilst this atom is "active" in */ /* the "1" state are a client move and should handle flipping desktops if */ /* the window is being dragged "off screem" or across desktop boundaries */ /* etc. This atom is ONLY ever set by the client */ #define XA_WIN_CLIENT_MOVING "_WIN_CLIENT_MOVING" /* WIN_CLIENT_MOVING = CARD32 */ /* Designed for checking if the WIN_ supporting WM is still there */ /* and kicking about - basically check this property - check the window */ /* ID it points to - then check that window Id has this property too */ /* if that is the case the WIN_ supporting WM is there and alive and the */ /* list of WIN_PROTOCOLS is valid */ #define XA_WIN_SUPPORTING_WM_CHECK "_WIN_SUPPORTING_WM_CHECK" /* CARD32 */ /* for root window button clicks */ #define XA_WIN_DESKTOP_BUTTON_PROXY "_WIN_DESKTOP_BUTTON_PROXY" /* CARD32 */ /* for the root window clicks */ static Window __button_proxy = 0; /* how many desks does gnome know about */ static int gnome_max_desk = 1; static int atom_size(int format) { if (format == 32) { return sizeof(long); } else { return (format >> 3); } } static void * AtomGet(Window win, Atom to_get, Atom type, int *size) { unsigned char *retval; Atom type_ret; unsigned long bytes_after, num_ret; int format_ret; long length; void *data; retval = NULL; length = 0x7fffffff; XGetWindowProperty( dpy, win, to_get, 0L, length, False, type, &type_ret, &format_ret, &num_ret, &bytes_after, &retval); if ((retval) && (num_ret > 0) && (format_ret > 0)) { int asize; asize = atom_size(format_ret); data = safemalloc(num_ret * asize); if (data) { memcpy(data, retval, num_ret * asize); } XFree(retval); *size = num_ret * (format_ret >> 3); return data; } return NULL; } /*** GET WINDOW PROPERTIES ***/ #if 0 static void GNOME_GetHintIcons(FvwmWindow *fwin) { Atom atom_get; long *retval; int size; int i; Pixmap pmap; Pixmap mask; atom_get = XInternAtom(dpy, XA_WIN_ICONS, False); retval = AtomGet(FW_W(fwin), atom_get, XA_PIXMAP, &size); if (retval) { int n; n = size / atom_size(32); for (i = 0; i < n; i += 2) { pmap = retval[i]; mask = retval[i + 1]; } free(retval); } return; } static void GNOME_GetHintLayer(FvwmWindow *fwin) { Atom atom_get; long *retval; int size; atom_get = XInternAtom(dpy, XA_WIN_LAYER, False); retval = AtomGet(FW_W(fwin), atom_get, XA_CARDINAL, &size); if (retval) { set_layer(fwin, *retval); free(retval); } return; } static void GNOME_GetHintState(FvwmWindow *fwin) { Atom atom_get; long *retval; int size; atom_get = XInternAtom(dpy, XA_WIN_STATE, False); retval = AtomGet(FW_W(fwin), atom_get, XA_CARDINAL, &size); if (retval) { if (*retval & WIN_STATE_STICKY) { SET_STICKY(fwin, 1); } if (*retval & WIN_STATE_SHADED) { /* Fixme: how do we find out the correct shade * direction here? */ SET_SHADED(fwin, 1); SET_SHADED_DIR(fwin, DIR_N); } if (*retval & WIN_STATE_FIXED_POSITION) { SET_FIXED(fwin, 1); } free(retval); } return; } static void GNOME_GetHintAppState(FvwmWindow *fwin) { Atom atom_get; unsigned char *retval; int size; /* have nothing interesting to do with an app state (lamp) right now */ atom_get = XInternAtom(dpy, XA_WIN_APP_STATE, False); retval = AtomGet(FW_W(fwin), atom_get, XA_CARDINAL, &size); if (retval) { free(retval); } return; } static void GNOME_GetHintDesktop(FvwmWindow *fwin) { Atom atom_get; unsigned char *retval; int size; int *desk; atom_get = XInternAtom(dpy, XA_WIN_WORKSPACE, False); retval = AtomGet(FW_W(fwin), atom_get, XA_CARDINAL, &size); if (retval) { desk = (int *)retval; fwin->Desk = *desk; /* XXX: hide window if it's not on the current desktop! */ free(retval); } return; } static void GNOME_GetHint(FvwmWindow *fwin) { Atom atom_get; int *retval; int size; atom_get = XInternAtom(dpy, XA_WIN_HINTS, False); retval = AtomGet(FW_W(fwin), atom_get, XA_CARDINAL, &size); if (retval) { if (*retval & WIN_HINTS_SKIP_WINLIST) { SET_DO_SKIP_WINDOW_LIST(fwin, 1); } /* XXX: unimplimented */ if (*retval & WIN_HINTS_SKIP_TASKBAR) { ; } if (*retval & WIN_HINTS_SKIP_FOCUS) { ; } if (*retval & WIN_HINTS_FOCUS_ON_CLICK) { ; } /* if (*retval & WIN_HINTS_DO_NOT_COVER);*/ free(retval); } return; } static void GNOME_GetExpandedSize(FvwmWindow *fwin) { Atom atom_get; long *retval; int size; /* unimplimented */ int expanded_x, expanded_y, expanded_width, expanded_height; atom_get = XInternAtom(dpy, XA_WIN_EXPANDED_SIZE, False); retval = AtomGet(FW_W(fwin), atom_get, XA_CARDINAL, &size); if (retval) { expanded_x = retval[0]; expanded_y = retval[1]; expanded_width = retval[2]; expanded_height = retval[3]; free(retval); } return; } void GNOME_GetHints(FvwmWindow *fwin) { if (DO_IGNORE_GNOME_HINTS(fwin)) { return; } GNOME_GetHintDesktop(fwin); GNOME_GetHintIcons(fwin); GNOME_GetHintLayer(fwin); GNOME_GetHintState(fwin); GNOME_GetHintAppState(fwin); GNOME_GetHint(fwin); GNOME_GetExpandedSize(fwin); return; } #endif void GNOME_SetHints(FvwmWindow *fwin) { Atom atom_set; long val; atom_set = XInternAtom(dpy, XA_WIN_STATE, False); val = 0; if (IS_STICKY_ACROSS_PAGES(fwin) && IS_STICKY_ACROSS_DESKS(fwin)) { val |= WIN_STATE_STICKY; } if (IS_SHADED(fwin)) { val |= WIN_STATE_SHADED; } if (!is_function_allowed(F_MOVE, NULL, fwin, RQORIG_PROGRAM_US, False)) { val |= WIN_STATE_FIXED_POSITION; } XChangeProperty( dpy, FW_W(fwin), atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); return; } /* this duplicates most of the above... and it assumes that style is inizialized to zero. */ void GNOME_GetStyle (FvwmWindow *fwin, window_style *style) { Atom atom_get; unsigned char *retval; int size; if (S_DO_IGNORE_GNOME_HINTS(SCF(*style))) { return; } /* Desktop */ atom_get = XInternAtom(dpy, XA_WIN_WORKSPACE, False); retval = AtomGet(FW_W(fwin), atom_get, XA_CARDINAL, &size); if (retval) { SSET_START_DESK(*style, *(int*)retval); /* Allow special case of -1 to work. */ if (SGET_START_DESK(*style) > -1) { SSET_START_DESK(*style, SGET_START_DESK(*style) + 1); } style->flags.use_start_on_desk = 1; style->flag_mask.use_start_on_desk = 1; free(retval); } /* Icons - not implemented */ /* Layer */ atom_get = XInternAtom(dpy, XA_WIN_LAYER, False); retval = AtomGet(FW_W(fwin), atom_get, XA_CARDINAL, &size); if (retval) { SSET_LAYER(*style, *(int*)retval); style->flags.use_layer = (SGET_LAYER(*style) >= 0) ? 1 : 0; style->flag_mask.use_layer = 1; free(retval); } /* State */ atom_get = XInternAtom(dpy, XA_WIN_STATE, False); retval = AtomGet(FW_W(fwin), atom_get, XA_CARDINAL, &size); if (retval) { if (*(int*)retval & WIN_STATE_STICKY) { S_SET_IS_STICKY_ACROSS_PAGES(SCF(*style), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCM(*style), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCC(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCF(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCM(*style), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCC(*style), 1); } if (*(int*)retval & WIN_STATE_SHADED) { /* unimplemented, since we don't have a start_shaded flag. SM code relies on a separate do_shade flag, but that is ugly. */ } if ((*(int*)retval & WIN_STATE_FIXED_POSITION)) { S_SET_IS_FIXED(SCF(*style), 1); S_SET_IS_FIXED(SCM(*style), 1); S_SET_IS_FIXED(SCC(*style), 1); } free(retval); } /* App state - not implemented */ /* Hints */ atom_get = XInternAtom(dpy, XA_WIN_HINTS, False); retval = AtomGet(FW_W(fwin), atom_get, XA_CARDINAL, &size); if (retval) { if (*retval & WIN_HINTS_SKIP_WINLIST) { S_SET_DO_WINDOW_LIST_SKIP(SCF(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCM(*style), 1); S_SET_DO_WINDOW_LIST_SKIP(SCC(*style), 1); } free(retval); } /* Expanded size - not implemented */ return; } /*** SET WINDOW PROPERTIES ***/ void GNOME_SetDesk(FvwmWindow *fwin) { Atom atom_set; long val; atom_set = XInternAtom(dpy, XA_WIN_WORKSPACE, False); val = fwin->Desk; if (val >= gnome_max_desk) { GNOME_SetDeskCount(); } XChangeProperty( dpy, FW_W(fwin), atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); return; } void GNOME_SetLayer(FvwmWindow *fwin) { Atom atom_set; long val; atom_set = XInternAtom(dpy, XA_WIN_LAYER, False); val = get_layer(fwin); XChangeProperty( dpy, FW_W(fwin), atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); return; } /*** INITIALIZE GNOME WM SUPPORT ***/ /* sets the virtual desktop grid properties */ void GNOME_SetAreaCount(void) { Atom atom_set; long val[2]; atom_set = XInternAtom(dpy, XA_WIN_AREA_COUNT, False); val[0] = (Scr.VxMax + Scr.MyDisplayWidth) / Scr.MyDisplayWidth; val[1] = (Scr.VyMax + Scr.MyDisplayHeight) / Scr.MyDisplayHeight; XChangeProperty( dpy, Scr.Root, atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)val, 2); return; } /* sets the property indicating the current virtual desktop * location */ void GNOME_SetCurrentArea(void) { Atom atom_set; long val[2]; atom_set = XInternAtom(dpy, XA_WIN_AREA, False); val[0] = Scr.Vx / Scr.MyDisplayWidth; val[1] = Scr.Vy / Scr.MyDisplayHeight; XChangeProperty( dpy, Scr.Root, atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)val, 2); return; } /* FIXME: what to do about negative desks ? */ /* ignore them! */ void GNOME_SetDeskCount(void) { Atom atom_set; long val; FvwmWindow *t; atom_set = XInternAtom(dpy, XA_WIN_WORKSPACE_COUNT, False); val = 0; if (Scr.CurrentDesk > 0) { val = Scr.CurrentDesk; } for (t = get_next_window_in_stack_ring(&Scr.FvwmRoot); t != &Scr.FvwmRoot; t = get_next_window_in_stack_ring(t)) { if (t->Desk > val) { val = t->Desk; } } val++; if (gnome_max_desk > val) { val = gnome_max_desk; } XChangeProperty( dpy, Scr.Root, atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); return; } /* XXX: this function is hard-coded to one! -JMP */ void GNOME_SetCurrentDesk(void) { Atom atom_set; long val; atom_set = XInternAtom(dpy, XA_WIN_WORKSPACE, False); val = (long) Scr.CurrentDesk; if (val >= gnome_max_desk) { GNOME_SetDeskCount(); } XChangeProperty( dpy, Scr.Root, atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); GNOME_SetCurrentArea(); return; } /* sets the names assigned to the desktops */ void GNOME_SetDeskNames(void) { Atom atom_set; XTextProperty text; char *names[1]; atom_set = XInternAtom(dpy, XA_WIN_WORKSPACE_NAMES, False); names[0] = "GNOME Desktop"; if (XStringListToTextProperty(names, 1, &text)) { XSetTextProperty(dpy, Scr.Root, &text, atom_set); XFree(text.value); } return; } void GNOME_SetClientList(void) { Atom atom_set; Window *wl=NULL; int displayed=0; int i = 0; FvwmWindow *t; /* Find out how many window pointers we need to store, allocate * the space and go through the list again to actually store them. */ for (t = Scr.FvwmRoot.next; t; t = t->next) { if (!DO_SKIP_WINDOW_LIST(t)) { displayed++; } } if(displayed) { wl=(Window*)safemalloc(sizeof(Window*)*displayed); for (t = Scr.FvwmRoot.next; t; t = t->next) { if (!DO_SKIP_WINDOW_LIST(t)) { wl[i++] = FW_W(t); } } } /* Update X */ atom_set = XInternAtom(dpy, XA_WIN_CLIENT_LIST, False); XChangeProperty( dpy, Scr.Root, atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)wl, i); if(wl) free(wl); return; } void GNOME_SetWinArea(FvwmWindow *w) { Atom atom_set; long val[2]; atom_set = XInternAtom(dpy, XA_WIN_AREA, False); if (!DO_SKIP_WINDOW_LIST(w)) { if (IsRectangleOnThisPage(&(w->g.frame), w->Desk)) { val[0] = Scr.Vx / Scr.MyDisplayWidth; val[1] = Scr.Vy / Scr.MyDisplayHeight; } else { val[0] = (w->g.frame.x + Scr.Vx) / Scr.MyDisplayWidth; if (val[0] < 0 && w->g.frame.x + Scr.Vx + w->g.frame.width > 0) { val[0] = 0; } val[1] = (w->g.frame.y + Scr.Vy) / Scr.MyDisplayHeight; if (val[1] < 0 && w->g.frame.y + Scr.Vy + w->g.frame.height > 0) { val[1] = 0; } } XChangeProperty( dpy, FW_W(w), atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)val, 2); } return; } void GNOME_Init(void) { int i; Atom atom_set, list[11]; long val; atom_set = XInternAtom(dpy, XA_WIN_PROTOCOLS, False); /* these indicate what GNOME compliance properties have been * implemented */ i = 0; list[i++] = XInternAtom(dpy, XA_WIN_LAYER, False); list[i++] = XInternAtom(dpy, XA_WIN_STATE, False); list[i++] = XInternAtom(dpy, XA_WIN_HINTS, False); /* list[i++] = XInternAtom(dpy, XA_WIN_APP_STATE, False); */ /* list[i++] = XInternAtom(dpy, XA_WIN_EXPANDED_SIZE, False); */ /* list[i++] = XInternAtom(dpy, XA_WIN_ICONS, False); */ list[i++] = XInternAtom(dpy, XA_WIN_WORKSPACE, False); list[i++] = XInternAtom(dpy, XA_WIN_WORKSPACE_COUNT, False); list[i++] = XInternAtom(dpy, XA_WIN_WORKSPACE_NAMES, False); list[i++] = XInternAtom(dpy, XA_WIN_CLIENT_LIST, False); list[i++] = XInternAtom(dpy, XA_WIN_DESKTOP_BUTTON_PROXY, False); XChangeProperty( dpy, Scr.Root, atom_set, XA_ATOM, 32, PropModeReplace, (unsigned char *)list, i); /*-------------------------------------------------------------------- why use two windows when one does just fine ? --------------------------------------------------------------------*/ /* create a window which is a child of the root window and set the * XA_WIN_SUPPORTING_WM_CHECK property on it, and also set the * same property on the root window with the window ID of of the * window we just created */ __button_proxy = XCreateWindow(dpy, Scr.Root, -10, -10, 10, 10, 0, 0, InputOnly, CopyFromParent, 0, NULL); atom_set = XInternAtom(dpy, XA_WIN_SUPPORTING_WM_CHECK, False); val = __button_proxy; XChangeProperty( dpy, Scr.Root, atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); XChangeProperty( dpy, __button_proxy, atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); /* create a window which is the child of the root window for proxying * root window clicks */ atom_set = XInternAtom(dpy, XA_WIN_DESKTOP_BUTTON_PROXY, False); XChangeProperty( dpy, Scr.Root, atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); XChangeProperty( dpy, __button_proxy, atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); /* some initial settings */ GNOME_SetDeskCount(); GNOME_SetCurrentDesk(); GNOME_SetDeskNames(); GNOME_SetAreaCount(); GNOME_SetCurrentArea(); GNOME_SetClientList(); return; } /*----------------------------------------------------------------------- tell gnome how many desks to show -----------------------------------------------------------------------*/ void CMD_GnomeShowDesks(F_CMD_ARGS) { int n; Atom atom_set; long val[1]; atom_set = XInternAtom(dpy, XA_WIN_WORKSPACE_COUNT, False); DBUG("GNOME_ShowDesks","Routine Entered"); n = GetIntegerArguments(action, NULL, (int *)val, 1); if(n != 1) { fvwm_msg(ERR, "GnomeShowDesks", "requires one argument"); return; } gnome_max_desk = val[0]; XChangeProperty( dpy, Scr.Root, atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)(&val[0]), 1); return; } /*** RECIVING MESSAGES ***/ int GNOME_ProcessClientMessage(const exec_context_t *exc) { Atom a; FvwmWindow *fw = exc->w.fw; XEvent *ev = exc->x.etrigger; long p0 = 0; long p1 = 0; const char* invalid_req = "---"; const char* invalid_prop = "---"; if (fw != NULL && DO_IGNORE_GNOME_HINTS(fw)) { return 0; } a = XInternAtom(dpy, XA_WIN_AREA, False); if (ev->xclient.message_type == a) { /* convert to integer grid */ p0 = ev->xclient.data.l[0] * Scr.MyDisplayWidth; p1 = ev->xclient.data.l[1] * Scr.MyDisplayHeight; if (p0 < 0 || p0 > 0x7fffffff || p1 < 0 || p1 > 0x7fffffff) { invalid_prop = "page"; invalid_req = "_WIN_AREA"; goto err_msg; } MoveViewport(p0, p1, 1); return 1; } a = XInternAtom(dpy, XA_WIN_WORKSPACE, False); if (ev->xclient.message_type == a) { p0 = ev->xclient.data.l[0]; if (p0 < 0 || p0 > 0x7fffffff) { invalid_prop = "desk"; invalid_req = "_WIN_WORKSPACE"; goto err_msg; } goto_desk(p0); return 1; } a = XInternAtom(dpy, XA_WIN_LAYER, False); if (ev->xclient.message_type == a && fw) { p0 = ev->xclient.data.l[0]; if (p0 < 0 || p0 > 0x7fffffff) { invalid_prop = "layer"; invalid_req = "_WIN_LAYER"; goto err_msg; } new_layer(fw, p0); return 1; } a = XInternAtom(dpy, XA_WIN_STATE, False); if (ev->xclient.message_type == a && fw) { GNOME_HandlePropRequest( exc, ev->xclient.data.l[0], ev->xclient.data.l[1]); return 1; } return 0; err_msg: fvwm_msg( WARN, "GNOME_ProcessClientMessage", "The application window (id %#lx)\n" " \"%s\" has requested an invalid %s (%ld, %ld)\n" " using a %s client message.\n" " fvwm is ignoring this request.\n", fw ? FW_W(fw) : 0, fw ? fw->name.name : "(none)", invalid_prop, p0, p1, invalid_req); fvwm_msg_report_app_and_workers(); return 0; } void GNOME_HandlePropRequest( const exec_context_t *exc, unsigned int propm, unsigned int prop) { Atom atype; Atom a; int aformat; FvwmWindow *fwin; unsigned char *indi; unsigned long nitems, bytes_remain, oldprop; indi = (unsigned char *)&oldprop; DBUG("HandleGnomePropRequest","Routine Entered"); a = XInternAtom(dpy, XA_WIN_STATE, False); for (fwin = Scr.FvwmRoot.next; fwin; fwin = fwin->next) { if (FW_W(fwin) == exc->w.w) { break; } } /*-------------------------------------------------------------------- First change the props on the window so the gnome app knows we did something. --------------------------------------------------------------------*/ #ifdef FVWM_DEBUG_MSGS fvwm_msg( DBG, "HandleGnomePropRequest", "window is %d", (int)FW_W(fwin)); #endif if (fwin == NULL) { return; } if (DO_IGNORE_GNOME_HINTS(fwin)) { return; } #ifdef FVWM_DEBUG_MSGS fvwm_msg(DBG, "HandleGnomePropRequest", "prop req is %d", prop); fvwm_msg(DBG, "HandleGnomePropRequest", "propm req is %d", propm); #endif XGetWindowProperty(dpy, FW_W(fwin), a, 0L, 3L, False, a, &atype, &aformat, &nitems, &bytes_remain, &indi); oldprop &= ~(propm); oldprop |= (propm & prop); #ifdef FVWM_DEBUG_MSGS fvwm_msg( DBG, "HandleGnomePropRequest", "oldprop req is %d", (int)oldprop); #endif XChangeProperty( dpy, FW_W(fwin), a, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&oldprop, 1); /*-------------------------------------------------------------------- Then apply the requests --------------------------------------------------------------------*/ /*-------------------------------------------------------------------- Sticky --------------------------------------------------------------------*/ if (propm & WIN_STATE_STICKY) { if (prop & WIN_STATE_STICKY) { SET_STICKY_ACROSS_PAGES(fwin, 1); SET_STICKY_ACROSS_DESKS(fwin, 1); } else { SET_STICKY_ACROSS_PAGES(fwin, 0); SET_STICKY_ACROSS_DESKS(fwin, 0); } border_draw_decorations( fwin, PART_TITLE, (Scr.Hilite==fwin), True, CLEAR_ALL, NULL, NULL); } /*-------------------------------------------------------------------- WindowShade -------------------------------------------------------------------*/ if (propm & WIN_STATE_SHADED) { if (prop & WIN_STATE_SHADED) { /* shade up */ execute_function_override_window( NULL, exc, "WindowShade True", 0, fwin); } else { /* shade down */ execute_function_override_window( NULL, exc, "WindowShade False", 0, fwin); } } return; } void GNOME_ProxyButtonEvent(const XEvent *ev) { switch (ev->type) { case ButtonPress: XUngrabPointer(dpy, CurrentTime); FSendEvent( dpy, __button_proxy, False, SubstructureNotifyMask, (XEvent *)ev); break; case ButtonRelease: FSendEvent( dpy, __button_proxy, False, SubstructureNotifyMask, (XEvent *)ev); break; } return; } /* this is the function entered into fvwm's functions table */ void CMD_GnomeButton(F_CMD_ARGS) { /* send off the button press event */ GNOME_ProxyButtonEvent(exc->x.etrigger); return; } fvwm-2.6.5.orig/fvwm/placement.c0000644000175000017500000016370011730575402014730 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/FScreen.h" #include "libs/Grab.h" #include "libs/Parse.h" #include "libs/XResource.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "cursor.h" #include "bindings.h" #include "misc.h" #include "screen.h" #include "placement.h" #include "geometry.h" #include "update.h" #include "style.h" #include "move_resize.h" #include "virtual.h" #include "stack.h" #include "ewmh.h" #include "icons.h" #include "add_window.h" /* ---------------------------- local definitions -------------------------- */ #define MAX_NUM_PLACEMENT_ALGOS 31 #define CP_GET_NEXT_STEP 5 /* ---------------------------- local macros ------------------------------- */ #ifndef MIN #define MIN(A,B) ((A)<(B)? (A):(B)) #endif #ifndef MAX #define MAX(A,B) ((A)>(B)? (A):(B)) #endif #define NORMAL_PLACEMENT_PENALTY(p) (p->normal) #define ONTOP_PLACEMENT_PENALTY(p) (p->ontop) #define ICON_PLACEMENT_PENALTY(p) (p->icon) #define STICKY_PLACEMENT_PENALTY(p) (p->sticky) #define BELOW_PLACEMENT_PENALTY(p) (p->below) #define EWMH_STRUT_PLACEMENT_PENALTY(p) (p->strut) #define PERCENTAGE_99_PENALTY(p) (p->p99) #define PERCENTAGE_95_PENALTY(p) (p->p95) #define PERCENTAGE_85_PENALTY(p) (p->p85) #define PERCENTAGE_75_PENALTY(p) (p->p75) /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef enum { PR_POS_NORMAL = 0, PR_POS_IGNORE_PPOS, PR_POS_USE_PPOS, PR_POS_IGNORE_USPOS, PR_POS_USE_USPOS, PR_POS_PLACE_AGAIN, PR_POS_CAPTURE, PR_POS_USPOS_OVERRIDE_SOS } preason_pos_t; typedef enum { PR_SCREEN_CURRENT = 0, PR_SCREEN_STYLE, PR_SCREEN_X_RESOURCE_FVWMSCREEN, PR_SCREEN_IGNORE_CAPTURE } preason_screen_t; typedef enum { PR_PAGE_CURRENT = 0, PR_PAGE_STYLE, PR_PAGE_X_RESOURCE_PAGE, PR_PAGE_IGNORE_CAPTURE, PR_PAGE_IGNORE_INVALID, PR_PAGE_STICKY } preason_page_t; typedef enum { PR_DESK_CURRENT = 0, PR_DESK_STYLE, PR_DESK_X_RESOURCE_DESK, PR_DESK_X_RESOURCE_PAGE, PR_DESK_CAPTURE, PR_DESK_STICKY, PR_DESK_WINDOW_GROUP_LEADER, PR_DESK_WINDOW_GROUP_MEMBER, PR_DESK_TRANSIENT, PR_DESK_XPROP_XA_WM_DESKTOP } preason_desk_t; typedef struct { struct { preason_pos_t reason; int x; int y; int algo; char *pl_position_string; unsigned do_not_manual_icon_placement : 1; unsigned do_adjust_off_screen : 1; unsigned do_adjust_off_page : 1; unsigned is_pl_position_string_invalid : 1; unsigned has_tile_failed : 1; unsigned has_manual_failed : 1; unsigned has_placement_failed : 1; } pos; struct { preason_screen_t reason; int screen; rectangle g; unsigned was_modified_by_ewmh_workingarea : 1; } screen; struct { preason_page_t reason; int px; int py; unsigned do_switch_page : 1; unsigned do_honor_starts_on_page : 1; unsigned do_ignore_starts_on_page : 1; } page; struct { preason_desk_t reason; preason_desk_t sod_reason; int desk; unsigned do_switch_desk : 1; } desk; } pl_reason_t; typedef struct { int desk; int page_x; int page_y; int screen; } pl_start_style_t; typedef struct { unsigned do_forbid_manual_placement : 1; unsigned do_honor_starts_on_page : 1; unsigned do_honor_starts_on_screen : 1; unsigned do_not_use_wm_placement : 1; } pl_flags_t; typedef float pl_penalty_t; typedef enum { PL_LOOP_END, PL_LOOP_CONT } pl_loop_rc_t; struct pl_arg_t; struct pl_ret_t; typedef struct { /* If this funtion pointer is not NULL, use this function to return * the desired position in a single call */ pl_penalty_t (*get_pos_simple)( position *ret_p, struct pl_ret_t *ret, const struct pl_arg_t *arg); /* otherwise use these three in a loop */ pl_loop_rc_t (*get_first_pos)( position *ret_p, struct pl_ret_t *ret, const struct pl_arg_t *arg); pl_loop_rc_t (*get_next_pos)( position *ret_p, struct pl_ret_t *ret, const struct pl_arg_t *arg, position hint_p); pl_penalty_t (*get_pos_penalty)( position *ret_hint_p, struct pl_ret_t *ret, const struct pl_arg_t *arg); } pl_algo_t; typedef struct pl_scratch_t { const pl_penalty_struct *pp; const pl_percent_penalty_struct *ppp; } pl_scratch_t; typedef struct pl_arg_t { const pl_algo_t *algo; const exec_context_t *exc; const window_style *style; pl_reason_t *reason; FvwmWindow *place_fw; pl_scratch_t *scratch; rectangle place_g; position place_p2; rectangle screen_g; position page_p1; position page_p2; position pdelta_p; struct { unsigned use_percent : 1; unsigned use_ewmh_dynamic_working_areapercent : 1; unsigned do_honor_starts_on_page : 1; } flags; } pl_arg_t; typedef struct pl_ret_t { position best_p; pl_penalty_t best_penalty; struct { unsigned do_resize_too : 1; } flags; } pl_ret_t; /* ---------------------------- forward declarations ----------------------- */ static pl_loop_rc_t __pl_minoverlap_get_first_pos( position *ret_p, struct pl_ret_t *ret, const struct pl_arg_t *arg); static pl_loop_rc_t __pl_minoverlap_get_next_pos( position *ret_p, struct pl_ret_t *ret, const struct pl_arg_t *arg, position hint_p); static pl_penalty_t __pl_minoverlap_get_pos_penalty( position *ret_hint_p, struct pl_ret_t *ret, const pl_arg_t *arg); static pl_penalty_t __pl_smart_get_pos_penalty( position *ret_hint_p, struct pl_ret_t *ret, const pl_arg_t *arg); static pl_penalty_t __pl_position_get_pos_simple( position *ret_p, struct pl_ret_t *ret, const struct pl_arg_t *arg); static pl_penalty_t __pl_cascade_get_pos_simple( position *ret_p, struct pl_ret_t *ret, const struct pl_arg_t *arg); static pl_penalty_t __pl_manual_get_pos_simple( position *ret_p, struct pl_ret_t *ret, const struct pl_arg_t *arg); /* ---------------------------- local variables ---------------------------- */ const pl_algo_t minoverlap_placement_algo = { NULL, __pl_minoverlap_get_first_pos, __pl_minoverlap_get_next_pos, __pl_minoverlap_get_pos_penalty }; const pl_algo_t smart_placement_algo = { NULL, __pl_minoverlap_get_first_pos, __pl_minoverlap_get_next_pos, __pl_smart_get_pos_penalty }; const pl_algo_t position_placement_algo = { __pl_position_get_pos_simple }; const pl_algo_t cascade_placement_algo = { __pl_cascade_get_pos_simple }; const pl_algo_t manual_placement_algo = { __pl_manual_get_pos_simple }; /* ---------------------------- exported variables (globals) --------------- */ const pl_penalty_struct default_pl_penalty = { 1, PLACEMENT_AVOID_ONTOP, PLACEMENT_AVOID_ICON, PLACEMENT_AVOID_STICKY, PLACEMENT_AVOID_BELOW, PLACEMENT_AVOID_EWMH_STRUT }; const pl_percent_penalty_struct default_pl_percent_penalty = { PLACEMENT_AVOID_COVER_99, PLACEMENT_AVOID_COVER_95, PLACEMENT_AVOID_COVER_85, PLACEMENT_AVOID_COVER_75 }; /* ---------------------------- local functions (PositionPlacement) -------- */ static pl_penalty_t __pl_position_get_pos_simple( position *ret_p, struct pl_ret_t *ret, const struct pl_arg_t *arg) { char *spos; Bool fPointer; int n; int i; Bool is_under_mouse; is_under_mouse = False; spos = SGET_PLACEMENT_POSITION_STRING(*arg->style); if (spos == NULL || *spos == 0) { spos = DEFAULT_PLACEMENT_POSITION_STRING; i = 1; } else if (StrEquals(spos, "Center")) { spos = DEFAULT_PLACEMENT_POS_CENTER_STRING; i = 1; } else if (StrEquals(spos, "UnderMouse")) { spos = DEFAULT_PLACEMENT_POS_MOUSE_STRING; i = 1; is_under_mouse = True; } else { i = 0; } arg->reason->pos.pl_position_string = spos; for (n = -1; i < 2 && n < 2; i++) { fPointer = False; ret_p->x = 0; ret_p->y = 0; n = GetMoveArguments( &spos, arg->place_g.width, arg->place_g.height, &ret_p->x, &ret_p->y, NULL, &fPointer, False); spos = DEFAULT_PLACEMENT_POSITION_STRING; if (n < 2) { arg->reason->pos.is_pl_position_string_invalid = 1; } } if (n < 2) { /* bug */ abort(); } if (is_under_mouse) { /* TA: 20090218: Try and keep the window on-screen if we * can. */ /* TA: 20120316: Imply the working-area when under the mouse -- this * brings it in-line with making the EWMH working area the default. * Note that "UnderMouse" is a special case, deliberately. All other * PositionPlacement commands are deliberately NOT subject to ewmhiwa * options. */ EWMH_GetWorkAreaIntersection( arg->place_fw, (int *)&arg->screen_g.x, (int *)&arg->screen_g.y, (int *)&arg->screen_g.width, (int *)&arg->screen_g.height, EWMH_USE_WORKING_AREA); if (ret_p->x + arg->place_fw->g.frame.width > arg->screen_g.x + arg->screen_g.width) { ret_p->x = (arg->screen_g.x + arg->screen_g.width) - arg->place_fw->g.frame.width; } if (ret_p->y + arg->place_fw->g.frame.height > arg->screen_g.y + arg->screen_g.height) { ret_p->y = (arg->screen_g.y + arg->screen_g.height) - arg->place_fw->g.frame.height; } } /* Don't let the upper left corner be offscreen. */ if (ret_p->x < arg->screen_g.x) { ret_p->x = arg->screen_g.x; } if (ret_p->y < arg->screen_g.y) { ret_p->y = arg->screen_g.y; } if (arg->flags.do_honor_starts_on_page) { ret_p->x -= arg->pdelta_p.x; ret_p->y -= arg->pdelta_p.y; } return 0; } /* ---------------------------- local functions (CascadePlacement)---------- */ static pl_penalty_t __pl_cascade_get_pos_simple( position *ret_p, struct pl_ret_t *ret, const struct pl_arg_t *arg) { size_borders b; int w; FvwmWindow *t; t = (Scr.cascade_window != NULL) ? Scr.cascade_window : arg->place_fw; w = t->title_thickness; if (w == 0) { w = t->boundary_width; } if (w == 0) { w = PLACEMENT_FALLBACK_CASCADE_STEP; } if (Scr.cascade_window != NULL) { Scr.cascade_x += w; Scr.cascade_y += w; switch (GET_TITLE_DIR(t)) { case DIR_S: case DIR_N: Scr.cascade_y += w; break; case DIR_E: case DIR_W: Scr.cascade_x += w; break; default: break; } } Scr.cascade_window = arg->place_fw; if (Scr.cascade_x > arg->screen_g.width / 2) { Scr.cascade_x = arg->place_fw->title_thickness; } if (Scr.cascade_y > arg->screen_g.height / 2) { Scr.cascade_y = 2 * arg->place_fw->title_thickness; } ret_p->x = Scr.cascade_x + arg->page_p1.x; ret_p->y = Scr.cascade_y + arg->page_p1.y; /* try to keep the window on the screen */ get_window_borders(arg->place_fw, &b); if (ret_p->x + arg->place_g.width >= arg->page_p2.x) { ret_p->x = arg->page_p2.x - arg->place_g.width - b.total_size.width; Scr.cascade_x = arg->place_fw->title_thickness; switch (GET_TITLE_DIR(t)) { case DIR_E: case DIR_W: Scr.cascade_x += arg->place_fw->title_thickness; default: break; } } if (ret_p->y + arg->place_g.height >= arg->page_p2.y) { ret_p->y = arg->page_p2.y - arg->place_g.height - b.total_size.height; Scr.cascade_y = arg->place_fw->title_thickness; switch (GET_TITLE_DIR(t)) { case DIR_N: case DIR_S: Scr.cascade_y += arg->place_fw->title_thickness; default: break; } } /* the left and top sides are more important in huge windows */ if (ret_p->x < arg->page_p1.x) { ret_p->x = arg->page_p1.x; } if (ret_p->y < arg->page_p1.y) { ret_p->y = arg->page_p1.y; } return 0; } /* ---------------------------- local functions (ManualPlacement)----------- */ static pl_penalty_t __pl_manual_get_pos_simple( position *ret_p, struct pl_ret_t *ret, const struct pl_arg_t *arg) { ret_p->x = 0; ret_p->y = 0; if (GrabEm(CRS_POSITION, GRAB_NORMAL)) { int DragWidth; int DragHeight; int mx; int my; /* Grabbed the pointer - continue */ MyXGrabServer(dpy); if ( XGetGeometry( dpy, FW_W(arg->place_fw), &JunkRoot, &JunkX, &JunkY, (unsigned int*)&DragWidth, (unsigned int*)&DragHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth) == 0) { MyXUngrabServer(dpy); UngrabEm(GRAB_NORMAL); return -1; } SET_PLACED_BY_FVWM(arg->place_fw, 0); MyXGrabKeyboard(dpy); DragWidth = arg->place_g.width; DragHeight = arg->place_g.height; if (Scr.SizeWindow != None) { XMapRaised(dpy, Scr.SizeWindow); } FScreenGetScrRect( NULL, FSCREEN_GLOBAL, &mx, &my, NULL, NULL); if (__move_loop( arg->exc, mx, my, DragWidth, DragHeight, &ret_p->x, &ret_p->y, False, CRS_POSITION)) { ret->flags.do_resize_too = 1; } if (Scr.SizeWindow != None) { XUnmapWindow(dpy, Scr.SizeWindow); } MyXUngrabKeyboard(dpy); MyXUngrabServer(dpy); UngrabEm(GRAB_NORMAL); } else { /* couldn't grab the pointer - better do something */ XBell(dpy, 0); ret_p->x = 0; ret_p->y = 0; arg->reason->pos.has_manual_failed = 1; } if (arg->flags.do_honor_starts_on_page) { ret_p->x -= arg->pdelta_p.x; ret_p->y -= arg->pdelta_p.y; } return 0; } /* ---------------------------- local functions (MinoverlapPlacement) ------ */ /* MinoverlapPlacement by Anthony Martin * This algorithm places a new window such that there is a minimum amount of * interference with other windows. If it can place a window without any * interference, fine. Otherwise, it places it so that the area of of * interference between the new window and the other windows is minimized */ static int __pl_minoverlap_get_next_x(const pl_arg_t *arg) { FvwmWindow *other_fw; int xnew; int xtest; int stickyx; int stickyy; int start,i; int win_left; rectangle g; Bool rc; int x; int y; x = arg->place_g.x; y = arg->place_g.y; if (arg->flags.use_percent == 1) { start = 0; } else { start = CP_GET_NEXT_STEP; } /* Test window at far right of screen */ xnew = arg->page_p2.x; xtest = arg->page_p2.x - arg->place_g.width; if (xtest > x) { xnew = xtest; } /* test the borders of the working area */ xtest = arg->page_p1.x + Scr.Desktops->ewmh_working_area.x; if (xtest > x) { xnew = MIN(xnew, xtest); } xtest = arg->page_p1.x + (Scr.Desktops->ewmh_working_area.x + Scr.Desktops->ewmh_working_area.width) - arg->place_g.width; if (xtest > x) { xnew = MIN(xnew, xtest); } /* Test the values of the right edges of every window */ for ( other_fw = Scr.FvwmRoot.next; other_fw != NULL; other_fw = other_fw->next) { if ( other_fw == arg->place_fw || (other_fw->Desk != arg->place_fw->Desk && !IS_STICKY_ACROSS_DESKS(other_fw)) || IS_EWMH_DESKTOP(FW_W(other_fw))) { continue; } if (IS_STICKY_ACROSS_PAGES(other_fw)) { stickyx = arg->pdelta_p.x; stickyy = arg->pdelta_p.y; } else { stickyx = 0; stickyy = 0; } if (IS_ICONIFIED(other_fw)) { rc = get_visible_icon_geometry(other_fw, &g); if (rc == True && y < g.y + g.height - stickyy && g.y - stickyy < arg->place_g.height + y) { win_left = arg->page_p1.x + g.x - stickyx - arg->place_g.width; for (i = start; i <= CP_GET_NEXT_STEP; i++) { xtest = win_left + g.width * (CP_GET_NEXT_STEP - i) / CP_GET_NEXT_STEP; if (xtest > x) { xnew = MIN(xnew, xtest); } } win_left = arg->page_p1.x + g.x - stickyx; for (i = start; i <= CP_GET_NEXT_STEP; i++) { xtest = (win_left) + g.width * i / CP_GET_NEXT_STEP; if (xtest > x) { xnew = MIN(xnew, xtest); } } } } else if ( y < other_fw->g.frame.height + other_fw->g.frame.y - stickyy && other_fw->g.frame.y - stickyy < arg->place_g.height + y && arg->page_p1.x < other_fw->g.frame.width + other_fw->g.frame.x - stickyx && other_fw->g.frame.x - stickyx < arg->page_p2.x) { win_left = other_fw->g.frame.x - stickyx - arg->place_g.width; for (i = start; i <= CP_GET_NEXT_STEP; i++) { xtest = win_left + other_fw->g.frame.width * (CP_GET_NEXT_STEP - i) / CP_GET_NEXT_STEP; if (xtest > x) { xnew = MIN(xnew, xtest); } } win_left = other_fw->g.frame.x - stickyx; for (i = start; i <= CP_GET_NEXT_STEP; i++) { xtest = win_left + other_fw->g.frame.width * i / CP_GET_NEXT_STEP; if (xtest > x) { xnew = MIN(xnew, xtest); } } } } return xnew; } static int __pl_minoverlap_get_next_y(const pl_arg_t *arg) { FvwmWindow *other_fw; int ynew; int ytest; int stickyy; int win_top; int start; int i; rectangle g; int y; y = arg->place_g.y; if (arg->flags.use_percent == 1) { start = 0; } else { start = CP_GET_NEXT_STEP; } /* Test window at far bottom of screen */ ynew = arg->page_p2.y; ytest = arg->page_p2.y - arg->place_g.height; if (ytest > y) { ynew = ytest; } /* test the borders of the working area */ ytest = arg->page_p1.y + Scr.Desktops->ewmh_working_area.y; if (ytest > y) { ynew = MIN(ynew, ytest); } ytest = arg->screen_g.y + (Scr.Desktops->ewmh_working_area.y + Scr.Desktops->ewmh_working_area.height) - arg->place_g.height; if (ytest > y) { ynew = MIN(ynew, ytest); } /* Test the values of the bottom edge of every window */ for ( other_fw = Scr.FvwmRoot.next; other_fw != NULL; other_fw = other_fw->next) { if ( other_fw == arg->place_fw || ( other_fw->Desk != arg->place_fw->Desk && !IS_STICKY_ACROSS_DESKS(other_fw)) || IS_EWMH_DESKTOP(FW_W(other_fw))) { continue; } if (IS_STICKY_ACROSS_PAGES(other_fw)) { stickyy = arg->pdelta_p.y; } else { stickyy = 0; } if (IS_ICONIFIED(other_fw)) { get_visible_icon_geometry(other_fw, &g); win_top = g.y - stickyy; for (i = start; i <= CP_GET_NEXT_STEP; i++) { ytest = win_top + g.height * i / CP_GET_NEXT_STEP; if (ytest > y) { ynew = MIN(ynew, ytest); } } win_top = g.y - stickyy - arg->place_g.height; for (i = start; i <= CP_GET_NEXT_STEP; i++) { ytest = win_top + g.height * (CP_GET_NEXT_STEP - i) / CP_GET_NEXT_STEP; if (ytest > y) { ynew = MIN(ynew, ytest); } } } else { win_top = other_fw->g.frame.y - stickyy; for (i = start; i <= CP_GET_NEXT_STEP; i++) { ytest = win_top + other_fw->g.frame.height * i / CP_GET_NEXT_STEP; if (ytest > y) { ynew = MIN(ynew, ytest); } } win_top = other_fw->g.frame.y - stickyy - arg->place_g.height; for (i = start; i <= CP_GET_NEXT_STEP; i++) { ytest = win_top + other_fw->g.frame.height * (CP_GET_NEXT_STEP - i) / CP_GET_NEXT_STEP; if (ytest > y) { ynew = MIN(ynew, ytest); } } } } return ynew; } static pl_loop_rc_t __pl_minoverlap_get_first_pos( position *ret_p, struct pl_ret_t *ret, const pl_arg_t *arg) { /* top left corner of page */ ret_p->x = arg->page_p1.x; ret_p->y = arg->page_p1.y; return PL_LOOP_CONT; } static pl_loop_rc_t __pl_minoverlap_get_next_pos( position *ret_p, struct pl_ret_t *ret, const struct pl_arg_t *arg, position hint_p) { ret_p->x = arg->place_g.x; ret_p->y = arg->place_g.y; if (ret_p->x + arg->place_g.width <= arg->page_p2.x) { /* try next x */ ret_p->x = __pl_minoverlap_get_next_x(arg); ret_p->y = arg->place_g.y; } if (ret_p->x + arg->place_g.width > arg->page_p2.x) { /* out of room in x direction. Try next y. Reset x.*/ ret_p->x = arg->page_p1.x; ret_p->y = __pl_minoverlap_get_next_y(arg); } if (ret_p->y + arg->place_g.height > arg->page_p2.y) { /* PageBottom */ return PL_LOOP_END; } return PL_LOOP_CONT; } static pl_penalty_t __pl_minoverlap_get_avoidance_penalty( const pl_arg_t *arg, FvwmWindow *other_fw, const rectangle *other_g) { pl_penalty_t anew; pl_penalty_t avoidance_factor; position other_p2; const pl_penalty_struct *opp; const pl_percent_penalty_struct *oppp; opp = (arg->scratch->pp != 0 && 0) ? arg->scratch->pp : &other_fw->pl_penalty; oppp = (arg->scratch->ppp != 0 && 0) ? arg->scratch->ppp : &other_fw->pl_percent_penalty; other_p2.x = other_g->x + other_g->width; other_p2.y = other_g->y + other_g->height; { long x1 = MAX(arg->place_g.x, other_g->x); long x2 = MIN(arg->place_p2.x, other_p2.x); long y1 = MAX(arg->place_g.y, other_g->y); long y2 = MIN(arg->place_p2.y, other_p2.y); /* overlapping area in pixels (windows are guaranteed to * overlap when this function is called) */ anew = (x2 - x1) * (y2 - y1); } if (IS_ICONIFIED(other_fw)) { avoidance_factor = ICON_PLACEMENT_PENALTY(opp); } else if (compare_window_layers(other_fw, arg->place_fw) > 0) { avoidance_factor = ONTOP_PLACEMENT_PENALTY(opp); } else if (compare_window_layers(other_fw, arg->place_fw) < 0) { avoidance_factor = BELOW_PLACEMENT_PENALTY(opp); } else if ( IS_STICKY_ACROSS_PAGES(other_fw) || IS_STICKY_ACROSS_DESKS(other_fw)) { avoidance_factor = STICKY_PLACEMENT_PENALTY(opp); } else { avoidance_factor = NORMAL_PLACEMENT_PENALTY(opp); } if (arg->flags.use_percent == 1) { pl_penalty_t cover_factor; long other_area; long place_area; other_area = other_g->width * other_g->height; place_area = arg->place_g.width * arg->place_g.height; cover_factor = 0; if (other_area != 0 && place_area != 0) { anew = 100 * MAX(anew / other_area, anew / place_area); if (anew >= 99) { cover_factor = PERCENTAGE_99_PENALTY(oppp); } else if (anew > 94) { cover_factor = PERCENTAGE_95_PENALTY(oppp); } else if (anew > 84) { cover_factor = PERCENTAGE_85_PENALTY(oppp); } else if (anew > 74) { cover_factor = PERCENTAGE_75_PENALTY(oppp); } } if (avoidance_factor >= 1) { avoidance_factor += cover_factor; } } if ( arg->flags.use_ewmh_dynamic_working_areapercent == 1 && DO_EWMH_IGNORE_STRUT_HINTS(other_fw) == 0 && ( other_fw->dyn_strut.left > 0 || other_fw->dyn_strut.right > 0 || other_fw->dyn_strut.top > 0 || other_fw->dyn_strut.bottom > 0)) { const pl_penalty_struct *mypp; mypp = (arg->scratch->pp != 0 && 0) ? arg->scratch->pp : &arg->place_fw->pl_penalty; /* if we intersect a window which reserves space */ avoidance_factor += (avoidance_factor >= 1) ? EWMH_STRUT_PLACEMENT_PENALTY(mypp) : 0; } anew *= avoidance_factor; return anew; } static pl_penalty_t __pl_minoverlap_get_pos_penalty( position *ret_hint_p, struct pl_ret_t *ret, const struct pl_arg_t *arg) { FvwmWindow *other_fw; pl_penalty_t penalty; size_borders b; penalty = 0; for ( other_fw = Scr.FvwmRoot.next; other_fw != NULL; other_fw = other_fw->next) { rectangle other_g; get_window_borders(other_fw, &b); if ( arg->place_fw == other_fw || IS_EWMH_DESKTOP(FW_W(other_fw))) { continue; } /* RBW - account for sticky windows... */ if ( other_fw->Desk != arg->place_fw->Desk && IS_STICKY_ACROSS_DESKS(other_fw) == 0) { continue; } (void)get_visible_window_or_icon_geometry(other_fw, &other_g); if (IS_STICKY_ACROSS_PAGES(other_fw)) { other_g.x -= arg->pdelta_p.x; other_g.y -= arg->pdelta_p.y; } if ( arg->place_g.x < other_g.x + other_g.width && arg->place_p2.x > other_g.x && arg->place_g.y < other_g.y + other_g.height && arg->place_p2.y > other_g.y) { pl_penalty_t anew; anew = __pl_minoverlap_get_avoidance_penalty( arg, other_fw, &other_g); penalty += anew; if ( penalty > ret->best_penalty && ret->best_penalty != -1) { /* TA: 20091230: Fix over-zealous penalties * by explicitly forcing the window on-screen * here. The y-axis is only affected here, * due to how the xoffset calculations happen * prior to setting the x-axis. When we get * penalties which are "over-zealous" -- and * by not taking into account the size of the * window borders, the window was being placed * off screen. */ if (ret->best_p.y + arg->place_g.height > arg->page_p2.y) { ret->best_p.y = (arg->page_p2.y - arg->place_g.height - b.total_size.height); ret->best_penalty = 0; penalty = 0; } /* stop looking; the penalty is too high */ return penalty; } } } /* now handle the working area */ { const pl_penalty_struct *mypp; mypp = (arg->scratch->pp != 0 && 0) ? arg->scratch->pp : &arg->place_fw->pl_penalty; if (arg->flags.use_ewmh_dynamic_working_areapercent == 1) { penalty += EWMH_STRUT_PLACEMENT_PENALTY(mypp) * EWMH_GetStrutIntersection( arg->place_g.x, arg->place_g.y, arg->place_p2.x, arg->place_p2.y, arg->flags.use_percent); } else { /* EWMH_USE_DYNAMIC_WORKING_AREA, count the base strut */ penalty += EWMH_STRUT_PLACEMENT_PENALTY(mypp) * EWMH_GetBaseStrutIntersection( arg->place_g.x, arg->place_g.y, arg->place_p2.x, arg->place_p2.y, arg->flags.use_percent); } } return penalty; } /* ---------------------------- local functions (SmartPlacement) ----------- */ static pl_penalty_t __pl_smart_get_pos_penalty( position *ret_hint_p, struct pl_ret_t *ret, const struct pl_arg_t *arg) { pl_penalty_t p; arg->scratch->pp = &default_pl_penalty; arg->scratch->ppp = &default_pl_percent_penalty; p = __pl_minoverlap_get_pos_penalty(ret_hint_p, ret, arg); if (p != 0) { p = -1; } return p; } /* ---------------------------- local functions ---------------------------- */ static int placement_loop(pl_ret_t *ret, pl_arg_t *arg) { position next_p; pl_penalty_t penalty; pl_loop_rc_t loop_rc; if (arg->algo->get_pos_simple != NULL) { position pos; penalty = arg->algo->get_pos_simple(&pos, ret, arg); arg->place_g.x = pos.x; arg->place_g.y = pos.y; ret->best_penalty = penalty; ret->best_p.x = pos.x; ret->best_p.y = pos.y; loop_rc = PL_LOOP_END; } else { loop_rc = arg->algo->get_first_pos(&next_p, ret, arg); arg->place_g.x = next_p.x; arg->place_g.y = next_p.y; ret->best_p.x = next_p.x; ret->best_p.y = next_p.y; } while (loop_rc != PL_LOOP_END) { position hint_p; pl_scratch_t scratch; memset(&scratch, 0, sizeof(scratch)); arg->scratch = &scratch; arg->place_p2.x = arg->place_g.x + arg->place_g.width; arg->place_p2.y = arg->place_g.y + arg->place_g.height; hint_p.x = arg->place_g.x; hint_p.y = arg->place_g.y; penalty = arg->algo->get_pos_penalty(&hint_p, ret, arg); /* I've added +0.0001 because with my machine the < test fail * with certain *equal* float numbers! */ if ( penalty >= 0 && ( ret->best_penalty < 0 || penalty + 0.0001 < ret->best_penalty)) { ret->best_p.x = arg->place_g.x; ret->best_p.y = arg->place_g.y; ret->best_penalty = penalty; } if (penalty == 0) { break; } loop_rc = arg->algo->get_next_pos(&next_p, ret, arg, hint_p); arg->place_g.x = next_p.x; arg->place_g.y = next_p.y; } if (ret->best_penalty < 0) { ret->best_penalty = -1; } return (ret->best_penalty == -1) ? -1 : 0; } static void __place_get_placement_flags( pl_flags_t *ret_flags, FvwmWindow *fw, window_style *pstyle, initial_window_options_t *win_opts, int mode, pl_reason_t *reason) { Bool override_ppos; Bool override_uspos; Bool has_ppos = False; Bool has_uspos = False; /* Windows use the position hint if these conditions are met: * * The program specified a USPosition hint and it is not overridden * with the No(Transient)USPosition style. * * OR * * The program specified a PPosition hint and it is not overridden * with the No(Transient)PPosition style. * * Windows without a position hint are placed using wm placement. */ if (IS_TRANSIENT(fw)) { override_ppos = SUSE_NO_TRANSIENT_PPOSITION(&pstyle->flags); override_uspos = SUSE_NO_TRANSIENT_USPOSITION(&pstyle->flags); } else { override_ppos = SUSE_NO_PPOSITION(&pstyle->flags); override_uspos = SUSE_NO_USPOSITION(&pstyle->flags); } if (fw->hints.flags & PPosition) { if (!override_ppos) { has_ppos = True; reason->pos.reason = PR_POS_USE_PPOS; } else { reason->pos.reason = PR_POS_IGNORE_PPOS; } } if (fw->hints.flags & USPosition) { if (!override_uspos) { has_uspos = True; reason->pos.reason = PR_POS_USE_USPOS; } else if (reason->pos.reason != PR_POS_USE_PPOS) { reason->pos.reason = PR_POS_IGNORE_USPOS; } } if (mode == PLACE_AGAIN) { ret_flags->do_not_use_wm_placement = 0; reason->pos.reason = PR_POS_PLACE_AGAIN; } else if (has_ppos || has_uspos) { ret_flags->do_not_use_wm_placement = 1; } else if (win_opts->flags.do_override_ppos) { ret_flags->do_not_use_wm_placement = 1; reason->pos.reason = PR_POS_CAPTURE; } else if (!ret_flags->do_honor_starts_on_page && fw->wmhints && (fw->wmhints->flags & StateHint) && fw->wmhints->initial_state == IconicState) { ret_flags->do_forbid_manual_placement = 1; reason->pos.do_not_manual_icon_placement = 1; } return; } static int __add_algo( const pl_algo_t **algos, int num_algos, const pl_algo_t *new_algo) { if (num_algos >= MAX_NUM_PLACEMENT_ALGOS) { return MAX_NUM_PLACEMENT_ALGOS; } algos[num_algos] = new_algo; num_algos++; return num_algos; } static int __place_get_wm_pos( const exec_context_t *exc, window_style *pstyle, rectangle *attr_g, pl_flags_t flags, rectangle screen_g, pl_start_style_t start_style, int mode, initial_window_options_t *win_opts, pl_reason_t *reason, int pdeltax, int pdeltay) { const pl_algo_t *algos[MAX_NUM_PLACEMENT_ALGOS + 1]; int num_algos; unsigned int placement_mode = SPLACEMENT_MODE(&pstyle->flags); pl_arg_t arg; pl_ret_t ret; int i; /* BEGIN init placement agrs and ret */ memset(&arg, 0, sizeof(arg)); arg.exc = exc; arg.style = pstyle; arg.reason = reason; arg.place_fw = exc->w.fw; arg.place_g = arg.place_fw->g.frame; arg.screen_g = screen_g; arg.page_p1.x = arg.screen_g.x - pdeltax; arg.page_p1.y = arg.screen_g.y - pdeltay; arg.page_p2.x = arg.page_p1.x + screen_g.width; arg.page_p2.y = arg.page_p1.y + screen_g.height; arg.pdelta_p.x = pdeltax; arg.pdelta_p.y = pdeltay; arg.flags.use_percent = 0; arg.flags.do_honor_starts_on_page = flags.do_honor_starts_on_page; if (SEWMH_PLACEMENT_MODE(&pstyle->flags) == EWMH_USE_WORKING_AREA) { arg.flags.use_ewmh_dynamic_working_areapercent = 1; } memset(&ret, 0, sizeof(ret)); ret.best_penalty = -1.0; /* END init placement agrs and ret */ /* override if manual placement happens */ SET_PLACED_BY_FVWM(arg.place_fw, 1); if (flags.do_forbid_manual_placement) { switch (placement_mode) { case PLACE_MANUAL: case PLACE_MANUAL_B: placement_mode = PLACE_CASCADE; break; case PLACE_TILEMANUAL: placement_mode = PLACE_TILECASCADE; break; default: break; } } reason->pos.algo = placement_mode; /* first, try various "smart" placement */ num_algos = 0; switch (placement_mode) { case PLACE_POSITION: num_algos = __add_algo( algos, num_algos, &position_placement_algo); break; case PLACE_TILEMANUAL: num_algos = __add_algo( algos, num_algos, &smart_placement_algo); num_algos = __add_algo( algos, num_algos, &manual_placement_algo); break; case PLACE_MINOVERLAPPERCENT: arg.flags.use_percent = 1; /* fall through */ case PLACE_MINOVERLAP: num_algos = __add_algo( algos, num_algos, &minoverlap_placement_algo); break; case PLACE_TILECASCADE: num_algos = __add_algo( algos, num_algos, &smart_placement_algo); num_algos = __add_algo( algos, num_algos, &cascade_placement_algo); break; case PLACE_MANUAL: case PLACE_MANUAL_B: num_algos = __add_algo( algos, num_algos, &manual_placement_algo); break; case PLACE_CASCADE: case PLACE_CASCADE_B: num_algos = __add_algo( algos, num_algos, &cascade_placement_algo); break; default: /* can't happen */ break; } /* try all the placement algorithms */ for (i = 0 ; ret.best_penalty < 0 && i < num_algos; i++) { arg.algo = algos[i]; placement_loop(&ret, &arg); } if (ret.best_penalty >= 0) { /* placement succed */ attr_g->x = ret.best_p.x; attr_g->y = ret.best_p.y; } else { /* fall back to default position */ attr_g->x = 0; attr_g->y = 0; reason->pos.has_placement_failed = 1; } return ret.flags.do_resize_too; } static int __place_get_nowm_pos( const exec_context_t *exc, window_style *pstyle, rectangle *attr_g, pl_flags_t flags, rectangle screen_g, pl_start_style_t start_style, int mode, initial_window_options_t *win_opts, pl_reason_t *reason, int pdeltax, int pdeltay) { FvwmWindow *fw = exc->w.fw; size_borders b; if (!win_opts->flags.do_override_ppos) { SET_PLACED_BY_FVWM(fw, False); } /* the USPosition was specified, or the window is a transient, or it * starts iconic so place it automatically */ if ( SUSE_START_ON_SCREEN(&pstyle->flags) && flags.do_honor_starts_on_screen) { fscreen_scr_t mangle_screen; /* If StartsOnScreen has been given for a window, translate its * USPosition so that it is relative to that particular screen. * If we don't do this, then a geometry would completely * cancel the effect of the StartsOnScreen style. However, some * applications try to remember their position. This would * break if these were translated to screen coordinates. There * is no reliable way to do it. Currently, if the desired * place does not intersect the target screen, we assume the * window position must be adjusted to the screen origin. So * there are two ways to get a window to pop up on a particular * Xinerama screen. 1: The intuitive way giving a geometry * hint relative to the desired screen's 0,0 along with the * appropriate StartsOnScreen style (or *wmscreen resource), or * 2: Do NOT specify a Xinerama screen (or specify it to be * 'g') and give the geometry hint in terms of the global * screen. */ mangle_screen = FScreenFetchMangledScreenFromUSPosHints( &(fw->hints)); if (mangle_screen != FSCREEN_GLOBAL) { /* whoever set this hint knew exactly what he was * doing; so ignore the StartsOnScreen style */ flags.do_honor_starts_on_screen = 0; reason->pos.reason = PR_POS_USPOS_OVERRIDE_SOS; } else if (attr_g->x + attr_g->width < screen_g.x || attr_g->x >= screen_g.x + screen_g.width || attr_g->y + attr_g->height < screen_g.y || attr_g->y >= screen_g.y + screen_g.height) { /* desired coordinates do not intersect the target * screen. Let's assume the application specified * global coordinates and translate them to the screen. */ FScreenTranslateCoordinates( NULL, start_style.screen, NULL, FSCREEN_GLOBAL, &attr_g->x, &attr_g->y); reason->pos.do_adjust_off_screen = 1; } } /* If SkipMapping, and other legalities are observed, adjust for * StartsOnPage. */ if (DO_NOT_SHOW_ON_MAP(fw) && flags.do_honor_starts_on_page && (!IS_TRANSIENT(fw) || SUSE_START_ON_PAGE_FOR_TRANSIENT(&pstyle->flags)) #if 0 /* dv 08-Jul-2003: Do not use this. Instead, force the window on * the requested page even if the application requested a different * position. */ && (SUSE_NO_PPOSITION(&pstyle->flags) || !(fw->hints.flags & PPosition)) /* dv 08-Jul-2003: This condition is always true because we * already checked for flags.do_honor_starts_on_page above. */ /* RBW - allow StartsOnPage to go through, even if iconic. */ && ((!(fw->wmhints && (fw->wmhints->flags & StateHint) && fw->wmhints->initial_state == IconicState)) || flags.do_honor_starts_on_page) #endif ) { int old_x; int old_y; old_x = attr_g->x; old_y = attr_g->y; /* We're placing a SkipMapping window - either capturing one * that's previously been mapped, or overriding USPosition - so * what we have here is its actual untouched coordinates. In * case it was a StartsOnPage window, we have to 1) convert the * existing x,y offsets relative to the requested page (i.e., * as though there were only one page, no virtual desktop), * then 2) readjust relative to the current page. */ if (attr_g->x < 0) { attr_g->x += Scr.MyDisplayWidth; } attr_g->x %= Scr.MyDisplayWidth; attr_g->x -= pdeltax; /* Noticed a quirk here. With some apps (e.g., xman), we find * the placement has moved 1 pixel away from where we * originally put it when we come through here. Why is this * happening? Probably attr_backup.border_width, try xclock * -borderwidth 100 */ if (attr_g->y < 0) { attr_g->y += Scr.MyDisplayHeight; } attr_g->y %= Scr.MyDisplayHeight; attr_g->y -= pdeltay; if (attr_g->x != old_x || attr_g->y != old_y) { reason->pos.do_adjust_off_page = 1; } } /* put it where asked, mod title bar */ /* if the gravity is towards the top, move it by the title height */ { rectangle final_g; int gravx; int gravy; gravity_get_offsets(fw->hints.win_gravity, &gravx, &gravy); final_g.x = attr_g->x + gravx * fw->attr_backup.border_width; final_g.y = attr_g->y + gravy * fw->attr_backup.border_width; /* Virtually all applications seem to share a common bug: they * request the top left pixel of their *border* as their origin * instead of the top left pixel of their client window, e.g. * 'xterm -g +0+0' creates an xterm that tries to map at (0 0) * although its border (width 1) would not be visible if it ran * under plain X. It should have tried to map at (1 1) * instead. This clearly violates the ICCCM, but trying to * change this is like tilting at windmills. So we have to add * the border width here. */ final_g.x += fw->attr_backup.border_width; final_g.y += fw->attr_backup.border_width; final_g.width = 0; final_g.height = 0; if (mode == PLACE_INITIAL) { get_window_borders(fw, &b); gravity_resize( fw->hints.win_gravity, &final_g, b.total_size.width, b.total_size.height); } attr_g->x = final_g.x; attr_g->y = final_g.y; } return 0; } /* Handles initial placement and sizing of a new window * * Return value: * * 0 = window lost * 1 = OK * 2 = OK, window must be resized too */ static int __place_window( const exec_context_t *exc, window_style *pstyle, rectangle *attr_g, pl_start_style_t start_style, int mode, initial_window_options_t *win_opts, pl_reason_t *reason) { FvwmWindow *t; int is_skipmapping_forbidden; int px = 0; int py = 0; int pdeltax = 0; int pdeltay = 0; rectangle screen_g; int rc = 0; pl_flags_t flags; extern Bool Restarting; FvwmWindow *fw = exc->w.fw; memset(&flags, 0, sizeof(flags)); /* Select a desk to put the window on (in list of priority): * 1. Sticky Windows stay on the current desk. * 2. Windows specified with StartsOnDesk go where specified * 3. Put it on the desk it was on before the restart. * 4. Transients go on the same desk as their parents. * 5. Window groups stay together (if the KeepWindowGroupsOnDesk style * is used). */ /* Let's get the StartsOnDesk/Page tests out of the way first. */ if ( SUSE_START_ON_DESK(&pstyle->flags) || SUSE_START_ON_SCREEN(&pstyle->flags)) { flags.do_honor_starts_on_page = 1; flags.do_honor_starts_on_screen = 1; /* * Honor the flag unless... * it's a restart or recapture, and that option's disallowed... */ if (win_opts->flags.do_override_ppos && (Restarting || (Scr.flags.are_windows_captured)) && !SRECAPTURE_HONORS_STARTS_ON_PAGE(&pstyle->flags)) { flags.do_honor_starts_on_page = 0; flags.do_honor_starts_on_screen = 0; reason->page.reason = PR_PAGE_IGNORE_CAPTURE; reason->page.do_ignore_starts_on_page = 1; reason->screen.reason = PR_PAGE_IGNORE_CAPTURE; } /* * it's a cold start window capture, and that's disallowed... */ if (win_opts->flags.do_override_ppos && (!Restarting && !(Scr.flags.are_windows_captured)) && !SCAPTURE_HONORS_STARTS_ON_PAGE(&pstyle->flags)) { flags.do_honor_starts_on_page = 0; flags.do_honor_starts_on_screen = 0; reason->page.reason = PR_PAGE_IGNORE_CAPTURE; reason->page.do_ignore_starts_on_page = 1; reason->screen.reason = PR_PAGE_IGNORE_CAPTURE; } /* * it's ActivePlacement and SkipMapping, and that's disallowed. */ switch (SPLACEMENT_MODE(&pstyle->flags)) { case PLACE_MANUAL: case PLACE_MANUAL_B: case PLACE_TILEMANUAL: is_skipmapping_forbidden = !SMANUAL_PLACEMENT_HONORS_STARTS_ON_PAGE( &pstyle->flags); break; default: is_skipmapping_forbidden = 0; break; } if (win_opts->flags.do_override_ppos || !DO_NOT_SHOW_ON_MAP(fw)) { is_skipmapping_forbidden = 0; } if (is_skipmapping_forbidden == 1) { flags.do_honor_starts_on_page = 0; reason->page.reason = PR_PAGE_IGNORE_INVALID; reason->page.do_ignore_starts_on_page = 1; fvwm_msg( WARN, "__place_window", "invalid style combination used: StartsOnPage" "/StartsOnDesk and SkipMapping don't work with" " ManualPlacement and TileManualPlacement." " Putting window on current page, please use" " another placement style or" " ActivePlacementHonorsStartsOnPage."); } } /* get the screen coordinates to place window on */ if (SUSE_START_ON_SCREEN(&pstyle->flags)) { if (flags.do_honor_starts_on_screen) { /* use screen from style */ FScreenGetScrRect( NULL, start_style.screen, &screen_g.x, &screen_g.y, &screen_g.width, &screen_g.height); reason->screen.screen = start_style.screen; } else { /* use global screen */ FScreenGetScrRect( NULL, FSCREEN_GLOBAL, &screen_g.x, &screen_g.y, &screen_g.width, &screen_g.height); reason->screen.screen = FSCREEN_GLOBAL; } } else { /* use current screen */ FScreenGetScrRect( NULL, FSCREEN_CURRENT, &screen_g.x, &screen_g.y, &screen_g.width, &screen_g.height); reason->screen.screen = FSCREEN_CURRENT; } if (SPLACEMENT_MODE(&pstyle->flags) != PLACE_MINOVERLAPPERCENT && SPLACEMENT_MODE(&pstyle->flags) != PLACE_MINOVERLAP && SPLACEMENT_MODE(&pstyle->flags) != PLACE_POSITION) { /* TA: In the case of PositionPlacement, the "ewmhiwa" option * will have already modified this for us -- so don't do it * for this placement policy. */ EWMH_GetWorkAreaIntersection( fw, &screen_g.x, &screen_g.y, &screen_g.width, &screen_g.height, SEWMH_PLACEMENT_MODE(&pstyle->flags)); reason->screen.was_modified_by_ewmh_workingarea = 1; } reason->screen.g = screen_g; /* Don't alter the existing desk location during Capture/Recapture. */ if (!win_opts->flags.do_override_ppos) { fw->Desk = Scr.CurrentDesk; reason->desk.reason = PR_DESK_CURRENT; } else { reason->desk.reason = PR_DESK_CAPTURE; } if (S_IS_STICKY_ACROSS_DESKS(SFC(pstyle->flags))) { fw->Desk = Scr.CurrentDesk; reason->desk.reason = PR_DESK_STICKY; } else if (SUSE_START_ON_DESK(&pstyle->flags) && start_style.desk && flags.do_honor_starts_on_page) { fw->Desk = (start_style.desk > -1) ? start_style.desk - 1 : start_style.desk; reason->desk.reason = reason->desk.sod_reason; } else { if ((DO_USE_WINDOW_GROUP_HINT(fw)) && (fw->wmhints) && (fw->wmhints->flags & WindowGroupHint)&& (fw->wmhints->window_group != None) && (fw->wmhints->window_group != Scr.Root)) { /* Try to find the group leader or another window in * the group */ for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if (FW_W(t) == fw->wmhints->window_group) { /* found the group leader, break out */ fw->Desk = t->Desk; reason->desk.reason = PR_DESK_WINDOW_GROUP_LEADER; break; } else if (t->wmhints && (t->wmhints->flags & WindowGroupHint) && (t->wmhints->window_group == fw->wmhints->window_group)) { /* found a window from the same group, * but keep looking for the group * leader */ fw->Desk = t->Desk; reason->desk.reason = PR_DESK_WINDOW_GROUP_MEMBER; } } } if ((IS_TRANSIENT(fw))&&(FW_W_TRANSIENTFOR(fw)!=None)&& (FW_W_TRANSIENTFOR(fw) != Scr.Root)) { /* Try to find the parent's desktop */ for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if (FW_W(t) == FW_W_TRANSIENTFOR(fw)) { fw->Desk = t->Desk; reason->desk.reason = PR_DESK_TRANSIENT; break; } } } { /* migo - I am not sure this block is ever needed */ Atom atype; int aformat; unsigned long nitems, bytes_remain; unsigned char *prop; if ( XGetWindowProperty( dpy, FW_W(fw), _XA_WM_DESKTOP, 0L, 1L, True, _XA_WM_DESKTOP, &atype, &aformat, &nitems, &bytes_remain, &prop) == Success) { if (prop != NULL) { fw->Desk = *(unsigned long *)prop; XFree(prop); reason->desk.reason = PR_DESK_XPROP_XA_WM_DESKTOP; } } } } reason->desk.desk = fw->Desk; /* I think it would be good to switch to the selected desk * whenever a new window pops up, except during initialization */ /* RBW - 11/02/1998 -- I dont. */ if (!win_opts->flags.do_override_ppos && !DO_NOT_SHOW_ON_MAP(fw)) { if (Scr.CurrentDesk != fw->Desk) { reason->desk.do_switch_desk = 1; } goto_desk(fw->Desk); } /* Don't move viewport if SkipMapping, or if recapturing the window, * adjust the coordinates later. Otherwise, just switch to the target * page - it's ever so much simpler. */ if (S_IS_STICKY_ACROSS_PAGES(SFC(pstyle->flags))) { reason->page.reason = PR_PAGE_STICKY; } else if (SUSE_START_ON_DESK(&pstyle->flags)) { if (start_style.page_x != 0 && start_style.page_y != 0) { px = start_style.page_x - 1; py = start_style.page_y - 1; reason->page.reason = PR_PAGE_STYLE; px *= Scr.MyDisplayWidth; py *= Scr.MyDisplayHeight; if (!win_opts->flags.do_override_ppos && !DO_NOT_SHOW_ON_MAP(fw)) { MoveViewport(px,py,True); reason->page.do_switch_page = 1; } else if (flags.do_honor_starts_on_page) { /* Save the delta from current page */ pdeltax = Scr.Vx - px; pdeltay = Scr.Vy - py; reason->page.do_honor_starts_on_page = 1; } } } /* pick a location for the window. */ __place_get_placement_flags( &flags, fw, pstyle, win_opts, mode, reason); if (flags.do_not_use_wm_placement) { rc = __place_get_nowm_pos( exc, pstyle, attr_g, flags, screen_g, start_style, mode, win_opts, reason, pdeltax, pdeltay); } else { rc = __place_get_wm_pos( exc, pstyle, attr_g, flags, screen_g, start_style, mode, win_opts, reason, pdeltax, pdeltay); } reason->pos.x = attr_g->x; reason->pos.y = attr_g->y; return rc; } static void __place_handle_x_resources( FvwmWindow *fw, window_style *pstyle, pl_reason_t *reason) { int client_argc = 0; char **client_argv = NULL; XrmValue rm_value; /* Used to parse command line of clients for specific desk requests. */ /* Todo: check for multiple desks. */ XrmDatabase db = NULL; static XrmOptionDescRec table [] = { /* Want to accept "-workspace N" or -xrm "fvwm*desk:N" as * options to specify the desktop. I have to include dummy * options that are meaningless since Xrm seems to allow -w to * match -workspace if there would be no ambiguity. */ {"-workspacf", "*junk", XrmoptionSepArg, (caddr_t) NULL}, {"-workspace", "*desk", XrmoptionSepArg, (caddr_t) NULL}, {"-xrn", NULL, XrmoptionResArg, (caddr_t) NULL}, {"-xrm", NULL, XrmoptionResArg, (caddr_t) NULL}, }; int t1 = -1, t2 = -1, t3 = -1, spargs = 0; /* Find out if the client requested a specific desk on the command * line. * RBW - 11/20/1998 - allow a desk of -1 to work. */ if (XGetCommand(dpy, FW_W(fw), &client_argv, &client_argc) == 0) { return; } if (client_argc <= 0 || client_argv == NULL) { return; } /* Get global X resources */ MergeXResources(dpy, &db, False); /* command line takes precedence over all */ MergeCmdLineResources( &db, table, 4, client_argv[0], &client_argc, client_argv, True); /* parse the database values */ if (GetResourceString(db, "desk", client_argv[0], &rm_value) && rm_value.size != 0) { SGET_START_DESK(*pstyle) = atoi(rm_value.addr); /* RBW - 11/20/1998 */ if (SGET_START_DESK(*pstyle) > -1) { SSET_START_DESK( *pstyle, SGET_START_DESK(*pstyle) + 1); } reason->desk.sod_reason = PR_DESK_X_RESOURCE_DESK; pstyle->flags.use_start_on_desk = 1; } if (GetResourceString(db, "fvwmscreen", client_argv[0], &rm_value) && rm_value.size != 0) { SSET_START_SCREEN( *pstyle, FScreenGetScreenArgument(rm_value.addr, 'c')); reason->screen.reason = PR_SCREEN_X_RESOURCE_FVWMSCREEN; reason->screen.screen = SGET_START_SCREEN(*pstyle); pstyle->flags.use_start_on_screen = 1; } if (GetResourceString(db, "page", client_argv[0], &rm_value) && rm_value.size != 0) { spargs = sscanf( rm_value.addr, "%d %d %d", &t1, &t2, &t3); switch (spargs) { case 1: pstyle->flags.use_start_on_desk = 1; SSET_START_DESK(*pstyle, (t1 > -1) ? t1 + 1 : t1); reason->desk.sod_reason = PR_DESK_X_RESOURCE_PAGE; break; case 2: pstyle->flags.use_start_on_desk = 1; SSET_START_PAGE_X(*pstyle, (t1 > -1) ? t1 + 1 : t1); SSET_START_PAGE_Y(*pstyle, (t2 > -1) ? t2 + 1 : t2); reason->page.reason = PR_PAGE_X_RESOURCE_PAGE; reason->page.px = SGET_START_PAGE_X(*pstyle); reason->page.py = SGET_START_PAGE_Y(*pstyle); break; case 3: pstyle->flags.use_start_on_desk = 1; SSET_START_DESK(*pstyle, (t1 > -1) ? t1 + 1 : t1); reason->desk.sod_reason = PR_DESK_X_RESOURCE_PAGE; SSET_START_PAGE_X(*pstyle, (t2 > -1) ? t2 + 1 : t2); SSET_START_PAGE_Y(*pstyle, (t3 > -1) ? t3 + 1 : t3); reason->page.reason = PR_PAGE_X_RESOURCE_PAGE; reason->page.px = SGET_START_PAGE_X(*pstyle); reason->page.py = SGET_START_PAGE_Y(*pstyle); break; default: break; } } XFreeStringList(client_argv); XrmDestroyDatabase(db); return; } static void __explain_placement(FvwmWindow *fw, pl_reason_t *reason) { char explanation[2048]; char *r; char *s; char t[32]; int do_show_page; int is_placed_by_algo; *explanation = 0; s = explanation; strcat(s, "placed new window 0x%x '%s':\n"); s += strlen(s); sprintf( s, " initial size %dx%d\n", fw->g.frame.width, fw->g.frame.height); s += strlen(s); switch (reason->desk.reason) { case PR_DESK_CURRENT: r = "current desk"; break; case PR_DESK_STYLE: r = "specified by style"; break; case PR_DESK_X_RESOURCE_DESK: r = "specified by 'desk' X resource"; break; case PR_DESK_X_RESOURCE_PAGE: r = "specified by 'page' X resource"; break; case PR_DESK_CAPTURE: r = "window was (re)captured"; break; case PR_DESK_STICKY: r = "window is sticky"; break; case PR_DESK_WINDOW_GROUP_LEADER: r = "same desk as window group leader"; break; case PR_DESK_WINDOW_GROUP_MEMBER: r = "same desk as window group member"; break; case PR_DESK_TRANSIENT: r = "transient window placed on same desk as parent"; break; case PR_DESK_XPROP_XA_WM_DESKTOP: r = "specified by _XA_WM_DESKTOP property"; break; default: r = "bug"; break; } sprintf(s, " desk %d (%s)\n", reason->desk.desk, r); s += strlen(s); if (reason->desk.do_switch_desk == 1) { sprintf(s, " (switched to desk)\n"); s += strlen(s); } /* page */ do_show_page = 1; switch (reason->page.reason) { case PR_PAGE_CURRENT: do_show_page = 0; r = "current page"; break; case PR_PAGE_STYLE: r = "specified by style"; break; case PR_PAGE_X_RESOURCE_PAGE: r = "specified by 'page' X resource"; break; case PR_PAGE_IGNORE_CAPTURE: r = "window was (re)captured"; break; case PR_PAGE_IGNORE_INVALID: r = "requested page ignored because of invalid style" " combination"; break; case PR_PAGE_STICKY: do_show_page = 0; r = "current page (window is sticky)"; break; default: r = "bug"; break; } if (do_show_page == 0) { sprintf(s, " %s\n", r); } else { sprintf( s, " page %d %d (%s)\n", reason->page.px - 1, reason->page.py - 1, r); } s += strlen(s); if (reason->page.do_switch_page == 1) { sprintf(s, " (switched to page)\n"); s += strlen(s); } if (reason->page.do_ignore_starts_on_page == 1) { sprintf(s, " (possibly ignored StartsOnPage)\n"); s += strlen(s); } /* screen */ if (FScreenIsEnabled() == True || FScreenIsSLSEnabled() == True) { switch (reason->screen.reason) { case PR_SCREEN_CURRENT: r = "current screen"; break; case PR_SCREEN_STYLE: r = "specified by style"; break; case PR_SCREEN_X_RESOURCE_FVWMSCREEN: r = "specified by 'fvwmscreen' X resource"; break; case PR_SCREEN_IGNORE_CAPTURE: r = "window was (re)captured"; break; default: r = "bug"; break; } FScreenSpecToString(t, 32, reason->screen.screen); sprintf( s, " screen: %s: %d %d %dx%d (%s)\n", t, reason->screen.g.x, reason->screen.g.y, reason->screen.g.width, reason->screen.g.height, r); s += strlen(s); if (reason->screen.was_modified_by_ewmh_workingarea == 1) { sprintf( s, " (screen area modified by EWMH working" " area)\n"); s += strlen(s); } } /* position */ is_placed_by_algo = 0; switch (reason->pos.reason) { case PR_POS_NORMAL: is_placed_by_algo = 1; r = "normal placement"; break; case PR_POS_IGNORE_PPOS: is_placed_by_algo = 1; r = "ignored program specified position"; break; case PR_POS_USE_PPOS: r = "used program specified position"; break; case PR_POS_IGNORE_USPOS: is_placed_by_algo = 1; r = "ignored user specified position"; break; case PR_POS_USE_USPOS: r = "used user specified position"; break; case PR_POS_PLACE_AGAIN: is_placed_by_algo = 1; r = "by PlaceAgain command"; break; case PR_POS_CAPTURE: r = "window was (re)captured"; break; case PR_POS_USPOS_OVERRIDE_SOS: r = "StartsOnPage style overridden by application via USPos"; break; default: r = "bug"; break; } sprintf(s, " position %d %d", reason->pos.x, reason->pos.y); s += strlen(s); if (is_placed_by_algo == 1) { char *a; char *b; b = ""; switch (reason->pos.algo) { case PLACE_POSITION: a = "Position args: "; b = reason->pos.pl_position_string; break; case PLACE_TILEMANUAL: a = "TileManual"; break; case PLACE_MANUAL: case PLACE_MANUAL_B: a = "Manual"; break; case PLACE_MINOVERLAPPERCENT: a = "MinOverlapPercent"; break; case PLACE_TILECASCADE: a = "TileCascade"; break; case PLACE_CASCADE: case PLACE_CASCADE_B: a = "Cascade"; break; case PLACE_MINOVERLAP: a = "MinOverlap"; break; default: a = "bug"; break; } sprintf(s, ", placed by fvwm (%s)\n", r); s += strlen(s); sprintf(s, " placement method: %s%s\n", a, b); s += strlen(s); if (reason->pos.do_not_manual_icon_placement == 1) { sprintf(s, " (icon not placed manually)\n"); s += strlen(s); } if (reason->pos.is_pl_position_string_invalid == 1) { sprintf(s, " (invalid position string)\n"); s += strlen(s); } if (reason->pos.has_tile_failed == 1) { sprintf(s, " (tile placement failed)\n"); s += strlen(s); } if (reason->pos.has_manual_failed == 1) { sprintf(s, " (manual placement failed)\n"); s += strlen(s); } if (reason->pos.has_placement_failed == 1) { sprintf(s, " (placement failed default pos 0 0)\n"); s += strlen(s); } } else { sprintf(s, " (%s)\n", r); s += strlen(s); } if (reason->pos.do_adjust_off_screen == 1) { sprintf(s, " (adjusted to force window on screen)\n"); s += strlen(s); } if (reason->pos.do_adjust_off_page == 1) { sprintf(s, " (adjusted to force window on page)\n"); s += strlen(s); } fvwm_msg( INFO, "__explain_placement", explanation, (int)FW_W(fw), fw->name.name); return; } /* ---------------------------- interface functions ------------------------ */ Bool setup_window_placement( FvwmWindow *fw, window_style *pstyle, rectangle *attr_g, initial_window_options_t *win_opts, placement_mode_t mode) { int rc; const exec_context_t *exc; exec_context_changes_t ecc; pl_reason_t reason; pl_start_style_t start_style; memset(&reason, 0, sizeof(reason)); if (pstyle->flags.use_start_on_desk) { reason.desk.sod_reason = PR_DESK_STYLE; reason.page.px = SGET_START_PAGE_X(*pstyle); reason.page.py = SGET_START_PAGE_Y(*pstyle); } if (pstyle->flags.use_start_on_screen) { reason.screen.reason = PR_SCREEN_STYLE; reason.screen.screen = SGET_START_SCREEN(*pstyle); } __place_handle_x_resources(fw, pstyle, &reason); if (pstyle->flags.do_start_iconic) { win_opts->initial_state = IconicState; } ecc.type = EXCT_NULL; ecc.w.fw = fw; exc = exc_create_context(&ecc, ECC_TYPE | ECC_FW); start_style.desk = SGET_START_DESK(*pstyle); start_style.page_x = SGET_START_PAGE_X(*pstyle); start_style.page_y = SGET_START_PAGE_Y(*pstyle); start_style.screen = SGET_START_SCREEN(*pstyle); rc = __place_window( exc, pstyle, attr_g, start_style, mode, win_opts, &reason); exc_destroy_context(exc); if (Scr.bo.do_explain_window_placement == 1) { __explain_placement(fw, &reason); } return (rc == 0) ? False : True; } /* ---------------------------- builtin commands --------------------------- */ void CMD_PlaceAgain(F_CMD_ARGS) { int old_desk; char *token; float noMovement[1] = {1.0}; float *ppctMovement = noMovement; rectangle attr_g; XWindowAttributes attr; Bool do_move_animated = False; Bool do_place_icon = False; FvwmWindow * const fw = exc->w.fw; if (!XGetWindowAttributes(dpy, FW_W(fw), &attr)) { return; } while ((token = PeekToken(action, &action)) != NULL) { if (StrEquals("Anim", token)) { ppctMovement = NULL; do_move_animated = True; } else if (StrEquals("icon", token)) { do_place_icon = True; } } old_desk = fw->Desk; if (IS_ICONIFIED(fw) && !do_place_icon) { return; } if (IS_ICONIFIED(fw) && do_place_icon) { rectangle new_g; rectangle old_g; if (IS_ICON_SUPPRESSED(fw)) { return; } fw->Desk = Scr.CurrentDesk; get_icon_geometry(fw, &old_g); SET_ICON_MOVED(fw, 0); AutoPlaceIcon(fw, NULL, False); get_icon_geometry(fw, &new_g); __move_icon( fw, new_g.x, new_g.y, old_g.x, old_g.y, do_move_animated, False); } else { window_style style; initial_window_options_t win_opts; memset(&win_opts, 0, sizeof(win_opts)); lookup_style(fw, &style); attr_g.x = attr.x; attr_g.y = attr.y; attr_g.width = attr.width; attr_g.height = attr.height; setup_window_placement( exc->w.fw, &style, &attr_g, &win_opts, PLACE_AGAIN); AnimatedMoveFvwmWindow( fw, FW_W_FRAME(fw), -1, -1, attr_g.x, attr_g.y, False, -1, ppctMovement); } if (fw->Desk != old_desk) { int new_desk = fw->Desk; fw->Desk = old_desk; do_move_window_to_desk(fw, new_desk); } return; } fvwm-2.6.5.orig/fvwm/frame.h0000644000175000017500000000451010552155662014053 0ustar vwcvwc/* -*-c-*- */ #ifndef FRAME_H #define FRAME_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef enum { FRAME_MR_SETUP, FRAME_MR_SETUP_BY_APP, FRAME_MR_OPAQUE, FRAME_MR_SHRINK, FRAME_MR_SCROLL, /* used internally only, do not set these in any calls */ FRAME_MR_FORCE_SETUP, FRAME_MR_FORCE_SETUP_NO_W, /* used by AddWindow() to suppress drawing during window setup */ FRAME_MR_DONT_DRAW = 0x80 } frame_move_resize_mode; typedef struct { rectangle title_g; rectangle button_g[NUMBER_OF_TITLE_BUTTONS]; } frame_title_layout_t; /* details are hidden in frame.c */ typedef void *frame_move_resize_args; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void frame_init(void); Bool is_frame_hide_window( Window w); void frame_destroyed_frame( Window frame_w); frame_move_resize_args frame_create_move_resize_args( FvwmWindow *fw, frame_move_resize_mode mr_mode, rectangle *start_g, rectangle *end_g, int anim_steps, int shade_dir); void frame_update_move_resize_args( frame_move_resize_args mr_args, rectangle *end_g); void frame_free_move_resize_args( FvwmWindow *fw, frame_move_resize_args mr_args); void frame_get_titlebar_dimensions( FvwmWindow *fw, rectangle *frame_g, rectangle *diff_g, frame_title_layout_t *title_layout); void frame_get_sidebar_geometry( FvwmWindow *fw, DecorFaceStyle *borderstyle, rectangle *frame_g, rectangle *ret_g, Bool *ret_has_x_marks, Bool *ret_has_y_marks); int frame_window_id_to_context( FvwmWindow *fw, Window w, int *ret_num); void frame_move_resize( FvwmWindow *fw, frame_move_resize_args mr_args); void frame_setup_window( FvwmWindow *fw, int x, int y, int w, int h, Bool do_send_configure_notify); void frame_setup_window_app_request( FvwmWindow *fw, int x, int y, int w, int h, Bool do_send_configure_notify); void frame_force_setup_window( FvwmWindow *fw, int x, int y, int w, int h, Bool do_send_configure_notify); void frame_setup_shape( FvwmWindow *fw, int w, int h, int shape_mode); #endif /* FRAME_H */ fvwm-2.6.5.orig/fvwm/colormaps.h0000644000175000017500000000626607677641663015011 0ustar vwcvwc/* -*-c-*- */ /* This module is all new * by Rob Nation * * This code handles colormaps for fvwm. * * Copyright 1994 Robert Nation. No restrictions are placed on this code, * as long as the copyright notice is preserved . No guarantees or * warrantees of any sort whatsoever are given or implied or anything. */ #ifndef COLORMAP_H #define COLORMAP_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ /* colormap notify event handler * * This procedure handles both a client changing its own colormap, and * a client explicitly installing its colormap itself (only the window * manager should do that, so we must set it correctly). */ void colormap_handle_colormap_notify(const evh_args_t *ea); /* Re-Install the active colormap */ void ReInstallActiveColormap(void); /* install the colormaps for one fvwm window * * Inputs: * type - type of event that caused the installation * tmp - for a subset of event types, the address of the * window structure, whose colormaps are to be installed. */ void InstallWindowColormaps(const FvwmWindow *tmp); /* Force (un)loads root colormap(s) * * These matching routines provide a mechanism to insure that * the root colormap(s) is installed during operations like * rubber banding that require colors from * that colormap. Calls may be nested arbitrarily deeply, * as long as there is one UninstallRootColormap call per * InstallRootColormap call. * * The final UninstallRootColormap will cause the colormap list * which would otherwise have be loaded to be loaded, unless * Enter or Leave Notify events are queued, indicating some * other colormap list would potentially be loaded anyway. */ void InstallRootColormap(void); /* Unstacks one layer of root colormap pushing * If we peel off the last layer, re-install the application colormap */ void UninstallRootColormap(void); /* Force (un)loads fvwm colormap(s) * * This is used to ensure the fvwm colormap is installed during * menu operations */ void InstallFvwmColormap(void); void UninstallFvwmColormap(void); /* Gets the WM_COLORMAP_WINDOWS property from the window * * This property typically doesn't exist, but a few applications * use it. These seem to occur mostly on SGI machines. */ void FetchWmColormapWindows (FvwmWindow *tmp); /* clasen@mathematik.uni-freiburg.de - 03/01/1999 - new * boolean for handling of client-side InstallColormap * as described in the ICCCM 2.0 */ void set_client_controls_colormaps(Bool flag); /* Looks through the window list for any matching COLORMAP_WINDOWS * windows and installs the colormap if one exists. */ void EnterSubWindowColormap(Window win); void LeaveSubWindowColormap(Window win); #endif /* COLORMAP_H */ fvwm-2.6.5.orig/fvwm/cursor.c0000644000175000017500000002622710646522443014301 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/ColorUtils.h" #include "libs/Cursor.h" #include "libs/Parse.h" #include "libs/Strings.h" #include "fvwm.h" #include "libs/PictureImageLoader.h" #include "externs.h" #include "cursor.h" #include "functions.h" #include "bindings.h" #include "misc.h" #include "screen.h" #include "cursor.h" #include "menus.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static Cursor cursors[CRS_MAX]; static const unsigned int default_cursors[CRS_MAX] = { None, XC_top_left_corner, /* CRS_POSITION */ XC_top_left_arrow, /* CRS_TITLE */ XC_top_left_arrow, /* CRS_DEFAULT */ XC_hand2, /* CRS_SYS */ XC_fleur, /* CRS_MOVE */ XC_sizing, /* CRS_RESIZE */ XC_watch, /* CRS_WAIT */ XC_top_left_arrow, /* CRS_MENU */ XC_crosshair, /* CRS_SELECT */ XC_pirate, /* CRS_DESTROY */ XC_top_side, /* CRS_TOP */ XC_right_side, /* CRS_RIGHT */ XC_bottom_side, /* CRS_BOTTOM */ XC_left_side, /* CRS_LEFT */ XC_top_left_corner, /* CRS_TOP_LEFT */ XC_top_right_corner, /* CRS_TOP_RIGHT */ XC_bottom_left_corner, /* CRS_BOTTOM_LEFT */ XC_bottom_right_corner, /* CRS_BOTTOM_RIGHT */ XC_top_side, /* CRS_TOP_EDGE */ XC_right_side, /* CRS_RIGHT_EDGE */ XC_bottom_side, /* CRS_BOTTOM_EDGE */ XC_left_side, /* CRS_LEFT_EDGE */ XC_left_ptr, /* CRS_ROOT */ XC_plus /* CRS_STROKE */ }; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static void SafeDefineCursor(Window w, Cursor cursor) { if (w) { XDefineCursor(dpy,w,cursor); } return; } /* ---------------------------- interface functions ------------------------ */ /* CreateCursors - Loads fvwm cursors */ Cursor *CreateCursors(Display *dpy) { int i; /* define cursors */ cursors[0] = None; for (i = 1; i < CRS_MAX; i++) { cursors[i] = XCreateFontCursor(dpy, default_cursors[i]); } return cursors; } /* ---------------------------- builtin commands --------------------------- */ void CMD_CursorStyle(F_CMD_ARGS) { char *cname=NULL; char *newcursor=NULL; char *errpos = NULL; char *fore = NULL; char *back = NULL; XColor colors[2]; int index; int nc; int i; int my_nc; FvwmWindow *fw2; Cursor cursor; cursor = 0; cname = PeekToken(action, &action); if (!cname) { fvwm_msg(ERR, "CursorStyle", "Bad cursor style"); return; } if (StrEquals("POSITION", cname)) { index = CRS_POSITION; } else if (StrEquals("DEFAULT", cname)) { index = CRS_DEFAULT; } else if (StrEquals("SYS", cname)) { index = CRS_SYS; } else if (StrEquals("TITLE", cname)) { index = CRS_TITLE; } else if (StrEquals("MOVE", cname)) { index = CRS_MOVE; } else if (StrEquals("RESIZE", cname)) { index = CRS_RESIZE; } else if (StrEquals("MENU", cname)) { index = CRS_MENU; } else if (StrEquals("WAIT", cname)) { index = CRS_WAIT; } else if (StrEquals("SELECT", cname)) { index = CRS_SELECT; } else if (StrEquals("DESTROY", cname)) { index = CRS_DESTROY; } else if (StrEquals("LEFT", cname)) { index = CRS_LEFT; } else if (StrEquals("RIGHT", cname)) { index = CRS_RIGHT; } else if (StrEquals("TOP", cname)) { index = CRS_TOP; } else if (StrEquals("BOTTOM", cname)) { index = CRS_BOTTOM; } else if (StrEquals("TOP_LEFT", cname)) { index = CRS_TOP_LEFT; } else if (StrEquals("TOP_RIGHT", cname)) { index = CRS_TOP_RIGHT; } else if (StrEquals("BOTTOM_LEFT", cname)) { index = CRS_BOTTOM_LEFT; } else if (StrEquals("BOTTOM_RIGHT", cname)) { index = CRS_BOTTOM_RIGHT; } else if (StrEquals("LEFT_EDGE", cname)) { index = CRS_LEFT_EDGE; } else if (StrEquals("RIGHT_EDGE", cname)) { index = CRS_RIGHT_EDGE; } else if (StrEquals("TOP_EDGE", cname)) { index = CRS_TOP_EDGE; } else if (StrEquals("BOTTOM_EDGE", cname)) { index = CRS_BOTTOM_EDGE; } else if (StrEquals("ROOT", cname)) { index = CRS_ROOT; } else if (StrEquals("STROKE", cname)) { index = CRS_STROKE; } else { fvwm_msg(ERR, "CursorStyle", "Unknown cursor name %s", cname); return; } cname = 0; /* check if the cursor is given by X11 name */ action = GetNextToken(action, &newcursor); if (newcursor) { my_nc = fvwmCursorNameToIndex(newcursor); } else { my_nc = default_cursors[index]; } if (my_nc == -1) { nc = strtol(newcursor, &errpos, 10); if (errpos && *errpos == '\0') { my_nc = 0; } } else { nc = my_nc; } if (my_nc > -1) { /* newcursor was a number or the name of a X11 cursor */ if ((nc < 0) || (nc >= XC_num_glyphs) || ((nc % 2) != 0)) { fvwm_msg( ERR, "CursorStyle", "Bad cursor number %s", newcursor); free(newcursor); return; } cursor = XCreateFontCursor(dpy, nc); } else { /* newcursor was not a number neither a X11 cursor name */ if ( StrEquals("none", newcursor) || StrEquals("tiny", newcursor)) { XColor nccol; XSetForeground( dpy, Scr.MonoGC, (tolower(*newcursor) == 'n') ? 0 : 1); XFillRectangle( dpy, Scr.ScratchMonoPixmap, Scr.MonoGC, 0, 0, 1, 1); cursor = XCreatePixmapCursor( dpy, Scr.ScratchMonoPixmap, Scr.ScratchMonoPixmap, &nccol, &nccol, 0, 0); } else { char *path; char *tmp; int hotspot[2]; hotspot[0] = -1; hotspot[1] = -1; path = PictureFindImageFile(newcursor, NULL, R_OK); if (!path) { fvwm_msg( ERR, "CursorStyle", "Cursor %s not found", newcursor); free(newcursor); return; } if (GetIntegerArguments(action, &tmp, hotspot, 2) == 2) { action = tmp; } cursor = PImageLoadCursorFromFile( dpy, Scr.Root, path, hotspot[0], hotspot[1]); free(path); } } if (!cursor) { fvwm_msg( ERR, "CursorStyle", "Cannot load cursor: %s", newcursor); free(newcursor); return; } free(newcursor); newcursor = 0; /* replace the cursor defn */ if (Scr.FvwmCursors[index]) { XFreeCursor(dpy, Scr.FvwmCursors[index]); } Scr.FvwmCursors[index] = cursor; /* look for optional color arguments */ action = GetNextToken(action, &fore); action = GetNextToken(action, &back); if (fore && back) { colors[0].pixel = GetColor(fore); colors[1].pixel = GetColor(back); XQueryColors (dpy, Pcmap, colors, 2); XRecolorCursor( dpy, Scr.FvwmCursors[index], &(colors[0]), &(colors[1])); } if (fore) { free(fore); } if (back) { free(back); } /* redefine all the windows using cursors */ for (fw2 = Scr.FvwmRoot.next; fw2; fw2 = fw2->next) { if (!HAS_HANDLES(fw2)) { /* Ignore windows without handles */ continue; } for (i = 0; i < 4; i++) { SafeDefineCursor( FW_W_CORNER(fw2, i), Scr.FvwmCursors[CRS_TOP_LEFT + i]); SafeDefineCursor( FW_W_SIDE(fw2, i), Scr.FvwmCursors[CRS_TOP + i]); } for (i = 0; i / 2 < Scr.nr_left_buttons; i += 2) { SafeDefineCursor( FW_W_BUTTON(fw2, i), Scr.FvwmCursors[CRS_SYS]); } for (i = 1; i / 2 < Scr.nr_right_buttons; i += 2) { SafeDefineCursor( FW_W_BUTTON(fw2, i), Scr.FvwmCursors[CRS_SYS]); } SafeDefineCursor(FW_W_TITLE(fw2), Scr.FvwmCursors[CRS_TITLE]); if (index == CRS_DEFAULT) { SafeDefineCursor( FW_W_FRAME(fw2), Scr.FvwmCursors[CRS_DEFAULT]); SafeDefineCursor( FW_W_PARENT(fw2), Scr.FvwmCursors[CRS_DEFAULT]); if (IS_ICONIFIED(fw2)) { if (!HAS_NO_ICON_TITLE(fw2)) { SafeDefineCursor( FW_W_ICON_TITLE(fw2), Scr.FvwmCursors[CRS_DEFAULT]); } if (FW_W_ICON_PIXMAP(fw2) != None) { SafeDefineCursor( FW_W_ICON_PIXMAP(fw2), Scr.FvwmCursors[CRS_DEFAULT]); } } } } /* Do the menus for good measure */ SetMenuCursor(Scr.FvwmCursors[CRS_MENU]); SafeDefineCursor(Scr.PanFrameTop.win, Scr.FvwmCursors[CRS_TOP_EDGE]); SafeDefineCursor( Scr.PanFrameBottom.win, Scr.FvwmCursors[CRS_BOTTOM_EDGE]); SafeDefineCursor(Scr.PanFrameLeft.win, Scr.FvwmCursors[CRS_LEFT_EDGE]); SafeDefineCursor( Scr.PanFrameRight.win, Scr.FvwmCursors[CRS_RIGHT_EDGE]); /* migo (04/Nov/1999): don't annoy users which use xsetroot */ if (index == CRS_ROOT) { SafeDefineCursor(Scr.Root, Scr.FvwmCursors[CRS_ROOT]); } return; } /* Defines in which cases fvwm "grab" the cursor during execution of certain * functions. */ void CMD_BusyCursor(F_CMD_ARGS) { char *option = NULL; char *optstring = NULL; char *args = NULL; int flag = -1; char *optlist[] = { "read", "wait", "modulesynchronous", "dynamicmenu", "*", NULL }; while (action && *action != '\0') { action = GetQuotedString( action, &optstring, ",", NULL, NULL, NULL); if (!optstring) { break; } args = GetNextToken(optstring, &option); if (!option) { free(optstring); break; } flag = ParseToggleArgument(args, NULL, -1, True); free(optstring); if (flag == -1) { fvwm_msg(ERR, "BusyCursor", "error in boolean specification"); free(option); break; } switch (GetTokenIndex(option, optlist, 0, NULL)) { case 0: /* read */ if (flag) { Scr.BusyCursor |= BUSY_READ; } else { Scr.BusyCursor &= ~BUSY_READ; } break; case 1: /* wait */ if (flag) { Scr.BusyCursor |= BUSY_WAIT; } else { Scr.BusyCursor &= ~BUSY_WAIT; } break; case 2: /* modulesynchronous */ if (flag) { Scr.BusyCursor |= BUSY_MODULESYNCHRONOUS; } else { Scr.BusyCursor &= ~BUSY_MODULESYNCHRONOUS; } break; case 3: /* dynamicmenu */ if (flag) { Scr.BusyCursor |= BUSY_DYNAMICMENU; } else { Scr.BusyCursor &= ~BUSY_DYNAMICMENU; } break; case 4: /* "*" */ if (flag) { Scr.BusyCursor |= BUSY_ALL; } else { Scr.BusyCursor &= ~(BUSY_ALL); } break; default: fvwm_msg(ERR, "BusyCursor", "unknown context '%s'", option); break; } free(option); } return; } fvwm-2.6.5.orig/fvwm/bindings.h0000644000175000017500000000144411150076641014553 0ustar vwcvwc/* -*-c-*- */ #ifndef BINDINGS_H #define BINDINGS_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void update_key_bindings(void); unsigned int MaskUsedModifiers(unsigned int in_modifiers); unsigned int GetUnusedModifiers(void); void print_bindings(void); #endif /* BINDINGS_H */ fvwm-2.6.5.orig/fvwm/condrc.c0000644000175000017500000000341107677641710014233 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "condrc.h" /* --------------------------- local definitions --------------------------- */ /* --------------------------- local macros -------------------------------- */ /* --------------------------- imports ------------------------------------- */ /* --------------------------- included code files ------------------------- */ /* --------------------------- local types --------------------------------- */ /* --------------------------- forward declarations ------------------------ */ /* --------------------------- local variables ----------------------------- */ /* --------------------------- exported variables (globals) ---------------- */ /* --------------------------- local functions ----------------------------- */ /* --------------------------- interface functions ------------------------- */ void condrc_init(cond_rc_t *cond_rc) { memset(cond_rc, 0, sizeof(*cond_rc)); cond_rc->rc = COND_RC_OK; return; } fvwm-2.6.5.orig/fvwm/menudim.h0000644000175000017500000000406010721516231014406 0ustar vwcvwc/* -*-c-*- */ #ifndef MENUDIM_H #define MENUDIM_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ #define MDIM_WIDTH(d) ((d).width) #define MDIM_HEIGHT(d) ((d).height) #define MDIM_ITEM_WIDTH(d) ((d).item_width) #define MDIM_SIDEPIC_X_OFFSET(d) ((d).sidepic_x_offset) #define MDIM_ICON_X_OFFSET(d) ((d).icon_x_offset) #define MDIM_TRIANGLE_X_OFFSET(d) ((d).triangle_x_offset) #define MDIM_ITEM_X_OFFSET(d) ((d).item_text_x_offset) #define MDIM_ITEM_TEXT_Y_OFFSET(d) ((d).item_text_y_offset) #define MDIM_HILIGHT_X_OFFSET(d) ((d).hilight_x_offset) #define MDIM_HILIGHT_WIDTH(d) ((d).hilight_width) #define MDIM_SCREEN_WIDTH(d) ((d).screen_width) #define MDIM_SCREEN_HEIGHT(d) ((d).screen_height) /* ---------------------------- type definitions --------------------------- */ struct MenuDimensions { /* width/height of the menu */ int width; int height; /* width of the actual menu item */ int item_width; /* offset of the sidepic */ int sidepic_x_offset; /* offsets of the mini icons */ int icon_x_offset[MAX_MENU_ITEM_MINI_ICONS]; /* offset of the submenu triangle col */ int triangle_x_offset; /* offset of the actual menu item */ int item_text_x_offset; /* y offset for item text. */ int item_text_y_offset; /* start of the area to be hilighted */ int hilight_x_offset; /* width of the area to be hilighted */ int hilight_width; /* y coordinate for item */ int y_offset; /* width and height of the last screen * the menu was mapped on */ int screen_width; int screen_height; }; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ int menudim_middle_x_offset(struct MenuDimensions *mdim); /* ---------------------------- builtin commands --------------------------- */ #endif /* MENUDIM_H */ fvwm-2.6.5.orig/fvwm/functions.c0000644000175000017500000007777610655441142015007 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* * fvwm built-in functions and complex functions */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "libs/fvwmlib.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "libs/Grab.h" #include "libs/Parse.h" #include "libs/Strings.h" #include "libs/Event.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "execcontext.h" #include "functions.h" #include "commands.h" #include "functable.h" #include "events.h" #include "modconf.h" #include "module_list.h" #include "misc.h" #include "screen.h" #include "repeat.h" #include "expand.h" #include "menus.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef struct FunctionItem { struct FvwmFunction *func; /* the function this item is in */ struct FunctionItem *next_item; /* next function item */ char condition; /* the character string displayed on * left*/ char *action; /* action to be performed */ short type; /* type of built in function */ FUNC_FLAGS_TYPE flags; } FunctionItem; typedef struct FvwmFunction { struct FvwmFunction *next_func; /* next in list of root menus */ FunctionItem *first_item; /* first item in function */ FunctionItem *last_item; /* last item in function */ char *name; /* function name */ int use_depth; } FvwmFunction; /* Types of events for the FUNCTION builtin */ typedef enum { CF_IMMEDIATE = 'i', CF_MOTION = 'm', CF_HOLD = 'h', CF_CLICK = 'c', CF_DOUBLE_CLICK = 'd', CF_TIMEOUT = '-' } cfunc_action_t; /* ---------------------------- forward declarations ----------------------- */ static void execute_complex_function( cond_rc_t *cond_rc, const exec_context_t *exc, char *action, Bool *desperate, Bool has_ref_window_moved); /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static int __context_has_window( const exec_context_t *exc, execute_flags_t flags) { if (exc->w.fw != NULL) { return 1; } else if ((flags & FUNC_ALLOW_UNMANAGED) && exc->w.w != None) { return 1; } return 0; } /* * Defer the execution of a function to the next button press if the context is * C_ROOT * * Inputs: * cursor - the cursor to display while waiting */ static Bool DeferExecution( exec_context_changes_t *ret_ecc, exec_context_change_mask_t *ret_mask, cursor_t cursor, int trigger_evtype, int do_allow_unmanaged) { int done; int finished = 0; int just_waiting_for_finish = 0; Window dummy; Window original_w; static XEvent e; Window w; int wcontext; FvwmWindow *fw; int FinishEvent; fw = ret_ecc->w.fw; w = ret_ecc->w.w; original_w = w; wcontext = ret_ecc->w.wcontext; FinishEvent = ((fw != NULL) ? ButtonRelease : ButtonPress); if (wcontext == C_UNMANAGED && do_allow_unmanaged) { return False; } if (wcontext != C_ROOT && wcontext != C_NO_CONTEXT && fw != NULL && wcontext != C_EWMH_DESKTOP) { if (FinishEvent == ButtonPress || (FinishEvent == ButtonRelease && trigger_evtype != ButtonPress)) { return False; } else if (FinishEvent == ButtonRelease) { /* We are only waiting until the user releases the * button. Do not change the cursor. */ cursor = CRS_NONE; just_waiting_for_finish = 1; } } if (Scr.flags.are_functions_silent) { return True; } if (!GrabEm(cursor, GRAB_NORMAL)) { XBell(dpy, 0); return True; } MyXGrabKeyboard(dpy); while (!finished) { done = 0; /* block until there is an event */ FMaskEvent( dpy, ButtonPressMask | ButtonReleaseMask | ExposureMask | KeyPressMask | VisibilityChangeMask | ButtonMotionMask | PointerMotionMask /* | EnterWindowMask | LeaveWindowMask*/, &e); if (e.type == KeyPress) { KeySym keysym = XLookupKeysym(&e.xkey, 0); if (keysym == XK_Escape) { ret_ecc->x.etrigger = &e; *ret_mask |= ECC_ETRIGGER; UngrabEm(GRAB_NORMAL); MyXUngrabKeyboard(dpy); return True; } Keyboard_shortcuts(&e, NULL, NULL, NULL, FinishEvent); } if (e.type == FinishEvent) { finished = 1; } switch (e.type) { case KeyPress: case ButtonPress: if (e.type != FinishEvent) { original_w = e.xany.window; } done = 1; break; case ButtonRelease: done = 1; break; default: break; } if (!done) { dispatch_event(&e); } } MyXUngrabKeyboard(dpy); UngrabEm(GRAB_NORMAL); if (just_waiting_for_finish) { return False; } w = e.xany.window; ret_ecc->x.etrigger = &e; *ret_mask |= ECC_ETRIGGER | ECC_W | ECC_WCONTEXT; if ((w == Scr.Root || w == Scr.NoFocusWin) && e.xbutton.subwindow != None) { w = e.xbutton.subwindow; e.xany.window = w; } if (w == Scr.Root || IS_EWMH_DESKTOP(w)) { ret_ecc->w.w = w; ret_ecc->w.wcontext = C_ROOT; XBell(dpy, 0); return True; } *ret_mask |= ECC_FW; if (XFindContext(dpy, w, FvwmContext, (caddr_t *)&fw) == XCNOENT) { ret_ecc->w.fw = NULL; ret_ecc->w.w = w; ret_ecc->w.wcontext = C_ROOT; XBell(dpy, 0); return (True); } if (w == FW_W_PARENT(fw)) { w = FW_W(fw); } if (original_w == FW_W_PARENT(fw)) { original_w = FW_W(fw); } /* this ugly mess attempts to ensure that the release and press * are in the same window. */ if (w != original_w && original_w != Scr.Root && original_w != None && original_w != Scr.NoFocusWin && !IS_EWMH_DESKTOP(original_w)) { if (w != FW_W_FRAME(fw) || original_w != FW_W(fw)) { ret_ecc->w.fw = fw; ret_ecc->w.w = w; ret_ecc->w.wcontext = C_ROOT; XBell(dpy, 0); return True; } } if (IS_EWMH_DESKTOP(FW_W(fw))) { ret_ecc->w.fw = fw; ret_ecc->w.w = w; ret_ecc->w.wcontext = C_ROOT; XBell(dpy, 0); return True; } wcontext = GetContext(NULL, fw, &e, &dummy); ret_ecc->w.fw = fw; ret_ecc->w.w = w; ret_ecc->w.wcontext = C_ROOT; return False; } /* ** do binary search on func list */ static int func_comp(const void *a, const void *b) { return (strcmp((char *)a, ((func_t *)b)->keyword)); } static const func_t *find_builtin_function(char *func) { static int nfuncs = 0; func_t *ret_func; char *temp; char *s; if (!func || func[0] == 0) { return NULL; } /* since a lot of lines in a typical rc are probably menu/func * continues: */ if (func[0]=='+' || (func[0] == ' ' && func[1] == '+')) { return &(func_table[0]); } temp = safestrdup(func); for (s = temp; *s != 0; s++) { if (isupper(*s)) { *s = tolower(*s); } } if (nfuncs == 0) { for ( ; (func_table[nfuncs]).action != NULL; nfuncs++) { /* nothing to do here */ } } ret_func = (func_t *)bsearch( temp, func_table, nfuncs, sizeof(func_t), func_comp); free(temp); return ret_func; } static void __execute_function( cond_rc_t *cond_rc, const exec_context_t *exc, char *action, FUNC_FLAGS_TYPE exec_flags, char *args[], Bool has_ref_window_moved) { static int func_depth = 0; cond_rc_t *func_rc = NULL; cond_rc_t dummy_rc; Window w; int j; char *function; char *taction; char *trash; char *trash2; char *expaction = NULL; char *arguments[11]; const func_t *bif; Bool set_silent; Bool must_free_string = False; Bool must_free_function = False; Bool do_keep_rc = False; /* needed to be able to avoid resize to use moved windows for base */ extern Window PressedW; Window dummy_w; if (!action) { return; } /* ignore whitespace at the beginning of all config lines */ action = SkipSpaces(action, NULL, 0); if (!action || action[0] == 0) { /* impossibly short command */ return; } if (action[0] == '#') { /* a comment */ return; } func_depth++; if (func_depth > MAX_FUNCTION_DEPTH) { fvwm_msg( ERR, "__execute_function", "Function '%s' called with a depth of %i, " "stopping function execution!", action, func_depth); func_depth--; return; } if (args) { for (j = 0; j < 11; j++) { arguments[j] = args[j]; } } else { for (j = 0; j < 11; j++) { arguments[j] = NULL; } } if (exc->w.fw == NULL || IS_EWMH_DESKTOP(FW_W(exc->w.fw))) { if (exec_flags & FUNC_IS_UNMANAGED) { w = exc->w.w; } else { w = Scr.Root; } } else { FvwmWindow *tw; w = GetSubwindowFromEvent(dpy, exc->x.elast); if (w == None) { w = exc->x.elast->xany.window; } tw = NULL; if (w != None) { if (XFindContext( dpy, w, FvwmContext, (caddr_t *)&tw) == XCNOENT) { tw = NULL; } } if (w == None || tw != exc->w.fw) { w = FW_W(exc->w.fw); } } set_silent = False; if (action[0] == '-') { exec_flags |= FUNC_DONT_EXPAND_COMMAND; action++; } taction = action; /* parse prefixes */ trash = PeekToken(taction, &trash2); while (trash) { if (StrEquals(trash, PRE_SILENT)) { if (Scr.flags.are_functions_silent == 0) { set_silent = 1; Scr.flags.are_functions_silent = 1; } taction = trash2; trash = PeekToken(taction, &trash2); } else if (StrEquals(trash, PRE_KEEPRC)) { do_keep_rc = True; taction = trash2; trash = PeekToken(taction, &trash2); } else { break; } } if (taction == NULL) { if (set_silent) { Scr.flags.are_functions_silent = 0; } func_depth--; return; } if (cond_rc == NULL || do_keep_rc == True) { condrc_init(&dummy_rc); func_rc = &dummy_rc; } else { func_rc = cond_rc; } GetNextToken(taction, &function); if (function) { char *tmp = function; function = expand_vars( function, arguments, False, False, func_rc, exc); free(tmp); } if (function && function[0] != '*') { #if 1 /* DV: with this piece of code it is impossible to have a * complex function with embedded whitespace that begins with a * builtin function name, e.g. a function "echo hello". */ /* DV: ... and without it some of the complex functions will * fail */ char *tmp = function; while (*tmp && !isspace(*tmp)) { tmp++; } *tmp = 0; #endif bif = find_builtin_function(function); must_free_function = True; } else { bif = NULL; if (function) { free(function); } function = ""; } #ifdef USEDECOR if (Scr.cur_decor && Scr.cur_decor != &Scr.DefaultDecor && (!bif || !(bif->flags & FUNC_DECOR))) { fvwm_msg( ERR, "__execute_function", "Command can not be added to a decor; executing" " command now: '%s'", action); } #endif if (!(exec_flags & FUNC_DONT_EXPAND_COMMAND)) { expaction = expand_vars( taction, arguments, (bif) ? !!(bif->flags & FUNC_ADD_TO) : False, (taction[0] == '*'), func_rc, exc); if (func_depth <= 1) { must_free_string = set_repeat_data( expaction, REPEAT_COMMAND, bif); } else { must_free_string = True; } } else { expaction = taction; } #ifdef FVWM_COMMAND_LOG fvwm_msg(INFO, "LOG", "%c: %s", (char)exc->type, expaction); #endif /* Note: the module config command, "*" can not be handled by the * regular command table because there is no required white space after * the asterisk. */ if (expaction[0] == '*') { #ifdef USEDECOR if (Scr.cur_decor && Scr.cur_decor != &Scr.DefaultDecor) { fvwm_msg( WARN, "__execute_function", "Command can not be added to a decor;" " executing command now: '%s'", expaction); } #endif /* process a module config command */ ModuleConfig(expaction); } else { const exec_context_t *exc2; exec_context_changes_t ecc; exec_context_change_mask_t mask; mask = (w != exc->w.w) ? ECC_W : 0; ecc.w.fw = exc->w.fw; ecc.w.w = w; ecc.w.wcontext = exc->w.wcontext; if (bif && bif->func_t != F_FUNCTION) { char *runaction; Bool rc = False; runaction = SkipNTokens(expaction, 1); if ((bif->flags & FUNC_NEEDS_WINDOW) && !(exec_flags & FUNC_DONT_DEFER)) { rc = DeferExecution( &ecc, &mask, bif->cursor, exc->x.elast->type, (bif->flags & FUNC_ALLOW_UNMANAGED)); } else if ((bif->flags & FUNC_NEEDS_WINDOW) && !__context_has_window( exc, bif->flags & FUNC_ALLOW_UNMANAGED)) { /* no context window and not allowed to defer, * skip command */ rc = True; } if (rc == False) { exc2 = exc_clone_context(exc, &ecc, mask); if (has_ref_window_moved && (bif->func_t == F_ANIMATED_MOVE || bif->func_t == F_MOVE || bif->func_t == F_RESIZE)) { dummy_w = PressedW; PressedW = None; bif->action(func_rc, exc2, runaction); PressedW = dummy_w; } else { bif->action(func_rc, exc2, runaction); } exc_destroy_context(exc2); } } else { Bool desperate = 1; char *runaction; if (bif) { /* strip "function" command */ runaction = SkipNTokens(expaction, 1); } else { runaction = expaction; } exc2 = exc_clone_context(exc, &ecc, mask); execute_complex_function( func_rc, exc2, runaction, &desperate, has_ref_window_moved); if (!bif && desperate) { if (executeModuleDesperate( func_rc, exc, runaction) == NULL && *function != 0 && !set_silent) { fvwm_msg( ERR, "__execute_function", "No such command '%s'", function); } } exc_destroy_context(exc2); } } if (set_silent) { Scr.flags.are_functions_silent = 0; } if (cond_rc != NULL) { cond_rc->break_levels = func_rc->break_levels; } if (must_free_string) { free(expaction); } if (must_free_function) { free(function); } func_depth--; return; } /* find_complex_function expects a token as the input. Make sure you have used * GetNextToken before passing a function name to remove quotes */ static FvwmFunction *find_complex_function(const char *function_name) { FvwmFunction *func; if (function_name == NULL || *function_name == 0) { return NULL; } func = Scr.functions; while (func != NULL) { if (func->name != NULL) { if (strcasecmp(function_name, func->name) == 0) { return func; } } func = func->next_func; } return NULL; } /* * Builtin which determines if the button press was a click or double click... * Waits Scr.ClickTime, or until it is evident that the user is not * clicking, but is moving the cursor */ static cfunc_action_t CheckActionType( int x, int y, XEvent *d, Bool may_time_out, Bool is_button_pressed, int *ret_button) { int xcurrent,ycurrent,total = 0; Time t0; int dist; Bool do_sleep = False; xcurrent = x; ycurrent = y; t0 = fev_get_evtime(); dist = Scr.MoveThreshold; while ((total < Scr.ClickTime && fev_get_evtime() - t0 < Scr.ClickTime) || !may_time_out) { if (!(x - xcurrent <= dist && xcurrent - x <= dist && y - ycurrent <= dist && ycurrent - y <= dist)) { return (is_button_pressed) ? CF_MOTION : CF_TIMEOUT; } if (do_sleep) { usleep(20000); } else { usleep(1); do_sleep = 1; } total += 20; if (FCheckMaskEvent( dpy, ButtonReleaseMask|ButtonMotionMask| PointerMotionMask|ButtonPressMask|ExposureMask, d)) { do_sleep = 0; switch (d->xany.type) { case ButtonRelease: *ret_button = d->xbutton.button; return CF_CLICK; case MotionNotify: if (d->xmotion.same_screen == False) { break; } if ((d->xmotion.state & DEFAULT_ALL_BUTTONS_MASK) || !is_button_pressed) { xcurrent = d->xmotion.x_root; ycurrent = d->xmotion.y_root; } else { return CF_CLICK; } break; case ButtonPress: *ret_button = d->xbutton.button; if (may_time_out) { is_button_pressed = True; } break; case Expose: /* must handle expose here so that raising a * window with "I" works */ dispatch_event(d); break; default: /* can't happen */ break; } } } return (is_button_pressed) ? CF_HOLD : CF_TIMEOUT; } static void __run_complex_function_items( cond_rc_t *cond_rc, char cond, FvwmFunction *func, const exec_context_t *exc, char *args[], Bool has_ref_window_moved) { char c; FunctionItem *fi; int x0, y0, x, y; extern Window PressedW; if (!(!has_ref_window_moved && PressedW && XTranslateCoordinates( dpy, PressedW , Scr.Root, 0, 0, &x0, &y0, &JunkChild))) { x0 = y0 = 0; } for (fi = func->first_item; fi != NULL && cond_rc->break_levels == 0; ) { /* make lower case */ c = fi->condition; if (isupper(c)) { c = tolower(c); } if (c == cond) { __execute_function( cond_rc, exc, fi->action, FUNC_DONT_DEFER, args, has_ref_window_moved); if (!has_ref_window_moved && PressedW && XTranslateCoordinates( dpy, PressedW , Scr.Root, 0, 0, &x, &y, &JunkChild)) { has_ref_window_moved =(x != x0 || y != y0); } } fi = fi->next_item; } return; } static void __cf_cleanup( int *depth, char **arguments, cond_rc_t *cond_rc) { int i; (*depth)--; if (!(*depth)) { Scr.flags.is_executing_complex_function = 0; } for (i = 0; i < 11; i++) { if (arguments[i] != NULL) { free(arguments[i]); } } if (cond_rc->break_levels > 0) { cond_rc->break_levels--; } return; } static void execute_complex_function( cond_rc_t *cond_rc, const exec_context_t *exc, char *action, Bool *desperate, Bool has_ref_window_moved) { cond_rc_t tmp_rc; cfunc_action_t type = CF_MOTION; char c; FunctionItem *fi; Bool Persist = False; Bool HaveDoubleClick = False; Bool HaveHold = False; Bool NeedsTarget = False; Bool ImmediateNeedsTarget = False; int do_allow_unmanaged = FUNC_ALLOW_UNMANAGED; int do_allow_unmanaged_immediate = FUNC_ALLOW_UNMANAGED; char *arguments[11], *taction; char *func_name; int x, y ,i; XEvent d; FvwmFunction *func; static int depth = 0; const exec_context_t *exc2; exec_context_changes_t ecc; exec_context_change_mask_t mask; int trigger_evtype; int button; XEvent *te; if (cond_rc == NULL) { condrc_init(&tmp_rc); cond_rc = &tmp_rc; } cond_rc->rc = COND_RC_OK; mask = 0; d.type = 0; ecc.w.fw = exc->w.fw; ecc.w.w = exc->w.w; ecc.w.wcontext = exc->w.wcontext; /* find_complex_function expects a token, not just a quoted string */ func_name = PeekToken(action, &taction); if (!func_name) { return; } func = find_complex_function(func_name); if (func == NULL) { if (*desperate == 0) { fvwm_msg( ERR, "ComplexFunction", "No such function %s", action); } return; } if (!depth) { Scr.flags.is_executing_complex_function = 1; } depth++; *desperate = 0; /* duplicate the whole argument list for use as '$*' */ if (taction) { arguments[0] = safestrdup(taction); /* strip trailing newline */ if (arguments[0][0]) { int l= strlen(arguments[0]); if (arguments[0][l - 1] == '\n') { arguments[0][l - 1] = 0; } } /* Get the argument list */ for (i = 1; i < 11; i++) { taction = GetNextToken(taction, &arguments[i]); } } else { for (i = 0; i < 11; i++) { arguments[i] = NULL; } } /* In case we want to perform an action on a button press, we * need to fool other routines */ te = exc->x.elast; if (te->type == ButtonPress) { trigger_evtype = ButtonRelease; } else { trigger_evtype = te->type; } func->use_depth++; for (fi = func->first_item; fi != NULL; fi = fi->next_item) { if (fi->flags & FUNC_NEEDS_WINDOW) { NeedsTarget = True; do_allow_unmanaged &= fi->flags; if (fi->condition == CF_IMMEDIATE) { do_allow_unmanaged_immediate &= fi->flags; ImmediateNeedsTarget = True; break; } } } if (ImmediateNeedsTarget) { if (DeferExecution( &ecc, &mask, CRS_SELECT, trigger_evtype, do_allow_unmanaged_immediate)) { func->use_depth--; __cf_cleanup(&depth, arguments, cond_rc); return; } NeedsTarget = False; } else { ecc.w.w = (ecc.w.fw) ? FW_W_FRAME(ecc.w.fw) : None; mask |= ECC_W; } /* we have to grab buttons before executing immediate actions because * these actions can move the window away from the pointer so that a * button release would go to the application below. */ if (!GrabEm(CRS_NONE, GRAB_NORMAL)) { func->use_depth--; fvwm_msg( ERR, "ComplexFunction", "Grab failed in function %s," " unable to execute immediate action", action); __cf_cleanup(&depth, arguments, cond_rc); return; } exc2 = exc_clone_context(exc, &ecc, mask); __run_complex_function_items( cond_rc, CF_IMMEDIATE, func, exc2, arguments, has_ref_window_moved); exc_destroy_context(exc2); for (fi = func->first_item; fi != NULL && cond_rc->break_levels == 0; fi = fi->next_item) { /* c is already lowercase here */ c = fi->condition; switch (c) { case CF_IMMEDIATE: break; case CF_DOUBLE_CLICK: HaveDoubleClick = True; Persist = True; break; case CF_HOLD: HaveHold = True; Persist = True; break; default: Persist = True; break; } } if (!Persist || cond_rc->break_levels != 0) { func->use_depth--; __cf_cleanup(&depth, arguments, cond_rc); UngrabEm(GRAB_NORMAL); return; } /* Only defer execution if there is a possibility of needing * a window to operate on */ if (NeedsTarget) { if (DeferExecution( &ecc, &mask, CRS_SELECT, trigger_evtype, do_allow_unmanaged)) { func->use_depth--; __cf_cleanup(&depth, arguments, cond_rc); UngrabEm(GRAB_NORMAL); return; } } te = (mask & ECC_ETRIGGER) ? ecc.x.etrigger : exc->x.elast; switch (te->xany.type) { case ButtonPress: case ButtonRelease: x = te->xbutton.x_root; y = te->xbutton.y_root; button = te->xbutton.button; /* Take the click which started this fuction off the * Event queue. -DDN- Dan D Niles dniles@iname.com */ FCheckMaskEvent(dpy, ButtonPressMask, &d); break; default: if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &x, &y, &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen */ x = 0; y = 0; } button = 0; break; } /* Wait and see if we have a click, or a move */ /* wait forever, see if the user releases the button */ type = CheckActionType(x, y, &d, HaveHold, True, &button); if (type == CF_CLICK) { int button2; /* If it was a click, wait to see if its a double click */ if (HaveDoubleClick) { type = CheckActionType( x, y, &d, True, False, &button2); switch (type) { case CF_HOLD: case CF_MOTION: case CF_CLICK: if (button == button2) { type = CF_DOUBLE_CLICK; } else { type = CF_CLICK; } break; case CF_TIMEOUT: type = CF_CLICK; break; default: /* can't happen */ break; } } } else if (type == CF_TIMEOUT) { type = CF_HOLD; } /* some functions operate on button release instead of presses. These * gets really weird for complex functions ... */ if (d.type == ButtonPress) { d.type = ButtonRelease; if (d.xbutton.button > 0 && d.xbutton.button <= NUMBER_OF_MOUSE_BUTTONS) { d.xbutton.state &= (~(Button1Mask >> (d.xbutton.button - 1))); } } #ifdef BUGGY_CODE /* domivogt (11-Apr-2000): The pointer ***must not*** be ungrabbed * here. If it is, any window that the mouse enters during the * function will receive MotionNotify events with a button held down! * The results are unpredictable. E.g. rxvt interprets the * ButtonMotion as user input to select text. */ UngrabEm(GRAB_NORMAL); #endif fev_set_evpos(&d, x, y); fev_fake_event(&d); ecc.x.etrigger = &d; ecc.w.w = (ecc.w.fw) ? FW_W_FRAME(ecc.w.fw) : None; mask |= ECC_ETRIGGER | ECC_W; exc2 = exc_clone_context(exc, &ecc, mask); __run_complex_function_items( cond_rc, type, func, exc2, arguments, has_ref_window_moved); exc_destroy_context(exc2); /* This is the right place to ungrab the pointer (see comment above). */ func->use_depth--; __cf_cleanup(&depth, arguments, cond_rc); UngrabEm(GRAB_NORMAL); return; } /* * create a new FvwmFunction */ static FvwmFunction *NewFvwmFunction(const char *name) { FvwmFunction *tmp; tmp = (FvwmFunction *)safemalloc(sizeof(FvwmFunction)); tmp->next_func = Scr.functions; tmp->first_item = NULL; tmp->last_item = NULL; tmp->name = stripcpy(name); tmp->use_depth = 0; Scr.functions = tmp; return tmp; } static void DestroyFunction(FvwmFunction *func) { FunctionItem *fi,*tmp2; FvwmFunction *tmp, *prev; if (func == NULL) { return; } tmp = Scr.functions; prev = NULL; while (tmp && tmp != func) { prev = tmp; tmp = tmp->next_func; } if (tmp != func) { return; } if (func->use_depth != 0) { fvwm_msg( ERR,"DestroyFunction", "Function %s is in use (depth %d)", func->name, func->use_depth); return; } if (prev == NULL) { Scr.functions = func->next_func; } else { prev->next_func = func->next_func; } free(func->name); fi = func->first_item; while (fi != NULL) { tmp2 = fi->next_item; if (fi->action != NULL) { free(fi->action); } free(fi); fi = tmp2; } free(func); return; } /* ---------------------------- interface functions ------------------------ */ Bool functions_is_complex_function(const char *function_name) { if (find_complex_function(function_name) != NULL) { return True; } return False; } void execute_function( cond_rc_t *cond_rc, const exec_context_t *exc, char *action, FUNC_FLAGS_TYPE exec_flags) { __execute_function(cond_rc, exc, action, exec_flags, NULL, False); return; } void execute_function_override_wcontext( cond_rc_t *cond_rc, const exec_context_t *exc, char *action, FUNC_FLAGS_TYPE exec_flags, int wcontext) { const exec_context_t *exc2; exec_context_changes_t ecc; ecc.w.wcontext = wcontext; exc2 = exc_clone_context(exc, &ecc, ECC_WCONTEXT); execute_function(cond_rc, exc2, action, exec_flags); exc_destroy_context(exc2); return; } void execute_function_override_window( cond_rc_t *cond_rc, const exec_context_t *exc, char *action, FUNC_FLAGS_TYPE exec_flags, FvwmWindow *fw) { const exec_context_t *exc2; exec_context_changes_t ecc; ecc.w.fw = fw; if (fw != NULL) { ecc.w.w = FW_W(fw); ecc.w.wcontext = C_WINDOW; exec_flags |= FUNC_DONT_DEFER; } else { ecc.w.w = None; ecc.w.wcontext = C_ROOT; } if (exc != NULL) { exc2 = exc_clone_context( exc, &ecc, ECC_FW | ECC_W | ECC_WCONTEXT); } else { ecc.type = EXCT_NULL; exc2 = exc_create_context( &ecc, ECC_TYPE | ECC_FW | ECC_W | ECC_WCONTEXT); } execute_function(cond_rc, exc2, action, exec_flags); exc_destroy_context(exc2); return; } void find_func_t(char *action, short *func_t, unsigned char *flags) { int j, len = 0; char *endtok = action; Bool matched; int mlen; if (action) { while (*endtok && !isspace((unsigned char)*endtok)) { ++endtok; } len = endtok - action; j=0; matched = False; while (!matched && (mlen = strlen(func_table[j].keyword)) > 0) { if (mlen == len && strncasecmp(action,func_table[j].keyword,mlen) == 0) { matched=True; /* found key word */ if (func_t) { *func_t = func_table[j].func_t; } if (flags) { *flags = func_table[j].flags; } return; } else { j++; } } /* No clue what the function is. Just return "BEEP" */ } if (func_t) { *func_t = F_BEEP; } if (flags) { *flags = 0; } return; } /* * add an item to a FvwmFunction * * Inputs: * func - pointer to the FvwmFunction to add the item * action - the definition string from the config line */ void AddToFunction(FvwmFunction *func, char *action) { FunctionItem *tmp; char *token = NULL; char condition; token = PeekToken(action, &action); if (!token) return; condition = token[0]; if (isupper(condition)) condition = tolower(condition); if (condition != CF_IMMEDIATE && condition != CF_MOTION && condition != CF_HOLD && condition != CF_CLICK && condition != CF_DOUBLE_CLICK) { fvwm_msg( ERR, "AddToFunction", "Got '%s' instead of a valid function specifier", token); return; } if (token[0] != 0 && token[1] != 0 && (find_builtin_function(token) || find_complex_function(token))) { fvwm_msg( WARN, "AddToFunction", "Got the command or function name '%s' instead of a" " function specifier. This may indicate a syntax" " error in the configuration file. Using %c as the" " specifier.", token, token[0]); } if (!action) { return; } while (isspace(*action)) { action++; } if (*action == 0) { return; } tmp = (FunctionItem *)safemalloc(sizeof(FunctionItem)); tmp->next_item = NULL; tmp->func = func; if (func->first_item == NULL) { func->first_item = tmp; func->last_item = tmp; } else { func->last_item->next_item = tmp; func->last_item = tmp; } tmp->condition = condition; tmp->action = stripcpy(action); find_func_t(tmp->action, NULL, &(tmp->flags)); return; } /* ---------------------------- builtin commands --------------------------- */ void CMD_DestroyFunc(F_CMD_ARGS) { FvwmFunction *func; char *token; token = PeekToken(action, NULL); if (!token) { return; } func = find_complex_function(token); if (!func) { return; } if (Scr.last_added_item.type == ADDED_FUNCTION) { set_last_added_item(ADDED_NONE, NULL); } DestroyFunction(func); return; } void CMD_AddToFunc(F_CMD_ARGS) { FvwmFunction *func; char *token; action = GetNextToken(action,&token); if (!token) { return; } func = find_complex_function(token); if (func == NULL) { func = NewFvwmFunction(token); } /* Set + state to last function */ set_last_added_item(ADDED_FUNCTION, func); free(token); AddToFunction(func, action); return; } void CMD_Plus(F_CMD_ARGS) { if (Scr.last_added_item.type == ADDED_MENU) { add_another_menu_item(action); } else if (Scr.last_added_item.type == ADDED_FUNCTION) { AddToFunction(Scr.last_added_item.item, action); } #ifdef USEDECOR else if (Scr.last_added_item.type == ADDED_DECOR) { FvwmDecor *tmp = &Scr.DefaultDecor; for ( ; tmp && tmp != Scr.last_added_item.item; tmp = tmp->next) { /* nothing to do here */ } if (!tmp) { return; } AddToDecor(F_PASS_ARGS, tmp); } #endif /* USEDECOR */ return; } void CMD_EchoFuncDefinition(F_CMD_ARGS) { FvwmFunction *func; const func_t *bif; FunctionItem *fi; char *token; GetNextToken(action, &token); if (!token) { fvwm_msg(ERR, "EchoFuncDefinition", "Missing argument"); return; } bif = find_builtin_function(token); if (bif != NULL) { fvwm_msg( INFO, "EchoFuncDefinition", "function '%s' is a built in command", token); free(token); return; } func = find_complex_function(token); if (!func) { fvwm_msg( INFO, "EchoFuncDefinition", "function '%s' not defined", token); free(token); return; } fvwm_msg( INFO, "EchoFuncDefinition", "definition of function '%s':", token); for (fi = func->first_item; fi != NULL; fi = fi->next_item) { fvwm_msg( INFO, "EchoFuncDefinition", " %c %s", fi->condition, (fi->action == 0) ? "(null)" : fi->action); } fvwm_msg(INFO, "EchoFuncDefinition", "end of definition"); free(token); return; } /* dummy commands */ void CMD_Title(F_CMD_ARGS) { } void CMD_TearMenuOff(F_CMD_ARGS) { } void CMD_KeepRc(F_CMD_ARGS) { } void CMD_Silent(F_CMD_ARGS) { } void CMD_Function(F_CMD_ARGS) { } fvwm-2.6.5.orig/fvwm/virtual.h0000644000175000017500000000111010717552355014443 0ustar vwcvwc/* -*-c-*- */ #ifndef _VIRTUAL_ #define _VIRTUAL_ int HandlePaging( XEvent *pev, int HorWarpSize, int VertWarpSize, int *xl, int *yt, int *delta_x, int *delta_y, Bool Grab, Bool fLoop, Bool do_continue_previous, int delay); void checkPanFrames(void); void raisePanFrames(void); void initPanFrames(void); Bool is_pan_frame(Window w); void MoveViewport(int newx, int newy,Bool); void goto_desk(int desk); void do_move_window_to_desk(FvwmWindow *fw, int desk); Bool get_page_arguments(char *action, int *page_x, int *page_y); char *GetDesktopName(int desk); #endif /* _VIRTUAL_ */ fvwm-2.6.5.orig/fvwm/ewmh_intern.h0000644000175000017500000001016011641302505015264 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2001 Olivier Chapuis */ #ifndef _EWMH_INTERN_ #define _EWMH_INTERN_ /* Extended window manager hints support */ /* #define EWMH_DEBUG */ #ifdef EWMH_DEBUG #include #include #include "ftime.h" #endif #define EWMH_CMD_ARGS FvwmWindow *fw, XEvent *ev, window_style *style, \ unsigned long any typedef struct ewmh_atom { char *name; Atom atom; Atom atom_type; #ifdef __STDC__ int (*action)(EWMH_CMD_ARGS); #else int (*action)(); #endif } ewmh_atom; typedef enum { EWMH_ATOM_LIST_ALL, EWMH_ATOM_LIST_CLIENT_ROOT, EWMH_ATOM_LIST_CLIENT_WIN, EWMH_ATOM_LIST_WM_STATE, EWMH_ATOM_LIST_ALLOWED_ACTIONS, EWMH_ATOM_LIST_WINDOW_TYPE, EWMH_ATOM_LIST_FIXED_PROPERTY, EWMH_ATOM_LIST_PROPERTY_NOTIFY, EWMH_ATOM_LIST_FVWM_ROOT, EWMH_ATOM_LIST_FVWM_WIN, EWMH_ATOM_LIST_END } ewmh_atom_list_name; typedef struct { ewmh_atom_list_name name; ewmh_atom *list; int size; } ewmh_atom_list; #define NET_WM_STATE_ADD 1 #define NET_WM_STATE_REMOVE 0 #define NET_WM_STATE_TOGGLE 2 #define EWMH_MAXIMIZE_HORIZ 0x1 #define EWMH_MAXIMIZE_VERT 0x2 #define EWMH_MAXIMIZE_FULL 0x3 #define EWMH_MAXIMIZE_REMOVE 0x4 #define EWMH_MAXIMIZE_FULLSCREEN 0x8 typedef enum { _NET_WM_MOVERESIZE_SIZE_TOPLEFT, _NET_WM_MOVERESIZE_SIZE_TOP, _NET_WM_MOVERESIZE_SIZE_TOPRIGHT, _NET_WM_MOVERESIZE_SIZE_RIGHT, _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT, _NET_WM_MOVERESIZE_SIZE_BOTTOM, _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT, _NET_WM_MOVERESIZE_SIZE_LEFT, _NET_WM_MOVERESIZE_MOVE, _NET_WM_MOVERESIZE_SIZE_KEYBOARD, _NET_WM_MOVERESIZE_MOVE_KEYBOARD } ewmh_move_resize; typedef struct ewmh_info { unsigned NumberOfDesktops; unsigned MaxDesktops; unsigned CurrentNumberOfDesktops; Bool NeedsToCheckDesk; ewmh_strut BaseStrut; } ewmhInfo; extern ewmhInfo ewmhc; ewmh_atom *ewmh_GetEwmhAtomByAtom(Atom atom, ewmh_atom_list_name list_name); void ewmh_ChangeProperty( Window w, const char *atom_name, ewmh_atom_list_name list, unsigned char *data, int length); void ewmh_DeleteProperty( Window w, const char *atom_name, ewmh_atom_list_name list); void *ewmh_AtomGetByName( Window win, const char *atom_name, ewmh_atom_list_name list, int *size); int ewmh_HandleDesktop(EWMH_CMD_ARGS); int ewmh_HandleDialog(EWMH_CMD_ARGS); int ewmh_HandleDock(EWMH_CMD_ARGS); int ewmh_HandleMenu(EWMH_CMD_ARGS); int ewmh_HandleNormal(EWMH_CMD_ARGS); int ewmh_HandleToolBar(EWMH_CMD_ARGS); int ewmh_HandleNotification(EWMH_CMD_ARGS); void ewmh_AddToKdeSysTray(FvwmWindow *fw); void ewmh_SetWorkArea(void); void ewmh_ComputeAndSetWorkArea(void); void ewmh_HandleDynamicWorkArea(void); void ewmh_HandleWindowType(FvwmWindow *fw, window_style *style); int ewmh_CurrentDesktop(EWMH_CMD_ARGS); int ewmh_DesktopGeometry(EWMH_CMD_ARGS); int ewmh_DesktopViewPort(EWMH_CMD_ARGS); int ewmh_NumberOfDesktops(EWMH_CMD_ARGS); int ewmh_ActiveWindow(EWMH_CMD_ARGS); int ewmh_CloseWindow(EWMH_CMD_ARGS); int ewmh_MoveResizeWindow(EWMH_CMD_ARGS); int ewmh_RestackWindow(EWMH_CMD_ARGS); int ewmh_WMDesktop(EWMH_CMD_ARGS); int ewmh_MoveResize(EWMH_CMD_ARGS); int ewmh_WMState(EWMH_CMD_ARGS); int ewmh_WMStateFullScreen(EWMH_CMD_ARGS); int ewmh_WMStateHidden(EWMH_CMD_ARGS); int ewmh_WMStateMaxHoriz(EWMH_CMD_ARGS); int ewmh_WMStateMaxVert(EWMH_CMD_ARGS); int ewmh_WMStateModal(EWMH_CMD_ARGS); int ewmh_WMStateShaded(EWMH_CMD_ARGS); int ewmh_WMStateSkipPager(EWMH_CMD_ARGS); int ewmh_WMStateSkipTaskBar(EWMH_CMD_ARGS); int ewmh_WMStateStaysOnTop(EWMH_CMD_ARGS); int ewmh_WMStateStaysOnBottom(EWMH_CMD_ARGS); int ewmh_WMStateSticky(EWMH_CMD_ARGS); int ewmh_WMIconGeometry(EWMH_CMD_ARGS); int ewmh_WMStrut(EWMH_CMD_ARGS); Bool ewmh_AllowsYes(EWMH_CMD_ARGS); Bool ewmh_AllowsClose(EWMH_CMD_ARGS); Bool ewmh_AllowsFullScreen(EWMH_CMD_ARGS); Bool ewmh_AllowsMinimize(EWMH_CMD_ARGS); Bool ewmh_AllowsMaximize(EWMH_CMD_ARGS); Bool ewmh_AllowsMove(EWMH_CMD_ARGS); Bool ewmh_AllowsResize(EWMH_CMD_ARGS); /* ewmh_icon */ int ewmh_WMIcon(EWMH_CMD_ARGS); CARD32 *ewmh_SetWmIconFromPixmap( FvwmWindow *fw, CARD32 *orig_icon, int *orig_size, Bool is_mini_icon); /* debugging */ #ifdef EWMH_DEBUG void EWMH_DLOG(char *msg, ...); #else #endif #endif /* _EWMH_INTERN_ */ fvwm-2.6.5.orig/fvwm/expand.h0000644000175000017500000000125407701425753014245 0ustar vwcvwc/* -*-c-*- */ #ifndef EXPAND_H #define EXPAND_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ char *expand_vars( char *input, char *arguments[], Bool addto, Bool ismod, cond_rc_t *cond_rc, const exec_context_t *exc); #endif /* EXPAND_H */ fvwm-2.6.5.orig/fvwm/ewmh_icons.c0000644000175000017500000004273411245071514015112 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2001 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/FShape.h" #include "libs/PictureBase.h" #include "libs/Picture.h" #include "libs/PictureUtils.h" #include "libs/PictureImageLoader.h" #include "libs/FRenderInit.h" #include "libs/Graphics.h" #include "libs/Strings.h" #include "fvwm.h" #include "externs.h" #include "window_flags.h" #include "cursor.h" #include "functions.h" #include "misc.h" #include "screen.h" #include "module_interface.h" #include "borders.h" #include "icons.h" #include "ewmh.h" #include "ewmh_intern.h" /* * net icon handler */ int ewmh_WMIcon(EWMH_CMD_ARGS) { CARD32 *list = NULL; CARD32 *new_list = NULL; CARD32 *dummy = NULL; int size = 0; if (ev != NULL && HAS_EWMH_WM_ICON_HINT(fw) == EWMH_FVWM_ICON) { /* this event has been produced by fvwm itself */ return 0; } list = ewmh_AtomGetByName(FW_W(fw),"_NET_WM_ICON", EWMH_ATOM_LIST_PROPERTY_NOTIFY, &size); if (list != NULL && HAS_EWMH_WM_ICON_HINT(fw) == EWMH_NO_ICON) { /* the application have a true _NET_WM_ICON */ SET_HAS_EWMH_WM_ICON_HINT(fw, EWMH_TRUE_ICON); } if (list == NULL || HAS_EWMH_WM_ICON_HINT(fw) != EWMH_TRUE_ICON) { /* No net icon or we have set the net icon */ if (DO_EWMH_DONATE_ICON(fw) && (new_list = ewmh_SetWmIconFromPixmap( fw, list, &size, False)) != NULL) { SET_HAS_EWMH_WM_ICON_HINT(fw, EWMH_FVWM_ICON); } } else if (ev != NULL && USE_EWMH_ICON(fw)) { /* client message. the application change its net icon */ ChangeIconPixmap(fw); } if (FMiniIconsSupported) { if (list == NULL || HAS_EWMH_WM_ICON_HINT(fw) != EWMH_TRUE_ICON) { /* No net icon or we have set the net icon */ if (DO_EWMH_DONATE_MINI_ICON(fw) && (dummy = ewmh_SetWmIconFromPixmap( fw, (new_list != NULL)? new_list : list, &size, True)) != NULL) { SET_HAS_EWMH_WM_ICON_HINT( fw, EWMH_FVWM_ICON); free(dummy); } } else { /* the application has a true ewmh icon */ if (EWMH_SetIconFromWMIcon(fw, list, size, True)) { SET_HAS_EWMH_MINI_ICON(fw, True); } } } if (list != NULL) { free(list); } if (new_list != NULL) { free(new_list); } return 0; } /* * update */ void EWMH_DoUpdateWmIcon(FvwmWindow *fw, Bool mini_icon, Bool icon) { CARD32 *list = NULL; CARD32 *new_list = NULL; CARD32 *dummy = NULL; int size = 0; Bool icon_too = False; if (HAS_EWMH_WM_ICON_HINT(fw) == EWMH_TRUE_ICON) { return; } /* first see if we have to delete */ if (FMiniIconsSupported && mini_icon && !DO_EWMH_DONATE_MINI_ICON(fw)) { if (icon && !DO_EWMH_DONATE_ICON(fw)) { icon_too = True; } EWMH_DeleteWmIcon(fw, True, icon_too); } if (!icon_too && icon && !DO_EWMH_DONATE_ICON(fw)) { EWMH_DeleteWmIcon(fw, False, True); } /* now set if needed */ if ((mini_icon && DO_EWMH_DONATE_MINI_ICON(fw)) || (icon && DO_EWMH_DONATE_ICON(fw))) { list = ewmh_AtomGetByName( FW_W(fw),"_NET_WM_ICON", EWMH_ATOM_LIST_PROPERTY_NOTIFY, &size); } else { return; } /* we have to reset */ if (icon && DO_EWMH_DONATE_ICON(fw)) { if ((new_list = ewmh_SetWmIconFromPixmap( fw, list, &size, False)) != NULL) { SET_HAS_EWMH_WM_ICON_HINT(fw, EWMH_FVWM_ICON); } } if (FMiniIconsSupported && mini_icon && DO_EWMH_DONATE_MINI_ICON(fw)) { if ((dummy = ewmh_SetWmIconFromPixmap( fw, (new_list != NULL)? new_list : list, &size, True)) != NULL) { SET_HAS_EWMH_WM_ICON_HINT(fw, EWMH_FVWM_ICON); free(dummy); } } if (list != NULL) { free(list); } if (new_list != NULL) { free(new_list); } } /* * build and set a net icon from a pixmap */ CARD32 *ewmh_SetWmIconFromPixmap( FvwmWindow *fw, CARD32 *orig_icon, int *orig_size, Bool is_mini_icon) { CARD32 *new_icon = NULL; int keep_start = 0, keep_length = 0; int width = 0, height = 0; int i,j,k,l,m; int s; Pixmap pixmap = None; Pixmap mask = None; Pixmap alpha = None; XImage *image; XImage *m_image = NULL; XImage *a_image = NULL; int save_picture_w_g_width = 0; int save_picture_w_g_height = 0; int save_icon_depth = 0; Pixmap save_icon_pixmap = None; Pixmap save_icon_mask = None; Pixmap save_icon_alpha = None; int save_icon_nalloc_pixels = 0; Pixel *save_icon_alloc_pixels = NULL; int save_icon_no_limit = 0; Window save_icon_pixmap_w = None; Bool is_pixmap_ours = False; Bool is_icon_ours = False; Bool is_icon_shaped = False; Bool destroy_icon_pix = False; s = *orig_size / sizeof(CARD32); *orig_size = 0; if (is_mini_icon) { if (FMiniIconsSupported && fw->mini_icon != NULL) { pixmap = fw->mini_icon->picture; mask = fw->mini_icon->mask; alpha = fw->mini_icon->alpha; width = fw->mini_icon->width; height = fw->mini_icon->height; } } else { /* should save and restore any iformation modified by * a call to GetIconPicture */ save_picture_w_g_width = fw->icon_g.picture_w_g.width; save_picture_w_g_height = fw->icon_g.picture_w_g.height; save_icon_depth = fw->iconDepth; save_icon_pixmap = fw->iconPixmap; save_icon_mask = fw->icon_maskPixmap; save_icon_alpha = fw->icon_alphaPixmap; save_icon_nalloc_pixels = fw->icon_nalloc_pixels; save_icon_alloc_pixels = fw->icon_alloc_pixels; save_icon_no_limit = fw->icon_no_limit; save_icon_pixmap_w = FW_W_ICON_PIXMAP(fw); is_pixmap_ours = IS_PIXMAP_OURS(fw); is_icon_ours = IS_ICON_OURS(fw); is_icon_shaped = IS_ICON_SHAPED(fw); GetIconPicture(fw, True); if (IS_PIXMAP_OURS(fw)) { destroy_icon_pix = True; } pixmap = fw->iconPixmap; mask = fw->icon_maskPixmap; alpha = fw->icon_alphaPixmap; width = fw->icon_g.picture_w_g.width; height = fw->icon_g.picture_w_g.height; if (fw->icon_alloc_pixels != NULL) { if (fw->icon_nalloc_pixels != 0) { PictureFreeColors( dpy, Pcmap, fw->icon_alloc_pixels, fw->icon_nalloc_pixels, 0, fw->icon_no_limit); } free(fw->icon_alloc_pixels); } fw->icon_g.picture_w_g.width = save_picture_w_g_width; fw->icon_g.picture_w_g.height = save_picture_w_g_height; fw->iconDepth = save_icon_depth; fw->iconPixmap = save_icon_pixmap; fw->icon_maskPixmap = save_icon_mask; fw->icon_alphaPixmap = save_icon_alpha; fw->icon_nalloc_pixels = save_icon_nalloc_pixels; fw->icon_alloc_pixels = save_icon_alloc_pixels; fw->icon_no_limit = save_icon_no_limit; FW_W_ICON_PIXMAP(fw) = save_icon_pixmap_w; SET_ICON_OURS(fw, is_icon_ours); SET_PIXMAP_OURS(fw, is_pixmap_ours); SET_ICON_SHAPED(fw, is_icon_shaped); } if (pixmap == None) { return NULL; } if (FMiniIconsSupported && orig_icon != NULL) { int k_width = (is_mini_icon)? fw->ewmh_icon_width : fw->ewmh_mini_icon_width; int k_height = (is_mini_icon)? fw->ewmh_icon_height : fw->ewmh_mini_icon_height; for (i = 0; i < s - 1 && i >= 0; ) { if (i + 1 + orig_icon[i]*orig_icon[i+1] < s) { if (orig_icon[i] == k_width && orig_icon[i+1] == k_height) { keep_start = i; keep_length = 2 + orig_icon[i] * orig_icon[i+1]; i = s; } } if (i != s && orig_icon[i]*orig_icon[i+1] > 0) { i = i + 2 + orig_icon[i]*orig_icon[i+1]; } else { i = s; } } } image = XGetImage( dpy, pixmap, 0, 0, width, height, AllPlanes, ZPixmap); if (image == NULL) { fvwm_msg( ERR, "EWMH_SetWmIconFromPixmap", "cannot create XImage\n"); if (destroy_icon_pix) { XFreePixmap(dpy, pixmap); if (mask != None) { XFreePixmap(dpy, mask); } if (alpha != None) { XFreePixmap(dpy, alpha); } } return NULL; } if (mask != None) { m_image = XGetImage(dpy, mask, 0, 0, width, height, AllPlanes, ZPixmap); } if (alpha != None) { a_image = XGetImage(dpy, alpha, 0, 0, width, height, AllPlanes, ZPixmap); } *orig_size = (height*width + 2 + keep_length) * sizeof(CARD32); new_icon = (CARD32 *)safemalloc(*orig_size); if (keep_length > 0) { memcpy(new_icon, &orig_icon[keep_start], keep_length * sizeof(CARD32)); } new_icon[keep_length] = width; new_icon[1+keep_length] = height; k = 0; l = (2 + keep_length); m = 0; switch(image->depth) { case 1: { XColor colors[2]; CARD32 fg, bg; colors[0].pixel = fw->colors.fore; colors[1].pixel = fw->colors.back; XQueryColors(dpy, Pcmap, colors, 2); fg = 0xff000000 + (((colors[0].red >> 8) & 0xff) << 16) + (((colors[0].green >> 8) & 0xff) << 8) + ((colors[0].blue >> 8) & 0xff); bg = 0xff000000 + (((colors[1].red >> 8) & 0xff) << 16) + (((colors[1].green >> 8) & 0xff) << 8) + ((colors[1].blue >> 8) & 0xff); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { if (m_image != NULL && (XGetPixel(m_image, i, j) == 0)) { new_icon[l++] = 0; } else if (XGetPixel(image, i, j) == 0) { new_icon[l++] = bg; } else { new_icon[l++] = fg; } } } break; } default: /* depth = Pdepth */ { unsigned char *cm; XColor *colors; colors = (XColor *)safemalloc(width * height * sizeof(XColor)); cm = (unsigned char *)safemalloc( width * height * sizeof(char)); for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { if (m_image != NULL && (XGetPixel(m_image, i, j) == 0)) { cm[m++] = 0; } else if (a_image != NULL) { cm[m++] = (unsigned char)XGetPixel( a_image, i, j); colors[k++].pixel = XGetPixel( image, i, j); } else { cm[m++] = 255; colors[k++].pixel = XGetPixel( image, i, j); } } } for (i = 0; i < k; i += 256) XQueryColors(dpy, Pcmap, &colors[i], min(k - i, 256)); k = 0;m = 0; for (j = 0; j < height; j++) { for (i = 0; i < width; i++) { if (cm[m] > 0) { new_icon[l++] = ((cm[m] & 0xff) << 24) + (((colors[k].red >> 8) & 0xff) << 16) + (((colors[k].green >> 8) & 0xff) << 8) + ((colors[k].blue >> 8) & 0xff); k++; } else { new_icon[l++] = 0; } m++; } } free(colors); free(cm); break; } } /* switch */ if (is_mini_icon) { fw->ewmh_mini_icon_width = width; fw->ewmh_mini_icon_height = height; } else { fw->ewmh_icon_width = width; fw->ewmh_icon_height = height; } ewmh_ChangeProperty( FW_W(fw), "_NET_WM_ICON", EWMH_ATOM_LIST_PROPERTY_NOTIFY, (unsigned char *)new_icon, height*width + 2 + keep_length); if (destroy_icon_pix) { XFreePixmap(dpy, pixmap); if (mask != None) { XFreePixmap(dpy, mask); } if (alpha != None) { XFreePixmap(dpy, alpha); } } XDestroyImage(image); if (m_image != None) { XDestroyImage(m_image); } if (a_image != None) { XDestroyImage(a_image); } return new_icon; } /* * delete the mini icon and/or the icon from a ewmh icon */ void EWMH_DeleteWmIcon(FvwmWindow *fw, Bool mini_icon, Bool icon) { CARD32 *list; CARD32 *new_list = NULL; int keep_start = 0, keep_length = 0; int s; int i; if (mini_icon && icon) { ewmh_DeleteProperty( FW_W(fw), "_NET_WM_ICON", EWMH_ATOM_LIST_PROPERTY_NOTIFY); fw->ewmh_mini_icon_width = 0; fw->ewmh_mini_icon_height = 0; fw->ewmh_icon_width = 0; fw->ewmh_icon_height = 0; /*SET_HAS_EWMH_WM_ICON_HINT(fw, EWMH_NO_ICON);*/ return; } list = ewmh_AtomGetByName( FW_W(fw),"_NET_WM_ICON", EWMH_ATOM_LIST_PROPERTY_NOTIFY, &s); if (list == NULL) { return; } s = s / sizeof(CARD32); if (FMiniIconsSupported && list != NULL) { int k_width = (mini_icon) ? fw->ewmh_icon_width : fw->ewmh_mini_icon_width; int k_height = (mini_icon) ? fw->ewmh_icon_height : fw->ewmh_mini_icon_height; for (i = 0; i < s - 1; ) { if (i + 1 + list[i]*list[i+1] < s) { if (list[i] == k_width && list[i+1] == k_height) { keep_start = i; keep_length = 2 + list[i]*list[i+1]; i = s; } } if (i != s && list[i]*list[i+1] > 0) { i = i + 2 + list[i]*list[i+1]; } else { i = s; } } } if (keep_length > 0) { new_list = (CARD32 *)safemalloc(keep_length * sizeof(CARD32)); memcpy( new_list, &list[keep_start], keep_length * sizeof(CARD32)); } if (new_list != NULL) { ewmh_ChangeProperty( FW_W(fw),"_NET_WM_ICON", EWMH_ATOM_LIST_PROPERTY_NOTIFY, (unsigned char *)new_list, keep_length); } else { /*SET_HAS_EWMH_WM_ICON_HINT(fw, EWMH_NO_ICON);*/ ewmh_DeleteProperty( FW_W(fw), "_NET_WM_ICON", EWMH_ATOM_LIST_PROPERTY_NOTIFY); } if (mini_icon) { fw->ewmh_mini_icon_width = 0; fw->ewmh_mini_icon_height = 0; } if (icon) { fw->ewmh_icon_width = 0; fw->ewmh_icon_height = 0; } if (new_list != NULL) { free(new_list); } free(list); } /* * Create an x image from a NET icon */ #define SQUARE(X) ((X)*(X)) static void extract_wm_icon( CARD32 *list, int size, int wanted_w, int wanted_h, int *start_best, int *best_w, int *best_h) { int i; int dist = 0; *start_best = 0; *best_w = 0; *best_h = 0; size = size / (sizeof(CARD32)); for (i = 0; i < size - 1; ) { if (i + 1 + list[i]*list[i+1] < size) { if (*best_w == 0 && *best_h == 0) { *start_best = i+2; *best_w = list[i]; *best_h = list[i+1]; dist = SQUARE( list[i]-wanted_w) + SQUARE(list[i+1]-wanted_h); } else if (SQUARE(list[i]-wanted_w) + SQUARE(list[i+1]-wanted_h) < dist) { *start_best = i+2; *best_w = list[i]; *best_h = list[i+1]; dist = SQUARE( list[i]-wanted_w) + SQUARE(list[i+1]-wanted_h); } } if (list[i]*list[i+1] > 0) { i = i + 2 + list[i]*list[i+1]; } else { i = size; } } return; } #define MINI_ICON_WANTED_WIDTH 16 #define MINI_ICON_WANTED_HEIGHT 16 #define MINI_ICON_MAX_WIDTH 22 #define MINI_ICON_MAX_HEIGHT 22 #define ICON_WANTED_WIDTH 56 #define ICON_WANTED_HEIGHT 56 #define ICON_MAX_WIDTH 100 #define ICON_MAX_HEIGHT 100 int EWMH_SetIconFromWMIcon( FvwmWindow *fw, CARD32 *list, int size, Bool is_mini_icon) { int start, width, height; int wanted_w, wanted_h; int max_w, max_h; Pixmap pixmap = None; Pixmap mask = None; Pixmap alpha = None; Bool free_list = False; int nalloc_pixels; Pixel *alloc_pixels; int no_limit; FvwmPictureAttributes fpa; if (list == NULL) { /* we are called from icons.c or update.c */ list = ewmh_AtomGetByName( FW_W(fw),"_NET_WM_ICON", EWMH_ATOM_LIST_PROPERTY_NOTIFY, &size); free_list = True; if (list == NULL) { return 0; } } if (is_mini_icon) { wanted_w = MINI_ICON_WANTED_WIDTH; wanted_h = MINI_ICON_WANTED_HEIGHT; max_w = MINI_ICON_MAX_WIDTH; max_h = ICON_MAX_HEIGHT; fpa.mask = 0; } else { wanted_w = ICON_WANTED_WIDTH; wanted_h = ICON_WANTED_HEIGHT; max_w = ICON_MAX_WIDTH; max_h = ICON_MAX_HEIGHT; if (fw->cs >= 0 && Colorset[fw->cs].do_dither_icon) { fpa.mask = FPAM_DITHER; } else { fpa.mask = 0; } } extract_wm_icon( list, size, wanted_w, wanted_h, &start, &width, &height); if (width == 0 || height == 0) { if (free_list) { free(list); } return 0; } if (!PImageCreatePixmapFromArgbData( dpy, Scr.NoFocusWin, list, start, width, height, &pixmap, &mask, &alpha, &nalloc_pixels, &alloc_pixels, &no_limit, fpa)) { fvwm_msg(ERR, "EWMH_SetIconFromWMIcon", "fail to create a pixmap\n"); if (free_list) { free(list); } return 0; } if (width > max_w || height > max_h) { Pixmap np = None,nm =None, na = None; if (pixmap) { np = CreateStretchPixmap( dpy, pixmap, width, height, Pdepth, wanted_w, wanted_h, Scr.TitleGC); XFreePixmap(dpy, pixmap); pixmap = np; } if (mask) { nm = CreateStretchPixmap( dpy, mask, width, height, 1, wanted_w, wanted_h, Scr.MonoGC); XFreePixmap(dpy, mask); mask = nm; } if (alpha) { na = CreateStretchPixmap( dpy, alpha, width, height, FRenderGetAlphaDepth(), wanted_w, wanted_h, Scr.AlphaGC); XFreePixmap(dpy, alpha); alpha = na; } width = wanted_w; height = wanted_h; } if (FMiniIconsSupported && is_mini_icon && !DO_EWMH_MINI_ICON_OVERRIDE(fw)) { char *name = NULL; CopyString(&name,"ewmh_mini_icon"); if (fw->mini_icon) { PDestroyFvwmPicture(dpy,fw->mini_icon); fw->mini_icon = 0; } fw->mini_icon = PCacheFvwmPictureFromPixmap( dpy, Scr.NoFocusWin, name, pixmap,mask,alpha, width, height, nalloc_pixels, alloc_pixels, no_limit); if (fw->mini_icon != NULL) { fw->mini_pixmap_file = name; BroadcastFvwmPicture( M_MINI_ICON, FW_W(fw), FW_W_FRAME(fw), (unsigned long)fw, fw->mini_icon, fw->mini_pixmap_file); border_redraw_decorations(fw); } } if (!is_mini_icon) { fw->iconPixmap = pixmap; fw->icon_maskPixmap = mask; fw->icon_alphaPixmap = alpha; fw->icon_nalloc_pixels = nalloc_pixels; fw->icon_alloc_pixels = alloc_pixels; fw->icon_no_limit = no_limit; fw->icon_g.picture_w_g.width = width; fw->icon_g.picture_w_g.height = height; fw->iconDepth = Pdepth; SET_PIXMAP_OURS(fw, 1); if (FShapesSupported && mask) { SET_ICON_SHAPED(fw, 1); } } if (free_list) { free(list); } return 1; } fvwm-2.6.5.orig/fvwm/menucmd.c0000644000175000017500000001564410556634173014421 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* IMPORTANT NOTE: Do *not* use any constant numbers in this file. All values * have to be #defined in the section below or defaults.h to ensure full * control over the menus. */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/Parse.h" #include "libs/Strings.h" #include "fvwm.h" #include "functions.h" #include "repeat.h" #include "misc.h" #include "move_resize.h" #include "screen.h" #include "menus.h" #include "menudim.h" #include "menuroot.h" #include "menustyle.h" #include "menuparameters.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static void menu_func(F_CMD_ARGS, Bool fStaysUp) { struct MenuRoot *menu; char *ret_action = NULL; struct MenuOptions mops; char *menu_name = NULL; struct MenuParameters mp; struct MenuReturn mret; FvwmWindow * const fw = exc->w.fw; const Window w = exc->w.w; const exec_context_t *exc2; memset(&mops, 0, sizeof(mops)); memset(&mret, 0, sizeof(MenuReturn)); action = GetNextToken(action,&menu_name); action = get_menu_options( action, w, fw, NULL, NULL, NULL, &mops); while (action && *action && isspace((unsigned char)*action)) { action++; } if (action && *action == 0) { action = NULL; } menu = menus_find_menu(menu_name); if (menu == NULL) { if (menu_name) { fvwm_msg(ERR,"menu_func","No such menu %s",menu_name); free(menu_name); } return; } if (menu_name && set_repeat_data( menu_name, (fStaysUp) ? REPEAT_MENU : REPEAT_POPUP,NULL)) { free(menu_name); } memset(&mp, 0, sizeof(mp)); mp.menu = menu; exc2 = exc_clone_context(exc, NULL, 0); mp.pexc = &exc2; MR_IS_TEAR_OFF_MENU(menu) = 0; mp.flags.has_default_action = (action != NULL); mp.flags.is_sticky = fStaysUp; mp.flags.is_submenu = False; mp.flags.is_already_mapped = False; mp.flags.is_triggered_by_keypress = (exc->x.etrigger->type == KeyPress); mp.pops = &mops; mp.ret_paction = &ret_action; do_menu(&mp, &mret); if (mret.rc == MENU_DOUBLE_CLICKED && action) { execute_function(cond_rc, exc2, action, 0); } if (ret_action != NULL) { free(ret_action); } exc_destroy_context(exc2); return; } /* ---------------------------- interface functions ------------------------ */ /* ---------------------------- builtin commands --------------------------- */ /* the function for the "Popup" command */ void CMD_Popup(F_CMD_ARGS) { menu_func(F_PASS_ARGS, False); return; } /* the function for the "Menu" command */ void CMD_Menu(F_CMD_ARGS) { menu_func(F_PASS_ARGS, True); return; } void CMD_AddToMenu(F_CMD_ARGS) { MenuRoot *mr; MenuRoot *mrPrior; char *token, *rest,*item; token = PeekToken(action, &rest); if (!token) { return; } mr = menus_find_menu(token); if (mr && MR_MAPPED_COPIES(mr) != 0) { fvwm_msg(ERR,"add_item_to_menu", "menu %s is in use", token); return; } mr = FollowMenuContinuations(menus_find_menu(token), &mrPrior); if (mr == NULL) { mr = NewMenuRoot(token); } /* Set + state to last menu */ set_last_added_item(ADDED_MENU, mr); rest = GetNextToken(rest, &item); AddToMenu(mr, item, rest, True /* pixmap scan */, True, False); if (item) { free(item); } return; } void CMD_DestroyMenu(F_CMD_ARGS) { MenuRoot *mr; MenuRoot *mrContinuation; Bool do_recreate = False; char *token; token = PeekToken(action, &action); if (!token) { return; } if (StrEquals(token, "recreate")) { do_recreate = True; token = PeekToken(action, NULL); } mr = menus_find_menu(token); if (Scr.last_added_item.type == ADDED_MENU) { set_last_added_item(ADDED_NONE, NULL); } while (mr) { /* save continuation before destroy */ mrContinuation = MR_CONTINUATION_MENU(mr); if (!DestroyMenu(mr, do_recreate, True)) { return; } /* Don't recreate the continuations */ do_recreate = False; mr = mrContinuation; } return; } void CMD_DestroyMenuStyle(F_CMD_ARGS) { MenuStyle *ms = NULL; char *name = NULL; name = PeekToken(action, NULL); if (name == NULL) { fvwm_msg(ERR,"DestroyMenuStyle", "needs one parameter"); return; } ms = menustyle_find(name); if (ms == NULL) { return; } else if (ms == menustyle_get_default_style()) { fvwm_msg(ERR,"DestroyMenuStyle", "cannot destroy default menu style. " "To reset the default menu style use\n %s", DEFAULT_MENU_STYLE); return; } else if (ST_USAGE_COUNT(ms) != 0) { fvwm_msg(ERR, "DestroyMenuStyle", "menu style %s is in use", name); return; } else { menustyle_free(ms); } menus_remove_style_from_menus(ms); return; } void CMD_ChangeMenuStyle(F_CMD_ARGS) { char *name = NULL; char *menuname = NULL; MenuStyle *ms = NULL; MenuRoot *mr = NULL; name = PeekToken(action, &action); if (name == NULL) { fvwm_msg(ERR,"ChangeMenuStyle", "needs at least two parameters"); return; } ms = menustyle_find(name); if (ms == NULL) { fvwm_msg(ERR,"ChangeMenuStyle", "cannot find style %s", name); return; } menuname = PeekToken(action, &action); while (menuname && *menuname) { mr = menus_find_menu(menuname); if (mr == NULL) { fvwm_msg(ERR, "ChangeMenuStyle", "cannot find menu %s", menuname); break; } if (MR_MAPPED_COPIES(mr) != 0) { fvwm_msg(ERR, "ChangeMenuStyle", "menu %s is in use", menuname); } else { MR_STYLE(mr) = ms; MR_IS_UPDATED(mr) = 1; } menuname = PeekToken(action, &action); } return; } fvwm-2.6.5.orig/fvwm/session.h0000644000175000017500000000357710656151547014463 0ustar vwcvwc/* -*-c-*- */ /* Description: * exports from session.c shall go into this file * * Created: * 4 April 1999 - Steve Robbins */ #ifndef SESSION_H #define SESSION_H /* ** Load and save the 'global', ie not window-related, state of fvwm ** into a file. */ void LoadGlobalState(char *filename); /* ** Turn off SM for new windows */ void DisableRestoringState(void); /* ** Load and save window states. */ void LoadWindowStates (char *filename); /* ** Save state to the named file, and if running under SM, ** make the SM properly restart fvwm. */ void RestartInSession (char *filename, Bool isNative, Bool doPreserveState); /* ** Fill in the FvwmWindow struct with information saved from ** the last session. This expects the fields ** t->w ** t->name ** t->class ** t->tmpflags.NameChanged ** to have meaningful values. The shade and maximize flags are set ** if the window should start out as shaded or maximized, respecively. ** The dimensions returned in x, y, w, h should be used when the ** window is to be maximized. */ typedef struct { int shade_dir; unsigned do_shade : 1; unsigned used_title_dir_for_shading : 1; unsigned do_max : 1; } mwtsm_state_args; Bool MatchWinToSM( FvwmWindow *ewin, mwtsm_state_args *ret_state_args, initial_window_options_t *win_opts); void SetClientID(char *client_id); /* ** Try to open a connection to the session manager. If non-NULL, ** reuse the client_id. */ void SessionInit(void); /* ** The file number of the session manager connection or -1 ** if no session manager was found. */ extern int sm_fd; /* ** Process messages received from the session manager. Call this ** from the main event loop when there is input waiting sm_fd. */ void ProcessICEMsgs(void); /* * Fvwm Function implementation */ Bool quitSession(void); Bool saveSession(void); Bool saveQuitSession(void); #endif fvwm-2.6.5.orig/fvwm/frame.c0000644000175000017500000014471611652476141014063 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "libs/fvwmlib.h" #include "libs/FShape.h" #include "libs/Grab.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "events.h" #include "misc.h" #include "screen.h" #include "geometry.h" #include "module_interface.h" #include "focus.h" #include "borders.h" #include "frame.h" #include "gnome.h" #include "ewmh.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef struct { int decor_grav; int title_grav; int lbutton_grav; int rbutton_grav; int parent_grav; int client_grav; } frame_decor_gravities_type; typedef struct { /* filled when args are created */ frame_move_resize_mode mode; frame_decor_gravities_type grav; size_borders b_g; size_borders b_no_title_g; rectangle curr_sidebar_g; rectangle start_g; rectangle end_g; rectangle delta_g; rectangle current_g; rectangle client_g; int anim_steps; Window w_with_focus; int current_step; int curr_titlebar_compression; direction_t shade_dir; window_parts trans_parts; struct { unsigned do_force : 1; unsigned do_not_configure_client : 1; unsigned do_not_draw : 1; unsigned do_restore_gravity : 1; unsigned do_set_bit_gravity : 1; unsigned do_update_shape : 1; unsigned had_handles : 1; unsigned is_lazy_shading : 1; unsigned is_setup : 1; unsigned is_shading : 1; unsigned was_moved : 1; } flags; /* used during the animation */ int next_titlebar_compression; rectangle next_sidebar_g; rectangle next_g; rectangle dstep_g; size_rect parent_s; int minimal_w_offset; int minimal_h_offset; struct { /* cleared before each step */ unsigned do_hide_parent : 1; unsigned do_unhide_parent : 1; unsigned is_hidden : 1; unsigned was_hidden : 1; } step_flags; } mr_args_internal; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* windows used to hide animation steps */ static struct { Window parent; Window w[4]; } hide_wins; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ #if 0 static void print_g(char *text, rectangle *g) { if (g == NULL) { fprintf(stderr, "%s: (null)", (text == NULL) ? "" : text); } else { fprintf(stderr, "%s: %4d %4d %4dx%4d (%4d - %4d %4d - %4d)\n", (text == NULL) ? "" : text, g->x, g->y, g->width, g->height, g->x, g->x + g->width - 1, g->y, g->y + g->height - 1); } } #endif static void combine_gravities( frame_decor_gravities_type *ret_grav, frame_decor_gravities_type *grav_x, frame_decor_gravities_type *grav_y) { ret_grav->decor_grav = gravity_combine_xy_grav( grav_x->decor_grav, grav_y->decor_grav); ret_grav->title_grav = gravity_combine_xy_grav( grav_x->title_grav, grav_y->title_grav); ret_grav->lbutton_grav = gravity_combine_xy_grav( grav_x->lbutton_grav, grav_y->lbutton_grav); ret_grav->rbutton_grav = gravity_combine_xy_grav( grav_x->rbutton_grav, grav_y->rbutton_grav); ret_grav->parent_grav = gravity_combine_xy_grav( grav_x->parent_grav, grav_y->parent_grav); ret_grav->client_grav = gravity_combine_xy_grav( grav_x->client_grav, grav_y->client_grav); return; } static void get_resize_decor_gravities_one_axis( frame_decor_gravities_type *ret_grav, direction_t title_dir, frame_move_resize_mode axis_mode, direction_t neg_dir, direction_t pos_dir, int is_moving) { int title_grav; int neg_grav; int pos_grav; title_grav = gravity_dir_to_grav(title_dir); neg_grav = gravity_dir_to_grav(neg_dir); pos_grav = gravity_dir_to_grav(pos_dir); if (title_dir != DIR_NONE) { ret_grav->decor_grav = title_grav; ret_grav->lbutton_grav = title_grav; ret_grav->title_grav = title_grav; ret_grav->rbutton_grav = title_grav; } else { ret_grav->decor_grav = neg_grav; ret_grav->lbutton_grav = neg_grav; ret_grav->title_grav = neg_grav; ret_grav->rbutton_grav = pos_grav; } switch (axis_mode) { case FRAME_MR_SCROLL: ret_grav->client_grav = (is_moving) ? neg_grav : pos_grav; break; case FRAME_MR_SHRINK: ret_grav->client_grav = (is_moving) ? pos_grav : neg_grav; break; case FRAME_MR_OPAQUE: case FRAME_MR_FORCE_SETUP: case FRAME_MR_FORCE_SETUP_NO_W: case FRAME_MR_SETUP: case FRAME_MR_SETUP_BY_APP: ret_grav->client_grav = neg_grav; break; case FRAME_MR_DONT_DRAW: /* can not happen, just a dummy to keep -Wall happy */ break; } ret_grav->parent_grav = ret_grav->client_grav; return; } static void frame_get_titlebar_dimensions_only( FvwmWindow *fw, rectangle *frame_g, size_borders *bs, rectangle *ret_titlebar_g) { if (!HAS_TITLE(fw)) { return; } switch (GET_TITLE_DIR(fw)) { case DIR_W: case DIR_E: ret_titlebar_g->x = (GET_TITLE_DIR(fw) == DIR_W) ? bs->top_left.width : frame_g->width - bs->bottom_right.width - fw->title_thickness; ret_titlebar_g->y = bs->top_left.height; ret_titlebar_g->width = fw->title_thickness; ret_titlebar_g->height = frame_g->height - bs->total_size.height; break; case DIR_N: case DIR_S: default: /* default makes gcc4 happy */ ret_titlebar_g->y = (GET_TITLE_DIR(fw) == DIR_N) ? bs->top_left.height : frame_g->height - bs->bottom_right.height - fw->title_thickness; ret_titlebar_g->x = bs->top_left.width; ret_titlebar_g->width = frame_g->width - bs->total_size.width; ret_titlebar_g->height = fw->title_thickness; break; } return; } static void frame_setup_border( FvwmWindow *fw, rectangle *frame_g, window_parts setup_parts, rectangle *diff_g) { XWindowChanges xwc; Window w; window_parts part; rectangle sidebar_g; rectangle part_g; Bool dummy; if (HAS_NO_BORDER(fw)) { return; } frame_get_sidebar_geometry( fw, NULL, frame_g, &sidebar_g, &dummy, &dummy); for (part = PART_BORDER_N; (part & PART_FRAME); part <<= 1) { if ((part & PART_FRAME & setup_parts) == PART_NONE) { continue; } border_get_part_geometry(fw, part, &sidebar_g, &part_g, &w); if (part_g.width <= 0 || part_g.height <= 0) { xwc.x = -1; xwc.y = -1; xwc.width = 1; xwc.height = 1; } else { xwc.x = part_g.x; xwc.y = part_g.y; xwc.width = part_g.width; xwc.height = part_g.height; } if (diff_g != NULL) { if (part == PART_BORDER_NE || part == PART_BORDER_E || part == PART_BORDER_SE) { xwc.x -= diff_g->width; } if (part == PART_BORDER_SW || part == PART_BORDER_S || part == PART_BORDER_SE) { xwc.y -= diff_g->height; } } XConfigureWindow(dpy, w, CWWidth | CWHeight | CWX | CWY, &xwc); } return; } static void frame_setup_titlebar( FvwmWindow *fw, rectangle *frame_g, window_parts setup_parts, rectangle *diff_g) { frame_title_layout_t title_layout; int i; if (!HAS_TITLE(fw)) { return; } frame_get_titlebar_dimensions(fw, frame_g, diff_g, &title_layout); /* configure buttons */ for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { if (FW_W_BUTTON(fw, i) != None && (setup_parts & PART_BUTTONS)) { XMoveResizeWindow( dpy, FW_W_BUTTON(fw, i), title_layout.button_g[i].x, title_layout.button_g[i].y, title_layout.button_g[i].width, title_layout.button_g[i].height); } } /* configure title */ if (setup_parts & PART_TITLE) { XMoveResizeWindow( dpy, FW_W_TITLE(fw), title_layout.title_g.x, title_layout.title_g.y, title_layout.title_g.width, title_layout.title_g.height); } return; } static void __frame_setup_window( FvwmWindow *fw, rectangle *frame_g, Bool do_send_configure_notify, Bool do_force, Bool is_application_request) { frame_move_resize_args mr_args; Bool is_resized = False; Bool is_moved = False; rectangle new_g; new_g = *frame_g; /* sanity checks */ if (new_g.width < 1) { new_g.width = 1; } if (new_g.height < 1) { new_g.height = 1; } /* set some flags */ if (new_g.width != fw->g.frame.width || new_g.height != fw->g.frame.height) { is_resized = True; } if (new_g.x != fw->g.frame.x || new_g.y != fw->g.frame.y) { is_moved = True; } /* setup the window */ if (is_resized || do_force) { frame_move_resize_mode mode; if (is_application_request) { mode = FRAME_MR_SETUP_BY_APP; } else if (do_force) { mode = FRAME_MR_FORCE_SETUP; } else { mode = FRAME_MR_SETUP; } mr_args = frame_create_move_resize_args( fw, mode, NULL, &new_g, 0, DIR_NONE); frame_move_resize(fw, mr_args); ((mr_args_internal *)mr_args)->flags.was_moved = 0; frame_free_move_resize_args(fw, mr_args); fw->g.frame = *frame_g; } else if (is_moved) { unsigned int draw_parts = PART_NONE; /* inform the application of the change * * According to the July 27, 1988 ICCCM draft, we should send a * synthetic ConfigureNotify event to the client if the window * was moved but not resized. */ XMoveWindow(dpy, FW_W_FRAME(fw), frame_g->x, frame_g->y); fw->g.frame = *frame_g; if ((draw_parts = border_get_transparent_decorations_part(fw)) != PART_NONE) { border_draw_decorations( fw, draw_parts, ((fw == get_focus_window())) ? True : False, True, CLEAR_ALL, NULL, NULL); } fw->g.frame = *frame_g; do_send_configure_notify = True; } /* must not send events to shaded windows because this might cause them * to look at their current geometry */ if (do_send_configure_notify && !IS_SHADED(fw)) { SendConfigureNotify( fw, new_g.x, new_g.y, new_g.width, new_g.height, 0, True); } /* get things updated */ XFlush(dpy); /* inform the modules of the change */ BroadcastConfig(M_CONFIGURE_WINDOW,fw); return; } static void frame_reparent_hide_windows( Window w) { int i; hide_wins.parent = w; for (i = 0; i < 4 ; i++) { if (w == Scr.Root) { XUnmapWindow(dpy, hide_wins.w[i]); } XReparentWindow(dpy, hide_wins.w[i], w, -1, -1); } if (w != Scr.Root) { XRaiseWindow(dpy, hide_wins.w[0]); XRestackWindows(dpy, hide_wins.w, 4); } return; } /* Returns True if the frame is so small that the parent window would have a * width or height smaller than one pixel. */ static Bool frame_is_parent_hidden( FvwmWindow *fw, rectangle *frame_g) { size_borders b; get_window_borders(fw, &b); if (frame_g->width <= b.total_size.width || frame_g->height <= b.total_size.height) { return True; } return False; } /* Returns the number of pixels that the title bar is too short to accomodate * all the title buttons and a title window that has at least a length of one * pixel. */ static int frame_get_titlebar_compression( FvwmWindow *fw, rectangle *frame_g) { size_borders b; int space; int need_space; if (!HAS_TITLE(fw)) { return 0; } get_window_borders(fw, &b); if (HAS_VERTICAL_TITLE(fw)) { space = frame_g->height - b.total_size.height; } else { space = frame_g->width - b.total_size.width; } need_space = (fw->nr_left_buttons + fw->nr_right_buttons) * fw->title_thickness + MIN_WINDOW_TITLE_LENGTH; if (space < need_space) { return need_space - space; } return 0; } /* Calculates the gravities for the various parts of the decor through ret_grav. * This can be passed to frame_set_decor_gravities. * * title_dir * The direction of the title in the frame. * rmode * The mode for the resize operation */ static void frame_get_resize_decor_gravities( frame_decor_gravities_type *ret_grav, direction_t title_dir, frame_move_resize_mode rmode, rectangle *delta_g) { frame_decor_gravities_type grav_x; frame_decor_gravities_type grav_y; direction_t title_dir_x; direction_t title_dir_y; gravity_split_xy_dir(&title_dir_x, &title_dir_y, title_dir); get_resize_decor_gravities_one_axis( &grav_x, title_dir_x, rmode, DIR_W, DIR_E, (delta_g->x != 0)); get_resize_decor_gravities_one_axis( &grav_y, title_dir_y, rmode, DIR_N, DIR_S, (delta_g->y != 0)); combine_gravities(ret_grav, &grav_x, &grav_y); return; } /* sets the gravity for the various parts of the window */ static void frame_set_decor_gravities( FvwmWindow *fw, frame_decor_gravities_type *grav, int do_set1_restore2_bit_gravity) { int valuemask; XSetWindowAttributes xcwa; int i; Bool button_reverted = False; /* using bit gravity can reduce redrawing dramatically */ valuemask = CWWinGravity; xcwa.win_gravity = grav->client_grav; if (do_set1_restore2_bit_gravity == 1) { XWindowAttributes xwa; if (!fw->attr_backup.is_bit_gravity_stored && XGetWindowAttributes(dpy, FW_W(fw), &xwa)) { fw->attr_backup.bit_gravity = xwa.bit_gravity; } fw->attr_backup.is_bit_gravity_stored = 1; valuemask |= CWBitGravity; xcwa.bit_gravity = grav->client_grav; } else if (do_set1_restore2_bit_gravity == 2) { fw->attr_backup.is_bit_gravity_stored = 0; valuemask |= CWBitGravity; xcwa.bit_gravity = fw->attr_backup.bit_gravity; } XChangeWindowAttributes(dpy, FW_W(fw), valuemask, &xcwa); xcwa.win_gravity = grav->parent_grav; valuemask = CWWinGravity; XChangeWindowAttributes(dpy, FW_W_PARENT(fw), valuemask, &xcwa); if (!HAS_TITLE(fw)) { return; } xcwa.win_gravity = grav->title_grav; XChangeWindowAttributes(dpy, FW_W_TITLE(fw), valuemask, &xcwa); if (fw->title_text_rotation == ROTATION_270 || fw->title_text_rotation == ROTATION_180) { button_reverted = True; } if (button_reverted) { xcwa.win_gravity = grav->rbutton_grav; } else { xcwa.win_gravity = grav->lbutton_grav; } for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i += 2) { if (FW_W_BUTTON(fw, i)) { XChangeWindowAttributes( dpy, FW_W_BUTTON(fw, i), valuemask, &xcwa); } } if (button_reverted) { xcwa.win_gravity = grav->lbutton_grav; } else { xcwa.win_gravity = grav->rbutton_grav; } for (i = 1; i < NUMBER_OF_TITLE_BUTTONS; i += 2) { if (FW_W_BUTTON(fw, i)) { XChangeWindowAttributes( dpy, FW_W_BUTTON(fw, i), valuemask, &xcwa); } } return; } /* Just restore the win and bit gravities on the client window. */ static void frame_restore_client_gravities(FvwmWindow *fw) { XSetWindowAttributes xcwa; long valuemask; valuemask = CWWinGravity; if (fw->attr_backup.is_bit_gravity_stored) { fw->attr_backup.is_bit_gravity_stored = 0; xcwa.bit_gravity = fw->attr_backup.bit_gravity; valuemask |= CWBitGravity; } xcwa.win_gravity = fw->hints.win_gravity; XChangeWindowAttributes(dpy, FW_W(fw), valuemask, &xcwa); return; } /* Prepares the structure for the next animation step. */ static void frame_next_move_resize_args( frame_move_resize_args mr_args) { mr_args_internal *mra; mra = (mr_args_internal *)mr_args; mra->curr_sidebar_g = mra->next_sidebar_g; mra->current_g = mra->next_g; mra->step_flags.was_hidden = mra->step_flags.is_hidden; mra->curr_titlebar_compression = mra->next_titlebar_compression; return; } static rectangle *frame_get_hidden_pos( FvwmWindow *fw, mr_args_internal *mra, Bool do_unhide, rectangle *ret_hidden_g) { rectangle *target_g; direction_t dir_x; direction_t dir_y; if (do_unhide == False) { gravity_split_xy_dir(&dir_x, &dir_y, mra->shade_dir); ret_hidden_g->x = (dir_x == DIR_E) ? -mra->client_g.width + mra->parent_s.width : 0; ret_hidden_g->y = (dir_y == DIR_S) ? -mra->client_g.height + mra->parent_s.height : 0; target_g = &mra->next_g; } else { gravity_split_xy_dir(&dir_x, &dir_y, SHADED_DIR(fw)); if (mra->mode == FRAME_MR_SCROLL) { ret_hidden_g->x = (dir_x == DIR_W) ? -mra->client_g.width + mra->parent_s.width : 0; ret_hidden_g->y = (dir_y == DIR_N) ? -mra->client_g.height + mra->parent_s.height : 0; } else { ret_hidden_g->x = (dir_x == DIR_E) ? -mra->client_g.width + mra->parent_s.width : 0; ret_hidden_g->y = (dir_y == DIR_S) ? -mra->client_g.height + mra->parent_s.height : 0; } target_g = &mra->next_g; } return target_g; } static void frame_update_hidden_window_pos( FvwmWindow *fw, mr_args_internal *mra, Bool do_unhide) { rectangle *target_g; rectangle hidden_g; target_g = frame_get_hidden_pos(fw, mra, do_unhide, &hidden_g); XMoveResizeWindow( dpy, FW_W_PARENT(fw), mra->b_g.top_left.width, mra->b_g.top_left.height, max(1, target_g->width - mra->b_g.total_size.width), max(1, target_g->height - mra->b_g.total_size.height)); XMoveResizeWindow( dpy, FW_W(fw), hidden_g.x, hidden_g.y, mra->client_g.width, mra->client_g.height); mra->flags.was_moved = 1; return; } static void frame_prepare_animation_shape( FvwmWindow *fw, mr_args_internal *mra, int parent_x, int parent_y) { rectangle parent_g; rectangle client_g; if (!FShapesSupported) { return; } parent_g.x = parent_x; parent_g.y = parent_y; parent_g.width = mra->parent_s.width; parent_g.height = mra->parent_s.height; gravity_move_resize_parent_child( mra->grav.parent_grav, &mra->dstep_g, &parent_g); client_g = mra->client_g; frame_get_hidden_pos(fw, mra, True, &client_g); client_g.x += parent_g.x; client_g.y += parent_g.y; FShapeCombineShape( dpy, Scr.NoFocusWin, FShapeBounding, client_g.x, client_g.y, FW_W(fw), FShapeBounding, FShapeSet); if (HAS_TITLE(fw)) { rectangle tb_g; XRectangle rect; frame_get_titlebar_dimensions_only( fw, &mra->next_g, &mra->b_no_title_g, &tb_g); /* windows w/ titles */ rect.x = tb_g.x; rect.y = tb_g.y; rect.width = tb_g.width; rect.height = tb_g.height; FShapeCombineRectangles( dpy, Scr.NoFocusWin, FShapeBounding, 0, 0, &rect, 1, FShapeUnion, Unsorted); } return; } static void frame_mrs_prepare_vars( FvwmWindow *fw, mr_args_internal *mra) { Bool dummy; int i; /* preparations */ i = mra->current_step; mra->next_g = mra->start_g; mra->next_g.x += (mra->delta_g.x * i) / mra->anim_steps; mra->next_g.y += (mra->delta_g.y * i) / mra->anim_steps; mra->next_g.width += (mra->delta_g.width * i) / mra->anim_steps; mra->next_g.height += (mra->delta_g.height * i) / mra->anim_steps; frame_get_sidebar_geometry( fw, NULL, &mra->next_g, &mra->next_sidebar_g, &dummy, &dummy); fvwmrect_subtract_rectangles( &mra->dstep_g, &mra->next_g, &mra->current_g); mra->next_titlebar_compression = frame_get_titlebar_compression(fw, &mra->next_g); mra->step_flags.is_hidden = (frame_is_parent_hidden(fw, &mra->next_g) == True); mra->step_flags.do_hide_parent = ((!mra->step_flags.was_hidden || mra->flags.do_force) && mra->step_flags.is_hidden); mra->step_flags.do_unhide_parent = ((mra->step_flags.was_hidden || mra->flags.do_force) && !mra->step_flags.is_hidden); /* get the parent's dimensions */ mra->parent_s.width = mra->next_g.width - mra->b_g.total_size.width; if (mra->parent_s.width < 1) { mra->minimal_w_offset = 1 - mra->parent_s.width; mra->parent_s.width = 1; } else { mra->minimal_w_offset = 0; } mra->parent_s.height = mra->next_g.height - mra->b_g.total_size.height; if (mra->parent_s.height < 1) { mra->minimal_h_offset = 1 - mra->parent_s.height; mra->parent_s.height = 1; } else { mra->minimal_h_offset = 0; } return; } static void frame_mrs_hide_changing_parts( mr_args_internal *mra) { int l_add; int t_add; int r_add; int b_add; int w; int h; t_add = 0; l_add = 0; b_add = 0; r_add = 0; if (mra->mode == FRAME_MR_SHRINK) { if (mra->dstep_g.x > 0) { l_add = mra->dstep_g.x; } if (mra->dstep_g.y > 0) { t_add = mra->dstep_g.y; } } else if (mra->mode == FRAME_MR_SCROLL) { if (mra->dstep_g.x == 0 && mra->dstep_g.width < 0) { l_add = -mra->dstep_g.width; } if (mra->dstep_g.y == 0 && mra->dstep_g.height < 0) { t_add = -mra->dstep_g.height; } } if (l_add > 0) { l_add -= mra->minimal_w_offset; } else { r_add = (mra->dstep_g.width < 0) ? -mra->dstep_g.width : 0; r_add -= mra->minimal_w_offset; } if (t_add > 0) { t_add -= mra->minimal_h_offset; } else { b_add = (mra->dstep_g.height < 0) ? -mra->dstep_g.height : 0; b_add -= mra->minimal_h_offset; } /* cover top border */ w = mra->current_g.width; h = mra->b_g.top_left.height + t_add; if (w > 0 && h > 0) { XMoveResizeWindow(dpy, hide_wins.w[0], 0, 0, w, h); XMapWindow(dpy, hide_wins.w[0]); } /* cover left border */ w = mra->b_g.top_left.width + l_add; h = mra->current_g.height; if (w > 0 && h > 0) { XMoveResizeWindow(dpy, hide_wins.w[1], 0, 0, w, h); XMapWindow(dpy, hide_wins.w[1]); } /* cover bottom border and possibly part of the client */ w = mra->current_g.width; h = mra->b_g.bottom_right.height + b_add; if (w > 0 && h > 0) { XMoveResizeWindow( dpy, hide_wins.w[2], 0, mra->current_g.height - mra->b_g.bottom_right.height - b_add, w, h); XMapWindow(dpy, hide_wins.w[2]); } /* cover right border and possibly part of the client */ w = mra->b_g.bottom_right.width + r_add; h = mra->current_g.height; if (w > 0 && h > 0) { XMoveResizeWindow( dpy, hide_wins.w[3], mra->current_g.width - mra->b_g.bottom_right.width - r_add, 0, w, h); XMapWindow(dpy, hide_wins.w[3]); } return; } static void frame_mrs_hide_unhide_parent( FvwmWindow *fw, mr_args_internal *mra) { XSetWindowAttributes xswa; if (mra->step_flags.do_unhide_parent) { Window w[2]; /* update the hidden position of the client */ frame_update_hidden_window_pos(fw, mra, True); w[0] = hide_wins.w[3]; w[1] = FW_W_PARENT(fw); XRestackWindows(dpy, w, 2); } else if (mra->step_flags.do_hide_parent) { /* When the parent gets hidden, unmap it automatically, lower * it while hidden, then remap it. Necessary to eliminate * flickering. */ xswa.win_gravity = UnmapGravity; XChangeWindowAttributes( dpy, FW_W_PARENT(fw), CWWinGravity, &xswa); } return; } static void frame_mrs_hide_unhide_parent2( FvwmWindow *fw, mr_args_internal *mra) { XSetWindowAttributes xswa; /* finish hiding the parent */ if (mra->step_flags.do_hide_parent) { xswa.win_gravity = mra->grav.parent_grav; XChangeWindowAttributes( dpy, FW_W_PARENT(fw), CWWinGravity, &xswa); /* update the hidden position of the client */ frame_update_hidden_window_pos(fw, mra, False); XLowerWindow(dpy, FW_W_PARENT(fw)); XMapWindow(dpy, FW_W_PARENT(fw)); } return; } static void frame_mrs_setup_draw_decorations( FvwmWindow *fw, mr_args_internal *mra) { window_parts setup_parts; /* setup the title bar and the border */ setup_parts = PART_TITLE; if (mra->curr_titlebar_compression != mra->next_titlebar_compression || mra->mode == FRAME_MR_FORCE_SETUP) { setup_parts |= PART_BUTTONS; } frame_setup_titlebar(fw, &mra->next_g, setup_parts, &mra->dstep_g); frame_setup_border(fw, &mra->next_g, PART_ALL, &mra->dstep_g); /* draw the border and the titlebar */ if (mra->flags.do_not_draw == 1) { /* nothing */ } else if (!mra->flags.is_shading || !mra->flags.is_lazy_shading) { /* draw as usual */ border_draw_decorations( fw, PART_ALL, (mra->w_with_focus != None) ? True : False, (mra->flags.do_force) ? True : False, CLEAR_ALL, &mra->current_g, &mra->next_g); } else /* lazy shading */ { /* Lazy shading relies on the proper window gravities and does * not redraw the decorations during the animation. Only draw * on the first step. */ if (mra->current_step == 1) { rectangle lazy_g; /* Use the larger width and height values from the * current and the final geometry to get proper * decorations. */ lazy_g.x = mra->current_g.x; lazy_g.y = mra->current_g.y; lazy_g.width = max( mra->current_g.width, mra->end_g.width); lazy_g.height = max( mra->current_g.height, mra->end_g.height); border_draw_decorations( fw, PART_ALL, (mra->w_with_focus != None) ? True : False, True, CLEAR_ALL, &mra->current_g, &lazy_g); } } return; } static void frame_mrs_resize_move_windows( FvwmWindow *fw, mr_args_internal *mra) { /* setup the parent, the frame and the client window */ if (!mra->flags.is_shading) { if (!mra->step_flags.is_hidden && !mra->flags.do_not_configure_client) { XMoveResizeWindow( dpy, FW_W(fw), 0, 0, mra->parent_s.width, mra->parent_s.height); mra->client_g.width = mra->parent_s.width; mra->client_g.height = mra->parent_s.height; } else { XMoveWindow(dpy, FW_W(fw), 0, 0); } mra->flags.was_moved = 1; #if 0 /* reduces flickering */ /* dv (11-Aug-2002): ... and slows down large scripts * dramatically. Rather let it flicker */ if (mra->flags.is_setup) { usleep(1000); } #endif XSync(dpy, 0); XMoveResizeWindow( dpy, FW_W_PARENT(fw), mra->b_g.top_left.width, mra->b_g.top_left.height, mra->parent_s.width, mra->parent_s.height); } else { int x; int y; x = mra->b_g.top_left.width; y = mra->b_g.top_left.height; if (mra->mode == FRAME_MR_SCROLL) { if (mra->dstep_g.x == 0) { x -= mra->dstep_g.width - mra->minimal_w_offset; } if (mra->dstep_g.y == 0) { y -= mra->dstep_g.height - mra->minimal_h_offset;; } } else if (mra->mode == FRAME_MR_SHRINK) { x += mra->dstep_g.x; y += mra->dstep_g.y; } if (x > 0) { x -= mra->minimal_w_offset; } else if (x < 0) { x += mra->minimal_w_offset; } if (y > 0) { y -= mra->minimal_h_offset; } else if (y < 0) { y += mra->minimal_h_offset; } XMoveResizeWindow( dpy, FW_W_PARENT(fw), x, y, mra->parent_s.width, mra->parent_s.height); if (mra->flags.do_update_shape) { /* Step 1: apply the union of the old and new shapes. * This way so that the client stays visible - rather * let the background show through than force an * Expose event. */ frame_prepare_animation_shape(fw, mra, x, y); FShapeCombineShape( dpy, FW_W_FRAME(fw), FShapeBounding, 0, 0, Scr.NoFocusWin, FShapeBounding, FShapeUnion); } } XMoveResizeWindow( dpy, FW_W_FRAME(fw), mra->next_g.x, mra->next_g.y, mra->next_g.width, mra->next_g.height); if (mra->flags.do_update_shape) { /* Step 2: clip the previous shape. */ FShapeCombineShape( dpy, FW_W_FRAME(fw), FShapeBounding, 0, 0, Scr.NoFocusWin, FShapeBounding, FShapeSet); } return; } static void frame_move_resize_step( FvwmWindow *fw, mr_args_internal *mra) { frame_mrs_prepare_vars(fw, mra); frame_mrs_hide_changing_parts(mra); frame_mrs_hide_unhide_parent(fw, mra); frame_mrs_setup_draw_decorations(fw, mra); frame_mrs_resize_move_windows(fw, mra); frame_mrs_hide_unhide_parent2(fw, mra); fw->g.frame = mra->next_g; return; } static void frame_has_handles_and_tiled_border( FvwmWindow *fw, int *ret_has_handles, int *ret_has_tiled_border) { DecorFace *df; *ret_has_handles = 1; if (!HAS_HANDLES(fw)) { *ret_has_handles = 0; } df = border_get_border_style(fw, (fw == Scr.Hilite) ? True : False); if (DFS_HAS_HIDDEN_HANDLES(df->style)) { *ret_has_handles = 0; } *ret_has_tiled_border = (DFS_FACE_TYPE(df->style) == TiledPixmapButton) || (DFS_FACE_TYPE(df->style) == ColorsetButton && !CSET_IS_TRANSPARENT_PR(df->u.acs.cs) && CSET_HAS_PIXMAP(df->u.acs.cs)); return; } static int frame_get_shading_laziness( FvwmWindow *fw, mr_args_internal *mra) { int has_handles; int has_tiled_pixmap_border; int using_border_style; if (!mra->flags.is_shading || mra->anim_steps <= 2) { return 0; } frame_has_handles_and_tiled_border( fw, &has_handles, &has_tiled_pixmap_border); if (HAS_TITLE(fw) && has_tiled_pixmap_border) { using_border_style = border_is_using_border_style( fw, (fw == Scr.Hilite) ? True : False); } else { using_border_style = 0; } switch (WINDOWSHADE_LAZINESS(fw)) { case WINDOWSHADE_ALWAYS_LAZY: return 1; case WINDOWSHADE_BUSY: if (has_handles) { return 0; } /* fall through */ case WINDOWSHADE_LAZY: default: if (has_tiled_pixmap_border && !HAS_NO_BORDER(fw)) { return 0; } else if (has_tiled_pixmap_border && HAS_TITLE(fw) && using_border_style) { return 0; } return 1; } } void frame_reshape_border(FvwmWindow *fw) { int grav; int off_x = 0; int off_y = 0; rectangle naked_g; rectangle *new_g; /* calculate the new offsets */ if (!IS_MAXIMIZED(fw)) { grav = fw->hints.win_gravity; new_g = &fw->g.normal; } else { /* maximized windows are always considered to have * NorthWestGravity */ grav = NorthWestGravity; new_g = &fw->g.max; off_x = fw->g.normal.x - fw->g.max.x; off_y = fw->g.normal.y - fw->g.max.y; } gravity_get_naked_geometry(grav, fw, &naked_g, new_g); gravity_translate_to_northwest_geometry_no_bw( grav, fw, &naked_g, &naked_g); set_window_border_size(fw, fw->unshaped_boundary_width); gravity_add_decoration(grav, fw, new_g, &naked_g); if (IS_MAXIMIZED(fw)) { /* prevent random paging when unmaximizing after the border * width has changed */ fw->g.max_offset.x += fw->g.normal.x - fw->g.max.x - off_x; fw->g.max_offset.y += fw->g.normal.y - fw->g.max.y - off_y; } if (IS_SHADED(fw)) { get_unshaded_geometry(fw, new_g); if (USED_TITLE_DIR_FOR_SHADING(fw)) { SET_SHADED_DIR(fw, GET_TITLE_DIR(fw)); } get_shaded_geometry(fw, &fw->g.frame, new_g); frame_force_setup_window( fw, fw->g.frame.x, fw->g.frame.y, fw->g.frame.width, fw->g.frame.height, False); } else { get_relative_geometry(new_g, new_g); frame_force_setup_window( fw, new_g->x, new_g->y, new_g->width, new_g->height, True); } return; } /* ---------------------------- interface functions ------------------------ */ /* Initialise structures local to frame.c */ void frame_init(void) { XSetWindowAttributes xswa; unsigned long valuemask; int i; xswa.override_redirect = True; xswa.backing_store = NotUseful; xswa.save_under = False; xswa.win_gravity = UnmapGravity; xswa.background_pixmap = None; valuemask = CWOverrideRedirect | CWSaveUnder | CWBackingStore | CWBackPixmap | CWWinGravity; hide_wins.parent = Scr.Root; for (i = 0; i < 4; i++) { hide_wins.w[i] = XCreateWindow( dpy, Scr.Root, -1, -1, 1, 1, 0, CopyFromParent, InputOutput, CopyFromParent, valuemask, &xswa); if (hide_wins.w[i] == None) { fvwm_msg(ERR, "frame_init", "Could not create internal windows. Exiting"); MyXUngrabServer(dpy); exit(1); } } return; } Bool is_frame_hide_window( Window w) { int i; if (w == None) { return False; } for (i = 0; i < 4; i++) { if (w == hide_wins.w[i]) { return True; } } return False; } void frame_destroyed_frame( Window frame_w) { if (hide_wins.parent == frame_w) { /* Oops, the window containing the hide windows was destroyed! * Let it die and create them from scratch. */ frame_init(); } return; } void frame_get_titlebar_dimensions( FvwmWindow *fw, rectangle *frame_g, rectangle *diff_g, frame_title_layout_t *title_layout) { size_borders b; int i; int tb_length; int tb_thick; int tb_x; int tb_y; int b_length; int b_w; int b_h; int t_length; int t_w; int t_h; int br_sub; int nbuttons; int nbuttons_big; int *padd_coord; int *b_l; Bool revert_button = False; if (!HAS_TITLE(fw)) { return; } get_window_borders_no_title(fw, &b); if (HAS_VERTICAL_TITLE(fw)) { tb_length = frame_g->height - b.total_size.height; } else { tb_length = frame_g->width - b.total_size.width; } /* find out the length of the title and the buttons */ tb_thick = fw->title_thickness; nbuttons = fw->nr_left_buttons + fw->nr_right_buttons; nbuttons_big = 0; b_length = tb_thick; t_length = tb_length - nbuttons * b_length; if (nbuttons > 0 && t_length < MIN_WINDOW_TITLE_LENGTH) { int diff = MIN_WINDOW_TITLE_LENGTH - t_length; int pixels = diff / nbuttons; b_length -= pixels; t_length += nbuttons * pixels; nbuttons_big = nbuttons - (MIN_WINDOW_TITLE_LENGTH - t_length); t_length = MIN_WINDOW_TITLE_LENGTH; } if (b_length < MIN_WINDOW_TITLEBUTTON_LENGTH) { /* don't draw the buttons */ nbuttons = 0; nbuttons_big = 0; b_length = 0; t_length = tb_length; } if (t_length < 0) { t_length = 0; } fw->title_length = t_length; /* prepare variables */ if (HAS_VERTICAL_TITLE(fw)) { tb_y = b.top_left.height; br_sub = (diff_g != NULL) ? diff_g->height : 0; if (GET_TITLE_DIR(fw) == DIR_W) { tb_x = b.top_left.width; } else { tb_x = frame_g->width - b.bottom_right.width - tb_thick; if (diff_g != NULL) { tb_x -= diff_g->width; } } padd_coord = &tb_y; b_w = tb_thick; b_h = b_length; t_w = tb_thick; t_h = t_length; b_l = &b_h; } else { tb_x = b.top_left.width; br_sub = (diff_g != NULL) ? diff_g->width : 0; if (GET_TITLE_DIR(fw) == DIR_N) { tb_y = b.top_left.height; } else { tb_y = frame_g->height - b.bottom_right.height - tb_thick; if (diff_g != NULL) { tb_y -= diff_g->height; } } padd_coord = &tb_x; b_w = b_length; b_h = tb_thick; t_w = t_length; t_h = tb_thick; b_l = &b_w; } if (fw->title_text_rotation == ROTATION_270 || fw->title_text_rotation == ROTATION_180) { revert_button = True; } /* configure left buttons */ for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { if ((revert_button && !(i & 1)) || (!revert_button && (i & 1)) || FW_W_BUTTON(fw, i) == None) { continue; } if (b_length <= 0) { title_layout->button_g[i].x = -1; title_layout->button_g[i].y = -1; title_layout->button_g[i].width = 1; title_layout->button_g[i].height = 1; } else { title_layout->button_g[i].x = tb_x; title_layout->button_g[i].y = tb_y; title_layout->button_g[i].width = b_w; title_layout->button_g[i].height = b_h; } *padd_coord += b_length; nbuttons_big--; if (nbuttons_big == 0) { b_length--; (*b_l)--; } } /* configure title */ if (t_length == 0) { title_layout->title_g.x = -1; title_layout->title_g.y = -1; title_layout->title_g.width = 1; title_layout->title_g.height = 1; } else { title_layout->title_g.x = tb_x; title_layout->title_g.y = tb_y; title_layout->title_g.width = t_w; title_layout->title_g.height = t_h; } *padd_coord += t_length; /* configure right buttons */ *padd_coord -= br_sub; for (i = NUMBER_OF_TITLE_BUTTONS-1; i > -1; i--) { if ((revert_button && (i & 1)) || (!revert_button && !(i & 1)) || FW_W_BUTTON(fw, i) == None) { continue; } if (b_length <= 0) { title_layout->button_g[i].x = -1; title_layout->button_g[i].y = -1; title_layout->button_g[i].width = 1; title_layout->button_g[i].height = 1; } else { title_layout->button_g[i].x = tb_x; title_layout->button_g[i].y = tb_y; title_layout->button_g[i].width = b_w; title_layout->button_g[i].height = b_h; } *padd_coord += b_length; nbuttons_big--; if (nbuttons_big == 0) { b_length--; (*b_l)--; } } return; } void frame_get_sidebar_geometry( FvwmWindow *fw, DecorFaceStyle *borderstyle, rectangle *frame_g, rectangle *ret_g, Bool *ret_has_x_marks, Bool *ret_has_y_marks) { int min_w; size_borders b; ret_g->x = 0; ret_g->y = 0; ret_g->width = 0; ret_g->height = 0; *ret_has_x_marks = False; *ret_has_y_marks = False; if (HAS_NO_BORDER(fw)) { return; } /* get the corner size */ if (!HAS_HANDLES(fw)) { *ret_has_x_marks = False; *ret_has_y_marks = False; } else if (borderstyle == NULL) { if (fw->decor_state.parts_drawn & PART_X_HANDLES) { *ret_has_x_marks = True; } if (fw->decor_state.parts_drawn & PART_Y_HANDLES) { *ret_has_y_marks = True; } } else if (!DFS_HAS_HIDDEN_HANDLES(*borderstyle)) { *ret_has_x_marks = True; *ret_has_y_marks = True; } ret_g->x = fw->corner_width; ret_g->y = fw->corner_width; min_w = 2 * fw->corner_width + 4; /* limit by available space, remove handle marks if necessary */ if (frame_g->width < min_w) { ret_g->x = frame_g->width / 3; *ret_has_y_marks = False; } if (frame_g->height < min_w) { ret_g->y = frame_g->height / 3; *ret_has_x_marks = False; } get_window_borders_no_title(fw, &b); if (ret_g->x < b.top_left.width) { ret_g->x = b.top_left.width; } if (ret_g->y < b.top_left.height) { ret_g->y = b.top_left.height; } /* length of the side bars */ ret_g->width = frame_g->width - 2 * ret_g->x; ret_g->height = frame_g->height - 2 * ret_g->y; return; } int frame_window_id_to_context( FvwmWindow *fw, Window w, int *ret_num) { int context = C_ROOT; *ret_num = -1; if (fw == NULL || w == None) { return C_ROOT; } if (w == FW_W_TITLE(fw)) { context = C_TITLE; } else if (Scr.EwmhDesktop && (w == FW_W(Scr.EwmhDesktop) || w == FW_W_PARENT(Scr.EwmhDesktop) || w == FW_W_FRAME(Scr.EwmhDesktop))) { context = C_EWMH_DESKTOP; } else if (w == FW_W(fw) || w == FW_W_PARENT(fw) || w == FW_W_FRAME(fw)) { context = C_WINDOW; } else if (w == FW_W_ICON_TITLE(fw) || w == FW_W_ICON_PIXMAP(fw)) { context = C_ICON; } else if (w == FW_W_CORNER(fw, 0)) { *ret_num = 0; context = C_F_TOPLEFT; } else if (w == FW_W_CORNER(fw, 1)) { *ret_num = 1; context = C_F_TOPRIGHT; } else if (w == FW_W_CORNER(fw, 2)) { *ret_num = 2; context = C_F_BOTTOMLEFT; } else if (w == FW_W_CORNER(fw, 3)) { *ret_num = 3; context = C_F_BOTTOMRIGHT; } else if (w == FW_W_SIDE(fw, 0)) { *ret_num = 0; context = C_SB_TOP; } else if (w == FW_W_SIDE(fw, 1)) { *ret_num = 1; context = C_SB_RIGHT; } else if (w == FW_W_SIDE(fw, 2)) { *ret_num = 2; context = C_SB_BOTTOM; } else if (w == FW_W_SIDE(fw, 3)) { *ret_num = 3; context = C_SB_LEFT; } else { int i; for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { if (w == FW_W_BUTTON(fw, i) && ((!(i & 1) && i / 2 < Scr.nr_left_buttons) || ( (i & 1) && i / 2 < Scr.nr_right_buttons))) { context = (1 << i) * C_L1; *ret_num = i; break; } } } if (!HAS_HANDLES(fw) && (context & (C_SIDEBAR | C_FRAME))) { context = C_SIDEBAR; } return context; } /* Creates a structure that must be passed to frame_move_resize(). The * structure *must* be deleted with frame_free_move_resize_args() as soon as the * move or resize operation is finished. Prepares the window for a move/resize * operation. * * Arguments: * fw * The window to move or resize. * mr_mode * The mode of operation: * FRAME_MR_SETUP: setup the frame * FRAME_MR_FORCE_SETUP: same, but forces all updates * FRAME_MR_OPAQUE: resize the frame in an opaque fashion * FRAME_MR_SHRINK: shrink the client window (useful for shading only) * FRAME_MR_SCROLL: scroll the client window (useful for shading only) * start_g * The initial geometry of the frame. If a NULL pointer is passed, the * frame_g member of the window is used instead. * end_g * The desired new geometry of the frame. * anim_steps * The number of animation steps in between * = 0: The operation is finished in a single step. * > 0: The given number of steps are drawn in between. * < 0: Each step resizes the window by the given number of pixels. * (the sign of the number is flipped first). * This argument is used only with FRAME_MR_SHRINK and FRAME_MR_SCROLL. */ frame_move_resize_args frame_create_move_resize_args( FvwmWindow *fw, frame_move_resize_mode mr_mode, rectangle *start_g, rectangle *end_g, int anim_steps, int shade_dir) { mr_args_internal *mra; Bool dummy; Bool rc; int whdiff; int xydiff; int diff; /* set some variables */ mra = (mr_args_internal *)safecalloc(1, sizeof(mr_args_internal)); memset(mra, 0, sizeof(*mra)); if (mr_mode & FRAME_MR_DONT_DRAW) { mr_mode &= ~FRAME_MR_DONT_DRAW; mra->flags.do_not_draw = 1; } else { mra->flags.do_not_draw = 0; } if (mr_mode == FRAME_MR_SETUP_BY_APP) { mr_mode = FRAME_MR_SETUP; mra->flags.do_set_bit_gravity = 0; } else { mra->flags.do_set_bit_gravity = 1; } if (mr_mode == FRAME_MR_FORCE_SETUP_NO_W) { mr_mode = FRAME_MR_FORCE_SETUP; mra->flags.do_not_configure_client = 1; } mra->mode = mr_mode; mra->shade_dir = (direction_t)shade_dir; mra->w_with_focus = (fw == get_focus_window()) ? FW_W(fw) : None; /* calculate various geometries */ if (!IS_SHADED(fw)) { rc = XGetGeometry( dpy, FW_W(fw), &JunkRoot, &mra->client_g.x, &mra->client_g.y, (unsigned int*)&mra->client_g.width, (unsigned int*)&mra->client_g.height, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth); if (rc == True) { rc = XTranslateCoordinates( dpy, FW_W_PARENT(fw), Scr.Root, mra->client_g.x, mra->client_g.y, &mra->client_g.x, &mra->client_g.y, &JunkChild); } if (rc == False) { /* Can only happen if the window died */ get_client_geometry(fw, &mra->client_g); } } else { /* If the window was reisez while shaded the client window * will not have been resized. Use the frame to get the * geometry */ get_client_geometry(fw, &mra->client_g); } get_window_borders(fw, &mra->b_g); get_window_borders_no_title(fw, &mra->b_no_title_g); mra->start_g = (start_g != NULL) ? *start_g : fw->g.frame; frame_get_sidebar_geometry( fw, NULL, &mra->start_g, &mra->curr_sidebar_g, &dummy, &dummy); mra->end_g = *end_g; mra->current_g = mra->start_g; mra->next_g = mra->end_g; mra->curr_titlebar_compression = frame_get_titlebar_compression(fw, &mra->start_g); fvwmrect_subtract_rectangles( &mra->delta_g, &mra->end_g, &mra->start_g); /* calcuate the number of animation steps */ switch (mra->mode) { case FRAME_MR_SHRINK: case FRAME_MR_SCROLL: whdiff = max(abs(mra->delta_g.width), abs(mra->delta_g.height)); xydiff = max(abs(mra->delta_g.x), abs(mra->delta_g.y)); diff = max(whdiff, xydiff); if (diff == 0) { mra->anim_steps = 0; } else if (anim_steps < 0) { mra->anim_steps = -(diff - 1) / anim_steps; } else if (anim_steps > 0 && anim_steps >= diff) { mra->anim_steps = diff - 1; } else { mra->anim_steps = anim_steps; } mra->anim_steps++; break; case FRAME_MR_FORCE_SETUP: case FRAME_MR_SETUP: case FRAME_MR_OPAQUE: default: mra->anim_steps = 1; break; } /* various flags */ mra->flags.was_moved = 0; mra->step_flags.was_hidden = (frame_is_parent_hidden(fw, &mra->start_g) == True); mra->flags.is_setup = (mra->mode == FRAME_MR_FORCE_SETUP || mra->mode == FRAME_MR_SETUP); mra->flags.do_force = (mra->mode == FRAME_MR_FORCE_SETUP); mra->flags.is_shading = !(mra->flags.is_setup || mra->mode == FRAME_MR_OPAQUE); mra->flags.do_update_shape = (FShapesSupported && mra->flags.is_shading && fw->wShaped); /* Lazy shading does not draw the hadle marks. Disable them in the * window flags if necessary. Restores the marks when mr_args are * freed. Lazy shading is considerably faster but causes funny looks * if either the border uses a tiled pixmap background. */ mra->flags.had_handles = HAS_HANDLES(fw); mra->flags.is_lazy_shading = frame_get_shading_laziness(fw, mra); mra->trans_parts = border_get_transparent_decorations_part(fw); if (mra->flags.is_lazy_shading) { SET_HAS_HANDLES(fw, 0); } /* Set gravities for the window parts. */ frame_get_resize_decor_gravities( &mra->grav, GET_TITLE_DIR(fw), mra->mode, &mra->delta_g); if (mra->flags.is_setup && mra->delta_g.x == 0 && mra->delta_g.y == 0 && mra->delta_g.width == 0 && mra->delta_g.height == 0) { frame_decor_gravities_type grav; /* The caller has already set the frame geometry. Use * StaticGravity so the sub windows are not moved to funny * places. */ grav.decor_grav = StaticGravity; grav.title_grav = StaticGravity; grav.lbutton_grav = StaticGravity; grav.rbutton_grav = StaticGravity; grav.parent_grav = StaticGravity; grav.client_grav = StaticGravity; frame_set_decor_gravities( fw, &grav, (mra->flags.do_set_bit_gravity) ? 1 : 0); mra->flags.do_restore_gravity = 1; mra->flags.do_force = 1; } else { frame_set_decor_gravities( fw, &mra->grav, (mra->flags.do_set_bit_gravity) ? 1 : 0); } frame_reparent_hide_windows(FW_W_FRAME(fw)); return (frame_move_resize_args)mra; } /* Changes the final_geometry in a frame_move_resize_args structure. This is * useful during opaque resize operations to avoid creating and destroying the * args for each animation step. * * If FRAME_MR_SHRINK or FRAME_MR_SCROLL was used to greate the mr_args, the * function does nothing. */ void frame_update_move_resize_args( frame_move_resize_args mr_args, rectangle *end_g) { mr_args_internal *mra; mra = (mr_args_internal *)mr_args; mra->end_g = *end_g; fvwmrect_subtract_rectangles( &mra->delta_g, &mra->end_g, &mra->start_g); return; } /* Destroys the structure allocated with frame_create_move_resize_args(). Does * some clean up operations on the modified window first. */ void frame_free_move_resize_args( FvwmWindow *fw, frame_move_resize_args mr_args) { mr_args_internal *mra; mra = (mr_args_internal *)mr_args; SET_HAS_HANDLES(fw, mra->flags.had_handles); fw->g.frame = mra->end_g; if (mra->flags.is_lazy_shading) { border_draw_decorations( fw, PART_ALL, (mra->w_with_focus != None) ? True : False, True, CLEAR_ALL, &mra->current_g, &mra->end_g); } else if (mra->trans_parts != PART_NONE) { border_draw_decorations( fw, mra->trans_parts, (mra->w_with_focus != None) ? True : False, True, CLEAR_ALL, &mra->current_g, &mra->end_g); } update_absolute_geometry(fw); frame_reparent_hide_windows(Scr.NoFocusWin); if (mra->w_with_focus != None) { /* domivogt (28-Dec-1999): For some reason the XMoveResize() on * the frame window removes the input focus from the client * window. I have no idea why, but if we explicitly restore * the focus here everything works fine. */ FOCUS_SET(mra->w_with_focus); } if (mra->flags.do_update_shape) { /* unset shape */ FShapeCombineMask( dpy, FW_W_FRAME(fw), FShapeBounding, 0, 0, None, FShapeSet); } frame_setup_shape(fw, mra->end_g.width, mra->end_g.height, fw->wShaped); if (mra->flags.do_restore_gravity) { /* TA: 2011-09-04: There might be a chance some clients with * a gravity other than Static (such as non-NW gravity) * might not react well -- but setting the gravity to the * main window hint will break clients being remapped as * subwindows, c.f. XEmbed. * * Note that we should probably consider handling * GravityNotify events ourselves, since we already set * StructureNotify and SubstructureNotify events on * FW_W_PARENT for example. * * mra->grav.client_grav = fw->hints.win_gravity; */ frame_set_decor_gravities( fw, &mra->grav, (mra->flags.do_set_bit_gravity) ? 2 : 0); } else { frame_restore_client_gravities(fw); } if (!IS_SHADED(fw) && mra->flags.was_moved) { SendConfigureNotify( fw, fw->g.frame.x, fw->g.frame.y, fw->g.frame.width, fw->g.frame.height, 0, True); mra->flags.was_moved = 0; } focus_grab_buttons_on_layer(fw->layer); /* free the memory */ free(mr_args); return; } void frame_move_resize( FvwmWindow *fw, frame_move_resize_args mr_args) { mr_args_internal *mra; Bool is_grabbed = False; int i; mra = (mr_args_internal *)mr_args; /* freeze the cursor shape; otherwise it may flash to a different shape * during the animation */ if (mra->anim_steps > 1) { is_grabbed = GrabEm(None, GRAB_FREEZE_CURSOR); } /* animation */ for (i = 1; i <= mra->anim_steps; i++, frame_next_move_resize_args(mra)) { mra->current_step = i; frame_move_resize_step(fw, mra); } if (is_grabbed == True) { UngrabEm(GRAB_FREEZE_CURSOR); } return; } /*********************************************************************** * * Procedure: * frame_setup_window - set window sizes * * Inputs: * fw - the FvwmWindow pointer * x - the x coordinate of the upper-left outer corner of the frame * y - the y coordinate of the upper-left outer corner of the frame * w - the width of the frame window w/o border * h - the height of the frame window w/o border * * Special Considerations: * This routine will check to make sure the window is not completely * off the display, if it is, it'll bring some of it back on. * * The fw->frame_XXX variables should NOT be updated with the * values of x,y,w,h prior to calling this routine, since the new * values are compared against the old to see whether a synthetic * ConfigureNotify event should be sent. (It should be sent if the * window was moved but not resized.) * ************************************************************************/ void frame_setup_window( FvwmWindow *fw, int x, int y, int w, int h, Bool do_send_configure_notify) { rectangle g; g.x = x; g.y = y; g.width = w; g.height = h; __frame_setup_window(fw, &g, do_send_configure_notify, False, False); return; } void frame_setup_window_app_request( FvwmWindow *fw, int x, int y, int w, int h, Bool do_send_configure_notify) { rectangle g; g.x = x; g.y = y; g.width = w; g.height = h; __frame_setup_window(fw, &g, do_send_configure_notify, False, True); return; } void frame_force_setup_window( FvwmWindow *fw, int x, int y, int w, int h, Bool do_send_configure_notify) { rectangle g; g.x = x; g.y = y; g.width = w; g.height = h; __frame_setup_window(fw, &g, do_send_configure_notify, True, False); return; } /**************************************************************************** * * Sets up the shaped window borders * ****************************************************************************/ void frame_setup_shape(FvwmWindow *fw, int w, int h, int shape_mode) { XRectangle rect; rectangle r; size_borders b; if (!FShapesSupported) { return; } if (fw->wShaped != shape_mode) { fw->wShaped = shape_mode; frame_reshape_border(fw); } if (!shape_mode) { /* unset shape */ FShapeCombineMask( dpy, FW_W_FRAME(fw), FShapeBounding, 0, 0, None, FShapeSet); } else { /* shape the window */ get_window_borders(fw, &b); FShapeCombineShape( dpy, FW_W_FRAME(fw), FShapeBounding, b.top_left.width, b.top_left.height, FW_W(fw), FShapeBounding, FShapeSet); if (FW_W_TITLE(fw)) { /* windows w/ titles */ r.width = w; r.height = h; get_title_geometry(fw, &r); rect.x = r.x; rect.y = r.y; rect.width = r.width; rect.height = r.height; FShapeCombineRectangles( dpy, FW_W_FRAME(fw), FShapeBounding, 0, 0, &rect, 1, FShapeUnion, Unsorted); } } return; } /* ---------------------------- builtin commands --------------------------- */ fvwm-2.6.5.orig/fvwm/borders.h0000644000175000017500000000403207677641663014437 0ustar vwcvwc/* -*-c-*- */ #ifndef _BORDERS_H #define _BORDERS_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ #define NPARTS_KEEP_STATE 12 /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef enum { PART_NONE = 0x0, /* the border drawing code relies on the fact that the border bits * occupy the lowest ten bits in this order! */ PART_BORDER_N = 0x1, PART_BORDER_S = 0x2, PART_BORDER_E = 0x4, PART_BORDER_W = 0x8, PART_BORDER_NW = 0x10, PART_BORDER_NE = 0x20, PART_BORDER_SW = 0x40, PART_BORDER_SE = 0x80, PART_TITLE = 0x100, PART_BUTTONS = 0x200, PART_X_HANDLES = 0x400, PART_Y_HANDLES = 0x800, /* combinations of the above values */ PART_SIDES = 0x0f, PART_CORNERS = 0xf0, PART_FRAME = 0xff, PART_TITLEBAR = 0x300, PART_HANDLES = 0xc00, PART_ALL = 0xfff } window_parts; typedef enum { CLEAR_NONE = 0x0, CLEAR_FRAME = 0x1, CLEAR_TITLE = 0x2, CLEAR_BUTTONS = 0x4, CLEAR_ALL = 0x7 } clear_window_parts; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ DecorFace *border_get_border_style( FvwmWindow *fw, Bool has_focus); int border_is_using_border_style( FvwmWindow *fw, Bool has_focus); int border_context_to_parts( int context); void border_get_part_geometry( FvwmWindow *fw, window_parts part, rectangle *sidebar_g, rectangle *ret_g, Window *ret_w); int get_button_number(int context); void border_draw_decorations( FvwmWindow *t, window_parts draw_parts, Bool has_focus, int force, clear_window_parts clear_parts, rectangle *old_g, rectangle *new_g); void border_undraw_decorations( FvwmWindow *fw); void border_redraw_decorations( FvwmWindow *fw); unsigned int border_get_transparent_decorations_part( FvwmWindow *fw); #endif /* _BORDERS_H */ fvwm-2.6.5.orig/fvwm/focus_policy.c0000644000175000017500000001242507677641663015475 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Note: focus_policy.[ch] is meant to manage structures of type focus_policy_t * only. No code dealing with *any* external data types belongs in here! Put * it in focus.[ch] instead. */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "focus_policy.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ /* Initialise focus policy to the system defaults */ void fpol_init_default_fp(focus_policy_t *fp) { memset(fp, 0, sizeof(focus_policy_t)); FPS_FOCUS_ENTER(*fp, DEF_FP_FOCUS_ENTER); FPS_UNFOCUS_LEAVE(*fp, DEF_FP_UNFOCUS_LEAVE); FPS_FOCUS_CLICK_CLIENT(*fp, DEF_FP_FOCUS_CLICK_CLIENT); FPS_FOCUS_CLICK_DECOR(*fp, DEF_FP_FOCUS_CLICK_DECOR); FPS_FOCUS_BY_PROGRAM(*fp, DEF_FP_FOCUS_BY_PROGRAM); FPS_FOCUS_BY_FUNCTION(*fp, DEF_FP_FOCUS_BY_FUNCTION); FPS_WARP_POINTER_ON_FOCUS_FUNC(*fp, DEF_FP_WARP_POINTER_ON_FOCUS_FUNC); FPS_LENIENT(*fp, DEF_FP_LENIENT); FPS_RAISE_FOCUSED_CLIENT_CLICK(*fp, DEF_FP_RAISE_FOCUSED_CLIENT_CLICK); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( *fp, DEF_FP_RAISE_UNFOCUSED_CLIENT_CLICK); FPS_RAISE_FOCUSED_DECOR_CLICK( *fp, DEF_FP_RAISE_FOCUSED_DECOR_CLICK); FPS_RAISE_UNFOCUSED_DECOR_CLICK( *fp, DEF_FP_RAISE_UNFOCUSED_DECOR_CLICK); FPS_RAISE_FOCUSED_ICON_CLICK( *fp, DEF_FP_RAISE_FOCUSED_ICON_CLICK); FPS_RAISE_UNFOCUSED_ICON_CLICK( *fp, DEF_FP_RAISE_UNFOCUSED_ICON_CLICK); FPS_MOUSE_BUTTONS(*fp, DEF_FP_MOUSE_BUTTONS); FPS_MODIFIERS(*fp, DEF_FP_MODIFIERS); FPS_PASS_FOCUS_CLICK(*fp, DEF_FP_PASS_FOCUS_CLICK); FPS_PASS_RAISE_CLICK(*fp, DEF_FP_PASS_RAISE_CLICK); FPS_IGNORE_FOCUS_CLICK_MOTION(*fp, DEF_FP_IGNORE_FOCUS_CLICK_MOTION); FPS_IGNORE_RAISE_CLICK_MOTION(*fp, DEF_FP_IGNORE_RAISE_CLICK_MOTION); FPS_ALLOW_FUNC_FOCUS_CLICK(*fp, DEF_FP_ALLOW_FUNC_FOCUS_CLICK); FPS_ALLOW_FUNC_RAISE_CLICK(*fp, DEF_FP_ALLOW_FUNC_RAISE_CLICK); FPS_GRAB_FOCUS(*fp, DEF_FP_GRAB_FOCUS); FPS_GRAB_FOCUS_TRANSIENT(*fp, DEF_FP_GRAB_FOCUS_TRANSIENT); FPS_OVERRIDE_GRAB_FOCUS(*fp, DEF_FP_OVERRIDE_GRAB_FOCUS); FPS_RELEASE_FOCUS(*fp, DEF_FP_RELEASE_FOCUS); FPS_RELEASE_FOCUS_TRANSIENT(*fp, DEF_FP_RELEASE_FOCUS_TRANSIENT); FPS_OVERRIDE_RELEASE_FOCUS(*fp, DEF_FP_OVERRIDE_RELEASE_FOCUS); FPS_SORT_WINDOWLIST_BY(*fp, DEF_FP_SORT_WINDOWLIST_BY); return; } int fpol_query_allow_set_focus( focus_policy_t *fpol, fpol_set_focus_by_t set_by_mode) { switch (set_by_mode) { case FOCUS_SET_BY_ENTER: return FP_DO_FOCUS_ENTER(*fpol); case FOCUS_SET_BY_CLICK_CLIENT: return FP_DO_FOCUS_CLICK_CLIENT(*fpol); case FOCUS_SET_BY_CLICK_DECOR: return FP_DO_FOCUS_CLICK_DECOR(*fpol); case FOCUS_SET_BY_CLICK_ICON: return FP_DO_FOCUS_CLICK_ICON(*fpol); case FOCUS_SET_BY_PROGRAM: return FP_DO_FOCUS_BY_PROGRAM(*fpol); case FOCUS_SET_BY_FUNCTION: return FP_DO_FOCUS_BY_FUNCTION(*fpol); case FOCUS_SET_FORCE: return 1; } return 0; } int fpol_query_allow_user_focus( focus_policy_t *fpol) { int flag = 0; flag |= FP_DO_FOCUS_ENTER(*fpol); flag |= FP_DO_FOCUS_CLICK_CLIENT(*fpol); flag |= FP_DO_FOCUS_CLICK_DECOR(*fpol); flag |= FP_DO_FOCUS_BY_FUNCTION(*fpol); return !!flag; } int fpol_is_policy_changed( focus_policy_t *fpol) { if (FP_DO_FOCUS_ENTER(*fpol)) { return 1; } if (FP_DO_UNFOCUS_LEAVE(*fpol)) { return 1; } if (FP_DO_FOCUS_CLICK_CLIENT(*fpol)) { return 1; } if (FP_DO_FOCUS_CLICK_DECOR(*fpol)) { return 1; } if (FP_DO_FOCUS_BY_PROGRAM(*fpol)) { return 1; } if (FP_DO_FOCUS_BY_FUNCTION(*fpol)) { return 1; } if (FP_IS_LENIENT(*fpol)) { return 1; } if (FP_DO_RAISE_FOCUSED_CLIENT_CLICK(*fpol)) { return 1; } if (FP_DO_RAISE_UNFOCUSED_CLIENT_CLICK(*fpol)) { return 1; } if (FP_DO_RAISE_FOCUSED_DECOR_CLICK(*fpol)) { return 1; } if (FP_DO_RAISE_UNFOCUSED_DECOR_CLICK(*fpol)) { return 1; } if (FP_USE_MOUSE_BUTTONS(*fpol)) { return 1; } if (FP_USE_MODIFIERS(*fpol)) { return 1; } return 0; } fvwm-2.6.5.orig/fvwm/colorset.h0000644000175000017500000000143210070327603014602 0ustar vwcvwc/* -*-c-*- */ #ifndef COLORSET_H #define COLORSET_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void parse_colorset(int n, char *line); void cleanup_colorsets(void); void alloc_colorset(int n); void update_root_transparent_colorset(Atom prop); #endif /* COLORSET_H */ fvwm-2.6.5.orig/fvwm/menugeometry.h0000644000175000017500000000244510552172642015503 0ustar vwcvwc/* -*-c-*- */ #ifndef MENU_GEOMETRY_H #define MENU_GEOMETRY_H /* ---------------------------- included header files ---------------------- */ /* Do not #include any files - the file including this file has to take care of * it. */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- forward declarations ----------------------- */ struct MenuRoot; struct MenuParameters; /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* Do not use global variable. Full stop. */ /* ---------------------------- interface functions ------------------------ */ /* * All functions in this file are to be used from menu*.c *only* */ Bool menu_get_geometry( struct MenuRoot *mr, Window *root_return, int *x_return, int *y_return, int *width_return, int *height_return, int *border_width_return, int *depth_return); Bool menu_get_outer_geometry( struct MenuRoot *mr, struct MenuParameters *pmp, Window *root_return, int *x_return, int *y_return, int *width_return, int *height_return, int *border_width_return, int *depth_return); #endif /* MENU_GEOMETRY_H */ fvwm-2.6.5.orig/fvwm/events.h0000644000175000017500000000333411320353276014263 0ustar vwcvwc/* -*-c-*- */ #ifndef EVENTS_H #define EVENTS_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef struct { Window w; int event_type; Atom atom; } test_typed_window_event_args; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void dispatch_event(XEvent *e); int GetContext(FvwmWindow **ret_fw, FvwmWindow *t, const XEvent *e, Window *w); int My_XNextEvent(Display *dpy, XEvent *event); int flush_expose(Window w); int flush_accumulate_expose(Window w, XEvent *e); void handle_all_expose(void); Bool StashEventTime(const XEvent *ev); void CoerceEnterNotifyOnCurrentWindow(void); void InitEventHandlerJumpTable(void); void SendConfigureNotify( FvwmWindow *fw, int x, int y, int w, int h, int bw, Bool send_for_frame_too); void WaitForButtonsUp(Bool do_handle_expose); int discard_events(long event_mask); int discard_window_events(Window w, long event_mask); int flush_property_notify(Atom atom, Window w); void sync_server(int toggle); Bool is_resizing_event_pending(FvwmWindow *fw); void events_handle_configure_request( XConfigureRequestEvent cre, FvwmWindow *fw, Bool force_use_grav, int force_gravity); Bool test_button_event(Display *display, XEvent *event, char *arg); Bool test_typed_window_event(Display *display, XEvent *event, char *arg); #endif /* EVENTS_H */ fvwm-2.6.5.orig/fvwm/update.c0000644000175000017500000004510011546555525014244 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "libs/Grab.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "cursor.h" #include "bindings.h" #include "misc.h" #include "screen.h" #include "update.h" #include "style.h" #include "builtins.h" #include "borders.h" #include "frame.h" #include "gnome.h" #include "ewmh.h" #include "icons.h" #include "geometry.h" #include "move_resize.h" #include "add_window.h" #include "module_interface.h" #include "focus.h" #include "stack.h" #include "icons.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ static void init_style( FvwmWindow *old_t, FvwmWindow *t, window_style *pstyle, short *pbuttons) { /* copy the window structure because we still need some old values. */ memcpy(old_t, t, sizeof(FvwmWindow)); /* determine level of decoration */ setup_style_and_decor(t, pstyle, pbuttons); /* restore some old values */ IS_STICKY_ACROSS_PAGES(t) = IS_STICKY_ACROSS_PAGES(old_t); IS_STICKY_ACROSS_DESKS(t) = IS_STICKY_ACROSS_DESKS(old_t); GET_USER_STATES(t) = GET_USER_STATES(old_t); return; } static void apply_window_updates( FvwmWindow *t, update_win *flags, window_style *pstyle, FvwmWindow *focus_w) { FvwmWindow old_t; short buttons; Bool is_style_initialised = False; rectangle frame_g; const exec_context_t *exc; exec_context_changes_t ecc; frame_g.x = t->g.frame.x; frame_g.y = t->g.frame.y; frame_g.width = t->g.frame.width; frame_g.height = t->g.frame.height; /* TA: 2010-07-28: Conditionally update window states if they're * present -- i.e., we're preserving states set via Windowstyle. */ CLEAR_USER_STATES(t, S_USER_STATES(SCM(*pstyle))); SET_USER_STATES(t, S_USER_STATES(SCF(*pstyle))); if (flags->do_setup_focus_policy) { setup_focus_policy(t); if (t == focus_w && !fpol_query_allow_user_focus(&FW_FOCUS_POLICY(t))) { focus_w = NULL; if (Scr.Hilite == t) { Scr.Hilite = NULL; } flags->do_redraw_decoration = True; } } if (flags->do_update_gnome_styles) { if (!S_DO_IGNORE_GNOME_HINTS(SCF(*pstyle))) { GNOME_GetStyle(t, pstyle); } } if (flags->do_update_window_grabs) { focus_grab_buttons(t); } if (IS_TRANSIENT(t) && flags->do_redecorate_transient) { flags->do_redecorate = True; flags->do_update_window_font = True; } /* * is_sticky * is_icon_sticky * * These are a bit complicated because they can move windows to a * different page or desk. */ ecc.type = EXCT_NULL; ecc.w.fw = t; ecc.w.w = FW_W_FRAME(t); ecc.w.wcontext = C_FRAME; exc = exc_create_context( &ecc, ECC_TYPE | ECC_FW | ECC_W | ECC_WCONTEXT); if (flags->do_update_stick_icon && IS_ICONIFIED(t) && !(IS_STICKY_ACROSS_PAGES(t) || IS_STICKY_ACROSS_DESKS(t))) { if (IS_ICON_STICKY_ACROSS_PAGES(pstyle) || IS_ICON_STICKY_ACROSS_DESKS(pstyle)) { /* stick and unstick the window to force the icon on * the current page */ handle_stick( NULL, exc, "", S_IS_STICKY_ACROSS_PAGES(SCF(*pstyle)), S_IS_STICKY_ACROSS_DESKS(SCF(*pstyle)), 1, 1); handle_stick(NULL, exc, "", 0, 0, 1, 0); } flags->do_update_icon_title = True; } else if (flags->do_update_stick) { handle_stick( NULL, exc, "", S_IS_STICKY_ACROSS_PAGES(SCF(*pstyle)), S_IS_STICKY_ACROSS_DESKS(SCF(*pstyle)), 0, 0); } exc_destroy_context(exc); if (FMiniIconsSupported && flags->do_update_mini_icon) { if (!HAS_EWMH_MINI_ICON(t) || DO_EWMH_MINI_ICON_OVERRIDE(t)) { change_mini_icon(t, pstyle); } else { if (EWMH_SetIconFromWMIcon(t, NULL, 0, True)) { SET_HAS_EWMH_MINI_ICON(t, True); } else { /* "should" not happen */ SET_HAS_EWMH_MINI_ICON(t, False); change_mini_icon(t, pstyle); } } } if (flags->do_update_visible_window_name) { setup_visible_name(t, False); BroadcastName(M_VISIBLE_NAME,FW_W(t),FW_W_FRAME(t), (unsigned long)t,t->visible_name); EWMH_SetVisibleName(t, False); } if (flags->do_update_visible_icon_name) { setup_visible_name(t, True); BroadcastName(MX_VISIBLE_ICON_NAME,FW_W(t),FW_W_FRAME(t), (unsigned long)t,t->visible_icon_name); EWMH_SetVisibleName(t, True); } if (flags->do_update_window_font || flags->do_update_window_font_height) { if (!is_style_initialised) { init_style(&old_t, t, pstyle, &buttons); is_style_initialised = True; } setup_window_font(t, pstyle, flags->do_update_window_font); flags->do_redecorate = True; } if (flags->do_update_title_text_dir) { flags->do_redecorate = True; } if (flags->do_redecorate || flags->do_update_title_dir) { size_borders b_old; size_borders b_new; int dw = 0; int dh = 0; rectangle naked_g; rectangle *new_g; if (flags->do_redecorate) { if (!is_style_initialised) { init_style(&old_t, t, pstyle, &buttons); is_style_initialised = True; } /* redecorate */ change_auxiliary_windows(t, buttons); /* calculate the new offsets */ /* naked_g: geometry without decor */ gravity_get_naked_geometry( old_t.hints.win_gravity, &old_t, &naked_g, &t->g.normal); /* gravity without decor */ gravity_translate_to_northwest_geometry_no_bw( old_t.hints.win_gravity, &old_t, &naked_g, &naked_g); /* set g.normal with the decor */ gravity_add_decoration( old_t.hints.win_gravity, t, &t->g.normal, &naked_g); } if (flags->do_update_title_dir) { /* new border sizes */ get_window_borders(t, &b_old); SET_TITLE_DIR(t, S_TITLE_DIR(SCF(*pstyle))); setup_title_geometry(t, pstyle); get_window_borders(t, &b_new); /* resizing */ dw = b_new.total_size.width - b_old.total_size.width; dh = b_new.total_size.height - b_old.total_size.height; gravity_resize( t->hints.win_gravity, &t->g.normal, dw, dh); gravity_constrain_size( t->hints.win_gravity, t, &t->g.normal, 0); } if (IS_MAXIMIZED(t)) { if (flags->do_redecorate) { int off_x = old_t.g.normal.x - old_t.g.max.x; int off_y = old_t.g.normal.y - old_t.g.max.y; int new_off_x; int new_off_y; /* maximized windows are always considered to * have NorthWestGravity */ gravity_get_naked_geometry( NorthWestGravity, &old_t, &naked_g, &t->g.max); gravity_translate_to_northwest_geometry_no_bw( NorthWestGravity, &old_t, &naked_g, &naked_g); gravity_add_decoration( NorthWestGravity, t, &t->g.max, &naked_g); /* prevent random paging when unmaximizing * after e.g. the border width has changed */ new_off_x = t->g.normal.x - t->g.max.x; new_off_y = t->g.normal.y - t->g.max.y; t->g.max_offset.x += new_off_x - off_x; t->g.max_offset.y += new_off_y - off_y; } if (flags->do_update_title_dir) { frame_g = t->g.max; gravity_resize( t->hints.win_gravity, &t->g.max, dw, dh); gravity_constrain_size( t->hints.win_gravity, t, &t->g.max, CS_UPDATE_MAX_DEFECT); } new_g = &t->g.max; } else { new_g = &t->g.normal; } if (IS_SHADED(t)) { get_unshaded_geometry(t, new_g); if (USED_TITLE_DIR_FOR_SHADING(t)) { SET_SHADED_DIR(t, GET_TITLE_DIR(t)); } get_shaded_geometry(t, &frame_g, new_g); } else { get_relative_geometry(&frame_g, new_g); } flags->do_setup_frame = True; flags->do_redraw_decoration = True; } if (flags->do_update_rotated_title) { if (t->title_text_rotation != ROTATION_0) { flags->do_setup_frame = True; flags->do_redraw_decoration = True; } } if (flags->do_resize_window) { rectangle old_g; setup_frame_size_limits(t, pstyle); old_g = frame_g; frame_g = t->g.normal; gravity_constrain_size(t->hints.win_gravity, t, &frame_g, 0); t->g.normal = frame_g; if (IS_MAXIMIZED(t)) { frame_g = t->g.max; gravity_constrain_size( t->hints.win_gravity, t, &frame_g, CS_UPDATE_MAX_DEFECT); t->g.max = frame_g; } frame_g = old_g; gravity_constrain_size( t->hints.win_gravity, t, &frame_g, 0); flags->do_setup_frame = True; flags->do_redraw_decoration = True; } if (flags->do_setup_frame) { FvwmWindow *tmp; setup_title_geometry(t, pstyle); /* frame_force_setup_window needs to know if the window is * hilighted */ tmp = get_focus_window(); set_focus_window(focus_w); frame_force_setup_window( t, frame_g.x, frame_g.y, frame_g.width, frame_g.height, True); set_focus_window(tmp); GNOME_SetWinArea(t); EWMH_SetFrameStrut(t); } if (flags->do_update_window_color) { if (t != focus_w) { flags->do_redraw_decoration = True; } update_window_color_style(t, pstyle); if (t != Scr.Hilite) { flags->do_broadcast_focus = True; } } if (flags->do_update_window_color_hi) { if (t == focus_w) { flags->do_redraw_decoration = True; } update_window_color_hi_style(t, pstyle); flags->do_broadcast_focus = True; if (t == Scr.Hilite) { flags->do_broadcast_focus = True; } } if (flags->do_update_icon_title_cs_hi) { if (t == focus_w && IS_ICONIFIED(t)) { flags->do_redraw_icon = True; } update_icon_title_cs_hi_style(t, pstyle); } if (flags->do_update_icon_title_cs) { if (t != focus_w && IS_ICONIFIED(t)) { flags->do_redraw_icon = True; } update_icon_title_cs_style(t, pstyle); } if (flags->do_update_icon_background_cs) { int old_cs = t->icon_background_cs; update_icon_background_cs_style(t, pstyle); if ((old_cs < 0 && t->icon_background_cs >= 0) || (old_cs >= 0 && t->icon_background_cs < 0)) { flags->do_update_icon = True; } else { flags->do_redraw_icon = True; } } if (flags->do_update_icon_size_limits) { setup_icon_size_limits(t, pstyle); flags->do_update_icon = True; } if (flags->do_update_icon_font) { if (!is_style_initialised) { init_style(&old_t, t, pstyle, &buttons); is_style_initialised = True; } setup_icon_font(t, pstyle, flags->do_update_icon_font); flags->do_update_icon_title = True; } if (flags->do_update_icon_boxes) { change_icon_boxes(t, pstyle); } if (flags->do_update_icon) { setup_icon_background_parameters(t, pstyle); setup_icon_title_parameters(t, pstyle); change_icon(t, pstyle); flags->do_update_icon_placement = True; flags->do_update_icon_title = False; flags->do_redraw_icon = False; flags->do_update_ewmh_icon = True; } if (flags->do_redraw_icon) { /* should not test if the window is iconified */ DrawIconWindow(t, True, True, False, True, NULL);; flags->do_redraw_decoration = False; flags->do_update_icon_title = False; } if (flags->do_update_icon_title) { RedoIconName(t); } if (flags->do_update_icon_placement) { if (IS_ICONIFIED(t)) { initial_window_options_t win_opts; memset(&win_opts, 0, sizeof(win_opts)); SET_ICONIFIED(t, 0); Iconify(t, &win_opts); flags->do_redraw_decoration = False; } } if (flags->do_redraw_decoration) { FvwmWindow *tmp; /* frame_redraw_decorations needs to know if the window is * hilighted */ tmp = get_focus_window(); set_focus_window(focus_w); if (IS_ICONIFIED(t)) { DrawIconWindow(t, True, True, False, False, NULL); } else { border_redraw_decorations(t); } set_focus_window(tmp); } if (flags->do_update_frame_attributes) { setup_frame_attributes(t, pstyle); } if (flags->do_update_ewmh_state_hints) { EWMH_SetWMState(t, False); } if (flags->do_update_modules_flags) { BroadcastConfig(M_CONFIGURE_WINDOW,t); } if (flags->do_update_ewmh_mini_icon || flags->do_update_ewmh_icon) { EWMH_DoUpdateWmIcon( t, flags->do_update_ewmh_mini_icon, flags->do_update_ewmh_icon); } if (flags->do_update_placement_penalty) { setup_placement_penalty(t, pstyle); } if (flags->do_update_working_area) { EWMH_UpdateWorkArea(); } if (flags->do_update_ewmh_stacking_hints) { if (DO_EWMH_USE_STACKING_HINTS(t)) { if (t->ewmh_hint_layer > 0 && t->layer != t->ewmh_hint_layer) { t->ewmh_normal_layer = t->layer; new_layer(t, t->ewmh_hint_layer); } } else { if (t->ewmh_hint_layer > 0 && t->ewmh_normal_layer) { if (t->ewmh_normal_layer) { new_layer(t, t->ewmh_normal_layer); } else { new_layer(t, Scr.DefaultLayer); } } } } if (flags->do_update_ewmh_allowed_actions) { EWMH_SetAllowedActions(t); } if (flags->do_broadcast_focus) { if (Scr.Hilite != NULL && t == Scr.Hilite) { BroadcastPacket( M_FOCUS_CHANGE, 5, (long)FW_W(Scr.Hilite), (long)FW_W_FRAME(Scr.Hilite), (long)0, (long)Scr.Hilite->hicolors.fore, (long)Scr.Hilite->hicolors.back); } } if (flags->do_refresh) { if (!IS_ICONIFIED(t)) { refresh_window(FW_W_FRAME(t), False); } } setup_numeric_vals(t, pstyle); if (flags->do_update_cr_motion_method) { switch (SCR_MOTION_METHOD(&pstyle->flags)) { case WS_CR_MOTION_METHOD_AUTO: if (WAS_CR_MOTION_METHOD_DETECTED(t)) { /* method was already detected, keep it */ break; } /* fall through */ case WS_CR_MOTION_METHOD_USE_GRAV: case WS_CR_MOTION_METHOD_STATIC_GRAV: SET_CR_MOTION_METHOD( t, SCR_MOTION_METHOD(&pstyle->flags)); SET_CR_MOTION_METHOD_DETECTED(t, 0); break; } } if (flags->do_update_layer) { int layer = get_layer(t); if (SUSE_LAYER(&pstyle->flags)) { /* use layer from style */ layer = SGET_LAYER(*pstyle); } /* Set the layer, and modify the stack ring. */ new_layer(t, layer); } return; } /* ---------------------------- builtin commands --------------------------- */ /* takes only care of destroying windows that have to go away. */ void destroy_scheduled_windows(void) { flist *t; Bool do_need_ungrab = False; if (Scr.flags.is_executing_complex_function || Scr.flags.is_executing_menu_function || !Scr.flags.is_window_scheduled_for_destroy) { return; } /* Grab the server during the style update! */ if (GrabEm(CRS_WAIT, GRAB_BUSY)) { do_need_ungrab = True; } MyXGrabServer(dpy); Scr.flags.is_window_scheduled_for_destroy = 0; /* need to destroy one or more windows before looking at the window * list */ for (t = Scr.FWScheduledForDestroy; t != NULL; t = t->next) { destroy_window(t->object); } Scr.FWScheduledForDestroy = flist_free_list(Scr.FWScheduledForDestroy); MyXUngrabServer(dpy); if (do_need_ungrab) { UngrabEm(GRAB_BUSY); } return; } /* similar to the flush_window_updates() function, but does only the updates * for a single window whose decor has been changed. */ void apply_decor_change(FvwmWindow *fw) { window_style style; update_win flags; lookup_style(fw, &style); memset(&flags, 0, sizeof(flags)); flags.do_redecorate = True; flags.do_update_window_font_height = True; apply_window_updates(fw, &flags, &style, get_focus_window()); return; } /* Check and apply new style to each window if the style has changed. */ void flush_window_updates(void) { FvwmWindow *t; window_style style; FvwmWindow *focus_fw; Bool do_need_ungrab = False; update_win flags; /* Grab the server during the style update! */ if (GrabEm(CRS_WAIT, GRAB_BUSY)) { do_need_ungrab = True; } MyXGrabServer(dpy); /* This is necessary in case the focus policy changes. With * ClickToFocus some buttons have to be grabbed/ungrabbed. */ focus_fw = get_focus_window(); DeleteFocus(False); /* Apply the new default font and colours first */ if (Scr.flags.has_default_color_changed || Scr.flags.has_default_font_changed) { ApplyDefaultFontAndColors(); } /* update styles for all windows */ for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { memset(&flags, 0, sizeof(update_win)); check_window_style_change(t, &flags, &style); if (Scr.flags.has_xinerama_state_changed) { flags.do_update_icon_boxes = True; flags.do_update_icon_placement = True; } if (Scr.flags.has_nr_buttons_changed) { flags.do_redecorate = True; } /* TODO: this is not optimised for minimal redrawing yet*/ if (t->decor->flags.has_changed) { flags.do_redecorate = True; flags.do_update_window_font_height = True; } if (Scr.flags.has_default_font_changed && !HAS_ICON_FONT(t)) { flags.do_update_icon_font = True; } if (Scr.flags.has_default_font_changed && !HAS_WINDOW_FONT(t)) { flags.do_update_window_font = True; } if (t->decor->flags.has_title_height_changed) { flags.do_update_window_font_height = True; } if (Scr.flags.has_mouse_binding_changed) { flags.do_update_window_grabs = True; } /* now apply the changes */ apply_window_updates(t, &flags, &style, focus_fw); } /* restore the focus; also handles the case that the previously focused * window is now NeverFocus */ if (focus_fw) { SetFocusWindow(focus_fw, False, FOCUS_SET_FORCE); if (Scr.flags.has_mouse_binding_changed) { focus_grab_buttons(focus_fw); } } else { DeleteFocus(True); } /* finally clean up the change flags */ reset_style_changes(); reset_decor_changes(); Scr.flags.do_need_window_update = 0; Scr.flags.has_default_font_changed = 0; Scr.flags.has_default_color_changed = 0; Scr.flags.has_mouse_binding_changed = 0; Scr.flags.has_nr_buttons_changed = 0; Scr.flags.has_xinerama_state_changed = 0; MyXUngrabServer(dpy); if (do_need_ungrab) { UngrabEm(GRAB_BUSY); } return; } void CMD_UpdateStyles(F_CMD_ARGS) { if (Scr.flags.do_need_window_update) { flush_window_updates(); } return; } fvwm-2.6.5.orig/fvwm/misc.h0000644000175000017500000000453510272650602013714 0ustar vwcvwc/* -*-c-*- */ #ifndef MISC_H #define MISC_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ enum { GRAB_ALL = 0, /* sum of all grabs */ GRAB_STARTUP = 1, /* Startup busy cursor */ GRAB_NORMAL = 2, /* DeferExecution, Move, Resize, ... */ GRAB_MENU = 3, /* a menus.c grabing */ GRAB_BUSY = 4, /* BusyCursor stuff */ GRAB_BUSYMENU = 5, /* Allows menus.c to regrab the cursor */ GRAB_PASSIVE = 6, /* Override of passive grab, only prevents grab * to be released too early */ GRAB_FREEZE_CURSOR = 7, /* Freeze the cursor shape if a window is * pressed. */ GRAB_MAXVAL /* last GRAB macro + 1 */ }; /* ---------------------------- global macros ------------------------------ */ #ifdef ICON_DEBUG #define ICON_DBG(X) fprintf X; #else #define ICON_DBG(X) #endif /* ---------------------------- type definitions --------------------------- */ /* message levels for fvwm_msg */ typedef enum { DBG = 0, ECHO, INFO, WARN, OLD, ERR } fvwm_msg_t; typedef enum { ADDED_NONE = 0, ADDED_MENU, #ifdef USEDECOR ADDED_DECOR, #endif ADDED_FUNCTION } last_added_item_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ Bool GrabEm( int cursor, int grab_context); Bool UngrabEm( int ungrab_context); int GetTwoArguments( char *action, int *val1, int *val2, int *val1_unit, int *val2_unit); void NewFontAndColor( FlocaleFont *flf, Pixel color, Pixel backcolor); void Keyboard_shortcuts( XEvent *ev, FvwmWindow *fw, int *x_defect, int *y_defect, int ReturnEvent); Bool check_if_fvwm_window_exists( FvwmWindow *fw); int truncate_to_multiple( int x, int m); Bool IsRectangleOnThisPage( const rectangle *rec, int desk); FvwmWindow *get_pointer_fvwm_window(void); Time get_server_time(void); void fvwm_msg(fvwm_msg_t type, char *id, char *msg, ...) __attribute__ ((format (printf, 3, 4))); void fvwm_msg_report_app(void); void fvwm_msg_report_app_and_workers(void); void set_last_added_item(last_added_item_t type, void *item); void print_g(char *text, rectangle *g); #endif /* MISC_H */ fvwm-2.6.5.orig/fvwm/repeat.h0000644000175000017500000000131207677641663014255 0ustar vwcvwc/* -*-c-*- */ #ifndef _REPEAT_ #define _REPEAT_ typedef enum { REPEAT_NONE = 0, REPEAT_COMMAND, /* I think we don't need all these REPEAT_BUILTIN, REPEAT_FUNCTION, REPEAT_TOP_FUNCTION, REPEAT_MODULE, */ REPEAT_MENU, REPEAT_POPUP, REPEAT_PAGE, REPEAT_DESK, REPEAT_DESK_AND_PAGE, REPEAT_FVWM_WINDOW } repeat_t; extern char *repeat_last_function; extern char *repeat_last_complex_function; extern char *repeat_last_builtin_function; extern char *repeat_last_module; /* extern char *repeat_last_top_function; extern char *repeat_last_menu; extern FvwmWindow *repeat_last_fvwm_window; */ Bool set_repeat_data(void *data, repeat_t type, const func_t *builtin); #endif /* _REPEAT_ */ fvwm-2.6.5.orig/fvwm/move_resize.c0000644000175000017500000032437111641302505015303 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* * * code for moving and resizing windows * */ #include "config.h" #include #include #include #include "libs/fvwmlib.h" #include "libs/FScreen.h" #include "libs/Picture.h" #include "libs/Grab.h" #include "libs/Parse.h" #include "libs/Graphics.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "execcontext.h" #include "commands.h" #include "misc.h" #include "screen.h" #include "menus.h" #include "menuparameters.h" #include "module_list.h" #include "module_interface.h" #include "focus.h" #include "borders.h" #include "frame.h" #include "geometry.h" #include "gnome.h" #include "ewmh.h" #include "virtual.h" #include "decorations.h" #include "events.h" #include "eventhandler.h" #include "eventmask.h" #include "colormaps.h" #include "update.h" #include "stack.h" #include "move_resize.h" #include "functions.h" #include "style.h" /* ----- move globals ----- */ #define MOVE_NORMAL 0x00 #define MOVE_PAGE 0x01 #define MOVE_SCREEN 0x02 /* Animated move stuff added by Greg J. Badros, gjb@cs.washington.edu */ float rgpctMovementDefault[32] = { -.01, 0, .01, .03,.08,.18,.3,.45,.60,.75,.85,.90,.94,.97,.99,1.0 /* must end in 1.0 */ }; int cmsDelayDefault = 10; /* milliseconds */ /* current geometry of size window */ static rectangle sizew_g = { -1, -1, -1, -1 }; static int move_interactive_finish_button_mask = ((1<<(NUMBER_OF_EXTENDED_MOUSE_BUTTONS))-1) & ~0x2; static int move_drag_finish_button_mask = ((1<<(NUMBER_OF_EXTENDED_MOUSE_BUTTONS))-1) & ~0x3; /* ----- end of move globals ----- */ /* ----- resize globals ----- */ /* DO NOT USE (STATIC) GLOBALS IN THIS MODULE! * Since some functions are called from other modules unwanted side effects * (i.e. bugs.) would be created */ extern Window PressedW; static void draw_move_resize_grid(int x, int y, int width, int height); /* ----- end of resize globals ----- */ /* * * Procedure: * draw_move_resize_grid - move a window outline * * Inputs: * root - the window we are outlining * x - upper left x coordinate * y - upper left y coordinate * width - the width of the rectangle * height - the height of the rectangle * */ static int get_outline_rects( XRectangle *rects, int x, int y, int width, int height) { int i; int n; int m; n = 3; m = (width - 5) / 2; if (m < n) { n = m; } m = (height - 5) / 2; if (m < n) { n = m; } if (n < 1) { n = 1; } for (i = 0; i < n; i++) { rects[i].x = x + i; rects[i].y = y + i; rects[i].width = width - (i << 1); rects[i].height = height - (i << 1); } if (width - (n << 1) >= 5 && height - (n << 1) >= 5) { if (width - (n << 1) >= 10) { int off = (width - (n << 1)) / 3 + n; rects[i].x = x + off; rects[i].y = y + n; rects[i].width = width - (off << 1); rects[i].height = height - (n << 1); i++; } if (height - (n << 1) >= 10) { int off = (height - (n << 1)) / 3 + n; rects[i].x = x + n; rects[i].y = y + off; rects[i].width = width - (n << 1); rects[i].height = height - (off << 1); i++; } } return i; } struct { rectangle geom; struct { unsigned is_enabled : 1; } flags; } move_resize_grid = { { 0, 0, 0, 0 }, { 0 } }; static void draw_move_resize_grid(int x, int y, int width, int height) { int nrects = 0; XRectangle rects[10]; if (move_resize_grid.flags.is_enabled && x == move_resize_grid.geom.x && y == move_resize_grid.geom.y && width == move_resize_grid.geom.width && height == move_resize_grid.geom.height) { return; } memset(rects, 0, 10 * sizeof(XRectangle)); /* place the resize rectangle into the array of rectangles */ /* interleave them for best visual look */ /* draw the new one, if any */ if (move_resize_grid.flags.is_enabled /*move_resize_grid.geom.width && move_resize_grid.geom.height*/) { move_resize_grid.flags.is_enabled = 0; nrects += get_outline_rects( &(rects[0]), move_resize_grid.geom.x, move_resize_grid.geom.y, move_resize_grid.geom.width, move_resize_grid.geom.height); } if (width && height) { move_resize_grid.flags.is_enabled = 1; move_resize_grid.geom.x = x; move_resize_grid.geom.y = y; move_resize_grid.geom.width = width; move_resize_grid.geom.height = height; nrects += get_outline_rects( &(rects[nrects]), x, y, width, height); } if (nrects > 0) { XDrawRectangles(dpy, Scr.Root, Scr.XorGC, rects, nrects); XFlush(dpy); } return; } void switch_move_resize_grid(Bool state) { if (state == False) { if (move_resize_grid.flags.is_enabled) { draw_move_resize_grid(0, 0, 0, 0); } else { move_resize_grid.geom.x = 0; move_resize_grid.geom.y = 0; move_resize_grid.geom.width = 0; move_resize_grid.geom.height = 0; } } else if (!move_resize_grid.flags.is_enabled) { if (move_resize_grid.geom.width && move_resize_grid.geom.height) { draw_move_resize_grid( move_resize_grid.geom.x, move_resize_grid.geom.y, move_resize_grid.geom.width, move_resize_grid.geom.height); } } return; } static int ParsePositionArgumentSuffix( float *ret_factor, char *suffix, float wfactor, float sfactor) { int n; switch (*suffix) { case 'p': case 'P': *ret_factor = 1.0; n = 1; break; case 'w': case 'W': *ret_factor = wfactor; n = 1; break; default: *ret_factor = sfactor; n = 0; break; } return n; } static int __get_shift(int val, float factor) { int shift; if (val >= 0) { shift = (int)(val * factor + 0.5); } else { shift = (int)(val * factor - 0.5); } return shift; } /* The vars are named for the x-direction, but this is used for both x and y */ static int GetOnePositionArgument( char *s1, int window_pos, int window_size, int *pFinalPos, float sfactor, int screen_size, int screen_pos, Bool is_x) { int final_pos; float wfactor; if (s1 == 0 || *s1 == 0) { return 0; } wfactor = (float)window_size / 100; /* get start position */ switch (*s1) { case 'w': case 'W': final_pos = window_pos; s1++; break; case 'm': case 'M': { int x; int y; if ( FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &JunkX, &JunkY, &x, &y, &JunkMask) == False) { /* pointer is on a different screen - that's okay here */ final_pos = 0; } else { final_pos = (is_x) ? x : y; } s1++; break; } default: final_pos = screen_pos; if (*s1 != 0) { int val; int n; float f; /* parse value */ if (sscanf(s1, "-%d%n", &val, &n) >= 1) { /* i.e. -1, -+1 or --1 */ final_pos += (screen_size - window_size); val = -val; } else if ( sscanf(s1, "+%d%n", &val, &n) >= 1 || sscanf(s1, "%d%n", &val, &n) >= 1) { /* i.e. 1, +1, ++1 or +-1 */ } else { /* syntax error, ignore rest of string */ break; } s1 += n; /* parse suffix */ n = ParsePositionArgumentSuffix( &f, s1, wfactor, sfactor); s1 += n; final_pos += __get_shift(val, f); } break; } /* loop over shift arguments */ while (*s1 != 0) { int val; int n; float f; /* parse value */ if (sscanf(s1, "-%d%n", &val, &n) >= 1) { /* i.e. -1, -+1 or --1 */ val = -val; } else if ( sscanf(s1, "+%d%n", &val, &n) >= 1 || sscanf(s1, "%d%n", &val, &n) >= 1) { /* i.e. 1, +1, ++1 or +-1 */ } else { /* syntax error, ignore rest of string */ break; } s1 += n; /* parse suffix */ n = ParsePositionArgumentSuffix(&f, s1, wfactor, sfactor); s1 += n; final_pos += __get_shift(val, f); } *pFinalPos = final_pos; return 1; } /* GetMoveArguments is used for Move & AnimatedMove * It lets you specify in all the following ways * 20 30 Absolute percent position, from left edge and top * -50 50 Absolute percent position, from right edge and top * 10p 5p Absolute pixel position * 10p -0p Absolute pixel position, from bottom * w+5 w-10p Relative position, right 5%, up ten pixels * m+5 m-10p Pointer relative position, right 5%, up ten pixels * Returns 2 when x & y have parsed without error, 0 otherwise */ int GetMoveArguments( char **paction, int w, int h, int *pFinalX, int *pFinalY, Bool *fWarp, Bool *fPointer, Bool fKeep) { char *s1 = NULL; char *s2 = NULL; char *token = NULL; char *action; char *naction; int scr_x = 0; int scr_y = 0; int scr_w = Scr.MyDisplayWidth; int scr_h = Scr.MyDisplayHeight; Bool use_working_area = True; Bool global_flag_parsed = False; int retval = 0; if (!paction) { return 0; } action = *paction; action = GetNextToken(action, &s1); if (s1 && fPointer && StrEquals(s1, "pointer")) { *fPointer = True; *paction = action; free(s1); return 0; } if (s1 && StrEquals(s1, "screen")) { char *token; int scr; fscreen_scr_arg arg; fscreen_scr_arg* parg; free(s1); token = PeekToken(action, &action); scr = FScreenGetScreenArgument(token, FSCREEN_SPEC_PRIMARY); if (scr == FSCREEN_XYPOS) { arg.xypos.x = *pFinalX; arg.xypos.y = *pFinalY; parg = &arg; } else { parg = NULL; } FScreenGetScrRect(parg, scr, &scr_x, &scr_y, &scr_w, &scr_h); action = GetNextToken(action, &s1); } action = GetNextToken(action, &s2); while (!global_flag_parsed) { token = PeekToken(action, &naction); if (!token) { global_flag_parsed = True; break; } if (StrEquals(token, "Warp")) { action = naction; if (fWarp) { *fWarp = True; } } else if (StrEquals(token, "ewmhiwa")) { use_working_area = False; action = naction; } else { global_flag_parsed = True; } } if (use_working_area) { EWMH_GetWorkAreaIntersection( NULL, &scr_x, &scr_y, &scr_w, &scr_h, EWMH_USE_WORKING_AREA); } if (s1 != NULL && s2 != NULL) { retval = 0; if (fKeep == True && StrEquals(s1, "keep")) { retval++; } else if ( GetOnePositionArgument( s1, *pFinalX, w, pFinalX, (float)scr_w / 100, scr_w, scr_x, True)) { retval++; } if (fKeep == True && StrEquals(s2, "keep")) { retval++; } else if ( GetOnePositionArgument( s2, *pFinalY, h, pFinalY, (float)scr_h / 100, scr_h, scr_y, False)) { retval++; } if (retval == 0) { /* make sure warping is off for interactive moves */ *fWarp = False; } } else { /* not enough arguments, switch to current page. */ while (*pFinalX < 0) { *pFinalX = Scr.MyDisplayWidth + *pFinalX; } while (*pFinalY < 0) { *pFinalY = Scr.MyDisplayHeight + *pFinalY; } } if (s1) { free(s1); } if (s2) { free(s2); } *paction = action; return retval; } static int ParseOneResizeArgument( char *arg, int scr_size, int base_size, int size_inc, int add_size, int *ret_size) { float factor; int val; int add_base_size = 0; int cch = strlen(arg); int tmp_size; if (cch == 0) { return 0; } if (StrEquals(arg, "keep")) { /* do not change size */ return 1; } if (arg[cch-1] == 'p') { factor = 1; arg[cch-1] = '\0'; } else if (arg[cch-1] == 'c') { factor = size_inc; add_base_size = base_size; arg[cch-1] = '\0'; } else { factor = (float)scr_size / 100.0; } if (strcmp(arg,"w") == 0) { /* do not change size */ } else if (sscanf(arg,"w-%d",&val) == 1) { tmp_size = (int)(val * factor + 0.5); if (tmp_size < *ret_size) { *ret_size -= tmp_size; } else { *ret_size = 0; } } else if (sscanf(arg,"w+%d",&val) == 1 || sscanf(arg,"w%d",&val) == 1) { tmp_size = (int)(val * factor + 0.5); if (-tmp_size < *ret_size) { *ret_size += tmp_size; } else { *ret_size = 0; } } else if (sscanf(arg,"-%d",&val) == 1) { tmp_size = (int)(val * factor + 0.5); if (tmp_size < scr_size + add_size) { *ret_size = scr_size - tmp_size + add_size; } else { *ret_size = 0; } } else if (sscanf(arg,"+%d",&val) == 1 || sscanf(arg,"%d",&val) == 1) { tmp_size = (int)(val * factor + 0.5); if (-tmp_size < add_size + add_base_size) { *ret_size = tmp_size + add_size + add_base_size; } else { *ret_size = 0; } } else { return 0; } return 1; } static int GetResizeArguments( char **paction, int x, int y, int w_base, int h_base, int w_inc, int h_inc, size_borders *sb, int *pFinalW, int *pFinalH, direction_t *ret_dir, Bool *is_direction_fixed, Bool *do_warp_to_border, Bool *automatic_border_direction, Bool *detect_automatic_direction) { int n; char *naction; char *token; char *tmp_token; char *s1; char *s2; int w_add; int h_add; int has_frame_option; *ret_dir = DIR_NONE; *is_direction_fixed = False; *do_warp_to_border = False; *automatic_border_direction = False; *detect_automatic_direction = False; if (!paction) { return 0; } token = PeekToken(*paction, &naction); if (!token) { return 0; } if (StrEquals(token, "bottomright") || StrEquals(token, "br")) { int nx = x + *pFinalW - 1; int ny = y + *pFinalH - 1; n = GetMoveArguments( &naction, 0, 0, &nx, &ny, NULL, NULL, True); if (n < 2) { return 0; } *pFinalW = nx - x + 1; *pFinalH = ny - y + 1; *paction = naction; return n; } has_frame_option = 0; for ( ; ; token = PeekToken(naction, &naction)) { if (StrEquals(token, "frame")) { has_frame_option = 1; } else if (StrEquals(token, "direction")) { if (token == NULL) { return 0; } *ret_dir = gravity_parse_dir_argument( naction, &naction, DIR_NONE); if (*ret_dir != DIR_NONE) { *is_direction_fixed = True; } else if (*ret_dir == DIR_NONE) { tmp_token = PeekToken(naction, &naction); if (tmp_token != NULL && StrEquals(tmp_token, "automatic")) { *detect_automatic_direction = True; *is_direction_fixed = True; } } } else if (StrEquals(token, "fixeddirection")) { *is_direction_fixed = True; } else if (StrEquals(token, "warptoborder")) { tmp_token = PeekToken(naction, &naction); if (tmp_token != NULL && StrEquals(tmp_token, "automatic")) { *automatic_border_direction = True; } *do_warp_to_border = True; } else { break; } } if (has_frame_option) { w_add = 0; h_add = 0; } else { w_add = sb->total_size.width; h_add = sb->total_size.height; } s1 = NULL; if (token != NULL) { s1 = safestrdup(token); } naction = GetNextToken(naction, &s2); if (!s2) { if (s1 != NULL) { free(s1); } return 0; } *paction = naction; n = 0; n += ParseOneResizeArgument( s1, Scr.MyDisplayWidth, w_base, w_inc, w_add, pFinalW); n += ParseOneResizeArgument( s2, Scr.MyDisplayHeight, h_base, h_inc, h_add, pFinalH); if (s1 != NULL) { free(s1); } if (s2 != NULL) { free(s2); } if (n < 2) { n = 0; } return n; } static int GetResizeMoveArguments( char **paction, int w_base, int h_base, int w_inc, int h_inc, size_borders *sb, int *pFinalX, int *pFinalY, int *pFinalW, int *pFinalH, Bool *fWarp, Bool *fPointer) { char *action = *paction; direction_t dir; Bool dummy; if (!paction) { return 0; } if (GetResizeArguments( &action, *pFinalX, *pFinalY, w_base, h_base, w_inc, h_inc, sb, pFinalW, pFinalH, &dir, &dummy, &dummy, &dummy, &dummy) < 2) { return 0; } if (GetMoveArguments( &action, *pFinalW, *pFinalH, pFinalX, pFinalY, fWarp, NULL, True) < 2) { return 0; } *paction = action; return 4; } /* Positions the SizeWindow on the current ("moused") xinerama-screen */ static void position_geometry_window(const XEvent *eventp) { int x; int y; fscreen_scr_arg fscr; fscr.mouse_ev = (XEvent *)eventp; /* Probably should remove this positioning code from {builtins,fvwm}.c? */ if (Scr.gs.do_emulate_mwm) { FScreenCenterOnScreen( &fscr, FSCREEN_CURRENT, &x, &y, sizew_g.width, sizew_g.height); } else { FScreenGetScrRect(&fscr, FSCREEN_CURRENT, &x, &y, NULL, NULL); } if (x != sizew_g.x || y != sizew_g.y) { switch_move_resize_grid(False); XMoveWindow(dpy, Scr.SizeWindow, x, y); switch_move_resize_grid(True); sizew_g.x = x; sizew_g.y = y; } return; } void resize_geometry_window(void) { int w; int h; int cset = Scr.DefaultColorset; Scr.SizeStringWidth = FlocaleTextWidth(Scr.DefaultFont, GEOMETRY_WINDOW_STRING, sizeof(GEOMETRY_WINDOW_STRING) - 1); w = Scr.SizeStringWidth + 2 * GEOMETRY_WINDOW_BW; h = Scr.DefaultFont->height + 2 * GEOMETRY_WINDOW_BW; if (w != sizew_g.width || h != sizew_g.height) { XResizeWindow(dpy, Scr.SizeWindow, w, h); sizew_g.width = w; sizew_g.height = h; } if (cset >= 0) { SetWindowBackground( dpy, Scr.SizeWindow, w, h, &Colorset[cset], Pdepth, Scr.StdGC, False); } else { XSetWindowBackground(dpy, Scr.SizeWindow, Scr.StdBack); } return; } /* * * Procedure: * DisplayPosition - display the position in the dimensions window * * Inputs: * tmp_win - the current fvwm window * x, y - position of the window * */ static void DisplayPosition( const FvwmWindow *tmp_win, const XEvent *eventp, int x, int y,int Init) { char str[100]; int offset; fscreen_scr_arg fscr; FlocaleWinString fstr; if (Scr.gs.do_hide_position_window) { return; } position_geometry_window(eventp); /* Translate x,y into local screen coordinates, * in case Xinerama is used. */ fscr.xypos.x = x; fscr.xypos.y = y; FScreenTranslateCoordinates( NULL, FSCREEN_GLOBAL, &fscr, FSCREEN_XYPOS, &x, &y); (void)sprintf(str, GEOMETRY_WINDOW_POS_STRING, x, y); if (Init) { XClearWindow(dpy, Scr.SizeWindow); } else { /* just clear indside the relief lines to reduce flicker */ XClearArea(dpy, Scr.SizeWindow, GEOMETRY_WINDOW_BW, GEOMETRY_WINDOW_BW, Scr.SizeStringWidth, Scr.DefaultFont->height, False); } if (Pdepth >= 2) { RelieveRectangle( dpy, Scr.SizeWindow, 0, 0, Scr.SizeStringWidth + GEOMETRY_WINDOW_BW * 2 - 1, Scr.DefaultFont->height + GEOMETRY_WINDOW_BW * 2 - 1, Scr.StdReliefGC, Scr.StdShadowGC, GEOMETRY_WINDOW_BW); } offset = (Scr.SizeStringWidth - FlocaleTextWidth(Scr.DefaultFont, str, strlen(str))) / 2; offset += GEOMETRY_WINDOW_BW; memset(&fstr, 0, sizeof(fstr)); if (Scr.DefaultColorset >= 0) { fstr.colorset = &Colorset[Scr.DefaultColorset]; fstr.flags.has_colorset = True; } fstr.str = str; fstr.win = Scr.SizeWindow; fstr.gc = Scr.StdGC; fstr.x = offset; fstr.y = Scr.DefaultFont->ascent + GEOMETRY_WINDOW_BW; FlocaleDrawString(dpy, Scr.DefaultFont, &fstr, 0); return; } /* * * Procedure: * DisplaySize - display the size in the dimensions window * * Inputs: * tmp_win - the current fvwm window * width - the width of the rubber band * height - the height of the rubber band * */ static void DisplaySize( const FvwmWindow *tmp_win, const XEvent *eventp, int width, int height, Bool Init, Bool resetLast) { char str[100]; int dwidth,dheight,offset; size_borders b; static int last_width = 0; static int last_height = 0; FlocaleWinString fstr; if (Scr.gs.do_hide_resize_window) { return; } position_geometry_window(eventp); if (resetLast) { last_width = 0; last_height = 0; } if (last_width == width && last_height == height) { return; } last_width = width; last_height = height; get_window_borders(tmp_win, &b); dheight = height - b.total_size.height; dwidth = width - b.total_size.width; dwidth -= tmp_win->hints.base_width; dheight -= tmp_win->hints.base_height; dwidth /= tmp_win->hints.width_inc; dheight /= tmp_win->hints.height_inc; (void)sprintf(str, GEOMETRY_WINDOW_SIZE_STRING, dwidth, dheight); if (Init) { XClearWindow(dpy,Scr.SizeWindow); } else { /* just clear indside the relief lines to reduce flicker */ XClearArea( dpy, Scr.SizeWindow, GEOMETRY_WINDOW_BW, GEOMETRY_WINDOW_BW, Scr.SizeStringWidth, Scr.DefaultFont->height, False); } if (Pdepth >= 2) { RelieveRectangle( dpy, Scr.SizeWindow, 0, 0, Scr.SizeStringWidth + GEOMETRY_WINDOW_BW * 2 - 1, Scr.DefaultFont->height + GEOMETRY_WINDOW_BW*2 - 1, Scr.StdReliefGC, Scr.StdShadowGC, GEOMETRY_WINDOW_BW); } offset = (Scr.SizeStringWidth - FlocaleTextWidth(Scr.DefaultFont, str, strlen(str))) / 2; offset += GEOMETRY_WINDOW_BW; memset(&fstr, 0, sizeof(fstr)); if (Scr.DefaultColorset >= 0) { fstr.colorset = &Colorset[Scr.DefaultColorset]; fstr.flags.has_colorset = True; } fstr.str = str; fstr.win = Scr.SizeWindow; fstr.gc = Scr.StdGC; fstr.x = offset; fstr.y = Scr.DefaultFont->ascent + GEOMETRY_WINDOW_BW; FlocaleDrawString(dpy, Scr.DefaultFont, &fstr, 0); return; } static Bool resize_move_window(F_CMD_ARGS) { int FinalX = 0; int FinalY = 0; int FinalW = 0; int FinalH = 0; int n; int x,y; Bool fWarp = False; Bool fPointer = False; int dx; int dy; size_borders b; FvwmWindow *fw = exc->w.fw; Window w = exc->w.w; if (!is_function_allowed(F_MOVE, NULL, fw, RQORIG_PROGRAM_US, False)) { return False; } if (!is_function_allowed(F_RESIZE, NULL, fw, RQORIG_PROGRAM_US, True)) { return False; } /* gotta have a window */ w = FW_W_FRAME(fw); if (!XGetGeometry( dpy, w, &JunkRoot, &x, &y, (unsigned int*)&FinalW, (unsigned int*)&FinalH, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth)) { XBell(dpy, 0); return False; } FinalX = x; FinalY = y; get_window_borders(fw, &b); n = GetResizeMoveArguments( &action, fw->hints.base_width, fw->hints.base_height, fw->hints.width_inc, fw->hints.height_inc, &b, &FinalX, &FinalY, &FinalW, &FinalH, &fWarp, &fPointer); if (n < 4) { return False; } if (IS_MAXIMIZED(fw)) { /* must redraw the buttons now so that the 'maximize' button * does not stay depressed. */ SET_MAXIMIZED(fw, 0); border_draw_decorations( fw, PART_BUTTONS, (fw == Scr.Hilite), True, CLEAR_ALL, NULL, NULL); } dx = FinalX - fw->g.frame.x; dy = FinalY - fw->g.frame.y; /* size will be less or equal to requested */ constrain_size(fw, NULL, &FinalW, &FinalH, 0, 0, 0); if (IS_SHADED(fw)) { frame_setup_window( fw, FinalX, FinalY, FinalW, fw->g.frame.height, False); } else { frame_setup_window(fw, FinalX, FinalY, FinalW, FinalH, True); } if (fWarp) { FWarpPointer( dpy, None, None, 0, 0, 0, 0, FinalX - x, FinalY - y); } if (IS_MAXIMIZED(fw)) { fw->g.max.x += dx; fw->g.max.y += dy; } else { fw->g.normal.x += dx; fw->g.normal.y += dy; } update_absolute_geometry(fw); maximize_adjust_offset(fw); XFlush(dpy); GNOME_SetWinArea(fw); return True; } void CMD_ResizeMove(F_CMD_ARGS) { FvwmWindow *fw = exc->w.fw; if (IS_EWMH_FULLSCREEN(fw)) { /* do not unmaximize ! */ CMD_ResizeMoveMaximize(F_PASS_ARGS); return; } resize_move_window(F_PASS_ARGS); return; } static void InteractiveMove( Window *win, const exec_context_t *exc, int *FinalX, int *FinalY, Bool do_start_at_pointer) { int origDragX,origDragY,DragX, DragY, DragWidth, DragHeight; int XOffset, YOffset; Window w; Bool do_move_opaque = False; w = *win; if (Scr.bo.do_install_root_cmap) { InstallRootColormap(); } else { InstallFvwmColormap(); } /* warp the pointer to the cursor position from before menu appeared */ /* domivogt (17-May-1999): an XFlush should not hurt anyway, so do it * unconditionally to remove the external */ XFlush(dpy); if (do_start_at_pointer) { if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &DragX, &DragY, &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen */ DragX = 0; DragY = 0; } } else { /* Although a move is usually done with a button depressed we * have to check for ButtonRelease too since the event may be * faked. */ fev_get_evpos_or_query( dpy, Scr.Root, exc->x.elast, &DragX, &DragY); } MyXGrabServer(dpy); if (!XGetGeometry( dpy, w, &JunkRoot, &origDragX, &origDragY, (unsigned int*)&DragWidth, (unsigned int*)&DragHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth)) { MyXUngrabServer(dpy); return; } MyXGrabKeyboard(dpy); if (do_start_at_pointer) { origDragX = DragX; origDragY = DragY; } if (IS_ICONIFIED(exc->w.fw)) { do_move_opaque = True; } else if (IS_MAPPED(exc->w.fw)) { float areapct; areapct = 100.0; areapct *= ((float)DragWidth / (float)Scr.MyDisplayWidth); areapct *= ((float)DragHeight / (float)Scr.MyDisplayHeight); /* round up */ areapct += 0.1; if (Scr.OpaqueSize < 0 || (float)areapct <= (float)Scr.OpaqueSize) { do_move_opaque = True; } } if (do_move_opaque) { MyXUngrabServer(dpy); } else { Scr.flags.is_wire_frame_displayed = True; } if (!do_move_opaque && IS_ICONIFIED(exc->w.fw)) { XUnmapWindow(dpy,w); } XOffset = origDragX - DragX; YOffset = origDragY - DragY; if (!Scr.gs.do_hide_position_window) { position_geometry_window(NULL); XMapRaised(dpy,Scr.SizeWindow); } __move_loop( exc, XOffset, YOffset, DragWidth, DragHeight, FinalX, FinalY, do_move_opaque, CRS_MOVE); if (!Scr.gs.do_hide_position_window) { XUnmapWindow(dpy,Scr.SizeWindow); } if (Scr.bo.do_install_root_cmap) { UninstallRootColormap(); } else { UninstallFvwmColormap(); } if (!do_move_opaque) { /* Throw away some events that dont interest us right now. */ discard_events(EnterWindowMask|LeaveWindowMask); Scr.flags.is_wire_frame_displayed = False; MyXUngrabServer(dpy); } MyXUngrabKeyboard(dpy); return; } /* Perform the movement of the window. ppctMovement *must* have a 1.0 entry * somewhere in ins list of floats, and movement will stop when it hits a 1.0 * entry */ static void AnimatedMoveAnyWindow( FvwmWindow *fw, Window w, int startX, int startY, int endX, int endY, Bool fWarpPointerToo, int cmsDelay, float *ppctMovement, MenuRepaintTransparentParameters *pmrtp) { int pointerX, pointerY; int currentX, currentY; int lastX, lastY; int deltaX, deltaY; Bool first = True; XEvent evdummy; unsigned int draw_parts = PART_NONE; if (!is_function_allowed(F_MOVE, NULL, fw, RQORIG_PROGRAM_US, False)) { return; } /* set our defaults */ if (ppctMovement == NULL) { ppctMovement = rgpctMovementDefault; } if (cmsDelay < 0) { cmsDelay = cmsDelayDefault; } if (startX < 0 || startY < 0) { if ( !XGetGeometry( dpy, w, &JunkRoot, ¤tX, ¤tY, (unsigned int*)&JunkWidth, (unsigned int*)&JunkHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth)) { XBell(dpy, 0); return; } if (startX < 0) { startX = currentX; } if (startY < 0) { startY = currentY; } } deltaX = endX - startX; deltaY = endY - startY; lastX = startX; lastY = startY; if (deltaX == 0 && deltaY == 0) { /* go nowhere fast */ return; } if (fw && w == FW_W_FRAME(fw)) { draw_parts = border_get_transparent_decorations_part(fw); } /* Needed for aborting */ MyXGrabKeyboard(dpy); do { currentX = startX + deltaX * (*ppctMovement); currentY = startY + deltaY * (*ppctMovement); if (lastX == currentX && lastY == currentY) { /* don't waste time in the same spot */ continue; } if (pmrtp != NULL) { update_transparent_menu_bg( pmrtp, lastX, lastY, currentX, currentY, endX, endY); } XMoveWindow(dpy,w,currentX,currentY); if (pmrtp != NULL) { repaint_transparent_menu( pmrtp, first, currentX, currentY, endX, endY, True); } else if (draw_parts != PART_NONE) { border_draw_decorations( fw, draw_parts, ((fw == get_focus_window())) ? True : False, True, CLEAR_ALL, NULL, NULL); } if (fw && pmrtp == NULL && IS_TEAR_OFF_MENU(fw)) { menu_redraw_transparent_tear_off_menu(fw, False); } if (fWarpPointerToo == True) { if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &JunkX, &JunkY, &pointerX, &pointerY, &JunkMask) == False) { /* pointer is on a different screen */ pointerX = currentX; pointerY = currentY; } else { pointerX += currentX - lastX; pointerY += currentY - lastY; } FWarpPointer( dpy, None, Scr.Root, 0, 0, 0, 0, pointerX, pointerY); } if (fw && !IS_SHADED(fw) && !Scr.bo.do_disable_configure_notify) { /* send configure notify event for windows that care * about their location */ SendConfigureNotify( fw, currentX, currentY, fw->g.frame.width, fw->g.frame.height, 0, False); #ifdef FVWM_DEBUG_MSGS fvwm_msg(DBG,"AnimatedMoveAnyWindow", "Sent ConfigureNotify (w == %d, h == %d)", fw->g.frame.width, fw->g.frame.height); #endif } XFlush(dpy); if (fw) { fw->g.frame.x = currentX; fw->g.frame.y = currentY; update_absolute_geometry(fw); maximize_adjust_offset(fw); BroadcastConfig(M_CONFIGURE_WINDOW, fw); FlushAllMessageQueues(); } usleep(cmsDelay * 1000); /* usleep takes microseconds */ /* this didn't work for me -- maybe no longer necessary since * we warn the user when they use > .5 seconds as a * between-frame delay time. * * domivogt (28-apr-1999): That is because the keyboard was not * grabbed. works nicely now. */ if (FCheckMaskEvent( dpy, ButtonPressMask|ButtonReleaseMask|KeyPressMask, &evdummy)) { /* finish the move immediately */ if (pmrtp != NULL) { update_transparent_menu_bg( pmrtp, lastX, lastY, currentX, currentY, endX, endY); } XMoveWindow(dpy,w,endX,endY); if (pmrtp != NULL) { repaint_transparent_menu( pmrtp, first, endX, endY, endX, endY, True); } break; } lastX = currentX; lastY = currentY; first = False; } while (*ppctMovement != 1.0 && ppctMovement++); MyXUngrabKeyboard(dpy); XFlush(dpy); if (fw) { GNOME_SetWinArea(fw); } return; } /* used for moving menus, not a client window */ void AnimatedMoveOfWindow( Window w, int startX, int startY, int endX, int endY, Bool fWarpPointerToo, int cmsDelay, float *ppctMovement, MenuRepaintTransparentParameters *pmrtp) { AnimatedMoveAnyWindow( NULL, w, startX, startY, endX, endY, fWarpPointerToo, cmsDelay, ppctMovement, pmrtp); return; } /* used for moving client windows */ void AnimatedMoveFvwmWindow( FvwmWindow *fw, Window w, int startX, int startY, int endX, int endY, Bool fWarpPointerToo, int cmsDelay, float *ppctMovement) { AnimatedMoveAnyWindow( fw, w, startX, startY, endX, endY, fWarpPointerToo, cmsDelay, ppctMovement, NULL); return; } int placement_binding(int button, KeySym keysym, int modifier, char *action) { if (keysym != 0) { /* fixme */ fvwm_msg( ERR, "placement_binding", "sorry, placement keybindings not allowed. yet."); return 1; } if (modifier != 0) { /* fixme */ fvwm_msg( ERR, "placement_binding", "sorry, placement binding modifiers not allowed. yet."); return 1; } if (strcmp(action,"-") == 0 || strcasecmp(action,"CancelPlacement") == 0) { if (keysym == 0) /* must be button binding */ { if (button == 0) { move_drag_finish_button_mask = 0; move_interactive_finish_button_mask = 0; } else if (button > 0 && button <= NUMBER_OF_EXTENDED_MOUSE_BUTTONS) { move_drag_finish_button_mask &= ~(1<<(button-1)); move_interactive_finish_button_mask &= ~(1<<(button-1)); } } } else if (strcasecmp(action,"CancelPlacementDrag") == 0) { if (keysym == 0) /* must be button binding */ { if (button == 0) { move_drag_finish_button_mask = 0; } else if (button > 0 && button <= NUMBER_OF_EXTENDED_MOUSE_BUTTONS) { move_drag_finish_button_mask &= ~(1<<(button-1)); } } } else if (strcasecmp(action,"CancelPlacementInteractive") == 0) { if (keysym == 0) /* must be button binding */ { if (button == 0) { move_interactive_finish_button_mask = 0; } else if (button > 0 && button <= NUMBER_OF_EXTENDED_MOUSE_BUTTONS) { move_interactive_finish_button_mask &= ~(1<<(button-1)); } } } else if (strcasecmp(action,"PlaceWindow") == 0) { if (keysym == 0) /* must be button binding */ { if (button == 0) { move_interactive_finish_button_mask = move_drag_finish_button_mask = (1< 0 && button <= NUMBER_OF_EXTENDED_MOUSE_BUTTONS) { move_drag_finish_button_mask |= (1<<(button-1)); move_interactive_finish_button_mask |= (1<<(button-1)); } } } else if (strcasecmp(action,"PlaceWindowDrag") == 0) { if (keysym == 0) /* must be button binding */ { if (button == 0) { move_drag_finish_button_mask = (1< 0 && button <= NUMBER_OF_EXTENDED_MOUSE_BUTTONS) { move_drag_finish_button_mask |= (1<<(button-1)); } } } else if (strcasecmp(action,"PlaceWindowInteractive") == 0) { if (keysym == 0) /* must be button binding */ { if (button == 0) { move_interactive_finish_button_mask = (1< 0 && button <= NUMBER_OF_EXTENDED_MOUSE_BUTTONS) { move_interactive_finish_button_mask |= (1<<(button-1)); } } } else { fvwm_msg( ERR, "placement_binding", "invalid action %s", action); } return 0; } /* * * Start a window move operation * */ void __move_icon( FvwmWindow *fw, int x, int y, int old_x, int old_y, Bool do_move_animated, Bool do_warp_pointer) { rectangle gt; rectangle gp; Bool has_icon_title; Bool has_icon_picture; Window tw; int tx; int ty; set_icon_position(fw, x, y); broadcast_icon_geometry(fw, False); has_icon_title = get_visible_icon_title_geometry(fw, >); has_icon_picture = get_visible_icon_picture_geometry(fw, &gp); if (has_icon_picture) { tw = FW_W_ICON_PIXMAP(fw); tx = gp.x; ty = gp.y; } else if (has_icon_title) { tw = FW_W_ICON_TITLE(fw); tx = gt.x; ty = gt.y; } else { return; } if (do_move_animated) { AnimatedMoveOfWindow( tw, -1, -1, tx, ty, do_warp_pointer, -1, NULL, NULL); do_warp_pointer = 0; } if (has_icon_title) { XMoveWindow(dpy, FW_W_ICON_TITLE(fw), gt.x, gt.y); } if (has_icon_picture) { XMoveWindow(dpy, FW_W_ICON_PIXMAP(fw), gp.x, gp.y); if (fw->Desk == Scr.CurrentDesk) { XMapWindow(dpy, FW_W_ICON_PIXMAP(fw)); if (has_icon_title) { XMapWindow(dpy, FW_W_ICON_TITLE(fw)); } } } if (do_warp_pointer) { FWarpPointer(dpy, None, None, 0, 0, 0, 0, x - old_x, y - old_y); } return; } static void __move_window(F_CMD_ARGS, Bool do_animate, int mode) { int FinalX = 0; int FinalY = 0; int n; int x; int y; int width, height; int page_x, page_y; Bool fWarp = False; Bool fPointer = False; int dx; int dy; FvwmWindow *fw = exc->w.fw; Window w; if (!is_function_allowed(F_MOVE, NULL, fw, RQORIG_PROGRAM_US, False)) { return; } /* gotta have a window */ w = FW_W_FRAME(fw); if (IS_ICONIFIED(fw)) { if (FW_W_ICON_PIXMAP(fw) != None) { w = FW_W_ICON_PIXMAP(fw); XUnmapWindow(dpy,FW_W_ICON_TITLE(fw)); } else { w = FW_W_ICON_TITLE(fw); } if (w == None && (mode == MOVE_PAGE || mode == MOVE_SCREEN)) { w = FW_W_FRAME(fw); } } if ( !XGetGeometry( dpy, w, &JunkRoot, &x, &y, (unsigned int*)&width, (unsigned int*)&height, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth)) { return; } if (mode == MOVE_PAGE && IS_STICKY_ACROSS_PAGES(fw)) { return; } if (mode == MOVE_PAGE) { rectangle r; rectangle s; rectangle t; do_animate = False; r.x = x; r.y = y; r.width = width; r.height = height; get_absolute_geometry(&t, &r); get_page_offset_rectangle(&page_x, &page_y, &t); if (!get_page_arguments(action, &page_x, &page_y)) { page_x = Scr.Vx; page_y = Scr.Vy; } s.x = page_x - Scr.Vx; s.y = page_y - Scr.Vy; s.width = Scr.MyDisplayWidth; s.height = Scr.MyDisplayHeight; fvwmrect_move_into_rectangle(&r, &s); FinalX = r.x; FinalY = r.y; } else if (mode == MOVE_SCREEN) { rectangle r; rectangle s; rectangle p; int fscreen; do_animate = False; fscreen = FScreenGetScreenArgument( action, FSCREEN_SPEC_CURRENT); FScreenGetScrRect( NULL, fscreen, &s.x, &s.y, &s.width, &s.height); page_x = Scr.Vx; page_y = Scr.Vy; r.x = x; r.y = y; r.width = width; r.height = height; p.x = page_x - Scr.Vx; p.y = page_y - Scr.Vy; p.width = Scr.MyDisplayWidth; p.height = Scr.MyDisplayHeight; /* move to page first */ fvwmrect_move_into_rectangle(&r, &p); /* then move to screen */ fvwmrect_move_into_rectangle(&r, &s); FinalX = r.x; FinalY = r.y; } else { FinalX = x; FinalY = y; n = GetMoveArguments( &action, width, height, &FinalX, &FinalY, &fWarp, &fPointer, True); if (n != 2 || fPointer) { InteractiveMove(&w, exc, &FinalX, &FinalY, fPointer); } else if (IS_ICONIFIED(fw)) { SET_ICON_MOVED(fw, 1); } } if (w == FW_W_FRAME(fw)) { dx = FinalX - fw->g.frame.x; dy = FinalY - fw->g.frame.y; if (do_animate) { AnimatedMoveFvwmWindow( fw, w, -1, -1, FinalX, FinalY, fWarp, -1, NULL); } frame_setup_window( fw, FinalX, FinalY, fw->g.frame.width, fw->g.frame.height, True); if (fWarp & !do_animate) { FWarpPointer( dpy, None, None, 0, 0, 0, 0, FinalX - x, FinalY - y); } if (IS_MAXIMIZED(fw)) { fw->g.max.x += dx; fw->g.max.y += dy; } else { fw->g.normal.x += dx; fw->g.normal.y += dy; } update_absolute_geometry(fw); maximize_adjust_offset(fw); XFlush(dpy); GNOME_SetWinArea(fw); } else /* icon window */ { __move_icon(fw, FinalX, FinalY, x, y, do_animate, fWarp); XFlush(dpy); } focus_grab_buttons_on_layer(fw->layer); return; } void CMD_Move(F_CMD_ARGS) { __move_window(F_PASS_ARGS, False, MOVE_NORMAL); return; } void CMD_AnimatedMove(F_CMD_ARGS) { __move_window(F_PASS_ARGS, True, MOVE_NORMAL); return; } void CMD_MoveToPage(F_CMD_ARGS) { __move_window(F_PASS_ARGS, False, MOVE_PAGE); return; } void CMD_MoveToScreen(F_CMD_ARGS) { __move_window(F_PASS_ARGS, False, MOVE_SCREEN); return; } /* This function does the SnapAttraction stuff. It takes x and y coordinates * (*px and *py) and returns the snapped values. */ static void DoSnapAttract( FvwmWindow *fw, int Width, int Height, int *px, int *py) { int nyt,nxl,dist,closestLeft,closestRight,closestBottom,closestTop; rectangle self; /* resist based on window edges */ closestTop = fw->snap_attraction.proximity; closestBottom = fw->snap_attraction.proximity; closestRight = fw->snap_attraction.proximity; closestLeft = fw->snap_attraction.proximity; nxl = -99999; nyt = -99999; self.x = *px; self.y = *py; self.width = Width; self.height = Height; { rectangle g; Bool rc; rc = get_visible_icon_title_geometry(fw, &g); if (rc == True) { self.height += g.height; } } /* * Snap grid handling */ if (fw->snap_grid_x > 1 && nxl == -99999) { if (*px != *px / fw->snap_grid_x * fw->snap_grid_x) { *px = (*px + ((*px >= 0) ? fw->snap_grid_x : -fw->snap_grid_x) / 2) / fw->snap_grid_x * fw->snap_grid_x; } } if (fw->snap_grid_y > 1 && nyt == -99999) { if (*py != *py / fw->snap_grid_y * fw->snap_grid_y) { *py = (*py + ((*py >= 0) ? fw->snap_grid_y : -fw->snap_grid_y) / 2) / fw->snap_grid_y * fw->snap_grid_y; } } /* * snap attraction */ /* snap to other windows or icons*/ if (fw->snap_attraction.proximity > 0 && (fw->snap_attraction.mode & (SNAP_ICONS | SNAP_WINDOWS | SNAP_SAME))) { FvwmWindow *tmp; int maskout = (SNAP_SCREEN | SNAP_SCREEN_WINDOWS | SNAP_SCREEN_ICONS | SNAP_SCREEN_ALL); for (tmp = Scr.FvwmRoot.next; tmp; tmp = tmp->next) { rectangle other; if (fw->Desk != tmp->Desk || fw == tmp) { continue; } /* check snapping type */ switch (fw->snap_attraction.mode & ~(maskout)) { case SNAP_WINDOWS: /* we only snap windows */ if (IS_ICONIFIED(tmp) || IS_ICONIFIED(fw)) { continue; } break; case SNAP_ICONS: /* we only snap icons */ if (!IS_ICONIFIED(tmp) || !IS_ICONIFIED(fw)) { continue; } break; case SNAP_SAME: /* we don't snap unequal */ if (IS_ICONIFIED(tmp) != IS_ICONIFIED(fw)) { continue; } break; default: /* All */ /* NOOP */ break; } /* get other window dimensions */ get_visible_window_or_icon_geometry(tmp, &other); /* prevent that window snaps off screen */ if (other.x <= 0) { other.x -= fw->snap_attraction.proximity + 10000; other.width += fw->snap_attraction.proximity + 10000; } if (other.y <= 0) { other.y -= fw->snap_attraction.proximity + 10000; other.height += fw->snap_attraction.proximity + 10000; } if (other.x + other.width >= Scr.MyDisplayWidth) { other.width += fw->snap_attraction.proximity + 10000; } if (other.y + other.height >= Scr.MyDisplayHeight) { other.height += fw->snap_attraction.proximity + 10000; } /* snap horizontally */ if ( other.y + other.height > *py && other.y < *py + self.height) { dist = abs(other.x - (*px + self.width)); if (dist < closestRight) { closestRight = dist; if (*px + self.width >= other.x && *px + self.width < other.x + fw->snap_attraction.proximity) { nxl = other.x - self.width; } if (*px + self.width >= other.x - fw->snap_attraction.proximity && *px + self.width < other.x) { nxl = other.x - self.width; } } dist = abs(other.x + other.width - *px); if (dist < closestLeft) { closestLeft = dist; if (*px <= other.x + other.width && *px > other.x + other.width - fw->snap_attraction.proximity) { nxl = other.x + other.width; } if (*px <= other.x + other.width + fw->snap_attraction.proximity && *px > other.x + other.width) { nxl = other.x + other.width; } } } /* snap vertically */ if ( other.x + other.width > *px && other.x < *px + self.width) { dist = abs(other.y - (*py + self.height)); if (dist < closestBottom) { closestBottom = dist; if (*py + self.height >= other.y && *py + self.height < other.y + fw->snap_attraction.proximity) { nyt = other.y - self.height; } if (*py + self.height >= other.y - fw->snap_attraction.proximity && *py + self.height < other.y) { nyt = other.y - self.height; } } dist = abs(other.y + other.height - *py); if (dist < closestTop) { closestTop = dist; if (*py <= other.y + other.height && *py > other.y + other.height - fw->snap_attraction.proximity) { nyt = other.y + other.height; } if (*py <= other.y + other.height + fw->snap_attraction.proximity && *py > other.y + other.height) { nyt = other.y + other.height; } } } } /* for */ } /* snap to other windows */ /* snap to screen egdes */ if (fw->snap_attraction.proximity > 0 && ( ( fw->snap_attraction.mode & SNAP_SCREEN && ( fw->snap_attraction.mode & SNAP_SAME || ( IS_ICONIFIED(fw) && fw->snap_attraction.mode & SNAP_ICONS ) || ( !IS_ICONIFIED(fw) && fw->snap_attraction.mode & SNAP_WINDOWS ))) || ( !IS_ICONIFIED(fw) && fw->snap_attraction.mode & SNAP_SCREEN_WINDOWS ) || ( IS_ICONIFIED(fw) && fw->snap_attraction.mode & SNAP_SCREEN_ICONS ) || fw->snap_attraction.mode & SNAP_SCREEN_ALL )) { /* horizontally */ if (!(Scr.MyDisplayWidth < (*px) || (*px + self.width) < 0)) { dist = abs(Scr.MyDisplayHeight - (*py + self.height)); if (dist < closestBottom) { closestBottom = dist; if (*py + self.height >= Scr.MyDisplayHeight && *py + self.height < Scr.MyDisplayHeight + fw->snap_attraction.proximity) { nyt = Scr.MyDisplayHeight - self.height; } if (*py + self.height >= Scr.MyDisplayHeight - fw->snap_attraction.proximity && *py + self.height < Scr.MyDisplayHeight) { nyt = Scr.MyDisplayHeight - self.height; } } dist = abs(*py); if (dist < closestTop) { closestTop = dist; if ((*py <= 0)&&(*py > - fw->snap_attraction.proximity)) { nyt = 0; } if ((*py <= fw->snap_attraction.proximity)&&(*py > 0)) { nyt = 0; } } } /* horizontally */ /* vertically */ if (!(Scr.MyDisplayHeight < (*py) || (*py + self.height) < 0)) { dist = abs( Scr.MyDisplayWidth - (*px + self.width)); if (dist < closestRight) { closestRight = dist; if (*px + self.width >= Scr.MyDisplayWidth && *px + self.width < Scr.MyDisplayWidth + fw->snap_attraction.proximity) { nxl = Scr.MyDisplayWidth - self.width; } if (*px + self.width >= Scr.MyDisplayWidth - fw->snap_attraction.proximity && *px + self.width < Scr.MyDisplayWidth) { nxl = Scr.MyDisplayWidth - self.width; } } dist = abs(*px); if (dist < closestLeft) { closestLeft = dist; if ((*px <= 0) && (*px > - fw->snap_attraction.proximity)) { nxl = 0; } if ((*px <= fw->snap_attraction.proximity) && (*px > 0)) { nxl = 0; } } } /* vertically */ } /* snap to screen edges */ if (nxl != -99999) { *px = nxl; } if (nyt != -99999) { *py = nyt; } /* * Resist moving windows beyond the edge of the screen */ if (fw->edge_resistance_move > 0) { /* snap to right edge */ if ( *px + Width >= Scr.MyDisplayWidth && *px + Width < Scr.MyDisplayWidth + fw->edge_resistance_move) { *px = Scr.MyDisplayWidth - Width; } /* snap to left edge */ else if ((*px <= 0) && (*px > -fw->edge_resistance_move)) { *px = 0; } /* snap to bottom edge */ if ( *py + Height >= Scr.MyDisplayHeight && *py + Height < Scr.MyDisplayHeight + fw->edge_resistance_move) { *py = Scr.MyDisplayHeight - Height; } /* snap to top edge */ else if (*py <= 0 && *py > -fw->edge_resistance_move) { *py = 0; } } /* Resist moving windows between xineramascreens */ if (fw->edge_resistance_xinerama_move > 0 && FScreenIsEnabled()) { int scr_x0, scr_y0; int scr_x1, scr_y1; Bool do_recalc_rectangle = False; FScreenGetResistanceRect( *px, *py, Width, Height, &scr_x0, &scr_y0, &scr_x1, &scr_y1); /* snap to right edge */ if (scr_x1 < Scr.MyDisplayWidth && *px + Width >= scr_x1 && *px + Width < scr_x1 + fw->edge_resistance_xinerama_move) { *px = scr_x1 - Width; do_recalc_rectangle = True; } /* snap to left edge */ else if ( scr_x0 > 0 && *px <= scr_x0 && scr_x0 - *px < fw->edge_resistance_xinerama_move) { *px = scr_x0; do_recalc_rectangle = True; } if (do_recalc_rectangle) { /* Snapping in X direction can move the window off a * screen. Thus, it may no longer be necessary to snap * in Y direction. */ FScreenGetResistanceRect( *px, *py, Width, Height, &scr_x0, &scr_y0, &scr_x1, &scr_y1); } /* snap to bottom edge */ if (scr_y1 < Scr.MyDisplayHeight && *py + Height >= scr_y1 && *py + Height < scr_y1 + fw->edge_resistance_xinerama_move) { *py = scr_y1 - Height; } /* snap to top edge */ else if ( scr_y0 > 0 && *py <= scr_y0 && scr_y0 - *py < fw->edge_resistance_xinerama_move) { *py = scr_y0; } } return; } /* * * Move the rubberband around, return with the new window location * * Returns True if the window has to be resized after the move. * */ Bool __move_loop( const exec_context_t *exc, int XOffset, int YOffset, int Width, int Height, int *FinalX, int *FinalY, Bool do_move_opaque, int cursor) { extern Window bad_window; Bool is_finished = False; Bool is_aborted = False; int xl,xl2,yt,yt2,delta_x,delta_y,paged; unsigned int button_mask = 0; FvwmWindow fw_copy; int dx = Scr.EdgeScrollX ? Scr.EdgeScrollX : Scr.MyDisplayWidth; int dy = Scr.EdgeScrollY ? Scr.EdgeScrollY : Scr.MyDisplayHeight; const int vx = Scr.Vx; const int vy = Scr.Vy; int xl_orig = 0; int yt_orig = 0; int cnx = 0; int cny = 0; int x_virtual_offset = 0; int y_virtual_offset = 0; Bool sent_cn = False; Bool do_resize_too = False; int x_bak; int y_bak; Window move_w = None; int orig_icon_x = 0; int orig_icon_y = 0; Bool do_snap = True; Bool was_snapped = False; /* if Alt is initially pressed don't enable no-snap until Alt is * released */ Bool nosnap_enabled = False; /* Must not set placed by button if the event is a modified KeyEvent */ Bool is_fake_event; FvwmWindow *fw = exc->w.fw; unsigned int draw_parts = PART_NONE; XEvent e; if (!GrabEm(cursor, GRAB_NORMAL)) { XBell(dpy, 0); return False; } if (!IS_MAPPED(fw) && !IS_ICONIFIED(fw)) { do_move_opaque = False; } bad_window = None; if (IS_ICONIFIED(fw)) { if (FW_W_ICON_PIXMAP(fw) != None) { move_w = FW_W_ICON_PIXMAP(fw); } else if (FW_W_ICON_TITLE(fw) != None) { move_w = FW_W_ICON_TITLE(fw); } } else { move_w = FW_W_FRAME(fw); } if ( !XGetGeometry( dpy, move_w, &JunkRoot, &x_bak, &y_bak, (unsigned int*)&JunkWidth, (unsigned int*)&JunkHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth)) { /* This is allright here since the window may not be mapped * yet. */ } if (IS_ICONIFIED(fw)) { rectangle g; get_visible_icon_geometry(fw, &g); orig_icon_x = g.x; orig_icon_y = g.y; } /* make a copy of the fw structure for sending to the pager */ memcpy(&fw_copy, fw, sizeof(FvwmWindow)); /* prevent flicker when paging */ SET_WINDOW_BEING_MOVED_OPAQUE(fw, do_move_opaque); if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &xl, &yt, &JunkX, &JunkY, &button_mask) == False) { /* pointer is on a different screen */ xl = 0; yt = 0; } else { xl += XOffset; yt += YOffset; } button_mask &= DEFAULT_ALL_BUTTONS_MASK; xl_orig = xl; yt_orig = yt; /* draw initial outline */ if (!IS_ICONIFIED(fw) && ((!do_move_opaque && !Scr.gs.do_emulate_mwm) || !IS_MAPPED(fw))) { draw_move_resize_grid(xl, yt, Width - 1, Height - 1); } if (move_w == FW_W_FRAME(fw) && do_move_opaque) { draw_parts = border_get_transparent_decorations_part(fw); } DisplayPosition(fw, exc->x.elast, xl, yt, True); memset(&e, 0, sizeof(e)); /* Unset the placed by button mask. * If the move is canceled this will remain as zero. */ fw->placed_by_button = 0; while (!is_finished && bad_window != FW_W(fw)) { int rc = 0; int old_xl; int old_yt; old_xl = xl; old_yt = yt; /* wait until there is an interesting event */ while (rc != -1 && (!FPending(dpy) || !FCheckMaskEvent( dpy, ButtonPressMask | ButtonReleaseMask | KeyPressMask | PointerMotionMask | ButtonMotionMask | ExposureMask, &e))) { XEvent le; fev_get_last_event(&le); xl -= XOffset; yt -= YOffset; rc = HandlePaging( &le, dx, dy, &xl, &yt, &delta_x, &delta_y, False, False, True, fw->edge_delay_ms_move); /* Fake an event to force window reposition */ if (delta_x) { x_virtual_offset = 0; } xl += XOffset; if (delta_y) { y_virtual_offset = 0; } yt += YOffset; if (do_snap) { DoSnapAttract( fw, Width, Height, &xl, &yt); was_snapped = True; } fev_make_null_event(&e, dpy); e.type = MotionNotify; e.xmotion.time = fev_get_evtime(); e.xmotion.x_root = xl - XOffset; e.xmotion.y_root = yt - YOffset; e.xmotion.same_screen = True; break; } if (rc == -1) { /* block until an event arrives */ /* dv (2004-07-01): With XFree 4.1.0.1, some Mouse * events are not reported to fvwm when the pointer * moves very fast and suddenly stops in the corner of * the screen. Handle EnterNotify/LeaveNotify events * too to get an idea where the pointer might be. */ FMaskEvent( dpy, ButtonPressMask | ButtonReleaseMask | KeyPressMask | PointerMotionMask | ButtonMotionMask | ExposureMask | EnterWindowMask | LeaveWindowMask, &e); } /* discard extra events before a logical release */ if (e.type == MotionNotify || e.type == EnterNotify || e.type == LeaveNotify) { while (FPending(dpy) > 0 && FCheckMaskEvent( dpy, ButtonMotionMask | PointerMotionMask | ButtonPressMask | ButtonRelease | KeyPressMask | EnterWindowMask | LeaveWindowMask, &e)) { if (e.type == ButtonPress || e.type == ButtonRelease || e.type == KeyPress) { break; } } } if (e.type == EnterNotify || e.type == LeaveNotify) { XEvent e2; int x; int y; /* Query the pointer to catch the latest information. * This *is* necessary. */ if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &x, &y, &JunkX, &JunkY, &JunkMask) == True) { fev_make_null_event(&e2, dpy); e2.type = MotionNotify; e2.xmotion.time = fev_get_evtime(); e2.xmotion.x_root = x; e2.xmotion.y_root = y; e2.xmotion.state = JunkMask; e2.xmotion.same_screen = True; e = e2; fev_fake_event(&e); } else { /* pointer is on a different screen, * ignore event */ } } is_fake_event = False; /* Handle a limited number of key press events to allow * mouseless operation */ if (e.type == KeyPress) { Keyboard_shortcuts( &e, fw, &x_virtual_offset, &y_virtual_offset, ButtonRelease); is_fake_event = (e.type != KeyPress); } switch (e.type) { case KeyPress: if (!(e.xkey.state & Mod1Mask)) { nosnap_enabled = True; } do_snap = nosnap_enabled && (e.xkey.state & Mod1Mask) ? False : True; /* simple code to bag out of move - CKH */ if (XLookupKeysym(&(e.xkey), 0) == XK_Escape) { if (!do_move_opaque) { switch_move_resize_grid(False); } if (!IS_ICONIFIED(fw)) { if (do_move_opaque) { *FinalX = fw->g.frame.x; *FinalY = fw->g.frame.y; } } else { *FinalX = orig_icon_x; *FinalY = orig_icon_y; } is_aborted = True; is_finished = True; } break; case ButtonPress: if (e.xbutton.button <= NUMBER_OF_MOUSE_BUTTONS && ((Button1Mask << (e.xbutton.button - 1)) & button_mask)) { /* No new button was pressed, just a delayed * event */ break; } if (!IS_MAPPED(fw) && ((e.xbutton.button == 2 && !Scr.gs.do_emulate_mwm) || (e.xbutton.button == 1 && Scr.gs.do_emulate_mwm && (e.xbutton.state & ShiftMask)))) { do_resize_too = True; /* Fallthrough to button-release */ } else if (!button_mask && e.xbutton.button <= NUMBER_OF_EXTENDED_MOUSE_BUTTONS && e.xbutton.button > 0 && (move_interactive_finish_button_mask & (1<<(e.xbutton.button-1)))) { do_resize_too = False; break; } else if (button_mask && e.xbutton.button <= NUMBER_OF_EXTENDED_MOUSE_BUTTONS && e.xbutton.button > 0 && (move_drag_finish_button_mask & (1<<(e.xbutton.button-1)))) { do_resize_too = False; /* Fallthrough to button-release */ } else { /* Abort the move if * - the move started with a pressed button * and another button was pressed during the * operation * - Any button not in the * move_finish_button_mask is pressed */ /* if (button_mask) */ /* - button_mask will always be set here. * only add an if if we want to be able to * place windows dragged by other means * than releasing the initial button. */ { if (!do_move_opaque) { switch_move_resize_grid(False); } if (!IS_ICONIFIED(fw)) { *FinalX = fw->g.frame.x; *FinalY = fw->g.frame.y; } else { *FinalX = orig_icon_x; *FinalY = orig_icon_y; } is_aborted = True; is_finished = True; } break; } case ButtonRelease: if (!is_fake_event) { fw->placed_by_button = e.xbutton.button; } if (!do_move_opaque) { switch_move_resize_grid(False); } xl2 = e.xbutton.x_root + XOffset + x_virtual_offset; yt2 = e.xbutton.y_root + YOffset + y_virtual_offset; /* ignore the position of the button release if it was * on a different page. */ if (!(((xl < 0 && xl2 >= 0) || (xl >= 0 && xl2 < 0) || (yt < 0 && yt2 >= 0) || (yt >= 0 && yt2 < 0)) && (abs(xl - xl2) > Scr.MyDisplayWidth / 2 || abs(yt - yt2) > Scr.MyDisplayHeight / 2))) { xl = xl2; yt = yt2; } if (xl != xl_orig || yt != yt_orig || vx != Scr.Vx || vy != Scr.Vy || was_snapped) { /* only snap if the window actually moved! */ if (do_snap) { DoSnapAttract( fw, Width, Height, &xl, &yt); was_snapped = True; } } *FinalX = xl; *FinalY = yt; is_finished = True; break; case MotionNotify: if (e.xmotion.same_screen == False) { continue; } if (!(e.xmotion.state & Mod1Mask)) { nosnap_enabled = True; } do_snap = nosnap_enabled && (e.xmotion.state & Mod1Mask) ? False : True; xl = e.xmotion.x_root; yt = e.xmotion.y_root; if (xl > 0 && xl < Scr.MyDisplayWidth - 1) { /* pointer was moved away from the left/right * border with the mouse, reset the virtual x * offset */ x_virtual_offset = 0; } if (yt > 0 && yt < Scr.MyDisplayHeight - 1) { /* pointer was moved away from the top/bottom * border with the mouse, reset the virtual y * offset */ y_virtual_offset = 0; } xl += XOffset + x_virtual_offset; yt += YOffset + y_virtual_offset; if (do_snap) { DoSnapAttract(fw, Width, Height, &xl, &yt); was_snapped = True; } /* check Paging request once and only once after * outline redrawn redraw after paging if needed * - mab */ for (paged = 0; paged <= 1; paged++) { if (!do_move_opaque) { draw_move_resize_grid( xl, yt, Width - 1, Height - 1); } else { if (IS_ICONIFIED(fw)) { set_icon_position(fw, xl, yt); move_icon_to_position(fw); broadcast_icon_geometry( fw, False); } else { XMoveWindow( dpy, FW_W_FRAME(fw), xl, yt); } } DisplayPosition(fw, &e, xl, yt, False); /* prevent window from lagging behind mouse * when paging - mab */ if (paged == 0) { XEvent le; xl = e.xmotion.x_root; yt = e.xmotion.y_root; fev_get_last_event(&le); HandlePaging( &le, dx, dy, &xl, &yt, &delta_x, &delta_y, False, False, False, fw->edge_delay_ms_move); if (delta_x) { x_virtual_offset = 0; } xl += XOffset; if (delta_y) { y_virtual_offset = 0; } yt += YOffset; if (do_snap) { DoSnapAttract( fw, Width, Height, &xl, &yt); was_snapped = True; } if (!delta_x && !delta_y) { /* break from while * (paged <= 1) */ break; } } } break; case Expose: if (!do_move_opaque) { /* must undraw the rubber band in case the * event causes some drawing */ switch_move_resize_grid(False); } dispatch_event(&e); if (!do_move_opaque) { draw_move_resize_grid( xl, yt, Width - 1, Height - 1); } break; default: /* cannot happen */ break; } /* switch */ xl += x_virtual_offset; yt += y_virtual_offset; if (do_move_opaque && !IS_ICONIFIED(fw) && !IS_SHADED(fw) && !Scr.bo.do_disable_configure_notify) { /* send configure notify event for windows that care * about their location; don't send anything if * position didn't change */ if (!sent_cn || cnx != xl || cny != yt) { cnx = xl; cny = yt; sent_cn = True; SendConfigureNotify( fw, xl, yt, Width, Height, 0, False); #ifdef FVWM_DEBUG_MSGS fvwm_msg( DBG, "frame_setup_window", "Sent ConfigureNotify (w %d, h %d)", Width, Height); #endif } } if (do_move_opaque) { if (!IS_ICONIFIED(fw)) { fw_copy.g.frame.x = xl; fw_copy.g.frame.y = yt; } if (xl != old_xl || yt != old_yt) { /* only do this with opaque moves, (i.e. the * server is not grabbed) */ if (draw_parts != PART_NONE) { border_draw_decorations( fw, draw_parts, ((fw == get_focus_window())) ? True : False, True, CLEAR_ALL, NULL, NULL); } if (IS_TEAR_OFF_MENU(fw)) { menu_redraw_transparent_tear_off_menu( fw, False); } BroadcastConfig(M_CONFIGURE_WINDOW, &fw_copy); FlushAllMessageQueues(); } } } /* while (!is_finished) */ if (!Scr.gs.do_hide_position_window) { XUnmapWindow(dpy,Scr.SizeWindow); } if (is_aborted || bad_window == FW_W(fw)) { if (vx != Scr.Vx || vy != Scr.Vy) { MoveViewport(vx, vy, False); } if (is_aborted && do_move_opaque) { XMoveWindow(dpy, move_w, x_bak, y_bak); if (draw_parts != PART_NONE) { border_draw_decorations( fw, draw_parts, ((fw == get_focus_window())) ? True : False, True, CLEAR_ALL, NULL, NULL); } menu_redraw_transparent_tear_off_menu(fw, False); } if (bad_window == FW_W(fw)) { XUnmapWindow(dpy, move_w); border_undraw_decorations(fw); XBell(dpy, 0); } } if (!is_aborted && bad_window != FW_W(fw) && IS_ICONIFIED(fw)) { SET_ICON_MOVED(fw, 1); } UngrabEm(GRAB_NORMAL); if (!do_resize_too) { /* Don't wait for buttons to come up when user is placing a new * window and wants to resize it. */ WaitForButtonsUp(True); } SET_WINDOW_BEING_MOVED_OPAQUE(fw, 0); bad_window = None; return do_resize_too; } void CMD_MoveThreshold(F_CMD_ARGS) { int val = 0; if (GetIntegerArguments(action, NULL, &val, 1) < 1 || val < 0) { Scr.MoveThreshold = DEFAULT_MOVE_THRESHOLD; } else { Scr.MoveThreshold = val; } return; } void CMD_OpaqueMoveSize(F_CMD_ARGS) { int val; if (GetIntegerArguments(action, NULL, &val, 1) < 1) { if (strncasecmp(action, "unlimited", 9) == 0) { Scr.OpaqueSize = -1; } else { Scr.OpaqueSize = DEFAULT_OPAQUE_MOVE_SIZE; } } else { Scr.OpaqueSize = val; } return; } static char *hide_options[] = { "never", "move", "resize", NULL }; void CMD_HideGeometryWindow(F_CMD_ARGS) { char *token = PeekToken(action, NULL); Scr.gs.do_hide_position_window = 0; Scr.gs.do_hide_resize_window = 0; switch(GetTokenIndex(token, hide_options, 0, NULL)) { case 0: break; case 1: Scr.gs.do_hide_position_window = 1; break; case 2: Scr.gs.do_hide_resize_window = 1; break; default: Scr.gs.do_hide_position_window = 1; Scr.gs.do_hide_resize_window = 1; break; } return; } void CMD_SnapAttraction(F_CMD_ARGS) { char *cmd; size_t len; len = strlen(action); len += 99; cmd = safemalloc(len); sprintf(cmd, "Style * SnapAttraction %s", action); fvwm_msg( OLD, "CMD_SnapAttraction", "The command SnapAttraction is obsolete. Please use the" " following command instead:"); fvwm_msg(OLD, "", cmd); execute_function( cond_rc, exc, cmd, FUNC_DONT_REPEAT | FUNC_DONT_EXPAND_COMMAND); free(cmd); return; } void CMD_SnapGrid(F_CMD_ARGS) { char *cmd; size_t len; len = strlen(action); len += 99; cmd = safemalloc(len); sprintf(cmd, "Style * SnapGrid %s", action); fvwm_msg( OLD, "CMD_SnapGrid", "The command SnapGrid is obsolete. Please use the following" " command instead:"); fvwm_msg(OLD, "", cmd); execute_function( cond_rc, exc, cmd, FUNC_DONT_REPEAT | FUNC_DONT_EXPAND_COMMAND); free(cmd); return; } static Pixmap XorPixmap = None; void CMD_XorValue(F_CMD_ARGS) { int val; XGCValues gcv; unsigned long gcm; if (GetIntegerArguments(action, NULL, &val, 1) != 1) { val = 0; } PictureUseDefaultVisual(); gcm = GCFunction|GCLineWidth|GCForeground|GCFillStyle|GCSubwindowMode; gcv.subwindow_mode = IncludeInferiors; gcv.function = GXxor; gcv.line_width = 1; /* use passed in value, or try to calculate appropriate value if 0 */ /* ctwm method: */ /* gcv.foreground = (val1)?(val1):((((unsigned long) 1) << Scr.d_depth) - 1); */ /* Xlib programming manual suggestion: */ gcv.foreground = (val)? (val):(PictureBlackPixel() ^ PictureWhitePixel()); gcv.fill_style = FillSolid; gcv.subwindow_mode = IncludeInferiors; /* modify XorGC, only create once */ if (Scr.XorGC) { XChangeGC(dpy, Scr.XorGC, gcm, &gcv); } else { Scr.XorGC = fvwmlib_XCreateGC(dpy, Scr.Root, gcm, &gcv); } /* free up XorPixmap if neccesary */ if (XorPixmap != None) { XFreePixmap(dpy, XorPixmap); XorPixmap = None; } PictureUseFvwmVisual(); return; } void CMD_XorPixmap(F_CMD_ARGS) { char *PixmapName; FvwmPicture *xp; XGCValues gcv; unsigned long gcm; FvwmPictureAttributes fpa; action = GetNextToken(action, &PixmapName); if (PixmapName == NULL) { /* return to default value. */ action = "0"; CMD_XorValue(F_PASS_ARGS); return; } /* get the picture in the root visual, colorlimit is ignored because the * pixels will be freed */ fpa.mask = FPAM_NO_COLOR_LIMIT | FPAM_NO_ALPHA; PictureUseDefaultVisual(); xp = PGetFvwmPicture(dpy, Scr.Root, NULL, PixmapName, fpa); if (xp == NULL) { fvwm_msg(ERR,"SetXORPixmap","Can't find pixmap %s", PixmapName); free(PixmapName); PictureUseFvwmVisual(); return; } free(PixmapName); /* free up old pixmap */ if (XorPixmap != None) { XFreePixmap(dpy, XorPixmap); } /* make a copy of the picture pixmap */ XorPixmap = XCreatePixmap(dpy, Scr.Root, xp->width, xp->height, Pdepth); XCopyArea(dpy, xp->picture, XorPixmap, DefaultGC(dpy, Scr.screen), 0, 0, xp->width, xp->height, 0, 0); /* destroy picture and free colors */ PDestroyFvwmPicture(dpy, xp); PictureUseFvwmVisual(); /* create Graphics context */ gcm = GCFunction|GCLineWidth|GCTile|GCFillStyle|GCSubwindowMode; gcv.subwindow_mode = IncludeInferiors; gcv.function = GXxor; /* line width of 1 is necessary for Exceed servers */ gcv.line_width = 1; gcv.tile = XorPixmap; gcv.fill_style = FillTiled; gcv.subwindow_mode = IncludeInferiors; /* modify XorGC, only create once */ if (Scr.XorGC) { XChangeGC(dpy, Scr.XorGC, gcm, &gcv); } else { Scr.XorGC = fvwmlib_XCreateGC(dpy, Scr.Root, gcm, &gcv); } return; } /* ----------------------------- resizing code ----------------------------- */ /* Given a mouse location within a window context, return the direction the * window could be resized in, based on the window quadrant. This is the same * as the quadrants drawn by the rubber-band, if "ResizeOpaque" has not been * set. */ static direction_t __resize_get_dir_from_resize_quadrant( int x_off, int y_off, int px, int py) { direction_t dir = DIR_NONE; int tx; int ty; int dx; int dy; if (px < 0 || x_off < 0 || py < 0 || y_off < 0) { return dir; } /* Rough quadrants per window. 3x3. */ tx = (x_off / 3) - 1; ty = (y_off / 3) - 1; dx = x_off - px; dy = y_off - py; if (px < tx) { /* Far left of window. Quadrants of NW, W, SW. */ if (py < ty) { /* North-West direction. */ dir = DIR_NW; } else if (dy < ty) { /* South-West direction. */ dir = DIR_SW; } else { /* West direction. */ dir = DIR_W; } } else if (dx < tx) { /* Far right of window. Quadrants NE, E, SE. */ if (py < ty) { /* North-East direction. */ dir = DIR_NE; } else if (dy < ty) { /* South-East direction */ dir = DIR_SE; } else { /* East direction. */ dir = DIR_E; } } else { if (py < ty) { /* North direction. */ dir = DIR_N; } else if (dy < ty) { /* South direction. */ dir = DIR_S; } } return dir; } static void __resize_get_dir_from_window( int *ret_xmotion, int *ret_ymotion, FvwmWindow *fw, Window context_w) { if (context_w != Scr.Root && context_w != None) { if (context_w == FW_W_SIDE(fw, 0)) /* top */ { *ret_ymotion = 1; } else if (context_w == FW_W_SIDE(fw, 1)) /* right */ { *ret_xmotion = -1; } else if (context_w == FW_W_SIDE(fw, 2)) /* bottom */ { *ret_ymotion = -1; } else if (context_w == FW_W_SIDE(fw, 3)) /* left */ { *ret_xmotion = 1; } else if (context_w == FW_W_CORNER(fw, 0)) /* upper-left */ { *ret_xmotion = 1; *ret_ymotion = 1; } else if (context_w == FW_W_CORNER(fw, 1)) /* upper-right */ { *ret_xmotion = -1; *ret_ymotion = 1; } else if (context_w == FW_W_CORNER(fw, 2)) /* lower left */ { *ret_xmotion = 1; *ret_ymotion = -1; } else if (context_w == FW_W_CORNER(fw, 3)) /* lower right */ { *ret_xmotion = -1; *ret_ymotion = -1; } } return; } static void __resize_get_dir_proximity( int *ret_xmotion, int *ret_ymotion, FvwmWindow *fw, int x_off, int y_off, int px, int py, int *warp_x, int *warp_y, Bool find_nearest_border) { int tx; int ty; direction_t dir; *warp_x = *warp_y = -1; if (px < 0 || x_off < 0 || py < 0 || y_off < 0) { return; } if (find_nearest_border == False) { tx = 0; ty = 0; tx = max(fw->boundary_width, tx); ty = max(fw->boundary_width, ty); if (px < tx) { *ret_xmotion = 1; } else if (x_off < tx) { *ret_xmotion = -1; } if (py < ty) { *ret_ymotion = 1; } else if (y_off < ty) { *ret_ymotion = -1; } return; } /* Get the direction from the quadrant the pointer is in. */ dir = __resize_get_dir_from_resize_quadrant( x_off, y_off, px, py); switch (dir) { case DIR_NW: *ret_xmotion = 1; *ret_ymotion = 1; *warp_x = 0; *warp_y = 0; break; case DIR_SW: *ret_xmotion = 1; *ret_ymotion = -1; *warp_x = 0; *warp_y = (y_off - 1); break; case DIR_W: *ret_xmotion = 1; *warp_x = 0; *warp_y = (y_off / 2); break; case DIR_NE: *ret_xmotion = -1; *ret_ymotion = 1; *warp_x = (x_off - 1); *warp_y = 0; break; case DIR_SE: *ret_xmotion = -1; *ret_ymotion = -1; *warp_x = (x_off - 1); *warp_y = (y_off - 1); break; case DIR_E: *ret_xmotion = -1; *warp_x = (x_off - 1); *warp_y = (y_off / 2); break; case DIR_N: *ret_ymotion = 1; *warp_x = (x_off / 2); *warp_y = 0; break; case DIR_S: *ret_ymotion = -1; *warp_x = (x_off / 2); *warp_y = (y_off - 1); break; default: break; } return; } static void __resize_get_refpos( int *ret_x, int *ret_y, int xmotion, int ymotion, int w, int h, FvwmWindow *fw) { if (xmotion > 0) { *ret_x = 0; } else if (xmotion < 0) { *ret_x = w - 1; } else { *ret_x = w / 2; } if (ymotion > 0) { *ret_y = 0; } else if (ymotion < 0) { *ret_y = h - 1; } else { *ret_y = h / 2; } return; } /* Procedure: * __resize_step - move the rubberband around. This is called for * each motion event when we are resizing * * Inputs: * x_root - the X corrdinate in the root window * y_root - the Y corrdinate in the root window * x_off - x offset of pointer from border (input/output) * y_off - y offset of pointer from border (input/output) * drag - resize internal structure * orig - resize internal structure * xmotionp - pointer to xmotion in resize_window * ymotionp - pointer to ymotion in resize_window * */ static void __resize_step( const exec_context_t *exc, int x_root, int y_root, int *x_off, int *y_off, rectangle *drag, const rectangle *orig, int *xmotionp, int *ymotionp, Bool do_resize_opaque, Bool is_direction_fixed) { int action = 0; int x2; int y2; int xdir; int ydir; x2 = x_root - *x_off; x_root += *x_off; if (is_direction_fixed == True && (*xmotionp != 0 || *ymotionp != 0)) { xdir = *xmotionp; } else if (x2 <= orig->x || (*xmotionp == 1 && x2 < orig->x + orig->width - 1)) { xdir = 1; } else if (x2 >= orig->x + orig->width - 1 || (*xmotionp == -1 && x2 > orig->x)) { xdir = -1; } else { xdir = 0; } switch (xdir) { case 1: if (*xmotionp != 1) { *x_off = -*x_off; x_root = x2; *xmotionp = 1; } drag->x = x_root; drag->width = orig->x + orig->width - x_root; action = 1; break; case -1: if (*xmotionp != -1) { *x_off = -*x_off; x_root = x2; *xmotionp = -1; } drag->x = orig->x; drag->width = 1 + x_root - drag->x; action = 1; break; default: break; } y2 = y_root - *y_off; y_root += *y_off; if (is_direction_fixed == True && (*xmotionp != 0 || *ymotionp != 0)) { ydir = *ymotionp; } else if (y2 <= orig->y || (*ymotionp == 1 && y2 < orig->y + orig->height - 1)) { ydir = 1; } else if (y2 >= orig->y + orig->height - 1 || (*ymotionp == -1 && y2 > orig->y)) { ydir = -1; } else { ydir = 0; } switch (ydir) { case 1: if (*ymotionp != 1) { *y_off = -*y_off; y_root = y2; *ymotionp = 1; } drag->y = y_root; drag->height = orig->y + orig->height - y_root; action = 1; break; case -1: if (*ymotionp != -1) { *y_off = -*y_off; y_root = y2; *ymotionp = -1; } drag->y = orig->y; drag->height = 1 + y_root - drag->y; action = 1; break; default: break; } if (action) { /* round up to nearest OK size to keep pointer inside * rubberband */ constrain_size( exc->w.fw, exc->x.elast, &drag->width, &drag->height, *xmotionp, *ymotionp, CS_ROUND_UP); if (*xmotionp == 1) { drag->x = orig->x + orig->width - drag->width; } if (*ymotionp == 1) { drag->y = orig->y + orig->height - drag->height; } if (!do_resize_opaque) { draw_move_resize_grid( drag->x, drag->y, drag->width - 1, drag->height - 1); } else { frame_setup_window( exc->w.fw, drag->x, drag->y, drag->width, drag->height, False); } } DisplaySize(exc->w.fw, exc->x.elast, drag->width, drag->height, False, False); return; } /* Starts a window resize operation */ static Bool __resize_window(F_CMD_ARGS) { extern Window bad_window; FvwmWindow *fw = exc->w.fw; Bool is_finished = False, is_done = False, is_aborted = False; Bool do_send_cn = False; Bool do_resize_opaque; Bool do_warp_to_border; Bool is_direction_fixed; Bool automatic_border_direction; Bool detect_automatic_direction; Bool fButtonAbort = False; Bool fForceRedraw = False; Bool called_from_title = False; int x,y,delta_x,delta_y,stashed_x,stashed_y; Window ResizeWindow; int dx = Scr.EdgeScrollX ? Scr.EdgeScrollX : Scr.MyDisplayWidth; int dy = Scr.EdgeScrollY ? Scr.EdgeScrollY : Scr.MyDisplayHeight; const int vx = Scr.Vx; const int vy = Scr.Vy; int n; unsigned int button_mask = 0; rectangle sdrag; rectangle sorig; rectangle *drag = &sdrag; const rectangle *orig = &sorig; const window_g g_backup = fw->g; int ymotion = 0; int xmotion = 0; int was_maximized; unsigned edge_wrap_x; unsigned edge_wrap_y; int px; int py; int i; size_borders b; frame_move_resize_args mr_args = NULL; long evmask; XEvent ev; int ref_x; int ref_y; int x_off; int y_off; direction_t dir; int warp_x = 0; int warp_y = 0; bad_window = False; ResizeWindow = FW_W_FRAME(fw); if (fev_get_evpos_or_query(dpy, Scr.Root, exc->x.etrigger, &px, &py) == False || XTranslateCoordinates( dpy, Scr.Root, ResizeWindow, px, py, &px, &py, &JunkChild) == False) { /* pointer is on a different screen - that's okay here */ px = 0; py = 0; } button_mask &= DEFAULT_ALL_BUTTONS_MASK; if (!is_function_allowed(F_RESIZE, NULL, fw, RQORIG_PROGRAM_US, True)) { XBell(dpy, 0); return False; } if (IS_SHADED(fw) || !IS_MAPPED(fw)) { do_resize_opaque = False; evmask = XEVMASK_RESIZE; } else { do_resize_opaque = DO_RESIZE_OPAQUE(fw); evmask = XEVMASK_RESIZE_OPAQUE; } /* no suffix = % of screen, 'p' = pixels, 'c' = increment units */ if (IS_SHADED(fw)) { get_unshaded_geometry(fw, drag); } else { drag->width = fw->g.frame.width; drag->height = fw->g.frame.height; } get_window_borders(fw, &b); n = GetResizeArguments( &action, fw->g.frame.x, fw->g.frame.y, fw->hints.base_width, fw->hints.base_height, fw->hints.width_inc, fw->hints.height_inc, &b, &(drag->width), &(drag->height), &dir, &is_direction_fixed, &do_warp_to_border, &automatic_border_direction, &detect_automatic_direction); if (n == 2) { rectangle new_g; /* size will be less or equal to requested */ if (IS_SHADED(fw)) { rectangle shaded_g; get_unshaded_geometry(fw, &new_g); SET_MAXIMIZED(fw, 0); constrain_size( fw, NULL, &drag->width, &drag->height, xmotion, ymotion, 0); gravity_resize( fw->hints.win_gravity, &new_g, drag->width - new_g.width, drag->height - new_g.height); fw->g.normal = new_g; get_shaded_geometry(fw, &shaded_g, &new_g); frame_setup_window( fw, shaded_g.x, shaded_g.y, shaded_g.width, shaded_g.height, False); } else { new_g = fw->g.frame; SET_MAXIMIZED(fw, 0); constrain_size( fw, NULL, &drag->width, &drag->height, xmotion, ymotion, 0); gravity_resize( fw->hints.win_gravity, &new_g, drag->width - new_g.width, drag->height - new_g.height); frame_setup_window( fw, new_g.x, new_g.y, drag->width, drag->height, False); } update_absolute_geometry(fw); maximize_adjust_offset(fw); GNOME_SetWinArea(fw); ResizeWindow = None; return True; } was_maximized = IS_MAXIMIZED(fw); SET_MAXIMIZED(fw, 0); if (was_maximized) { /* must redraw the buttons now so that the 'maximize' button * does not stay depressed. */ border_draw_decorations( fw, PART_BUTTONS, (fw == Scr.Hilite), True, CLEAR_ALL, NULL, NULL); } if (Scr.bo.do_install_root_cmap) { InstallRootColormap(); } else { InstallFvwmColormap(); } if (!GrabEm(CRS_RESIZE, GRAB_NORMAL)) { XBell(dpy, 0); return False; } /* handle problems with edge-wrapping while resizing */ edge_wrap_x = Scr.flags.do_edge_wrap_x; edge_wrap_y = Scr.flags.do_edge_wrap_y; Scr.flags.do_edge_wrap_x = 0; Scr.flags.do_edge_wrap_y = 0; if (!do_resize_opaque) { MyXGrabServer(dpy); } if (!XGetGeometry( dpy, (Drawable)ResizeWindow, &JunkRoot, &drag->x, &drag->y, (unsigned int*)&drag->width, (unsigned int*)&drag->height, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth)) { UngrabEm(GRAB_NORMAL); if (!do_resize_opaque) { MyXUngrabServer(dpy); } return False; } if (IS_SHADED(fw)) { SET_MAXIMIZED(fw, was_maximized); get_unshaded_geometry(fw, drag); SET_MAXIMIZED(fw, 0); } if (do_resize_opaque) { mr_args = frame_create_move_resize_args( fw, FRAME_MR_OPAQUE, &fw->g.frame, &fw->g.frame, 0, DIR_NONE); } else { Scr.flags.is_wire_frame_displayed = True; } MyXGrabKeyboard(dpy); sorig = *drag; ymotion = 0; xmotion = 0; /* pop up a resize dimensions window */ if (!Scr.gs.do_hide_resize_window) { position_geometry_window(NULL); XMapRaised(dpy, Scr.SizeWindow); } DisplaySize(fw, exc->x.elast, orig->width, orig->height, True, True); if (dir == DIR_NONE && detect_automatic_direction == True) { dir = __resize_get_dir_from_resize_quadrant( orig->width, orig->height, px, py); } if (dir != DIR_NONE) { int grav; grav = gravity_dir_to_grav(dir); gravity_get_offsets(grav, &xmotion, &ymotion); xmotion = -xmotion; ymotion = -ymotion; } if (xmotion == 0 && ymotion == 0) { __resize_get_dir_from_window(&xmotion, &ymotion, fw, PressedW); } if (FW_W_TITLE(fw) != None && PressedW == FW_W_TITLE(fw)) { /* title was pressed to start the resize */ called_from_title = True; } else { for (i = NUMBER_OF_TITLE_BUTTONS; i--; ) { /* see if the title button was pressed to that the * resize */ if (FW_W_BUTTON(fw, i) != None && FW_W_BUTTON(fw, i) == PressedW) { /* yes */ called_from_title = True; } } } /* don't warp if the resize was triggered by a press somwhere on the * title bar */ if (PressedW != Scr.Root && xmotion == 0 && ymotion == 0 && !called_from_title) { __resize_get_dir_proximity( &xmotion, &ymotion, fw, orig->width, orig->height, px, py, &warp_x, &warp_y, automatic_border_direction); if (xmotion != 0 || ymotion != 0) { do_warp_to_border = True; } } if (!IS_SHADED(fw)) { __resize_get_refpos( &ref_x, &ref_y, xmotion, ymotion, orig->width, orig->height, fw); } else { switch (SHADED_DIR(fw)) { case DIR_N: case DIR_NW: case DIR_NE: if (ymotion == -1) { ymotion = 0; } break; case DIR_S: case DIR_SW: case DIR_SE: if (ymotion == 1) { ymotion = 0; } break; default: break; } switch (SHADED_DIR(fw)) { case DIR_E: case DIR_NE: case DIR_SE: if (xmotion == 1) { xmotion = 0; } break; case DIR_W: case DIR_NW: case DIR_SW: if (xmotion == -1) { xmotion = 0; } break; default: break; } __resize_get_refpos( &ref_x, &ref_y, xmotion, ymotion, fw->g.frame.width, fw->g.frame.height, fw); } x_off = 0; y_off = 0; if (do_warp_to_border == True) { int dx; int dy; dx = (xmotion == 0) ? px : ref_x; dy = (ymotion == 0) ? py : ref_y; /* Warp the pointer to the closest border automatically? */ if (automatic_border_direction == True && (warp_x >=0 && warp_y >=0) && !IS_SHADED(fw)) { dx = warp_x; dy = warp_y; } /* warp the pointer to the border */ FWarpPointer( dpy, None, ResizeWindow, 0, 0, 1, 1, dx, dy); XFlush(dpy); } else if (xmotion != 0 || ymotion != 0) { /* keep the distance between pointer and border */ x_off = (xmotion == 0) ? 0 : ref_x - px; y_off = (ymotion == 0) ? 0 : ref_y - py; } else { /* wait until the pointer hits a border before making a * decision about the resize direction */ } /* draw the rubber-band window */ if (!do_resize_opaque) { draw_move_resize_grid( drag->x, drag->y, drag->width - 1, drag->height - 1); } /* kick off resizing without requiring any motion if invoked with a key * press */ if (exc->x.elast->type == KeyPress) { int xo; int yo; if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &stashed_x, &stashed_y, &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen */ stashed_x = 0; stashed_y = 0; } xo = 0; yo = 0; __resize_step( exc, stashed_x, stashed_y, &xo, &yo, drag, orig, &xmotion, &ymotion, do_resize_opaque, True); } else { stashed_x = stashed_y = -1; } /* loop to resize */ memset(&ev, 0, sizeof(ev)); while (!is_finished && bad_window != FW_W(fw)) { int rc = 0; /* block until there is an interesting event */ while (rc != -1 && (!FPending(dpy) || !FCheckMaskEvent(dpy, evmask, &ev))) { rc = HandlePaging( &ev, dx, dy, &x, &y, &delta_x, &delta_y, False, False, True, fw->edge_delay_ms_resize); if (rc == 1) { /* Fake an event to force window reposition */ ev.type = MotionNotify; ev.xmotion.time = fev_get_evtime(); fForceRedraw = True; break; } } if (rc == -1) { FMaskEvent( dpy, evmask | EnterWindowMask | LeaveWindowMask, &ev); } if (ev.type == MotionNotify || ev.type == EnterNotify || ev.type == LeaveNotify) { /* discard any extra motion events before a release */ /* dv (2004-07-01): With XFree 4.1.0.1, some Mouse * events are not reported to fvwm when the pointer * moves very fast and suddenly stops in the corner of * the screen. Handle EnterNotify/LeaveNotify events * too to get an idea where the pointer might be. */ while ( FCheckMaskEvent( dpy, ButtonMotionMask | PointerMotionMask | ButtonReleaseMask | ButtonPressMask | EnterWindowMask | LeaveWindowMask, &ev) == True) { if (ev.type == ButtonRelease || ev.type == ButtonPress || ev.type == KeyPress) { break; } } } if (ev.type == EnterNotify || ev.type == LeaveNotify) { XEvent e2; int x; int y; /* Query the pointer to catch the latest information. * This *is* necessary. */ if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &x, &y, &JunkX, &JunkY, &JunkMask) == True) { /* Must NOT use button_mask here, or resize * will not work with num lock */ fev_make_null_event(&e2, dpy); e2.type = MotionNotify; e2.xmotion.time = fev_get_evtime(); e2.xmotion.x_root = x; e2.xmotion.y_root = y; e2.xmotion.state = JunkMask; e2.xmotion.same_screen = True; ev = e2; fev_fake_event(&ev); } else { /* pointer is on a different screen, * ignore event */ } } is_done = False; /* Handle a limited number of key press events to allow * mouseless operation */ if (ev.type == KeyPress) { Keyboard_shortcuts(&ev, fw, NULL, NULL, ButtonRelease); if (ev.type == ButtonRelease) { do_send_cn = True; } } switch (ev.type) { case ButtonPress: is_done = True; if (ev.xbutton.button <= NUMBER_OF_MOUSE_BUTTONS && ((Button1Mask << (ev.xbutton.button - 1)) & button_mask)) { /* No new button was pressed, just a delayed * event */ break; } /* Abort the resize if * - the move started with a pressed button and * another button was pressed during the operation * - no button was started at the beginning and any * button except button 1 was pressed. */ if (button_mask || (ev.xbutton.button != 1)) { fButtonAbort = True; /* fall through */ } else { is_finished = True; do_send_cn = True; break; } case KeyPress: /* simple code to bag out of move - CKH */ if (fButtonAbort || XLookupKeysym(&ev.xkey, 0) == XK_Escape) { is_aborted = True; do_send_cn = True; is_finished = True; } is_done = True; break; case ButtonRelease: is_finished = True; is_done = True; break; case MotionNotify: if (ev.xmotion.same_screen == False) { continue; } if (!fForceRedraw) { x = ev.xmotion.x_root; y = ev.xmotion.y_root; /* resize before paging request to prevent * resize from lagging * mouse - mab */ __resize_step( exc, x, y, &x_off, &y_off, drag, orig, &xmotion, &ymotion, do_resize_opaque, is_direction_fixed); /* need to move the viewport */ HandlePaging( &ev, dx, dy, &x, &y, &delta_x, &delta_y, False, False, False, fw->edge_delay_ms_resize); } /* redraw outline if we paged - mab */ if (delta_x != 0 || delta_y != 0) { sorig.x -= delta_x; sorig.y -= delta_y; drag->x -= delta_x; drag->y -= delta_y; __resize_step( exc, x, y, &x_off, &y_off, drag, orig, &xmotion, &ymotion, do_resize_opaque, is_direction_fixed); } fForceRedraw = False; is_done = True; break; case PropertyNotify: { evh_args_t ea; exec_context_changes_t ecc; ecc.x.etrigger = &ev; ea.exc = exc_clone_context(exc, &ecc, ECC_ETRIGGER); HandlePropertyNotify(&ea); exc_destroy_context(ea.exc); is_done = True; break; } default: break; } if (!is_done) { if (!do_resize_opaque) { /* must undraw the rubber band in case the * event causes some drawing */ switch_move_resize_grid(False); } dispatch_event(&ev); if (!do_resize_opaque) { draw_move_resize_grid( drag->x, drag->y, drag->width - 1, drag->height - 1); } } else { if (do_resize_opaque) { /* only do this with opaque resizes, (i.e. the * server is not grabbed) */ BroadcastConfig(M_CONFIGURE_WINDOW, fw); FlushAllMessageQueues(); } } } /* erase the rubber-band */ if (!do_resize_opaque) { switch_move_resize_grid(False); } /* pop down the size window */ if (!Scr.gs.do_hide_resize_window) { XUnmapWindow(dpy, Scr.SizeWindow); } if (is_aborted || bad_window == FW_W(fw)) { /* return pointer if aborted resize was invoked with key */ if (stashed_x >= 0) { FWarpPointer( dpy, None, Scr.Root, 0, 0, 0, 0, stashed_x, stashed_y); } if (was_maximized) { /* since we aborted the resize, the window is still * maximized */ SET_MAXIMIZED(fw, 1); } if (do_resize_opaque) { int xo; int yo; rectangle g; xo = 0; yo = 0; xmotion = 1; ymotion = 1; g = sorig; __resize_step( exc, sorig.x, sorig.y, &xo, &yo, &g, orig, &xmotion, &ymotion, do_resize_opaque, True); } if (vx != Scr.Vx || vy != Scr.Vy) { MoveViewport(vx, vy, False); } /* restore all geometry-related info */ fw->g = g_backup; if (bad_window == FW_W(fw)) { XUnmapWindow(dpy, FW_W_FRAME(fw)); border_undraw_decorations(fw); XBell(dpy, 0); } } else if (!is_aborted && bad_window != FW_W(fw)) { rectangle new_g; /* size will be >= to requested */ constrain_size( fw, exc->x.elast, &drag->width, &drag->height, xmotion, ymotion, CS_ROUND_UP); if (IS_SHADED(fw)) { get_shaded_geometry(fw, &new_g, drag); } else { new_g = *drag; } if (do_resize_opaque) { frame_update_move_resize_args(mr_args, &new_g); } else { frame_setup_window( fw, new_g.x, new_g.y, new_g.width, new_g.height, False); } if (IS_SHADED(fw)) { fw->g.normal.width = drag->width; fw->g.normal.height = drag->height; } } if (is_aborted && was_maximized) { /* force redraw */ border_draw_decorations( fw, PART_BUTTONS, (fw == Scr.Hilite), True, CLEAR_ALL, NULL, NULL); } if (Scr.bo.do_install_root_cmap) { UninstallRootColormap(); } else { UninstallFvwmColormap(); } ResizeWindow = None; if (!do_resize_opaque) { /* Throw away some events that dont interest us right now. */ discard_events(EnterWindowMask|LeaveWindowMask); Scr.flags.is_wire_frame_displayed = False; MyXUngrabServer(dpy); } if (mr_args != NULL) { frame_free_move_resize_args(fw, mr_args); } if (do_send_cn == True) { rectangle g; if (is_aborted) { g = sorig; } else { g = *drag; } SendConfigureNotify(fw, g.x, g.y, g.width, g.height, 0, True); } MyXUngrabKeyboard(dpy); WaitForButtonsUp(True); UngrabEm(GRAB_NORMAL); Scr.flags.do_edge_wrap_x = edge_wrap_x; Scr.flags.do_edge_wrap_y = edge_wrap_y; update_absolute_geometry(fw); maximize_adjust_offset(fw); GNOME_SetWinArea(fw); if (is_aborted) { return False; } return True; } void CMD_Resize(F_CMD_ARGS) { FvwmWindow *fw = exc->w.fw; if (IS_EWMH_FULLSCREEN(fw)) { /* do not unmaximize ! */ CMD_ResizeMaximize(F_PASS_ARGS); return; } __resize_window(F_PASS_ARGS); return; } /* ----------------------------- maximizing code --------------------------- */ Bool is_window_sticky_across_pages(FvwmWindow *fw) { if (IS_STICKY_ACROSS_PAGES(fw) || (IS_ICONIFIED(fw) && IS_ICON_STICKY_ACROSS_PAGES(fw))) { return True; } else { return False; } } Bool is_window_sticky_across_desks(FvwmWindow *fw) { if (IS_STICKY_ACROSS_DESKS(fw) || (IS_ICONIFIED(fw) && IS_ICON_STICKY_ACROSS_DESKS(fw))) { return True; } else { return False; } } static void move_sticky_window_to_same_page( int *x11, int *x12, int *y11, int *y12, int x21, int x22, int y21, int y22) { /* make sure the x coordinate is on the same page as the reference * window */ if (*x11 >= x22) { while (*x11 >= x22) { *x11 -= Scr.MyDisplayWidth; *x12 -= Scr.MyDisplayWidth; } } else if (*x12 <= x21) { while (*x12 <= x21) { *x11 += Scr.MyDisplayWidth; *x12 += Scr.MyDisplayWidth; } } /* make sure the y coordinate is on the same page as the reference * window */ if (*y11 >= y22) { while (*y11 >= y22) { *y11 -= Scr.MyDisplayHeight; *y12 -= Scr.MyDisplayHeight; } } else if (*y12 <= y21) { while (*y12 <= y21) { *y11 += Scr.MyDisplayHeight; *y12 += Scr.MyDisplayHeight; } } return; } static void MaximizeHeight( FvwmWindow *win, int win_width, int win_x, int *win_height, int *win_y, Bool grow_up, Bool grow_down, int top_border, int bottom_border, int *layers) { FvwmWindow *cwin; int x11, x12, x21, x22; int y11, y12, y21, y22; int new_y1, new_y2; rectangle g; Bool rc; x11 = win_x; /* Start x */ y11 = *win_y; /* Start y */ x12 = x11 + win_width; /* End x */ y12 = y11 + *win_height; /* End y */ new_y1 = top_border; new_y2 = bottom_border; for (cwin = Scr.FvwmRoot.next; cwin; cwin = cwin->next) { if (cwin == win || (cwin->Desk != win->Desk && !is_window_sticky_across_desks(cwin))) { continue; } if ((layers[0] >= 0 && cwin->layer < layers[0]) || (layers[1] >= 0 && cwin->layer > layers[1])) { continue; } rc = get_visible_window_or_icon_geometry(cwin, &g); if (rc == False) { continue; } x21 = g.x; y21 = g.y; x22 = x21 + g.width; y22 = y21 + g.height; if (is_window_sticky_across_pages(cwin)) { move_sticky_window_to_same_page( &x21, &x22, &new_y1, &new_y2, x11, x12, y11, y12); } /* Are they in the same X space? */ if (!((x22 <= x11) || (x21 >= x12))) { if ((y22 <= y11) && (y22 >= new_y1)) { new_y1 = y22; } else if ((y12 <= y21) && (new_y2 >= y21)) { new_y2 = y21; } } } if (!grow_up) { new_y1 = y11; } if (!grow_down) { new_y2 = y12; } *win_height = new_y2 - new_y1; *win_y = new_y1; return; } static void MaximizeWidth( FvwmWindow *win, int *win_width, int *win_x, int win_height, int win_y, Bool grow_left, Bool grow_right, int left_border, int right_border, int *layers) { FvwmWindow *cwin; int x11, x12, x21, x22; int y11, y12, y21, y22; int new_x1, new_x2; rectangle g; Bool rc; x11 = *win_x; /* Start x */ y11 = win_y; /* Start y */ x12 = x11 + *win_width; /* End x */ y12 = y11 + win_height; /* End y */ new_x1 = left_border; new_x2 = right_border; for (cwin = Scr.FvwmRoot.next; cwin; cwin = cwin->next) { if (cwin == win || (cwin->Desk != win->Desk && !is_window_sticky_across_desks(cwin))) { continue; } if ((layers[0] >= 0 && cwin->layer < layers[0]) || (layers[1] >= 0 && cwin->layer > layers[1])) { continue; } rc = get_visible_window_or_icon_geometry(cwin, &g); if (rc == False) { continue; } x21 = g.x; y21 = g.y; x22 = x21 + g.width; y22 = y21 + g.height; if (is_window_sticky_across_pages(cwin)) { move_sticky_window_to_same_page( &new_x1, &new_x2, &y21, &y22, x11, x12, y11, y12); } /* Are they in the same Y space? */ if (!((y22 <= y11) || (y21 >= y12))) { if ((x22 <= x11) && (x22 >= new_x1)) { new_x1 = x22; } else if ((x12 <= x21) && (new_x2 >= x21)) { new_x2 = x21; } } } if (!grow_left) { new_x1 = x11; } if (!grow_right) { new_x2 = x12; } *win_width = new_x2 - new_x1; *win_x = new_x1; return; } static void unmaximize_fvwm_window( FvwmWindow *fw) { rectangle new_g; SET_MAXIMIZED(fw, 0); if (IS_SHADED(fw)) { get_shaded_geometry(fw, &new_g, &new_g); } /* We might be restoring a window's geometry coming out of fullscreen, * which might be a maximized window, so ensure we use the correct * geometry reference. * * If the window was not maximized, then we use the window's normal * geometry. */ get_relative_geometry(&new_g, fw->fullscreen.was_maximized ? &fw->fullscreen.g.max : &fw->g.normal); if (fw->fullscreen.was_maximized) { /* If MWMButtons is in use, set the style of the button as * marked as maximized. */ SET_MAXIMIZED(fw, 1); } if (IS_EWMH_FULLSCREEN(fw)) { SET_EWMH_FULLSCREEN(fw, False); if (DO_EWMH_USE_STACKING_HINTS(fw)) { new_layer(fw, fw->ewmh_normal_layer); } } /* TA: Apply the decor change now, if the window we've just restored * was maximized; the client frame and geometry will be updated as a * result of this, so we correctly restore the window at this point. */ if (fw->fullscreen.was_maximized) { fw->fullscreen.was_maximized = 0; apply_decor_change(fw); } frame_setup_window( fw, new_g.x, new_g.y, new_g.width, new_g.height, True); border_draw_decorations( fw, PART_ALL, (Scr.Hilite == fw), True, CLEAR_ALL, NULL, NULL); if (fw->fullscreen.is_shaded) { execute_function_override_window( NULL, NULL, "WindowShade on", 0, fw); fw->fullscreen.is_shaded = 0; } if (fw->fullscreen.is_iconified) { execute_function_override_window( NULL, NULL, "Iconify on", 0, fw); fw->fullscreen.is_iconified = 0; } /* Since the window's geometry will have been constrained already when * coming out of fullscreen, we can always call this; either it's a * noop or the window will be correctly decorated in the case of the * window being restored from fullscreen to a non-maximized state. */ apply_decor_change(fw); return; } static void maximize_fvwm_window( FvwmWindow *fw, rectangle *geometry) { SET_MAXIMIZED(fw, 1); fw->g.max_defect.width = 0; fw->g.max_defect.height = 0; constrain_size( fw, NULL, &geometry->width, &geometry->height, 0, 0, CS_UPDATE_MAX_DEFECT); fw->g.max = *geometry; if (IS_SHADED(fw)) { get_shaded_geometry(fw, geometry, &fw->g.max); } frame_setup_window( fw, geometry->x, geometry->y, geometry->width, geometry->height, True); border_draw_decorations( fw, PART_ALL, (Scr.Hilite == fw), True, CLEAR_ALL, NULL, NULL); update_absolute_geometry(fw); /* remember the offset between old and new position in case the * maximized window is moved more than the screen width/height. */ fw->g.max_offset.x = fw->g.normal.x - fw->g.max.x; fw->g.max_offset.y = fw->g.normal.y - fw->g.max.y; #if 0 fprintf(stderr,"%d %d %d %d, g.max_offset.x = %d, g.max_offset.y = %d, %d %d %d %d\n", fw->g.max.x, fw->g.max.y, fw->g.max.width, fw->g.max.height, fw->g.max_offset.x, fw->g.max_offset.y, fw->g.normal.x, fw->g.normal.y, fw->g.normal.width, fw->g.normal.height); #endif return; } /* * * Procedure: * (Un)Maximize a window. * */ void CMD_Maximize(F_CMD_ARGS) { int page_x, page_y; int val1, val2, val1_unit, val2_unit; int toggle; char *token; char *taction; Bool grow_up = False; Bool grow_down = False; Bool grow_left = False; Bool grow_right = False; Bool do_force_maximize = False; Bool is_screen_given = False; Bool ignore_working_area = False; int layers[2] = { -1, -1 }; Bool global_flag_parsed = False; int scr_x, scr_y; int scr_w, scr_h; rectangle new_g; FvwmWindow *fw = exc->w.fw; if ( !is_function_allowed( F_MAXIMIZE, NULL, fw, RQORIG_PROGRAM_US, False)) { XBell(dpy, 0); return; } /* Check for "global" flag ("absolute" is for compatibility with E) */ while (!global_flag_parsed) { token = PeekToken(action, &taction); if (!token) { global_flag_parsed = True; } else { if (StrEquals(token, "screen")) { int scr; is_screen_given = True; token = PeekToken(taction, &action); scr = FScreenGetScreenArgument( token, FSCREEN_SPEC_PRIMARY); FScreenGetScrRect( NULL, scr, &scr_x, &scr_y, &scr_w, &scr_h); } else if (StrEquals(token, "ewmhiwa")) { ignore_working_area = True; action = taction; } else if (StrEquals(token, "growonwindowlayer")) { layers[0] = fw->layer; layers[1] = fw->layer; action = taction; } else if (StrEquals(token, "growonlayers")) { int n; n = GetIntegerArguments( taction, &action, layers, 2); if (n != 2) { layers[0] = -1; layers[1] = -1; } } else { global_flag_parsed = True; } } } toggle = ParseToggleArgument(action, &action, -1, 0); if (toggle == 0 && !IS_MAXIMIZED(fw)) { return; } if (toggle == 1 && IS_MAXIMIZED(fw)) { /* Fake that the window is not maximized. */ do_force_maximize = True; } /* find the new page and geometry */ new_g.x = fw->g.frame.x; new_g.y = fw->g.frame.y; new_g.width = fw->g.frame.width; new_g.height = fw->g.frame.height; get_page_offset_check_visible(&page_x, &page_y, fw); /* Check if we should constrain rectangle to some Xinerama screen */ if (!is_screen_given) { fscreen_scr_arg fscr; fscr.xypos.x = fw->g.frame.x + fw->g.frame.width / 2 - page_x; fscr.xypos.y = fw->g.frame.y + fw->g.frame.height / 2 - page_y; FScreenGetScrRect( &fscr, FSCREEN_XYPOS, &scr_x, &scr_y, &scr_w, &scr_h); } if (!ignore_working_area) { EWMH_GetWorkAreaIntersection( fw, &scr_x, &scr_y, &scr_w, &scr_h, EWMH_MAXIMIZE_MODE(fw)); } #if 0 fprintf(stderr, "%s: page=(%d,%d), scr=(%d,%d, %dx%d)\n", __FUNCTION__, page_x, page_y, scr_x, scr_y, scr_w, scr_h); #endif /* parse first parameter */ val1_unit = scr_w; token = PeekToken(action, &taction); if (token && StrEquals(token, "grow")) { grow_left = True; grow_right = True; val1 = 100; val1_unit = scr_w; } else if (token && StrEquals(token, "growleft")) { grow_left = True; val1 = 100; val1_unit = scr_w; } else if (token && StrEquals(token, "growright")) { grow_right = True; val1 = 100; val1_unit = scr_w; } else { if (GetOnePercentArgument(token, &val1, &val1_unit) == 0) { val1 = 100; val1_unit = scr_w; } else if (val1 < 0) { /* handle negative offsets */ if (val1_unit == scr_w) { val1 = 100 + val1; } else { val1 = scr_w + val1; } } } /* parse second parameter */ val2_unit = scr_h; token = PeekToken(taction, NULL); if (token && StrEquals(token, "grow")) { grow_up = True; grow_down = True; val2 = 100; val2_unit = scr_h; } else if (token && StrEquals(token, "growup")) { grow_up = True; val2 = 100; val2_unit = scr_h; } else if (token && StrEquals(token, "growdown")) { grow_down = True; val2 = 100; val2_unit = scr_h; } else { if (GetOnePercentArgument(token, &val2, &val2_unit) == 0) { val2 = 100; val2_unit = scr_h; } else if (val2 < 0) { /* handle negative offsets */ if (val2_unit == scr_h) { val2 = 100 + val2; } else { val2 = scr_h + val2; } } } #if 0 fprintf(stderr, "%s: page=(%d,%d), scr=(%d,%d, %dx%d)\n", __FUNCTION__, page_x, page_y, scr_x, scr_y, scr_w, scr_h); #endif if (IS_MAXIMIZED(fw) && !do_force_maximize) { unmaximize_fvwm_window(fw); } else /* maximize */ { /* handle command line arguments */ if (grow_up || grow_down) { MaximizeHeight( fw, new_g.width, new_g.x, &new_g.height, &new_g.y, grow_up, grow_down, page_y + scr_y, page_y + scr_y + scr_h, layers); } else if (val2 > 0) { new_g.height = val2 * val2_unit / 100; new_g.y = page_y + scr_y; } if (grow_left || grow_right) { MaximizeWidth( fw, &new_g.width, &new_g.x, new_g.height, new_g.y, grow_left, grow_right, page_x + scr_x, page_x + scr_x + scr_w, layers); } else if (val1 >0) { new_g.width = val1 * val1_unit / 100; new_g.x = page_x + scr_x; } if (val1 == 0 && val2 == 0) { new_g.x = page_x + scr_x; new_g.y = page_y + scr_y; new_g.height = scr_h; new_g.width = scr_w; } /* now maximize it */ maximize_fvwm_window(fw, &new_g); } EWMH_SetWMState(fw, False); GNOME_SetWinArea(fw); return; } /* * * Same as CMD_Resize and CMD_ResizeMove, but the window ends up maximized * without touching the normal geometry. * */ void CMD_ResizeMaximize(F_CMD_ARGS) { rectangle normal_g; rectangle max_g; Bool was_resized; FvwmWindow *fw = exc->w.fw; /* keep a copy of the old geometry */ normal_g = fw->g.normal; /* resize the window normally */ was_resized = __resize_window(F_PASS_ARGS); if (was_resized == True) { /* set the new geometry as the maximized geometry and restore * the old normal geometry */ max_g = fw->g.normal; max_g.x -= Scr.Vx; max_g.y -= Scr.Vy; fw->g.normal = normal_g; /* and mark it as maximized */ maximize_fvwm_window(fw, &max_g); } EWMH_SetWMState(fw, False); return; } void CMD_ResizeMoveMaximize(F_CMD_ARGS) { rectangle normal_g; rectangle max_g; Bool was_resized; FvwmWindow *fw = exc->w.fw; /* keep a copy of the old geometry */ normal_g = fw->g.normal; /* resize the window normally */ was_resized = resize_move_window(F_PASS_ARGS); if (was_resized == True) { /* set the new geometry as the maximized geometry and restore * the old normal geometry */ max_g = fw->g.normal; max_g.x -= Scr.Vx; max_g.y -= Scr.Vy; fw->g.normal = normal_g; /* and mark it as maximized */ maximize_fvwm_window(fw, &max_g); } EWMH_SetWMState(fw, False); return; } /* ----------------------------- stick code -------------------------------- */ int stick_across_pages(F_CMD_ARGS, int toggle) { FvwmWindow *fw = exc->w.fw; if ((toggle == 1 && IS_STICKY_ACROSS_PAGES(fw)) || (toggle == 0 && !IS_STICKY_ACROSS_PAGES(fw))) { return 0; } if (IS_STICKY_ACROSS_PAGES(fw)) { SET_STICKY_ACROSS_PAGES(fw, 0); } else { if (!IsRectangleOnThisPage(&fw->g.frame, Scr.CurrentDesk)) { action = ""; __move_window(F_PASS_ARGS, False, MOVE_PAGE); } SET_STICKY_ACROSS_PAGES(fw, 1); } return 1; } int stick_across_desks(F_CMD_ARGS, int toggle) { FvwmWindow *fw = exc->w.fw; if ((toggle == 1 && IS_STICKY_ACROSS_DESKS(fw)) || (toggle == 0 && !IS_STICKY_ACROSS_DESKS(fw))) { return 0; } if (IS_STICKY_ACROSS_DESKS(fw)) { SET_STICKY_ACROSS_DESKS(fw, 0); fw->Desk = Scr.CurrentDesk; GNOME_SetDeskCount(); GNOME_SetDesk(fw); } else { if (fw->Desk != Scr.CurrentDesk) { do_move_window_to_desk(fw, Scr.CurrentDesk); } SET_STICKY_ACROSS_DESKS(fw, 1); } return 1; } static void __handle_stick_exit( FvwmWindow *fw, int do_not_draw, int do_silently) { if (do_not_draw == 0) { border_draw_decorations( fw, PART_TITLE | PART_BUTTONS, (Scr.Hilite==fw), True, CLEAR_ALL, NULL, NULL); } if (!do_silently) { BroadcastConfig(M_CONFIGURE_WINDOW,fw); EWMH_SetWMState(fw, False); EWMH_SetWMDesktop(fw); GNOME_SetHints(fw); } return; } void handle_stick_across_pages( F_CMD_ARGS, int toggle, int do_not_draw, int do_silently) { FvwmWindow *fw = exc->w.fw; int did_change; did_change = stick_across_pages(F_PASS_ARGS, toggle); if (did_change) { __handle_stick_exit(fw, do_not_draw, do_silently); } return; } void handle_stick_across_desks( F_CMD_ARGS, int toggle, int do_not_draw, int do_silently) { FvwmWindow *fw = exc->w.fw; int did_change; did_change = stick_across_desks(F_PASS_ARGS, toggle); if (did_change) { __handle_stick_exit(fw, do_not_draw, do_silently); } return; } void handle_stick( F_CMD_ARGS, int toggle_page, int toggle_desk, int do_not_draw, int do_silently) { FvwmWindow *fw = exc->w.fw; int did_change; did_change = 0; did_change |= stick_across_desks(F_PASS_ARGS, toggle_desk); did_change |= stick_across_pages(F_PASS_ARGS, toggle_page); if (did_change) { __handle_stick_exit(fw, do_not_draw, do_silently); } return; } void CMD_Stick(F_CMD_ARGS) { int toggle; toggle = ParseToggleArgument(action, &action, -1, 0); if (toggle == -1 && IS_STICKY_ACROSS_DESKS(exc->w.fw) != IS_STICKY_ACROSS_PAGES(exc->w.fw)) { /* don't switch between only stickypage and only stickydesk. * rather switch it off completely */ toggle = 0; } handle_stick(F_PASS_ARGS, toggle, toggle, 0, 0); return; } void CMD_StickAcrossPages(F_CMD_ARGS) { int toggle; toggle = ParseToggleArgument(action, &action, -1, 0); handle_stick_across_pages(F_PASS_ARGS, toggle, 0, 0); return; } void CMD_StickAcrossDesks(F_CMD_ARGS) { int toggle; toggle = ParseToggleArgument(action, &action, -1, 0); handle_stick_across_desks(F_PASS_ARGS, toggle, 0, 0); return; } fvwm-2.6.5.orig/fvwm/menugeometry.c0000644000175000017500000000637210552376502015502 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "misc.h" #include "screen.h" #include "menudim.h" #include "menuroot.h" #include "menuparameters.h" #include "menugeometry.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* ---------------------------- interface functions ------------------------ */ Bool menu_get_geometry( struct MenuRoot *mr, Window *root_return, int *x_return, int *y_return, int *width_return, int *height_return, int *border_width_return, int *depth_return) { Status rc; Bool brc; int root_x; int root_y; rc = XGetGeometry( dpy, MR_WINDOW(mr), root_return, x_return, y_return, (unsigned int*)width_return, (unsigned int*)height_return, (unsigned int*)border_width_return, (unsigned int*)depth_return); if (rc == 0) { return False; } if (!MR_IS_TEAR_OFF_MENU(mr)) { return True; } brc = XTranslateCoordinates( dpy, MR_WINDOW(mr), Scr.Root, *x_return, *y_return, &root_x, &root_y, &JunkChild); if (brc == True) { *x_return = root_x; *y_return = root_y; } else { *x_return = 0; *y_return = 0; } return brc; } Bool menu_get_outer_geometry( struct MenuRoot *mr, struct MenuParameters *pmp, Window *root_return, int *x_return, int *y_return, int *width_return, int *height_return, int *border_width_return, int *depth_return) { if (MR_IS_TEAR_OFF_MENU(mr)) { return XGetGeometry( dpy, FW_W_FRAME(pmp->tear_off_root_menu_window), root_return,x_return,y_return, (unsigned int*)width_return, (unsigned int*)height_return, (unsigned int*)border_width_return, (unsigned int*)depth_return); } else { return menu_get_geometry( mr,root_return,x_return,y_return, width_return, height_return, border_width_return, depth_return); } } fvwm-2.6.5.orig/fvwm/focus.h0000644000175000017500000000503610453527214014100 0ustar vwcvwc/* -*-c-*- */ #ifndef FOCUS_H #define FOCUS_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ #define FOCUS_SET(w) XSetInputFocus(dpy, w, RevertToParent, CurrentTime) #define FOCUS_RESET() \ XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime) #define SetFocusWindow(a, b, c) _SetFocusWindow(a, b, c, False); #define SetFocusWindowClientEntered(a, b, c) _SetFocusWindow(a, b, c, True); #define ReturnFocusWindow(a) _ReturnFocusWindow(a); #define DeleteFocus(a) _DeleteFocus(a); #define ForceDeleteFocus() _ForceDeleteFocus(); /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ /* * * Sets/deletes the input focus to the indicated window. * */ void _SetFocusWindow( FvwmWindow *fw, Bool do_allow_force_broadcast, fpol_set_focus_by_t set_by, Bool client_entered); void _ReturnFocusWindow(FvwmWindow *fw); void _DeleteFocus(Bool do_allow_force_broadcast); void _ForceDeleteFocus(void); void restore_focus_after_unmap( const FvwmWindow *fw, Bool do_skip_marked_transients); /* * These need documentation */ Bool IsLastFocusSetByMouse(void); void focus_grab_buttons(FvwmWindow *fw); void focus_grab_buttons_client_entered(FvwmWindow *fw); void focus_grab_buttons_on_layer(int layer); void focus_grab_buttons_all(void); void focus_grab_buttons_on_pointer_window(void); Bool focus_does_accept_input_focus(const FvwmWindow *fw); Bool focus_is_focused(const FvwmWindow *fw); Bool focus_query_click_to_raise( FvwmWindow *fw, Bool is_focused, int context); Bool focus_query_click_to_focus( FvwmWindow *fw, int context); Bool focus_query_open_grab_focus(FvwmWindow *fw, FvwmWindow *focus_win); Bool focus_query_close_release_focus(const FvwmWindow *fw); FvwmWindow *focus_get_transientfor_fwin(const FvwmWindow *fw); FvwmWindow *get_focus_window(void); void set_focus_window(FvwmWindow *fw); FvwmWindow *get_last_screen_focus_window(void); void set_last_screen_focus_window(FvwmWindow *fw); void update_last_screen_focus_window(FvwmWindow *fw); void set_focus_model(FvwmWindow *fw); void focus_force_refresh_focus(const FvwmWindow *fw); void refresh_focus(const FvwmWindow *fw); #endif /* FOCUS_H */ fvwm-2.6.5.orig/fvwm/module_list.c0000644000175000017500000006746611114077327015313 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #ifdef HAVE_FCNTL_H #include #endif /* for F_CMD_ARGS */ #include "fvwm/fvwm.h" #include "execcontext.h" /* end of for CMD_ARGS */ /*for debug message*/ #include "fvwm.h" #include "misc.h" /* end of for debug message */ /* for get_current_read_file */ #include "read.h" /* for busy cursor */ #include "cursor.h" /* for Scr global */ #include "screen.h" #include "externs.h" /* for module syncronous */ #include "libs/ftime.h" #include "libs/System.c" #include "libs/envvar.h" #include "libs/Parse.h" #include "libs/Strings.h" #include "libs/wild.h" #include "libs/fvwmsignal.h" #include "events.h" #include "bindings.h" /* for positive write */ #include "module_list.h" #include "module_interface.h" /* * Use POSIX behaviour if we can, otherwise use SysV instead * should this be here? */ #ifndef O_NONBLOCK # define O_NONBLOCK O_NDELAY #endif #define MOD_NOGRABMASK(m) ((m)->xNoGrabMask) #define MOD_SYNCMASK(m) ((m)->xSyncMask) typedef struct { unsigned long *data; int size; int done; } mqueue_object_type; /* the linked list pointers to the first and last modules */ static fmodule_list module_list = NULL; /* keep to-be-deleted modules in a deathrow until they are deleted safely. */ static fmodule_list death_row = NULL; /* * static functions */ static fmodule *module_alloc(void); static void module_free(fmodule *module); /* * list handling functions */ static inline void module_list_insert(fmodule *module, fmodule_list *list); static inline fmodule *module_list_remove(fmodule *module, fmodule_list *list); static inline void module_list_destroy(fmodule_list *list); static inline int module_list_len(fmodule_list *list); static void KillModuleByName(char *name, char *alias); static char *get_pipe_name(fmodule *module); static void DeleteMessageQueueBuff(fmodule *module); static inline void msg_mask_set( msg_masks_t *msg_mask, unsigned long m1, unsigned long m2); static void set_message_mask(msg_masks_t *mask, unsigned long msg); void module_kill_all(void) { module_list_destroy(&module_list); return; } static fmodule *module_alloc(void) { fmodule *module; module = (fmodule *)safemalloc(sizeof(fmodule)); MOD_SET_CMDLINE(module, 0); MOD_READFD(module) = -1; MOD_WRITEFD(module) = -1; fqueue_init(&MOD_PIPEQUEUE(module)); msg_mask_set(&MOD_PIPEMASK(module), DEFAULT_MASK, DEFAULT_MASK); msg_mask_set(&MOD_NOGRABMASK(module), 0, 0); msg_mask_set(&MOD_SYNCMASK(module), 0, 0); MOD_NAME(module) = NULL; MOD_ALIAS(module) = NULL; return module; } /* closes the pipes and frees every data associated with a module record */ static void module_free(fmodule *module) { if (module == NULL) { return; } close(MOD_WRITEFD(module)); close(MOD_READFD(module)); if (MOD_NAME(module) != NULL) { free(MOD_NAME(module)); } if (MOD_ALIAS(module) != NULL) { free(MOD_ALIAS(module)); } while (!FQUEUE_IS_EMPTY(&(MOD_PIPEQUEUE(module)))) { DeleteMessageQueueBuff(module); } free(module); return; } static inline void module_list_insert(fmodule *module, fmodule_list *list) { fmodule_store *new_store; DBUG("module_list_insert", "inserting module"); if (module == NULL) { return; } new_store = (fmodule_store*)safemalloc(sizeof(fmodule_store)); new_store->module = module; new_store->next = *list; *list = new_store; return; } static inline fmodule *module_list_remove(fmodule *module, fmodule_list *list) { fmodule_store **position; if (module == NULL) { return NULL; } for ( position = list; *position != NULL; position = &((*position)->next)) { if ((*position)->module == module) { /* found it */ fmodule_store *current; DBUG("module_list_remove", "Removing from module list"); current = *position; *position = (*position)->next; free(current); return module; } } /* module not found */ DBUG("module_list_remove", "Tried to remove a not listed module!"); return NULL; } static inline void module_list_destroy(fmodule_list *list) { fmodule_store *current; fmodule_store *next; for (current = *list; current != NULL; current = next) { next = current->next; module_free(current->module); free(current); } *list = NULL; return; } static fmodule *do_execute_module( F_CMD_ARGS, Bool desperate, Bool do_listen_only) { int fvwm_to_app[2], app_to_fvwm[2]; int i, val, nargs = 0; char *cptr = NULL; char **args = NULL; char *arg1 = NULL; char arg2[20]; char arg3[20]; char arg5[20]; char arg6[20]; char *token; extern char *ModulePath; Window win; FvwmWindow * const fw = exc->w.fw; fmodule *module; fvwm_to_app[0] = -1; fvwm_to_app[1] = -1; app_to_fvwm[1] = -1; app_to_fvwm[0] = -1; args = (char **)safemalloc(7 * sizeof(char *)); /* Olivier: Why ? */ /* if (eventp->type != KeyPress) */ /* UngrabEm(); */ if (action == NULL) { goto err_exit; } if (fw) { win = FW_W(fw); } else { win = None; } action = GetNextToken(action, &cptr); if (!cptr) { goto err_exit; } arg1 = searchPath(ModulePath, cptr, EXECUTABLE_EXTENSION, X_OK); if (arg1 == NULL) { /* If this function is called in 'desparate' mode this means * fvwm is trying a module name as a last resort. In this case * the error message is inappropriate because it was most * likely a typo in a command, not a module name. */ if (!desperate) { fvwm_msg( ERR, "executeModule", "No such module '%s' in ModulePath '%s'", cptr, ModulePath); } goto err_exit; } #ifdef REMOVE_EXECUTABLE_EXTENSION { char *p; p = arg1 + strlen(arg1) - strlen(EXECUTABLE_EXTENSION); if (strcmp(p, EXECUTABLE_EXTENSION) == 0) { *p = 0; } } #endif /* I want one-ended pipes, so I open two two-ended pipes, * and close one end of each. I need one ended pipes so that * I can detect when the module crashes/malfunctions */ if (do_listen_only == True) { fvwm_to_app[0] = -1; fvwm_to_app[1] = -1; } else if (pipe(fvwm_to_app) != 0) { fvwm_msg(ERR, "executeModule", "Failed to open pipe"); goto err_exit; } if (pipe(app_to_fvwm) != 0) { fvwm_msg(ERR, "executeModule", "Failed to open pipe2"); goto err_exit; } if ( fvwm_to_app[0] >= fvwmlib_max_fd || fvwm_to_app[1] >= fvwmlib_max_fd || app_to_fvwm[0] >= fvwmlib_max_fd || app_to_fvwm[1] >= fvwmlib_max_fd) { fvwm_msg(ERR, "executeModule", "too many open fds"); goto err_exit; } /* all ok, create the space and fill up */ module = module_alloc(); MOD_NAME(module) = stripcpy(cptr); free(cptr); sprintf(arg2, "%d", app_to_fvwm[1]); sprintf(arg3, "%d", fvwm_to_app[0]); sprintf(arg5, "%lx", (unsigned long)win); sprintf(arg6, "%lx", (unsigned long)exc->w.wcontext); args[0] = arg1; args[1] = arg2; args[2] = arg3; args[3] = (char *)get_current_read_file(); if (!args[3]) { args[3] = "none"; } args[4] = arg5; args[5] = arg6; for (nargs = 6; action = GetNextToken(action, &token), token; nargs++) { args = (char **)saferealloc( (void *)args, (nargs + 2) * sizeof(char *)); args[nargs] = token; if (MOD_ALIAS(module) == NULL) { const char *ptr = skipModuleAliasToken(args[nargs]); if (ptr && *ptr == '\0') { MOD_ALIAS(module) = stripcpy(args[nargs]); } } } args[nargs] = NULL; /* Try vfork instead of fork. The man page says that vfork is better! */ /* Also, had to change exit to _exit() */ /* Not everyone has vfork! */ val = fork(); if (val > 0) { /* This fork remains running fvwm */ /* close appropriate descriptors from each pipe so * that fvwm will be able to tell when the app dies */ close(app_to_fvwm[1]); /* dont't care that this may be -1 */ close(fvwm_to_app[0]); /* add these pipes to fvwm's active pipe list */ MOD_WRITEFD(module) = fvwm_to_app[1]; MOD_READFD(module) = app_to_fvwm[0]; msg_mask_set( &MOD_PIPEMASK(module), DEFAULT_MASK, DEFAULT_MASK); free(arg1); if (DoingCommandLine) { /* add to the list of command line modules */ DBUG("executeModule", "starting commandline module\n"); MOD_SET_CMDLINE(module, 1); } /* make the PositiveWrite pipe non-blocking. Don't want to jam * up fvwm because of an uncooperative module */ if (MOD_WRITEFD(module) >= 0) { fcntl(MOD_WRITEFD(module), F_SETFL, O_NONBLOCK); } /* Mark the pipes close-on exec so other programs * won`t inherit them */ if (fcntl(MOD_READFD(module), F_SETFD, 1) == -1) { fvwm_msg( ERR, "executeModule", "module close-on-exec failed"); } if ( MOD_WRITEFD(module) >= 0 && fcntl(MOD_WRITEFD(module), F_SETFD, 1) == -1) { fvwm_msg( ERR, "executeModule", "module close-on-exec failed"); } /* module struct is completed, insert into the list */ module_list_insert(module, &module_list); for (i = 6; i < nargs; i++) { if (args[i] != 0) { free(args[i]); } } } else if (val ==0) { /* this is the child */ /* this fork execs the module */ #ifdef FORK_CREATES_CHILD /* dont't care that this may be -1 */ close(fvwm_to_app[1]); close(app_to_fvwm[0]); #endif fvmm_deinstall_signals(); if (!Pdefault) { char visualid[32]; char colormap[32]; sprintf( visualid, "FVWM_VISUALID=%lx", XVisualIDFromVisual(Pvisual)); flib_putenv("FVWM_VISUALID", visualid); sprintf(colormap, "FVWM_COLORMAP=%lx", Pcmap); flib_putenv("FVWM_COLORMAP", colormap); } else { flib_unsetenv("FVWM_VISUALID"); flib_unsetenv("FVWM_COLORMAP"); } /* Why is this execvp?? We've already searched the module * path! */ execvp(arg1,args); fvwm_msg( ERR, "executeModule", "Execution of module failed: %s", arg1); perror(""); close(app_to_fvwm[1]); /* dont't care that this may be -1 */ close(fvwm_to_app[0]); #ifdef FORK_CREATES_CHILD exit(1); #endif } else { fvwm_msg(ERR, "executeModule", "Fork failed"); free(arg1); for (i = 6; i < nargs; i++) { if (args[i] != 0) { free(args[i]); } } free(args); module_free(module); return NULL; } free(args); return module; err_exit: if (arg1 != NULL) { free(arg1); } if (cptr != NULL) { free(cptr); } if (args != NULL) { free(args); } /* dont't care that these may be -1 */ close(fvwm_to_app[0]); close(fvwm_to_app[1]); close(app_to_fvwm[0]); close(app_to_fvwm[1]); return NULL; } fmodule *executeModuleDesperate(F_CMD_ARGS) { fmodule *m; m = do_execute_module(F_PASS_ARGS, True, False); return m; } void module_kill(fmodule *module) { module_list_insert( module_list_remove(module, &module_list), &death_row); return; } /* free modules in the deathrow */ void module_cleanup(void) { module_list_destroy(&death_row); return; } /* void module_send(fmodule *module, unsigned long *ptr, int size) */ /* This used to be marked "fvwm_inline". I removed this when I added the lockonsend logic. The routine seems too big to want to inline. dje 9/4/98 */ extern int myxgrabcount; /* defined in libs/Grab.c */ extern char *ModuleUnlock; /* defined in libs/Module.c */ void PositiveWrite(fmodule *module, unsigned long *ptr, int size) { extern int moduleTimeout; msg_masks_t mask; if (ptr == NULL) { return; } if (MOD_WRITEFD(module) == -1) { return; } if (!IS_MESSAGE_IN_MASK(&(MOD_PIPEMASK(module)), ptr[1])) { return; } /* a dirty hack to prevent FvwmAnimate triggering during Recapture */ /* would be better to send RecaptureStart and RecaptureEnd messages. */ /* If module is lock on send for iconify message and it's an * iconify event and server grabbed, then return */ mask.m1 = (MOD_NOGRABMASK(module).m1 & MOD_SYNCMASK(module).m1); mask.m2 = (MOD_NOGRABMASK(module).m2 & MOD_SYNCMASK(module).m2); if (IS_MESSAGE_IN_MASK(&mask, ptr[1]) && myxgrabcount != 0) { return; } /* DV: This was once the AddToMessageQueue function. Since it was only * called once, put it in here for better performance. */ { mqueue_object_type *c; c = (mqueue_object_type *)malloc( sizeof(mqueue_object_type) + size); if (c == NULL) { fvwm_msg(ERR, "PositiveWrite", "malloc failed\n"); exit(1); } c->size = size; c->done = 0; c->data = (unsigned long *)(c + 1); memcpy((void*)c->data, (const void*)ptr, size); fqueue_add_at_end(&(MOD_PIPEQUEUE(module)), c); } /* dje, from afterstep, for FvwmAnimate, allows modules to sync with * fvwm. this is disabled when the server is grabbed, otherwise * deadlocks happen. M_LOCKONSEND has been replaced by a separated * mask which defines on which messages the fvwm-to-module * communication need to be lock on send. olicha Nov 13, 1999 */ /* migo (19-Aug-2000): removed !myxgrabcount to sync M_DESTROY_WINDOW */ /* dv (06-Jul-2002): added the !myxgrabcount again. Deadlocks *do* * happen without it. There must be another way to fix * M_DESTROY_WINDOW handling in FvwmEvent. */ /*if (IS_MESSAGE_IN_MASK(&(MOD_SYNCMASK(module)), ptr[1]))*/ if ( IS_MESSAGE_IN_MASK( &(MOD_SYNCMASK(module)), ptr[1]) && !myxgrabcount) { fd_set readSet; int channel = MOD_READFD(module); struct timeval timeout; Bool done = False; fmodule_input *input; FlushMessageQueue(module); while (!done) { int rc = 0; /* * We give the read a long timeout; if the module * fails to respond within this time then it deserves * to be KILLED! * * NOTE: rather than impose an arbitrary timeout on the * user, we will make this a configuration parameter. */ do { timeout.tv_sec = moduleTimeout; timeout.tv_usec = 0; FD_ZERO(&readSet); FD_SET(channel, &readSet); /* Wait for input to arrive on just one * descriptor, with a timeout (fvwmSelect <= 0) * or read() returning wrong size is bad news */ rc = fvwmSelect( channel + 1, &readSet, NULL, NULL, &timeout); /* retry if select() failed with EINTR */ } while (rc < 0 && !isTerminated && (errno == EINTR)); if ( isTerminated ) { break; } if (rc > 0) { input = module_receive(module); if ( input == NULL || module_input_expect(input, ModuleUnlockResponse)) { module_input_discard(input); done = True; } else { module_input_execute(input); } } else { char *name; name = get_pipe_name(module); /* Doh! Something has gone wrong - get rid of * the offender! */ fvwm_msg(ERR, "PositiveWrite", "Failed to read descriptor from" " '%s':\n" "- data available=%c\n" "- terminate signal=%c\n", name, (FD_ISSET(channel, &readSet) ? 'Y' : 'N'), isTerminated ? 'Y' : 'N'); module_kill(module); break; } /* Execute all messages from the module until UNLOCK is * received N.B. This may cause recursion if a command * results in a sync message to another module, which * in turn may send a command that results in another * sync message to this module. * Hippo: I don't think this will cause deadlocks, but * the third time we get here the first times UNLOCK * will be read and then on returning up the third * level UNLOCK will be read at the first level. This * could be difficult to fix without turning queueing * on. Turning queueing on may be bad because it can * be useful for modules to be able to inject commands * from modules in a synchronous manner. e.g. * FvwmIconMan can tell FvwmAnimate to do an animation * when a window is de-iconified from the IconMan, * queueing make s this happen too late. */ } } return; } fmodule_input *module_receive(fmodule *module) { unsigned long size; unsigned long cont; Window win; int n; fmodule_input *input = NULL; n = read(MOD_READFD(module), &win, sizeof(Window)); if (n < sizeof(Window)) { /* exit silently, module should have died.. */ goto err; } n = read(MOD_READFD(module), &size, sizeof(size)); if (n < sizeof(size)) { fvwm_msg( ERR, "module_receive", "Fail to read command size (Module: %p, read: %i, " "size: %i)", module, n, (int)sizeof(size)); goto err; } if (size > MAX_MODULE_INPUT_TEXT_LEN) { fvwm_msg(ERR, "module_receive", "Module(%p) command is too big (%ld), limit is %d", module, size, MAX_MODULE_INPUT_TEXT_LEN); /* The rest of the output from this module is going to be * scrambled so let's kill it rather than risk interpreting * garbage */ goto err; } /* allocate all storage at once */ /* also save space for the '\0' termination character */ input = (fmodule_input *)safemalloc( sizeof(fmodule_input) + sizeof(char)*(size + 1)); input->module = module; input->window = win; input->command = (char*)input + sizeof(fmodule_input); n = read(MOD_READFD(module), input->command, size); if (n < size) { fvwm_msg( ERR, "module_receive", "Fail to read command (Module: %p, read: %i, size:" " %ld)", module, n, size); goto err; } input->command[n] = '\0'; n = read(MOD_READFD(module), &cont, sizeof(cont)); if (n < sizeof(cont)) { fvwm_msg(ERR, "module_receive", "Module %p, Size Problems (read: %d, size: %d)", module, n, (int)sizeof(cont)); goto err; } if (cont == 0) { /* this is documented as a valid way for a module to quit * so let's not complain */ module_kill(module); } return input; err: module_kill(module); module_input_discard(input); return NULL; } /* frees the module input data struct */ void module_input_discard(fmodule_input *input) { if (input==NULL) { return; } free(input); } /* returns true if the module command matches "expect", false otherwise */ Bool module_input_expect(fmodule_input *input, char *expect) { if (input == NULL || input->command == NULL || expect == NULL) { return False; } if (strncasecmp(input->command, expect, strlen(expect)) == 0) { /* the module sent the expected string */ return True; } return False; } void module_list_itr_init(fmodule_list_itr *itr) { *itr = module_list; return; } fmodule *module_list_itr_next(fmodule_list_itr *itr) { fmodule *module; if (*itr == NULL) { return NULL; } module = (*itr)->module; *itr = (*itr)->next; return module; } int module_list_len(fmodule_list *list) { int count=0; fmodule_store *current=*list; while (current != NULL) { current = current->next; count++; } return count; } static void KillModuleByName(char *name, char *alias) { fmodule_list_itr moditr; fmodule *module; if (name == NULL) { return; } module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { if ( MOD_NAME(module) != NULL && matchWildcards(name, MOD_NAME(module)) && (!alias || ( MOD_ALIAS(module) && matchWildcards(alias, MOD_ALIAS(module))))) { module_kill(module); } } return; } static char *get_pipe_name(fmodule *module) { char *name=""; if (MOD_NAME(module) != NULL) { if (MOD_ALIAS(module) != NULL) { name = CatString3( MOD_NAME(module), " ", MOD_ALIAS(module)); } else { name = MOD_NAME(module); } } else { name = CatString3("(null)", "", ""); } return name; } /* * returns a pointer inside a string (just after the alias) if ok or NULL */ char *skipModuleAliasToken(const char *string) { #define is_valid_first_alias_char(ch) (isalpha(ch) || (ch) == '/') #define is_valid_alias_char(ch) (is_valid_first_alias_char(ch) \ || isalnum(ch) || (ch) == '-' || \ (ch) == '.' || (ch) == '/') if (is_valid_first_alias_char(*string)) { int len = 1; string++; while (*string && is_valid_alias_char(*string)) { if (++len > MAX_MODULE_ALIAS_LEN) { return NULL; } string++; } return (char *)string; } return NULL; #undef is_valid_first_alias_char #undef is_valid_alias_char } /* message mask handling - does this belong here? */ static inline void msg_mask_set( msg_masks_t *msg_mask, unsigned long m1, unsigned long m2) { msg_mask->m1 = m1; msg_mask->m2 = m2; return; } /* * Sets the mask to the specific value. If M_EXTENDED_MSG is set in mask, the * function operates only on the extended messages, otherwise it operates only * on normal messages. */ static void set_message_mask(msg_masks_t *mask, unsigned long msg) { if (msg & M_EXTENDED_MSG) { mask->m2 = (msg & ~M_EXTENDED_MSG); } else { mask->m1 = msg; } return; } /* message queues */ static void DeleteMessageQueueBuff(fmodule *module) { mqueue_object_type *obj; if (fqueue_get_first(&(MOD_PIPEQUEUE(module)), (void **)&obj) == 1) { /* remove from queue */ fqueue_remove_or_operate_from_front( &(MOD_PIPEQUEUE(module)), NULL, NULL, NULL, NULL); /* we don't need to free the obj->data here because it's in the * same malloced block as the obj itself. */ free(obj); } return; } void FlushMessageQueue(fmodule *module) { extern int moduleTimeout; mqueue_object_type *obj; char *dptr; int a; if (module == NULL) { return; } while (fqueue_get_first(&(MOD_PIPEQUEUE(module)), (void **)&obj) == 1) { dptr = (char *)obj->data; while (obj->done < obj->size) { a = write(MOD_WRITEFD(module), &dptr[obj->done], obj->size - obj->done); if (a >=0) { obj->done += a; } /* the write returns EWOULDBLOCK or EAGAIN if the pipe * is full. (This is non-blocking I/O). SunOS returns * EWOULDBLOCK, OSF/1 returns EAGAIN under these * conditions. Hopefully other OSes return one of these * values too. Solaris 2 doesn't seem to have a man * page for write(2) (!) */ else if (errno == EWOULDBLOCK || errno == EAGAIN) { fd_set writeSet; struct timeval timeout; int channel = MOD_WRITEFD(module); int rc = 0; do { /* Wait until the pipe accepts further * input */ timeout.tv_sec = moduleTimeout; timeout.tv_usec = 0; FD_ZERO(&writeSet); FD_SET(channel, &writeSet); rc = fvwmSelect( channel + 1, NULL, &writeSet, NULL, &timeout); /* retry if select() failed with EINTR */ } while ((rc < 0) && !isTerminated && (errno == EINTR)); if ( isTerminated ) { return; } if (!FD_ISSET(channel, &writeSet)) { char *name; name = get_pipe_name(module); /* Doh! Something has gone wrong - get * rid of the offender! */ fvwm_msg( ERR, "FlushMessageQueue", "Failed to write descriptor to" " '%s':\n" "- select rc=%d\n" "- terminate signal=%c\n", name, rc, isTerminated ? 'Y' : 'N'); module_kill(module); return; } /* pipe accepts further input; continue */ continue; } else if (errno != EINTR) { module_kill(module); return; } } DeleteMessageQueueBuff(module); } return; } void FlushAllMessageQueues(void) { fmodule_list_itr moditr; fmodule *module; module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { FlushMessageQueue(module); } return; } /* empty, only here so that the signal handling initialization code is the * same for modules and fvwm */ RETSIGTYPE DeadPipe(int sig) { SIGNAL_RETURN; } void CMD_Module(F_CMD_ARGS) { do_execute_module(F_PASS_ARGS, False, False); return; } void CMD_ModuleListenOnly(F_CMD_ARGS) { do_execute_module(F_PASS_ARGS, False, True); return; } void CMD_KillModule(F_CMD_ARGS) { char *name; char *alias = NULL; action = GetNextToken(action,&name); if (!name) { return; } GetNextToken(action, &alias); KillModuleByName(name, alias); free(name); if (alias) { free(alias); } return; } void CMD_ModuleSynchronous(F_CMD_ARGS) { int sec = 0; char *next; char *token; char *expect = ModuleFinishedStartupResponse; fmodule *module; fd_set in_fdset; fd_set out_fdset; time_t start_time; Bool done = False; Bool need_ungrab = False; char *escape = NULL; XEvent tmpevent; if (!action) { return; } token = PeekToken(action, &next); if (StrEquals(token, "expect")) { token = PeekToken(next, &next); if (token) { expect = alloca(strlen(token) + 1); strcpy(expect, token); } action = next; token = PeekToken(action, &next); } if (token && StrEquals(token, "timeout")) { if (GetIntegerArguments(next, &next, &sec, 1) > 0 && sec > 0) { /* we have a delay, skip the number */ action = next; } else { fvwm_msg(ERR, "executeModuleSync", "illegal timeout"); return; } } if (!action) { /* no module name */ return; } module = do_execute_module(F_PASS_ARGS, False, False); if (module == NULL) { /* executing the module failed, just return */ return; } /* Busy cursor stuff */ if (Scr.BusyCursor & BUSY_MODULESYNCHRONOUS) { if (GrabEm(CRS_WAIT, GRAB_BUSY)) need_ungrab = True; } /* wait for module input */ start_time = time(NULL); while (!done) { struct timeval timeout; int num_fd; /* A signal here could interrupt the select call. We would * then need to restart our select, unless the signal was * a "terminate" signal. Note that we need to reinitialise * all of select's parameters after it has returned. */ do { FD_ZERO(&in_fdset); FD_ZERO(&out_fdset); FD_SET(MOD_READFD(module), &in_fdset); if (!FQUEUE_IS_EMPTY(&MOD_PIPEQUEUE(module))) { FD_SET(MOD_WRITEFD(module), &out_fdset); } timeout.tv_sec = 0; timeout.tv_usec = 1; num_fd = fvwmSelect( fvwmlib_max_fd, &in_fdset, &out_fdset, 0, &timeout); } while (num_fd < 0 && !isTerminated); /* Exit if we have received a "terminate" signal */ if (isTerminated) { break; } if (num_fd > 0) { if (FD_ISSET(MOD_READFD(module), &in_fdset)) { fmodule_input * input; /* Check for module input. */ input = module_receive(module); if ( input == NULL || module_input_expect(input,expect)) { module_input_discard(input); done = True; } else { module_input_execute(input); } } if ((MOD_WRITEFD(module) >= 0) && FD_ISSET(MOD_WRITEFD(module), &out_fdset)) { FlushMessageQueue(module); } } usleep(1000); if (difftime(time(NULL), start_time) >= sec && sec) { /* timeout */ done = True; } /* Check for "escape function" */ if (FPending(dpy) && FCheckMaskEvent(dpy, KeyPressMask, &tmpevent)) { int context; XClassHint *class; char *name; Window w; context = GetContext( NULL, exc->w.fw, &tmpevent, &w); if (exc->w.fw != NULL) { class = &(exc->w.fw->class); name = exc->w.fw->name.name; } else { class = NULL; name = NULL; } escape = CheckBinding( Scr.AllBindings, STROKE_ARG(0) tmpevent.xkey.keycode, tmpevent.xkey.state, GetUnusedModifiers(), context, BIND_KEYPRESS, class, name); if (escape != NULL) { if (!strcasecmp(escape,"escapefunc")) { done = True; } } } } /* while */ if (need_ungrab) { UngrabEm(GRAB_BUSY); } return; } /* mask handling - does this belong here? */ void CMD_set_mask(F_CMD_ARGS) { unsigned long val; if (exc->m.module == NULL) { return; } if (!action || sscanf(action, "%lu", &val) != 1) { val = 0; } set_message_mask(&(MOD_PIPEMASK(exc->m.module)), (unsigned long)val); return; } void CMD_set_sync_mask(F_CMD_ARGS) { unsigned long val; if (exc->m.module == NULL) { return; } if (!action || sscanf(action,"%lu",&val) != 1) { val = 0; } set_message_mask(&(MOD_SYNCMASK(exc->m.module)), (unsigned long)val); return; } void CMD_set_nograb_mask(F_CMD_ARGS) { unsigned long val; if (exc->m.module == NULL) { return; } if (!action || sscanf(action,"%lu",&val) != 1) { val = 0; } set_message_mask(&(MOD_NOGRABMASK(exc->m.module)), (unsigned long)val); return; } fvwm-2.6.5.orig/fvwm/commands.h0000644000175000017500000001453711705516565014600 0ustar vwcvwc/* -*-c-*- */ #ifndef COMMANDS_H #define COMMANDS_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ enum { F_UNDEFINED = -1, /* functions that need no window */ F_NOP = 0, F_ADDFUNC, F_ADDMENU, F_ADDMENU2, F_ALL, F_ANY, F_BEEP, F_BREAK, F_BUG_OPTS, F_BUSY_CURSOR, F_BUTTON_STATE, F_BUTTON_STYLE, F_CHANGE_MENUSTYLE, F_CIRCULATE_DOWN, F_CIRCULATE_UP, F_CLICK, F_CLOSE, F_COLORMAP_FOCUS, F_COND, F_CONDCASE, F_CONFIG_LIST, F_COPY_MENU_STYLE, F_CURRENT, F_CURSOR_STYLE, F_DESCHEDULE, F_DESKTOP_NAME, F_DESTROY_FUNCTION, F_DESTROY_MENU, F_DESTROY_MENUSTYLE, F_DESTROY_STYLE, F_DFLT_COLORS, F_DFLT_COLORSET, F_DFLT_FONT, F_DFLT_ICON, F_DFLT_LAYERS, F_DIRECTION, F_EDGE_COMMAND, F_EDGE_LEAVE_COMMAND, F_EDGE_RES, F_EDGE_SCROLL, F_EMULATE, F_ESCAPE_FUNC, F_EWMH_BASE_STRUTS, F_EWMH_NUMBER_OF_DESKTOPS, F_EXEC, F_EXEC_SETUP, F_FAKE_CLICK, F_FAKE_KEYPRESS, F_FOCUSSTYLE, F_FUNCTION, F_GLOBAL_OPTS, F_GOTO_DESK, F_GOTO_PAGE, F_HICOLOR, F_HICOLORSET, F_HIDEGEOMWINDOW, F_ICONFONT, F_ICON_PATH, F_IGNORE_MODIFIERS, F_IMAGE_PATH, F_INFOSTOREADD, F_INFOSTOREREMOVE, F_KEEPRC, F_KEY, F_KILL_MODULE, F_LAYER, F_LOCALE_PATH, F_MENUSTYLE, F_MODULE, F_MODULE_LISTEN_ONLY, F_MODULE_PATH, F_MODULE_SYNC, F_MOUSE, F_MOVECURSOR, F_MOVE_TO_DESK, F_NEXT, F_NONE, F_OPAQUE, F_PICK, F_PIXMAP_PATH, F_POINTERKEY, F_POINTERWINDOW, F_POPUP, F_PREV, F_PRINTINFO, F_QUIT, F_QUIT_SESSION, F_QUIT_SCREEN, F_READ, F_RECAPTURE, F_RECAPTURE_WINDOW, F_REFRESH, F_REPEAT, F_RESTART, F_SAVE_SESSION, F_SAVE_QUIT_SESSION, F_SCANFORWINDOW, F_SCHEDULE, F_SCROLL, F_SETDESK, F_SETENV, F_SET_ANIMATION, F_SET_MASK, F_SET_NOGRAB_MASK, F_SET_SYNC_MASK, F_SHADE_ANIMATE, F_SILENT, F_SNAP_ATT, F_SNAP_GRID, F_STAYSUP, STROKE_ARG(F_STROKE) STROKE_ARG(F_STROKE_FUNC) F_STYLE, F_TEARMENUOFF, F_TEST_, F_TESTRC, F_THISWINDOW, F_TITLE, F_TITLESTYLE, F_TOGGLE_PAGE, F_UPDATE_STYLES, F_WAIT, F_WINDOWFONT, F_WINDOWLIST, F_XINERAMA, F_XINERAMAPRIMARYSCREEN, F_XINERAMASLS, F_XINERAMASLSSCREENS, F_XINERAMASLSSIZE, F_XOR, F_XSYNC, F_XSYNCHRONIZE, /* functions that need a window to operate on */ F_ADD_BUTTON_STYLE, F_ADD_DECOR, F_ADD_TITLE_STYLE, F_ANIMATED_MOVE, F_BORDERSTYLE, F_CHANGE_DECOR, F_COLOR_LIMIT, F_DELETE, F_DESTROY, F_DESTROY_DECOR, F_DESTROY_MOD, F_DESTROY_WINDOW_STYLE, F_ECHO, F_ECHO_FUNC_DEFINITION, F_FLIP_FOCUS, F_FOCUS, F_ICONIFY, F_LOWER, F_MAXIMIZE, F_MOVE, F_MOVE_THRESHOLD, F_MOVE_TO_PAGE, F_MOVE_TO_SCREEN, F_PLACEAGAIN, F_RAISE, F_RAISELOWER, F_RESIZE, F_RESIZE_MAXIMIZE, F_RESIZEMOVE, F_RESIZEMOVE_MAXIMIZE, F_RESTACKTRANSIENTS, F_SEND_STRING, F_STATE, F_STICK, F_STICKACROSSDESKS, F_STICKACROSSPAGES, F_UPDATE_DECOR, F_WARP, F_WINDOWID, F_WINDOW_SHADE, F_WINDOW_STYLE, F_END_OF_LIST = 999, /* Functions for use by modules only! */ F_SEND_WINDOW_LIST = 1000, F_SEND_REPLY }; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ #ifdef P #undef P #endif #define P(n) void CMD_ ## n(F_CMD_ARGS) /* This file contains all command prototypes. */ P(Plus); P(AddButtonStyle); P(AddTitleStyle); #ifdef USEDECOR P(AddToDecor); #endif /* USEDECOR */ P(AddToFunc); P(AddToMenu); P(Alias); P(All); P(AnimatedMove); P(Any); P(Beep); P(Break); P(BorderStyle); P(BugOpts); P(BusyCursor); P(ButtonState); P(ButtonStyle); #ifdef USEDECOR P(ChangeDecor); #endif /* USEDECOR */ P(ChangeMenuStyle); P(CleanupColorsets); P(ClickTime); P(Close); P(ColorLimit); P(ColormapFocus); P(Colorset); P(CopyMenuStyle); P(Current); P(CursorMove); P(CursorStyle); P(DefaultColors); P(DefaultColorset); P(DefaultFont); P(DefaultIcon); P(DefaultLayers); P(Delete); P(Deschedule); P(Desk); P(DesktopName); P(DesktopSize); P(Destroy); #ifdef USEDECOR P(DestroyDecor); #endif /* USEDECOR */ P(DestroyFunc); P(DestroyMenu); P(DestroyMenuStyle); P(DestroyModuleConfig); P(DestroyStyle); P(DestroyWindowStyle); P(Direction); P(Echo); P(EchoFuncDefinition); P(EdgeCommand); P(EdgeLeaveCommand); P(EdgeResistance); P(EdgeScroll); P(EdgeThickness); P(Emulate); P(EscapeFunc); P(EwmhBaseStruts); P(EwmhNumberOfDesktops); P(Exec); P(ExecUseShell); P(FakeClick); P(FakeKeypress); P(FlipFocus); P(Focus); P(FocusStyle); P(Function); P(GlobalOpts); P(GnomeButton); P(GnomeShowDesks); P(GotoDesk); P(GotoDeskAndPage); P(GotoPage); P(HideGeometryWindow); P(HilightColor); P(HilightColorset); P(IconFont); P(Iconify); P(IconPath); P(IgnoreModifiers); P(ImagePath); P(InfoStoreAdd); P(InfoStoreRemove); P(KeepRc); P(Key); P(KillModule); P(Layer); P(LocalePath); P(Lower); P(Maximize); P(Menu); P(MenuStyle); P(Module); P(ModuleListenOnly); P(ModulePath); P(ModuleSynchronous); P(ModuleTimeout); P(Mouse); P(Move); P(MoveThreshold); P(MoveToDesk); P(MoveToPage); P(MoveToScreen); P(Next); P(None); P(Nop); P(NoWindow); P(OpaqueMoveSize); P(Pick); P(PipeRead); P(PixmapPath); P(PlaceAgain); P(PointerKey); P(PointerWindow); P(Popup); P(Prev); P(PrintInfo); P(PropertyChange); P(Quit); P(QuitScreen); P(QuitSession); P(Raise); P(RaiseLower); P(Read); P(ReadWriteColors); P(Recapture); P(RecaptureWindow); P(Refresh); P(RefreshWindow); P(Repeat); P(Resize); P(ResizeMaximize); P(ResizeMove); P(ResizeMoveMaximize); P(RestackTransients); P(Restart); P(SaveQuitSession); P(SaveSession); P(ScanForWindow); P(Schedule); P(Scroll); P(Send_ConfigInfo); P(Send_Reply); P(Send_WindowList); P(SendToModule); P(set_mask); P(set_nograb_mask); P(set_sync_mask); P(SetAnimation); P(SetEnv); P(Silent); P(SnapAttraction); P(SnapGrid); P(State); P(Stick); P(StickAcrossDesks); P(StickAcrossPages); #ifdef HAVE_STROKE P(Stroke); P(StrokeFunc); #endif /* HAVE_STROKE */ P(Style); P(TearMenuOff); P(Test); P(TestRc); P(ThisWindow); P(Title); P(TitleStyle); P(Unalias); P(UnsetEnv); P(UpdateDecor); P(UpdateStyles); P(Wait); P(WarpToWindow); P(WindowFont); P(WindowId); P(WindowList); P(WindowShade); P(WindowShadeAnimate); P(WindowStyle); P(Xinerama); P(XineramaPrimaryScreen); P(XineramaSls); P(XineramaSlsScreens); P(XineramaSlsSize); P(XorPixmap); P(XorValue); P(XSync); P(XSynchronize); #undef P #endif /* COMMANDS_H */ fvwm-2.6.5.orig/fvwm/menuparameters.h0000644000175000017500000000616510721523646016020 0ustar vwcvwc/* -*-c-*- */ #ifndef MENU_PARAMETERS_H #define MENU_PARAMETERS_H /* ---------------------------- included header files ---------------------- */ /* Do not #include any files - the file including this file has to take care of * it. */ /* ---------------------------- forward declarations ----------------------- */ struct MenuRoot; struct MenuParameters; struct MenuReturn; struct MenuItem; struct FvwmWindow; /* ---------------------------- type definitions --------------------------- */ /* Return values for UpdateMenu, do_menu, menuShortcuts. This is a lame * hack, in that "_BUTTON" is added to mean a button-release caused the * return-- the macros below help deal with the ugliness. */ typedef enum MenuRC { MENU_ERROR = -1, MENU_NOP = 0, MENU_DONE, MENU_ABORTED, MENU_SUBMENU_DONE, MENU_DOUBLE_CLICKED, MENU_POPUP, MENU_POPDOWN, MENU_SELECTED, MENU_NEWITEM, MENU_NEWITEM_MOVEMENU, MENU_NEWITEM_FIND, MENU_POST, MENU_UNPOST, MENU_TEAR_OFF, MENU_SUBMENU_TORN_OFF, MENU_KILL_TEAR_OFF_MENU, MENU_EXEC_CMD, /* propagate the event to a different menu */ MENU_PROPAGATE_EVENT } MenuRC; typedef struct MenuReturn { MenuRC rc; struct MenuRoot *target_menu; struct { unsigned do_unpost_submenu : 1; unsigned is_first_item_selected : 1; unsigned is_key_press : 1; unsigned is_menu_posted : 1; } flags; } MenuReturn; typedef struct MenuPosHints { /* suggested x/y position */ int x; int y; /* additional offset to x */ int x_offset; /* width of the parent menu or item */ int menu_width; /* to take menu width into account (0, -1 or -0.5) */ float x_factor; /* additional offset factor to x */ float context_x_factor; /* same with height */ float y_factor; int screen_origin_x; int screen_origin_y; /* False if referring to absolute screen position */ Bool is_relative; /* True if referring to a part of a menu */ Bool is_menu_relative; Bool has_screen_origin; } MenuPosHints; typedef struct MenuOptions { struct MenuPosHints pos_hints; /* A position on the Xinerama screen on which the menu should be * started. */ struct { unsigned do_not_warp : 1; unsigned do_warp_on_select : 1; unsigned do_warp_title : 1; unsigned do_select_in_place : 1; unsigned do_tear_off_immediately : 1; unsigned has_poshints : 1; unsigned is_fixed : 1; } flags; } MenuOptions; typedef struct MenuParameters { struct MenuRoot *menu; struct MenuRoot *parent_menu; struct MenuItem *parent_item; const exec_context_t **pexc; struct FvwmWindow *tear_off_root_menu_window; char **ret_paction; XEvent *event_propagate_to_submenu; struct MenuOptions *pops; /* A position on the Xinerama screen on which the menu should be * started. */ int screen_origin_x; int screen_origin_y; struct { unsigned has_default_action : 1; unsigned is_already_mapped : 1; unsigned is_first_root_menu : 1; unsigned is_invoked_by_key_press : 1; unsigned is_sticky : 1; unsigned is_submenu : 1; unsigned is_triggered_by_keypress : 1; } flags; } MenuParameters; typedef struct MenuRepaintTransparentParameters { struct MenuRoot *mr; struct FvwmWindow *fw; } MenuRepaintTransparentParameters; #endif /* MENU_PARAMETERS_H */ fvwm-2.6.5.orig/fvwm/menus.c0000644000175000017500000053051711622413321014102 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* IMPORTANT NOTE: Do *not* use any constant numbers in this file. All values * have to be #defined in the section below or in defaults.h to ensure full * control over the menus. */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include "libs/ftime.h" #include "libs/fvwmlib.h" #include "libs/FScreen.h" #include "libs/Grab.h" #include "libs/Parse.h" #include "libs/ColorUtils.h" #include "libs/Picture.h" #include "libs/PictureUtils.h" #include "libs/Graphics.h" #include "libs/PictureGraphics.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "events.h" #include "eventhandler.h" #include "eventmask.h" #include "cursor.h" #include "functions.h" #include "commands.h" #include "misc.h" #include "screen.h" #include "colormaps.h" #include "geometry.h" #include "move_resize.h" #include "menudim.h" #include "menuitem.h" #include "menuroot.h" #include "menustyle.h" #include "bindings.h" #include "menubindings.h" #include "menugeometry.h" #include "menuparameters.h" #include "menus.h" #include "libs/FGettext.h" /* ---------------------------- local definitions -------------------------- */ /* used in float to int arithmetic */ #define ROUNDING_ERROR_TOLERANCE 0.005 /* ---------------------------- local macros ------------------------------- */ #define SCTX_SET_MI(ctx,item) ((ctx).type = SCTX_MENU_ITEM, \ (ctx).menu_item.menu_item = (item)) #define SCTX_GET_MI(ctx) ((ctx).type == SCTX_MENU_ITEM ? \ (ctx).menu_item.menu_item : NULL) #define SCTX_SET_MR(ctx,root) ((ctx).type = SCTX_MENU_ROOT, \ (ctx).menu_root.menu_root = (root)) #define SCTX_GET_MR(ctx) ((ctx).type == SCTX_MENU_ROOT ? \ (ctx).menu_root.menu_root : NULL) /* ---------------------------- imports ------------------------------------ */ /* This external is safe. It's written only during startup. */ extern XContext MenuContext; /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* patch to pass the last popups position hints to popup_func */ typedef struct { struct { unsigned is_last_menu_pos_hints_valid : 1; unsigned do_ignore_pos_hints : 1; unsigned do_warp_title : 1; } flags; struct MenuPosHints pos_hints; } saved_pos_hints; typedef struct MenuInfo { MenuRoot *all; int n_destroyed_menus; } MenuInfo; typedef struct MenuSizingParameters { MenuRoot *menu; /* number of item labels present in the item format */ int used_item_labels; /* same for mini icons */ int used_mini_icons; struct { int sidepic_width; MenuItemPartSizesT i; } max; struct { unsigned is_popup_indicator_used : 1; } flags; } MenuSizingParameters; typedef enum { SCTX_MENU_ROOT, SCTX_MENU_ITEM } string_context_type_t; typedef union { string_context_type_t type; struct { string_context_type_t type; MenuRoot *menu_root; } menu_root; struct { string_context_type_t type; MenuItem *menu_item; } menu_item; } string_context_t; typedef struct { char delimiter; Bool (*string_handler)( char *string, char delimiter, string_context_t *user_data); } string_def_t; /* ---------------------------- menu loop types ---------------------------- */ typedef enum { MENU_MLOOP_RET_NORMAL, MENU_MLOOP_RET_LOOP, MENU_MLOOP_RET_END } mloop_ret_code_t; typedef struct { unsigned do_popup_immediately : 1; /* used for delay popups, to just popup the menu */ unsigned do_popup_now : 1; unsigned do_popdown_now : 1; /* used for keystrokes, to popup and move to that menu */ unsigned do_popup_and_warp : 1; unsigned do_force_reposition : 1; unsigned do_force_popup : 1; unsigned do_popdown : 1; unsigned do_popup : 1; unsigned do_menu : 1; unsigned do_recycle_event : 1; unsigned do_propagate_event_into_submenu : 1; unsigned has_mouse_moved : 1; unsigned is_off_menu_allowed : 1; unsigned is_key_press : 1; unsigned is_item_entered_by_key_press : 1; unsigned is_motion_faked : 1; unsigned is_popped_up_by_timeout : 1; unsigned is_pointer_in_active_item_area : 1; unsigned is_motion_first : 1; unsigned is_release_first : 1; unsigned is_submenu_mapped : 1; unsigned was_item_unposted : 1; unsigned is_button_release : 1; } mloop_flags_t; typedef struct { MenuItem *mi; MenuRoot *mrMi; int x_offset; int popdown_delay_10ms; int popup_delay_10ms; } mloop_evh_data_t; typedef struct { MenuRoot *mrPopup; MenuRoot *mrPopdown; mloop_flags_t mif; /* used to reduce network traffic with delayed popup/popdown */ MenuItem *mi_with_popup; MenuItem *mi_wants_popup; MenuItem *miRemovedSubmenu; } mloop_evh_input_t; /* values that are set once when the menu loop is entered */ typedef struct mloop_static_info_t { int x_init; int y_init; Time t0; unsigned int event_mask; } mloop_static_info_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* This global is saved and restored every time a function is called that * might modify them, so we can safely let it live outside a function. */ static saved_pos_hints last_saved_pos_hints = { { False, False }, { 0, 0, 0.0, 0.0, 0, 0, False, False, False, False } }; /* structures for menus */ static MenuInfo Menus; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static void __menu_execute_function(const exec_context_t **pexc, char *action) { const exec_context_t *exc; exec_context_changes_t ecc; int old_emf; ecc.w.w = ((*pexc)->w.fw) ? FW_W((*pexc)->w.fw) : None; exc = exc_clone_context(*pexc, &ecc, ECC_W); old_emf = Scr.flags.is_executing_menu_function; Scr.flags.is_executing_menu_function = 1; execute_function(NULL, exc, action, FUNC_DONT_EXPAND_COMMAND); Scr.flags.is_executing_menu_function = old_emf; exc_destroy_context(exc); /* See if the window has been deleted */ if (!check_if_fvwm_window_exists((*pexc)->w.fw)) { ecc.w.fw = NULL; ecc.w.w = None; ecc.w.wcontext = 0; exc = exc_clone_context( *pexc, &ecc, ECC_FW | ECC_W | ECC_WCONTEXT); exc_destroy_context(*pexc); *pexc = exc; } return; } static Bool pointer_in_active_item_area(int x_offset, MenuRoot *mr) { float ratio = (float)MST_ACTIVE_AREA_PERCENT(mr) / 100.0; if (MST_ACTIVE_AREA_PERCENT(mr) >= 100) { return False; } if (MST_USE_LEFT_SUBMENUS(mr)) { return (x_offset <= MR_ITEM_X_OFFSET(mr) + MR_ITEM_WIDTH(mr) - MR_ITEM_WIDTH(mr) * ratio); } else { return (x_offset >= MR_ITEM_X_OFFSET(mr) + MR_ITEM_WIDTH(mr) * ratio); } } static Bool pointer_in_passive_item_area(int x_offset, MenuRoot *mr) { float ratio = (float)MST_ACTIVE_AREA_PERCENT(mr) / 100.0; if (MST_ACTIVE_AREA_PERCENT(mr) >= 100) { return False; } if (MST_USE_LEFT_SUBMENUS(mr)) { return (x_offset >= MR_ITEM_X_OFFSET(mr) + MR_ITEM_WIDTH(mr) * ratio); } else { return (x_offset <= MR_ITEM_X_OFFSET(mr) + MR_ITEM_WIDTH(mr) - MR_ITEM_WIDTH(mr) * ratio); } } /* * warping functions */ static void warp_pointer_to_title(MenuRoot *mr) { FWarpPointer( dpy, 0, MR_WINDOW(mr), 0, 0, 0, 0, menudim_middle_x_offset(&MR_DIM(mr)), menuitem_middle_y_offset(MR_FIRST_ITEM(mr), MR_STYLE(mr))); } static MenuItem *warp_pointer_to_item( MenuRoot *mr, MenuItem *mi, Bool do_skip_title) { if (do_skip_title) { while (MI_NEXT_ITEM(mi) != NULL && (!MI_IS_SELECTABLE(mi) || MI_IS_TEAR_OFF_BAR(mi))) { /* skip separators, titles and tear off bars until the * first 'real' item is found */ mi = MI_NEXT_ITEM(mi); } } if (mi == NULL) { mi = MR_LAST_ITEM(mr); } if (mi == NULL) { return mi; } FWarpPointer( dpy, 0, MR_WINDOW(mr), 0, 0, 0, 0, menudim_middle_x_offset(&MR_DIM(mr)), menuitem_middle_y_offset(mi, MR_STYLE(mr))); return mi; } /* * menu animation functions */ /* prepares the parameters to be passed to AnimatedMoveOfWindow * mr - the menu instance that holds the menu item * fw - the FvwmWindow structure to check against allowed functions */ static void get_menu_repaint_transparent_parameters( MenuRepaintTransparentParameters *pmrtp, MenuRoot *mr, FvwmWindow *fw) { pmrtp->mr = mr; pmrtp->fw = fw; return; } /* Undo the animation of a menu */ static void animated_move_back( MenuRoot *mr, Bool do_warp_pointer, FvwmWindow *fw) { MenuRepaintTransparentParameters mrtp; int act_x; int act_y; if (MR_XANIMATION(mr) == 0) { return; } if (menu_get_geometry( mr, &JunkRoot, &act_x, &act_y, &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth)) { Bool transparent_bg = False; /* move it back */ if (ST_HAS_MENU_CSET(MR_STYLE(mr)) && CSET_IS_TRANSPARENT(ST_CSET_MENU(MR_STYLE(mr)))) { transparent_bg = True; get_menu_repaint_transparent_parameters( &mrtp, mr, fw); } AnimatedMoveOfWindow( MR_WINDOW(mr), act_x, act_y, act_x - MR_XANIMATION(mr), act_y, do_warp_pointer, -1, NULL, (transparent_bg)? &mrtp:NULL); MR_XANIMATION(mr) = 0; } return; } /* move a menu or a tear-off menu preserving transparency. * tear-off menus are moved with their frame coordinates. */ static void move_any_menu( MenuRoot *mr, MenuParameters *pmp, int endX, int endY) { if (MR_IS_TEAR_OFF_MENU(mr)) { float fFull = 1.0; /* this moves the tearoff menu, updating of transparency * will not be as good as if menu repaint parameters * are used. */ AnimatedMoveFvwmWindow( pmp->tear_off_root_menu_window, FW_W_FRAME(pmp->tear_off_root_menu_window), -1, -1, endX, endY, False, 0, &fFull); } else { int x; int y; int JunkDept; menu_get_geometry(mr, &JunkRoot, &x, &y, &JunkWidth, &JunkHeight, &JunkBW, &JunkDept); if (x == endX && y == endY) { return; } if (ST_HAS_MENU_CSET(MR_STYLE(mr)) && CSET_IS_TRANSPARENT(ST_CSET_MENU(MR_STYLE(mr)))) { MenuRepaintTransparentParameters mrtp; get_menu_repaint_transparent_parameters( &mrtp, mr, (*pmp->pexc)->w.fw); update_transparent_menu_bg( &mrtp, x, y, endX, endY, endX, endY); XMoveWindow(dpy, MR_WINDOW(mr), endX, endY); repaint_transparent_menu( &mrtp, False, endX,endY, endX, endY, True); } else { XMoveWindow(dpy, MR_WINDOW(mr), endX, endY); } } } /* ---------------------------- submenu function --------------------------- */ /* Search for a submenu that was popped up by the given item in the given * instance of the menu. */ static MenuRoot *seek_submenu_instance( MenuRoot *parent_menu, MenuItem *parent_item) { MenuRoot *mr; for (mr = Menus.all; mr != NULL; mr = MR_NEXT_MENU(mr)) { if (MR_PARENT_MENU(mr) == parent_menu && MR_PARENT_ITEM(mr) == parent_item) { /* here it is */ break; } } return mr; } static Bool is_submenu_mapped(MenuRoot *parent_menu, MenuItem *parent_item) { XWindowAttributes win_attribs; MenuRoot *mr; mr = seek_submenu_instance(parent_menu, parent_item); if (mr == NULL) { return False; } if (MR_WINDOW(mr) == None) { return False; } if (!XGetWindowAttributes(dpy, MR_WINDOW(mr), &win_attribs)) { return False; } return (win_attribs.map_state == IsViewable); } /* Returns the menu root that a given menu item pops up */ static MenuRoot *mr_popup_for_mi(MenuRoot *mr, MenuItem *mi) { char *menu_name; MenuRoot *menu = NULL; /* This checks if mi is != NULL too */ if (!mi || !MI_IS_POPUP(mi)) { return NULL; } /* first look for a menu that is aleady mapped */ menu = seek_submenu_instance(mr, mi); if (menu) { return menu; } /* just look past "Popup " in the action, and find that menu root */ menu_name = PeekToken(SkipNTokens(MI_ACTION(mi), 1), NULL); menu = menus_find_menu(menu_name); return menu; } /* ---------------------------- item handling ------------------------------ */ /* * find_entry() * * Returns the menu item the pointer is over and optionally the offset * from the left side of the menu entry (if px_offset is != NULL) and * the MenuRoot the pointer is over (if pmr is != NULL). */ static MenuItem *find_entry( MenuParameters *pmp, int *px_offset /*NULL means don't return this value */, MenuRoot **pmr /*NULL means don't return this value */, /* values passed in from caller it FQueryPointer was already called * there */ Window p_child, int p_rx, int p_ry) { MenuItem *mi; MenuRoot *mr; int root_x, root_y; int x, y; Window Child; int r; /* x_offset returns the x offset of the pointer in the found menu item */ if (px_offset) { *px_offset = 0; } if (pmr) { *pmr = NULL; } /* get the pointer position */ if (p_rx < 0) { if (!FQueryPointer( dpy, Scr.Root, &JunkRoot, &Child, &root_x, &root_y, &JunkX, &JunkY, &JunkMask)) { /* pointer is on a different screen */ return NULL; } } else { root_x = p_rx; root_y = p_ry; Child = p_child; } /* find out the menu the pointer is in */ if (pmp->tear_off_root_menu_window != NULL && Child == FW_W_FRAME(pmp->tear_off_root_menu_window)) { /* we're in the top level torn off menu */ Child = FW_W(pmp->tear_off_root_menu_window); } if (XFindContext(dpy, Child, MenuContext, (caddr_t *)&mr) == XCNOENT) { return NULL; } /* get position in that child window */ if (!XTranslateCoordinates( dpy, Scr.Root, MR_WINDOW(mr), root_x, root_y, &x, &y, &JunkChild)) { return NULL; } if (x < 0 || y < 0 || x >= MR_WIDTH(mr) || y >= MR_HEIGHT(mr)) { return NULL; } if (pmr) { *pmr = mr; } r = MST_RELIEF_THICKNESS(mr); /* look for the entry that the mouse is in */ for (mi = MR_FIRST_ITEM(mr); mi; mi = MI_NEXT_ITEM(mi)) { int a; int b; a = (MI_PREV_ITEM(mi) && MI_IS_SELECTABLE(MI_PREV_ITEM(mi))) ? r / 2 : 0; if (!MI_IS_SELECTABLE(mi)) { b = 0; } else if (MI_NEXT_ITEM(mi) && MI_IS_SELECTABLE(MI_NEXT_ITEM(mi))) { b = r / 2; } else { b = r; } if (y >= MI_Y_OFFSET(mi) - a && y < MI_Y_OFFSET(mi) + MI_HEIGHT(mi) + b) { break; } } if (x < MR_ITEM_X_OFFSET(mr) || x >= MR_ITEM_X_OFFSET(mr) + MR_ITEM_WIDTH(mr) - 1) { mi = NULL; } if (mi && px_offset) { *px_offset = x; } return mi; } /* ---------------------------- keyboard shortcuts ------------------------- */ static Bool is_double_click( Time t0, MenuItem *mi, MenuParameters *pmp, MenuReturn *pmret, double_keypress *pdkp, Bool has_mouse_moved) { if ((*pmp->pexc)->x.elast->type == KeyPress) { return False; } if (fev_get_evtime() - t0 >= MST_DOUBLE_CLICK_TIME(pmp->menu)) { return False; } if (has_mouse_moved) { return False; } if (!pmp->flags.has_default_action && (mi && mi == MR_FIRST_ITEM(pmp->menu) && MI_IS_SELECTABLE(mi))) { return False; } if (pmp->flags.is_submenu) { return False; } if (pmp->flags.is_invoked_by_key_press && pdkp->timestamp == 0) { return False; } return True; } /* ---------------------------- item label parsing ------------------------- */ /* * Procedure: * scanForHotkeys - Look for hotkey markers in a MenuItem * (pete@tecc.co.uk) * * Inputs: * it - MenuItem to scan * column - The column number in which to look for a hotkey. * */ static void scanForHotkeys( MenuItem *it, int column) { char *start; char *s; char *t; /* Get start of string */ start = MI_LABEL(it)[column]; /* Scan whole string */ for (s = start; *s != '\0'; s++) { if (*s != '&') { continue; } if (s[1] != '&') { /* found a hotkey - only one hotkey per item */ break; } /* Just an escaped '&'; copy the string down over it */ for (t = s; *t != '\0'; t++) { t[0] = t[1]; } } if (*s != 0) { /* It's a hot key marker - work out the offset value */ MI_HOTKEY_COFFSET(it) = s - start; MI_HOTKEY_COLUMN(it) = column; MI_HAS_HOTKEY(it) = (s[1] != '\0'); MI_IS_HOTKEY_AUTOMATIC(it) = 0; for ( ; *s != '\0'; s++) { /* Copy down.. */ s[0] = s[1]; } } return; } static void __copy_down(char *remove_from, char *remove_to) { char *t1; char *t2; for (t1 = remove_from, t2 = remove_to; *t2 != '\0'; t2++, t1++) { *t1 = *t2; } *t1 = '\0'; return; } static int __check_for_delimiter(char *s, const string_def_t *string_defs) { int type; for (type = 0; string_defs[type].delimiter != '\0'; type++) { if (s[0] == string_defs[type].delimiter) { if (s[1] != string_defs[type].delimiter) { return type; } else { /* escaped delimiter, copy the * string down over it */ __copy_down(s, s+1); return -1; } } } return -1; } /* This scans for strings within delimiters and calls a callback based * on the delimiter found for each found string */ static void scanForStrings( char *instring, const string_def_t *string_defs, string_context_t *context) { char *s; int type; char *string; type = -1; /* string is set whenever type >= 0, and unused otherwise * set to NULL to supress compiler warning */ string = NULL; for (s = instring; *s != '\0'; s++) { if (type < 0) { /* look for starting delimiters */ type = __check_for_delimiter(s, string_defs); if (type >= 0) { /* start of a string */ string = s + 1; } } else if ( s[0] == string_defs[type].delimiter && s[1] != string_defs[type].delimiter) { /* found ending delimiter */ Bool is_valid; /* terminate the string pointer */ s[0] = '\0'; is_valid = string_defs[type].string_handler( string, string_defs[type].delimiter, context); /* restore the string */ s[0] = string_defs[type].delimiter; if (is_valid) { /* the string was OK, remove it from * instring */ __copy_down(string - 1, s + 1); /* continue next iteration at the * first character after the string */ s = string - 2; } type = -1; } else if (s[0] == string_defs[type].delimiter) { /* escaped delimiter, copy the string down over * it */ __copy_down(s, s + 1); } } } /* Side picture support: this scans for a color int the menu name for colorization */ static Bool __scan_for_color( char *name, char type, string_context_t *context) { if (type != '^' || SCTX_GET_MR(*context) == NULL) { abort(); } if (MR_HAS_SIDECOLOR(SCTX_GET_MR(*context))) { return False; } MR_SIDECOLOR(SCTX_GET_MR(*context)) = GetColor(name); MR_HAS_SIDECOLOR(SCTX_GET_MR(*context)) = True; return True; } static Bool __scan_for_pixmap( char *name, char type, string_context_t *context) { FvwmPicture *p; FvwmPictureAttributes fpa; int current_mini_icon; /* check that more pictures are allowed before trying to load the * picture */ current_mini_icon = -999999999; switch (type) { case '@': if (SCTX_GET_MR(*context) == NULL) { abort(); } if (MR_SIDEPIC(SCTX_GET_MR(*context))) { return False; } break; case '*': /* menu item picture, requires menu item */ if (SCTX_GET_MI(*context) == NULL) { abort(); } if (MI_PICTURE(SCTX_GET_MI(*context))) { return False; } break; case '%': /* mini icon - look for next free spot */ if (SCTX_GET_MI(*context) == NULL) { abort(); } current_mini_icon = 0; while (current_mini_icon < MAX_MENU_ITEM_MINI_ICONS) { if ( MI_MINI_ICON(SCTX_GET_MI(*context)) [current_mini_icon]) { current_mini_icon++; } else { break; } } if (current_mini_icon == MAX_MENU_ITEM_MINI_ICONS) { return False; } break; default: abort(); } fpa.mask = 0; p = PCacheFvwmPicture( dpy, Scr.NoFocusWin, NULL, name, fpa); if (!p) { fvwm_msg(WARN, "scanForPixmap", "Couldn't load image from %s", name); /* return true to make missing pictures not appear in the * label/name */ return True; } switch (type) { case '@': MR_SIDEPIC(SCTX_GET_MR(*context)) = p; break; case '*': MI_PICTURE(SCTX_GET_MI(*context)) = p; MI_HAS_PICTURE(SCTX_GET_MI(*context)) = True; break; case '%': MI_MINI_ICON(SCTX_GET_MI(*context))[current_mini_icon] = p; MI_HAS_PICTURE(SCTX_GET_MI(*context)) = True; break; } return True; } /* ---------------------------- item list handling ------------------------- */ static void unlink_item_from_menu( MenuRoot *mr, MenuItem *mi) { MenuItem *next; MenuItem *prev; next = MI_NEXT_ITEM(mi); prev = MI_PREV_ITEM(mi); if (next != NULL) { MI_PREV_ITEM(next) = prev; } else { MR_LAST_ITEM(mr) = prev; } if (prev != NULL) { MI_NEXT_ITEM(prev) = next; } else { MR_FIRST_ITEM(mr) = next; } MI_NEXT_ITEM(mi) = NULL; MI_PREV_ITEM(mi) = NULL; MR_ITEMS(mr)--; return; } /* Add the given menu item to the menu. If the first item of the menu is a * title, and the do_replace_title flag is True, the old title is deleted and * replaced by the new item. Otherwise the item is appended at the end of the * menu. */ static void append_item_to_menu( MenuRoot *mr, MenuItem *mi, Bool do_replace_title) { if (MR_FIRST_ITEM(mr) == NULL) { MR_FIRST_ITEM(mr) = mi; MR_LAST_ITEM(mr) = mi; MI_NEXT_ITEM(mi) = NULL; MI_PREV_ITEM(mi) = NULL; } else if (do_replace_title) { if (MI_IS_TITLE(MR_FIRST_ITEM(mr))) { if (MR_FIRST_ITEM(mr) == MR_LAST_ITEM(mr)) { MR_LAST_ITEM(mr) = mi; } if (MI_NEXT_ITEM(MR_FIRST_ITEM(mr)) != NULL) { MI_PREV_ITEM(MI_NEXT_ITEM( MR_FIRST_ITEM(mr))) = mi; } MI_NEXT_ITEM(mi) = MI_NEXT_ITEM(MR_FIRST_ITEM(mr)); menuitem_free(MR_FIRST_ITEM(mr)); } else { MI_PREV_ITEM(MR_FIRST_ITEM(mr)) = mi; MI_NEXT_ITEM(mi) = MR_FIRST_ITEM(mr); } MI_PREV_ITEM(mi) = NULL; MR_FIRST_ITEM(mr) = mi; } else { MI_NEXT_ITEM(MR_LAST_ITEM(mr)) = mi; MI_PREV_ITEM(mi) = MR_LAST_ITEM(mr); MR_LAST_ITEM(mr) = mi; } return; } static void clone_menu_item_list( MenuRoot *dest_mr, MenuRoot *src_mr) { MenuItem *mi; MenuItem *cloned_mi; MenuRoot *mr; MR_FIRST_ITEM(dest_mr) = NULL; MR_LAST_ITEM(dest_mr) = NULL; /* traverse the menu and all its continuations */ for (mr = src_mr; mr != NULL; mr = MR_CONTINUATION_MENU(mr)) { /* duplicate all items in the current menu */ for (mi = MR_FIRST_ITEM(mr); mi != NULL; mi = MI_NEXT_ITEM(mi)) { if (MI_IS_CONTINUATION(mi)) { /* skip this item */ continue; } cloned_mi = menuitem_clone(mi); append_item_to_menu(dest_mr, cloned_mi, False); } } return; } /* ---------------------------- MenuRoot maintenance functions ------------- */ /* Extract interesting values from the item format string that are needed by * the size_menu_... functions. */ static void calculate_item_sizes(MenuSizingParameters *msp) { MenuItem *mi; MenuItemPartSizesT mipst; int i; Bool do_reverse_icon_order = (MST_USE_LEFT_SUBMENUS(msp->menu)) ? True : False; memset(&(msp->max), 0, sizeof(msp->max)); /* Calculate the widths for all columns of all items. */ for (mi = MR_FIRST_ITEM(msp->menu); mi != NULL; mi = MI_NEXT_ITEM(mi)) { if (MI_IS_TITLE(mi)) { menuitem_get_size( mi, &mipst, MST_PTITLEFONT(msp->menu), do_reverse_icon_order); } else { menuitem_get_size( mi, &mipst, MST_PSTDFONT(msp->menu), do_reverse_icon_order); } /* adjust maximums */ if (msp->max.i.triangle_width < mipst.triangle_width) { msp->max.i.triangle_width = mipst.triangle_width; } if (msp->max.i.title_width < mipst.title_width) { msp->max.i.title_width = mipst.title_width; } for (i = 0; i < MAX_MENU_ITEM_LABELS; i++) { if (msp->max.i.label_width[i] < mipst.label_width[i]) { msp->max.i.label_width[i] = mipst.label_width[i]; } } if (msp->max.i.picture_width < mipst.picture_width) { msp->max.i.picture_width = mipst.picture_width; } for (i = 0; i < MAX_MENU_ITEM_MINI_ICONS; i++) { if (msp->max.i.icon_width[i] < mipst.icon_width[i]) { msp->max.i.icon_width[i] = mipst.icon_width[i]; } } } if (MR_SIDEPIC(msp->menu)) { msp->max.sidepic_width = MR_SIDEPIC(msp->menu)->width; } else if (MST_SIDEPIC(msp->menu)) { msp->max.sidepic_width = MST_SIDEPIC(msp->menu)->width; } return; } /* * * Calculate the positions of the columns in the menu. * Called by make_menu(). * */ static void size_menu_horizontally(MenuSizingParameters *msp) { MenuItem *mi; Bool sidepic_is_left = True; int total_width; int sidepic_space = 0; int label_offset[MAX_MENU_ITEM_LABELS]; char lcr_column[MAX_MENU_ITEM_LABELS]; int i; int d; int relief_thickness = MST_RELIEF_THICKNESS(msp->menu); int *item_order[ MAX_MENU_ITEM_LABELS + MAX_MENU_ITEM_MINI_ICONS + 1 /* triangle */ + 2 /* relief markers */]; int used_objects = 0; int left_objects = 0; int right_objects = 0; int x; unsigned char icons_placed = 0; Bool sidepic_placed = False; Bool triangle_placed = False; Bool relief_begin_placed = False; Bool relief_end_placed = False; char *format; Bool first = True; Bool done = False; Bool is_last_object_left = True; unsigned char columns_placed = 0; int relief_gap = 0; int gap_left; int gap_right; int chars; memset(item_order, 0, sizeof(item_order)); for (i = 0; i < MAX_MENU_ITEM_LABELS; i++) { lcr_column[i] = 'l'; } /* Now calculate the offsets for the columns. */ format = MST_ITEM_FORMAT(msp->menu); if (!format) { format = (MST_USE_LEFT_SUBMENUS(msp->menu)) ? DEFAULT_LEFT_MENU_ITEM_FORMAT : DEFAULT_MENU_ITEM_FORMAT; } /* Place the individual items off the menu in case they are not * set in the format string. */ for (i = 0; i < MAX_MENU_ITEM_LABELS; i++) { label_offset[i] = 2 * Scr.MyDisplayWidth; } x = MST_BORDER_WIDTH(msp->menu); while (*format && !done) { switch (*format) { case '%': format++; chars = 0; gap_left = 0; gap_right = 0; /* Insert a gap of %d pixels. */ if (sscanf(format, "%d.%d%n", &gap_left, &gap_right, &chars) >= 2 || (sscanf(format, "%d.%n", &gap_left, &chars) >= 1 && chars > 0) || sscanf(format, "%d%n", &gap_left, &chars) >= 1 || sscanf(format, ".%d%n", &gap_right, &chars) >= 1) { if (gap_left > MR_SCREEN_WIDTH(msp->menu) || gap_left < -MR_SCREEN_WIDTH(msp->menu)) { gap_left = 0; } if (gap_right > MR_SCREEN_HEIGHT(msp->menu) || gap_right < -MR_SCREEN_HEIGHT(msp->menu)) { gap_right = 0; } /* Skip the number. */ format += chars; } else if (*format == '.') { /* Skip a dot without values */ format++; } if (!*format) { break; } switch (*format) { case 'l': case 'c': case 'r': /* A left, center or right aligned column. */ if (columns_placed >= MAX_MENU_ITEM_LABELS) { break; } if ( msp->max.i.label_width[columns_placed] <= 0) { columns_placed++; break; } lcr_column[columns_placed] = *format; x += gap_left; label_offset[columns_placed] = x; x += msp->max.i.label_width[columns_placed] + gap_right; item_order[used_objects++] = &(label_offset[columns_placed]); if (is_last_object_left && (*format == 'l')) { left_objects++; } else { is_last_object_left = False; if (*format == 'r') { right_objects++; } else { right_objects = 0; } } columns_placed++; break; case 's': /* the sidepic */ if (sidepic_placed) { break; } sidepic_placed = True; if (msp->max.sidepic_width <= 0) { break; } x += gap_left; MR_SIDEPIC_X_OFFSET(msp->menu) = x; sidepic_is_left = first; sidepic_space = msp->max.sidepic_width + ((sidepic_is_left) ? gap_left : gap_right); x += msp->max.sidepic_width + gap_right; break; case 'i': /* a mini icon */ if (icons_placed >= MAX_MENU_ITEM_MINI_ICONS) { break; } if (msp->max.i.icon_width[icons_placed] > 0) { x += gap_left; MR_ICON_X_OFFSET(msp->menu) [icons_placed] = x; x += msp->max.i.icon_width [icons_placed] + gap_right; item_order[used_objects++] = &(MR_ICON_X_OFFSET(msp->menu) [icons_placed]); if (is_last_object_left) { left_objects++; } else { right_objects++; } } icons_placed++; break; case '|': if (!relief_begin_placed) { relief_begin_placed = True; x += gap_left; MR_HILIGHT_X_OFFSET(msp->menu) = x; x += relief_thickness + gap_right; relief_gap += gap_right; item_order[used_objects++] = &(MR_HILIGHT_X_OFFSET( msp->menu)); if (is_last_object_left) { left_objects++; } else { right_objects = 0; } } else if (!relief_end_placed) { relief_end_placed = True; x += relief_thickness + gap_left; /* This is a hack: for now we record * the x coordinate of the end of the * hilight area, but later we'll place * the width in here. */ MR_HILIGHT_WIDTH(msp->menu) = x; x += gap_right; relief_gap += gap_left; item_order[used_objects++] = &(MR_HILIGHT_WIDTH(msp->menu)); right_objects++; } break; case '>': case '<': /* the triangle for popup menus */ if (triangle_placed) { break; } triangle_placed = True; if (msp->max.i.triangle_width > 0) { x += gap_left; MR_TRIANGLE_X_OFFSET( msp->menu) = x; MR_IS_LEFT_TRIANGLE(msp->menu) = (*format == '<'); x += msp->max.i.triangle_width + gap_right; item_order[used_objects++] = &(MR_TRIANGLE_X_OFFSET( msp->menu)); if (is_last_object_left && *format == '<') { left_objects++; } else { is_last_object_left = False; right_objects++; } } break; case 'p': /* Simply add a gap. */ x += gap_right + gap_left; break; case '\t': x += MENU_TAB_WIDTH * FlocaleTextWidth( MST_PSTDFONT( msp->menu), " ", 1); break; case ' ': /* Advance the x position. */ x += FlocaleTextWidth( MST_PSTDFONT(msp->menu), format, 1); break; default: /* Ignore unknown characters. */ break; } /* switch (*format) */ break; case '\t': x += MENU_TAB_WIDTH * FlocaleTextWidth( MST_PSTDFONT(msp->menu), " ", 1); break; case ' ': /* Advance the x position. */ x += FlocaleTextWidth( MST_PSTDFONT(msp->menu), format, 1); break; default: /* Ignore unknown characters. */ break; } /* switch (*format) */ format++; first = False; } /* while (*format) */ /* stored for vertical sizing */ msp->used_item_labels = columns_placed; msp->used_mini_icons = icons_placed; /* Hide unplaced parts of the menu. */ if (!sidepic_placed) { MR_SIDEPIC_X_OFFSET(msp->menu) = 2 * MR_SCREEN_WIDTH(msp->menu); } for (i = icons_placed; i < MAX_MENU_ITEM_MINI_ICONS; i++) { MR_ICON_X_OFFSET(msp->menu)[i] = 2 * MR_SCREEN_WIDTH(msp->menu); } if (!triangle_placed) { MR_TRIANGLE_X_OFFSET(msp->menu) = 2 * MR_SCREEN_WIDTH(msp->menu); } msp->flags.is_popup_indicator_used = triangle_placed; total_width = x - MST_BORDER_WIDTH(msp->menu); d = (sidepic_space + 2 * relief_thickness + max(msp->max.i.title_width, msp->max.i.picture_width)) - total_width; if (d > 0) { int m = 1 - left_objects; int n = 1 + used_objects - left_objects - right_objects; /* The title is larger than all menu items. Stretch the * gaps between the items up to the total width of the * title. */ for (i = 0; i < used_objects; i++) { if (i < left_objects) { continue; } if (i >= used_objects - right_objects) { /* Right aligned item. */ *(item_order[i]) += d; } else { /* Neither left nor right aligned item. * Divide the overhead gap evenly * between the items. */ *(item_order[i]) += d * (m + i) / n; } } total_width += d; if (!sidepic_is_left) { MR_SIDEPIC_X_OFFSET(msp->menu) += d; } } /* if (d > 0) */ MR_WIDTH(msp->menu) = total_width + 2 * MST_BORDER_WIDTH(msp->menu); MR_ITEM_WIDTH(msp->menu) = total_width - sidepic_space; MR_ITEM_X_OFFSET(msp->menu) = MST_BORDER_WIDTH(msp->menu); if (sidepic_is_left) { MR_ITEM_X_OFFSET(msp->menu) += sidepic_space; } if (!relief_begin_placed) { MR_HILIGHT_X_OFFSET(msp->menu) = MR_ITEM_X_OFFSET(msp->menu); } if (relief_end_placed) { MR_HILIGHT_WIDTH(msp->menu) = MR_HILIGHT_WIDTH(msp->menu) - MR_HILIGHT_X_OFFSET(msp->menu); } else { MR_HILIGHT_WIDTH(msp->menu) = MR_ITEM_WIDTH(msp->menu) + MR_ITEM_X_OFFSET(msp->menu) - MR_HILIGHT_X_OFFSET(msp->menu); } /* Now calculate the offsets for the individual labels. */ for (mi = MR_FIRST_ITEM(msp->menu); mi != NULL; mi = MI_NEXT_ITEM(mi)) { for (i = 0; i < MAX_MENU_ITEM_LABELS; i++) { if (MI_LABEL(mi)[i] == NULL) { continue; } if (!MI_IS_TITLE(mi) || !MI_IS_TITLE_CENTERED(mi)) { switch (lcr_column[i]) { case 'l': MI_LABEL_OFFSET(mi)[i] = label_offset[i]; break; case 'c': MI_LABEL_OFFSET(mi)[i] = label_offset[i] + (msp->max.i.label_width[i] - MI_LABEL_OFFSET(mi)[i]) / 2; break; case 'r': MI_LABEL_OFFSET(mi)[i] = label_offset[i] + msp->max.i.label_width[i] - MI_LABEL_OFFSET(mi)[i]; break; } } else { /* This is a centered title item (indicated by * negative width). */ MI_LABEL_OFFSET(mi)[i] = menudim_middle_x_offset( &MR_DIM(msp->menu)) - MI_LABEL_OFFSET(mi)[i] / 2; } } /* for */ } /* for */ return; } static int calc_more_item_height(MenuSizingParameters *msp) { int height; height = MST_PSTDFONT(msp->menu)->height + MST_ITEM_GAP_ABOVE(msp->menu) + MST_ITEM_GAP_BELOW(msp->menu) + MST_RELIEF_THICKNESS(msp->menu); return height; } static int calc_normal_item_height(MenuSizingParameters *msp, MenuItem *mi) { int height; height = MST_ITEM_GAP_ABOVE(msp->menu) + MST_ITEM_GAP_BELOW(msp->menu) + MST_RELIEF_THICKNESS(msp->menu); /* Normal text entry or an entry with a sub menu triangle */ if ( (MI_HAS_TEXT(mi) && msp->used_item_labels) || (MI_IS_POPUP(mi) && msp->flags.is_popup_indicator_used)) { height += MST_PSTDFONT(msp->menu)->height; } return height; } /* * * Calculate the positions of the columns in the menu. * Called by make_menu(). * */ static Bool size_menu_vertically(MenuSizingParameters *msp) { MenuItem *mi; int y; int cItems; int relief_thickness = MST_RELIEF_THICKNESS(msp->menu); int i; Bool has_continuation_menu = False; MR_ITEM_TEXT_Y_OFFSET(msp->menu) = MST_PSTDFONT(msp->menu)->ascent + relief_thickness + MST_ITEM_GAP_ABOVE(msp->menu); /* mi_prev trails one behind mi, since we need to move that into a newly-made menu if we run out of space */ y = MST_BORDER_WIDTH(msp->menu) + MST_VERTICAL_MARGIN_TOP(msp->menu); for ( cItems = 0, mi = MR_FIRST_ITEM(msp->menu); mi != NULL; mi = MI_NEXT_ITEM(mi), cItems++) { Bool last_item_has_relief = (MI_PREV_ITEM(mi)) ? MI_IS_SELECTABLE(MI_PREV_ITEM(mi)) : False; Bool has_mini_icon = False; int separator_height; int menu_height; separator_height = (last_item_has_relief) ? MENU_SEPARATOR_HEIGHT + relief_thickness : MENU_SEPARATOR_TOTAL_HEIGHT; MI_Y_OFFSET(mi) = y; if (MI_IS_TITLE(mi)) { MI_HEIGHT(mi) = MST_PTITLEFONT(msp->menu)->height + MST_TITLE_GAP_ABOVE(msp->menu) + MST_TITLE_GAP_BELOW(msp->menu); } else if (MI_IS_SEPARATOR(mi)) { /* Separator */ MI_HEIGHT(mi) = separator_height; } else if (MI_IS_TEAR_OFF_BAR(mi)) { /* Tear off bar */ MI_HEIGHT(mi) = relief_thickness + MENU_TEAR_OFF_BAR_HEIGHT; } else { MI_HEIGHT(mi) = calc_normal_item_height(msp, mi); } if (MI_IS_TITLE(mi)) { /* add space for the underlines */ switch (MST_TITLE_UNDERLINES(msp->menu)) { case 0: if (last_item_has_relief) MI_HEIGHT(mi) += relief_thickness; break; case 1: if (mi != MR_FIRST_ITEM(msp->menu)) { /* Space to draw the separator plus a * gap above */ MI_HEIGHT(mi) += separator_height; } if (MI_NEXT_ITEM(mi) != NULL) { /* Space to draw the separator */ MI_HEIGHT(mi) += MENU_SEPARATOR_HEIGHT; } break; default: /* Space to draw n underlines. */ MI_HEIGHT(mi) += MENU_UNDERLINE_HEIGHT * MST_TITLE_UNDERLINES(msp->menu); if (last_item_has_relief) MI_HEIGHT(mi) += relief_thickness; break; } } for (i = 0; i < msp->used_mini_icons; i++) { if (MI_MINI_ICON(mi)[i]) { has_mini_icon = True; } if (MI_MINI_ICON(mi)[i] && MI_HEIGHT(mi) < MI_MINI_ICON(mi)[i]->height + relief_thickness) { MI_HEIGHT(mi) = MI_MINI_ICON(mi)[i]->height + relief_thickness; } } if (MI_PICTURE(mi)) { if ((MI_HAS_TEXT(mi) && msp->used_item_labels) || has_mini_icon) { MI_HEIGHT(mi) += MI_PICTURE(mi)->height; } else { MI_HEIGHT(mi) = MI_PICTURE(mi)->height + relief_thickness; } } y += MI_HEIGHT(mi); /* this item would have to be the last item, or else * we need to add a "More..." entry pointing to a new menu */ menu_height = y + MST_BORDER_WIDTH(msp->menu) + MST_VERTICAL_MARGIN_BOTTOM(msp->menu) + ((MI_IS_SELECTABLE(mi)) ? relief_thickness : 0); if (menu_height > MR_SCREEN_HEIGHT(msp->menu)) { /* Item does not fit on screen anymore. */ char *t; char *tempname; MenuRoot *menuContinuation; int more_item_height; more_item_height = calc_more_item_height(msp); /* Remove items form the menu until it fits (plus a * 'More' entry). */ while ( MI_PREV_ITEM(mi) != NULL && menu_height > MR_SCREEN_HEIGHT(msp->menu)) { /* Remove current item. */ y -= MI_HEIGHT(mi); mi = MI_PREV_ITEM(mi); cItems--; menu_height = y + MST_BORDER_WIDTH(msp->menu) + more_item_height + relief_thickness + MST_VERTICAL_MARGIN_BOTTOM(msp->menu); } if ( MI_PREV_ITEM(mi) == NULL || menu_height > MR_SCREEN_HEIGHT(msp->menu)) { fvwm_msg(ERR, "size_menu_vertically", "Menu entry does not fit on screen"); /* leave a coredump */ abort(); exit(1); } t = EscapeString(MR_NAME(msp->menu), "\"", '\\'); tempname = (char *)safemalloc( (10 + strlen(t)) * sizeof(char)); strcpy(tempname, "Popup \""); strcat(tempname, t); strcat(tempname, "$\""); free(t); /* NewMenuRoot inserts at the head of the list of menus but, we need it at the end. (Give it just the name, * which is 6 chars past the action since * strlen("Popup ")==6 ) */ t = (char *)safemalloc(strlen(MR_NAME(msp->menu)) + 2); strcpy(t, MR_NAME(msp->menu)); strcat(t, "$"); menuContinuation = NewMenuRoot(t); free(t); MR_CONTINUATION_MENU(msp->menu) = menuContinuation; /* Now move this item and the remaining items into the * new menu */ MR_FIRST_ITEM(menuContinuation) = MI_NEXT_ITEM(mi); MR_LAST_ITEM(menuContinuation) = MR_LAST_ITEM(msp->menu); MR_ITEMS(menuContinuation) = MR_ITEMS(msp->menu) - cItems; MI_PREV_ITEM(MI_NEXT_ITEM(mi)) = NULL; /* mi_prev is now the last item in the parent menu */ MR_LAST_ITEM(msp->menu) = mi; MR_ITEMS(msp->menu) = cItems; MI_NEXT_ITEM(mi) = NULL; /* use the same style for the submenu */ MR_STYLE(menuContinuation) = MR_STYLE(msp->menu); MR_IS_LEFT_TRIANGLE(menuContinuation) = MR_IS_LEFT_TRIANGLE(msp->menu); /* migo: propagate missing_submenu_func */ if (MR_MISSING_SUBMENU_FUNC(msp->menu)) { MR_MISSING_SUBMENU_FUNC(menuContinuation) = safestrdup(MR_MISSING_SUBMENU_FUNC( msp->menu)); } /* don't propagate sidepic, sidecolor, popup and * popdown actions */ /* And add the entry pointing to the new menu */ AddToMenu( msp->menu, gettext("More&..."), tempname, False /* no pixmap scan */, False, True); free(tempname); has_continuation_menu = True; } } /* for */ /* The menu may be empty here! */ if (MR_LAST_ITEM(msp->menu) != NULL && MI_IS_SELECTABLE(MR_LAST_ITEM(msp->menu))) { y += relief_thickness; } MR_HEIGHT(msp->menu) = y + MST_BORDER_WIDTH(msp->menu) + MST_VERTICAL_MARGIN_BOTTOM(msp->menu); return has_continuation_menu; } /* * * Merge menu continuations back into the original menu. * Called by make_menu(). * */ static void merge_continuation_menus(MenuRoot *mr) { /* merge menu continuations into one menu again - needed when changing * the font size of a long menu. */ while (MR_CONTINUATION_MENU(mr) != NULL) { MenuRoot *cont = MR_CONTINUATION_MENU(mr); /* link first item of continuation to item before 'more...' */ MI_NEXT_ITEM(MI_PREV_ITEM(MR_LAST_ITEM(mr))) = MR_FIRST_ITEM(cont); MI_PREV_ITEM(MR_FIRST_ITEM(cont)) = MI_PREV_ITEM(MR_LAST_ITEM(mr)); menuitem_free(MR_LAST_ITEM(mr)); MR_LAST_ITEM(mr) = MR_LAST_ITEM(cont); MR_CONTINUATION_MENU(mr) = MR_CONTINUATION_MENU(cont); /* fake an empty menu so that DestroyMenu does not destroy the * items. */ MR_FIRST_ITEM(cont) = NULL; DestroyMenu(cont, False, False); } return; } /* * * Creates the window for the menu. * */ static void make_menu_window(MenuRoot *mr, Bool is_tear_off) { unsigned long valuemask; XSetWindowAttributes attributes; int w; int h; unsigned int evmask; w = MR_WIDTH(mr); if (w == 0) { w = 1; } h = MR_HEIGHT(mr); if (h == 0) { h = 1; } attributes.background_pixel = (MST_HAS_MENU_CSET(mr)) ? Colorset[MST_CSET_MENU(mr)].bg : MST_MENU_COLORS(mr).back; if (MR_WINDOW(mr) != None) { /* just resize the existing window */ XResizeWindow(dpy, MR_WINDOW(mr), w, h); /* and change the background color */ valuemask = CWBackPixel | CWCursor; XChangeWindowAttributes( dpy, MR_WINDOW(mr), valuemask, &attributes); } else { /* create a new window */ valuemask = CWBackPixel | CWEventMask | CWCursor | CWColormap | CWBorderPixel | CWSaveUnder; attributes.border_pixel = 0; attributes.colormap = Pcmap; evmask = XEVMASK_MENUW; attributes.event_mask = 0; attributes.cursor = Scr.FvwmCursors[CRS_MENU]; attributes.save_under = True; /* Create a display used to create the window. Can't use the * normal display because 'xkill' would kill the window * manager if used on a tear off menu. The display can't be * deleted right now because that would either destroy the new * window or leave it as an orphan if fvwm dies or is * restarted. */ if (is_tear_off) { MR_CREATE_DPY(mr) = XOpenDisplay(display_name); if (MR_CREATE_DPY(mr) == NULL) { /* Doh. Use the standard display instead. */ MR_CREATE_DPY(mr) = dpy; } } else { MR_CREATE_DPY(mr) = dpy; } MR_WINDOW(mr) = XCreateWindow( MR_CREATE_DPY(mr), Scr.Root, 0, 0, w, h, 0, Pdepth, InputOutput, Pvisual, valuemask, &attributes); if (MR_CREATE_DPY(mr) != dpy) { /* We *must* synchronize the display here. Otherwise * the request will never be processed. */ XSync(MR_CREATE_DPY(mr), 1); } if (MR_WINDOW(mr) != None) { /* select events for the window from the standard * display */ XSelectInput(dpy, MR_WINDOW(mr), evmask); } XSaveContext(dpy, MR_WINDOW(mr), MenuContext,(caddr_t)mr); } return; } /* * * Generates the window for a menu * */ static void make_menu(MenuRoot *mr, Bool is_tear_off) { MenuSizingParameters msp; Bool has_continuation_menu = False; if (MR_MAPPED_COPIES(mr) > 0) { return; } merge_continuation_menus(mr); do { memset(&msp, 0, sizeof(MenuSizingParameters)); msp.menu = mr; calculate_item_sizes(&msp); /* Call size_menu_horizontally first because it calculated * some values used by size_menu_vertically. */ size_menu_horizontally(&msp); has_continuation_menu = size_menu_vertically(&msp); /* repeat this step if the menu was split */ } while (has_continuation_menu); MR_USED_MINI_ICONS(mr) = msp.used_mini_icons; MR_XANIMATION(mr) = 0; memset(&(MR_DYNAMIC_FLAGS(mr)), 0, sizeof(MR_DYNAMIC_FLAGS(mr))); /* create a new window for the menu */ make_menu_window(mr, is_tear_off); MR_IS_UPDATED(mr) = 0; return; } /* Make sure the menu is properly rebuilt when the style or the menu has * changed. */ static void update_menu(MenuRoot *mr, MenuParameters *pmp) { int sw; int sh; Bool has_screen_size_changed = False; fscreen_scr_arg fscr; if (MST_IS_UPDATED(mr)) { /* The menu style has changed. */ MenuRoot *menu; for (menu = Menus.all; menu; menu = MR_NEXT_MENU(menu)) { if (MR_STYLE(menu) == MR_STYLE(mr)) { /* Mark all other menus with the same style as * changed. */ MR_IS_UPDATED(menu) = 1; } } MST_IS_UPDATED(mr) = 0; } fscr.xypos.x = pmp->screen_origin_x; fscr.xypos.y = pmp->screen_origin_y; FScreenGetScrRect(&fscr, FSCREEN_XYPOS, &JunkX, &JunkY, &sw, &sh); if (sw != MR_SCREEN_WIDTH(mr) || sh != MR_SCREEN_HEIGHT(mr)) { has_screen_size_changed = True; MR_SCREEN_WIDTH(mr) = sw; MR_SCREEN_HEIGHT(mr) = sh; } if (MR_IS_UPDATED(mr) || has_screen_size_changed) { /* The menu or the screen dimensions have changed. We have to * re-make it. */ make_menu(mr, False); } return; } /* * * Procedure: * copy_menu_root - creates a new instance of an existing menu * * Returned Value: * (MenuRoot *) * * Inputs: * mr - the MenuRoot structure of the existing menu * */ static MenuRoot *copy_menu_root(MenuRoot *mr) { MenuRoot *tmp; if (!mr || MR_COPIES(mr) >= MAX_MENU_COPIES) { return NULL; } tmp = (MenuRoot *)safemalloc(sizeof(MenuRoot)); tmp->d = (MenuRootDynamic *)safemalloc(sizeof(MenuRootDynamic)); memset(tmp->d, 0, sizeof(MenuRootDynamic)); tmp->s = mr->s; MR_COPIES(mr)++; MR_ORIGINAL_MENU(tmp) = MR_ORIGINAL_MENU(mr); MR_CONTINUATION_MENU(tmp) = MR_CONTINUATION_MENU(mr); MR_NEXT_MENU(tmp) = MR_NEXT_MENU(mr); MR_NEXT_MENU(mr) = tmp; MR_WINDOW(tmp) = None; memset(&(MR_DYNAMIC_FLAGS(tmp)), 0, sizeof(MR_DYNAMIC_FLAGS(tmp))); return tmp; } /* * * Procedure: * clone_menu - duplicates an existing menu in newly allocated memory. The new menu is independent of the original. * * Returned Value: * (MenuRoot *) * * Inputs: * mr - the MenuRoot structure of the existing menu * */ static void clone_menu_root_static( MenuRoot *dest_mr, MenuRoot *src_mr) { dest_mr->s = (MenuRootStatic *)safemalloc(sizeof(MenuRootStatic)); /* copy everything */ memcpy(dest_mr->s, src_mr->s, sizeof(MenuRootStatic)); /* special treatment for a few parts */ if (MR_NAME(src_mr) != NULL) { MR_NAME(dest_mr) = safestrdup(MR_NAME(src_mr)); } MR_COPIES(dest_mr) = 1; MR_MAPPED_COPIES(dest_mr) = 0; MR_POPUP_ACTION(dest_mr) = NULL; MR_POPDOWN_ACTION(dest_mr) = NULL; if (MR_MISSING_SUBMENU_FUNC(src_mr)) { MR_MISSING_SUBMENU_FUNC(dest_mr) = safestrdup(MR_MISSING_SUBMENU_FUNC(src_mr)); } if (MR_HAS_SIDECOLOR(src_mr)) { MR_SIDECOLOR(dest_mr) = fvwmlib_clone_color(MR_SIDECOLOR(src_mr)); } MR_SIDEPIC(dest_mr) = PCloneFvwmPicture(MR_SIDEPIC(src_mr)); clone_menu_item_list(dest_mr, src_mr); return; } static MenuRoot *clone_menu(MenuRoot *mr) { MenuRoot *new_mr; new_mr = (MenuRoot *)safemalloc(sizeof(MenuRoot)); new_mr->d = (MenuRootDynamic *)safemalloc(sizeof(MenuRootDynamic)); memset(new_mr->d, 0, sizeof(MenuRootDynamic)); clone_menu_root_static(new_mr, mr); return new_mr; } /* ---------------------------- position hints ----------------------------- */ static int float_to_int_with_tolerance(float f) { int low; if (f < 0) { low = (int)(f - ROUNDING_ERROR_TOLERANCE); } else { low = (int)(f + ROUNDING_ERROR_TOLERANCE); } if ((int)f != low) { return low; } else { return (int)(f); } } static void get_xy_from_position_hints( struct MenuPosHints *ph, int width, int height, int context_width, Bool do_reverse_x, int *ret_x, int *ret_y) { float x_add; float y_add; *ret_x = ph->x; *ret_y = ph->y; if (ph->is_menu_relative) { if (do_reverse_x) { *ret_x -= ph->x_offset; x_add = width * (-1.0 - ph->x_factor) + ph->menu_width * (1.0 - ph->context_x_factor); } else { *ret_x += ph->x_offset; x_add = width * ph->x_factor + ph->menu_width * ph->context_x_factor; } y_add = height * ph->y_factor; } else { x_add = width * ph->x_factor; y_add = height * ph->y_factor; } *ret_x += float_to_int_with_tolerance(x_add); *ret_y += float_to_int_with_tolerance(y_add); return; } /* * Used by get_menu_options * * The vars are named for the x-direction, but this is used for both x and y */ static char *get_one_menu_position_argument( char *action, int x, int w, int *pFinalX, int *x_offset, float *width_factor, float *context_width_factor, Bool *is_menu_relative) { char *token, *orgtoken, *naction; char c; int val; int chars; float fval; float factor = (float)w/100; float x_add = 0; naction = GetNextToken(action, &token); if (token == NULL) { return action; } orgtoken = token; *pFinalX = x; *x_offset = 0; *width_factor = 0.0; *context_width_factor = 0.0; if (sscanf(token,"o%d%n", &val, &chars) >= 1) { fval = val; token += chars; x_add += fval*factor; *width_factor -= fval / 100.0; *context_width_factor += fval / 100.0; } else if (token[0] == 'c') { token++; x_add += ((float)w) / 2.0; *width_factor -= 0.5; *context_width_factor += 0.5; } while (*token != 0) { if (sscanf(token,"%d%n", &val, &chars) < 1) { naction = action; break; } fval = (float)val; token += chars; if (sscanf(token,"%c", &c) == 1) { switch (c) { case 'm': token++; *width_factor += fval / 100.0; *is_menu_relative = True; break; case 'p': token++; x_add += val; *x_offset += val; break; default: x_add += fval * factor; *context_width_factor += fval / 100.0; break; } } else { x_add += fval * factor; *context_width_factor += fval / 100.0; } } *pFinalX += float_to_int_with_tolerance(x_add); free(orgtoken); return naction; } /* Returns the menu options for the menu that a given menu item pops up */ static void get_popup_options( MenuParameters *pmp, MenuItem *mi, MenuOptions *pops) { if (!mi) { return; } pops->flags.has_poshints = 0; pops->pos_hints.has_screen_origin = True; pops->pos_hints.screen_origin_x = pmp->screen_origin_x; pops->pos_hints.screen_origin_y = pmp->screen_origin_y; /* just look past "Popup " in the action */ get_menu_options( SkipNTokens(MI_ACTION(mi), 2), MR_WINDOW(pmp->menu), NULL, NULL, pmp->menu, mi, pops); return; } /* ---------------------------- menu painting functions --------------------- */ static void clear_expose_menu_area(Window win, XEvent *e) { if (e == NULL) { XClearWindow(dpy, win); } else { XClearArea( dpy, win, e->xexpose.x, e->xexpose.y, e->xexpose.width, e->xexpose.height, False); } return; } /* * * Draws a picture on the left side of the menu * What about a SidePic Colorset ? (olicha 2002-08-21) * */ static void paint_side_pic(MenuRoot *mr, XEvent *pevent) { GC gc; FvwmPicture *sidePic; int ys; int yt; int h; int bw = MST_BORDER_WIDTH(mr); if (MR_SIDEPIC(mr)) { sidePic = MR_SIDEPIC(mr); } else if (MST_SIDEPIC(mr)) { sidePic = MST_SIDEPIC(mr); } else { return; } if (Pdepth < 2) { /* ? */ gc = SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)); } else { gc = FORE_GC(MST_MENU_INACTIVE_GCS(mr)); } if (sidePic->height > MR_HEIGHT(mr) - 2 * bw) { h = MR_HEIGHT(mr) - 2 * bw; ys = sidePic->height - h; yt = bw; } else { h = sidePic->height; ys = 0; yt = MR_HEIGHT(mr) - bw - sidePic->height; } if (pevent != NULL && pevent->type == Expose) { if ( pevent->xexpose.x + pevent->xexpose.width < MR_SIDEPIC_X_OFFSET(mr) || pevent->xexpose.x >= MR_SIDEPIC_X_OFFSET(mr) + sidePic->width) { /* out of x-range for side bar */ return; } if ( pevent->xexpose.y + pevent->xexpose.height < bw || pevent->xexpose.y >= bw + MR_HEIGHT(mr)) { /* in the border */ return; } if ( !(MR_HAS_SIDECOLOR(mr) || MST_HAS_SIDE_COLOR(mr)) && pevent->xexpose.y + pevent->xexpose.height < yt) { /* outside picture and no background */ return; } } if (MR_HAS_SIDECOLOR(mr)) { Globalgcv.foreground = MR_SIDECOLOR(mr); } else if (MST_HAS_SIDE_COLOR(mr)) { Globalgcv.foreground = MST_SIDE_COLOR(mr); } if (MR_HAS_SIDECOLOR(mr) || MST_HAS_SIDE_COLOR(mr)) { Globalgcm = GCForeground; XChangeGC(dpy, Scr.ScratchGC1, Globalgcm, &Globalgcv); XFillRectangle( dpy, MR_WINDOW(mr), Scr.ScratchGC1, MR_SIDEPIC_X_OFFSET(mr), bw, sidePic->width, MR_HEIGHT(mr) - 2 * bw); } else if (sidePic->alpha != None) { XClearArea( dpy, MR_WINDOW(mr), MR_SIDEPIC_X_OFFSET(mr), yt, sidePic->width, h, False); } PGraphicsRenderPicture( dpy, MR_WINDOW(mr), sidePic, 0, MR_WINDOW(mr), gc, Scr.MonoGC, Scr.AlphaGC, 0, ys, sidePic->width, h, MR_SIDEPIC_X_OFFSET(mr), yt, sidePic->width, h, False); return; } static Bool paint_menu_gradient_background( MenuRoot *mr, XEvent *pevent) { MenuStyle *ms = MR_STYLE(mr); int bw = MST_BORDER_WIDTH(mr); XRectangle bounds; Pixmap pmap; GC pmapgc; XGCValues gcv; unsigned long gcm = GCLineWidth; int switcher = -1; Bool do_clear = False; gcv.line_width = 1; bounds.x = bw; bounds.y = bw; bounds.width = MR_WIDTH(mr) - bw; bounds.height = MR_HEIGHT(mr) - bw; /* H, V, D and B gradients are optimized and have * their own code here. (if no dither) */ if (!ST_FACE(ms).u.grad.do_dither) { switcher = ST_FACE(ms).gradient_type; } switch (switcher) { case H_GRADIENT: if (MR_IS_BACKGROUND_SET(mr) == False) { register int i; register int dw; pmap = XCreatePixmap( dpy, MR_WINDOW(mr), MR_WIDTH(mr), DEFAULT_MENU_GRADIENT_PIXMAP_THICKNESS, Pdepth); pmapgc = fvwmlib_XCreateGC(dpy, pmap, gcm, &gcv); dw = (float) (bounds.width / ST_FACE(ms).u.grad.npixels) + 1; for (i = 0; i < ST_FACE(ms).u.grad.npixels; i++) { int x; x = i * bounds.width / ST_FACE(ms).u.grad.npixels; XSetForeground( dpy, pmapgc, ST_FACE(ms).u.grad.xcs[i].pixel); XFillRectangle( dpy, pmap, pmapgc, x, 0, dw, DEFAULT_MENU_GRADIENT_PIXMAP_THICKNESS); } XSetWindowBackgroundPixmap(dpy, MR_WINDOW(mr), pmap); XFreeGC(dpy,pmapgc); XFreePixmap(dpy,pmap); MR_IS_BACKGROUND_SET(mr) = True; } do_clear = True; break; case V_GRADIENT: if (MR_IS_BACKGROUND_SET(mr) == False) { register int i; register int dh; static int best_tile_width = 0; int junk; if (best_tile_width == 0) { int tw = DEFAULT_MENU_GRADIENT_PIXMAP_THICKNESS; if (!XQueryBestTile( dpy, Scr.screen, tw, tw, (unsigned int*)&best_tile_width, (unsigned int*)&junk)) { /* call failed, use default and risk a * screwed up tile */ best_tile_width = tw; } } pmap = XCreatePixmap( dpy, MR_WINDOW(mr), best_tile_width, MR_HEIGHT(mr), Pdepth); pmapgc = fvwmlib_XCreateGC(dpy, pmap, gcm, &gcv); dh = (float) (bounds.height / ST_FACE(ms).u.grad.npixels) + 1; for (i = 0; i < ST_FACE(ms).u.grad.npixels; i++) { int y; y = i * bounds.height / ST_FACE(ms).u.grad.npixels; XSetForeground( dpy, pmapgc, ST_FACE(ms).u.grad.xcs[i].pixel); XFillRectangle( dpy, pmap, pmapgc, 0, y, best_tile_width, dh); } XSetWindowBackgroundPixmap(dpy, MR_WINDOW(mr), pmap); XFreeGC(dpy,pmapgc); XFreePixmap(dpy,pmap); MR_IS_BACKGROUND_SET(mr) = True; } do_clear = True; break; case D_GRADIENT: case B_GRADIENT: { register int i = 0, numLines; int cindex = -1; XRectangle r; if (pevent) { r.x = pevent->xexpose.x; r.y = pevent->xexpose.y; r.width = pevent->xexpose.width; r.height = pevent->xexpose.height; } else { r.x = bw; r.y = bw; r.width = MR_WIDTH(mr) - 2 * bw; r.height = MR_HEIGHT(mr) - 2 * bw; } XSetClipRectangles( dpy, Scr.TransMaskGC, 0, 0, &r, 1, Unsorted); numLines = MR_WIDTH(mr) + MR_HEIGHT(mr) - 2 * bw; for (i = 0; i < numLines; i++) { if ((int)(i * ST_FACE(ms).u.grad.npixels / numLines) > cindex) { /* pick the next colour (skip if necc.) */ cindex = i * ST_FACE(ms).u.grad.npixels / numLines; XSetForeground( dpy, Scr.TransMaskGC, ST_FACE(ms).u.grad.xcs[cindex].pixel); } if (ST_FACE(ms).gradient_type == D_GRADIENT) { XDrawLine(dpy, MR_WINDOW(mr), Scr.TransMaskGC, 0, i, i, 0); } else /* B_GRADIENT */ { XDrawLine(dpy, MR_WINDOW(mr), Scr.TransMaskGC, 0, MR_HEIGHT(mr) - 1 - i, i, MR_HEIGHT(mr) - 1); } } } XSetClipMask(dpy, Scr.TransMaskGC, None); break; default: if (MR_IS_BACKGROUND_SET(mr) == False) { int g_width; int g_height; /* let library take care of all other gradients */ pmap = XCreatePixmap( dpy, MR_WINDOW(mr), MR_WIDTH(mr), MR_HEIGHT(mr), Pdepth); pmapgc = fvwmlib_XCreateGC(dpy, pmap, gcm, &gcv); /* find out the size the pixmap should be */ CalculateGradientDimensions( dpy, MR_WINDOW(mr), ST_FACE(ms).u.grad.npixels, ST_FACE(ms).gradient_type, ST_FACE(ms).u.grad.do_dither, &g_width, &g_height); /* draw the gradient directly into the window */ CreateGradientPixmap( dpy, MR_WINDOW(mr), pmapgc, ST_FACE(ms).gradient_type, g_width, g_height, ST_FACE(ms).u.grad.npixels, ST_FACE(ms).u.grad.xcs, ST_FACE(ms).u.grad.do_dither, &(MR_STORED_PIXELS(mr).d_pixels), &(MR_STORED_PIXELS(mr).d_npixels), pmap, bw, bw, MR_WIDTH(mr) - bw, MR_HEIGHT(mr) - bw, NULL); XSetWindowBackgroundPixmap(dpy, MR_WINDOW(mr), pmap); XFreeGC(dpy, pmapgc); XFreePixmap(dpy, pmap); MR_IS_BACKGROUND_SET(mr) = True; } do_clear = True; break; } return do_clear; } static Bool paint_menu_pixmap_background( MenuRoot *mr, XEvent *pevent) { MenuStyle *ms = MR_STYLE(mr); int width, height, x, y; int bw = MST_BORDER_WIDTH(mr); FvwmPicture *p; p = ST_FACE(ms).u.p; width = MR_WIDTH(mr) - 2 * bw; height = MR_HEIGHT(mr) - 2 * bw; y = (int)(height - p->height) / 2; x = (int)(width - p->width) / 2; if (x < bw) { x = bw; } if (y < bw) { y = bw; } if (width > p->width) { width = p->width; } if (height > p->height) { height = p->height; } if (width > MR_WIDTH(mr) - x - bw) { width = MR_WIDTH(mr) - x - bw; } if (height > MR_HEIGHT(mr) - y - bw) { height = MR_HEIGHT(mr) - y - bw; } XSetClipMask(dpy, Scr.TransMaskGC, p->mask); XSetClipOrigin(dpy, Scr.TransMaskGC, x, y); XCopyArea( dpy, p->picture, MR_WINDOW(mr), Scr.TransMaskGC, bw, bw, width, height, x, y); return False; } /* * * Procedure: * get_menu_paint_item_parameters - prepares the parameters to be * passed to menuitem_paint(). * * mr - the menu instance that holds the menu item * mi - the menu item to redraw * fw - the FvwmWindow structure to check against allowed functions * */ static void get_menu_paint_item_parameters( MenuPaintItemParameters *mpip, MenuRoot *mr, MenuItem *mi, FvwmWindow *fw, XEvent *pevent, Bool do_redraw_menu_border) { mpip->ms = MR_STYLE(mr); mpip->w = MR_WINDOW(mr); mpip->selected_item = MR_SELECTED_ITEM(mr); mpip->dim = &MR_DIM(mr); mpip->fw = fw; mpip->used_mini_icons = MR_USED_MINI_ICONS(mr); mpip->cb_mr = mr; mpip->cb_reset_bg = paint_menu_gradient_background; mpip->flags.is_first_item = (MR_FIRST_ITEM(mr) == mi); mpip->flags.is_left_triangle = MR_IS_LEFT_TRIANGLE(mr); mpip->ev = pevent; return; } /* * * Procedure: * paint_menu - draws the entire menu * */ static void paint_menu( MenuRoot *mr, XEvent *pevent, FvwmWindow *fw) { MenuItem *mi; MenuStyle *ms = MR_STYLE(mr); int bw = MST_BORDER_WIDTH(mr); int relief_thickness = ST_RELIEF_THICKNESS(MR_STYLE(mr)); if (fw && !check_if_fvwm_window_exists(fw)) { fw = NULL; } if (MR_IS_PAINTED(mr) && pevent && (pevent->xexpose.x >= MR_WIDTH(mr) - bw || pevent->xexpose.x + pevent->xexpose.width <= bw || pevent->xexpose.y >= MR_HEIGHT(mr) - bw || pevent->xexpose.y + pevent->xexpose.height <= bw)) { /* Only the border was obscured. Redraw it centrally instead of * redrawing several menu items. */ RelieveRectangle( dpy, MR_WINDOW(mr), 0, 0, MR_WIDTH(mr) - 1, MR_HEIGHT(mr) - 1, (Pdepth < 2) ? SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)) : HILIGHT_GC(MST_MENU_INACTIVE_GCS(mr)), SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)), bw); { return; } } MR_IS_PAINTED(mr) = 1; /* paint the menu background */ if (ms && ST_HAS_MENU_CSET(ms)) { if (MR_IS_BACKGROUND_SET(mr) == False) { SetWindowBackground( dpy, MR_WINDOW(mr), MR_WIDTH(mr), MR_HEIGHT(mr), &Colorset[ST_CSET_MENU(ms)], Pdepth, FORE_GC(ST_MENU_INACTIVE_GCS(ms)), True); MR_IS_BACKGROUND_SET(mr) = True; } } else if (ms) { int type; Bool do_clear = False; type = ST_FACE(ms).type; switch(type) { case SolidMenu: XSetWindowBackground( dpy, MR_WINDOW(mr), MST_FACE(mr).u.back); do_clear = True; break; case GradientMenu: do_clear = paint_menu_gradient_background(mr, pevent); break; case PixmapMenu: do_clear = paint_menu_pixmap_background(mr, pevent); break; case TiledPixmapMenu: XSetWindowBackgroundPixmap( dpy, MR_WINDOW(mr), ST_FACE(ms).u.p->picture); do_clear = True; break; } /* switch(type) */ if (do_clear == True) { clear_expose_menu_area(MR_WINDOW(mr), pevent); } } /* if (ms) */ /* draw the relief */ RelieveRectangle(dpy, MR_WINDOW(mr), 0, 0, MR_WIDTH(mr) - 1, MR_HEIGHT(mr) - 1, (Pdepth < 2) ? SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)) : HILIGHT_GC(MST_MENU_INACTIVE_GCS(mr)), SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)), bw); /* paint the menu items */ for (mi = MR_FIRST_ITEM(mr); mi != NULL; mi = MI_NEXT_ITEM(mi)) { int do_draw = 0; /* be smart about handling the expose, redraw only the entries * that we need to */ if (pevent == NULL) { do_draw = True; } else { register int b_offset; b_offset = MI_Y_OFFSET(mi) + MI_HEIGHT(mi); if (MR_SELECTED_ITEM(mr) == mi) { b_offset += relief_thickness; } if (pevent->xexpose.y < b_offset && (pevent->xexpose.y + pevent->xexpose.height) > MI_Y_OFFSET(mi)) { do_draw = True; } } if (do_draw) { MenuPaintItemParameters mpip; get_menu_paint_item_parameters( &mpip, mr, NULL, fw, pevent, True); mpip.flags.is_first_item = (MR_FIRST_ITEM(mr) == mi); menuitem_paint(mi, &mpip); } } paint_side_pic(mr, pevent); XFlush(dpy); return; } /* Set the selected-ness state of the menuitem passed in */ static void select_menu_item( MenuRoot *mr, MenuItem *mi, Bool select, FvwmWindow *fw) { if (select == True && MR_SELECTED_ITEM(mr) != NULL && MR_SELECTED_ITEM(mr) != mi) { select_menu_item(mr, MR_SELECTED_ITEM(mr), False, fw); } else if (select == False && MR_SELECTED_ITEM(mr) == NULL) { return; } else if (select == True && MR_SELECTED_ITEM(mr) == mi) { return; } if (!MI_IS_SELECTABLE(mi)) { return; } if (select == False) { MI_WAS_DESELECTED(mi) = True; } if (!MST_HAS_MENU_CSET(mr)) { switch (MST_FACE(mr).type) { case GradientMenu: if (select == True) { int iy; int ih; int mw; XEvent e; if (!MR_IS_PAINTED(mr)) { flush_expose(MR_WINDOW(mr)); paint_menu(mr, NULL, fw); } iy = MI_Y_OFFSET(mi); ih = MI_HEIGHT(mi) + (MI_IS_SELECTABLE(mi) ? MST_RELIEF_THICKNESS(mr) : 0); if (iy < 0) { ih += iy; iy = 0; } mw = MR_WIDTH(mr) - 2 * MST_BORDER_WIDTH(mr); if (iy + ih > MR_HEIGHT(mr)) ih = MR_HEIGHT(mr) - iy; /* grab image */ MR_STORED_ITEM(mr).stored = XCreatePixmap( dpy, Scr.NoFocusWin, mw, ih, Pdepth); XSetGraphicsExposures( dpy, FORE_GC(MST_MENU_INACTIVE_GCS(mr)), True); XSync(dpy, 0); while (FCheckTypedEvent(dpy, NoExpose, &e)) { /* nothing to do here */ } XCopyArea( dpy, MR_WINDOW(mr), MR_STORED_ITEM(mr).stored, FORE_GC(MST_MENU_INACTIVE_GCS(mr)), MST_BORDER_WIDTH(mr), iy, mw, ih, 0, 0); XSync(dpy, 0); if (FCheckTypedEvent(dpy, NoExpose, &e)) { MR_STORED_ITEM(mr).y = iy; MR_STORED_ITEM(mr).width = mw; MR_STORED_ITEM(mr).height = ih; } else { XFreePixmap( dpy, MR_STORED_ITEM(mr).stored); MR_STORED_ITEM(mr).stored = None; MR_STORED_ITEM(mr).width = 0; MR_STORED_ITEM(mr).height = 0; MR_STORED_ITEM(mr).y = 0; } XSetGraphicsExposures( dpy, FORE_GC(MST_MENU_INACTIVE_GCS(mr)), False); } else if (select == False && MR_STORED_ITEM(mr).width != 0) { /* ungrab image */ XCopyArea( dpy, MR_STORED_ITEM(mr).stored, MR_WINDOW(mr), FORE_GC(MST_MENU_INACTIVE_GCS(mr)), 0, 0, MR_STORED_ITEM(mr).width, MR_STORED_ITEM(mr).height, MST_BORDER_WIDTH(mr), MR_STORED_ITEM(mr).y); if (MR_STORED_ITEM(mr).stored != None) { XFreePixmap( dpy, MR_STORED_ITEM(mr).stored); } MR_STORED_ITEM(mr).stored = None; MR_STORED_ITEM(mr).width = 0; MR_STORED_ITEM(mr).height = 0; MR_STORED_ITEM(mr).y = 0; } else if (select == False) { XEvent e; FvwmPicture *sidePic = NULL; e.type = Expose; e.xexpose.x = MST_BORDER_WIDTH(mr); e.xexpose.y = MI_Y_OFFSET(mi); e.xexpose.width = MR_WIDTH(mr) - 2 * MST_BORDER_WIDTH(mr); e.xexpose.height = MI_HEIGHT(mi) + (MI_IS_SELECTABLE(mi) ? MST_RELIEF_THICKNESS(mr) : 0); if (MR_SIDEPIC(mr)) { sidePic = MR_SIDEPIC(mr); } else if (MST_SIDEPIC(mr)) { sidePic = MST_SIDEPIC(mr); } if (sidePic) { e.xexpose.width -= sidePic->width; if (MR_SIDEPIC_X_OFFSET(mr) == MST_BORDER_WIDTH(mr)) { e.xexpose.x += sidePic->width; } } MR_SELECTED_ITEM(mr) = (select) ? mi : NULL; paint_menu(mr, &e, fw); } break; default: if (MR_STORED_ITEM(mr).width != 0) { if (MR_STORED_ITEM(mr).stored != None) { XFreePixmap( dpy, MR_STORED_ITEM(mr).stored); } MR_STORED_ITEM(mr).stored = None; MR_STORED_ITEM(mr).width = 0; MR_STORED_ITEM(mr).height = 0; MR_STORED_ITEM(mr).y = 0; } break; } /* switch */ } /* if */ if (fw && !check_if_fvwm_window_exists(fw)) { fw = NULL; } MR_SELECTED_ITEM(mr) = (select) ? mi : NULL; if (MR_IS_PAINTED(mr)) { MenuPaintItemParameters mpip; get_menu_paint_item_parameters(&mpip, mr, mi, fw, NULL, False); menuitem_paint(mi, &mpip); } return; } /* ---------------------------- popping menu up or down -------------------- */ static int get_left_popup_x_position(MenuRoot *mr, MenuRoot *submenu, int x) { if (MST_USE_LEFT_SUBMENUS(mr)) { return (x - MST_POPUP_OFFSET_ADD(mr) - MR_WIDTH(submenu) + MR_WIDTH(mr) * (100 - MST_POPUP_OFFSET_PERCENT(mr)) / 100); } else { return (x - MR_WIDTH(submenu) + MST_BORDER_WIDTH(mr)); } } static int get_right_popup_x_position(MenuRoot *mr, MenuRoot *submenu, int x) { if (MST_USE_LEFT_SUBMENUS(mr)) { return (x + MR_WIDTH(mr) - MST_BORDER_WIDTH(mr)); } else { return (x + MR_WIDTH(mr) * MST_POPUP_OFFSET_PERCENT(mr) / 100 + MST_POPUP_OFFSET_ADD(mr)); } } static void get_prefered_popup_position( MenuRoot *mr, MenuRoot *submenu, int *px, int *py, Bool *pprefer_left_submenus) { int menu_x, menu_y; MenuItem *mi = NULL; if (!menu_get_geometry( mr, &JunkRoot, &menu_x, &menu_y, &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth)) { *px = 0; *py = 0; *pprefer_left_submenus = False; fvwm_msg(ERR, "get_prefered_popup_position", "can't get geometry of menu %s", MR_NAME(mr)); return; } /* set the direction flag */ *pprefer_left_submenus = (MR_HAS_POPPED_UP_LEFT(mr) || (MST_USE_LEFT_SUBMENUS(mr) && !MR_HAS_POPPED_UP_RIGHT(mr))); /* get the x position */ if (*pprefer_left_submenus) { *px = get_left_popup_x_position(mr, submenu, menu_x); } else { *px = get_right_popup_x_position(mr, submenu, menu_x); } /* get the y position */ if (MR_SELECTED_ITEM(mr)) { mi = MR_SELECTED_ITEM(mr); } if (mi) { *py = menu_y + MI_Y_OFFSET(mi) - MST_BORDER_WIDTH(mr) + MST_RELIEF_THICKNESS(mr); } else { *py = menu_y; } } static int do_menus_overlap( MenuRoot *mr, int x, int y, int width, int height, int h_tolerance, int v_tolerance, int s_tolerance, Bool allow_popup_offset_tolerance) { int prior_x, prior_y, x_overlap; int prior_width, prior_height; if (mr == NULL) { return 0; } if (!menu_get_geometry( mr, &JunkRoot,&prior_x,&prior_y, &prior_width, &prior_height, &JunkBW, &JunkDepth)) { return 0; } x_overlap = 0; if (allow_popup_offset_tolerance) { if (MST_POPUP_OFFSET_ADD(mr) < 0) { s_tolerance = -MST_POPUP_OFFSET_ADD(mr); } if (MST_USE_LEFT_SUBMENUS(mr)) { prior_x += (100 - MST_POPUP_OFFSET_PERCENT(mr)) / 100; } else { prior_width *= (float)(MST_POPUP_OFFSET_PERCENT(mr)) / 100.0; } } if (MST_USE_LEFT_SUBMENUS(mr)) { int t = s_tolerance; s_tolerance = h_tolerance; h_tolerance = t; } if (y < prior_y + prior_height - v_tolerance && prior_y < y + height - v_tolerance && x < prior_x + prior_width - s_tolerance && prior_x < x + width - h_tolerance) { x_overlap = x - prior_x; if (x <= prior_x) { x_overlap--; } } return x_overlap; } /* * * Procedure: * pop_menu_up - pop up a pull down menu * * Inputs: * x, y - location of upper left of menu * do_warp_to_item - warp pointer to the first item after title * pops - pointer to the menu options for new menu * */ static int pop_menu_up( MenuRoot **pmenu, MenuParameters *pmp, MenuRoot *parent_menu, MenuItem *parent_item, const exec_context_t **pexc, int x, int y, Bool prefer_left_submenu, Bool do_warp_to_item, MenuOptions *pops, Bool *ret_overlap, Window popdown_window) { Bool do_warp_to_title = False; int x_overlap = 0; int x_clipped_overlap; MenuRoot *mrMi; MenuRoot *mr; FvwmWindow *fw; int context; int bw = 0; int bwp = 0; int prev_x; int prev_y; int prev_width; int prev_height; unsigned int event_mask; int scr_x, scr_y; int scr_w, scr_h; mr = *pmenu; if (!mr || (MR_MAPPED_COPIES(mr) > 0 && MR_COPIES(mr) >= MAX_MENU_COPIES)) { return False; } /* * handle dynamic menu actions */ /* First of all, execute the popup action (if defined). */ if (MR_POPUP_ACTION(mr)) { char *menu_name; saved_pos_hints pos_hints; Bool is_busy_grabbed = False; int mapped_copies = MR_MAPPED_COPIES(mr); /* save variables that we still need but that may be * overwritten */ menu_name = safestrdup(MR_NAME(mr)); pos_hints = last_saved_pos_hints; if (Scr.BusyCursor & BUSY_DYNAMICMENU) { is_busy_grabbed = GrabEm(CRS_WAIT, GRAB_BUSYMENU); } /* Execute the action */ __menu_execute_function(pmp->pexc, MR_POPUP_ACTION(mr)); if (is_busy_grabbed) { UngrabEm(GRAB_BUSYMENU); } /* restore the stuff we saved */ last_saved_pos_hints = pos_hints; if (mapped_copies == 0) { /* Now let's see if the menu still exists. It may have * been destroyed and recreated, so we have to look for * a menu with the saved name. menus_find_menu() always * returns the original menu, not one of its copies, so * below logic would fail miserably if used with a menu * copy. On the other hand, menu copies can't be * deleted within a dynamic popup action, so just * ignore this case. */ *pmenu = menus_find_menu(menu_name); if (menu_name) { free(menu_name); } mr = *pmenu; } } if (mr) { update_menu(mr, pmp); } if (mr == NULL || MR_FIRST_ITEM(mr) == NULL || MR_ITEMS(mr) == 0) { /* The menu deleted itself or all its items or it has been * empty from the start. */ return False; } fw = (*pexc)->w.fw; if (fw && !check_if_fvwm_window_exists(fw)) { fw = NULL; } context = (*pexc)->w.wcontext; /* * Create a new menu instance (if necessary) */ if (MR_MAPPED_COPIES(mr) > 0) { /* create a new instance of the menu */ *pmenu = copy_menu_root(*pmenu); if (!*pmenu) { return False; } make_menu_window(*pmenu, False); mr = *pmenu; } /* * Evaluate position hints */ /* calculate position from position hints if available */ if (pops->flags.has_poshints && !last_saved_pos_hints.flags.do_ignore_pos_hints) { get_xy_from_position_hints( &(pops->pos_hints), MR_WIDTH(mr), MR_HEIGHT(mr), (parent_menu) ? MR_WIDTH(parent_menu) : 0, prefer_left_submenu, &x, &y); } /* * Initialise new menu */ MR_PARENT_MENU(mr) = parent_menu; MR_PARENT_ITEM(mr) = parent_item; MR_IS_PAINTED(mr) = 0; MR_IS_LEFT(mr) = 0; MR_IS_RIGHT(mr) = 0; MR_IS_UP(mr) = 0; MR_IS_DOWN(mr) = 0; MR_XANIMATION(mr) = 0; InstallFvwmColormap(); /* * Handle popups from button clicks on buttons in the title bar, * or the title bar itself. Position hints override this. */ if (!pops->flags.has_poshints && fw && parent_menu == NULL && pmp->flags.is_first_root_menu) { int cx; int cy; int gx; int gy; Bool has_context; rectangle button_g; has_context = get_title_button_geometry( fw, &button_g, context); if (has_context) { fscreen_scr_arg fscr; get_title_gravity_factors(fw, &gx, &gy); cx = button_g.x + button_g.width / 2; cy = button_g.y + button_g.height / 2; if (gx != 0) { x = button_g.x + (gx == 1) * button_g.width - (gx == -1) * MR_WIDTH(mr); } if (gy != 0) { y = button_g.y + (gy == 1) * button_g.height - (gy == -1) * MR_HEIGHT(mr); } if (gx == 0 && x < button_g.x) { x = button_g.x; } else if (gx == 0 && x + MR_WIDTH(mr) >= button_g.x + button_g.width) { x = button_g.x + button_g.width - MR_WIDTH(mr); } if (gy == 0 && y < button_g.y) { y = button_g.y; } else if (gy == 0 && y + MR_HEIGHT(mr) >= button_g.y + button_g.height) { y = button_g.y + button_g.height - MR_HEIGHT(mr); } pops->pos_hints.has_screen_origin = True; fscr.xypos.x = cx; fscr.xypos.y = cy; if (FScreenGetScrRect( &fscr, FSCREEN_XYPOS, &JunkX, &JunkY, &JunkWidth, &JunkHeight)) { /* use current cx/cy */ } else if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &cx, &cy, &JunkX, &JunkY, &JunkMask)) { /* use pointer's position */ } else { cx = -1; cy = -1; } pops->pos_hints.screen_origin_x = cx; pops->pos_hints.screen_origin_y = cy; } } /* if (pops->flags.has_poshints) */ /* * Clip to screen */ { fscreen_scr_arg fscr; fscr.xypos.x = pops->pos_hints.screen_origin_x; fscr.xypos.y = pops->pos_hints.screen_origin_y; /* clip to screen */ FScreenClipToScreen( &fscr, FSCREEN_XYPOS, &x, &y, MR_WIDTH(mr), MR_HEIGHT(mr)); /* "this" screen is defined -- so get its coords for future * reference */ FScreenGetScrRect( &fscr, FSCREEN_XYPOS, &scr_x, &scr_y, &scr_w, &scr_h); } if (parent_menu) { bw = MST_BORDER_WIDTH(mr); bwp = MST_BORDER_WIDTH(parent_menu); x_overlap = do_menus_overlap( parent_menu, x, y, MR_WIDTH(mr), MR_HEIGHT(mr), bwp, bwp, bwp, True); } /* * Calculate position and animate menus */ if (parent_menu == NULL || !menu_get_geometry( parent_menu, &JunkRoot, &prev_x, &prev_y, &prev_width, &prev_height, &JunkBW, &JunkDepth)) { MR_HAS_POPPED_UP_LEFT(mr) = 0; MR_HAS_POPPED_UP_RIGHT(mr) = 0; } else { int left_x; int right_x; Bool use_left_submenus = MST_USE_LEFT_SUBMENUS(mr); MenuRepaintTransparentParameters mrtp; Bool transparent_bg = False; /* check if menus overlap */ x_clipped_overlap = do_menus_overlap( parent_menu, x, y, MR_WIDTH(mr), MR_HEIGHT(mr), bwp, bwp, bwp, True); if (x_clipped_overlap && (!pops->flags.has_poshints || pops->pos_hints.is_relative == False || x_overlap == 0)) { /* menus do overlap, but do not reposition if overlap * was caused by relative positioning hints */ left_x = get_left_popup_x_position( parent_menu, mr, prev_x); right_x = get_right_popup_x_position( parent_menu, mr, prev_x); if (use_left_submenus) { if (left_x + MR_WIDTH(mr) < prev_x + bwp) { left_x = prev_x + bwp - MR_WIDTH(mr); } } else { if (right_x > prev_x + prev_width - bwp) { right_x = prev_x + prev_width - bwp; } } /* * Animate parent menu */ if (MST_IS_ANIMATED(mr)) { /* animate previous out of the way */ int a_left_x; int a_right_x; int end_x; Window w; if (use_left_submenus) { if (prev_x - left_x < MR_WIDTH(mr)) { a_right_x = x + (prev_x - left_x); } else { a_right_x = x + MR_WIDTH(mr) - bw; } a_left_x = x - MR_WIDTH(parent_menu); } else { if (right_x - prev_x < prev_width) { a_left_x = x + (prev_x - right_x); } else { a_left_x = x - prev_width + bw; } a_right_x = x + MR_WIDTH(mr); } if (prefer_left_submenu) { /* popup menu is left of old menu, try * to move prior menu right */ if (a_right_x + prev_width <= scr_x + scr_w) { end_x = a_right_x; } else if (a_left_x >= scr_x) { end_x = a_left_x; } else { end_x = scr_x + scr_w - prev_width; } } else { /* popup menu is right of old menu, try * to move prior menu left */ if (a_left_x >= scr_x) { end_x = a_left_x; } else if (a_right_x + prev_width <= scr_x + scr_w) { end_x = a_right_x; } else { end_x = scr_x; } } if (end_x == a_left_x || end_x == 0) { MR_HAS_POPPED_UP_LEFT(mr) = 0; MR_HAS_POPPED_UP_RIGHT(mr) = 1; } else { MR_HAS_POPPED_UP_LEFT(mr) = 1; MR_HAS_POPPED_UP_RIGHT(mr) = 0; } MR_XANIMATION(parent_menu) += end_x - prev_x; if (ST_HAS_MENU_CSET(MR_STYLE(parent_menu)) && CSET_IS_TRANSPARENT( ST_CSET_MENU( MR_STYLE(parent_menu)))) { transparent_bg = True; get_menu_repaint_transparent_parameters( &mrtp, parent_menu, fw); } if (MR_IS_TEAR_OFF_MENU(parent_menu)) { int cx; int cy; w = FW_W_FRAME( pmp->tear_off_root_menu_window ); if (XGetGeometry( dpy, w, &JunkRoot, &cx, &cy, (unsigned int*)&JunkWidth, (unsigned int*)&JunkHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth)) { end_x += (cx - prev_x ); prev_x = cx; prev_y = cy; } } else { w = MR_WINDOW(parent_menu); } AnimatedMoveOfWindow( w, prev_x, prev_y, end_x, prev_y, True, -1, NULL, (transparent_bg)? &mrtp:NULL); } /* if (MST_IS_ANIMATED(mr)) */ /* * Try the other side of the parent menu */ else if (!pops->flags.is_fixed) { Bool may_use_left; Bool may_use_right; Bool do_use_left; Bool use_left_as_last_resort; use_left_as_last_resort = (left_x > scr_x + scr_w - right_x - MR_WIDTH(mr)); may_use_left = (left_x >= scr_x); may_use_right = (right_x + MR_WIDTH(mr) <= scr_x + scr_w); if (!may_use_left && !may_use_right) { /* If everything goes wrong, put the * submenu on the side with more free * space. */ do_use_left = use_left_as_last_resort; } else if (may_use_left && (prefer_left_submenu || !may_use_right)) { do_use_left = True; } else { do_use_left = False; } x = (do_use_left) ? left_x : right_x; MR_HAS_POPPED_UP_LEFT(mr) = do_use_left; MR_HAS_POPPED_UP_RIGHT(mr) = !do_use_left; /* Force the menu onto the screen, but leave at * least PARENT_MENU_FORCE_VISIBLE_WIDTH pixels * of the parent menu visible */ if (x + MR_WIDTH(mr) > scr_x + scr_w) { int d = x + MR_WIDTH(mr) - (scr_x + scr_w); int c; if (prev_width >= PARENT_MENU_FORCE_VISIBLE_WIDTH) { c = PARENT_MENU_FORCE_VISIBLE_WIDTH + prev_x; } else { c = prev_x + prev_width; } if (x - c >= d || x <= prev_x) { x -= d; } else if (x > c) { x = c; } } if (x < scr_x) { int c = prev_width - PARENT_MENU_FORCE_VISIBLE_WIDTH; if (c < 0) { c = 0; } if (scr_x - x > c) { x += c; } else { x = scr_x; } } } /* else if (non-overlapping menu style) */ } /* if (x_clipped_overlap && ...) */ else { MR_HAS_POPPED_UP_LEFT(mr) = prefer_left_submenu; MR_HAS_POPPED_UP_RIGHT(mr) = !prefer_left_submenu; } if (x < prev_x) { MR_IS_LEFT(mr) = 1; } if (x + MR_WIDTH(mr) > prev_x + prev_width) { MR_IS_RIGHT(mr) = 1; } if (y < prev_y) { MR_IS_UP(mr) = 1; } if (y + MR_HEIGHT(mr) > prev_y + prev_height) { MR_IS_DOWN(mr) = 1; } if (!MR_IS_LEFT(mr) && !MR_IS_RIGHT(mr)) { MR_IS_LEFT(mr) = 1; MR_IS_RIGHT(mr) = 1; } } /* if (parent_menu) */ /* * Make sure we have the correct events selected */ if (pmp->tear_off_root_menu_window == NULL) { /* normal menus and sub menus */ event_mask = XEVMASK_MENUW; } else if (parent_menu == NULL) { /* tear off menu needs more events */ event_mask = XEVMASK_TEAR_OFF_MENUW; } else { /* sub menus of tear off menus need LeaveNotify */ event_mask = XEVMASK_TEAR_OFF_SUBMENUW; } /* * Pop up the menu */ XMoveWindow(dpy, MR_WINDOW(mr), x, y); XSelectInput(dpy, MR_WINDOW(mr), event_mask); XMapRaised(dpy, MR_WINDOW(mr)); if (popdown_window) XUnmapWindow(dpy, popdown_window); XFlush(dpy); MR_MAPPED_COPIES(mr)++; MST_USAGE_COUNT(mr)++; if (ret_overlap) { *ret_overlap = do_menus_overlap( parent_menu, x, y, MR_WIDTH(mr), MR_HEIGHT(mr), 0, 0, 0, False) ? True : False; } /* * Warp the pointer */ if (!do_warp_to_item && parent_menu != NULL) { MenuItem *mi; mi = find_entry(pmp, NULL, &mrMi, None, -1, -1); if (mi && mrMi == mr && mi != MR_FIRST_ITEM(mrMi)) { /* pointer is on an item of the popup */ if (MST_DO_WARP_TO_TITLE(mr)) { /* warp pointer if not on a root menu */ do_warp_to_title = True; } } } /* if (!do_warp_to_item) */ if (pops->flags.do_not_warp) { do_warp_to_title = False; } else if (pops->flags.do_warp_title) { do_warp_to_title = True; } if (pops->flags.has_poshints && !last_saved_pos_hints.flags.do_ignore_pos_hints && pops->flags.do_warp_title) { do_warp_to_title = True; } if (do_warp_to_item) { /* also warp */ MR_SELECTED_ITEM(mr) = NULL; warp_pointer_to_item( mr, MR_FIRST_ITEM(mr), True /* skip Title */); select_menu_item(mr, MR_SELECTED_ITEM(mr), True, fw); } else if (do_warp_to_title) { /* Warp pointer to middle of top line, since we don't * want the user to come up directly on an option */ warp_pointer_to_title(mr); } return True; } /* * * Procedure: * pop_menu_down - unhighlight the current menu selection and * take down the menus * * mr - menu to pop down; this pointer is invalid after the function * returns. Don't use it anymore! * parent - the menu that has spawned mr (may be NULL). this is * used to see if mr was spawned by itself on some level. * this is a hack to allow specifying 'Popup foo' within * menu foo. You must use the MenuRoot that is currently * being processed here. DO NOT USE MR_PARENT_MENU(mr) here! * */ static void pop_menu_down(MenuRoot **pmr, MenuParameters *pmp) { MenuItem *mi; assert(*pmr); memset(&(MR_DYNAMIC_FLAGS(*pmr)), 0, sizeof(MR_DYNAMIC_FLAGS(*pmr))); XUnmapWindow(dpy, MR_WINDOW(*pmr)); MR_MAPPED_COPIES(*pmr)--; MST_USAGE_COUNT(*pmr)--; UninstallFvwmColormap(); XFlush(dpy); if ((mi = MR_SELECTED_ITEM(*pmr)) != NULL) { select_menu_item(*pmr, mi, False, (*pmp->pexc)->w.fw); } if (MR_STORED_PIXELS(*pmr).d_pixels != NULL) { PictureFreeColors( dpy, Pcmap, MR_STORED_PIXELS(*pmr).d_pixels, MR_STORED_PIXELS(*pmr).d_npixels, 0, False); free(MR_STORED_PIXELS(*pmr).d_pixels); MR_STORED_PIXELS(*pmr).d_pixels = NULL; } if (MR_COPIES(*pmr) > 1) { /* delete this instance of the menu */ DestroyMenu(*pmr, False, False); } else if (MR_POPDOWN_ACTION(*pmr)) { /* Finally execute the popdown action (if defined). */ saved_pos_hints pos_hints; /* save variables that we still need but that may be * overwritten */ pos_hints = last_saved_pos_hints; /* Execute the action */ __menu_execute_function(pmp->pexc, MR_POPDOWN_ACTION(*pmr)); /* restore the stuff we saved */ last_saved_pos_hints = pos_hints; } return; } /* * * Procedure: * pop_menu_down_and_repaint_parent - Pops down a menu and repaints the * overlapped portions of the parent menu. This is done only if * *fSubmenuOverlaps is True. *fSubmenuOverlaps is set to False * afterwards. * */ static void pop_menu_down_and_repaint_parent( MenuRoot **pmr, Bool *fSubmenuOverlaps, MenuParameters *pmp) { MenuRoot *parent = MR_PARENT_MENU(*pmr); XEvent event; int mr_x; int mr_y; int mr_width; int mr_height; int parent_x; int parent_y; int parent_width; int parent_height; if (*fSubmenuOverlaps && parent) { /* popping down the menu may destroy the menu via the dynamic * popdown action! Thus we must not access *pmr afterwards. */ /* Create a fake event to pass into paint_menu */ event.type = Expose; if (!menu_get_geometry( *pmr, &JunkRoot, &mr_x, &mr_y, &mr_width, &mr_height, &JunkBW, &JunkDepth) || !menu_get_geometry( parent, &JunkRoot, &parent_x, &parent_y, &parent_width, &parent_height, &JunkBW, &JunkDepth)) { pop_menu_down(pmr, pmp); paint_menu(parent, NULL, (*pmp->pexc)->w.fw); } else { pop_menu_down(pmr, pmp); event.xexpose.x = mr_x - parent_x; event.xexpose.width = mr_width; if (event.xexpose.x < 0) { event.xexpose.width += event.xexpose.x; event.xexpose.x = 0; } if (event.xexpose.x + event.xexpose.width > parent_width) { event.xexpose.width = parent_width - event.xexpose.x; } event.xexpose.y = mr_y - parent_y; event.xexpose.height = mr_height; if (event.xexpose.y < 0) { event.xexpose.height += event.xexpose.y; event.xexpose.y = 0; } if (event.xexpose.y + event.xexpose.height > parent_height) { event.xexpose.height = parent_height - event.xexpose.y; } flush_accumulate_expose(MR_WINDOW(parent), &event); paint_menu(parent, &event, (*pmp->pexc)->w.fw); } } else { /* popping down the menu may destroy the menu via the dynamic * popdown action! Thus we must not access *pmr afterwards. */ pop_menu_down(pmr, pmp); } *fSubmenuOverlaps = False; return; } /* ---------------------------- menu main loop ------------------------------ */ static void __mloop_init( MenuParameters *pmp, MenuReturn *pmret, mloop_evh_input_t *in, mloop_evh_data_t *med, mloop_static_info_t *msi, MenuOptions *pops) { memset(in, 0, sizeof(*in)); in->mif.do_force_reposition = 1; memset(med, 0, sizeof(*med)); msi->t0 = fev_get_evtime(); pmret->rc = MENU_NOP; memset(pops, 0, sizeof(*pops)); /* remember where the pointer was so we can tell if it has moved */ if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &(msi->x_init), &(msi->y_init), &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen */ msi->x_init = 0; msi->y_init = 0; } /* get the event mask right */ msi->event_mask = (pmp->tear_off_root_menu_window == NULL) ? XEVMASK_MENU : XEVMASK_TEAR_OFF_MENU; return; } static void __mloop_get_event_timeout_loop( MenuParameters *pmp, mloop_evh_input_t *in, mloop_evh_data_t *med, mloop_static_info_t *msi) { XEvent e = *(*pmp->pexc)->x.elast; while (!FPending(dpy) || !FCheckMaskEvent(dpy, msi->event_mask, &e)) { Bool is_popup_timed_out = (MST_POPUP_DELAY(pmp->menu) > 0 && med->popup_delay_10ms++ >= MST_POPUP_DELAY(pmp->menu) + 1); Bool is_popdown_timed_out = (MST_POPDOWN_DELAY(pmp->menu) > 0 && in->mrPopdown && med->popdown_delay_10ms++ >= MST_POPDOWN_DELAY(pmp->menu) + 1); Bool do_fake_motion = False; if (is_popup_timed_out) { med->popup_delay_10ms = MST_POPUP_DELAY(pmp->menu); } if (is_popdown_timed_out) { med->popdown_delay_10ms = MST_POPDOWN_DELAY(pmp->menu); } if ( in->mif.do_force_popup || (is_popup_timed_out && (is_popdown_timed_out || in->mif.is_item_entered_by_key_press || !in->mrPopdown || MST_DO_POPDOWN_IMMEDIATELY(pmp->menu)))) { in->mif.do_popup_now = True; in->mif.do_force_popup = False; do_fake_motion = True; in->mif.is_popped_up_by_timeout = True; is_popdown_timed_out = True; } if ((in->mrPopdown || in->mrPopup) && (is_popdown_timed_out || MST_DO_POPDOWN_IMMEDIATELY(pmp->menu))) { MenuRoot *m = (in->mrPopdown) ? in->mrPopdown : in->mrPopup; if (!m || med->mi != MR_PARENT_ITEM(m)) { in->mif.do_popdown_now = True; do_fake_motion = True; if (MST_DO_POPUP_IMMEDIATELY(pmp->menu)) { in->mif.do_popup_now = True; in->mif.is_popped_up_by_timeout = True; } else if ( !MST_DO_POPUP_IMMEDIATELY(pmp->menu) && in->mif.is_pointer_in_active_item_area) { in->mif.do_popup_now = True; in->mif.is_popped_up_by_timeout = True; } else if ( !MST_DO_POPUP_IMMEDIATELY(pmp->menu) && !MST_DO_POPDOWN_IMMEDIATELY(pmp->menu) && MST_POPUP_DELAY(pmp->menu) <= MST_POPDOWN_DELAY(pmp->menu) && med->popup_delay_10ms == med->popdown_delay_10ms) { in->mif.do_popup_now = True; in->mif.is_popped_up_by_timeout = True; } } } if (in->mif.do_popup_now && med->mi == in->miRemovedSubmenu && !in->mif.is_key_press) { /* prevent popping up the menu again with * RemoveSubemenus */ in->mif.do_popup_now = False; in->mif.do_force_popup = False; do_fake_motion = in->mif.do_popdown_now; in->mif.is_popped_up_by_timeout = False; } if (do_fake_motion) { /* fake a motion event, and set in->mif.do_popup_now */ e.type = MotionNotify; e.xmotion.time = fev_get_evtime(); fev_fake_event(&e); in->mif.is_motion_faked = True; break; } usleep(10000 /* 10 ms*/); } return; } static mloop_ret_code_t __mloop_get_event( MenuParameters *pmp, MenuReturn *pmret, mloop_evh_input_t *in, mloop_evh_data_t *med, mloop_static_info_t *msi) { XEvent e = *(*pmp->pexc)->x.elast; in->mif.do_popup_and_warp = False; in->mif.do_popup_now = False; in->mif.do_popdown_now = False; in->mif.do_propagate_event_into_submenu = False; in->mif.is_key_press = False; in->mif.is_button_release = 0; if (pmp->event_propagate_to_submenu) { /* handle an event that was passed in from the parent menu */ fev_fake_event(pmp->event_propagate_to_submenu); pmp->event_propagate_to_submenu = NULL; } else if (in->mif.do_recycle_event) { in->mif.is_popped_up_by_timeout = False; in->mif.do_recycle_event = 0; if (pmp->menu != pmret->target_menu) { /* the event is for a previous menu, just close this * one */ pmret->rc = MENU_PROPAGATE_EVENT; return MENU_MLOOP_RET_END; } if ((*pmp->pexc)->x.elast->type == KeyPress) { /* since the pointer has been warped since the key was * pressed, fake a different key press position */ if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &e.xkey.x_root, &e.xkey.y_root, &JunkX, &JunkY, &e.xkey.state) == False) { /* pointer is on a different screen */ e.xkey.x_root = 0; e.xkey.y_root = 0; } fev_fake_event(&e); med->mi = MR_SELECTED_ITEM(pmp->menu); } } else if (pmp->tear_off_root_menu_window != NULL && FCheckTypedWindowEvent( dpy, FW_W_PARENT(pmp->tear_off_root_menu_window), ClientMessage, &e)) { /* Got a ClientMessage for the tear out menu */ } else { if (in->mif.do_force_reposition) { e.type = MotionNotify; e.xmotion.time = fev_get_evtime(); in->mif.is_motion_faked = True; in->mif.do_force_reposition = False; in->mif.is_popped_up_by_timeout = False; fev_fake_event(&e); } else if (!FCheckMaskEvent(dpy, ExposureMask, &e)) { Bool is_popdown_timer_active = False; Bool is_popup_timer_active = False; if (MST_POPDOWN_DELAY(pmp->menu) > 0 && in->mi_with_popup != NULL && in->mi_with_popup != MR_SELECTED_ITEM(pmp->menu)) { is_popdown_timer_active = True; } if (MST_POPUP_DELAY(pmp->menu) > 0 && !in->mif.is_popped_up_by_timeout && in->mi_wants_popup != NULL) { is_popup_timer_active = True; } /* handle exposure events first */ if (in->mif.do_force_popup || in->mif.is_pointer_in_active_item_area || is_popdown_timer_active || is_popup_timer_active) { __mloop_get_event_timeout_loop( pmp, in, med, msi); } else { /* block until there is an event */ FMaskEvent(dpy, msi->event_mask, &e); in->mif.is_popped_up_by_timeout = False; } } else { in->mif.is_popped_up_by_timeout = False; } } in->mif.is_pointer_in_active_item_area = False; if (e.type == MotionNotify) { /* discard any extra motion events before a release */ while (FCheckMaskEvent( dpy, ButtonMotionMask | ButtonReleaseMask, &e) && (e.type != ButtonRelease)) { /* nothing */ } } return MENU_MLOOP_RET_NORMAL; } static mloop_ret_code_t __mloop_handle_event( MenuParameters *pmp, MenuReturn *pmret, double_keypress *pdkp, mloop_evh_input_t *in, mloop_evh_data_t *med, mloop_static_info_t *msi) { MenuRoot *tmrMi; Bool rc; pmret->rc = MENU_NOP; switch ((*pmp->pexc)->x.elast->type) { case ButtonRelease: in->mif.is_button_release = 1; med->mi = find_entry( pmp, &med->x_offset, &med->mrMi, (*pmp->pexc)->x.elast->xbutton.subwindow, (*pmp->pexc)->x.elast->xbutton.x_root, (*pmp->pexc)->x.elast->xbutton.y_root); /* hold the menu up when the button is released * for the first time if released OFF of the menu */ if (pmp->flags.is_sticky && !in->mif.is_motion_first) { in->mif.is_release_first = True; pmp->flags.is_sticky = False; return MENU_MLOOP_RET_LOOP; } if (med->mrMi != NULL) { int menu_x; int menu_y; menu_shortcuts( med->mrMi, pmp, pmret, (*pmp->pexc)->x.elast, &med->mi, pdkp, &menu_x, &menu_y); if (pmret->rc == MENU_NEWITEM_MOVEMENU) { move_any_menu(med->mrMi, pmp, menu_x, menu_y); pmret->rc = MENU_NEWITEM; } else if (pmret->rc == MENU_NEWITEM_FIND) { med->mi = find_entry( pmp, NULL, NULL, None, -1, -1); pmret->rc = MENU_NEWITEM; } } else { pmret->rc = MENU_SELECTED; } switch (pmret->rc) { case MENU_NOP: return MENU_MLOOP_RET_LOOP; case MENU_POPDOWN: case MENU_ABORTED: case MENU_DOUBLE_CLICKED: case MENU_TEAR_OFF: case MENU_KILL_TEAR_OFF_MENU: case MENU_EXEC_CMD: return MENU_MLOOP_RET_END; case MENU_POPUP: /* Allow for MoveLeft/MoveRight action to work with * Mouse */ in->mif.do_popup_and_warp = True; case MENU_NEWITEM: /* unpost the menu if posted */ pmret->flags.is_menu_posted = 0; return MENU_MLOOP_RET_NORMAL; case MENU_SELECTED: in->mif.was_item_unposted = 0; if (pmret->flags.is_menu_posted && med->mrMi != NULL) { if (pmret->flags.do_unpost_submenu) { pmret->flags.do_unpost_submenu = 0; pmret->flags.is_menu_posted = 0; /* just ignore the event */ return MENU_MLOOP_RET_LOOP; } else if (med->mi && MI_IS_POPUP(med->mi) && med->mrMi == pmp->menu) { /* post menu - done below */ } else if (MR_PARENT_ITEM(pmp->menu) && med->mi == MR_PARENT_ITEM(pmp->menu)) { /* propagate back to parent menu * and unpost current menu */ pmret->flags.do_unpost_submenu = 1; pmret->rc = MENU_PROPAGATE_EVENT; pmret->target_menu = med->mrMi; return MENU_MLOOP_RET_END; } else if (med->mrMi != pmp->menu && med->mrMi != in->mrPopup) { /* unpost and propagate back to * ancestor */ pmret->flags.is_menu_posted = 0; pmret->rc = MENU_PROPAGATE_EVENT; pmret->target_menu = med->mrMi; return MENU_MLOOP_RET_END; } else if (in->mrPopup && med->mrMi == in->mrPopup) { /* unpost and propagate into * submenu */ in->mif.was_item_unposted = 1; in->mif.do_propagate_event_into_submenu = True; break; } else { /* simply unpost the menu */ pmret->flags.is_menu_posted = 0; } } if (is_double_click( msi->t0, med->mi, pmp, pmret, pdkp, in->mif.has_mouse_moved)) { pmret->rc = MENU_DOUBLE_CLICKED; return MENU_MLOOP_RET_END; } if (med->mi == NULL) { pmret->rc = MENU_ABORTED; } else if (MI_IS_POPUP(med->mi)) { switch (MST_DO_POPUP_AS(pmp->menu)) { case MDP_POST_MENU: if (in->mif.was_item_unposted) { pmret->flags.is_menu_posted = 0; pmret->rc = MENU_UNPOST; pmret->target_menu = NULL; in->mif.do_popup_now = False; } else { pmret->flags.is_menu_posted = 1; pmret->rc = MENU_POST; pmret->target_menu = NULL; in->mif.do_popup_now = True; if ((in->mrPopup || in->mrPopdown) && med->mi != MR_SELECTED_ITEM( pmp->menu)) { in->mif.do_popdown_now = True; } } return MENU_MLOOP_RET_NORMAL; case MDP_IGNORE: pmret->rc = MENU_NOP; return MENU_MLOOP_RET_NORMAL; case MDP_CLOSE: pmret->rc = MENU_ABORTED; break; case MDP_ROOT_MENU: default: break; } } break; default: break; } pdkp->timestamp = 0; return MENU_MLOOP_RET_END; case ButtonPress: /* if the first event is a button press allow the release to * select something */ pmp->flags.is_sticky = False; return MENU_MLOOP_RET_LOOP; case VisibilityNotify: return MENU_MLOOP_RET_LOOP; case KeyRelease: if ((*pmp->pexc)->x.elast->xkey.keycode != MST_SELECT_ON_RELEASE_KEY(pmp->menu)) { return MENU_MLOOP_RET_LOOP; } /* fall through to KeyPress */ case KeyPress: /* Handle a key press events to allow mouseless operation */ in->mif.is_key_press = True; med->x_offset = menudim_middle_x_offset(&MR_DIM(pmp->menu)); /* if there is a posted menu we may have to move back into a * previous menu or possibly ignore the mouse position */ if (pmret->flags.is_menu_posted) { MenuRoot *l_mrMi; int l_x_offset; XEvent e; pmret->flags.is_menu_posted = 0; (void)find_entry( pmp, &l_x_offset, &l_mrMi, None, -1, -1); if (l_mrMi != NULL) { if (pmp->menu != l_mrMi) { /* unpost the menu and propagate the * event to the correct menu */ pmret->rc = MENU_PROPAGATE_EVENT; pmret->target_menu = l_mrMi; return MENU_MLOOP_RET_END; } } med->mi = MR_SELECTED_ITEM(pmp->menu); e = *(*pmp->pexc)->x.elast; e.xkey.x_root = med->x_offset; e.xkey.y_root = menuitem_middle_y_offset( med->mi, MR_STYLE(pmp->menu)); fev_fake_event(&e); } /* now handle the actual key press */ { int menu_x; int menu_y; menu_shortcuts( pmp->menu, pmp, pmret, (*pmp->pexc)->x.elast, &med->mi, pdkp, &menu_x, &menu_y); if (pmret->rc == MENU_NEWITEM_MOVEMENU) { move_any_menu(pmp->menu, pmp, menu_x, menu_y); pmret->rc = MENU_NEWITEM; } else if (pmret->rc == MENU_NEWITEM_FIND) { med->mi = find_entry( pmp, NULL, NULL, None, -1, -1); pmret->rc = MENU_NEWITEM; } } if (pmret->rc != MENU_NOP) { /* using a key 'unposts' the posted menu */ pmret->flags.is_menu_posted = 0; } switch (pmret->rc) { case MENU_SELECTED: if (med->mi && MI_IS_POPUP(med->mi)) { switch (MST_DO_POPUP_AS(pmp->menu)) { case MDP_POST_MENU: pmret->rc = MENU_POPUP; break; case MDP_IGNORE: pmret->rc = MENU_NOP; return MENU_MLOOP_RET_NORMAL; case MDP_CLOSE: pmret->rc = MENU_ABORTED; return MENU_MLOOP_RET_END; case MDP_ROOT_MENU: default: return MENU_MLOOP_RET_END; } break; } return MENU_MLOOP_RET_END; case MENU_POPDOWN: case MENU_ABORTED: case MENU_DOUBLE_CLICKED: case MENU_TEAR_OFF: case MENU_KILL_TEAR_OFF_MENU: case MENU_EXEC_CMD: return MENU_MLOOP_RET_END; case MENU_NEWITEM: case MENU_POPUP: if (med->mrMi == NULL) { /* Set the MenuRoot of the current item in case * we have just warped to the menu from the * void or unposted a popup menu. */ med->mrMi = pmp->menu; } /*tmrMi = med->mrMi;*/ break; default: break; } /* now warp to the new menu item, if any */ if (pmret->rc == MENU_NEWITEM && med->mi) { warp_pointer_to_item(med->mrMi, med->mi, False); } if (pmret->rc == MENU_POPUP && med->mi && MI_IS_POPUP(med->mi)) { in->mif.do_popup_and_warp = True; break; } break; case MotionNotify: { int p_rx = -1; int p_ry = -1; Window p_child = None; if (in->mif.has_mouse_moved == False) { if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &p_child, &p_rx, &p_ry, &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen */ p_rx = 0; p_ry = 0; } if (p_rx - msi->x_init > Scr.MoveThreshold || msi->x_init - p_rx > Scr.MoveThreshold || p_ry - msi->y_init > Scr.MoveThreshold || msi->y_init - p_ry > Scr.MoveThreshold) { /* remember that this isn't just a click any * more since the pointer moved */ in->mif.has_mouse_moved = True; } } med->mi = find_entry( pmp, &med->x_offset, &med->mrMi, p_child, p_rx, p_ry); if (pmret->flags.is_menu_posted && med->mrMi != pmret->target_menu) { /* ignore mouse movement outside a posted menu */ med->mrMi = NULL; med->mi = NULL; } if (!in->mif.is_release_first && !in->mif.is_motion_faked && in->mif.has_mouse_moved) { in->mif.is_motion_first = True; } in->mif.is_motion_faked = False; break; } case Expose: /* grab our expose events, let the rest go through */ XFlush(dpy); rc = menu_expose((*pmp->pexc)->x.elast, (*pmp->pexc)->w.fw); /* we want to dispatch this too so that icons and maybe tear * off get redrawn after being obscured by menus. */ if (rc == False) { dispatch_event((*pmp->pexc)->x.elast); } return MENU_MLOOP_RET_LOOP; case ClientMessage: if ((*pmp->pexc)->x.elast->xclient.format == 32 && (*pmp->pexc)->x.elast->xclient.data.l[0] == _XA_WM_DELETE_WINDOW && pmp->tear_off_root_menu_window != NULL && (*pmp->pexc)->x.elast->xclient.window == FW_W_PARENT( pmp->tear_off_root_menu_window)) { /* handle deletion of tear out menus */ pmret->rc = MENU_KILL_TEAR_OFF_MENU; return MENU_MLOOP_RET_END; } break; case EnterNotify: /* ignore EnterNotify events */ break; case LeaveNotify: if (pmp->tear_off_root_menu_window != NULL && find_entry(pmp, NULL, &tmrMi, None, -1, -1) == NULL && tmrMi == NULL) { /* handle deletion of tear out menus */ pmret->rc = MENU_ABORTED; return MENU_MLOOP_RET_END; } /* ignore it */ return MENU_MLOOP_RET_LOOP; case UnmapNotify: /* should never happen, but does not hurt */ if (pmp->tear_off_root_menu_window != NULL && (*pmp->pexc)->x.elast->xunmap.window == FW_W(pmp->tear_off_root_menu_window)) { /* handle deletion of tear out menus */ pmret->rc = MENU_KILL_TEAR_OFF_MENU; /* extra safety: pass event back to main event loop to * make sure the window is destroyed */ FPutBackEvent(dpy, (*pmp->pexc)->x.elast); return MENU_MLOOP_RET_END; } break; default: /* We must not dispatch events here. There is no guarantee * that dispatch_event doesn't destroy a window stored in the * menu structures. Anyway, no events should ever get here * except to tear off menus and these must be handled * individually. */ #if 0 dispatch_event((*pmp->pexc)->x.elast); #endif break; } return MENU_MLOOP_RET_NORMAL; } static void __mloop_select_item( MenuParameters *pmp, mloop_evh_input_t *in, mloop_evh_data_t *med, Bool does_submenu_overlap, Bool *pdoes_popdown_submenu_overlap) { in->mif.is_item_entered_by_key_press = in->mif.is_key_press; med->popup_delay_10ms = 0; /* we're on the same menu, but a different item, so we need to unselect * the old item */ if (MR_SELECTED_ITEM(pmp->menu)) { /* something else was already selected on this menu. We have * to pop down the menu before unselecting the item in case we * are using gradient menus. The recalled image would paint * over the submenu. */ if (in->mrPopup && in->mrPopup != in->mrPopdown) { in->mrPopdown = in->mrPopup; med->popdown_delay_10ms = 0; *pdoes_popdown_submenu_overlap = does_submenu_overlap; in->mrPopup = NULL; } select_menu_item( pmp->menu, MR_SELECTED_ITEM(pmp->menu), False, (*pmp->pexc)->w.fw); } /* highlight the new item; sets MR_SELECTED_ITEM(pmp->menu) too */ select_menu_item(pmp->menu, med->mi, True, (*pmp->pexc)->w.fw); return; } static void __mloop_wants_popup( MenuParameters *pmp, mloop_evh_input_t *in, mloop_evh_data_t *med, MenuRoot *mrMiPopup) { Bool do_it_now = False; in->mi_wants_popup = med->mi; if (in->mif.do_popup_now) { do_it_now = True; } else if (MST_DO_POPUP_IMMEDIATELY(pmp->menu) && med->mi != in->miRemovedSubmenu) { if (in->mif.is_key_press || MST_DO_POPDOWN_IMMEDIATELY(pmp->menu) || !in->mrPopdown) { do_it_now = True; } } else if (pointer_in_active_item_area(med->x_offset, med->mrMi)) { if (in->mif.is_key_press || med->mi == in->miRemovedSubmenu || MST_DO_POPDOWN_IMMEDIATELY(pmp->menu) || !in->mrPopdown) { do_it_now = True; } else { in->mif.is_pointer_in_active_item_area = 1; } } if (do_it_now) { in->miRemovedSubmenu = NULL; /* must create a new menu or popup */ if (in->mrPopup == NULL || in->mrPopup != mrMiPopup) { if (in->mif.do_popup_now) { in->mif.do_popup = True; } else { /* pop up in next pass through loop */ in->mif.do_force_popup = True; } } else if (in->mif.do_popup_and_warp) { warp_pointer_to_item( in->mrPopup, MR_FIRST_ITEM(in->mrPopup), True); } } return; } static mloop_ret_code_t __mloop_make_popup( MenuParameters *pmp, MenuReturn *pmret, mloop_evh_input_t *in, mloop_evh_data_t *med, MenuOptions *pops, Bool *pdoes_submenu_overlap) { /* create a popup menu */ if (!is_submenu_mapped(pmp->menu, med->mi)) { /* We want to pop prepop menus so it doesn't *have* to be unpopped; do_menu pops down any menus it pops up, but we want to be able to popdown w/o actually removing the menu */ int x; int y; Bool prefer_left_submenus; /* Make sure we are using the latest style and menu layout. */ update_menu(in->mrPopup, pmp); get_prefered_popup_position( pmp->menu, in->mrPopup, &x, &y, &prefer_left_submenus); /* Note that we don't care if popping up the menu works. If it * doesn't we'll catch it below. */ pop_menu_up( &in->mrPopup, pmp, pmp->menu, med->mi, pmp->pexc, x, y, prefer_left_submenus, in->mif.do_popup_and_warp, pops, pdoes_submenu_overlap, (in->mrPopdown) ? MR_WINDOW(in->mrPopdown) : None); in->mi_with_popup = med->mi; in->mi_wants_popup = NULL; if (in->mrPopup == NULL) { /* the menu deleted itself when execution the dynamic * popup * action */ pmret->rc = MENU_ERROR; return MENU_MLOOP_RET_END; } MR_SUBMENU_ITEM(pmp->menu) = med->mi; } return MENU_MLOOP_RET_NORMAL; } static mloop_ret_code_t __mloop_get_mi_actions( MenuParameters *pmp, MenuReturn *pmret, double_keypress *pdkp, mloop_evh_input_t *in, mloop_evh_data_t *med, mloop_static_info_t *msi, MenuRoot *mrMiPopup, Bool *pdoes_submenu_overlap, Bool *pdoes_popdown_submenu_overlap) { in->mif.do_popdown = False; in->mif.do_popup = False; in->mif.do_menu = False; in->mif.is_submenu_mapped = False; if (!in->mrPopup && in->mrPopdown && med->mi == MR_PARENT_ITEM(in->mrPopdown)) { /* We're again on the item that we left before. * Deschedule popping it down. */ in->mrPopup = in->mrPopdown; in->mrPopdown = NULL; } if (med->mrMi == in->mrPopup) { /* must make current popup menu a real menu */ in->mif.do_menu = True; in->mif.is_submenu_mapped = True; } else if (pmret->rc == MENU_POST) { /* must create a real menu and warp into it */ if (in->mrPopup == NULL || in->mrPopup != mrMiPopup) { in->mif.do_popup = True; } in->mif.do_menu = True; in->mif.is_submenu_mapped = True; } else if (in->mif.do_popup_and_warp) { /* must create a real menu and warp into it */ if (in->mrPopup == NULL || in->mrPopup != mrMiPopup) { in->mif.do_popup = True; } else { XRaiseWindow(dpy, MR_WINDOW(in->mrPopup)); warp_pointer_to_item( in->mrPopup, MR_FIRST_ITEM(in->mrPopup), True); in->mif.do_menu = True; in->mif.is_submenu_mapped = True; } } else if (med->mi && MI_IS_POPUP(med->mi)) { if ((*pmp->pexc)->x.elast->type == ButtonPress && is_double_click( msi->t0, med->mi, pmp, pmret, pdkp, in->mif.has_mouse_moved)) { pmret->rc = MENU_DOUBLE_CLICKED; return MENU_MLOOP_RET_END; } else if (!in->mrPopup || in->mrPopup != mrMiPopup || in->mif.do_popup_and_warp) { __mloop_wants_popup(pmp, in, med, mrMiPopup); } } if (in->mif.do_popdown_now) { in->mif.do_popdown = True; in->mif.do_popdown_now = False; } else if (in->mif.do_popup) { if (in->mrPopup && in->mrPopup != mrMiPopup) { in->mif.do_popdown = True; in->mrPopdown = in->mrPopup; med->popdown_delay_10ms = 0; *pdoes_popdown_submenu_overlap = *pdoes_submenu_overlap; } else if (in->mrPopdown && in->mrPopdown != mrMiPopup) { in->mif.do_popdown = True; } else if (in->mrPopdown && in->mrPopdown == mrMiPopup) { in->mrPopup = in->mrPopdown; *pdoes_submenu_overlap = *pdoes_popdown_submenu_overlap; in->mrPopdown = NULL; in->mif.do_popup = False; in->mif.do_popdown = False; } } return MENU_MLOOP_RET_NORMAL; } static void __mloop_do_popdown( MenuParameters *pmp, mloop_evh_input_t *in, Bool *pdoes_popdown_submenu_overlap) { if (in->mrPopdown) { pop_menu_down_and_repaint_parent( &in->mrPopdown, pdoes_popdown_submenu_overlap, pmp); in->mi_with_popup = NULL; MR_SUBMENU_ITEM(pmp->menu) = NULL; if (in->mrPopup == in->mrPopdown) { in->mrPopup = NULL; } in->mrPopdown = NULL; } in->mif.do_popdown = False; return; } static mloop_ret_code_t __mloop_do_popup( MenuParameters *pmp, MenuReturn *pmret, mloop_evh_input_t *in, mloop_evh_data_t *med, MenuOptions *pops, MenuRoot *mrMiPopup, Bool *pdoes_submenu_overlap, Bool *pdoes_popdown_submenu_overlap) { if (!MR_IS_PAINTED(pmp->menu)) { /* draw the parent menu if it is not already drawn */ flush_expose(MR_WINDOW(pmp->menu)); paint_menu(pmp->menu, NULL, (*pmp->pexc)->w.fw); } /* get pos hints for item's action */ get_popup_options(pmp, med->mi, pops); if (med->mrMi == pmp->menu && mrMiPopup == NULL && MI_IS_POPUP(med->mi) && MR_MISSING_SUBMENU_FUNC(pmp->menu)) { /* We're on a submenu item, but the submenu does not exist. * The user defined missing_submenu_action may create it. */ Bool is_complex_function; Bool is_busy_grabbed = False; char *menu_name; char *action; char *missing_action = MR_MISSING_SUBMENU_FUNC(pmp->menu); menu_name = PeekToken( SkipNTokens(MI_ACTION(med->mi), 1), NULL); if (!menu_name) { menu_name = ""; } is_complex_function = functions_is_complex_function(missing_action); if (is_complex_function) { char *action_ptr; action = safemalloc( strlen("Function") + 3 + strlen(missing_action) * 2 + 3 + strlen(menu_name) * 2 + 1); strcpy(action, "Function "); action_ptr = action + strlen(action); action_ptr = QuoteString(action_ptr, missing_action); *action_ptr++ = ' '; action_ptr = QuoteString(action_ptr, menu_name); } else { action = MR_MISSING_SUBMENU_FUNC(pmp->menu); } if (Scr.BusyCursor & BUSY_DYNAMICMENU) { is_busy_grabbed = GrabEm(CRS_WAIT, GRAB_BUSYMENU); } /* Execute the action */ __menu_execute_function(pmp->pexc, action); if (is_complex_function) { free(action); } if (is_busy_grabbed) { UngrabEm(GRAB_BUSYMENU); } /* Let's see if the menu exists now. */ mrMiPopup = mr_popup_for_mi(pmp->menu, med->mi); } /* run MISSING_SUBMENU_FUNCTION */ in->mrPopup = mrMiPopup; if (!in->mrPopup) { in->mif.do_menu = False; pmret->flags.is_menu_posted = 0; } else { if (__mloop_make_popup( pmp, pmret, in, med, pops, pdoes_submenu_overlap) == MENU_MLOOP_RET_END) { return MENU_MLOOP_RET_END; } } /* else (in->mrPopup) */ if (in->mif.do_popdown) { if (in->mrPopdown) { if (in->mrPopdown != in->mrPopup) { if (in->mi_with_popup == MR_PARENT_ITEM(in->mrPopdown)) { in->mi_with_popup = NULL; } pop_menu_down_and_repaint_parent( &in->mrPopdown, pdoes_popdown_submenu_overlap, pmp); } in->mrPopdown = NULL; } in->mif.do_popdown = False; } if (in->mrPopup) { if (MR_PARENT_MENU(in->mrPopup) == pmp->menu) { med->mi = find_entry( pmp, NULL, &med->mrMi, None, -1, -1); if (med->mi && med->mrMi == in->mrPopup) { in->mif.do_menu = True; in->mif.is_submenu_mapped = True; } } else { /* This menu must be already mapped somewhere else, so * ignore it completely. This can only happen if we * have reached the maximum allowed number of menu * copies. */ in->mif.do_menu = False; in->mif.do_popdown = False; in->mrPopup = NULL; } } return MENU_MLOOP_RET_NORMAL; } static mloop_ret_code_t __mloop_do_menu( MenuParameters *pmp, MenuReturn *pmret, double_keypress *pdkp, mloop_evh_input_t *in, mloop_evh_data_t *med, MenuOptions *pops, Bool *pdoes_submenu_overlap) { MenuParameters mp; XEvent e; memset(&mp, 0, sizeof(mp)); mp.menu = in->mrPopup; mp.pexc = pmp->pexc; mp.parent_menu = pmp->menu; mp.parent_item = med->mi; mp.tear_off_root_menu_window = pmp->tear_off_root_menu_window; MR_IS_TEAR_OFF_MENU(in->mrPopup) = 0; mp.flags.has_default_action = False; mp.flags.is_already_mapped = in->mif.is_submenu_mapped; mp.flags.is_sticky = False; mp.flags.is_submenu = True; mp.flags.is_triggered_by_keypress = !!in->mif.do_popup_and_warp; mp.pops = pops; mp.ret_paction = pmp->ret_paction; mp.screen_origin_x = pmp->screen_origin_x; mp.screen_origin_y = pmp->screen_origin_y; if (in->mif.do_propagate_event_into_submenu) { e = *(*pmp->pexc)->x.elast; mp.event_propagate_to_submenu = &e; } else { mp.event_propagate_to_submenu = NULL; } /* recursively do the new menu we've moved into */ do_menu(&mp, pmret); in->mif.do_propagate_event_into_submenu = False; if (pmret->rc == MENU_PROPAGATE_EVENT) { in->mif.do_recycle_event = 1; return MENU_MLOOP_RET_LOOP; } if (IS_MENU_RETURN(pmret->rc)) { pdkp->timestamp = 0; return MENU_MLOOP_RET_END; } if (MST_DO_UNMAP_SUBMENU_ON_POPDOWN(pmp->menu) && pmret->flags.is_key_press) { in->miRemovedSubmenu = MR_PARENT_ITEM(in->mrPopup); pop_menu_down_and_repaint_parent( &in->mrPopup, pdoes_submenu_overlap, pmp); in->mi_with_popup = NULL; MR_SUBMENU_ITEM(pmp->menu) = NULL; if (in->mrPopup == in->mrPopdown) { in->mrPopdown = NULL; } in->mrPopup = NULL; } if (pmret->rc == MENU_POPDOWN) { med->popup_delay_10ms = 0; in->mif.do_force_reposition = True; } return MENU_MLOOP_RET_NORMAL; } static mloop_ret_code_t __mloop_handle_action_with_mi( MenuParameters *pmp, MenuReturn *pmret, double_keypress *pdkp, mloop_evh_input_t *in, mloop_evh_data_t *med, mloop_static_info_t *msi, MenuOptions *pops, Bool *pdoes_submenu_overlap, Bool *pdoes_popdown_submenu_overlap) { MenuItem *tmi; MenuRoot *tmrMi; MenuRoot *mrMiPopup = NULL; pmret->flags.do_unpost_submenu = 0; /* we're on a menu item */ in->mif.is_off_menu_allowed = False; if (med->mrMi == pmp->menu && med->mi != in->miRemovedSubmenu) { in->miRemovedSubmenu = NULL; } if (med->mrMi != pmp->menu && med->mrMi != in->mrPopup && med->mrMi != in->mrPopdown) { /* we're on an item from a prior menu */ if (med->mrMi != MR_PARENT_MENU(pmp->menu)) { /* the event is for a previous menu, just close * this one */ pmret->rc = MENU_PROPAGATE_EVENT; pmret->target_menu = med->mrMi; } else { pmret->rc = MENU_POPDOWN; } pdkp->timestamp = 0; return MENU_MLOOP_RET_END; } if (med->mi != MR_SELECTED_ITEM(pmp->menu) && med->mrMi == pmp->menu) { /* new item of the same menu */ __mloop_select_item( pmp, in, med, *pdoes_submenu_overlap, pdoes_popdown_submenu_overlap); } else if (med->mi != MR_SELECTED_ITEM(pmp->menu) && med->mrMi && med->mrMi == in->mrPopdown) { /* we're on the popup menu of a different menu item of this * menu */ med->mi = MR_PARENT_ITEM(in->mrPopdown); in->mrPopup = in->mrPopdown; in->mrPopdown = NULL; *pdoes_submenu_overlap = *pdoes_popdown_submenu_overlap; select_menu_item(pmp->menu, med->mi, True, (*pmp->pexc)->w.fw); } mrMiPopup = mr_popup_for_mi(pmp->menu, med->mi); /* check what has to be done with the item */ if (__mloop_get_mi_actions( pmp, pmret, pdkp, in, med, msi, mrMiPopup, pdoes_submenu_overlap, pdoes_popdown_submenu_overlap) == MENU_MLOOP_RET_END) { return MENU_MLOOP_RET_END; } /* do what needs to be done */ if (in->mif.do_popdown && !in->mif.do_popup) { /* popdown previous popup */ __mloop_do_popdown(pmp, in, pdoes_popdown_submenu_overlap); } if (in->mif.do_popup) { if (__mloop_do_popup( pmp, pmret, in, med, pops, mrMiPopup, pdoes_submenu_overlap, pdoes_popdown_submenu_overlap) == MENU_MLOOP_RET_END) { return MENU_MLOOP_RET_END; } } /* remember the 'posted' menu */ if (pmret->flags.is_menu_posted && in->mrPopup != NULL && pmret->target_menu == NULL) { pmret->target_menu = in->mrPopup; } else if (pmret->flags.is_menu_posted && in->mrPopup == NULL) { pmret->flags.is_menu_posted = 0; } if (in->mif.do_menu) { mloop_ret_code_t rc; rc = __mloop_do_menu( pmp, pmret, pdkp, in, med, pops, pdoes_submenu_overlap); if (rc != MENU_MLOOP_RET_NORMAL) { return rc; } } /* Now check whether we can animate the current popup menu back to the * original place to unobscure the current menu; this happens only * when using animation */ if (in->mrPopup && MR_XANIMATION(in->mrPopup) && (tmi = find_entry(pmp, NULL, &tmrMi, None, -1, -1)) && (tmi == MR_SELECTED_ITEM(pmp->menu) || tmrMi != pmp->menu)) { animated_move_back(in->mrPopup, False, (*pmp->pexc)->w.fw); } /* now check whether we should animate the current real menu * over to the right to unobscure the prior menu; only a very * limited case where this might be helpful and not too disruptive */ /* but this cause terrible back-and-forth under certain circonstance, * I think we should disable this ... 2002-09-17 olicha */ if (in->mrPopup == NULL && pmp->parent_menu != NULL && MR_XANIMATION(pmp->menu) != 0 && pointer_in_passive_item_area(med->x_offset, med->mrMi)) { /* we have to see if we need menu to be moved */ animated_move_back(pmp->menu, True, (*pmp->pexc)->w.fw); if (in->mrPopdown) { if (in->mrPopdown != in->mrPopup) { pop_menu_down_and_repaint_parent( &in->mrPopdown, pdoes_popdown_submenu_overlap, pmp); in->mi_with_popup = NULL; } in->mrPopdown = NULL; } in->mif.do_popdown = False; } return MENU_MLOOP_RET_NORMAL; } static mloop_ret_code_t __mloop_handle_action_without_mi( MenuParameters *pmp, MenuReturn *pmret, double_keypress *pdkp, mloop_evh_input_t *in, mloop_evh_data_t *med, mloop_static_info_t *msi, MenuOptions *pops, Bool *pdoes_submenu_overlap, Bool *pdoes_popdown_submenu_overlap) { pmret->flags.do_unpost_submenu = 0; /* moved off menu, deselect selected item... */ if (!MR_SELECTED_ITEM(pmp->menu) || in->mif.is_off_menu_allowed == True || pmret->flags.is_menu_posted) { /* nothing to do */ return MENU_MLOOP_RET_NORMAL; } if (in->mrPopup) { int x, y, mx, my; int mw, mh; if (FQueryPointer(dpy, Scr.Root, &JunkRoot, &JunkChild, &x, &y, &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen */ x = 0; y = 0; } if (menu_get_geometry( pmp->menu, &JunkRoot, &mx, &my, &mw, &mh, &JunkBW, &JunkDepth) && ((!MR_IS_LEFT(in->mrPopup) && x < mx) || (!MR_IS_RIGHT(in->mrPopup) && x > mx + mw) || (!MR_IS_UP(in->mrPopup) && y < my) || (!MR_IS_DOWN(in->mrPopup) && y > my + mh))) { select_menu_item( pmp->menu, MR_SELECTED_ITEM(pmp->menu), False, (*pmp->pexc)->w.fw); pop_menu_down_and_repaint_parent( &in->mrPopup, pdoes_submenu_overlap, pmp); in->mi_with_popup = NULL; MR_SUBMENU_ITEM(pmp->menu) = NULL; if (in->mrPopup == in->mrPopdown) { in->mrPopdown = NULL; } in->mrPopup = NULL; } else if (x < mx || x >= mx + mw || y < my || y >= my + mh) { /* pointer is outside the menu but do not pop down */ in->mif.is_off_menu_allowed = True; } else { /* Pointer is still in the menu. Postpone the decision * if we have to pop down. */ } } /* if (in->mrPopup) */ else { select_menu_item( pmp->menu, MR_SELECTED_ITEM(pmp->menu), False, (*pmp->pexc)->w.fw); } return MENU_MLOOP_RET_NORMAL; } static void __mloop_exit_warp_back(MenuParameters *pmp) { MenuRoot *tmrMi; if (pmp->parent_menu && MR_SELECTED_ITEM(pmp->parent_menu)) { warp_pointer_to_item( pmp->parent_menu, MR_SELECTED_ITEM(pmp->parent_menu), False); (void)find_entry(pmp, NULL, &tmrMi, None, -1, -1); if (pmp->parent_menu != tmrMi && MR_XANIMATION(pmp->menu) == 0) { /* Warping didn't take us to the correct menu, i.e. the * spot we want to warp to is obscured. So raise our * window first. */ XRaiseWindow(dpy, MR_WINDOW(pmp->parent_menu)); } } return; } static void __mloop_exit_select_in_place( MenuParameters *pmp, mloop_evh_data_t *med, MenuOptions *pops) { MenuRoot *submenu; XWindowAttributes win_attribs; last_saved_pos_hints.flags.is_last_menu_pos_hints_valid = True; last_saved_pos_hints.pos_hints.x_offset = 0; last_saved_pos_hints.pos_hints.x_factor = 0; last_saved_pos_hints.pos_hints.context_x_factor = 0; last_saved_pos_hints.pos_hints.y_factor = 0; last_saved_pos_hints.pos_hints.is_relative = False; last_saved_pos_hints.pos_hints.is_menu_relative = False; submenu = mr_popup_for_mi(pmp->menu, med->mi); if (submenu && MR_WINDOW(submenu) != None && XGetWindowAttributes(dpy, MR_WINDOW(submenu), &win_attribs) && win_attribs.map_state == IsViewable && menu_get_geometry( submenu, &JunkRoot, &last_saved_pos_hints.pos_hints.x, &last_saved_pos_hints.pos_hints.y, &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth)) { /* The submenu is mapped, just take its position and put it in * the position hints. */ } else if (pops->flags.has_poshints) { last_saved_pos_hints.pos_hints = pops->pos_hints; } else { Bool dummy; get_prefered_popup_position( pmp->menu, submenu, &last_saved_pos_hints. pos_hints.x, &last_saved_pos_hints. pos_hints.y, &dummy); } if (pops->flags.do_warp_on_select) { last_saved_pos_hints.flags.do_warp_title = 1; } return; } static void __mloop_exit_selected( MenuParameters *pmp, MenuReturn *pmret, mloop_evh_data_t *med, MenuOptions *pops) { /* save action to execute so that the menu may be destroyed now */ if (pmp->ret_paction) { if (pmret->rc == MENU_EXEC_CMD) { *pmp->ret_paction = safestrdup(*pmp->ret_paction); } else { if (*pmp->ret_paction) { free(*pmp->ret_paction); } *pmp->ret_paction = (med->mi) ? safestrdup(MI_ACTION(med->mi)) : NULL; } } if ( pmp->ret_paction && *pmp->ret_paction && med->mi && MI_IS_POPUP(med->mi)) { get_popup_options(pmp, med->mi, pops); if (pops->flags.do_select_in_place) { __mloop_exit_select_in_place(pmp, med, pops); } else { last_saved_pos_hints.flags.do_ignore_pos_hints = True; } /* pops->flags.do_select_in_place */ last_saved_pos_hints.pos_hints.screen_origin_x = pmp->screen_origin_x; last_saved_pos_hints.pos_hints.screen_origin_y = pmp->screen_origin_y; } return; } static void __mloop_exit( MenuParameters *pmp, MenuReturn *pmret, double_keypress *pdkp, mloop_evh_input_t *in, mloop_evh_data_t *med, mloop_static_info_t *msi, MenuOptions *pops) { Bool no = False; Bool do_deselect = False; if (in->mrPopdown) { pop_menu_down_and_repaint_parent(&in->mrPopdown, &no, pmp); MR_SUBMENU_ITEM(pmp->menu) = NULL; } if ( pmret->rc == MENU_SELECTED && is_double_click( msi->t0, med->mi, pmp, pmret, pdkp, in->mif.has_mouse_moved)) { pmret->rc = MENU_DOUBLE_CLICKED; } if ( pmret->rc == MENU_SELECTED && med->mi && MI_FUNC_TYPE(med->mi) == F_TEARMENUOFF) { pmret->rc = (MR_IS_TEAR_OFF_MENU(pmp->menu)) ? MENU_KILL_TEAR_OFF_MENU : MENU_TEAR_OFF; } switch (pmret->rc) { case MENU_POPDOWN: case MENU_PROPAGATE_EVENT: case MENU_DOUBLE_CLICKED: do_deselect = True; /* Allow popdown to warp back pointer to main menu with mouse button control. (MoveLeft/MoveRight on a mouse binding) */ if (((pmret->rc == MENU_POPDOWN && in->mif.is_button_release) || in->mif.is_key_press) && pmret->rc != MENU_DOUBLE_CLICKED) { if (!pmp->flags.is_submenu) { /* abort a root menu rather than pop it down */ pmret->rc = MENU_ABORTED; } __mloop_exit_warp_back(pmp); } break; case MENU_ABORTED: case MENU_TEAR_OFF: case MENU_KILL_TEAR_OFF_MENU: do_deselect = True; break; case MENU_SELECTED: case MENU_EXEC_CMD: __mloop_exit_selected(pmp, pmret, med, pops); pmret->rc = MENU_DONE; break; default: break; } if (do_deselect && MR_SELECTED_ITEM(pmp->menu)) { select_menu_item( pmp->menu, MR_SELECTED_ITEM(pmp->menu), False, (*pmp->pexc)->w.fw); } if (pmret->rc == MENU_SUBMENU_TORN_OFF) { in->mrPopup = NULL; MR_SUBMENU_ITEM(pmp->menu) = NULL; } if (in->mrPopup) { pop_menu_down_and_repaint_parent(&in->mrPopup, &no, pmp); MR_SUBMENU_ITEM(pmp->menu) = NULL; } pmret->flags.is_key_press = in->mif.is_key_press; return; } static void __menu_loop( MenuParameters *pmp, MenuReturn *pmret, double_keypress *pdkp) { mloop_evh_input_t mei; mloop_ret_code_t mloop_ret; mloop_evh_data_t med; mloop_static_info_t msi; MenuOptions mops; Bool is_finished; Bool does_submenu_overlap = False; Bool does_popdown_submenu_overlap = False; __mloop_init(pmp, pmret, &mei, &med, &msi, &mops); for (is_finished = False; !is_finished; ) { mloop_ret = __mloop_get_event(pmp, pmret, &mei, &med, &msi); switch (mloop_ret) { case MENU_MLOOP_RET_END: is_finished = True; case MENU_MLOOP_RET_LOOP: continue; default: break; } mloop_ret = __mloop_handle_event( pmp, pmret, pdkp, &mei, &med, &msi); switch (mloop_ret) { case MENU_MLOOP_RET_END: is_finished = True; continue; case MENU_MLOOP_RET_LOOP: continue; default: break; } /* Now handle new menu items, whether it is from a keypress or * a pointer motion event. */ if (med.mi != NULL) { mloop_ret = __mloop_handle_action_with_mi( pmp, pmret, pdkp, &mei, &med, &msi, &mops, &does_submenu_overlap, &does_popdown_submenu_overlap); } else { mloop_ret = __mloop_handle_action_without_mi( pmp, pmret, pdkp, &mei, &med, &msi, &mops, &does_submenu_overlap, &does_popdown_submenu_overlap); } if (mloop_ret == MENU_MLOOP_RET_END) { is_finished = True; } XFlush(dpy); } __mloop_exit(pmp, pmret, pdkp, &mei, &med, &msi, &mops); return; } /* * Functions dealing with tear off menus */ static char *menu_strip_tear_off_title(MenuRoot *mr) { MenuItem *mi; int i; int len; char *name; for (mi = MR_FIRST_ITEM(mr); mi != NULL; mi = MI_NEXT_ITEM(mi)) { if (MI_IS_TITLE(mi)) { break; } else if (!MI_IS_SEPARATOR(mi) && !MI_IS_TEAR_OFF_BAR(mi)) { /* a normal item, no title found */ return NULL; } /* skip separators and tear off bars */ } if (mi == NULL || !MI_HAS_TEXT(mi) || MI_NEXT_ITEM(mi) == NULL) { return NULL; } /* extract the window title from the labels */ for (i = 0, len = 0; i < MAX_MENU_ITEM_LABELS; i++) { if (MI_LABEL(mi)[i] != 0) { len += strlen(MI_LABEL(mi)[i]) + 1; } } if (len == 0) { return NULL; } name = safemalloc(len + 1); *name = 0; for (i = 0; i < MAX_MENU_ITEM_LABELS; i++) { if (MI_LABEL(mi)[i] != 0) { strcat(name, MI_LABEL(mi)[i]); strcat(name, " "); } } /* strip the last space */ name[len - 1] = 0; /* unlink and destroy the item */ unlink_item_from_menu(mr, mi); menuitem_free(mi); return name; } static void menu_tear_off(MenuRoot *mr_to_copy) { MenuRoot *mr; MenuStyle *ms; XEvent ev; XSizeHints menusizehints; XClassHint menuclasshints; XTextProperty menunametext; XWMHints menuwmhints; char *list[] ={ NULL, NULL }; char *t; char *name = NULL; Atom protocols[1]; int x = 0; int y = 0; unsigned int add_mask = 0; initial_window_options_t win_opts; evh_args_t ea; exec_context_changes_t ecc; char *buffer; char *action; cond_rc_t *cond_rc = NULL; const exec_context_t *exc = NULL; /* keep the menu open */ if (MR_WINDOW(mr_to_copy) != None) { discard_window_events( MR_WINDOW(mr_to_copy), SubstructureNotifyMask); } mr = clone_menu(mr_to_copy); /* also dump the menu style */ buffer = (char *)safemalloc(23); sprintf(buffer,"%lu",(unsigned long)mr); action = buffer; ms = menustyle_parse_style(F_PASS_ARGS); if (!ms) { /* this must never happen */ fvwm_msg( ERR, "menu_tear_off", "impossible to create %s menu style", buffer); free(buffer); DestroyMenu(mr, False, False); return; } free(buffer); menustyle_copy(MR_STYLE(mr_to_copy),ms); MR_STYLE(mr) = ms; MST_USAGE_COUNT(mr) = 0; name = menu_strip_tear_off_title(mr); /* create the menu window and size the menu */ make_menu(mr, True); /* set position */ if (menu_get_geometry( mr_to_copy, &JunkRoot, &x, &y, &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth)) { add_mask = PPosition; XMoveWindow(dpy, MR_WINDOW(mr), x, y); } else { add_mask = 0; } /* focus policy */ menuwmhints.flags = InputHint; menuwmhints.input = False; /* size hints */ menusizehints.flags = PBaseSize | PMinSize | PMaxSize | add_mask; menusizehints.base_width = 0; menusizehints.base_height = 0; menusizehints.min_width = MR_WIDTH(mr); menusizehints.min_height = MR_HEIGHT(mr); menusizehints.max_width = MR_WIDTH(mr); menusizehints.max_height = MR_HEIGHT(mr); /* class, resource and names */ menuclasshints.res_name = (name != NULL) ? name : safestrdup(MR_NAME(mr)); menuclasshints.res_class = safestrdup("fvwm_menu"); for (t = menuclasshints.res_name; t != NULL && *t != 0; t++) { /* replace tabs in the title with spaces */ if (*t == '\t') { *t = ' '; } } list[0] = menuclasshints.res_name; menunametext.value = NULL; XStringListToTextProperty(list, 1, &menunametext); /* set all properties and hints */ XSetWMProperties( dpy, MR_WINDOW(mr), &menunametext, &menunametext, NULL, 0, &menusizehints, NULL, &menuclasshints); XSetWMHints(dpy, MR_WINDOW(mr), &menuwmhints); protocols[0] = _XA_WM_DELETE_WINDOW; XSetWMProtocols(dpy, MR_WINDOW(mr), &(protocols[0]), 1); /* free memory */ if (menunametext.value != NULL) { XFree(menunametext.value); } free(menuclasshints.res_class); free(menuclasshints.res_name); /* manage the window */ memset(&win_opts, 0, sizeof(win_opts)); win_opts.flags.is_menu = True; ev.type = MapRequest; ev.xmaprequest.send_event = True; ev.xmaprequest.display = dpy; ev.xmaprequest.parent = Scr.Root; ev.xmaprequest.window = MR_WINDOW(mr); fev_fake_event(&ev); ecc.type = EXCT_NULL; ecc.x.etrigger = &ev; ecc.w.w = MR_WINDOW(mr); ecc.w.wcontext = C_ROOT; ea.exc = exc_create_context( &ecc, ECC_TYPE | ECC_ETRIGGER | ECC_W | ECC_WCONTEXT); HandleMapRequestKeepRaised(&ea, None, NULL, &win_opts); exc_destroy_context(ea.exc); return; } static void do_menu_close_tear_off_menu(MenuRoot *mr, MenuParameters mp) { pop_menu_down(&mr, &mp); menustyle_free(MR_STYLE(mr)); DestroyMenu(mr, False, False); } /* ---------------------------- interface functions ------------------------- */ void menus_init(void) { memset((&Menus), 0, sizeof(MenuInfo)); return; } /* menus_find_menu expects a token as the input. Make sure you have used * GetNextToken before passing a menu name to remove quotes (if necessary) */ MenuRoot *menus_find_menu(char *name) { MenuRoot *mr; if (name == NULL) { return NULL; } for (mr = Menus.all; mr != NULL; mr = MR_NEXT_MENU(mr)) { if (!MR_IS_DESTROYED(mr) && mr == MR_ORIGINAL_MENU(mr) && MR_NAME(mr) != NULL && StrEquals(name, MR_NAME(mr))) { break; } } return mr; } void menus_remove_style_from_menus(MenuStyle *ms) { MenuRoot *mr; for (mr = Menus.all; mr; mr = MR_NEXT_MENU(mr)) { if (MR_STYLE(mr) == ms) { MR_STYLE(mr) = menustyle_get_default_style(); MR_IS_UPDATED(mr) = 1; } } return; } /* * Functions dealing with tear off menus */ void menu_enter_tear_off_menu(const exec_context_t *exc) { MenuRoot *mr; char *ret_action = NULL; MenuOptions mops; MenuParameters mp; MenuReturn mret; const exec_context_t *exc2; exec_context_changes_t ecc; if (XFindContext( dpy, FW_W(exc->w.fw), MenuContext, (caddr_t *)&mr) == XCNOENT) { return; } ecc.w.fw = NULL; ecc.w.w = None; ecc.w.wcontext = C_ROOT; exc2 = exc_clone_context(exc, &ecc, ECC_FW | ECC_W | ECC_WCONTEXT); memset(&mops, 0, sizeof(mops)); memset(&mret, 0, sizeof(MenuReturn)); memset(&mp, 0, sizeof(mp)); mp.menu = mr; mp.pexc = &exc2; mp.tear_off_root_menu_window = exc->w.fw; MR_IS_TEAR_OFF_MENU(mr) = 1; mp.flags.has_default_action = 0; mp.flags.is_already_mapped = True; mp.flags.is_sticky = False; mp.flags.is_submenu = False; mp.pops = &mops; mp.ret_paction = &ret_action; do_menu(&mp, &mret); exc_destroy_context(exc2); return; } void menu_close_tear_off_menu(FvwmWindow *fw) { MenuRoot *mr; MenuParameters mp; const exec_context_t *exc; exec_context_changes_t ecc; if (XFindContext( dpy, FW_W(fw), MenuContext, (caddr_t *)&mr) == XCNOENT) { return; } memset(&mp, 0, sizeof(mp)); mp.menu = mr; ecc.w.fw = NULL; ecc.w.w = None; ecc.w.wcontext = C_ROOT; exc = exc_create_context(&ecc, ECC_FW | ECC_W | ECC_WCONTEXT); mp.pexc = &exc; do_menu_close_tear_off_menu(mr, mp); exc_destroy_context(exc); return; } Bool menu_redraw_transparent_tear_off_menu(FvwmWindow *fw, Bool pr_only) { MenuRoot *mr; MenuStyle *ms = NULL; int cs; if (!(IS_TEAR_OFF_MENU(fw) && XFindContext(dpy, FW_W(fw), MenuContext,(caddr_t *)&mr) != XCNOENT && (ms = MR_STYLE(mr)) && ST_HAS_MENU_CSET(ms))) { return False; } cs = ST_CSET_MENU(ms); if (!CSET_IS_TRANSPARENT(cs) || (pr_only && !CSET_IS_TRANSPARENT_PR(cs))) { return False; } return UpdateBackgroundTransparency( dpy, MR_WINDOW(mr), MR_WIDTH(mr), MR_HEIGHT(mr), &Colorset[ST_CSET_MENU(ms)], Pdepth, FORE_GC(MST_MENU_INACTIVE_GCS(mr)), True); } /* * * Initiates a menu pop-up * * fStick = True = sticky menu, stays up on initial button release. * fStick = False = transient menu, drops on initial release. * * eventp = 0: menu opened by mouse, do not warp * eventp > 1: root menu opened by keypress with 'Menu', warp pointer and * allow 'double-keypress'. * eventp = 1: menu opened by keypress, warp but forbid 'double-keypress' * this should always be used except in the call in 'staysup_func' * in builtin.c * * Returns one of MENU_NOP, MENU_ERROR, MENU_ABORTED, MENU_DONE * do_menu() may destroy the *pmp->pexec member and replace it with a new * copy. Be sure not to rely on the original structure being kept intact * when calling do_menu(). */ void do_menu(MenuParameters *pmp, MenuReturn *pmret) { int x; int y; Bool fWasAlreadyPopped = False; Bool key_press; Bool is_pointer_grabbed = False; Bool is_pointer_ungrabbed = False; Bool do_menu_interaction; Bool do_check_pop_down; Bool do_warp; Time t0 = fev_get_evtime(); XEvent tmpevent; double_keypress dkp; /* don't save these ones, we want them to work even within recursive * menus popped up by dynamic actions. */ static int indirect_depth = 0; static int x_start; static int y_start; int scr_x, scr_y; int scr_w, scr_h; pmret->rc = MENU_NOP; if (pmp->flags.is_sticky && !pmp->flags.is_submenu) { FCheckTypedEvent(dpy, ButtonPressMask, &tmpevent); } if (pmp->menu == NULL) { pmret->rc = MENU_ERROR; return; } key_press = pmp->flags.is_triggered_by_keypress; /* Try to pick a root-relative optimal x,y to * put the mouse right on the title w/o warping */ if (FQueryPointer(dpy, Scr.Root, &JunkRoot, &JunkChild, &x, &y, &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen */ x = 0; y = 0; } /* Save these - we want to warp back here if this is a top level * menu brought up by a keystroke */ if (!pmp->flags.is_submenu) { pmp->flags.is_invoked_by_key_press = key_press; pmp->flags.is_first_root_menu = !indirect_depth; } else { pmp->flags.is_first_root_menu = 0; } if (!pmp->flags.is_submenu && indirect_depth == 0) { if (key_press) { x_start = x; y_start = y; } else { x_start = -1; y_start = -1; } pmp->screen_origin_x = pmp->pops->pos_hints.screen_origin_x; pmp->screen_origin_y = pmp->pops->pos_hints.screen_origin_y; } if (pmp->pops->flags.do_warp_title) { do_warp = True; } else if (pmp->pops->flags.do_not_warp) { do_warp = False; } else if (key_press) { do_warp = True; } else { do_warp = False; } /* Figure out where we should popup, if possible */ if (!pmp->flags.is_already_mapped) { Bool prefer_left_submenus = False; /* Make sure we are using the latest style and menu layout. */ update_menu(pmp->menu, pmp); if (pmp->flags.is_submenu) { /* this is a submenu popup */ get_prefered_popup_position( pmp->parent_menu, pmp->menu, &x, &y, &prefer_left_submenus); } else { fscreen_scr_arg fscr; /* we're a top level menu */ if (!GrabEm(CRS_MENU, GRAB_MENU)) { /* GrabEm specifies the cursor to use */ XBell(dpy, 0); pmret->rc = MENU_ABORTED; return; } is_pointer_grabbed = True; /* Make the menu appear under the pointer rather than * warping */ fscr.xypos.x = x; fscr.xypos.y = y; FScreenGetScrRect( &fscr, FSCREEN_XYPOS, &scr_x, &scr_y, &scr_w, &scr_h); x -= menudim_middle_x_offset(&MR_DIM(pmp->menu)); y -= menuitem_middle_y_offset( MR_FIRST_ITEM(pmp->menu), MR_STYLE(pmp->menu)); if (x < scr_x) { x = scr_x; } if (y < scr_y) { y = scr_y; } } /* pop_menu_up may move the x,y to make it fit on screen more * nicely. It might also move parent_menu out of the way. */ if (!pop_menu_up( &(pmp->menu), pmp, pmp->parent_menu, NULL, pmp->pexc, x, y, prefer_left_submenus, do_warp, pmp->pops, NULL, None)) { XBell(dpy, 0); UngrabEm(GRAB_MENU); pmret->rc = MENU_ERROR; return; } } else { fWasAlreadyPopped = True; if (pmp->tear_off_root_menu_window != NULL) { if (!GrabEm(CRS_MENU, GRAB_MENU)) { /* GrabEm specifies the cursor to use */ XBell(dpy, 0); pmret->rc = MENU_ABORTED; return; } is_pointer_grabbed = True; } if (key_press) { warp_pointer_to_item( pmp->menu, MR_FIRST_ITEM(pmp->menu), True /* skip Title */); } } /* Remember the key that popped up the root menu. */ if (pmp->flags.is_submenu) { dkp.timestamp = 0; } else { if (pmp->flags.is_triggered_by_keypress) { /* we have a real key event */ dkp.keystate = (*pmp->pexc)->x.etrigger->xkey.state; dkp.keycode = (*pmp->pexc)->x.etrigger->xkey.keycode; } dkp.timestamp = (key_press && pmp->flags.has_default_action) ? t0 : 0; } if (!pmp->flags.is_submenu && indirect_depth == 0) { /* we need to grab the keyboard so we are sure no key presses * are lost */ MyXGrabKeyboard(dpy); } /* This may loop for tear off menus */ for (do_menu_interaction = True; do_menu_interaction == True; ) { if (is_pointer_ungrabbed && !GrabEm(CRS_MENU, GRAB_MENU)) { /* re-grab the pointer in this cycle */ XBell(dpy, 0); pmret->rc = MENU_ABORTED; break; } do_menu_interaction = False; if (pmp->pops->flags.do_tear_off_immediately == 1) { pmret->rc = MENU_TEAR_OFF; } else { if (!pmp->flags.is_submenu) { XSelectInput( dpy, Scr.NoFocusWin, XEVMASK_MENUNFW); XFlush(dpy); } __menu_loop(pmp, pmret, &dkp); if (!pmp->flags.is_submenu) { XSelectInput( dpy, Scr.NoFocusWin, XEVMASK_NOFOCUSW); XFlush(dpy); } } do_check_pop_down = False; switch (pmret->rc) { case MENU_TEAR_OFF: menu_tear_off(pmp->menu); pop_menu_down(&pmp->menu, pmp); break; case MENU_KILL_TEAR_OFF_MENU: if (MR_IS_TEAR_OFF_MENU(pmp->menu)) { /* kill the menu */ do_menu_close_tear_off_menu(pmp->menu, *pmp); pmret->rc = MENU_ABORTED; } else { /* pass return code up to the torn off menu */ } break; case MENU_DOUBLE_CLICKED: case MENU_DONE: if (MR_IS_TEAR_OFF_MENU(pmp->menu)) { do_menu_interaction = True; } else { do_check_pop_down = True; } break; case MENU_SUBMENU_TORN_OFF: pmret->rc = MENU_ABORTED; do_check_pop_down = True; break; default: do_check_pop_down = True; break; } if (do_check_pop_down == True) { /* popping down may destroy the menu via the dynamic * popdown action! */ if (!MR_IS_TEAR_OFF_MENU(pmp->menu) && fWasAlreadyPopped == False) { pop_menu_down(&pmp->menu, pmp); } } XFlush(dpy); if (!pmp->flags.is_submenu && x_start >= 0 && y_start >= 0 && pmret->flags.is_key_press && pmret->rc != MENU_TEAR_OFF) { /* warp pointer back to where invoked if this was * brought up with a keypress and we're returning from * a top level menu, and a button release event didn't * end it */ FWarpPointer( dpy, 0, Scr.Root, 0, 0, Scr.MyDisplayWidth, Scr.MyDisplayHeight, x_start, y_start); if ((*pmp->pexc)->x.elast->type == KeyPress) { XEvent e = *(*pmp->pexc)->x.elast; e.xkey.x_root = x_start; e.xkey.y_root = y_start; fev_fake_event(&e); } } if (pmret->rc == MENU_TEAR_OFF) { pmret->rc = MENU_SUBMENU_TORN_OFF; } dkp.timestamp = 0; if (is_pointer_grabbed) { UngrabEm(GRAB_MENU); WaitForButtonsUp(True); is_pointer_ungrabbed = True; } if (!pmp->flags.is_submenu) { if (pmret->rc == MENU_DONE) { if (pmp->ret_paction && *pmp->ret_paction) { indirect_depth++; /* Execute the action */ __menu_execute_function( pmp->pexc, *pmp->ret_paction); indirect_depth--; free(*pmp->ret_paction); *pmp->ret_paction = NULL; } last_saved_pos_hints.flags. do_ignore_pos_hints = False; last_saved_pos_hints.flags. is_last_menu_pos_hints_valid = False; } if (indirect_depth == 0) { last_saved_pos_hints.flags. do_ignore_pos_hints = False; last_saved_pos_hints.flags. is_last_menu_pos_hints_valid = False; } } } if (!pmp->flags.is_submenu && indirect_depth == 0) { /* release the keyboard when the last menu closes */ MyXUngrabKeyboard(dpy); } return; } Bool menu_expose(XEvent *event, FvwmWindow *fw) { MenuRoot *mr = NULL; if ((XFindContext( dpy, event->xany.window, MenuContext, (caddr_t *)&mr) != XCNOENT)) { flush_accumulate_expose(event->xany.window, event); paint_menu(mr, event, fw); return True; } else { return False; } } /* * * Procedure: * update_transparent_menu_bg - set the background of the menu to * match a forseen move of a menu. If the background is updated * for the target position before the move is done, and repainted * after the move, the move will look more seamless. * * This method should be folleowd by a call to repaint_transparent_menu * with the same step_x, stey_y, end_x and any_y, with is_bg_set True */ void update_transparent_menu_bg( MenuRepaintTransparentParameters *prtm, int current_x, int current_y, int step_x, int step_y, int end_x, int end_y) { MenuRoot *mr; MenuStyle *ms; Bool last = False; mr = prtm->mr; ms = MR_STYLE(mr); if (step_x == end_x && step_y == end_y) { last = True; } if (!last && CSET_IS_TRANSPARENT_PR_TINT(ST_CSET_MENU(ms))) { /* too slow ... */ return; } SetWindowBackgroundWithOffset( dpy, MR_WINDOW(mr), step_x - current_x, step_y - current_y, MR_WIDTH(mr), MR_HEIGHT(mr), &Colorset[ST_CSET_MENU(ms)], Pdepth, FORE_GC(MST_MENU_INACTIVE_GCS(mr)), False); } /* * * Procedure: * repaint_transparent_menu - repaint the menu background if it is * tranparent during an animated move. Called in move_resize.c * (AnimatedMoveAnyWindow). Performance improvement Welcome! * ideas: - write the foreground into a pixmap and a mask the first time * this function is called. Then use these pixmaps to draw * the items * - Use a Buffer if !IS_TRANSPARENT_PR_PURE and if we do not have one * already */ void repaint_transparent_menu( MenuRepaintTransparentParameters *prtm, Bool first, int x, int y, int end_x, int end_y, Bool is_bg_set) { MenuItem *mi; MenuRoot *mr; MenuStyle *ms; int h = 0; int s_h = 0; int e_h = 0; Bool last = False; mr = prtm->mr; ms = MR_STYLE(mr); if (x == end_x && y == end_y) { last = True; } if (!last && CSET_IS_TRANSPARENT_PR_TINT(ST_CSET_MENU(ms))) { /* too slow ... */ return; } if (!is_bg_set) { SetWindowBackground( dpy, MR_WINDOW(mr), MR_WIDTH(mr), MR_HEIGHT(mr), &Colorset[ST_CSET_MENU(ms)], Pdepth, FORE_GC(MST_MENU_INACTIVE_GCS(mr)), False); } /* redraw the background of non active item */ for (mi = MR_FIRST_ITEM(mr); mi != NULL; mi = MI_NEXT_ITEM(mi)) { if (mi == MR_SELECTED_ITEM(mr) && MST_DO_HILIGHT_BACK(mr)) { int left; left = MR_HILIGHT_X_OFFSET(mr) - MR_ITEM_X_OFFSET(mr); if (left > 0) { XClearArea( dpy, MR_WINDOW(mr), MR_ITEM_X_OFFSET(mr), MI_Y_OFFSET(mi), left, MI_HEIGHT(mi) + MST_RELIEF_THICKNESS(mr), 0); } h = MI_HEIGHT(mi); continue; } if (h == 0) { s_h += MI_HEIGHT(mi); } else { e_h += MI_HEIGHT(mi); } } XClearArea( dpy, MR_WINDOW(mr), MR_ITEM_X_OFFSET(mr), MST_BORDER_WIDTH(mr), MR_ITEM_WIDTH(mr), s_h, 0); if (e_h != 0) { XClearArea( dpy, MR_WINDOW(mr), MR_ITEM_X_OFFSET(mr), s_h + h + MST_RELIEF_THICKNESS(mr) + MST_BORDER_WIDTH(mr), MR_ITEM_WIDTH(mr), e_h, 0); } /* now redraw the items */ for (mi = MR_FIRST_ITEM(mr); mi != NULL; mi = MI_NEXT_ITEM(mi)) { MenuPaintItemParameters mpip; if (mi == MR_SELECTED_ITEM(mr) && MST_DO_HILIGHT_BACK(mr) && !CSET_IS_TRANSPARENT_PR_TINT(ST_CSET_MENU(ms))) { continue; } get_menu_paint_item_parameters( &mpip, mr, NULL, prtm->fw, NULL, True); mpip.flags.is_first_item = (MR_FIRST_ITEM(mr) == mi); menuitem_paint(mi, &mpip); } /* if we have a side pic and no side colors we shound repaint the side * pic */ if ((MR_SIDEPIC(mr) || MST_SIDEPIC(mr)) && !MR_HAS_SIDECOLOR(mr) && !MST_HAS_SIDE_COLOR(mr)) { FvwmPicture *sidePic; if (MR_SIDEPIC(mr)) { sidePic = MR_SIDEPIC(mr); } else if (MST_SIDEPIC(mr)) { sidePic = MST_SIDEPIC(mr); } else { return; } XClearArea( dpy, MR_WINDOW(mr), MR_SIDEPIC_X_OFFSET(mr), MST_BORDER_WIDTH(mr), sidePic->width, MR_HEIGHT(mr) - 2 * MST_BORDER_WIDTH(mr), 0); paint_side_pic(mr, NULL); } } Bool DestroyMenu(MenuRoot *mr, Bool do_recreate, Bool is_command_request) { MenuItem *mi,*tmp2; MenuRoot *tmp, *prev; Bool in_list = True; if (mr == NULL) { return False; } /* seek menu in master list */ tmp = Menus.all; prev = NULL; while (tmp && tmp != mr) { prev = tmp; tmp = MR_NEXT_MENU(tmp); } if (tmp != mr) { /* no such menu */ in_list = False; } if (MR_MAPPED_COPIES(mr) > 0 && (is_command_request || MR_COPIES(mr) == 1)) { /* can't destroy a menu while in use */ fvwm_msg(ERR, "DestroyMenu", "Menu %s is in use", MR_NAME(mr)); return False; } if (in_list && MR_COPIES(mr) > 1 && MR_ORIGINAL_MENU(mr) == mr) { MenuRoot *m; MenuRoot *new_orig; /* find a new 'original' menu */ for (m = Menus.all, new_orig = NULL; m; m = MR_NEXT_MENU(m)) { if (m != mr && MR_ORIGINAL_MENU(m) == mr) { if (new_orig == NULL) { new_orig = m; } MR_ORIGINAL_MENU(m) = new_orig; } } MR_ORIGINAL_MENU(mr) = new_orig; /* now dump old original menu */ } MR_COPIES(mr)--; if (MR_STORED_ITEM(mr).stored) { XFreePixmap(dpy, MR_STORED_ITEM(mr).stored); } if (MR_COPIES(mr) > 0) { do_recreate = False; } else { /* free all items */ mi = MR_FIRST_ITEM(mr); while (mi != NULL) { tmp2 = MI_NEXT_ITEM(mi); menuitem_free(mi); mi = tmp2; } if (do_recreate) { /* just dump the menu items but keep the menu itself */ MR_COPIES(mr)++; MR_FIRST_ITEM(mr) = NULL; MR_LAST_ITEM(mr) = NULL; MR_SELECTED_ITEM(mr) = NULL; MR_CONTINUATION_MENU(mr) = NULL; MR_PARENT_MENU(mr) = NULL; MR_ITEMS(mr) = 0; memset(&(MR_STORED_ITEM(mr)), 0 , sizeof(MR_STORED_ITEM(mr))); MR_IS_UPDATED(mr) = 1; return True; } } /* unlink menu from list */ if (in_list) { if (prev == NULL) { Menus.all = MR_NEXT_MENU(mr); } else { MR_NEXT_MENU(prev) = MR_NEXT_MENU(mr); } } /* destroy the window and the display */ if (MR_WINDOW(mr) != None) { XDeleteContext(dpy, MR_WINDOW(mr), MenuContext); XFlush(dpy); XDestroyWindow(MR_CREATE_DPY(mr), MR_WINDOW(mr)); MR_WINDOW(mr) = None; XFlush(MR_CREATE_DPY(mr)); } if (MR_CREATE_DPY(mr) != NULL && MR_CREATE_DPY(mr) != dpy) { XCloseDisplay(MR_CREATE_DPY(mr)); MR_CREATE_DPY(mr) = NULL; } if (MR_COPIES(mr) == 0) { if (MR_POPUP_ACTION(mr)) { free(MR_POPUP_ACTION(mr)); } if (MR_POPDOWN_ACTION(mr)) { free(MR_POPDOWN_ACTION(mr)); } if (MR_MISSING_SUBMENU_FUNC(mr)) { free(MR_MISSING_SUBMENU_FUNC(mr)); } free(MR_NAME(mr)); if (MR_SIDEPIC(mr)) { PDestroyFvwmPicture(dpy, MR_SIDEPIC(mr)); } memset(mr->s, 0, sizeof(*(mr->s))); free(mr->s); } memset(mr->d, 0, sizeof(*(mr->d))); free(mr->d); memset(mr, 0, sizeof(*mr)); free(mr); return True; } /* FollowMenuContinuations * Given an menu root, return the menu root to add to by * following continuation links until there are no more */ MenuRoot *FollowMenuContinuations(MenuRoot *mr, MenuRoot **pmrPrior ) { *pmrPrior = NULL; while ((mr != NULL) && (MR_CONTINUATION_MENU(mr) != NULL)) { *pmrPrior = mr; mr = MR_CONTINUATION_MENU(mr); } return mr; } /* * * Procedure: * AddToMenu - add an item to a root menu * * Returned Value: * (MenuItem *) * * Inputs: * menu - pointer to the root menu to add the item * item - the text to appear in the menu * action - the string to possibly execute * * ckh - need to add boolean to say whether or not to expand for pixmaps, * so built in window list can handle windows w/ * and % in title. * */ void AddToMenu( MenuRoot *mr, char *item, char *action, Bool fPixmapsOk, Bool fNoPlus, Bool is_continuation_item) { MenuItem *tmp; char *start; char *end; char *token = NULL; char *option = NULL; int i; int is_empty; Bool do_replace_title; if (MR_MAPPED_COPIES(mr) > 0) { /* whoa, we can't handle *everything* */ return; } if ((item == NULL || *item == 0) && (action == NULL || *action == 0) && fNoPlus) { return; } /* empty items screw up our menu when painted, so we replace them with * a separator */ if (item == NULL) item = ""; /* * Handle dynamic actions */ if (StrEquals(item, "DynamicPopupAction")) { if (MR_POPUP_ACTION(mr)) { free(MR_POPUP_ACTION(mr)); } if (!action || *action == 0) { MR_POPUP_ACTION(mr) = NULL; } else { MR_POPUP_ACTION(mr) = stripcpy(action); } return; } else if (StrEquals(item, "DynamicPopdownAction")) { if (MR_POPDOWN_ACTION(mr)) { free(MR_POPDOWN_ACTION(mr)); } if (!action || *action == 0) { MR_POPDOWN_ACTION(mr) = NULL; } else { MR_POPDOWN_ACTION(mr) = stripcpy(action); } return; } else if (StrEquals(item, "MissingSubmenuFunction")) { if (MR_MISSING_SUBMENU_FUNC(mr)) { free(MR_MISSING_SUBMENU_FUNC(mr)); } if (!action || *action == 0) { MR_MISSING_SUBMENU_FUNC(mr) = NULL; } else { MR_MISSING_SUBMENU_FUNC(mr) = stripcpy(action); } return; } /* * Parse the action */ if (action == NULL || *action == 0) { action = "Nop"; } GetNextToken(GetNextToken(action, &token), &option); tmp = menuitem_create(); if (MR_FIRST_ITEM(mr) != NULL && StrEquals(token, "title") && option != NULL && StrEquals(option, "top")) { do_replace_title = True; } else { do_replace_title = False; } append_item_to_menu(mr, tmp, do_replace_title); if (token) { free(token); } if (option) { free(option); } MI_ACTION(tmp) = stripcpy(action); /* * Parse the labels */ start = item; end = item; for (i = 0; i < MAX_MENU_ITEM_LABELS; i++, start = end) { /* Read label up to next tab. */ if (*end) { if (i < MAX_MENU_ITEM_LABELS - 1) { while (*end && *end != '\t') { /* seek next tab or end of string */ end++; } } else { /* remove all tabs in last label */ while (*end) { if (*end == '\t') { *end = ' '; } end++; } } /* Copy the label. */ MI_LABEL(tmp)[i] = safemalloc(end - start + 1); strncpy(MI_LABEL(tmp)[i], start, end - start); (MI_LABEL(tmp)[i])[end - start] = 0; if (*end == '\t') { /* skip the tab */ end++; } } else { MI_LABEL(tmp)[i] = NULL; } /* Parse the label. */ if (MI_LABEL(tmp)[i] != NULL) { if (fPixmapsOk) { string_def_t item_pixmaps[] = { {'*', __scan_for_pixmap}, {'%', __scan_for_pixmap}, {'\0', NULL}}; string_context_t ctx; SCTX_SET_MI(ctx,tmp); scanForStrings( MI_LABEL(tmp)[i], item_pixmaps, &ctx); } if (!MI_HAS_HOTKEY(tmp)) { /* pete@tecc.co.uk */ scanForHotkeys(tmp, i); if (!MI_HAS_HOTKEY(tmp) && *MI_LABEL(tmp)[i] != 0) { MI_HOTKEY_COFFSET(tmp) = 0; MI_HOTKEY_COLUMN(tmp) = i; MI_HAS_HOTKEY(tmp) = 1; MI_IS_HOTKEY_AUTOMATIC(tmp) = 1; } } if (*(MI_LABEL(tmp)[i])) { MI_HAS_TEXT(tmp) = True; } else { free(MI_LABEL(tmp)[i]); MI_LABEL(tmp)[i] = NULL; } } MI_LABEL_STRLEN(tmp)[i] = (MI_LABEL(tmp)[i]) ? strlen(MI_LABEL(tmp)[i]) : 0; } /* for */ /* * Set the type flags */ if (is_continuation_item) { MI_IS_CONTINUATION(tmp) = True; } find_func_t(MI_ACTION(tmp), &(MI_FUNC_TYPE(tmp)), NULL); switch (MI_FUNC_TYPE(tmp)) { case F_POPUP: MI_IS_POPUP(tmp) = True; case F_WINDOWLIST: case F_STAYSUP: MI_IS_MENU(tmp) = True; break; case F_TITLE: MI_IS_TITLE(tmp) = True; break; default: break; } is_empty = (!MI_HAS_TEXT(tmp) && !MI_HAS_PICTURE(tmp)); if (is_empty) { if (MI_FUNC_TYPE(tmp) == F_TEARMENUOFF) { MI_IS_TEAR_OFF_BAR(tmp) = 1; MI_IS_SEPARATOR(tmp) = 0; } else { MI_IS_TEAR_OFF_BAR(tmp) = 0; MI_IS_SEPARATOR(tmp) = 1; } } if (MI_IS_SEPARATOR(tmp)) { /* An empty title is handled like a separator. */ MI_IS_TITLE(tmp) = False; } MI_IS_SELECTABLE(tmp) = ((MI_HAS_TEXT(tmp) || MI_HAS_PICTURE(tmp) || MI_IS_TEAR_OFF_BAR(tmp)) && !MI_IS_TITLE(tmp)); /* * misc stuff */ MR_ITEMS(mr)++; MR_IS_UPDATED(mr) = 1; return; } /* * * Procedure: * NewMenuRoot - create a new menu root * * Returned Value: * (MenuRoot *) * * Inputs: * name - the name of the menu root * */ MenuRoot *NewMenuRoot(char *name) { MenuRoot *mr; string_def_t root_strings[] = { {'@', __scan_for_pixmap}, {'^', __scan_for_color}, {'\0', NULL}}; string_context_t ctx; mr = (MenuRoot *)safemalloc(sizeof(MenuRoot)); mr->s = (MenuRootStatic *)safemalloc(sizeof(MenuRootStatic)); mr->d = (MenuRootDynamic *)safemalloc(sizeof(MenuRootDynamic)); memset(mr->s, 0, sizeof(MenuRootStatic)); memset(mr->d, 0, sizeof(MenuRootDynamic)); MR_NEXT_MENU(mr) = Menus.all; MR_NAME(mr) = safestrdup(name); MR_WINDOW(mr) = None; SCTX_SET_MR(ctx,mr); MR_HAS_SIDECOLOR(mr) = False; scanForStrings( MR_NAME(mr), root_strings, &ctx); MR_STYLE(mr) = menustyle_get_default_style(); MR_ORIGINAL_MENU(mr) = mr; MR_COPIES(mr) = 1; MR_IS_UPDATED(mr) = 1; Menus.all = mr; return mr; } void SetMenuCursor(Cursor cursor) { MenuRoot *mr; mr = Menus.all; for (mr = Menus.all; mr; mr = MR_NEXT_MENU(mr)) { if (MR_WINDOW(mr)) { XDefineCursor(dpy, MR_WINDOW(mr), cursor); } } return; } void UpdateAllMenuStyles(void) { MenuStyle *ms; for (ms = menustyle_get_default_style(); ms; ms = ST_NEXT_STYLE(ms)) { menustyle_update(ms); } return; } void UpdateMenuColorset(int cset) { MenuStyle *ms; FvwmWindow *t; for (ms = menustyle_get_default_style(); ms; ms = ST_NEXT_STYLE(ms)) { if ((ST_HAS_MENU_CSET(ms) && ST_CSET_MENU(ms) == cset) || (ST_HAS_ACTIVE_CSET(ms) && ST_CSET_ACTIVE(ms) == cset) || (ST_HAS_GREYED_CSET(ms) && ST_CSET_GREYED(ms) == cset) || (ST_HAS_TITLE_CSET(ms) && ST_CSET_TITLE(ms) == cset)) { menustyle_update(ms); } } for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { MenuRoot *mr = NULL; MenuStyle *ms = NULL; if (IS_TEAR_OFF_MENU(t) && XFindContext(dpy, FW_W(t), MenuContext, (caddr_t *)&mr) != XCNOENT && (ms = MR_STYLE(mr))) { if (ST_HAS_MENU_CSET(ms) && ST_CSET_MENU(ms) == cset) { SetWindowBackground( dpy, MR_WINDOW(mr), MR_WIDTH(mr), MR_HEIGHT(mr), &Colorset[ST_CSET_MENU(ms)], Pdepth, FORE_GC(MST_MENU_INACTIVE_GCS(mr)), True); } else if ((ST_HAS_ACTIVE_CSET(ms) && ST_CSET_ACTIVE(ms) == cset) || (ST_HAS_GREYED_CSET(ms) && ST_CSET_GREYED(ms) == cset)) { paint_menu(mr, NULL, NULL); } } } return; } /* This is called by the window list function */ void change_mr_menu_style(MenuRoot *mr, char *stylename) { MenuStyle *ms = NULL; ms = menustyle_find(stylename); if (ms == NULL) { return; } if (MR_MAPPED_COPIES(mr) != 0) { fvwm_msg(ERR,"ChangeMenuStyle", "menu %s is in use", MR_NAME(mr)); } else { MR_STYLE(mr) = ms; MR_IS_UPDATED(mr) = 1; } return; } void add_another_menu_item(char *action) { MenuRoot *mr; MenuRoot *mrPrior; char *rest,*item; mr = FollowMenuContinuations(Scr.last_added_item.item, &mrPrior); if (mr == NULL) { return; } if (MR_MAPPED_COPIES(mr) != 0) { fvwm_msg(ERR,"add_another_menu_item", "menu is in use"); return; } rest = GetNextToken(action,&item); AddToMenu(mr, item, rest, True /* pixmap scan */, False, False); if (item) { free(item); } return; } /* * get_menu_options is used for Menu, Popup and WindowList * It parses strings matching * * [ [context-rectangle] x y ] [special-options] [other arguments] * * and returns a pointer to the first part of the input string that doesn't * match this syntax. * * See documentation for a detailed description. */ char *get_menu_options( char *action, Window w, FvwmWindow *fw, XEvent *e, MenuRoot *mr, MenuItem *mi, MenuOptions *pops) { char *tok = NULL; char *naction = action; char *taction; int x; int y; int button; int width; int height; int dummy_int; float dummy_float; Bool dummy_flag; Window context_window = None; Bool fHasContext, fUseItemOffset, fRectangleContext, fXineramaRoot; Bool fValidPosHints = last_saved_pos_hints.flags.is_last_menu_pos_hints_valid; Bool is_action_empty = False; Bool once_more = True; Bool is_icon_context; rectangle icon_g; /* If this is set we may want to reverse the position hints, so don't * sum up the totals right now. This is useful for the SubmenusLeft * style. */ fXineramaRoot = False; last_saved_pos_hints.flags.is_last_menu_pos_hints_valid = False; if (pops == NULL) { fvwm_msg(ERR, "get_menu_options","no MenuOptions pointer passed"); return action; } taction = action; memset(&(pops->flags), 0, sizeof(pops->flags)); pops->flags.has_poshints = 0; if (!action || *action == 0) { is_action_empty = True; } while (action != NULL && *action != 0 && once_more) { /* ^ just to be able to jump to end of loop without 'goto' */ pops->pos_hints.is_relative = False; pops->pos_hints.menu_width = 0; pops->pos_hints.is_menu_relative = False; /* parse context argument (if present) */ naction = GetNextToken(taction, &tok); if (!tok) { /* no context string */ fHasContext = False; is_action_empty = True; break; } /* set to False for absolute hints! */ pops->pos_hints.is_relative = True; fUseItemOffset = False; fHasContext = True; fRectangleContext = False; is_icon_context = False; if (StrEquals(tok, "context")) { if (mi && mr) { context_window = MR_WINDOW(mr); } else if (fw) { if (IS_ICONIFIED(fw)) { is_icon_context = True; get_icon_geometry(fw, &icon_g); context_window = None; } else { context_window = FW_W_FRAME(fw); } } else { context_window = w; } } else if (StrEquals(tok,"menu")) { if (mr) { context_window = MR_WINDOW(mr); pops->pos_hints.is_menu_relative = True; pops->pos_hints.menu_width = MR_WIDTH(mr); } } else if (StrEquals(tok,"item")) { if (mi && mr) { context_window = MR_WINDOW(mr); fUseItemOffset = True; pops->pos_hints.is_menu_relative = True; pops->pos_hints.menu_width = MR_WIDTH(mr); } } else if (StrEquals(tok,"icon")) { if (fw && IS_ICONIFIED(fw)) { is_icon_context = True; get_icon_geometry(fw, &icon_g); context_window = None; } } else if (StrEquals(tok,"window")) { if (fw && !IS_ICONIFIED(fw)) { context_window = FW_W_FRAME(fw); } } else if (StrEquals(tok,"interior")) { if (fw && !IS_ICONIFIED(fw)) { context_window = FW_W(fw); } } else if (StrEquals(tok,"title")) { if (fw) { if (IS_ICONIFIED(fw)) { context_window = FW_W_ICON_TITLE(fw); } else { context_window = FW_W_TITLE(fw); } } } else if (strncasecmp(tok,"button",6) == 0) { if (sscanf(&(tok[6]),"%d",&button) != 1 || tok[6] == '+' || tok[6] == '-' || button < 0 || button > 9) { fHasContext = False; } else if (fw && !IS_ICONIFIED(fw)) { button = BUTTON_INDEX(button); context_window = FW_W_BUTTON(fw, button); } } else if (StrEquals(tok,"root")) { context_window = Scr.Root; pops->pos_hints.is_relative = False; } else if (StrEquals(tok,"xineramaroot")) { context_window = Scr.Root; pops->pos_hints.is_relative = False; fXineramaRoot = True; } else if (StrEquals(tok,"mouse")) { context_window = None; } else if (StrEquals(tok,"rectangle")) { int flags; int screen; int sx; int sy; int sw; int sh; /* parse the rectangle */ free(tok); naction = GetNextToken(naction, &tok); if (tok == NULL) { fvwm_msg(ERR, "get_menu_options", "missing rectangle geometry"); if (!pops->pos_hints.has_screen_origin) { /* xinerama: emergency fallback */ pops->pos_hints.has_screen_origin = 1; pops->pos_hints.screen_origin_x = 0; pops->pos_hints.screen_origin_y = 0; } return action; } flags = FScreenParseGeometryWithScreen( tok, &x, &y, (unsigned int*)&width, (unsigned int*)&height, &screen); if ((flags & (XValue | YValue)) != (XValue | YValue)) { free(tok); fvwm_msg(ERR, "get_menu_options", "invalid rectangle geometry"); if (!pops->pos_hints.has_screen_origin) { /* xinerama: emergency fallback */ pops->pos_hints.has_screen_origin = 1; pops->pos_hints.screen_origin_x = 0; pops->pos_hints.screen_origin_y = 0; } return action; } pops->pos_hints.has_screen_origin = 1; FScreenGetScrRect(NULL, screen, &sx, &sy, &sw, &sh); pops->pos_hints.screen_origin_x = sx; pops->pos_hints.screen_origin_y = sy; if (!(flags & WidthValue)) { width = 1; } if (!(flags & HeightValue)) { height = 1; } x += sx; y += sy; if (flags & XNegative) { x = sx + sw - x - width; } if (flags & YNegative) { y = sy + sh - y - height; } pops->pos_hints.is_relative = False; fRectangleContext = True; } else if (StrEquals(tok,"this")) { MenuRoot *dummy_mr; context_window = w; if (XFindContext( dpy, w, MenuContext, (caddr_t *)&dummy_mr) != XCNOENT) { if (mr) { /* the parent menu */ pops->pos_hints.is_menu_relative = True; pops->pos_hints.menu_width = MR_WIDTH(mr); } } } else { /* no context string */ fHasContext = False; } if (tok) { free(tok); } if (fHasContext) { taction = naction; } else { naction = action; } if (fRectangleContext) { if (!pops->pos_hints.has_screen_origin) { /* xinerama: use global screen as reference */ pops->pos_hints.has_screen_origin = 1; pops->pos_hints.screen_origin_x = -1; pops->pos_hints.screen_origin_y = -1; } /* nothing else to do */ } else if (!is_icon_context && (!fHasContext || !context_window || !XGetGeometry( dpy, context_window, &JunkRoot, &JunkX, &JunkY, (unsigned int*)&width, (unsigned int*)&height, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth) || !XTranslateCoordinates( dpy, context_window, Scr.Root, 0, 0, &x, &y, &JunkChild))) { /* no window or could not get geometry */ if (FQueryPointer( dpy,Scr.Root, &JunkRoot, &JunkChild, &x, &y, &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen - that's * okay here */ x = 0; y = 0; } width = height = 1; if (!pops->pos_hints.has_screen_origin) { /* xinerama: use screen with pinter as * reference */ pops->pos_hints.has_screen_origin = 1; pops->pos_hints.screen_origin_x = x; pops->pos_hints.screen_origin_y = y; } } else { if (is_icon_context) { x = icon_g.x; y = icon_g.y; width = icon_g.width; height = icon_g.height; } /* we have a context window */ if (fUseItemOffset) { y += MI_Y_OFFSET(mi); height = MI_HEIGHT(mi); } if (!pops->pos_hints.has_screen_origin) { pops->pos_hints.has_screen_origin = 1; if (fXineramaRoot) { /* use whole screen */ pops->pos_hints.screen_origin_x = -1; pops->pos_hints.screen_origin_y = -1; } else if (context_window == Scr.Root) { /* xinerama: use screen that contains * the window center as reference */ if (!fev_get_evpos_or_query( dpy, context_window, e, &pops->pos_hints. screen_origin_x, &pops->pos_hints. screen_origin_y)) { pops->pos_hints. screen_origin_x = 0; pops->pos_hints. screen_origin_y = 0; } else { fscreen_scr_arg fscr; fscr.xypos.x = pops->pos_hints. screen_origin_x; fscr.xypos.y = pops->pos_hints. screen_origin_y; FScreenGetScrRect( &fscr, FSCREEN_XYPOS, &x, &y, &width, &height); } } else { /* xinerama: use screen that contains * the window center as reference */ pops->pos_hints.screen_origin_x = JunkX + width / 2; pops->pos_hints.screen_origin_y = JunkY + height / 2; } } } /* parse position arguments */ taction = get_one_menu_position_argument( naction, x, width, &(pops->pos_hints.x), &(pops->pos_hints.x_offset), &(pops->pos_hints.x_factor), &(pops->pos_hints.context_x_factor), &pops->pos_hints.is_menu_relative); if (pops->pos_hints.is_menu_relative) { pops->pos_hints.x = x; if (pops->pos_hints.menu_width == 0 && mr) { pops->pos_hints.menu_width = MR_WIDTH(mr); } } naction = get_one_menu_position_argument( taction, y, height, &(pops->pos_hints.y), &dummy_int, &(pops->pos_hints.y_factor), &dummy_float, &dummy_flag); if (naction == taction) { /* argument is missing or invalid */ if (fHasContext) { fvwm_msg(ERR, "get_menu_options", "invalid position arguments"); } naction = action; taction = action; break; } taction = naction; pops->flags.has_poshints = 1; if (fValidPosHints == True && pops->pos_hints.is_relative == True) { pops->pos_hints = last_saved_pos_hints.pos_hints; } /* we want to do this only once */ once_more = False; } /* while */ if (is_action_empty) { if (!pops->pos_hints.has_screen_origin) { pops->pos_hints.has_screen_origin = 1; if (!fev_get_evpos_or_query( dpy, Scr.Root, e, &pops->pos_hints.screen_origin_x, &pops->pos_hints.screen_origin_y)) { pops->pos_hints.screen_origin_x = 0; pops->pos_hints.screen_origin_y = 0; } } } if (!pops->flags.has_poshints && fValidPosHints) { pops->flags.has_poshints = 1; pops->pos_hints = last_saved_pos_hints.pos_hints; pops->pos_hints.is_relative = False; } action = naction; /* to keep Purify silent */ pops->flags.do_select_in_place = 0; /* parse additional options */ while (naction && *naction) { naction = GetNextToken(action, &tok); if (!tok) { break; } if (StrEquals(tok, "WarpTitle")) { pops->flags.do_warp_title = 1; pops->flags.do_not_warp = 0; } else if (StrEquals(tok, "NoWarp")) { pops->flags.do_warp_title = 0; pops->flags.do_not_warp = 1; } else if (StrEquals(tok, "Fixed")) { pops->flags.is_fixed = 1; } else if (StrEquals(tok, "SelectInPlace")) { pops->flags.do_select_in_place = 1; } else if (StrEquals(tok, "SelectWarp")) { pops->flags.do_warp_on_select = 1; } else if (StrEquals(tok, "TearOffImmediately")) { pops->flags.do_tear_off_immediately = 1; } else { free (tok); break; } action = naction; free (tok); } if (!pops->flags.do_select_in_place) { pops->flags.do_warp_on_select = 0; } return action; } /* ---------------------------- new menu loop code ------------------------- */ #if 0 /*!!!*/ typedef enum { MTR_XEVENT = 0x1, MTR_FAKE_ENTER_ITEM = 0x2, MTR_PROPAGATE_XEVENT_UP = 0x4, MTR_PROPAGATE_XEVENT_DOWN = 0x8, MTR_POPUP_TIMEOUT = 0x10, MTR_POPDOWN_TIMEOUT = 0x20 } mloop_trigger_type_t; typedef_struct { mloop_trigger_type_t type; XEvent trigger_ev; int ticks_passed; } mloop_trigger_t; typedef_struct { int popup_10ms; int popdown_10ms; } mloop_timeouts_t; typedef struct { MenuRoot *current_menu; XEvent *in_ev; struct { unsigned do_fake_enter_item : 1; unsigned do_propagete_event_up : 1; unsigned do_propagete_event_down : 1; } flags; } mloop_get_trigger_input_t; /*!!!static*/ mloop_trigger_type_t __mloop_get_trigger( mloop_trigger_t *ret_trigger, mloop_timeouts_t *io_timeouts, const mloop_get_trigger_input_t * const in, { if (in_out->in_flags->do_propagate_event_down) { return MTR_PROPAGATE_XEVENT_DOWN; } else if (in_out->in_flags->do_propagate_event_up) { if (a != b) { return MTR_PROPAGATE_XEVENT_UP; } else { } /*!!!return propagate up*/ /*!!!*/ } /*!!!read event or wait for timeout*/ while (0/*!!!not finished*/) { /*!!!rc = 0*/ if (0/*!!!wait for tiomeout*/) { /*!!!check for event*/ } else { /*!!!block for event*/ } if (0/*got event*/) { /*!!!rc = MTR_XEVENT*/ } if (0/*!!!popup timed out;break*/) { /*!!!rc = MTR_POPUP;break*/ } if (0/*!!!popdown timed out;break*/) { /*!!!rc = MTR_POPDOWN;break*/ } /*!!!sleep*/ } if (0/*!!!rc == MTR_XEVENT && evtype == MotionNotify*/) { /*!!!eat up further MotionNotify events*/ } return 0/*!!!rc*/; } /*!!!static*/ void __menu_loop_new( MenuParameters *pmp, MenuReturn *pmret, double_keypress *pdkp) { mloop_evh_input_t mei; #if 0 mloop_ret_code_t mloop_ret; #endif mloop_evh_data_t med; mloop_static_info_t msi; MenuOptions mops; Bool is_finished; /*!!!init menu loop*/ __mloop_init(pmp, pmret, &mei, &med, &msi, &mops); for (is_finished = False; !is_finished; ) { mloop_trigger_type_t mtr; mtr = __mloop_get_trigger( pmp, pmret, &mei, &med, &msi); switch (mtr) { case MTR_XEVENT: /*!!!handle event*/ break; case MTR_FAKE_ENTER_ITEM: /*!!!fake enter item*/ break; case MTR_PROPAGATE_XEVENT_UP: /*!!!handle propagation*/ break; case MTR_PROPAGATE_XEVENT_DOWN: /*!!!handle propagation*/ break; case MTR_POPUP_TIMEOUT: /*!!!handle popup*/ break; case MTR_POPDOWN_TIMEOUT: /*!!!handle popdown*/ break; } #if 0 mloop_ret = __mloop_handle_event( pmp, pmret, pdkp, &mei, &med, &msi); switch (mloop_ret) { case MENU_MLOOP_RET_LOOP: continue; case MENU_MLOOP_RET_END: is_finished = True; break; default: break; } /* Now handle new menu items, whether it is from a * keypress or a pointer motion event. */ if (med.mi != NULL) { mloop_ret = __mloop_handle_action_with_mi( pmp, pmret, pdkp, &mei, &med, &msi, &mops); } else { mloop_ret = __mloop_handle_action_without_mi( pmp, pmret, pdkp, &mei, &med, &msi, &mops); } if (mloop_ret == MENU_MLOOP_RET_END) { is_finished = True; } XFlush(dpy); #endif } __mloop_exit(pmp, pmret, pdkp, &mei, &med, &msi, &mops); return; } #endif fvwm-2.6.5.orig/fvwm/move_resize.h0000644000175000017500000000231510561452201015276 0ustar vwcvwc/* -*-c-*- */ #ifndef _MOVE_RESIZE_ #define _MOVE_RESIZE_ struct MenuRepaintTransparentParameters; void switch_move_resize_grid(Bool state); void AnimatedMoveOfWindow( Window w,int startX,int startY,int endX, int endY,Bool fWarpPointerToo, int cusDelay, float *ppctMovement, struct MenuRepaintTransparentParameters *pmrtp); void AnimatedMoveFvwmWindow( FvwmWindow *fw, Window w, int startX, int startY, int endX, int endY, Bool fWarpPointerToo, int cmsDelay, float *ppctMovement); Bool __move_loop( const exec_context_t *exc, int XOffset, int YOffset, int Width, int Height, int *FinalX, int *FinalY, Bool do_move_opaque, int cursor); int is_window_sticky_across_pages(FvwmWindow *fw); int is_window_sticky_across_desks(FvwmWindow *fw); void handle_stick( F_CMD_ARGS, int toggle_page, int toggle_desk, int do_not_draw, int do_silently); void resize_geometry_window(void); void __move_icon( FvwmWindow *fw, int x, int y, int old_x, int old_y, Bool do_move_animated, Bool do_warp_pointer); int placement_binding(int button,KeySym keysym,int modifier,char *action); int GetMoveArguments( char **paction, int w, int h, int *pFinalX, int *pFinalY, Bool *fWarp, Bool *fPointer, Bool fKeep); #endif /* _MOVE_RESIZE_ */ fvwm-2.6.5.orig/fvwm/icons.h0000644000175000017500000000157707677641663014125 0ustar vwcvwc/* -*-c-*- */ #ifndef _ICONS_ #define _ICONS_ #ifdef NO_ICONS #define ICON_HEIGHT(t) 1 #else #define ICON_HEIGHT(t) \ ((t)->icon_font->height + 2*abs((t)->icon_title_relief)) #endif int get_visible_icon_window_count(FvwmWindow *fw); void clear_icon(FvwmWindow *fw); void setup_icon_title_size(FvwmWindow *fw); void GetIconPicture(FvwmWindow *fw, Bool no_icon_window); void AutoPlaceIcon( FvwmWindow *t, initial_window_options_t *win_opts, Bool do_move_immediately); void ChangeIconPixmap(FvwmWindow *fw); void RedoIconName(FvwmWindow *fw); void DrawIconWindow( FvwmWindow *fw, Bool draw_title, Bool draw_pixmap, Bool focus_change, Bool reset_bg, XEvent *pev); void CreateIconWindow(FvwmWindow *fw, int def_x, int def_y); void Iconify(FvwmWindow *fw, initial_window_options_t *win_opts); void DeIconify(FvwmWindow *); void SetMapStateProp(const FvwmWindow *, int); #endif /* _ICONS_ */ fvwm-2.6.5.orig/fvwm/stack.h0000644000175000017500000000325710630540746014073 0ustar vwcvwc/* -*-c-*- */ #ifndef _STACK_H #define _STACK_H #define DEBUG_STACK_RING 1 #ifdef DEBUG_STACK_RING void verify_stack_ring_consistency(void); #endif void remove_window_from_stack_ring(FvwmWindow *t); void add_window_to_stack_ring_after(FvwmWindow *t, FvwmWindow *add_after_win); FvwmWindow *get_next_window_in_stack_ring(const FvwmWindow *t); FvwmWindow *get_prev_window_in_stack_ring(const FvwmWindow *t); FvwmWindow *get_transientfor_fvwmwindow(const FvwmWindow *t); Bool position_new_window_in_stack_ring(FvwmWindow *t, Bool do_lower); void RaiseWindow(FvwmWindow *t, Bool is_client_request); void LowerWindow(FvwmWindow *t, Bool is_client_request); Bool HandleUnusualStackmodes( unsigned int stack_mode, FvwmWindow *r, Window rw, FvwmWindow *sib, Window sibw); void BroadcastRestackAllWindows(void); void BroadcastRestackThisWindow(FvwmWindow *t); int compare_window_layers(FvwmWindow *t, FvwmWindow *s); void set_default_layer(FvwmWindow *t, int layer); void set_layer(FvwmWindow *t, int layer); int get_layer(FvwmWindow *t); void new_layer(FvwmWindow *t, int layer); void init_stack_and_layers(void); Bool is_on_top_of_layer(FvwmWindow *t); Bool is_on_top_of_layer_and_above_unmanaged(FvwmWindow *t); /* This function recursively finds the transients of the window t and sets * their is_in_transient_subtree flag. If a layer is given, only windows in * this layer are checked. If the layer is < 0, all windows are considered. */ #define MARK_RAISE 0 #define MARK_LOWER 1 #define MARK_RESTACK 2 #define MARK_ALL 3 #define MARK_ALL_LAYERS -1 void mark_transient_subtree( FvwmWindow *t, int layer, int mark_mode, Bool do_ignore_icons, Bool use_window_group_hint); #endif /* _STACK_H */ fvwm-2.6.5.orig/fvwm/Makefile.am0000644000175000017500000000454611705516565014661 0ustar vwcvwc## Process this file with automake to create Makefile.in configdir = @FVWM_DATADIR@ bin_PROGRAMS = fvwm EXTRA_DIST = $(config_DATA) config_DATA = ConfigFvwmDefaults ConfigFvwmSetup ## please keep .c file in largest first order to speed up parallel makes fvwm_SOURCES = \ add_window.h bindings.h borders.h builtins.h colormaps.h colorset.h \ commands.h conditional.h condrc.h cursor.h decorations.h events.h \ eventhandler.h eventmask.h ewmh.h ewmh_intern.h expand.h externs.h \ focus.h functable.h functions.h fvwm.h geometry.h focus_policy.h \ gnome.h icccm2.h icons.h menubindings.h menudim.h menugeometry.h \ menuitem.h menuroot.h menuparameters.h menus.h menustyle.h misc.h \ modconf.h module_interface.h module_list.h move_resize.h \ placement.h read.h repeat.h execcontext.h schedule.h screen.h \ session.h stack.h style.h update.h virtual.h window_flags.h frame.h \ infostore.h \ \ menus.c style.c borders.c events.c move_resize.c builtins.c \ add_window.c icons.c fvwm.c frame.c placement.c virtual.c \ menustyle.c conditional.c ewmh.c stack.c session.c colorset.c \ functions.c ewmh_events.c gnome.c geometry.c module_list.c focus.c \ windowlist.c functable.c menuitem.c expand.c module_interface.c \ menubindings.c decorations.c ewmh_icons.c update.c bindings.c misc.c \ cursor.c colormaps.c modconf.c ewmh_conf.c read.c schedule.c \ menucmd.c ewmh_names.c icccm2.c windowshade.c focus_policy.c repeat.c \ execcontext.c menugeometry.c menudim.c condrc.c infostore.c fvwm_DEPENDENCIES = $(top_builddir)/libs/libfvwm.a LDADD = \ -L$(top_builddir)/libs -lfvwm $(Xft_LIBS) $(X_LIBS) $(xpm_LIBS) \ $(stroke_LIBS) $(X_PRE_LIBS) $(Xinerama_LIBS) -lXext -lX11 \ $(X_EXTRA_LIBS) -lm $(iconv_LIBS) $(Xrender_LIBS) $(Xcursor_LIBS) \ $(Bidi_LIBS) $(png_LIBS) $(rsvg_LIBS) $(intl_LIBS) INCLUDES = \ -I$(top_srcdir) $(stroke_CFLAGS) $(Xft_CFLAGS) \ $(xpm_CFLAGS) $(X_CFLAGS) $(iconv_CFLAGS) $(Xrender_CFLAGS) \ $(Bidi_CFLAGS) $(png_CFLAGS) $(rsvg_CFLAGS) $(intl_CFLAGS) AM_CFLAGS = \ -DFVWM_MODULEDIR=\"$(FVWM_MODULEDIR)\" \ -DFVWM_DATADIR=\"$(FVWM_DATADIR)\" \ -DFVWM_CONFDIR=\"$(FVWM_CONFDIR)\" \ -DFVWM_COLORSET_PRIVATE=1 \ -DLOCALEDIR=\"$(LOCALEDIR)\" ## Create compatibility symlinks if available install-exec-local: @rm -f $(DESTDIR)$(bindir)/fvwm2 @$(LN_S) fvwm $(DESTDIR)$(bindir)/fvwm2 || \ echo "Minor warning: $(bindir)/fvwm2 symlink was not created" fvwm-2.6.5.orig/fvwm/icccm2.h0000644000175000017500000000040107677641663014133 0ustar vwcvwc/* -*-c-*- */ #ifndef ICCCM2_h #define ICCCM2_h extern void SetupICCCM2(Bool replace_wm); extern void CloseICCCM2(void); extern void icccm2_handle_selection_request(const XEvent *e); extern void icccm2_handle_selection_clear(void); #endif /* ICCCM2_H */ fvwm-2.6.5.orig/fvwm/gnome.h0000644000175000017500000000320710656151547014073 0ustar vwcvwc/* -*-c-*- */ /* * GNOME WM Compliance adapted for fvwm * Properties set on the root window (or desktop window) * * Even though the rest of fvwm is GPL consider this file * Public Domain - use it however you see fit to make * your WM GNOME compiant * * written by Raster * adapted for fvwm by Jay Painter */ #ifndef GNOME_H #define GNOME_H /* GNOME window manager hints support */ /* initalization */ void GNOME_Init(void); /* client messages; setting hints on a window comes through this mechanism */ int GNOME_ProcessClientMessage(const exec_context_t *exc); /* hook into config functions */ void GNOME_ButtonFunc( XEvent *eventp, Window w, FvwmWindow *fwin, unsigned long context, char *action, int *Module); void GNOME_ProxyButtonEvent(const XEvent *ev); void GNOME_ShowDesks( XEvent *eventp, Window w, FvwmWindow *fwin, unsigned long context, char *action, int *Module); /* get hints on a window; sets parameters in a FvwmWindow */ void GNOME_GetHints(FvwmWindow *fwin); /* get hints on a window, set parameters in style */ void GNOME_GetStyle(FvwmWindow *fwin, window_style *style); /* set hints on a window from parameters in FvwmWindow */ void GNOME_SetHints(FvwmWindow *fwin); void GNOME_SetLayer(FvwmWindow *fwin); void GNOME_SetDesk(FvwmWindow *fwin); void GNOME_SetWinArea(FvwmWindow *w); void GNOME_HandlePropRequest( const exec_context_t *exc, unsigned int propm, unsigned int prop); /* update public window manager information */ void GNOME_SetAreaCount(void); void GNOME_SetDeskCount(void); void GNOME_SetCurrentArea(void); void GNOME_SetCurrentDesk(void); void GNOME_SetClientList(void); #endif /* GNOME_H */ fvwm-2.6.5.orig/fvwm/menuitem.h0000644000175000017500000001060310552172642014601 0ustar vwcvwc/* -*-c-*- */ #ifndef MENUITEM_H #define MENUITEM_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ #define MI_NEXT_ITEM(i) ((i)->next) #define MI_PREV_ITEM(i) ((i)->prev) #define MI_LABEL(i) ((i)->label) #define MI_LABEL_OFFSET(i) ((i)->label_offset) #define MI_LABEL_STRLEN(i) ((i)->label_strlen) #define MI_PICTURE(i) ((i)->picture) #define MI_MINI_ICON(i) ((i)->lpicture) #define MI_Y_OFFSET(i) ((i)->y_offset) #define MI_HEIGHT(i) ((i)->height) #define MI_ACTION(i) ((i)->action) #define MI_FUNC_TYPE(i) ((i)->func_type) #define MI_HOTKEY_COFFSET(i) ((i)->hotkey_coffset) #define MI_HOTKEY_COLUMN(i) ((i)->hotkey_column) /* flags */ #define MI_IS_SEPARATOR(i) ((i)->flags.is_separator) #define MI_IS_TEAR_OFF_BAR(i) ((i)->flags.is_tear_off_bar) #define MI_IS_TITLE(i) ((i)->flags.is_title) #define MI_IS_TITLE_CENTERED(i) ((i)->flags.is_title_centered) #define MI_IS_POPUP(i) ((i)->flags.is_popup) #define MI_IS_MENU(i) ((i)->flags.is_menu) #define MI_IS_CONTINUATION(i) ((i)->flags.is_continuation) #define MI_HAS_TEXT(i) ((i)->flags.has_text) #define MI_HAS_PICTURE(i) ((i)->flags.has_picture) #define MI_HAS_HOTKEY(i) ((i)->flags.has_hotkey) #define MI_IS_HOTKEY_AUTOMATIC(i) ((i)->flags.is_hotkey_automatic) #define MI_IS_SELECTABLE(i) ((i)->flags.is_selectable) /* temporary flags */ #define MI_WAS_DESELECTED(i) ((i)->flags.was_deselected) /* ---------------------------- forward declarations ----------------------- */ struct MenuStyle; /* ---------------------------- type definitions --------------------------- */ /* IMPORTANT NOTE: Don't put members into this struct that can change while the * menu is visible! This will wreak havoc on recursive menus. */ typedef struct MenuItem { /* next and prev menu items */ struct MenuItem *next; struct MenuItem *prev; /* the strings displayed in the item */ char *label[MAX_MENU_ITEM_LABELS]; /* witdh of label[i] */ int label_offset[MAX_MENU_ITEM_LABELS]; /* strlen(label[i]) */ int label_strlen[MAX_MENU_ITEM_LABELS]; /* Pixmap to show above label*/ FvwmPicture *picture; /* Pics to show left/right of label */ FvwmPicture *lpicture[MAX_MENU_ITEM_MINI_ICONS]; /* y offset and height for item */ int y_offset; int height; /* action to be performed */ char *action; /* type of built in function */ short func_type; /* Hot key offset (pete@tecc.co.uk). */ int hotkey_coffset; /* The column number the hotkey is defined in*/ char hotkey_column; struct { unsigned is_continuation : 1; unsigned is_separator : 1; unsigned is_tear_off_bar : 1; unsigned is_title : 1; unsigned is_title_centered : 1; unsigned is_popup : 1; unsigned is_menu : 1; unsigned has_text : 1; unsigned has_picture : 1; unsigned has_hotkey : 1; unsigned is_hotkey_automatic : 1; unsigned is_selectable : 1; /* temporary flags */ unsigned was_deselected : 1; } flags; } MenuItem; typedef struct MenuItemPartSizesT { int label_width[MAX_MENU_ITEM_LABELS]; int icon_width[MAX_MENU_ITEM_MINI_ICONS]; int picture_width; int triangle_width; int title_width; } MenuItemPartSizesT; typedef struct MenuPaintItemParameters { struct MenuStyle *ms; Window w; struct MenuItem *selected_item; struct MenuDimensions *dim; FvwmWindow *fw; XEvent *ev; int used_mini_icons; struct MenuRoot *cb_mr; /* number of item labels present in the item format */ Bool (*cb_reset_bg)(struct MenuRoot *mr, XEvent *pevent); struct { unsigned is_first_item : 1; unsigned is_left_triangle : 1; } flags; } MenuPaintItemParameters; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ struct MenuItem *menuitem_clone(struct MenuItem *mi); struct MenuItem *menuitem_create(void); void menuitem_free(struct MenuItem *mi); void menuitem_get_size( struct MenuItem *mi, struct MenuItemPartSizesT *mipst, FlocaleFont *font, Bool do_reverse_icon_order); void menuitem_paint( struct MenuItem *mi, struct MenuPaintItemParameters *mpip); int menuitem_middle_y_offset(struct MenuItem *mi, struct MenuStyle *ms); #endif /* MENUITEM_H */ fvwm-2.6.5.orig/fvwm/menubindings.h0000644000175000017500000000525410721523646015450 0ustar vwcvwc/* -*-c-*- */ #ifndef MENU_BINDINGS_H #define MENU_BINDINGS_H /* ---------------------------- included header files ---------------------- */ /* Do not #include any files - the file including this file has to take care of * it. */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- forward declarations ----------------------- */ struct MenuRoot; struct MenuParameters; struct MenuReturn; struct MenuItem; /* ---------------------------- type definitions --------------------------- */ typedef struct { unsigned int keystate; unsigned int keycode; Time timestamp; } double_keypress; typedef enum { SA_NONE = 0, SA_ENTER, SA_LEAVE, SA_MOVE_ITEMS, SA_FIRST, SA_LAST, SA_CONTINUE, SA_WARPBACK, SA_SELECT, SA_TEAROFF, SA_ABORT, SA_SCROLL, SA_EXEC_CMD } menu_shortcut_action; /* ---------------------------- exported variables (globals) --------------- */ /* Do not use global variable. Full stop. */ /* ---------------------------- interface functions ------------------------ */ /* Before this function is called, all menu bindings created through * menu_binding() are permanent i.e. they can not be deleted (although * overridden). After calling it, new bindings are stored in the regular list * and can be deleted by the user as usual. * * To be called by SetRCDefaults *only*. */ void menu_bindings_startup_complete(void); /* Parse a menu binding and store it. * * To be called from bindings.c *only*. */ int menu_binding( Display *dpy, binding_t type, int button, KeySym keysym, int context, int modifier, char *action, char *menu_style); /* Checks if the given mouse or keyboard event in the given context * corresponds to a menu binding. If so, the binding is returned. Otherwise * NULL is returned. * * To be called from menus.c *only*. */ Binding *menu_binding_is_mouse(XEvent* event, int context); Binding *menu_binding_is_key(XEvent* event, int context); /* Menu keyboard processing * * Function called instead of Keyboard_Shortcuts() * when a KeyPress event is received. If the key is alphanumeric, * then the menu is scanned for a matching hot key. Otherwise if * it was the escape key then the menu processing is aborted. * If none of these conditions are true, then the default processing * routine is called. * TKP - uses XLookupString so that keypad numbers work with windowlist */ void menu_shortcuts( struct MenuRoot *mr, struct MenuParameters *pmp, struct MenuReturn *pmret, XEvent *event, struct MenuItem **pmi_current, double_keypress *pdkp, int *ret_menu_x, int *ret_menu_y); #endif /* MENU_BINDINGS_H */ fvwm-2.6.5.orig/fvwm/icons.c0000644000175000017500000020630710652052253014070 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is mostly all new * by Rob Nation * A little of it is borrowed from ctwm. * Copyright 1993 Robert Nation. No restrictions are placed on this code, * as long as the copyright notice is preserved */ /* * * fvwm icon code * */ #include "config.h" #include #ifdef HAVE_FCNTL_H #include #endif #include "libs/fvwmlib.h" #include "libs/FScreen.h" #include "libs/FShape.h" #include "libs/Parse.h" #include "libs/Picture.h" #include "libs/Graphics.h" #include "libs/PictureGraphics.h" #include "libs/FRenderInit.h" #include "libs/Rectangles.c" #include "libs/charmap.h" #include "libs/wcontext.h" #include "fvwm.h" #include "externs.h" #include "cursor.h" #include "execcontext.h" #include "commands.h" #include "bindings.h" #include "events.h" #include "eventmask.h" #include "eventhandler.h" #include "misc.h" #include "screen.h" #include "icons.h" #include "borders.h" #include "frame.h" #include "focus.h" #include "colormaps.h" #include "stack.h" #include "virtual.h" #include "decorations.h" #include "module_interface.h" #include "gnome.h" #include "ewmh.h" #include "geometry.h" static int do_all_iconboxes(FvwmWindow *t, icon_boxes **icon_boxes_ptr); static void GetIconFromFile(FvwmWindow *fw); static void GetIconWindow(FvwmWindow *fw); static void GetIconBitmap(FvwmWindow *fw); static void clear_icon_dimensions(FvwmWindow *fw) { int px; int py; int tx; int ty; px = fw->icon_g.picture_w_g.x; py = fw->icon_g.picture_w_g.y; tx = fw->icon_g.title_w_g.x; ty = fw->icon_g.title_w_g.y; memset(&fw->icon_g, 0, sizeof(fw->icon_g)); fw->icon_g.picture_w_g.x = px; fw->icon_g.picture_w_g.y = py; fw->icon_g.title_w_g.x = tx; fw->icon_g.title_w_g.y = ty; return; } /* erase all traces of the last used icon in the window structure */ void clear_icon(FvwmWindow *fw) { FW_W_ICON_PIXMAP(fw) = None; fw->iconPixmap = None; fw->icon_maskPixmap = None; fw->icon_alphaPixmap = None; fw->icon_nalloc_pixels = 0; fw->icon_alloc_pixels = NULL; fw->icon_no_limit = 0; if (IS_ICON_MOVED(fw)) { clear_icon_dimensions(fw); } else { memset(&fw->icon_g, 0, sizeof(fw->icon_g)); } return; } int get_visible_icon_window_count(FvwmWindow *fw) { int count = 0; if (fw == NULL || !IS_ICONIFIED(fw) || IS_ICON_SUPPRESSED(fw)) { return 0; } if (FW_W_ICON_PIXMAP(fw) != None) { count++; } if (FW_W_ICON_TITLE(fw) != None) { count++; } return count; } void setup_icon_title_size(FvwmWindow *fw) { if (HAS_NO_ICON_TITLE(fw)) { fw->icon_g.title_text_width = 0; fw->icon_g.title_w_g.width = 0; fw->icon_g.title_w_g.height = 0; } else { fw->icon_g.title_text_width = FlocaleTextWidth( fw->icon_font, fw->visible_icon_name, strlen(fw->visible_icon_name)); fw->icon_g.title_w_g.height = ICON_HEIGHT(fw); if (fw->icon_g.picture_w_g.width == 0) { fw->icon_g.title_w_g.width = fw->icon_g.title_text_width + 2 * (ICON_TITLE_TEXT_GAP_COLLAPSED + abs(fw->icon_title_relief)); if (IS_STICKY_ACROSS_PAGES(fw) || IS_ICON_STICKY_ACROSS_PAGES(fw) || IS_STICKY_ACROSS_DESKS(fw) || IS_ICON_STICKY_ACROSS_DESKS(fw)) { fw->icon_g.title_w_g.width += 2 * (ICON_TITLE_TO_STICK_EXTRA_GAP + ICON_TITLE_STICK_MIN_WIDTH); } } else { fw->icon_g.title_w_g.width = fw->icon_g.picture_w_g.width; } } return; } /* * * Resizes the given icon Pixmap. * */ static void SetIconPixmapSize( Pixmap *icon, int width, int height, int depth, int newWidth, int newHeight, Bool force_centering, int resize_type, int *nrx, int *nry, int freeOldPixmap) { Pixmap oldPixmap; Pixmap resizedPixmap = None; int r_w,r_h; GC gc; XGCValues gc_init; *nrx = 0; *nry = 0; /* Check for invalid dimensions */ if (newWidth == 0 || newHeight == 0) { return; } /* Save the existing Pixmap */ oldPixmap = *icon; gc = XCreateGC(dpy, oldPixmap, 0, &gc_init); switch(resize_type) { case ICON_RESIZE_TYPE_ADJUSTED: if (newWidth != width || newHeight != height) { *icon = CreateStretchPixmap( dpy, oldPixmap, width, height, depth, newWidth, newHeight, gc); } break; case ICON_RESIZE_TYPE_STRETCHED: if (width < newWidth || height < newHeight) { r_w = max(newWidth, width); r_h = max(newHeight, height); resizedPixmap = CreateStretchPixmap( dpy, oldPixmap, width, height, depth, r_w, r_h, gc); width = r_w; height = r_h; } break; case ICON_RESIZE_TYPE_SHRUNK: if (width > newWidth || height > newHeight) { r_w = min(newWidth, width); r_h = min(newHeight, height); resizedPixmap = CreateStretchPixmap( dpy, oldPixmap, width, height, depth, r_w, r_h, gc); width = r_w; height = r_h; } break; default: break; } if (resize_type != ICON_RESIZE_TYPE_ADJUSTED) { *icon = XCreatePixmap( dpy, oldPixmap, newWidth, newHeight, depth); XSetForeground(dpy, gc, 0); XFillRectangle(dpy, *icon, gc, 0, 0, newWidth, newHeight); /* * Copy old Pixmap onto new. Center horizontally. Center * vertically if the new height is smaller than the old. * Otherwise, place the icon on the bottom, along the title bar. */ *nrx = (newWidth - width) / 2; *nry = (newHeight > height && !force_centering) ? newHeight - height : (newHeight - height) / 2; XCopyArea( dpy, (resizedPixmap)? resizedPixmap:oldPixmap, *icon, gc, 0, 0, width, height, *nrx, *nry); } XFreeGC(dpy, gc); if (freeOldPixmap) { XFreePixmap(dpy, oldPixmap); } } /* Move the icon of a window by dx/dy pixels */ /* * * Get the Icon for the icon window (also used by ewmh_icon) * */ void GetIconPicture(FvwmWindow *fw, Bool no_icon_window) { char icon_order[4]; int i; /* First, see if it was specified in the .fvwmrc */ if (ICON_OVERRIDE_MODE(fw) == ICON_OVERRIDE) { /* try fvwm provided icons before application provided icons */ icon_order[0] = 0; icon_order[1] = 1; icon_order[2] = 2; icon_order[3] = 3; ICON_DBG((stderr,"ciw: hint order: file iwh iph '%s'\n", fw->name)); } else if (ICON_OVERRIDE_MODE(fw) == NO_ACTIVE_ICON_OVERRIDE) { if (fw->wmhints && (fw->wmhints->flags & IconPixmapHint) && WAS_ICON_HINT_PROVIDED(fw) == ICON_HINT_MULTIPLE) { /* use application provided icon window or pixmap * first, then fvwm provided icons. */ icon_order[0] = 1; icon_order[1] = 2; icon_order[2] = 3; icon_order[3] = 0; ICON_DBG((stderr,"ciw: hint order: iwh iph file '%s'\n", fw->name)); } else if (Scr.DefaultIcon && fw->icon_bitmap_file == Scr.DefaultIcon) { /* use application provided icon window/pixmap first, * then fvwm provided default icon */ icon_order[0] = 1; icon_order[1] = 2; icon_order[2] = 3; icon_order[3] = 0; ICON_DBG((stderr,"ciw: hint order: iwh iph file '%s'\n", fw->name)); } else { /* use application provided icon window or ewmh icon * first, then fvwm provided icons and then application * provided icon pixmap */ icon_order[0] = 1; icon_order[1] = 2; icon_order[2] = 0; icon_order[3] = 3; ICON_DBG((stderr,"ciw: hint order: iwh file iph '%s'\n", fw->name)); } } else { /* use application provided icon rather than fvwm provided * icon */ icon_order[0] = 1; icon_order[1] = 2; icon_order[2] = 3; icon_order[3] = 0; ICON_DBG((stderr,"ciw: hint order: iwh iph file '%s'\n", fw->name)); } fw->icon_g.picture_w_g.width = 0; fw->icon_g.picture_w_g.height = 0; fw->iconPixmap = None; fw->icon_maskPixmap = None; fw->icon_alphaPixmap= None; FW_W_ICON_PIXMAP(fw) = None; for (i = 0; i < 4 && fw->icon_g.picture_w_g.width == 0 && fw->icon_g.picture_w_g.height == 0; i++) { switch (icon_order[i]) { case 0: /* Next, check for a color pixmap */ if (fw->icon_bitmap_file) { GetIconFromFile(fw); } ICON_DBG((stderr,"ciw: file%s used '%s'\n", (fw->icon_g.picture_w_g.height)?"":" not", fw->name)); break; case 1: /* Next, See if the app supplies its own icon window */ if (no_icon_window) { break; } if (fw->wmhints && (fw->wmhints->flags & IconWindowHint)) { GetIconWindow(fw); } ICON_DBG((stderr,"ciw: iwh%s used '%s'\n", (fw->icon_g.picture_w_g.height)?"":" not",fw->name)); break; case 2: /* try an ewmh icon */ if (HAS_EWMH_WM_ICON_HINT(fw) == EWMH_TRUE_ICON) { if (EWMH_SetIconFromWMIcon(fw, NULL, 0, False)) { SET_USE_EWMH_ICON(fw, True); } } ICON_DBG((stderr,"ciw: inh%s used '%s'\n", (fw->icon_g.picture_w_g.height)?"":" not",fw->name)); break; case 3: /* Finally, try to get icon bitmap from the * application */ if (fw->wmhints && (fw->wmhints->flags & IconPixmapHint)) { GetIconBitmap(fw); } ICON_DBG((stderr,"ciw: iph%s used '%s'\n", (fw->icon_g.picture_w_g.height)?"":" not",fw->name)); break; default: /* can't happen */ break; } } /* Resize icon if necessary */ if ((IS_ICON_OURS(fw)) && fw->icon_g.picture_w_g.height > 0 && fw->icon_g.picture_w_g.height > 0) { int newWidth = fw->icon_g.picture_w_g.width; int newHeight = fw->icon_g.picture_w_g.height; Boolean resize = False; if (newWidth < fw->min_icon_width) { newWidth = fw->min_icon_width; resize = True; } else { if (newWidth > fw->max_icon_width) { newWidth = fw->max_icon_width; resize = True; } } if (newHeight < fw->min_icon_height) { newHeight = fw->min_icon_height; resize = True; } else { if (newHeight > fw->max_icon_height) { newHeight = fw->max_icon_height; resize = True; } } if (resize) { /* Resize the icon Pixmap */ int force_centering = False; int nrx, nry; ICON_DBG((stderr,"ciw: Changing icon (%s) from %dx%d to" " %dx%d\n", fw->name, fw->icon_g.picture_w_g.width, fw->icon_g.picture_w_g.height, newWidth, newHeight)); /* Resize the icon Pixmap */ /* force to center if the icon has a bg */ if (fw->icon_background_cs >= 0 || fw->icon_maskPixmap == None) { force_centering = True; } SetIconPixmapSize( &(fw->iconPixmap), fw->icon_g.picture_w_g.width, fw->icon_g.picture_w_g.height, fw->iconDepth, newWidth, newHeight, force_centering, fw->icon_resize_type, &nrx, &nry, IS_PIXMAP_OURS(fw)); /* Resize the icon mask Pixmap if one was defined */ if (fw->icon_maskPixmap) { SetIconPixmapSize( &(fw->icon_maskPixmap), fw->icon_g.picture_w_g.width, fw->icon_g.picture_w_g.height, 1, newWidth, newHeight, force_centering, fw->icon_resize_type, &nrx, &nry, IS_PIXMAP_OURS(fw)); } else if ((nrx > 0 || nry > 0) && fw->iconDepth > 1) { fw->icon_maskPixmap = XCreatePixmap( dpy, fw->iconPixmap, newWidth, newHeight, 1); XSetForeground(dpy, Scr.MonoGC, 0); XFillRectangle( dpy, fw->icon_maskPixmap, Scr.MonoGC, 0, 0, newWidth, newHeight); XSetForeground(dpy, Scr.MonoGC, 1); XFillRectangle( dpy, fw->icon_maskPixmap, Scr.MonoGC, nrx, nry, fw->icon_g.picture_w_g.width, fw->icon_g.picture_w_g.height); XSetForeground(dpy, Scr.MonoGC, 0); /* set it shaped ? YES */ SET_ICON_SHAPED(fw, 1); } /* Resize the icon alpha Pixmap if one was defined */ if (fw->icon_alphaPixmap) { SetIconPixmapSize( &(fw->icon_alphaPixmap), fw->icon_g.picture_w_g.width, fw->icon_g.picture_w_g.height, FRenderGetAlphaDepth(), newWidth, newHeight, force_centering, fw->icon_resize_type, &nrx, &nry, IS_PIXMAP_OURS(fw)); } /* Set the new dimensions of the icon window */ fw->icon_g.picture_w_g.width = newWidth; fw->icon_g.picture_w_g.height = newHeight; } } return; } /* * * set the icon pixmap window background * */ static void set_icon_pixmap_background(FvwmWindow *fw) { if (fw->iconPixmap != None && (Pdefault || fw->iconDepth == 1 || fw->iconDepth == Pdepth || IS_PIXMAP_OURS(fw))) { if (fw->icon_background_cs >= 0) { SetWindowBackground( dpy, FW_W_ICON_PIXMAP(fw), fw->icon_g.picture_w_g.width, fw->icon_g.picture_w_g.height, &Colorset[fw->icon_background_cs], Pdepth, Scr.StdGC, False); } else if (FShapesSupported && Pdepth == DefaultDepth(dpy, (DefaultScreen(dpy)))) { XSetWindowBackgroundPixmap( dpy, FW_W_ICON_PIXMAP(fw), ParentRelative); } else if (Scr.DefaultColorset >= 0) { SetWindowBackground( dpy, FW_W_ICON_PIXMAP(fw), fw->icon_g.picture_w_g.width, fw->icon_g.picture_w_g.height, &Colorset[Scr.DefaultColorset], Pdepth, Scr.StdGC, False); } } } /* * * Creates an icon window as needed * */ void CreateIconWindow(FvwmWindow *fw, int def_x, int def_y) { /* mask for create windows */ unsigned long valuemask; /* attributes for create windows */ XSetWindowAttributes attributes; XWindowChanges xwc; Window old_icon_pixmap_w; Window old_icon_w; Bool is_old_icon_shaped = IS_ICON_SHAPED(fw); old_icon_w = FW_W_ICON_TITLE(fw); old_icon_pixmap_w = (IS_ICON_OURS(fw)) ? FW_W_ICON_PIXMAP(fw) : None; if (!IS_ICON_OURS(fw) && FW_W_ICON_PIXMAP(fw)) { XUnmapWindow(dpy, FW_W_ICON_PIXMAP(fw)); } SET_ICON_OURS(fw, 1); SET_PIXMAP_OURS(fw, 0); SET_ICON_SHAPED(fw, 0); FW_W_ICON_PIXMAP(fw) = None; fw->iconPixmap = None; fw->iconDepth = 0; if (IS_ICON_SUPPRESSED(fw)) { return; } /* * set up the icon picture */ GetIconPicture(fw, False); /* make space for relief to be drawn outside the icon */ /* this does not happen if fvwm is using a non-default visual (with * private colormap) and the client has supplied a pixmap (not a * bitmap) */ if ((IS_ICON_OURS(fw)) && (fw->icon_g.picture_w_g.height > 0) && (Pdefault || fw->iconDepth == 1 || fw->iconDepth == Pdepth || IS_PIXMAP_OURS(fw))) { fw->icon_g.picture_w_g.width += 2 * abs(fw->icon_background_relief) + 2 * fw->icon_background_padding; fw->icon_g.picture_w_g.height += 2 * abs(fw->icon_background_relief) + 2 * fw->icon_background_padding; } /* * set up the icon title geometry */ setup_icon_title_size(fw); /* * set up icon position */ set_icon_position(fw, def_x, def_y); /* * create the icon title window */ valuemask = CWColormap | CWBorderPixel | CWBackPixel | CWCursor | CWEventMask; attributes.colormap = Pcmap; attributes.background_pixel = Scr.StdBack; attributes.cursor = Scr.FvwmCursors[CRS_DEFAULT]; attributes.border_pixel = 0; attributes.event_mask = XEVMASK_ICONW; if (HAS_NO_ICON_TITLE(fw)) { if (FW_W_ICON_TITLE(fw)) { XDeleteContext(dpy, FW_W_ICON_TITLE(fw), FvwmContext); XDestroyWindow(dpy, FW_W_ICON_TITLE(fw)); XFlush(dpy); FW_W_ICON_TITLE(fw) = None; } } else { if (FW_W_ICON_TITLE(fw) == None) { FW_W_ICON_TITLE(fw) = XCreateWindow( dpy, Scr.Root, fw->icon_g.title_w_g.x, fw->icon_g.title_w_g.y, fw->icon_g.title_w_g.width, fw->icon_g.title_w_g.height, 0, Pdepth, InputOutput, Pvisual, valuemask, &attributes); } else { XMoveResizeWindow( dpy, FW_W_ICON_TITLE(fw), fw->icon_g.title_w_g.x, fw->icon_g.title_w_g.y, fw->icon_g.title_w_g.width, fw->icon_g.title_w_g.height); } } if (Scr.DefaultColorset >= 0) { SetWindowBackground( dpy, FW_W_ICON_TITLE(fw), fw->icon_g.title_w_g.width, fw->icon_g.title_w_g.height, &Colorset[Scr.DefaultColorset], Pdepth, Scr.StdGC, False); } /* * create the icon picture window */ if (IS_ICON_OURS(fw) && fw->icon_g.picture_w_g.width > 0 && fw->icon_g.picture_w_g.height > 0) { /* use fvwm's visuals in these cases */ if (Pdefault || fw->iconDepth == 1 || fw->iconDepth == Pdepth || IS_PIXMAP_OURS(fw)) { if (!old_icon_pixmap_w) { FW_W_ICON_PIXMAP(fw) = XCreateWindow( dpy, Scr.Root, fw->icon_g.picture_w_g.x, fw->icon_g.picture_w_g.y, fw->icon_g.picture_w_g.width, fw->icon_g.picture_w_g.height, 0, Pdepth, InputOutput, Pvisual, valuemask, &attributes); } else { FW_W_ICON_PIXMAP(fw) = old_icon_pixmap_w; XMoveResizeWindow( dpy, FW_W_ICON_PIXMAP(fw), fw->icon_g.picture_w_g.x, fw->icon_g.picture_w_g.y, fw->icon_g.picture_w_g.width, fw->icon_g.picture_w_g.height); } set_icon_pixmap_background(fw); } else { /* client supplied icon pixmap and fvwm is using * another visual. * use it as the background pixmap, don't try to put * relief on it because fvwm will not have the correct * colors the Exceed server has problems maintaining * the icon window, it usually fails to refresh the * icon leaving it black so ask for expose events */ attributes.background_pixmap = fw->iconPixmap; attributes.colormap = DefaultColormap(dpy, Scr.screen); valuemask &= ~CWBackPixel; valuemask |= CWBackPixmap; FW_W_ICON_PIXMAP(fw) = XCreateWindow( dpy, Scr.Root, fw->icon_g.picture_w_g.x, fw->icon_g.picture_w_g.y, fw->icon_g.picture_w_g.width, fw->icon_g.picture_w_g.height, 0, DefaultDepth(dpy, Scr.screen), InputOutput, DefaultVisual(dpy, Scr.screen), valuemask, &attributes); } } else if (FW_W_ICON_PIXMAP(fw) != None) { /* client supplied icon window: select events on it */ attributes.event_mask = XEVMASK_ICONPW; valuemask = CWEventMask; XChangeWindowAttributes( dpy, FW_W_ICON_PIXMAP(fw), valuemask,&attributes); if (!IS_ICON_OURS(fw)) { XMoveWindow( dpy, FW_W_ICON_PIXMAP(fw), fw->icon_g.picture_w_g.x, fw->icon_g.picture_w_g.y); } } if (old_icon_pixmap_w != None && old_icon_pixmap_w != FW_W_ICON_PIXMAP(fw)) { /* destroy the old window */ XDestroyWindow(dpy, old_icon_pixmap_w); XDeleteContext(dpy, old_icon_pixmap_w, FvwmContext); XFlush(dpy); is_old_icon_shaped = False; } if (FShapesSupported) { if (IS_ICON_SHAPED(fw) && fw->icon_background_cs < 0) { /* when fvwm is using the non-default visual client * supplied icon pixmaps are drawn in a window with no * relief */ int off = 0; if (Pdefault || fw->iconDepth == 1 || fw->iconDepth == Pdepth || IS_PIXMAP_OURS(fw)) { off = abs(fw->icon_background_relief) + fw->icon_background_padding; } FShapeCombineMask( dpy, FW_W_ICON_PIXMAP(fw), FShapeBounding, off, off, fw->icon_maskPixmap, FShapeSet); } else if (is_old_icon_shaped && FW_W_ICON_PIXMAP(fw) == old_icon_pixmap_w) { /* remove the shape */ XRectangle r; r.x = 0; r.y = 0; r.width = fw->icon_g.picture_w_g.width; r.height = fw->icon_g.picture_w_g.height; FShapeCombineRectangles( dpy, FW_W_ICON_PIXMAP(fw), FShapeBounding, 0, 0, &r, 1, FShapeSet, 0); } } if (FW_W_ICON_TITLE(fw) != None && FW_W_ICON_TITLE(fw) != old_icon_w) { XSaveContext( dpy, FW_W_ICON_TITLE(fw), FvwmContext, (caddr_t)fw); XDefineCursor( dpy, FW_W_ICON_TITLE(fw), Scr.FvwmCursors[CRS_DEFAULT]); GrabAllWindowKeysAndButtons( dpy, FW_W_ICON_TITLE(fw), Scr.AllBindings, C_ICON, GetUnusedModifiers(), Scr.FvwmCursors[CRS_DEFAULT], True); xwc.sibling = FW_W_FRAME(fw); xwc.stack_mode = Below; XConfigureWindow( dpy, FW_W_ICON_TITLE(fw), CWSibling|CWStackMode, &xwc); } if (FW_W_ICON_PIXMAP(fw) != None && FW_W_ICON_PIXMAP(fw) != old_icon_pixmap_w) { XSaveContext( dpy, FW_W_ICON_PIXMAP(fw), FvwmContext, (caddr_t)fw); XDefineCursor( dpy, FW_W_ICON_PIXMAP(fw), Scr.FvwmCursors[CRS_DEFAULT]); GrabAllWindowKeysAndButtons( dpy, FW_W_ICON_PIXMAP(fw), Scr.AllBindings, C_ICON, GetUnusedModifiers(), Scr.FvwmCursors[CRS_DEFAULT], True); xwc.sibling = FW_W_FRAME(fw); xwc.stack_mode = Below; XConfigureWindow( dpy,FW_W_ICON_PIXMAP(fw),CWSibling|CWStackMode,&xwc); } return; } /* * * Draws the icon window * */ static void DrawIconTitleWindow( FvwmWindow *fw, XEvent *pev, Pixel BackColor, GC Shadow, GC Relief, int cs, int title_cs) { int is_expanded = IS_ICON_ENTERED(fw); FlocaleWinString fstr; Region region = None; XRectangle clip, r; int relief = abs(fw->icon_title_relief); int x_title; int x_title_min = 0; int w_title = fw->icon_g.title_text_width; int x_title_w = fw->icon_g.picture_w_g.x; int w_title_w = fw->icon_g.picture_w_g.width; int x_stipple = relief; int w_title_text_gap = 0; int w_stipple = 0; int is_sticky; int is_stippled; int use_unexpanded_size = 1; Bool draw_string = True; is_sticky = (IS_STICKY_ACROSS_PAGES(fw) || IS_ICON_STICKY_ACROSS_PAGES(fw)); is_sticky |= (IS_STICKY_ACROSS_DESKS(fw) || IS_ICON_STICKY_ACROSS_DESKS(fw)); is_stippled = ((is_sticky && HAS_STICKY_STIPPLED_ICON_TITLE(fw)) || HAS_STIPPLED_ICON_TITLE(fw)); if (is_expanded && FW_W_ICON_PIXMAP(fw) != None) { int sx; int sy; int sw; int sh; use_unexpanded_size = 0; w_title_text_gap = ICON_TITLE_TEXT_GAP_EXPANDED; x_title_min = w_title_text_gap + relief; if (is_stippled) { w_stipple = ICON_TITLE_STICK_MIN_WIDTH; x_title_min += w_stipple + ICON_TITLE_TO_STICK_EXTRA_GAP; } /* resize the icon name window */ w_title_w = w_title + 2 * x_title_min; if (w_title_w <= fw->icon_g.picture_w_g.width) { /* the expanded title is smaller, so do not * expand at all */ is_expanded = 1; w_stipple = 0; use_unexpanded_size = 1; } else { x_title_w = fw->icon_g.picture_w_g.x - (w_title_w - fw->icon_g.picture_w_g.width) / 2; FScreenGetScrRect( NULL, FSCREEN_CURRENT, &sx, &sy, &sw, &sh); /* start keep label on screen. dje 8/7/97 */ if (x_title_w < sx) { /* if new loc neg (off left edge) */ x_title_w = sx; /* move to edge */ } else { /* if not on left edge */ /* if (new loc + width) > screen width * (off edge on right) */ if ((x_title_w + w_title_w) >sx + sw) { /* off right */ /* position up against right * edge */ x_title_w = sx + sw - w_title_w; } /* end keep label on screen. dje * 8/7/97 */ } } } if (use_unexpanded_size) { w_title_text_gap = ICON_TITLE_TEXT_GAP_COLLAPSED; x_title_min = w_title_text_gap + relief; /* resize the icon name window */ if (FW_W_ICON_PIXMAP(fw) != None) { w_title_w = fw->icon_g.picture_w_g.width; x_title_w = fw->icon_g.picture_w_g.x; } else { w_title_w = fw->icon_g.title_w_g.width; x_title_w = fw->icon_g.title_w_g.x; } } if (fw->icon_g.title_w_g.width != w_title_w || fw->icon_g.title_w_g.x != x_title_w || fw->icon_g.title_w_g.height != ICON_HEIGHT(fw)) { fw->icon_g.title_w_g.width = w_title_w; fw->icon_g.title_w_g.x = x_title_w; fw->icon_g.title_w_g.height = ICON_HEIGHT(fw); pev = NULL; /* resize && redraw all */ } if (!pev) { XMoveResizeWindow( dpy, FW_W_ICON_TITLE(fw), fw->icon_g.title_w_g.x, fw->icon_g.title_w_g.y, w_title_w, ICON_HEIGHT(fw)); } if (title_cs >= 0) { SetWindowBackground( dpy, FW_W_ICON_TITLE(fw), w_title_w, ICON_HEIGHT(fw), &Colorset[title_cs], Pdepth, Scr.TitleGC, False); } else { XSetWindowBackground( dpy, FW_W_ICON_TITLE(fw), BackColor); } /* text position */ x_title = (w_title_w - w_title) / 2; if (x_title < x_title_min) x_title = x_title_min; /* text rectangle */ r.x = x_title; r.y = relief; r.width = w_title_w - x_title - relief; r.height = ICON_HEIGHT(fw) - 2*relief; if (is_stippled) { if (w_stipple == 0) { w_stipple = ((w_title_w - 2 * (x_stipple + w_title_text_gap) - w_title) + 1) / 2; } if (w_stipple < ICON_TITLE_STICK_MIN_WIDTH) { w_stipple = ICON_TITLE_STICK_MIN_WIDTH; } if (x_title < x_stipple + w_stipple + w_title_text_gap) { x_title = x_stipple + w_stipple + w_title_text_gap; } r.x = x_title; r.width = w_title_w - 2 * x_title; if (r.width < 1) r.width = 1; } memset(&fstr, 0, sizeof(fstr)); if (pev || is_stippled) { if (pev) { if (!frect_get_intersection( pev->xexpose.x, pev->xexpose.y, pev->xexpose.width, pev->xexpose.height, r.x, r.y, r.width, r.height, &clip)) { draw_string = False; } } else { clip.x = r.x; clip.y = r.y; clip.width = r.width; clip.height = r.height; } if (draw_string) { XSetClipRectangles( dpy, Scr.TitleGC, 0, 0, &clip, 1, Unsorted); region = XCreateRegion(); XUnionRectWithRegion (&clip, region, region); fstr.flags.has_clip_region = True; fstr.clip_region = region; } } if (!pev) { clip.x = relief; clip.y = relief; clip.width = w_title_w - 2*relief; clip.height = ICON_HEIGHT(fw) - 2*relief; XClearWindow(dpy, FW_W_ICON_TITLE(fw)); } else { /* needed for first drawing */ if (x_title - relief >= 1) { /* clear before the text */ XClearArea( dpy, FW_W_ICON_TITLE(fw), relief, relief, x_title - relief, ICON_HEIGHT(fw) - 2*relief, False); } if (is_stippled) { /* clear the stippled area after the text */ XClearArea( dpy, FW_W_ICON_TITLE(fw), w_title_w - x_stipple - w_stipple -1, relief, w_stipple + 2, ICON_HEIGHT(fw) - 2*relief, False); } } if (draw_string) { if (pev) { /* needed by xft font and at first drawing */ XClearArea( dpy, FW_W_ICON_TITLE(fw), clip.x, clip.y, clip.width, clip.height, False); } fstr.str = fw->visible_icon_name; fstr.win = FW_W_ICON_TITLE(fw); fstr.gc = Scr.TitleGC; if (title_cs >= 0) { fstr.colorset = &Colorset[title_cs]; fstr.flags.has_colorset = 1; } else if (cs >= 0) { fstr.colorset = &Colorset[cs]; fstr.flags.has_colorset = 1; } fstr.x = x_title; fstr.y = fw->icon_g.title_w_g.height - relief - fw->icon_font->height + fw->icon_font->ascent; FlocaleDrawString(dpy, fw->icon_font, &fstr, 0); if (pev || is_stippled) { XSetClipMask(dpy, Scr.TitleGC, None); if (region) { XDestroyRegion(region); } } } RelieveRectangle( dpy, FW_W_ICON_TITLE(fw), 0, 0, w_title_w - 1, ICON_HEIGHT(fw) - 1, (fw->icon_title_relief > 0)? Relief:Shadow, (fw->icon_title_relief > 0)? Shadow:Relief, relief); if (is_stippled) { /* an odd number of lines every 4 pixels */ int pseudo_height = ICON_HEIGHT(fw)- 2*relief + 2; int num = (pseudo_height / ICON_TITLE_STICK_VERT_DIST / 2) * 2 - 1; int min = ICON_HEIGHT(fw) / 2 - num * 2 + 1; int max = ICON_HEIGHT(fw) / 2 + num * 2 - ICON_TITLE_STICK_VERT_DIST + 1; int i; for(i = min; w_stipple > 0 && i <= max; i += ICON_TITLE_STICK_VERT_DIST) { RelieveRectangle( dpy, FW_W_ICON_TITLE(fw), x_stipple, i, w_stipple - 1, 1, Shadow, Relief, ICON_TITLE_STICK_HEIGHT); RelieveRectangle( dpy, FW_W_ICON_TITLE(fw), w_title_w - x_stipple - w_stipple, i, w_stipple - 1, 1, Shadow, Relief, ICON_TITLE_STICK_HEIGHT); } } return; } static void DrawIconPixmapWindow( FvwmWindow *fw, Bool reset_bg, XEvent *pev, GC Shadow, GC Relief, int cs) { XRectangle r,clip; Bool cleared = False; if (!pev) { XMoveWindow( dpy, FW_W_ICON_PIXMAP(fw), fw->icon_g.picture_w_g.x, fw->icon_g.picture_w_g.y); if (reset_bg && (fw->iconDepth == 1 || fw->iconDepth == Pdepth || Pdefault || IS_PIXMAP_OURS(fw))) { set_icon_pixmap_background(fw); XClearArea(dpy, FW_W_ICON_PIXMAP(fw), 0, 0, 0, 0, False); cleared = True; } } /* need to locate the icon pixmap */ if (fw->iconPixmap != None) { if (fw->iconDepth == 1 || fw->iconDepth == Pdepth || Pdefault || IS_PIXMAP_OURS(fw)) { FvwmRenderAttributes fra; Bool draw_icon = True; memset(&fra, 0, sizeof(fra)); fra.mask = FRAM_DEST_IS_A_WINDOW; if (cs >= 0) { fra.mask |= FRAM_HAVE_ICON_CSET; fra.colorset = &Colorset[cs]; } r.x = r.y = abs(fw->icon_background_relief) + fw->icon_background_padding; r.width = fw->icon_g.picture_w_g.width - 2 * (abs(fw->icon_background_relief) + fw->icon_background_padding); r.height = fw->icon_g.picture_w_g.height - 2 * (abs(fw->icon_background_relief) + fw->icon_background_padding); if (pev) { if (!frect_get_intersection( pev->xexpose.x, pev->xexpose.y, pev->xexpose.width, pev->xexpose.height, r.x, r.y, r.width, r.height, &clip)) { draw_icon = False; } } else { clip.x = r.x; clip.y = r.y; clip.width = r.width; clip.height = r.height; } if (draw_icon) { if (!cleared && (fw->icon_alphaPixmap || (cs >= 0 && Colorset[cs].icon_alpha_percent < 100))) { XClearArea( dpy, FW_W_ICON_PIXMAP(fw), clip.x, clip.y, clip.width, clip.height, False); } PGraphicsRenderPixmaps( dpy, FW_W_ICON_PIXMAP(fw), fw->iconPixmap, fw->icon_maskPixmap, fw->icon_alphaPixmap, fw->iconDepth, &fra, FW_W_ICON_PIXMAP(fw), Scr.TitleGC, Scr.MonoGC, Scr.AlphaGC, clip.x - r.x, clip.y - r.y, clip.width, clip.height, clip.x, clip.y, clip.width, clip.height, False); } } else { /* it's a client pixmap and fvwm is not using * the root visual The icon window has no 3d * border so copy to (0,0) install the root * colormap temporarily to help the Exceed * server */ if (Scr.bo.do_install_root_cmap) InstallRootColormap(); XCopyArea( dpy, fw->iconPixmap, FW_W_ICON_PIXMAP(fw), DefaultGC(dpy, Scr.screen), 0, 0, fw->icon_g.picture_w_g.width, fw->icon_g.picture_w_g.height, 0, 0); if (Scr.bo.do_install_root_cmap) UninstallRootColormap(); } } /* only relieve unshaped icons or icons with a bg that share fvwm's * visual */ if ((fw->iconPixmap != None) && (!IS_ICON_SHAPED(fw) || fw->icon_background_cs >= 0) && (Pdefault || fw->iconDepth == 1 || fw->iconDepth == Pdepth || IS_PIXMAP_OURS(fw))) { RelieveRectangle( dpy, FW_W_ICON_PIXMAP(fw), 0, 0, fw->icon_g.picture_w_g.width - 1, fw->icon_g.picture_w_g.height - 1, (fw->icon_background_relief > 0)? Relief:Shadow, (fw->icon_background_relief > 0)? Shadow:Relief, abs(fw->icon_background_relief)); } } void DrawIconWindow( FvwmWindow *fw, Bool draw_title, Bool draw_pixmap, Bool focus_change, Bool reset_bg, XEvent *pev) { GC Shadow; GC Relief; Pixel TextColor; Pixel BackColor; color_quad draw_colors; color_quad co_draw_colors; int cs, co_cs; int title_cs = -1; int co_title_cs = -1; int is_expanded = IS_ICON_ENTERED(fw); if (IS_ICON_SUPPRESSED(fw) || (pev && fw->Desk != Scr.CurrentDesk)) { return; } if (Scr.Hilite == fw) { if (fw->icon_title_cs_hi >= 0) { title_cs = fw->icon_title_cs_hi; draw_colors.hilight = Colorset[title_cs].hilite; draw_colors.shadow = Colorset[title_cs].shadow; draw_colors.back = Colorset[title_cs].bg; draw_colors.fore = Colorset[title_cs].fg; } else { draw_colors.hilight = fw->hicolors.hilight; draw_colors.shadow = fw->hicolors.shadow; draw_colors.back = fw->hicolors.back; draw_colors.fore = fw->hicolors.fore; } if (fw->icon_title_cs >= 0) { co_title_cs = fw->icon_title_cs; co_draw_colors.hilight = Colorset[co_title_cs].hilite; co_draw_colors.shadow = Colorset[co_title_cs].shadow; co_draw_colors.back = Colorset[co_title_cs].bg; co_draw_colors.fore = Colorset[co_title_cs].fg; } else { co_draw_colors.hilight = fw->colors.hilight; co_draw_colors.shadow = fw->colors.shadow; co_draw_colors.back = fw->colors.back; co_draw_colors.fore = fw->colors.fore; } cs = fw->cs_hi; co_cs = fw->cs; } else { if (fw->icon_title_cs >= 0) { title_cs = fw->icon_title_cs; draw_colors.hilight = Colorset[title_cs].hilite; draw_colors.shadow = Colorset[title_cs].shadow; draw_colors.back = Colorset[title_cs].bg; draw_colors.fore = Colorset[title_cs].fg; } else { draw_colors.hilight = fw->colors.hilight; draw_colors.shadow = fw->colors.shadow; draw_colors.back = fw->colors.back; draw_colors.fore = fw->colors.fore; } if (fw->icon_title_cs_hi >= 0) { co_title_cs = fw->icon_title_cs_hi; co_draw_colors.hilight = Colorset[co_title_cs].hilite; co_draw_colors.shadow = Colorset[co_title_cs].shadow; co_draw_colors.back = Colorset[co_title_cs].bg; co_draw_colors.fore = Colorset[co_title_cs].fg; } else { co_draw_colors.hilight = fw->hicolors.hilight; co_draw_colors.shadow = fw->hicolors.shadow; co_draw_colors.back = fw->hicolors.back; co_draw_colors.fore = fw->hicolors.fore; } cs = fw->cs; co_cs = fw->cs_hi; } if (Pdepth < 2 && Scr.Hilite != fw) { Relief = Scr.StdReliefGC; Shadow = Scr.StdShadowGC; } else { if (Pdepth < 2 && Scr.Hilite == fw) { Relief = Scr.ScratchGC2; } else { Globalgcv.foreground = draw_colors.hilight; Globalgcm = GCForeground; XChangeGC(dpy,Scr.ScratchGC1,Globalgcm,&Globalgcv); Relief = Scr.ScratchGC1; } Globalgcv.foreground = draw_colors.shadow; XChangeGC(dpy,Scr.ScratchGC2, Globalgcm, &Globalgcv); Shadow = Scr.ScratchGC2; } TextColor = draw_colors.fore; BackColor = draw_colors.back; /* set up TitleGC for drawing the icon label */ if (fw->icon_font != NULL) { NewFontAndColor(fw->icon_font, TextColor, BackColor); } if (draw_title && FW_W_ICON_TITLE(fw) != None) { if (pev && pev->xexpose.window != FW_W_ICON_TITLE(fw)) { XEvent e; if (FCheckTypedWindowEvent( dpy, FW_W_ICON_TITLE(fw), Expose, &e)) { flush_accumulate_expose( FW_W_ICON_TITLE(fw), &e); DrawIconTitleWindow( fw, &e, BackColor, Shadow, Relief, cs, title_cs); } } else { if (!pev) { flush_expose(FW_W_ICON_TITLE(fw)); } DrawIconTitleWindow( fw, pev, BackColor, Shadow, Relief, cs, title_cs); } } if (draw_pixmap) { int bg_cs = fw->icon_background_cs; if (bg_cs >= 0 && (fw->iconDepth != 1 || fw->icon_background_padding > 0 || fw->icon_maskPixmap != None || fw->icon_alphaPixmap != None)) { if (Pdepth < 2 && Scr.Hilite == fw) { Relief = Scr.ScratchGC2; } else { Globalgcv.foreground = Colorset[bg_cs].hilite; Globalgcm = GCForeground; XChangeGC( dpy,Scr.ScratchGC1,Globalgcm,&Globalgcv); Relief = Scr.ScratchGC1; } Globalgcv.foreground = Colorset[bg_cs].shadow; XChangeGC(dpy,Scr.ScratchGC2, Globalgcm, &Globalgcv); Shadow = Scr.ScratchGC2; } } if (focus_change && draw_pixmap) { Bool alpha_change = False; Bool tint_change = False; Bool relief_change = False; Bool color_change = False; draw_pixmap = False; /* check if we have to draw the icons */ if (Pdepth < 2) { relief_change = True; } else if (fw->iconDepth == 1) { color_change = (draw_colors.fore != co_draw_colors.back) || (draw_colors.fore != co_draw_colors.back); } if (!relief_change && (fw->iconPixmap != None) && !IS_ICON_SHAPED(fw) && (Pdefault || fw->iconDepth == Pdepth || fw->iconDepth == 1 || IS_PIXMAP_OURS(fw))) { relief_change = (draw_colors.hilight != co_draw_colors.hilight) || (draw_colors.shadow != co_draw_colors.shadow); } if (cs >= 0 && co_cs >= 0) { alpha_change = (Colorset[cs].icon_alpha_percent != Colorset[co_cs].icon_alpha_percent); tint_change = (Colorset[cs].icon_tint_percent != Colorset[co_cs].icon_tint_percent) || (Colorset[cs].icon_tint_percent > 0 && Colorset[cs].icon_tint != Colorset[co_cs].icon_tint); } else if (cs >= 0 && co_cs < 0) { alpha_change = (Colorset[cs].icon_alpha_percent < 100); tint_change = (Colorset[cs].icon_tint_percent > 0); } else if (cs < 0 && co_cs >= 0) { alpha_change = (Colorset[co_cs].icon_alpha_percent < 100); tint_change = (Colorset[co_cs].icon_tint_percent > 0); } if (alpha_change || tint_change || relief_change || color_change) { draw_pixmap = True; } } if (draw_pixmap && FW_W_ICON_PIXMAP(fw) != None) { if (pev && pev->xexpose.window != FW_W_ICON_PIXMAP(fw)) { XEvent e; if (FCheckTypedWindowEvent( dpy, FW_W_ICON_PIXMAP(fw), Expose, &e)) { flush_accumulate_expose( FW_W_ICON_PIXMAP(fw), &e); DrawIconPixmapWindow( fw, reset_bg, &e, Shadow, Relief, cs); } } else { if (!pev) { flush_expose(FW_W_ICON_PIXMAP(fw)); } DrawIconPixmapWindow( fw, reset_bg, pev, Shadow, Relief, cs); } } if (is_expanded) { if (FW_W_ICON_TITLE(fw) != None) { XRaiseWindow(dpy, FW_W_ICON_TITLE(fw)); raisePanFrames(); } } else { XWindowChanges xwc; int mask; xwc.sibling = FW_W_FRAME(fw); xwc.stack_mode = Below; mask = CWSibling|CWStackMode; if (FW_W_ICON_TITLE(fw) != None) { XConfigureWindow(dpy, FW_W_ICON_TITLE(fw), mask, &xwc); } if (FW_W_ICON_PIXMAP(fw) != None) { XConfigureWindow(dpy, FW_W_ICON_PIXMAP(fw), mask, &xwc); } } /* wait for pending EnterNotify/LeaveNotify events to suppress race * condition w/ expanding/collapsing icon titles */ XFlush(dpy); } /* * * Procedure: * ChangeIconPixmap - procedure change the icon pixmap or "pixmap" * window. Called in events.c and ewmh_events.c * */ void ChangeIconPixmap(FvwmWindow *fw) { rectangle g; if (!IS_ICONIFIED(fw)) { ICON_DBG((stderr,"hpn: postpone icon change '%s'\n", fw->name)); /* update the icon later when application is iconified */ SET_HAS_ICON_CHANGED(fw, 1); } else if (IS_ICONIFIED(fw)) { ICON_DBG((stderr,"hpn: applying new icon '%s'\n", fw->name)); SET_ICONIFIED(fw, 0); SET_ICON_UNMAPPED(fw, 0); get_icon_geometry(fw, &g); CreateIconWindow(fw, g.x, g.y); broadcast_icon_geometry(fw, False); /* domivogt (15-Sep-1999): BroadcastConfig informs modules of * the configuration change including the iconified flag. So * this flag must be set here. I'm not sure if the two calls of * the SET_ICONIFIED macro after BroadcastConfig are necessary, * but since it's only minimal overhead I prefer to be on the * safe side. */ SET_ICONIFIED(fw, 1); BroadcastConfig(M_CONFIGURE_WINDOW, fw); SET_ICONIFIED(fw, 0); if (!IS_ICON_SUPPRESSED(fw)) { LowerWindow(fw, False); AutoPlaceIcon(fw, NULL, True); if (fw->Desk == Scr.CurrentDesk) { if (FW_W_ICON_TITLE(fw)) { XMapWindow(dpy, FW_W_ICON_TITLE(fw)); } if (FW_W_ICON_PIXMAP(fw) != None) { XMapWindow(dpy, FW_W_ICON_PIXMAP(fw)); } } } SET_ICONIFIED(fw, 1); DrawIconWindow(fw, False, True, False, False, NULL); } return; } /* * * Procedure: * RedoIconName - procedure to re-position the icon window and name * */ void RedoIconName(FvwmWindow *fw) { if (IS_ICON_SUPPRESSED(fw)) { return; } if (FW_W_ICON_TITLE(fw) == None) { return; } setup_icon_title_size(fw); /* clear the icon window, and trigger a re-draw via an expose event */ if (IS_ICONIFIED(fw)) { DrawIconWindow(fw, True, False, False, False, NULL); XClearArea(dpy, FW_W_ICON_TITLE(fw), 0, 0, 0, 0, True); } return; } /* * * Procedure: * AutoPlace - Find a home for an icon * */ void AutoPlaceIcon( FvwmWindow *t, initial_window_options_t *win_opts, Bool do_move_immediately) { int base_x, base_y; int width,height; FvwmWindow *test_fw; Bool loc_ok; Bool loc_ok_wrong_screen; Bool loc_ok_wrong_screen2; int real_x=10, real_y=10; int new_x, new_y; Bool do_move_icon = False; #if 0 /* dv (16-Mar-2003): We need to place the icon even if there is no icon so * the 'position' can be communicated to the modules to decide whether to show * the icon or not. */ if (FW_W_ICON_PIXMAP(t) == None && FW_W_ICON_TITLE(t) == None) { return; } #endif /* New! Put icon in same page as the center of the window */ /* Not a good idea for StickyIcons. Neither for icons of windows that are * visible on the current page. */ if (IS_ICON_STICKY_ACROSS_DESKS(t) || IS_STICKY_ACROSS_DESKS(t)) { t->Desk = Scr.CurrentDesk; } if (IS_ICON_STICKY_ACROSS_PAGES(t) || IS_STICKY_ACROSS_PAGES(t)) { base_x = 0; base_y = 0; /*Also, if its a stickyWindow, put it on the current page! */ new_x = t->g.frame.x % Scr.MyDisplayWidth; new_y = t->g.frame.y % Scr.MyDisplayHeight; if (new_x + t->g.frame.width <= 0) new_x += Scr.MyDisplayWidth; if (new_y + t->g.frame.height <= 0) new_y += Scr.MyDisplayHeight; frame_setup_window( t, new_x, new_y, t->g.frame.width, t->g.frame.height, False); } else if (IsRectangleOnThisPage(&(t->g.frame), t->Desk)) { base_x = 0; base_y = 0; } else { base_x = ((t->g.frame.x + Scr.Vx + (t->g.frame.width >> 1)) / Scr.MyDisplayWidth) * Scr.MyDisplayWidth; base_y= ((t->g.frame.y + Scr.Vy + (t->g.frame.height >> 1)) / Scr.MyDisplayHeight) * Scr.MyDisplayHeight; /* limit icon position to desktop */ if (base_x > Scr.VxMax) base_x = Scr.VxMax; if (base_x < 0) base_x = 0; if (base_y > Scr.VyMax) base_y = Scr.VyMax; if (base_y < 0) base_y = 0; base_x -= Scr.Vx; base_y -= Scr.Vy; } if (IS_ICON_MOVED(t) || (win_opts != NULL && win_opts->flags.use_initial_icon_xy)) { rectangle g; int dx; int dy; get_icon_geometry(t, &g); if (win_opts != NULL && win_opts->flags.use_initial_icon_xy) { g.x = win_opts->initial_icon_x; g.y = win_opts->initial_icon_y; } dx = g.x; dy = g.y; /* just make sure the icon is on this page */ g.x = g.x % Scr.MyDisplayWidth + base_x; g.y = g.y % Scr.MyDisplayHeight + base_y; if (g.x < 0) { g.x += Scr.MyDisplayWidth; } if (g.y < 0) { g.y += Scr.MyDisplayHeight; } dx = g.x - dx; dy = g.y - dy; modify_icon_position(t, dx, dy); do_move_icon = True; } else if (USE_ICON_POSITION_HINT(t) && t->wmhints && t->wmhints->flags & IconPositionHint) { set_icon_position(t, t->wmhints->icon_x, t->wmhints->icon_y); do_move_icon = True; } /* dje 10/12/97: Look thru chain of icon boxes assigned to window. Add logic for grids and fill direction. */ else if (DO_IGNORE_ICON_BOXES(t)) { int sx; int sy; int sw; int sh; fscreen_scr_arg fscr; rectangle g; get_icon_geometry(t, &g); get_icon_corner(t, &g); fscr.xypos.x = g.x + g.width / 2; fscr.xypos.y = g.y + g.height / 2; FScreenGetScrRect(&fscr, FSCREEN_XYPOS, &sx, &sy, &sw, &sh); if (g.x < sx) g.x = sx; else if (g.x + g.width > sx + sw) g.x = sx + sw - g.width; if (g.y < sy) g.y = sy; else if (g.y + g.height > sy + sh) g.y = sy + sh - g.height; set_icon_position(t, g.x, g.y); do_move_icon = True; } else { /* A place to hold inner and outer loop variables. */ typedef struct dimension_struct { int step; /* grid size (may be negative) */ int start_at; /* starting edge */ int real_start; /* on screen starting edge */ int end_at; /* ending edge */ int base; /* base for screen */ int icon_dimension; /* height or width */ int nom_dimension; /* nonminal height or width */ int screen_dimension; /* screen height or width */ int screen_offset; /* screen offset */ } dimension; dimension dim[3]; /* space for work, 1st, 2nd dimen */ icon_boxes *icon_boxes_ptr; /* current icon box */ int i; /* index for inner/outer loop data */ fscreen_scr_arg fscr; rectangle ref; rectangle g; /* Hopefully this makes the following more readable. */ #define ICONBOX_LFT icon_boxes_ptr->IconBox[0] #define ICONBOX_TOP icon_boxes_ptr->IconBox[1] #define ICONBOX_RGT icon_boxes_ptr->IconBox[2] #define ICONBOX_BOT icon_boxes_ptr->IconBox[3] #define BOT_FILL icon_boxes_ptr->IconFlags & ICONFILLBOT #define RGT_FILL icon_boxes_ptr->IconFlags & ICONFILLRGT #define HRZ_FILL icon_boxes_ptr->IconFlags & ICONFILLHRZ /* needed later */ fscr.xypos.x = t->g.frame.x + (t->g.frame.width / 2) - base_x; fscr.xypos.y = t->g.frame.y + (t->g.frame.height / 2) - base_y; get_icon_geometry(t, &g); /* unnecessary copy of width */ width = g.width; /* total height */ height = g.height; /* no slot found yet */ loc_ok = False; loc_ok_wrong_screen = False; /* check all boxes in order */ icon_boxes_ptr = NULL; /* init */ while(do_all_iconboxes(t, &icon_boxes_ptr)) { if (loc_ok == True) { /* leave for loop */ break; } /* get the screen dimensions for the icon box */ if (icon_boxes_ptr->IconScreen == FSCREEN_CURRENT) fscr.mouse_ev = NULL; FScreenGetScrRect( &fscr, icon_boxes_ptr->IconScreen, &ref.x, &ref.y, &ref.width, &ref.height); dim[1].screen_offset = ref.y; dim[1].screen_dimension = ref.height; dim[2].screen_offset = ref.x; dim[2].screen_dimension = ref.width; /* y amount */ dim[1].step = icon_boxes_ptr->IconGrid[1]; /* init start from */ dim[1].start_at = ICONBOX_TOP + dim[1].screen_offset; if (icon_boxes_ptr->IconSign[1] == '-') { dim[1].start_at += dim[1].screen_dimension; } /* init end at */ dim[1].end_at = ICONBOX_BOT + dim[1].screen_offset; if (icon_boxes_ptr->IconSign[3] == '-') { dim[1].end_at += dim[1].screen_dimension; } /* save base */ dim[1].base = base_y; /* save dimension */ dim[1].icon_dimension = height; if (BOT_FILL) { /* fill from bottom */ /* reverse step */ dim[1].step = 0 - dim[1].step; } /* end fill from bottom */ /* x amount */ dim[2].step = icon_boxes_ptr->IconGrid[0]; /* init start from */ dim[2].start_at = ICONBOX_LFT + dim[2].screen_offset; if (icon_boxes_ptr->IconSign[0] == '-') { dim[2].start_at += dim[2].screen_dimension; } /* init end at */ dim[2].end_at = ICONBOX_RGT + dim[2].screen_offset; if (icon_boxes_ptr->IconSign[2] == '-') { dim[2].end_at += dim[2].screen_dimension; } /* save base */ dim[2].base = base_x; /* save dimension */ dim[2].icon_dimension = width; if (RGT_FILL) { /* fill from right */ /* reverse step */ dim[2].step = 0 - dim[2].step; } /* end fill from right */ for (i=1;i<=2;i++) { /* for dimensions 1 and 2 */ /* If the window is taller than the icon box, ignore the icon height * when figuring where to put it. Same goes for the width * This should permit reasonably graceful handling of big icons. */ dim[i].nom_dimension = dim[i].icon_dimension; if (dim[i].icon_dimension >= dim[i].end_at - dim[i].start_at) { dim[i].nom_dimension = dim[i].end_at - dim[i].start_at - 1; } if (dim[i].step < 0) { /* if moving backwards */ /* save */ dim[0].start_at = dim[i].start_at; /* swap one */ dim[i].start_at = dim[i].end_at; /* swap the other */ dim[i].end_at = dim[0].start_at; dim[i].start_at -= dim[i].icon_dimension; } /* end moving backwards */ /* adjust both to base */ dim[i].start_at += dim[i].base; dim[i].end_at += dim[i].base; } /* end 2 dimensions */ if (HRZ_FILL) { /* if hrz first */ /* save */ memcpy(&dim[0],&dim[1],sizeof(dimension)); /* switch one */ memcpy(&dim[1],&dim[2],sizeof(dimension)); /* switch the other */ memcpy(&dim[2],&dim[0],sizeof(dimension)); } /* end horizontal dimension first */ /* save for reseting inner loop */ dim[0].start_at = dim[2].start_at; loc_ok_wrong_screen2 = False; while((dim[1].step < 0 /* filling reversed */ ? (dim[1].start_at + dim[1].icon_dimension - dim[1].nom_dimension > dim[1].end_at) /* check back edge */ : (dim[1].start_at + dim[1].nom_dimension < dim[1].end_at)) /* check front edge */ && (!loc_ok) && (!loc_ok_wrong_screen2)) { /* nothing found yet */ dim[1].real_start = dim[1].start_at; /* init */ if (dim[1].start_at + dim[1].icon_dimension > dim[1].screen_offset + dim[1].screen_dimension - 2 + dim[1].base) { /* off screen, move on screen */ dim[1].real_start = dim[1].screen_offset + dim[1].screen_dimension - dim[1].icon_dimension + dim[1].base; } /* end off screen */ if (dim[1].start_at < dim[1].screen_offset + dim[1].base) { /* if off other edge, move on screen */ dim[1].real_start = dim[1].screen_offset + dim[1].base; } /* end off other edge */ /* reset inner loop */ dim[2].start_at = dim[0].start_at; while((dim[2].step < 0 /* filling reversed */ ? (dim[2].start_at + dim[2].icon_dimension-dim[2].nom_dimension > dim[2].end_at) /* check back edge */ : (dim[2].start_at + dim[2].nom_dimension < dim[2].end_at)) /* check front edge */ && (!loc_ok) && (!loc_ok_wrong_screen2)) { /* nothing found yet */ dim[2].real_start = dim[2].start_at; /* init */ if (dim[2].start_at + dim[2].icon_dimension > dim[2].screen_offset + dim[2].screen_dimension - 2 + dim[2].base) { /* if off screen, move on screen */ dim[2].real_start = dim[2].screen_offset + dim[2].screen_dimension - dim[2].icon_dimension + dim[2].base; } /* end off screen */ if (dim[2].start_at < dim[2].screen_offset + dim[2].base) { /* if off other edge, move on screen */ dim[2].real_start = dim[2].screen_offset + dim[2].base; } /* end off other edge */ if (HRZ_FILL) { /* hrz first */ /* unreverse them */ real_x = dim[1].real_start; real_y = dim[2].real_start; } else { /* reverse them */ real_x = dim[2].real_start; real_y = dim[1].real_start; } /* this may be a good location */ if (FScreenIsRectangleOnScreen(&fscr, FSCREEN_XYPOS, &ref)) { loc_ok = True; } else { loc_ok_wrong_screen2 = True; } test_fw = Scr.FvwmRoot.next; while((test_fw != (FvwmWindow *)0) &&(loc_ok == True || loc_ok_wrong_screen2)) { /* test overlap */ if (test_fw->Desk == t->Desk) { rectangle g; if ((IS_ICONIFIED(test_fw)) && (!IS_TRANSIENT(test_fw) || !IS_ICONIFIED_BY_PARENT(test_fw)) && (FW_W_ICON_TITLE(test_fw)||FW_W_ICON_PIXMAP(test_fw)) && (test_fw != t)) { get_icon_geometry(test_fw, &g); if ((g.x<(real_x+width+MIN_ICON_BOX_DIST))&& ((g.x+g.width+MIN_ICON_BOX_DIST) > real_x)&& (g.y<(real_y+height+MIN_ICON_BOX_DIST))&& ((g.y+g.height + MIN_ICON_BOX_DIST)>real_y)) { /* don't accept this location */ loc_ok = False; loc_ok_wrong_screen2 = False; } /* end if icons overlap */ } /* end if its an icon */ } /* end if same desk */ test_fw = test_fw->next; } /* end while icons that may overlap */ if (loc_ok_wrong_screen2) { loc_ok_wrong_screen = True; } /* Grid inner value & direction */ dim[2].start_at += dim[2].step; } /* end while room inner dimension */ /* Grid outer value & direction */ dim[1].start_at += dim[1].step; } /* end while room outer dimension */ } /* end for all icon boxes, or found space */ if (!loc_ok && !loc_ok_wrong_screen) /* If icon never found a home just leave it */ return; set_icon_position(t, real_x, real_y); broadcast_icon_geometry(t, True); do_move_icon = True; } if (do_move_icon && do_move_immediately) { move_icon_to_position(t); } return; } static icon_boxes *global_icon_box_ptr; /* Find next icon box to try to place icon in. Goes thru chain that the window got thru style matching, then the global icon box. Create the global icon box on first call. Return code indicates when the boxes are used up. The boxes could only get completely used up when you fill the screen with them. */ static int do_all_iconboxes(FvwmWindow *t, icon_boxes **icon_boxes_ptr) { if (global_icon_box_ptr == 0) { /* if first time */ int sx; int sy; int sw; int sh; /* Right now, the global box is hard-coded, fills the primary * screen, uses an 80x80 grid, and fills top-bottom, * left-right */ FScreenGetScrRect(NULL, FSCREEN_PRIMARY, &sx, &sy, &sw, &sh); global_icon_box_ptr = calloc(1, sizeof(icon_boxes)); global_icon_box_ptr->IconBox[0] = sx; global_icon_box_ptr->IconBox[1] = sy; global_icon_box_ptr->IconBox[2] = sx + sw; global_icon_box_ptr->IconBox[3] = sy + sh; global_icon_box_ptr->IconGrid[0] = 80; global_icon_box_ptr->IconGrid[1] = 80; global_icon_box_ptr->IconFlags = ICONFILLHRZ; } if (*icon_boxes_ptr == NULL) { /* first time? */ /* start at windows box */ *icon_boxes_ptr = t->IconBoxes; if (!*icon_boxes_ptr) { /* if window has no box */ /* use global box */ *icon_boxes_ptr = global_icon_box_ptr; } /* use box */ return (1); } /* Here its not the first call, we are either on the chain or at * the global box */ if (*icon_boxes_ptr == global_icon_box_ptr) { /* if the global box */ /* completely out of boxes (unlikely) */ return (0); } /* move to next one on chain */ *icon_boxes_ptr = (*icon_boxes_ptr)->next; if (*icon_boxes_ptr) { /* if there is a next one */ /* return it */ return (1); } /* global box */ *icon_boxes_ptr = global_icon_box_ptr; /* use it */ return (1); } /* * * Looks for icon from a file * */ static void GetIconFromFile(FvwmWindow *fw) { char *path = NULL; FvwmPictureAttributes fpa; fpa.mask = 0; if (fw->cs >= 0 && Colorset[fw->cs].do_dither_icon) { fpa.mask |= FPAM_DITHER; } fw->icon_g.picture_w_g.width = 0; fw->icon_g.picture_w_g.height = 0; path = PictureFindImageFile(fw->icon_bitmap_file, NULL, R_OK); if (path == NULL) { return; } if (!PImageLoadPixmapFromFile( dpy, Scr.NoFocusWin, path, &fw->iconPixmap, &fw->icon_maskPixmap, &fw->icon_alphaPixmap, &fw->icon_g.picture_w_g.width, &fw->icon_g.picture_w_g.height, &fw->iconDepth, &fw->icon_nalloc_pixels, &fw->icon_alloc_pixels, &fw->icon_no_limit, fpa)) { fvwm_msg(ERR, "GetIconFromFile", "Failed to load %s", path); free(path); return; } SET_PIXMAP_OURS(fw, 1); free(path); if (FShapesSupported && fw->icon_maskPixmap) { SET_ICON_SHAPED(fw, 1); } return; } /* * * Looks for an application supplied icon window * */ static void GetIconWindow(FvwmWindow *fw) { int w; int h; int bw; fw->icon_g.picture_w_g.width = 0; fw->icon_g.picture_w_g.height = 0; /* We are guaranteed that wmhints is non-null when calling this * routine */ if (XGetGeometry( dpy, fw->wmhints->icon_window, &JunkRoot, &JunkX, &JunkY, (unsigned int*)&w, (unsigned int*)&h,(unsigned int*)&bw, (unsigned int*)&JunkDepth) == 0) { fvwm_msg( ERR,"GetIconWindow", "Window '%s' has a bad icon window! Ignoring icon" " window.", fw->name.name); /* disable the icon window hint */ fw->wmhints->icon_window = None; fw->wmhints->flags &= ~IconWindowHint; return; } fw->icon_border_width = bw; fw->icon_g.picture_w_g.width = w + 2 * bw; fw->icon_g.picture_w_g.height = h + 2 * bw; /* * Now make the new window the icon window for this window, * and set it up to work as such (select for key presses * and button presses/releases, set up the contexts for it, * and define the cursor for it). */ FW_W_ICON_PIXMAP(fw) = fw->wmhints->icon_window; if (FShapesSupported) { if (fw->wmhints->flags & IconMaskHint) { SET_ICON_SHAPED(fw, 1); fw->icon_maskPixmap = fw->wmhints->icon_mask; } } /* Make sure that the window is a child of the root window ! */ /* Olwais screws this up, maybe others do too! */ XReparentWindow(dpy, FW_W_ICON_PIXMAP(fw), Scr.Root, 0,0); SET_ICON_OURS(fw, 0); return; } /* * * Looks for an application supplied bitmap or pixmap * */ static void GetIconBitmap(FvwmWindow *fw) { int width, height, depth; fw->icon_g.picture_w_g.width = 0; fw->icon_g.picture_w_g.height = 0; /* We are guaranteed that wmhints is non-null when calling this routine */ if (!XGetGeometry( dpy, fw->wmhints->icon_pixmap, &JunkRoot, &JunkX, &JunkY, (unsigned int*)&width, (unsigned int*)&height, (unsigned int*)&JunkBW, (unsigned int*)&depth)) { fvwm_msg( ERR,"GetIconBitmap", "Window '%s' has a bad icon pixmap! Ignoring icon.", fw->name.name); /* disable icon pixmap hint */ fw->wmhints->icon_pixmap = None; fw->wmhints->flags &= ~IconPixmapHint; return; } /* sanity check the pixmap depth, it must be the same as the root or 1 */ if (depth != 1 && depth != Pdepth && depth != DefaultDepth(dpy,Scr.screen)) { fvwm_msg( ERR, "GetIconBitmap", "Window '%s' has a bad icon bitmap depth %d (should" " be 1, %d or %d)! Ignoring icon bitmap.", fw->name.name, depth, Pdepth, DefaultDepth(dpy,Scr.screen)); /* disable icon pixmap hint */ fw->wmhints->icon_pixmap = None; fw->wmhints->flags &= ~IconPixmapHint; return; } fw->iconPixmap = fw->wmhints->icon_pixmap; fw->icon_g.picture_w_g.width = width; fw->icon_g.picture_w_g.height = height; fw->iconDepth = depth; if (FShapesSupported) { if (fw->wmhints->flags & IconMaskHint) { SET_ICON_SHAPED(fw, 1); fw->icon_maskPixmap = fw->wmhints->icon_mask; } } SET_PIXMAP_OURS(fw, 0); return; } /* * * Procedure: * DeIconify a window * */ void DeIconify(FvwmWindow *fw) { FvwmWindow *t, *tmp, *ofw; FvwmWindow *sf = get_focus_window(); rectangle icon_rect; XWindowAttributes winattrs = {0}; if (!fw) { return; } if (!XGetWindowAttributes(dpy, FW_W(fw), &winattrs)) { return; } /* make sure fw->flags.is_map_pending is OK */ if (winattrs.map_state == IsViewable && IS_MAP_PENDING(fw)) { SET_MAP_PENDING(fw, 0); } else if (IS_MAP_PENDING(fw)) { /* final state: de-iconified */ SET_ICONIFY_AFTER_MAP(fw, 0); return; } for (ofw = NULL; fw != ofw && IS_ICONIFIED_BY_PARENT(fw); ) { t = get_transientfor_fvwmwindow(fw); if (t == NULL) { break; } ofw = fw; fw = t; } if (IS_ICONIFIED_BY_PARENT(fw)) { SET_ICONIFIED_BY_PARENT(fw, 0); } /* AS dje RaiseWindow(fw); */ if (fw == sf) { /* take away the focus before mapping */ DeleteFocus(True); } /* Note: DeleteFocus may delete the flags set by * mark_transient_subtree(), so do it later. */ mark_transient_subtree(fw, MARK_ALL_LAYERS, MARK_ALL, False, True); /* now de-iconify transients */ for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if (t == fw || IS_IN_TRANSIENT_SUBTREE(t)) { SET_IN_TRANSIENT_SUBTREE(t, 0); SET_MAPPED(t, 1); SET_ICONIFIED_BY_PARENT(t, 0); if (Scr.Hilite == t) { border_draw_decorations( t, PART_ALL, False, True, CLEAR_ALL, NULL, NULL); } /* AS stuff starts here dje */ if (FW_W_ICON_PIXMAP(t)) { XUnmapWindow(dpy, FW_W_ICON_PIXMAP(t)); } if (FW_W_ICON_TITLE(t)) { XUnmapWindow(dpy, FW_W_ICON_TITLE(t)); } XFlush(dpy); /* End AS */ XMapWindow(dpy, FW_W(t)); if (t->Desk == Scr.CurrentDesk) { rectangle r; get_icon_geometry(t, &r); /* update absoluthe geometry in case the icon * was moved over a page boundary; the move * code already takes care of keeping the frame * geometry up to date */ update_absolute_geometry(t); if (IsRectangleOnThisPage(&r, t->Desk) && !IsRectangleOnThisPage( &(t->g.frame), t->Desk)) { /* Make sure we keep it on screen when * de-iconifying. */ t->g.frame.x -= truncate_to_multiple( t->g.frame.x, Scr.MyDisplayWidth); t->g.frame.y -= truncate_to_multiple( t->g.frame.y, Scr.MyDisplayHeight); XMoveWindow( dpy, FW_W_FRAME(t), t->g.frame.x, t->g.frame.y); update_absolute_geometry(t); maximize_adjust_offset(t); } } /* domivogt (1-Mar-2000): The next block is a hack to * prevent animation if the window has an icon, but * neither a pixmap nor a title. */ if (HAS_NO_ICON_TITLE(t) && FW_W_ICON_PIXMAP(t) == None) { memset(&fw->icon_g, 0, sizeof(fw->icon_g)); } get_icon_geometry(t, &icon_rect); /* if this fails it does not overwrite icon_rect */ EWMH_GetIconGeometry(t, &icon_rect); if (t == fw) { BroadcastPacket( M_DEICONIFY, 11, (long)FW_W(t), (long)FW_W_FRAME(t), (unsigned long)t, (long)icon_rect.x, (long)icon_rect.y, (long)icon_rect.width, (long)icon_rect.height, (long)t->g.frame.x, (long)t->g.frame.y, (long)t->g.frame.width, (long)t->g.frame.height); } else { BroadcastPacket( M_DEICONIFY, 7, (long)FW_W(t), (long)FW_W_FRAME(t), (unsigned long)t, (long)icon_rect.x, (long)icon_rect.y, (long)icon_rect.width, (long)icon_rect.height); } XMapWindow(dpy, FW_W_PARENT(t)); if (t->Desk == Scr.CurrentDesk) { XMapWindow(dpy, FW_W_FRAME(t)); SET_MAP_PENDING(t, 1); } SetMapStateProp(t, NormalState); SET_ICONIFIED(t, 0); SET_ICON_UNMAPPED(t, 0); SET_ICON_ENTERED(t, 0); /* Need to make sure the border is colored correctly, * in case it was stuck or unstuck while iconified. */ tmp = Scr.Hilite; Scr.Hilite = t; border_draw_decorations( t, PART_ALL, (sf == t) ? True : False, True, CLEAR_ALL, NULL, NULL); Scr.Hilite = tmp; } } #if 1 RaiseWindow(fw, False); /* moved dje */ #endif if (sf == fw) { /* update the focus to make sure the application knows its * state */ if (!FP_DO_UNFOCUS_LEAVE(FW_FOCUS_POLICY(fw))) { SetFocusWindow(fw, True, FOCUS_SET_FORCE); } } else if (FP_DO_SORT_WINDOWLIST_BY(FW_FOCUS_POLICY(fw)) == FPOL_SORT_WL_BY_OPEN) { SetFocusWindow(fw, True, FOCUS_SET_FORCE); } focus_grab_buttons_on_layer(fw->layer); GNOME_SetWinArea(fw); return; } /* * * Iconifies the selected window * */ void Iconify(FvwmWindow *fw, initial_window_options_t *win_opts) { FvwmWindow *t; FvwmWindow *sf; XWindowAttributes winattrs = {0}; unsigned long eventMask; rectangle icon_rect; if (!fw) { return; } if (!XGetWindowAttributes(dpy, FW_W(fw), &winattrs)) { return; } /* make sure fw->flags.is_map_pending is OK */ if ((winattrs.map_state == IsViewable) && IS_MAP_PENDING(fw)) { SET_MAP_PENDING(fw, 0); } if (IS_MAP_PENDING(fw)) { /* final state: iconified */ SET_ICONIFY_AFTER_MAP(fw, 1); return; } eventMask = winattrs.your_event_mask; mark_transient_subtree(fw, MARK_ALL_LAYERS, MARK_ALL, False, True); sf = get_focus_window(); if (sf && IS_IN_TRANSIENT_SUBTREE(sf)) { restore_focus_after_unmap(sf, True); /* restore_focus_after_unmap() destorys the flags set by * mark_transient_subtree(), so we have to unfortunately call * it again. */ mark_transient_subtree( fw, MARK_ALL_LAYERS, MARK_ALL, False, True); } /* iconify transients first */ for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if (t == fw || IS_IN_TRANSIENT_SUBTREE(t)) { SET_IN_TRANSIENT_SUBTREE(t, 0); SET_ICON_ENTERED(t, 0); /* Prevent the receipt of an UnmapNotify, since that * would cause a transition to the Withdrawn state. */ SET_MAPPED(t, 0); XSelectInput( dpy, FW_W(t), eventMask & ~StructureNotifyMask); XUnmapWindow(dpy, FW_W(t)); XSelectInput(dpy, FW_W(t), eventMask); XUnmapWindow(dpy, FW_W_FRAME(t)); border_undraw_decorations(t); t->DeIconifyDesk = t->Desk; if (FW_W_ICON_TITLE(t)) { XUnmapWindow(dpy, FW_W_ICON_TITLE(t)); } if (FW_W_ICON_PIXMAP(t)) { XUnmapWindow(dpy, FW_W_ICON_PIXMAP(t)); } SetMapStateProp(t, IconicState); border_draw_decorations( t, PART_ALL, False, False, CLEAR_ALL, NULL, NULL); if (t == fw && !IS_ICONIFIED_BY_PARENT(fw)) { SET_ICONIFY_PENDING(t, 1); } else { rectangle g; SET_ICONIFIED(t, 1); SET_ICON_UNMAPPED(t, 1); SET_ICONIFIED_BY_PARENT(t, 1); get_icon_geometry(t, &g); BroadcastPacket( M_ICONIFY, 7, (long)FW_W(t), (long)FW_W_FRAME(t), (unsigned long)t, (long)-32768, (long)-32768, (long)g.width, (long)g.height); BroadcastConfig(M_CONFIGURE_WINDOW,t); } } /* if */ } /* for */ /* necessary during a recapture */ if (IS_ICONIFIED_BY_PARENT(fw)) { return; } if (FW_W_ICON_TITLE(fw) == None || HAS_ICON_CHANGED(fw)) { if (IS_ICON_MOVED(fw) || win_opts->flags.use_initial_icon_xy) { rectangle g; get_icon_geometry(fw, &g); if (win_opts->flags.use_initial_icon_xy) { g.x = win_opts->initial_icon_x; g.y = win_opts->initial_icon_y; } CreateIconWindow(fw, g.x, g.y); } else { CreateIconWindow( fw, win_opts->default_icon_x, win_opts->default_icon_y); } SET_HAS_ICON_CHANGED(fw, 0); } else if (FW_W_ICON_TITLE(fw) && !FW_W_ICON_PIXMAP(fw)) { /* if no pixmap we want icon width to change to text width * every iconify; not necessary if the icon was created above */ setup_icon_title_size(fw); } /* this condition will be true unless we restore a window to * iconified state from a saved session. */ if (win_opts->initial_state != IconicState || (!IS_ICON_MOVED(fw) && !win_opts->flags.use_initial_icon_xy)) { AutoPlaceIcon(fw, win_opts, True); } /* domivogt (12-Mar-2003): Clean out the icon geometry if there is no * icon. Necessary to initialise the values and to suppress animation * if there is no icon. */ if (HAS_NO_ICON_TITLE(fw) && FW_W_ICON_PIXMAP(fw) == None) { clear_icon_dimensions(fw); } SET_ICONIFIED(fw, 1); SET_ICON_UNMAPPED(fw, 0); get_icon_geometry(fw, &icon_rect); /* if this fails it does not overwrite icon_rect */ EWMH_GetIconGeometry(fw, &icon_rect); BroadcastPacket( M_ICONIFY, 11, (long)FW_W(fw), (long)FW_W_FRAME(fw), (unsigned long)fw, (long)icon_rect.x, (long)icon_rect.y, (long)icon_rect.width, (long)icon_rect.height, /* next 4 added for Animate module */ (long)fw->g.frame.x, (long)fw->g.frame.y, (long)fw->g.frame.width, (long)fw->g.frame.height); BroadcastConfig(M_CONFIGURE_WINDOW,fw); if (win_opts->initial_state != IconicState || (!IS_ICON_MOVED(fw) && !win_opts->flags.use_initial_icon_xy)) { LowerWindow(fw, False); } if (IS_ICON_STICKY_ACROSS_DESKS(fw) || IS_STICKY_ACROSS_DESKS(fw)) { fw->Desk = Scr.CurrentDesk; } if (fw->Desk == Scr.CurrentDesk) { if (FW_W_ICON_TITLE(fw) != None) { XMapWindow(dpy, FW_W_ICON_TITLE(fw)); } if (FW_W_ICON_PIXMAP(fw) != None) { XMapWindow(dpy, FW_W_ICON_PIXMAP(fw)); } } focus_grab_buttons_on_layer(fw->layer); return; } /* * * This is used to tell applications which windows on the screen are * top level appication windows, and which windows are the icon windows * that go with them. * */ void SetMapStateProp(const FvwmWindow *fw, int state) { /* "suggested" by ICCCM version 1 */ unsigned long data[2]; data[0] = (unsigned long) state; data[1] = (unsigned long) FW_W_ICON_TITLE(fw); /* data[2] = (unsigned long) FW_W_ICON_PIXMAP(fw);*/ XChangeProperty( dpy, FW_W(fw), _XA_WM_STATE, _XA_WM_STATE, 32, PropModeReplace, (unsigned char *) data, 2); return; } void CMD_Iconify(F_CMD_ARGS) { int toggle; FvwmWindow * const fw = exc->w.fw; toggle = ParseToggleArgument(action, NULL, -1, 0); if (toggle == -1) { if (GetIntegerArguments(action, NULL, &toggle, 1) > 0) { if (toggle > 0) { toggle = 1; } else if (toggle < 0) { toggle = 0; } else { toggle = -1; } } } if (toggle == -1) { toggle = (IS_ICONIFIED(fw)) ? 0 : 1; } if (IS_ICONIFIED(fw)) { if (toggle == 0) { DeIconify(fw); EWMH_SetWMState(fw, False); } } else { if (toggle == 1) { initial_window_options_t win_opts; if ( !is_function_allowed( F_ICONIFY, NULL, fw, RQORIG_PROGRAM, True)) { XBell(dpy, 0); return; } memset(&win_opts, 0, sizeof(win_opts)); fev_get_evpos_or_query( dpy, Scr.Root, NULL, &win_opts.default_icon_x, &win_opts.default_icon_y); Iconify(fw, &win_opts); EWMH_SetWMState(fw, False); } } return; } fvwm-2.6.5.orig/fvwm/eventmask.h0000644000175000017500000000466307677641663015006 0ustar vwcvwc/* -*-c-*- */ #ifndef EVENTMASK_H #define EVENTMASK_H /* ---------------------------- global definitions ------------------------- */ #define XEVMASK_FRAMEW \ (SubstructureRedirectMask | VisibilityChangeMask | \ EnterWindowMask | LeaveWindowMask) #define XEVMASK_FRAMEW_CAPTURE (XEVMASK_FRAMEW | StructureNotifyMask) #define XEVMASK_TITLEW \ (ButtonPressMask | ButtonReleaseMask | \ OwnerGrabButtonMask | /*ButtonMotionMask | PointerMotionMask | */\ EnterWindowMask | LeaveWindowMask) #define XEVMASK_BUTTONW \ XEVMASK_TITLEW #define XEVMASK_PARENTW \ (SubstructureRedirectMask) #define XEVMASK_BORDERW \ (ButtonPressMask | ButtonReleaseMask | \ EnterWindowMask | LeaveWindowMask) #define XEVMASK_CLIENTW \ (StructureNotifyMask | PropertyChangeMask | \ EnterWindowMask | LeaveWindowMask | \ ColormapChangeMask | FocusChangeMask) #define XEVMASK_ICONW \ (ButtonPressMask | ButtonReleaseMask | \ VisibilityChangeMask | ExposureMask | KeyPressMask | KeyReleaseMask | \ EnterWindowMask | LeaveWindowMask | FocusChangeMask) #define XEVMASK_ICONPW \ XEVMASK_ICONW #define XEVMASK_MENU \ (ButtonPressMask | ButtonReleaseMask | ExposureMask | KeyReleaseMask | \ KeyPressMask | VisibilityChangeMask | ButtonMotionMask | \ PointerMotionMask) #define XEVMASK_TEAR_OFF_MENU \ (XEVMASK_MENU | LeaveWindowMask | EnterWindowMask) #define XEVMASK_MENUW \ (ExposureMask | KeyPressMask | KeyReleaseMask) #define XEVMASK_TEAR_OFF_MENUW \ (XEVMASK_MENUW | EnterWindowMask | LeaveWindowMask | \ StructureNotifyMask) #define XEVMASK_TEAR_OFF_SUBMENUW \ (XEVMASK_MENUW | LeaveWindowMask) #define XEVMASK_PANFW \ (ButtonPressMask | ButtonReleaseMask | KeyReleaseMask | KeyPressMask | \ EnterWindowMask | LeaveWindowMask | VisibilityChangeMask) #define XEVMASK_NOFOCUSW \ (KeyPressMask | KeyReleaseMask | FocusChangeMask) #define XEVMASK_MENUNFW \ (KeyPressMask | KeyReleaseMask | FocusChangeMask) #define XEVMASK_ORW \ (FocusChangeMask) #define XEVMASK_ROOTW \ (LeaveWindowMask| EnterWindowMask | \ PropertyChangeMask | SubstructureRedirectMask | KeyPressMask | \ KeyReleaseMask | \ SubstructureNotifyMask | ColormapChangeMask | \ STROKE_CODE(ButtonMotionMask | DEFAULT_ALL_BUTTONS_MOTION_MASK |) \ ButtonPressMask | ButtonReleaseMask) #define XEVMASK_RESIZE \ (ButtonPressMask | ButtonReleaseMask | KeyPressMask | \ PointerMotionMask | ButtonMotionMask | ExposureMask) #define XEVMASK_RESIZE_OPAQUE \ (XEVMASK_RESIZE | PropertyChangeMask) #endif /* EVENTMASK_H */ fvwm-2.6.5.orig/fvwm/menuitem.c0000644000175000017500000005531010765006466014606 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/Picture.h" #include "libs/Graphics.h" #include "libs/PictureGraphics.h" #include "libs/Rectangles.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "misc.h" #include "screen.h" #include "menudim.h" #include "menustyle.h" #include "menuitem.h" #include "decorations.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static void clear_menu_item_background( MenuPaintItemParameters *mpip, int x, int y, int w, int h) { MenuStyle *ms = mpip->ms; if (!ST_HAS_MENU_CSET(ms) && ST_FACE(ms).type == GradientMenu && (ST_FACE(ms).gradient_type == D_GRADIENT || ST_FACE(ms).gradient_type == B_GRADIENT)) { XEvent e; e.xexpose.x = x; e.xexpose.y = y; e.xexpose.width = w; e.xexpose.height = h; mpip->cb_reset_bg(mpip->cb_mr, &e); } else { XClearArea(dpy, mpip->w, x, y, w, h, False); } } /* * * Draws two horizontal lines to form a separator * */ static void draw_separator( Window w, GC TopGC, GC BottomGC, int x1, int y, int x2) { XDrawLine(dpy, w, TopGC , x1, y, x2, y); XDrawLine(dpy, w, BottomGC, x1-1, y+1, x2+1, y+1); return; } /* * * Draws a tear off bar. Similar to a separator, but with a dashed line. * */ static void draw_tear_off_bar( Window w, GC TopGC, GC BottomGC, int x1, int y, int x2) { XGCValues xgcv; int width; int offset; xgcv.line_style = LineOnOffDash; xgcv.dashes = MENU_TEAR_OFF_BAR_DASH_WIDTH; XChangeGC(dpy, TopGC, GCLineStyle | GCDashList, &xgcv); XChangeGC(dpy, BottomGC, GCLineStyle | GCDashList, &xgcv); width = (x2 - x1 + 1); offset = (width / MENU_TEAR_OFF_BAR_DASH_WIDTH) * MENU_TEAR_OFF_BAR_DASH_WIDTH; offset = (width - offset) / 2; x1 += offset; x2 += offset; XDrawLine(dpy, w, TopGC, x1, y, x2, y); XDrawLine(dpy, w, BottomGC, x1, y + 1, x2, y + 1); xgcv.line_style = LineSolid; XChangeGC(dpy, TopGC, GCLineStyle, &xgcv); XChangeGC(dpy, BottomGC, GCLineStyle, &xgcv); return; } static void draw_highlight_background( struct MenuPaintItemParameters *mpip, int x, int y, int width, int height, colorset_t *cs, GC gc) { if (cs != NULL && cs->pixmap && cs->pixmap_type != PIXMAP_TILED) { Pixmap p; p = CreateOffsetBackgroundPixmap( dpy, mpip->w, 0, 0, width, height, cs, Pdepth, gc, False); switch (cs->pixmap_type) { case PIXMAP_STRETCH_X: /* todo: optimize to only create one pixmap and gc per * mr. */ case PIXMAP_STRETCH_Y: { XGCValues gcv; int gcm; GC bgc; gcv.tile = p; gcv.fill_style = FillTiled; gcm = GCFillStyle | GCTile; /* vertcal gradients has to be aligned properly */ if (cs->pixmap_type == PIXMAP_STRETCH_Y) { gcv.ts_y_origin = y; gcm|=GCTileStipYOrigin; } else if (cs->pixmap_type == PIXMAP_STRETCH_X) { gcv.ts_x_origin = x; gcm|=GCTileStipXOrigin; } bgc = fvwmlib_XCreateGC(dpy, mpip->w, gcm, &gcv); XFillRectangle(dpy, mpip->w, bgc, x, y, width, height); XFreeGC(dpy, bgc); break; } default: XCopyArea(dpy, p, mpip->w, gc, 0, 0, width, height, x, y); break; } XFreePixmap(dpy, p); } else { XFillRectangle(dpy, mpip->w, gc, x, y, width, height); } } /* ---------------------------- interface functions ------------------------ */ /* Allocates a new, empty menu item */ struct MenuItem *menuitem_create(void) { MenuItem *mi; mi = (MenuItem *)safemalloc(sizeof(MenuItem)); memset(mi, 0, sizeof(MenuItem)); return mi; } /* Frees a menu item and all of its allocated resources. */ void menuitem_free(struct MenuItem *mi) { int i; if (!mi) { return; } for (i = 0; i < MAX_MENU_ITEM_LABELS; i++) { if (MI_LABEL(mi)[i] != NULL) { free(MI_LABEL(mi)[i]); } } if (MI_ACTION(mi) != NULL) { free(MI_ACTION(mi)); } if (MI_PICTURE(mi)) { PDestroyFvwmPicture(dpy, MI_PICTURE(mi)); } for (i = 0; i < MAX_MENU_ITEM_MINI_ICONS; i++) { if (MI_MINI_ICON(mi)[i]) { PDestroyFvwmPicture(dpy, MI_MINI_ICON(mi)[i]); } } free(mi); return; } /* Duplicate a menu item into newly allocated memory. The new item is * completely independent of the old one. */ struct MenuItem *menuitem_clone(struct MenuItem *mi) { MenuItem *new_mi; int i; /* copy everything */ new_mi = (MenuItem *)safemalloc(sizeof(MenuItem)); memcpy(new_mi, mi, sizeof(MenuItem)); /* special treatment for a few parts */ MI_NEXT_ITEM(new_mi) = NULL; MI_PREV_ITEM(new_mi) = NULL; MI_WAS_DESELECTED(new_mi) = 0; if (MI_ACTION(mi) != NULL) { MI_ACTION(new_mi) = safestrdup(MI_ACTION(mi)); } for (i = 0; i < MAX_MENU_ITEM_LABELS; i++) { if (MI_LABEL(mi)[i] != NULL) { MI_LABEL(new_mi)[i] = strdup(MI_LABEL(mi)[i]); } } if (MI_PICTURE(mi) != NULL) { MI_PICTURE(new_mi) = PCloneFvwmPicture(MI_PICTURE(mi)); } for (i = 0; i < MAX_MENU_ITEM_MINI_ICONS; i++) { if (MI_MINI_ICON(mi)[i] != NULL) { MI_MINI_ICON(new_mi)[i] = PCloneFvwmPicture(MI_MINI_ICON(mi)[i]); } } return new_mi; } /* Calculate the size of the various parts of the item. The sizes are returned * through mipst. */ void menuitem_get_size( struct MenuItem *mi, struct MenuItemPartSizesT *mipst, FlocaleFont *font, Bool do_reverse_icon_order) { int i; int j; int w; memset(mipst, 0, sizeof(MenuItemPartSizesT)); if (MI_IS_POPUP(mi)) { mipst->triangle_width = MENU_TRIANGLE_WIDTH; } else if (MI_IS_TITLE(mi) && !MI_HAS_PICTURE(mi)) { Bool is_formatted = False; /* titles stretch over the whole menu width, so count the * maximum separately if the title is unformatted. */ for (j = 1; j < MAX_MENU_ITEM_LABELS; j++) { if (MI_LABEL(mi)[j] != NULL) { is_formatted = True; break; } else { MI_LABEL_OFFSET(mi)[j] = 0; } } if (!is_formatted && MI_LABEL(mi)[0] != NULL) { MI_LABEL_STRLEN(mi)[0] = strlen(MI_LABEL(mi)[0]); w = FlocaleTextWidth( font, MI_LABEL(mi)[0], MI_LABEL_STRLEN(mi)[0]); MI_LABEL_OFFSET(mi)[0] = w; MI_IS_TITLE_CENTERED(mi) = True; if (mipst->title_width < w) { mipst->title_width = w; } return; } } /* regular item or formatted title */ for (i = 0; i < MAX_MENU_ITEM_LABELS; i++) { if (MI_LABEL(mi)[i]) { MI_LABEL_STRLEN(mi)[i] = strlen(MI_LABEL(mi)[i]); w = FlocaleTextWidth( font, MI_LABEL(mi)[i], MI_LABEL_STRLEN(mi)[i]); MI_LABEL_OFFSET(mi)[i] = w; if (mipst->label_width[i] < w) { mipst->label_width[i] = w; } } } if (MI_PICTURE(mi) && mipst->picture_width < MI_PICTURE(mi)->width) { mipst->picture_width = MI_PICTURE(mi)->width; } for (i = 0; i < MAX_MENU_ITEM_MINI_ICONS; i++) { if (MI_MINI_ICON(mi)[i]) { int k; /* Reverse mini icon order for left submenu style. */ k = (do_reverse_icon_order == True) ? MAX_MENU_ITEM_MINI_ICONS - 1 - i : i; mipst->icon_width[k] = MI_MINI_ICON(mi)[i]->width; } } return; } /* * * Procedure: * menuitem_paint - draws a single entry in a popped up menu * * mr - the menu instance that holds the menu item * mi - the menu item to redraw * fw - the FvwmWindow structure to check against allowed functions * */ void menuitem_paint( struct MenuItem *mi, struct MenuPaintItemParameters *mpip) { struct MenuStyle *ms = mpip->ms; struct MenuDimensions *dim = mpip->dim; static FlocaleWinString *fws = NULL; int y_offset; int text_y; int y_height; int x; int y; int lit_x_start; int lit_x_end; gc_quad_t gcs; gc_quad_t off_gcs; int cs = -1; int off_cs; FvwmRenderAttributes fra; /*Pixel fg, fgsh;*/ int relief_thickness = ST_RELIEF_THICKNESS(ms); Bool is_item_selected; Bool item_cleared = False; Bool xft_clear = False; Bool empty_inter = False; XRectangle b; Region region = None; int i; int sx1; int sx2; FlocaleFont* font; if (!mi) { return; } is_item_selected = (mi == mpip->selected_item); if (MI_IS_TITLE(mi)) { font = ST_PTITLEFONT(ms); } else { font = ST_PSTDFONT(ms); } y_offset = MI_Y_OFFSET(mi); y_height = MI_HEIGHT(mi); if (MI_IS_SELECTABLE(mi)) { text_y = y_offset + MDIM_ITEM_TEXT_Y_OFFSET(*dim); } else { text_y = y_offset + font->ascent + ST_TITLE_GAP_ABOVE(ms); } /* center text vertically if the pixmap is taller */ if (MI_PICTURE(mi)) { text_y += MI_PICTURE(mi)->height; } for (i = 0; i < mpip->used_mini_icons; i++) { y = 0; if (MI_MINI_ICON(mi)[i]) { if (MI_MINI_ICON(mi)[i]->height > y) { y = MI_MINI_ICON(mi)[i]->height; } } y -= font->height; if (y > 1) { text_y += y / 2; } } off_cs = ST_HAS_MENU_CSET(ms) ? ST_CSET_MENU(ms) : -1; /* Note: it's ok to pass a NULL label to is_function_allowed. */ if ( !IS_EWMH_DESKTOP_FW(mpip->fw) && !is_function_allowed( MI_FUNC_TYPE(mi), MI_LABEL(mi)[0], mpip->fw, RQORIG_PROGRAM_US, False)) { gcs = ST_MENU_STIPPLE_GCS(ms); off_gcs = gcs; off_cs = ST_HAS_GREYED_CSET(ms) ? ST_CSET_GREYED(ms) : -1; } else if (is_item_selected) { gcs = ST_MENU_ACTIVE_GCS(ms); off_gcs = ST_MENU_INACTIVE_GCS(ms); } else if (MI_IS_TITLE(mi)) { gcs = ST_MENU_TITLE_GCS(ms); off_gcs = ST_MENU_INACTIVE_GCS(ms); } else { gcs = ST_MENU_INACTIVE_GCS(ms); off_gcs = ST_MENU_INACTIVE_GCS(ms); } if (is_item_selected) { cs = (ST_HAS_ACTIVE_CSET(ms)) ? ST_CSET_ACTIVE(ms) : -1; } else if (MI_IS_TITLE(mi)) { cs = (ST_HAS_TITLE_CSET(ms)) ? ST_CSET_TITLE(ms) : off_cs; } else { cs = off_cs; } /* * Hilight the item. */ if (FftSupport && ST_PSTDFONT(ms)->fftf.fftfont != NULL) { xft_clear = True; } /* Hilight or clear the background. */ lit_x_start = -1; lit_x_end = -1; if (is_item_selected && (ST_DO_HILIGHT_BACK(ms) || ST_DO_HILIGHT_FORE(ms))) { /* Hilight the background. */ if (MDIM_HILIGHT_WIDTH(*dim) - 2 * relief_thickness > 0) { lit_x_start = MDIM_HILIGHT_X_OFFSET(*dim) + relief_thickness; lit_x_end = lit_x_start + MDIM_HILIGHT_WIDTH(*dim) - 2 * relief_thickness; if (ST_DO_HILIGHT_BACK(ms)) { draw_highlight_background( mpip, lit_x_start, y_offset + relief_thickness, lit_x_end - lit_x_start, y_height - relief_thickness, (cs >= 0 ? &Colorset[cs] : NULL), gcs.back_gc); item_cleared = True; } } } else if ((MI_WAS_DESELECTED(mi) && (relief_thickness > 0 || ST_DO_HILIGHT_BACK(ms) || ST_DO_HILIGHT_FORE(ms)) && (ST_FACE(ms).type != GradientMenu || ST_HAS_MENU_CSET(ms)))) { int x1; int x2; /* we clear if xft_clear and !ST_HAS_MENU_CSET(ms) as the * non colorset code is too complicate ... olicha */ int d = 0; if (MI_PREV_ITEM(mi) && mpip->selected_item == MI_PREV_ITEM(mi)) { /* Don't paint over the hilight relief. */ d = relief_thickness; } /* Undo the hilighting. */ x1 = min( MDIM_HILIGHT_X_OFFSET(*dim), MDIM_ITEM_X_OFFSET(*dim)); x2 = max( MDIM_HILIGHT_X_OFFSET(*dim) + MDIM_HILIGHT_WIDTH(*dim), MDIM_ITEM_X_OFFSET(*dim) + MDIM_ITEM_WIDTH(*dim)); clear_menu_item_background( mpip, x1, y_offset + d, x2 - x1, y_height + relief_thickness - d); item_cleared = True; } else if (MI_IS_TITLE(mi)) { lit_x_start = MDIM_ITEM_X_OFFSET(*dim); lit_x_end = lit_x_start + MDIM_ITEM_WIDTH(*dim); /* Hilight the background. */ if ( MDIM_HILIGHT_WIDTH(*dim) > 0 && ST_DO_HILIGHT_TITLE_BACK(ms)) { draw_highlight_background( mpip, lit_x_start, y_offset + relief_thickness, lit_x_end - lit_x_start, y_height - relief_thickness, (cs >= 0 ? &Colorset[cs] : NULL), gcs.back_gc); item_cleared = True; } } MI_WAS_DESELECTED(mi) = False; memset(&fra, 0, sizeof(fra)); fra.mask = 0; /* Hilight 3D */ if (is_item_selected && relief_thickness > 0) { GC rgc; GC sgc; rgc = gcs.hilight_gc; sgc = gcs.shadow_gc; if (ST_IS_ITEM_RELIEF_REVERSED(ms)) { GC tgc = rgc; /* swap gcs for reversed relief */ rgc = sgc; sgc = tgc; } if (MDIM_HILIGHT_WIDTH(*dim) - 2 * relief_thickness > 0) { /* The relief reaches down into the next item, hence * the value for the second y coordinate: * MI_HEIGHT(mi) + 1 */ RelieveRectangle( dpy, mpip->w, MDIM_HILIGHT_X_OFFSET(*dim), y_offset, MDIM_HILIGHT_WIDTH(*dim) - 1, MI_HEIGHT(mi) - 1 + relief_thickness, rgc, sgc, relief_thickness); } } /* * Draw the item itself. */ /* Calculate the separator offsets. */ if (ST_HAS_LONG_SEPARATORS(ms)) { sx1 = MDIM_ITEM_X_OFFSET(*dim) + relief_thickness; sx2 = MDIM_ITEM_X_OFFSET(*dim) + MDIM_ITEM_WIDTH(*dim) - 1 - relief_thickness; } else { sx1 = MDIM_ITEM_X_OFFSET(*dim) + relief_thickness + MENU_SEPARATOR_SHORT_X_OFFSET; sx2 = MDIM_ITEM_X_OFFSET(*dim) + MDIM_ITEM_WIDTH(*dim) - 1 - relief_thickness - MENU_SEPARATOR_SHORT_X_OFFSET; } if (MI_IS_SEPARATOR(mi)) { if (sx1 < sx2) { /* It's a separator. */ draw_separator( mpip->w, gcs.shadow_gc, gcs.hilight_gc, sx1, y_offset + y_height - MENU_SEPARATOR_HEIGHT, sx2); /* Nothing else to do. */ } return; } else if (MI_IS_TEAR_OFF_BAR(mi)) { int tx1; int tx2; tx1 = MDIM_ITEM_X_OFFSET(*dim) + relief_thickness + MENU_TEAR_OFF_BAR_X_OFFSET; tx2 = MDIM_ITEM_X_OFFSET(*dim) + MDIM_ITEM_WIDTH(*dim) - 1 - relief_thickness - MENU_TEAR_OFF_BAR_X_OFFSET; if (tx1 < tx2) { /* It's a tear off bar. */ draw_tear_off_bar( mpip->w, gcs.shadow_gc, gcs.hilight_gc, tx1, y_offset + relief_thickness + MENU_TEAR_OFF_BAR_Y_OFFSET, tx2); } /* Nothing else to do. */ return; } else if (MI_IS_TITLE(mi)) { /* Separate the title. */ if (ST_TITLE_UNDERLINES(ms) > 0 && !mpip->flags.is_first_item) { int add = (MI_IS_SELECTABLE(MI_PREV_ITEM(mi))) ? relief_thickness : 0; text_y += MENU_SEPARATOR_HEIGHT + add; y = y_offset + add; if (sx1 < sx2) { draw_separator( mpip->w, gcs.shadow_gc, gcs.hilight_gc, sx1, y, sx2); } } /* Underline the title. */ switch (ST_TITLE_UNDERLINES(ms)) { case 0: break; case 1: if (MI_NEXT_ITEM(mi) != NULL) { y = y_offset + y_height - MENU_SEPARATOR_HEIGHT; draw_separator( mpip->w, gcs.shadow_gc, gcs.hilight_gc, sx1, y, sx2); } break; default: for (i = ST_TITLE_UNDERLINES(ms); i-- > 0; ) { y = y_offset + y_height - 1 - i * MENU_UNDERLINE_HEIGHT; XDrawLine( dpy, mpip->w, gcs.shadow_gc, sx1, y, sx2, y); } break; } } /* * Draw the labels. */ if (fws == NULL) { FlocaleAllocateWinString(&fws); } fws->win = mpip->w; fws->y = text_y; fws->flags.has_colorset = 0; b.y = text_y - font->ascent; b.height = font->height + 1; /* ? */ if (!item_cleared && mpip->ev) { int u,v; if (!frect_get_seg_intersection( mpip->ev->xexpose.y, mpip->ev->xexpose.height, b.y, b.height, &u, &v)) { /* empty intersection */ empty_inter = True; } b.y = u; b.height = v; } for (i = MAX_MENU_ITEM_LABELS; i-- > 0; ) { if (!empty_inter && MI_LABEL(mi)[i] && *(MI_LABEL(mi)[i])) { Bool draw_string = True; int text_width; int tmp_cs; if (MI_LABEL_OFFSET(mi)[i] >= lit_x_start && MI_LABEL_OFFSET(mi)[i] < lit_x_end) { /* label is in hilighted area */ fws->gc = gcs.fore_gc; tmp_cs = cs; } else { /* label is in unhilighted area */ fws->gc = off_gcs.fore_gc; tmp_cs = off_cs; } if (tmp_cs >= 0) { fws->colorset = &Colorset[tmp_cs]; fws->flags.has_colorset = 1; } fws->str = MI_LABEL(mi)[i]; b.x = fws->x = MI_LABEL_OFFSET(mi)[i]; b.width = text_width = FlocaleTextWidth( font, fws->str, strlen(fws->str)); if (!item_cleared && mpip->ev) { int s_x,s_w; if (frect_get_seg_intersection( mpip->ev->xexpose.x, mpip->ev->xexpose.width, fws->x, text_width, &s_x, &s_w)) { b.x = s_x; b.width = s_w; region = XCreateRegion(); XUnionRectWithRegion( &b, region, region); fws->flags.has_clip_region = True; fws->clip_region = region; draw_string = True; XSetRegion(dpy, fws->gc, region); } else { /* empty intersection */ draw_string = False; } } if (draw_string) { if (!item_cleared && xft_clear) { clear_menu_item_background( mpip, b.x, b.y, b.width, b.height); } FlocaleDrawString(dpy, font, fws, 0); /* hot key */ if (MI_HAS_HOTKEY(mi) && !MI_IS_TITLE(mi) && (!MI_IS_HOTKEY_AUTOMATIC(mi) || ST_USE_AUTOMATIC_HOTKEYS(ms)) && MI_HOTKEY_COLUMN(mi) == i) { FlocaleDrawUnderline( dpy, ST_PSTDFONT(ms), fws, MI_HOTKEY_COFFSET(mi)); } } } if (region) { XDestroyRegion(region); region = None; fws->flags.has_clip_region = False; fws->clip_region = None; XSetClipMask(dpy, fws->gc, None); } } /* * Draw the submenu triangle. */ if (MI_IS_POPUP(mi)) { GC tmp_gc; if (MDIM_TRIANGLE_X_OFFSET(*dim) >= lit_x_start && MDIM_TRIANGLE_X_OFFSET(*dim) < lit_x_end && is_item_selected) { /* triangle is in hilighted area */ if (ST_TRIANGLES_USE_FORE(ms)) { tmp_gc = gcs.fore_gc; } else { tmp_gc = gcs.hilight_gc; } } else { /* triangle is in unhilighted area */ if (ST_TRIANGLES_USE_FORE(ms)) { tmp_gc = off_gcs.fore_gc; } else { tmp_gc = off_gcs.hilight_gc; } } y = y_offset + (y_height - MENU_TRIANGLE_HEIGHT + relief_thickness) / 2; if (ST_TRIANGLES_USE_FORE(ms)) { DrawTrianglePattern( dpy, mpip->w, tmp_gc, tmp_gc, tmp_gc, MDIM_TRIANGLE_X_OFFSET(*dim), y, MENU_TRIANGLE_WIDTH, MENU_TRIANGLE_HEIGHT, 0, (mpip->flags.is_left_triangle) ? 'l' : 'r', ST_HAS_TRIANGLE_RELIEF(ms), !ST_HAS_TRIANGLE_RELIEF(ms), is_item_selected); } else { DrawTrianglePattern( dpy, mpip->w, gcs.hilight_gc, gcs.shadow_gc, tmp_gc, MDIM_TRIANGLE_X_OFFSET(*dim), y, MENU_TRIANGLE_WIDTH, MENU_TRIANGLE_HEIGHT, 0, (mpip->flags.is_left_triangle) ? 'l' : 'r', ST_HAS_TRIANGLE_RELIEF(ms), !ST_HAS_TRIANGLE_RELIEF(ms), is_item_selected); } } /* * Draw the item picture. */ if (MI_PICTURE(mi)) { GC tmp_gc; int tmp_cs; Bool draw_picture = True; x = menudim_middle_x_offset(mpip->dim) - MI_PICTURE(mi)->width / 2; y = y_offset + ((MI_IS_SELECTABLE(mi)) ? relief_thickness : 0); if (x >= lit_x_start && x < lit_x_end) { tmp_gc = gcs.fore_gc; tmp_cs = cs; } else { tmp_gc = off_gcs.fore_gc; tmp_cs = off_cs; } fra.mask = FRAM_DEST_IS_A_WINDOW; if (tmp_cs >= 0) { fra.mask |= FRAM_HAVE_ICON_CSET; fra.colorset = &Colorset[tmp_cs]; } b.x = x; b.y = y; b.width = MI_PICTURE(mi)->width; b.height = MI_PICTURE(mi)->height; if (!item_cleared && mpip->ev) { if (!frect_get_intersection( mpip->ev->xexpose.x, mpip->ev->xexpose.y, mpip->ev->xexpose.width, mpip->ev->xexpose.height, b.x, b.y, b.width, b.height, &b)) { draw_picture = False; } } if (draw_picture) { if ( !item_cleared && (MI_PICTURE(mi)->alpha != None || (tmp_cs >=0 && Colorset[tmp_cs].icon_alpha_percent < 100))) { clear_menu_item_background( mpip, b.x, b.y, b.width, b.height); } PGraphicsRenderPicture( dpy, mpip->w, MI_PICTURE(mi), &fra, mpip->w, tmp_gc, Scr.MonoGC, Scr.AlphaGC, b.x - x, b.y - y, b.width, b.height, b.x, b.y, b.width, b.height, False); } } /* * Draw the mini icons. */ for (i = 0; i < mpip->used_mini_icons; i++) { int k; Bool draw_picture = True; /* We need to reverse the mini icon order for left submenu * style. */ k = (ST_USE_LEFT_SUBMENUS(ms)) ? mpip->used_mini_icons - 1 - i : i; if (MI_MINI_ICON(mi)[i]) { GC tmp_gc; int tmp_cs; if (MI_PICTURE(mi)) { y = y_offset + MI_HEIGHT(mi) - MI_MINI_ICON(mi)[i]->height; } else { y = y_offset + (MI_HEIGHT(mi) + ((MI_IS_SELECTABLE(mi)) ? relief_thickness : 0) - MI_MINI_ICON(mi)[i]->height) / 2; } if (MDIM_ICON_X_OFFSET(*dim)[k] >= lit_x_start && MDIM_ICON_X_OFFSET(*dim)[k] < lit_x_end) { /* icon is in hilighted area */ tmp_gc = gcs.fore_gc; tmp_cs = cs; } else { /* icon is in unhilighted area */ tmp_gc = off_gcs.fore_gc; tmp_cs = off_cs; } fra.mask = FRAM_DEST_IS_A_WINDOW; if (tmp_cs >= 0) { fra.mask |= FRAM_HAVE_ICON_CSET; fra.colorset = &Colorset[tmp_cs]; } b.x = MDIM_ICON_X_OFFSET(*dim)[k]; b.y = y; b.width = MI_MINI_ICON(mi)[i]->width; b.height = MI_MINI_ICON(mi)[i]->height; if (!item_cleared && mpip->ev) { if (!frect_get_intersection( mpip->ev->xexpose.x, mpip->ev->xexpose.y, mpip->ev->xexpose.width, mpip->ev->xexpose.height, b.x, b.y, b.width, b.height, &b)) { draw_picture = False; } } if (draw_picture) { if (!item_cleared && (MI_MINI_ICON(mi)[i]->alpha != None || (tmp_cs >=0 && Colorset[tmp_cs].icon_alpha_percent < 100))) { clear_menu_item_background( mpip, b.x, b.y, b.width, b.height); } PGraphicsRenderPicture( dpy, mpip->w, MI_MINI_ICON(mi)[i], &fra, mpip->w, tmp_gc, Scr.MonoGC, Scr.AlphaGC, b.x - MDIM_ICON_X_OFFSET(*dim)[k], b.y - y, b.width, b.height, b.x, b.y, b.width, b.height, False); } } } return; } /* returns the center y coordinate of the menu item */ int menuitem_middle_y_offset(struct MenuItem *mi, struct MenuStyle *ms) { int r; if (!mi) { return ST_BORDER_WIDTH(ms); } r = (MI_IS_SELECTABLE(mi)) ? ST_RELIEF_THICKNESS(ms) : 0; return MI_Y_OFFSET(mi) + (MI_HEIGHT(mi) + r) / 2; } fvwm-2.6.5.orig/fvwm/session.c0000644000175000017500000012244311622413321014431 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* This file is strongly based on the corresponding files from twm and enlightenment. */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #ifdef HAVE_GETPWUID #include #endif #include #include #include #include "libs/fvwmlib.h" #include "libs/FSMlib.h" #include "libs/Strings.h" #include "libs/System.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "add_window.h" #include "misc.h" #include "screen.h" #include "session.h" #include "module_list.h" #include "module_interface.h" #include "stack.h" #include "icccm2.h" #include "virtual.h" #include "geometry.h" #include "move_resize.h" /* ---------------------------- local definitions -------------------------- */ /*#define FVWM_SM_DEBUG_PROTO*/ /*#define FVWM_SM_DEBUG_WINMATCH*/ /*#define FVWM_SM_DEBUG_FILES*/ /* ---------------------------- local macros ------------------------------- */ #define xstreq(a,b) ((!a && !b) || (a && b && (strcmp(a,b)==0))) /* ---------------------------- imports ------------------------------------ */ extern Bool Restarting; extern int master_pid; extern char **g_argv; extern int g_argc; /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef struct _match { unsigned long win; char *client_id; char *res_name; char *res_class; char *window_role; char *wm_name; int wm_command_count; char **wm_command; int x, y, w, h, icon_x, icon_y; int x_max, y_max, w_max, h_max; int width_defect_max, height_defect_max; int max_x_offset, max_y_offset; int desktop; int layer; int default_layer; int placed_by_button; int used; int gravity; unsigned long ewmh_hint_desktop; window_flags flags; } Match; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static char *previous_sm_client_id = NULL; static char *sm_client_id = NULL; static Bool sent_save_done = 0; static char *real_state_filename = NULL; static Bool going_to_restart = False; static FIceIOErrorHandler prev_handler; static FSmcConn sm_conn = NULL; static int num_match = 0; static Match *matches = NULL; static Bool does_file_version_match = False; static Bool do_preserve_state = True; /* ---------------------------- exported variables (globals) --------------- */ int sm_fd = -1; /* ---------------------------- local functions ---------------------------- */ static char *duplicate(const char *s) { int l; char *r; if (!s) return NULL; l = strlen(s); r = (char *) safemalloc (sizeof(char)*(l+1)); strncpy(r, s, l+1); return r; } static char *get_version_string(void) { /* migo (14-Mar-2001): it is better to manually update a version string * in the stable branch, otherwise saving sessions becomes useless */ return CatString3(VERSION, ", ", __DATE__); /* return "2.6-0"; */ } static char *unspace_string(const char *str) { static const char *spaces = " \t\n"; char *tr_str = CatString2(str, NULL); int i; if (!tr_str) { return NULL; } for (i = 0; i < strlen(spaces); i++) { char *ptr = tr_str; while ((ptr = strchr(ptr, spaces[i])) != NULL) { *(ptr++) = '_'; } } return tr_str; } /* * It is a bit ugly to have a separate file format for * config files and session save files. The proper way * to do this may be to extend the config file format * to allow the specification of everything we need * to save here. Then the option "-restore xyz" could * be replaced by "-f xyz". */ static int SaveGlobalState(FILE *f) { fprintf(f, "[GLOBAL]\n"); fprintf(f, " [DESKTOP] %i\n", Scr.CurrentDesk); fprintf(f, " [VIEWPORT] %i %i %i %i\n", Scr.Vx, Scr.Vy, Scr.VxMax, Scr.VyMax); fprintf(f, " [SCROLL] %i %i %i %i %i\n", Scr.EdgeScrollX, Scr.EdgeScrollY, Scr.ScrollDelay, !!(Scr.flags.do_edge_wrap_x), !!(Scr.flags.do_edge_wrap_y)); fprintf(f, " [MISC] %i %i %i\n", Scr.ClickTime, Scr.ColormapFocus, Scr.ColorLimit); fprintf( f, " [STYLE] %i %i\n", Scr.gs.do_emulate_mwm, Scr.gs.do_emulate_win); return 1; } static void set_real_state_filename(char *filename) { if (!SessionSupport) { return; } if (real_state_filename) { free(real_state_filename); } real_state_filename = safestrdup(filename); return; } static char *get_unique_state_filename(void) { const char *path = getenv("SM_SAVE_DIR"); char *filename; int fd; if (!SessionSupport) { return NULL; } if (!path) { path = getenv ("HOME"); } #ifdef HAVE_GETPWUID if (!path) { struct passwd *pwd; pwd = getpwuid(getuid()); if (pwd) { path = pwd->pw_dir; } } #endif if (!path) { return NULL; } filename = safestrdup(CatString2(path, "/.fs-XXXXXX")); fd = fvwm_mkstemp(filename); if (fd == -1) { free (filename); filename = NULL; } else { close (fd); } return filename; } static char * GetWindowRole(Window window) { XTextProperty tp; if (XGetTextProperty (dpy, window, &tp, _XA_WM_WINDOW_ROLE)) { if (tp.encoding == XA_STRING && tp.format == 8 && tp.nitems != 0) { return ((char *) tp.value); } } if (XGetTextProperty (dpy, window, &tp, _XA_WINDOW_ROLE)) { if (tp.encoding == XA_STRING && tp.format == 8 && tp.nitems != 0) { return ((char *) tp.value); } } return NULL; } static char * GetClientID(FvwmWindow *fw) { char *client_id = NULL; Window client_leader = None; Window window; XTextProperty tp; Atom actual_type; int actual_format; unsigned long nitems; unsigned long bytes_after; unsigned char *prop = NULL; window = FW_W(fw); if (XGetWindowProperty( dpy, window, _XA_WM_CLIENT_LEADER, 0L, 1L, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, &prop) == Success) { if (actual_type == XA_WINDOW && actual_format == 32 && nitems == 1 && bytes_after == 0) { client_leader = (Window)(*(long *)prop); } } if (!client_leader && fw->wmhints && (fw->wmhints->flags & WindowGroupHint)) { client_leader = fw->wmhints->window_group; } if (client_leader) { if ( XGetTextProperty( dpy, client_leader, &tp, _XA_SM_CLIENT_ID)) { if (tp.encoding == XA_STRING && tp.format == 8 && tp.nitems != 0) { client_id = (char *) tp.value; } } } if (prop) { XFree (prop); } return client_id; } /* ** Verify the current fvwm version with the version that stroed the state file. ** No state will be restored if versions don't match. */ static Bool VerifyVersionInfo(char *filename) { FILE *f; char s[4096], s1[4096]; if (!filename || !*filename) { return False; } if ((f = fopen(filename, "r")) == NULL) { return False; } while (fgets(s, sizeof(s), f)) { sscanf(s, "%4000s", s1); if (!strcmp(s1, "[FVWM_VERSION]")) { char *current_v = get_version_string(); sscanf(s, "%*s %[^\n]", s1); if (strcmp(s1, current_v) == 0) { does_file_version_match = True; } else { fvwm_msg( ERR, "VerifyVersionInfo", "State file version (%s) does not" " match the current version (%s), " "state file is ignored.", s1, current_v); break; } } } fclose(f); return does_file_version_match; } static int SaveVersionInfo(FILE *f) { fprintf(f, "[FVWM_VERSION] %s\n", get_version_string()); return 1; } static int SaveWindowStates(FILE *f) { char *client_id; char *window_role; char **wm_command; int wm_command_count; FvwmWindow *ewin; rectangle save_g; rectangle ig; int i; int layer; for (ewin = get_next_window_in_stack_ring(&Scr.FvwmRoot); ewin != &Scr.FvwmRoot; ewin = get_next_window_in_stack_ring(ewin)) { Bool is_icon_sticky_across_pages; if (!XGetGeometry( dpy, FW_W(ewin), &JunkRoot, &JunkX, &JunkY, (unsigned int*)&JunkWidth, (unsigned int*)&JunkHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth)) { /* Don't save the state of windows that already died * (i.e. modules)! */ continue; } is_icon_sticky_across_pages = is_window_sticky_across_pages(ewin); wm_command = NULL; wm_command_count = 0; client_id = GetClientID(ewin); if (!client_id) { /* no client id, some session manager do not manage * such client ... this can cause problem */ if (XGetCommand( dpy, FW_W(ewin), &wm_command, &wm_command_count) && wm_command && wm_command_count > 0) { /* ok */ } else { /* No client id and no WM_COMMAND, the client * cannot be managed by the sessiom manager * skip it! */ /* TA: 20110611 - But actually, this breaks * those applications which don't set the * WM_COMMAND XAtom anymore. The ICCCM * deprecated this at version 2.0 -- and its * lack of existence here shouldn't be a * problem. Let newer session managers handle * the error if it even matters. */ if (!Restarting) { if (wm_command) { XFreeStringList(wm_command); wm_command = NULL; } /* TA: 20110611 - But see above. We * no longer skip clients who don't * set this legacy field. */ /* continue; */ } } } fprintf(f, "[CLIENT] %lx\n", FW_W(ewin)); if (client_id) { fprintf(f, " [CLIENT_ID] %s\n", client_id); XFree(client_id); } window_role = GetWindowRole(FW_W(ewin)); if (window_role) { fprintf(f, " [WINDOW_ROLE] %s\n", window_role); XFree(window_role); } if (client_id && window_role) { /* we have enough information */ } else { if (ewin->class.res_class) { fprintf(f, " [RES_NAME] %s\n", ewin->class.res_name); } if (ewin->class.res_name) { fprintf(f, " [RES_CLASS] %s\n", ewin->class.res_class); } if (ewin->name.name) { fprintf(f, " [WM_NAME] %s\n", ewin->name.name); } if (wm_command && wm_command_count > 0) { fprintf(f, " [WM_COMMAND] %i", wm_command_count); for (i = 0; i < wm_command_count; i++) { fprintf(f, " %s", unspace_string(wm_command[i])); } fprintf(f, "\n"); } } /* !window_role */ if (wm_command) { XFreeStringList(wm_command); wm_command = NULL; } gravity_get_naked_geometry( ewin->hints.win_gravity, ewin, &save_g, &ewin->g.normal); if (IS_STICKY_ACROSS_PAGES(ewin)) { save_g.x -= Scr.Vx; save_g.y -= Scr.Vy; } get_visible_icon_geometry(ewin, &ig); fprintf( f, " [GEOMETRY] %i %i %i %i %i %i %i %i %i %i %i %i" " %i %i %i\n", save_g.x, save_g.y, save_g.width, save_g.height, ewin->g.max.x, ewin->g.max.y, ewin->g.max.width, ewin->g.max.height, ewin->g.max_defect.width, ewin->g.max_defect.height, ig.x + ((!is_icon_sticky_across_pages) ? Scr.Vx : 0), ig.y + ((!is_icon_sticky_across_pages) ? Scr.Vy : 0), ewin->hints.win_gravity, ewin->g.max_offset.x, ewin->g.max_offset.y); fprintf(f, " [DESK] %i\n", ewin->Desk); /* set the layer to the default layer if the layer has been * set by an ewmh hint */ layer = get_layer(ewin); if (layer == ewin->ewmh_hint_layer && layer > 0) { layer = Scr.DefaultLayer; } fprintf(f, " [LAYER] %i %i\n", layer, ewin->default_layer); fprintf(f, " [PLACED_BY_BUTTON] %i\n", ewin->placed_by_button); fprintf(f, " [EWMH_DESKTOP] %lu\n", ewin->ewmh_hint_desktop); fprintf(f, " [FLAGS] "); for (i = 0; i < sizeof(window_flags); i++) { fprintf(f, "%02x ", (int)(((unsigned char *)&(ewin->flags))[i])); } fprintf(f, "\n"); } return 1; } /* This complicated logic is from twm, where it is explained */ static Bool matchWin(FvwmWindow *w, Match *m) { char *client_id = NULL; char *window_role = NULL; char **wm_command = NULL; int wm_command_count = 0, i; int found; found = 0; client_id = GetClientID(w); if (Restarting) { if (FW_W(w) == m->win) { found = 1; } } else if (xstreq(client_id, m->client_id)) { /* client_id's match */ window_role = GetWindowRole(FW_W(w)); if (client_id && (window_role || m->window_role)) { /* We have or had a window role, base decision on it */ found = xstreq(window_role, m->window_role); } else if (xstreq(w->class.res_name, m->res_name) && xstreq(w->class.res_class, m->res_class) && (IS_NAME_CHANGED(w) || IS_NAME_CHANGED(m) || xstreq(w->name.name, m->wm_name))) { if (client_id) { /* If we have a client_id, we don't * compare WM_COMMAND, since it will be * different. */ found = 1; } else { /* for non-SM-aware clients we also * compare WM_COMMAND */ if (!XGetCommand( dpy, FW_W(w), &wm_command, &wm_command_count)) { wm_command = NULL; wm_command_count = 0; } if (wm_command_count == m->wm_command_count) { for (i = 0; i < wm_command_count; i++) { if (strcmp(unspace_string( wm_command[i]), m->wm_command[i])!=0) { break; } } if (i == wm_command_count) { /* migo (21/Oct/1999): * on restarts compare * window ids too */ /* But if we restart we only need * to compare window ids * olicha (2005-01-06) */ found = 1; } } /* if (wm_command_count ==... */ } /* else if res_class, res_name and wm_name agree */ } /* else no window roles */ } /* if client_id's agree */ #ifdef FVWM_SM_DEBUG_WINMATCH fprintf(stderr, "\twin(%s, %s, %s, %s, %s,", w->class.res_name, w->class.res_class, w->name.name, (client_id)? client_id:"(null)", (window_role)? window_role:"(null)"); if (wm_command) { for (i = 0; i < wm_command_count; i++) { fprintf(stderr," %s", wm_command[i]); } fprintf(stderr,","); } else { fprintf(stderr," no_wmc,"); } fprintf(stderr," %d)", IS_NAME_CHANGED(w)); fprintf(stderr,"\n[%d]", found); fprintf(stderr, "\tmat(%s, %s, %s, %s, %s,", m->res_name, m->res_class, m->wm_name, (m->client_id)?m->client_id:"(null)", (m->window_role)?m->window_role:"(null)"); if (m->wm_command) { for (i = 0; i < m->wm_command_count; i++) { fprintf(stderr," %s", m->wm_command[i]); } fprintf(stderr,","); } else { fprintf(stderr," no_wmc,"); } fprintf(stderr," %d)\n\n", IS_NAME_CHANGED(m)); #endif if (client_id) { XFree(client_id); } if (window_role) { XFree(window_role); } if (wm_command) { XFreeStringList (wm_command); } return found; } static int save_state_file(char *filename) { FILE *f; int success; if (!filename || !*filename) { return 0; } if ((f = fopen(filename, "w")) == NULL) { return 0; } fprintf(f, "# This file is generated by fvwm." " It stores global and window states.\n"); fprintf(f, "# Normally, you must never delete this file," " it will be auto-deleted.\n\n"); if (SessionSupport && going_to_restart) { fprintf(f, "[REAL_STATE_FILENAME] %s\n", real_state_filename); going_to_restart = False; /* not needed */ } success = do_preserve_state ? SaveVersionInfo(f) && SaveWindowStates(f) && SaveGlobalState(f) : 1; do_preserve_state = True; if (fclose(f) != 0) return 0; #ifdef FVWM_SM_DEBUG_FILES system(CatString3( "mkdir -p /tmp/fs-save; cp ", filename, " /tmp/fs-save")); #endif #if defined(FVWM_SM_DEBUG_PROTO) || defined(FVWM_SM_DEBUG_FILES) fprintf(stderr, "[FVWM_SMDEBUG] Saving %s\n", filename); #endif return success; } static void set_sm_properties(FSmcConn sm_conn, char *filename, char hint) { FSmProp prop1, prop2, prop3, prop4, prop5, prop6, prop7, *props[7]; FSmPropValue prop1val, prop2val, prop3val, prop4val, prop7val; struct passwd *pwd; char *user_id; char screen_num[32]; int numVals, i, priority = 30; Bool is_xsm_detected = False; if (!SessionSupport) { return; } #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr, "[FVWM_SMDEBUG][set_sm_properties] state filename: %s%s\n", filename ? filename : "(null)", sm_conn ? "" : " - not connected"); #endif if (!sm_conn) { return; } pwd = getpwuid (getuid()); user_id = pwd->pw_name; prop1.name = FSmProgram; prop1.type = FSmARRAY8; prop1.num_vals = 1; prop1.vals = &prop1val; prop1val.value = g_argv[0]; prop1val.length = strlen (g_argv[0]); prop2.name = FSmUserID; prop2.type = FSmARRAY8; prop2.num_vals = 1; prop2.vals = &prop2val; prop2val.value = (FSmPointer) user_id; prop2val.length = strlen (user_id); prop3.name = FSmRestartStyleHint; prop3.type = FSmCARD8; prop3.num_vals = 1; prop3.vals = &prop3val; prop3val.value = (FSmPointer) &hint; prop3val.length = 1; prop4.name = "_GSM_Priority"; prop4.type = FSmCARD8; prop4.num_vals = 1; prop4.vals = &prop4val; prop4val.value = (FSmPointer) &priority; prop4val.length = 1; sprintf(screen_num, "%d", (int)Scr.screen); prop5.name = FSmCloneCommand; prop5.type = FSmLISTofARRAY8; prop5.vals = (FSmPropValue *)malloc((g_argc + 2) * sizeof (FSmPropValue)); numVals = 0; for (i = 0; i < g_argc; i++) { if (strcmp (g_argv[i], "-clientId") == 0 || strcmp (g_argv[i], "-restore") == 0 || strcmp (g_argv[i], "-d") == 0 || (strcmp (g_argv[i], "-s") == 0 && i+1 < g_argc && g_argv[i+1][0] != '-')) { i++; } else if (strcmp (g_argv[i], "-s") != 0) { prop5.vals[numVals].value = (FSmPointer) g_argv[i]; prop5.vals[numVals++].length = strlen (g_argv[i]); } } prop5.vals[numVals].value = (FSmPointer) "-s"; prop5.vals[numVals++].length = 2; prop5.vals[numVals].value = (FSmPointer) screen_num; prop5.vals[numVals++].length = strlen (screen_num); prop5.num_vals = numVals; if (filename) { prop6.name = FSmRestartCommand; prop6.type = FSmLISTofARRAY8; prop6.vals = (FSmPropValue *)malloc( (g_argc + 6) * sizeof (FSmPropValue)); numVals = 0; for (i = 0; i < g_argc; i++) { if (strcmp (g_argv[i], "-clientId") == 0 || strcmp (g_argv[i], "-restore") == 0 || strcmp (g_argv[i], "-d") == 0 || (strcmp (g_argv[i], "-s") == 0 && i+1 < g_argc && g_argv[i+1][0] != '-')) { i++; } else if (strcmp (g_argv[i], "-s") != 0) { prop6.vals[numVals].value = (FSmPointer) g_argv[i]; prop6.vals[numVals++].length = strlen (g_argv[i]); } } prop6.vals[numVals].value = (FSmPointer) "-s"; prop6.vals[numVals++].length = 2; prop6.vals[numVals].value = (FSmPointer) screen_num; prop6.vals[numVals++].length = strlen (screen_num); prop6.vals[numVals].value = (FSmPointer) "-clientId"; prop6.vals[numVals++].length = 9; prop6.vals[numVals].value = (FSmPointer) sm_client_id; prop6.vals[numVals++].length = strlen (sm_client_id); prop6.vals[numVals].value = (FSmPointer) "-restore"; prop6.vals[numVals++].length = 8; prop6.vals[numVals].value = (FSmPointer) filename; prop6.vals[numVals++].length = strlen (filename); prop6.num_vals = numVals; prop7.name = FSmDiscardCommand; is_xsm_detected = StrEquals(getenv("SESSION_MANAGER_NAME"), "xsm"); if (is_xsm_detected) { /* the protocol spec says that the discard command should be LISTofARRAY8 on posix systems, but xsm demands that it be ARRAY8. */ char *discardCommand = alloca( (10 + strlen(filename)) * sizeof(char)); sprintf (discardCommand, "rm -f '%s'", filename); prop7.type = FSmARRAY8; prop7.num_vals = 1; prop7.vals = &prop7val; prop7val.value = (FSmPointer) discardCommand; prop7val.length = strlen (discardCommand); } else { prop7.type = FSmLISTofARRAY8; prop7.num_vals = 3; prop7.vals = (FSmPropValue *) malloc ( 3 * sizeof (FSmPropValue)); prop7.vals[0].value = "rm"; prop7.vals[0].length = 2; prop7.vals[1].value = "-f"; prop7.vals[1].length = 2; prop7.vals[2].value = filename; prop7.vals[2].length = strlen (filename); } } props[0] = &prop1; props[1] = &prop2; props[2] = &prop3; props[3] = &prop4; props[4] = &prop5; if (filename) { props[5] = &prop6; props[6] = &prop7; FSmcSetProperties (sm_conn, 7, props); free ((char *) prop6.vals); if (!is_xsm_detected) { free ((char *) prop7.vals); } } else { FSmcSetProperties (sm_conn, 5, props); } free ((char *) prop5.vals); } static void callback_save_yourself2(FSmcConn sm_conn, FSmPointer client_data) { Bool success = 0; char *filename; if (!SessionSupport) { return; } filename = get_unique_state_filename(); #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr, "[FVWM_SMDEBUG][callback_save_yourself2]\n"); #endif success = save_state_file(filename); if (success) { set_sm_properties(sm_conn, filename, FSmRestartIfRunning); set_real_state_filename(filename); } free(filename); FSmcSaveYourselfDone (sm_conn, success); sent_save_done = 1; } static void callback_save_yourself(FSmcConn sm_conn, FSmPointer client_data, int save_style, Bool shutdown, int interact_style, Bool fast) { if (!SessionSupport) { return; } #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr, "[FVWM_SMDEBUG][callback_save_yourself] " "(save=%d, shut=%d, intr=%d, fast=%d)\n", save_style, shutdown, interact_style, fast); #endif if (save_style == FSmSaveGlobal) { /* nothing to do */ #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr, "[FVWM_SMDEBUG][callback_save_yourself] " "Global Save type ... do nothing\n"); #endif FSmcSaveYourselfDone (sm_conn, True); sent_save_done = 1; return; } #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr, "[FVWM_SMDEBUG][callback_save_yourself] " "Both or Local save type, going to phase 2 ..."); #endif if (!FSmcRequestSaveYourselfPhase2( sm_conn, callback_save_yourself2, NULL)) { FSmcSaveYourselfDone (sm_conn, False); sent_save_done = 1; #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr, " failed!\n"); #endif } else { #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr, " OK\n"); #endif sent_save_done = 0; } return; } static void callback_die(FSmcConn sm_conn, FSmPointer client_data) { if (!SessionSupport) { return; } #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr, "[FVWM_SMDEBUG][callback_die]\n"); #endif if (FSmcCloseConnection(sm_conn, 0, NULL) != FSmcClosedNow) { /* go a head any way ? */ } sm_fd = -1; if (master_pid != getpid()) { kill(master_pid, SIGTERM); } Done(0, NULL); } static void callback_save_complete(FSmcConn sm_conn, FSmPointer client_data) { if (!SessionSupport) { return; } #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr, "[FVWM_SMDEBUG][callback_save_complete]\n"); #endif return; } static void callback_shutdown_cancelled(FSmcConn sm_conn, FSmPointer client_data) { if (!SessionSupport) { return; } #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr, "[FVWM_SMDEBUG][callback_shutdown_cancelled]\n"); #endif if (!sent_save_done) { FSmcSaveYourselfDone(sm_conn, False); sent_save_done = 1; } return; } /* the following is taken from xsm */ static void MyIoErrorHandler(FIceConn ice_conn) { if (!SessionSupport) { return; } if (prev_handler) { (*prev_handler) (ice_conn); } return; } static void InstallIOErrorHandler(void) { FIceIOErrorHandler default_handler; if (!SessionSupport) { return; } prev_handler = FIceSetIOErrorHandler (NULL); default_handler = FIceSetIOErrorHandler (MyIoErrorHandler); if (prev_handler == default_handler) { prev_handler = NULL; } return; } /* ---------------------------- interface functions ------------------------ */ void LoadGlobalState(char *filename) { FILE *f; char s[4096], s1[4096]; /* char s2[256]; */ int i1, i2, i3, i4; if (!does_file_version_match) { return; } if (!filename || !*filename) { return; } if ((f = fopen(filename, "r")) == NULL) { return; } while (fgets(s, sizeof(s), f)) { i1 = 0; i2 = 0; i3 = 0; i4 = 0; sscanf(s, "%4000s", s1); /* If we are restarting, [REAL_STATE_FILENAME] points * to the file containing the true session state. */ if (SessionSupport && !strcmp(s1, "[REAL_STATE_FILENAME]")) { /* migo: temporarily (?) moved to LoadWindowStates (trick for gnome-session) sscanf(s, "%*s %s", s2); set_sm_properties(sm_conn, s2, FSmRestartIfRunning); set_real_state_filename(s2); */ } else if (!strcmp(s1, "[DESKTOP]")) { sscanf(s, "%*s %i", &i1); goto_desk(i1); } else if (!strcmp(s1, "[VIEWPORT]")) { sscanf(s, "%*s %i %i %i %i", &i1, &i2, &i3, &i4); /* migo: we don't want to lose DeskTopSize in * configurations, and it does not work well * anyways - Gnome is not updated Scr.VxMax = i3; Scr.VyMax = i4; */ MoveViewport(i1, i2, True); } #if 0 /* migo (08-Dec-1999): we don't want to eliminate config yet */ else if (/*!Restarting*/ 0) { /* Matthias: We don't want to restore too much * state if we are restarting, since that * would make restarting useless for rereading * changed rc files. */ if (!strcmp(s1, "[SCROLL]")) { sscanf(s, "%*s %i %i %i %i ", &i1, &i2, &i3, &i4); Scr.EdgeScrollX = i1; Scr.EdgeScrollY = i2; Scr.ScrollDelay = i3; if (i4) { Scr.flags.edge_wrap_x = 1; } else { Scr.flags.edge_wrap_x = 0; } if (i3) { Scr.flags.edge_wrap_y = 1; } else { Scr.flags.edge_wrap_y = 0; } } else if (!strcmp(s1, "[MISC]")) { sscanf(s, "%*s %i %i %i", &i1, &i2, &i3); Scr.ClickTime = i1; Scr.ColormapFocus = i2; Scr.ColorLimit = i3; } else if (!strcmp(s1, "[STYLE]")) { sscanf(s, "%*s %i %i", &i1, &i2); Scr.gs.EmulateMWM = i1; Scr.gs.EmulateWIN = i2; } } #endif } fclose(f); return; } void DisableRestoringState(void) { num_match = 0; return; } void LoadWindowStates(char *filename) { FILE *f; char s[4096], s1[4096]; char *s2; int i, pos, pos1; unsigned long w; int n; if (!VerifyVersionInfo(filename)) { return; } if (!filename || !*filename) { return; } set_real_state_filename(filename); if ((f = fopen(filename, "r")) == NULL) { return; } #if defined(FVWM_SM_DEBUG_PROTO) || defined(FVWM_SM_DEBUG_FILES) fprintf(stderr, "[FVWM_SMDEBUG] Loading %s\n", filename); #endif #ifdef FVWM_SM_DEBUG_FILES system(CatString3( "mkdir -p /tmp/fs-load; cp ", filename, " /tmp/fs-load")); #endif while (fgets(s, sizeof(s), f)) { n = 0; sscanf(s, "%4000s%n", s1, &n); if (!SessionSupport /* migo: temporarily */ && !strcmp(s1, "[REAL_STATE_FILENAME]")) { sscanf(s, "%*s %s", s1); set_sm_properties(sm_conn, s1, FSmRestartIfRunning); set_real_state_filename(s1); } else if (!strcmp(s1, "[CLIENT]")) { sscanf(s, "%*s %lx", &w); num_match++; matches = (Match *)saferealloc( (void *)matches, sizeof(Match) * num_match); matches[num_match - 1].win = w; matches[num_match - 1].client_id = NULL; matches[num_match - 1].res_name = NULL; matches[num_match - 1].res_class = NULL; matches[num_match - 1].window_role = NULL; matches[num_match - 1].wm_name = NULL; matches[num_match - 1].wm_command_count = 0; matches[num_match - 1].wm_command = NULL; matches[num_match - 1].x = 0; matches[num_match - 1].y = 0; matches[num_match - 1].w = 100; matches[num_match - 1].h = 100; matches[num_match - 1].x_max = 0; matches[num_match - 1].y_max = 0; matches[num_match - 1].w_max = Scr.MyDisplayWidth; matches[num_match - 1].h_max = Scr.MyDisplayHeight; matches[num_match - 1].width_defect_max = 0; matches[num_match - 1].height_defect_max = 0; matches[num_match - 1].icon_x = 0; matches[num_match - 1].icon_y = 0; matches[num_match - 1].desktop = 0; matches[num_match - 1].layer = 0; matches[num_match - 1].default_layer = 0; memset(&(matches[num_match - 1].flags), 0, sizeof(window_flags)); matches[num_match - 1].used = 0; } else if (!strcmp(s1, "[GEOMETRY]")) { sscanf(s, "%*s %i %i %i %i %i %i %i %i %i %i %i %i" " %i %i %i", &(matches[num_match - 1].x), &(matches[num_match - 1].y), &(matches[num_match - 1].w), &(matches[num_match - 1].h), &(matches[num_match - 1].x_max), &(matches[num_match - 1].y_max), &(matches[num_match - 1].w_max), &(matches[num_match - 1].h_max), &(matches[num_match - 1].width_defect_max), &(matches[num_match - 1].height_defect_max), &(matches[num_match - 1].icon_x), &(matches[num_match - 1].icon_y), &(matches[num_match - 1].gravity), &(matches[num_match - 1].max_x_offset), &(matches[num_match - 1].max_y_offset)); } else if (!strcmp(s1, "[DESK]")) { sscanf(s, "%*s %i", &(matches[num_match - 1].desktop)); } else if (!strcmp(s1, "[LAYER]")) { sscanf(s, "%*s %i %i", &(matches[num_match - 1].layer), &(matches[num_match - 1].default_layer)); } else if (!strcmp(s1, "[PLACED_BY_BUTTON]")) { sscanf(s, "%*s %i", &(matches[num_match - 1].placed_by_button)); } else if (!strcmp(s1, "[EWMH_DESKTOP]")) { sscanf(s, "%*s %lu", &(matches[num_match - 1].ewmh_hint_desktop)); } else if (!strcmp(s1, "[FLAGS]")) { char *ts = s; /* skip [FLAGS] */ while (*ts != ']') { ts++; } ts++; for (i = 0; i < sizeof(window_flags); i++) { unsigned int f; sscanf(ts, "%02x ", &f); ((unsigned char *)& (matches[num_match-1].flags))[i] = f; ts += 3; } } else if (!strcmp(s1, "[CLIENT_ID]")) { s2 = s + n; if (*s2 != 0) { s2++; } sscanf(s2, "%[^\n]", s1); matches[num_match - 1].client_id = duplicate(s1); } else if (!strcmp(s1, "[WINDOW_ROLE]")) { s2 = s + n; if (*s2 != 0) { s2++; } sscanf(s2, "%[^\n]", s1); matches[num_match - 1].window_role = duplicate(s1); } else if (!strcmp(s1, "[RES_NAME]")) { s2 = s + n; if (*s2 != 0) { s2++; } sscanf(s2, "%[^\n]", s1); matches[num_match - 1].res_name = duplicate(s1); } else if (!strcmp(s1, "[RES_CLASS]")) { s2 = s + n; if (*s2 != 0) { s2++; } sscanf(s2, "%[^\n]", s1); matches[num_match - 1].res_class = duplicate(s1); } else if (!strcmp(s1, "[WM_NAME]")) { s2 = s + n; if (*s2 != 0) { s2++; } sscanf(s2, "%[^\n]", s1); matches[num_match - 1].wm_name = duplicate(s1); } else if (!strcmp(s1, "[WM_COMMAND]")) { sscanf(s, "%*s %i%n", &matches[num_match - 1].wm_command_count, &pos); matches[num_match - 1].wm_command = (char **) safemalloc( matches[num_match - 1]. wm_command_count * sizeof (char *)); for (i = 0; i < matches[num_match - 1].wm_command_count; i++) { sscanf (s+pos, "%s%n", s1, &pos1); pos += pos1; matches[num_match - 1].wm_command[i] = duplicate (s1); } } } fclose(f); return; } /* This routine (potentially) changes the flags STARTICONIC, MAXIMIZED, WSHADE and STICKY and the Desk and attr.x, .y, .width, .height entries. It also changes the stack_before pointer to return information about the desired stacking order. It expects the stacking order to be set up correctly beforehand! */ Bool MatchWinToSM( FvwmWindow *ewin, mwtsm_state_args *ret_state_args, initial_window_options_t *win_opts) { int i; if (!does_file_version_match) { return False; } for (i = 0; i < num_match; i++) { if (!matches[i].used && matchWin(ewin, &matches[i])) { matches[i].used = 1; if (!Restarting) { /* We don't want to restore too much state if we are restarting, since that would make * restarting useless for rereading changed * rc files. */ SET_DO_SKIP_WINDOW_LIST( ewin, DO_SKIP_WINDOW_LIST(&(matches[i]))); SET_ICON_SUPPRESSED( ewin, IS_ICON_SUPPRESSED(&(matches[i]))); SET_HAS_NO_ICON_TITLE( ewin, HAS_NO_ICON_TITLE(&(matches[i]))); FPS_LENIENT( FW_FOCUS_POLICY(ewin), FP_IS_LENIENT(FW_FOCUS_POLICY( &(matches[i])))); SET_ICON_STICKY_ACROSS_PAGES( ewin, IS_ICON_STICKY_ACROSS_PAGES( &(matches[i]))); SET_ICON_STICKY_ACROSS_DESKS( ewin, IS_ICON_STICKY_ACROSS_DESKS( &(matches[i]))); SET_DO_SKIP_ICON_CIRCULATE( ewin, DO_SKIP_ICON_CIRCULATE( &(matches[i]))); SET_DO_SKIP_SHADED_CIRCULATE( ewin, DO_SKIP_SHADED_CIRCULATE( &(matches[i]))); SET_DO_SKIP_CIRCULATE( ewin, DO_SKIP_CIRCULATE(&(matches[i]))); memcpy( &FW_FOCUS_POLICY(ewin), &FW_FOCUS_POLICY(&matches[i]), sizeof(focus_policy_t)); if (matches[i].wm_name) { free_window_names(ewin, True, False); ewin->name.name = matches[i].wm_name; setup_visible_name(ewin, False); } } SET_NAME_CHANGED(ewin,IS_NAME_CHANGED(&(matches[i]))); SET_PLACED_BY_FVWM( ewin, IS_PLACED_BY_FVWM(&(matches[i]))); ret_state_args->do_shade = IS_SHADED(&(matches[i])); ret_state_args->used_title_dir_for_shading = USED_TITLE_DIR_FOR_SHADING(&(matches[i])); ret_state_args->shade_dir = SHADED_DIR(&(matches[i])); ret_state_args->do_max = IS_MAXIMIZED(&(matches[i])); SET_USER_STATES(ewin, GET_USER_STATES(&(matches[i]))); SET_ICON_MOVED(ewin, IS_ICON_MOVED(&(matches[i]))); if (IS_ICONIFIED(&(matches[i]))) { /* ICON_MOVED is necessary to make fvwm use icon_[xy]_loc for icon placement */ win_opts->initial_state = IconicState; win_opts->flags.use_initial_icon_xy = 1; win_opts->initial_icon_x = matches[i].icon_x; win_opts->initial_icon_y = matches[i].icon_y; if (!IS_STICKY_ACROSS_PAGES(&(matches[i])) && !(IS_ICONIFIED(&(matches[i])) && IS_ICON_STICKY_ACROSS_PAGES( &(matches[i])))) { win_opts->initial_icon_x -= Scr.Vx; win_opts->initial_icon_y -= Scr.Vy; } } ewin->g.normal.x = matches[i].x; ewin->g.normal.y = matches[i].y; ewin->g.normal.width = matches[i].w; ewin->g.normal.height = matches[i].h; ewin->g.max.x = matches[i].x_max; ewin->g.max.y = matches[i].y_max; ewin->g.max.width = matches[i].w_max; ewin->g.max.height = matches[i].h_max; ewin->g.max_defect.width = matches[i].width_defect_max; ewin->g.max_defect.height = matches[i].height_defect_max; ewin->g.max_offset.x = matches[i].max_x_offset; ewin->g.max_offset.y = matches[i].max_y_offset; SET_STICKY_ACROSS_PAGES( ewin, IS_STICKY_ACROSS_PAGES(&(matches[i]))); SET_STICKY_ACROSS_DESKS( ewin, IS_STICKY_ACROSS_DESKS(&(matches[i]))); ewin->Desk = (IS_STICKY_ACROSS_DESKS(ewin)) ? Scr.CurrentDesk : matches[i].desktop; set_layer(ewin, matches[i].layer); set_default_layer(ewin, matches[i].default_layer); ewin->placed_by_button = matches[i].placed_by_button; /* Note: the Modal, skip pager, skip taskbar and * "stacking order" state are not restored here: there * are restored in EWMH_ExitStuff */ ewin->ewmh_hint_desktop = matches[i].ewmh_hint_desktop; SET_HAS_EWMH_INIT_WM_DESKTOP( ewin, HAS_EWMH_INIT_WM_DESKTOP(&(matches[i]))); SET_HAS_EWMH_INIT_HIDDEN_STATE( ewin, HAS_EWMH_INIT_HIDDEN_STATE( &(matches[i]))); SET_HAS_EWMH_INIT_MAXHORIZ_STATE( ewin, HAS_EWMH_INIT_MAXHORIZ_STATE( &(matches[i]))); SET_HAS_EWMH_INIT_MAXVERT_STATE( ewin, HAS_EWMH_INIT_MAXVERT_STATE( &(matches[i]))); SET_HAS_EWMH_INIT_SHADED_STATE( ewin, HAS_EWMH_INIT_SHADED_STATE( &(matches[i]))); SET_HAS_EWMH_INIT_STICKY_STATE( ewin, HAS_EWMH_INIT_STICKY_STATE( &(matches[i]))); return True; } } return False; } void RestartInSession (char *filename, Bool is_native, Bool _do_preserve_state) { do_preserve_state = _do_preserve_state; if (SessionSupport && sm_conn && is_native) { going_to_restart = True; save_state_file(filename); set_sm_properties(sm_conn, filename, FSmRestartImmediately); MoveViewport(0, 0, False); Reborder(); CloseICCCM2(); XCloseDisplay(dpy); if (!FSmcCloseConnection(sm_conn, 0, NULL) != FSmcClosedNow) { /* go a head any way ? */ } #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr, "[FVWM_SMDEBUG]: Exiting, now SM must " "restart us.\n"); #endif /* Close all my pipes */ module_kill_all(); exit(0); /* let the SM restart us */ } save_state_file(filename); /* return and let Done restart us */ return; } void SetClientID(char *client_id) { if (!SessionSupport) { return; } previous_sm_client_id = client_id; return; } void SessionInit(void) { char error_string_ret[4096] = ""; FSmPointer context; FSmcCallbacks callbacks; if (!SessionSupport) { /* -Wall fixes */ MyIoErrorHandler(NULL); callback_save_yourself2(NULL, NULL); return; } context = NULL; InstallIOErrorHandler(); callbacks.save_yourself.callback = callback_save_yourself; callbacks.die.callback = callback_die; callbacks.save_complete.callback = callback_save_complete; callbacks.shutdown_cancelled.callback = callback_shutdown_cancelled; callbacks.save_yourself.client_data = callbacks.die.client_data = callbacks.save_complete.client_data = callbacks.shutdown_cancelled.client_data = (FSmPointer) NULL; sm_conn = FSmcOpenConnection( NULL, &context, FSmProtoMajor, FSmProtoMinor, FSmcSaveYourselfProcMask | FSmcDieProcMask | FSmcSaveCompleteProcMask | FSmcShutdownCancelledProcMask, &callbacks, previous_sm_client_id, &sm_client_id, 4096, error_string_ret); if (!sm_conn) { /* Don't annoy users which don't use a session manager */ if (previous_sm_client_id) { fvwm_msg( ERR, "SessionInit", "While connecting to session manager:\n%s.", error_string_ret); } sm_fd = -1; #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr,"[FVWM_SMDEBUG] No SM connection\n"); #endif } else { sm_fd = FIceConnectionNumber(FSmcGetIceConnection(sm_conn)); #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr,"[FVWM_SMDEBUG] Connectecd to a SM\n"); #endif set_init_function_name(0, "SessionInitFunction"); set_init_function_name(1, "SessionRestartFunction"); set_init_function_name(2, "SessionExitFunction"); /* basically to restet our restart style hint after a * restart */ set_sm_properties(sm_conn, NULL, FSmRestartIfRunning); } return; } void ProcessICEMsgs(void) { FIceProcessMessagesStatus status; if (!SessionSupport) { return; } #ifdef FVWM_SM_DEBUG_PROTO fprintf(stderr,"[FVWM_SMDEBUG][ProcessICEMsgs] %i\n", (int)sm_fd); #endif if (sm_fd < 0) { return; } status = FIceProcessMessages(FSmcGetIceConnection(sm_conn), NULL, NULL); if (status == FIceProcessMessagesIOError) { fvwm_msg(ERR, "ProcessICEMSGS", "Connection to session manager lost\n"); sm_conn = NULL; sm_fd = -1; } return; } /* * Fvwm Function implementation: QuitSession, SaveSession, SaveQuitSession. * migo (15-Jun-1999): I am not sure this is right. * The session mabager must implement SmsSaveYourselfRequest (xsm doesn't?). * Alternative implementation may use unix signals, but this does not work * with all session managers (also must suppose that SM runs locally). */ int get_sm_pid(void) { const char *session_manager_var = getenv("SESSION_MANAGER"); const char *sm_pid_str_ptr; int sm_pid = 0; if (!SessionSupport) { return 0; } if (!session_manager_var) { return 0; } sm_pid_str_ptr = strchr(session_manager_var, ','); if (!sm_pid_str_ptr) { return 0; } while (sm_pid_str_ptr > session_manager_var && isdigit(*(--sm_pid_str_ptr))) { /* nothing */ } while (isdigit(*(++sm_pid_str_ptr))) { sm_pid = sm_pid * 10 + *sm_pid_str_ptr - '0'; } return sm_pid; } /* * quit_session - hopefully shutdowns the session */ Bool quit_session(void) { if (!SessionSupport) { return False; } if (!sm_conn) { return False; } FSmcRequestSaveYourself( sm_conn, FSmSaveLocal, True /* shutdown */, FSmInteractStyleAny, False /* fast */, True /* global */); return True; /* migo: xsm does not support RequestSaveYourself, but supports * signals: */ /* int sm_pid = get_sm_pid(); if (!sm_pid) return False; return kill(sm_pid, SIGTERM) == 0 ? True : False; */ } /* * save_session - hopefully saves the session */ Bool save_session(void) { if (!SessionSupport) { return False; } if (!sm_conn) { return False; } FSmcRequestSaveYourself( sm_conn, FSmSaveBoth, False /* shutdown */, FSmInteractStyleAny, False /* fast */, True /* global */); return True; /* migo: xsm does not support RequestSaveYourself, but supports * signals: */ /* int sm_pid = get_sm_pid(); if (!sm_pid) return False; return kill(sm_pid, SIGUSR1) == 0 ? True : False; */ } /* * save_quit_session - hopefully saves and shutdowns the session */ Bool save_quit_session(void) { if (!SessionSupport) { return False; } if (!sm_conn) { return False; } FSmcRequestSaveYourself( sm_conn, FSmSaveBoth, True /* shutdown */, FSmInteractStyleAny, False /* fast */, True /* global */); return True; /* migo: xsm does not support RequestSaveYourself, but supports * signals: */ /* if (save_session() == False) return False; sleep(3); / * doesn't work anyway * / if (quit_session() == False) return False; return True; */ } /* ---------------------------- builtin commands --------------------------- */ void CMD_QuitSession(F_CMD_ARGS) { quit_session(); return; } void CMD_SaveSession(F_CMD_ARGS) { save_session(); return; } void CMD_SaveQuitSession(F_CMD_ARGS) { save_quit_session(); return; } fvwm-2.6.5.orig/fvwm/geometry.h0000644000175000017500000000635010552172642014615 0ustar vwcvwc/* -*-c-*- */ #ifndef GEOMETRY_H #define GEOMETRY_H #define CS_ROUND_UP 0x01 #define CS_UPDATE_MAX_DEFECT 0x02 void gravity_get_naked_geometry( int gravity, FvwmWindow *t, rectangle *dest_g, rectangle *orig_g); void gravity_add_decoration( int gravity, FvwmWindow *t, rectangle *dest_g, rectangle *orig_g); void get_relative_geometry(rectangle *rel_g, rectangle *abs_g); void get_absolute_geometry(rectangle *abs_g, rectangle *rel_g); void gravity_translate_to_northwest_geometry( int gravity, FvwmWindow *t, rectangle *dest_g, rectangle *orig_g); void gravity_translate_to_northwest_geometry_no_bw( int gravity, FvwmWindow *t, rectangle *dest_g, rectangle *orig_g); void get_title_geometry( FvwmWindow *fw, rectangle *ret_g); int get_title_gravity( FvwmWindow *fw); void get_title_gravity_factors( FvwmWindow *fw, int *ret_fx, int *ret_fy); Bool get_title_button_geometry( FvwmWindow *fw, rectangle *ret_g, int context); void get_title_font_size_and_offset( FvwmWindow *fw, direction_t title_dir, Bool is_left_title_rotated_cw, Bool is_right_title_rotated_cw, Bool is_top_title_rotated, Bool is_bottom_title_rotated, int *size, int *offset); void get_icon_corner( FvwmWindow *fw, rectangle *ret_g); void get_shaded_geometry( FvwmWindow *fw, rectangle *small_g, rectangle *big_g); void get_shaded_geometry_with_dir( FvwmWindow *fw, rectangle *small_g, rectangle *big_g, direction_t shade_dir); void get_unshaded_geometry( FvwmWindow *fw, rectangle *ret_g); void get_shaded_client_window_pos( FvwmWindow *fw, rectangle *ret_g); void get_client_geometry( FvwmWindow *fw, rectangle *ret_g); void get_window_borders( const FvwmWindow *fw, size_borders *borders); void get_window_borders_no_title( const FvwmWindow *fw, size_borders *borders); void set_window_border_size( FvwmWindow *fw, int used_width); Bool is_window_border_minimal( FvwmWindow *fw); void update_relative_geometry(FvwmWindow *fw); void update_absolute_geometry(FvwmWindow *fw); void maximize_adjust_offset(FvwmWindow *fw); void constrain_size( FvwmWindow *fw, const XEvent *e, int *widthp, int *heightp, int xmotion, int ymotion, int flags); void gravity_constrain_size( int gravity, FvwmWindow *t, rectangle *rect, int flags); Bool get_visible_window_or_icon_geometry( FvwmWindow *fw, rectangle *ret_g); Bool get_visible_icon_geometry( FvwmWindow *fw, rectangle *ret_g); void get_icon_geometry( FvwmWindow *fw, rectangle *ret_g); Bool get_visible_icon_title_geometry( FvwmWindow *fw, rectangle *ret_g); Bool get_icon_title_geometry( FvwmWindow *fw, rectangle *ret_g); Bool get_visible_icon_picture_geometry( FvwmWindow *fw, rectangle *ret_g); Bool get_icon_picture_geometry( FvwmWindow *fw, rectangle *ret_g); void broadcast_icon_geometry(FvwmWindow *fw, Bool do_force); void move_icon_to_position(FvwmWindow *fw); void modify_icon_position(FvwmWindow *fw, int dx, int dy); void set_icon_position(FvwmWindow *fw, int x, int y); void set_icon_picture_size(FvwmWindow *fw, int w, int h); void resize_icon_title_height(FvwmWindow *fw, int dh); void get_page_offset_rectangle( int *ret_page_x, int *ret_page_y, rectangle *r); void get_page_offset( int *ret_page_x, int *ret_page_y, FvwmWindow *fw); void get_page_offset_check_visible( int *ret_page_x, int *ret_page_y, FvwmWindow *fw); #endif fvwm-2.6.5.orig/fvwm/menuroot.h0000644000175000017500000001435210552172642014633 0ustar vwcvwc/* -*-c-*- */ #ifndef MENU_ROOT_H #define MENU_ROOT_H /* ---------------------------- included header files ---------------------- */ /* Do not #include any files - the file including this file has to take care of * it. */ /* ---------------------------- forward declarations ----------------------- */ struct MenuItem; struct MenuStyle; /* ---------------------------- type definitions --------------------------- */ /* * MENU ROOT STRUCTURES */ /* This struct contains the parts of a root menu that are shared among all * copies of the menu */ typedef struct MenuRootStatic { /* first item in menu */ struct MenuItem *first; /* last item in menu */ struct MenuItem *last; /* # of copies, 0 if none except this one */ int copies; /* # of mapped instances */ int usage_count; /* name of root */ char *name; struct MenuDimensions dim; int items; FvwmPicture *sidePic; Pixel sideColor; int used_mini_icons; /* Menu Face */ struct MenuStyle *ms; /* permanent flags */ struct { unsigned has_side_color : 1; unsigned is_left_triangle : 1; unsigned is_updated : 1; } flags; struct { char *popup_action; char *popdown_action; char *missing_submenu_func; } dynamic; } MenuRootStatic; /* access macros to static menu members */ #define MR_FIRST_ITEM(m) ((m)->s->first) #define MR_LAST_ITEM(m) ((m)->s->last) #define MR_COPIES(m) ((m)->s->copies) #define MR_MAPPED_COPIES(m) ((m)->s->usage_count) #define MR_NAME(m) ((m)->s->name) #define MR_DIM(m) ((m)->s->dim) #define MR_WIDTH(m) MDIM_WIDTH((m)->s->dim) #define MR_HEIGHT(m) MDIM_HEIGHT((m)->s->dim) #define MR_ITEM_WIDTH(m) MDIM_ITEM_WIDTH((m)->s->dim) #define MR_SIDEPIC_X_OFFSET(m) MDIM_SIDEPIC_X_OFFSET((m)->s->dim) #define MR_ICON_X_OFFSET(m) MDIM_ICON_X_OFFSET((m)->s->dim) #define MR_TRIANGLE_X_OFFSET(m) MDIM_TRIANGLE_X_OFFSET((m)->s->dim) #define MR_ITEM_X_OFFSET(m) MDIM_ITEM_X_OFFSET((m)->s->dim) #define MR_ITEM_TEXT_Y_OFFSET(m) MDIM_ITEM_TEXT_Y_OFFSET((m)->s->dim) #define MR_HILIGHT_X_OFFSET(m) MDIM_HILIGHT_X_OFFSET((m)->s->dim) #define MR_HILIGHT_WIDTH(m) MDIM_HILIGHT_WIDTH((m)->s->dim) #define MR_SCREEN_WIDTH(m) MDIM_SCREEN_WIDTH((m)->s->dim) #define MR_SCREEN_HEIGHT(m) MDIM_SCREEN_HEIGHT((m)->s->dim) #define MR_ITEMS(m) ((m)->s->items) #define MR_SIDEPIC(m) ((m)->s->sidePic) #define MR_SIDECOLOR(m) ((m)->s->sideColor) #define MR_USED_MINI_ICONS(m) ((m)->s->used_mini_icons) #define MR_STYLE(m) ((m)->s->ms) /* flags */ #define MR_FLAGS(m) ((m)->s->flags) #define MR_POPUP_ACTION(m) ((m)->s->dynamic.popup_action) #define MR_POPDOWN_ACTION(m) ((m)->s->dynamic.popdown_action) #define MR_MISSING_SUBMENU_FUNC(m) ((m)->s->dynamic.missing_submenu_func) #define MR_HAS_SIDECOLOR(m) ((m)->s->flags.has_side_color) #define MR_IS_LEFT_TRIANGLE(m) ((m)->s->flags.is_left_triangle) #define MR_IS_UPDATED(m) ((m)->s->flags.is_updated) /* This struct contains the parts of a root menu that differ in all copies of * the menu */ typedef struct MenuRootDynamic { /* the first copy of the current menu */ struct MenuRoot *original_menu; /* next in list of root menus */ struct MenuRoot *next_menu; /* continuation of this menu (too tall for screen) */ struct MenuRoot *continuation_menu; /* can get the menu that this popped up through selected_item->mr when * selected is a popup menu item */ /* the menu that popped this up, if any */ struct MenuRoot *parent_menu; /* the menu item that popped this up, if any */ struct MenuItem *parent_item; /* the display used to create the menu. Can't use the normal display * because 'xkill' would kill the window manager if used on a tear off * menu. */ Display *create_dpy; /* the window of the menu */ Window window; /* the selected item in menu */ struct MenuItem *selected_item; /* item that has it's submenu mapped */ struct MenuItem *submenu_item; /* x distance window was moved by animation */ int xanimation; /* dynamic temp flags */ struct { /* is win background set? */ unsigned is_background_set : 1; unsigned is_destroyed : 1; /* menu direction relative to parent menu */ unsigned is_left : 1; unsigned is_right : 1; unsigned is_up : 1; unsigned is_down : 1; unsigned is_painted : 1; unsigned is_tear_off_menu : 1; unsigned has_popped_up_left : 1; unsigned has_popped_up_right : 1; } dflags; struct { Pixmap stored; int width; int height; int y; } stored_item; struct { Pixel *d_pixels; int d_npixels; } stored_pixels; /* alloc pixels when dithering is used for gradients */ } MenuRootDynamic; /* access macros to dynamic menu members */ #define MR_ORIGINAL_MENU(m) ((m)->d->original_menu) #define MR_NEXT_MENU(m) ((m)->d->next_menu) #define MR_CONTINUATION_MENU(m) ((m)->d->continuation_menu) #define MR_PARENT_MENU(m) ((m)->d->parent_menu) #define MR_PARENT_ITEM(m) ((m)->d->parent_item) #define MR_CREATE_DPY(m) ((m)->d->create_dpy) #define MR_WINDOW(m) ((m)->d->window) #define MR_SELECTED_ITEM(m) ((m)->d->selected_item) #define MR_SUBMENU_ITEM(m) ((m)->d->submenu_item) #define MR_XANIMATION(m) ((m)->d->xanimation) #define MR_STORED_ITEM(m) ((m)->d->stored_item) #define MR_STORED_PIXELS(m) ((m)->d->stored_pixels) /* flags */ #define MR_DYNAMIC_FLAGS(m) ((m)->d->dflags) #define MR_IS_BACKGROUND_SET(m) ((m)->d->dflags.is_background_set) #define MR_IS_DESTROYED(m) ((m)->d->dflags.is_destroyed) #define MR_IS_LEFT(m) ((m)->d->dflags.is_left) #define MR_IS_RIGHT(m) ((m)->d->dflags.is_right) #define MR_IS_UP(m) ((m)->d->dflags.is_up) #define MR_IS_DOWN(m) ((m)->d->dflags.is_down) #define MR_IS_PAINTED(m) ((m)->d->dflags.is_painted) #define MR_IS_TEAR_OFF_MENU(m) ((m)->d->dflags.is_tear_off_menu) #define MR_HAS_POPPED_UP_LEFT(m) ((m)->d->dflags.has_popped_up_left) #define MR_HAS_POPPED_UP_RIGHT(m) ((m)->d->dflags.has_popped_up_right) typedef struct MenuRoot { MenuRootStatic *s; MenuRootDynamic *d; } MenuRoot; /* don't forget to initialise new members in NewMenuRoot()! */ #endif /* MENU_ROOT_H */ fvwm-2.6.5.orig/fvwm/externs.h0000644000175000017500000000607711157754473014472 0ustar vwcvwc/* -*-c-*- */ /* * Copyright 1988 by Evans & Sutherland Computer Corporation, * Salt Lake City, Utah * Portions Copyright 1989 by the Massachusetts Institute of Technology * Cambridge, Massachusetts * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby * granted, provided that the above copyright notice appear in all * copies and that both that copyright notice and this permis- * sion notice appear in supporting documentation, and that the * names of Evans & Sutherland and M.I.T. not be used in advertising * in publicity pertaining to distribution of the software without * specific, written prior permission. * * EVANS & SUTHERLAND AND M.I.T. DISCLAIM ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- * ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND OR * M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- * AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA * OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE * OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef EXTERNS_H #define EXTERNS_H void Done(int, char *) __attribute__((__noreturn__)); void set_init_function_name(int n, const char *name); const char *get_init_function_name(int n); extern char NoName[]; extern char NoClass[]; extern char NoResource[]; extern XGCValues Globalgcv; extern unsigned long Globalgcm; extern int master_pid; extern Display *dpy; extern int x_fd; extern XContext FvwmContext; extern Bool fFvwmInStartup; extern Bool DoingCommandLine; extern Bool debugging; extern Bool debugging_stack_ring; extern int GrabPointerState; extern Window JunkRoot, JunkChild; extern int JunkX, JunkY; extern int JunkWidth, JunkHeight, JunkBW, JunkDepth; extern unsigned int JunkMask; extern char *fvwm_userdir; extern char *display_name; extern Atom _XA_MIT_PRIORITY_COLORS; extern Atom _XA_WM_CHANGE_STATE; extern Atom _XA_WM_STATE; extern Atom _XA_WM_COLORMAP_WINDOWS; extern Atom _XA_WM_PROTOCOLS; extern Atom _XA_WM_TAKE_FOCUS; extern Atom _XA_WM_SAVE_YOURSELF; extern Atom _XA_WM_DELETE_WINDOW; extern Atom _XA_WM_DESKTOP; extern Atom _XA_OL_WIN_ATTR; extern Atom _XA_OL_WT_BASE; extern Atom _XA_OL_WT_CMD; extern Atom _XA_OL_WT_HELP; extern Atom _XA_OL_WT_NOTICE; extern Atom _XA_OL_WT_OTHER; extern Atom _XA_OL_DECOR_ADD; extern Atom _XA_OL_DECOR_DEL; extern Atom _XA_OL_DECOR_CLOSE; extern Atom _XA_OL_DECOR_RESIZE; extern Atom _XA_OL_DECOR_HEADER; extern Atom _XA_OL_DECOR_ICON_NAME; extern Atom _XA_WM_WINDOW_ROLE; extern Atom _XA_WINDOW_ROLE; extern Atom _XA_WM_CLIENT_LEADER; extern Atom _XA_SM_CLIENT_ID; extern Atom _XA_WIN_SX; extern Atom _XA_MANAGER; extern Atom _XA_ATOM_PAIR; extern Atom _XA_WM_COLORMAP_NOTIFY; extern Atom _XA_XROOTPMAP_ID; extern Atom _XA_XSETROOT_ID; #endif /* _EXTERNS_ */ fvwm-2.6.5.orig/fvwm/schedule.c0000644000175000017500000001565110556634174014564 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/queue.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "libs/Parse.h" #include "fvwm.h" #include "externs.h" #include "colorset.h" #include "bindings.h" #include "misc.h" #include "cursor.h" #include "functions.h" #include "commands.h" #include "screen.h" typedef struct { int id; Time time_to_execute; Window window; char *command; int period; /* in milliseconds */ } sq_object_type; static int last_schedule_id = 0; static int next_schedule_id = -1; static fqueue sq = FQUEUE_INIT; static int cmp_times(Time t1, Time t2) { unsigned long ul1 = (unsigned long)t1; unsigned long ul2 = (unsigned long)t2; unsigned long diff; signed long udiff; diff = ul1 - ul2; udiff = *(signed long *)&diff; if (udiff > 0) { return 1; } else if (udiff < 0) { return -1; } else { return 0; } } static int cmp_object_time(void *object1, void *object2, void *args) { sq_object_type *so1 = (sq_object_type *)object1; sq_object_type *so2 = (sq_object_type *)object2; return cmp_times(so1->time_to_execute, so2->time_to_execute); } static int check_deschedule_obj_func(void *object, void *args) { sq_object_type *obj = object; return (obj->id == *(int *)args); } static void destroy_obj_func(void *object) { sq_object_type *obj = object; if (obj->command != NULL) { free(obj->command); } free(obj); return; } static void deschedule(int *pid) { int id; if (FQUEUE_IS_EMPTY(&sq)) { return; } /* get the job group id to deschedule */ if (pid != NULL) { id = *pid; } else { id = last_schedule_id; } /* deschedule matching jobs */ fqueue_remove_or_operate_all( &sq, check_deschedule_obj_func, NULL, destroy_obj_func, (void *)&id); return; } static void schedule( Window window, char *command, Time time_to_execute, int *pid, int period) { sq_object_type *new_obj; if (command == NULL || *command == 0) { return; } /* create the new object */ new_obj = (sq_object_type *)safemalloc(sizeof(sq_object_type)); memset(new_obj, 0, sizeof(sq_object_type)); new_obj->window = window; new_obj->command = safestrdup(command); new_obj->time_to_execute = time_to_execute; new_obj->period = period; /* 0 if this is not a periodic command */ /* set the job group id */ if (pid != NULL) { new_obj->id = *pid; } else { new_obj->id = next_schedule_id; next_schedule_id--; if (next_schedule_id >= 0) { /* wrapped around */ next_schedule_id = -1; } } last_schedule_id = new_obj->id; /* insert into schedule queue */ fqueue_add_inside(&sq, new_obj, cmp_object_time, NULL); return; } static int check_execute_obj_func(void *object, void *args) { sq_object_type *obj = object; Time *ptime = (Time *)args; return (cmp_times(*ptime, obj->time_to_execute) >= 0); } static void execute_obj_func(void *object, void *args) { sq_object_type *obj = object; if (obj->command != NULL) { /* execute the command */ const exec_context_t *exc; exec_context_changes_t ecc; exec_context_change_mask_t mask = ECC_TYPE | ECC_WCONTEXT; ecc.type = EXCT_SCHEDULE; ecc.w.wcontext = C_ROOT; if (XFindContext( dpy, obj->window, FvwmContext, (caddr_t *)&ecc.w.fw) != XCNOENT) { ecc.w.wcontext = C_WINDOW; mask |= ECC_FW; } exc = exc_create_context(&ecc, mask); execute_function(NULL, exc, obj->command, 0); exc_destroy_context(exc); } if (obj->period > 0) { /* This is a periodic function, so reschedule it. */ sq_object_type *new_obj = (sq_object_type *)safemalloc(sizeof(sq_object_type)); memcpy(new_obj, obj, sizeof(sq_object_type)); obj->command = NULL; /* new_obj->command now points to cmd. */ new_obj->time_to_execute = fev_get_evtime() + new_obj->period; /* insert into schedule queue */ fqueue_add_inside(&sq, new_obj, cmp_object_time, NULL); } XFlush(dpy); return; } /* executes all scheduled commands that are due for execution */ void squeue_execute(void) { Time current_time; if (FQUEUE_IS_EMPTY(&sq)) { return; } current_time = get_server_time(); fqueue_remove_or_operate_all( &sq, check_execute_obj_func, execute_obj_func, destroy_obj_func, ¤t_time); return; } /* returns the time in milliseconds to wait before next queue command must be * executed or -1 if none is queued */ int squeue_get_next_ms(void) { int ms; sq_object_type *obj; if (fqueue_get_first(&sq, (void **)&obj) == 0) { return -1; } if (cmp_times(fev_get_evtime(), obj->time_to_execute) >= 0) { /* jobs pending to be executed immediately */ ms = 0; } else { /* execute jobs later */ ms = obj->time_to_execute - fev_get_evtime(); } return ms; } int squeue_get_next_id(void) { return next_schedule_id; } int squeue_get_last_id(void) { return last_schedule_id; } void CMD_Schedule(F_CMD_ARGS) { Window xw; Time time; Time current_time; char *taction; char *token; char *next; int ms; int id; int *pid; int n; FvwmWindow * const fw = exc->w.fw; Bool is_periodic = False; token = PeekToken(action, &next); if (token && strcasecmp(token, "periodic") == 0) { is_periodic = True; action = next; } /* get the time to execute */ n = GetIntegerArguments(action, &action, &ms, 1); if (n <= 0) { fvwm_msg(ERR, "CMD_Schedule", "Requires time to schedule as argument"); return; } if (ms < 0) { ms = 0; } #if 0 /* eats up way too much cpu if schedule is used excessively */ current_time = get_server_time(); #else /* with this version, scheduled commands may be executed earlier than * intended. */ current_time = fev_get_evtime(); #endif time = current_time + (Time)ms; /* get the job group id to schedule */ n = GetIntegerArgumentsAnyBase(action, &taction, &id, 1); if (n >= 1) { pid = &id; action = taction; } else { pid = NULL; } /* get the window to operate on */ if (fw != NULL) { xw = FW_W(fw); } else { xw = None; } /* schedule the job */ schedule(xw, action, time, pid, (is_periodic == True ? ms : 0)); return; } void CMD_Deschedule(F_CMD_ARGS) { int id; int *pid; int n; /* get the job group id to deschedule */ n = GetIntegerArgumentsAnyBase(action, &action, &id, 1); if (n <= 0) { /* none, use default */ pid = NULL; } else { pid = &id; } /* deschedule matching jobs */ deschedule(pid); return; } fvwm-2.6.5.orig/fvwm/misc.c0000644000175000017500000003255010656151547013717 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include "libs/ftime.h" #ifdef FVWM_DEBUG_TIME #include #endif #include "libs/Parse.h" #include "libs/Target.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "cursor.h" #include "misc.h" #include "screen.h" #include "module_interface.h" #include "events.h" #include "eventmask.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ #define GRAB_EVMASK (ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | \ PointerMotionMask | EnterWindowMask | LeaveWindowMask) /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static int grab_count[GRAB_MAXVAL] = { 1, 1, 0, 0, 0, 0, 0 }; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* * Change the appearance of the grabbed cursor. */ static void change_grab_cursor(int cursor) { if (cursor != None) { XChangeActivePointerGrab( dpy, GRAB_EVMASK, Scr.FvwmCursors[cursor], CurrentTime); } return; } /* ---------------------------- interface functions ------------------------ */ int GetTwoArguments( char *action, int *val1, int *val2, int *val1_unit, int *val2_unit) { *val1_unit = Scr.MyDisplayWidth; *val2_unit = Scr.MyDisplayHeight; return GetTwoPercentArguments(action, val1, val2, val1_unit, val2_unit); } /* * Grab the pointer. * grab_context: GRAB_NORMAL, GRAB_BUSY, GRAB_MENU, GRAB_BUSYMENU, * GRAB_PASSIVE. * GRAB_STARTUP and GRAB_NONE are used at startup but are not made * to be grab_context. * GRAB_PASSIVE does not actually grab, but only delays the following ungrab * until the GRAB_PASSIVE is released too. */ #define DEBUG_GRAB 0 #if DEBUG_GRAB void print_grab_stats(char *text) { int i; fprintf(stderr,"grab_stats (%s):", text); for (i = 0; i < GRAB_MAXVAL; i++) { fprintf(stderr," %d", grab_count[i]); } fprintf(stderr," \n"); return; } #endif Bool GrabEm(int cursor, int grab_context) { int i = 0; int val = 0; int rep; Window grab_win; extern Window PressedW; if (grab_context <= GRAB_STARTUP || grab_context >= GRAB_MAXVAL) { fvwm_msg( ERR, "GrabEm", "Bug: Called with illegal context %d", grab_context); return False; } if (grab_context == GRAB_PASSIVE) { grab_count[grab_context]++; grab_count[GRAB_ALL]++; return True; } if (grab_count[GRAB_ALL] > grab_count[GRAB_PASSIVE]) { /* already grabbed, just change the grab cursor */ if (grab_context == GRAB_FREEZE_CURSOR) { if (XGrabPointer( dpy, (PressedW != None) ? PressedW : Scr.NoFocusWin, True, GRAB_EVMASK, GrabModeAsync, GrabModeAsync, None, Scr.FvwmCursors[CRS_DEFAULT], CurrentTime) != GrabSuccess) { return False; } return True; } grab_count[grab_context]++; grab_count[GRAB_ALL]++; if (grab_context != GRAB_BUSY || grab_count[GRAB_STARTUP] == 0) { change_grab_cursor(cursor); } return True; } /* move the keyboard focus prior to grabbing the pointer to * eliminate the enterNotify and exitNotify events that go * to the windows. But GRAB_BUSY. */ switch (grab_context) { case GRAB_BUSY: if ( Scr.Hilite != NULL ) { grab_win = FW_W(Scr.Hilite); } else { grab_win = Scr.Root; } /* retry to grab the busy cursor only once */ rep = 2; break; case GRAB_PASSIVE: /* cannot happen */ return False; case GRAB_FREEZE_CURSOR: grab_win = (PressedW != None) ? PressedW : Scr.NoFocusWin; rep = 2; break; default: grab_win = Scr.Root; rep = NUMBER_OF_GRAB_ATTEMPTS; break; } XFlush(dpy); while (i < rep && (val = XGrabPointer( dpy, grab_win, True, GRAB_EVMASK, GrabModeAsync, GrabModeAsync, None, (grab_context == GRAB_FREEZE_CURSOR) ? None : Scr.FvwmCursors[cursor], CurrentTime) != GrabSuccess)) { switch (val) { case GrabInvalidTime: case GrabNotViewable: /* give up */ i += rep; break; case GrabSuccess: break; case AlreadyGrabbed: case GrabFrozen: default: /* If you go too fast, other windows may not get a * chance to release any grab that they have. */ i++; if (grab_context == GRAB_FREEZE_CURSOR) { break; } if (i < rep) { usleep(1000 * TIME_BETWEEN_GRAB_ATTEMPTS); } break; } } XFlush(dpy); /* If we fall out of the loop without grabbing the pointer, its * time to give up */ if (val != GrabSuccess) { return False; } grab_count[grab_context]++; grab_count[GRAB_ALL]++; #if DEBUG_GRAB print_grab_stats("grabbed"); #endif return True; } /* * * UnGrab the pointer * */ Bool UngrabEm(int ungrab_context) { if (ungrab_context <= GRAB_ALL || ungrab_context >= GRAB_MAXVAL) { fvwm_msg( ERR, "UngrabEm", "Bug: Called with illegal context %d", ungrab_context); return False; } if (grab_count[ungrab_context] == 0 || grab_count[GRAB_ALL] == 0) { /* context is not grabbed */ return False; } XFlush(dpy); grab_count[ungrab_context]--; grab_count[GRAB_ALL]--; if (grab_count[GRAB_ALL] > 0) { int new_cursor = None; /* there are still grabs left - switch grab cursor */ switch (ungrab_context) { case GRAB_NORMAL: case GRAB_BUSY: case GRAB_MENU: if (grab_count[GRAB_BUSYMENU] > 0) { new_cursor = CRS_WAIT; } else if (grab_count[GRAB_BUSY] > 0) { new_cursor = CRS_WAIT; } else if (grab_count[GRAB_MENU] > 0) { new_cursor = CRS_MENU; } else { new_cursor = None; } break; case GRAB_BUSYMENU: /* switch back from busymenu cursor to normal menu * cursor */ new_cursor = CRS_MENU; break; default: new_cursor = None; break; } if (grab_count[GRAB_ALL] > grab_count[GRAB_PASSIVE]) { #if DEBUG_GRAB print_grab_stats("-restore"); #endif change_grab_cursor(new_cursor); } } else { #if DEBUG_GRAB print_grab_stats("-ungrab"); #endif XUngrabPointer(dpy, CurrentTime); } XFlush(dpy); return True; } #ifndef fvwm_msg /* Some ports (i.e. VMS) define their own version */ /* ** fvwm_msg: used to send output from fvwm to files and or stderr/stdout ** ** type -> DBG == Debug, ERR == Error, INFO == Information, WARN == Warning, ** OLD == Command or option deprecated ** id -> name of function, or other identifier */ static char *fvwm_msg_strings[] = { "<> ", "", "", "<> ", "<> ", "<> " }; void fvwm_msg(fvwm_msg_t type, char *id, char *msg, ...) { va_list args; char fvwm_id[20]; char time_str[40] = "\0"; #ifdef FVWM_DEBUG_TIME clock_t time_val, time_taken; static clock_t start_time = 0; static clock_t prev_time = 0; struct tms not_used_tms; time_t mytime; struct tm *t_ptr; #endif #ifdef FVWM_DEBUG_TIME time(&mytime); t_ptr = localtime(&mytime); if (start_time == 0) { /* get clock ticks */ prev_time = start_time = (unsigned int)times(¬_used_tms); } time_val = (unsigned int)times(¬_used_tms); /* get clock ticks */ time_taken = time_val - prev_time; prev_time = time_val; sprintf(time_str, "%.2d:%.2d:%.2d%7ld ", t_ptr->tm_hour, t_ptr->tm_min, t_ptr->tm_sec, time_taken); #endif strcpy(fvwm_id, "fvwm"); if (Scr.NumberOfScreens > 1) { sprintf(&fvwm_id[strlen(fvwm_id)], ".%d", (int)Scr.screen); } fprintf(stderr, "%s[%s][%s]: %s", time_str, fvwm_id, id, fvwm_msg_strings[(int)type]); if (type == ECHO) { /* user echos must be printed as a literal string */ fprintf(stderr, "%s", msg); } else { va_start(args, msg); vfprintf(stderr, msg, args); va_end(args); } fprintf(stderr, "\n"); if (type == ERR) { /* I hate to use a fixed length but this will do for now */ char tmp[2 * MAX_TOKEN_LENGTH]; sprintf(tmp, "[%s][%s]: %s", fvwm_id, id, fvwm_msg_strings[(int)type]); va_start(args, msg); vsprintf(tmp + strlen(tmp), msg, args); va_end(args); tmp[strlen(tmp) + 1] = '\0'; tmp[strlen(tmp)] = '\n'; if (strlen(tmp) >= MAX_MODULE_INPUT_TEXT_LEN) { sprintf(tmp + MAX_MODULE_INPUT_TEXT_LEN - 5, "...\n"); } BroadcastName(M_ERROR, 0, 0, 0, tmp); } } /* fvwm_msg */ #endif void fvwm_msg_report_app(void) { fprintf( stderr, " If you are having a problem with the application, send a" " bug report\n" " with this message included to the application owner.\n" " There is no need to notify fvwm-workers@fvwm.org.\n"); return; } void fvwm_msg_report_app_and_workers(void) { fprintf( stderr, " If you are having a problem with the application, send" " a bug report with\n" " this message included to the application owner and" " notify\n" " fvwm-workers@fvwm.org.\n"); return; } /* Store the last item that was added with '+' */ void set_last_added_item(last_added_item_t type, void *item) { Scr.last_added_item.type = type; Scr.last_added_item.item = item; return; } /* some fancy font handling stuff */ void NewFontAndColor(FlocaleFont *flf, Pixel color, Pixel backcolor) { Globalgcm = GCForeground | GCBackground; if (flf->font) { Globalgcm |= GCFont; Globalgcv.font = flf->font->fid; } Globalgcv.foreground = color; Globalgcv.background = backcolor; XChangeGC(dpy,Scr.TitleGC,Globalgcm,&Globalgcv); return; } /* * * For menus, move, and resize operations, we can effect keyboard * shortcuts by warping the pointer. * */ void Keyboard_shortcuts( XEvent *ev, FvwmWindow *fw, int *x_defect, int *y_defect, int ReturnEvent) { int x_move_size = 0; int y_move_size = 0; if (fw) { x_move_size = fw->hints.width_inc; y_move_size = fw->hints.height_inc; } fvwmlib_keyboard_shortcuts( dpy, Scr.screen, ev, x_move_size, y_move_size, x_defect, y_defect, ReturnEvent); return; } /* * * Check if the given FvwmWindow structure still points to a valid window. * */ Bool check_if_fvwm_window_exists(FvwmWindow *fw) { FvwmWindow *t; for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if (t == fw) return True; } return False; } /* rounds x down to the next multiple of m */ int truncate_to_multiple (int x, int m) { return (x < 0) ? (m * (((x + 1) / m) - 1)) : (m * (x / m)); } Bool IsRectangleOnThisPage(const rectangle *rec, int desk) { return (desk == Scr.CurrentDesk && rec->x + (signed int)rec->width > 0 && (rec->x < 0 || rec->x < Scr.MyDisplayWidth) && rec->y + (signed int)rec->height > 0 && (rec->y < 0 || rec->y < Scr.MyDisplayHeight)) ? True : False; } /* returns the FvwmWindow that contains the pointer or NULL if none */ FvwmWindow *get_pointer_fvwm_window(void) { int x,y; Window win; Window ancestor; FvwmWindow *t; if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &win, &JunkX, &JunkY, &x, &y, &JunkMask) == False) { /* pointer is on a different screen */ return NULL; } for (t = NULL ; win != Scr.Root && win != None; win = ancestor) { Window root = None; Window *children; unsigned int nchildren; if (XFindContext(dpy, win, FvwmContext, (caddr_t *) &t) != XCNOENT) { /* found a matching window context */ return t; } /* get next higher ancestor window */ children = NULL; if (!XQueryTree( dpy, win, &root, &ancestor, &children, &nchildren)) { return NULL; } if (children) { XFree(children); } } return t; } /* Returns the current X server time */ Time get_server_time(void) { XEvent xev; XSetWindowAttributes attr; /* add PropChange to NoFocusWin events */ attr.event_mask = PropertyChangeMask; XChangeWindowAttributes (dpy, Scr.NoFocusWin, CWEventMask, &attr); /* provoke an event */ XChangeProperty( dpy, Scr.NoFocusWin, XA_WM_CLASS, XA_STRING, 8, PropModeAppend, NULL, 0); FWindowEvent(dpy, Scr.NoFocusWin, PropertyChangeMask, &xev); attr.event_mask = XEVMASK_NOFOCUSW; XChangeWindowAttributes(dpy, Scr.NoFocusWin, CWEventMask, &attr); return xev.xproperty.time; } void print_g(char *text, rectangle *g) { fprintf(stderr,"%s: ", (text != NULL) ? text : ""); if (g == NULL) { fprintf(stderr, "(null)\n"); return; } fprintf(stderr,"%4d %4d %4dx%4d (%4d - %4d, %4d - %4d)\n", g->x, g->y, g->width, g->height, g->x, g->x + g->width, g->y, g->y + g->height); return; } fvwm-2.6.5.orig/fvwm/menubindings.c0000644000175000017500000005750111613252164015440 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "libs/Parse.h" #include "libs/Bindings.h" #include "libs/charmap.h" #include "libs/Flocale.h" #include "libs/wcontext.h" #include "fvwm.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "misc.h" #include "screen.h" #include "bindings.h" #include "move_resize.h" #include "menudim.h" #include "menustyle.h" #include "menuitem.h" #include "menuroot.h" #include "menuparameters.h" #include "menugeometry.h" #include "menubindings.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* menu bindings are kept in a local binding list separate from other * bindings*/ static Binding *menu_bindings_regular = NULL; static Binding *menu_bindings_fallback = NULL; static Binding **menu_bindings = NULL; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ /* * Returns the position of the item in the menu, but counts * only items that can be selected (i.e. nor separators or * titles). The count begins with 0. */ static int get_selectable_item_index( MenuRoot *mr, MenuItem *mi_target, int *ret_sections) { int i = 0; int s = 0; MenuItem *mi; int is_last_selectable = 0; for (mi = MR_FIRST_ITEM(mr); mi && mi != mi_target; mi = MI_NEXT_ITEM(mi)) { if (MI_IS_SELECTABLE(mi)) { i++; is_last_selectable = 1; } else if (is_last_selectable == 1) { s++; is_last_selectable = 0; } } if (ret_sections) { *ret_sections = s; } if (mi == mi_target) { return i; } return -1; } static MenuItem *get_selectable_item_from_index(MenuRoot *mr, int index) { int i = -1; MenuItem *mi; MenuItem *mi_last_ok = NULL; for (mi = MR_FIRST_ITEM(mr); mi && (i < index || mi_last_ok == NULL); mi=MI_NEXT_ITEM(mi)) { if (MI_IS_SELECTABLE(mi)) { mi_last_ok = mi; i++; } } return mi_last_ok; } static MenuItem *get_selectable_item_from_section(MenuRoot *mr, int section) { int i = 0; MenuItem *mi; MenuItem *mi_last_ok = NULL; int is_last_selectable = 0; for ( mi = MR_FIRST_ITEM(mr); mi && (i <= section || mi_last_ok == NULL); mi=MI_NEXT_ITEM(mi)) { if (MI_IS_SELECTABLE(mi)) { if (!is_last_selectable) { mi_last_ok = mi; is_last_selectable = 1; } } else if (is_last_selectable) { i++; is_last_selectable = 0; } } return mi_last_ok; } static int get_selectable_item_count(MenuRoot *mr, int *ret_sections) { int count; count = get_selectable_item_index(mr, MR_LAST_ITEM(mr), ret_sections); if (MR_LAST_ITEM(mr) && MI_IS_SELECTABLE(MR_LAST_ITEM(mr))) { count++; } return count; } static Binding *__menu_binding_is_mouse( Binding *blist, XEvent* event, int context) { Binding *b; int real_mod; real_mod = event->xbutton.state - (1 << (7 + event->xbutton.button)); for (b = blist; b != NULL; b = b->NextBinding) { if ( BIND_IS_MOUSE_BINDING(b->type) && (b->Button_Key == 0 || event->xbutton.button == b->Button_Key) && (b->Modifier == AnyModifier || MaskUsedModifiers(b->Modifier) == MaskUsedModifiers(real_mod)) && (b->Context == C_MENU || (b->Context & context) != C_MENU)) { break; } } return b; } static void parse_menu_action( struct MenuRoot *mr, const char *action, menu_shortcut_action *saction, int *items_to_move, int *do_skip_section, char **ret_cmd) { char *optlist[] = { "MenuClose", "MenuEnterContinuation", "MenuEnterSubmenu", "MenuLeaveSubmenu", "MenuMoveCursor", "MenuCursorLeft", "MenuCursorRight", "MenuSelectItem", "MenuScroll", "MenuTearOff", "MenuCloseAndExec", NULL }; int index; char *options; int num; int suffix[2]; int count[2]; *ret_cmd = NULL; options = GetNextTokenIndex((char *)action, optlist, 0, &index); switch (index) { case 0: /* MenuClose */ *saction = SA_ABORT; break; case 1: /* MenuEnterContinuation */ *saction = (MR_CONTINUATION_MENU(mr) != NULL) ? SA_CONTINUE : SA_ENTER; break; case 2: /* MenuEnterSubmenu */ *saction = SA_ENTER; break; case 3: /* MenuLeaveSubmenu */ *saction = SA_LEAVE; break; case 4: /* MenuMoveCursor */ num = GetSuffixedIntegerArguments(options, NULL, count, 2, "s", suffix); if (num == 2) { if (suffix[0] != 0 || count[0] != 0) { fvwm_msg(ERR, "parse_menu_action", "invalid MenuMoveCursor arguments " "'%s'", options); *saction = SA_NONE; break; } if (count[1] < 0) { *saction = SA_LAST; *items_to_move = 1 + count[1]; } else { *saction = SA_FIRST; *items_to_move = count[1]; } if (suffix[1] == 1) { *do_skip_section = 1; } } else if (num == 1) { *saction = SA_MOVE_ITEMS; *items_to_move = count[0]; if (suffix[0] == 1) { *do_skip_section = 1; } } else { fvwm_msg(ERR, "parse_menu_action", "invalid MenuMoveCursor arguments '%s'", options); *saction = SA_NONE; break; } break; case 5: /* MenuCursorLeft */ *saction = (MST_USE_LEFT_SUBMENUS(mr)) ? SA_ENTER : SA_LEAVE; break; case 6: /* MenuCursorRight */ *saction = (MST_USE_LEFT_SUBMENUS(mr)) ? SA_LEAVE : SA_ENTER; break; case 7: /* MenuSelectItem */ *saction = SA_SELECT; break; case 8: /* MenuScroll */ if (MST_MOUSE_WHEEL(mr) == MMW_OFF) { *saction = SA_SELECT; } else { num = GetSuffixedIntegerArguments(options, NULL, count, 1, "s", suffix); if (num == 1) { *saction = SA_SCROLL; *items_to_move = count[0]; if (suffix[0] == 1) { *do_skip_section = 1; } } else { fvwm_msg(ERR, "parse_menu_action", "invalid MenuScroll arguments '%s'", options); *saction = SA_NONE; break; } } break; case 9: /* MenuTearOff */ *saction = SA_TEAROFF; break; case 10: /* MenuCloseAndExecute */ *saction = SA_EXEC_CMD; *ret_cmd = options; break; default: fvwm_msg( ERR, "parse_menu_action", "unknown action '%s'", action); *saction = SA_NONE; } return; } static Binding *__menu_binding_is_key( Binding *blist, XEvent* event, int context) { Binding *b; for (b = blist; b != NULL; b = b->NextBinding) { if ( BIND_IS_KEY_BINDING(b->type) && event->xkey.keycode == b->Button_Key && (b->Modifier == AnyModifier || MaskUsedModifiers(b->Modifier) == MaskUsedModifiers(event->xkey.state)) && (b->Context == C_MENU || (b->Context & context) != C_MENU)) { break; } } return b; } /* ---------------------------- interface functions ------------------------ */ void menu_bindings_startup_complete(void) { menu_bindings = &menu_bindings_regular; return; } Binding *menu_binding_is_mouse(XEvent* event, int context) { Binding *b; b = __menu_binding_is_mouse(menu_bindings_regular, event, context); if (b == NULL) { b = __menu_binding_is_mouse( menu_bindings_fallback, event, context); } return b; } Binding *menu_binding_is_key(XEvent* event, int context) { Binding *b; b = __menu_binding_is_key(menu_bindings_regular, event, context); if (b == NULL) { b = __menu_binding_is_key( menu_bindings_fallback, event, context); } return b; } int menu_binding( Display *dpy, binding_t type, int button, KeySym keysym, int context, int modifier, char *action, char *menu_style) { Binding *rmlist; int rc; if (menu_bindings == NULL) { menu_bindings = &menu_bindings_fallback; } rmlist = NULL; if (~(~context | C_MENU | C_TITLE | C_MENU_ITEM | C_SIDEBAR) != 0) { fvwm_msg( ERR, "menu_binding", "invalid context in combination with menu context."); return 1; } if (menu_style != NULL) { /*!!! fixme - make either match a menu style or a menu name */ fvwm_msg( ERR, "menu_binding", "a window name may not be" " specified without a menu context."); return 1; } /* * Remove the "old" bindings if any */ /* BEGIN remove */ CollectBindingList( dpy, menu_bindings, &rmlist, type, STROKE_ARG(NULL) button, keysym, modifier, context, menu_style); if (rmlist != NULL) { FreeBindingList(rmlist); } else if ( keysym == 0 && button != 0 && modifier == 0 && strcmp(action,"-") == 0 && context == C_MENU) { /* Warn if Mouse n M N - occurs without removing any binding. The user most likely want Mouse n MT A - instead. */ fvwm_msg( WARN, "menu_binding", "The syntax for disabling the tear off button has " "changed."); } if (strcmp(action,"-") == 0) { return 0; } /* END remove */ if ((modifier & AnyModifier) && (modifier & (~AnyModifier))) { fvwm_msg( WARN, "menu_binding", "Binding specified AnyModifier" " and other modifers too. Excess modifiers are" " ignored."); modifier = AnyModifier; } /* Warn about Mouse n M N TearOff. */ if ( keysym == 0 && button != 0 && modifier == 0 && strcasecmp(action,"tearoff") == 0 && context == C_MENU) { fvwm_msg(OLD, "menu_binding", "The syntax for disabling the tear off button has " "changed. The TearOff action is no longer possible " "in menu bindings."); } rc = AddBinding( dpy, menu_bindings, type, STROKE_ARG(NULL) button, keysym, NULL, modifier, context, (void *)action, NULL, menu_style); return rc; } void menu_shortcuts( struct MenuRoot *mr, struct MenuParameters *pmp, struct MenuReturn *pmret, XEvent *event, struct MenuItem **pmi_current, double_keypress *pdkp, int *ret_menu_x, int *ret_menu_y) { int with_control; int with_shift; int with_meta; KeySym keysym; char ckeychar; int ikeychar; MenuItem *new_item; MenuItem *mi_current; int index; int mx; int my; int menu_x; int menu_y; int menu_width; int menu_height; int items_to_move; int do_skip_section; menu_shortcut_action saction; Binding *binding; int context; int is_geometry_known; char *command; ckeychar = 0; new_item = NULL; mi_current = pmi_current ? *pmi_current : NULL; do_skip_section = 0; saction = SA_NONE; context = C_MENU; is_geometry_known = 0; context = C_MENU; command = 0; if (mi_current) { if (MI_IS_TITLE(mi_current)) { context |= C_TITLE; } else { /* menu item context, use I (icon) for it */ context |= C_MENU_ITEM; } } else { if ( menu_get_geometry( mr, &JunkRoot, &menu_x, &menu_y, &menu_width, &menu_height, &JunkBW, &JunkDepth)) { is_geometry_known = 1; if ( FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &mx, &my, &JunkX, &JunkY, &JunkMask) == 0) { /* pointer is on a different screen */ mx = 0; my = 0; } else if ( mx >= menu_x && mx < menu_x + menu_width && my >= menu_y && my < menu_y + menu_height) { /* pointer is on the meny somewhere not over * an item */ if (my < menu_y + MST_BORDER_WIDTH(mr)) { /* upper border context (-)*/ context |= C_SB_TOP; } else if ( my >= menu_y + menu_height - MST_BORDER_WIDTH(mr)) { /* lower border context (_) */ context |= C_SB_BOTTOM; } else if (mx < menu_x + MR_ITEM_X_OFFSET(mr)) { /* left border or left sidepic */ context |= C_SB_LEFT; } else if (mx < menu_x + MST_BORDER_WIDTH(mr)) { /* left border context ([)*/ context |= C_SB_LEFT; } else if ( mx >= menu_x + MR_ITEM_X_OFFSET(mr) + MR_ITEM_WIDTH(mr)) { /* right sidepic or right border */ context |= C_SB_RIGHT; } else if ( mx >= menu_x + menu_width - MST_BORDER_WIDTH(mr)) { /* right border context (])*/ context |= C_SB_RIGHT; } } } else { fvwm_msg( ERR, "menu_shortcuts", "can't get geometry of" " menu %s", MR_NAME(mr)); } } if (event->type == KeyRelease) { /* This function is only called with a KeyRelease event if the * user released the 'select' key (s)he configured. */ pmret->rc = MENU_SELECTED; return; } items_to_move = 0; pmret->rc = MENU_NOP; /*** handle mouse events ***/ if (event->type == ButtonRelease) { /*** Read the control keys stats ***/ with_control = event->xbutton.state & ControlMask ? 1 : 0; with_shift = event->xbutton.state & ShiftMask ? 1: 0; with_meta = event->xbutton.state & Mod1Mask ? 1: 0; /** handle menu bindings **/ binding = menu_binding_is_mouse(event, context); if (binding != NULL) { parse_menu_action( mr, binding->Action, &saction, &items_to_move, &do_skip_section, &command); } index = 0; ikeychar = 0; } else /* Should be KeyPressed */ { /*** Read the control keys stats ***/ with_control = event->xkey.state & ControlMask? 1 : 0; with_shift = event->xkey.state & ShiftMask? 1: 0; with_meta = event->xkey.state & Mod1Mask? 1: 0; /*** handle double-keypress ***/ if (pdkp->timestamp && fev_get_evtime() - pdkp->timestamp < MST_DOUBLE_CLICK_TIME(pmp->menu) && event->xkey.state == pdkp->keystate && event->xkey.keycode == pdkp->keycode) { *pmi_current = NULL; pmret->rc = MENU_DOUBLE_CLICKED; return; } pdkp->timestamp = 0; /*** find out the key ***/ /* Is it okay to treat keysym-s as Ascii? * No, because the keypad numbers don't work. * Use XlookupString */ index = XLookupString(&(event->xkey), &ckeychar, 1, &keysym, NULL); ikeychar = (int)ckeychar; } /*** Try to match hot keys ***/ /* Need isascii here - isgraph might coredump! */ if (index == 1 && isascii(ikeychar) && isgraph(ikeychar) && with_control == 0 && with_meta == 0) { /* allow any printable character to be a keysym, but be sure * control isn't pressed */ MenuItem *mi; MenuItem *mi1; int key; int countHotkey = 0; /* if this is a letter set it to lower case */ if (isupper(ikeychar)) { ikeychar = tolower(ikeychar) ; } /* MMH mikehan@best.com 2/7/99 * Multiple hotkeys per menu * Search menu for matching hotkey; * remember how many we found and where we found it */ mi = (mi_current == NULL || mi_current == MR_LAST_ITEM(mr)) ? MR_FIRST_ITEM(mr) : MI_NEXT_ITEM(mi_current); mi1 = mi; do { if (MI_HAS_HOTKEY(mi) && !MI_IS_TITLE(mi) && (!MI_IS_HOTKEY_AUTOMATIC(mi) || MST_USE_AUTOMATIC_HOTKEYS(mr))) { key = (MI_LABEL(mi)[(int)MI_HOTKEY_COLUMN(mi)]) [MI_HOTKEY_COFFSET(mi)]; key = tolower(key); if (ikeychar == key) { if (++countHotkey == 1) { new_item = mi; } } } mi = (mi == MR_LAST_ITEM(mr)) ? MR_FIRST_ITEM(mr) : MI_NEXT_ITEM(mi); } while (mi != mi1); /* For multiple instances of a single hotkey, just move the * selection */ /* TA: 2011-07-24: But if the user has turned off * "UniqueHotkeyActivatedImmediate", keep the menu open until * the user has asked for that entry to be enacted. This also * implies the style "TitleWarpOff" and we're not over a popup * item, in which case the pointer is warped to the submenu in * the usual way. */ if ((countHotkey > 1) || (countHotkey >=1 && ( (!MST_DO_WARP_TO_TITLE(mr) || !MI_IS_POPUP(new_item)) ) && !MST_HOTKEY_ACTIVATES_IMMEDIATE(mr))) { *pmi_current = new_item; pmret->rc = MENU_NEWITEM; return; } /* Do things the old way for unique hotkeys in the menu */ else if (countHotkey == 1) { *pmi_current = new_item; if (new_item && MI_IS_POPUP(new_item)) { pmret->rc = MENU_POPUP; } else { pmret->rc = MENU_SELECTED; } return; } /* MMH mikehan@best.com 2/7/99 */ } /*** now determine the action to take ***/ /** handle menu key bindings **/ if ( event->type == KeyPress && keysym == XK_Escape && with_control == 0 && with_shift == 0 && with_meta == 0) { /* Don't allow override of Escape with no modifiers */ saction = SA_ABORT; } else if (event->type == KeyPress) { binding = menu_binding_is_key(event, context); if (binding != NULL) { parse_menu_action( mr, binding->Action, &saction, &items_to_move, &do_skip_section, &command); } } if ( !mi_current && (saction == SA_ENTER || saction == SA_MOVE_ITEMS || saction == SA_SELECT || saction == SA_SCROLL)) { if (is_geometry_known) { if (my < menu_y + MST_BORDER_WIDTH(mr)) { saction = SA_FIRST; } else if (my > menu_y + menu_height - MST_BORDER_WIDTH(mr)) { saction = SA_LAST; } else { saction = SA_WARPBACK; } } else { saction = SA_FIRST; } } /*** execute the necessary actions ***/ switch (saction) { case SA_ENTER: if (mi_current && MI_IS_POPUP(mi_current)) { pmret->rc = MENU_POPUP; } else { pmret->rc = MENU_NOP; } break; case SA_LEAVE: pmret->rc = (MR_IS_TEAR_OFF_MENU(mr)) ? MENU_NOP : MENU_POPDOWN; break; case SA_FIRST: if (do_skip_section) { *pmi_current = get_selectable_item_from_section( mr, items_to_move); } else { *pmi_current = get_selectable_item_from_index( mr, items_to_move); } if (*pmi_current != NULL) { pmret->rc = MENU_NEWITEM; } else { pmret->rc = MENU_NOP; } break; case SA_LAST: if (do_skip_section) { get_selectable_item_count(mr, &index); index += items_to_move; if (index < 0) { index = 0; } *pmi_current = get_selectable_item_from_section( mr, index); if (*pmi_current != NULL) { pmret->rc = MENU_NEWITEM; } else { pmret->rc = MENU_NOP; } } else { index = get_selectable_item_count(mr, NULL); if (index > 0) { index += items_to_move; if (index < 0) { index = 0; } *pmi_current = get_selectable_item_from_index( mr, index); pmret->rc = (*pmi_current) ? MENU_NEWITEM : MENU_NOP; } else { pmret->rc = MENU_NOP; } } break; case SA_MOVE_ITEMS: if (do_skip_section) { int section; int count; get_selectable_item_count(mr, &count); get_selectable_item_index(mr, mi_current, §ion); section += items_to_move; if (section < 0) section = count; else if (section > count) section = 0; index = section; } else if (items_to_move < 0) { index = get_selectable_item_index( mr, mi_current, NULL); if (index == 0) /* wraparound */ index = get_selectable_item_count(mr, NULL); else { index += items_to_move; } } else { index = get_selectable_item_index( mr, mi_current, NULL) + items_to_move; /* correct for the case that we're between items */ if (!MI_IS_SELECTABLE(mi_current)) { index--; } } if (do_skip_section) { new_item = get_selectable_item_from_section(mr, index); } else { new_item = get_selectable_item_from_index(mr, index); if (items_to_move > 0 && new_item == mi_current) { new_item = get_selectable_item_from_index(mr, 0); } } if (new_item) { *pmi_current = new_item; pmret->rc = MENU_NEWITEM; } else { pmret->rc = MENU_NOP; } break; case SA_CONTINUE: *pmi_current = MR_LAST_ITEM(mr); if (*pmi_current && MI_IS_POPUP(*pmi_current)) { /* enter the submenu */ pmret->rc = MENU_POPUP; } else { /* do nothing */ *pmi_current = mi_current; pmret->rc = MENU_NOP; } break; case SA_WARPBACK: /* Warp the pointer back into the menu. */ FWarpPointer( dpy, 0, MR_WINDOW(mr), 0, 0, 0, 0, menudim_middle_x_offset(&MR_DIM(mr)), my - menu_y); pmret->rc = MENU_NEWITEM_FIND; break; case SA_SELECT: pmret->rc = MENU_SELECTED; return; case SA_ABORT: pmret->rc = (MR_IS_TEAR_OFF_MENU(mr)) ? MENU_KILL_TEAR_OFF_MENU : MENU_ABORTED; return; case SA_TEAROFF: pmret->rc = (MR_IS_TEAR_OFF_MENU(mr)) ? MENU_NOP : MENU_TEAR_OFF; return; case SA_SCROLL: if (MST_MOUSE_WHEEL(mr) == MMW_MENU) { items_to_move *= -1; } if ( !menu_get_outer_geometry( mr, pmp, &JunkRoot, &menu_x, &menu_y, &JunkWidth, &menu_height, &JunkBW, &JunkDepth)) { fvwm_msg( ERR, "menu_shortcuts", "can't get geometry of menu %s", MR_NAME(mr)); return; } if (do_skip_section) { int count; get_selectable_item_count(mr, &count); get_selectable_item_index(mr, mi_current, &index); index += items_to_move; if (index < 0) { index = 0; } else if (index > count) { index = count; } new_item = get_selectable_item_from_section(mr, index); } else { index = get_selectable_item_index( mr, mi_current, NULL); if (items_to_move > 0 && !MI_IS_SELECTABLE(mi_current)) { index--; } index += items_to_move; new_item = get_selectable_item_from_index(mr, index); } if ( new_item && ((items_to_move < 0 && MI_Y_OFFSET(new_item) > MI_Y_OFFSET(mi_current)) || (items_to_move > 0 && MI_Y_OFFSET(new_item) < MI_Y_OFFSET(mi_current)))) { /* never scroll in the "wrong" direction */ new_item = NULL; } if (new_item) { *pmi_current = new_item; pmret->rc = MENU_NEWITEM; /* Have to work with relative positions or tear off * menus will be hard to reposition */ if ( FQueryPointer( dpy, MR_WINDOW(mr), &JunkRoot, &JunkChild, &JunkX, &JunkY, &mx, &my, &JunkMask) == 0) { /* This should not happen */ mx = 0; my = 0; } if (MST_MOUSE_WHEEL(mr) == MMW_POINTER) { if (event->type == ButtonRelease) { FWarpPointer( dpy, 0, 0, 0, 0, 0, 0, 0, -my + menuitem_middle_y_offset( new_item, MR_STYLE(mr))); } /* pointer wrapped elsewhere for key events */ } else { int old_y = menu_y; menu_y += my - menuitem_middle_y_offset( new_item, MR_STYLE(mr)); if ( !MST_SCROLL_OFF_PAGE(mr) && menu_height < MR_SCREEN_HEIGHT(mr)) { if (menu_y < 0) { FWarpPointer(dpy, 0, 0, 0, 0, 0, 0, 0,-menu_y); menu_y=0; } if ( menu_y + menu_height > MR_SCREEN_HEIGHT(mr)) { FWarpPointer( dpy, 0, 0, 0, 0, 0, 0, 0, MR_SCREEN_HEIGHT(mr) - menu_y - menu_height); menu_y = MR_SCREEN_HEIGHT(mr) - menu_height; } } if (old_y != menu_y) { pmret->rc = MENU_NEWITEM_MOVEMENU; *ret_menu_x = menu_x; *ret_menu_y = menu_y; } else { pmret->rc = MENU_NEWITEM; } } } else { pmret->rc = MENU_NOP; } break; case SA_EXEC_CMD: pmret->rc = MENU_EXEC_CMD; *pmp->ret_paction = command; break; case SA_NONE: default: pmret->rc = MENU_NOP; break; } if (saction != SA_SCROLL && pmret->rc == MENU_NEWITEM) { if (!menu_get_outer_geometry( mr, pmp, &JunkRoot, &menu_x, &menu_y, &JunkWidth, &menu_height, &JunkBW, &JunkDepth)) { fvwm_msg( ERR, "menu_shortcuts", "can't get geometry of menu %s", MR_NAME(mr)); return; } if (menu_y < 0 || menu_y + menu_height > MR_SCREEN_HEIGHT(mr)) { menu_y = (menu_y < 0) ? 0 : MR_SCREEN_HEIGHT(mr) - menu_height; pmret->rc = MENU_NEWITEM_MOVEMENU; *ret_menu_x = menu_x; *ret_menu_y = menu_y; } } return; } fvwm-2.6.5.orig/fvwm/menus.h0000644000175000017500000000372410556636263014123 0ustar vwcvwc/* -*-c-*- */ #ifndef _MENUS_ #define _MENUS_ #define MENU_IS_LEFT 0x01 #define MENU_IS_RIGHT 0x02 #define MENU_IS_UP 0x04 #define MENU_IS_DOWN 0x08 /* * MISCELLANEOUS MENU STUFF */ #define IS_MENU_RETURN(x) \ ((x)==MENU_DONE || (x)==MENU_ABORTED || (x)==MENU_SUBMENU_TORN_OFF) struct MenuRoot; struct MenuStyle; struct MenuReturn; struct MenuParameters; struct MenuOptions; struct MenuItem; struct MenuRepaintTransparentParameters; /* * EXPORTED FUNCTIONS */ void menus_init(void); struct MenuRoot *menus_find_menu(char *name); void menus_remove_style_from_menus(struct MenuStyle *ms); struct MenuRoot *FollowMenuContinuations( struct MenuRoot *mr, struct MenuRoot **pmrPrior); struct MenuRoot *NewMenuRoot(char *name); void AddToMenu(struct MenuRoot *, char *, char *, Bool, Bool, Bool); void menu_enter_tear_off_menu(const exec_context_t *exc); void menu_close_tear_off_menu(FvwmWindow *fw); Bool menu_redraw_transparent_tear_off_menu(FvwmWindow *fw, Bool pr_only); void do_menu(struct MenuParameters *pmp, struct MenuReturn *pret); char *get_menu_options( char *action, Window w, FvwmWindow *fw, XEvent *e, struct MenuRoot *mr, struct MenuItem *mi, struct MenuOptions *pops); Bool DestroyMenu( struct MenuRoot *mr, Bool do_recreate, Bool is_command_request); void add_another_menu_item(char *action); void change_mr_menu_style(struct MenuRoot *mr, char *stylename); void UpdateAllMenuStyles(void); void UpdateMenuColorset(int cset); void SetMenuCursor(Cursor cursor); void update_transparent_menu_bg( struct MenuRepaintTransparentParameters *prtm, int current_x, int current_y, int step_x, int step_y, int end_x, int end_y); void repaint_transparent_menu( struct MenuRepaintTransparentParameters *prtmp, Bool first, int x, int y, int end_x, int end_y, Bool is_bg_set); Bool menu_expose(XEvent *event, FvwmWindow *fw); int menu_binding(Display *dpy, binding_t type, int button, KeySym keysym, int context, int modifier, char *action, char *menuStyle); #endif /* _MENUS_ */ fvwm-2.6.5.orig/fvwm/conditional.h0000644000175000017500000000173007677641663015304 0ustar vwcvwc/* -*-c-*- */ #ifndef CONDITIONAL_H #define CONDITIONAL_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ /* Condition matching routines */ char *CreateFlagString(char *string, char **restptr); void DefaultConditionMask(WindowConditionMask *mask); void CreateConditionMask(char *flags, WindowConditionMask *mask); void FreeConditionMask(WindowConditionMask *mask); Bool MatchesConditionMask(FvwmWindow *fw, WindowConditionMask *mask); #endif /* CONDITIONAL_H */ fvwm-2.6.5.orig/fvwm/menustyle.c0000644000175000017500000013327111622413321014774 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include "libs/fvwmlib.h" #include "libs/Parse.h" #include "libs/ColorUtils.h" #include "libs/Picture.h" #include "libs/PictureUtils.h" #include "libs/Graphics.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "functions.h" #include "misc.h" #include "screen.h" #include "colorset.h" #include "menustyle.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static MenuStyle *default_menu_style; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static void menustyle_free_face(MenuFace *mf) { switch (mf->type) { case GradientMenu: if (Pdepth <= 8 && mf->u.grad.npixels > 0 && !mf->u.grad.do_dither) { Pixel *p; int i; p = (Pixel *)safemalloc( mf->u.grad.npixels * sizeof(Pixel)); for(i=0; i < mf->u.grad.npixels; i++) { p[i] = mf->u.grad.xcs[i].pixel; } PictureFreeColors( dpy, Pcmap, p, mf->u.grad.npixels, 0, False); free(p); } free(mf->u.grad.xcs); mf->u.grad.xcs = NULL; break; case PixmapMenu: case TiledPixmapMenu: if (mf->u.p) { PDestroyFvwmPicture(dpy, mf->u.p); } mf->u.p = NULL; break; case SolidMenu: fvwmlib_free_colors(dpy, &mf->u.back, 1, True); default: break; } mf->type = SimpleMenu; return; } static void menustyle_copy_face(MenuFace *destmf, MenuFace *origmf) { FvwmPictureAttributes fpa; int i; menustyle_free_face(destmf); destmf->type = SimpleMenu; switch (origmf->type) { case SolidMenu: fvwmlib_copy_color( dpy, &destmf->u.back, &origmf->u.back, False, True); destmf->type = SolidMenu; break; case GradientMenu: destmf->u.grad.xcs = (XColor *)safemalloc(sizeof(XColor) * origmf->u.grad.npixels); memcpy(destmf->u.grad.xcs, origmf->u.grad.xcs, sizeof(XColor) * origmf->u.grad.npixels); for (i = 0; iu.grad.npixels;i++) { fvwmlib_clone_color(origmf->u.grad.xcs[i].pixel); } destmf->u.grad.npixels = origmf->u.grad.npixels; destmf->u.grad.do_dither = origmf->u.grad.do_dither; destmf->type = GradientMenu; destmf->gradient_type = origmf->gradient_type; break; case PixmapMenu: case TiledPixmapMenu: fpa.mask = (Pdepth <= 8)? FPAM_DITHER:0; if (destmf->u.p) destmf->u.p = NULL; if (origmf->u.p) destmf->u.p = PCacheFvwmPicture( dpy, Scr.NoFocusWin, NULL, origmf->u.p->name, fpa); destmf->type = origmf->type; break; default: break; } } /* * * Reads a menu face line into a structure (veliaa@rpi.edu) * */ static Boolean menustyle_parse_face(char *s, MenuFace *mf, int verbose) { char *style; char *token; char *action = s; FvwmPictureAttributes fpa; s = GetNextToken(s, &style); if (style && strncasecmp(style, "--", 2) == 0) { free(style); return True; } menustyle_free_face(mf); mf->type = SimpleMenu; /* determine menu style */ if (!style) { return True; } else if (StrEquals(style,"Solid")) { s = GetNextToken(s, &token); if (token) { mf->type = SolidMenu; mf->u.back = GetColor(token); free(token); } else { if (verbose) { fvwm_msg(ERR, "menustyle_parse_face", "no color given for Solid face type:" " %s", action); } free(style); return False; } } else if (StrEquals(style+1, "Gradient")) { char **s_colors; int npixels, nsegs, *perc; XColor *xcs; if (!IsGradientTypeSupported(style[0])) { return False; } /* translate the gradient string into an array of colors etc */ npixels = ParseGradient(s, NULL, &s_colors, &perc, &nsegs); if (npixels <= 0) { return False; } /* dither ? */ mf->u.grad.do_dither = False; if (Pdepth <= 8) { mf->u.grad.do_dither = True; } /* grab the colors */ xcs = AllocAllGradientColors( s_colors, perc, nsegs, npixels, mf->u.grad.do_dither); if (xcs == None) { return False; } mf->u.grad.xcs = xcs; mf->u.grad.npixels = npixels; mf->type = GradientMenu; mf->gradient_type = toupper(style[0]); } else if (StrEquals(style,"Pixmap") || StrEquals(style,"TiledPixmap")) { s = GetNextToken(s, &token); fpa.mask = (Pdepth <= 8)? FPAM_DITHER:0; if (token) { mf->u.p = PCacheFvwmPicture( dpy, Scr.NoFocusWin, NULL, token, fpa); if (mf->u.p == NULL) { if (verbose) { fvwm_msg(ERR, "menustyle_parse_face", "couldn't load pixmap %s", token); } free(token); free(style); return False; } free(token); mf->type = (StrEquals(style,"TiledPixmap")) ? TiledPixmapMenu : PixmapMenu; } else { if (verbose) { fvwm_msg(ERR, "menustyle_parse_face", "missing pixmap name for style %s", style); } free(style); return False; } } else { if (verbose) { fvwm_msg( ERR, "menustyle_parse_face", "unknown style %s: %s", style, action); } free(style); return False; } free(style); return True; } static void parse_vertical_spacing_line( char *args, signed char *above, signed char *below, signed char above_default, signed char below_default) { int val[2]; if (GetIntegerArguments(args, NULL, val, 2) != 2 || val[0] < MIN_VERTICAL_SPACING || val[0] > MAX_VERTICAL_SPACING || val[1] < MIN_VERTICAL_SPACING || val[1] > MAX_VERTICAL_SPACING) { /* illegal or missing parameters, return to default */ *above = above_default; *below = below_default; return; } *above = val[0]; *below = val[1]; return; } static void parse_vertical_margins_line( char *args, unsigned char *top, unsigned char *bottom, signed char top_default, signed char bottom_default) { int val[2]; if (GetIntegerArguments(args, NULL, val, 2) != 2 || val[0] < 0 || val[0] > MAX_MENU_MARGIN || val[1] < 0 || val[1] > MAX_MENU_MARGIN) { /* invalid or missing parameters, return to default */ *top = top_default; *bottom = bottom_default; return; } *top = val[0]; *bottom = val[1]; return; } static MenuStyle *menustyle_parse_old_style(F_CMD_ARGS) { char *buffer, *rest; char *fore, *back, *stipple, *font, *style, *animated; MenuStyle *ms = NULL; rest = GetNextToken(action,&fore); rest = GetNextToken(rest,&back); rest = GetNextToken(rest,&stipple); rest = GetNextToken(rest,&font); rest = GetNextToken(rest,&style); rest = GetNextToken(rest,&animated); if (!fore || !back || !stipple || !font || !style) { fvwm_msg(ERR, "menustyle_parse_old_style", "error in %s style specification", action); } else { buffer = (char *)alloca(strlen(action) + 100); sprintf(buffer, "* \"%s\", Foreground \"%s\", Background \"%s\", " "Greyed \"%s\", Font \"%s\", \"%s\"", style, fore, back, stipple, font, (animated && StrEquals(animated, "anim")) ? "Animation" : "AnimationOff"); fvwm_msg(OLD, "menustyle_parse_old_style", "The old MenuStyle snytax has been deprecated. " "Use 'MenuStyle %s' instead of 'MenuStyle %s'\n", buffer, action); action = buffer; ms = menustyle_parse_style(F_PASS_ARGS); } if (fore) { free(fore); } if (back) { free(back); } if (stipple) { free(stipple); } if (font) { free(font); } if (style) { free(style); } if (animated) { free(animated); } return ms; } static int menustyle_get_styleopt_index(char *option) { char *optlist[] = { "fvwm", "mwm", "win", "Foreground", "Background", "Greyed", "HilightBack", "HilightBackOff", "ActiveFore", "ActiveForeOff", "Hilight3DThick", "Hilight3DThin", "Hilight3DOff", "Animation", "AnimationOff", "Font", "MenuFace", "PopupDelay", "PopupOffset", "TitleWarp", "TitleWarpOff", "TitleUnderlines0", "TitleUnderlines1", "TitleUnderlines2", "SeparatorsLong", "SeparatorsShort", "TrianglesSolid", "TrianglesRelief", "PopupImmediately", "PopupDelayed", "DoubleClickTime", "SidePic", "SideColor", "PopupAsRootmenu", "PopupAsSubmenu", "RemoveSubmenus", "HoldSubmenus", "SubmenusRight", "SubmenusLeft", "BorderWidth", "Hilight3DThickness", "ItemFormat", "AutomaticHotkeys", "AutomaticHotkeysOff", "VerticalItemSpacing", "VerticalTitleSpacing", "MenuColorset", "ActiveColorset", "GreyedColorset", "SelectOnRelease", "PopdownImmediately", "PopdownDelayed", "PopdownDelay", "PopupActiveArea", "PopupIgnore", "PopupClose", "MouseWheel", "ScrollOffPage", "TrianglesUseFore", "TitleColorset", "HilightTitleBack", "TitleFont", "VerticalMargins", "UniqueHotkeyActivatesImmediate", NULL }; return GetTokenIndex(option, optlist, 0, NULL); } static void change_or_make_gc(GC *gc, unsigned long gcm, XGCValues *gcv) { if (*gc != None) { XChangeGC(dpy, *gc, gcm, gcv); } else { *gc = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, gcv); } return; } /* ---------------------------- interface functions ------------------------ */ MenuStyle *menustyle_get_default_style(void) { return default_menu_style; } void menustyle_free(MenuStyle *ms) { MenuStyle *before = default_menu_style; if (!ms) { return; } menustyle_free_face(&ST_FACE(ms)); if (FORE_GC(ST_MENU_INACTIVE_GCS(ms))) { XFreeGC(dpy, FORE_GC(ST_MENU_INACTIVE_GCS(ms))); } if (FORE_GC(ST_MENU_ACTIVE_GCS(ms))) { XFreeGC(dpy, FORE_GC(ST_MENU_ACTIVE_GCS(ms))); } if (BACK_GC(ST_MENU_ACTIVE_GCS(ms))) { XFreeGC(dpy, BACK_GC(ST_MENU_ACTIVE_GCS(ms))); } if (HILIGHT_GC(ST_MENU_ACTIVE_GCS(ms))) { XFreeGC(dpy, HILIGHT_GC(ST_MENU_ACTIVE_GCS(ms))); } if (SHADOW_GC(ST_MENU_ACTIVE_GCS(ms))) { XFreeGC(dpy, SHADOW_GC(ST_MENU_ACTIVE_GCS(ms))); } if (HILIGHT_GC(ST_MENU_INACTIVE_GCS(ms))) { XFreeGC(dpy, HILIGHT_GC(ST_MENU_INACTIVE_GCS(ms))); } if (SHADOW_GC(ST_MENU_INACTIVE_GCS(ms))) { XFreeGC(dpy, SHADOW_GC(ST_MENU_INACTIVE_GCS(ms))); } if (FORE_GC(ST_MENU_STIPPLE_GCS(ms))) { XFreeGC(dpy, FORE_GC(ST_MENU_STIPPLE_GCS(ms))); } if (FORE_GC(ST_MENU_TITLE_GCS(ms))) { XFreeGC(dpy, FORE_GC(ST_MENU_TITLE_GCS(ms))); } if (BACK_GC(ST_MENU_TITLE_GCS(ms))) { XFreeGC(dpy, BACK_GC(ST_MENU_TITLE_GCS(ms))); } if (HILIGHT_GC(ST_MENU_TITLE_GCS(ms))) { XFreeGC(dpy, HILIGHT_GC(ST_MENU_TITLE_GCS(ms))); } if (SHADOW_GC(ST_MENU_TITLE_GCS(ms))) { XFreeGC(dpy, SHADOW_GC(ST_MENU_TITLE_GCS(ms))); } if (ST_SIDEPIC(ms)) { PDestroyFvwmPicture(dpy, ST_SIDEPIC(ms)); } if (ST_HAS_SIDE_COLOR(ms) == 1) { fvwmlib_free_colors(dpy, &ST_SIDE_COLOR(ms), 1, True); } if (ST_PSTDFONT(ms) && !ST_USING_DEFAULT_FONT(ms)) { FlocaleUnloadFont(dpy, ST_PSTDFONT(ms)); } if (ST_PTITLEFONT(ms) && !ST_USING_DEFAULT_TITLEFONT(ms)) { FlocaleUnloadFont(dpy, ST_PTITLEFONT(ms)); } if (ST_ITEM_FORMAT(ms)) { free(ST_ITEM_FORMAT(ms)); } fvwmlib_free_colors(dpy, &ST_MENU_COLORS(ms).back,1,True); fvwmlib_free_colors(dpy, &ST_MENU_COLORS(ms).fore,1,True); if (ST_HAS_STIPPLE_FORE(ms)) { fvwmlib_free_colors( dpy, &ST_MENU_STIPPLE_COLORS(ms).fore,1,True); } if (ST_HAS_ACTIVE_BACK(ms)) { fvwmlib_free_colors( dpy, &ST_MENU_ACTIVE_COLORS(ms).back,1,True); } if (ST_HAS_ACTIVE_FORE(ms)) { fvwmlib_free_colors( dpy, &ST_MENU_ACTIVE_COLORS(ms).fore,1,True); } while (ST_NEXT_STYLE(before) != ms) { /* Not too many checks, may segfault in race conditions */ before = ST_NEXT_STYLE(before); } ST_NEXT_STYLE(before) = ST_NEXT_STYLE(ms); free(ST_NAME(ms)); free(ms); return; } MenuStyle *menustyle_find(char *name) { MenuStyle *ms = default_menu_style; while (ms) { if (strcasecmp(ST_NAME(ms),name)==0) { return ms; } ms = ST_NEXT_STYLE(ms); } return NULL; } void menustyle_update(MenuStyle *ms) { XGCValues gcv; unsigned long gcm; color_quad c_inactive; color_quad c_active; color_quad c_stipple; color_quad c_title; colorset_t *menu_cs = &Colorset[ST_CSET_MENU(ms)]; colorset_t *active_cs = &Colorset[ST_CSET_ACTIVE(ms)]; colorset_t *greyed_cs = &Colorset[ST_CSET_GREYED(ms)]; colorset_t *title_cs = &Colorset[ST_CSET_TITLE(ms)]; if (ST_USAGE_COUNT(ms) != 0) { fvwm_msg(ERR,"menustyle_update", "menu style %s is in use", ST_NAME(ms)); return; } ST_IS_UPDATED(ms) = 1; if (ST_USING_DEFAULT_FONT(ms)) { ST_PSTDFONT(ms) = Scr.DefaultFont; } if (ST_USING_DEFAULT_TITLEFONT(ms)) { ST_PTITLEFONT(ms) = ST_PSTDFONT(ms); } /* calculate colors based on foreground */ if (!ST_HAS_ACTIVE_FORE(ms)) { ST_MENU_ACTIVE_COLORS(ms).fore = ST_MENU_COLORS(ms).fore; } /* calculate colors based on background */ if (!ST_HAS_ACTIVE_BACK(ms)) { ST_MENU_ACTIVE_COLORS(ms).back = ST_MENU_COLORS(ms).back; } if (!ST_HAS_STIPPLE_FORE(ms)) { ST_MENU_STIPPLE_COLORS(ms).fore = ST_MENU_COLORS(ms).back; } ST_MENU_STIPPLE_COLORS(ms).back = ST_MENU_COLORS(ms).back; /* prepare colours for changing the gcs */ if (ST_HAS_MENU_CSET(ms)) { c_inactive.fore = menu_cs->fg; c_inactive.back = menu_cs->bg; c_inactive.hilight = menu_cs->hilite; c_inactive.shadow = menu_cs->shadow; } else { c_inactive.fore = ST_MENU_COLORS(ms).fore; c_inactive.back = ST_MENU_COLORS(ms).back; if (Pdepth > 2) { c_inactive.hilight = GetHilite(ST_MENU_COLORS(ms).back); c_inactive.shadow = GetShadow(ST_MENU_COLORS(ms).back); } else { c_inactive.hilight = GetColor(DEFAULT_HILIGHT_COLOR); c_inactive.shadow = GetColor(DEFAULT_SHADOW_COLOR); } } if (ST_HAS_ACTIVE_CSET(ms)) { c_active.fore = active_cs->fg; c_active.back = active_cs->bg; c_active.hilight = active_cs->hilite; c_active.shadow = active_cs->shadow; } else { c_active.fore = ST_MENU_ACTIVE_COLORS(ms).fore; c_active.back = ST_MENU_ACTIVE_COLORS(ms).back; if (Pdepth > 2) { c_active.hilight = GetHilite(ST_MENU_ACTIVE_COLORS(ms).back); c_active.shadow = GetShadow(ST_MENU_ACTIVE_COLORS(ms).back); } else { c_active.hilight = GetColor(DEFAULT_HILIGHT_COLOR); c_active.shadow = GetColor(DEFAULT_SHADOW_COLOR); } } if (ST_HAS_GREYED_CSET(ms)) { c_stipple.fore = greyed_cs->fg; c_stipple.back = greyed_cs->fg; } else { c_stipple.fore = ST_MENU_STIPPLE_COLORS(ms).fore; c_stipple.back = ST_MENU_STIPPLE_COLORS(ms).back; } if (ST_HAS_TITLE_CSET(ms)) { c_title.fore = title_cs->fg; c_title.back = title_cs->bg; c_title.hilight = title_cs->hilite; c_title.shadow = title_cs->shadow; } else { c_title.fore = c_inactive.fore; c_title.back = c_inactive.back; c_title.hilight = c_inactive.hilight; c_title.shadow = c_inactive.shadow; } /* override hilighting colours if necessary */ if (!ST_DO_HILIGHT_FORE(ms)) { c_active.fore = c_inactive.fore; } if (!ST_DO_HILIGHT_BACK(ms)) { c_active.back = c_inactive.back; c_active.hilight = c_inactive.hilight; c_active.shadow = c_inactive.shadow; } if (!ST_DO_HILIGHT_TITLE_BACK(ms)) { c_title.fore = c_inactive.fore; c_title.back = c_inactive.back; c_title.hilight = c_inactive.hilight; c_title.shadow = c_inactive.shadow; } /* make GC's */ gcm = GCFunction|GCLineWidth|GCForeground|GCBackground; if (ST_PSTDFONT(ms)->font != NULL) { gcm |= GCFont; gcv.font = ST_PSTDFONT(ms)->font->fid; } gcv.function = GXcopy; gcv.line_width = 0; /* update inactive menu gcs */ gcv.foreground = c_inactive.fore; gcv.background = c_inactive.back; change_or_make_gc(&FORE_GC(ST_MENU_INACTIVE_GCS(ms)), gcm, &gcv); BACK_GC(ST_MENU_INACTIVE_GCS(ms)) = FORE_GC(ST_MENU_INACTIVE_GCS(ms)); gcv.foreground = c_inactive.hilight; gcv.background = c_inactive.shadow; change_or_make_gc(&HILIGHT_GC(ST_MENU_INACTIVE_GCS(ms)), gcm, &gcv); gcv.foreground = c_inactive.shadow; gcv.background = c_inactive.hilight; change_or_make_gc(&SHADOW_GC(ST_MENU_INACTIVE_GCS(ms)), gcm, &gcv); /* update active menu gcs */ gcv.foreground = c_active.fore; gcv.background = c_active.back; change_or_make_gc(&FORE_GC(ST_MENU_ACTIVE_GCS(ms)), gcm, &gcv); gcv.foreground = c_active.back; gcv.background = c_active.fore; if (ST_HAS_ACTIVE_CSET(ms) && active_cs->pixmap && active_cs->pixmap_type == PIXMAP_TILED) { gcv.tile = active_cs->pixmap; gcv.fill_style = FillTiled; change_or_make_gc(&BACK_GC(ST_MENU_ACTIVE_GCS(ms)), gcm | GCFillStyle | GCTile , &gcv); } else { gcv.fill_style = FillSolid; change_or_make_gc(&BACK_GC(ST_MENU_ACTIVE_GCS(ms)), gcm | GCFillStyle , &gcv); } gcv.foreground = c_active.hilight; gcv.background = c_active.shadow; change_or_make_gc(&HILIGHT_GC(ST_MENU_ACTIVE_GCS(ms)), gcm, &gcv); gcv.foreground = c_active.shadow; gcv.background = c_active.hilight; change_or_make_gc(&SHADOW_GC(ST_MENU_ACTIVE_GCS(ms)), gcm, &gcv); /* update title gcs */ if (ST_PTITLEFONT(ms)->font != NULL && ST_PSTDFONT(ms)->font == NULL) { if (ST_PSTDFONT(ms)->font == NULL) { gcm |= GCFont; } gcv.font = ST_PTITLEFONT(ms)->font->fid; } gcv.foreground = c_title.fore; gcv.background = c_title.back; change_or_make_gc(&FORE_GC(ST_MENU_TITLE_GCS(ms)), gcm, &gcv); gcv.foreground = c_title.back; gcv.background = c_title.fore; if (ST_HAS_TITLE_CSET(ms) && title_cs->pixmap && title_cs->pixmap_type == PIXMAP_TILED) { gcv.tile = title_cs->pixmap; gcv.fill_style = FillTiled; change_or_make_gc(&BACK_GC(ST_MENU_TITLE_GCS(ms)), gcm | GCFillStyle | GCTile , &gcv); } else { gcv.fill_style = FillSolid; change_or_make_gc(&BACK_GC(ST_MENU_TITLE_GCS(ms)), gcm | GCFillStyle , &gcv); } gcv.foreground = c_title.hilight; gcv.background = c_title.shadow; change_or_make_gc(&HILIGHT_GC(ST_MENU_TITLE_GCS(ms)), gcm, &gcv); gcv.foreground = c_title.shadow; gcv.background = c_title.hilight; change_or_make_gc(&SHADOW_GC(ST_MENU_TITLE_GCS(ms)), gcm, &gcv); /* update stipple menu gcs */ SHADOW_GC(ST_MENU_STIPPLE_GCS(ms)) = SHADOW_GC(ST_MENU_INACTIVE_GCS(ms)); if (Pdepth < 2) { gcv.fill_style = FillStippled; gcv.stipple = Scr.gray_bitmap; /* no need to reset fg/bg, FillStipple wins */ gcm |= GCStipple | GCFillStyle; HILIGHT_GC(ST_MENU_STIPPLE_GCS(ms)) = SHADOW_GC(ST_MENU_INACTIVE_GCS(ms)); } else { gcv.foreground = c_stipple.fore; gcv.background = c_stipple.back; HILIGHT_GC(ST_MENU_STIPPLE_GCS(ms)) = HILIGHT_GC(ST_MENU_INACTIVE_GCS(ms)); } change_or_make_gc(&FORE_GC(ST_MENU_STIPPLE_GCS(ms)), gcm, &gcv); BACK_GC(ST_MENU_STIPPLE_GCS(ms)) = BACK_GC(ST_MENU_INACTIVE_GCS(ms)); return; } MenuStyle *menustyle_parse_style(F_CMD_ARGS) { char *name; char *option = NULL; char *poption = NULL; char *optstring = NULL; char *args = NULL; char *arg1; int on; MenuStyle *ms; MenuStyle *tmpms; Bool is_initialised = True; Bool has_gc_changed = False; int val[2]; int n; FlocaleFont *new_font = NULL; int i; KeyCode keycode; FvwmPictureAttributes fpa; action = GetNextToken(action, &name); if (!name) { fvwm_msg(ERR, "NewMenuStyle", "error in %s style specification",action); return NULL; } ms = menustyle_find(name); if (ms && ST_USAGE_COUNT(ms) != 0) { fvwm_msg(ERR,"NewMenuStyle", "menu style %s is in use", name); return ms; } tmpms = (MenuStyle *)safemalloc(sizeof(MenuStyle)); if (ms) { /* copy the structure over our temporary menu face. */ memcpy(tmpms, ms, sizeof(MenuStyle)); free(name); } else { memset(tmpms, 0, sizeof(MenuStyle)); ST_NAME(tmpms) = name; is_initialised = False; } ST_IS_UPDATED(tmpms) = 1; /* Parse the options. */ while (!is_initialised || (action && *action)) { on = 1; if (!is_initialised) { /* some default configuration goes here for the new * menu style */ ST_MENU_COLORS(tmpms).back = GetColor(DEFAULT_BACK_COLOR); ST_MENU_COLORS(tmpms).fore = GetColor(DEFAULT_FORE_COLOR); ST_PSTDFONT(tmpms) = Scr.DefaultFont; ST_USING_DEFAULT_FONT(tmpms) = True; ST_FACE(tmpms).type = SimpleMenu; ST_HAS_ACTIVE_FORE(tmpms) = 0; ST_HAS_ACTIVE_BACK(tmpms) = 0; ST_DO_POPUP_AS(tmpms) = MDP_POST_MENU; ST_DOUBLE_CLICK_TIME(tmpms) = DEFAULT_MENU_CLICKTIME; ST_POPUP_DELAY(tmpms) = DEFAULT_POPUP_DELAY; ST_POPDOWN_DELAY(tmpms) = DEFAULT_POPDOWN_DELAY; ST_MOUSE_WHEEL(tmpms) = MMW_POINTER; ST_SCROLL_OFF_PAGE(tmpms) = 1; ST_DO_HILIGHT_TITLE_BACK(tmpms) = 0; ST_USING_DEFAULT_TITLEFONT(tmpms) = True; has_gc_changed = True; option = "fvwm"; } else { /* Read next option specification (delimited by a comma * or \0). */ args = action; action = GetQuotedString( action, &optstring, ",", NULL, NULL, NULL); if (!optstring) { break; } args = GetNextToken(optstring, &option); if (!option) { free(optstring); break; } (void)GetNextToken(args, &arg1); } poption = option; while (poption[0] == '!') { on ^= 1; poption++; } switch((i = menustyle_get_styleopt_index(poption))) { case 0: /* fvwm */ case 1: /* mwm */ case 2: /* win */ if (i == 0) { ST_POPUP_OFFSET_PERCENT(tmpms) = 67; ST_POPUP_OFFSET_ADD(tmpms) = 0; ST_DO_POPUP_IMMEDIATELY(tmpms) = 0; ST_DO_WARP_TO_TITLE(tmpms) = 1; ST_DO_UNMAP_SUBMENU_ON_POPDOWN(tmpms) = 0; ST_RELIEF_THICKNESS(tmpms) = 1; ST_TITLE_UNDERLINES(tmpms) = 1; ST_HAS_LONG_SEPARATORS(tmpms) = 0; ST_HAS_TRIANGLE_RELIEF(tmpms) = 1; ST_DO_HILIGHT_BACK(tmpms) = 0; ST_DO_HILIGHT_FORE(tmpms) = 0; } else if (i == 1) { ST_POPUP_OFFSET_PERCENT(tmpms) = 100; ST_POPUP_OFFSET_ADD(tmpms) = -DEFAULT_MENU_BORDER_WIDTH - 1; ST_DO_POPUP_IMMEDIATELY(tmpms) = 1; ST_DO_WARP_TO_TITLE(tmpms) = 0; ST_DO_UNMAP_SUBMENU_ON_POPDOWN(tmpms) = 0; ST_RELIEF_THICKNESS(tmpms) = 2; ST_TITLE_UNDERLINES(tmpms) = 2; ST_HAS_LONG_SEPARATORS(tmpms) = 1; ST_HAS_TRIANGLE_RELIEF(tmpms) = 1; ST_DO_HILIGHT_BACK(tmpms) = 0; ST_DO_HILIGHT_FORE(tmpms) = 0; } else /* i == 2 */ { ST_POPUP_OFFSET_PERCENT(tmpms) = 100; ST_POPUP_OFFSET_ADD(tmpms) = -DEFAULT_MENU_BORDER_WIDTH - 3; ST_DO_POPUP_IMMEDIATELY(tmpms) = 1; ST_DO_WARP_TO_TITLE(tmpms) = 0; ST_DO_UNMAP_SUBMENU_ON_POPDOWN(tmpms) = 1; ST_RELIEF_THICKNESS(tmpms) = 0; ST_TITLE_UNDERLINES(tmpms) = 1; ST_HAS_LONG_SEPARATORS(tmpms) = 0; ST_HAS_TRIANGLE_RELIEF(tmpms) = 0; ST_DO_HILIGHT_BACK(tmpms) = 1; ST_DO_HILIGHT_FORE(tmpms) = 1; } /* common settings */ ST_VERTICAL_MARGIN_TOP(tmpms) = 0; ST_VERTICAL_MARGIN_BOTTOM(tmpms) = 0; ST_CSET_MENU(tmpms) = 0; ST_HAS_MENU_CSET(tmpms) = 0; ST_CSET_ACTIVE(tmpms) = 0; ST_HAS_ACTIVE_CSET(tmpms) = 0; ST_CSET_GREYED(tmpms) = 0; ST_HAS_GREYED_CSET(tmpms) = 0; ST_BORDER_WIDTH(tmpms) = DEFAULT_MENU_BORDER_WIDTH; ST_ACTIVE_AREA_PERCENT(tmpms) = DEFAULT_MENU_POPUP_NOW_RATIO; ST_ITEM_GAP_ABOVE(tmpms) = DEFAULT_MENU_ITEM_TEXT_Y_OFFSET; ST_ITEM_GAP_BELOW(tmpms) = DEFAULT_MENU_ITEM_TEXT_Y_OFFSET2; ST_TITLE_GAP_ABOVE(tmpms) = DEFAULT_MENU_TITLE_TEXT_Y_OFFSET; ST_TITLE_GAP_BELOW(tmpms) = DEFAULT_MENU_TITLE_TEXT_Y_OFFSET2; ST_USE_LEFT_SUBMENUS(tmpms) = 0; ST_IS_ANIMATED(tmpms) = 0; ST_USE_AUTOMATIC_HOTKEYS(tmpms) = 0; /* Pressing a hotkey on an item which only has a * single entry will activate that action; turning * those off will make the menu persist until enter or * space is pressed; the default behaviour is to * always close the menu and run the action. */ ST_HOTKEY_ACTIVATES_IMMEDIATE(tmpms) = 1; menustyle_free_face(&ST_FACE(tmpms)); ST_FACE(tmpms).type = SimpleMenu; if (ST_PSTDFONT(tmpms) && !ST_USING_DEFAULT_FONT(tmpms)) { FlocaleUnloadFont(dpy, ST_PSTDFONT(tmpms)); } ST_PSTDFONT(tmpms) = Scr.DefaultFont; ST_USING_DEFAULT_FONT(tmpms) = True; has_gc_changed = True; if (ST_HAS_SIDE_COLOR(tmpms) == 1) { fvwmlib_free_colors( dpy, &ST_SIDE_COLOR(tmpms), 1, True); ST_HAS_SIDE_COLOR(tmpms) = 0; } ST_HAS_SIDE_COLOR(tmpms) = 0; if (ST_SIDEPIC(tmpms)) { PDestroyFvwmPicture(dpy, ST_SIDEPIC(tmpms)); ST_SIDEPIC(tmpms) = NULL; } if (is_initialised == False) { /* now begin the real work */ is_initialised = True; continue; } break; case 3: /* Foreground */ fvwmlib_free_colors( dpy, &ST_MENU_COLORS(tmpms).fore, 1, True); if (arg1) { ST_MENU_COLORS(tmpms).fore = GetColor(arg1); } else { ST_MENU_COLORS(tmpms).fore = GetColor(DEFAULT_FORE_COLOR); } has_gc_changed = True; break; case 4: /* Background */ fvwmlib_free_colors( dpy, &ST_MENU_COLORS(tmpms).back, 1, True); if (arg1) { ST_MENU_COLORS(tmpms).back = GetColor(arg1); } else { ST_MENU_COLORS(tmpms).back = GetColor(DEFAULT_BACK_COLOR); } has_gc_changed = True; break; case 5: /* Greyed */ if (ST_HAS_STIPPLE_FORE(tmpms)) { fvwmlib_free_colors( dpy, &ST_MENU_STIPPLE_COLORS(tmpms).fore, 1, True); } if (arg1 == NULL) { ST_HAS_STIPPLE_FORE(tmpms) = 0; } else { ST_MENU_STIPPLE_COLORS(tmpms).fore = GetColor(arg1); ST_HAS_STIPPLE_FORE(tmpms) = 1; } has_gc_changed = True; break; case 7: /* HilightBackOff */ on ^= 1; /* fall throw */ case 6: /* HilightBack */ if (ST_HAS_ACTIVE_BACK(tmpms)) { fvwmlib_free_colors( dpy, &ST_MENU_ACTIVE_COLORS(tmpms).back, 1, True); } if (arg1 == NULL || !on) { ST_HAS_ACTIVE_BACK(tmpms) = 0; } else { ST_MENU_ACTIVE_COLORS(tmpms).back = GetColor(arg1); ST_HAS_ACTIVE_BACK(tmpms) = 1; } ST_DO_HILIGHT_BACK(tmpms) = on; has_gc_changed = True; break; case 9: /* ActiveForeOff */ on ^= 1; /* fall throw */ case 8: /* ActiveFore */ if (ST_HAS_ACTIVE_FORE(tmpms)) { fvwmlib_free_colors( dpy, &ST_MENU_ACTIVE_COLORS(tmpms).fore, 1, True); } if (arg1 == NULL || !on) { ST_HAS_ACTIVE_FORE(tmpms) = 0; } else { ST_MENU_ACTIVE_COLORS(tmpms).fore = GetColor(arg1); ST_HAS_ACTIVE_FORE(tmpms) = 1; } ST_DO_HILIGHT_FORE(tmpms) = on; has_gc_changed = True; break; case 10: /* Hilight3DThick */ ST_RELIEF_THICKNESS(tmpms) = 2; break; case 11: /* Hilight3DThin */ ST_RELIEF_THICKNESS(tmpms) = 1; break; case 12: /* Hilight3DOff */ ST_RELIEF_THICKNESS(tmpms) = 0; break; case 13: /* Animation */ ST_IS_ANIMATED(tmpms) = on; break; case 14: /* AnimationOff */ ST_IS_ANIMATED(tmpms) = !on; break; case 15: /* Font */ if (arg1 != NULL && !(new_font = FlocaleLoadFont(dpy, arg1, "fvwm"))) { fvwm_msg(ERR, "NewMenuStyle", "Couldn't load font '%s'\n", arg1); break; } if (ST_PSTDFONT(tmpms) && !ST_USING_DEFAULT_FONT(tmpms)) { FlocaleUnloadFont(dpy, ST_PSTDFONT(tmpms)); } if (arg1 == NULL) { /* reset to screen font */ ST_PSTDFONT(tmpms) = Scr.DefaultFont; ST_USING_DEFAULT_FONT(tmpms) = True; } else { ST_PSTDFONT(tmpms) = new_font; ST_USING_DEFAULT_FONT(tmpms) = False; } has_gc_changed = True; break; case 16: /* MenuFace */ while (args && *args != '\0' && isspace((unsigned char)*args)) { args++; } menustyle_parse_face(args, &ST_FACE(tmpms), True); break; case 17: /* PopupDelay */ if (GetIntegerArguments(args, NULL, val, 1) == 0 || *val < 0) { ST_POPUP_DELAY(tmpms) = DEFAULT_POPUP_DELAY; } else { ST_POPUP_DELAY(tmpms) = (*val+9)/10; } break; case 18: /* PopupOffset */ if ((n = GetIntegerArguments(args, NULL, val, 2)) == 0) { fvwm_msg(ERR,"NewMenuStyle", "PopupOffset requires one or two" " arguments"); } else { ST_POPUP_OFFSET_ADD(tmpms) = val[0]; if (n == 2 && val[1] <= 100 && val[1] >= 0) { ST_POPUP_OFFSET_PERCENT(tmpms) = val[1]; } else { ST_POPUP_OFFSET_PERCENT(tmpms) = 100; } } break; case 19: /* TitleWarp */ ST_DO_WARP_TO_TITLE(tmpms) = on; break; case 20: /* TitleWarpOff */ ST_DO_WARP_TO_TITLE(tmpms) = !on; break; case 21: /* TitleUnderlines0 */ ST_TITLE_UNDERLINES(tmpms) = 0; break; case 22: /* TitleUnderlines1 */ ST_TITLE_UNDERLINES(tmpms) = 1; break; case 23: /* TitleUnderlines2 */ ST_TITLE_UNDERLINES(tmpms) = 2; break; case 24: /* SeparatorsLong */ ST_HAS_LONG_SEPARATORS(tmpms) = on; break; case 25: /* SeparatorsShort */ ST_HAS_LONG_SEPARATORS(tmpms) = !on; break; case 26: /* TrianglesSolid */ ST_HAS_TRIANGLE_RELIEF(tmpms) = !on; break; case 27: /* TrianglesRelief */ ST_HAS_TRIANGLE_RELIEF(tmpms) = on; break; case 28: /* PopupImmediately */ ST_DO_POPUP_IMMEDIATELY(tmpms) = on; break; case 29: /* PopupDelayed */ ST_DO_POPUP_IMMEDIATELY(tmpms) = !on; break; case 30: /* DoubleClickTime */ if (GetIntegerArguments(args, NULL, val, 1) == 0 || *val < 0) { ST_DOUBLE_CLICK_TIME(tmpms) = DEFAULT_MENU_CLICKTIME; } else { ST_DOUBLE_CLICK_TIME(tmpms) = *val; } break; case 31: /* SidePic */ if (ST_SIDEPIC(tmpms)) { PDestroyFvwmPicture(dpy, ST_SIDEPIC(tmpms)); ST_SIDEPIC(tmpms) = NULL; } if (arg1) { fpa.mask = (Pdepth <= 8)? FPAM_DITHER:0; ST_SIDEPIC(tmpms) = PCacheFvwmPicture( dpy, Scr.NoFocusWin, NULL, arg1, fpa); if (!ST_SIDEPIC(tmpms)) { fvwm_msg(WARN, "NewMenuStyle", "Couldn't find pixmap %s", arg1); } } break; case 32: /* SideColor */ if (ST_HAS_SIDE_COLOR(tmpms) == 1) { fvwmlib_free_colors( dpy, &ST_SIDE_COLOR(tmpms), 1, True); ST_HAS_SIDE_COLOR(tmpms) = 0; } if (arg1) { ST_SIDE_COLOR(tmpms) = GetColor(arg1); ST_HAS_SIDE_COLOR(tmpms) = 1; } break; case 33: /* PopupAsRootmenu */ ST_DO_POPUP_AS(tmpms) = MDP_ROOT_MENU; break; case 34: /* PopupAsSubmenu */ ST_DO_POPUP_AS(tmpms) = MDP_POST_MENU; break; case 35: /* RemoveSubmenus */ ST_DO_UNMAP_SUBMENU_ON_POPDOWN(tmpms) = on; break; case 36: /* HoldSubmenus */ ST_DO_UNMAP_SUBMENU_ON_POPDOWN(tmpms) = !on; break; case 37: /* SubmenusRight */ ST_USE_LEFT_SUBMENUS(tmpms) = !on; break; case 38: /* SubmenusLeft */ ST_USE_LEFT_SUBMENUS(tmpms) = on; break; case 39: /* BorderWidth */ if (GetIntegerArguments(args, NULL, val, 1) == 0 || *val < 0 || *val > MAX_MENU_BORDER_WIDTH) { ST_BORDER_WIDTH(tmpms) = DEFAULT_MENU_BORDER_WIDTH; } else { ST_BORDER_WIDTH(tmpms) = *val; } break; case 40: /* Hilight3DThickness */ if (GetIntegerArguments(args, NULL, val, 1) > 0) { if (*val < 0) { *val = -*val; ST_IS_ITEM_RELIEF_REVERSED(tmpms) = 1; } else { ST_IS_ITEM_RELIEF_REVERSED(tmpms) = 0; } if (*val > MAX_MENU_ITEM_RELIEF_THICKNESS) *val = MAX_MENU_ITEM_RELIEF_THICKNESS; ST_RELIEF_THICKNESS(tmpms) = *val; } break; case 41: /* ItemFormat */ if (ST_ITEM_FORMAT(tmpms)) { free(ST_ITEM_FORMAT(tmpms)); ST_ITEM_FORMAT(tmpms) = NULL; } if (arg1) { ST_ITEM_FORMAT(tmpms) = safestrdup(arg1); } break; case 42: /* AutomaticHotkeys */ ST_USE_AUTOMATIC_HOTKEYS(tmpms) = on; break; case 43: /* AutomaticHotkeysOff */ ST_USE_AUTOMATIC_HOTKEYS(tmpms) = !on; break; case 44: /* VerticalItemSpacing */ parse_vertical_spacing_line( args, &ST_ITEM_GAP_ABOVE(tmpms), &ST_ITEM_GAP_BELOW(tmpms), DEFAULT_MENU_ITEM_TEXT_Y_OFFSET, DEFAULT_MENU_ITEM_TEXT_Y_OFFSET2); break; case 45: /* VerticalTitleSpacing */ parse_vertical_spacing_line( args, &ST_TITLE_GAP_ABOVE(tmpms), &ST_TITLE_GAP_BELOW(tmpms), DEFAULT_MENU_TITLE_TEXT_Y_OFFSET, DEFAULT_MENU_TITLE_TEXT_Y_OFFSET2); break; case 46: /* MenuColorset */ if (GetIntegerArguments(args, NULL, val, 1) == 0 || *val < 0) { ST_HAS_MENU_CSET(tmpms) = 0; ST_CSET_MENU(tmpms) = 0; } else { ST_HAS_MENU_CSET(tmpms) = 1; ST_CSET_MENU(tmpms) = *val; alloc_colorset(*val); } has_gc_changed = True; break; case 47: /* ActiveColorset */ if (GetIntegerArguments(args, NULL, val, 1) == 0 || *val < 0) { ST_HAS_ACTIVE_CSET(tmpms) = 0; ST_CSET_ACTIVE(tmpms) = 0; } else { ST_HAS_ACTIVE_CSET(tmpms) = 1; ST_CSET_ACTIVE(tmpms) = *val; alloc_colorset(*val); } has_gc_changed = True; break; case 48: /* GreyedColorset */ if (GetIntegerArguments(args, NULL, val, 1) == 0 || *val < 0) { ST_HAS_GREYED_CSET(tmpms) = 0; ST_CSET_GREYED(tmpms) = 0; } else { ST_HAS_GREYED_CSET(tmpms) = 1; ST_CSET_GREYED(tmpms) = *val; alloc_colorset(*val); } has_gc_changed = True; break; case 49: /* SelectOnRelease */ keycode = 0; if (arg1) { keycode = XKeysymToKeycode( dpy, FvwmStringToKeysym(dpy, arg1)); } ST_SELECT_ON_RELEASE_KEY(tmpms) = keycode; break; case 50: /* PopdownImmediately */ ST_DO_POPDOWN_IMMEDIATELY(tmpms) = 1; break; case 51: /* PopdownDelayed */ ST_DO_POPDOWN_IMMEDIATELY(tmpms) = 0; break; case 52: /* PopdownDelay */ if (GetIntegerArguments(args, NULL, val, 1) == 0 || *val < 0) { ST_POPDOWN_DELAY(tmpms) = DEFAULT_POPDOWN_DELAY; } else { ST_POPDOWN_DELAY(tmpms) = (*val+9)/10; } break; case 53: /* PopupActiveArea */ if (GetIntegerArguments(args, NULL, val, 1) == 0 || *val <= 50 || *val > 100) { ST_ACTIVE_AREA_PERCENT(tmpms) = DEFAULT_MENU_POPUP_NOW_RATIO; } else { ST_ACTIVE_AREA_PERCENT(tmpms) = *val; } break; case 54: /* PopupIgnore */ ST_DO_POPUP_AS(tmpms) = MDP_IGNORE; break; case 55: /* PopupClose */ ST_DO_POPUP_AS(tmpms) = MDP_CLOSE; break; case 56: /* MouseWheel */ if (arg1) { if (StrEquals(arg1, "ActivatesItem")) { ST_MOUSE_WHEEL(tmpms) = MMW_OFF; } else if (StrEquals(arg1, "ScrollsMenuBackwards")) { ST_MOUSE_WHEEL(tmpms) = MMW_MENU_BACKWARDS; } else if (StrEquals(arg1, "ScrollsMenu")) { ST_MOUSE_WHEEL(tmpms) = MMW_MENU; } else if (StrEquals(arg1, "ScrollsPointer")) { ST_MOUSE_WHEEL(tmpms) = MMW_POINTER; } else { fvwm_msg( ERR, "NewMenuStyle", "unknown argument to" " MouseWheel '%s'", arg1); ST_MOUSE_WHEEL(tmpms) = MMW_POINTER; } } else { ST_MOUSE_WHEEL(tmpms) = (on) ? MMW_POINTER : MMW_OFF; } break; case 57: /* ScrollOffPage */ ST_SCROLL_OFF_PAGE(tmpms) = on; break; case 58: /* TrianglesUseFore */ ST_TRIANGLES_USE_FORE(tmpms) = on; break; case 59: /* TitleColorset */ if (GetIntegerArguments(args, NULL, val, 1) == 0 || *val < 0) { ST_HAS_TITLE_CSET(tmpms) = 0; ST_CSET_TITLE(tmpms) = 0; } else { ST_HAS_TITLE_CSET(tmpms) = 1; ST_CSET_TITLE(tmpms) = *val; alloc_colorset(*val); } has_gc_changed = True; break; case 60: /* TitleHilightBack */ ST_DO_HILIGHT_TITLE_BACK(tmpms) = on; has_gc_changed = True; break; case 61: /* TitleFont */ if (arg1 != NULL && !(new_font = FlocaleLoadFont(dpy, arg1, "fvwm"))) { fvwm_msg(ERR, "NewMenuStyle", "Couldn't load font '%s'\n", arg1); break; } if ( ST_PTITLEFONT(tmpms) && !ST_USING_DEFAULT_TITLEFONT(tmpms)) { FlocaleUnloadFont(dpy, ST_PTITLEFONT(tmpms)); } if (arg1 == NULL) { /* reset to screen font */ ST_PTITLEFONT(tmpms) = Scr.DefaultFont; ST_USING_DEFAULT_TITLEFONT(tmpms) = True; } else { ST_PTITLEFONT(tmpms) = new_font; ST_USING_DEFAULT_TITLEFONT(tmpms) = False; } has_gc_changed = True; break; case 62: /* VerticalMargins */ parse_vertical_margins_line( args, &ST_VERTICAL_MARGIN_TOP(tmpms), &ST_VERTICAL_MARGIN_BOTTOM(tmpms), 0, 0); break; case 63: /* UniqueHotKeyActivatesImmediate */ ST_HOTKEY_ACTIVATES_IMMEDIATE(tmpms) = on; break; #if 0 case 99: /* PositionHints */ /* to be implemented */ break; #endif default: fvwm_msg(ERR, "NewMenuStyle", "unknown option '%s'", poption); break; } /* switch */ if (option) { free(option); option = NULL; } free(optstring); optstring = NULL; if (arg1) { free(arg1); arg1 = NULL; } } /* while */ if (has_gc_changed) { menustyle_update(tmpms); } if (default_menu_style == NULL) { /* First MenuStyle MUST be the default style */ default_menu_style = tmpms; ST_NEXT_STYLE(tmpms) = NULL; } else if (ms) { /* copy our new menu face over the old one */ memcpy(ms, tmpms, sizeof(MenuStyle)); free(tmpms); return ms; } else { MenuStyle *before = default_menu_style; /* add a new menu face to list */ ST_NEXT_STYLE(tmpms) = NULL; while (ST_NEXT_STYLE(before)) before = ST_NEXT_STYLE(before); ST_NEXT_STYLE(before) = tmpms; } return tmpms; } void menustyle_copy(MenuStyle *origms, MenuStyle *destms) { FvwmPictureAttributes fpa; /* Copy origms to destms, be aware of all pointers in the MenuStyle strcture. Use the same order as in menustyle_parse_style */ /* menu colors */ fvwmlib_copy_color( dpy, &ST_MENU_COLORS(destms).fore, &ST_MENU_COLORS(origms).fore, True, True); fvwmlib_copy_color( dpy, &ST_MENU_COLORS(destms).back, &ST_MENU_COLORS(origms).back, True, True); /* Greyed */ fvwmlib_copy_color( dpy, &ST_MENU_STIPPLE_COLORS(destms).fore, &ST_MENU_STIPPLE_COLORS(origms).fore, ST_HAS_STIPPLE_FORE(destms), ST_HAS_STIPPLE_FORE(origms)); ST_MENU_STIPPLE_COLORS(destms).back = ST_MENU_STIPPLE_COLORS(origms).back; ST_HAS_STIPPLE_FORE(destms) = ST_HAS_STIPPLE_FORE(origms); /* HilightBack */ fvwmlib_copy_color( dpy, &ST_MENU_ACTIVE_COLORS(destms).back, &ST_MENU_ACTIVE_COLORS(origms).back, ST_HAS_ACTIVE_BACK(destms), ST_HAS_ACTIVE_BACK(origms)); ST_HAS_ACTIVE_BACK(destms) = ST_HAS_ACTIVE_BACK(origms); ST_DO_HILIGHT_BACK(destms) = ST_DO_HILIGHT_BACK(origms); /* ActiveFore */ fvwmlib_copy_color( dpy, &ST_MENU_ACTIVE_COLORS(destms).fore, &ST_MENU_ACTIVE_COLORS(origms).fore, ST_HAS_ACTIVE_FORE(destms), ST_HAS_ACTIVE_FORE(origms)); ST_HAS_ACTIVE_FORE(destms) = ST_HAS_ACTIVE_FORE(origms); ST_DO_HILIGHT_FORE(destms) = ST_DO_HILIGHT_FORE(origms); /* Hilight3D */ ST_RELIEF_THICKNESS(destms) = ST_RELIEF_THICKNESS(origms); /* Animation */ ST_IS_ANIMATED(destms) = ST_IS_ANIMATED(origms); /* font */ if (ST_PSTDFONT(destms) && !ST_USING_DEFAULT_FONT(destms)) { FlocaleUnloadFont(dpy, ST_PSTDFONT(destms)); } if (ST_PSTDFONT(origms) && !ST_USING_DEFAULT_FONT(origms)) { if (!(ST_PSTDFONT(destms) = FlocaleLoadFont(dpy, ST_PSTDFONT(origms)->name, "fvwm"))) { ST_PSTDFONT(destms) = Scr.DefaultFont; ST_USING_DEFAULT_FONT(destms) = True; fvwm_msg(ERR, "CopyMenuStyle", "Couldn't load font '%s' use Default Font\n", ST_PSTDFONT(origms)->name); } else { ST_USING_DEFAULT_FONT(destms) = False; } } else { ST_USING_DEFAULT_FONT(destms) = True; ST_PSTDFONT(destms) = Scr.DefaultFont; } /* TitleFont */ if (ST_PTITLEFONT(destms) && !ST_USING_DEFAULT_TITLEFONT(destms)) { FlocaleUnloadFont(dpy, ST_PTITLEFONT(destms)); } if (ST_PTITLEFONT(origms) && !ST_USING_DEFAULT_TITLEFONT(origms)) { if ( !(ST_PTITLEFONT(destms) = FlocaleLoadFont( dpy, ST_PTITLEFONT(origms)->name, "fvwm"))) { ST_PTITLEFONT(destms) = Scr.DefaultFont; ST_USING_DEFAULT_TITLEFONT(destms) = True; fvwm_msg(ERR, "CopyMenuStyle", "Couldn't load font '%s' use Default Font\n", ST_PTITLEFONT(origms)->name); } else { ST_USING_DEFAULT_TITLEFONT(destms) = False; } } else { ST_USING_DEFAULT_TITLEFONT(destms) = True; ST_PTITLEFONT(destms) = Scr.DefaultFont; } /* MenuFace */ menustyle_copy_face(&ST_FACE(destms), &ST_FACE(origms)); /* PopupDelay */ ST_POPUP_DELAY(destms) = ST_POPUP_DELAY(origms); /* PopupOffset */ ST_POPUP_OFFSET_PERCENT(destms) = ST_POPUP_OFFSET_PERCENT(origms); ST_POPUP_OFFSET_ADD(destms) = ST_POPUP_OFFSET_ADD(origms); /* TitleWarp */ ST_DO_WARP_TO_TITLE(destms) = ST_DO_WARP_TO_TITLE(origms); /* TitleUnderlines */ ST_TITLE_UNDERLINES(destms) = ST_TITLE_UNDERLINES(origms); /* Separators */ ST_HAS_LONG_SEPARATORS(destms) = ST_HAS_LONG_SEPARATORS(origms); /* Triangles */ ST_HAS_TRIANGLE_RELIEF(destms) = ST_HAS_TRIANGLE_RELIEF(origms); /* PopupDelayed */ ST_DO_POPUP_IMMEDIATELY(destms) = ST_DO_POPUP_IMMEDIATELY(origms); /* DoubleClickTime */ ST_DOUBLE_CLICK_TIME(destms) = ST_DOUBLE_CLICK_TIME(origms); /* VerticalMargins */ ST_VERTICAL_MARGIN_TOP(destms) = ST_VERTICAL_MARGIN_TOP(origms); ST_VERTICAL_MARGIN_BOTTOM(destms) = ST_VERTICAL_MARGIN_BOTTOM(origms); /* SidePic */ if (ST_SIDEPIC(destms)) { PDestroyFvwmPicture(dpy, ST_SIDEPIC(destms)); ST_SIDEPIC(destms) = NULL; } if (ST_SIDEPIC(origms)) { fpa.mask = (Pdepth <= 8)? FPAM_DITHER:0; ST_SIDEPIC(destms) = PCacheFvwmPicture( dpy, Scr.NoFocusWin, NULL, ST_SIDEPIC(origms)->name, fpa); } /* side color */ fvwmlib_copy_color( dpy, &ST_SIDE_COLOR(destms), &ST_SIDE_COLOR(origms), ST_HAS_SIDE_COLOR(destms), ST_HAS_SIDE_COLOR(origms)); ST_HAS_SIDE_COLOR(destms) = ST_HAS_SIDE_COLOR(origms); /* PopupAsRootmenu */ ST_DO_POPUP_AS(destms) = ST_DO_POPUP_AS(origms); /* RemoveSubmenus */ ST_DO_UNMAP_SUBMENU_ON_POPDOWN(destms) = ST_DO_UNMAP_SUBMENU_ON_POPDOWN(origms); /* SubmenusRight */ ST_USE_LEFT_SUBMENUS(destms) = ST_USE_LEFT_SUBMENUS(origms); /* BorderWidth */ ST_BORDER_WIDTH(destms) = ST_BORDER_WIDTH(origms); /* Hilight3DThickness */ ST_IS_ITEM_RELIEF_REVERSED(destms) = ST_IS_ITEM_RELIEF_REVERSED(origms); /* ItemFormat */ if (ST_ITEM_FORMAT(destms)) { free(ST_ITEM_FORMAT(destms)); ST_ITEM_FORMAT(destms) = NULL; } if (ST_ITEM_FORMAT(origms)) { ST_ITEM_FORMAT(destms) = safestrdup(ST_ITEM_FORMAT(origms)); } /* AutomaticHotkeys */ ST_USE_AUTOMATIC_HOTKEYS(destms) = ST_USE_AUTOMATIC_HOTKEYS(origms); ST_HOTKEY_ACTIVATES_IMMEDIATE(destms) = ST_HOTKEY_ACTIVATES_IMMEDIATE(origms); /* Item and Title Spacing */ ST_ITEM_GAP_ABOVE(destms) = ST_ITEM_GAP_ABOVE(origms); ST_ITEM_GAP_BELOW(destms) = ST_ITEM_GAP_BELOW(origms); ST_TITLE_GAP_ABOVE(destms) = ST_TITLE_GAP_ABOVE(origms); ST_TITLE_GAP_BELOW(destms) = ST_TITLE_GAP_BELOW(origms); /* MenuColorset */ ST_HAS_MENU_CSET(destms) = ST_HAS_MENU_CSET(origms); ST_CSET_MENU(destms) = ST_CSET_MENU(origms); /* ActiveColorset */ ST_HAS_ACTIVE_CSET(destms) = ST_HAS_ACTIVE_CSET(origms); ST_CSET_ACTIVE(destms) = ST_CSET_ACTIVE(origms); /* MenuColorset */ ST_HAS_GREYED_CSET(destms) = ST_HAS_GREYED_CSET(origms); ST_CSET_GREYED(destms) = ST_CSET_GREYED(origms); /* TitleColorset */ ST_HAS_TITLE_CSET(destms) = ST_HAS_TITLE_CSET(origms); ST_CSET_TITLE(destms) = ST_CSET_TITLE(origms); /* SelectOnRelease */ ST_SELECT_ON_RELEASE_KEY(destms) = ST_SELECT_ON_RELEASE_KEY(origms); /* PopdownImmediately */ ST_DO_POPDOWN_IMMEDIATELY(destms) = ST_DO_POPDOWN_IMMEDIATELY(origms); /* PopdownDelay */ ST_POPDOWN_DELAY(destms) = ST_POPDOWN_DELAY(origms); /* Scroll */ ST_MOUSE_WHEEL(destms) = ST_MOUSE_WHEEL(origms); /* ScrollOffPage */ ST_SCROLL_OFF_PAGE(destms) = ST_SCROLL_OFF_PAGE(origms); /* TrianglesUseFore */ ST_TRIANGLES_USE_FORE(destms) = ST_TRIANGLES_USE_FORE(origms); /* Title */ ST_DO_HILIGHT_TITLE_BACK(destms) = ST_DO_HILIGHT_TITLE_BACK(origms); menustyle_update(destms); return; } /* ---------------------------- builtin commands --------------------------- */ void CMD_CopyMenuStyle(F_CMD_ARGS) { char *origname = NULL; char *destname = NULL; char *buffer; MenuStyle *origms; MenuStyle *destms; origname = PeekToken(action, &action); if (origname == NULL) { fvwm_msg(ERR,"CopyMenuStyle", "need two arguments"); return; } origms = menustyle_find(origname); if (!origms) { fvwm_msg(ERR, "CopyMenuStyle", "%s: no such menu style", origname); return; } destname = PeekToken(action, &action); if (destname == NULL) { fvwm_msg(ERR,"CopyMenuStyle", "need two arguments"); return; } if (action && *action) { fvwm_msg(ERR,"CopyMenuStyle", "too many arguments"); return; } destms = menustyle_find(destname); if (!destms) { /* create destms menu style */ buffer = (char *)safemalloc(strlen(destname) + 3); sprintf(buffer,"\"%s\"",destname); action = buffer; destms = menustyle_parse_style(F_PASS_ARGS); free(buffer); if (!destms) { /* this must never happen */ fvwm_msg(ERR, "CopyMenuStyle", "impossible to create %s menu style", destname); return; } } if (strcasecmp("*",destname) == 0) { fvwm_msg(ERR, "CopyMenuStyle", "You cannot copy on the default menu style"); return; } if (strcasecmp(ST_NAME(origms),destname) == 0) { fvwm_msg(ERR, "CopyMenuStyle", "%s and %s identify the same menu style", ST_NAME(origms),destname); return; } if (ST_USAGE_COUNT(destms) != 0) { fvwm_msg(ERR, "CopyMenuStyle", "menu style %s is in use", destname); return; } menustyle_copy(origms, destms); return; } void CMD_MenuStyle(F_CMD_ARGS) { char *option; char *poption; GetNextSimpleOption(SkipNTokens(action, 1), &option); poption = option; while (poption && poption[0] == '!') { poption++; } if (option == NULL || menustyle_get_styleopt_index(poption) != -1) { (void)menustyle_parse_style(F_PASS_ARGS); } else { (void)menustyle_parse_old_style(F_PASS_ARGS); } if (option) { free(option); } return; } fvwm-2.6.5.orig/fvwm/ConfigFvwmSetup0000644000175000017500000002671711476546467015653 0ustar vwcvwc# This file is copied to a new user's FVWM_USERDIR by FvwmForm-Setup form. # This file contains the commands fvwm reads while starting. # EdgeResistance 250 10 EdgeScroll 100 100 ClickTime 750 DeskTopSize 2x2 MenuStyle * fvwm, Foreground white, Background cornflowerblue, Greyed grey40 MenuStyle * Font -adobe-times-bold-r-*-*-14-*-*-*-*-*-*-* ColormapFocus FollowsMouse # default Styles: # make sure these fonts exist on your system: Style * Font -adobe-times-bold-r-*-*-12-*-*-*-*-*-*-* Style * IconFont -adobe-times-bold-r-*-*-12-*-*-*-*-*-*-* Style * HilightFore black, HilightBack cornflowerblue Style * BorderWidth 7, HandleWidth 7 Style * Icon unknown1.xpm, Color lightgrey/dimgrey Style * MWMFunctions, MWMDecor, HintOverride Style * DecorateTransient, NoPPosition Style * IconBox 0 -10 -280 -1 Style * FocusFollowsMouse Style * TileCascadePlacement # Styles for various Fvwm modules: Style Fvwm* NoTitle, Sticky, WindowListSkip Style Fvwm* BorderWidth 2, CirculateSkipIcon, CirculateSkip Style FvwmPager StaysOnTop Style FvwmBanner StaysOnTop Style FvwmButtons Icon toolbox.xpm, ClickToFocus # Styles for your common terminal emulator programs. # xterms and rxvts in a separate icon box: Style XTerm Icon xterm.xpm, SloppyFocus, IconBox -70 1 -1 -140 Style rxvt Icon term.xpm, SloppyFocus, IconBox -70 1 -1 -140 Style rxvt MWMBorder, MWMButtons # Styles for various common programs: Style *lock NoTitle, NoHandles, Sticky, WindowListSkip, ClickToFocus Style xbiff NoTitle, Sticky, WindowListSkip, ClickToFocus Style xcalc Icon xcalc.xpm, NoButton 2,ClickToFocus Style xmh Icon mail1.xpm, NoIconTitle,StickyIcon Style xmh NoButton 2 Style xman Icon xman.xpm, ClickToFocus Style xmag Icon mag_glass.xpm, ClickToFocus Style xgraph Icon graphs.xpm, ClickToFocus Style xmosaic Color Green/Yellow, ClickToFocus # some simple default key bindings: Key Next A SCM Next [*] Focus Key Prior A SCM Prev [*] Focus # some simple default mouse bindings: # for the root window: Mouse 1 R A Menu MenuFvwmRoot Nop Mouse 2 R A Menu MenuFvwmWindowOps Nop Mouse 3 R A WindowList # for the title bar buttons: Mouse 0 1 A Menu MenuFvwmWindowOps2 Close Mouse 0 2 A FuncFvwmMaximize Mouse 0 4 A Iconify # for other parts of the window/borders/icons: Mouse 1 F A FuncFvwmResizeOrRaise Mouse 1 TS A FuncFvwmMoveOrRaise Mouse 1 I A FuncFvwmMoveOrIconify Mouse 2 I A Iconify Mouse 2 FST A Menu MenuFvwmWindowOps2 Nop Mouse 3 TSIF A RaiseLower ######################## Initialization Functions ############################ AddToFunc StartFunction + I Module FvwmAnimate + I Module FvwmBanner + I Module FvwmButtons AddToFunc InitFunction + I exec xsetroot -mod 2 2 -fg rgb:55/40/55 -bg rgb:70/50/70 # For some SM-s (like gnome-session) there is an internal background setter. AddToFunc SessionInitFunction + I Nop ######################## Menus ################### DestroyMenu MenuFvwmRoot AddToMenu MenuFvwmRoot "$[gt.Root Menu]" Title + "&1. XTerm" Exec exec xterm + "&2. Rxvt" Exec exec rxvt + "" Nop + "&R. $[gt.Remote Logins]" Popup MenuFvwmLogins + "" Nop + "&U. $[gt.Utilities]" Popup MenuFvwmUtilities + "" Nop + "&M. $[gt.Fvwm Modules]" Popup MenuFvwmModules + "&W. $[gt.Fvwm Window Ops]" Popup MenuFvwmWindowOps + "&S. $[gt.Fvwm Config Ops]" Popup MenuFvwmConfig + "" Nop + "&F. $[gt.Refresh Screen]" Refresh + "&C. $[gt.Recapture Screen]" Recapture + "" Nop + "&X. $[gt.Exit Fvwm]" Popup MenuFvwmQuitVerify DestroyMenu MenuFvwmUtilities AddToMenu MenuFvwmUtilities "$[gt.Utilities]" Title + "&T. Top" Exec exec xterm -T Top -n Top -e top + "&C. Calculator" Exec exec xcalc + "&M. Xman" Exec exec xman + "&G. Xmag" Exec exec xmag + "&R. Editres" Exec exec editres + "" Nop + "&E. XEmacs" Exec exec xemacs + "&A. Xmh Mail" FuncFvwmMailXmh xmh "-font fixed" + "" Nop + "&L. XLock" Exec exec xlock -mode random + "" Nop + "&D. $[gt.Reset X defaults]" Exec xrdb -load $HOME/.Xdefaults DestroyMenu MenuFvwmConfig AddToMenu MenuFvwmConfig "$[gt.Fvwm Config Ops]" Title + "&S. $[gt.Sloppy Focus]" FuncFvwmFocusPolicyChange SloppyFocus + "&C. $[gt.Click To Focus]" FuncFvwmFocusPolicyChange ClickToFocus + "&F. $[gt.Focus Follows Mouse]" FuncFvwmFocusPolicyChange FocusFollowsMouse + "" Nop + "&1. $[gt.Colormap Follows Mouse]" ColormapFocus FollowsMouse + "&2. $[gt.Colormap Follows Focus]" ColormapFocus FollowsFocus + "" Nop + "&3. $[gt.Full Paging ON]" EdgeScroll 100 100 + "&4. $[gt.All Paging OFF]" EdgeScroll 0 0 + "&5. $[gt.Horizontal Paging Only]" EdgeScroll 100 0 + "&6. $[gt.Vertical Paging Only]" EdgeScroll 0 100 + "&7. $[gt.Partial Paging]" EdgeScroll 50 50 + "&8. $[gt.Full Paging && Edge Wrap]" EdgeScroll 100000 100000 # The window Ops menus exhibit a different HotKey style. # There are 2 versions of the WindowOps Menu, meant to be bound to different # things. Here is the "common" part: DestroyFunc FuncFvwmWindowCommon AddToFunc FuncFvwmWindowCommon + I AddToMenu $0 "$[gt.&Move]" Move + I AddToMenu $0 "$[gt.&Resize]" Resize + I AddToMenu $0 "$[gt.R&aise]" Raise + I AddToMenu $0 "$[gt.&Lower]" Lower + I AddToMenu $0 "$[gt.(De)&Iconify]" Iconify + I AddToMenu $0 "$[gt.(Un)&Stick]" Stick + I AddToMenu $0 "$[gt.(Un)Ma&ximize]" Maximize + I AddToMenu $0 "" Nop + I AddToMenu $0 "$[gt.&Delete]" Delete + I AddToMenu $0 "$[gt.&Close]" Close + I AddToMenu $0 "$[gt.Destroy]" Destroy + I AddToMenu $0 "" Nop # First windowops menu, bound to: # mouse 2 on root # Root menu DestroyMenu MenuFvwmWindowOps AddToMenu MenuFvwmWindowOps "$[gt.Window Ops]" Title FuncFvwmWindowCommon MenuFvwmWindowOps + "$[gt.Re&fresh Window]" RefreshWindow # Second windowops menu, bound to: # any mouse on titlebar button 1 # mouse 2 on frame, side or titlebar DestroyMenu MenuFvwmWindowOps2 AddToMenu MenuFvwmWindowOps2 FuncFvwmWindowCommon MenuFvwmWindowOps2 + Scroll&Bar Module FvwmScroll 2 2 + "&$[gt.Print]" FuncFvwmPrint + "$[gt.Print Re&verse]" FuncFvwmPrintReverse # 3 different ways to log on, take your pick: DestroyFunc FuncFvwmRloginXterm AddToFunc FuncFvwmRloginXterm \ I Exec xterm -name $0 -title "$USER @ $0" -e rlogin $0 DestroyFunc FuncFvwmRloginRxvt AddToFunc FuncFvwmRloginRxvt \ I Exec rxvt -name $0 -n $0 -title $USER@$0 -e rlogin $0 DestroyFunc FuncFvwmRloginSshRxvt AddToFunc FuncFvwmRloginSshRxvt \ I Exec Exec ssh $0 rxvt -display $HOSTDISPLAY # be sure to fill these in with your correct machine names: DestroyMenu MenuFvwmLogins AddToMenu MenuFvwmLogins + &dopey FuncFvwmRloginXterm dopey + &snoopy FuncFvwmRloginXterm snoopy + s&ignal Exec rxterm signal DestroyMenu MenuFvwmModules AddToMenu MenuFvwmModules "$[gt.Fvwm Modules]" Title + "&1. $[gt.Control Animation]" Popup MenuFvwmAnimate + "&B. Button-Bar" Module FvwmButtons + "&O. IconBox" FuncFvwmConfigureIconBox + "&F. Forms" Popup MenuFvwmForms + "&I. Identify" Module FvwmIdent + "&M. IconMan" Module FvwmIconMan + "&N. Banner" Module FvwmBanner + "&C. Console" Module FvwmConsole + "&P. Pager" Module FvwmPager 0 0 + "&2. Pager (2 $[gt.desks])" Module FvwmPager 0 1 + "&R. Backer" Module FvwmBacker + "&S. ScrollBar" Module FvwmScroll 50 50 + "&T. FvwmTaskBar" Module FvwmTaskBar + "&U. AutoRaise" Module FvwmAuto 200 Raise Nop + "&W. WinList" Module FvwmWinList + "&X. $[gt.Stop Module Menu]" Popup MenuFvwmStopModule DestroyMenu MenuFvwmStopModule AddToMenu MenuFvwmStopModule "$[gt.Stop Fvwm Modules]" Title + "&B. $[gt.Stop] Button-Bar" KillModule FvwmButtons + "&O. $[gt.Stop] IconBox" KillModule FvwmIconBox + "&M. $[gt.Stop] IconMan" KillModule FvwmIconMan + "&P. $[gt.Stop] Pager" KillModule FvwmPager + "&R. $[gt.Stop] Backer" KillModule FvwmBacker + "&S. $[gt.Stop] ScrollBar" KillModule FvwmScroll + "&T. $[gt.Stop] FvwmTaskBar" KillModule FvwmTaskBar + "&U. $[gt.Stop] AutoRaise" KillModule FvwmAuto + "&W. $[gt.Stop] WinList" KillModule FvwmWinList DestroyMenu MenuFvwmForms AddToMenu MenuFvwmForms + "&C. Capture" Module FvwmForm FvwmForm-Capture + "&D. Form Defaults" Module FvwmForm FvwmForm-Form + "&R. Rlogin" Module FvwmForm FvwmForm-Rlogin + "&P. RootCursor" Module FvwmForm FvwmForm-RootCursor + "&S. Setup" Module FvwmForm FvwmForm-Setup + "&T. Talk Form" Module FvwmForm FvwmForm-Talk + "&Q. QuitVerify" Module FvwmForm FvwmForm-QuitVerify # Configure and start using an iconbox on the fly DestroyFunc FuncFvwmConfigureIconBox AddToFunc FuncFvwmConfigureIconBox + I Module FvwmIconBox + I Style * NoIcon DestroyMenu MenuFvwmQuitVerify AddToMenu MenuFvwmQuitVerify "$[gt.Really Quit Fvwm?]" Title + "&Q. $[gt.Yes, Really Quit]" Quit + "" Nop + "&R. $[gt.Restart]" Restart + "" Nop + "&T. $[gt.Start] twm" Restart twm + "&C. $[gt.Start] ctwm" Restart ctwm + "&2. $[gt.Start] tvtwm" Restart tvtwm + "&V. $[gt.Start] vtwm" Restart vtwm + "&M. $[gt.Start] mwm" Restart mwm + "&O. $[gt.Start] olwm" Restart /usr/openwin/bin/olwm + "" Nop + "&X. $[gt.Just an Xterm]" Restart xterm -n '"X Console"' -T '"X Console"' + "" Nop + "&N. $[gt.No, Don't Quit]" Nop ######################## Sample Functions ########################## DestroyFunc FuncFvwmMailXmh AddToFunc FuncFvwmMailXmh + I Next [$0] Iconify false + I Next [$0] Focus + I None [$0] Exec $0 $1 DestroyFunc FuncFvwmMoveOrRaise AddToFunc FuncFvwmMoveOrRaise + I Raise + M Move + D Lower DestroyFunc FuncFvwmMaximize AddToFunc FuncFvwmMaximize + M Maximize 0 100 + H Maximize 0 100 + C Maximize 0 80 + D Maximize 100 100 DestroyFunc FuncFvwmMoveOrIconify AddToFunc FuncFvwmMoveOrIconify + I Raise + M Move + D Iconify DestroyFunc FuncFvwmResizeOrRaise AddToFunc FuncFvwmResizeOrRaise + I Raise + M Resize + D Lower DestroyFunc FuncFvwmPrint AddToFunc FuncFvwmPrint + I Raise + I Exec xdpr -id $w DestroyFunc FuncFvwmPrintReverse AddToFunc FuncFvwmPrintReverse + I Raise + I Exec xdpr 1/2 -h -rv -id $w DestroyFunc FuncFvwmFocusPolicyChange AddToFunc FuncFvwmFocusPolicyChange + I Style * $0 + I Recapture # Read config files for modules: read ConfigFvwmBacker read ConfigFvwmButtons read ConfigFvwmIconBox read ConfigFvwmIconMan read ConfigFvwmIdent read ConfigFvwmPager read ConfigFvwmScroll read ConfigFvwmTaskBar read ConfigFvwmWinList fvwm-2.6.5.orig/fvwm/virtual.c0000644000175000017500000015033111622413321014431 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include "libs/fvwmlib.h" #include "libs/FScreen.h" #include "libs/FGettext.h" #include "libs/Grab.h" #include "libs/Parse.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "cursor.h" #include "events.h" #include "eventmask.h" #include "misc.h" #include "screen.h" #include "virtual.h" #include "module_interface.h" #include "module_list.h" #include "focus.h" #include "gnome.h" #include "ewmh.h" #include "move_resize.h" #include "borders.h" #include "frame.h" #include "geometry.h" #include "icons.h" #include "stack.h" #include "functions.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* * dje 12/19/98 * * Testing with edge_thickness of 1 showed that some XServers don't * care for 1 pixel windows, causing EdgeScrolling not to work with some * servers. One bug report was for SUNOS 4.1.3_U1. We didn't find out * the exact cause of the problem. Perhaps no enter/leave events were * generated. * * Allowed: 0,1,or 2 pixel pan frames. * * 0 completely disables mouse edge scrolling, even while dragging a * window. * * 1 gives the smallest pan frames, which seem to work best except on * some servers. * * 2 is the default. */ static int edge_thickness = 2; static int last_edge_thickness = 2; static int prev_page_x = 0; static int prev_page_y = 0; static int prev_desk = 0; static int prev_desk_and_page_desk = 0; static int prev_desk_and_page_page_x = 0; static int prev_desk_and_page_page_y = 0; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static void __drag_viewport(const exec_context_t *exc, int scroll_speed) { XEvent e; int x; int y; unsigned int button_mask = 0; Bool is_finished = False; if (!GrabEm(CRS_MOVE, GRAB_NORMAL)) { XBell(dpy, 0); return; } if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &x, &y, &JunkX, &JunkY, &button_mask) == False) { /* pointer is on a different screen */ /* Is this the best thing to do? */ UngrabEm(GRAB_NORMAL); return; } MyXGrabKeyboard(dpy); button_mask &= DEFAULT_ALL_BUTTONS_MASK; memset(&e, 0, sizeof(e)); while (!is_finished) { int old_x; int old_y; old_x = x; old_y = y; FMaskEvent( dpy, ButtonPressMask | ButtonReleaseMask | KeyPressMask | PointerMotionMask | ButtonMotionMask | ExposureMask | EnterWindowMask | LeaveWindowMask, &e); /* discard extra events before a logical release */ if (e.type == MotionNotify || e.type == EnterNotify || e.type == LeaveNotify) { while (FPending(dpy) > 0 && FCheckMaskEvent( dpy, ButtonMotionMask | PointerMotionMask | ButtonPressMask | ButtonRelease | KeyPressMask | EnterWindowMask | LeaveWindowMask, &e)) { if (e.type == ButtonPress || e.type == ButtonRelease || e.type == KeyPress) { break; } } } if (e.type == EnterNotify || e.type == LeaveNotify) { XEvent e2; int px; int py; /* Query the pointer to catch the latest information. * This *is* necessary. */ if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &px, &py, &JunkX, &JunkY, &JunkMask) == True) { fev_make_null_event(&e2, dpy); e2.type = MotionNotify; e2.xmotion.time = fev_get_evtime(); e2.xmotion.x_root = px; e2.xmotion.y_root = py; e2.xmotion.state = JunkMask; e2.xmotion.same_screen = True; e = e2; fev_fake_event(&e); } else { /* pointer is on a different screen, * ignore event */ } } /* Handle a limited number of key press events to allow * mouseless operation */ if (e.type == KeyPress) { Keyboard_shortcuts( &e, NULL, NULL, NULL, ButtonRelease); } switch (e.type) { case KeyPress: /* simple code to bag out of move - CKH */ if (XLookupKeysym(&(e.xkey), 0) == XK_Escape) { is_finished = True; } break; case ButtonPress: if (e.xbutton.button <= NUMBER_OF_MOUSE_BUTTONS && ((Button1Mask << (e.xbutton.button - 1)) & button_mask)) { /* No new button was pressed, just a delayed * event */ break; } /* fall through */ case ButtonRelease: x = e.xbutton.x_root; y = e.xbutton.y_root; is_finished = True; break; case MotionNotify: if (e.xmotion.same_screen == False) { continue; } x = e.xmotion.x_root; y = e.xmotion.y_root; break; case Expose: dispatch_event(&e); break; default: /* cannot happen */ break; } /* switch */ if (x != old_x || y != old_y) { MoveViewport( Scr.Vx + scroll_speed * (x - old_x), Scr.Vy + scroll_speed * (y - old_y), False); FlushAllMessageQueues(); } } /* while*/ UngrabEm(GRAB_NORMAL); MyXUngrabKeyboard(dpy); WaitForButtonsUp(True); } /* * * Parse arguments for "Desk" and "MoveToDesk" (formerly "WindowsDesk"): * * (nil) : desk number = current desk * n : desk number = current desk + n * 0 n : desk number = n * n x : desk number = current desk + n * 0 n min max : desk number = n, but limit to min/max * n min max : desk number = current desk + n, but wrap around at desk #min * or desk #max * n x min max : desk number = current desk + n, but wrap around at desk #min * or desk #max * * The current desk number is returned if not enough parameters could be * read (or if action is empty). * */ static int GetDeskNumber(char *action, int current_desk) { int n; int m; int is_relative; int desk; int val[4]; int min, max; if (MatchToken(action, "prev")) { return prev_desk; } n = GetIntegerArguments(action, NULL, &(val[0]), 4); if (n <= 0) { return Scr.CurrentDesk; } if (n == 1) { return current_desk + val[0]; } desk = current_desk; m = 0; if (val[0] == 0) { /* absolute desk number */ desk = val[1]; is_relative = 0; } else { /* relative desk number */ desk += val[0]; is_relative = 1; } if (n == 3) { m = 1; } if (n == 4) { m = 2; } if (n > 2) { /* handle limits */ if (val[m] <= val[m+1]) { min = val[m]; max = val[m+1]; } else { /* min > max is nonsense, so swap 'em. */ min = val[m+1]; max = val[m]; } if (is_relative) { /* Relative moves wrap around. */ if (desk < min) { desk += (max - min + 1); } else if (desk > max) { desk -= (max - min + 1); } } else if (desk < min) { /* Relative move outside of range, wrap around. */ if (val[0] < 0) { desk = max; } else { desk = min; } } else if (desk > max) { /* Move outside of range, truncate. */ if (val[0] > 0) { desk = min; } else { desk = max; } } } return desk; } /* * * Unmaps a window on transition to a new desktop * */ static void unmap_window(FvwmWindow *t) { XWindowAttributes winattrs; unsigned long eventMask = 0; Status ret; /* * Prevent the receipt of an UnmapNotify, since that would * cause a transition to the Withdrawn state. */ ret = XGetWindowAttributes(dpy, FW_W(t), &winattrs); if (ret) { eventMask = winattrs.your_event_mask; /* suppress UnmapRequest event */ XSelectInput(dpy, FW_W(t), eventMask & ~StructureNotifyMask); } if (IS_ICONIFIED(t)) { if (FW_W_ICON_PIXMAP(t) != None) { XUnmapWindow(dpy,FW_W_ICON_PIXMAP(t)); } if (FW_W_ICON_TITLE(t) != None) { XUnmapWindow(dpy,FW_W_ICON_TITLE(t)); } } else { XUnmapWindow(dpy,FW_W_FRAME(t)); border_undraw_decorations(t); #ifdef ICCCM2_UNMAP_WINDOW_PATCH /* this is required by the ICCCM2 */ XUnmapWindow(dpy, FW_W(t)); #endif if (!Scr.bo.do_enable_ewmh_iconic_state_workaround) { SetMapStateProp(t, IconicState); } } if (ret) { XSelectInput(dpy, FW_W(t), eventMask); XFlush(dpy); } return; } /* * * Maps a window on transition to a new desktop * */ static void map_window(FvwmWindow *t) { XWindowAttributes winattrs; unsigned long eventMask = 0; Status ret; if (IS_SCHEDULED_FOR_DESTROY(t)) { return; } /* * Prevent the receipt of an UnmapNotify, since that would * cause a transition to the Withdrawn state. */ ret = XGetWindowAttributes(dpy, FW_W(t), &winattrs); if (ret) { eventMask = winattrs.your_event_mask; /* suppress MapRequest event */ XSelectInput(dpy, FW_W(t), eventMask & ~StructureNotifyMask); } if (IS_ICONIFIED(t)) { if (FW_W_ICON_PIXMAP(t) != None) { XMapWindow(dpy,FW_W_ICON_PIXMAP(t)); } if (FW_W_ICON_TITLE(t) != None) { XMapWindow(dpy,FW_W_ICON_TITLE(t)); } } else if (IS_MAPPED(t)) { border_draw_decorations( t, PART_ALL, (t == get_focus_window()) ? True : False, False, CLEAR_ALL, NULL, NULL); XMapWindow(dpy, FW_W_FRAME(t)); XMapWindow(dpy, FW_W_PARENT(t)); XMapSubwindows(dpy, FW_W_FRAME(t)); #ifdef ICCCM2_UNMAP_WINDOW_PATCH /* this is required by the ICCCM2 */ XMapWindow(dpy, FW_W(t)); #endif if (!Scr.bo.do_enable_ewmh_iconic_state_workaround) { SetMapStateProp(t, NormalState); } } if (ret) { XSelectInput(dpy, FW_W(t), eventMask); XFlush(dpy); } return; } /* * * Unmap all windows on a desk - * - Part 1 of a desktop switch * - must eventually be followed by a call to MapDesk * - unmaps from the bottom of the stack up * */ static void UnmapDesk(int desk, Bool grab) { FvwmWindow *t; FvwmWindow *sf = get_focus_window(); if (grab) { MyXGrabServer(dpy); } for (t = get_prev_window_in_stack_ring(&Scr.FvwmRoot); t != &Scr.FvwmRoot; t = get_prev_window_in_stack_ring(t)) { /* Only change mapping for non-sticky windows */ if (!is_window_sticky_across_desks(t) && !IS_ICON_UNMAPPED(t)) { if (t->Desk == desk) { if (sf == t) { t->flags.is_focused_on_other_desk = 1; t->FocusDesk = desk; DeleteFocus(True); } else { t->flags.is_focused_on_other_desk = 0; } unmap_window(t); SET_FULLY_VISIBLE(t, 0); SET_PARTIALLY_VISIBLE(t, 0); } } else { t->flags.is_focused_on_other_desk = 0; } } if (grab) { MyXUngrabServer(dpy); } return; } /* * * Map all windows on a desk - * - Part 2 of a desktop switch * - only use if UnmapDesk has previously been called * - maps from the top of the stack down * */ static void MapDesk(int desk, Bool grab) { FvwmWindow *t; FvwmWindow *FocusWin = NULL; FvwmWindow *StickyWin = NULL; FvwmWindow *sf = get_focus_window(); Scr.flags.is_map_desk_in_progress = 1; if (grab) { MyXGrabServer(dpy); } for (t = get_next_window_in_stack_ring(&Scr.FvwmRoot); t != &Scr.FvwmRoot; t = get_next_window_in_stack_ring(t)) { /* Only change mapping for non-sticky windows */ if (!is_window_sticky_across_desks(t) && !IS_ICON_UNMAPPED(t)) { if (t->Desk == desk) { map_window(t); } } else { /* If window is sticky, just update its desk (it's * still mapped). */ t->Desk = desk; GNOME_SetDesk(t); GNOME_SetWinArea(t); if (sf == t) { StickyWin = t; } } } if (grab) { MyXUngrabServer(dpy); } for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { /* Autoplace any sticky icons, so that sticky icons from the old desk don't land on top of stationary ones on the new desk. */ if (is_window_sticky_across_desks(t) && IS_ICONIFIED(t) && !IS_ICON_MOVED(t) && !IS_ICON_UNMAPPED(t)) { AutoPlaceIcon(t, NULL, True); } /* Keep track of the last-focused window on the new desk. */ if (t->flags.is_focused_on_other_desk && t->FocusDesk == desk) { t->flags.is_focused_on_other_desk = 0; FocusWin = t; } } /* If a sticky window has focus, don't disturb it. */ if (!StickyWin && FocusWin) { /* Otherwise, handle remembering the last-focused clicky * window. */ if (!FP_DO_UNFOCUS_LEAVE(FW_FOCUS_POLICY(FocusWin))) { ReturnFocusWindow(FocusWin); } else { DeleteFocus(True); } } Scr.flags.is_map_desk_in_progress = 0; return; } /* ---------------------------- interface functions ------------------------ */ /* * * Check to see if the pointer is on the edge of the screen, and scroll/page * if needed * * Returns * 0: no paging * 1: paging occured * -1: no need to call the function again before a new event arrives */ int HandlePaging( XEvent *pev, int HorWarpSize, int VertWarpSize, int *xl, int *yt, int *delta_x, int *delta_y, Bool Grab, Bool fLoop, Bool do_continue_previous, int delay) { static int add_time = 0; int x,y; XEvent e; static Time my_timestamp = 0; static Time my_last_timestamp = 0; static Bool is_timestamp_valid = False; static int last_x = 0; static int last_y = 0; static Bool is_last_position_valid = False; *delta_x = 0; *delta_y = 0; if (!is_timestamp_valid && do_continue_previous) { /* don't call me again until something has happened */ return -1; } if (!is_timestamp_valid && pev->type == MotionNotify) { x = pev->xmotion.x_root; y = pev->xmotion.y_root; if ((Scr.VxMax == 0 || (x >= edge_thickness && x < Scr.MyDisplayWidth - edge_thickness)) && (Scr.VyMax == 0 || (y >= edge_thickness && y < Scr.MyDisplayHeight - edge_thickness))) { return -1; } } if (delay < 0 || (HorWarpSize == 0 && VertWarpSize==0)) { is_timestamp_valid = False; add_time = 0; return 0; } if (Scr.VxMax == 0 && Scr.VyMax == 0) { is_timestamp_valid = False; add_time = 0; return 0; } if (!is_timestamp_valid) { is_timestamp_valid = True; my_timestamp = fev_get_evtime(); is_last_position_valid = False; add_time = 0; last_x = -1; last_y = -1; } else if (my_last_timestamp != fev_get_evtime()) { add_time = 0; } my_last_timestamp = fev_get_evtime(); do { int rc; Window JunkW; int JunkC; unsigned int JunkM; if (FCheckPeekIfEvent(dpy, &e, test_button_event, NULL)) { is_timestamp_valid = False; add_time = 0; return 0; } /* get pointer location */ rc = FQueryPointer( dpy, Scr.Root, &JunkW, &JunkW, &x, &y, &JunkC, &JunkC, &JunkM); if (rc == False) { /* pointer is on a different screen */ x = 0; y = 0; } /* check actual pointer location since PanFrames can get buried * under window being moved or resized - mab */ if (x >= edge_thickness && x < Scr.MyDisplayWidth-edge_thickness && y >= edge_thickness && y < Scr.MyDisplayHeight-edge_thickness) { is_timestamp_valid = False; add_time = 0; return 0; } if (!fLoop && is_last_position_valid && (x - last_x > MAX_PAGING_MOVE_DISTANCE || x - last_x < -MAX_PAGING_MOVE_DISTANCE || y - last_y > MAX_PAGING_MOVE_DISTANCE || y - last_y < -MAX_PAGING_MOVE_DISTANCE)) { /* The pointer is moving too fast, prevent paging until * it slows down. Don't prevent paging when fLoop is * set since we can't be sure that HandlePaging will be * called again. */ is_timestamp_valid = True; my_timestamp = fev_get_evtime(); add_time = 0; last_x = x; last_y = y; return 0; } last_x = x; last_y = y; is_last_position_valid = True; usleep(10000); add_time += 10; } while (fLoop && fev_get_evtime() - my_timestamp + add_time < delay); if (fev_get_evtime() - my_timestamp + add_time < delay) { return 0; } /* Get the latest pointer position. This is necessary as XFree 4.1.0.1 * sometimes does not report mouse movement when it should. */ if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &x, &y, &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen - ignore */ } /* Move the viewport */ /* and/or move the cursor back to the approximate correct location */ /* that is, the same place on the virtual desktop that it */ /* started at */ if (x < edge_thickness) { *delta_x = -HorWarpSize; } else if (x >= Scr.MyDisplayWidth-edge_thickness) { *delta_x = HorWarpSize; } else { *delta_x = 0; } if (Scr.VxMax == 0) { *delta_x = 0; } if (y < edge_thickness) { *delta_y = -VertWarpSize; } else if (y >= Scr.MyDisplayHeight-edge_thickness) { *delta_y = VertWarpSize; } else { *delta_y = 0; } if (Scr.VyMax == 0) { *delta_y = 0; } /* Ouch! lots of bounds checking */ if (Scr.Vx + *delta_x < 0) { if (!(Scr.flags.do_edge_wrap_x)) { *delta_x = -Scr.Vx; *xl = x - *delta_x; } else { *delta_x += Scr.VxMax + Scr.MyDisplayWidth; *xl = x + *delta_x % Scr.MyDisplayWidth + HorWarpSize; } } else if (Scr.Vx + *delta_x > Scr.VxMax) { if (!(Scr.flags.do_edge_wrap_x)) { *delta_x = Scr.VxMax - Scr.Vx; *xl = x - *delta_x; } else { *delta_x -= Scr.VxMax +Scr.MyDisplayWidth; *xl = x + *delta_x % Scr.MyDisplayWidth - HorWarpSize; } } else { *xl = x - *delta_x; } if (Scr.Vy + *delta_y < 0) { if (!(Scr.flags.do_edge_wrap_y)) { *delta_y = -Scr.Vy; *yt = y - *delta_y; } else { *delta_y += Scr.VyMax + Scr.MyDisplayHeight; *yt = y + *delta_y % Scr.MyDisplayHeight + VertWarpSize; } } else if (Scr.Vy + *delta_y > Scr.VyMax) { if (!(Scr.flags.do_edge_wrap_y)) { *delta_y = Scr.VyMax - Scr.Vy; *yt = y - *delta_y; } else { *delta_y -= Scr.VyMax + Scr.MyDisplayHeight; *yt = y + *delta_y % Scr.MyDisplayHeight - VertWarpSize; } } else { *yt = y - *delta_y; } /* Check for paging -- and don't warp the pointer. */ is_timestamp_valid = False; add_time = 0; if (*delta_x == 0 && *delta_y == 0) { return 0; } /* make sure the pointer isn't warped into the panframes */ if (*xl < edge_thickness) { *xl = edge_thickness; } if (*yt < edge_thickness) { *yt = edge_thickness; } if (*xl >= Scr.MyDisplayWidth - edge_thickness) { *xl = Scr.MyDisplayWidth - edge_thickness -1; } if (*yt >= Scr.MyDisplayHeight - edge_thickness) { *yt = Scr.MyDisplayHeight - edge_thickness -1; } if (Grab) { MyXGrabServer(dpy); } /* Turn off the rubberband if its on */ switch_move_resize_grid(False); FWarpPointer(dpy,None,Scr.Root,0,0,0,0,*xl,*yt); MoveViewport(Scr.Vx + *delta_x,Scr.Vy + *delta_y,False); if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, xl, yt, &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen */ *xl = 0; *yt = 0; } if (Grab) { MyXUngrabServer(dpy); } return 1; } /* the root window is surrounded by four window slices, which are InputOnly. * So you can see 'through' them, but they eat the input. An EnterEvent in * one of these windows causes a Paging. The windows have the according cursor * pointing in the pan direction or are hidden if there is no more panning * in that direction. This is mostly intended to get a panning even atop * of Motif applictions, which does not work yet. It seems Motif windows * eat all mouse events. * * Hermann Dunkel, HEDU, dunkel@cul-ipn.uni-kiel.de 1/94 */ /* * checkPanFrames hides PanFrames if they are on the very border of the * VIRTUAL screen and EdgeWrap for that direction is off. * (A special cursor for the EdgeWrap border could be nice) HEDU */ void checkPanFrames(void) { Bool do_unmap_l = False; Bool do_unmap_r = False; Bool do_unmap_t = False; Bool do_unmap_b = False; if (!Scr.flags.are_windows_captured) return; /* thickness of 0 means remove the pan frames */ if (edge_thickness == 0) { do_unmap_l = True; do_unmap_r = True; do_unmap_t = True; do_unmap_b = True; } /* Remove Pan frames if paging by edge-scroll is permanently or * temporarily disabled */ if (Scr.EdgeScrollX == 0 || Scr.VxMax == 0) { do_unmap_l = True; do_unmap_r = True; } if (Scr.EdgeScrollY == 0 || Scr.VyMax == 0) { do_unmap_t = True; do_unmap_b = True; } if (Scr.Vx == 0 && !Scr.flags.do_edge_wrap_x) { do_unmap_l = True; } if (Scr.Vx == Scr.VxMax && !Scr.flags.do_edge_wrap_x) { do_unmap_r = True; } if (Scr.Vy == 0 && !Scr.flags.do_edge_wrap_y) { do_unmap_t = True; } if (Scr.Vy == Scr.VyMax && !Scr.flags.do_edge_wrap_y) { do_unmap_b = True; } /* correct the unmap variables if pan frame commands are set */ if (edge_thickness != 0) { if (Scr.PanFrameLeft.command != NULL || Scr.PanFrameLeft.command_leave != NULL) { do_unmap_l = False; } if (Scr.PanFrameRight.command != NULL || Scr.PanFrameRight.command_leave != NULL) { do_unmap_r = False; } if (Scr.PanFrameBottom.command != NULL || Scr.PanFrameBottom.command_leave != NULL) { do_unmap_b = False; } if (Scr.PanFrameTop.command != NULL || Scr.PanFrameTop.command_leave != NULL) { do_unmap_t = False; } } /* * hide or show the windows */ /* left */ if (do_unmap_l) { if (Scr.PanFrameLeft.isMapped) { XUnmapWindow(dpy, Scr.PanFrameLeft.win); Scr.PanFrameLeft.isMapped = False; } } else { if (edge_thickness != last_edge_thickness) { XResizeWindow( dpy, Scr.PanFrameLeft.win, edge_thickness, Scr.MyDisplayHeight); } if (!Scr.PanFrameLeft.isMapped) { XMapRaised(dpy, Scr.PanFrameLeft.win); Scr.PanFrameLeft.isMapped = True; } } /* right */ if (do_unmap_r) { if (Scr.PanFrameRight.isMapped) { XUnmapWindow(dpy, Scr.PanFrameRight.win); Scr.PanFrameRight.isMapped = False; } } else { if (edge_thickness != last_edge_thickness) { XMoveResizeWindow( dpy, Scr.PanFrameRight.win, Scr.MyDisplayWidth - edge_thickness, 0, edge_thickness, Scr.MyDisplayHeight); } if (!Scr.PanFrameRight.isMapped) { XMapRaised(dpy, Scr.PanFrameRight.win); Scr.PanFrameRight.isMapped = True; } } /* top */ if (do_unmap_t) { if (Scr.PanFrameTop.isMapped) { XUnmapWindow(dpy, Scr.PanFrameTop.win); Scr.PanFrameTop.isMapped = False; } } else { if (edge_thickness != last_edge_thickness) { XResizeWindow( dpy, Scr.PanFrameTop.win, Scr.MyDisplayWidth, edge_thickness); } if (!Scr.PanFrameTop.isMapped) { XMapRaised(dpy, Scr.PanFrameTop.win); Scr.PanFrameTop.isMapped = True; } } /* bottom */ if (do_unmap_b) { if (Scr.PanFrameBottom.isMapped) { XUnmapWindow(dpy, Scr.PanFrameBottom.win); Scr.PanFrameBottom.isMapped = False; } } else { if (edge_thickness != last_edge_thickness) { XMoveResizeWindow( dpy, Scr.PanFrameBottom.win, 0, Scr.MyDisplayHeight - edge_thickness, Scr.MyDisplayWidth, edge_thickness); } if (!Scr.PanFrameBottom.isMapped) { XMapRaised(dpy, Scr.PanFrameBottom.win); Scr.PanFrameBottom.isMapped = True; } } last_edge_thickness = edge_thickness; return; } /* * * Gotta make sure these things are on top of everything else, or they * don't work! * * For some reason, this seems to be unneeded. * */ void raisePanFrames(void) { Window windows[4]; int n; /* Note: make sure the stacking order of the pan frames is not changed * every time they are raised by using XRestackWindows. */ n = 0; if (Scr.PanFrameTop.isMapped) { windows[n++] = Scr.PanFrameTop.win; } if (Scr.PanFrameLeft.isMapped) { windows[n++] = Scr.PanFrameLeft.win; } if (Scr.PanFrameRight.isMapped) { windows[n++] = Scr.PanFrameRight.win; } if (Scr.PanFrameBottom.isMapped) { windows[n++] = Scr.PanFrameBottom.win; } if (n > 0) { XRaiseWindow(dpy, windows[0]); if (n > 1) { XRestackWindows(dpy, windows, n); } } return; } /* * * Creates the windows for edge-scrolling * */ void initPanFrames(void) { XSetWindowAttributes attributes; unsigned long valuemask; int saved_thickness; /* Not creating the frames disables all subsequent behavior */ /* TKP. This is bad, it will cause an XMap request on a null window * later*/ /* if (edge_thickness == 0) return; */ saved_thickness = edge_thickness; if (edge_thickness == 0) { edge_thickness = 2; } attributes.event_mask = XEVMASK_PANFW; valuemask= (CWEventMask | CWCursor); attributes.cursor = Scr.FvwmCursors[CRS_TOP_EDGE]; /* I know these overlap, it's useful when at (0,0) and the top one is * unmapped */ Scr.PanFrameTop.win = XCreateWindow( dpy, Scr.Root, 0, 0, Scr.MyDisplayWidth, edge_thickness, 0, CopyFromParent, InputOnly, CopyFromParent, valuemask, &attributes); attributes.cursor = Scr.FvwmCursors[CRS_LEFT_EDGE]; Scr.PanFrameLeft.win = XCreateWindow( dpy, Scr.Root, 0, 0, edge_thickness, Scr.MyDisplayHeight, 0, CopyFromParent, InputOnly, CopyFromParent, valuemask, &attributes); attributes.cursor = Scr.FvwmCursors[CRS_RIGHT_EDGE]; Scr.PanFrameRight.win = XCreateWindow( dpy, Scr.Root, Scr.MyDisplayWidth - edge_thickness, 0, edge_thickness, Scr.MyDisplayHeight, 0, CopyFromParent, InputOnly, CopyFromParent, valuemask, &attributes); attributes.cursor = Scr.FvwmCursors[CRS_BOTTOM_EDGE]; Scr.PanFrameBottom.win = XCreateWindow( dpy, Scr.Root, 0, Scr.MyDisplayHeight - edge_thickness, Scr.MyDisplayWidth, edge_thickness, 0, CopyFromParent, InputOnly, CopyFromParent, valuemask, &attributes); Scr.PanFrameTop.isMapped=Scr.PanFrameLeft.isMapped= Scr.PanFrameRight.isMapped= Scr.PanFrameBottom.isMapped=False; edge_thickness = saved_thickness; return; } Bool is_pan_frame(Window w) { if (w == Scr.PanFrameTop.win || w == Scr.PanFrameBottom.win || w == Scr.PanFrameLeft.win || w == Scr.PanFrameRight.win) { return True; } else { return False; } } /* * * Moves the viewport within the virtual desktop * */ void MoveViewport(int newx, int newy, Bool grab) { FvwmWindow *t, *t1; int deltax,deltay; int PageTop, PageLeft; int PageBottom, PageRight; int txl, txr, tyt, tyb; if (grab) { MyXGrabServer(dpy); } if (newx > Scr.VxMax) { newx = Scr.VxMax; } if (newy > Scr.VyMax) { newy = Scr.VyMax; } if (newx < 0) { newx = 0; } if (newy < 0) { newy = 0; } deltay = Scr.Vy - newy; deltax = Scr.Vx - newx; /* Identify the bounding rectangle that will be moved into the viewport. */ PageBottom = Scr.MyDisplayHeight - deltay - 1; PageRight = Scr.MyDisplayWidth - deltax - 1; PageTop = 0 - deltay; PageLeft = 0 - deltax; if (deltax || deltay) { prev_page_x = Scr.Vx; prev_page_y = Scr.Vy; prev_desk_and_page_page_x = Scr.Vx; prev_desk_and_page_page_y = Scr.Vy; prev_desk_and_page_desk = Scr.CurrentDesk; } Scr.Vx = newx; Scr.Vy = newy; if (deltax || deltay) { BroadcastPacket( M_NEW_PAGE, 7, (long)Scr.Vx, (long)Scr.Vy, (long)Scr.CurrentDesk, (long)Scr.MyDisplayWidth, (long)Scr.MyDisplayHeight, (long)((Scr.VxMax / Scr.MyDisplayWidth) + 1), (long)((Scr.VyMax / Scr.MyDisplayHeight) + 1)); /* * RBW - 11/13/1998 - new: chase the chain * bidirectionally, all at once! The idea is to move the * windows that are moving out of the viewport from the bottom * of the stacking order up, to minimize the expose-redraw * overhead. Windows that will be moving into view will be * moved top down, for the same reason. Use the new * stacking-order chain, rather than the old last-focused * chain. * * domivogt (29-Nov-1999): It's faster to first map windows * top to bottom and then unmap windows bottom up. */ t = get_next_window_in_stack_ring(&Scr.FvwmRoot); while (t != &Scr.FvwmRoot) { /* * If the window is moving into the viewport... */ txl = t->g.frame.x; tyt = t->g.frame.y; txr = t->g.frame.x + t->g.frame.width - 1; tyb = t->g.frame.y + t->g.frame.height - 1; if (is_window_sticky_across_pages(t) && !IS_VIEWPORT_MOVED(t)) { /* the absolute position has changed */ t->g.normal.x -= deltax; t->g.normal.y -= deltay; t->g.max.x -= deltax; t->g.max.y -= deltay; /* Block double move. */ SET_VIEWPORT_MOVED(t, 1); } if ((txr >= PageLeft && txl <= PageRight && tyb >= PageTop && tyt <= PageBottom) && !IS_VIEWPORT_MOVED(t) && !IS_WINDOW_BEING_MOVED_OPAQUE(t)) { /* Block double move. */ SET_VIEWPORT_MOVED(t, 1); /* If the window is iconified, and sticky * Icons is set, then the window should * essentially be sticky */ if (!is_window_sticky_across_pages(t)) { if (IS_ICONIFIED(t)) { modify_icon_position( t, deltax, deltay); move_icon_to_position(t); broadcast_icon_geometry( t, False); } frame_setup_window( t, t->g.frame.x + deltax, t->g.frame.y + deltay, t->g.frame.width, t->g.frame.height, False); } } /* Bump to next win... */ t = get_next_window_in_stack_ring(t); } t1 = get_prev_window_in_stack_ring(&Scr.FvwmRoot); while (t1 != &Scr.FvwmRoot) { /* *If the window is not moving into the viewport... */ SET_VIEWPORT_MOVED(t, 1); txl = t1->g.frame.x; tyt = t1->g.frame.y; txr = t1->g.frame.x + t1->g.frame.width - 1; tyb = t1->g.frame.y + t1->g.frame.height - 1; if (! (txr >= PageLeft && txl <= PageRight && tyb >= PageTop && tyt <= PageBottom) && !IS_VIEWPORT_MOVED(t1) && !IS_WINDOW_BEING_MOVED_OPAQUE(t1)) { /* If the window is iconified, and sticky * Icons is set, then the window should * essentially be sticky */ if (!is_window_sticky_across_pages(t1)) { if (IS_ICONIFIED(t1)) { modify_icon_position( t1, deltax, deltay); move_icon_to_position(t1); broadcast_icon_geometry( t1, False); } frame_setup_window( t1, t1->g.frame.x + deltax, t1->g.frame.y + deltay, t1->g.frame.width, t1->g.frame.height, False); } } /* Bump to next win... */ t1 = get_prev_window_in_stack_ring(t1); } for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if (IS_VIEWPORT_MOVED(t)) { /* Clear double move blocker. */ SET_VIEWPORT_MOVED(t, 0); GNOME_SetWinArea(t); } /* If its an icon, and its sticking, autoplace it so * that it doesn't wind up on top a a stationary * icon */ if (is_window_sticky_across_pages(t) && IS_ICONIFIED(t) && !IS_ICON_MOVED(t) && !IS_ICON_UNMAPPED(t)) { AutoPlaceIcon(t, NULL, True); } } } checkPanFrames(); /* regrab buttons in case something got obscured or unobscured */ focus_grab_buttons_all(); #if 0 /* dv (2004-07-01): I don't think that's a good idea. We could eat too * many events. */ /* do this with PanFrames too ??? HEDU */ { XEvent e; while (FCheckTypedEvent(dpy, MotionNotify, &e)) { /* nothing */ } } #endif if (grab) { MyXUngrabServer(dpy); } /* update GNOME pager */ GNOME_SetCurrentArea(); EWMH_SetDesktopViewPort(); return; } void goto_desk(int desk) { /* RBW - the unmapping operations are now removed to their own * functions so they can also be used by the new GoToDeskAndPage * command. */ if (Scr.CurrentDesk != desk) { prev_desk = Scr.CurrentDesk; prev_desk_and_page_desk = Scr.CurrentDesk; prev_desk_and_page_page_x = Scr.Vx; prev_desk_and_page_page_y = Scr.Vy; UnmapDesk(Scr.CurrentDesk, True); Scr.CurrentDesk = desk; MapDesk(desk, True); focus_grab_buttons_all(); BroadcastPacket(M_NEW_DESK, 1, (long)Scr.CurrentDesk); /* FIXME: domivogt (22-Apr-2000): Fake a 'restack' for sticky * window upon desk change. This is a workaround for a * problem in FvwmPager: The pager has a separate 'root' * window for each desk. If the active desk changes, the * pager destroys sticky mini windows and creates new ones in * the other desktop 'root'. But the pager can't know where to * stack them. So we have to tell it explicitly where they * go :-( This should be fixed in the pager, but right now the * pager doesn't maintain the stacking order. */ BroadcastRestackAllWindows(); EWMH_SetCurrentDesktop(); GNOME_SetCurrentDesk(); GNOME_SetDeskCount(); } return; } /* * * Move a window to a new desktop * */ void do_move_window_to_desk(FvwmWindow *fw, int desk) { if (fw == NULL) { return; } /* * Set the window's desktop, and map or unmap it as needed. */ /* Only change mapping for non-sticky windows */ if (!is_window_sticky_across_desks(fw) /*&& !IS_ICON_UNMAPPED(fw)*/) { if (fw->Desk == Scr.CurrentDesk) { fw->Desk = desk; if (fw == get_focus_window()) { DeleteFocus(True); } unmap_window(fw); SET_FULLY_VISIBLE(fw, 0); SET_PARTIALLY_VISIBLE(fw, 0); } else if (desk == Scr.CurrentDesk) { fw->Desk = desk; /* If its an icon, auto-place it */ if (IS_ICONIFIED(fw)) { AutoPlaceIcon(fw, NULL, True); } map_window(fw); } else { fw->Desk = desk; } BroadcastConfig(M_CONFIGURE_WINDOW,fw); } focus_grab_buttons_on_layer(fw->layer); EWMH_SetWMDesktop(fw); GNOME_SetDeskCount(); GNOME_SetDesk(fw); GNOME_SetWinArea(fw); return; } Bool get_page_arguments(char *action, int *page_x, int *page_y) { int val[2]; int suffix[2]; char *token; char *taction; int wrapx; int wrapy; int limitdeskx; int limitdesky; wrapx = 0; wrapy = 0; limitdeskx = 1; limitdesky = 1; for (; ; action = taction) { int do_reverse; token = PeekToken(action, &taction); if (token == NULL) { *page_x = Scr.Vx; *page_y = Scr.Vy; return True; } if (StrEquals(token, "prev")) { /* last page selected */ *page_x = prev_page_x; *page_y = prev_page_y; return True; } do_reverse = 0; for ( ; *token == '!'; token++) { do_reverse = !do_reverse; } if (StrEquals(token, "wrapx")) { wrapx = (1 ^ do_reverse); } else if (StrEquals(token, "wrapy")) { wrapy = (1 ^ do_reverse); } else if (StrEquals(token, "nodesklimitx")) { limitdeskx = (0 ^ do_reverse); } else if (StrEquals(token, "nodesklimitx")) { limitdesky = (0 ^ do_reverse); } else { /* no more options */ break; } } if (GetSuffixedIntegerArguments(action, NULL, val, 2, "pw", suffix) != 2) { return 0; } if (suffix[0] == 1) { *page_x = val[0] * Scr.MyDisplayWidth + Scr.Vx; } else if (suffix[0] == 2) { *page_x += val[0] * Scr.MyDisplayWidth; } else if (val[0] >= 0) { *page_x = val[0] * Scr.MyDisplayWidth; } else { *page_x = (val[0] + 1) * Scr.MyDisplayWidth + Scr.VxMax; } if (suffix[1] == 1) { *page_y = val[1] * Scr.MyDisplayHeight + Scr.Vy; } else if (suffix[1] == 2) { *page_y += val[1] * Scr.MyDisplayHeight; } else if (val[1] >= 0) { *page_y = val[1] * Scr.MyDisplayHeight; } else { *page_y = (val[1] + 1) * Scr.MyDisplayHeight + Scr.VyMax; } /* limit to desktop size */ if (limitdeskx && !wrapx) { if (*page_x < 0) { *page_x = 0; } else if (*page_x > Scr.VxMax) { *page_x = Scr.VxMax; } } else if (limitdeskx && wrapx) { while (*page_x < 0) { *page_x += Scr.VxMax + Scr.MyDisplayWidth; } while (*page_x > Scr.VxMax) { *page_x -= Scr.VxMax + Scr.MyDisplayWidth; } } if (limitdesky && !wrapy) { if (*page_y < 0) { *page_y = 0; } else if (*page_y > Scr.VyMax) { *page_y = Scr.VyMax; } } else if (limitdesky && wrapy) { while (*page_y < 0) { *page_y += Scr.VyMax + Scr.MyDisplayHeight; } while (*page_y > Scr.VyMax) { *page_y -= Scr.VyMax + Scr.MyDisplayHeight; } } return True; } char *GetDesktopName(int desk) { DesktopsInfo *d; d = Scr.Desktops->next; while (d != NULL && d->desk != desk) { d = d->next; } if (d != NULL) { return d->name; } return NULL; } /* ---------------------------- builtin commands --------------------------- */ /* EdgeCommand - binds a function to a pan frame enter event */ void CMD_EdgeCommand(F_CMD_ARGS) { direction_t direction; char * command; /* get the direction */ direction = gravity_parse_dir_argument(action, &action, DIR_NONE); if (direction >= 0 && direction <= DIR_MAJOR_MASK) { /* check if the command does contain at least one token */ command = safestrdup(action); if (PeekToken(action , &action) == NULL) { /* the command does not contain a token so the command of this edge is removed */ free(command); command = NULL; } /* assign command to the edge(s) */ if (direction == DIR_N) { if (Scr.PanFrameTop.command != NULL) { free(Scr.PanFrameTop.command); } Scr.PanFrameTop.command = command; } else if (direction == DIR_S) { if (Scr.PanFrameBottom.command != NULL) { free(Scr.PanFrameBottom.command); } Scr.PanFrameBottom.command = command; } else if (direction == DIR_W) { if (Scr.PanFrameLeft.command != NULL) { free(Scr.PanFrameLeft.command); } Scr.PanFrameLeft.command = command; } else if (direction == DIR_E) { if (Scr.PanFrameRight.command != NULL) { free(Scr.PanFrameRight.command); } Scr.PanFrameRight.command = command; } else { /* this should never happen */ fvwm_msg(ERR, "EdgeCommand", "Internal error in CMD_EdgeCommand"); } } else { /* check if the argument does contain at least one token */ if (PeekToken(action , &action) == NULL) { /* Just plain EdgeCommand, so all edge commands are * removed */ if (Scr.PanFrameTop.command != NULL) { free(Scr.PanFrameTop.command); Scr.PanFrameTop.command = NULL; } if (Scr.PanFrameBottom.command != NULL) { free(Scr.PanFrameBottom.command); Scr.PanFrameBottom.command = NULL; } if (Scr.PanFrameLeft.command != NULL) { free(Scr.PanFrameLeft.command); Scr.PanFrameLeft.command = NULL; } if (Scr.PanFrameRight.command != NULL) { free(Scr.PanFrameRight.command); Scr.PanFrameRight.command = NULL; } } else { /* not a proper direction */ fvwm_msg(ERR, "EdgeCommand", "EdgeCommand [direction [function]]"); } } /* maybe something has changed so we adapt the pan frames */ checkPanFrames(); return; } /* EdgeLeaveCommand - binds a function to a pan frame Leave event */ void CMD_EdgeLeaveCommand(F_CMD_ARGS) { direction_t direction; char * command; /* get the direction */ direction = gravity_parse_dir_argument(action, &action, DIR_NONE); if (direction >= 0 && direction <= DIR_MAJOR_MASK) { /* check if the command does contain at least one token */ command = safestrdup(action); if (PeekToken(action , &action) == NULL) { /* the command does not contain a token so the command of this edge is removed */ free(command); command = NULL; } /* assign command to the edge(s) */ if (direction == DIR_N) { if (Scr.PanFrameTop.command_leave != NULL) { free(Scr.PanFrameTop.command_leave); } Scr.PanFrameTop.command_leave = command; } else if (direction == DIR_S) { if (Scr.PanFrameBottom.command_leave != NULL) { free(Scr.PanFrameBottom.command_leave); } Scr.PanFrameBottom.command_leave = command; } else if (direction == DIR_W) { if (Scr.PanFrameLeft.command_leave != NULL) { free(Scr.PanFrameLeft.command_leave); } Scr.PanFrameLeft.command_leave = command; } else if (direction == DIR_E) { if (Scr.PanFrameRight.command_leave != NULL) { free(Scr.PanFrameRight.command_leave); } Scr.PanFrameRight.command_leave = command; } else { /* this should never happen */ fvwm_msg(ERR, "EdgeLeaveCommand", "Internal error in CMD_EdgeLeaveCommand"); } } else { /* check if the argument does contain at least one token */ if (PeekToken(action , &action) == NULL) { /* Just plain EdgeLeaveCommand, so all edge commands are * removed */ if (Scr.PanFrameTop.command_leave != NULL) { free(Scr.PanFrameTop.command_leave); Scr.PanFrameTop.command_leave = NULL; } if (Scr.PanFrameBottom.command_leave != NULL) { free(Scr.PanFrameBottom.command_leave); Scr.PanFrameBottom.command_leave = NULL; } if (Scr.PanFrameLeft.command_leave != NULL) { free(Scr.PanFrameLeft.command_leave); Scr.PanFrameLeft.command_leave = NULL; } if (Scr.PanFrameRight.command_leave != NULL) { free(Scr.PanFrameRight.command_leave); Scr.PanFrameRight.command_leave = NULL; } } else { /* not a proper direction */ fvwm_msg(ERR, "EdgeLeaveCommand", "EdgeLeaveCommand [direction [function]]"); } } /* maybe something has changed so we adapt the pan frames */ checkPanFrames(); return; } void CMD_EdgeThickness(F_CMD_ARGS) { int val, n; n = GetIntegerArguments(action, NULL, &val, 1); if (n != 1) { fvwm_msg(ERR,"setEdgeThickness", "EdgeThickness requires 1 numeric argument," " found %d args",n); return; } /* check range */ if (val < 0 || val > 2) { fvwm_msg(ERR,"setEdgeThickness", "EdgeThickness arg must be between 0 and 2," " found %d",val); return; } edge_thickness = val; checkPanFrames(); return; } void CMD_EdgeScroll(F_CMD_ARGS) { int val1, val2, val1_unit, val2_unit, n; char *token; n = GetTwoArguments(action, &val1, &val2, &val1_unit, &val2_unit); if (n != 2) { fvwm_msg( ERR, "SetEdgeScroll", "EdgeScroll requires two arguments"); return; } /* * if edgescroll >1000 and <100000 * wrap at edges of desktop (a "spherical" desktop) */ if (val1 >= 1000 && val1_unit != 100) { val1 /= 1000; Scr.flags.do_edge_wrap_x = 1; } else { Scr.flags.do_edge_wrap_x = 0; } if (val2 >= 1000 && val2_unit != 100) { val2 /= 1000; Scr.flags.do_edge_wrap_y = 1; } else { Scr.flags.do_edge_wrap_y = 0; } action=SkipNTokens(action,2); token = PeekToken(action, NULL); if (token) { if (StrEquals(token, "wrap")) { Scr.flags.do_edge_wrap_x = 1; Scr.flags.do_edge_wrap_y = 1; } else if (StrEquals(token, "wrapx")) { Scr.flags.do_edge_wrap_x = 1; } else if (StrEquals(token, "wrapy")) { Scr.flags.do_edge_wrap_y = 1; } } Scr.EdgeScrollX = val1 * val1_unit / 100; Scr.EdgeScrollY = val2 * val2_unit / 100; checkPanFrames(); return; } void CMD_EdgeResistance(F_CMD_ARGS) { int val[3]; int n; val[0] = 0; n = GetIntegerArguments(action, NULL, val, 3); if (n > 1 && val[0] >= 10000) { /* map val[0] >= 10000 in old syntax to -1 in new syntax */ val[0] = -1; } if (n == 1) { Scr.ScrollDelay = val[0]; } else if (n >= 2 && n <= 3) { char cmd[99]; char stylecmd[99]; char stylecmd2[99]; Scr.ScrollDelay = val[0]; sprintf(cmd, "EdgeResistance %d", val[0]); sprintf(stylecmd, "Style * EdgeMoveDelay %d", val[0]); if (n == 2) { sprintf( stylecmd2, "Style * EdgeMoveResistance %d", val[1]); } else { sprintf( stylecmd2, "Style * EdgeMoveResistance %d %d", val[1], val[2]); } fvwm_msg( OLD, "CMD_EdgeResistance", "The command EdgeResistance with three arguments is" " obsolete. Please use the following commands" " instead:"); fvwm_msg(OLD, "", cmd); fvwm_msg(OLD, "", stylecmd); fvwm_msg(OLD, "", stylecmd2); execute_function( cond_rc, exc, cmd, FUNC_DONT_REPEAT | FUNC_DONT_EXPAND_COMMAND); execute_function( cond_rc, exc, stylecmd, FUNC_DONT_REPEAT | FUNC_DONT_EXPAND_COMMAND); execute_function( cond_rc, exc, stylecmd2, FUNC_DONT_REPEAT | FUNC_DONT_EXPAND_COMMAND); } else { fvwm_msg( ERR, "CMD_EdgeResistance", "EdgeResistance requires two or three arguments"); return; } return; } void CMD_Xinerama(F_CMD_ARGS) { int toggle; toggle = ParseToggleArgument(action, NULL, -1, 0); if (toggle == -1) { toggle = !FScreenIsEnabled(); } if (!toggle != !FScreenIsEnabled()) { Scr.flags.do_need_window_update = True; Scr.flags.has_xinerama_state_changed = True; FScreenOnOff(toggle); broadcast_xinerama_state(); } return; } void CMD_XineramaPrimaryScreen(F_CMD_ARGS) { int val; val = FScreenGetScreenArgument(action, 0); FScreenSetPrimaryScreen(val); if (FScreenIsEnabled()) { Scr.flags.do_need_window_update = True; Scr.flags.has_xinerama_state_changed = True; } broadcast_xinerama_state(); return; } void CMD_XineramaSls(F_CMD_ARGS) { int toggle; toggle = ParseToggleArgument(action, NULL, -1, 0); if (toggle == -1) { toggle = !FScreenIsSLSEnabled(); } if (!toggle != !FScreenIsSLSEnabled()) { if (FScreenIsEnabled()) { Scr.flags.do_need_window_update = True; Scr.flags.has_xinerama_state_changed = True; } FScreenSLSOnOff(toggle); broadcast_xinerama_state(); } return; } void CMD_XineramaSlsSize(F_CMD_ARGS) { int val[2]; if (GetIntegerArguments(action, NULL, val, 2) != 2 && GetRectangleArguments(action, &val[0], &val[1]) != 2) { val[0] = 1; val[1] = 1; } if (FScreenConfigureSLSSize(val[0], val[1])) { broadcast_xinerama_state(); } return; } void CMD_XineramaSlsScreens(F_CMD_ARGS) { int nscreens; char *args; if (GetIntegerArguments(action, &args, &nscreens, 1) != 1) { nscreens = 0; args = NULL; } else if (args == NULL) { nscreens = 0; } if (FScreenConfigureSLSScreens(nscreens, args)) { broadcast_xinerama_state(); } return; } void CMD_DesktopSize(F_CMD_ARGS) { int val[2]; if (GetIntegerArguments(action, NULL, val, 2) != 2 && GetRectangleArguments(action, &val[0], &val[1]) != 2) { fvwm_msg(ERR, "CMD_DesktopSize", "DesktopSize requires two arguments"); return; } Scr.VxMax = (val[0] <= 0) ? 0: val[0]*Scr.MyDisplayWidth-Scr.MyDisplayWidth; Scr.VyMax = (val[1] <= 0) ? 0: val[1]*Scr.MyDisplayHeight-Scr.MyDisplayHeight; BroadcastPacket( M_NEW_PAGE, 7, (long)Scr.Vx, (long)Scr.Vy, (long)Scr.CurrentDesk, (long)Scr.MyDisplayWidth, (long)Scr.MyDisplayHeight, (long)((Scr.VxMax / Scr.MyDisplayWidth) + 1), (long)((Scr.VyMax / Scr.MyDisplayHeight) + 1)); checkPanFrames(); /* update GNOME pager */ GNOME_SetAreaCount(); EWMH_SetDesktopGeometry(); return; } /* * * Move to a new desktop * */ void CMD_GotoDesk(F_CMD_ARGS) { goto_desk(GetDeskNumber(action, Scr.CurrentDesk)); return; } void CMD_Desk(F_CMD_ARGS) { CMD_GotoDesk(F_PASS_ARGS); return; } /* * * Move to a new desktop and page at the same time. * This function is designed for use by the Pager, and replaces the old * GoToDesk 0 10000 hack. * - unmap all windows on the current desk so they don't flash when the * viewport is moved, then switch the viewport, then the desk. * */ void CMD_GotoDeskAndPage(F_CMD_ARGS) { int val[3]; Bool is_new_desk; if (MatchToken(action, "prev")) { val[0] = prev_desk_and_page_desk; val[1] = prev_desk_and_page_page_x; val[2] = prev_desk_and_page_page_y; } else if (GetIntegerArguments(action, NULL, val, 3) == 3) { val[1] *= Scr.MyDisplayWidth; val[2] *= Scr.MyDisplayHeight; } else { return; } is_new_desk = (Scr.CurrentDesk != val[0]); if (is_new_desk) { UnmapDesk(Scr.CurrentDesk, True); } prev_desk_and_page_page_x = Scr.Vx; prev_desk_and_page_page_y = Scr.Vy; MoveViewport(val[1], val[2], True); if (is_new_desk) { prev_desk = Scr.CurrentDesk; prev_desk_and_page_desk = Scr.CurrentDesk; Scr.CurrentDesk = val[0]; MapDesk(val[0], True); focus_grab_buttons_all(); BroadcastPacket(M_NEW_DESK, 1, (long)Scr.CurrentDesk); /* FIXME: domivogt (22-Apr-2000): Fake a 'restack' for sticky * window upon desk change. This is a workaround for a * problem in FvwmPager: The pager has a separate 'root' * window for each desk. If the active desk changes, the * pager destroys sticky mini windows and creates new ones in * the other desktop 'root'. But the pager can't know where to * stack them. So we have to tell it ecplicitly where they * go :-( This should be fixed in the pager, but right now the * pager doesn't the stacking order. */ BroadcastRestackAllWindows(); } else { BroadcastPacket(M_NEW_DESK, 1, (long)Scr.CurrentDesk); } EWMH_SetCurrentDesktop(); GNOME_SetCurrentDesk(); GNOME_SetDeskCount(); return; } void CMD_GotoPage(F_CMD_ARGS) { int x; int y; x = Scr.Vx; y = Scr.Vy; if (!get_page_arguments(action, &x, &y)) { fvwm_msg( ERR, "goto_page_func", "GotoPage: invalid arguments: %s", action); return; } if (x < 0) { x = 0; } if (x > Scr.VxMax) { x = Scr.VxMax; } if (y < 0) { y = 0; } if (y > Scr.VyMax) { y = Scr.VyMax; } MoveViewport(x,y,True); return; } /* function with parsing of command line */ void CMD_MoveToDesk(F_CMD_ARGS) { int desk; FvwmWindow * const fw = exc->w.fw; desk = GetDeskNumber(action, fw->Desk); if (desk == fw->Desk) { return; } do_move_window_to_desk(fw, desk); return; } void CMD_Scroll(F_CMD_ARGS) { int x,y; int val1, val2, val1_unit, val2_unit; if (GetTwoArguments(action, &val1, &val2, &val1_unit, &val2_unit) != 2) { /* less then two integer parameters implies interactive * scroll check if we are scrolling in reverse direction */ char *option; int scroll_speed = 1; option = PeekToken(action, NULL); if (option != NULL) { if (StrEquals(option, "Reverse")) { scroll_speed *= -1; } } __drag_viewport(exc, scroll_speed); return; } if ((val1 > -100000)&&(val1 < 100000)) { x = Scr.Vx + val1*val1_unit/100; } else { x = Scr.Vx + (val1/1000)*val1_unit/100; } if ((val2 > -100000)&&(val2 < 100000)) { y=Scr.Vy + val2*val2_unit/100; } else { y = Scr.Vy + (val2/1000)*val2_unit/100; } if (((val1 <= -100000)||(val1 >= 100000))&&(x>Scr.VxMax)) { int xpixels; xpixels = (Scr.VxMax / Scr.MyDisplayWidth + 1) * Scr.MyDisplayWidth; x %= xpixels; y += Scr.MyDisplayHeight * (1+((x-Scr.VxMax-1)/xpixels)); if (y > Scr.VyMax) { y %= (Scr.VyMax / Scr.MyDisplayHeight + 1) * Scr.MyDisplayHeight; } } if (((val1 <= -100000)||(val1 >= 100000))&&(x<0)) { x = Scr.VxMax; y -= Scr.MyDisplayHeight; if (y < 0) { y=Scr.VyMax; } } if (((val2 <= -100000)||(val2>= 100000))&&(y>Scr.VyMax)) { int ypixels = (Scr.VyMax / Scr.MyDisplayHeight + 1) * Scr.MyDisplayHeight; y %= ypixels; x += Scr.MyDisplayWidth * (1+((y-Scr.VyMax-1)/ypixels)); if (x > Scr.VxMax) { x %= (Scr.VxMax / Scr.MyDisplayWidth + 1) * Scr.MyDisplayWidth; } } if (((val2 <= -100000)||(val2>= 100000))&&(y<0)) { y = Scr.VyMax; x -= Scr.MyDisplayWidth; if (x < 0) { x=Scr.VxMax; } } MoveViewport(x,y,True); return; } /* * * Defines the name of a desktop * */ void CMD_DesktopName(F_CMD_ARGS) { int desk; DesktopsInfo *t, *d, *new, **prev; if (GetIntegerArguments(action, &action, &desk, 1) != 1) { fvwm_msg( ERR,"CMD_DesktopName", "First argument to DesktopName must be an integer: %s", action); return; } d = Scr.Desktops->next; while (d != NULL && d->desk != desk) { d = d->next; } if (d != NULL) { if (d->name != NULL) { free(d->name); d->name = NULL; } if (action != NULL && *action && *action != '\n') { CopyString(&d->name, action); } } else { /* new deskops entries: add it in order */ d = Scr.Desktops->next; t = Scr.Desktops; prev = &(Scr.Desktops->next); while (d != NULL && d->desk < desk) { t = t->next; prev = &(d->next); d = d->next; } if (d == NULL) { /* add it at the end */ *prev = (DesktopsInfo *)safemalloc( sizeof(DesktopsInfo)); memset(*prev, 0, sizeof(DesktopsInfo)); (*prev)->desk = desk; if (action != NULL && *action && *action != '\n') { CopyString(&((*prev)->name), action); } } else { /* instert it */ new = (DesktopsInfo *)safemalloc(sizeof(DesktopsInfo)); memset(new, 0, sizeof(DesktopsInfo)); new->desk = desk; if (action != NULL && *action && *action != '\n') { CopyString(&(new->name), action); } t->next = new; new->next = d; } /* should check/set the working areas */ } if (!fFvwmInStartup) { char *msg; const char *default_desk_name = _("Desk"); /* should send the info to the FvwmPager and set the EWMH * desktop names */ if (action != NULL && *action && *action != '\n') { msg = (char *)safemalloc(strlen(action) + 44); sprintf(msg, "DesktopName %d %s", desk, action); } else { msg = (char *)safemalloc(strlen(default_desk_name)+44); sprintf( msg, "DesktopName %d %s %d", desk, default_desk_name, desk); } BroadcastConfigInfoString(msg); free(msg); EWMH_SetDesktopNames(); } return; } fvwm-2.6.5.orig/fvwm/functions.h0000644000175000017500000000473210662527720014777 0ustar vwcvwc/* -*-c-*- */ #ifndef FUNCTIONS_H #define FUNCTIONS_H /* ---------------------------- included header files ---------------------- */ #include "execcontext.h" /* ---------------------------- global definitions ------------------------- */ /* Bits for the function flag byte. */ typedef enum { FUNC_NEEDS_WINDOW = 0x01, FUNC_DONT_REPEAT = 0x02, FUNC_ADD_TO = 0x04, FUNC_DECOR = 0x08, FUNC_ALLOW_UNMANAGED = 0x10, /* only to be passed to execute_function() */ FUNC_IS_UNMANAGED = 0x20, FUNC_DONT_EXPAND_COMMAND = 0x40, FUNC_DONT_DEFER = 0x80, /* The values are not used internally but by external scripts parsing * functable. Hence all the values below are 0 */ /* tagging used only for building the documentation */ FUNC_OBSOLETE = 0, FUNC_DEPRECATED = 0, /* command grouping (used only for building the documentation) */ /*!!!*/ FG_BINDING = 0, FG_MODULE = 0, FG_MENU = 0, FG_SESSION = 0, FG_STYLE = 0, FG_MOVE = 0, FG_STATE = 0, FG_COND = 0, FG_USER = 0, FG_COLOR = 0, FG_EWMH_GNOME = 0, FG_VIRTUAL = 0, FG_FOCUS = 0, FG_MISC = 0, FG_OLD = 0 } execute_flags_t; /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ /* used for parsing commands*/ typedef struct { char *keyword; #ifdef __STDC__ void (*action)(F_CMD_ARGS); #else void (*action)(); #endif short func_t; FUNC_FLAGS_TYPE flags; int cursor; } func_t; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void find_func_t( char *action, short *func_t, FUNC_FLAGS_TYPE *flags); Bool functions_is_complex_function( const char *function_name); void execute_function( cond_rc_t *cond_rc, const exec_context_t *exc, char *action, FUNC_FLAGS_TYPE exec_flags); void execute_function_override_wcontext( cond_rc_t *cond_rc, const exec_context_t *exc, char *action, FUNC_FLAGS_TYPE exec_flags, int wcontext); void execute_function_override_window( cond_rc_t *cond_rc, const exec_context_t *exc, char *action, FUNC_FLAGS_TYPE exec_flags, FvwmWindow *fw); #endif /* FUNCTIONS_H */ fvwm-2.6.5.orig/fvwm/module_interface.c0000644000175000017500000005343311622413321016255 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* * * code for talking with fvwm modules. * */ #include "config.h" #include #include #include #include "libs/ftime.h" #include "libs/fvwmlib.h" #include "libs/FScreen.h" #include "libs/ColorUtils.h" #include "libs/Parse.h" #include "libs/Strings.h" #include "libs/wild.h" #include "fvwm.h" #include "externs.h" #include "functions.h" #include "bindings.h" #include "misc.h" #include "screen.h" #include "module_interface.h" #include "module_list.h" #include "events.h" #include "geometry.h" #include "libs/fvwmsignal.h" #include "decorations.h" #include "commands.h" /* A queue of commands from the modules */ static fqueue cqueue = FQUEUE_INIT; static const unsigned long dummy = 0; static unsigned long * make_vpacket(unsigned long *body, unsigned long event_type, unsigned long num, va_list ap) { unsigned long *bp = body; /* truncate long packets */ if (num > FvwmPacketMaxSize) { num = FvwmPacketMaxSize; } *(bp++) = START_FLAG; *(bp++) = event_type; *(bp++) = num+FvwmPacketHeaderSize; *(bp++) = fev_get_evtime(); for (; num > 0; --num) { *(bp++) = va_arg(ap, unsigned long); } return body; } /* RBW - 04/16/1999 - new packet builder for GSFR -- Arguments are pairs of lengths and argument data pointers. RBW - 05/01/2000 - A length of zero means that an int is being passed which must be stored in the packet as an unsigned long. This is a special hack to accommodate the old CONFIGARGS technique of sending the args for the M_CONFIGURE_WINDOW packet. */ static unsigned long make_new_vpacket(unsigned char *body, unsigned long event_type, unsigned long num, va_list ap) { long arglen; unsigned long addlen; unsigned long bodylen = 0; unsigned long *bp = (unsigned long *)body; unsigned long *bp1 = bp; unsigned long plen = 0; *(bp++) = START_FLAG; *(bp++) = event_type; /* Skip length field, we don't know it yet. */ bp++; *(bp++) = fev_get_evtime(); for (; num > 0; --num) { arglen = va_arg(ap, long); if (arglen <= 0) { if (arglen == 0) { arglen = -sizeof(int); } addlen = sizeof(unsigned long); } else { addlen = arglen; } bodylen += addlen; if (bodylen >= FvwmPacketMaxSize_byte) { fvwm_msg( ERR, "make_new_vpacket", "packet too long %ld %ld", (long)bodylen, (long)FvwmPacketMaxSize_byte); break; } if (arglen > 0) { register char *tmp = (char *)bp; memcpy(tmp, va_arg(ap, char *), arglen); tmp += arglen; bp = (unsigned long *)tmp; } else if (arglen == 0 || arglen == -sizeof(int)) { int *tmp; tmp = va_arg(ap, int *); *bp = (unsigned long) *tmp; bp++; } else if (arglen == -sizeof(long)) { unsigned long *tmp; tmp = va_arg(ap, unsigned long *); *bp = (unsigned long) *tmp; bp++; } else if (arglen == -sizeof(short)) { short *tmp; tmp = va_arg(ap, short *); *bp = (unsigned long) *tmp; bp++; } else { fvwm_msg( ERR, "make_new_vpacket", "can not handle arglen %ld, please contact" " fvwm-workers@fvwm.org. aborting...", arglen); abort(); } } /* Round up to a long word boundary. Most of the module interface still thinks in terms of an array of longss, so let's humor it. */ plen = (unsigned long) ((char *)bp - (char *)bp1); plen = ((plen + (sizeof(long) - 1)) / sizeof(long)) * sizeof(long); *(((unsigned long*)bp1)+2) = (plen / (sizeof(unsigned long))); return plen; } void SendPacket( fmodule *module, unsigned long event_type, unsigned long num_datum, ...) { unsigned long body[FvwmPacketMaxSize]; va_list ap; va_start(ap, num_datum); make_vpacket(body, event_type, num_datum, ap); va_end(ap); PositiveWrite( module, body, (num_datum+FvwmPacketHeaderSize)*sizeof(body[0])); return; } void BroadcastPacket(unsigned long event_type, unsigned long num_datum, ...) { unsigned long body[FvwmPacketMaxSize]; va_list ap; fmodule_list_itr moditr; fmodule *module; va_start(ap,num_datum); make_vpacket(body, event_type, num_datum, ap); va_end(ap); module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { PositiveWrite( module, body, (num_datum+FvwmPacketHeaderSize)*sizeof(body[0])); } return; } /* RBW - 04/16/1999 - new style packet senders for GSFR -- */ static void SendNewPacket( fmodule *module, unsigned long event_type, unsigned long num_datum, ...) { unsigned char body[FvwmPacketMaxSize_byte]; va_list ap; unsigned long plen; va_start(ap,num_datum); plen = make_new_vpacket(body, event_type, num_datum, ap); va_end(ap); PositiveWrite(module, (void *) &body, plen); return; } static void BroadcastNewPacket(unsigned long event_type, unsigned long num_datum, ...) { unsigned char body[FvwmPacketMaxSize_byte]; va_list ap; fmodule_list_itr moditr; fmodule *module; unsigned long plen; va_start(ap,num_datum); plen = make_new_vpacket(body, event_type, num_datum, ap); va_end(ap); module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { PositiveWrite(module, (void *) &body, plen); } return; } action_flags *__get_allowed_actions(const FvwmWindow *fw) { static action_flags act; act.is_movable = is_function_allowed( F_MOVE, NULL, fw, RQORIG_PROGRAM_US, False); act.is_deletable = is_function_allowed( F_DELETE, NULL, fw, RQORIG_PROGRAM_US, False); act.is_destroyable = is_function_allowed( F_DESTROY, NULL, fw, RQORIG_PROGRAM_US, False); act.is_closable = is_function_allowed( F_CLOSE, NULL, fw, RQORIG_PROGRAM_US, False); act.is_maximizable = is_function_allowed( F_MAXIMIZE, NULL, fw, RQORIG_PROGRAM_US, False); act.is_resizable = is_function_allowed( F_RESIZE, NULL, fw, RQORIG_PROGRAM_US, False); act.is_iconifiable = is_function_allowed( F_ICONIFY, NULL, fw, RQORIG_PROGRAM_US, False); return &act; } /* RBW - 04/16/1999 - new version for GSFR -- - args are now pairs: - length of arg data - pointer to arg data - number of arguments is the number of length/pointer pairs. - the 9th field, where flags used to be, is temporarily left as a dummy to preserve alignment of the other fields in the old packet: we should drop this before the next release. */ #define CONFIGARGS(_fw) 33, \ (unsigned long)(-sizeof(Window)), \ &FW_W(*(_fw)), \ (unsigned long)(-sizeof(Window)), \ &FW_W_FRAME(*(_fw)), \ (unsigned long)(-sizeof(void *)), \ &(_fw), \ (unsigned long)(0), \ &(*(_fw))->g.frame.x, \ (unsigned long)(0), \ &(*(_fw))->g.frame.y, \ (unsigned long)(0), \ &(*(_fw))->g.frame.width, \ (unsigned long)(0), \ &(*(_fw))->g.frame.height, \ (unsigned long)(0), \ &(*(_fw))->Desk, \ (unsigned long)(0), \ &(*(_fw))->layer, \ (unsigned long)(0), \ &(*(_fw))->hints.base_width, \ (unsigned long)(0), \ &(*(_fw))->hints.base_height, \ (unsigned long)(0), \ &(*(_fw))->hints.width_inc, \ (unsigned long)(0), \ &(*(_fw))->hints.height_inc, \ (unsigned long)(0), \ &(*(_fw))->orig_hints.width_inc, \ (unsigned long)(0), \ &(*(_fw))->orig_hints.height_inc, \ (unsigned long)(0), \ &(*(_fw))->hints.min_width, \ (unsigned long)(0), \ &(*(_fw))->hints.min_height, \ (unsigned long)(0), \ &(*(_fw))->hints.max_width, \ (unsigned long)(0), \ &(*(_fw))->hints.max_height, \ (unsigned long)(-sizeof(Window)), \ &FW_W_ICON_TITLE(*(_fw)), \ (unsigned long)(-sizeof(Window)), \ &FW_W_ICON_PIXMAP(*(_fw)), \ (unsigned long)(0), \ &(*(_fw))->hints.win_gravity, \ (unsigned long)(-sizeof(Pixel)), \ &(*(_fw))->colors.fore, \ (unsigned long)(-sizeof(Pixel)), \ &(*(_fw))->colors.back, \ (unsigned long)(0), \ &(*(_fw))->ewmh_hint_layer, \ (unsigned long)(sizeof(unsigned long)), \ &(*(_fw))->ewmh_hint_desktop, \ (unsigned long)(0), \ &(*(_fw))->ewmh_window_type, \ (unsigned long)(sizeof(short)), \ &(*(_fw))->title_thickness, \ (unsigned long)(sizeof(short)), \ &(*(_fw))->boundary_width, \ (unsigned long)(sizeof(short)), \ &dummy, \ (unsigned long)(sizeof(short)), \ &dummy, \ (unsigned long)(sizeof((*(_fw))->flags)), \ &(*(_fw))->flags, \ (unsigned long)(sizeof(action_flags)), \ __get_allowed_actions((*(_fw))) void SendConfig(fmodule *module, unsigned long event_type, const FvwmWindow *t) { const FvwmWindow **t1 = &t; /* RBW- SendPacket(module, event_type, CONFIGARGS(t)); */ SendNewPacket(module, event_type, CONFIGARGS(t1)); return; } void BroadcastConfig(unsigned long event_type, const FvwmWindow *t) { const FvwmWindow **t1 = &t; /* RBW- BroadcastPacket(event_type, CONFIGARGS(t)); */ BroadcastNewPacket(event_type, CONFIGARGS(t1)); return; } static unsigned long *make_named_packet( int *len, unsigned long event_type, const char *name, int num, ...) { unsigned long *body; va_list ap; /* Packet is the header plus the items plus enough items to hold the * name string. */ *len = FvwmPacketHeaderSize + num + (strlen(name) / sizeof(unsigned long)) + 1; /* truncate long packets */ if (*len > FvwmPacketMaxSize) { *len = FvwmPacketMaxSize; } body = (unsigned long *)safemalloc(*len * sizeof(unsigned long)); /* Zero out end of memory to avoid uninit memory access. */ body[*len-1] = 0; va_start(ap, num); make_vpacket(body, event_type, num, ap); va_end(ap); strncpy((char *)&body[FvwmPacketHeaderSize+num], name, (*len - FvwmPacketHeaderSize - num)*sizeof(unsigned long) - 1); body[2] = *len; return (body); } void SendName( fmodule *module, unsigned long event_type, unsigned long data1,unsigned long data2, unsigned long data3, const char *name) { unsigned long *body; int l; if (name == NULL) { return; } body = make_named_packet(&l, event_type, name, 3, data1, data2, data3); PositiveWrite(module, body, l*sizeof(unsigned long)); free(body); return; } void BroadcastName( unsigned long event_type, unsigned long data1, unsigned long data2, unsigned long data3, const char *name) { unsigned long *body; int l; fmodule_list_itr moditr; fmodule *module; if (name == NULL) { return; } body = make_named_packet(&l, event_type, name, 3, data1, data2, data3); module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { PositiveWrite(module, body, l*sizeof(unsigned long)); } free(body); return; } void BroadcastWindowIconNames(FvwmWindow *fw, Bool window, Bool icon) { if (window) { BroadcastName( M_WINDOW_NAME, FW_W(fw), FW_W_FRAME(fw), (unsigned long)fw, fw->name.name); BroadcastName( M_VISIBLE_NAME, FW_W(fw), FW_W_FRAME(fw), (unsigned long)fw, fw->visible_name); } if (icon) { BroadcastName( M_ICON_NAME, FW_W(fw), FW_W_FRAME(fw), (unsigned long)fw, fw->icon_name.name); BroadcastName( MX_VISIBLE_ICON_NAME, FW_W(fw), FW_W_FRAME(fw), (unsigned long)fw, fw->visible_icon_name); } return; } void SendFvwmPicture( fmodule *module, unsigned long event_type, unsigned long data1, unsigned long data2, unsigned long data3, FvwmPicture *picture, char *name) { unsigned long *body; unsigned long data4 = 0, data5 = 0, data6 = 0, data7 = 0, data8 = 0, data9 = 0; int l; if (!FMiniIconsSupported) { return; } if ((name == NULL) || (event_type != M_MINI_ICON)) { return; } if (picture != NULL) { data4 = picture->width; data5 = picture->height; data6 = picture->depth; data7 = picture->picture; data8 = picture->mask; data9 = picture->alpha; } body = make_named_packet( &l, event_type, name, 9, data1, data2, data3, data4, data5, data6, data7, data8, data9); PositiveWrite(module, body, l*sizeof(unsigned long)); free(body); return; } void BroadcastFvwmPicture( unsigned long event_type, unsigned long data1, unsigned long data2, unsigned long data3, FvwmPicture *picture, char *name) { unsigned long *body; unsigned long data4, data5, data6, data7, data8, data9; int l; fmodule_list_itr moditr; fmodule *module; if (!FMiniIconsSupported) { return; } if (picture != NULL) { data4 = picture->width; data5 = picture->height; data6 = picture->depth; data7 = picture->picture; data8 = picture->mask; data9 = picture->alpha; } else { data4 = 0; data5 = 0; data6 = 0; data7 = 0; data8 = 0; data9 = 0; } body = make_named_packet( &l, event_type, name, 9, data1, data2, data3, data4, data5, data6, data7, data8, data9); module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { PositiveWrite(module, body, l*sizeof(unsigned long)); } free(body); return; } /* * Reads a colorset command from a module and broadcasts it back out */ void BroadcastColorset(int n) { fmodule_list_itr moditr; fmodule *module; char *buf; buf = DumpColorset(n, &Colorset[n]); module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { SendName(module, M_CONFIG_INFO, 0, 0, 0, buf); } return; } /* * Broadcasts a string to all modules as M_CONFIG_INFO. */ void BroadcastPropertyChange( unsigned long argument, unsigned long data1, unsigned long data2, char *string) { fmodule_list_itr moditr; fmodule *module; module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { SendName(module, MX_PROPERTY_CHANGE, argument, data1, data2, string); } return; } /* * Broadcasts a string to all modules as M_CONFIG_INFO. */ void BroadcastConfigInfoString(char *string) { fmodule_list_itr moditr; fmodule *module; module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { SendName(module, M_CONFIG_INFO, 0, 0, 0, string); } return; } /* * Broadcasts the state of Xinerama support to all modules as M_CONFIG_INFO. */ void broadcast_xinerama_state(void) { BroadcastConfigInfoString((char *)FScreenGetConfiguration()); return; } /* * Broadcasts the ignored modifiers to all modules as M_CONFIG_INFO. */ void broadcast_ignore_modifiers(void) { char msg[32]; sprintf(msg, "IgnoreModifiers %d", GetUnusedModifiers()); BroadcastConfigInfoString(msg); return; } /* run the input command as if it cames from a button press or release */ void module_input_execute(struct fmodule_input *input) { XEvent e; const exec_context_t *exc; exec_context_changes_t ecc; memset(&e, 0, sizeof(e)); if (XFindContext(dpy, input->window, FvwmContext, (caddr_t *)&ecc.w.fw) == XCNOENT) { ecc.w.fw = NULL; input->window = None; } /* Query the pointer, the pager-drag-out feature doesn't work properly. * This is OK now that the Pager uses "Move pointer" * A real fix would be for the modules to pass the button press coords */ if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &JunkX,&JunkY, &e.xbutton.x_root, &e.xbutton.y_root, &e.xbutton.state) == False) { /* pointer is not on this screen */ /* If a module does XUngrabPointer(), it can now get proper * Popups */ e.xbutton.window = Scr.Root; ecc.w.fw = NULL; } else { e.xbutton.window = input->window; } e.xbutton.subwindow = None; e.xbutton.button = 1; /* If a module does XUngrabPointer(), it can now get proper Popups */ if (StrEquals(input->command, "popup")) { e.xbutton.type = ButtonPress; e.xbutton.state |= Button1Mask; } else { e.xbutton.type = ButtonRelease; e.xbutton.state &= (~(Button1Mask)); } e.xbutton.x = 0; e.xbutton.y = 0; fev_fake_event(&e); ecc.type = EXCT_MODULE; ecc.w.w = input->window; ecc.w.wcontext = GetContext(NULL, ecc.w.fw, &e, &(input->window)); ecc.x.etrigger = &e; ecc.m.module = input->module; exc = exc_create_context( &ecc, ECC_TYPE | ECC_ETRIGGER | ECC_FW | ECC_W | ECC_WCONTEXT | ECC_MODULE); execute_function(NULL, exc, input->command, 0); exc_destroy_context(exc); module_input_discard(input); return; } /* enqueue a module command on the command queue to be executed later */ void module_input_enqueue(struct fmodule_input *input) { if (input == NULL) { return; } DBUG("module_input_enqueue", input->command); fqueue_add_at_end(&cqueue, (void*)input); } /* * * Procedure: * ExecuteCommandQueue - runs command from the module command queue * This may be called recursively if a module command runs a function * that does a Wait, so it must be re-entrant * */ void ExecuteCommandQueue(void) { fmodule_input *input; while (fqueue_get_first(&cqueue, (void **)&input) == 1) { /* remove from queue */ fqueue_remove_or_operate_from_front( &cqueue, NULL, NULL, NULL, NULL); /* execute and destroy */ if (input->command) { DBUG("ExecuteCommandQueue", input->command); module_input_execute(input); } else { module_input_discard(input); } } return; } /* ** send an arbitrary string to all instances of a module */ void CMD_SendToModule(F_CMD_ARGS) { char *name,*str; unsigned long data0, data1, data2; fmodule_list_itr moditr; fmodule *module; FvwmWindow * const fw = exc->w.fw; /* FIXME: Without this, popup menus can't be implemented properly in * modules. Olivier: Why ? */ /* UngrabEm(); */ if (!action) { return; } str = GetNextToken(action, &name); if (!name) { return; } if (fw) { /* Modules may need to know which window this applies to */ data0 = FW_W(fw); data1 = FW_W_FRAME(fw); data2 = (unsigned long)fw; } else { data0 = 0; data1 = 0; data2 = 0; } module_list_itr_init(&moditr); while ( (module = module_list_itr_next(&moditr)) != NULL) { if ( (MOD_NAME(module) != NULL && matchWildcards(name,MOD_NAME(module))) || (MOD_ALIAS(module) && matchWildcards(name, MOD_ALIAS(module)))) { SendName(module,M_STRING,data0,data1,data2,str); FlushMessageQueue(module); } } free(name); return; } /* ** send an arbitrary string back to the calling module */ void CMD_Send_Reply(F_CMD_ARGS) { unsigned long data0, data1, data2; fmodule *module = exc->m.module; FvwmWindow * const fw = exc->w.fw; if (module == NULL) { return; } if (!action) { return; } if (fw) { /* Modules may need to know which window this applies to */ data0 = FW_W(fw); data1 = FW_W_FRAME(fw); data2 = (unsigned long)fw; } else { data0 = 0; data1 = 0; data2 = 0; } SendName(module, MX_REPLY, data0, data1, data2, action); FlushMessageQueue(module); return; } void CMD_Send_WindowList(F_CMD_ARGS) { FvwmWindow *t; fmodule *mod = exc->m.module; if (mod == NULL) { return; } SendPacket(mod, M_NEW_DESK, 1, (long)Scr.CurrentDesk); SendPacket( mod, M_NEW_PAGE, 7, (long)Scr.Vx, (long)Scr.Vy, (long)Scr.CurrentDesk, (long)Scr.MyDisplayWidth, (long)Scr.MyDisplayHeight, (long)((Scr.VxMax / Scr.MyDisplayWidth) + 1), (long)((Scr.VyMax / Scr.MyDisplayHeight) + 1)); if (Scr.Hilite != NULL) { SendPacket( mod, M_FOCUS_CHANGE, 5, (long)FW_W(Scr.Hilite), (long)FW_W_FRAME(Scr.Hilite), (unsigned long)True, (long)Scr.Hilite->hicolors.fore, (long)Scr.Hilite->hicolors.back); } else { SendPacket( mod, M_FOCUS_CHANGE, 5, 0, 0, (unsigned long)True, (long)GetColor(DEFAULT_FORE_COLOR), (long)GetColor(DEFAULT_BACK_COLOR)); } if (Scr.DefaultIcon != NULL) { SendName(mod, M_DEFAULTICON, 0, 0, 0, Scr.DefaultIcon); } for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { SendConfig(mod,M_CONFIGURE_WINDOW,t); SendName( mod, M_WINDOW_NAME, FW_W(t), FW_W_FRAME(t), (unsigned long)t, t->name.name); SendName( mod, M_ICON_NAME, FW_W(t), FW_W_FRAME(t), (unsigned long)t, t->icon_name.name); SendName( mod, M_VISIBLE_NAME, FW_W(t), FW_W_FRAME(t), (unsigned long)t, t->visible_name); SendName( mod, MX_VISIBLE_ICON_NAME, FW_W(t), FW_W_FRAME(t), (unsigned long)t,t->visible_icon_name); if (t->icon_bitmap_file != NULL && t->icon_bitmap_file != Scr.DefaultIcon) { SendName( mod, M_ICON_FILE, FW_W(t), FW_W_FRAME(t), (unsigned long)t, t->icon_bitmap_file); } SendName( mod, M_RES_CLASS, FW_W(t), FW_W_FRAME(t), (unsigned long)t, t->class.res_class); SendName( mod, M_RES_NAME, FW_W(t), FW_W_FRAME(t), (unsigned long)t, t->class.res_name); if (IS_ICONIFIED(t) && !IS_ICON_UNMAPPED(t)) { rectangle r; Bool rc; rc = get_visible_icon_geometry(t, &r); if (rc == True) { SendPacket( mod, M_ICONIFY, 7, (long)FW_W(t), (long)FW_W_FRAME(t), (unsigned long)t, (long)r.x, (long)r.y, (long)r.width, (long)r.height); } } if ((IS_ICONIFIED(t))&&(IS_ICON_UNMAPPED(t))) { SendPacket( mod, M_ICONIFY, 7, (long)FW_W(t), (long)FW_W_FRAME(t), (unsigned long)t, (long)0, (long)0, (long)0, (long)0); } if (FMiniIconsSupported && t->mini_icon != NULL) { SendFvwmPicture( mod, M_MINI_ICON, FW_W(t), FW_W_FRAME(t), (unsigned long)t, t->mini_icon, t->mini_pixmap_file); } } if (Scr.Hilite == NULL) { BroadcastPacket( M_FOCUS_CHANGE, 5, (long)0, (long)0, (unsigned long)True, (long)GetColor(DEFAULT_FORE_COLOR), (long)GetColor(DEFAULT_BACK_COLOR)); } else { BroadcastPacket( M_FOCUS_CHANGE, 5, (long)FW_W(Scr.Hilite), (long)FW_W(Scr.Hilite), (unsigned long)True, (long)Scr.Hilite->hicolors.fore, (long)Scr.Hilite->hicolors.back); } SendPacket(mod, M_END_WINDOWLIST, 0); return; } fvwm-2.6.5.orig/fvwm/ewmh_names.c0000644000175000017500000001507111225543014015071 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2001 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include #include #include "libs/fvwmlib.h" #include "libs/Flocale.h" #include "libs/FlocaleCharset.h" #include "libs/Ficonv.h" #include "fvwm.h" #include "window_flags.h" #include "cursor.h" #include "functions.h" #include "misc.h" #include "screen.h" #include "module_interface.h" #include "borders.h" #include "add_window.h" #include "icons.h" #include "ewmh.h" #include "ewmh_intern.h" #include "externs.h" /* * set the visibale window name and icon name */ void EWMH_SetVisibleName(FvwmWindow *fw, Bool is_icon_name) { unsigned char *val; char *tmp_str; FlocaleCharset *fc = NULL; if (!FiconvSupport) { return; } /* set the ewmh visible name only if it is != wm name */ if (is_icon_name) { if ((fw->icon_name_count == 0 || !USE_INDEXED_ICON_NAME(fw)) && !HAS_EWMH_WM_ICON_NAME(fw) && !HAS_EWMH_WM_NAME(fw)) { ewmh_DeleteProperty( FW_W(fw), "_NET_WM_ICON_VISIBLE_NAME", EWMH_ATOM_LIST_FVWM_WIN); return; } if (IS_ICON_FONT_LOADED(fw) && fw->icon_font != NULL) { fc = fw->icon_font->str_fc; } tmp_str = fw->visible_icon_name; } else { if ((fw->name_count == 0 || !USE_INDEXED_WINDOW_NAME(fw)) && !HAS_EWMH_WM_NAME(fw) && !HAS_EWMH_WM_ICON_NAME(fw)) { ewmh_DeleteProperty( FW_W(fw), "_NET_WM_VISIBLE_NAME", EWMH_ATOM_LIST_FVWM_WIN); return; } if (IS_WINDOW_FONT_LOADED(fw) && fw->title_font != NULL) { fc = fw->title_font->str_fc; } tmp_str = fw->visible_name; } if (tmp_str == NULL) { return; /* should never happen */ } val = (unsigned char *)FiconvCharsetToUtf8( dpy, fc, tmp_str, strlen(tmp_str)); if (val == NULL) { return; } if (is_icon_name) { ewmh_ChangeProperty( FW_W(fw), "_NET_WM_ICON_VISIBLE_NAME", EWMH_ATOM_LIST_FVWM_WIN, (unsigned char *)val, strlen((char *)val)); } else { ewmh_ChangeProperty( FW_W(fw), "_NET_WM_VISIBLE_NAME", EWMH_ATOM_LIST_FVWM_WIN, (unsigned char *)val, strlen((char *)val)); } free(val); } /* * setup and property notify */ int EWMH_WMIconName(EWMH_CMD_ARGS) { int size = 0; char *val; char *tmp_str; FlocaleCharset *fc = NULL; if (!FiconvSupport) { return 0; } val = ewmh_AtomGetByName( FW_W(fw), "_NET_WM_ICON_NAME", EWMH_ATOM_LIST_PROPERTY_NOTIFY, &size); if (val == NULL) { SET_HAS_EWMH_WM_ICON_NAME(fw,0); return 0; } if (IS_ICON_FONT_LOADED(fw) && fw->icon_font != NULL) { fc = fw->icon_font->str_fc; } tmp_str = (char *)FiconvUtf8ToCharset( dpy, fc, (const char *) val, size); free(val); if (tmp_str == NULL) { SET_HAS_EWMH_WM_ICON_NAME(fw, 0); return 0; } if (strlen(tmp_str) > MAX_ICON_NAME_LEN) { tmp_str[MAX_ICON_NAME_LEN] = 0; } SET_HAS_EWMH_WM_ICON_NAME(fw, 1); if (fw->icon_name.name && strcmp(tmp_str, fw->icon_name.name) == 0) { /* migo: some apps update their names every second */ free(tmp_str); return 0; } if (ev != NULL) { /* client message */ free_window_names(fw, False, True); } fw->icon_name.name = tmp_str; SET_WAS_ICON_NAME_PROVIDED(fw, 1); if (ev == NULL) { /* return now for setup */ return 1; } setup_visible_name(fw, True); EWMH_SetVisibleName(fw, True); BroadcastWindowIconNames(fw, False, True); RedoIconName(fw); return 1; } int EWMH_WMName(EWMH_CMD_ARGS) { int size = 0; char *val; char *tmp_str; FlocaleCharset *fc = NULL; if (!FiconvSupport) return 0; val = ewmh_AtomGetByName( FW_W(fw), "_NET_WM_NAME", EWMH_ATOM_LIST_PROPERTY_NOTIFY, &size); if (val == NULL) { SET_HAS_EWMH_WM_NAME(fw,0); return 0; } if (IS_WINDOW_FONT_LOADED(fw) && fw->title_font != NULL) { fc = fw->title_font->str_fc; } tmp_str = (char *)FiconvUtf8ToCharset( dpy, fc, (const char *) val, size); free(val); if (tmp_str == NULL) { SET_HAS_EWMH_WM_NAME(fw,0); return 0; } if (strlen(tmp_str) > MAX_WINDOW_NAME_LEN) { tmp_str[MAX_WINDOW_NAME_LEN] = 0; } SET_HAS_EWMH_WM_NAME(fw, 1); if (fw->name.name && strcmp(tmp_str, fw->name.name) == 0) { /* migo: some apps update their names every second */ free(tmp_str); return 0; } if (ev != NULL) { /* client message */ free_window_names(fw, True, False); } fw->name.name = tmp_str; if (ev == NULL) { return 1; } setup_visible_name(fw, False); SET_NAME_CHANGED(fw, 1); EWMH_SetVisibleName(fw, False); BroadcastWindowIconNames(fw, True, False); /* fix the name in the title bar */ if (!IS_ICONIFIED(fw)) { border_draw_decorations( fw, PART_TITLE, (Scr.Hilite == fw), True, CLEAR_ALL, NULL, NULL); } if (!WAS_ICON_NAME_PROVIDED(fw)) { fw->icon_name = fw->name; setup_visible_name(fw, True); BroadcastWindowIconNames(fw, False, True); EWMH_SetVisibleName(fw, True); RedoIconName(fw); } return 0; } #define MAX(A,B) ((A)>(B)? (A):(B)) /* * set the desktop name */ void EWMH_SetDesktopNames(void) { int nbr = 0; int len = 0; int i; int j = 0; DesktopsInfo *d,*s; unsigned char **names; unsigned char *val; if (!FiconvSupport) { return; } d = Scr.Desktops->next; /* skip negative desk */ while (d != NULL && d->desk < 0) { d = d->next; } s = d; while (d != NULL && d->name != NULL && d->desk == nbr) { nbr++; d = d->next; } if (nbr == 0) { return; } names = (void *)safemalloc(sizeof(*names)*nbr); for (i = 0; i < nbr; i++) { names[i] = (unsigned char *)FiconvCharsetToUtf8( dpy, NULL, s->name, strlen(s->name)); if (names[i]) { len += strlen((char *)names[i]) + 1; } else { len++; } s = s->next; } val = (unsigned char *)safemalloc(len); for (i = 0; i < nbr; i++) { if (names[i] != NULL) { memcpy(&val[j], names[i], strlen((char *)names[i])); j += strlen((char *)names[i]); free(names[i]); } val[j++] = '\0'; } ewmh_ChangeProperty( Scr.Root, "_NET_DESKTOP_NAMES", EWMH_ATOM_LIST_CLIENT_ROOT, (unsigned char *)val, len); free(names); free(val); } fvwm-2.6.5.orig/fvwm/icccm2.c0000644000175000017500000001506610556634173014127 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #ifdef HAVE_FCNTL_H #include #endif #include #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "misc.h" #include "screen.h" #include "eventmask.h" Time managing_since; Atom _XA_WM_SX; Atom _XA_MANAGER; Atom _XA_ATOM_PAIR; Atom _XA_WM_COLORMAP_NOTIFY; #define _XA_TARGETS conversion_targets[0] #define _XA_MULTIPLE conversion_targets[1] #define _XA_TIMESTAMP conversion_targets[2] #define _XA_VERSION conversion_targets[3] #define MAX_TARGETS 4 long conversion_targets[MAX_TARGETS]; long icccm_version[] = { 2, 0 }; void SetupICCCM2(Bool replace_wm) { Window running_wm_win; XSetWindowAttributes attr; XEvent xev; XClientMessageEvent ev; char wm_sx[20]; sprintf(wm_sx, "WM_S%lu", Scr.screen); _XA_WM_SX = XInternAtom(dpy, wm_sx, False); _XA_MANAGER = XInternAtom(dpy, "MANAGER", False); _XA_ATOM_PAIR = XInternAtom(dpy, "ATOM_PAIR", False); _XA_TARGETS = XInternAtom(dpy, "TARGETS", False); _XA_MULTIPLE = XInternAtom(dpy, "MULTIPLE", False); _XA_TIMESTAMP = XInternAtom(dpy, "TIMESTAMP", False); _XA_VERSION = XInternAtom(dpy, "VERSION", False); _XA_WM_COLORMAP_NOTIFY = XInternAtom(dpy, "WM_COLORMAP_NOTIFY", False); /* Check for a running ICCCM 2.0 compliant WM */ running_wm_win = XGetSelectionOwner(dpy, _XA_WM_SX); if (running_wm_win != None) { DBUG( "SetupICCCM2", "another ICCCM 2.0 compliant WM is running"); if (!replace_wm) { fvwm_msg( ERR, "SetupICCCM2", "another ICCCM 2.0 compliant WM is running," " try -replace"); exit(1); } /* We need to know when the old manager is gone. Thus we wait until it destroys running_wm_win. */ attr.event_mask = StructureNotifyMask; XChangeWindowAttributes( dpy, running_wm_win, CWEventMask, &attr); } /* We are not yet in the event loop, thus fev_get_evtime() will not * be ready. Have to get a timestamp manually by provoking a * PropertyNotify. */ managing_since = get_server_time(); XSetSelectionOwner(dpy, _XA_WM_SX, Scr.NoFocusWin, managing_since); if (XGetSelectionOwner(dpy, _XA_WM_SX) != Scr.NoFocusWin) { fvwm_msg( ERR, "SetupICCCM2", "failed to acquire selection ownership"); exit(1); } /* Announce ourself as the new wm */ ev.type = ClientMessage; ev.window = Scr.Root; ev.message_type = _XA_MANAGER; ev.format = 32; ev.data.l[0] = managing_since; ev.data.l[1] = _XA_WM_SX; FSendEvent(dpy, Scr.Root, False, StructureNotifyMask,(XEvent*)&ev); if (running_wm_win != None) { /* Wait for the old wm to finish. */ /* FIXME: need a timeout here. */ DBUG("SetupICCCM2", "waiting for WM to give up"); do { FWindowEvent( dpy, running_wm_win, StructureNotifyMask, &xev); } while (xev.type != DestroyNotify); } /* restore NoFocusWin event mask */ attr.event_mask = XEVMASK_NOFOCUSW; XChangeWindowAttributes(dpy, Scr.NoFocusWin, CWEventMask, &attr); return; } /* We must make sure that we have released SubstructureRedirect before we destroy manager_win, so that another wm can start successfully. */ void CloseICCCM2(void) { DBUG("CloseICCCM2", "good luck, new wm"); XSelectInput(dpy, Scr.Root, NoEventMask); XFlush(dpy); return; } /* FIXME: property change actually succeeded */ static Bool convertProperty(Window w, Atom target, Atom property) { if (target == _XA_TARGETS) { XChangeProperty( dpy, w, property, XA_ATOM, 32, PropModeReplace, (unsigned char *)conversion_targets, MAX_TARGETS); } else if (target == _XA_TIMESTAMP) { long local_managing_since; local_managing_since = managing_since; XChangeProperty( dpy, w, property, XA_INTEGER, 32, PropModeReplace, (unsigned char *)&local_managing_since, 1); } else if (target == _XA_VERSION) { XChangeProperty( dpy, w, property, XA_INTEGER, 32, PropModeReplace, (unsigned char *)icccm_version, 2); } else { return False; } /* FIXME: This is ugly. We should rather select for PropertyNotify on the window, return to the main loop, and send the SelectionNotify once we are sure the property has arrived. Problem: this needs a list of pending SelectionNotifys. */ XFlush(dpy); return True; } void icccm2_handle_selection_request(const XEvent *e) { Atom type; unsigned long *adata; int i, format; unsigned long num, rest; unsigned char *data; XSelectionRequestEvent ev = e->xselectionrequest; XSelectionEvent reply; reply.type = SelectionNotify; reply.display = dpy; reply.requestor = ev.requestor; reply.selection = ev.selection; reply.target = ev.target; reply.property = None; reply.time = ev.time; if (ev.target == _XA_MULTIPLE) { if (ev.property != None) { XGetWindowProperty( dpy, ev.requestor, ev.property, 0L, 256L, False, _XA_ATOM_PAIR, &type, &format, &num, &rest, &data); /* FIXME: to be 100% correct, should deal with * rest > 0, but since we have 4 possible targets, we * will hardly ever meet multiple requests with a * length > 8 */ adata = (unsigned long *)data; for(i = 0; i < num; i += 2) { if (!convertProperty( ev.requestor, adata[i], adata[i+1])) { adata[i+1] = None; } } XChangeProperty( dpy, ev.requestor, ev.property, _XA_ATOM_PAIR, 32, PropModeReplace, data, num); XFree(data); } } else { if (ev.property == None) { ev.property = ev.target; } if (convertProperty(ev.requestor, ev.target, ev.property)) { reply.property = ev.property; } } FSendEvent(dpy, ev.requestor, False, 0L,(XEvent*)&reply); XFlush(dpy); return; } /* If another wm is requesting ownership of the selection, we receive a SelectionClear event. In that case, we have to release all resources and destroy manager_win. Done() calls CloseICCCM2() after undecorating all windows. */ void icccm2_handle_selection_clear(void) { DBUG("HandleSelectionClear", "I lost my selection!"); Done(0, NULL); return; } fvwm-2.6.5.orig/fvwm/builtins.c0000644000175000017500000025376511705516565014633 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include #include #include #include #include #include #include "libs/fvwmlib.h" #include "libs/fvwmsignal.h" #include "libs/setpgrp.h" #include "libs/Grab.h" #include "libs/Parse.h" #include "libs/ColorUtils.h" #include "libs/Graphics.h" #include "libs/wild.h" #include "libs/envvar.h" #include "libs/ClientMsg.h" #include "libs/Picture.h" #include "libs/PictureUtils.h" #include "libs/FGettext.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "libs/Flocale.h" #include "libs/Ficonv.h" #include "fvwm.h" #include "externs.h" #include "colorset.h" #include "bindings.h" #include "misc.h" #include "cursor.h" #include "functions.h" #include "commands.h" #include "screen.h" #include "builtins.h" #include "module_interface.h" #include "borders.h" #include "frame.h" #include "events.h" #include "ewmh.h" #include "virtual.h" #include "decorations.h" #include "add_window.h" #include "update.h" #include "style.h" #include "move_resize.h" #include "menus.h" #include "infostore.h" #ifdef HAVE_STROKE #include "stroke.h" #endif /* HAVE_STROKE */ /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ extern float rgpctMovementDefault[32]; extern int cpctMovementDefault; extern int cmsDelayDefault; /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef enum {FakeMouseEvent, FakeKeyEvent} FakeEventType; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static char *exec_shell_name="/bin/sh"; /* button state strings must match the enumerated states */ static char *button_states[BS_MaxButtonStateName + 1] = { "ActiveUp", "ActiveDown", "InactiveUp", "InactiveDown", "ToggledActiveUp", "ToggledActiveDown", "ToggledInactiveUp", "ToggledInactiveDown", "Active", "Inactive", "ToggledActive", "ToggledInactive", "AllNormal", "AllToggled", "AllActive", "AllInactive", "AllUp", "AllDown", "AllActiveUp", "AllActiveDown", "AllInactiveUp", "AllInactiveDown", NULL }; /* ---------------------------- exported variables (globals) --------------- */ char *ModulePath = FVWM_MODULEDIR; int moduleTimeout = DEFAULT_MODULE_TIMEOUT; /* ---------------------------- local functions ---------------------------- */ /** Prepend rather than replace the image path. Used for obsolete PixmapPath and IconPath **/ static void obsolete_imagepaths( const char* pre_path ) { char* tmp = stripcpy( pre_path ); char* path = alloca(strlen( tmp ) + strlen(PictureGetImagePath()) + 2 ); strcpy( path, tmp ); free( tmp ); strcat( path, ":" ); strcat( path, PictureGetImagePath() ); PictureSetImagePath( path ); return; } /* * * Reads a title button description (veliaa@rpi.edu) * */ static char *ReadTitleButton( char *s, TitleButton *tb, Boolean append, int button) { char *end = NULL; char *spec; char *t; int i; int bs; int bs_start, bs_end; int pstyle = 0; DecorFace tmpdf; Bool multiple; int use_mask = 0; int set_mask = 0; s = SkipSpaces(s, NULL, 0); t = GetNextTokenIndex(s, button_states, 0, &bs); if (bs != BS_All) { s = SkipSpaces(t, NULL, 0); } if (bs == BS_All) { use_mask = 0; set_mask = 0; } else if (bs == BS_Active) { use_mask = BS_MASK_INACTIVE | BS_MASK_TOGGLED; set_mask = 0; } else if (bs == BS_Inactive) { use_mask = BS_MASK_INACTIVE | BS_MASK_TOGGLED; set_mask = BS_MASK_INACTIVE; } else if (bs == BS_ToggledActive) { use_mask = BS_MASK_INACTIVE | BS_MASK_TOGGLED; set_mask = BS_MASK_TOGGLED; } else if (bs == BS_ToggledInactive) { use_mask = BS_MASK_INACTIVE | BS_MASK_TOGGLED; set_mask = BS_MASK_INACTIVE | BS_MASK_TOGGLED; } else if (bs == BS_AllNormal) { use_mask = BS_MASK_TOGGLED; set_mask = 0; } else if (bs == BS_AllToggled) { use_mask = BS_MASK_TOGGLED; set_mask = BS_MASK_TOGGLED; } else if (bs == BS_AllActive) { use_mask = BS_MASK_INACTIVE; set_mask = 0; } else if (bs == BS_AllInactive) { use_mask = BS_MASK_INACTIVE; set_mask = BS_MASK_INACTIVE; } else if (bs == BS_AllUp) { use_mask = BS_MASK_DOWN; set_mask = 0; } else if (bs == BS_AllDown) { use_mask = BS_MASK_DOWN; set_mask = BS_MASK_DOWN; } else if (bs == BS_AllActiveUp) { use_mask = BS_MASK_INACTIVE | BS_MASK_DOWN; set_mask = 0; } else if (bs == BS_AllActiveDown) { use_mask = BS_MASK_INACTIVE | BS_MASK_DOWN; set_mask = BS_MASK_DOWN; } else if (bs == BS_AllInactiveUp) { use_mask = BS_MASK_INACTIVE | BS_MASK_DOWN; set_mask = BS_MASK_INACTIVE; } else if (bs == BS_AllInactiveDown) { use_mask = BS_MASK_INACTIVE | BS_MASK_DOWN; set_mask = BS_MASK_INACTIVE | BS_MASK_DOWN; } if ((bs & BS_MaxButtonStateMask) == bs) { multiple = False; bs_start = bs; bs_end = bs; } else { multiple = True; bs_start = 0; bs_end = BS_MaxButtonState - 1; for (i = bs_start; (i & use_mask) != set_mask && i <= bs_end; i++) { bs_start++; } } if (*s == '(') { int len; pstyle = 1; if (!(end = strchr(++s, ')'))) { fvwm_msg( ERR, "ReadTitleButton", "missing parenthesis: %s", s); return NULL; } s = SkipSpaces(s, NULL, 0); len = end - s + 1; spec = safemalloc(len); strncpy(spec, s, len - 1); spec[len - 1] = 0; } else { spec = s; } spec = SkipSpaces(spec, NULL, 0); /* setup temporary in case button read fails */ memset(&tmpdf, 0, sizeof(DecorFace)); DFS_FACE_TYPE(tmpdf.style) = SimpleButton; if (strncmp(spec, "--", 2) == 0) { /* only change flags */ Bool verbose = True; for (i = bs_start; i <= bs_end; ++i) { if (multiple && (i & use_mask) != set_mask) { continue; } ReadDecorFace(spec, &TB_STATE(*tb)[i], button, verbose); verbose = False; } } else if (ReadDecorFace(spec, &tmpdf, button, True)) { if (append) { DecorFace *head = &TB_STATE(*tb)[bs_start]; DecorFace *tail = head; DecorFace *next; while (tail->next) { tail = tail->next; } tail->next = (DecorFace *)safemalloc(sizeof(DecorFace)); memcpy(tail->next, &tmpdf, sizeof(DecorFace)); if (DFS_FACE_TYPE(tail->next->style) == VectorButton && DFS_FACE_TYPE((&TB_STATE(*tb)[bs_start])->style) == DefaultVectorButton) { /* override the default vector style */ memcpy( &tail->next->style, &head->style, sizeof(DecorFaceStyle)); DFS_FACE_TYPE(tail->next->style) = VectorButton; next = head->next; head->next = NULL; FreeDecorFace(dpy, head); memcpy(head, next, sizeof(DecorFace)); free(next); } for (i = bs_start + 1; i <= bs_end; ++i) { if (multiple && (i & use_mask) != set_mask) { continue; } head = &TB_STATE(*tb)[i]; tail = head; while (tail->next) { tail = tail->next; } tail->next = (DecorFace *)safemalloc( sizeof(DecorFace)); memset( &DFS_FLAGS(tail->next->style), 0, sizeof(DFS_FLAGS(tail->next->style))); DFS_FACE_TYPE(tail->next->style) = SimpleButton; tail->next->next = NULL; ReadDecorFace(spec, tail->next, button, False); if (DFS_FACE_TYPE(tail->next->style) == VectorButton && DFS_FACE_TYPE((&TB_STATE(*tb)[i])->style) == DefaultVectorButton) { /* override the default vector style */ memcpy( &tail->next->style, &head->style, sizeof(DecorFaceStyle)); DFS_FACE_TYPE(tail->next->style) = VectorButton; next = head->next; head->next = NULL; FreeDecorFace(dpy, head); memcpy(head, next, sizeof(DecorFace)); free(next); } } } else { FreeDecorFace(dpy, &TB_STATE(*tb)[bs_start]); memcpy( &(TB_STATE(*tb)[bs_start]), &tmpdf, sizeof(DecorFace)); for (i = bs_start + 1; i <= bs_end; ++i) { if (multiple && (i & use_mask) != set_mask) { continue; } ReadDecorFace( spec, &TB_STATE(*tb)[i], button, False); } } } if (pstyle) { free(spec); end++; end = SkipSpaces(end, NULL, 0); } return end; } /* Remove the given decor from all windows */ static void __remove_window_decors(F_CMD_ARGS, FvwmDecor *d) { const exec_context_t *exc2; exec_context_changes_t ecc; FvwmWindow *t; for (t = Scr.FvwmRoot.next; t; t = t->next) { if (t->decor == d) { /* remove the extra title height now because we delete * the current decor before calling ChangeDecor(). */ t->g.frame.height -= t->decor->title_height; t->decor = NULL; ecc.w.fw = t; ecc.w.wcontext = C_WINDOW; exc2 = exc_clone_context( exc, &ecc, ECC_FW | ECC_WCONTEXT); execute_function( cond_rc, exc2, "ChangeDecor Default", 0); exc_destroy_context(exc2); } } return; } static void do_title_style(F_CMD_ARGS, Bool do_add) { char *parm; char *prev; #ifdef USEDECOR FvwmDecor *decor = Scr.cur_decor ? Scr.cur_decor : &Scr.DefaultDecor; #else FvwmDecor *decor = &Scr.DefaultDecor; #endif Scr.flags.do_need_window_update = 1; decor->flags.has_changed = 1; decor->titlebar.flags.has_changed = 1; for (prev = action ; (parm = PeekToken(action, &action)); prev = action) { if (!do_add && StrEquals(parm,"centered")) { TB_JUSTIFICATION(decor->titlebar) = JUST_CENTER; } else if (!do_add && StrEquals(parm,"leftjustified")) { TB_JUSTIFICATION(decor->titlebar) = JUST_LEFT; } else if (!do_add && StrEquals(parm,"rightjustified")) { TB_JUSTIFICATION(decor->titlebar) = JUST_RIGHT; } else if (!do_add && StrEquals(parm,"height")) { int height = 0; int next = 0; if (!action || sscanf(action, "%d%n", &height, &next) <= 0 || height < MIN_FONT_HEIGHT || height > MAX_FONT_HEIGHT) { if (height != 0) { fvwm_msg(ERR, "do_title_style", "bad height argument (height" " must be from 5 to 256)"); height = 0; } } if (decor->title_height != height || decor->min_title_height != 0) { decor->title_height = height; decor->min_title_height = 0; decor->flags.has_title_height_changed = 1; } if (action) action += next; } else if (!do_add && StrEquals(parm,"MinHeight")) { int height = 0; int next = 0; if (!action || sscanf(action, "%d%n", &height, &next) <= 0 || height < MIN_FONT_HEIGHT || height > MAX_FONT_HEIGHT) { if (height < MIN_FONT_HEIGHT) height = MIN_FONT_HEIGHT; else if (height > MAX_FONT_HEIGHT) height = 0; } if (decor->min_title_height != height) { decor->title_height = 0; decor->min_title_height = height; decor->flags.has_title_height_changed = 1; } if (action) action += next; } else { action = ReadTitleButton( prev, &decor->titlebar, do_add, -1); } } return; } /* * * Reads a multi-pixmap titlebar config. (tril@igs.net) * */ static char *ReadMultiPixmapDecor(char *s, DecorFace *df) { static char *pm_names[TBMP_NUM_PIXMAPS+1] = { "Main", "LeftMain", "RightMain", "LeftButtons", "RightButtons", "UnderText", "LeftOfText", "RightOfText", "LeftEnd", "RightEnd", "Buttons", NULL }; FvwmPicture **pm; FvwmAcs *acs; Pixel *pixels; char *token; Bool stretched; Bool load_pixmap = False; int pm_id, i = 0; FvwmPictureAttributes fpa; df->style.face_type = MultiPixmap; df->u.mp.pixmaps = pm = (FvwmPicture**)safecalloc( TBMP_NUM_PIXMAPS, sizeof(FvwmPicture*)); df->u.mp.acs = acs = (FvwmAcs *)safemalloc(TBMP_NUM_PIXMAPS * sizeof(FvwmAcs)); df->u.mp.pixels = pixels = (Pixel *)safemalloc(TBMP_NUM_PIXMAPS * sizeof(Pixel)); for(i=0; i < TBMP_NUM_PIXMAPS; i++) { acs[i].cs = -1; acs[i].alpha_percent = 100; } s = GetNextTokenIndex(s, pm_names, 0, &pm_id); while (pm_id >= 0) { stretched = False; load_pixmap = False; s = DoPeekToken(s, &token, ",()", NULL, NULL); if (StrEquals(token, "stretched")) { stretched = True; s = DoPeekToken(s, &token, ",", NULL, NULL); } else if (StrEquals(token, "tiled")) { s = DoPeekToken(s, &token, ",", NULL, NULL); } if (!token) { break; } if (pm[pm_id] || acs[pm_id].cs >= 0 || (df->u.mp.solid_flags & (1 << pm_id))) { fvwm_msg(WARN, "ReadMultiPixmapDecor", "Ignoring: already-specified %s", pm_names[i]); continue; } if (stretched) { df->u.mp.stretch_flags |= (1 << pm_id); } if (strncasecmp (token, "Colorset", 8) == 0) { int val; char *tmp; tmp = DoPeekToken(s, &token, ",", NULL, NULL); if (!GetIntegerArguments(token, NULL, &val, 1) || val < 0) { fvwm_msg( ERR, "ReadMultiPixmapDecor", "Colorset shoule take one or two " "positive integers as argument"); } else { acs[pm_id].cs = val; alloc_colorset(val); s = tmp; tmp = DoPeekToken(s, &token, ",", NULL, NULL); if (GetIntegerArguments(token, NULL, &val, 1)) { acs[pm_id].alpha_percent = max(0, min(100,val)); s = tmp; } } } else if (strncasecmp(token, "TiledPixmap", 11) == 0) { s = DoPeekToken(s, &token, ",", NULL, NULL); load_pixmap = True; } else if (strncasecmp(token, "AdjustedPixmap", 14) == 0) { s = DoPeekToken(s, &token, ",", NULL, NULL); load_pixmap = True; df->u.mp.stretch_flags |= (1 << pm_id); } else if (strncasecmp(token, "Solid", 5) == 0) { s = DoPeekToken(s, &token, ",", NULL, NULL); if (token) { df->u.mp.pixels[pm_id] = GetColor(token); df->u.mp.solid_flags |= (1 << pm_id); } } else { load_pixmap = True; } if (load_pixmap && token) { fpa.mask = (Pdepth <= 8)? FPAM_DITHER:0; /* ? */ pm[pm_id] = PCacheFvwmPicture( dpy, Scr.NoFocusWin, NULL, token, fpa); if (!pm[pm_id]) { fvwm_msg(ERR, "ReadMultiPixmapDecor", "Pixmap '%s' could not be loaded", token); } } if (pm_id == TBMP_BUTTONS) { if (pm[TBMP_LEFT_BUTTONS]) { PDestroyFvwmPicture(dpy, pm[TBMP_LEFT_BUTTONS]); } if (pm[TBMP_RIGHT_BUTTONS]) { PDestroyFvwmPicture(dpy, pm[TBMP_RIGHT_BUTTONS]); } df->u.mp.stretch_flags &= ~(1 << TBMP_LEFT_BUTTONS); df->u.mp.stretch_flags &= ~(1 << TBMP_RIGHT_BUTTONS); df->u.mp.solid_flags &= ~(1 << TBMP_LEFT_BUTTONS); df->u.mp.solid_flags &= ~(1 << TBMP_RIGHT_BUTTONS); if (pm[TBMP_BUTTONS]) { pm[TBMP_LEFT_BUTTONS] = PCloneFvwmPicture(pm[TBMP_BUTTONS]); acs[TBMP_LEFT_BUTTONS].cs = -1; pm[TBMP_RIGHT_BUTTONS] = PCloneFvwmPicture(pm[TBMP_BUTTONS]); acs[TBMP_RIGHT_BUTTONS].cs = -1; } else { pm[TBMP_RIGHT_BUTTONS] = pm[TBMP_LEFT_BUTTONS] = NULL; acs[TBMP_RIGHT_BUTTONS].cs = acs[TBMP_LEFT_BUTTONS].cs = acs[TBMP_BUTTONS].cs; acs[TBMP_RIGHT_BUTTONS].alpha_percent = acs[TBMP_LEFT_BUTTONS].alpha_percent = acs[TBMP_BUTTONS].alpha_percent; pixels[TBMP_LEFT_BUTTONS] = pixels[TBMP_RIGHT_BUTTONS] = pixels[TBMP_BUTTONS]; } if (stretched) { df->u.mp.stretch_flags |= (1 << TBMP_LEFT_BUTTONS) | (1 << TBMP_RIGHT_BUTTONS); } if (df->u.mp.solid_flags & (1 << TBMP_BUTTONS)) { df->u.mp.solid_flags |= (1 << TBMP_LEFT_BUTTONS); df->u.mp.solid_flags |= (1 << TBMP_RIGHT_BUTTONS); } if (pm[TBMP_BUTTONS]) { PDestroyFvwmPicture(dpy, pm[TBMP_BUTTONS]); pm[TBMP_BUTTONS] = NULL; } acs[TBMP_BUTTONS].cs = -1; df->u.mp.solid_flags &= ~(1 << TBMP_BUTTONS); } s = SkipSpaces(s, NULL, 0); s = GetNextTokenIndex(s, pm_names, 0, &pm_id); } if (!(pm[TBMP_MAIN] || acs[TBMP_MAIN].cs >= 0 || (df->u.mp.solid_flags & TBMP_MAIN)) && !(pm[TBMP_LEFT_MAIN] || acs[TBMP_LEFT_MAIN].cs >= 0 || (df->u.mp.solid_flags & TBMP_LEFT_MAIN)) && !(pm[TBMP_RIGHT_MAIN] || acs[TBMP_RIGHT_MAIN].cs >= 0 || (df->u.mp.solid_flags & TBMP_RIGHT_MAIN))) { fvwm_msg(ERR, "ReadMultiPixmapDecor", "No Main pixmap/colorset/solid found for TitleStyle " "MultiPixmap (you must specify either Main, " "or both LeftMain and RightMain)"); for (i=0; i < TBMP_NUM_PIXMAPS; i++) { if (pm[i]) { PDestroyFvwmPicture(dpy, pm[i]); } else if (!!(df->u.mp.solid_flags & i)) { PictureFreeColors( dpy, Pcmap, &df->u.mp.pixels[i], 1, 0, False); } } free(pm); free(acs); free(pixels); return NULL; } return s; } /* * * DestroyFvwmDecor -- frees all memory assocated with an FvwmDecor * structure, but does not free the FvwmDecor itself * */ static void DestroyFvwmDecor(FvwmDecor *decor) { int i; /* reset to default button set (frees allocated mem) */ DestroyAllButtons(decor); for (i = 0; i < BS_MaxButtonState; ++i) { FreeDecorFace(dpy, &TB_STATE(decor->titlebar)[i]); } FreeDecorFace(dpy, &decor->BorderStyle.active); FreeDecorFace(dpy, &decor->BorderStyle.inactive); #ifdef USEDECOR if (decor->tag) { free(decor->tag); decor->tag = NULL; } #endif return; } static void SetLayerButtonFlag( int layer, int multi, int set, FvwmDecor *decor, TitleButton *tb) { int i; int start = 0; int add = 2; if (multi) { if (multi == 2) { start = 1; } else if (multi == 3) { add = 1; } for (i = start; i < NUMBER_OF_TITLE_BUTTONS; i += add) { if (set) { TB_FLAGS(decor->buttons[i]).has_layer = 1; TB_LAYER(decor->buttons[i]) = layer; } else { TB_FLAGS(decor->buttons[i]).has_layer = 0; } } } else { if (set) { TB_FLAGS(*tb).has_layer = 1; TB_LAYER(*tb) = layer; } else { TB_FLAGS(*tb).has_layer = 0; } } return; } /* * * Changes a button decoration style (changes by veliaa@rpi.edu) * */ static void SetMWMButtonFlag( mwm_flags flag, int multi, int set, FvwmDecor *decor, TitleButton *tb) { int i; int start = 0; int add = 2; if (multi) { if (multi == 2) { start = 1; } else if (multi == 3) { add = 1; } for (i = start; i < NUMBER_OF_TITLE_BUTTONS; i += add) { if (set) { TB_MWM_DECOR_FLAGS(decor->buttons[i]) |= flag; } else { TB_MWM_DECOR_FLAGS(decor->buttons[i]) &= ~flag; } } } else { if (set) { TB_MWM_DECOR_FLAGS(*tb) |= flag; } else { TB_MWM_DECOR_FLAGS(*tb) &= ~flag; } } return; } static void do_button_style(F_CMD_ARGS, Bool do_add) { int i; int multi = 0; int button = 0; int do_return; char *text = NULL; char *prev = NULL; char *parm = NULL; TitleButton *tb = NULL; #ifdef USEDECOR FvwmDecor *decor = Scr.cur_decor ? Scr.cur_decor : &Scr.DefaultDecor; #else FvwmDecor *decor = &Scr.DefaultDecor; #endif parm = PeekToken(action, &text); if (parm && isdigit(*parm)) { button = atoi(parm); button = BUTTON_INDEX(button); } if (parm == NULL || button >= NUMBER_OF_TITLE_BUTTONS || button < 0) { fvwm_msg( ERR, "ButtonStyle", "Bad button style (1) in line %s", action); return; } Scr.flags.do_need_window_update = 1; do_return = 0; if (!isdigit(*parm)) { if (StrEquals(parm,"left")) { multi = 1; /* affect all left buttons */ } else if (StrEquals(parm,"right")) { multi = 2; /* affect all right buttons */ } else if (StrEquals(parm,"all")) { multi = 3; /* affect all buttons */ } else { /* we're either resetting buttons or an invalid button * set was specified */ if (StrEquals(parm,"reset")) { ResetAllButtons(decor); } else { fvwm_msg( ERR, "ButtonStyle", "Bad button style (2) in line %s", action); } multi = 3; do_return = 1; } } /* mark button style and decor as changed */ decor->flags.has_changed = 1; if (multi == 0) { /* a single button was specified */ tb = &decor->buttons[button]; TB_FLAGS(*tb).has_changed = 1; } else { for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; ++i) { if (((multi & 1) && !(i & 1)) || ((multi & 2) && (i & 1))) { TB_FLAGS(decor->buttons[i]).has_changed = 1; } } } if (do_return == 1) { return; } for (prev = text; (parm = PeekToken(text, &text)); prev = text) { if (!do_add && strcmp(parm,"-") == 0) { char *tok; text = GetNextToken(text, &tok); while (tok) { int set = 1; char *old_tok = NULL; if (*tok == '!') { /* flag negate */ set = 0; old_tok = tok; tok++; } if (StrEquals(tok,"Clear")) { if (multi) { for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; ++i) { if (((multi & 1) && !(i & 1)) || ((multi & 2) && (i & 1))) { TB_JUSTIFICATION(decor->buttons[i]) = (set) ? JUST_CENTER : JUST_RIGHT; memset(&TB_FLAGS(decor->buttons[i]), (set) ? 0 : 0xff, sizeof(TB_FLAGS(decor->buttons[i]))); /* ? not very useful if set == 0 ? */ } } } else { TB_JUSTIFICATION(*tb) = (set) ? JUST_CENTER : JUST_RIGHT; memset(&TB_FLAGS(*tb), (set) ? 0 : 0xff, sizeof(TB_FLAGS(*tb))); /* ? not very useful if * set == 0 ? */ } } else if (StrEquals(tok, "MWMDecorMenu")) { SetMWMButtonFlag( MWM_DECOR_MENU, multi, set, decor, tb); } else if (StrEquals(tok, "MWMDecorMin")) { SetMWMButtonFlag( MWM_DECOR_MINIMIZE, multi, set, decor, tb); } else if (StrEquals(tok, "MWMDecorMax")) { SetMWMButtonFlag( MWM_DECOR_MAXIMIZE, multi, set, decor, tb); } else if (StrEquals(tok, "MWMDecorShade")) { SetMWMButtonFlag( MWM_DECOR_SHADE, multi, set, decor, tb); } else if (StrEquals(tok, "MWMDecorStick")) { SetMWMButtonFlag( MWM_DECOR_STICK, multi, set, decor, tb); } else if (StrEquals(tok, "MwmDecorLayer")) { int layer, got_number; char *ltok; text = GetNextToken(text, <ok); if (ltok) { got_number = (sscanf(ltok, "%d", &layer) == 1); free (ltok); } else { got_number = 0; } if (!ltok || !got_number) { fvwm_msg(ERR, "ButtonStyle", "could not read" " integer value for" " layer -- line: %s", text); } else { SetLayerButtonFlag( layer, multi, set, decor, tb); } } else { fvwm_msg(ERR, "ButtonStyle", "unknown title button flag" " %s -- line: %s", tok, text); } if (set) { free(tok); } else { free(old_tok); } text = GetNextToken(text, &tok); } break; } else { if (multi) { for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; ++i) { if (((multi & 1) && !(i & 1)) || ((multi & 2) && (i & 1))) { text = ReadTitleButton( prev, &decor->buttons[i], do_add, i); } } } else if (!(text = ReadTitleButton( prev, tb, do_add, button))) { break; } } } return; } static int update_decorface_colorset(DecorFace *df, int cset) { DecorFace *tdf; int has_changed = 0; for(tdf = df; tdf != NULL; tdf = tdf->next) { if (DFS_FACE_TYPE(tdf->style) == ColorsetButton && tdf->u.acs.cs == cset) { tdf->flags.has_changed = 1; has_changed = 1; } else if (DFS_FACE_TYPE(tdf->style) == MultiPixmap) { int i; for (i = 0; i < TBMP_NUM_PIXMAPS; i++) { if (tdf->u.mp.acs[i].cs == cset) { tdf->flags.has_changed = 1; has_changed = 1; } } } } return has_changed; } static int update_titlebutton_colorset(TitleButton *tb, int cset) { int i; int has_changed = 0; for(i = 0; i < BS_MaxButtonState; i++) { tb->state[i].flags.has_changed = update_decorface_colorset(&(tb->state[i]), cset); has_changed |= tb->state[i].flags.has_changed; } return has_changed; } static void update_decors_colorset(int cset) { int i; FvwmDecor *decor = &Scr.DefaultDecor; #ifdef USEDECOR for(decor = &Scr.DefaultDecor; decor != NULL; decor = decor->next) #endif { for(i = 0; i < NUMBER_OF_TITLE_BUTTONS; i++) { decor->flags.has_changed |= update_titlebutton_colorset( &(decor->buttons[i]), cset); } decor->flags.has_changed |= update_titlebutton_colorset( &(decor->titlebar), cset); decor->flags.has_changed |= update_decorface_colorset( &(decor->BorderStyle.active), cset); decor->flags.has_changed |= update_decorface_colorset( &(decor->BorderStyle.inactive), cset); if (decor->flags.has_changed) { Scr.flags.do_need_window_update = 1; } } } static Bool __parse_vector_line_one_coord( char **ret_action, int *pcoord, int *poff, char *action) { int offset; int n; *ret_action = action; n = sscanf(action, "%d%n", pcoord, &offset); if (n < 1) { return False; } action += offset; /* check for offest */ if (*action == '+' || *action == '-') { n = sscanf(action, "%dp%n", poff, &offset); if (n < 1) { return False; } if (*poff < -128) { *poff = -128; } else if (*poff > 127) { *poff = 127; } action += offset; } else { *poff = 0; } *ret_action = action; return True; } static Bool __parse_vector_line( char **ret_action, int *px, int *py, int *pxoff, int *pyoff, int *pc, char *action) { Bool is_valid = True; int offset; int n; *ret_action = action; if (__parse_vector_line_one_coord(&action, px, pxoff, action) == False) { return False; } if (*action != 'x') { return False; } action++; if (__parse_vector_line_one_coord(&action, py, pyoff, action) == False) { return False; } if (*action != '@') { return False; } action++; /* read the line style */ n = sscanf(action, "%d%n", pc, &offset); if (n < 1) { return False; } action += offset; *ret_action = action; return is_valid; } /* ---------------------------- interface functions ------------------------ */ void refresh_window(Window w, Bool window_update) { XSetWindowAttributes attributes; unsigned long valuemask; valuemask = CWOverrideRedirect | CWBackingStore | CWSaveUnder | CWBackPixmap; attributes.override_redirect = True; attributes.save_under = False; attributes.background_pixmap = None; attributes.backing_store = NotUseful; w = XCreateWindow( dpy, w, 0, 0, Scr.MyDisplayWidth, Scr.MyDisplayHeight, 0, CopyFromParent, CopyFromParent, CopyFromParent, valuemask, &attributes); XMapWindow(dpy, w); if (Scr.flags.do_need_window_update && window_update) { flush_window_updates(); } XDestroyWindow(dpy, w); XSync(dpy, 0); handle_all_expose(); return; } void ApplyDefaultFontAndColors(void) { XGCValues gcv; unsigned long gcm; int cset = Scr.DefaultColorset; /* make GC's */ gcm = GCFunction|GCLineWidth|GCForeground|GCBackground; gcv.function = GXcopy; if (Scr.DefaultFont->font) { gcm |= GCFont; gcv.font = Scr.DefaultFont->font->fid; } gcv.line_width = 0; if (cset >= 0) { gcv.foreground = Colorset[cset].fg; gcv.background = Colorset[cset].bg; } else { gcv.foreground = Scr.StdFore; gcv.background = Scr.StdBack; } if (Scr.StdGC) { XChangeGC(dpy, Scr.StdGC, gcm, &gcv); } else { Scr.StdGC = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv); } gcm = GCFunction|GCLineWidth|GCForeground; if (cset >= 0) { gcv.foreground = Colorset[cset].hilite; } else { gcv.foreground = Scr.StdHilite; } if (Scr.StdReliefGC) { XChangeGC(dpy, Scr.StdReliefGC, gcm, &gcv); } else { Scr.StdReliefGC = fvwmlib_XCreateGC( dpy, Scr.NoFocusWin, gcm, &gcv); } if (cset >= 0) { gcv.foreground = Colorset[cset].shadow; } else { gcv.foreground = Scr.StdShadow; } if (Scr.StdShadowGC) { XChangeGC(dpy, Scr.StdShadowGC, gcm, &gcv); } else { Scr.StdShadowGC = fvwmlib_XCreateGC( dpy, Scr.NoFocusWin, gcm, &gcv); } /* update the geometry window for move/resize */ if (Scr.SizeWindow != None) { resize_geometry_window(); } UpdateAllMenuStyles(); return; } void FreeDecorFace(Display *dpy, DecorFace *df) { int i; switch (DFS_FACE_TYPE(df->style)) { case GradientButton: if (df->u.grad.d_pixels != NULL && df->u.grad.d_npixels) { PictureFreeColors( dpy, Pcmap, df->u.grad.d_pixels, df->u.grad.d_npixels, 0, False); free(df->u.grad.d_pixels); } else if (Pdepth <= 8 && df->u.grad.xcs != NULL && df->u.grad.npixels > 0 && !df->u.grad.do_dither) { Pixel *p; int i; p = (Pixel *)safemalloc( df->u.grad.npixels * sizeof(Pixel)); for(i=0; i < df->u.grad.npixels; i++) { p[i] = df->u.grad.xcs[i].pixel; } PictureFreeColors( dpy, Pcmap, p, df->u.grad.npixels, 0, False); free(p); } if (df->u.grad.xcs != NULL) { free(df->u.grad.xcs); } break; case PixmapButton: case TiledPixmapButton: case StretchedPixmapButton: case AdjustedPixmapButton: case ShrunkPixmapButton: if (df->u.p) { PDestroyFvwmPicture(dpy, df->u.p); } break; case MultiPixmap: if (df->u.mp.pixmaps) { for (i = 0; i < TBMP_NUM_PIXMAPS; i++) { if (df->u.mp.pixmaps[i]) { PDestroyFvwmPicture( dpy, df->u.mp.pixmaps[i]); } else if (!!(df->u.mp.solid_flags & i)) { PictureFreeColors( dpy, Pcmap, &df->u.mp.pixels[i], 1, 0, False); } } free(df->u.mp.pixmaps); } if (df->u.mp.acs) { free(df->u.mp.acs); } if (df->u.mp.pixels) { free(df->u.mp.pixels); } break; case VectorButton: case DefaultVectorButton: if (df->u.vector.x) { free (df->u.vector.x); } if (df->u.vector.y) { free (df->u.vector.y); } /* free offsets for coord */ if (df->u.vector.xoff) { free(df->u.vector.xoff); } if (df->u.vector.yoff) { free(df->u.vector.yoff); } if (df->u.vector.c) { free (df->u.vector.c); } break; default: /* see below */ break; } /* delete any compound styles */ if (df->next) { FreeDecorFace(dpy, df->next); free(df->next); } df->next = NULL; memset(&df->style, 0, sizeof(df->style)); memset(&df->u, 0, sizeof(df->u)); DFS_FACE_TYPE(df->style) = SimpleButton; return; } /* * * Reads a button face line into a structure (veliaa@rpi.edu) * */ Bool ReadDecorFace(char *s, DecorFace *df, int button, int verbose) { int offset; char style[256], *file; char *action = s; /* some variants of scanf do not increase the assign count when %n is * used, so a return value of 1 is no error. */ if (sscanf(s, "%255s%n", style, &offset) < 1) { if (verbose) { fvwm_msg(ERR, "ReadDecorFace", "error in face `%s'", s); } return False; } style[255] = 0; if (strncasecmp(style, "--", 2) != 0) { s += offset; FreeDecorFace(dpy, df); /* determine button style */ if (strncasecmp(style,"Simple",6)==0) { memset(&df->style, 0, sizeof(df->style)); DFS_FACE_TYPE(df->style) = SimpleButton; } else if (strncasecmp(style,"Default",7)==0) { int b = -1, n = sscanf(s, "%d%n", &b, &offset); if (n < 1) { if (button == -1) { if (verbose) { fvwm_msg( ERR,"ReadDecorFace", "need default button" " number to load"); } return False; } b = button; } else { b = BUTTON_INDEX(b); s += offset; } if (b >= 0 && b < NUMBER_OF_TITLE_BUTTONS) { LoadDefaultButton(df, b); } else { if (verbose) { fvwm_msg( ERR, "ReadDecorFace", "button number out of range:" " %d", b); } return False; } } else if (strncasecmp(style,"Vector",6)==0 || (strlen(style)<=2 && isdigit(*style))) { /* normal coordinate list button style */ int i, num_coords, num; struct vector_coords *vc = &df->u.vector; /* get number of points */ if (strncasecmp(style,"Vector",6)==0) { num = sscanf(s,"%d%n",&num_coords,&offset); s += offset; } else { num = sscanf(style,"%d",&num_coords); } if (num < 1 || num_coords<2 || num_coords > MAX_TITLE_BUTTON_VECTOR_LINES) { if (verbose) { fvwm_msg( ERR, "ReadDecorFace", "Bad button style (2) in line:" " %s",action); } return False; } vc->num = num_coords; vc->use_fgbg = 0; vc->x = (signed char*)safemalloc(sizeof(char) * num_coords); vc->y = (signed char*)safemalloc(sizeof(char) * num_coords); vc->xoff = (signed char*)safemalloc(sizeof(char) * num_coords); vc->yoff = (signed char*)safemalloc(sizeof(char) * num_coords); vc->c = (signed char*)safemalloc(sizeof(char) * num_coords); /* get the points */ for (i = 0; i < vc->num; ++i) { int x; int y; int xoff = 0; int yoff = 0; int c; if (__parse_vector_line( &s, &x, &y, &xoff, &yoff, &c, s) == False) { break; } if (x < 0) { x = 0; } if (x > 100) { x = 100; } if (y < 0) { y = 0; } if (y > 100) { y = 100; } if (c < 0 || c > 4) { c = 4; } vc->x[i] = x; vc->y[i] = y; vc->c[i] = c; vc->xoff[i] = xoff; vc->yoff[i] = yoff; if (c == 2 || c == 3) { vc->use_fgbg = 1; } } if (i < vc->num) { if (verbose) { fvwm_msg( ERR, "ReadDecorFace", "Bad button style (3) in line" " %s", action); } free(vc->x); free(vc->y); free(vc->c); free(vc->xoff); free(vc->yoff); vc->x = NULL; vc->y = NULL; vc->c = NULL; vc->xoff = NULL; vc->yoff = NULL; return False; } memset(&df->style, 0, sizeof(df->style)); DFS_FACE_TYPE(df->style) = VectorButton; } else if (strncasecmp(style,"Solid",5)==0) { s = GetNextToken(s, &file); if (file) { memset(&df->style, 0, sizeof(df->style)); DFS_FACE_TYPE(df->style) = SolidButton; df->u.back = GetColor(file); free(file); } else { if (verbose) { fvwm_msg( ERR, "ReadDecorFace", "no color given for Solid" " face type: %s", action); } return False; } } else if (strncasecmp(style+1, "Gradient", 8)==0) { char **s_colors; int npixels, nsegs, *perc; XColor *xcs; Bool do_dither = False; if (!IsGradientTypeSupported(style[0])) { return False; } /* translate the gradient string into an array of * colors etc */ npixels = ParseGradient( s, &s, &s_colors, &perc, &nsegs); while (*s && isspace(*s)) { s++; } if (npixels <= 0) { return False; } /* grab the colors */ if (Pdepth <= 16) { do_dither = True; } xcs = AllocAllGradientColors( s_colors, perc, nsegs, npixels, do_dither); if (xcs == None) return False; df->u.grad.xcs = xcs; df->u.grad.npixels = npixels; df->u.grad.do_dither = do_dither; df->u.grad.d_pixels = NULL; memset(&df->style, 0, sizeof(df->style)); DFS_FACE_TYPE(df->style) = GradientButton; df->u.grad.gradient_type = toupper(style[0]); } else if (strncasecmp(style,"Pixmap",6)==0 || strncasecmp(style,"TiledPixmap",11)==0 || strncasecmp(style,"StretchedPixmap",15)==0 || strncasecmp(style,"AdjustedPixmap",14)==0 || strncasecmp(style,"ShrunkPixmap",12)==0) { FvwmPictureAttributes fpa; s = GetNextToken(s, &file); fpa.mask = (Pdepth <= 8)? FPAM_DITHER:0; /* ? */ df->u.p = PCacheFvwmPicture( dpy, Scr.NoFocusWin, NULL, file, fpa); if (df->u.p == NULL) { if (file) { if (verbose) { fvwm_msg( ERR, "ReadDecorFace", "couldn't load pixmap" " %s", file); } free(file); } return False; } if (file) { free(file); file = NULL; } memset(&df->style, 0, sizeof(df->style)); if (strncasecmp(style,"Tiled",5)==0) { DFS_FACE_TYPE(df->style) = TiledPixmapButton; } else if (strncasecmp(style,"Stretched",9)==0) { DFS_FACE_TYPE(df->style) = StretchedPixmapButton; } else if (strncasecmp(style,"Adjusted",8)==0) { DFS_FACE_TYPE(df->style) = AdjustedPixmapButton; } else if (strncasecmp(style,"Shrunk",6)==0) { DFS_FACE_TYPE(df->style) = ShrunkPixmapButton; } else { DFS_FACE_TYPE(df->style) = PixmapButton; } } else if (strncasecmp(style,"MultiPixmap",11)==0) { if (button != -1) { if (verbose) { fvwm_msg( ERR, "ReadDecorFace", "MultiPixmap is only valid" " for TitleStyle"); } return False; } s = ReadMultiPixmapDecor(s, df); if (!s) { return False; } } else if (FMiniIconsSupported && strncasecmp (style, "MiniIcon", 8) == 0) { memset(&df->style, 0, sizeof(df->style)); DFS_FACE_TYPE(df->style) = MiniIconButton; /* pixmap read in when the window is created */ df->u.p = NULL; } else if (strncasecmp (style, "Colorset", 8) == 0) { int val[2]; int n; n = GetIntegerArguments(s, NULL, val, 2); if (n == 0) { } memset(&df->style, 0, sizeof(df->style)); if (n > 0 && val[0] >= 0) { df->u.acs.cs = val[0]; alloc_colorset(val[0]); DFS_FACE_TYPE(df->style) = ColorsetButton; } df->u.acs.alpha_percent = 100; if (n > 1) { df->u.acs.alpha_percent = max(0, min(100,val[1])); } s = SkipNTokens(s, n); } else { if (verbose) { fvwm_msg( ERR, "ReadDecorFace", "unknown style %s: %s", style, action); } return False; } } /* Process button flags ("--" signals start of flags, it is also checked for above) */ s = GetNextToken(s, &file); if (file && (strcmp(file,"--")==0)) { char *tok; s = GetNextToken(s, &tok); while (tok && *tok) { int set = 1; char *old_tok = NULL; if (*tok == '!') { /* flag negate */ set = 0; old_tok = tok; tok++; } if (StrEquals(tok,"Clear")) { memset(&DFS_FLAGS(df->style), (set) ? 0 : 0xff, sizeof(DFS_FLAGS(df->style))); /* ? what is set == 0 good for ? */ } else if (StrEquals(tok,"Left")) { if (set) { DFS_H_JUSTIFICATION(df->style) = JUST_LEFT; } else { DFS_H_JUSTIFICATION(df->style) = JUST_RIGHT; } } else if (StrEquals(tok,"Right")) { if (set) { DFS_H_JUSTIFICATION(df->style) = JUST_RIGHT; } else { DFS_H_JUSTIFICATION(df->style) = JUST_LEFT; } } else if (StrEquals(tok,"Centered")) { DFS_H_JUSTIFICATION(df->style) = JUST_CENTER; DFS_V_JUSTIFICATION(df->style) = JUST_CENTER; } else if (StrEquals(tok,"Top")) { if (set) { DFS_V_JUSTIFICATION(df->style) = JUST_TOP; } else { DFS_V_JUSTIFICATION(df->style) = JUST_BOTTOM; } } else if (StrEquals(tok,"Bottom")) { if (set) { DFS_V_JUSTIFICATION(df->style) = JUST_BOTTOM; } else { DFS_V_JUSTIFICATION(df->style) = JUST_TOP; } } else if (StrEquals(tok,"Flat")) { if (set) { DFS_BUTTON_RELIEF(df->style) = DFS_BUTTON_IS_FLAT; } else if (DFS_BUTTON_RELIEF(df->style) == DFS_BUTTON_IS_FLAT) { DFS_BUTTON_RELIEF(df->style) = DFS_BUTTON_IS_UP; } } else if (StrEquals(tok,"Sunk")) { if (set) { DFS_BUTTON_RELIEF(df->style) = DFS_BUTTON_IS_SUNK; } else if (DFS_BUTTON_RELIEF(df->style) == DFS_BUTTON_IS_SUNK) { DFS_BUTTON_RELIEF(df->style) = DFS_BUTTON_IS_UP; } } else if (StrEquals(tok,"Raised")) { if (set) { DFS_BUTTON_RELIEF(df->style) = DFS_BUTTON_IS_UP; } else { DFS_BUTTON_RELIEF(df->style) = DFS_BUTTON_IS_SUNK; } } else if (StrEquals(tok,"UseTitleStyle")) { if (set) { DFS_USE_TITLE_STYLE(df->style) = 1; DFS_USE_BORDER_STYLE(df->style) = 0; } else DFS_USE_TITLE_STYLE(df->style) = 0; } else if (StrEquals(tok,"HiddenHandles")) { DFS_HAS_HIDDEN_HANDLES(df->style) = !!set; } else if (StrEquals(tok,"NoInset")) { DFS_HAS_NO_INSET(df->style) = !!set; } else if (StrEquals(tok,"UseBorderStyle")) { if (set) { DFS_USE_BORDER_STYLE(df->style) = 1; DFS_USE_TITLE_STYLE(df->style) = 0; } else { DFS_USE_BORDER_STYLE(df->style) = 0; } } else if (verbose) { fvwm_msg( ERR, "ReadDecorFace", "unknown button face flag '%s'" " -- line: %s", tok, action); } if (set) { free(tok); } else { free(old_tok); } s = GetNextToken(s, &tok); } } if (file) { free(file); } return True; } #ifdef USEDECOR /* * * Diverts a style definition to an FvwmDecor structure (veliaa@rpi.edu) * */ void AddToDecor(F_CMD_ARGS, FvwmDecor *decor) { if (!action) { return; } while (*action && isspace((unsigned char)*action)) { ++action; } if (!*action) { return; } Scr.cur_decor = decor; execute_function(cond_rc, exc, action, 0); Scr.cur_decor = NULL; return; } /* * * InitFvwmDecor -- initializes an FvwmDecor structure to defaults * */ void InitFvwmDecor(FvwmDecor *decor) { int i; DecorFace tmpdf; /* zero out the structures */ memset(decor, 0, sizeof (FvwmDecor)); memset(&tmpdf, 0, sizeof(DecorFace)); /* initialize title-bar button styles */ DFS_FACE_TYPE(tmpdf.style) = SimpleButton; for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; ++i) { int j = 0; for (; j < BS_MaxButtonState; ++j) { TB_STATE(decor->buttons[i])[j] = tmpdf; } } /* reset to default button set */ ResetAllButtons(decor); /* initialize title-bar styles */ for (i = 0; i < BS_MaxButtonState; ++i) { DFS_FACE_TYPE( TB_STATE(decor->titlebar)[i].style) = SimpleButton; } /* initialize border texture styles */ DFS_FACE_TYPE(decor->BorderStyle.active.style) = SimpleButton; DFS_FACE_TYPE(decor->BorderStyle.inactive.style) = SimpleButton; return; } void reset_decor_changes(void) { #ifndef USEDECOR Scr.DefaultDecor.flags.has_changed = 0; Scr.DefaultDecor.flags.has_title_height_changed = 0; #else FvwmDecor *decor; for (decor = &Scr.DefaultDecor; decor; decor = decor->next) { decor->flags.has_changed = 0; decor->flags.has_title_height_changed = 0; } /* todo: must reset individual change flags too */ #endif return; } void update_fvwm_colorset(int cset) { if (cset == Scr.DefaultColorset) { Scr.flags.do_need_window_update = 1; Scr.flags.has_default_color_changed = 1; } UpdateMenuColorset(cset); update_style_colorset(cset); update_decors_colorset(cset); return; } /* ---------------------------- builtin commands --------------------------- */ void CMD_Beep(F_CMD_ARGS) { #if 1 /*!!!*/ parse_colorset(11, "RootTransparent"); #endif XBell(dpy, 0); return; } void CMD_Nop(F_CMD_ARGS) { return; } void CMD_EscapeFunc(F_CMD_ARGS) { return; } void CMD_CursorMove(F_CMD_ARGS) { int x = 0, y = 0; int val1, val2, val1_unit, val2_unit; int x_unit, y_unit; int virtual_x, virtual_y; int x_pages, y_pages; if (GetTwoArguments(action, &val1, &val2, &val1_unit, &val2_unit) != 2) { fvwm_msg(ERR, "movecursor", "CursorMove needs 2 arguments"); return; } if (FQueryPointer(dpy, Scr.Root, &JunkRoot, &JunkChild, &x, &y, &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen */ return; } x_unit = val1 * val1_unit / 100; y_unit = val2 * val2_unit / 100; x += x_unit; y += y_unit; virtual_x = Scr.Vx; virtual_y = Scr.Vy; if (x >= 0) { x_pages = x / Scr.MyDisplayWidth; } else { x_pages = ((x + 1) / Scr.MyDisplayWidth) - 1; } virtual_x += x_pages * Scr.MyDisplayWidth; x -= x_pages * Scr.MyDisplayWidth; if (virtual_x < 0) { x += virtual_x; virtual_x = 0; } else if (virtual_x > Scr.VxMax) { x += virtual_x - Scr.VxMax; virtual_x = Scr.VxMax; } if (y >= 0) { y_pages = y / Scr.MyDisplayHeight; } else { y_pages = ((y + 1) / Scr.MyDisplayHeight) - 1; } virtual_y += y_pages * Scr.MyDisplayHeight; y -= y_pages * Scr.MyDisplayHeight; if (virtual_y < 0) { y += virtual_y; virtual_y = 0; } else if (virtual_y > Scr.VyMax) { y += virtual_y - Scr.VyMax; virtual_y = Scr.VyMax; } /* TA: (2010/12/19): Only move to the new page if scrolling is * enabled and the viewport is able to change based on where the * pointer is. */ if ((virtual_x != Scr.Vx && Scr.EdgeScrollX != 0) || (virtual_y != Scr.Vy && Scr.EdgeScrollY != 0)) { MoveViewport(virtual_x, virtual_y, True); } /* TA: (2010/12/19): If the cursor is about to enter a pan-window, or * is one, or the cursor's next step is to go beyond the page * boundary, stop the cursor from moving in that direction, *if* we've * disallowed edge scrolling. * * Whilst this stops the cursor short of the edge of the screen in a * given direction, this is the desired behaviour. */ if (Scr.EdgeScrollX == 0 && (x >= Scr.MyDisplayWidth || x + x_unit >= Scr.MyDisplayWidth)) return; if (Scr.EdgeScrollY == 0 && (y >= Scr.MyDisplayHeight || y + y_unit >= Scr.MyDisplayHeight)) return; FWarpPointerUpdateEvpos( exc->x.elast, dpy, None, Scr.Root, 0, 0, Scr.MyDisplayWidth, Scr.MyDisplayHeight, x, y); return; } void CMD_Delete(F_CMD_ARGS) { FvwmWindow * const fw = exc->w.fw; if (!is_function_allowed(F_DELETE, NULL, fw, RQORIG_PROGRAM_US, True)) { XBell(dpy, 0); return; } if (IS_TEAR_OFF_MENU(fw)) { /* 'soft' delete tear off menus. Note: we can't send the * message to the menu window directly because it was created * using a different display. The client message would never * be read from there. */ send_clientmessage( dpy, FW_W_PARENT(fw), _XA_WM_DELETE_WINDOW, CurrentTime); return; } if (WM_DELETES_WINDOW(fw)) { send_clientmessage( dpy, FW_W(fw), _XA_WM_DELETE_WINDOW, CurrentTime); return; } else { XBell(dpy, 0); } XFlush(dpy); return; } void CMD_Destroy(F_CMD_ARGS) { FvwmWindow * const fw = exc->w.fw; if (IS_TEAR_OFF_MENU(fw)) { CMD_Delete(F_PASS_ARGS); return; } if (!is_function_allowed(F_DESTROY, NULL, fw, True, True)) { XBell(dpy, 0); return; } if ( XGetGeometry( dpy, FW_W(fw), &JunkRoot, &JunkX, &JunkY, (unsigned int*)&JunkWidth, (unsigned int*)&JunkHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth) != 0) { XKillClient(dpy, FW_W(fw)); } destroy_window(fw); XFlush(dpy); return; } void CMD_Close(F_CMD_ARGS) { FvwmWindow * const fw = exc->w.fw; if (IS_TEAR_OFF_MENU(fw)) { CMD_Delete(F_PASS_ARGS); return; } if (!is_function_allowed(F_CLOSE, NULL, fw, True, True)) { XBell(dpy, 0); return; } if (WM_DELETES_WINDOW(fw)) { send_clientmessage( dpy, FW_W(fw), _XA_WM_DELETE_WINDOW, CurrentTime); return; } if ( XGetGeometry( dpy, FW_W(fw), &JunkRoot, &JunkX, &JunkY, (unsigned int*)&JunkWidth, (unsigned int*)&JunkHeight, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth) != 0) { XKillClient(dpy, FW_W(fw)); } destroy_window(fw); XFlush(dpy); return; } void CMD_Restart(F_CMD_ARGS) { Done(1, action); return; } void CMD_ExecUseShell(F_CMD_ARGS) { char *arg=NULL; static char shell_set = 0; if (shell_set) { free(exec_shell_name); } shell_set = 1; action = GetNextToken(action,&arg); if (arg) /* specific shell was specified */ { exec_shell_name = arg; } else /* no arg, so use $SHELL -- not working??? */ { if (getenv("SHELL")) { exec_shell_name = safestrdup(getenv("SHELL")); } else { /* if $SHELL not set, use default */ exec_shell_name = safestrdup("/bin/sh"); } } } void CMD_Exec(F_CMD_ARGS) { char *cmd=NULL; /* if it doesn't already have an 'exec' as the first word, add that * to keep down number of procs started */ /* need to parse string better to do this right though, so not doing * this for now... */ #if 0 if (strncasecmp(action,"exec",4)!=0) { cmd = (char *)safemalloc(strlen(action)+6); strcpy(cmd,"exec "); strcat(cmd,action); } else #endif { cmd = safestrdup(action); } if (!cmd) { return; } /* Use to grab the pointer here, but the fork guarantees that * we wont be held up waiting for the function to finish, * so the pointer-gram just caused needless delay and flashing * on the screen */ /* Thought I'd try vfork and _exit() instead of regular fork(). * The man page says that its better. */ /* Not everyone has vfork! */ /* According to the man page, vfork should never be used at all. */ if (!(fork())) /* child process */ { /* This is for fixing a problem with rox filer */ int fd; fvmm_deinstall_signals(); fd = open("/dev/null", O_RDONLY, 0); dup2(fd,STDIN_FILENO); if (fd != STDIN_FILENO) close(fd); if (fvwm_setpgrp() == -1) { fvwm_msg(ERR, "exec_function", "setpgrp failed (%s)", strerror(errno)); exit(100); } if (execl(exec_shell_name, exec_shell_name, "-c", cmd, NULL) == -1) { fvwm_msg(ERR, "exec_function", "execl failed (%s)", strerror(errno)); exit(100); } } free(cmd); return; } void CMD_Refresh(F_CMD_ARGS) { refresh_window(Scr.Root, True); return; } void CMD_RefreshWindow(F_CMD_ARGS) { FvwmWindow * const fw = exc->w.fw; refresh_window( (exc->w.wcontext == C_ICON) ? FW_W_ICON_TITLE(fw) : FW_W_FRAME(fw), True); return; } void CMD_Wait(F_CMD_ARGS) { Bool done = False; Bool redefine_cursor = False; Bool is_ungrabbed; char *escape; Window nonewin = None; char *wait_string, *rest; FvwmWindow *t; /* try to get a single token */ rest = GetNextToken(action, &wait_string); if (wait_string) { while (*rest && isspace((unsigned char)*rest)) { rest++; } if (*rest) { int i; char *temp; /* nope, multiple tokens - try old syntax */ /* strip leading and trailing whitespace */ temp = action; while (*temp && isspace((unsigned char)*temp)) { temp++; } wait_string = safestrdup(temp); for (i = strlen(wait_string) - 1; i >= 0 && isspace(wait_string[i]); i--) { wait_string[i] = 0; } } } else { wait_string = safestrdup(""); } is_ungrabbed = UngrabEm(GRAB_NORMAL); while (!done && !isTerminated) { XEvent e; if (BUSY_WAIT & Scr.BusyCursor) { XDefineCursor(dpy, Scr.Root, Scr.FvwmCursors[CRS_WAIT]); redefine_cursor = True; } if (My_XNextEvent(dpy, &e)) { dispatch_event(&e); if (XFindContext( dpy, e.xmap.window, FvwmContext, (caddr_t *)&t) == XCNOENT) { t = NULL; } if (e.type == MapNotify && e.xmap.event == Scr.Root) { if (!*wait_string) { done = True; } if (t && matchWildcards( wait_string, t->name.name) == True) { done = True; } else if (t && t->class.res_class && matchWildcards( wait_string, t->class.res_class) == True) { done = True; } else if (t && t->class.res_name && matchWildcards( wait_string, t->class.res_name) == True) { done = True; } } else if (e.type == KeyPress) { /* should I be using or w.fw>? * DV: t */ int context; XClassHint *class; char *name; context = GetContext(&t, t, &e, &nonewin); if (t != NULL) { class = &(t->class); name = t->name.name; } else { class = NULL; name = NULL; } escape = CheckBinding( Scr.AllBindings, STROKE_ARG(0) e.xkey.keycode, e.xkey.state, GetUnusedModifiers(), context, BIND_KEYPRESS, class, name); if (escape != NULL) { if (!strcasecmp(escape,"escapefunc")) { done = True; } } } } } if (redefine_cursor) { XDefineCursor(dpy, Scr.Root, Scr.FvwmCursors[CRS_ROOT]); } if (is_ungrabbed) { GrabEm(CRS_NONE, GRAB_NORMAL); } free(wait_string); return; } void CMD_Quit(F_CMD_ARGS) { if (master_pid != getpid()) { kill(master_pid, SIGTERM); } Done(0,NULL); return; } void CMD_QuitScreen(F_CMD_ARGS) { Done(0,NULL); return; } void CMD_Echo(F_CMD_ARGS) { int len; if (!action) { action = ""; } len = strlen(action); if (len != 0) { if (action[len-1]=='\n') { action[len-1]='\0'; } } fvwm_msg(ECHO,"Echo",action); return; } void CMD_PrintInfo(F_CMD_ARGS) { int verbose; char *rest, *subject = NULL; rest = GetNextToken(action, &subject); if (!rest || GetIntegerArguments(rest, NULL, &verbose, 1) != 1) { verbose = 0; } if (StrEquals(subject, "Colors")) { PicturePrintColorInfo(verbose); } else if (StrEquals(subject, "Locale")) { FlocalePrintLocaleInfo(dpy, verbose); } else if (StrEquals(subject, "NLS")) { FGettextPrintLocalePath(verbose); } else if (StrEquals(subject, "style")) { print_styles(verbose); } else if (StrEquals(subject, "ImageCache")) { PicturePrintImageCache(verbose); } else if (StrEquals(subject, "Bindings")) { print_bindings(); } else if (StrEquals(subject, "InfoStore")) { print_infostore(); } else { fvwm_msg(ERR, "PrintInfo", "Unknown subject '%s'", action); } if (subject) { free(subject); } return; } void CMD_ColormapFocus(F_CMD_ARGS) { if (MatchToken(action,"FollowsFocus")) { Scr.ColormapFocus = COLORMAP_FOLLOWS_FOCUS; } else if (MatchToken(action,"FollowsMouse")) { Scr.ColormapFocus = COLORMAP_FOLLOWS_MOUSE; } else { fvwm_msg(ERR, "SetColormapFocus", "ColormapFocus requires 1 arg: FollowsFocus or" " FollowsMouse"); return; } return; } void CMD_ClickTime(F_CMD_ARGS) { int val; if (GetIntegerArguments(action, NULL, &val, 1) != 1) { Scr.ClickTime = DEFAULT_CLICKTIME; } else { Scr.ClickTime = (val < 0)? 0 : val; } /* Use a negative value during startup and change sign afterwards. This * speeds things up quite a bit. */ if (fFvwmInStartup) { Scr.ClickTime = -Scr.ClickTime; } return; } void CMD_ImagePath(F_CMD_ARGS) { PictureSetImagePath( action ); return; } void CMD_IconPath(F_CMD_ARGS) { fvwm_msg(ERR, "iconPath_function", "IconPath is deprecated since 2.3.0; use ImagePath instead."); obsolete_imagepaths( action ); return; } void CMD_PixmapPath(F_CMD_ARGS) { fvwm_msg(ERR, "pixmapPath_function", "PixmapPath is deprecated since 2.3.0; use ImagePath" " instead." ); obsolete_imagepaths( action ); return; } void CMD_LocalePath(F_CMD_ARGS) { FGettextSetLocalePath( action ); return; } void CMD_ModulePath(F_CMD_ARGS) { static int need_to_free = 0; setPath( &ModulePath, action, need_to_free ); need_to_free = 1; return; } void CMD_ModuleTimeout(F_CMD_ARGS) { int timeout; moduleTimeout = DEFAULT_MODULE_TIMEOUT; if (GetIntegerArguments(action, NULL, &timeout, 1) == 1 && timeout > 0) { moduleTimeout = timeout; } return; } void CMD_HilightColor(F_CMD_ARGS) { char *fore; char *back; #ifdef USEDECOR if (Scr.cur_decor && Scr.cur_decor != &Scr.DefaultDecor) { fvwm_msg( ERR, "SetHiColor", "Decors do not support the HilightColor command" " anymore. Please use" " 'Style HilightFore ' and" " 'Style HilightBack ' instead." " Sorry for the inconvenience."); return; } #endif action = GetNextToken(action, &fore); GetNextToken(action, &back); if (fore && back) { action = safemalloc(strlen(fore) + strlen(back) + 29); sprintf(action, "* HilightFore %s, HilightBack %s", fore, back); CMD_Style(F_PASS_ARGS); } if (fore) { free(fore); } if (back) { free(back); } return; } void CMD_HilightColorset(F_CMD_ARGS) { char *newaction; #ifdef USEDECOR if (Scr.cur_decor && Scr.cur_decor != &Scr.DefaultDecor) { fvwm_msg( ERR, "SetHiColorset", "Decors do not support the HilightColorset command " "anymore. Please use " "'Style HilightColorset '" " instead. Sorry for the inconvenience."); return; } #endif if (action) { newaction = safemalloc(strlen(action) + 32); sprintf(newaction, "* HilightColorset %s", action); action = newaction; CMD_Style(F_PASS_ARGS); free(newaction); } return; } void CMD_TitleStyle(F_CMD_ARGS) { do_title_style(F_PASS_ARGS, False); return; } /* SetTitleStyle */ /* * * Appends a titlestyle (veliaa@rpi.edu) * */ void CMD_AddTitleStyle(F_CMD_ARGS) { do_title_style(F_PASS_ARGS, True); return; } void CMD_PropertyChange(F_CMD_ARGS) { char string[256]; char *token; char *rest; int ret; unsigned long argument; unsigned long data1; unsigned long data2; /* argument */ token = PeekToken(action, &rest); if (token == NULL) { return; } ret = sscanf(token, "%lu", &argument); if (ret < 1) { return; } /* data1 */ data1 = 0; token = PeekToken(rest, &rest); if (token != NULL) { ret = sscanf(token, "%lu", &data1); if (ret < 1) { rest = NULL; } } /* data2 */ data2 = 0; token = PeekToken(rest, &rest); if (token != NULL) { ret = sscanf(token, "%lu", &data2); if (ret < 1) { rest = NULL; } } /* string */ memset(string, 0, 256); if (rest != NULL) { ret = sscanf(rest, "%255c", &(string[0])); } BroadcastPropertyChange(argument, data1, data2, string); return; } void CMD_DefaultIcon(F_CMD_ARGS) { if (Scr.DefaultIcon) { free(Scr.DefaultIcon); } GetNextToken(action, &Scr.DefaultIcon); return; } void CMD_DefaultColorset(F_CMD_ARGS) { int cset; if (GetIntegerArguments(action, NULL, &cset, 1) != 1) { return; } Scr.DefaultColorset = cset; if (Scr.DefaultColorset < 0) { Scr.DefaultColorset = -1; } alloc_colorset(Scr.DefaultColorset); Scr.flags.do_need_window_update = 1; Scr.flags.has_default_color_changed = 1; return; } void CMD_DefaultColors(F_CMD_ARGS) { char *fore = NULL; char *back = NULL; action = GetNextToken(action, &fore); if (action) { action = GetNextToken(action, &back); } if (!back) { back = safestrdup(DEFAULT_BACK_COLOR); } if (!fore) { fore = safestrdup(DEFAULT_FORE_COLOR); } if (!StrEquals(fore, "-")) { PictureFreeColors(dpy, Pcmap, &Scr.StdFore, 1, 0, True); Scr.StdFore = GetColor(fore); } if (!StrEquals(back, "-")) { PictureFreeColors(dpy, Pcmap, &Scr.StdBack, 3, 0, True); Scr.StdBack = GetColor(back); Scr.StdHilite = GetHilite(Scr.StdBack); Scr.StdShadow = GetShadow(Scr.StdBack); } free(fore); free(back); Scr.DefaultColorset = -1; Scr.flags.do_need_window_update = 1; Scr.flags.has_default_color_changed = 1; return; } void CMD_DefaultFont(F_CMD_ARGS) { char *font; FlocaleFont *new_font; FvwmWindow *t; font = PeekToken(action, &action); if (!font) { /* Try 'fixed', pass NULL font name */ } if (!(new_font = FlocaleLoadFont(dpy, font, "fvwm"))) { if (Scr.DefaultFont == NULL) { exit(1); } else { return; } } FlocaleUnloadFont(dpy, Scr.DefaultFont); Scr.DefaultFont = new_font; /* we should do that here because a redraw can happen before flush_window_updates is called ... */ for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if (USING_DEFAULT_ICON_FONT(t)) { t->icon_font = Scr.DefaultFont; } if (USING_DEFAULT_WINDOW_FONT(t)) { t->title_font = Scr.DefaultFont; } } /* set flags to indicate that the font has changed */ Scr.flags.do_need_window_update = 1; Scr.flags.has_default_font_changed = 1; return; } void CMD_IconFont(F_CMD_ARGS) { char *newaction; #ifdef USEDECOR if (Scr.cur_decor && Scr.cur_decor != &Scr.DefaultDecor) { fvwm_msg( ERR, "LoadIconFont", "Decors do not support the IconFont command anymore." " Please use 'Style IconFont '" " instead. Sorry for the inconvenience."); return; } #endif if (action) { newaction = safemalloc(strlen(action) + 16); sprintf(newaction, "* IconFont %s", action); action = newaction; CMD_Style(F_PASS_ARGS); free(newaction); } return; } void CMD_WindowFont(F_CMD_ARGS) { char *newaction; #ifdef USEDECOR if (Scr.cur_decor && Scr.cur_decor != &Scr.DefaultDecor) { fvwm_msg( ERR, "LoadWindowFont", "Decors do not support the WindowFont command anymore." " Please use 'Style Font '" " instead. Sorry for the inconvenience."); return; } #endif if (action) { newaction = safemalloc(strlen(action) + 16); sprintf(newaction, "* Font %s", action); action = newaction; CMD_Style(F_PASS_ARGS); free(newaction); } return; } /* * * Changes the window's FvwmDecor pointer (veliaa@rpi.edu) * */ void CMD_ChangeDecor(F_CMD_ARGS) { char *item; FvwmDecor *decor = &Scr.DefaultDecor; FvwmDecor *found = NULL; FvwmWindow * const fw = exc->w.fw; item = PeekToken(action, &action); if (!action || !item) { return; } /* search for tag */ for (; decor; decor = decor->next) { if (decor->tag && StrEquals(item, decor->tag)) { found = decor; break; } } if (!found) { XBell(dpy, 0); return; } SET_DECOR_CHANGED(fw, 1); fw->decor = found; apply_decor_change(fw); return; } /* * * Destroys an FvwmDecor (veliaa@rpi.edu) * */ void CMD_DestroyDecor(F_CMD_ARGS) { char *item; FvwmDecor *decor = Scr.DefaultDecor.next; FvwmDecor *prev = &Scr.DefaultDecor, *found = NULL; Bool do_recreate = False; item = PeekToken(action, &action); if (!item) { return; } if (StrEquals(item, "recreate")) { do_recreate = True; item = PeekToken(action, NULL); } if (!item) { return; } /* search for tag */ for (; decor; decor = decor->next) { if (decor->tag && StrEquals(item, decor->tag)) { found = decor; break; } prev = decor; } if (found && (found != &Scr.DefaultDecor || do_recreate)) { if (!do_recreate) { __remove_window_decors(F_PASS_ARGS, found); } DestroyFvwmDecor(found); if (do_recreate) { int i; InitFvwmDecor(found); found->tag = safestrdup(item); Scr.flags.do_need_window_update = 1; found->flags.has_changed = 1; found->flags.has_title_height_changed = 0; found->titlebar.flags.has_changed = 1; for (i = 0; i < NUMBER_OF_TITLE_BUTTONS; ++i) { TB_FLAGS(found->buttons[i]).has_changed = 1; } } else { prev->next = found->next; free(found); } } return; } /* * * Initiates an AddToDecor (veliaa@rpi.edu) * */ void CMD_AddToDecor(F_CMD_ARGS) { FvwmDecor *decor; FvwmDecor *found = NULL; char *item = NULL; action = GetNextToken(action, &item); if (!item) { return; } if (!action) { free(item); return; } /* search for tag */ for (decor = &Scr.DefaultDecor; decor; decor = decor->next) { if (decor->tag && StrEquals(item, decor->tag)) { found = decor; break; } } if (!found) { /* then make a new one */ found = (FvwmDecor *)safemalloc(sizeof( FvwmDecor )); InitFvwmDecor(found); found->tag = item; /* tag it */ /* add it to list */ for (decor = &Scr.DefaultDecor; decor->next; decor = decor->next) { /* nop */ } decor->next = found; } else { free(item); } if (found) { AddToDecor(F_PASS_ARGS, found); /* Set + state to last decor */ set_last_added_item(ADDED_DECOR, found); } return; } #endif /* USEDECOR */ /* * * Updates window decoration styles (veliaa@rpi.edu) * */ void CMD_UpdateDecor(F_CMD_ARGS) { FvwmWindow *fw2; #ifdef USEDECOR FvwmDecor *decor, *found = NULL; FvwmWindow *hilight = Scr.Hilite; char *item = NULL; action = GetNextToken(action, &item); if (item) { /* search for tag */ for (decor = &Scr.DefaultDecor; decor; decor = decor->next) { if (decor->tag && StrEquals(item, decor->tag)) { found = decor; break; } } free(item); } #endif for (fw2 = Scr.FvwmRoot.next; fw2; fw2 = fw2->next) { #ifdef USEDECOR /* update specific decor, or all */ if (found) { if (fw2->decor == found) { border_draw_decorations( fw2, PART_ALL, True, True, CLEAR_ALL, NULL, NULL); border_draw_decorations( fw2, PART_ALL, False, True, CLEAR_ALL, NULL, NULL); } } else #endif { border_draw_decorations( fw2, PART_ALL, True, True, CLEAR_ALL, NULL, NULL); border_draw_decorations( fw2, PART_ALL, False, True, CLEAR_ALL, NULL, NULL); } } border_draw_decorations( hilight, PART_ALL, True, True, CLEAR_ALL, NULL, NULL); } void CMD_ButtonStyle(F_CMD_ARGS) { do_button_style(F_PASS_ARGS, False); return; } /* * * Appends a button decoration style (veliaa@rpi.edu) * */ void CMD_AddButtonStyle(F_CMD_ARGS) { do_button_style(F_PASS_ARGS, True); return; } void CMD_SetEnv(F_CMD_ARGS) { char *szVar = NULL; char *szValue = NULL; char *szPutenv = NULL; action = GetNextToken(action, &szVar); if (!szVar) { return; } action = GetNextToken(action, &szValue); if (!szValue) { szValue = safestrdup(""); } szPutenv = safemalloc(strlen(szVar) + strlen(szValue) + 2); sprintf(szPutenv,"%s=%s", szVar, szValue); flib_putenv(szVar, szPutenv); free(szVar); free(szPutenv); free(szValue); return; } void CMD_UnsetEnv(F_CMD_ARGS) { char *szVar = NULL; szVar = PeekToken(action, &action); if (!szVar) { return; } flib_unsetenv(szVar); return; } void CMD_GlobalOpts(F_CMD_ARGS) { char *opt; char *replace; char buf[64]; int i; Bool is_bugopt; char *optlist[] = { "WindowShadeShrinks", "WindowShadeScrolls", "SmartPlacementIsReallySmart", "SmartPlacementIsNormal", "ClickToFocusDoesntPassClick", "ClickToFocusPassesClick", "ClickToFocusDoesntRaise", "ClickToFocusRaises", "MouseFocusClickDoesntRaise", "MouseFocusClickRaises", "NoStipledTitles", "StipledTitles", "CaptureHonorsStartsOnPage", "CaptureIgnoresStartsOnPage", "RecaptureHonorsStartsOnPage", "RecaptureIgnoresStartsOnPage", "ActivePlacementHonorsStartsOnPage", "ActivePlacementIgnoresStartsOnPage", "RaiseOverNativeWindows", "IgnoreNativeWindows", NULL }; char *replacelist[] = { /* These options are mapped to the Style * command */ NULL, /* NULL means to use "Style * " */ NULL, "* MinOverlapPlacement", "* TileCascadePlacement", "* ClickToFocusPassesClickOff", "* ClickToFocusPassesClick", "* ClickToFocusRaisesOff", "* ClickToFocusRaises", "* MouseFocusClickRaisesOff", "* MouseFocusClickRaises", "* StippledTitleOff", "* StippledTitle", NULL, NULL, NULL, NULL, "* ManualPlacementHonorsStartsOnPage", "* ManualPlacementIgnoresStartsOnPage", /* These options are mapped to the BugOpts command */ "RaiseOverNativeWindows on", "RaiseOverNativeWindows off" }; fvwm_msg(ERR, "SetGlobalOptions", "The GlobalOpts command is obsolete."); for (action = GetNextSimpleOption(action, &opt); opt; action = GetNextSimpleOption(action, &opt)) { replace = NULL; is_bugopt = False; i = GetTokenIndex(opt, optlist, 0, NULL); if (i > -1) { char *cmd; char *tmp; replace = replacelist[i]; if (replace == NULL) { replace = &(buf[0]); sprintf(buf, "* %s", opt); } else if (*replace != '*') { is_bugopt = True; } tmp = action; action = replace; if (!is_bugopt) { CMD_Style(F_PASS_ARGS); cmd = "Style"; } else { CMD_BugOpts(F_PASS_ARGS); cmd = "BugOpts"; } action = tmp; fvwm_msg( ERR, "SetGlobalOptions", "Please replace 'GlobalOpts %s' with '%s %s'.", opt, cmd, replace); } else { fvwm_msg(ERR, "SetGlobalOptions", "Unknown Global Option '%s'", opt); } /* should never be null, but checking anyways... */ if (opt) { free(opt); } } if (opt) { free(opt); } return; } void CMD_BugOpts(F_CMD_ARGS) { char *opt; int toggle; char *optstring; /* fvwm_msg(DBG,"SetGlobalOptions","init action == '%s'\n",action); */ while (action && *action && *action != '\n') { action = GetNextFullOption(action, &optstring); if (!optstring) { /* no more options */ return; } toggle = ParseToggleArgument( SkipNTokens(optstring,1), NULL, 2, False); opt = PeekToken(optstring, NULL); free(optstring); if (!opt) { return; } /* toggle = ParseToggleArgument(rest, &rest, 2, False);*/ if (StrEquals(opt, "FlickeringMoveWorkaround")) { switch (toggle) { case -1: Scr.bo.do_disable_configure_notify ^= 1; break; case 0: case 1: Scr.bo.do_disable_configure_notify = toggle; break; default: Scr.bo.do_disable_configure_notify = 0; break; } } else if (StrEquals(opt, "MixedVisualWorkaround")) { switch (toggle) { case -1: Scr.bo.do_install_root_cmap ^= 1; break; case 0: case 1: Scr.bo.do_install_root_cmap = toggle; break; default: Scr.bo.do_install_root_cmap = 0; break; } } else if (StrEquals(opt, "ModalityIsEvil")) { switch (toggle) { case -1: Scr.bo.is_modality_evil ^= 1; break; case 0: case 1: Scr.bo.is_modality_evil = toggle; break; default: Scr.bo.is_modality_evil = 0; break; } if (Scr.bo.is_modality_evil) { SetMWM_INFO(Scr.NoFocusWin); } } else if (StrEquals(opt, "RaiseOverNativeWindows")) { switch (toggle) { case -1: Scr.bo.is_raise_hack_needed ^= 1; break; case 0: case 1: Scr.bo.is_raise_hack_needed = toggle; break; default: Scr.bo.is_raise_hack_needed = 0; break; } } else if (StrEquals(opt, "RaiseOverUnmanaged")) { switch (toggle) { case -1: Scr.bo.do_raise_over_unmanaged ^= 1; break; case 0: case 1: Scr.bo.do_raise_over_unmanaged = toggle; break; default: Scr.bo.do_raise_over_unmanaged = 0; break; } } else if (StrEquals(opt, "FlickeringQtDialogsWorkaround")) { switch (toggle) { case -1: Scr.bo.do_enable_flickering_qt_dialogs_workaround ^= 1; break; case 0: case 1: Scr.bo.do_enable_flickering_qt_dialogs_workaround = toggle; break; default: Scr.bo.do_enable_flickering_qt_dialogs_workaround = 0; break; } } else if (StrEquals(opt, "QtDragnDropWorkaround") ) { switch (toggle) { case -1: Scr.bo.do_enable_qt_drag_n_drop_workaround ^= 1; break; case 0: case 1: Scr.bo.do_enable_qt_drag_n_drop_workaround = toggle; break; default: Scr.bo.do_enable_qt_drag_n_drop_workaround = 0; break; } } else if (EWMH_BugOpts(opt, toggle)) { /* work is done in EWMH_BugOpts */ } else if (StrEquals(opt, "DisplayNewWindowNames")) { switch (toggle) { case -1: Scr.bo.do_display_new_window_names ^= 1; break; case 0: case 1: Scr.bo.do_display_new_window_names = toggle; break; default: Scr.bo.do_display_new_window_names = 0; break; } } else if (StrEquals(opt, "ExplainWindowPlacement")) { switch (toggle) { case -1: Scr.bo.do_explain_window_placement ^= 1; break; case 0: case 1: Scr.bo.do_explain_window_placement = toggle; break; default: Scr.bo.do_explain_window_placement = 0; break; } } else if (StrEquals(opt, "DebugCRMotionMethod")) { switch (toggle) { case -1: Scr.bo.do_debug_cr_motion_method ^= 1; break; case 0: case 1: Scr.bo.do_debug_cr_motion_method = toggle; break; default: Scr.bo.do_debug_cr_motion_method = 0; break; } } else if (StrEquals(opt, "TransliterateUtf8")) { FiconvSetTransliterateUtf8(toggle); } else { fvwm_msg(ERR, "SetBugOptions", "Unknown Bug Option '%s'", opt); } } return; } void CMD_Emulate(F_CMD_ARGS) { char *style; style = PeekToken(action, NULL); if (!style || StrEquals(style, "fvwm")) { Scr.gs.do_emulate_mwm = False; Scr.gs.do_emulate_win = False; } else if (StrEquals(style, "mwm")) { Scr.gs.do_emulate_mwm = True; Scr.gs.do_emulate_win = False; } else if (StrEquals(style, "win")) { Scr.gs.do_emulate_mwm = False; Scr.gs.do_emulate_win = True; } else { fvwm_msg(ERR, "Emulate", "Unknown style '%s'", style); return; } Scr.flags.do_need_window_update = 1; Scr.flags.has_default_font_changed = 1; Scr.flags.has_default_color_changed = 1; return; } void CMD_ColorLimit(F_CMD_ARGS) { fvwm_msg( WARN, "ColorLimit", "ColorLimit is obsolete,\n\tuse the " "fvwm -color-limit option"); return; } /* set animation parameters */ void CMD_SetAnimation(F_CMD_ARGS) { char *opt; int delay; float pct; int i = 0; opt = PeekToken(action, &action); if (!opt || sscanf(opt,"%d",&delay) != 1) { fvwm_msg(ERR,"SetAnimation", "Improper milli-second delay as first argument"); return; } if (delay > 500) { fvwm_msg(WARN,"SetAnimation", "Using longer than .5 seconds as between frame" " animation delay"); } cmsDelayDefault = delay; for (opt = PeekToken(action, &action); opt; opt = PeekToken(action, &action)) { if (sscanf(opt,"%f",&pct) != 1) { fvwm_msg(ERR,"SetAnimation", "Use fractional values ending in 1.0 as args" " 2 and on"); return; } rgpctMovementDefault[i++] = pct; } /* No pct entries means don't change them at all */ if (i > 0 && rgpctMovementDefault[i-1] != 1.0) { rgpctMovementDefault[i++] = 1.0; } return; } /* Determine which modifiers are required with a keycode to make . */ static Bool FKeysymToKeycode (Display *dpy, KeySym keysym, unsigned int *keycode, unsigned int *modifiers) { int m; *keycode = XKeysymToKeycode(dpy, keysym); *modifiers = 0; for (m = 0; m <= 8; ++m) { KeySym ks = XKeycodeToKeysym(dpy, *keycode, m); if (ks == keysym) { switch (m) { case 0: /* No modifiers */ break; case 1: /* Shift modifier */ *modifiers |= ShiftMask; break; default: fvwm_msg(ERR, "FKeysymToKeycode", "Unhandled modifier %d", m); break; } return True; } } return False; } static void __fake_event(F_CMD_ARGS, FakeEventType type) { char *token; char *optlist[] = { "press", "p", "release", "r", "wait", "w", "modifiers", "m", "depth", "d", NULL }; unsigned int mask = 0; Window root = Scr.Root; int maxdepth = 0; static char args[128]; strncpy(args, action, sizeof(args) - 1); /* get the mask of pressed/released buttons/keys */ FQueryPointer( dpy, Scr.Root, &root, &JunkRoot, &JunkX, &JunkY, &JunkX, &JunkY, &mask); token = PeekToken(action, &action); while (token && action) { int index = GetTokenIndex(token, optlist, 0, NULL); int val, depth; XEvent e; Window w; Window child_w; int x = 0; int y = 0; int rx = 0; int ry = 0; Bool do_unset; long add_mask = 0; KeySym keysym = NoSymbol; XFlush(dpy); do_unset = True; switch (index) { case 0: case 1: do_unset = False; /* fall through */ case 2: case 3: /* key/button press or release */ if (type == FakeMouseEvent) { if ((GetIntegerArguments( action, &action, &val, 1) != 1) || val < 1 || val > NUMBER_OF_EXTENDED_MOUSE_BUTTONS) { fvwm_msg( ERR, "__fake_event", "Invalid button specifier in" " \"%s\" for FakeClick.", args); return; /* error */ } } else /* type == FakeKeyEvent */ { char *key = PeekToken(action, &action); if (key == NULL) { fvwm_msg( ERR, "__fake_event", "No keysym specifier in \"%s\"" " for FakeKeypress.", args); return; } /* Do *NOT* use FvwmStringToKeysym() as it is * case insensitive. */ keysym = XStringToKeysym(key); if (keysym == NoSymbol) { fvwm_msg( ERR, "__fake_event", "Invalid keysym specifier (%s)" " in \"%s\" for FakeKeypress.", key, args); return; } } w = None; child_w = root; for (depth = 1; depth != maxdepth && w != child_w && child_w != None; depth++) { w = child_w; if (FQueryPointer( dpy, w, &root, &child_w, &rx, &ry, &x, &y, &JunkMask) == False) { /* pointer is on a different * screen - that's okay here */ } } if (type == FakeMouseEvent) { e.type = (do_unset) ? ButtonRelease : ButtonPress; e.xbutton.display = dpy; e.xbutton.window = w; e.xbutton.subwindow = None; e.xbutton.root = root; e.xbutton.time = fev_get_evtime(); e.xbutton.x = x; e.xbutton.y = y; e.xbutton.x_root = rx; e.xbutton.y_root = ry; e.xbutton.button = val; e.xbutton.state = mask; e.xbutton.same_screen = (Scr.Root == root); /* SS: I think this mask handling code is * buggy. * The value of is overridden during a * "wait" operation. Also why are we only using * Button1Mask? What if the user has requested * a FakeClick using some other button? */ /* DV: Button1Mask is actually a bit. Shifting * it by (val -1) bits to the left gives * Button2Mask, Button3Mask etc. */ if (do_unset) { mask &= ~(Button1Mask << (val - 1)); } else { mask |= (Button1Mask << (val - 1)); } add_mask = (do_unset) ? ButtonPressMask : ButtonReleaseMask; } else { /* type == FakeKeyEvent */ e.type = (do_unset ? KeyRelease : KeyPress); e.xkey.display = dpy; e.xkey.subwindow = None; e.xkey.root = root; e.xkey.time = fev_get_evtime(); e.xkey.x = x; e.xkey.y = y; e.xkey.x_root = rx; e.xkey.y_root = ry; e.xkey.same_screen = (Scr.Root == root); w = e.xkey.window = exc->w.w; if (FKeysymToKeycode( dpy, keysym, &(e.xkey.keycode), &(e.xkey.state)) != True) { fvwm_msg(DBG, "__fake_event", "FKeysymToKeycode failed"); return; } e.xkey.state |= mask; add_mask = (do_unset) ? KeyReleaseMask : KeyPressMask; } FSendEvent(dpy, w, True, SubstructureNotifyMask | add_mask, &e); XFlush(dpy); break; case 4: case 5: /* wait */ if ((GetIntegerArguments( action, &action, &val, 1) != 1) || val <= 0 || val > 1000000) { fvwm_msg(ERR, "__fake_event", "Invalid wait value in \"%s\"", args); return; } usleep(1000 * val); if (FQueryPointer( dpy, Scr.Root, &root, &JunkRoot, &JunkX, &JunkY, &JunkX, &JunkY, &mask) == False) { /* pointer is on a different screen - * that's okay here */ } break; case 6: case 7: /* set modifier */ if (GetIntegerArguments(action, &action, &val, 1) != 1) { fvwm_msg( ERR, "__fake_event", "Invalid modifier value in \"%s\"", args); return; } do_unset = False; if (val < 0) { do_unset = True; val = -val; } if (val == 6) { val = ShiftMask; } else if (val == 7) { val = LockMask; } else if (val == 8) { val = ControlMask; } else if (val >=1 && val <= 5) { val = (Mod1Mask << (val - 1)); } else { /* error */ return; } /* SS: Could be buggy if a "modifier" operation * preceeds a "wait" operation. */ if (do_unset) { mask &= ~val; } else { mask |= val; } break; case 8: case 9: /* new max depth */ if (GetIntegerArguments(action, &action, &val, 1) != 1) { fvwm_msg(ERR, "__fake_event", "Invalid depth value in \"%s\"", args); return; } maxdepth = val; break; default: fvwm_msg(ERR, "__fake_event", "Invalid command (%s) in \"%s\"", token, args); return; } if (action) { token = PeekToken(action, &action); } } return; } void CMD_FakeClick(F_CMD_ARGS) { __fake_event(F_PASS_ARGS, FakeMouseEvent); return; } void CMD_FakeKeypress(F_CMD_ARGS) { __fake_event(F_PASS_ARGS, FakeKeyEvent); return; } /* A function to handle stroke (olicha Nov 11, 1999) */ #ifdef HAVE_STROKE void CMD_StrokeFunc(F_CMD_ARGS) { int finished = 0; int abort = 0; int modifiers = exc->x.etrigger->xbutton.state; int start_event_type = exc->x.etrigger->type; char sequence[STROKE_MAX_SEQUENCE + 1]; char *stroke_action, *name; char *opt = NULL; Bool finish_on_release = True; KeySym keysym; Bool restore_repeat = False; Bool echo_sequence = False; Bool draw_motion = False; int i = 0; int *x = NULL; int *y = NULL; const int STROKE_CHUNK_SIZE = 0xff; int coords_size = STROKE_CHUNK_SIZE; Window JunkRoot, JunkChild; int JunkX, JunkY; int tmpx, tmpy; unsigned int JunkMask; Bool feed_back = False; int stroke_width = 1; XEvent e; XClassHint *class; if (!GrabEm(CRS_STROKE, GRAB_NORMAL)) { XBell(dpy, 0); return; } x = (int*)safemalloc(coords_size * sizeof(int)); y = (int*)safemalloc(coords_size * sizeof(int)); e = *exc->x.etrigger; /* set the default option */ if (e.type == KeyPress || e.type == ButtonPress) { finish_on_release = True; } else { finish_on_release = False; } /* parse the option */ for (action = GetNextSimpleOption(action, &opt); opt; action = GetNextSimpleOption(action, &opt)) { if (StrEquals("NotStayPressed",opt)) { finish_on_release = False; } else if (StrEquals("EchoSequence",opt)) { echo_sequence = True; } else if (StrEquals("DrawMotion",opt)) { draw_motion = True; } else if (StrEquals("FeedBack",opt)) { feed_back = True; } else if (StrEquals("StrokeWidth",opt)) { /* stroke width takes a positive integer argument */ if (opt) { free(opt); } action = GetNextToken(action, &opt); if (!opt) { fvwm_msg( WARN, "StrokeWidth", "needs an integer argument"); } /* we allow stroke_width == 0 which means drawing a * `fast' line of width 1; the upper level of 100 is * arbitrary */ else if (!sscanf(opt, "%d", &stroke_width) || stroke_width < 0 || stroke_width > 100) { fvwm_msg( WARN, "StrokeWidth", "Bad integer argument %d", stroke_width); stroke_width = 1; } } else { fvwm_msg(WARN,"StrokeFunc","Unknown option %s", opt); } if (opt) { free(opt); } } if (opt) { free(opt); } /* Force auto repeat off and grab the Keyboard to get proper * KeyRelease events if we need it. * Some computers do not support KeyRelease events, can we * check this here ? No ? */ if (start_event_type == KeyPress && finish_on_release) { XKeyboardState kstate; XGetKeyboardControl(dpy, &kstate); if (kstate.global_auto_repeat == AutoRepeatModeOn) { XAutoRepeatOff(dpy); restore_repeat = True; } MyXGrabKeyboard(dpy); } /* be ready to get a stroke sequence */ stroke_init(); if (draw_motion) { MyXGrabServer(dpy); if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &x[0], &y[0], &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen */ x[0] = 0; y[0] = 0; } XSetLineAttributes( dpy,Scr.XorGC,stroke_width,LineSolid,CapButt,JoinMiter); } while (!finished && !abort) { /* block until there is an event */ FMaskEvent( dpy, ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask | ButtonMotionMask | PointerMotionMask, &e); switch (e.type) { case MotionNotify: if (e.xmotion.same_screen == False) { continue; } if (e.xany.window != Scr.Root) { if (FQueryPointer( dpy, Scr.Root, &JunkRoot, &JunkChild, &tmpx, &tmpy, &JunkX, &JunkY, &JunkMask) == False) { /* pointer is on a different screen */ tmpx = 0; tmpy = 0; } } else { tmpx = e.xmotion.x; tmpy = e.xmotion.y; } stroke_record(tmpx,tmpy); if (draw_motion && (x[i] != tmpx || y[i] != tmpy)) { i++; if (i >= coords_size) { coords_size += STROKE_CHUNK_SIZE; x = (int*)saferealloc( (void *)x, coords_size * sizeof(int)); y = (int*)saferealloc( (void *)y, coords_size * sizeof(int)); } x[i] = tmpx; y[i] = tmpy; XDrawLine( dpy, Scr.Root, Scr.XorGC, x[i-1], y[i-1], x[i], y[i]); } break; case ButtonRelease: if (finish_on_release && start_event_type == ButtonPress) { finished = 1; } break; case KeyRelease: if (finish_on_release && start_event_type == KeyPress) { finished = 1; } break; case KeyPress: keysym = XLookupKeysym(&e.xkey, 0); /* abort if Escape or Delete is pressed (as in menus.c) */ if (keysym == XK_Escape || keysym == XK_Delete || keysym == XK_KP_Separator) { abort = 1; } /* finish on enter or space (as in menus.c) */ if (keysym == XK_Return || keysym == XK_KP_Enter || keysym == XK_space) { finished = 1; } break; case ButtonPress: if (!finish_on_release) { finished = 1; } break; default: break; } } if (draw_motion) { while (i > 0) { XDrawLine( dpy, Scr.Root, Scr.XorGC, x[i-1], y[i-1], x[i], y[i]); i--; } XSetLineAttributes(dpy,Scr.XorGC,0,LineSolid,CapButt,JoinMiter); MyXUngrabServer(dpy); } if (x != NULL) { free(x); free(y); } if (start_event_type == KeyPress && finish_on_release) { MyXUngrabKeyboard(dpy); } UngrabEm(GRAB_NORMAL); if (restore_repeat) { XAutoRepeatOn(dpy); } /* get the stroke sequence */ stroke_trans(sequence); if (echo_sequence) { char num_seq[STROKE_MAX_SEQUENCE + 1]; for (i = 0; sequence[i] != '\0';i++) { /* Telephone to numeric pad */ if ('7' <= sequence[i] && sequence[i] <= '9') { num_seq[i] = sequence[i]-6; } else if ('1' <= sequence[i] && sequence[i] <= '3') { num_seq[i] = sequence[i]+6; } else { num_seq[i] = sequence[i]; } } num_seq[i++] = '\0'; fvwm_msg(INFO, "StrokeFunc", "stroke sequence: %s (N%s)", sequence, num_seq); } if (abort) { return; } if (exc->w.fw == NULL) { class = NULL; name = NULL; } else { class = &exc->w.fw->class; name = exc->w.fw->name.name; } /* check for a binding */ stroke_action = CheckBinding( Scr.AllBindings, sequence, 0, modifiers, GetUnusedModifiers(), exc->w.wcontext, BIND_STROKE, class, name); /* execute the action */ if (stroke_action != NULL) { const exec_context_t *exc2; exec_context_changes_t ecc; if (feed_back && atoi(sequence) != 0) { GrabEm(CRS_WAIT, GRAB_BUSY); usleep(200000); UngrabEm(GRAB_BUSY); } ecc.x.etrigger = &e; exc2 = exc_clone_context(exc, &ecc, ECC_ETRIGGER); execute_function(cond_rc, exc2, stroke_action, 0); exc_destroy_context(exc2); } return; } #endif /* HAVE_STROKE */ void CMD_State(F_CMD_ARGS) { unsigned int state; int toggle; int n; FvwmWindow * const fw = exc->w.fw; n = GetIntegerArguments(action, &action, (int *)&state, 1); if (n <= 0) { return; } if (state < 0 || state > 31) { fvwm_msg(ERR, "CMD_State", "Illegal state %d\n", state); return; } toggle = ParseToggleArgument(action, NULL, -1, 0); state = (1 << state); switch (toggle) { case -1: TOGGLE_USER_STATES(fw, state); break; case 0: CLEAR_USER_STATES(fw, state); break; case 1: default: SET_USER_STATES(fw, state); break; } return; } fvwm-2.6.5.orig/fvwm/menustyle.h0000644000175000017500000003347711613252206015013 0ustar vwcvwc/* -*-c-*- */ #ifndef MENUSTYLE_H #define MENUSTYLE_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ #define ST_NAME(s) ((s)->name) #define MST_NAME(m) ((m)->s->ms->name) #define ST_NEXT_STYLE(s) ((s)->next_style) #define MST_NEXT_STYLE(m) ((m)->s->ms->next_style) #define ST_USAGE_COUNT(s) ((s)->usage_count) #define MST_USAGE_COUNT(m) ((m)->s->ms->usage_count) /* flags */ #define ST_IS_UPDATED(s) ((s)->flags.is_updated) #define MST_IS_UPDATED(m) ((m)->s->ms->flags.is_updated) /* look */ #define ST_FACE(s) ((s)->look.face) #define MST_FACE(m) ((m)->s->ms->look.face) #define ST_DO_HILIGHT_BACK(s) ((s)->look.flags.do_hilight_back) #define MST_DO_HILIGHT_BACK(m) ((m)->s->ms->look.flags.do_hilight_back) #define ST_DO_HILIGHT_FORE(s) ((s)->look.flags.do_hilight_fore) #define MST_DO_HILIGHT_FORE(m) ((m)->s->ms->look.flags.do_hilight_fore) #define ST_DO_HILIGHT_TITLE_BACK(s) ((s)->look.flags.do_hilight_title_back) #define MST_DO_HILIGHT_TITLE_BACK(m) \ ((m)->s->ms->look.flags.do_hilight_title_back) #define ST_HAS_ACTIVE_FORE(s) ((s)->look.flags.has_active_fore) #define MST_HAS_ACTIVE_FORE(m) ((m)->s->ms->look.flags.has_active_fore) #define ST_HAS_ACTIVE_BACK(s) ((s)->look.flags.has_active_back) #define MST_HAS_ACTIVE_BACK(m) ((m)->s->ms->look.flags.has_active_back) #define ST_HAS_STIPPLE_FORE(s) ((s)->look.flags.has_stipple_fore) #define MST_HAS_STIPPLE_FORE(m) ((m)->s->ms->look.flags.has_stipple_fore) #define ST_HAS_LONG_SEPARATORS(s) ((s)->look.flags.has_long_separators) #define MST_HAS_LONG_SEPARATORS(m) \ ((m)->s->ms->look.flags.has_long_separators) #define ST_HAS_TRIANGLE_RELIEF(s) ((s)->look.flags.has_triangle_relief) #define MST_HAS_TRIANGLE_RELIEF(m) \ ((m)->s->ms->look.flags.has_triangle_relief) #define ST_HAS_SIDE_COLOR(s) ((s)->look.flags.has_side_color) #define MST_HAS_SIDE_COLOR(m) ((m)->s->ms->look.flags.has_side_color) #define ST_HAS_MENU_CSET(s) ((s)->look.flags.has_menu_cset) #define MST_HAS_MENU_CSET(m) ((m)->s->ms->look.flags.has_menu_cset) #define ST_HAS_ACTIVE_CSET(s) ((s)->look.flags.has_active_cset) #define MST_HAS_ACTIVE_CSET(m) ((m)->s->ms->look.flags.has_active_cset) #define ST_HAS_GREYED_CSET(s) ((s)->look.flags.has_greyed_cset) #define MST_HAS_GREYED_CSET(m) ((m)->s->ms->look.flags.has_greyed_cset) #define ST_HAS_TITLE_CSET(s) ((s)->look.flags.has_title_cset) #define MST_HAS_TITLE_CSET(m) ((m)->s->ms->look.flags.has_title_cset) #define ST_IS_ITEM_RELIEF_REVERSED(s) ((s)->look.flags.is_item_relief_reversed) #define MST_IS_ITEM_RELIEF_REVERSED(m) \ ((m)->s->ms->look.flags.is_item_relief_reversed) #define ST_USING_DEFAULT_FONT(s) ((s)->look.flags.using_default_font) #define MST_USING_DEFAULT_FONT(m) \ ((m)->s->ms->look.flags.using_default_font) #define ST_USING_DEFAULT_TITLEFONT(s) ((s)->look.flags.using_default_titlefont) #define MST_USING_DEFAULT_TITLEFONT(m) \ ((m)->s->ms->look.flags.using_default_titlefont) #define ST_TRIANGLES_USE_FORE(s) ((s)->look.flags.triangles_use_fore) #define MST_TRIANGLES_USE_FORE(m) \ ((m)->s->ms->look.flags.triangles_use_fore) #define ST_RELIEF_THICKNESS(s) ((s)->look.ReliefThickness) #define MST_RELIEF_THICKNESS(m) ((m)->s->ms->look.ReliefThickness) #define ST_TITLE_UNDERLINES(s) ((s)->look.TitleUnderlines) #define MST_TITLE_UNDERLINES(m) ((m)->s->ms->look.TitleUnderlines) #define ST_BORDER_WIDTH(s) ((s)->look.BorderWidth) #define MST_BORDER_WIDTH(m) ((m)->s->ms->look.BorderWidth) #define ST_ITEM_GAP_ABOVE(s) ((s)->look.vertical_spacing.item_above) #define MST_ITEM_GAP_ABOVE(m) \ ((m)->s->ms->look.vertical_spacing.item_above) #define ST_ITEM_GAP_BELOW(s) ((s)->look.vertical_spacing.item_below) #define MST_ITEM_GAP_BELOW(m) \ ((m)->s->ms->look.vertical_spacing.item_below) #define ST_TITLE_GAP_ABOVE(s) ((s)->look.vertical_spacing.title_above) #define MST_TITLE_GAP_ABOVE(m) \ ((m)->s->ms->look.vertical_spacing.title_above) #define ST_TITLE_GAP_BELOW(s) ((s)->look.vertical_spacing.title_below) #define MST_TITLE_GAP_BELOW(m) \ ((m)->s->ms->look.vertical_spacing.title_below) #define ST_SEPARATOR_GAP_ABOVE(s) \ ((s)->look.vertical_spacing.separator_above) #define MST_SEPARATOR_GAP_ABOVE(m) \ ((m)->s->ms->look.vertical_spacing.separator_above) #define ST_SEPARATOR_GAP_BELOW(s) \ ((s)->look.vertical_spacing.separator_below) #define MST_SEPARATOR_GAP_BELOW(m) \ ((m)->s->ms->look.vertical_spacing.separator_below) #define ST_CSET_MENU(s) ((s)->look.cset.menu) #define MST_CSET_MENU(m) ((m)->s->ms->look.cset.menu) #define ST_CSET_ACTIVE(s) ((s)->look.cset.active) #define MST_CSET_ACTIVE(m) ((m)->s->ms->look.cset.active) #define ST_CSET_TITLE(s) ((s)->look.cset.title) #define MST_CSET_TITLE(m) ((m)->s->ms->look.cset.title) #define ST_CSET_GREYED(s) ((s)->look.cset.greyed) #define MST_CSET_GREYED(m) ((m)->s->ms->look.cset.greyed) #define ST_SIDEPIC(s) ((s)->look.side_picture) #define MST_SIDEPIC(m) ((m)->s->ms->look.side_picture) #define ST_SIDE_COLOR(s) ((s)->look.side_color) #define MST_SIDE_COLOR(m) ((m)->s->ms->look.side_color) #define ST_MENU_ACTIVE_GCS(s) ((s)->look.active_gcs) #define MST_MENU_ACTIVE_GCS(m) ((m)->s->ms->look.active_gcs) #define ST_MENU_INACTIVE_GCS(s) ((s)->look.inactive_gcs) #define MST_MENU_INACTIVE_GCS(m) ((m)->s->ms->look.inactive_gcs) #define ST_MENU_STIPPLE_GCS(s) ((s)->look.stipple_gcs) #define MST_MENU_STIPPLE_GCS(m) ((m)->s->ms->look.stipple_gcs) #define ST_MENU_TITLE_GCS(s) ((s)->look.title_gcs) #define MST_MENU_TITLE_GCS(m) ((m)->s->ms->look.title_gcs) #define FORE_GC(g) ((g).fore_gc) #define BACK_GC(g) ((g).back_gc) #define HILIGHT_GC(g) ((g).hilight_gc) #define SHADOW_GC(g) ((g).shadow_gc) #define ST_MENU_STIPPLE_GC(s) ((s)->look.MenuStippleGC) #define MST_MENU_STIPPLE_GC(m) ((m)->s->ms->look.MenuStippleGC) #define ST_MENU_COLORS(s) ((s)->look.MenuColors) #define MST_MENU_COLORS(m) ((m)->s->ms->look.MenuColors) #define ST_MENU_ACTIVE_COLORS(s) ((s)->look.MenuActiveColors) #define MST_MENU_ACTIVE_COLORS(m) ((m)->s->ms->look.MenuActiveColors) #define ST_MENU_STIPPLE_COLORS(s) ((s)->look.MenuStippleColors) #define MST_MENU_STIPPLE_COLORS(m) ((m)->s->ms->look.MenuStippleColors) #define ST_PSTDFONT(s) ((s)->look.pStdFont) #define MST_PSTDFONT(m) ((m)->s->ms->look.pStdFont) #define ST_PTITLEFONT(s) ((s)->look.pTitleFont) #define MST_PTITLEFONT(m) ((m)->s->ms->look.pTitleFont) #define ST_FONT_HEIGHT(s) ((s)->look.FontHeight) #define MST_FONT_HEIGHT(m) ((m)->s->ms->look.FontHeight) /* feel */ #define ST_IS_ANIMATED(s) ((s)->feel.flags.is_animated) #define MST_IS_ANIMATED(m) ((m)->s->ms->feel.flags.is_animated) #define ST_DO_POPUP_IMMEDIATELY(s) ((s)->feel.flags.do_popup_immediately) #define MST_DO_POPUP_IMMEDIATELY(m) \ ((m)->s->ms->feel.flags.do_popup_immediately) #define ST_DO_POPDOWN_IMMEDIATELY(s) ((s)->feel.flags.do_popdown_immediately) #define MST_DO_POPDOWN_IMMEDIATELY(m) \ ((m)->s->ms->feel.flags.do_popdown_immediately) #define ST_DO_WARP_TO_TITLE(s) ((s)->feel.flags.do_warp_to_title) #define MST_DO_WARP_TO_TITLE(m) ((m)->s->ms->feel.flags.do_warp_to_title) #define ST_DO_POPUP_AS(s) ((s)->feel.flags.do_popup_as) #define MST_DO_POPUP_AS(m) ((m)->s->ms->feel.flags.do_popup_as) #define ST_DO_UNMAP_SUBMENU_ON_POPDOWN(s) \ ((s)->feel.flags.do_unmap_submenu_on_popdown) #define MST_DO_UNMAP_SUBMENU_ON_POPDOWN(m) \ ((m)->s->ms->feel.flags.do_unmap_submenu_on_popdown) #define ST_USE_LEFT_SUBMENUS(s) ((s)->feel.flags.use_left_submenus) #define MST_USE_LEFT_SUBMENUS(m) \ ((m)->s->ms->feel.flags.use_left_submenus) #define ST_USE_AUTOMATIC_HOTKEYS(s) ((s)->feel.flags.use_automatic_hotkeys) #define MST_USE_AUTOMATIC_HOTKEYS(m) \ ((m)->s->ms->feel.flags.use_automatic_hotkeys) #define ST_MOUSE_WHEEL(s) ((s)->feel.flags.mouse_wheel) #define MST_MOUSE_WHEEL(m) ((m)->s->ms->feel.flags.mouse_wheel) #define ST_SCROLL_OFF_PAGE(s) ((s)->feel.flags.scroll_off_page) #define MST_SCROLL_OFF_PAGE(m) ((m)->s->ms->feel.flags.scroll_off_page) #define ST_FLAGS(s) ((s)->feel.flags) #define MST_FLAGS(m) ((m)->s->ms->feel.flags) #define ST_POPUP_OFFSET_PERCENT(s) ((s)->feel.PopupOffsetPercent) #define MST_POPUP_OFFSET_PERCENT(m) ((m)->s->ms->feel.PopupOffsetPercent) #define ST_POPUP_OFFSET_ADD(s) ((s)->feel.PopupOffsetAdd) #define MST_POPUP_OFFSET_ADD(m) ((m)->s->ms->feel.PopupOffsetAdd) #define ST_ACTIVE_AREA_PERCENT(s) \ ((s)->feel.ActiveAreaPercent) #define MST_ACTIVE_AREA_PERCENT(m) \ ((m)->s->ms->feel.ActiveAreaPercent) #define ST_POPDOWN_DELAY(s) ((s)->feel.PopdownDelay10ms) #define MST_POPDOWN_DELAY(m) ((m)->s->ms->feel.PopdownDelay10ms) #define ST_POPUP_DELAY(s) ((s)->feel.PopupDelay10ms) #define MST_POPUP_DELAY(m) ((m)->s->ms->feel.PopupDelay10ms) #define ST_DOUBLE_CLICK_TIME(s) ((s)->feel.DoubleClickTime) #define MST_DOUBLE_CLICK_TIME(m) ((m)->s->ms->feel.DoubleClickTime) #define ST_ITEM_FORMAT(s) ((s)->feel.item_format) #define MST_ITEM_FORMAT(m) ((m)->s->ms->feel.item_format) #define ST_SELECT_ON_RELEASE_KEY(s) ((s)->feel.select_on_release_key) #define MST_SELECT_ON_RELEASE_KEY(m) ((m)->s->ms->feel.select_on_release_key) #define ST_VERTICAL_MARGIN_TOP(s) ((s)->look.vertical_margins.top) #define MST_VERTICAL_MARGIN_TOP(m) ((m)->s->ms->look.vertical_margins.top) #define ST_VERTICAL_MARGIN_BOTTOM(s) ((s)->look.vertical_margins.bottom) #define MST_VERTICAL_MARGIN_BOTTOM(m) ((m)->s->ms->look.vertical_margins.bottom) #define ST_HOTKEY_ACTIVATES_IMMEDIATE(s) ((s)->feel.flags.hotkey_activates_immediate) #define MST_HOTKEY_ACTIVATES_IMMEDIATE(m) ((m)->s->ms->feel.flags.hotkey_activates_immediate) /* ---------------------------- type definitions --------------------------- */ typedef enum { /* menu types */ SimpleMenu = 0, GradientMenu, PixmapMenu, TiledPixmapMenu, SolidMenu /* max button is 8 (0x8) */ } MenuFaceType; typedef enum { MDP_POST_MENU = 0, MDP_ROOT_MENU = 1, MDP_IGNORE = 2, MDP_CLOSE = 3 } ms_do_popup_as_t; typedef enum { MMW_OFF = 0, MMW_MENU_BACKWARDS = 1, MMW_MENU = 2, MMW_POINTER = 3 } ms_mouse_wheel_t; typedef struct MenuFeel { struct { unsigned is_animated : 1; unsigned do_popdown_immediately : 1; unsigned do_popup_immediately : 1; unsigned do_popup_as : 2; unsigned do_warp_to_title : 1; unsigned do_unmap_submenu_on_popdown : 1; unsigned use_left_submenus : 1; unsigned use_automatic_hotkeys : 1; unsigned mouse_wheel : 2; unsigned scroll_off_page : 1; unsigned hotkey_activates_immediate : 1; } flags; int PopdownDelay10ms; int PopupOffsetPercent; int ActiveAreaPercent; int PopupOffsetAdd; int PopupDelay10ms; int DoubleClickTime; char *item_format; KeyCode select_on_release_key; } MenuFeel; typedef struct MenuFace { union { FvwmPicture *p; Pixel back; struct { int npixels; XColor *xcs; Bool do_dither; } grad; } u; MenuFaceType type; char gradient_type; } MenuFace; typedef struct { GC fore_gc; GC back_gc; GC hilight_gc; GC shadow_gc; } gc_quad_t; typedef struct MenuLook { MenuFace face; struct { unsigned do_hilight_back : 1; unsigned do_hilight_fore : 1; unsigned has_active_fore : 1; unsigned has_active_back : 1; unsigned has_stipple_fore : 1; unsigned has_long_separators : 1; unsigned has_triangle_relief : 1; unsigned has_side_color : 1; unsigned has_menu_cset : 1; unsigned has_active_cset : 1; unsigned has_greyed_cset : 1; unsigned is_item_relief_reversed : 1; unsigned using_default_font : 1; unsigned triangles_use_fore : 1; unsigned has_title_cset : 1; unsigned do_hilight_title_back : 1; unsigned using_default_titlefont : 1; } flags; unsigned char ReliefThickness; unsigned char TitleUnderlines; unsigned char BorderWidth; struct { signed char item_above; signed char item_below; signed char title_above; signed char title_below; signed char separator_above; signed char separator_below; } vertical_spacing; struct { unsigned char top; unsigned char bottom; } vertical_margins; struct { int menu; int active; int greyed; int title; } cset; FvwmPicture *side_picture; Pixel side_color; gc_quad_t inactive_gcs; gc_quad_t active_gcs; gc_quad_t stipple_gcs; gc_quad_t title_gcs; ColorPair MenuColors; ColorPair MenuActiveColors; ColorPair MenuStippleColors; FlocaleFont *pStdFont; FlocaleFont *pTitleFont; int FontHeight; } MenuLook; typedef struct MenuStyle { char *name; struct MenuStyle *next_style; int usage_count; MenuLook look; MenuFeel feel; struct { unsigned is_updated : 1; } flags; } MenuStyle; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void menustyle_free(MenuStyle *ms); MenuStyle *menustyle_find(char *name); void menustyle_update(MenuStyle *ms); MenuStyle *menustyle_parse_style(F_CMD_ARGS); MenuStyle *menustyle_get_default_style(void); void menustyle_copy(MenuStyle *origms, MenuStyle *destms); #endif /* MENUSTYLE_H */ fvwm-2.6.5.orig/fvwm/condrc.h0000644000175000017500000000153307677641710014243 0ustar vwcvwc/* -*-c-*- */ #ifndef CONDRC_H #define CONDRC_H /* ---------------------------- included header files ---------------------- */ /* ---------------------------- global definitions ------------------------- */ /* ---------------------------- global macros ------------------------------ */ /* ---------------------------- type definitions --------------------------- */ typedef enum { COND_RC_BREAK = -2, COND_RC_ERROR = -1, COND_RC_NO_MATCH = 0, COND_RC_OK = 1 } cond_rc_enum; typedef struct { cond_rc_enum rc; int break_levels; } cond_rc_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- interface functions ------------------------ */ void condrc_init(cond_rc_t *cond_rc); #endif /* CONDRC_H */ fvwm-2.6.5.orig/fvwm/style.c0000644000175000017500000042562411720436066014127 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module was all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* code for parsing the fvwm style command */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/FScreen.h" #include "libs/charmap.h" #include "libs/modifiers.h" #include "libs/ColorUtils.h" #include "libs/Parse.h" #include "libs/wild.h" #include "fvwm.h" #include "execcontext.h" #include "misc.h" #include "screen.h" #include "update.h" #include "style.h" #include "colorset.h" #include "ewmh.h" #include "gnome.h" #include "placement.h" /* ---------------------------- local definitions -------------------------- */ #define SAFEFREE( p ) {if (p) {free(p);(p)=NULL;}} /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ /* list of window names with attributes */ static window_style *all_styles = NULL; static window_style *last_style_in_list = NULL; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static Bool __validate_titleformat_string(const char *formatstr) { const char *fmt; /* Setting this to "True" here ensures we don't erroneously report on * an invalid TitleFormat string which contains no placeholders * whatsoever. */ Bool ret_condition = True; for (fmt = formatstr; *fmt; fmt++) { if (*fmt != '%') continue; switch (*++fmt) { case 'c': case 'n': case 'r': case 't': case 'i': case 'I': ret_condition = True; break; default: ret_condition = False; break; } } return ret_condition; } static int blockor(char *dest, char *blk1, char *blk2, int length) { int i; char result = 0; for (i = 0; i < length; i++) { dest[i] = (blk1[i] | blk2[i]); result |= dest[i]; } return (result) ? 1 : 0; } static int blockand(char *dest, char *blk1, char *blk2, int length) { int i; char result = 0; for (i = 0; i < length; i++) { dest[i] = (blk1[i] & blk2[i]); result |= dest[i]; } return (result) ? 1 : 0; } static int blockunmask(char *dest, char *blk1, char *blk2, int length) { int i; char result = (char)0xff; for (i = 0; i < length; i++) { dest[i] = (blk1[i] & ~blk2[i]); result |= dest[i]; } return (result) ? 1 : 0; } static int blockissubset(char *sub, char *super, int length) { int i; for (i = 0; i < length; i++) { if ((sub[i] & super[i]) != sub[i]) { return 0; } } return 1; } static int blocksintersect(char *blk1, char *blk2, int length) { int i; for (i = 0; i < length; i++) { if (blk1[i] & blk2[i]) { return 1; } } return 0; } static int style_ids_are_equal(style_id_t *a, style_id_t *b) { if ( SID_GET_HAS_NAME(*a) && SID_GET_HAS_NAME(*b) && !strcmp(SID_GET_NAME(*a), SID_GET_NAME(*b))) { return 1; } if ( SID_GET_HAS_WINDOW_ID(*a) && SID_GET_HAS_WINDOW_ID(*b) && SID_GET_WINDOW_ID(*a) == SID_GET_WINDOW_ID(*b)) { return 1; } return 0; } static int style_id_equals_id(window_style *s, style_id_t* id) { return style_ids_are_equal(&SGET_ID(*s), id); } static int styles_have_same_id(window_style* s, window_style* t) { return style_ids_are_equal(&SGET_ID(*s), &SGET_ID(*t)); } static int fw_match_style_id(FvwmWindow *fw, style_id_t s_id) { if (SID_GET_HAS_NAME(s_id)) { if (matchWildcards(SID_GET_NAME(s_id), fw->class.res_class) == 1) { return 1; } if (matchWildcards(SID_GET_NAME(s_id), fw->class.res_name) == 1) { return 1; } if (matchWildcards(SID_GET_NAME(s_id), fw->visible_name) == 1) { return 1; } if (matchWildcards(SID_GET_NAME(s_id), fw->name.name) == 1) { return 1; } if (fw->style_name != NULL && matchWildcards(SID_GET_NAME(s_id), fw->style_name) == 1) { return 1; } } if (SID_GET_HAS_WINDOW_ID(s_id) && SID_GET_WINDOW_ID(s_id) == (XID)FW_W(fw)) { return 1; } return 0; } static int one_fw_can_match_both_ids(window_style *s, window_style *t) { if (SGET_ID_HAS_WINDOW_ID(*s) && SGET_ID_HAS_WINDOW_ID(*t) && SGET_WINDOW_ID(*s) != SGET_WINDOW_ID(*t)) { return 0; } return 1; } static void remove_icon_boxes_from_style(window_style *pstyle) { if (SHAS_ICON_BOXES(&pstyle->flags)) { free_icon_boxes(SGET_ICON_BOXES(*pstyle)); pstyle->flags.has_icon_boxes = 0; SSET_ICON_BOXES(*pstyle, NULL); } return; } static void copy_icon_boxes(icon_boxes **pdest, icon_boxes *src) { icon_boxes *last = NULL; icon_boxes *temp; *pdest = NULL; /* copy the icon boxes */ for ( ; src != NULL; src = src->next) { temp = (icon_boxes *)safemalloc(sizeof(icon_boxes)); memcpy(temp, src, sizeof(icon_boxes)); temp->next = NULL; if (last != NULL) last->next = temp; else *pdest = temp; last = temp; } } /* Check word after IconFill to see if its "Top,Bottom,Left,Right" */ static int Get_TBLR(char *token, unsigned char *IconFill) { /* init */ if (StrEquals(token, "B") || StrEquals(token, "BOT")|| StrEquals(token, "BOTTOM")) { /* turn on bottom and verical */ *IconFill = ICONFILLBOT | ICONFILLHRZ; } else if (StrEquals(token, "T") || StrEquals(token, "TOP")) { /* turn on vertical */ *IconFill = ICONFILLHRZ; } else if (StrEquals(token, "R") || StrEquals(token, "RGT") || StrEquals(token, "RIGHT")) { /* turn on right bit */ *IconFill = ICONFILLRGT; } else if (StrEquals(token, "L") || StrEquals(token, "LFT") || StrEquals(token, "LEFT")) { *IconFill = 0; } else { /* anything else is bad */ return 0; } /* return OK */ return 1; } static void cleanup_style_defaults(window_style *style) { int i; char *dflt; char *mask; mask = (char *)&(style->flag_mask); dflt = (char *)&(style->flag_default); for (i = 0; i < sizeof(style_flags); i++) { dflt[i] &= ~mask[i]; } return; } /* merge_styles - For a matching style, merge window_style to window_style * * Returned Value: * merged matching styles in callers window_style. * * Inputs: * merged_style - style resulting from the merge * add_style - the style to be added into the merge_style * do_free_src_and_alloc_copy * - free allocated parts of merge_style that are replaced * from add_style. Create a copy of of the replaced * styles in allocated memory. * * Note: * The only trick here is that on and off flags/buttons are * combined into the on flag/button. */ static void merge_styles( window_style *merged_style, window_style *add_style, Bool do_free_src_and_alloc_copy) { int i; char *merge_flags; char *add_flags; char *merge_mask; char *add_mask; char *merge_dflt; char *add_dflt; char *merge_change_mask; char *add_change_mask; if (add_style->flag_mask.has_icon) { if (do_free_src_and_alloc_copy) { SAFEFREE(SGET_ICON_NAME(*merged_style)); SSET_ICON_NAME( *merged_style, (SGET_ICON_NAME(*add_style)) ? safestrdup(SGET_ICON_NAME(*add_style)) : NULL); } else { SSET_ICON_NAME( *merged_style, SGET_ICON_NAME(*add_style)); } } if (FMiniIconsSupported && add_style->flag_mask.has_mini_icon) { if (do_free_src_and_alloc_copy) { SAFEFREE(SGET_MINI_ICON_NAME(*merged_style)); SSET_MINI_ICON_NAME( *merged_style, (SGET_MINI_ICON_NAME(*add_style)) ? safestrdup(SGET_MINI_ICON_NAME(*add_style)) : NULL); } else { SSET_MINI_ICON_NAME( *merged_style, SGET_MINI_ICON_NAME(*add_style)); } } #ifdef USEDECOR if (add_style->flag_mask.has_decor) { if (do_free_src_and_alloc_copy) { SAFEFREE(SGET_DECOR_NAME(*merged_style)); SSET_DECOR_NAME( *merged_style, (SGET_DECOR_NAME(*add_style)) ? safestrdup(SGET_DECOR_NAME(*add_style)) : NULL); } else { SSET_DECOR_NAME( *merged_style, SGET_DECOR_NAME(*add_style)); } } #endif if (S_HAS_ICON_FONT(SCF(*add_style))) { if (do_free_src_and_alloc_copy) { SAFEFREE(SGET_ICON_FONT(*merged_style)); SSET_ICON_FONT( *merged_style, (SGET_ICON_FONT(*add_style)) ? safestrdup(SGET_ICON_FONT(*add_style)) : NULL); } else { SSET_ICON_FONT( *merged_style, SGET_ICON_FONT(*add_style)); } } if (S_HAS_WINDOW_FONT(SCF(*add_style))) { if (do_free_src_and_alloc_copy) { SAFEFREE(SGET_WINDOW_FONT(*merged_style)); SSET_WINDOW_FONT( *merged_style, (SGET_WINDOW_FONT(*add_style)) ? safestrdup(SGET_WINDOW_FONT(*add_style)) : NULL); } else { SSET_WINDOW_FONT( *merged_style, SGET_WINDOW_FONT(*add_style)); } } if (add_style->flags.use_start_on_desk) { SSET_START_DESK(*merged_style, SGET_START_DESK(*add_style)); SSET_START_PAGE_X( *merged_style, SGET_START_PAGE_X(*add_style)); SSET_START_PAGE_Y( *merged_style, SGET_START_PAGE_Y(*add_style)); } if (add_style->flags.use_start_on_screen) { SSET_START_SCREEN (*merged_style, SGET_START_SCREEN(*add_style)); } if (add_style->flag_mask.has_color_fore) { if (do_free_src_and_alloc_copy) { SAFEFREE(SGET_FORE_COLOR_NAME(*merged_style)); SSET_FORE_COLOR_NAME( *merged_style, (SGET_FORE_COLOR_NAME(*add_style)) ? safestrdup(SGET_FORE_COLOR_NAME(*add_style)) : NULL); } else { SSET_FORE_COLOR_NAME( *merged_style, SGET_FORE_COLOR_NAME(*add_style)); } } if (add_style->flag_mask.has_color_back) { if (do_free_src_and_alloc_copy) { SAFEFREE(SGET_BACK_COLOR_NAME(*merged_style)); SSET_BACK_COLOR_NAME( *merged_style, (SGET_BACK_COLOR_NAME(*add_style)) ? safestrdup(SGET_BACK_COLOR_NAME(*add_style)) : NULL); } else { SSET_BACK_COLOR_NAME( *merged_style, SGET_BACK_COLOR_NAME(*add_style)); } } if (add_style->flag_mask.has_color_fore_hi) { if (do_free_src_and_alloc_copy) { SAFEFREE(SGET_FORE_COLOR_NAME_HI(*merged_style)); SSET_FORE_COLOR_NAME_HI( *merged_style, (SGET_FORE_COLOR_NAME_HI(*add_style)) ? safestrdup( SGET_FORE_COLOR_NAME_HI(*add_style)) : NULL); } else { SSET_FORE_COLOR_NAME_HI( *merged_style, SGET_FORE_COLOR_NAME_HI(*add_style)); } } if (add_style->flag_mask.has_color_back_hi) { if (do_free_src_and_alloc_copy) { SAFEFREE(SGET_BACK_COLOR_NAME_HI(*merged_style)); SSET_BACK_COLOR_NAME_HI( *merged_style, (SGET_BACK_COLOR_NAME_HI(*add_style)) ? safestrdup( SGET_BACK_COLOR_NAME_HI(*add_style)) : NULL); } else { SSET_BACK_COLOR_NAME_HI( *merged_style, SGET_BACK_COLOR_NAME_HI(*add_style)); } } if (add_style->flags.has_border_width) { SSET_BORDER_WIDTH( *merged_style, SGET_BORDER_WIDTH(*add_style)); } if (add_style->flags.has_handle_width) { SSET_HANDLE_WIDTH( *merged_style, SGET_HANDLE_WIDTH(*add_style)); } if (add_style->flags.has_icon_size_limits) { SSET_MIN_ICON_WIDTH( *merged_style, SGET_MIN_ICON_WIDTH(*add_style)); SSET_MIN_ICON_HEIGHT( *merged_style, SGET_MIN_ICON_HEIGHT(*add_style)); SSET_MAX_ICON_WIDTH( *merged_style, SGET_MAX_ICON_WIDTH(*add_style)); SSET_MAX_ICON_HEIGHT( *merged_style, SGET_MAX_ICON_HEIGHT(*add_style)); SSET_ICON_RESIZE_TYPE( *merged_style, SGET_ICON_RESIZE_TYPE(*add_style)); } if (add_style->flags.has_min_window_size) { SSET_MIN_WINDOW_WIDTH( *merged_style, SGET_MIN_WINDOW_WIDTH(*add_style)); SSET_MIN_WINDOW_HEIGHT( *merged_style, SGET_MIN_WINDOW_HEIGHT(*add_style)); } if (add_style->flags.has_max_window_size) { SSET_MAX_WINDOW_WIDTH( *merged_style, SGET_MAX_WINDOW_WIDTH(*add_style)); SSET_MAX_WINDOW_HEIGHT( *merged_style, SGET_MAX_WINDOW_HEIGHT(*add_style)); } if (add_style->flags.has_icon_background_relief) { SSET_ICON_BACKGROUND_RELIEF( *merged_style, SGET_ICON_BACKGROUND_RELIEF(*add_style)); } if (add_style->flags.has_icon_background_padding) { SSET_ICON_BACKGROUND_PADDING( *merged_style, SGET_ICON_BACKGROUND_PADDING(*add_style)); } if (add_style->flags.has_icon_title_relief) { SSET_ICON_TITLE_RELIEF( *merged_style, SGET_ICON_TITLE_RELIEF(*add_style)); } if (add_style->flags.has_window_shade_steps) { SSET_WINDOW_SHADE_STEPS( *merged_style, SGET_WINDOW_SHADE_STEPS(*add_style)); } if (add_style->flags.has_snap_attraction) { SSET_SNAP_PROXIMITY( *merged_style, SGET_SNAP_PROXIMITY(*add_style)); SSET_SNAP_MODE( *merged_style, SGET_SNAP_MODE(*add_style)); } if (add_style->flags.has_snap_grid) { SSET_SNAP_GRID_X( *merged_style, SGET_SNAP_GRID_X(*add_style)); SSET_SNAP_GRID_Y( *merged_style, SGET_SNAP_GRID_Y(*add_style)); } if (add_style->flags.has_edge_delay_ms_move) { SSET_EDGE_DELAY_MS_MOVE( *merged_style, SGET_EDGE_DELAY_MS_MOVE(*add_style)); } if (add_style->flags.has_edge_delay_ms_resize) { SSET_EDGE_DELAY_MS_RESIZE( *merged_style, SGET_EDGE_DELAY_MS_RESIZE(*add_style)); } if (add_style->flags.has_edge_resistance_move) { SSET_EDGE_RESISTANCE_MOVE( *merged_style, SGET_EDGE_RESISTANCE_MOVE(*add_style)); } if (add_style->flags.has_edge_resistance_xinerama_move) { SSET_EDGE_RESISTANCE_XINERAMA_MOVE( *merged_style, SGET_EDGE_RESISTANCE_XINERAMA_MOVE(*add_style)); } /* Note: Only one style cmd can define a window's iconboxes, the last * one encountered. */ if (SHAS_ICON_BOXES(&add_style->flag_mask)) { /* If style has iconboxes */ /* copy it */ if (do_free_src_and_alloc_copy) { remove_icon_boxes_from_style(merged_style); copy_icon_boxes( &SGET_ICON_BOXES(*merged_style), SGET_ICON_BOXES(*add_style)); } else { SSET_ICON_BOXES( *merged_style, SGET_ICON_BOXES(*add_style)); } } if (add_style->flags.use_layer) { SSET_LAYER(*merged_style, SGET_LAYER(*add_style)); } if (add_style->flags.do_start_shaded) { SSET_STARTS_SHADED_DIR( *merged_style, SGET_STARTS_SHADED_DIR(*add_style)); } if (add_style->flags.use_colorset) { SSET_COLORSET(*merged_style, SGET_COLORSET(*add_style)); } if (add_style->flags.use_colorset_hi) { SSET_COLORSET_HI(*merged_style, SGET_COLORSET_HI(*add_style)); } if (add_style->flags.use_border_colorset) { SSET_BORDER_COLORSET( *merged_style, SGET_BORDER_COLORSET(*add_style)); } if (add_style->flags.use_border_colorset_hi) { SSET_BORDER_COLORSET_HI( *merged_style,SGET_BORDER_COLORSET_HI(*add_style)); } if (add_style->flags.use_icon_title_colorset) { SSET_ICON_TITLE_COLORSET( *merged_style,SGET_ICON_TITLE_COLORSET(*add_style)); } if (add_style->flags.use_icon_title_colorset_hi) { SSET_ICON_TITLE_COLORSET_HI( *merged_style,SGET_ICON_TITLE_COLORSET_HI(*add_style)); } if (add_style->flags.use_icon_background_colorset) { SSET_ICON_BACKGROUND_COLORSET( *merged_style,SGET_ICON_BACKGROUND_COLORSET( *add_style)); } if (add_style->flags.has_placement_penalty) { SSET_NORMAL_PLACEMENT_PENALTY( *merged_style, SGET_NORMAL_PLACEMENT_PENALTY(*add_style)); SSET_ONTOP_PLACEMENT_PENALTY( *merged_style, SGET_ONTOP_PLACEMENT_PENALTY(*add_style)); SSET_ICON_PLACEMENT_PENALTY( *merged_style, SGET_ICON_PLACEMENT_PENALTY( *add_style)); SSET_STICKY_PLACEMENT_PENALTY( *merged_style, SGET_STICKY_PLACEMENT_PENALTY(*add_style)); SSET_BELOW_PLACEMENT_PENALTY( *merged_style, SGET_BELOW_PLACEMENT_PENALTY(*add_style)); SSET_EWMH_STRUT_PLACEMENT_PENALTY( *merged_style, SGET_EWMH_STRUT_PLACEMENT_PENALTY(*add_style)); } if (add_style->flags.has_placement_percentage_penalty) { SSET_99_PLACEMENT_PERCENTAGE_PENALTY( *merged_style, SGET_99_PLACEMENT_PERCENTAGE_PENALTY(*add_style)); SSET_95_PLACEMENT_PERCENTAGE_PENALTY( *merged_style, SGET_95_PLACEMENT_PERCENTAGE_PENALTY(*add_style)); SSET_85_PLACEMENT_PERCENTAGE_PENALTY( *merged_style, SGET_85_PLACEMENT_PERCENTAGE_PENALTY(*add_style)); SSET_75_PLACEMENT_PERCENTAGE_PENALTY( *merged_style, SGET_75_PLACEMENT_PERCENTAGE_PENALTY(*add_style)); } if (add_style->flags.has_placement_position_string) { SAFEFREE(SGET_PLACEMENT_POSITION_STRING(*merged_style)); SSET_PLACEMENT_POSITION_STRING( *merged_style, strdup(SGET_PLACEMENT_POSITION_STRING(*add_style))); } if (add_style->flags.has_initial_map_command_string) { SAFEFREE(SGET_INITIAL_MAP_COMMAND_STRING(*merged_style)); SSET_INITIAL_MAP_COMMAND_STRING( *merged_style, strdup(SGET_INITIAL_MAP_COMMAND_STRING(*add_style))); } if (add_style->flags.has_title_format_string) { SAFEFREE(SGET_TITLE_FORMAT_STRING(*merged_style)); SSET_TITLE_FORMAT_STRING(*merged_style, strdup(SGET_TITLE_FORMAT_STRING(*add_style))); } if (add_style->flags.has_icon_title_format_string) { SAFEFREE(SGET_ICON_TITLE_FORMAT_STRING(*merged_style)); SSET_ICON_TITLE_FORMAT_STRING(*merged_style, strdup(SGET_ICON_TITLE_FORMAT_STRING(*add_style))); } /* merge the style flags */ /*** ATTENTION: *** This must be the last thing that is done in this function! */ merge_flags = (char *)&(merged_style->flags); add_flags = (char *)&(add_style->flags); merge_mask = (char *)&(merged_style->flag_mask); add_mask = (char *)&(add_style->flag_mask); merge_dflt = (char *)&(merged_style->flag_default); add_dflt = (char *)&(add_style->flag_default); merge_change_mask = (char *)&(merged_style->change_mask); add_change_mask = (char *)&(add_style->change_mask); for (i = 0; i < sizeof(style_flags); i++) { char m; /* overwrite set styles */ merge_flags[i] |= (add_flags[i] & add_mask[i]); merge_flags[i] &= (add_flags[i] | ~add_mask[i]); /* overwrite default values */ m = add_dflt[i] & ~add_mask[i] & ~merge_mask[i]; merge_flags[i] |= (add_flags[i] & m); merge_flags[i] &= (add_flags[i] | ~m); /* overwrite even weaker default values */ m = ~add_dflt[i] & ~add_mask[i] & ~merge_dflt[i] & ~merge_mask[i]; merge_flags[i] |= (add_flags[i] & m); merge_flags[i] &= (add_flags[i] | ~m); /* other flags */ merge_change_mask[i] &= ~(add_mask[i]); merge_change_mask[i] |= add_change_mask[i]; merge_mask[i] |= add_mask[i]; merge_dflt[i] |= add_dflt[i]; merge_dflt[i] &= ~merge_mask[i]; } merged_style->has_style_changed |= add_style->has_style_changed; return; } static void free_style(window_style *style) { /* Free contents of style */ SAFEFREE(SGET_NAME(*style)); SAFEFREE(SGET_BACK_COLOR_NAME(*style)); SAFEFREE(SGET_FORE_COLOR_NAME(*style)); SAFEFREE(SGET_BACK_COLOR_NAME_HI(*style)); SAFEFREE(SGET_FORE_COLOR_NAME_HI(*style)); SAFEFREE(SGET_DECOR_NAME(*style)); SAFEFREE(SGET_ICON_FONT(*style)); SAFEFREE(SGET_WINDOW_FONT(*style)); SAFEFREE(SGET_ICON_NAME(*style)); SAFEFREE(SGET_MINI_ICON_NAME(*style)); remove_icon_boxes_from_style(style); SAFEFREE(SGET_PLACEMENT_POSITION_STRING(*style)); SAFEFREE(SGET_INITIAL_MAP_COMMAND_STRING(*style)); SAFEFREE(SGET_TITLE_FORMAT_STRING(*style)); SAFEFREE(SGET_ICON_TITLE_FORMAT_STRING(*style)); return; } /* Frees only selected members of a style; adjusts the flag_mask and * change_mask appropriately. */ static void free_style_mask(window_style *style, style_flags *mask) { style_flags local_mask; style_flags *pmask; /* mask out all bits that are not set in the target style */ pmask =&local_mask; blockand((char *)pmask, (char *)&style->flag_mask, (char *)mask, sizeof(style_flags)); /* Free contents of style */ if (pmask->has_color_back) { SAFEFREE(SGET_BACK_COLOR_NAME(*style)); } if (pmask->has_color_fore) { SAFEFREE(SGET_FORE_COLOR_NAME(*style)); } if (pmask->has_color_back_hi) { SAFEFREE(SGET_BACK_COLOR_NAME_HI(*style)); } if (pmask->has_color_fore_hi) { SAFEFREE(SGET_FORE_COLOR_NAME_HI(*style)); } if (pmask->has_decor) { SAFEFREE(SGET_DECOR_NAME(*style)); } if (pmask->common.has_icon_font) { SAFEFREE(SGET_ICON_FONT(*style)); } if (pmask->common.has_window_font) { SAFEFREE(SGET_WINDOW_FONT(*style)); } if (pmask->has_icon) { SAFEFREE(SGET_ICON_NAME(*style)); } if (pmask->has_mini_icon) { SAFEFREE(SGET_MINI_ICON_NAME(*style)); } if (pmask->has_icon_boxes) { remove_icon_boxes_from_style(style); } /* remove styles from definitiion */ blockunmask((char *)&style->flag_mask, (char *)&style->flag_mask, (char *)pmask, sizeof(style_flags)); blockunmask((char *)&style->flag_default, (char *)&style->flag_default, (char *)pmask, sizeof(style_flags)); blockunmask((char *)&style->change_mask, (char *)&style->change_mask, (char *)pmask, sizeof(style_flags)); return; } static void add_style_to_list(window_style *new_style) { /* This used to contain logic that returned if the style didn't contain * anything. I don't see why we should bother. dje. * * used to merge duplicate entries, but that is no longer * appropriate since conflicting styles are possible, and the * last match should win! */ if (last_style_in_list != NULL) { /* not first entry in list chain this entry to the list */ SSET_NEXT_STYLE(*last_style_in_list, new_style); } else { /* first entry in list set the list root pointer. */ all_styles = new_style; } SSET_PREV_STYLE(*new_style, last_style_in_list); SSET_NEXT_STYLE(*new_style, NULL); last_style_in_list = new_style; Scr.flags.do_need_style_list_update = 1; return; } /* end function */ static void remove_style_from_list(window_style *style, Bool do_free_style) { window_style *prev; window_style *next; prev = SGET_PREV_STYLE(*style); next = SGET_NEXT_STYLE(*style); if (!prev) { /* first style in list */ all_styles = next; } else { /* not first style in list */ SSET_NEXT_STYLE(*prev, next); } if (!next) { /* last style in list */ last_style_in_list = prev; } else { SSET_PREV_STYLE(*next, prev); } if (do_free_style) { free_style(style); free(style); } } static int remove_all_of_style_from_list(style_id_t style_id) { window_style *nptr = all_styles; window_style *next; int is_changed = 0; /* loop though styles */ while (nptr) { next = SGET_NEXT_STYLE(*nptr); /* Check if it's to be wiped */ if (style_id_equals_id(nptr, &style_id)) { remove_style_from_list(nptr, True); is_changed = 1; } /* move on */ nptr = next; } return is_changed; } static int __simplify_style_list(void) { window_style *cur; int has_modified; /* Step 1: * Remove styles that are completely overridden by later * style definitions. At the same time... * Step 2: * Merge styles with the same name if there are no * conflicting styles with other names set in between. */ for ( cur = last_style_in_list, has_modified = 0; cur; cur = SGET_PREV_STYLE(*cur)) { style_flags dummyflags; /* incremental flags set in styles with the same name */ style_flags sumflags; style_flags sumdflags; /* incremental flags set in styles with other names */ style_flags interflags; window_style *cmp; memset(&interflags, 0, sizeof(style_flags)); memcpy(&sumflags, &cur->flag_mask, sizeof(style_flags)); memcpy(&sumdflags, &cur->flag_default, sizeof(style_flags)); cmp = SGET_PREV_STYLE(*cur); while (cmp) { if (!styles_have_same_id(cur, cmp)) { if (one_fw_can_match_both_ids(cur, cmp)) { blockor((char *)&interflags, (char *)&interflags, (char *)&cmp->flag_mask, sizeof(style_flags)); blockor((char *)&interflags, (char *)&interflags, (char *)&cmp->flag_default, sizeof(style_flags)); } cmp = SGET_PREV_STYLE(*cmp); continue; } if (blockissubset( (char *)&cmp->flag_mask, (char *)&sumflags, sizeof(style_flags)) && blockissubset( (char *)&cmp->flag_default, (char *)&sumdflags, sizeof(style_flags))) { /* The style is a subset of later style * definitions; nuke it */ window_style *tmp = SGET_PREV_STYLE(*cmp); remove_style_from_list(cmp, True); cmp = tmp; has_modified = 1; continue; } /* remove all styles that are overridden later from the * style */ blockor((char *)&dummyflags, (char *)&sumdflags, (char *)&sumflags, sizeof(style_flags)); free_style_mask(cmp, &dummyflags); if ( !blocksintersect( (char *)&cmp->flag_mask, (char *)&interflags, sizeof(style_flags)) && !blocksintersect( (char *)&cmp->flag_default, (char *)&interflags, sizeof(style_flags))) { /* merge old style into new style */ window_style *tmp = SGET_PREV_STYLE(*cmp); window_style *prev = SGET_PREV_STYLE(*cur); window_style *next = SGET_NEXT_STYLE(*cur); /* Add the style to the set */ blockor((char *)&sumflags, (char *)&sumflags, (char *)&cmp->flag_mask, sizeof(style_flags)); blockor((char *)&sumdflags, (char *)&sumflags, (char *)&cmp->flag_default, sizeof(style_flags)); /* merge cmp into cur and delete it * afterwards */ merge_styles(cmp, cur, True); free_style(cur); memcpy(cur, cmp, sizeof(window_style)); /* restore fields overwritten by memcpy */ SSET_PREV_STYLE(*cur, prev); SSET_NEXT_STYLE(*cur, next); /* remove the style without freeing the * memory */ remove_style_from_list(cmp, False); /* release the style structure */ free(cmp); cmp = tmp; has_modified = 1; } else if ( !blocksintersect( (char *)&cur->flag_mask, (char *)&interflags, sizeof(style_flags)) && !blocksintersect( (char *)&cur->flag_default, (char *)&interflags, sizeof(style_flags))) { /* merge new style into old style */ window_style *tmp = SGET_PREV_STYLE(*cmp); /* Add the style to the set */ blockor((char *)&sumflags, (char *)&sumflags, (char *)&cur->flag_mask, sizeof(style_flags)); blockor((char *)&sumdflags, (char *)&sumflags, (char *)&cur->flag_default, sizeof(style_flags)); /* merge cur into cmp and delete it * afterwards */ merge_styles(cmp, cur, True); remove_style_from_list(cur, True); cur = cmp; cmp = tmp; has_modified = 1; memset(&interflags, 0, sizeof(style_flags)); continue; } else { /* Add it to the set of interfering styles. */ blockor((char *)&interflags, (char *)&interflags, (char *)&cmp->flag_mask, sizeof(style_flags)); blockor((char *)&interflags, (char *)&interflags, (char *)&cmp->flag_default, sizeof(style_flags)); cmp = SGET_PREV_STYLE(*cmp); } } } return has_modified; } static void style_set_old_focus_policy(window_style *ps, int policy) { focus_policy_t fp; switch (policy) { case 0: /* ClickToFocus */ FPS_FOCUS_ENTER(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_UNFOCUS_LEAVE(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_CLICK_CLIENT(S_FOCUS_POLICY(SCF(*ps)), 1); FPS_FOCUS_CLICK_DECOR(S_FOCUS_POLICY(SCF(*ps)), 1); FPS_FOCUS_CLICK_ICON(S_FOCUS_POLICY(SCF(*ps)), 1); FPS_FOCUS_BY_FUNCTION(S_FOCUS_POLICY(SCF(*ps)), 1); FPS_FOCUS_BY_PROGRAM(fp, 1); FPS_GRAB_FOCUS(fp, 1); FPS_RELEASE_FOCUS(fp, 1); FPS_RAISE_FOCUSED_CLIENT_CLICK(fp, 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK(fp, 1); FPS_RAISE_FOCUSED_DECOR_CLICK(fp, 1); FPS_RAISE_UNFOCUSED_DECOR_CLICK(fp, 1); FPS_PASS_FOCUS_CLICK(fp, 1); FPS_PASS_RAISE_CLICK(fp, 1); FPS_ALLOW_FUNC_FOCUS_CLICK(fp, 1); FPS_ALLOW_FUNC_RAISE_CLICK(fp, 1); FPS_WARP_POINTER_ON_FOCUS_FUNC(fp, 0); break; case 1: /* MouseFocus */ FPS_FOCUS_ENTER(S_FOCUS_POLICY(SCF(*ps)), 1); FPS_UNFOCUS_LEAVE(S_FOCUS_POLICY(SCF(*ps)), 1); FPS_FOCUS_CLICK_CLIENT(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_CLICK_DECOR(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_CLICK_ICON(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_BY_FUNCTION(S_FOCUS_POLICY(SCF(*ps)), 1); FPS_FOCUS_BY_PROGRAM(fp, 1); FPS_GRAB_FOCUS(fp, 0); FPS_RELEASE_FOCUS(fp, 0); FPS_RAISE_FOCUSED_CLIENT_CLICK(fp, 0); FPS_RAISE_UNFOCUSED_CLIENT_CLICK(fp, 0); FPS_RAISE_FOCUSED_DECOR_CLICK(fp, 0); FPS_RAISE_UNFOCUSED_DECOR_CLICK(fp, 0); FPS_PASS_FOCUS_CLICK(fp, 1); FPS_PASS_RAISE_CLICK(fp, 1); FPS_ALLOW_FUNC_FOCUS_CLICK(fp, 0); FPS_ALLOW_FUNC_RAISE_CLICK(fp, 0); FPS_WARP_POINTER_ON_FOCUS_FUNC(fp, 1); break; case 2: /* SloppyFocus */ FPS_FOCUS_ENTER(S_FOCUS_POLICY(SCF(*ps)), 1); FPS_UNFOCUS_LEAVE(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_CLICK_CLIENT(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_CLICK_DECOR(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_CLICK_ICON(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_BY_FUNCTION(S_FOCUS_POLICY(SCF(*ps)), 1); FPS_FOCUS_BY_PROGRAM(fp, 1); FPS_GRAB_FOCUS(fp, 0); FPS_RELEASE_FOCUS(fp, 1); FPS_RAISE_FOCUSED_CLIENT_CLICK(fp, 0); FPS_RAISE_UNFOCUSED_CLIENT_CLICK(fp, 0); FPS_RAISE_FOCUSED_DECOR_CLICK(fp, 0); FPS_RAISE_UNFOCUSED_DECOR_CLICK(fp, 0); FPS_PASS_FOCUS_CLICK(fp, 1); FPS_PASS_RAISE_CLICK(fp, 1); FPS_ALLOW_FUNC_FOCUS_CLICK(fp, 0); FPS_ALLOW_FUNC_RAISE_CLICK(fp, 0); FPS_WARP_POINTER_ON_FOCUS_FUNC(fp, 1); break; case 3: /* NeverFocus */ FPS_FOCUS_ENTER(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_UNFOCUS_LEAVE(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_CLICK_CLIENT(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_CLICK_DECOR(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_CLICK_ICON(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_BY_FUNCTION(S_FOCUS_POLICY(SCF(*ps)), 0); FPS_FOCUS_BY_PROGRAM(fp, 1); FPS_GRAB_FOCUS(fp, 0); FPS_RELEASE_FOCUS(fp, 0); FPS_RAISE_FOCUSED_CLIENT_CLICK(fp, 0); FPS_RAISE_UNFOCUSED_CLIENT_CLICK(fp, 0); FPS_RAISE_FOCUSED_DECOR_CLICK(fp, 0); FPS_RAISE_UNFOCUSED_DECOR_CLICK(fp, 0); FPS_PASS_FOCUS_CLICK(fp, 1); FPS_PASS_RAISE_CLICK(fp, 1); FPS_ALLOW_FUNC_FOCUS_CLICK(fp, 1); FPS_ALLOW_FUNC_RAISE_CLICK(fp, 1); FPS_WARP_POINTER_ON_FOCUS_FUNC(fp, 0); break; } FPS_FOCUS_ENTER(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_FOCUS_ENTER(S_FOCUS_POLICY(SCC(*ps)), 1); FPS_UNFOCUS_LEAVE(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_UNFOCUS_LEAVE(S_FOCUS_POLICY(SCC(*ps)), 1); FPS_FOCUS_CLICK_CLIENT(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_FOCUS_CLICK_CLIENT(S_FOCUS_POLICY(SCC(*ps)), 1); FPS_FOCUS_CLICK_DECOR(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_FOCUS_CLICK_DECOR(S_FOCUS_POLICY(SCC(*ps)), 1); FPS_FOCUS_CLICK_ICON(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_FOCUS_CLICK_ICON(S_FOCUS_POLICY(SCC(*ps)), 1); FPS_FOCUS_BY_FUNCTION(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_FOCUS_BY_FUNCTION(S_FOCUS_POLICY(SCC(*ps)), 1); if (!FP_DO_FOCUS_BY_PROGRAM(S_FOCUS_POLICY(SCM(*ps)))) { FPS_FOCUS_BY_PROGRAM( S_FOCUS_POLICY(SCF(*ps)), FP_DO_FOCUS_BY_PROGRAM(fp)); FPS_FOCUS_BY_PROGRAM(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_FOCUS_BY_PROGRAM(S_FOCUS_POLICY(SCC(*ps)), 1); } if (!FP_DO_GRAB_FOCUS(S_FOCUS_POLICY(SCM(*ps)))) { FPS_GRAB_FOCUS(S_FOCUS_POLICY(SCF(*ps)), FP_DO_GRAB_FOCUS(fp)); FPS_GRAB_FOCUS(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_GRAB_FOCUS(S_FOCUS_POLICY(SCC(*ps)), 1); } if (!FP_DO_RELEASE_FOCUS(S_FOCUS_POLICY(SCM(*ps)))) { FPS_RELEASE_FOCUS( S_FOCUS_POLICY(SCF(*ps)), FP_DO_RELEASE_FOCUS(fp)); FPS_RELEASE_FOCUS(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_RELEASE_FOCUS(S_FOCUS_POLICY(SCC(*ps)), 1); } if (!FP_DO_RAISE_FOCUSED_CLIENT_CLICK(S_FOCUS_POLICY(SCM(*ps)))) { FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCF(*ps)), FP_DO_RAISE_FOCUSED_CLIENT_CLICK(fp)); FPS_RAISE_FOCUSED_CLIENT_CLICK(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_RAISE_FOCUSED_CLIENT_CLICK(S_FOCUS_POLICY(SCC(*ps)), 1); } if (!FP_DO_RAISE_UNFOCUSED_CLIENT_CLICK(S_FOCUS_POLICY(SCM(*ps)))) { FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCF(*ps)), FP_DO_RAISE_UNFOCUSED_CLIENT_CLICK(fp)); FPS_RAISE_UNFOCUSED_CLIENT_CLICK(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK(S_FOCUS_POLICY(SCC(*ps)), 1); } if (!FP_DO_RAISE_FOCUSED_DECOR_CLICK(S_FOCUS_POLICY(SCM(*ps)))) { FPS_RAISE_FOCUSED_DECOR_CLICK( S_FOCUS_POLICY(SCF(*ps)), FP_DO_RAISE_FOCUSED_DECOR_CLICK(fp)); FPS_RAISE_FOCUSED_DECOR_CLICK(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_RAISE_FOCUSED_DECOR_CLICK(S_FOCUS_POLICY(SCC(*ps)), 1); } if (!FP_DO_RAISE_UNFOCUSED_DECOR_CLICK(S_FOCUS_POLICY(SCM(*ps)))) { FPS_RAISE_UNFOCUSED_DECOR_CLICK( S_FOCUS_POLICY(SCF(*ps)), FP_DO_RAISE_UNFOCUSED_DECOR_CLICK(fp)); FPS_RAISE_UNFOCUSED_DECOR_CLICK(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_RAISE_UNFOCUSED_DECOR_CLICK(S_FOCUS_POLICY(SCC(*ps)), 1); } if (!FP_DO_PASS_FOCUS_CLICK(S_FOCUS_POLICY(SCM(*ps)))) { FPS_PASS_FOCUS_CLICK( S_FOCUS_POLICY(SCF(*ps)), FP_DO_PASS_FOCUS_CLICK(fp)); FPS_PASS_FOCUS_CLICK(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_PASS_FOCUS_CLICK(S_FOCUS_POLICY(SCC(*ps)), 1); } if (!FP_DO_PASS_RAISE_CLICK(S_FOCUS_POLICY(SCM(*ps)))) { FPS_PASS_RAISE_CLICK( S_FOCUS_POLICY(SCF(*ps)), FP_DO_PASS_RAISE_CLICK(fp)); FPS_PASS_RAISE_CLICK(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_PASS_RAISE_CLICK(S_FOCUS_POLICY(SCC(*ps)), 1); } if (!FP_DO_ALLOW_FUNC_FOCUS_CLICK(S_FOCUS_POLICY(SCM(*ps)))) { FPS_ALLOW_FUNC_FOCUS_CLICK( S_FOCUS_POLICY(SCF(*ps)), FP_DO_ALLOW_FUNC_FOCUS_CLICK(fp)); FPS_ALLOW_FUNC_FOCUS_CLICK(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_ALLOW_FUNC_FOCUS_CLICK(S_FOCUS_POLICY(SCC(*ps)), 1); } if (!FP_DO_ALLOW_FUNC_RAISE_CLICK(S_FOCUS_POLICY(SCM(*ps)))) { FPS_ALLOW_FUNC_RAISE_CLICK( S_FOCUS_POLICY(SCF(*ps)), FP_DO_ALLOW_FUNC_RAISE_CLICK(fp)); FPS_ALLOW_FUNC_RAISE_CLICK(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_ALLOW_FUNC_RAISE_CLICK(S_FOCUS_POLICY(SCC(*ps)), 1); } if (!FP_DO_WARP_POINTER_ON_FOCUS_FUNC( S_FOCUS_POLICY(SCM(*ps)))) { FPS_WARP_POINTER_ON_FOCUS_FUNC( S_FOCUS_POLICY(SCF(*ps)), FP_DO_WARP_POINTER_ON_FOCUS_FUNC(fp)); FPS_WARP_POINTER_ON_FOCUS_FUNC(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_WARP_POINTER_ON_FOCUS_FUNC(S_FOCUS_POLICY(SCC(*ps)), 1); } if (!FP_DO_SORT_WINDOWLIST_BY(S_FOCUS_POLICY(SCM(*ps)))) { FPS_SORT_WINDOWLIST_BY( S_FOCUS_POLICY(SCF(*ps)), FP_DO_SORT_WINDOWLIST_BY(fp)); FPS_SORT_WINDOWLIST_BY(S_FOCUS_POLICY(SCD(*ps)), 1); FPS_SORT_WINDOWLIST_BY(S_FOCUS_POLICY(SCC(*ps)), 1); } return; } static char *style_parse_button_style( window_style *ps, char *button_string, int on) { int button; char *rest; button = -1; GetIntegerArguments(button_string, &rest, &button, 1); button = BUTTON_INDEX(button); if (button < 0 || button >= NUMBER_OF_TITLE_BUTTONS) { fvwm_msg( ERR, "CMD_Style", "Button and NoButton styles require an argument"); } else { if (on) { ps->flags.is_button_disabled &= ~(1 << button); ps->flag_mask.is_button_disabled |= (1 << button); ps->change_mask.is_button_disabled |= (1 << button); } else { ps->flags.is_button_disabled |= (1 << button); ps->flag_mask.is_button_disabled |= (1 << button); ps->change_mask.is_button_disabled |= (1 << button); } } return rest; } static Bool style_parse_focus_policy_style( char *option, char *rest, char **ret_rest, Bool is_reversed, focus_policy_t *f, focus_policy_t *m, focus_policy_t *c) { char *optlist[] = { "SortWindowlistByFocus", "FocusClickButtons", "FocusClickModifiers", "ClickRaisesFocused", "ClickDecorRaisesFocused", "ClickIconRaisesFocused", "ClickRaisesUnfocused", "ClickDecorRaisesUnfocused", "ClickIconRaisesUnfocused", "ClickToFocus", "ClickDecorToFocus", "ClickIconToFocus", "EnterToFocus", "LeaveToUnfocus", "FocusByProgram", "FocusByFunction", "FocusByFunctionWarpPointer", "Lenient", "PassFocusClick", "PassRaiseClick", "IgnoreFocusClickMotion", "IgnoreRaiseClickMotion", "AllowFocusClickFunction", "AllowRaiseClickFunction", "GrabFocus", "GrabFocusTransient", "OverrideGrabFocus", "ReleaseFocus", "ReleaseFocusTransient", "OverrideReleaseFocus", NULL }; Bool found; int val; int index; char *token; if (ret_rest) { *ret_rest = rest; } found = True; val = !is_reversed; GetNextTokenIndex(option, optlist, 0, &index); switch (index) { case 0: /* SortWindowlistByFocus */ FPS_SORT_WINDOWLIST_BY( *f, (val) ? FPOL_SORT_WL_BY_FOCUS : FPOL_SORT_WL_BY_OPEN); FPS_SORT_WINDOWLIST_BY(*m, 1); FPS_SORT_WINDOWLIST_BY(*c, 1); break; case 1: /* FocusClickButtons */ if (is_reversed) { found = False; break; } token = PeekToken(rest, ret_rest); val = 0; for ( ; token != NULL && isdigit(*token); token++) { int button; char s[2]; s[0] = *token; s[1] = 0; button = atoi(s); if (button == 0) { val = ~0; } else if (button > NUMBER_OF_EXTENDED_MOUSE_BUTTONS) { break; } else { val |= (1 << (button - 1)); } } if (token != NULL && *token != 0) { fvwm_msg( ERR, "style_parse_focus_policy_style", "illegal mouse button '%c'", *token); val = DEF_FP_MOUSE_BUTTONS; } if (token == NULL) { val = DEF_FP_MOUSE_BUTTONS; } FPS_MOUSE_BUTTONS(*f, val); FPS_MOUSE_BUTTONS(*m, ~0); FPS_MOUSE_BUTTONS(*c, ~0); break; case 2: /* FocusClickModifiers */ if (is_reversed) { found = False; break; } token = PeekToken(rest, ret_rest); if (token == NULL || modifiers_string_to_modmask(token, &val) == 1) { val = DEF_FP_MODIFIERS; } if (val & AnyModifier) { val = FPOL_ANY_MODIFIER; } FPS_MODIFIERS(*f, val); FPS_MODIFIERS(*m, ~0); FPS_MODIFIERS(*c, ~0); break; case 3: /* ClickRaisesFocused */ FPS_RAISE_FOCUSED_CLIENT_CLICK(*f, val); FPS_RAISE_FOCUSED_CLIENT_CLICK(*m, 1); FPS_RAISE_FOCUSED_CLIENT_CLICK(*c, 1); break; case 4: /* ClickDecorRaisesFocused */ FPS_RAISE_FOCUSED_DECOR_CLICK(*f, val); FPS_RAISE_FOCUSED_DECOR_CLICK(*m, 1); FPS_RAISE_FOCUSED_DECOR_CLICK(*c, 1); break; case 5: /* ClickIconRaisesFocused */ FPS_RAISE_FOCUSED_ICON_CLICK(*f, val); FPS_RAISE_FOCUSED_ICON_CLICK(*m, 1); FPS_RAISE_FOCUSED_ICON_CLICK(*c, 1); break; case 6: /* ClickRaisesUnfocused */ FPS_RAISE_UNFOCUSED_CLIENT_CLICK(*f, val); FPS_RAISE_UNFOCUSED_CLIENT_CLICK(*m, 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK(*c, 1); break; case 7: /* ClickDecorRaisesUnfocused */ FPS_RAISE_UNFOCUSED_DECOR_CLICK(*f, val); FPS_RAISE_UNFOCUSED_DECOR_CLICK(*m, 1); FPS_RAISE_UNFOCUSED_DECOR_CLICK(*c, 1); break; case 8: /* ClickIconRaisesUnfocused */ FPS_RAISE_UNFOCUSED_ICON_CLICK(*f, val); FPS_RAISE_UNFOCUSED_ICON_CLICK(*m, 1); FPS_RAISE_UNFOCUSED_ICON_CLICK(*c, 1); break; case 9: /* ClickToFocus */ FPS_FOCUS_CLICK_CLIENT(*f, val); FPS_FOCUS_CLICK_CLIENT(*m, 1); FPS_FOCUS_CLICK_CLIENT(*c, 1); break; case 10: /* ClickDecorToFocus */ FPS_FOCUS_CLICK_DECOR(*f, val); FPS_FOCUS_CLICK_DECOR(*m, 1); FPS_FOCUS_CLICK_DECOR(*c, 1); break; case 11: /* ClickIconToFocus */ FPS_FOCUS_CLICK_ICON(*f, val); FPS_FOCUS_CLICK_ICON(*m, 1); FPS_FOCUS_CLICK_ICON(*c, 1); break; case 12: /* EnterToFocus */ FPS_FOCUS_ENTER(*f, val); FPS_FOCUS_ENTER(*m, 1); FPS_FOCUS_ENTER(*c, 1); break; case 13: /* LeaveToUnfocus */ FPS_UNFOCUS_LEAVE(*f, val); FPS_UNFOCUS_LEAVE(*m, 1); FPS_UNFOCUS_LEAVE(*c, 1); break; case 14: /* FocusByProgram */ FPS_FOCUS_BY_PROGRAM(*f, val); FPS_FOCUS_BY_PROGRAM(*m, 1); FPS_FOCUS_BY_PROGRAM(*c, 1); break; case 15: /* FocusByFunction */ FPS_FOCUS_BY_FUNCTION(*f, val); FPS_FOCUS_BY_FUNCTION(*m, 1); FPS_FOCUS_BY_FUNCTION(*c, 1); break; case 16: /* FocusByFunctionWarpPointer */ FPS_WARP_POINTER_ON_FOCUS_FUNC(*f, val); FPS_WARP_POINTER_ON_FOCUS_FUNC(*m, 1); FPS_WARP_POINTER_ON_FOCUS_FUNC(*c, 1); break; case 17: /* Lenient */ FPS_LENIENT(*f, val); FPS_LENIENT(*m, 1); FPS_LENIENT(*c, 1); break; case 18: /* PassFocusClick */ FPS_PASS_FOCUS_CLICK(*f, val); FPS_PASS_FOCUS_CLICK(*m, 1); FPS_PASS_FOCUS_CLICK(*c, 1); break; case 19: /* PassRaiseClick */ FPS_PASS_RAISE_CLICK(*f, val); FPS_PASS_RAISE_CLICK(*m, 1); FPS_PASS_RAISE_CLICK(*c, 1); break; case 20: /* IgnoreFocusClickMotion */ FPS_IGNORE_FOCUS_CLICK_MOTION(*f, val); FPS_IGNORE_FOCUS_CLICK_MOTION(*m, 1); FPS_IGNORE_FOCUS_CLICK_MOTION(*c, 1); break; case 21: /* IgnoreRaiseClickMotion */ FPS_IGNORE_RAISE_CLICK_MOTION(*f, val); FPS_IGNORE_RAISE_CLICK_MOTION(*m, 1); FPS_IGNORE_RAISE_CLICK_MOTION(*c, 1); break; case 22: /* AllowFocusClickFunction */ FPS_ALLOW_FUNC_FOCUS_CLICK(*f, val); FPS_ALLOW_FUNC_FOCUS_CLICK(*m, 1); FPS_ALLOW_FUNC_FOCUS_CLICK(*c, 1); break; case 23: /* AllowRaiseClickFunction */ FPS_ALLOW_FUNC_RAISE_CLICK(*f, val); FPS_ALLOW_FUNC_RAISE_CLICK(*m, 1); FPS_ALLOW_FUNC_RAISE_CLICK(*c, 1); break; case 24: /* GrabFocus */ FPS_GRAB_FOCUS(*f, val); FPS_GRAB_FOCUS(*m, 1); FPS_GRAB_FOCUS(*c, 1); break; case 25: /* GrabFocusTransient */ FPS_GRAB_FOCUS_TRANSIENT(*f, val); FPS_GRAB_FOCUS_TRANSIENT(*m, 1); FPS_GRAB_FOCUS_TRANSIENT(*c, 1); break; case 26: /* OverrideGrabFocus */ FPS_OVERRIDE_GRAB_FOCUS(*f, val); FPS_OVERRIDE_GRAB_FOCUS(*m, 1); FPS_OVERRIDE_GRAB_FOCUS(*c, 1); break; case 27: /* ReleaseFocus */ FPS_RELEASE_FOCUS(*f, val); FPS_RELEASE_FOCUS(*m, 1); FPS_RELEASE_FOCUS(*c, 1); break; case 28: /* ReleaseFocusTransient */ FPS_RELEASE_FOCUS_TRANSIENT(*f, val); FPS_RELEASE_FOCUS_TRANSIENT(*m, 1); FPS_RELEASE_FOCUS_TRANSIENT(*c, 1); break; case 29: /* OverrideReleaseFocus */ FPS_OVERRIDE_RELEASE_FOCUS(*f, val); FPS_OVERRIDE_RELEASE_FOCUS(*m, 1); FPS_OVERRIDE_RELEASE_FOCUS(*c, 1); break; default: found = False; break; } return found; } static char *style_parse_icon_size_style( char *option, char *rest, window_style *ps) { int vals[4]; int i; option = PeekToken(rest, NULL); if (StrEquals(option, "Stretched")) { SSET_ICON_RESIZE_TYPE(*ps, ICON_RESIZE_TYPE_STRETCHED); option = PeekToken(rest, &rest); } else if (StrEquals(option, "Adjusted")) { SSET_ICON_RESIZE_TYPE(*ps, ICON_RESIZE_TYPE_ADJUSTED); option = PeekToken(rest, &rest); } else if (StrEquals(option, "Shrunk")) { SSET_ICON_RESIZE_TYPE(*ps, ICON_RESIZE_TYPE_SHRUNK); option = PeekToken(rest, &rest); } else { SSET_ICON_RESIZE_TYPE(*ps, ICON_RESIZE_TYPE_NONE); } switch (GetIntegerArguments(rest, &rest, vals, 4)) { case 0: /* No arguments results in default values */ vals[0] = vals[1] = UNSPECIFIED_ICON_DIMENSION; /* fall through */ case 2: /* Max and min values are the same */ vals[2] = vals[0]; vals[3] = vals[1]; /* fall through */ case 4: /* Validate values */ for (i = 0; i < 4; i++) { int use_default = 0; if (vals[i] != UNSPECIFIED_ICON_DIMENSION && (vals[i] < MIN_ALLOWABLE_ICON_DIMENSION || vals[i] > MAX_ALLOWABLE_ICON_DIMENSION)) { fvwm_msg( ERR, "CMD_Style", "IconSize dimension (%d) not in valid" " range (%d-%d)", vals[i], MIN_ALLOWABLE_ICON_DIMENSION, MAX_ALLOWABLE_ICON_DIMENSION); use_default = 1; } /* User requests default value for this dimension */ else if (vals[i] == UNSPECIFIED_ICON_DIMENSION) { use_default = 1; } if (use_default) { /* Set default value for this dimension. The * first two indexes refer to min values, the * latter two to max values. */ vals[i] = i < 2 ? MIN_ALLOWABLE_ICON_DIMENSION : MAX_ALLOWABLE_ICON_DIMENSION; } } SSET_MIN_ICON_WIDTH(*ps, vals[0]); SSET_MIN_ICON_HEIGHT(*ps, vals[1]); SSET_MAX_ICON_WIDTH(*ps, vals[2]); SSET_MAX_ICON_HEIGHT(*ps, vals[3]); ps->flags.has_icon_size_limits = 1; ps->flag_mask.has_icon_size_limits = 1; ps->change_mask.has_icon_size_limits = 1; break; default: fvwm_msg( ERR, "CMD_Style", "IconSize requires exactly 0, 2 or 4" " numerical arguments"); break; } return rest; } static char *style_parse_icon_box_style( icon_boxes **ret_ib, char *option, char *rest, window_style *ps) { icon_boxes *IconBoxes = NULL; Bool is_screen_given = False; int val[4]; int num; int i; option = PeekToken(rest, NULL); if (!option || StrEquals(option, "none")) { option = PeekToken(rest, &rest); /* delete icon boxes from style */ if (SGET_ICON_BOXES(*ps)) { remove_icon_boxes_from_style(ps); } (*ret_ib) = NULL; if (option) { /* disable default icon box */ S_SET_DO_IGNORE_ICON_BOXES(SCF(*ps), 1); } else { /* use default icon box */ S_SET_DO_IGNORE_ICON_BOXES(SCF(*ps), 0); } S_SET_DO_IGNORE_ICON_BOXES(SCM(*ps), 1); S_SET_DO_IGNORE_ICON_BOXES(SCC(*ps), 1); ps->flags.has_icon_boxes = 0; ps->flag_mask.has_icon_boxes = 1; ps->change_mask.has_icon_boxes = 1; return rest; } /* otherwise try to parse the icon box */ IconBoxes = (icon_boxes *)safemalloc(sizeof(icon_boxes)); /* clear it */ memset(IconBoxes, 0, sizeof(icon_boxes)); IconBoxes->IconScreen = FSCREEN_GLOBAL; /* init grid x */ IconBoxes->IconGrid[0] = 3; /* init grid y */ IconBoxes->IconGrid[1] = 3; /* check for screen (for 4 numbers) */ if (StrEquals(option, "screen")) { is_screen_given = True; option = PeekToken(rest, &rest); /* skip screen */ option = PeekToken(rest, &rest); /* get the screen spec */ IconBoxes->IconScreen = FScreenGetScreenArgument(option, FSCREEN_SPEC_PRIMARY); } /* try for 4 numbers x y x y */ num = GetIntegerArguments(rest, NULL, val, 4); /* if 4 numbers */ if (num == 4) { for (i = 0; i < 4; i++) { /* make sure the value fits into a short */ if (val[i] < -32768) { val[i] = -32768; } if (val[i] > 32767) { val[i] = 32767; } IconBoxes->IconBox[i] = val[i]; /* If leading minus sign */ option = PeekToken(rest, &rest); if (option[0] == '-') { IconBoxes->IconSign[i]='-'; } /* end leading minus sign */ } /* Note: here there is no test for valid co-ords, use geom */ } else if (is_screen_given) { /* screen-spec is given but not 4 numbers */ fvwm_msg( ERR,"CMD_Style", "IconBox requires 4 numbers if screen is given!" " Invalid: <%s>.", option); /* Drop the box */ free(IconBoxes); /* forget about it */ IconBoxes = 0; } else { /* Not 4 numeric args dje */ /* bigger than =32767x32767+32767+32767 */ int geom_flags; int l; int width; int height; /* read in 1 word w/o advancing */ option = PeekToken(rest, NULL); if (!option) { return rest; } l = strlen(option); if (l > 0 && l < 24) { /* advance */ option = PeekToken(rest, &rest); /* if word found, not too long */ geom_flags = FScreenParseGeometryWithScreen( option, &IconBoxes->IconBox[0], &IconBoxes->IconBox[1], (unsigned int*)&width, (unsigned int*)&height, &IconBoxes->IconScreen); if (width == 0 || !(geom_flags & WidthValue)) { /* zero width is invalid */ fvwm_msg( ERR,"CMD_Style", "IconBox requires 4 numbers or" " geometry! Invalid string <%s>.", option); /* Drop the box */ free(IconBoxes); /* forget about it */ IconBoxes = 0; } else { /* got valid iconbox geom */ if (geom_flags & XNegative) { IconBoxes->IconBox[0] = /* neg x coord */ IconBoxes->IconBox[0] - width - 2; /* save for later */ IconBoxes->IconSign[0]='-'; IconBoxes->IconSign[2]='-'; } if (geom_flags & YNegative) { IconBoxes->IconBox[1] = /* neg y coord */ IconBoxes->IconBox[1] - height -2; /* save for later */ IconBoxes->IconSign[1]='-'; IconBoxes->IconSign[3]='-'; } /* x + wid = right x */ IconBoxes->IconBox[2] = width + IconBoxes->IconBox[0]; /* y + height = bottom y */ IconBoxes->IconBox[3] = height + IconBoxes->IconBox[1]; } /* end icon geom worked */ } else { /* no word or too long; drop the box */ free(IconBoxes); /* forget about it */ IconBoxes = 0; } /* end word found, not too long */ } /* end not 4 args */ /* If we created an IconBox, put it in the chain. */ if (IconBoxes != 0) { /* no error */ if (SGET_ICON_BOXES(*ps) == 0) { /* first one, chain to root */ SSET_ICON_BOXES(*ps, IconBoxes); } else { /* else not first one, add to end of chain */ (*ret_ib)->next = IconBoxes; } /* end not first one */ /* new current box. save for grid */ (*ret_ib) = IconBoxes; } /* end no error */ S_SET_DO_IGNORE_ICON_BOXES(SCF(*ps), 0); S_SET_DO_IGNORE_ICON_BOXES(SCM(*ps), 1); S_SET_DO_IGNORE_ICON_BOXES(SCC(*ps), 1); ps->flags.has_icon_boxes = !!(SGET_ICON_BOXES(*ps)); ps->flag_mask.has_icon_boxes = 1; ps->change_mask.has_icon_boxes = 1; return rest; } static char *style_parse_icon_grid_style( char *option, char *rest, window_style *ps, icon_boxes *ib) { int val[4]; int num; int i; /* The grid always affects the prior iconbox */ if (ib == 0) { /* If no current box */ fvwm_msg( ERR,"CMD_Style", "IconGrid must follow an IconBox in same Style" " command"); return rest; } /* have a place to grid */ /* 2 ints */ num = GetIntegerArguments(rest, &rest, val, 2); if (num != 2 || val[0] < 1 || val[1] < 1) { fvwm_msg( ERR,"CMD_Style", "IconGrid needs 2 numbers > 0. Got %d numbers." " x=%d y=%d!", num, val[0], val[1]); /* reset grid */ ib->IconGrid[0] = 3; ib->IconGrid[1] = 3; } else { for (i = 0; i < 2; i++) { ib->IconGrid[i] = val[i]; } } /* end bad grid */ return rest; } static char *style_parse_icon_fill_style( char *option, char *rest, window_style *ps, icon_boxes *ib) { /* first type direction parsed */ unsigned char IconFill_1; /* second type direction parsed */ unsigned char IconFill_2; /* direction to fill iconbox */ /* The fill always affects the prior iconbox */ if (ib == 0) { /* If no current box */ fvwm_msg( ERR,"CMD_Style", "IconFill must follow an IconBox in same Style" " command"); return rest; } /* have a place to fill */ option = PeekToken(rest, &rest); /* top/bot/lft/rgt */ if (!option || Get_TBLR(option, &IconFill_1) == 0) { /* its wrong */ if (!option) { option = "(none)"; } fvwm_msg( ERR,"CMD_Style", "IconFill must be followed by T|B|R|L, found" " %s.", option); return rest; } /* first word valid */ /* read in second word */ option = PeekToken(rest, &rest); /* top/bot/lft/rgt */ if (!option || Get_TBLR(option, &IconFill_2) == 0) { /* its wrong */ if (!option) { option = "(none)"; } fvwm_msg( ERR,"CMD_Style", "IconFill must be followed by T|B|R|L," " found %s.", option); return rest; } if ((IconFill_1 & ICONFILLHRZ) == (IconFill_2 & ICONFILLHRZ)) { fvwm_msg( ERR, "CMD_Style", "IconFill must specify a horizontal" " and vertical direction."); return rest; } /* Its valid! */ /* merge in flags */ ib->IconFlags |= IconFill_1; /* ignore horiz in 2nd arg */ IconFill_2 &= ~ICONFILLHRZ; /* merge in flags */ ib->IconFlags |= IconFill_2; return rest; } static Bool style_parse_one_style_option( char *token, char *rest, char **ret_rest, char *prefix, window_style *ps, icon_boxes **cur_ib) { window_style *add_style; /* work area for button number */ int num; int i; int tmpno[3] = { -1, -1, -1 }; int val[4]; int spargs = 0; Bool found; int on; char *token_l = NULL; found = True; on = 1; while (token[0] == '!') { on ^= 1; token++; } if (prefix != NULL && *prefix != 0) { int l; l = strlen(prefix); if (strncasecmp(token, prefix, l) != 0) { /* add missing prefix */ token_l = (char *)safemalloc(l + strlen(token) + 1); strcpy(token_l, prefix); strcat(token_l, token); token = token_l; } } switch (tolower(token[0])) { case 'a': if (StrEquals(token, "ACTIVEPLACEMENT")) { ps->flags.placement_mode &= (~PLACE_RANDOM); ps->flag_mask.placement_mode |= PLACE_RANDOM; ps->change_mask.placement_mode |= PLACE_RANDOM; } else if (StrEquals(token, "ACTIVEPLACEMENTHONORSSTARTSONPAGE")) { ps->flags.manual_placement_honors_starts_on_page = on; ps->flag_mask.manual_placement_honors_starts_on_page = 1; ps->change_mask.manual_placement_honors_starts_on_page = 1; } else if (StrEquals( token, "ACTIVEPLACEMENTIGNORESSTARTSONPAGE")) { ps->flags.manual_placement_honors_starts_on_page = !on; ps->flag_mask.manual_placement_honors_starts_on_page = 1; ps->change_mask.manual_placement_honors_starts_on_page = 1; } else if (StrEquals(token, "AllowRestack")) { S_SET_DO_IGNORE_RESTACK(SCF(*ps), !on); S_SET_DO_IGNORE_RESTACK(SCM(*ps), 1); S_SET_DO_IGNORE_RESTACK(SCC(*ps), 1); } else if (StrEquals(token, "AllowMaximizeFixedSize")) { S_SET_MAXIMIZE_FIXED_SIZE_DISALLOWED(SCF(*ps), !on); S_SET_MAXIMIZE_FIXED_SIZE_DISALLOWED(SCM(*ps), 1); S_SET_MAXIMIZE_FIXED_SIZE_DISALLOWED(SCC(*ps), 1); } else { found = False; } break; case 'b': if (StrEquals(token, "BackColor")) { rest = GetNextToken(rest, &token); if (token) { SAFEFREE(SGET_BACK_COLOR_NAME(*ps)); SSET_BACK_COLOR_NAME(*ps, token); ps->flags.has_color_back = 1; ps->flag_mask.has_color_back = 1; ps->change_mask.has_color_back = 1; ps->flags.use_colorset = 0; ps->flag_mask.use_colorset = 1; ps->change_mask.use_colorset = 1; } else { fvwm_msg( ERR, "style_parse_on_estyle_option", "Style BackColor requires color" " argument"); } } else if (StrEquals(token, "Button")) { rest = style_parse_button_style(ps, rest, on); } else if (StrEquals(token, "BorderWidth")) { if (GetIntegerArguments(rest, &rest, val, 1)) { SSET_BORDER_WIDTH(*ps, (short)*val); ps->flags.has_border_width = 1; ps->flag_mask.has_border_width = 1; ps->change_mask.has_border_width = 1; } else { ps->flags.has_border_width = 0; ps->flag_mask.has_border_width = 1; ps->change_mask.has_border_width = 1; } } else if (StrEquals(token, "BackingStore")) { ps->flags.use_backing_store = BACKINGSTORE_ON; ps->flag_mask.use_backing_store = BACKINGSTORE_MASK; ps->change_mask.use_backing_store = BACKINGSTORE_MASK; } else if (StrEquals(token, "BackingStoreOff")) { ps->flags.use_backing_store = BACKINGSTORE_OFF; ps->flag_mask.use_backing_store = BACKINGSTORE_MASK; ps->change_mask.use_backing_store = BACKINGSTORE_MASK; } else if (StrEquals(token, "BackingStoreWindowDefault")) { ps->flags.use_backing_store = BACKINGSTORE_DEFAULT; ps->flag_mask.use_backing_store = BACKINGSTORE_MASK; ps->change_mask.use_backing_store = BACKINGSTORE_MASK; } else if (StrEquals(token, "BorderColorset")) { *val = -1; GetIntegerArguments(rest, &rest, val, 1); SSET_BORDER_COLORSET(*ps, *val); alloc_colorset(*val); ps->flags.use_border_colorset = (*val >= 0); ps->flag_mask.use_border_colorset = 1; ps->change_mask.use_border_colorset = 1; } else if (StrEquals(token, "BottomTitleRotated")) { S_SET_IS_BOTTOM_TITLE_ROTATED(SCF(*ps), on); S_SET_IS_BOTTOM_TITLE_ROTATED(SCM(*ps), 1); S_SET_IS_BOTTOM_TITLE_ROTATED(SCC(*ps), 1); } else if (StrEquals(token, "BottomTitleNotRotated")) { S_SET_IS_BOTTOM_TITLE_ROTATED(SCF(*ps), !on); S_SET_IS_BOTTOM_TITLE_ROTATED(SCM(*ps), 1); S_SET_IS_BOTTOM_TITLE_ROTATED(SCC(*ps), 1); } else if (StrEquals(token, "Borders")) { S_SET_HAS_NO_BORDER(SCF(*ps), !on); S_SET_HAS_NO_BORDER(SCM(*ps), 1); S_SET_HAS_NO_BORDER(SCC(*ps), 1); } else { found = False; } break; case 'c': if (StrEquals(token, "CascadePlacement")) { ps->flags.placement_mode = PLACE_CASCADE; ps->flag_mask.placement_mode = PLACE_MASK; ps->change_mask.placement_mode = PLACE_MASK; } else if (StrEquals(token, "CLEVERPLACEMENT")) { ps->flags.placement_mode |= PLACE_CLEVER; ps->flag_mask.placement_mode |= PLACE_CLEVER; ps->change_mask.placement_mode |= PLACE_CLEVER; } else if (StrEquals(token, "CleverPlacementOff")) { ps->flags.placement_mode &= (~PLACE_CLEVER); ps->flag_mask.placement_mode |= PLACE_CLEVER; ps->change_mask.placement_mode |= PLACE_CLEVER; } else if (StrEquals(token, "CaptureHonorsStartsOnPage")) { ps->flags.capture_honors_starts_on_page = on; ps->flag_mask.capture_honors_starts_on_page = 1; ps->change_mask.capture_honors_starts_on_page = 1; } else if (StrEquals(token, "CaptureIgnoresStartsonPage")) { ps->flags.capture_honors_starts_on_page = !on; ps->flag_mask.capture_honors_starts_on_page = 1; ps->change_mask.capture_honors_starts_on_page = 1; } else if (StrEquals(token, "ColorSet")) { *val = -1; GetIntegerArguments(rest, &rest, val, 1); if (*val < 0) { *val = -1; } SSET_COLORSET(*ps, *val); alloc_colorset(*val); ps->flags.use_colorset = (*val >= 0); ps->flag_mask.use_colorset = 1; ps->change_mask.use_colorset = 1; } else if (StrEquals(token, "Color")) { char c = 0; char *next; next = GetNextToken(rest, &token); if (token == NULL) { fvwm_msg( ERR, "style_parse_one_style_option", "Color Style requires a color" " argument"); break; } if (strncasecmp(token, "rgb:", 4) == 0) { char *s; int i; /* spool to third '/' */ for (i = 0, s = token + 4; *s && i < 3; s++) { if (*s == '/') { i++; } } s--; if (i == 3) { *s = 0; /* spool to third '/' in original * string too */ for (i = 0, s = rest; *s && i < 3; s++) { if (*s == '/') { i++; } } next = s - 1; } } else { free(token); next = DoGetNextToken( rest, &token, NULL, ",/", &c); } rest = next; SAFEFREE(SGET_FORE_COLOR_NAME(*ps)); SSET_FORE_COLOR_NAME(*ps, token); ps->flags.has_color_fore = 1; ps->flag_mask.has_color_fore = 1; ps->change_mask.has_color_fore = 1; ps->flags.use_colorset = 0; ps->flag_mask.use_colorset = 1; ps->change_mask.use_colorset = 1; /* skip over '/' */ if (c != '/') { while (rest && *rest && isspace((unsigned char)*rest) && *rest != ',' && *rest != '/') { rest++; } if (*rest == '/') { rest++; } } rest=GetNextToken(rest, &token); if (!token) { fvwm_msg( ERR, "style_parse_one_style_option", "Color Style called with incomplete" " color argument."); break; } SAFEFREE(SGET_BACK_COLOR_NAME(*ps)); SSET_BACK_COLOR_NAME(*ps, token); ps->flags.has_color_back = 1; ps->flag_mask.has_color_back = 1; ps->change_mask.has_color_back = 1; break; } else if (StrEquals(token, "CirculateSkipIcon")) { S_SET_DO_CIRCULATE_SKIP_ICON(SCF(*ps), on); S_SET_DO_CIRCULATE_SKIP_ICON(SCM(*ps), 1); S_SET_DO_CIRCULATE_SKIP_ICON(SCC(*ps), 1); } else if (StrEquals(token, "CirculateSkipShaded")) { S_SET_DO_CIRCULATE_SKIP_SHADED(SCF(*ps), on); S_SET_DO_CIRCULATE_SKIP_SHADED(SCM(*ps), 1); S_SET_DO_CIRCULATE_SKIP_SHADED(SCC(*ps), 1); } else if (StrEquals(token, "CirculateHitShaded")) { S_SET_DO_CIRCULATE_SKIP_SHADED(SCF(*ps), !on); S_SET_DO_CIRCULATE_SKIP_SHADED(SCM(*ps), 1); S_SET_DO_CIRCULATE_SKIP_SHADED(SCC(*ps), 1); } else if (StrEquals(token, "CirculateHitIcon")) { S_SET_DO_CIRCULATE_SKIP_ICON(SCF(*ps), !on); S_SET_DO_CIRCULATE_SKIP_ICON(SCM(*ps), 1); S_SET_DO_CIRCULATE_SKIP_ICON(SCC(*ps), 1); } else if (StrEquals(token, "ClickToFocus")) { style_set_old_focus_policy(ps, 0); } else if (StrEquals(token, "ClickToFocusPassesClick")) { FPS_PASS_FOCUS_CLICK(S_FOCUS_POLICY(SCF(*ps)), on); FPS_PASS_FOCUS_CLICK(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_PASS_FOCUS_CLICK(S_FOCUS_POLICY(SCC(*ps)), 1); FPS_PASS_RAISE_CLICK(S_FOCUS_POLICY(SCF(*ps)), on); FPS_PASS_RAISE_CLICK(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_PASS_RAISE_CLICK(S_FOCUS_POLICY(SCC(*ps)), 1); } else if (StrEquals(token, "ClickToFocusPassesClickOff")) { FPS_PASS_FOCUS_CLICK(S_FOCUS_POLICY(SCF(*ps)), !on); FPS_PASS_FOCUS_CLICK(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_PASS_FOCUS_CLICK(S_FOCUS_POLICY(SCC(*ps)), 1); FPS_PASS_RAISE_CLICK(S_FOCUS_POLICY(SCF(*ps)), !on); FPS_PASS_RAISE_CLICK(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_PASS_RAISE_CLICK(S_FOCUS_POLICY(SCC(*ps)), 1); } else if (StrEquals(token, "ClickToFocusRaises")) { FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCF(*ps)), on); FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCM(*ps)), 1); FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCC(*ps)), 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCF(*ps)), on); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCM(*ps)), 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCC(*ps)), 1); } else if (StrEquals(token, "ClickToFocusRaisesOff")) { FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCF(*ps)), !on); FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCM(*ps)), 1); FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCC(*ps)), 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCF(*ps)), !on); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCM(*ps)), 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCC(*ps)), 1); } else if (StrEquals(token, "CirculateSkip")) { S_SET_DO_CIRCULATE_SKIP(SCF(*ps), on); S_SET_DO_CIRCULATE_SKIP(SCM(*ps), 1); S_SET_DO_CIRCULATE_SKIP(SCC(*ps), 1); } else if (StrEquals(token, "CirculateHit")) { S_SET_DO_CIRCULATE_SKIP(SCF(*ps), !on); S_SET_DO_CIRCULATE_SKIP(SCM(*ps), 1); S_SET_DO_CIRCULATE_SKIP(SCC(*ps), 1); } else if (StrEquals(token, "Closable")) { S_SET_IS_UNCLOSABLE(SCF(*ps), !on); S_SET_IS_UNCLOSABLE(SCM(*ps), 1); S_SET_IS_UNCLOSABLE(SCC(*ps), 1); } else { found = False; } break; case 'd': if (StrEquals(token, "DepressableBorder")) { S_SET_HAS_DEPRESSABLE_BORDER(SCF(*ps), on); S_SET_HAS_DEPRESSABLE_BORDER(SCM(*ps), 1); S_SET_HAS_DEPRESSABLE_BORDER(SCC(*ps), 1); } else if (StrEquals(token, "DecorateTransient")) { ps->flags.do_decorate_transient = on; ps->flag_mask.do_decorate_transient = 1; ps->change_mask.do_decorate_transient = 1; } else if (StrEquals(token, "DumbPlacement")) { ps->flags.placement_mode &= (~PLACE_SMART); ps->flag_mask.placement_mode |= PLACE_SMART; ps->change_mask.placement_mode |= PLACE_SMART; } else if (StrEquals(token, "DONTRAISETRANSIENT")) { S_SET_DO_RAISE_TRANSIENT(SCF(*ps), !on); S_SET_DO_RAISE_TRANSIENT(SCM(*ps), 1); S_SET_DO_RAISE_TRANSIENT(SCC(*ps), 1); } else if (StrEquals(token, "DONTLOWERTRANSIENT")) { S_SET_DO_LOWER_TRANSIENT(SCF(*ps), !on); S_SET_DO_LOWER_TRANSIENT(SCM(*ps), 1); S_SET_DO_LOWER_TRANSIENT(SCC(*ps), 1); } else if (StrEquals(token, "DontStackTransientParent")) { S_SET_DO_STACK_TRANSIENT_PARENT(SCF(*ps), !on); S_SET_DO_STACK_TRANSIENT_PARENT(SCM(*ps), 1); S_SET_DO_STACK_TRANSIENT_PARENT(SCC(*ps), 1); } else { found = False; } break; case 'e': if (StrEquals(token, "ExactWindowName")) { char *format; /* TA: This is being deprecated in favour of the more * generic: * * TitleFormat %n */ fvwm_msg(WARN, "style_parse_one_style_option", "ExactWindowName is deprecated -- using" " TitleFormat %%n"); format = strdup(DEFAULT_TITLE_FORMAT); SSET_TITLE_FORMAT_STRING(*ps, format); ps->flags.has_title_format_string = 1; ps->flag_mask.has_title_format_string = 1; ps->change_mask.has_title_format_string = 1; } else if (StrEquals(token, "ExactIconName")) { char *format; /* TA: This is being deprecated in favour of the more * generic: * * IconTitleFormat %n */ fvwm_msg(WARN, "style_parse_one_style_option", "ExactIconName is deprecated -- using" " IconTitleFormat %%n"); format = strdup(DEFAULT_TITLE_FORMAT); SSET_ICON_TITLE_FORMAT_STRING(*ps, format); ps->flags.has_icon_title_format_string = 1; ps->flag_mask.has_icon_title_format_string = 1; ps->change_mask.has_icon_title_format_string = 1; } else if (StrEquals(token, "EdgeMoveResistance")) { int num; unsigned has_move; unsigned has_xinerama_move; num = GetIntegerArguments(rest, &rest, val, 2); if (num == 1) { has_move = 1; has_xinerama_move = 0; } else if (num == 2) { has_move = 1; has_xinerama_move = 1; } else { val[0] = 0; val[1] = 0; has_move = 0; has_xinerama_move = 0; } if (val[0] < 0) { val[0] = 0; } if (val[1] < 0) { val[1] = 0; } ps->flags.has_edge_resistance_move = has_move; ps->flag_mask.has_edge_resistance_move = 1; ps->change_mask.has_edge_resistance_move = 1; SSET_EDGE_RESISTANCE_MOVE(*ps, val[0]); ps->flags.has_edge_resistance_xinerama_move = has_xinerama_move; ps->flag_mask.has_edge_resistance_xinerama_move = 1; ps->change_mask.has_edge_resistance_xinerama_move = 1; SSET_EDGE_RESISTANCE_XINERAMA_MOVE(*ps, val[1]); } else if (StrEquals(token, "EdgeMoveDelay")) { if (GetIntegerArguments(rest, &rest, val, 1)) { SSET_EDGE_DELAY_MS_MOVE(*ps, (short)*val); ps->flags.has_edge_delay_ms_move = 1; ps->flag_mask.has_edge_delay_ms_move = 1; ps->change_mask.has_edge_delay_ms_move = 1; } else { ps->flags.has_edge_delay_ms_move = 0; ps->flag_mask.has_edge_delay_ms_move = 1; ps->change_mask.has_edge_delay_ms_move = 1; } } else if (StrEquals(token, "EdgeResizeDelay")) { if (GetIntegerArguments(rest, &rest, val, 1)) { SSET_EDGE_DELAY_MS_RESIZE(*ps, (short)*val); ps->flags.has_edge_delay_ms_resize = 1; ps->flag_mask.has_edge_delay_ms_resize = 1; ps->change_mask.has_edge_delay_ms_resize = 1; } else { ps->flags.has_edge_delay_ms_resize = 0; ps->flag_mask.has_edge_delay_ms_resize = 1; ps->change_mask.has_edge_delay_ms_resize = 1; } } else { found = EWMH_CMD_Style(token, ps, on); } break; case 'f': if (strncasecmp(token, "fp", 2) == 0) { /* parse focus policy options */ found = style_parse_focus_policy_style( token + 2, rest, &rest, (on) ? False : True, &S_FOCUS_POLICY(SCF(*ps)), &S_FOCUS_POLICY(SCM(*ps)), &S_FOCUS_POLICY(SCC(*ps))); } else if (StrEquals(token, "Font")) { SAFEFREE(SGET_WINDOW_FONT(*ps)); rest = GetNextToken(rest, &token); SSET_WINDOW_FONT(*ps, token); S_SET_HAS_WINDOW_FONT(SCF(*ps), (token != NULL)); S_SET_HAS_WINDOW_FONT(SCM(*ps), 1); S_SET_HAS_WINDOW_FONT(SCC(*ps), 1); } else if (StrEquals(token, "ForeColor")) { rest = GetNextToken(rest, &token); if (token) { SAFEFREE(SGET_FORE_COLOR_NAME(*ps)); SSET_FORE_COLOR_NAME(*ps, token); ps->flags.has_color_fore = 1; ps->flag_mask.has_color_fore = 1; ps->change_mask.has_color_fore = 1; ps->flags.use_colorset = 0; ps->flag_mask.use_colorset = 1; ps->change_mask.use_colorset = 1; } else { fvwm_msg( ERR, "style_parse_one_style_option", "ForeColor Style needs color argument" ); } } else if (StrEquals(token, "FVWMBUTTONS")) { S_SET_HAS_MWM_BUTTONS(SCF(*ps), !on); S_SET_HAS_MWM_BUTTONS(SCM(*ps), 1); S_SET_HAS_MWM_BUTTONS(SCC(*ps), 1); } else if (StrEquals(token, "FVWMBORDER")) { S_SET_HAS_MWM_BORDER(SCF(*ps), !on); S_SET_HAS_MWM_BORDER(SCM(*ps), 1); S_SET_HAS_MWM_BORDER(SCC(*ps), 1); } else if (StrEquals(token, "FocusFollowsMouse")) { style_set_old_focus_policy(ps, 1); } else if (StrEquals(token, "FirmBorder")) { S_SET_HAS_DEPRESSABLE_BORDER(SCF(*ps), !on); S_SET_HAS_DEPRESSABLE_BORDER(SCM(*ps), 1); S_SET_HAS_DEPRESSABLE_BORDER(SCC(*ps), 1); } else if (StrEquals(token, "FixedPosition") || StrEquals(token, "FixedUSPosition")) { S_SET_IS_FIXED(SCF(*ps), on); S_SET_IS_FIXED(SCM(*ps), 1); S_SET_IS_FIXED(SCC(*ps), 1); } else if (StrEquals(token, "FixedPPosition")) { S_SET_IS_FIXED_PPOS(SCF(*ps), on); S_SET_IS_FIXED_PPOS(SCM(*ps), 1); S_SET_IS_FIXED_PPOS(SCC(*ps), 1); } else if (StrEquals(token, "FixedSize") || StrEquals(token, "FixedUSSize")) { S_SET_IS_SIZE_FIXED(SCF(*ps), on); S_SET_IS_SIZE_FIXED(SCM(*ps), 1); S_SET_IS_SIZE_FIXED(SCC(*ps), 1); } else if (StrEquals(token, "FixedPSize")) { S_SET_IS_PSIZE_FIXED(SCF(*ps), on); S_SET_IS_PSIZE_FIXED(SCM(*ps), 1); S_SET_IS_PSIZE_FIXED(SCC(*ps), 1); } else { found = False; } break; case 'g': if (StrEquals(token, "GrabFocusOff")) { FPS_GRAB_FOCUS(S_FOCUS_POLICY(SCF(*ps)), !on); FPS_GRAB_FOCUS(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_GRAB_FOCUS(S_FOCUS_POLICY(SCC(*ps)), 1); } else if (StrEquals(token, "GrabFocus")) { FPS_GRAB_FOCUS(S_FOCUS_POLICY(SCF(*ps)), on); FPS_GRAB_FOCUS(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_GRAB_FOCUS(S_FOCUS_POLICY(SCC(*ps)), 1); } else if (StrEquals(token, "GrabFocusTransientOff")) { FPS_GRAB_FOCUS_TRANSIENT( S_FOCUS_POLICY(SCF(*ps)), !on); FPS_GRAB_FOCUS_TRANSIENT(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_GRAB_FOCUS_TRANSIENT(S_FOCUS_POLICY(SCC(*ps)), 1); } else if (StrEquals(token, "GrabFocusTransient")) { FPS_GRAB_FOCUS_TRANSIENT(S_FOCUS_POLICY(SCF(*ps)), on); FPS_GRAB_FOCUS_TRANSIENT(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_GRAB_FOCUS_TRANSIENT(S_FOCUS_POLICY(SCC(*ps)), 1); } else if (StrEquals(token, "GNOMEIgnoreHints")) { S_SET_DO_IGNORE_GNOME_HINTS(SCF(*ps), on); S_SET_DO_IGNORE_GNOME_HINTS(SCM(*ps), 1); S_SET_DO_IGNORE_GNOME_HINTS(SCC(*ps), 1); } else if (StrEquals(token, "GNOMEUseHints")) { S_SET_DO_IGNORE_GNOME_HINTS(SCF(*ps), !on); S_SET_DO_IGNORE_GNOME_HINTS(SCM(*ps), 1); S_SET_DO_IGNORE_GNOME_HINTS(SCC(*ps), 1); } else { found = False; } break; case 'h': if (StrEquals(token, "HintOverride")) { S_SET_HAS_MWM_OVERRIDE(SCF(*ps), on); S_SET_HAS_MWM_OVERRIDE(SCM(*ps), 1); S_SET_HAS_MWM_OVERRIDE(SCC(*ps), 1); } else if (StrEquals(token, "Handles")) { ps->flags.has_no_handles = !on; ps->flag_mask.has_no_handles = 1; ps->change_mask.has_no_handles = 1; } else if (StrEquals(token, "HandleWidth")) { if (GetIntegerArguments(rest, &rest, val, 1)) { SSET_HANDLE_WIDTH(*ps, (short)*val); ps->flags.has_handle_width = 1; ps->flag_mask.has_handle_width = 1; ps->change_mask.has_handle_width = 1; } else { ps->flags.has_handle_width = 0; ps->flag_mask.has_handle_width = 1; ps->change_mask.has_handle_width = 1; } } else if (StrEquals(token, "HilightFore")) { rest = GetNextToken(rest, &token); if (token) { SAFEFREE(SGET_FORE_COLOR_NAME_HI(*ps)); SSET_FORE_COLOR_NAME_HI(*ps, token); ps->flags.has_color_fore_hi = 1; ps->flag_mask.has_color_fore_hi = 1; ps->change_mask.has_color_fore_hi = 1; ps->flags.use_colorset_hi = 0; ps->flag_mask.use_colorset_hi = 1; ps->change_mask.use_colorset_hi = 1; } else { fvwm_msg( ERR, "style_parse_one_style_option", "HilightFore Style needs color" " argument"); } } else if (StrEquals(token, "HilightBack")) { rest = GetNextToken(rest, &token); if (token) { SAFEFREE(SGET_BACK_COLOR_NAME_HI(*ps)); SSET_BACK_COLOR_NAME_HI(*ps, token); ps->flags.has_color_back_hi = 1; ps->flag_mask.has_color_back_hi = 1; ps->change_mask.has_color_back_hi = 1; ps->flags.use_colorset_hi = 0; ps->flag_mask.use_colorset_hi = 1; ps->change_mask.use_colorset_hi = 1; } else { fvwm_msg( ERR, "style_parse_one_style_option", "HilightBack Style needs color" " argument"); } } else if (StrEquals(token, "HilightColorset")) { *val = -1; GetIntegerArguments(rest, &rest, val, 1); SSET_COLORSET_HI(*ps, *val); alloc_colorset(*val); ps->flags.use_colorset_hi = (*val >= 0); ps->flag_mask.use_colorset_hi = 1; ps->change_mask.use_colorset_hi = 1; } else if (StrEquals(token, "HilightBorderColorset")) { *val = -1; GetIntegerArguments(rest, &rest, val, 1); SSET_BORDER_COLORSET_HI(*ps, *val); alloc_colorset(*val); ps->flags.use_border_colorset_hi = (*val >= 0); ps->flag_mask.use_border_colorset_hi = 1; ps->change_mask.use_border_colorset_hi = 1; } else if (StrEquals(token, "HilightIconTitleColorset")) { *val = -1; GetIntegerArguments(rest, &rest, val, 1); SSET_ICON_TITLE_COLORSET_HI(*ps, *val); alloc_colorset(*val); ps->flags.use_icon_title_colorset_hi = (*val >= 0); ps->flag_mask.use_icon_title_colorset_hi = 1; ps->change_mask.use_icon_title_colorset_hi = 1; } else { found = False; } break; case 'i': if (StrEquals(token, "Icon")) { if (on == 1) { rest = GetNextToken(rest, &token); SAFEFREE(SGET_ICON_NAME(*ps)); SSET_ICON_NAME(*ps,token); ps->flags.has_icon = (token != NULL); ps->flag_mask.has_icon = 1; ps->change_mask.has_icon = 1; S_SET_IS_ICON_SUPPRESSED(SCF(*ps), 0); S_SET_IS_ICON_SUPPRESSED(SCM(*ps), 1); S_SET_IS_ICON_SUPPRESSED(SCC(*ps), 1); } else { S_SET_IS_ICON_SUPPRESSED(SCF(*ps), 1); S_SET_IS_ICON_SUPPRESSED(SCM(*ps), 1); S_SET_IS_ICON_SUPPRESSED(SCC(*ps), 1); } } else if (StrEquals(token, "IconBackgroundColorset")) { *val = -1; GetIntegerArguments(rest, &rest, val, 1); SSET_ICON_BACKGROUND_COLORSET(*ps, *val); alloc_colorset(*val); ps->flags.use_icon_background_colorset = (*val >= 0); ps->flag_mask.use_icon_background_colorset = 1; ps->change_mask.use_icon_background_colorset = 1; } else if (StrEquals(token, "IconBackgroundPadding")) { *val = ICON_BACKGROUND_PADDING; GetIntegerArguments(rest, &rest, val, 1); if (*val < 0) { *val = 0; } else if (*val > 50) { *val = 50; } SSET_ICON_BACKGROUND_PADDING(*ps, (unsigned char)*val); ps->flags.has_icon_background_padding = 1; ps->flag_mask.has_icon_background_padding = 1; ps->change_mask.has_icon_background_padding = 1; } else if (StrEquals(token, "IconBackgroundRelief")) { *val = ICON_RELIEF_WIDTH; GetIntegerArguments(rest, &rest, val, 1); if (*val < -50) { *val = -50; } else if (*val > 50) { *val = 50; } SSET_ICON_BACKGROUND_RELIEF(*ps, (signed char)*val); ps->flags.has_icon_background_relief = 1; ps->flag_mask.has_icon_background_relief = 1; ps->change_mask.has_icon_background_relief = 1; } else if (StrEquals(token, "IconFont")) { SAFEFREE(SGET_ICON_FONT(*ps)); rest = GetNextToken(rest, &token); SSET_ICON_FONT(*ps, token); S_SET_HAS_ICON_FONT(SCF(*ps), (token != NULL)); S_SET_HAS_ICON_FONT(SCM(*ps), 1); S_SET_HAS_ICON_FONT(SCC(*ps), 1); } else if (StrEquals(token, "IconOverride")) { S_SET_ICON_OVERRIDE(SCF(*ps), ICON_OVERRIDE); S_SET_ICON_OVERRIDE(SCM(*ps), ICON_OVERRIDE_MASK); S_SET_ICON_OVERRIDE(SCC(*ps), ICON_OVERRIDE_MASK); } else if (StrEquals(token, "IgnoreRestack")) { S_SET_DO_IGNORE_RESTACK(SCF(*ps), on); S_SET_DO_IGNORE_RESTACK(SCM(*ps), 1); S_SET_DO_IGNORE_RESTACK(SCC(*ps), 1); } else if (StrEquals(token, "IconTitle")) { S_SET_HAS_NO_ICON_TITLE(SCF(*ps), !on); S_SET_HAS_NO_ICON_TITLE(SCM(*ps), 1); S_SET_HAS_NO_ICON_TITLE(SCC(*ps), 1); } else if (StrEquals(token, "IconTitleFormat")) { char *fmt_string = NULL; (rest != NULL) ? fmt_string = strdup(rest) : NULL; rest = NULL; /* Consume the string. */ if (fmt_string == NULL) { fmt_string = DEFAULT_TITLE_FORMAT; } if (!__validate_titleformat_string(fmt_string)) { fvwm_msg(ERR, "style_parse_one_style_option", "TitleFormat string invalid: %s", fmt_string); } SSET_ICON_TITLE_FORMAT_STRING(*ps, fmt_string); ps->flags.has_icon_title_format_string = 1; ps->flag_mask.has_icon_title_format_string = 1; ps->change_mask.has_icon_title_format_string = 1; } else if (StrEquals(token, "IconTitleColorset")) { *val = -1; GetIntegerArguments(rest,&rest, val, 1); SSET_ICON_TITLE_COLORSET(*ps, *val); alloc_colorset(*val); ps->flags.use_icon_title_colorset = (*val >= 0); ps->flag_mask.use_icon_title_colorset = 1; ps->change_mask.use_icon_title_colorset = 1; } else if (StrEquals(token, "IconTitleRelief")) { *val = ICON_RELIEF_WIDTH; GetIntegerArguments(rest, &rest, val, 1); if (*val < -50) { *val = -50; } else if (*val > 50) { *val = 50; } SSET_ICON_TITLE_RELIEF(*ps, (signed char)*val); ps->flags.has_icon_title_relief = 1; ps->flag_mask.has_icon_title_relief = 1; ps->change_mask.has_icon_title_relief = 1; } else if (StrEquals(token, "IconSize")) { rest = style_parse_icon_size_style(token, rest, ps); } else if (StrEquals(token, "IconBox")) { rest = style_parse_icon_box_style(cur_ib, token, rest, ps); } /* end iconbox parameter */ else if (StrEquals(token, "ICONGRID")) { rest = style_parse_icon_grid_style(token, rest, ps, *cur_ib); } else if (StrEquals(token, "ICONFILL")) { rest = style_parse_icon_fill_style(token, rest, ps, *cur_ib); } /* end iconfill */ else if (StrEquals(token, "IconifyWindowGroups")) { S_SET_DO_ICONIFY_WINDOW_GROUPS(SCF(*ps), on); S_SET_DO_ICONIFY_WINDOW_GROUPS(SCM(*ps), 1); S_SET_DO_ICONIFY_WINDOW_GROUPS(SCC(*ps), 1); } else if (StrEquals(token, "IconifyWindowGroupsOff")) { S_SET_DO_ICONIFY_WINDOW_GROUPS(SCF(*ps), !on); S_SET_DO_ICONIFY_WINDOW_GROUPS(SCM(*ps), 1); S_SET_DO_ICONIFY_WINDOW_GROUPS(SCC(*ps), 1); } else if (StrEquals(token, "Iconifiable")) { S_SET_IS_UNICONIFIABLE(SCF(*ps), !on); S_SET_IS_UNICONIFIABLE(SCM(*ps), 1); S_SET_IS_UNICONIFIABLE(SCC(*ps), 1); } else if (StrEquals(token, "IndexedWindowName")) { char *format; /* TA: This is being deprecated in favour of the more * generic: * * TitleFormat %n */ fvwm_msg(WARN, "style_parse_one_style_option", "IndexedWindowName is deprecated. " "Converting to use: TitleFormat %%n (%%t)"); format = strdup( "%n (%t)" ); SSET_TITLE_FORMAT_STRING(*ps, format); ps->flags.has_title_format_string = 1; ps->flag_mask.has_title_format_string = 1; ps->change_mask.has_title_format_string = 1; } else if (StrEquals(token, "IndexedIconName")) { char *format; /* TA: This is being deprecated in favour of the more * generic: * * TitleFormat %n */ fvwm_msg(WARN, "style_parse_one_style_option", "IndexedIconName is deprecated. " "Converting to use: IconTitleFormat %%n (%%t)"); format = strdup( "%n (%t)" ); SSET_ICON_TITLE_FORMAT_STRING(*ps, format); ps->flags.has_icon_title_format_string = 1; ps->flag_mask.has_icon_title_format_string = 1; ps->change_mask.has_icon_title_format_string = 1; } else if (StrEquals(token, "InitialMapCommand")) { char *s; s = (rest != NULL) ? strdup(rest) : NULL; SSET_INITIAL_MAP_COMMAND_STRING(*ps, s); ps->flags.has_initial_map_command_string = on; ps->flag_mask.has_initial_map_command_string = on; ps->change_mask.has_initial_map_command_string = 1; rest = NULL; /* consume the entire string */ } else { found = False; } break; case 'j': if (0) { } else { found = False; } break; case 'k': if (StrEquals(token, "KeepWindowGroupsOnDesk")) { S_SET_DO_USE_WINDOW_GROUP_HINT(SCF(*ps), on); S_SET_DO_USE_WINDOW_GROUP_HINT(SCM(*ps), 1); S_SET_DO_USE_WINDOW_GROUP_HINT(SCC(*ps), 1); } else { found = False; } break; case 'l': if (StrEquals(token, "LeftTitleRotatedCW")) { S_SET_IS_LEFT_TITLE_ROTATED_CW(SCF(*ps), on); S_SET_IS_LEFT_TITLE_ROTATED_CW(SCM(*ps), 1); S_SET_IS_LEFT_TITLE_ROTATED_CW(SCC(*ps), 1); } else if (StrEquals(token, "LeftTitleRotatedCCW")) { S_SET_IS_LEFT_TITLE_ROTATED_CW(SCF(*ps), !on); S_SET_IS_LEFT_TITLE_ROTATED_CW(SCM(*ps), 1); S_SET_IS_LEFT_TITLE_ROTATED_CW(SCC(*ps), 1); } else if (StrEquals(token, "Lenience")) { FPS_LENIENT(S_FOCUS_POLICY(SCF(*ps)), on); FPS_LENIENT(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_LENIENT(S_FOCUS_POLICY(SCC(*ps)), 1); } else if (StrEquals(token, "Layer")) { *val = -1; if (GetIntegerArguments(rest, &rest, val, 1) && *val < 0) { fvwm_msg(ERR, "style_parse_one_style_option", "Layer must be positive or zero."); } if (*val < 0) { SSET_LAYER(*ps, -9); /* mark layer unset */ ps->flags.use_layer = 0; ps->flag_mask.use_layer = 1; ps->change_mask.use_layer = 1; } else { SSET_LAYER(*ps, *val); ps->flags.use_layer = 1; ps->flag_mask.use_layer = 1; ps->change_mask.use_layer = 1; } } else if (StrEquals(token, "LOWERTRANSIENT")) { S_SET_DO_LOWER_TRANSIENT(SCF(*ps), on); S_SET_DO_LOWER_TRANSIENT(SCM(*ps), 1); S_SET_DO_LOWER_TRANSIENT(SCC(*ps), 1); } else { found = False; } break; case 'm': if (StrEquals(token, "ManualPlacement")) { ps->flags.placement_mode = PLACE_MANUAL; ps->flag_mask.placement_mode = PLACE_MASK; ps->change_mask.placement_mode = PLACE_MASK; } else if (StrEquals(token, "ManualPlacementHonorsStartsOnPage")) { ps->flags.manual_placement_honors_starts_on_page = on; ps->flag_mask.manual_placement_honors_starts_on_page = 1; ps->change_mask.manual_placement_honors_starts_on_page = 1; } else if (StrEquals( token, "ManualPlacementIgnoresStartsOnPage")) { ps->flags.manual_placement_honors_starts_on_page = !on; ps->flag_mask.manual_placement_honors_starts_on_page = 1; ps->change_mask.manual_placement_honors_starts_on_page = 1; } else if (StrEquals(token, "Maximizable")) { S_SET_IS_UNMAXIMIZABLE(SCF(*ps), !on); S_SET_IS_UNMAXIMIZABLE(SCM(*ps), 1); S_SET_IS_UNMAXIMIZABLE(SCC(*ps), 1); } else if (StrEquals(token, "MinOverlapPlacement")) { ps->flags.placement_mode = PLACE_MINOVERLAP; ps->flag_mask.placement_mode = PLACE_MASK; ps->change_mask.placement_mode = PLACE_MASK; } else if (StrEquals(token, "MinOverlapPercentPlacement")) { ps->flags.placement_mode = PLACE_MINOVERLAPPERCENT; ps->flag_mask.placement_mode = PLACE_MASK; ps->change_mask.placement_mode = PLACE_MASK; } else if (StrEquals(token, "MinOverlapPlacementPenalties")) { float f[6] = {-1, -1, -1, -1, -1, -1}; Bool bad = False; num = 0; if (on != 0 && rest != NULL) { num = sscanf( rest, "%f %f %f %f %f %f", &f[0], &f[1], &f[2], &f[3], &f[4], &f[5]); for (i=0; i < num; i++) { PeekToken(rest,&rest); if (f[i] < 0) { bad = True; } } } if (bad) { fvwm_msg( ERR, "style_parse_one_style_option", "Bad argument to MinOverlap" "PlacementPenalties: %s", rest); break; } { pl_penalty_struct *p; p = SGET_PLACEMENT_PENALTY_PTR(*ps); *p = default_pl_penalty; } if (num > 0) { (*ps).pl_penalty.normal = f[0]; } if (num > 1) { (*ps).pl_penalty.ontop = f[1]; } if (num > 2) { (*ps).pl_penalty.icon = f[2]; } if (num > 3) { (*ps).pl_penalty.sticky = f[3]; } if (num > 4) { (*ps).pl_penalty.below = f[4]; } if (num > 5) { (*ps).pl_penalty.strut = f[5]; } ps->flags.has_placement_penalty = 1; ps->flag_mask.has_placement_penalty = 1; ps->change_mask.has_placement_penalty = 1; } else if (StrEquals( token, "MinOverlapPercentPlacementPenalties")) { Bool bad = False; num = 0; if (on != 0) { num = GetIntegerArguments(rest, &rest, val, 4); for (i=0; i < num; i++) { if (val[i] < 0) bad = True; } } if (bad) { fvwm_msg( ERR, "style_parse_one_style_option", "Bad argument to MinOverlapPercent" "PlacementPenalties: %s", rest); break; } { pl_percent_penalty_struct *p; p = SGET_PLACEMENT_PERCENTAGE_PENALTY_PTR(*ps); *p = default_pl_percent_penalty; } if (num > 0) { (*ps).pl_percent_penalty.p99 = val[0]; } if (num > 1) { (*ps).pl_percent_penalty.p95 = val[1]; } if (num > 2) { (*ps).pl_percent_penalty.p85 = val[2]; } if (num > 3) { (*ps).pl_percent_penalty.p75 = val[3]; } ps->flags.has_placement_percentage_penalty = 1; ps->flag_mask.has_placement_percentage_penalty = 1; ps->change_mask.has_placement_percentage_penalty = 1; } else if (StrEquals(token, "MwmButtons")) { S_SET_HAS_MWM_BUTTONS(SCF(*ps), on); S_SET_HAS_MWM_BUTTONS(SCM(*ps), 1); S_SET_HAS_MWM_BUTTONS(SCC(*ps), 1); } else if (StrEquals(token, "MiniIcon")) { if (!FMiniIconsSupported) { break; } rest = GetNextToken(rest, &token); if (token) { SAFEFREE(SGET_MINI_ICON_NAME(*ps)); SSET_MINI_ICON_NAME(*ps, token); ps->flags.has_mini_icon = 1; ps->flag_mask.has_mini_icon = 1; ps->change_mask.has_mini_icon = 1; } else { fvwm_msg( ERR, "style_parse_one_style_option", "MiniIcon Style requires an Argument"); } } else if (StrEquals(token, "MwmBorder")) { S_SET_HAS_MWM_BORDER(SCF(*ps), on); S_SET_HAS_MWM_BORDER(SCM(*ps), 1); S_SET_HAS_MWM_BORDER(SCC(*ps), 1); } else if (StrEquals(token, "MwmDecor")) { ps->flags.has_mwm_decor = on; ps->flag_mask.has_mwm_decor = 1; ps->change_mask.has_mwm_decor = 1; } else if (StrEquals(token, "MwmFunctions")) { ps->flags.has_mwm_functions = on; ps->flag_mask.has_mwm_functions = 1; ps->change_mask.has_mwm_functions = 1; } else if (StrEquals(token, "MouseFocus")) { style_set_old_focus_policy(ps, 1); } else if (StrEquals(token, "MouseFocusClickRaises")) { FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCF(*ps)), on); FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCM(*ps)), 1); FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCC(*ps)), 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCF(*ps)), on); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCM(*ps)), 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCC(*ps)), 1); } else if (StrEquals(token, "MouseFocusClickRaisesOff")) { FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCF(*ps)), !on); FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCM(*ps)), 1); FPS_RAISE_FOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCC(*ps)), 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCF(*ps)), !on); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCM(*ps)), 1); FPS_RAISE_UNFOCUSED_CLIENT_CLICK( S_FOCUS_POLICY(SCC(*ps)), 1); } else if (StrEquals(token, "MinWindowSize")) { int val1; int val2; int val1_unit; int val2_unit; num = GetTwoArguments( rest, &val1, &val2, &val1_unit, &val2_unit); rest = SkipNTokens(rest, num); if (num != 2) { val1 = 0; val2 = 0; } else { val1 = val1 * val1_unit / 100; val2 = val2 * val2_unit / 100; } if (val1 < 0) { val1 = 0; } if (val2 < 0) { val2 = 0; } SSET_MIN_WINDOW_WIDTH(*ps, val1); SSET_MIN_WINDOW_HEIGHT(*ps, val2); ps->flags.has_min_window_size = 1; ps->flag_mask.has_min_window_size = 1; ps->change_mask.has_min_window_size = 1; } else if (StrEquals(token, "MaxWindowSize")) { int val1; int val2; int val1_unit; int val2_unit; num = GetTwoArguments( rest, &val1, &val2, &val1_unit, &val2_unit); rest = SkipNTokens(rest, num); if (num != 2) { val1 = DEFAULT_MAX_MAX_WINDOW_WIDTH; val2 = DEFAULT_MAX_MAX_WINDOW_HEIGHT; } else { val1 = val1 * val1_unit / 100; val2 = val2 * val2_unit / 100; } if (val1 < DEFAULT_MIN_MAX_WINDOW_WIDTH) { val1 = DEFAULT_MIN_MAX_WINDOW_WIDTH; } if (val1 > DEFAULT_MAX_MAX_WINDOW_WIDTH || val1 <= 0) { val1 = DEFAULT_MAX_MAX_WINDOW_WIDTH; } if (val2 < DEFAULT_MIN_MAX_WINDOW_HEIGHT) { val2 = DEFAULT_MIN_MAX_WINDOW_HEIGHT; } if (val2 > DEFAULT_MAX_MAX_WINDOW_HEIGHT || val2 <= 0) { val2 = DEFAULT_MAX_MAX_WINDOW_HEIGHT; } SSET_MAX_WINDOW_WIDTH(*ps, val1); SSET_MAX_WINDOW_HEIGHT(*ps, val2); ps->flags.has_max_window_size = 1; ps->flag_mask.has_max_window_size = 1; ps->change_mask.has_max_window_size = 1; } else if (StrEquals(token, "MoveByProgramMethod")) { int i; char *methodlist[] = { "AutoDetect", "UseGravity", "IgnoreGravity", NULL }; i = GetTokenIndex(rest, methodlist, 0, &rest); if (i == -1) { i = WS_CR_MOTION_METHOD_AUTO; } SCR_MOTION_METHOD(&ps->flags) = i; SCR_MOTION_METHOD(&ps->flag_mask) = WS_CR_MOTION_METHOD_MASK; SCR_MOTION_METHOD(&ps->change_mask) = WS_CR_MOTION_METHOD_MASK; } else { found = False; } break; case 'n': if (StrEquals(token, "NoActiveIconOverride")) { S_SET_ICON_OVERRIDE(SCF(*ps), NO_ACTIVE_ICON_OVERRIDE); S_SET_ICON_OVERRIDE(SCM(*ps), ICON_OVERRIDE_MASK); S_SET_ICON_OVERRIDE(SCC(*ps), ICON_OVERRIDE_MASK); } else if (StrEquals(token, "NoIconOverride")) { S_SET_ICON_OVERRIDE(SCF(*ps), NO_ICON_OVERRIDE); S_SET_ICON_OVERRIDE(SCM(*ps), ICON_OVERRIDE_MASK); S_SET_ICON_OVERRIDE(SCC(*ps), ICON_OVERRIDE_MASK); } else if (StrEquals(token, "NoIconTitle")) { S_SET_HAS_NO_ICON_TITLE(SCF(*ps), on); S_SET_HAS_NO_ICON_TITLE(SCM(*ps), 1); S_SET_HAS_NO_ICON_TITLE(SCC(*ps), 1); } else if (StrEquals(token, "NOICON")) { S_SET_IS_ICON_SUPPRESSED(SCF(*ps), on); S_SET_IS_ICON_SUPPRESSED(SCM(*ps), 1); S_SET_IS_ICON_SUPPRESSED(SCC(*ps), 1); } else if (StrEquals(token, "NOTITLE")) { ps->flags.has_no_title = on; ps->flag_mask.has_no_title = 1; ps->change_mask.has_no_title = 1; } else if (StrEquals(token, "NoPPosition")) { ps->flags.use_no_pposition = on; ps->flag_mask.use_no_pposition = 1; ps->change_mask.use_no_pposition = 1; } else if (StrEquals(token, "NoUSPosition")) { ps->flags.use_no_usposition = on; ps->flag_mask.use_no_usposition = 1; ps->change_mask.use_no_usposition = 1; } else if (StrEquals(token, "NoTransientPPosition")) { ps->flags.use_no_transient_pposition = on; ps->flag_mask.use_no_transient_pposition = 1; ps->change_mask.use_no_transient_pposition = 1; } else if (StrEquals(token, "NoTransientUSPosition")) { ps->flags.use_no_transient_usposition = on; ps->flag_mask.use_no_transient_usposition = 1; ps->change_mask.use_no_transient_usposition = 1; } else if (StrEquals(token, "NoIconPosition")) { S_SET_USE_ICON_POSITION_HINT(SCF(*ps), !on); S_SET_USE_ICON_POSITION_HINT(SCM(*ps), 1); S_SET_USE_ICON_POSITION_HINT(SCC(*ps), 1); } else if (StrEquals(token, "NakedTransient")) { ps->flags.do_decorate_transient = !on; ps->flag_mask.do_decorate_transient = 1; ps->change_mask.do_decorate_transient = 1; } else if (StrEquals(token, "NODECORHINT")) { ps->flags.has_mwm_decor = !on; ps->flag_mask.has_mwm_decor = 1; ps->change_mask.has_mwm_decor = 1; } else if (StrEquals(token, "NOFUNCHINT")) { ps->flags.has_mwm_functions = !on; ps->flag_mask.has_mwm_functions = 1; ps->change_mask.has_mwm_functions = 1; } else if (StrEquals(token, "NOOVERRIDE")) { S_SET_HAS_MWM_OVERRIDE(SCF(*ps), !on); S_SET_HAS_MWM_OVERRIDE(SCM(*ps), 1); S_SET_HAS_MWM_OVERRIDE(SCC(*ps), 1); } else if (StrEquals(token, "NORESIZEOVERRIDE") || StrEquals(token, "NORESIZEHINTOVERRIDE")) { S_SET_HAS_OVERRIDE_SIZE(SCF(*ps), !on); S_SET_HAS_OVERRIDE_SIZE(SCM(*ps), 1); S_SET_HAS_OVERRIDE_SIZE(SCC(*ps), 1); } else if (StrEquals(token, "NOHANDLES")) { ps->flags.has_no_handles = on; ps->flag_mask.has_no_handles = 1; ps->change_mask.has_no_handles = 1; } else if (StrEquals(token, "NOLENIENCE")) { FPS_LENIENT(S_FOCUS_POLICY(SCF(*ps)), !on); FPS_LENIENT(S_FOCUS_POLICY(SCM(*ps)), 1); FPS_LENIENT(S_FOCUS_POLICY(SCC(*ps)), 1); } else if (StrEquals(token, "NoButton")) { rest = style_parse_button_style(ps, rest, !on); } else if (StrEquals(token, "NOOLDECOR")) { ps->flags.has_ol_decor = !on; ps->flag_mask.has_ol_decor = 1; ps->change_mask.has_ol_decor = 1; } else if (StrEquals(token, "NeverFocus")) { style_set_old_focus_policy(ps, 3); } else { found = False; } break; case 'o': if (StrEquals(token, "OLDECOR")) { ps->flags.has_ol_decor = on; ps->flag_mask.has_ol_decor = 1; ps->change_mask.has_ol_decor = 1; } else if (StrEquals(token, "Opacity")) { ps->flags.use_parent_relative = !on; ps->flag_mask.use_parent_relative = 1; ps->change_mask.use_parent_relative = 1; } else { found = False; } break; case 'p': if (StrEquals(token, "PositionPlacement")) { char *s; ps->flags.placement_mode = PLACE_POSITION; ps->flag_mask.placement_mode = PLACE_MASK; ps->change_mask.placement_mode = PLACE_MASK; s = (rest != NULL) ? strdup(rest) : NULL; rest = NULL; /* consume the entire string */ SSET_PLACEMENT_POSITION_STRING(*ps, s); ps->flags.has_placement_position_string = 1; ps->flag_mask.has_placement_position_string = 1; ps->change_mask.has_placement_position_string = 1; } else if (StrEquals(token, "ParentalRelativity")) { ps->flags.use_parent_relative = on; ps->flag_mask.use_parent_relative = 1; ps->change_mask.use_parent_relative = 1; } else { found = False; } break; case 'q': if (0) { } else { found = False; } break; case 'r': if (StrEquals(token, "RAISETRANSIENT")) { S_SET_DO_RAISE_TRANSIENT(SCF(*ps), on); S_SET_DO_RAISE_TRANSIENT(SCM(*ps), 1); S_SET_DO_RAISE_TRANSIENT(SCC(*ps), 1); } else if (StrEquals(token, "RANDOMPLACEMENT")) { ps->flags.placement_mode |= PLACE_RANDOM; ps->flag_mask.placement_mode |= PLACE_RANDOM; ps->change_mask.placement_mode |= PLACE_RANDOM; } else if (StrEquals(token, "RECAPTUREHONORSSTARTSONPAGE")) { ps->flags.recapture_honors_starts_on_page = on; ps->flag_mask.recapture_honors_starts_on_page = 1; ps->change_mask.recapture_honors_starts_on_page = 1; } else if (StrEquals(token, "RECAPTUREIGNORESSTARTSONPAGE")) { ps->flags.recapture_honors_starts_on_page = !on; ps->flag_mask.recapture_honors_starts_on_page = 1; ps->change_mask.recapture_honors_starts_on_page = 1; } else if (StrEquals(token, "RESIZEHINTOVERRIDE")) { S_SET_HAS_OVERRIDE_SIZE(SCF(*ps), on); S_SET_HAS_OVERRIDE_SIZE(SCM(*ps), 1); S_SET_HAS_OVERRIDE_SIZE(SCC(*ps), 1); } else if (StrEquals(token, "ResizeOpaque")) { S_SET_DO_RESIZE_OPAQUE(SCF(*ps), on); S_SET_DO_RESIZE_OPAQUE(SCM(*ps), 1); S_SET_DO_RESIZE_OPAQUE(SCC(*ps), 1); } else if (StrEquals(token, "ResizeOutline")) { S_SET_DO_RESIZE_OPAQUE(SCF(*ps), !on); S_SET_DO_RESIZE_OPAQUE(SCM(*ps), 1); S_SET_DO_RESIZE_OPAQUE(SCC(*ps), 1); } else if (StrEquals(token, "RightTitleRotatedCW")) { S_SET_IS_RIGHT_TITLE_ROTATED_CW(SCF(*ps), on); S_SET_IS_RIGHT_TITLE_ROTATED_CW(SCM(*ps), 1); S_SET_IS_RIGHT_TITLE_ROTATED_CW(SCC(*ps), 1); } else if (StrEquals(token, "RightTitleRotatedCCW")) { S_SET_IS_RIGHT_TITLE_ROTATED_CW(SCF(*ps), !on); S_SET_IS_RIGHT_TITLE_ROTATED_CW(SCM(*ps), 1); S_SET_IS_RIGHT_TITLE_ROTATED_CW(SCC(*ps), 1); } else { found = False; } break; case 's': if (StrEquals(token, "SMARTPLACEMENT")) { ps->flags.placement_mode |= PLACE_SMART; ps->flag_mask.placement_mode |= PLACE_SMART; ps->change_mask.placement_mode |= PLACE_SMART; } else if (StrEquals(token, "SkipMapping")) { S_SET_DO_NOT_SHOW_ON_MAP(SCF(*ps), on); S_SET_DO_NOT_SHOW_ON_MAP(SCM(*ps), 1); S_SET_DO_NOT_SHOW_ON_MAP(SCC(*ps), 1); } else if (StrEquals(token, "ShowMapping")) { S_SET_DO_NOT_SHOW_ON_MAP(SCF(*ps), !on); S_SET_DO_NOT_SHOW_ON_MAP(SCM(*ps), 1); S_SET_DO_NOT_SHOW_ON_MAP(SCC(*ps), 1); } else if (StrEquals(token, "StackTransientParent")) { S_SET_DO_STACK_TRANSIENT_PARENT(SCF(*ps), on); S_SET_DO_STACK_TRANSIENT_PARENT(SCM(*ps), 1); S_SET_DO_STACK_TRANSIENT_PARENT(SCC(*ps), 1); } else if (StrEquals(token, "StickyIcon")) { S_SET_IS_ICON_STICKY_ACROSS_PAGES(SCF(*ps), on); S_SET_IS_ICON_STICKY_ACROSS_PAGES(SCM(*ps), 1); S_SET_IS_ICON_STICKY_ACROSS_PAGES(SCC(*ps), 1); S_SET_IS_ICON_STICKY_ACROSS_DESKS(SCF(*ps), on); S_SET_IS_ICON_STICKY_ACROSS_DESKS(SCM(*ps), 1); S_SET_IS_ICON_STICKY_ACROSS_DESKS(SCC(*ps), 1); } else if (StrEquals(token, "StickyAcrossPagesIcon")) { S_SET_IS_ICON_STICKY_ACROSS_PAGES(SCF(*ps), on); S_SET_IS_ICON_STICKY_ACROSS_PAGES(SCM(*ps), 1); S_SET_IS_ICON_STICKY_ACROSS_PAGES(SCC(*ps), 1); } else if (StrEquals(token, "StickyAcrossDesksIcon")) { S_SET_IS_ICON_STICKY_ACROSS_DESKS(SCF(*ps), on); S_SET_IS_ICON_STICKY_ACROSS_DESKS(SCM(*ps), 1); S_SET_IS_ICON_STICKY_ACROSS_DESKS(SCC(*ps), 1); } else if (StrEquals(token, "SlipperyIcon")) { S_SET_IS_ICON_STICKY_ACROSS_PAGES(SCF(*ps), !on); S_SET_IS_ICON_STICKY_ACROSS_PAGES(SCM(*ps), 1); S_SET_IS_ICON_STICKY_ACROSS_PAGES(SCC(*ps), 1); S_SET_IS_ICON_STICKY_ACROSS_DESKS(SCF(*ps), !on); S_SET_IS_ICON_STICKY_ACROSS_DESKS(SCM(*ps), 1); S_SET_IS_ICON_STICKY_ACROSS_DESKS(SCC(*ps), 1); } else if (StrEquals(token, "SloppyFocus")) { style_set_old_focus_policy(ps, 2); } else if (StrEquals(token, "StartIconic")) { ps->flags.do_start_iconic = on; ps->flag_mask.do_start_iconic = 1; ps->change_mask.do_start_iconic = 1; } else if (StrEquals(token, "StartNormal")) { ps->flags.do_start_iconic = !on; ps->flag_mask.do_start_iconic = 1; ps->change_mask.do_start_iconic = 1; } else if (StrEquals(token, "StaysOnBottom")) { SSET_LAYER( *ps, (on) ? Scr.BottomLayer : Scr.DefaultLayer); ps->flags.use_layer = 1; ps->flag_mask.use_layer = 1; ps->change_mask.use_layer = 1; } else if (StrEquals(token, "StaysOnTop")) { SSET_LAYER( *ps, (on) ? Scr.BottomLayer : Scr.DefaultLayer); SSET_LAYER(*ps, Scr.TopLayer); ps->flags.use_layer = 1; ps->flag_mask.use_layer = 1; ps->change_mask.use_layer = 1; } else if (StrEquals(token, "StaysPut")) { SSET_LAYER(*ps, Scr.DefaultLayer); ps->flags.use_layer = 1; ps->flag_mask.use_layer = 1; ps->change_mask.use_layer = 1; } else if (StrEquals(token, "Sticky")) { S_SET_IS_STICKY_ACROSS_PAGES(SCF(*ps), on); S_SET_IS_STICKY_ACROSS_PAGES(SCM(*ps), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCC(*ps), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCF(*ps), on); S_SET_IS_STICKY_ACROSS_DESKS(SCM(*ps), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCC(*ps), 1); } else if (StrEquals(token, "StickyAcrossPages")) { S_SET_IS_STICKY_ACROSS_PAGES(SCF(*ps), on); S_SET_IS_STICKY_ACROSS_PAGES(SCM(*ps), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCC(*ps), 1); } else if (StrEquals(token, "StickyAcrossDesks")) { S_SET_IS_STICKY_ACROSS_DESKS(SCF(*ps), on); S_SET_IS_STICKY_ACROSS_DESKS(SCM(*ps), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCC(*ps), 1); } else if (StrEquals(token, "StickyStippledTitle")) { S_SET_HAS_NO_STICKY_STIPPLED_TITLE(SCF(*ps), !on); S_SET_HAS_NO_STICKY_STIPPLED_TITLE(SCM(*ps), 1); S_SET_HAS_NO_STICKY_STIPPLED_TITLE(SCC(*ps), 1); } else if (StrEquals(token, "StickyStippledIconTitle")) { S_SET_HAS_NO_STICKY_STIPPLED_ICON_TITLE(SCF(*ps), !on); S_SET_HAS_NO_STICKY_STIPPLED_ICON_TITLE(SCM(*ps), 1); S_SET_HAS_NO_STICKY_STIPPLED_ICON_TITLE(SCC(*ps), 1); } else if (StrEquals(token, "Slippery")) { S_SET_IS_STICKY_ACROSS_PAGES(SCF(*ps), !on); S_SET_IS_STICKY_ACROSS_PAGES(SCM(*ps), 1); S_SET_IS_STICKY_ACROSS_PAGES(SCC(*ps), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCF(*ps), !on); S_SET_IS_STICKY_ACROSS_DESKS(SCM(*ps), 1); S_SET_IS_STICKY_ACROSS_DESKS(SCC(*ps), 1); } else if (StrEquals(token, "STARTSONDESK")) { spargs = GetIntegerArguments(rest, NULL, tmpno, 1); if (spargs == 1) { PeekToken(rest,&rest); ps->flags.use_start_on_desk = 1; ps->flag_mask.use_start_on_desk = 1; ps->change_mask.use_start_on_desk = 1; /* RBW - 11/20/1998 - allow for the special * case of -1 */ SSET_START_DESK( *ps, (tmpno[0] > -1) ? tmpno[0] + 1 : tmpno[0]); } else { fvwm_msg(ERR,"style_parse_one_style_option", "bad StartsOnDesk arg: %s", rest); } } /* StartsOnPage is like StartsOnDesk-Plus */ else if (StrEquals(token, "STARTSONPAGE")) { char *ret_rest; spargs = GetIntegerArguments(rest, &ret_rest, tmpno, 3); if (spargs == 1 || spargs == 3) { /* We have a desk no., with or without page. */ /* RBW - 11/20/1998 - allow for the special * case of -1 */ /* Desk is now actual + 1 */ SSET_START_DESK( *ps, (tmpno[0] > -1) ? tmpno[0] + 1 : tmpno[0]); } if (spargs == 2 || spargs == 3) { if (spargs == 3) { /* RBW - 11/20/1998 - allow for the * special case of -1 */ SSET_START_PAGE_X( *ps, (tmpno[1] > -1) ? tmpno[1] + 1 : tmpno[1]); SSET_START_PAGE_Y( *ps, (tmpno[2] > -1) ? tmpno[2] + 1 : tmpno[2]); } else { SSET_START_PAGE_X( *ps, (tmpno[0] > -1) ? tmpno[0] + 1 : tmpno[0]); SSET_START_PAGE_Y( *ps, (tmpno[1] > -1) ? tmpno[1] + 1 : tmpno[1]); } } if (spargs < 1 || spargs > 3) { fvwm_msg(ERR, "style_parse_one_style_option", "bad StartsOnPage args: %s", rest); } else { ps->flags.use_start_on_desk = 1; ps->flag_mask.use_start_on_desk = 1; ps->change_mask.use_start_on_desk = 1; } rest = ret_rest; } else if (StrEquals(token, "STARTSONPAGEINCLUDESTRANSIENTS")) { ps->flags.use_start_on_page_for_transient = on; ps->flag_mask.use_start_on_page_for_transient = 1; ps->change_mask.use_start_on_page_for_transient = 1; } else if (StrEquals(token, "STARTSONPAGEIGNORESTRANSIENTS")) { ps->flags.use_start_on_page_for_transient = !on; ps->flag_mask.use_start_on_page_for_transient = 1; ps->change_mask.use_start_on_page_for_transient = 1; } else if (StrEquals(token, "StartsOnScreen")) { if (rest) { tmpno[0] = FScreenGetScreenArgument(rest, 'c'); PeekToken(rest,&rest); ps->flags.use_start_on_screen = 1; ps->flag_mask.use_start_on_screen = 1; ps->change_mask.use_start_on_screen = 1; SSET_START_SCREEN(*ps, tmpno[0]); } else { ps->flags.use_start_on_screen = 0; ps->flag_mask.use_start_on_screen = 1; ps->change_mask.use_start_on_screen = 1; } } else if (StrEquals(token, "STARTSANYWHERE")) { ps->flags.use_start_on_desk = 0; ps->flag_mask.use_start_on_desk = 1; ps->change_mask.use_start_on_desk = 1; } else if (StrEquals(token, "STARTSLOWERED")) { ps->flags.do_start_lowered = on; ps->flag_mask.do_start_lowered = 1; ps->change_mask.do_start_lowered = 1; } else if (StrEquals(token, "STARTSRAISED")) { ps->flags.do_start_lowered = !on; ps->flag_mask.do_start_lowered = 1; ps->change_mask.do_start_lowered = 1; } else if (StrEquals(token, "StartShaded")) { token = PeekToken(rest, &rest); if (token) { direction_t direction; direction = gravity_parse_dir_argument( token, &token, DIR_NONE); if (direction >= 0 && direction <= DIR_MASK) { SSET_STARTS_SHADED_DIR(*ps, direction); } else { fvwm_msg( ERR, "style_parse_one_style_option", "Option: %s is not valid with" " StartShaded", token); } } else { SSET_STARTS_SHADED_DIR(*ps, DIR_N); } ps->flags.do_start_shaded = on; ps->flag_mask.do_start_shaded = 1; ps->change_mask.do_start_shaded = 1; } else if (StrEquals(token, "SaveUnder")) { ps->flags.do_save_under = on; ps->flag_mask.do_save_under = 1; ps->change_mask.do_save_under = 1; } else if (StrEquals(token, "SaveUnderOff")) { ps->flags.do_save_under = !on; ps->flag_mask.do_save_under = 1; ps->change_mask.do_save_under = 1; } else if (StrEquals(token, "StippledTitle")) { S_SET_HAS_STIPPLED_TITLE(SCF(*ps), on); S_SET_HAS_STIPPLED_TITLE(SCM(*ps), 1); S_SET_HAS_STIPPLED_TITLE(SCC(*ps), 1); } else if (StrEquals(token, "StippledTitleOff")) { S_SET_HAS_STIPPLED_TITLE(SCF(*ps), !on); S_SET_HAS_STIPPLED_TITLE(SCM(*ps), 1); S_SET_HAS_STIPPLED_TITLE(SCC(*ps), 1); } else if (StrEquals(token, "StippledIconTitle")) { S_SET_HAS_STIPPLED_ICON_TITLE(SCF(*ps), on); S_SET_HAS_STIPPLED_ICON_TITLE(SCM(*ps), 1); S_SET_HAS_STIPPLED_ICON_TITLE(SCC(*ps), 1); } else if (StrEquals(token, "ScatterWindowGroups")) { S_SET_DO_USE_WINDOW_GROUP_HINT(SCF(*ps), !on); S_SET_DO_USE_WINDOW_GROUP_HINT(SCM(*ps), 1); S_SET_DO_USE_WINDOW_GROUP_HINT(SCC(*ps), 1); } else if (StrEquals(token, "State")) { unsigned int mask; unsigned int states; spargs = GetIntegerArguments(rest, NULL, tmpno, 1); if (spargs == 1 && tmpno[0] >= 0 && tmpno[0] <= 31) { PeekToken(rest,&rest); states = S_USER_STATES(SCF(*ps)); mask = (1 << tmpno[0]); if (on) { states |= mask; } else { states &= ~mask; } S_SET_USER_STATES(SCF(*ps), states); S_ADD_USER_STATES(SCM(*ps), mask); S_ADD_USER_STATES(SCC(*ps), mask); } else { fvwm_msg( ERR,"style_parse_one_style_option", "bad State arg: %s", rest); } } else if (StrEquals(token, "SnapAttraction")) { int val; char *token; int snap_proximity; int snap_mode; do { snap_proximity = DEFAULT_SNAP_ATTRACTION; snap_mode = DEFAULT_SNAP_ATTRACTION_MODE; if ( GetIntegerArguments( rest, &rest, &val, 1) != 1) { break; } if (val >= 0) { snap_proximity = val; } if (val == 0) { break; } token = PeekToken(rest, &rest); if (token == NULL) { break; } if (StrEquals(token, "All")) { snap_mode = SNAP_ICONS | SNAP_WINDOWS; token = PeekToken(rest, &rest); } else if (StrEquals(token, "None")) { snap_mode = SNAP_NONE; token = PeekToken(rest, &rest); } else if (StrEquals(token, "SameType")) { snap_mode = SNAP_SAME; token = PeekToken(rest, &rest); } else if (StrEquals(token, "Icons")) { snap_mode = SNAP_ICONS; token = PeekToken(rest, &rest); } else if (StrEquals(token, "Windows")) { snap_mode = SNAP_WINDOWS; token = PeekToken(rest, &rest); } if (token == NULL) { break; } if (StrEquals(token, "Screen")) { snap_mode |= SNAP_SCREEN; } else if (StrEquals(token, "ScreenWindows")) { snap_mode |= SNAP_SCREEN_WINDOWS; } else if (StrEquals(token, "ScreenIcons")) { snap_mode |= SNAP_SCREEN_ICONS; } else if (StrEquals(token, "ScreenAll")) { snap_mode |= SNAP_SCREEN_ALL; } } while (0); ps->flags.has_snap_attraction = 1; ps->flag_mask.has_snap_attraction = 1; ps->change_mask.has_snap_attraction = 1; SSET_SNAP_PROXIMITY(*ps, snap_proximity); SSET_SNAP_MODE(*ps, snap_mode); } else if (StrEquals(token, "SnapGrid")) { int num; num = GetIntegerArguments(rest, &rest, val, 2); if (num != 2) { val[0] = DEFAULT_SNAP_GRID_X; val[1] = DEFAULT_SNAP_GRID_Y; } if (val[0] < 0) { val[0] = DEFAULT_SNAP_GRID_X; } if (val[1] < 0) { val[1] = DEFAULT_SNAP_GRID_Y; } ps->flags.has_snap_grid = 1; ps->flag_mask.has_snap_grid = 1; ps->change_mask.has_snap_grid = 1; SSET_SNAP_GRID_X(*ps, val[0]); SSET_SNAP_GRID_Y(*ps, val[1]); } else { found = False; } break; case 't': if (StrEquals(token, "TileCascadePlacement")) { ps->flags.placement_mode = PLACE_TILECASCADE; ps->flag_mask.placement_mode = PLACE_MASK; ps->change_mask.placement_mode = PLACE_MASK; } else if (StrEquals(token, "TileManualPlacement")) { ps->flags.placement_mode = PLACE_TILEMANUAL; ps->flag_mask.placement_mode = PLACE_MASK; ps->change_mask.placement_mode = PLACE_MASK; } else if (StrEquals(token, "Title")) { ps->flags.has_no_title = !on; ps->flag_mask.has_no_title = 1; ps->change_mask.has_no_title = 1; } else if (StrEquals(token, "TitleAtBottom")) { S_SET_TITLE_DIR(SCF(*ps), DIR_S); S_SET_TITLE_DIR(SCM(*ps), DIR_MAJOR_MASK); S_SET_TITLE_DIR(SCC(*ps), DIR_MAJOR_MASK); } else if (StrEquals(token, "TitleAtTop")) { S_SET_TITLE_DIR(SCF(*ps), DIR_N); S_SET_TITLE_DIR(SCM(*ps), DIR_MAJOR_MASK); S_SET_TITLE_DIR(SCC(*ps), DIR_MAJOR_MASK); } else if (StrEquals(token, "TitleAtLeft")) { S_SET_TITLE_DIR(SCF(*ps), DIR_W); S_SET_TITLE_DIR(SCM(*ps), DIR_MAJOR_MASK); S_SET_TITLE_DIR(SCC(*ps), DIR_MAJOR_MASK); } else if (StrEquals(token, "TitleAtRight")) { S_SET_TITLE_DIR(SCF(*ps), DIR_E); S_SET_TITLE_DIR(SCM(*ps), DIR_MAJOR_MASK); S_SET_TITLE_DIR(SCC(*ps), DIR_MAJOR_MASK); } else if (StrEquals(token, "TitleFormat")) { char *fmt_string = NULL; (rest != NULL) ? fmt_string = strdup(rest) : NULL; rest = NULL; /* Consume the string. */ if (fmt_string == NULL) { fmt_string = DEFAULT_TITLE_FORMAT; } if (!__validate_titleformat_string(fmt_string)) { fvwm_msg(ERR, "style_parse_one_style_option", "TitleFormat string invalid: %s", fmt_string); } SSET_TITLE_FORMAT_STRING(*ps, fmt_string); ps->flags.has_title_format_string = 1; ps->flag_mask.has_title_format_string = 1; ps->change_mask.has_title_format_string = 1; } else if (StrEquals(token, "TopTitleRotated")) { S_SET_IS_TOP_TITLE_ROTATED(SCF(*ps), on); S_SET_IS_TOP_TITLE_ROTATED(SCM(*ps), 1); S_SET_IS_TOP_TITLE_ROTATED(SCC(*ps), 1); } else if (StrEquals(token, "TopTitleNotRotated")) { S_SET_IS_TOP_TITLE_ROTATED(SCF(*ps), !on); S_SET_IS_TOP_TITLE_ROTATED(SCM(*ps), 1); S_SET_IS_TOP_TITLE_ROTATED(SCC(*ps), 1); } else { found = False; } break; case 'u': if (StrEquals(token, "UsePPosition")) { ps->flags.use_no_pposition = !on; ps->flag_mask.use_no_pposition = 1; ps->change_mask.use_no_pposition = 1; } else if (StrEquals(token, "UseUSPosition")) { ps->flags.use_no_usposition = !on; ps->flag_mask.use_no_usposition = 1; ps->change_mask.use_no_usposition = 1; } else if (StrEquals(token, "UseTransientPPosition")) { ps->flags.use_no_transient_pposition = !on; ps->flag_mask.use_no_transient_pposition = 1; ps->change_mask.use_no_transient_pposition = 1; } else if (StrEquals(token, "UseTransientUSPosition")) { ps->flags.use_no_transient_usposition = !on; ps->flag_mask.use_no_transient_usposition = 1; ps->change_mask.use_no_transient_usposition = 1; } else if (StrEquals(token, "UseIconPosition")) { S_SET_USE_ICON_POSITION_HINT(SCF(*ps), on); S_SET_USE_ICON_POSITION_HINT(SCM(*ps), 1); S_SET_USE_ICON_POSITION_HINT(SCC(*ps), 1); } else if (StrEquals(token, "UseTitleDecorRotation")) { S_SET_USE_TITLE_DECOR_ROTATION(SCF(*ps), on); S_SET_USE_TITLE_DECOR_ROTATION(SCM(*ps), 1); S_SET_USE_TITLE_DECOR_ROTATION(SCC(*ps), 1); } #ifdef USEDECOR else if (StrEquals(token, "UseDecor")) { SAFEFREE(SGET_DECOR_NAME(*ps)); rest = GetNextToken(rest, &token); SSET_DECOR_NAME(*ps, token); ps->flags.has_decor = (token != NULL); ps->flag_mask.has_decor = 1; ps->change_mask.has_decor = 1; } #endif else if (StrEquals(token, "UseStyle")) { int hit; token = PeekToken(rest, &rest); if (!token) { fvwm_msg(ERR, "style_parse_one_style_option", "UseStyle needs an argument"); break; } hit = 0; /* changed to accum multiple Style definitions * (veliaa@rpi.edu) */ for (add_style = all_styles; add_style; add_style = SGET_NEXT_STYLE(*add_style)) { if (SGET_ID_HAS_NAME(*add_style) && StrEquals(token, SGET_NAME(*add_style))) { /* match style */ hit = 1; merge_styles(ps, add_style, True); } /* end found matching style */ } /* end looking at all styles */ /* move forward one word */ if (!hit) { fvwm_msg( ERR, "style_parse_one_style_option", "UseStyle: %s style not found", token); } } else if (StrEquals(token, "Unmanaged")) { ps->flags.is_unmanaged = on; ps->flag_mask.is_unmanaged = 1; ps->change_mask.is_unmanaged = 1; } else { found = False; } break; case 'v': if (StrEquals(token, "VariablePosition") || StrEquals(token, "VariableUSPosition")) { S_SET_IS_FIXED(SCF(*ps), !on); S_SET_IS_FIXED(SCM(*ps), 1); S_SET_IS_FIXED(SCC(*ps), 1); } else if (StrEquals(token, "VariablePPosition")) { S_SET_IS_FIXED_PPOS(SCF(*ps), !on); S_SET_IS_FIXED_PPOS(SCM(*ps), 1); S_SET_IS_FIXED_PPOS(SCC(*ps), 1); } else if (StrEquals(token, "VariableSize") || StrEquals(token, "VariableUSSize")) { S_SET_IS_SIZE_FIXED(SCF(*ps), !on); S_SET_IS_SIZE_FIXED(SCM(*ps), 1); S_SET_IS_SIZE_FIXED(SCC(*ps), 1); } else if (StrEquals(token, "VariablePSize")) { S_SET_IS_PSIZE_FIXED(SCF(*ps), !on); S_SET_IS_PSIZE_FIXED(SCM(*ps), 1); S_SET_IS_PSIZE_FIXED(SCC(*ps), 1); } else { found = False; } break; case 'w': if (StrEquals(token, "WindowListSkip")) { S_SET_DO_WINDOW_LIST_SKIP(SCF(*ps), on); S_SET_DO_WINDOW_LIST_SKIP(SCM(*ps), 1); S_SET_DO_WINDOW_LIST_SKIP(SCC(*ps), 1); } else if (StrEquals(token, "WindowListHit")) { S_SET_DO_WINDOW_LIST_SKIP(SCF(*ps), !on); S_SET_DO_WINDOW_LIST_SKIP(SCM(*ps), 1); S_SET_DO_WINDOW_LIST_SKIP(SCC(*ps), 1); } else if (StrEquals(token, "WindowShadeSteps")) { int n = 0; int val = 0; int unit = 0; n = GetOnePercentArgument(rest, &val, &unit); if (n != 1) { val = 0; } else { PeekToken(rest,&rest); } /* we have a 'pixel' suffix if unit != 0; negative * values mean pixels */ val = (unit != 0) ? -val : val; ps->flags.has_window_shade_steps = 1; ps->flag_mask.has_window_shade_steps = 1; ps->change_mask.has_window_shade_steps = 1; SSET_WINDOW_SHADE_STEPS(*ps, val); } else if (StrEquals(token, "WindowShadeScrolls")) { S_SET_DO_SHRINK_WINDOWSHADE(SCF(*ps), !on); S_SET_DO_SHRINK_WINDOWSHADE(SCM(*ps), 1); S_SET_DO_SHRINK_WINDOWSHADE(SCC(*ps), 1); } else if (StrEquals(token, "WindowShadeShrinks")) { S_SET_DO_SHRINK_WINDOWSHADE(SCF(*ps), on); S_SET_DO_SHRINK_WINDOWSHADE(SCM(*ps), 1); S_SET_DO_SHRINK_WINDOWSHADE(SCC(*ps), 1); } else if (StrEquals(token, "WindowShadeLazy")) { S_SET_WINDOWSHADE_LAZINESS(SCF(*ps), WINDOWSHADE_LAZY); S_SET_WINDOWSHADE_LAZINESS( SCM(*ps), WINDOWSHADE_LAZY_MASK); S_SET_WINDOWSHADE_LAZINESS( SCC(*ps), WINDOWSHADE_LAZY_MASK); } else if (StrEquals(token, "WindowShadeAlwaysLazy")) { S_SET_WINDOWSHADE_LAZINESS( SCF(*ps), WINDOWSHADE_ALWAYS_LAZY); S_SET_WINDOWSHADE_LAZINESS( SCM(*ps), WINDOWSHADE_LAZY_MASK); S_SET_WINDOWSHADE_LAZINESS( SCC(*ps), WINDOWSHADE_LAZY_MASK); } else if (StrEquals(token, "WindowShadeBusy")) { S_SET_WINDOWSHADE_LAZINESS(SCF(*ps), WINDOWSHADE_BUSY); S_SET_WINDOWSHADE_LAZINESS( SCM(*ps), WINDOWSHADE_LAZY_MASK); S_SET_WINDOWSHADE_LAZINESS( SCC(*ps), WINDOWSHADE_LAZY_MASK); } else { found = False; } break; case 'x': case 'y': case 'z': if (0) { } else { found = False; } break; default: found = False; break; } if (ret_rest) { *ret_rest = rest; } if (token_l != NULL) { free(token_l); } return found; } static void parse_and_set_window_style(char *action, char *prefix, window_style *ps) { char *option; char *token; char *rest; Bool found; /* which current boxes to chain to */ icon_boxes *cur_ib = NULL; while (isspace((unsigned char)*action)) { action++; } while (action && *action && *action != '\n') { action = GetNextFullOption(action, &option); if (!option) { break; } token = PeekToken(option, &rest); if (!token) { free(option); break; } /* It might make more sense to capture the whole word, fix its * case, and use strcmp, but there aren't many caseless compares * because of this "switch" on the first letter. */ found = style_parse_one_style_option( token, rest, &rest, prefix, ps, &cur_ib); if (found == False) { fvwm_msg( ERR, "style_parse_and_set_window_style", "Bad style option: %s", option); /* Can't return here since all malloced memory will be * lost. Ignore rest of line instead. */ /* No, I think we /can/ return here. In fact, /not/ * bombing out leaves a half-done style in the list! * N.Bird 07-Sep-1999 */ /* domivogt (01-Oct-1999): Which is exactly what we * want! Why should all the styles be thrown away if a * single one is mis-spelled? Let's just continue * parsing styles. */ } else if (rest != NULL) { rest = SkipSpaces(rest,NULL,0); if (*rest) { fvwm_msg(WARN, "style_parse_and_set_window_style", "Unconsumed argument in %s: %s", option, rest); } } free(option); } /* end while still stuff on command */ return; } /* Process a style command. First built up in a temp area. * If valid, added to the list in a malloced area. * * *** Important note *** * * Remember that *all* styles need a flag, flag_mask and change_mask. * It is not enough to add the code for new styles in this function. * There *must* be corresponding code in handle_new_window_style() * and merge_styles() too. And don't forget that allocated memory * must be freed in ProcessDestroyStyle(). */ static void __style_command(F_CMD_ARGS, char *prefix, Bool is_window_style) { /* temp area to build name list */ window_style *ps; ps = (window_style *)safemalloc(sizeof(window_style)); /* init temp window_style area */ memset(ps, 0, sizeof(window_style)); /* init default focus policy */ fpol_init_default_fp(&S_FOCUS_POLICY(SCF(*ps))); /* mark style as changed */ ps->has_style_changed = 1; /* set global flag */ Scr.flags.do_need_window_update = 1; /* default StartsOnPage behavior for initial capture */ ps->flags.capture_honors_starts_on_page = 1; if (!is_window_style) { /* parse style name */ action = GetNextToken(action, &SGET_NAME(*ps)); /* in case there was no argument! */ if (SGET_NAME(*ps) == NULL) { free(ps); return; } SSET_ID_HAS_NAME(*ps, True); } else { SSET_WINDOW_ID(*ps, (XID)FW_W(exc->w.fw)); SSET_ID_HAS_WINDOW_ID(*ps, True); CopyString(&SGET_NAME(*ps), ""); /* safe */ } if (action == NULL) { free(SGET_NAME(*ps)); free(ps); return; } parse_and_set_window_style(action, prefix, ps); /* capture default icons */ if (SGET_ID_HAS_NAME(*ps) && StrEquals(SGET_NAME(*ps), "*")) { if (ps->flags.has_icon == 1) { if (Scr.DefaultIcon) { free(Scr.DefaultIcon); } Scr.DefaultIcon = SGET_ICON_NAME(*ps); ps->flags.has_icon = 0; ps->flag_mask.has_icon = 0; ps->change_mask.has_icon = 1; SSET_ICON_NAME(*ps, NULL); } } if (last_style_in_list && styles_have_same_id(ps, last_style_in_list)) { /* merge with previous style */ merge_styles(last_style_in_list, ps, True); free_style(ps); free(ps); } else { /* add temp name list to list */ add_style_to_list(ps); cleanup_style_defaults(ps); } return; } /* ---------------------------- interface functions ------------------------ */ /* Compare two flag structures passed as byte arrays. Only compare bits set in * the mask. * * Returned Value: * zero if the flags are the same * non-zero otherwise * * Inputs: * flags1 - first byte array of flags to compare * flags2 - second byte array of flags to compare * mask - byte array of flags to be considered for the comparison * len - number of bytes to compare */ Bool blockcmpmask(char *blk1, char *blk2, char *mask, int length) { int i; for (i = 0; i < length; i++) { if ((blk1[i] & mask[i]) != (blk2[i] & mask[i])) { /* flags are not the same, return 1 */ return False; } } return True; } void free_icon_boxes(icon_boxes *ib) { icon_boxes *temp; for ( ; ib != NULL; ib = temp) { temp = ib->next; if (ib->use_count == 0) { free(ib); } else { /* we can't delete the icon box yet, it is still in use */ ib->is_orphan = True; } } return; } void simplify_style_list(void) { /* one pass through the style list, then process other events first */ Scr.flags.do_need_style_list_update = __simplify_style_list(); return; } /* lookup_style - look through a list for a window name, or class * * Returned Value: * merged matching styles in callers window_style. * * Inputs: * fw - FvwmWindow structure to match against * styles - callers return area */ void lookup_style(FvwmWindow *fw, window_style *styles) { window_style *nptr; /* clear callers return area */ memset(styles, 0, sizeof(window_style)); /* look thru all styles in order defined. */ for (nptr = all_styles; nptr != NULL; nptr = SGET_NEXT_STYLE(*nptr)) { if (fw_match_style_id(fw, SGET_ID(*nptr))) { merge_styles(styles, nptr, False); } } if (!DO_IGNORE_GNOME_HINTS(fw)) { window_style gnome_style; /* use GNOME hints if not overridden by user with * GNOMEIgnoreHitns */ memset(&gnome_style, 0, sizeof(window_style)); GNOME_GetStyle(fw, &gnome_style); merge_styles(&gnome_style, styles, False); memcpy(styles, &gnome_style, sizeof(window_style)); } EWMH_GetStyle(fw, styles); return; } /* This function sets the style update flags as necessary */ void check_window_style_change( FvwmWindow *t, update_win *flags, window_style *ret_style) { int i; char *wf; char *sf; char *sc; lookup_style(t, ret_style); if (!ret_style->has_style_changed && !IS_STYLE_DELETED(t)) { /* nothing to do */ return; } /* do_ignore_gnome_hints * * must handle these first because they may alter the style */ if (S_DO_IGNORE_GNOME_HINTS(SCC(*ret_style)) && !S_DO_IGNORE_GNOME_HINTS(SCF(*ret_style))) { GNOME_GetStyle(t, ret_style); /* may need further treatment for some styles */ flags->do_update_gnome_styles = 1; } /*** common style flags ***/ wf = (char *)(&FW_COMMON_STATIC_FLAGS(t)); sf = (char *)(&SCFS(*ret_style)); if (IS_STYLE_DELETED(t)) { /* update all styles */ memset(flags, 0xff, sizeof(*flags)); SET_STYLE_DELETED(t, 0); /* copy the static common window flags */ for (i = 0; i < sizeof(SCFS(*ret_style)); i++) { wf[i] = sf[i]; } return; } /* All static common styles can simply be copied. For some there is * additional work to be done below. */ sc = (char *)(&SCCS(*ret_style)); for (i = 0; i < sizeof(SCFS(*ret_style)); i++) { wf[i] = (wf[i] & ~sc[i]) | (sf[i] & sc[i]); sf[i] = wf[i]; } /* is_sticky * is_icon_sticky */ if (S_IS_STICKY_ACROSS_PAGES(SCC(*ret_style)) || S_IS_STICKY_ACROSS_DESKS(SCC(*ret_style))) { flags->do_update_stick = 1; } else if (S_IS_ICON_STICKY_ACROSS_PAGES(SCC(*ret_style)) && IS_ICONIFIED(t) && !IS_STICKY_ACROSS_PAGES(t)) { flags->do_update_stick_icon = 1; } else if (S_IS_ICON_STICKY_ACROSS_DESKS(SCC(*ret_style)) && IS_ICONIFIED(t) && !IS_STICKY_ACROSS_DESKS(t)) { flags->do_update_stick_icon = 1; } /* focus policy */ if (fpol_is_policy_changed(&S_FOCUS_POLICY(SCC(*ret_style)))) { flags->do_setup_focus_policy = 1; } /* is_left_title_rotated_cw * is_right_title_rotated_cw * is_top_title_rotated * is_bottom_title_rotated */ if (S_IS_LEFT_TITLE_ROTATED_CW(SCC(*ret_style)) || S_IS_RIGHT_TITLE_ROTATED_CW(SCC(*ret_style)) || S_IS_TOP_TITLE_ROTATED(SCC(*ret_style)) || S_IS_BOTTOM_TITLE_ROTATED(SCC(*ret_style))) { flags->do_update_title_text_dir = 1; } /* title_dir */ if (S_TITLE_DIR(SCC(*ret_style))) { flags->do_update_title_dir = 1; } /* use_title_decor_rotation */ if (S_USE_TITLE_DECOR_ROTATION(SCC(*ret_style))) { flags->do_update_rotated_title = 1; } /* has_mwm_border * has_mwm_buttons */ if (S_HAS_MWM_BORDER(SCC(*ret_style)) || S_HAS_MWM_BUTTONS(SCC(*ret_style))) { flags->do_redecorate = 1; } /* has_icon_font */ if (S_HAS_ICON_FONT(SCC(*ret_style))) { flags->do_update_icon_font = 1; } /* has_window_font */ if (S_HAS_WINDOW_FONT(SCC(*ret_style))) { flags->do_update_window_font = 1; } /* has_stippled_title */ if (S_HAS_STIPPLED_TITLE(SCC(*ret_style)) || S_HAS_NO_STICKY_STIPPLED_TITLE(SCC(*ret_style)) || S_HAS_STIPPLED_ICON_TITLE(SCC(*ret_style)) || S_HAS_NO_STICKY_STIPPLED_ICON_TITLE(SCC(*ret_style))) { flags->do_redraw_decoration = 1; } /* has_no_icon_title * is_icon_suppressed * * handled below */ /*** private style flags ***/ /* nothing to do for these flags (only used when mapping new windows): * * do_place_random * do_place_smart * do_start_lowered * use_no_pposition * use_no_usposition * use_no_transient_pposition * use_no_transient_usposition * use_start_on_desk * use_start_on_page_for_transient * use_start_on_screen * manual_placement_honors_starts_on_page * capture_honors_starts_on_page * recapture_honors_starts_on_page * ewmh_placement_mode */ /* not implemented yet: * * handling the 'usestyle' style */ /* do_window_list_skip */ if (S_DO_WINDOW_LIST_SKIP(SCC(*ret_style))) { flags->do_update_modules_flags = 1; flags->do_update_ewmh_state_hints = 1; } /* has_icon * icon_override */ if (ret_style->change_mask.has_icon || S_ICON_OVERRIDE(SCC(*ret_style))) { flags->do_update_icon_font = 1; flags->do_update_icon = 1; } /* has_icon_background_padding * has_icon_background_relief * has_icon_title_relief */ if (ret_style->change_mask.has_icon_background_padding || ret_style->change_mask.has_icon_background_relief || ret_style->change_mask.has_icon_title_relief) { flags->do_update_icon = 1; } /* has_no_icon_title * is_icon_suppressed */ if (S_HAS_NO_ICON_TITLE(SCC(*ret_style)) || S_IS_ICON_SUPPRESSED(SCC(*ret_style))) { flags->do_update_icon_font = 1; flags->do_update_icon_title = 1; flags->do_update_icon = 1; flags->do_update_modules_flags = 1; } /* has_icon_size_limits */ if (ret_style->change_mask.has_icon_size_limits) { flags->do_update_icon_size_limits = 1; flags->do_update_icon = 1; } /* has_icon_boxes */ if (ret_style->change_mask.has_icon_boxes) { flags->do_update_icon_boxes = 1; flags->do_update_icon = 1; } /* do_ewmh_donate_icon */ if (S_DO_EWMH_DONATE_ICON(SCC(*ret_style))) { flags->do_update_ewmh_icon = 1; } /* has_mini_icon * do_ewmh_mini_icon_override */ if ( FMiniIconsSupported && ( ret_style->change_mask.has_mini_icon || S_DO_EWMH_MINI_ICON_OVERRIDE(SCC(*ret_style)))) { flags->do_update_mini_icon = 1; flags->do_update_ewmh_mini_icon = 1; flags->do_redecorate = 1; } /* do_ewmh_donate_mini_icon */ if (FMiniIconsSupported && S_DO_EWMH_DONATE_MINI_ICON(SCC(*ret_style))) { flags->do_update_ewmh_mini_icon = 1; } /* has_min_window_size */ /* has_max_window_size */ if (ret_style->change_mask.has_min_window_size) { flags->do_resize_window = 1; flags->do_update_ewmh_allowed_actions = 1; flags->do_update_modules_flags = 1; } if (ret_style->change_mask.has_max_window_size) { flags->do_resize_window = 1; flags->do_update_ewmh_allowed_actions = 1; flags->do_update_modules_flags = 1; } /* has_color_back * has_color_fore * use_colorset * use_border_colorset */ if (ret_style->change_mask.has_color_fore || ret_style->change_mask.has_color_back || ret_style->change_mask.use_colorset || ret_style->change_mask.use_border_colorset) { flags->do_update_window_color = 1; } /* has_color_back_hi * has_color_fore_hi * use_colorset_hi * use_border_colorset_hi */ if (ret_style->change_mask.has_color_fore_hi || ret_style->change_mask.has_color_back_hi || ret_style->change_mask.use_colorset_hi || ret_style->change_mask.use_border_colorset_hi) { flags->do_update_window_color_hi = 1; } /* use_icon_title_colorset */ if (ret_style->change_mask.use_icon_title_colorset) { flags->do_update_icon_title_cs = 1; } /* use_icon_title_colorset_hi */ if (ret_style->change_mask.use_icon_title_colorset_hi) { flags->do_update_icon_title_cs_hi = 1; } /* use_icon_title_colorset */ if (ret_style->change_mask.use_icon_title_colorset) { flags->do_update_icon_title_cs = 1; } /* use_icon_background_colorset */ if (ret_style->change_mask.use_icon_background_colorset) { flags->do_update_icon_background_cs = 1; } /* has_decor */ if (ret_style->change_mask.has_decor) { flags->do_redecorate = 1; flags->do_update_window_font_height = 1; } /* has_no_title */ if (ret_style->change_mask.has_no_title) { flags->do_redecorate = 1; flags->do_update_window_font = 1; } /* do_decorate_transient */ if (ret_style->change_mask.do_decorate_transient) { flags->do_redecorate_transient = 1; } /* has_ol_decor */ if (ret_style->change_mask.has_ol_decor) { /* old decor overrides 'has_no_icon_title'! */ flags->do_update_icon_font = 1; flags->do_update_icon_title = 1; flags->do_update_icon = 1; flags->do_redecorate = 1; } /* Changing layer. */ if (ret_style->change_mask.use_layer) { flags->do_update_layer = 1; } /* has_no_border * has_border_width * has_handle_width * has_mwm_decor * has_mwm_functions * has_no_handles * is_button_disabled */ if (S_HAS_NO_BORDER(SCC(*ret_style)) || ret_style->change_mask.has_border_width || ret_style->change_mask.has_handle_width || ret_style->change_mask.has_mwm_decor || ret_style->change_mask.has_mwm_functions || ret_style->change_mask.has_no_handles || ret_style->change_mask.is_button_disabled) { flags->do_redecorate = 1; flags->do_update_ewmh_allowed_actions = 1; flags->do_update_modules_flags = 1; } if (ret_style->change_mask.do_save_under || ret_style->change_mask.use_backing_store || ret_style->change_mask.use_parent_relative) { flags->do_update_frame_attributes = 1; } if (ret_style->change_mask.use_parent_relative && ret_style->flags.use_parent_relative) { /* needed only for Opacity -> ParentalRelativity */ flags->do_refresh = 1; } /* has_placement_penalty * has_placement_percentage_penalty */ if (ret_style->change_mask.has_placement_penalty || ret_style->change_mask.has_placement_percentage_penalty) { flags->do_update_placement_penalty = 1; } /* do_ewmh_ignore_strut_hints */ if (S_DO_EWMH_IGNORE_STRUT_HINTS(SCC(*ret_style))) { flags->do_update_working_area = 1; } /* do_ewmh_ignore_state_hints */ if (S_DO_EWMH_IGNORE_STATE_HINTS(SCC(*ret_style))) { flags->do_update_ewmh_state_hints = 1; flags->do_update_modules_flags = 1; } /* do_ewmh_use_staking_hints */ if (S_DO_EWMH_USE_STACKING_HINTS(SCC(*ret_style))) { flags->do_update_ewmh_stacking_hints = 1; } /* has_title_format_string */ if (ret_style->change_mask.has_title_format_string) { flags->do_update_visible_window_name = 1; flags->do_redecorate = 1; } /* has_icon_title_format_string */ if (ret_style->change_mask.has_icon_title_format_string) { flags->do_update_visible_icon_name = 1; flags->do_update_icon_title = 1; } /* is_fixed */ if (S_IS_FIXED(SCC(*ret_style)) || S_IS_FIXED_PPOS(SCC(*ret_style)) || S_IS_SIZE_FIXED(SCC(*ret_style)) || S_IS_PSIZE_FIXED(SCC(*ret_style)) || S_HAS_OVERRIDE_SIZE(SCC(*ret_style))) { flags->do_update_ewmh_allowed_actions = 1; flags->do_update_modules_flags = 1; } /* cr_motion_method */ if (SCR_MOTION_METHOD(&ret_style->change_mask)) { flags->do_update_cr_motion_method = 1; } return; } /* Mark all styles as unchanged. */ void reset_style_changes(void) { window_style *temp; for (temp = all_styles; temp != NULL; temp = SGET_NEXT_STYLE(*temp)) { temp->has_style_changed = 0; memset(&SCCS(*temp), 0, sizeof(SCCS(*temp))); memset(&(temp->change_mask), 0, sizeof(temp->change_mask)); } return; } /* Mark styles as updated if their colorset changed. */ void update_style_colorset(int colorset) { window_style *temp; for (temp = all_styles; temp != NULL; temp = SGET_NEXT_STYLE(*temp)) { if (SUSE_COLORSET(&temp->flags) && SGET_COLORSET(*temp) == colorset) { temp->has_style_changed = 1; temp->change_mask.use_colorset = 1; Scr.flags.do_need_window_update = 1; } if (SUSE_COLORSET_HI(&temp->flags) && SGET_COLORSET_HI(*temp) == colorset) { temp->has_style_changed = 1; temp->change_mask.use_colorset_hi = 1; Scr.flags.do_need_window_update = 1; } if (SUSE_BORDER_COLORSET(&temp->flags) && SGET_BORDER_COLORSET(*temp) == colorset) { temp->has_style_changed = 1; temp->change_mask.use_border_colorset = 1; Scr.flags.do_need_window_update = 1; } if (SUSE_BORDER_COLORSET_HI(&temp->flags) && SGET_BORDER_COLORSET_HI(*temp) == colorset) { temp->has_style_changed = 1; temp->change_mask.use_border_colorset_hi = 1; Scr.flags.do_need_window_update = 1; } if (SUSE_ICON_TITLE_COLORSET(&temp->flags) && SGET_ICON_TITLE_COLORSET(*temp) == colorset) { temp->has_style_changed = 1; temp->change_mask.use_icon_title_colorset = 1; Scr.flags.do_need_window_update = 1; } if (SUSE_ICON_TITLE_COLORSET_HI(&temp->flags) && SGET_ICON_TITLE_COLORSET_HI(*temp) == colorset) { temp->has_style_changed = 1; temp->change_mask.use_icon_title_colorset_hi = 1; Scr.flags.do_need_window_update = 1; } if (SUSE_ICON_BACKGROUND_COLORSET(&temp->flags) && SGET_ICON_BACKGROUND_COLORSET(*temp) == colorset) { temp->has_style_changed = 1; temp->change_mask.use_icon_background_colorset = 1; Scr.flags.do_need_window_update = 1; } } return; } /* Update fore and back colours for a specific window */ void update_window_color_style(FvwmWindow *fw, window_style *pstyle) { int cs = Scr.DefaultColorset; if (SUSE_COLORSET(&pstyle->flags)) { cs = SGET_COLORSET(*pstyle); fw->cs = cs; } else { fw->cs = -1; } if (SGET_FORE_COLOR_NAME(*pstyle) != NULL && !SUSE_COLORSET(&pstyle->flags)) { fw->colors.fore = GetColor(SGET_FORE_COLOR_NAME(*pstyle)); } else { fw->colors.fore = Colorset[cs].fg; } if (SGET_BACK_COLOR_NAME(*pstyle) != NULL && !SUSE_COLORSET(&pstyle->flags)) { fw->colors.back = GetColor(SGET_BACK_COLOR_NAME(*pstyle)); fw->colors.shadow = GetShadow(fw->colors.back); fw->colors.hilight = GetHilite(fw->colors.back); } else { fw->colors.hilight = Colorset[cs].hilite; fw->colors.shadow = Colorset[cs].shadow; fw->colors.back = Colorset[cs].bg; } if (SUSE_BORDER_COLORSET(&pstyle->flags)) { cs = SGET_BORDER_COLORSET(*pstyle); fw->border_cs = cs; fw->border_colors.hilight = Colorset[cs].hilite; fw->border_colors.shadow = Colorset[cs].shadow; fw->border_colors.back = Colorset[cs].bg; } else { fw->border_cs = -1; fw->border_colors.hilight = fw->colors.hilight; fw->border_colors.shadow = fw->colors.shadow; fw->border_colors.back = fw->colors.back; } } void update_window_color_hi_style(FvwmWindow *fw, window_style *pstyle) { int cs = Scr.DefaultColorset; if (SUSE_COLORSET_HI(&pstyle->flags)) { cs = SGET_COLORSET_HI(*pstyle); fw->cs_hi = cs; } else { fw->cs_hi = -1; } if ( SGET_FORE_COLOR_NAME_HI(*pstyle) != NULL && !SUSE_COLORSET_HI(&pstyle->flags)) { fw->hicolors.fore = GetColor(SGET_FORE_COLOR_NAME_HI(*pstyle)); } else { fw->hicolors.fore = Colorset[cs].fg; } if ( SGET_BACK_COLOR_NAME_HI(*pstyle) != NULL && !SUSE_COLORSET_HI(&pstyle->flags)) { fw->hicolors.back = GetColor(SGET_BACK_COLOR_NAME_HI(*pstyle)); fw->hicolors.shadow = GetShadow(fw->hicolors.back); fw->hicolors.hilight = GetHilite(fw->hicolors.back); } else { fw->hicolors.hilight = Colorset[cs].hilite; fw->hicolors.shadow = Colorset[cs].shadow; fw->hicolors.back = Colorset[cs].bg; } if (SUSE_BORDER_COLORSET_HI(&pstyle->flags)) { cs = SGET_BORDER_COLORSET_HI(*pstyle); fw->border_cs_hi = cs; fw->border_hicolors.hilight = Colorset[cs].hilite; fw->border_hicolors.shadow = Colorset[cs].shadow; fw->border_hicolors.back = Colorset[cs].bg; } else { fw->border_cs_hi = -1; fw->border_hicolors.hilight = fw->hicolors.hilight; fw->border_hicolors.shadow = fw->hicolors.shadow; fw->border_hicolors.back = fw->hicolors.back; } } void update_icon_title_cs_style(FvwmWindow *fw, window_style *pstyle) { if (SUSE_ICON_TITLE_COLORSET(&pstyle->flags)) { fw->icon_title_cs = SGET_ICON_TITLE_COLORSET(*pstyle); } else { fw->icon_title_cs = -1; } } void update_icon_title_cs_hi_style(FvwmWindow *fw, window_style *pstyle) { if (SUSE_ICON_TITLE_COLORSET_HI(&pstyle->flags)) { fw->icon_title_cs_hi = SGET_ICON_TITLE_COLORSET_HI(*pstyle); } else { fw->icon_title_cs_hi = -1; } } void update_icon_background_cs_style(FvwmWindow *fw, window_style *pstyle) { if (SUSE_ICON_BACKGROUND_COLORSET(&pstyle->flags)) { fw->icon_background_cs = SGET_ICON_BACKGROUND_COLORSET(*pstyle); } else { fw->icon_background_cs = -1; } } void style_destroy_style(style_id_t s_id) { FvwmWindow *t; if (remove_all_of_style_from_list(s_id)) { /* compact the current list of styles */ Scr.flags.do_need_style_list_update = 1; } else { return; } /* mark windows for update */ for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if (fw_match_style_id(t, s_id)) { SET_STYLE_DELETED(t, 1); Scr.flags.do_need_window_update = 1; } } return; } void print_styles(int verbose) { window_style *nptr; int count = 0; int mem = 0; fprintf(stderr,"Info on fvwm Styles:\n"); if (verbose) { fprintf(stderr," List of Styles Names:\n"); } for (nptr = all_styles; nptr != NULL; nptr = SGET_NEXT_STYLE(*nptr)) { count++; if (SGET_ID_HAS_NAME(*nptr)) { mem += strlen(SGET_NAME(*nptr)); if (verbose) { fprintf(stderr," * %s\n", SGET_NAME(*nptr)); } } else { mem++; if (verbose) { fprintf(stderr," * 0x%lx\n", (unsigned long)SGET_WINDOW_ID(*nptr)); } } if (SGET_BACK_COLOR_NAME(*nptr)) { mem += strlen(SGET_BACK_COLOR_NAME(*nptr)); if (verbose > 1) { fprintf( stderr," Back Color: %s\n", SGET_BACK_COLOR_NAME(*nptr)); } } if (SGET_FORE_COLOR_NAME(*nptr)) { mem += strlen(SGET_FORE_COLOR_NAME(*nptr)); if (verbose > 1) { fprintf( stderr," Fore Color: %s\n", SGET_FORE_COLOR_NAME(*nptr)); } } if (SGET_BACK_COLOR_NAME_HI(*nptr)) { mem += strlen(SGET_BACK_COLOR_NAME_HI(*nptr)); if (verbose > 1) { fprintf( stderr," Back Color hi: %s\n", SGET_BACK_COLOR_NAME_HI(*nptr)); } } if (SGET_FORE_COLOR_NAME_HI(*nptr)) { mem += strlen(SGET_FORE_COLOR_NAME_HI(*nptr)); if (verbose > 1) { fprintf( stderr," Fore Color hi: %s\n", SGET_FORE_COLOR_NAME_HI(*nptr)); } } if (SGET_DECOR_NAME(*nptr)) { mem += strlen(SGET_DECOR_NAME(*nptr)); if (verbose > 1) { fprintf( stderr," Decor: %s\n", SGET_DECOR_NAME(*nptr)); } } if (SGET_WINDOW_FONT(*nptr)) { mem += strlen(SGET_WINDOW_FONT(*nptr)); if (verbose > 1) { fprintf( stderr," Window Font: %s\n", SGET_WINDOW_FONT(*nptr)); } } if (SGET_ICON_FONT(*nptr)) { mem += strlen(SGET_ICON_FONT(*nptr)); if (verbose > 1) { fprintf( stderr," Icon Font: %s\n", SGET_ICON_FONT(*nptr)); } } if (SGET_ICON_NAME(*nptr)) { mem += strlen(SGET_ICON_NAME(*nptr)); if (verbose > 1) { fprintf( stderr," Icon Name: %s\n", SGET_ICON_NAME(*nptr)); } } if (SGET_MINI_ICON_NAME(*nptr)) { mem += strlen(SGET_MINI_ICON_NAME(*nptr)); if (verbose > 1) { fprintf( stderr," MiniIcon Name: %s\n", SGET_MINI_ICON_NAME(*nptr)); } } if (SGET_ICON_BOXES(*nptr)) { mem += sizeof(icon_boxes); } } fprintf(stderr," Number of styles: %d, Memory Used: %d bits\n", count, (int)(count*sizeof(window_style) + mem)); return; } /* ---------------------------- builtin commands --------------------------- */ void CMD_Style(F_CMD_ARGS) { __style_command(F_PASS_ARGS, NULL, False); return; } void CMD_WindowStyle(F_CMD_ARGS) { __style_command(F_PASS_ARGS, NULL, True); return; } void CMD_FocusStyle(F_CMD_ARGS) { __style_command(F_PASS_ARGS, "FP", False); return; } void CMD_DestroyStyle(F_CMD_ARGS) { char *name; style_id_t s_id; /* parse style name */ name = PeekToken(action, &action); /* in case there was no argument! */ if (name == NULL) return; memset(&s_id, 0, sizeof(style_id_t)); SID_SET_NAME(s_id, name); SID_SET_HAS_NAME(s_id, True); /* Do it */ style_destroy_style(s_id); return; } void CMD_DestroyWindowStyle(F_CMD_ARGS) { style_id_t s_id; memset(&s_id, 0, sizeof(style_id_t)); SID_SET_WINDOW_ID(s_id, (XID)FW_W(exc->w.fw)); SID_SET_HAS_WINDOW_ID(s_id, True); /* Do it */ style_destroy_style(s_id); return; } fvwm-2.6.5.orig/fvwm/ewmh_conf.c0000644000175000017500000002046711545673171014735 0ustar vwcvwc/* -*-c-*- */ /* Copyright (C) 2001 Olivier Chapuis */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "config.h" #include #include #include #include "libs/fvwmlib.h" #include "libs/Parse.h" #include "libs/Strings.h" #include "fvwm.h" #include "cursor.h" #include "functions.h" #include "misc.h" #include "screen.h" #include "update.h" #include "stack.h" #include "style.h" #include "externs.h" #include "icons.h" #include "ewmh.h" #include "ewmh_intern.h" #include "move_resize.h" /* * CMDS */ static void set_state_workaround(void) { FvwmWindow *t; for (t = Scr.FvwmRoot.next; t != NULL; t = t->next) { if ((t->Desk != Scr.CurrentDesk) && (!is_window_sticky_across_desks(t) && !IS_ICON_UNMAPPED(t))) { if (Scr.bo.do_enable_ewmh_iconic_state_workaround) { SetMapStateProp(t, NormalState); } else { SetMapStateProp(t, IconicState); } } } } Bool EWMH_BugOpts(char *opt, Bool toggle) { Bool save_isw = Scr.bo.do_enable_ewmh_iconic_state_workaround; if (StrEquals(opt,"EWMHIconicStateWorkaround")) { switch (toggle) { case -1: Scr.bo.do_enable_ewmh_iconic_state_workaround ^= 1; break; case 0: case 1: Scr.bo.do_enable_ewmh_iconic_state_workaround = toggle; break; default: Scr.bo.do_enable_ewmh_iconic_state_workaround = 0; break; } if (save_isw != Scr.bo.do_enable_ewmh_iconic_state_workaround) { set_state_workaround(); } return True; } return False; } void CMD_EwmhNumberOfDesktops(F_CMD_ARGS) { int val[2]; int num; num = GetIntegerArguments(action, NULL, val, 2); if ((num != 1 && num != 2) || val[0] < 1 || (num == 2 && val[1] < val[0] && val[1] != 0)) { fvwm_msg(ERR,"EwmhNumberOfDesktops", "Bad arguments to EwmhNumberOfDesktops"); return; } if (num == 2 && ewmhc.MaxDesktops != val[1]) { ewmhc.MaxDesktops = val[1]; num = 3; } else if (num == 1 && ewmhc.MaxDesktops != 0) { ewmhc.MaxDesktops = 0; num = 3; } if (ewmhc.NumberOfDesktops != val[0]) { ewmhc.NumberOfDesktops = val[0]; num = 3; } if (num == 3) { ewmhc.NeedsToCheckDesk = True; EWMH_SetNumberOfDesktops(); } } void CMD_EwmhBaseStruts(F_CMD_ARGS) { int val[4]; if (GetIntegerArguments(action, NULL, val, 4) != 4 || val[0] < 0 || val[1] < 0 || val[2] < 0 || val[3] < 0) { fvwm_msg(ERR,"CMD_EwmhBaseStruts", "EwmhBaseStruts needs four positive arguments"); return; } if (ewmhc.BaseStrut.left != val[0] || ewmhc.BaseStrut.right != val[1] || ewmhc.BaseStrut.top != val[2] || ewmhc.BaseStrut.bottom != val[3]) { ewmhc.BaseStrut.left = val[0]; ewmhc.BaseStrut.right = val[1]; ewmhc.BaseStrut.top = val[2]; ewmhc.BaseStrut.bottom = val[3]; EWMH_UpdateWorkArea(); } } /* * Styles */ Bool EWMH_CMD_Style(char *token, window_style *ptmpstyle, int on) { int found = False; if (StrEquals(token, "EWMHDonateIcon")) { found = True; S_SET_DO_EWMH_DONATE_ICON(SCF(*ptmpstyle), on); S_SET_DO_EWMH_DONATE_ICON(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_DONATE_ICON(SCC(*ptmpstyle), 1); } else if (StrEquals(token, "EWMHDonateMiniIcon")) { found = True; S_SET_DO_EWMH_DONATE_MINI_ICON(SCF(*ptmpstyle), on); S_SET_DO_EWMH_DONATE_MINI_ICON(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_DONATE_MINI_ICON(SCC(*ptmpstyle), 1); } else if (StrEquals(token, "EWMHDontDonateIcon")) { found = True; S_SET_DO_EWMH_DONATE_ICON(SCF(*ptmpstyle), !on); S_SET_DO_EWMH_DONATE_ICON(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_DONATE_ICON(SCC(*ptmpstyle), 1); } else if (StrEquals(token, "EWMHDontDonateMiniIcon")) { found = True; S_SET_DO_EWMH_DONATE_MINI_ICON(SCF(*ptmpstyle), !on); S_SET_DO_EWMH_DONATE_MINI_ICON(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_DONATE_MINI_ICON(SCC(*ptmpstyle), 1); } else if (StrEquals(token, "EWMHMaximizeIgnoreWorkingArea")) { found = True; S_SET_EWMH_MAXIMIZE_MODE( SCF(*ptmpstyle), EWMH_IGNORE_WORKING_AREA); S_SET_EWMH_MAXIMIZE_MODE( SCM(*ptmpstyle), EWMH_WORKING_AREA_MASK); S_SET_EWMH_MAXIMIZE_MODE( SCC(*ptmpstyle), EWMH_WORKING_AREA_MASK); } else if (StrEquals(token, "EWMHMaximizeUseWorkingArea")) { found = True; S_SET_EWMH_MAXIMIZE_MODE( SCF(*ptmpstyle), EWMH_USE_WORKING_AREA); S_SET_EWMH_MAXIMIZE_MODE( SCM(*ptmpstyle), EWMH_WORKING_AREA_MASK); S_SET_EWMH_MAXIMIZE_MODE( SCC(*ptmpstyle), EWMH_WORKING_AREA_MASK); } else if (StrEquals(token, "EWMHMaximizeUseDynamicWorkingArea")) { found = True; S_SET_EWMH_MAXIMIZE_MODE( SCF(*ptmpstyle), EWMH_USE_DYNAMIC_WORKING_AREA); S_SET_EWMH_MAXIMIZE_MODE( SCM(*ptmpstyle), EWMH_WORKING_AREA_MASK); S_SET_EWMH_MAXIMIZE_MODE( SCC(*ptmpstyle), EWMH_WORKING_AREA_MASK); } else if (StrEquals(token, "EWMHMiniIconOverride")) { found = True; S_SET_DO_EWMH_MINI_ICON_OVERRIDE(SCF(*ptmpstyle), on); S_SET_DO_EWMH_MINI_ICON_OVERRIDE(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_MINI_ICON_OVERRIDE(SCC(*ptmpstyle), 1); } else if (StrEquals(token, "EWMHNoMiniIconOverride")) { found = True; S_SET_DO_EWMH_MINI_ICON_OVERRIDE(SCF(*ptmpstyle), !on); S_SET_DO_EWMH_MINI_ICON_OVERRIDE(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_MINI_ICON_OVERRIDE(SCC(*ptmpstyle), 1); } else if (StrEquals(token, "EWMHPlacementIgnoreWorkingArea")) { found = True; ptmpstyle->flags.ewmh_placement_mode = EWMH_IGNORE_WORKING_AREA; ptmpstyle->flag_mask.ewmh_placement_mode = EWMH_WORKING_AREA_MASK; ptmpstyle->change_mask.ewmh_placement_mode = EWMH_WORKING_AREA_MASK; } else if (StrEquals(token, "EWMHPlacementUseWorkingArea")) { found = True; ptmpstyle->flags.ewmh_placement_mode = EWMH_USE_WORKING_AREA; ptmpstyle->flag_mask.ewmh_placement_mode = EWMH_WORKING_AREA_MASK; ptmpstyle->change_mask.ewmh_placement_mode = EWMH_WORKING_AREA_MASK; } else if (StrEquals(token, "EWMHPlacementUseDynamicWorkingArea")) { found = True; ptmpstyle->flags.ewmh_placement_mode = EWMH_USE_DYNAMIC_WORKING_AREA; ptmpstyle->flag_mask.ewmh_placement_mode = EWMH_WORKING_AREA_MASK; ptmpstyle->change_mask.ewmh_placement_mode = EWMH_WORKING_AREA_MASK; } else if (StrEquals(token, "EWMHUseStackingOrderHints")) { found = True; S_SET_DO_EWMH_USE_STACKING_HINTS(SCF(*ptmpstyle), on); S_SET_DO_EWMH_USE_STACKING_HINTS(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_USE_STACKING_HINTS(SCC(*ptmpstyle), 1); } else if (StrEquals(token, "EWMHIgnoreStackingOrderHints")) { found = True; S_SET_DO_EWMH_USE_STACKING_HINTS(SCF(*ptmpstyle), !on); S_SET_DO_EWMH_USE_STACKING_HINTS(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_USE_STACKING_HINTS(SCC(*ptmpstyle), 1); } else if (StrEquals(token, "EWMHUseStateHints")) { found = True; S_SET_DO_EWMH_IGNORE_STATE_HINTS(SCF(*ptmpstyle), !on); S_SET_DO_EWMH_IGNORE_STATE_HINTS(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_IGNORE_STATE_HINTS(SCC(*ptmpstyle), 1); } else if (StrEquals(token, "EWMHIgnoreStateHints")) { found = True; S_SET_DO_EWMH_IGNORE_STATE_HINTS(SCF(*ptmpstyle), on); S_SET_DO_EWMH_IGNORE_STATE_HINTS(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_IGNORE_STATE_HINTS(SCC(*ptmpstyle), 1); } else if (StrEquals(token, "EWMHUseStrutHints")) { found = True; S_SET_DO_EWMH_IGNORE_STRUT_HINTS(SCF(*ptmpstyle), !on); S_SET_DO_EWMH_IGNORE_STRUT_HINTS(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_IGNORE_STRUT_HINTS(SCC(*ptmpstyle), 1); } else if (StrEquals(token, "EWMHIgnoreStrutHints")) { found = True; S_SET_DO_EWMH_IGNORE_STRUT_HINTS(SCF(*ptmpstyle), on); S_SET_DO_EWMH_IGNORE_STRUT_HINTS(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_IGNORE_STRUT_HINTS(SCC(*ptmpstyle), 1); } else if (StrEquals(token, "EWMHIgnoreWindowType")) { found = True; S_SET_DO_EWMH_IGNORE_WINDOW_TYPE(SCF(*ptmpstyle), on); S_SET_DO_EWMH_IGNORE_WINDOW_TYPE(SCM(*ptmpstyle), 1); S_SET_DO_EWMH_IGNORE_WINDOW_TYPE(SCC(*ptmpstyle), 1); } return found; } fvwm-2.6.5.orig/fvwm/focus.c0000644000175000017500000006441210630540746014100 0ustar vwcvwc/* -*-c-*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * This module is all original code * by Rob Nation * Copyright 1993, Robert Nation * You may use this code for any purpose, as long as the original * copyright remains in the source code and all documentation */ /* ---------------------------- included header files ---------------------- */ #include "config.h" #include #include "libs/fvwmlib.h" #include "libs/charmap.h" #include "libs/wcontext.h" #include "libs/ClientMsg.h" #include "libs/Grab.h" #include "libs/Parse.h" #include "libs/Strings.h" #include "fvwm.h" #include "externs.h" #include "execcontext.h" #include "eventhandler.h" #include "bindings.h" #include "misc.h" #include "screen.h" #include "focus.h" #include "borders.h" #include "frame.h" #include "virtual.h" #include "stack.h" #include "geometry.h" #include "colormaps.h" #include "add_window.h" /* ---------------------------- local definitions -------------------------- */ /* ---------------------------- local macros ------------------------------- */ /* ---------------------------- imports ------------------------------------ */ /* ---------------------------- included code files ------------------------ */ /* ---------------------------- local types -------------------------------- */ typedef struct { unsigned do_allow_force_broadcast : 1; unsigned do_forbid_warp : 1; unsigned do_force : 1; unsigned is_focus_by_flip_focus_cmd : 1; unsigned client_entered : 1; fpol_set_focus_by_t set_by; } sftfwin_args_t; /* ---------------------------- forward declarations ----------------------- */ /* ---------------------------- local variables ---------------------------- */ static Bool lastFocusType; /* Last window which Fvwm gave the focus to NOT the window that really has the * focus */ static FvwmWindow *ScreenFocus = NULL; /* Window which had focus before the pointer moved to a different screen. */ static FvwmWindow *LastScreenFocus = NULL; /* ---------------------------- exported variables (globals) --------------- */ /* ---------------------------- local functions ---------------------------- */ static Bool focus_get_fpol_context_flag( fpol_context_t *fpol_context, int context) { int flag; switch (context) { case C_WINDOW: case C_EWMH_DESKTOP: flag = fpol_context->client; break; case C_ICON: flag = fpol_context->icon; break; default: flag = fpol_context->decor; break; } return (flag) ? True : False; } /* * Helper functions for setting the focus */ static void __try_program_focus(Window w, const FvwmWindow *fw) { if (fw && WM_TAKES_FOCUS(fw) && FP_DO_FOCUS_BY_PROGRAM(FW_FOCUS_POLICY(fw))) { send_clientmessage(dpy, w, _XA_WM_TAKE_FOCUS, fev_get_evtime()); } return; } static Bool __try_forbid_user_focus( Window w, FvwmWindow *fw) { if (fw == NULL || fpol_query_allow_user_focus(&FW_FOCUS_POLICY(fw)) == True) { return False; } if (WM_TAKES_FOCUS(fw)) { /* give it a chance to take the focus itself */ __try_program_focus(w, fw); XFlush(dpy); } else { /* make sure the window is not hilighted */ border_draw_decorations( fw, PART_ALL, False, False, CLEAR_ALL, NULL, NULL); } return True; } static Bool __check_allow_focus( Window w, FvwmWindow *fw, fpol_set_focus_by_t set_by) { FvwmWindow *sf; if (fw == NULL || set_by == FOCUS_SET_FORCE) { /* always allow to delete focus */ return True; } sf = get_focus_window(); if (!FP_IS_LENIENT(FW_FOCUS_POLICY(fw)) && !focus_does_accept_input_focus(fw) && sf != NULL && sf->Desk == Scr.CurrentDesk) { /* window does not want focus */ return False; } if (fpol_query_allow_set_focus(&FW_FOCUS_POLICY(fw), set_by)) { return True; } return False; } static void __update_windowlist( FvwmWindow *fw, fpol_set_focus_by_t set_by, int is_focus_by_flip_focus_cmd) { lastFocusType = (is_focus_by_flip_focus_cmd) ? True : False; if (fw == NULL || focus_is_focused(fw) || fw == &Scr.FvwmRoot || IS_SCHEDULED_FOR_DESTROY(fw)) { return; } /* Watch out: fw may not be on the windowlist and the windowlist may be * empty */ if (!is_focus_by_flip_focus_cmd && (FP_DO_SORT_WINDOWLIST_BY(FW_FOCUS_POLICY(fw)) == FPOL_SORT_WL_BY_OPEN || set_by == FOCUS_SET_BY_FUNCTION)) { /* move the windowlist around so that fw is at the top */ FvwmWindow *fw2; /* find the window on the windowlist */ for (fw2 = &Scr.FvwmRoot; fw2 && fw2 != fw; fw2 = fw2->next) { /* nothing */ } if (fw2) { /* the window is on the (non-zero length) windowlist */ /* make fw2 point to the last window on the list */ while (fw2->next) { fw2 = fw2->next; } /* close the ends of the windowlist */ fw2->next = Scr.FvwmRoot.next; Scr.FvwmRoot.next->prev = fw2; /* make fw the new start of the list */ Scr.FvwmRoot.next = fw; /* open the closed loop windowlist */ fw->prev->next = NULL; fw->prev = &Scr.FvwmRoot; } } else { /* pluck window from list and deposit at top */ /* remove fw from list */ if (fw->prev) { fw->prev->next = fw->next; } if (fw->next) { fw->next->prev = fw->prev; } /* insert fw at start */ fw->next = Scr.FvwmRoot.next; if (Scr.FvwmRoot.next) { Scr.FvwmRoot.next->prev = fw; } Scr.FvwmRoot.next = fw; fw->prev = &Scr.FvwmRoot; } return; } static Bool __try_other_screen_focus(const FvwmWindow *fw) { if (fw == NULL && !Scr.flags.is_pointer_on_this_screen) { FvwmWindow *sf; sf = get_focus_window(); set_focus_window(NULL); if (sf != NULL) { focus_grab_buttons(sf); } /* DV (25-Nov-2000): Don't give the Scr.NoFocusWin the focus * here. This would steal the focus from the other screen's * root window again. */ return True; } return False; } /* * Sets the input focus to the indicated window. */ static void __set_focus_to_fwin( Window w, FvwmWindow *fw, sftfwin_args_t *args) { FvwmWindow *sf; if (__try_forbid_user_focus(w, fw) == True) { return; } __try_program_focus(w, fw); if (__check_allow_focus(w, fw, args->set_by) == False) { return; } __update_windowlist(fw, args->set_by, args->is_focus_by_flip_focus_cmd); if (__try_other_screen_focus(fw) == True) { return; } if (fw && !args->do_forbid_warp) { if (IS_ICONIFIED(fw)) { rectangle r; Bool rc; rc = get_visible_icon_geometry(fw, &r); if (!rc || !IsRectangleOnThisPage(&r, fw->Desk)) { fw = NULL; w = Scr.NoFocusWin; } } else if (!IsRectangleOnThisPage(&(fw->g.frame), fw->Desk)) { fw = NULL; w = Scr.NoFocusWin; } } sf = get_focus_window(); if (fw == NULL) { FOCUS_SET(Scr.NoFocusWin); set_focus_window(NULL); Scr.UnknownWinFocused = None; XFlush(dpy); return; } /* RBW - allow focus to go to a NoIconTitle icon window so * auto-raise will work on it. */ if (IS_ICONIFIED(fw)) { Bool is_window_selected = False; if (FW_W_ICON_TITLE(fw)) { w = FW_W_ICON_TITLE(fw); is_window_selected = True; } if ((!is_window_selected || WAS_ICON_HINT_PROVIDED(fw)) && FW_W_ICON_PIXMAP(fw)) { w = FW_W_ICON_PIXMAP(fw); } } if (FP_IS_LENIENT(FW_FOCUS_POLICY(fw))) { FOCUS_SET(w); set_focus_window(fw); if (args->do_allow_force_broadcast) { SET_FOCUS_CHANGE_BROADCAST_PENDING(fw, 1); } Scr.UnknownWinFocused = None; } else if (focus_does_accept_input_focus(fw)) { /* Window will accept input focus */ if (Scr.StolenFocusWin == w && Scr.UnknownWinFocused != None) { /* Without this FocusIn is not generated on the * window if it was focuesed when the unmanaged * window took focus. */ FOCUS_SET(Scr.NoFocusWin); } FOCUS_SET(w); set_focus_window(fw); if (fw) { if (args->do_allow_force_broadcast) { SET_FOCUS_CHANGE_BROADCAST_PENDING(fw, 1); } } Scr.UnknownWinFocused = None; } else if (sf && sf->Desk == Scr.CurrentDesk) { /* Window doesn't want focus. Leave focus alone */ } else { FOCUS_SET(Scr.NoFocusWin); set_focus_window(NULL); } XFlush(dpy); return; } static void set_focus_to_fwin( Window w, FvwmWindow *fw, sftfwin_args_t *args) { FvwmWindow *sf; sf = get_focus_window(); if (!args->do_force && fw == sf) { focus_grab_buttons(sf); return; } __set_focus_to_fwin(w, fw, args); /* Make sure the button grabs on the new and the old focused windows * are up to date. */ if (args->client_entered) { focus_grab_buttons_client_entered(fw); } else { focus_grab_buttons(fw); } /* RBW -- don't call this twice for the same window! */ if (fw != get_focus_window()) { if (args->client_entered) { focus_grab_buttons_client_entered(get_focus_window()); } else { focus_grab_buttons(get_focus_window()); } } return; } /* * * Moves pointer to specified window * */ static void warp_to_fvwm_window( const exec_context_t *exc, int warp_x, int x_unit, int warp_y, int y_unit) { int dx,dy; int cx,cy; int x,y; FvwmWindow *t = exc->w.fw; if (t == (FvwmWindow *)0 || (IS_ICONIFIED(t) && FW_W_ICON_TITLE(t) == None)) { return; } if (t->Desk != Scr.CurrentDesk) { goto_desk(t->Desk); } if (IS_ICONIFIED(t)) { rectangle g; Bool rc; rc = get_visible_icon_title_geometry(t, &g); if (rc == False) { get_visible_icon_picture_geometry(t, &g); } cx = g.x + g.width / 2; cy = g.y + g.height / 2; } else { cx = t->g.frame.x + t->g.frame.width/2; cy = t->g.frame.y + t->g.frame.height/2; } dx = (cx + Scr.Vx) / Scr.MyDisplayWidth * Scr.MyDisplayWidth; dy = (cy + Scr.Vy) / Scr.MyDisplayHeight * Scr.MyDisplayHeight; if (dx != Scr.Vx || dy != Scr.Vy) { MoveViewport(dx, dy, True); } if (IS_ICONIFIED(t)) { rectangle g; Bool rc; rc = get_visible_icon_title_geometry(t, &g); if (rc == False) { get_visible_icon_picture_geometry(t, &g); } x = g.x + g.width / 2; y = g.y + g.height / 2; } else { if (x_unit != Scr.MyDisplayWidth && warp_x >= 0) { x = t->g.frame.x + warp_x; } else if (x_unit != Scr.MyDisplayWidth) { x = t->g.frame.x + t->g.frame.width + warp_x; } else if (warp_x >= 0) { x = t->g.frame.x + (t->g.frame.width - 1) * warp_x / 100; } else { x = t->g.frame.x + (t->g.frame.width - 1) * (100 + warp_x) / 100; } if (y_unit != Scr.MyDisplayHeight && warp_y >= 0) { y = t->g.frame.y + warp_y; } else if (y_unit != Scr.MyDisplayHeight) { y = t->g.frame.y + t->g.frame.height + warp_y; } else if (warp_y >= 0) { y = t->g.frame.y + (t->g.frame.height - 1) * warp_y / 100; } else { y = t->g.frame.y + (t->g.frame.height - 1) * (100 + warp_y) / 100; } } FWarpPointerUpdateEvpos( exc->x.elast, dpy, None, Scr.Root, 0, 0, 0, 0, x, y); RaiseWindow(t, False); /* If the window is still not visible, make it visible! */ if (t->g.frame.x + t->g.frame.width < 0 || t->g.frame.y + t->g.frame.height < 0 || t->g.frame.x >= Scr.MyDisplayWidth || t->g.frame.y >= Scr.MyDisplayHeight) { frame_setup_window( t, 0, 0, t->g.frame.width, t->g.frame.height, False); FWarpPointerUpdateEvpos( exc->x.elast, dpy, None, Scr.Root, 0, 0, 0, 0, 2, 2); } return; } static Bool focus_query_grab_buttons(FvwmWindow *fw, Bool client_entered) { Bool flag; Bool is_focused; if (fw->Desk != Scr.CurrentDesk || IS_ICONIFIED(fw)) { return False; } is_focused = focus_is_focused(fw); if (!is_focused && FP_DO_FOCUS_CLICK_CLIENT(FW_FOCUS_POLICY(fw))) { return True; } if (is_on_top_of_layer_and_above_unmanaged(fw)) { return False; } if (is_focused) { flag = FP_DO_RAISE_FOCUSED_CLIENT_CLICK(FW_FOCUS_POLICY(fw)); } else { flag = FP_DO_RAISE_UNFOCUSED_CLIENT_CLICK(FW_FOCUS_POLICY(fw)); } return (flag) ? True : False; } static FvwmWindow *__restore_focus_after_unmap( const FvwmWindow *fw, Bool do_skip_marked_transients) { FvwmWindow *t = NULL; FvwmWindow *set_focus_to = NULL; t = get_transientfor_fvwmwindow(fw); if (t != NULL && FP_DO_RELEASE_FOCUS_TRANSIENT(FW_FOCUS_POLICY(fw)) && !FP_DO_OVERRIDE_RELEASE_FOCUS(FW_FOCUS_POLICY(t)) && t->Desk == fw->Desk && (!do_skip_marked_transients || !IS_IN_TRANSIENT_SUBTREE(t))) { set_focus_to = t; } else if (t == NULL && FP_DO_RELEASE_FOCUS(FW_FOCUS_POLICY(fw))) { for (t = fw->next; t != NULL && set_focus_to == NULL; t = t->next) { if (!FP_DO_OVERRIDE_RELEASE_FOCUS( FW_FOCUS_POLICY(t)) && t->Desk == fw->Desk && !DO_SKIP_CIRCULATE(t) && !(IS_ICONIFIED(t) && (DO_SKIP_ICON_CIRCULATE(t) || IS_ICON_SUPPRESSED(t))) && (!do_skip_marked_transients || !IS_IN_TRANSIENT_SUBTREE(t))) { /* If it is on a different desk we have to look * for another window */ set_focus_to = t; } } } if (set_focus_to && set_focus_to != fw && set_focus_to->Desk == fw->Desk) { /* Don't transfer focus to windows on other desks */ SetFocusWindow(set_focus_to, True, FOCUS_SET_FORCE); } if (focus_is_focused(fw)) { DeleteFocus(True); } return set_focus_to; } /* * * Moves focus to specified window; only to be called bay Focus and FlipFocus * */ static void __activate_window_by_command( F_CMD_ARGS, int is_focus_by_flip_focus_cmd) { int cx; int cy; Bool do_not_warp; sftfwin_args_t sf_args; FvwmWindow * const fw = exc->w.fw; memset(&sf_args, 0, sizeof(sf_args)); sf_args.do_allow_force_broadcast = 1; sf_args.is_focus_by_flip_focus_cmd = is_focus_by_flip_focus_cmd; sf_args.set_by = FOCUS_SET_BY_FUNCTION; sf_args.client_entered = 0; if (fw == NULL || !FP_DO_FOCUS_BY_FUNCTION(FW_FOCUS_POLICY(fw))) { UngrabEm(GRAB_NORMAL); if (fw) { /* give the window a chance to take the focus itself */ sf_args.do_forbid_warp = 1; sf_args.do_force = 0; set_focus_to_fwin(FW_W(fw), fw, &sf_args); } return; } do_not_warp = StrEquals(PeekToken(action, NULL), "NoWarp"); if (!do_not_warp) { if (fw->Desk != Scr.CurrentDesk) { goto_desk(fw->Desk); } if (IS_ICONIFIED(fw)) { rectangle g; Bool rc; rc = get_visible_icon_title_geometry(fw, &g); if (rc == False) { get_visible_icon_picture_geometry(fw, &g); } cx = g.x + g.width / 2; cy = g.y + g.height / 2; } else { cx = fw->g.frame.x + fw->g.frame.width/2; cy = fw->g.frame.y + fw->g.frame.height/2; } if ( cx < 0 || cx >= Scr.MyDisplayWidth || cy < 0 || cy >= Scr.MyDisplayHeight) { int dx; int dy; dx = ((cx + Scr.Vx) / Scr.MyDisplayWidth) * Scr.MyDisplayWidth; dy = ((cy + Scr.Vy) / Scr.MyDisplayHeight) * Scr.MyDisplayHeight; MoveViewport(dx, dy, True); } #if 0 /* can not happen */ /* If the window is still not visible, make it visible! */ if (fw->g.frame.x + fw->g.frame.width < 0 || fw->g.frame.y + fw->g.frame.height < 0 || fw->g.frame.x >= Scr.MyDisplayWidth || fw->g.frame.y >= Scr.MyDisplayHeight) { frame_setup_window( fw, 0, 0, fw->g.frame.width, fw->g.frame.height, False); if ( FP_DO_WARP_POINTER_ON_FOCUS_FUNC( FW_FOCUS_POLICY(fw))) { FWarpPointerUpdateEvpos( exc->x.elast, dpy, None, Scr.Root, 0, 0, 0, 0, 2, 2); } } #endif } UngrabEm(GRAB_NORMAL); if (fw->Desk == Scr.CurrentDesk) { FvwmWindow *sf; sf = get_focus_window(); sf_args.do_forbid_warp = !!do_not_warp; sf_args.do_force = 0; sf_args.client_entered = 0; set_focus_to_fwin(FW_W(fw), fw, &sf_args); if (sf != get_focus_window()) { /* Ignore EnterNotify event while we are waiting for * this window to be focused. */ Scr.focus_in_pending_window = sf; } } return; } static void __focus_grab_one_button( FvwmWindow *fw, int button, int grab_buttons) { Bool do_grab; do_grab = (grab_buttons & (1 << button)); if ((do_grab & (1 << button)) == (fw->grabbed_buttons & (1 << button))) { return; } if (do_grab) { XGrabButton( dpy, button + 1, AnyModifier, FW_W_PARENT(fw), True, ButtonPressMask, GrabModeSync, GrabModeAsync, None, None); /* Set window flags accordingly as we grab or ungrab. */ fw->grabbed_buttons |= (1 << button); } else { XUngrabButton(dpy, button + 1, AnyModifier, FW_W_PARENT(fw)); fw->grabbed_buttons &= ~(1 << button); } return; } /* ---------------------------- interface functions ------------------------ */ Bool focus_does_accept_input_focus(const FvwmWindow *fw) { return (!fw || !fw->wmhints || !(fw->wmhints->flags & InputHint) || fw->wmhints->input); } Bool focus_is_focused(const FvwmWindow *fw) { return (fw && fw == ScreenFocus); } Bool focus_query_click_to_raise( FvwmWindow *fw, Bool is_focused, int context) { fpol_context_t *c; if (is_focused) { c = &FP_DO_RAISE_FOCUSED_CLICK(FW_FOCUS_POLICY(fw)); } else { c = &FP_DO_RAISE_UNFOCUSED_CLICK(FW_FOCUS_POLICY(fw)); } return focus_get_fpol_context_flag(c, context); } Bool focus_query_click_to_focus( FvwmWindow *fw, int context) { fpol_context_t *c; c = &FP_DO_FOCUS_CLICK(FW_FOCUS_POLICY(fw)); return focus_get_fpol_context_flag(c, context); } /* Takes as input the window that wants the focus and the one that currently * has the focus and returns if the new window should get it. */ Bool focus_query_open_grab_focus(FvwmWindow *fw, FvwmWindow *focus_win) { if (fw == NULL) { return False; } focus_win = get_focus_window(); if (focus_win != NULL && FP_DO_OVERRIDE_GRAB_FOCUS(FW_FOCUS_POLICY(focus_win))) { /* Don't steal the focus from the current window */ return False; } validate_transientfor(fw); if (IS_TRANSIENT(fw) && FW_W_TRANSIENTFOR(fw) != Scr.Root) { if (focus_win != NULL && FP_DO_GRAB_FOCUS_TRANSIENT(FW_FOCUS_POLICY(fw)) && FW_W(focus_win) == FW_W_TRANSIENTFOR(fw)) { /* it's a transient and its transientfor currently has * focus. */ return True; } } else { if (FP_DO_GRAB_FOCUS(FW_FOCUS_POLICY(fw)) && (focus_win == NULL || !FP_DO_OVERRIDE_GRAB_FOCUS(FW_FOCUS_POLICY(focus_win)))) { return True; } } return False; } /* Returns true if the focus has to be restored to a different window after * unmapping. */ Bool focus_query_close_release_focus(const FvwmWindow *fw) { if (fw == NULL || fw != get_focus_window()) { return False; } if (!IS_TRANSIENT(fw) && (FW_W_TRANSIENTFOR(fw) == Scr.Root || FP_DO_GRAB_FOCUS(FW_FOCUS_POLICY(fw)))) { return True; } else if (IS_TRANSIENT(fw) && FP_DO_GRAB_FOCUS_TRANSIENT(FW_FOCUS_POLICY(fw))) { return True; } return False; } static void __focus_grab_buttons(FvwmWindow *fw, Bool client_entered) { int i; Bool do_grab_window = False; int grab_buttons; if (fw == NULL || IS_SCHEDULED_FOR_DESTROY(fw) || !IS_MAPPED(fw)) { /* It is pointless to grab buttons on dieing windows. Buttons * can not be grabbed when the window is unmapped. */ return; } grab_buttons = Scr.buttons2grab; do_grab_window = focus_query_grab_buttons(fw, client_entered); if (do_grab_window == True) { grab_buttons |= FP_USE_MOUSE_BUTTONS(FW_FOCUS_POLICY(fw)); } if (grab_buttons != fw->grabbed_buttons) { MyXGrabServer(dpy); for (i = 0; i < NUMBER_OF_EXTENDED_MOUSE_BUTTONS; i++) { __focus_grab_one_button(fw, i, grab_buttons); } MyXUngrabServer (dpy); } return; } void focus_grab_buttons(FvwmWindow *fw) { __focus_grab_buttons(fw, False); } void focus_grab_buttons_client_entered(FvwmWindow *fw) { __focus_grab_buttons(fw, True); } void focus_grab_buttons_on_layer(int layer) { FvwmWindow *fw; for ( fw = Scr.FvwmRoot.stack_next; fw != &Scr.FvwmRoot && fw->layer >= layer; fw = fw->stack_next) { if (fw->layer == layer) { focus_grab_buttons(fw); } } return; } void focus_grab_buttons_all(void) { FvwmWindow *fw; for (fw = Scr.FvwmRoot.next; fw != NULL; fw = fw->next) { focus_grab_buttons(fw); } return; } void _SetFocusWindow( FvwmWindow *fw, Bool do_allow_force_broadcast, fpol_set_focus_by_t set_by, Bool client_entered) { sftfwin_args_t sf_args; memset(&sf_args, 0, sizeof(sf_args)); sf_args.do_allow_force_broadcast = !!do_allow_force_broadcast; sf_args.is_focus_by_flip_focus_cmd = 0; sf_args.do_forbid_warp = 0; sf_args.do_force = 1; sf_args.set_by = set_by; if (client_entered) { sf_args.client_entered = 1; } else { sf_args.client_entered = 0; } set_focus_to_fwin(FW_W(fw), fw, &sf_args); return; } void _ReturnFocusWindow(FvwmWindow *fw) { sftfwin_args_t sf_args; memset(&sf_args, 0, sizeof(sf_args)); sf_args.do_allow_force_broadcast = 1; sf_args.is_focus_by_flip_focus_cmd = 0; sf_args.do_forbid_warp = 1; sf_args.client_entered = 0; sf_args.do_force = 0; sf_args.set_by = FOCUS_SET_FORCE; set_focus_to_fwin(FW_W(fw), fw, &sf_args); return; } void _DeleteFocus(Bool do_allow_force_broadcast) { sftfwin_args_t sf_args; memset(&sf_args, 0, sizeof(sf_args)); sf_args.do_allow_force_broadcast = !!do_allow_force_broadcast; sf_args.is_focus_by_flip_focus_cmd = 0; sf_args.do_forbid_warp = 0; sf_args.client_entered = 0; sf_args.do_force = 0; sf_args.set_by = FOCUS_SET_FORCE; set_focus_to_fwin(Scr.NoFocusWin, NULL, &sf_args); return; } void _ForceDeleteFocus(void) { sftfwin_args_t sf_args; memset(&sf_args, 0, sizeof(sf_args)); sf_args.do_allow_force_broadcast = 1; sf_args.is_focus_by_flip_focus_cmd = 0; sf_args.do_forbid_warp = 0; sf_args.client_entered = 0; sf_args.do_force = 1; sf_args.set_by = FOCUS_SET_FORCE; set_focus_to_fwin(Scr.NoFocusWin, NULL, &sf_args); return; } /* When a window is unmapped (or destroyed) this function takes care of * adjusting the focus window appropriately. */ void restore_focus_after_unmap( const FvwmWindow *fw, Bool do_skip_marked_transients) { extern FvwmWindow *colormap_win; FvwmWindow *set_focus_to = NULL; if (focus_is_focused(fw)) { set_focus_to = __restore_focus_after_unmap( fw, do_skip_marked_transients); } if (fw == Scr.pushed_window) { Scr.pushed_window = NULL; } if (fw == colormap_win) { InstallWindowColormaps(set_focus_to); } return; } Bool IsLastFocusSetByMouse(void) { return lastFocusType; } /* same as above, but forces to regrab buttons on the window under the pointer * if necessary */ void focus_grab_buttons_on_pointer_window(void) { Window w; FvwmWindow *fw; if (!FQueryPointer( dpy, Scr.Root, &JunkRoot, &w, &JunkX, &JunkY, &JunkX, &JunkY, &JunkMask)) { /* pointer is not on this screen */ return; } if (XFindContext(dpy, w, FvwmContext, (caddr_t *) &fw) == XCNOENT) { /* pointer is not over a window */ return; } focus_grab_buttons(fw); return; } /* functions to access ScreenFocus, LastScreenFocus and PreviousFocus */ FvwmWindow *get_focus_window(void) { return ScreenFocus; } void set_focus_window(FvwmWindow *fw) { ScreenFocus = fw; return; } FvwmWindow *get_last_screen_focus_window(void) { return LastScreenFocus; } void set_last_screen_focus_window(FvwmWindow *fw) { LastScreenFocus = fw; return; } void update_last_screen_focus_window(FvwmWindow *fw) { if (fw == LastScreenFocus) { LastScreenFocus = NULL; } return; } void set_focus_model(FvwmWindow *fw) { if (!focus_does_accept_input_focus(fw)) { if (WM_TAKES_FOCUS(fw)) { fw->focus_model = FM_GLOBALLY_ACTIVE; } else { fw->focus_model = FM_NO_INPUT; } } else { if (WM_TAKES_FOCUS(fw)) { fw->focus_model = FM_LOCALLY_ACTIVE; } else { fw->focus_model = FM_PASSIVE; } } return; } /* This function is part of a hack to make focus handling work better with * applications that use the passive focus model but manage focus in their own * sub windows and should thus use the locally active focus model instead. * There are many examples like netscape or ddd. */ void focus_force_refresh_focus(const FvwmWindow *fw) { XWindowAttributes winattrs; MyXGrabServer(dpy); if (XGetWindowAttributes(dpy, FW_W(fw), &winattrs)) { XSelectInput( dpy, FW_W(fw), winattrs.your_event_mask & ~FocusChangeMask); FOCUS_SET(FW_W(fw)); XSelectInput(dpy, FW_W(fw), winattrs.your_event_mask); } MyXUngrabServer(dpy); return; } void refresh_focus(const FvwmWindow *fw) { Bool do_refresh = False; if (fw == NULL || !focus_is_focused(fw)) { /* only refresh the focus on the currently focused window */ return; } /* only refresh the focus for windows with the passive focus model so * that we don't disturb focus handling more than necessary */ switch (fw->focus_model) { case FM_PASSIVE: do_refresh = True; break; case FM_NO_INPUT: case FM_GLOBALLY_ACTIVE: case FM_LOCALLY_ACTIVE: default: do_refresh = False; break; } if (do_refresh) { focus_force_refresh_focus(fw); } return; } /* ---------------------------- builtin commands --------------------------- */ void CMD_FlipFocus(F_CMD_ARGS) { /* Reorder the window list */ __activate_window_by_command(F_PASS_ARGS, 1); return; } void CMD_Focus(F_CMD_ARGS) { __activate_window_by_command(F_PASS_ARGS, 0); return; } void CMD_WarpToWindow(F_CMD_ARGS) { int val1_unit, val2_unit, n; int val1, val2; n = GetTwoArguments(action, &val1, &val2, &val1_unit, &val2_unit); if (exc->w.wcontext != C_UNMANAGED) { if (n == 2) { warp_to_fvwm_window( exc, val1, val1_unit, val2, val2_unit); } else { warp_to_fvwm_window(exc, 0, 0, 0, 0); } } else { int x = 0; int y = 0; if (n == 2) { int wx; int wy; int ww; int wh; if (!XGetGeometry( dpy, exc->w.w, &JunkRoot, &wx, &wy, (unsigned int*)&ww, (unsigned int*)&wh, (unsigned int*)&JunkBW, (unsigned int*)&JunkDepth)) { return; } if (val1_unit != Scr.MyDisplayWidth) { x = val1; } else { x = (ww - 1) * val1 / 100; } if (val2_unit != Scr.MyDisplayHeight) { y = val2; } else { y = (wh - 1) * val2 / 100; } if (x < 0) { x += ww; } if (y < 0) { y += wh; } } FWarpPointerUpdateEvpos( exc->x.elast, dpy, None, exc->w.w, 0, 0, 0, 0, x, y); } return; } fvwm-2.6.5.orig/AUTHORS0000644000175000017500000003576211315461241012705 0ustar vwcvwcTo find out what should go in this file, see "Information For Maintainers of GNU Software" (maintain.texi), the section called "Recording Changes". Christoph Fritz: SnapAttraction bugfix "SameType" and "Screen" behaviour. Implement options None/ScreenWindows/ScreenIcons/ScreenAll for differentiated screen edge snapping. Julio José Teca Nemesio: ChangeWindowTitle and ChangeWindowTitleFromArg FvwmScript instructions. ChangeWindowTitle FvwmScript command. Simon Griph: SVG image loader. ARGB/animated mouse cursor loading. Thomas Adam: Window style !StickyStippledTitle (and hence StickyStippledTitle). Icon style StippledIconTitle and !StickyStippledIconTitle. StartShaded style option. Introduce the command expansion placeholder: $[w.visiblename] Make style matching honour a window's visible name (c.f. $[w.visiblename]) Added "bindings" option to PrintInfo command useful for debugging. Force windows on-screen where applicable when using "PositionPlacement UnderMouse". Wrote initial version of the fvwm-convert-2.6 script. Bug fixes. Serge (gentoosiast) Koksharov: Documentation fixes, bug fixes. Arwed von Merkatz: UnderMousePlacement style. David Maciver: Menu styles TitleColorset, HilightTitle and TitleFont. Renato Caldas: Some cleanups. Module linked list mechanism. Malcolm Still: New MenuStyle option TrianglesUseFore. Evgeny Stambulchik: Patch to improve look of "BorderStyle TiledPixmap" windows. Jonathan Kotta: FixedPosition condition. Viktor Griph: Patch for Perl modules on 64 bit machines. EdgeHasPointer and EdgeIsActive test conditions. Nested variable expansion. MouseWheel and ScrollOffPage menu style options. Simple placement mouse bindings and PlacedByButton window condition. Use of fvwmstyle resource. Warnings for unconsumed arguments to style options. Bug fixes. Advance Menu context bindings. Bjoern Steinbrink: Patch for FvwmScript tasks running too often. Arnaud Vrac: Patch which fixes maximize by growing vs EWMH working area Rafal Bisingier: WindowLayer and Layers options to the Maximize command. EdgeLeaveCommand George Potapov: ShowOnlyFocused option for FvwmIconMan. PressButton command in FvwmButtons Jim C. Brown: MailDir option in FvwmTaskBar. Norman Yarvin: Extend conditionals to handle multiple window names. Funda Wang: Chinese translations. Anton Kazennikov: Menu navigation patch. Johan Svedberg: Swedish translations. Andrei Mitrofanow: German translations. Debian package creation procedure. David Lazar: Use font for selected buttons in Start button. Scott Smedley: Wrote FvwmTabs module. Improved Perl module support. FakeKeyPress command. Window-specific key/mouse bindings. FvwmButtons: ActiveIcon, ActiveTitle, ActiveColorset, PressIcon, PressTitle & PressColorset options. FvwmWindowMenu: rewrote to use WindowList tracker. Version test condition. Added "Periodic" option to Schedule command. Converted manpage into XML source to generate HTML documentation & (auto-generated) manpage. Francis Litterio: Fixed building FvwmScript under cygwin. Added CenterPlacement style. David Fries: Fixed the GNOME1 patch. WindowList class name sorting. Nadim Shaikli: Added joining and shaping in bi-directional languages that need this; Arabic translations. Richard Lister: New module FvwmWindowMenu. Marcus Lundblad: Vector button offsets patch. New styles restricting window operations (Close,Maximize,Iconify). Implemented support for combining charaters. Jason Weber: FvwmProxy module. Cameron Simpson: Documentation fixes. Ben Winslow: Fixed a core dump. Ben Mathews: Modified FvwmTaskBar to allow shortcut buttons in the taskbar David Fries: WindowList option SortClassName. Anders Andersson: Spelling fixes in all man pages. Steve Talley: Style option IconSize. Maxim F. Ischenko: Original patch for MaxLabelWidth option in WindowList command. Jan Echternach: TMPDIR security patch. Stian Sletner: WindowList option IconifiedAtEnd. Derek B. Noonburg: Weighted sorting in FvwmIconMan. Jochen Klenner: WindowList option CurrentAtEnd. Uwe Pross: EdgeCommand. Dave Trollope: Memory management clean up patches. Daniel Henninger: Timeout feature in FvwmForm. Suzanne Skinner: Multi-pixmap titlebars patch. Lorenz Minder: Patches for fvwm-setup95 and safestrdup. Johannes Zellner: StrokeWidth option for StrokeFunc. Darren Stuart Embry: ActiveColorset uses colour set supplied hilight and shadow colours. Neil Bird: Add $c, $r, $n variables for Functions. Add Next/Prev conditions to WindowId and WindowList. Attempted fix of OLDecor hints use for decorations. Add DestroyStyle command. Alan F. Ho: fvwm-logo-colorful.xpm, a prototype of a current default FvwmBanner logo. Olivier Chapuis: Rewrote fonts loading and text rendering with locale, Xft, rotation, encoding and shadow support. Rewrote image loading and added PNG support with alpha blending. Added XRender support with full emulation if not present. Added XShm support for faster XImage manipulation. Added EWMH support (with a lot of new styles and commands) for KDE and GNOME. Added Gettext support and (LocalePath command and $[gt.str] variable). Some French translation. Rewrote the color limit code and added dithering for screen with a depth < 24. Colorset support in BorderStyle, TitleStyle and ButtonsStyle and MultiPixmap. Solid option of MultiPixmap. Merge MultiPixmap code and regular title bar drawing code. AdjustedPixmap, StretchedPixmap and ShrunkPixmap options for the decorations commands. MinHeight option to TitleStyle. UseTitleDecorRotation Style. Colorset Improvement: lot of works with the Transparent option, new options RootTransparent, Tint, fgTint, bgTint, Alpha, fgAlpha, Dither, NoDither, IconTint, IconAlpha, fgsh. Bitmap support in Colorset. BorderColorset, HilightBorderColorset, IconBackgroundColorset, IconTitleColorset, HilightIconTitleColorset, IconTitleRelief, IconBackgroundRelief and IconBackgroundPadding Styles. MinOverlapPercentPlacement, PlacementOverlapPenalties and PlacementOverlapPercentPenalties Styles. Indexed{Window,Icon}Name Styles. Adjusted, Stretched, Shrunk option to IconSize style. layer flags to the Maximize command. DesktopName command with variables $[desk.name] and dynamic update for FvwmPager. layer flags to the Maximize command. OnlySkipList, NoDeskNum, NoCurrentDeskTitle, TitleForAllDesks, NoNumInDeskTitle options to WindowList. CopyMenuStyle, BusyCursor, EscapeFunc and PrintInfo commands. StrokeFunc command and some works on the STROKE patch. PlacedByFvwm condition. libs: setSyncMask to define the messages on which a module is lock on send (not my idea); put SendFvwmPipe in the library; amelioration of SlideWindow. FvwmButtons: (No)FvwmModule Swallow option; Vastly improved redrawing with complex colorset configuration; position option for panel. FvwmBacker: RetainPixmap option. FvwmEvent: StartDelay option. FvwmIconBox: UseSkipList options; aliases support. FvwmIconMan: Full colorset support. FvwmM4/Cpp: -lock and -noread options. FvwmPager: Aliases support; some fixes. FvwmPager: Aliases support. FvwmScript: The Default configuration options; UseGettext and WindowLocaleTitle head instruction; LocaleTitle widget instruction; NoFocus and Left, Center, and Right flags option for text position; Key and ChangeLocaleTitle instructions; GetPid, Parse, SendMsgAndGet, LastString and Gettext functions; SendToModule ScriptName SendString command; rewrite some scripts examples and new script examples. FvwmScroll: p option for a percentage reduction. FvwmTaskBar: Focus, Rows, 3DFvwm, NoIconAction options, take in account the real border width for geometry computation, AutoHide amelioration; aliases support. FvwmWinList: geometries fixes; aliases support. utils: fvwm-menu-desktop script for GNOME and KDE desktop menus. fvwm-root improvement (root properties). Bugfixes! Mikhael Goikhman: Parsing Restart command, Session*Function and StartFunction special functions, {Save|Quit}Session commands, some work on restart logic and session stuff, FormFvwmRootCursor, creating fvwm-menu-* scripts, FvwmWharf improvements, new FvwmBacker syntax, new default FvwmBanner logo, updates to envvar lib, FVWM_DATADIR/FVWM_USERDIR changes, fvwm-config script, some work on configure, module alias support in KillModule & SendToModule, many small fixes. Matthias Clasen: Session management, layered stacking order, maximized shaded windows, FvwmGtk module, colored and xpm cursors. Nagi Aboulenein: Original idea for 'previous page' parameter (MoveToPage and GotoPage). Dan Espen: Common-color Color Limiting, Multiple IconBoxes, Iconification Animation, lots of improvements in FvwmForm, replacement of FvwmTalk with FvwmForm, fvwm setup form. Tony Finch: Original patch for opaque resizing for 2.2. Will French: $d, $x and $y macros for functions. Julian Gilbey: Fixes in the fvwmrc_convert script. German Gomez Garcia: Implemented new menu style definition, allowing multiple definitions and gradients and pixmaps 'ala' ButtonStyle. See doc/README.styles for more info. Udo Grabowski: Private colormaps on subwindows. Mike Han: Multiple menu hotkeys. Automatic menu hotkeys. Reverse-resolution for FvwmIconMan. Multiple FvwmIconMan invocations. FvwmBacker per-page hacks (only usable after lots of fixes by others). Finally killed FvwmAudio. Finished off GSFR in modules. Albrecht Kadlec: Code & manual cleanups, enhancements, Fixes and module-library which partially made it into fvwm-2.0.42-47d. Rewrite & cleanup of FvwmAuto & FvwmAudio. Created FvwmEvent to supersede FvwmAudio (& FvwmAuto). Andrew Morton: MoveThreshold command. Robert Nation: The original author of fvwm. Tomas Ogren: Animated windowshading, "adaptive maximize", various bugfixes. Jay Painter: Gnome support (thanks, Jay!). Chetan Patil: Patch fix MoveToPage command without arguments. Mark Rainford: Handling of transient windows in Raise/Lower: reasonable emulation of Motif group behaviour is now possible. $v variable in fvwm commands. Chris Rankin: Rework of signal handlers (fvwm, FvwmButtons, FvwmIconMan, FvwmPager and FvwmEvent). Steven M. Robbins: Autoconf & automake support, configuration & portability improvements, and general code gadfly a la Paul Smith. Chris Ross: Addition of ReliefThickness feature to FvwmIconMan. Solaris Xinerama support. Paul D. Smith: Purify support (heap rot, array overwrites, memory stompage of all sorts). Some autoconf/automake/portability help. Initial cut at a generic debugging API. Rework module interface API on fvwm's side. General code gadfly: tiptoe in; change some code; run away, run away! Benoit Triquet: Original idea and some code for IgnoreModifiers command. Fabien Villard: OpenVMS port. Dominik Vogt: Improved ShuffleButtons algorithm (FvwmButtons), button geometries (FvwmButtons), Menu Position Hints, XResources.c, various move/resize and menu enhancements, MoveToPage, MoveToDesk, various parsing functions, COPYING file, a myriad of bugfixes, Rewrite of MenuStyle syntax, Silent command, GSFR preparations, various enhancements and bugfixes for FvwmButtons, FvwmPager and FvwmTaskBar, split function and menu code, FAQ rewrite, rewrite of toggling function syntax (with hints from Matthias Claasen), IgnoreModifiers command, enhancements of GotoPage and MoveToPage syntax, Repeat command, menu code clean up, panel enhancements (FvwmButtons), transient FvwmPager, GSFR for the main module, dynamic menus, recursive menus, rewrite of menu drawing, speed up startup with lots of menus, new menu styles BorderWidth, ItemFormat, VerticalItemSpacing, VerticalTitleSpacing, Hilight3DThickness and SubmenusLeft, major clean up of the menu code, improved transient FvwmPager, improved transient window handling, MaxWindowSize style, Improved(?) mouse paging, RaiseTransient and LowerTransient styles, nicer cursors, helped with colorset implementation, variables for FvwmButtons actions, fvwm-cats page, ported &%!#?-95 like config file from fvwm95, cleanup of gradient drawing code, rewrite of opaque resize patch for 2.3.8, HideSizeWindow command, enhanced CursorStyle command, TitleAtBottom style, patches to obsolete Recapture command (styles apply immediately), new old styles BackingStore/BackingStoreOff and SaveUnder/SaveUnderOff, more WindowList enhancements, look of sticky icons, WindowList menu style, PointerKey command, several FvwmTheme options, FvwmTheme parsing, styles Font and IconFont, introduced the decor_w, smooth window shading, smooth (well, sort of) opaque resizing, many many more bugfixes. Lost motivation to continue this list. A.J. Weber: SnapAttraction patch. Bob Woodside: StartsOnPage style, Stacking Order chain, new variable module packets, GSFR for the modules. Charles Hines: Contributed some patches in the early days of fvwm. Later took over maintenance of fvwm-2.0.x after Rob Nation, the original author of fvwm, decided to "retire". Made a fair amount of changes and fixes, and incorporated changes and fixes from numerous people all over the net. Did this from about August of 1995 until May of 1998 when he came to the realization that he didn't have enough time to properly devote to it and decided to "retire" himself, handing Brady Montz the torch. Shortly thereafter is when fvwm became "ruled by committee" and this previous fvwm dictator is now happy to see fvwm surviving and thriving with this new development methodology (and may even contribute again himself, someday). Dan Astoorian: Wrote extras/fvwmperl, before X11::Fvwm (available via CPAN) made it obsolete. Greg J. Badros: Substantial rewrite of fvwm-2.0.x menuing code to support arbitrary depth menus, animated menus, Win95 look, better logically-based shortcut keys, auto-splitting of long menus, check for re-used hot-keys, integrated LEFT_MENUS option. Added primitives: animated-moves, SetEnv, fix to Echo. Improve modules: Make FvwmM4 pass args on to m4, font-related seg-fault bug fix in FvwmButtons. Along with a cast of thousands (well, dozens) mentioned in old ChangeLog entries. If you find your name below, please send an entry in the style of the above entries, to the mailing list fvwm-workers@fvwm.org. Andrew (a.b.) Atrens John Aughey Graham Barr David Barth Mike Blatchley Mark Boyns Eli Burke Martin Cartwright Beat Christen Frederic Cordier Andrew Davison Frederic Devernay Austin Donnelly Matthias Ettrich Evans & Sutherland Computer Corporation Frank Fejes Thomas Zuwei Feng Mike Finger Pete Forman Patrice Fortier Todd Fries Larry Gensch Romano Giannetti Peter Gray Kaj Groner Eddy J. Gurney Markus Gutschke Georg Hager John Heidemann Paul Hudson Sverre H. Huseby Toshi Isogai Jesper James Thimo Jansen Michael A. Kazda Jonathan Kelley Andreas Klemm Alfredo Kengi Kojima Chris Laas Tom LaStrange Ric Lister David MacKenzie Don Mahurin Pekka Marjola Anthony Martin Christophe Martin Makoto Matushita Grant McDorman Henry R. McTague Roman Mitnitski Brady Montz Ludvig A. Norin Bill Oswald Carsten Paeth Hector Peraza Per Persson Trent Piepho Pekka Pietik{inen Mark Powell Randy Ray William E. Roadcap Frank Scheelen Eric Schott Mark Scott Cameron Simpson Kit Smithers Nobutaka Suzuki Szijarto Szabolcs Andrew Taylor Jason L. Tibbitts Jarl Totland Ilkka E T Tuohela Andrew Veliath Barry A. Warsaw Dan Weeks Brian Wellington Rob Whapham Alan Wild Randall Winchester Bo Yang fvwm-2.6.5.orig/config.guess0000755000175000017500000012673011562437544014166 0ustar vwcvwc#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-05-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner. Please send patches (context # diff format) to and include a ChangeLog # entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-tilera-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: fvwm-2.6.5.orig/ChangeLog0000644000175000017500000174570111744241136013416 0ustar vwcvwc2012-04-20 Thomas Adam * configure.ac: * docs/ANNOUNCE: Prep for 2.6.5 2012-03-17 Thomas Adam * fvwm/events.c (HandlePropertyNotify): Fix XSizeHints problem with FVWM not correctly allowing resizing of windows when the hints are toggled with respect to FVWM processing XA_WM_NORMAL_HINTS. 2012-03-16 Thomas Adam * fvwm/placement.c ( __pl_position_get_pos_simple): When using "UnderMouse" for PositionPlacement, ensure we honor the EWMH working area by default if it's in use. 2012-02-20 Thomas Adam * fvwm/fvwm.c (InstallSignals): Unblock signals when installing them. When signals are registered, ensure they're unblocked so as not to queue them up. 2012-02-01 Thomas Adam * fvwm/infostore.c (get_metainfo_length): * fvwm/infostore.c (new_metainfo): * fvwm/infostore.c (insert_metainfo): * fvwm/style.c (style_parse_one_style_option): Make C90 compliant. 2012-02-01 Thomas Adam * configure.ac: * docs/ANNOUNCE: Prep for 2.6.4 2012-01-26 Thomas Adam * fvwm/events.c (HandlePropertyNotify): Rather than tracking whether the icon name has been assigned or not, now also do this on _XA_WM_NAME when the icon title is not the same as the window title; since the ordering of events is not guaranteed to be processed correctly, 2012-01-18 Thomas Adam * README: Update for 2.6.X release, but generalise on the actual version of FVWM so that generic documents such as this do not need updating as often. 2012-01-02 Thomas Adam * fvwm/ConfigFvwmDefaults: Make BusyCursor Wait True, and give a CursorStyle of dot. This gives a visual clue when generating fvwm-menu-desktop, for instance via PipeRead which might take some time. 2011-12-19 Thomas Adam * bin/fvwm-menu-desktop.in: Add back "/usr/share/applications" to the list in get_KDE_legacy_dirs(). 2011-11-03 Dominik Vogt * configure.ac: AC_SUBST(SED) 2011-10-16 Thomas Adam * fvwm/conditional.c (CreateConditionMask): Fix processing of Layer conditional command Since we handle negations for conditional parameters, ensure we match against the correct variable holding the negated condition. 2011-10-15 Thomas Adam * fvwm/frame.c (frame_free_move_resize_args): Don't restore the client's gravity. There might be a chance some clients with a gravity other than Static (such as non-NW gravity) might not react well -- but setting the gravity to the main window hint will break clients being remapped as subwindows, c.f. XEmbed. 2011-09-30 Thomas Adam * configure.ac: * NEWS: Updated for 2.6.4 2011-09-30 Thomas Adam * configure.ac: * NEWS: * docs/ANNOUNCE: Update key files for 2.6.3 release. 2011-09-26 Chris Siebenmann * fvwm/add_window.c (interpolate_titleformat_name): * fvwm/style.c (__validate_titleformat_string): Add '%i' format for IconTitleFormat/TitleFormat This inserts the window's icon name. There are some applications that update only their icon name, not their title. 2011-09-10 Thomas Adam * fvwm/ewmh.c (ewmh_HandleNotification): * fvwm/ewmh_intern.h: * fvwm/fvwm.h: Support _NET_WM_WINDOW_TYPE_NOTIFICATION Applications such as xfce4-notifyd do not explicitly set override_redirect, but do set _NET_WM_WINDOW_TYPE_NOTIFICATION -- so fvwm should also handle this by marking such windows as unmanaged. 2011-08-30 Thomas Adam * fvwm/placement.c (__place_window): Don't assume PositionPlacement can modify EWMH working area Because PositionPlacement uses the same mechanics as the Move command, and this now has the ability to check for the EWMH working area via "ewmhiwa", etc., let that modify it for us if the option is given. This makes things like the following possible: Style teddybear PositionPlacement screen 1 0p 0p ewmhiwa 2011-08-28 Thomas Adam * fvwm/ewmh.c (EWMH_fullscreen): Add "ewmhiwa" option when a client goes fullscreen 2011-08-28 Thomas Adam * libs/FScreen.c (FScreenOfPointerXY): * libs/FScreen.h: Introduce wrapper around static function FindScreenOfXY() to determine which screen the pointer is on, and return it as something which can be used through parameter expansion (presumably in configs?) * fvwm/expand.c (expand_vars_extended): Expand VAR_POINTER_SCREEN. 2011-08-28 Thomas Adam * fvwm/move_resize.c (GetMoveArguments): Add ewmhiwa option As with the Maximize command, the coordinates of the Move command can be told to ignore the working area. The default is to honour it, again as with the Maximize command. 2011-08-15 Thomas Adam * fvwm/move_resize.c (__resize_window): Add support code for warping/direction. Adds the code which ensures, based on the new warptoborder/direction logic that the various logic is handled at the correct time. * fvwm/move_resize.c (__resize_get_dir_from_window): __resize_dir_get_proximity() to include warp coords In working out which direction a window should be moved in, ensure we also set the coordinates for where the pointer should be warped to, if it's been requested that the pointer should be warped to the closest border automatically. * fvwm/move_resize.c (GetResizeArguments): Add "automatic" option to resize arguments Both the "direction" and "warptoborder" sub-commands of Resize, can now optionally accept the option "automatic" which will attempt to work out which region of the window the pointer is in, and set the direction based on it. * fvwm/move_resize.c (__resize_get_dir_from_resize_quadrant): Introduce __resize_get_dir_from_resize_quadrant() In order to work out the direction to warp the pointer to automatically, as well as setting the direction automatically, this helper function will return the direction the pointer is in, based on the quadrant of the window. 2011-08-15 Thomas Adam * fvwm/style.c (__validate_titleformat_string): New helper function for validating TitleFormat and IconTitleFormat commands. * fvwm/style.c: * fvwm/style.h: Introduce TitleFormat and IconTitleFormat style commands. These effectively deprecate: IndexedWindowName IndexedIconName ExactWindowName ExactIconName * fvwm/add_window.c (interpolate_titleformat_name): Helper function to interpolate and parse the TitleFormat and IconTitleFormat string. * fvwm/add_window.c (setup_visible_name): Make use of: interpolate_titleformat_name() for setting the visible name of an icon or window title. 2011-08-06 Thomas Adam * fvwm/borders.c (border_mp_draw_mp_titlebar): * fvwm/builtins.c (update_decors_colorset, CMD_ChangeDecor): * fvwm/events.c (HandleMapRequestKeepRaised): * fvwm/ewmh_events.c (ewmh_MoveResizeWindow): * fvwm/frame.c (frame_get_titlebar_dimensions): * fvwm/fvwm.c (CreateGCs): * fvwm/menus.c (paint_menu_gradient_background, paint_menu, pop_menu_down_and_repaint_parent, __mloop_exit_warp_back(MenuParameters, do_menu(MenuParameters, get_menu_options): * fvwm/menustyle.c (menustyle_parse_style, CMD_MenuStyle): * fvwm/module_interface.c (module_input_execute): * fvwm/move_resize.c (resize_move_window): * fvwm/placement.c (__pl_minoverlap_get_pos_penalty): * fvwm/session.c (LoadGlobalState): * fvwm/style.c (parse_and_set_window_style): * fvwm/virtual.c (get_page_arguments): * libs/FGettext.c (FGettextInit, FGettext): * libs/Ficonv.c (is_iconv_supported): * libs/Graphics.c (CreateGradientPixmap): * libs/PictureBase.c (PictureDefaultGC): * libs/PictureImageLoader.c (PImageCreatePixmapFromFImage): * libs/PictureUtils.c (PictureAllocColorTable): * libs/fsm.c (CompletNewConnectionMsg): Remove dead code due to -Wset-but-unused-variable (GCC 4.6) This removes dead references to variables which were created and never used. Whilst we could disable the warning completely when compiling, it was a useful chance to remove dead code. 2011-08-06 Thomas Adam * fvwm/ewmh.c (EWMH_fullscreen): Remove unused variable. 2011-08-06 Thomas Adam * Changelog: * docs/ANNOUNCE: * NEWS: * configure.ac: Update key files for 2.6.2 release. 2011-07-25 Thomas Adam * doc/commands/MenuStyle.xml: * fvwm/menubindings.c (menu_shortcuts): * fvwm/menubindings.h: * fvwm/menustyle.c (menustyle_get_styleopt_index, menustyle_parse_style, menustyle_copy): * fvwm/menustyle.h: Add new MenuStyle option "UniqueHotkeyActivatesImmediate" This change allows for the hotkey to be pressed on a menu and for it remain open until the user presses one of the keys to enact that specified item. The default behaviour is the current one of closing the menu and running the action in the case of there being only one entry at the specified hotkey. 2011-07-24 Thomas Adam * fvwm/move_resize.c (unmaximize_fvwm_window): * fvwm/ewmh.c (EWMH_fullscreen): * fvwm/fvwm.h: Fix fullscreen restoring with ResizeHintOverride Correctly handle restoring a window whose geometry isn't subject to resize increments when coming out of fullscreen, with respect to that window then being subsequently maximized. 2011-07-18 Thomas Adam * fvwm/move_resize.c (unmaximize_fvwm_window): * fvwm/ewmh.c (EWMH_fullscreen): * fvwm/fvwm.h: Correctly restore windows coming out of fullscreen When windows enter into fullscreen, ensure certain attributes of that window -- such as the iconification, maximisation, shading, etc., are tracked and correctly restored when the window leaves fullscreen mode. In the case of window maximisation, because fullscreen mode internally uses "ResizeMoveMaximize" to achieve this, the effect of this is to lose the window's maximised state in the interim, because calling ResizeMoveMaximize will remove the maximised state of the window before changing it for its own purposes. 2011-06-11 Thomas Adam * fvwm/session.c (SaveWindowStates): Don't skip saving window state for windows without WM_COMMAND Newer applications (that is, those written before 1821) used to use a nasty hack in the way of the WM_COMMAND XAtom to effectively start the running application. But this is a crap way of doing it, and the ICCCM even agrees. Such Atoms have been deprecated for a long time. But FVWM uses this file for more than just hints to some other Session Manager -- it's used to reapply state across restarts, and skipping it on the off-chance some session manager might need WM_COMMAND in today's world is silly. If a session manager relying soley on WM_COMMAND is being used under FVWM, it won't be honouring many applications anyway, so dropping support for it is fine. 2011-06-04 Thomas Adam * configure.ac: Fix XCursor detection. Include the linker libraries if XCursor is found. 2011-04-18 * fvwm/fvwm.c (SetRCDefaults): Make fvwm-desktop-menu dynamic. 2011-04-16 Thomas Adam * docs/ANNOUNCE: * configure.ac: Update for 2.6.1 2011-04-16 Thomas Adam * configure.ac: Fix Fribidi library check to use 0.19.2 as a minimum. 2011-04-15 Thomas Adam * libs/FBidi.c (FBidi_convert): Compiler warnings fix. * libs/fsm.c (CompletNewConnectionMsg): Compiler warnings fix. 2011-04-15 Thomas Adam * NEWS: * configure.ac: Updated for the FVWM 2.6.0 stable release. 2011-04-10 * fvwm/fvwm.c (SetRCDefaults): Add fvwm-menu-desktop to built in menu. 2011-04-10 Thomas Adam * acinclude.m4: * configure.ac: More --as-needed ld fixes for linking against exernal libraries. 2011-04-05 Thomas Adam * fvwm/update.c (apply_window_updates): Don't clear all States on WindowStyle. 2011-04-02 Thomas Adam *fvwm/ewmh_conf.c (CMD_EwmhBaseStruts): Use EWMH_UpdateWorkArea() and not separate function calls Don't assume the work of EWMH_UpdateWorkArea() will only ever call two function calls by itself in the future; hence, centralise the call to doing that to the correct containing function. 2011-02-05 Thomas Adam * acinclude.m4: Fix DSO linker error (ld) with missing "-lfontconfig" for fontconfig Stricter DSO checks with newer Libc versions requires the linker find the symbols elsewhere. The only one that's missing is "-lfontconfig" as we already supply -lX11 -lXent elsewhere. 2011-03-02 Thomas Adam * fvwm/events.c (HandleFocusIn): Fix NeverFocus windows when handling FocusIn events. Certain button presses on client windows can trigger a FocusIn event on the parent (such as opening a menu on a GTK application). Disallow the click to trigger the window receiving focus, as well as redrawing the border to reflect the window has focus. 2011-02-14 Thomas Adam * libs/PictureImageLoader.c (PImageLoadPng): Use png_get_color_type() as the data type we were previously using is now no longer public (Finfo_ptr->color_type). This is in libpng 1.5 -- hopefully no need for an #ifdef. 2010-12-19 Thomas Adam * fvwm/builtins.c (CMD_CursorMove): Honour EdgeScroll settings to not flip pages when EdgeScroll is disabled. 2010-12-04 * fvwm/ConfigFvwmSetup: Better colors in menus and active frames. 2010-11-12 Dominik Vogt * fvwm/placement.c (__place_get_placement_flags): fix reporting of placement reason with nousposition style. 2010-10-09 Dominik Vogt * fvwm/events.c (__handle_cr_on_client): fix resize of shaded windows with a shade direction that does not match the window gravity * libs/gravity.h: * libs/gravity.c (__gravity_override_one_axis): (gravity_override_dir): new helper functions * libs/gravity.c (gravity_combine_xy_dir): fixed calculation with only one axis set 2010-09-16 Sergey Vlasov * fvwm/move_resize.c (GetOnePositionArgument): Fix parsing of commands like 'Move 50-50w 50-50w'. 2010-08-31 Gerard Vermeulen * fvwm/move_resize.c (GetOnePositionArgument): Parse commands like 'Move w+-5p w+-2p'. 2010-08-09 Thomas Adam * NEWS: * configure.ac: Updated for the FVWM 2.5.31 release. 2010-08-09 Thomas Adam * NEWS: * configure.ac: Updated for the FVWM 2.5.31 release. 2010-08-07 Thomas Adam * fvwm/builtins.c (CMD_Exec): Remove extraneous whitespace. 2010-07-28 Thomas Adam * fvwm/builtins.c (CMD_Exec): Close fd if it's not opened successfully. 2010-07-28 Thomas Adam * fvwm/update.c (apply_window_updates): * NEWS: Copy over State settings on WindowStyle command. When merging/updating style hints for recaptured windows, ensure we preserve any State hints set on the window. 2010-05-22 Thomas Adam * fvwm/windowlist.c (CMD_WindowList): * NEWS: When reporting on a window's width and height ensure we use the orig_hints XSizeHints struct for calculating resize increment geometries. 2010-05-09 Thomas Adam * NEWS: * configure.ac: Update CVS to use 2.5.31 2010-05-09 Thomas Adam * NEWS: * configure.ac: * docs/ANNOUNCE: Updated for the FVWM 2.5.30 release. 2010-05-09 Thomas Adam * NEWS: Cosmetic clean up for NEWS. 2010-04-28 Dan Espen * fvwm/colorset.c (parse_colorset): Remove bogus error message. 2010-04-24 Thomas Adam * libs/Fpng.h: Define version checks for conditional macros. libpng 1.4.0 has different macros for previous version of the same macros in libong 1.2.0, so check for them here. 2010-04-18 Thomas Adam * libs/charmap.c (charmap_table_to_string): Don't allow incremental matching of C_ALL for contexts. When printing out bindings, ensure we allow "A" for any/all contexts/modifiers to be matched exactly, so that the context column for bindings matches with what the user put in their config file. 2010-04-03 Thomas Adam * NEWS: * configure.ac: Updated for the FVWM 2.5.29 release. 2010-04-03 Thomas Adam * libs/Fplay.h: Cull unused functions when compiling against librplay. When compiling with -Werror, ensure we're not trying to use unneeded librplay static functions we ourselves declare. 2010-04-03 Thomas Adam * fvwm/placement.c (__pl_minoverlap_get_pos_penalty): Tweak placement calculation for over-zealous windows. Don't adjust a window's position unless it's actually greater than the screen's dimension (i.e., potentially placed off screen.) 2010-03-30 Christoph Fritz * fvwm/windowlist.c (CMD_WindowList): Free allocated memory. 2010-02-28 Thomas Adam * fvwm/move_resize.c (__resize_step): Don't explicitly send MotionNotify event during Resize (GeometryWindow) When calling DisplaySize() from a resize event performed on a window, ensure we use the window's last event (which will be MotionNotify anyway) otherwise this completely confuses the GeometryWindow as it has to then update itself each time. When using Xinerama/TwinView, the effect is that the GeometryWindow flickers and/or displays itself on the opposite screen to where the pointer is, because the x/y positions don't take into account the location of the pointer from the original hand-crafted event, but are correct from the execute context the window being resized is called in. 2010-02-06 Thomas Adam * fvwm/style.c (check_window_style_change): * fvwm/update.c (apply_window_updates): * fvwm/update.h: Propagate Layer changes via Style command on-the-fly. Until there's a distinction between initially-mapped styles and runtime commands, and that currently, Style commands take effect immediately, ensure that for any Layer requests received via Style commands, these too are applied immediately. The previous assumption was that this was only applicable when mapping a new window, but goes against expectations from the user. 2010-01-07 Thomas Adam * fvwm/read.c (run_command_file): Restructure how we look for Read files slightly. When searching for files with the Read command, check to see if the file first of all has an absolute path and if so open it. If it's relative then search for it in either FVWM_USERDIR or FVWM_DATADIR as before. If the file still can't be found, try and open it outright. This will allow therefore: ../../some_file as a valid filename -- of course this really only makes sense when invoking fvwm with "-f" on the command-line, as relative paths to config files in this way should be built up using "$." 2010-01-05 Thomas Adam * fvwm/menustyle.c (menustyle_copy_face): Fix segfault setting MenuFace pixmap style for menus. As with the tearoff bug from 2010-01-03, ensure we don't try and free a non-existent pixmap from an invalid pointer. 2010-01-05 Thomas Adam * fvwm/read.c (run_command_file): Fix opening of files to Read/PipeRead to accept absolute paths. Don't just assume "/" is a valid identifier for opening files. "./" is just as likely. Fixes use-case of: fvwm -f ./some_fvwm2rc 2010-01-04 Thomas Adam * fvwm/events.c (flush_property_notify): Add atom to struct so it is checked for by test_typed_window_event(). 2010-01-04 David Fries * fvwm/events.c (test_typed_window_event): * fvwm/events.c (flush_property_notify): Efficiently handle flushing property events of the same type. * fvwm/events.h (test_typed_window_event_args): Add XAtom type to struct. 2010-01-04 David Fries * fvwm/virtual.c (HandlePaging): Move no page detect check, it wasn't being hit. * fvwm/move_resize.c (__move_loop): Transform window position to pointer position and back when calling HandlePaging. 2010-01-03 Thomas Adam * fvwm/menustyle.c (menustyle_copy_face): Fix segfault when creating a tearoff menu using a Pixmap background. When we copy the original menustyle to the new torn-off menu which contains a background image, don't then update the menu's pixel background color, as this is already free()d for us by an earlier copy call. 2009-12-31 Thomas Adam * fvwm/builtins.c (CMD_BugOpts): Remove debug line. 2009-12-31 Thomas Adam * fvwm/builtins.c (CMD_BugOpts): * fvwm/fvwm.c (InitVariables): * fvwm/events.c (HandleClientMessage): * fvwm/screen.h: Add new BugOpts QtDragnDropWorkaround option to handle an oddity in how Qt windows handle having ClientMessage events sent to them. 2009-12-30 Thomas Adam * fvwm/placement.c (__pl_minoverlap_get_pos_penalty): Fix y-axis offset calculations when using MinOverlapPlacement, by forcing the window on-screen when over-zealous penality calculations don't take into account the size of the window borders. 2009-12-26 Thomas Adam * bin/fvwm-convert-2.6.1.in: Add in BUGS section a note that converting over FvwmTheme lines is likely buggy. 2009-12-26 Thomas Adam * NEWS: * AUTHORS: * bin/fvwm-convert-2.6.in: * bin/fvwm-convert-2.6.1.in: First pass at a fvwm-convert-2.6 script to convert fvwm-2.4 syntax files. 2009-12-19 Thomas Adam * libs/Flocale.c (FlocaleEncodeString): Pre-initialise "len2" to zero, to avoid GCC warning during compilation. 2009-12-12 Thomas Adam * fvwm/fvwm.c (StartupStuff): Reset the state of the "Restarting" flag to False when restarting FVWM. * fvwm/events.c (HandleMapRequestKeepRaised): Only run InitialMapCommand when FVWM isn't restarting and all windows have been recaptured. The window is already mapped by the time FVWM is restarting, and running the InitialMapCommand again only serves to "toggle" the window state (c.f. InitialMapCommand Iconic, etc.) 2009-09-20 Viktor Griph * NEWS: * configure.ac: increased version number to 2.5.29 * NEWS: updated for 2.5.28 release 2009-08-28 Viktor Griph * NEWS: * fvwm/ewmh.c (ewmh_ChangeProperty): only convert _NET_WM_ICON hint to long before storing 2009-08-26 Viktor Griph * fvwm/builtins.c (CMD_BugOpts): remove unused variables * NEWS: * fvwm/ewmh.c (ewmh_ChangeProperty): fix storing of CARD32 arrays on 64 bit machines * fvwm/ewmh_icons.c (ewmh_SetWmIconFromPixmap): prevent segmentation fault when reading a bad _NET_WM_ICON hint 2009-08-22 Thomas Adam * fvwm/geometry.c (__cs_handle_aspect_ratio): Workaround gcc -O3, by declaring local vars as volatile. This fixes an otherwise continual loop when resizing windows when keeping aspect ratio (c.f. mplayer.) 2009-08-20 Christoph Fritz * configure.ac: Fix typo in AS_HELP_STRING referring to enable-htmldoc 2009-08-19 Viktor Griph * NEWS: * fvwm/builtins.c (CMD_BugOpts): Fix parsing of BugOpts options lists separated by ',', and restoring to default value when the boolean option is omitted if not inside a list. * NEWS: Change QT to Qt. * NEWS: * libs/Flocale.h: * libs/Ficonv.h (FiconvSetTransliterateUtf8): * libs/Ficonv.c (FiconvSetTransliterateUtf8, translit_csname) (is_translit_supported, set_default_iconv_charsets) (set_iconv_charset_index, FiconvUtf8ToCharset): * fvwm/builtins.c (CMD_BugOpts): Add TransliterateUtf8 bug opt for working around clients which don't care about the WM_NAME value. 2009-08-09 Viktor Griph * NEWS: * fvwm/stack.c (BroadcastRestack): Fix splitting or M_RESTACK packages causing weird window stacking in modules when more than 83 windows are broadcast. 2009-08-04 Thomas Adam * configure.ac: Remove dnl comments from configure.ac regarding malloc.h -- it's self-explanatory anyway. 2009-08-03 Thomas Adam * configure.ac: Most *BSD platforms are deprecating malloc.h in favout of stdlib.h -- this never used to produce compiler warnings, but things are starting to become more vocal, so don't use this in our ./configure script if we're compiling FVWM on a *BSD system. 2009-07-31 Christoph Fritz * fvwm/style.h: * fvwm/fvwm.h: * fvwm/add_window.c (setup_numeric_vals): add "typedef struct snap_attraction_t" * fvwm/style.c (style_parse_one_style_option): add new SnapAttraction options "None", "ScreenWindows", "ScreenIcons" and "ScreenAll" * fvwm/move_resize.c (DoSnapAttract): Bugfix, option SameType/Icons/Windows did falsely not affect conditions of option "Screen" and option "SameType" snapped falsely icons and windows together. Implement options None/ScreenWindows/ScreenIcons/ScreenAll for differentiated screen edge snapping. 2009-07-10 Thomas Adam * fvwm/add_window.c (setup_window_name_count): * fvwm/add_window.c (setup_icon_name_count): Deprecate these in favour of setup_name_count() * fvwm/add_window.c (setup_name_count): Amalgamate setup_window_name_count and setup_icon_name_count to just one function (very similar code between them.) Used with IndexedWindowName and IndexedIconName. 2009-07-10 Viktor Griph * NEWS: Fix the options RPlayVolume and RPlayPriority in FvwmEvent. * libs/Fplay.h (Fplay_set, Fplay_get, Frptp_putline) (Frptp_async_putline): Fix ANSI C compatibility. * NEWS: * fvwm/ewmh_names.c (EWMH_WMName): set the HAS_EWMH_WM_NAME flag even if the window name on display isn't changing. (EWMH_WMIconName): same for HAS_EWMH_WM_ICON_NAME 2009-07-08 Viktor Griph * NEWS: fix for segfault with RPlatHost directive in FvwmEvent * libs/Makefile.am (libfvwm_a_SOURCES): * libs/Fplay.h: add Fplay.h wrapper header for rplay.h * NEWS: fix debian bug #438132 2009-07-06 Viktor Griph * NEWS: * fvwm/style.c (fw_match_style_id): Fix fvwmstyle resource 2009-07-05 Viktor Griph * NEWS: * fvwm/events.c (HandleMapRequestKeepRaised): Make sure that a PropertyNotify on the WM_STATE property is always sent out when a window is requested to be moved to the withdrawn state. (Needed by QT) 2009-07-01 Viktor Griph * sample.fvwmrc/DecorMwm: * sample.fvwmrc/DecorWin95: * sample.fvwmrc/new-features: * sample.fvwmrc/system.fvwm2rc: * sample.fvwmrc/system.fvwm2rc-sample-1: * sample.fvwmrc/system.fvwm2rc-sample-2: * sample.fvwmrc/system.fvwm2rc-sample-95: Use !-negation for styles instead of No... * NEWS: fix a typo * sample.fvwmrc/system.fvwm2rc-sample-95: sed -i '/^#*\(+\|AddToMenu\) "[^%"]*%[^%"]*"/s/%\([^"]*\)/%\1%/' sed -i 's/StayOnTop/StaysOnTop/' According to patches by Manoj Srivastava 2009-03-17 Mikhael Goikhman * fvwm/externs.h: * fvwm/fvwm.c: * fvwm/session.c: convert my old code to use var_name and function_name coding style 2009-02-23 Dominik Vogt * NEWS: * configure.ac: increased version to 2.5.28 * ANNOUNCE: * NEWS: * configure.ac: updated for 2.5.27 release 2009-02-23 Thomas Adam * fvwm/bindings.c (print_bindings): Fixed compilation of not having libstroke installed by using ifdefs around stroke code. 2009-02-22 Dominik Vogt * fvwm/bindings.c (print_bindings): slight cleanup * libs/charmap.c (charmap_table_to_string): several memory menagement fixes. 2009-02-22 Thomas Adam * libs/charmap.c (charmap_table_to_string): Reduce memory management on the stack, by making only those variables to be accessed outside of the function charmap_table_to_string() allocated on the heap instead. * fvwm/bindings.c (print_bindings): b->Action was previously checked whether it was NULL or not before printing its value to STDERR -- however, this caused a segfault when trying to perform strlen() operations internally -- hence don't bother checking if it's NULL. This avoids segfaulting. 2009-02-05 Thomas Adam * libs/charmap.c (charmap_table_to_string): * libs/charmap.h: Introduce charmap_to_string function which is used to build up a binding string, for use with PrintInfo. * fvwm/bindings.c (print_bindings): Introduce print_bindings to print all bindings known to fvwm. * fvwm/builtins.c (CMD_PrintInfo): * fvwm/builtins.h: Add support for "binding" as an option to PrintInfo. 2009-02-19 Thomas Adam * fvwm/placement.c (__pl_position_get_pos_simple): Force the window on-screen if using PositionPlacement UnderMouse. 2009-02-07 Dominik Vogt * fvwm/events.c (HandleMapRequestKeepRaised): * fvwm/add_window.c (AddWindow): * fvwm/style.h: * fvwm/style.c (style_parse_one_style_option): add new style InitialMapCommand 2008-02-08 Thomas Adam * bin/fvwm-menu-desktop.in: Fix the location prefix for GNOME application files. 2008-12-29 Alexandre Julliard * fvwm/ewmh_events.c (ewmh_WMStateMaxHoriz): Having either _NET_WM_STATE_MAXIMIZED_HORIZ or _NET_WM_STATE_MAXIMIZED_HORZ should be enough to make the window horizontally maximized. 2008-11-29 Dominik Vogt * fvwm/fvwm.h: * fvwm/module_list.c (do_execute_module): * fvwm/fvwm.c (fvmm_deinstall_signals): restore default signal handlers before execl()/execvp() 2008-10-05 Thomas Adam * fvwm/style.c (fw_match_style_id): Allow for the window's visible name to be considered when matching a style line. It is possible to use $[w.visiblename] as the style name. Whilst the normal name and the visible name are usually the same, in the case of having IndxedWindowName, if a style line matches this as a visible name, apply it first of all. 2008-10-03 Thomas Adam * AUTHORS: * fvwm/expand.c: Add $[w.visiblename] as an expansion parameter. 2008-08-12 Dominik Vogt * fvwm/placement.c (__pl_position_get_pos_simple): position placement honours StartsOnPage 2008-08-09 Dominik Vogt * fvwm/session.c (MatchWinToSM): fixed keeping fullscreen state of windows over a restart; the old code tried to do this through session management and effectively overwrote the responsible ewmh hint; eventually, fvwm thought that the window was fullscreen without actually making it fullscreen 2008-08-08 Dominik Vogt * fvwm/ewmh_events.c (ewmh_MoveResizeWindow): fixed compiler warning caused by a logic error in previous patch * configure.ac: applied png detection fix by Yuri Bushmelev for cross compiliation * fvwm/events.c (__handle_cr_on_client): fixed event merging with auto motion detection 2008-08-07 Viktor Griph * NEWS: * fvwm/ewmh_events.c (ewmh_MoveResizeWindow): * fvwm/events.h (events_handle_configure_request): * fvwm/events.c (events_handle_configure_request): (__handle_cr_on_client): (__handle_configure_request): fix handling of _NET_MOVERESIZE_WINDOW (__cr_detect_icccm_move): remove douplicate code 2008-08-06 Viktor Griph * NEWS: * fvwm/add_window.c (setup_frame_window): fix compilation without XRender 2008-05-22 Adam Goode * AUTHORS: * ChangeLog-pre-2.4: * rpm/fvwm.spec.in: * vms/fvwmrc.dat: Convert Latin-1 encodings to UTF-8 2008-05-07 Dominik Vogt * NEWS: * configure.ac: increased version to 2.5.27 * ANNOUNCE: * NEWS: * configure.ac: updated for 2.5.26 release 2008-04-05 Dominik Vogt * fvwm/ewmh_events.c (ewmh_WMDesktop): (ewmh_WMState): * fvwm/ewmh.c (ewmh_AddToKdeSysTray): (ewmh_HandleWindowType): (ewmh_AddToKdeSysTray): (ewmh_HandleWindowType): (ewmh_check_wm_pid): 64-bit fix by Alexandre Julliard 2008-03-30 Mikhael Goikhman * configure.ac: fix fribidi detection when it uses pkg-config and not fribidi-config * libs/FBidi.c: fix compilation with newer fribidi-0.19.1 (or also called fribidi2), it now uses fribidi-types.h and not fribidi_types.h 2008-03-21 Viktor Griph * fvwm/events.c (dispatch_event): Fix handling of Shape events. 2008-03-18 Dominik Vogt * fvwm/menus.c (calc_normal_item_height): (calc_more_item_height): (size_menu_vertically): fix calculations so the menu fit on the screen height 2008-03-12 Jes~s Guerrero * fvwm/menus.c (size_menu_vertically): added paddings at the top and bottom of the menus * fvwm/menustyle.c (parse_vertical_margins_line): new function to parse the VerticalMargins new MenuStyle command * fvwm/menustyle.c (menustyle_get_styleopt_index): added the VerticalMargins option to the list * fvwm/menustyle.c (menustyle_parse_style): added default values for the padding, and a case clause for the specific case when you invoke the VerticalMargins MenuStyle * fvwm/menustyle.c (menustyle_copy): added two lines to copy the menu styles from origin to destiny * fvwm/menustyle.h: added macros for the vertical padding stuff * fvwm/menustyle.h (struct MenuLook): added sub-structure to hold the VerticalMargins * fvwm/libs/defaults.h: added one define for MAX_MENU_MARGIN 2008-03-09 Dominik Vogt * fvwm/menuitem.c (draw_highlight_background): fixed drawing of background pictures in menu items 2008-02-29 Viktor Griph * fvwm/add_window.c (setup_frame_window): fix core dump with ARGB detection code fix compilation without XRender 2008-02-26 Dominik Vogt * NEWS: * configure.ac: increased version to 2.5.26 * ANNOUNCE: * NEWS: * configure.ac: updated for 2.5.25 release 2008-02-12 Renato Caldas * fvwm/fvwm.c (main): further condense the X visual selection code 2008-02-10 Renato Caldas * fvwm/fvwm.c (main): condense the X visual selection code 2008-02-09 Viktor Griph * fvwm/events.c (register_event_group) (InitEventHandlerJumpTable, dispatch_event): use separate jump tables for events defined by X-extensions to eliminate the need to ovverride the LASTEvent value. * fvwm/module_list.c (module_list_remove): include the case where the module is first in the list in the loop, fixing a segmentaion fault when the list was empty. 2008-02-07 Renato Caldas * fvwm/add_window.c (setup_frame_window): add CWCursor to window's valuemask (from Marc Lehmann's argb patch) add preliminary support for ARGB windows in fvwm (based on Marc Lehman's argb patch) 2008-02-06 Dominik Vogt * libs/PictureUtils.c (XPM_COLOR_CLOSENESS): fixed compile error 2008-02-05 Dominik Vogt * libs/Colorset.c (CreateOffsetBackgroundPixmap): catch BadGC when updating root transparent window background * libs/XError.c (do_coredump): (ferror_set_temp_error_handler): (ferror_reset_error_handler) (ferror_call_next_error_handler): new helper functions * libs/XError.c (PrintXErrorAndCoredump): try to dump core the hard way 2008-02-04 Dominik Vogt * fvwm/colorset.c (parse_colorset): check for image != None before calling XDestroyImage * fvwm/ewmh_events.c (ewmh_WMStateMaxVert): (ewmh_WMStateMaxHoriz): (ewmh_WMStateModal): (ewmh_WMStateShaded): (ewmh_WMStateStaysOnTop): (ewmh_WMStateStaysOnBottom): handle the STATE_ADD command of the EWMH _NET_WM_STATE message from version 1.3 also ignore the EWMH staysontop and staysonbottom hints if the EWMHIgnoreStackingOrderHints style is used * fvwm/colorset.c (parse_colorset): Fixed a sporadic crash when the root background set by gnome, fvwm-root, esetroot etc. changes and a root transparent colour set is used. * fvwm/colorset.c (parse_colorset): * libs/PictureUtils.c (alloc_color_dynamic_no_limit): * libs/Colorset.c (CreateOffsetBackgroundPixmap): * libs/PictureGraphics.c (PGrabXImage) (PGraphicsCreateTranslucent): use MyXGrabserver and MyXUngrabServer instead of doing the X calls directly! 2008-01-31 Dominik Vogt * libs/PictureGraphics.c (PGrabXImage): fixed XImage memory leak (PCreateRenderPixmap): (PCreateDitherPixmap): Properly handle return code of FgetFImage() 2008-01-30 Dominik Vogt * fvwm/events.c (HandleConfigureRequest): (events_handle_configure_request): cleanup * fvwm/ewmh_events.c (ewmh_RestackWindow): (ewmh_MoveResizeWindow): fixed crash when moving/resizing/restacking unmanaged windows through an ewmh message 2008-01-30 Dominik Vogt * fvwm/events.c (HandleMapRequestKeepRaised): fixed compiler warning 2008-01-26 Olivier * libs/FlocaleCharset.c: (FlocaleInit_X_Charset), (FlocaleCharsetInit), (FlocaleCharsetGetDefaultCharset): * NEWS: Fixed the determination of the X charset on UTF-8 system 2008-01-09 Dominik Vogt * fvwm/placement.c (__pl_minoverlap_get_next_x): do not add screen offset to window position * libs/FlocaleCharset.c (FlocaleInit_X_Charset): fixed a memory leak 2008-01-07 Viktor Griph * NEWS: Some html documentation files were not installed. 2008-01-07 Dominik Vogt * fvwm/style.c (style_parse_one_style_option): fixed parsing of screen argument of the SnapAttraction Style 2007-12-07 Viktor Griph * fvwm/move_resize.c (DoSnapAttract): Use edge move resistance, and not delay for top edge when moving windows. 2007-12-03 Viktor Griph * NEWS: * fvwm/events.c (HandleMapRequestKeepRaised) (test_withdraw_request): Don't map windows that request to be moved back to WithdrawnState by the ICCCM2 method before they have been mapped. (Fixes bug with disappearing windows.) 2007-11-24 Dominik Vogt * NEWS: * configure.ac: increased version to 2.5.25 * NEWS: * configure.ac: updated for 2.5.24 release 2007-11-23 Dominik Vogt * fvwm/menus.c (__mloop_exit): * fvwm/menubindings.c (parse_menu_action): * fvwm/bindings.c: reindented and cleaned up some code 2007-11-16 Dominik Vogt * fvwm/update.c (apply_window_updates): * fvwm/add_window.c (setup_style_and_decor): (setup_numeric_vals): * fvwm/add_window.h: * fvwm/style.h: * libs/defaults.h: * fvwm/events.c (HandleEnterNotify): * fvwm/fvwm.c (InitVariables): * fvwm/screen.h: * fvwm/session.c (SaveGlobalState): (LoadGlobalState): * fvwm/move_resize.c (DoSnapAttract): (CMD_SnapGrid) (DoSnapAttract): The commands EdgeResistance, SnapGrid and SnapAttraction are obsolete They have been replaced by the styles EdgeMoveResistance, EdgeMoveDelay, EdgeResizeDelay, SnapGrid and SnapAttraction 2007-10-21 Renato Caldas * acinclude.m4: * configure.ac: use AS_HELP_STRING to format the configure options help strings 2007-10-06 Dominik Vogt * fvwm/conditional.c: some reformatting 2007-10-05 Viktor Griph * fvwm/ConfigFvwmDefaults: restore default action of closing menus for menu titles 2007-10-02 Dominik Vogt * libs/FScreen.c (FindScreenOfXY): * fvwm/move_resize.c (GetMoveArguments): fixed the "screen w" argument of the Move and other commands 2007-09-11 Dominik Vogt * fvwm/virtual.c (HandlePaging): don't modify *xl and *yt unless we we really page 2007-09-04 Dominik Vogt * fvwm/module_list.h: * fvwm/module_list.c: a little cleanup 2007-09-01 Dominik Vogt * NEWS: * configure.ac: increased version to 2.5.24 * NEWS: * configure.ac: updated for 2.5.23 release * libs/Flocale.c (FlocaleEncodeString): removed previous warning fix 2007-08-30 Thomas Adam * fvwm/style.c: * fvwm/add_window.c: Added new style option: StartShaded. 2007-08-30 Renato Caldas * libs/Flocale.c (FlocaleEncodeString): fix compile warning 2007-08-30 Viktor Griph * configure.ac: * fvwm/fvwm.1.in * fvwm/Makefile.am: removed old fvwm manpage 2007-08-29 Renato Caldas * NEWS: * configure.ac: increased version to 2.5.23 * NEWS: * configure.ac: fix the date for 2.5.22 release 2007-08-28 Viktor Griph * fvwm/windowlist.c (CMD_WindowList): fixed crash when using CurrentAtEnd and IconifiedAtEnd with only iconified windows. 2007-08-28 Dominik Vogt * configure.ac: fixed perl check use "test ! ... = ..." instead of "test ... != ..." * fvwm/builtins.c (CMD_PropertyChange): fixed completely broken parsing of PropertyChange arguments 2007-08-28 Renato Caldas * NEWS: * configure.ac: updated for 2.5.22 release * fvwm/builtins.c (CMD_PropertyChange): * libs/Flocale.c (FlocaleGetFftFont): (FlocaleGetFontSet): (FlocaleGetFont): (FlocaleGetFontOrFontSet): (FlocaleLoadFont): (FlocaleUnloadFont): fix compiler warnings 2007-08-23 Dominik Vogt * fvwm/functable.c: fixed command table parsing 2007-08-21 Dominik Vogt * fvwm/module_list.c (module_kill): (executeModuleDesperate): (module_list_itr_init): re-indented * fvwm/events.c (My_XNextEvent): * fvwm/module_list.c (module_alloc): (do_execute_module): * fvwm/module_list.h (fmodule): (MOD_IS_CMDLINE): (MOD_SET_CMDLINE): restored *not* useless is_cmdline_module stuff * fvwm/functions.h: add constants for command group tagging 2007-08-19 Viktor Griph * configure.ac: don't check for tbl 2007-08-17 Dominik Vogt * configure.ac: check for sed, perl and tbl, needed to build documentation 2007-08-16 Dominik Vogt * libs/System.c (fvwm_mkstemp): use constants from libs/fvwm_sys_stat.h 2007-08-15 Renato Caldas * fvwm/module_list.c (do_execute_module): fixed possible crash when fork fails * fvwm/module_list.c (module_list_remove): now returns the removed fmodule*, or NULL if unsuccessful removed error message when removing a not listed module (it's normal) * fvwm/module_list.c (module_kill): module is inserted in death_row only if it is successfuly removed from module_list (fixes crash when module is killed more than once) 2007-08-08 Renato Caldas * fvwm/events.c (My_XNextEvent): fixed hang with startup modules 2007-08-07 Viktor Griph * fvwm/conditional.c (FreeConditionMask): fixed crash with inverted name condition * NEWS: fixed typo 2007-08-07 Dominik Vogt * configure.ac: * README: * NEWS: * INSTALL.fvwm: * sample.fvwmrc/system.fvwm2rc-sample-95: * sample.fvwmrc/system.fvwm2rc: * sample.fvwmrc/system.fvwm2rc-sample-2: * libs/Picture.c (PicturePrintImageCache): * libs/Module.c: * libs/FGettext.c (FGettextPrintLocalePath): * libs/fvwmsignal.c: * libs/Module.h: * libs/PictureUtils.c (PictureAllocColorTable) (PicturePrintColorInfo): * libs/FScreen.h: * libs/fvwmsignal.h: * libs/Bindings.c: * libs/FScreen.c: * libs/Ficonv.c (convert_charsets): (FiconvSetupConversion): * fvwm/decorations.c: * fvwm/gnome.h: * fvwm/events.c: * fvwm/add_window.c (setup_window_font): (setup_icon_font): * fvwm/fvwm.1.in: * fvwm/session.h: * fvwm/conditional.c: * fvwm/fvwm.c (SetRCDefaults): (main): * fvwm/ewmh_events.c: * fvwm/stack.c: * fvwm/gnome.c: * fvwm/menustyle.c (menustyle_parse_style): (menustyle_copy): * fvwm/ewmh.c (EWMH_Init): * libs/Flocale.c (FlocaleParseShadow): (FlocaleGetFontSet): (FlocaleLoadFont): (FlocalePrintLocaleInfo): * fvwm/misc.c (fvwm_msg): * vms/README: * vms/vms.c: write fvwm in lower case * configure.ac: fixed build without GNU make 2007-08-06 Dominik Vogt * libs/Flocale.c (FlocaleChar2bOneCharToUtf8): fixed buffer overflow 2007-08-06 Renato Caldas * fvwm/module_list.h (fmodule_list_itr): * fvwm/module_list.c (module_list_itr_init, module_list_itr_next): replace iterator struct by typedef * fvwm/module_list.c (module_list_destroy): (module_kill_all): (module_cleanup): new function to remove dup code * fvwm/module_list.c (module_kill): changed to move the module to the deathrow list * fvwm/module_list.h (fmodule): * fvwm/module_list.c (module_alloc): (module_list_remove): (FlushMessageQueue): removed is_removed logic * fvwm/module_list.c (module_safefree): removed function * fvwm/events.c (My_XNextEvent): remove old "#if 0" code * fvwm/module_list.c (module_kill): removed debug code 2007-08-06 Viktor Griph * fvwm/module_list.h (fmodule_list_itr): * fvwm/module_list.c (module_list_itr_init, module_list_itr_next): don't store current pointer in module list iterators. fix C89-compilance 2007-08-06 Renato Caldas * fvwm/events.c (My_XNextEvent): * fvwm/module_list.c (KillModuleByName): (FlushAllMessageQueues): * fvwm/module_interface.c (BroadcastPacket): (BroadcastNewPacket): (BroadcastName): (BroadcastFvwmPicture): (BroadcastColorset): (BroadcastProperyChange): (BroadcastConfigInfoString): (CMD_SendToModule): * fvwm/modconf.c (ModuleConfig): * fvwm/stack.c (BroadcastRestack): replaced module_get_next by module list iterator mechanism * fvwm/module_list.h: * fvwm/module_list.c (module_get_next): removed function 2007-08-05 Renato Caldas * fvwm/module_list.h: * fvwm/module_list.c (fmodule): (fmodule_store): (module_insert): (module_remove): (module_count): (module_get_next): (FlushAllMessageQueues): (KillModuleByName): * fvwm/module_interface.c (BroadcastPacket): (BroadcastNewPacket): (BroadcastName): (BroadcastFvwmPicture): (BroadcastColorset): (BroadcastProperyChange): (BroadcastConfigInfoString): (CMD_SendToModule): * fvwm/event.c (My_XNextEvent): * fvwm/stack.c (BroadcastRestack): * fvwm/modconf.c (ModuleConfig): changed to work with generic list container * fvwm/module_list.c (module_insert): (module_list_insert): (module_remove): (module_list_remove): (module_count): (module_list_len): renamed as list handling functions * fvwm/events.c (My_XNextEvent): * fvwm/module_list.h: * fvwm/module_list.c (module_alloc): (do_execute_module): removed useless is_cmdline_module stuff * fvwm/module_list.h: * fvwm/module_list.c (module_list_insert): (module_list_remove): (module_list_len): new fmodule_list object representing a module list. changed the module lists to the new object. changed list functions to use the list object instead of the fmodule_store pointer. * fvwm/events.c (My_XNextEvent): moved module_cleanup to after ExecuteCommandQueue to avoid segfaults * fvwm/module_list.h (fmodule_list_itr): * fvwm/module_list.c (fmodule_list_itr_init): (fmodule_list_itr_next): created a smart (safe) iterator mechanism to replace the module_get_next function 2007-08-05 Dominik Vogt * fvwm/functions.c: * fvwm/functable.c: added empty functions to replace CMD_Dummy * configure.ac: use subordinate Makefile.ams instead of iuncluding files from other dirs * configure.ac: removed FVWMNAMEUCASE * configure.ac: make distcheck fix * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): force --enable-htmldoc on "make distcheck" * fvwm/events.c (HandleEnterNotify): (HandleLeaveNotify): properly generate enter_window and leave_window events for FvwmEvent 2007-08-01 Dominik Vogt * fvwm/move_resize.c (GetOnePositionArgument): (__get_shift) (ParsePositionArgumentSuffix): code cleanup 2007-07-31 Dominik Vogt * fvwm/move_resize.c (GetOnePositionArgument): fixed position calculation with the "w" prefix (move w-1 w-1). (GetOnePositionArgument): code cleanup 2007-07-26 Viktor Griph * fvwm/menus.c (__copy_down, __check_for_delimiter) (scanForStrings): reduce indentation level add comment to explain why suppressing the warning is right 2007-07-26 Dominik Vogt * fvwm/ewmh_events.c (ewmh_MoveResizeWindow): fixed using uninitialized variable * fvwm/menus.c (scanForStrings): suppress compiler warning for now * fvwm/move_resize.c (resize_move_window): (AnimatedMoveAnyWindow): (__move_window): (__resize_window): (CMD_Maximize): * fvwm/module_interface.c (__get_allowed_actions): * fvwm/menuitem.c (menuitem_paint): * fvwm/icons.c (CMD_Iconify): * fvwm/gnome.c (GNOME_SetHints): * fvwm/ewmh.c (ewmh_AllowsClose): (ewmh_AllowsClose) (ewmh_AllowsFullScreen): (ewmh_AllowsMinimize) (ewmh_AllowsMaximize): (ewmh_AllowsMove): (ewmh_AllowsResize) (EWMH_fullscreen): * fvwm/ewmh_events.c (ewmh_CloseWindow): (ewmh_MoveResizeWindow): (ewmh_MoveResize): (ewmh_WMState): (ewmh_WMStateHidden): * fvwm/events.c (__handle_cr_on_client): * fvwm/decorations.c (__is_resize_allowed): (is_function_allowed): * fvwm/conditional.c (MatchesConditionMask): * fvwm/builtins.c (CMD_Delete): * fvwm/add_window.c (AddWindow): is_function allowed now differentiates between US program actions and actions initiated by interaction between fvwm and the user 2007-07-25 Dominik Vogt * fvwm/menus.c (__scan_for_pixmap): fixed compiler warning * fvwm/ewmh_events.c (ewmh_MoveResizeWindow): (ewmh_RestackWindow): honor FixedSize/FixedPosition styles in EWMH messages too 2007-07-24 Viktor Griph * fvwm/fvwm.c (setVersionInfo): add XCursor support to version output * fvwm/menus.c (SCTX_SET_MI, SCTX_GET_MI, SCTX_SET_MR) (SCTX_GET_MR, string_context_type_t, string_context_t) (string_def_t, scanForColor, scanForPixmap, scanForStrings) (__scan_for_color, __scan_for_pixmap, AddToMenu, NewMenuRoot): reimplement pixmap and color scanning for menus to better handle escaped delimiters. 2007-07-22 Viktor Griph * fvwm/Makefile.am: don't install fvwm.1 * fvwm/events.c (My_XNextEvent): remove unused varaible * fvwm/events.c (My_XNextEvent): * fvwm/module_list.h: * fvwm/module_list.c (module_store, module_alloc) (module_kill_all, module_safefree, module_remove) (do_execute_module, module_kill, module_cleanup, module_get_next) (FlushMessageQueue): Don't free module stuctures during module I/O. (Fixes segfault.) 2007-07-20 Simon Griph Committed by Scott. * libs/PictureImageLoader.c (PImageLoadCursorFromFile): Someone missed to add extra conditions when changing from unsigned to signed. 2007-07-19 Dominik Vogt * configure.ac: fixed liXcursor detection 2007-07-16 Simon Griph Committed by Scott. * fvwm/menus.c (scanForPixmap): made it possible to escape '*' '%' '@' in filenames * libs/PictureImageLoader.c (PImageLoadSvg): added transposing and none uniform scaling to svg options 2007-07-16 Dominik Vogt * libs/PictureImageLoader.c: cleanup (PImageLoadCursorFromFile): fixed compilation without xpm library (PImageLoadPng): fixed compiler warning without png library 2007-07-16 Viktor Griph * libs/Fxpm.h: * libs/PictureImageLoader.c (PImageLoadCursorFromFile): fix compilation without xpm library 2007-07-16 Dominik Vogt * libs/Fxpm.h: fixed compile error * libs/PictureImageLoader.c: cleanup (PImageLoadCursorFromFile): fixed compilation without xpm library (PImageLoadPng): fixed compiler warning without png library 2007-07-16 Dominik Vogt * libs/PictureImageLoader.c (PImageLoadCursorFromFile): * fvwm/cursor.c (CMD_CursorStyle): fixed compiler warning 2007-07-15 Viktor Griph * fvwm/cursor.c (CMD_CursorStyle): fix CursorStyle command parsing 2007-06-22 Simon Griph * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): * libs/PictureImageLoader.h (PImageCreatePixmapFromArgbData): * libs/PictureImageLoader.c (PImageLoadSvg): (PImageLoadPng): (PImageCreatePixmapFromArgbData): moved XCreatePixmap() calls into PImageCreatePixmapFromArgbData() (PImageCreatePixmapFromFImage): new local function 2007-06-22 Simon Griph * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): * libs/PictureImageLoader.h (PImageCreatePixmapFromArgbData): * libs/PictureImageLoader.c (PImageLoadSvg): (PImageLoadPng): (PImageCreatePixmapFromArgbData): moved XCreatePixmap() calls into PImageCreatePixmapFromArgbData() (PImageCreatePixmapFromFImage): new local function 2007-06-22 Simon Griph * AUTHORS: * NEWS: updated * configure.ac: added libXcursor detection * fvwm/Makefile.am (LDADD): added Xcursor_LIBS * INSTALL.fvwm: * libs/Fcursor.h: new file * libs/Makefile.am (libfvwm_a_SOURCES): added Fcursor.h * libs/PictureImageLoader.c (PImageLoadCursorFromFile): added Xcursor support 2007-06-22 Simon Griph * NEWS: updated * libs/Fxpm.h: added defs for FxpmInfo and FxpmFreeXpmInfo * libs/PictureBase.h (FvwmPictureAttributes): * libs/PictureImageLoader.c (PImageCreatePixmapFromArgbData): (PImageLoadPixmapFromFile): added FPAM_MONOCHROME option to FvwmPictureAttributes bitmask (PImageLoadCursorPixmapFromFile): (PImageLoadCursorFromFile): * libs/PictureImageLoader.h: removed the xpm-specific PImageLoadCursorPixmapFromFile(), replaced by the new general PImageLoadCursorFromFile() * fvwm/cursor.c (CMD_CursorStyle): handle new hot-spot arguments, use PImageLoadCursorFromFile() instead of PImageLoadCursorPixmapFromFile(), less code duplication 2007-06-22 Simon Griph * libs/PictureImageLoader.c (PImageLoadSvg): (PImageLoadPng): (PImageLoadXpm): now returns argb data instead of pixmaps (PImageLoadPixmapFromFile): (PImageLoadArgbDataFromFile): moved first half of PImageLoadPixmapFromFile() into the new local function PImageLoadArgbDataFromFile() (PImageLoadBitmap): removed function, code moved into PImageLoadPixmapFromFile() 2007-06-22 Simon Griph * libs/PictureImageLoader.c (PImageLoadXpm): revised to make use of PImageCreatePixmapFromArgbData() 2007-06-22 Simon Griph * fvwm/colorset.c (parse_shape): * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): * libs/PictureImageLoader.h (PImageCreatePixmapFromArgbData): * libs/PictureImageLoader.c (PImageLoadSvg): (PImageLoadPng): (PImageCreatePixmapFromArgbData): don't create a mask pixmap for fully opaque (all alpha == 0xff) or translucent (0 < any alpha < 0xff) images. 2007-06-22 Simon Griph * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): * libs/PictureImageLoader.h (PImageCreatePixmapFromArgbData): * libs/PictureImageLoader.c (PImageLoadSvg): (PImageLoadPng): (PImageCreatePixmapFromArgbData): moved XCreatePixmap() calls into PImageCreatePixmapFromArgbData() (PImageCreatePixmapFromFImage): new local function 2007-07-12 Dominik Vogt * fvwm/functions.c (CMD_EchoFuncDefinition): * fvwm/functable.c (func_table): * fvwm/commands.h: new command EchoFuncDefinition 2007-07-07 Simon Griph * NEWS: * fvwm/conditional.c (CreateConditionMask): bugfix: Condition separation previously failed when a single comma (no whitespace padding) was used directly after a multi-worded condition. 2007-06-21 Renato Caldas * fvwm/module_list.c (module_kill): fix possible core dump when using startup modules 2007-06-10 Viktor Griph * NEWS: * fvwm/builtins.c (CMD_PrintInfo): * libs/Picture.h (PicturePrintImageCache): * libs/Picture.c (PicturePrintImageCache): add ImageCache subject to PrintInfo command 2007-06-07 Viktor Griph * NEWS: * fvwm/events.c (My_XNextEvent): fix crash when a module closes down during input/output. 2007-06-03 Viktor Griph * fvwm/icons.c (ChangeIconPixmap): (DeIconify): (Iconify): * fvwm/focus.c (warp_to_fvwm_window): * fvwm/events.c (__handle_cr_restack): (__handle_bpress_on_managed): (HandlePropertyNotify): * fvwm/stack.h: * fvwm/stack.c (__restack_window): (__raise_lower_recursion): (__raise_or_lower_window): (raise_or_lower_window): (position_new_window_in_stack_ring): (RaiseWindow): (LowerWindow): (RestackWindow): (HandleUnusualStackmodes): (CMD_Raise): (CMD_Lower): (CMD_RestackTransients): (CMD_RaiseLower): do raise hacks even when the internal stack is intact, unless on a client request 2007-06-03 Dominik Vogt * fvwm/style.c (check_window_style_change) (style_parse_one_style_option): * fvwm/style.h: * fvwm/fvwm.h (window_style): * fvwm/add_window.c (setup_frame_size_limits): * fvwm/geometry.c (constrain_size): new style MinWindowSize 2007-05-30 Dominik Vogt * libs/System.h: added missing prototypes * libs/safemalloc.c: * libs/fio.c: * libs/envvar.c: * libs/XResource.c: * libs/XError.c: * libs/WinMagic.c: * libs/Target.c: * libs/Event.c (GetSubwindowFromEvent): * libs/Cursor.c: * libs/ColorUtils.c: include corresponding header files * libs/PictureBase.c: * libs/FlocaleCharset.c: * fvwm/ewmh.c: cleanup prototypes 2007-05-27 Viktor Griph * configure.ac (HAVE_GNU_READLINE): detect full GNU readline API (vs BSD libedit readline compatibility layer) 2007-04-27 Scott Smedley * fvwm/windowlist.c (CMD_WindowList): * NEWS: Deprecated "UseListSkip" & "OnlyListSkip" - replaced with "UseSkipList" & "OnlySkipList". 2007-04-29 Viktor Griph * NEWS: * fvwm/add_window.c (validate_transientfor): detect and disallow circular transient-for hints 2007-04-27 Scott Smedley * fvwm/fvwm.1.in: s/UseListSkip/UseSkipList/g etc. 2007-04-17 Jesus Guerrero <6thpink(at)terra(dot)es> * fvwm/menus.c (size_menu_vertically): added localization of the "More&..." string 2007-03-17 Viktor Griph * libs/PictureBase.c (PictureFindImageFile): fix for segfault with svg-support enabled * INSTALL.fvwm (http): * configure.ac (png_CFLAGS): raise librsvg dependeny due to bug with 2.13.91 * fvwm/cursor.c (CMD_CursorStyle): remove unused static variable nocursor 2007-03-14 Scott Smedley * AUTHORS: typo. 2007-03-11 Scott Smedley * configure.ac: bugfix: 'make dist' failed cos I moved 'scott.notes' to util/ subdir. bugfix: out-of-tree builds failed due to broken dependency. Make man page have same header as old one. Fix man page indentation. Make text of top-level man page sections all uppercase. Added --disable-mandoc option. HTML doc generation is off by default: use --enable-htmldoc. Added more info in doc/README about XML commands to use. 2007-03-10 Scott Smedley * NEWS: * Everything in the 'doc' subdirectory. XML source to generate man page & HTML documentation. 2007-02-07 Viktor Griph * NEWS: * fvwm/colorset.c (parse_colorset): don't recompute sh, hi and fgsh if they were supplied in a previous colorset line. Fixes bug #3359. 2007-02-06 Dominik Vogt * fvwm/move_resize.c (DoSnapAttract): handle SnapGrid before SnapAttraction so that non-overlapping windows do not snap edge to edge: +---+ | | +---+---+ | | +---+ 2007-02-05 Viktor Griph * fvwm/style.c (parse_and_set_window_style) (style_parse_one_style_option): don't warn about PositionPlacement arguments 2007-02-04 Viktor Griph * AUTHORS: * NEWS: enties for ChangeWindowTitle patch by Julio Teca. 2007-02-04 Dominik Vogt * fvwm/fvwm.c (main): fixed ROOT CursorStyle context * fvwm/placement.c (__pl_manual_get_pos_simple): * fvwm/move_resize.h: * fvwm/move_resize.c (__move_loop): (InteractiveMove): fixed long broken POSITION CursorStyle context 2007-02-04 Viktor Griph * fvwm/bindings.c (ParseBinding): fix buffer overrun with >78 character window names. * fvwm/fvwm.1.in (PositionPlacement): fix typos * fvwm/fvwm.1.in (BorderWidth, HandleWidth): * fvwm/style.c (style_parse_one_style_option): change BorderWidth and HandleWidth style to revert to default if no arguments are given 2007-02-04 Dominik Vogt * fvwm/fvwm.h (style_flags): * fvwm/placement.c (__pl_under_mouse_get_pos_simple): (__place_get_wm_pos): (__place_window, __explain_placement): * fvwm/style.c (style_parse_one_style_option): * libs/defaults.h (DEFAULT_PLACEMENT_POS_CENTER_STRING) (DEFAULT_PLACEMENT_POS_MOUSE_STRING) (DEFAULT_PLACEMENT_POSITION_STRING): new default strings * fvwm/move_resize.c (GetOnePositionArgument): added 'w' suffix to Move arguments allow multiple shifts from original position * fvwm/style.c (style_parse_one_style_option): (merge_styles) (free_style): * fvwm/placement.c (setup_window_placement) (__place_get_placement_flags): (__place_get_wm_pos): (__place_get_nowm_pos): (__place_window): (__place_handle_x_resources): (setup_window_placement): * fvwm/fvwm.h (PLACE_CENTER): (PLACE_POSITION): replaced CenterPlacement with more flexibe PositionPlacement * fvwm/move_resize.c (GetMoveArguments): (GetResizeArguments): (GetResizeMoveArguments): (__move_window): * fvwm/move_resize.h: exported and enhanced function GetMoveArguments for use by placement algorithm 2007-02-01 Viktor Griph * fvwm/ConfigFvwmDefaults: reenable MenuScroll on titles * fvwm/menubindings.c (menu_shortcuts): don't scroll menus if scrolling would be in the wrong direction 2007-02-01 Dominik Vogt * fvwm/move_resize.c (__resize_window): some resizing/gravity fixes properly handle maximized + shaded state when resizing non-interactively 2007-01-31 Viktor Griph * fvwm/move_resize.c (__resize_window): resizing of shaded windows work better. 2007-01-30 Viktor Griph * fvwm/fvwm.1.in (COMMAND EXPANSION): clarified previous patch * fvwm/fvwm.1.in (COMMAND EXPANSION): documented '-' command prefix * fvwm/expand.c (__eae_parse_range): fix $[n-] and $[*] after unsigned int havoc 2007-01-28 Dominik Vogt * fvwm/Makefile.am: * fvwm/ConfigFvwmMenuDefaults: removed file * fvwm/ConfigFvwmDefaults: * fvwm/ConfigFvwmMenuDefaults: moved all settings from ConfigFvwmMenuDefaults to ConfigFvwmDefaults 2007-01-28 Viktor Griph * fvwm/ConfigFvwmMenuDefaults: * fvwm/fvwm.c (SetRCDefaults): make default menu mouse bindings for MenuSelectItem and MenuScroll only apply to menu item context. 2007-01-28 Dominik Vogt * fvwm/placement.c (placement_loop): (__pl_minoverlap_get_avoidance_penalty): (__pl_smart_get_first_pos): (__pl_smart_get_next_pos): (__pl_smart_test_window): (__pl_smart_get_pos_penalty): rewrote SmartPlacement as a sub-mode of MinOverlapPlacement, i.e. it's now less than ten lines of code. * fvwm/add_window.c (setup_placement_penalty): * fvwm/style.c (style_parse_one_style_option): allow to reset the placement penalties with ! * fvwm/placement.h: * fvwm/add_window.c (setup_placement_penalty): * fvwm/style.h: * fvwm/fvwm.h: * fvwm/style.c (style_parse_one_style_option): put placement penalty array in a struct * fvwm/placement.c (__place_get_wm_pos): (__pl_clever_get_next_x): (__pl_clever_get_next_y): (__pl_clever_get_first_pos): (__pl_clever_get_next_pos): (__pl_clever_get_avoidance_penalty): (__pl_clever_get_pos_penalty): (__pl_minoverlap_get_next_x): (__pl_minoverlap_get_next_y): (__pl_minoverlap_get_first_pos): (__pl_minoverlap_get_next_pos): (__pl_minoverlap_get_avoidance_penalty): (__pl_minoverlap_get_pos_penalty): renamed ...clever... functions to ...minoverlap... * fvwm/bindings.c: * fvwm/decorations.c: * fvwm/menubindings.c: * fvwm/module_interface.c: * fvwm/module_list.c: * fvwm/fvwm.c: * fvwm/module_list.h: * fvwm/events.c: * fvwm/module_interface.h: * fvwm/Makefile.am: dont include "libs" in include path * libs/vpacket.h: #includes from fvwm path with "..." not <...> * fvwm/stack.c: #includes from library path with "..." not <...> 2007-01-28 Simon Griph * NEWS: * AUTHORS: * INSTALL.fvwm: documented new svg support * configure.ac: added librsvg detection * fvwm/Makefile.am (LDADD, INCLUDES): added rsvg_LIBS, rsvg_CFLAGS * fvwm/expand.c (expand_vars_extended): new extended variables $[w.iconfile.svgopts] and $[w.miniiconfile.svgopts] * fvwm/fvwm.1.in (OPTIONS): (ICONS AND IMAGES): documented new svg support (COMMAND EXPANSION): documented new extended variables * fvwm/fvwm.c (setVersionInfo): (main): added Frsvg_init() call * libs/Fsvg.h: new file * libs/Makefile.am (libfvwm_a_SOURCES): added Fsvg.h (INCLUDES): added rsvg_CFLAGS * libs/Picture.c (PCacheFvwmPicture): hid svgopts from isFileStampChanged() * libs/PictureBase.c (PictureFindImageFile): hid svgopts from searchPath() * libs/PictureBase.h: * libs/PictureImageLoader.c (PImageLoadFvwmPictureFromFile): hid svgopts from setFileStamp() (PImageLoadSvg): new svg image loader * libs/fvwmlib.c (flib_init_graphics): added Frsvg_init() call 2007-01-28 Viktor Griph * NEWS: * fvwm/stack.c (__is_restack_needed) (is_transient_subtree_straight): (__restack_window): fix crash when trying to restack destroyed window 2007-01-27 Viktor Griph * libs/Makefile.am (libfvwm_a_SOURCES): add fvwmlib.c * fvwm/move_resize.c (AnimatedMoveAnyWindow): * fvwm/menus.c (move_any_menu) set menu backgrounds before moving. Makes transparent menus move more seamless. * fvwm/menus.c (update_transparent_menu_bg, repaint_transparent_menu): * fvwm/menus.c (update_transparent_menu_bg, repaint_transparent_menu): add update_transparent_menu_bg to allow set of transparent menu background before a move, and change repaint_transparent_menu to allow for not setting the menu background. * libs/Colorset.c (SetWindowBackgroundWithOffset): create offset backgrounds with CreateOffsetBackgroundPixmap (works with transparent colorsets) (CreateOffsetBackgroundPixmap): use offset also for non transparent backgrounds. * fvwm/menubindings.c (menu_shortcuts): don't move menus on scroll if they don't move 2007-01-27 Dominik Vogt * libs/fvwmlib.h: * fvwm/bindings.c: * fvwm/cursor.c: * fvwm/decorations.c: * fvwm/ewmh_conf.c: * fvwm/ewmh_events.c: * fvwm/ewmh_icons.c: * fvwm/expand.c: * fvwm/focus.c: * fvwm/functions.c: * fvwm/gnome.c: * fvwm/menubindings.c: * fvwm/menucmd.c: * fvwm/menuitem.c: * fvwm/misc.c: * fvwm/modconf.c: * fvwm/module_interface.c: * fvwm/module_list.c: * fvwm/read.c: * fvwm/update.c: * fvwm/windowlist.c: * fvwm/windowshade.c: * fvwm/colorset.c: * fvwm/session.c: * fvwm/stack.c: * fvwm/ewmh.c: * fvwm/conditional.c: * fvwm/menustyle.c: * fvwm/virtual.c: * fvwm/placement.c: * fvwm/frame.c: * fvwm/fvwm.c: * fvwm/icons.c: * fvwm/add_window.c: * fvwm/builtins.c: * fvwm/move_resize.c: * fvwm/borders.c: * fvwm/style.c: * fvwm/events.c: * fvwm/menus.c: * libs/FTips.c: * libs/Picture.c: * libs/Target.c: * libs/gravity.c: * fvwm/execcontext.c: * libs/BidiJoin.c: * libs/CombineChars.c: * libs/FBidi.c: * libs/FEvent.c: * libs/Fft.c: * libs/FGettext.c: * libs/Ficonv.c: * libs/FImage.c: * libs/flist.c: * libs/FlocaleCharset.c: * libs/fsm.c: * libs/Parse.c: * libs/queue.c: * libs/safemalloc.c: * libs/strdup.c: * libs/timeout.c: * libs/Strings.c: * libs/FRender.c: * libs/Module.c: * libs/ColorUtils.c: * libs/Colorset.c: * libs/PictureImageLoader.c: * libs/PictureGraphics.c: * libs/Graphics.c: * libs/FScreen.c: * libs/PictureUtils.c: * libs/Flocale.c: * libs/PictureBase.c: use new header files * libs/Graphics.h: * libs/XResource.h: * libs/Event.h: * libs/XError.h: * libs/ColorUtils.h: * libs/PictureBase.h: * libs/System.h: * libs/defaults.h: * libs/Cursor.h: * libs/Target.h: * libs/WinMagic.h: * libs/fvwmlib.h: * libs/Makefile.am (libfvwm_a_SOURCES): moved declarations from fvwmlib.h to new/appropriate header files * libs/XError.c: reformatted * fvwm/menus.c (paint_side_pic): fixed previous patch reindented function 2007-01-27 Viktor Griph * fvwm/menus.c (paint_side_pic): fix a core dump * fvwm/menus.c (paint_side_pic): use simple expose information to redraw sidepics less. 2007-01-26 Viktor Griph * fvwm/geometry.c (constrain_size): silence gcc 4.1.1 warning. * libs/System.c (searchPath): search in pwd if no path is given. return NULL if a file dosn't exist regardless if it's absolute path 2007-01-26 Dominik Vogt * fvwm/placement.c (__place_window) (__pl_under_mouse_get_pos_simple): * fvwm/style.h (SUNDERMOUSE_PLACEMENT_HONORS_STARTS_ON_PAGE): * fvwm/fvwm.1.in: new style option UnderMousePlacementHonorsStartsOnPage * fvwm/update.c (init_style): don't forget stickyness when a window goes fullscreen (or when some other style is changed) 2007-01-25 Dominik Vogt * fvwm/placement.c (__pl_cascade_get_pos_simple): properly handle title direction with cascade placement * libs/defaults.h (PLACEMENT_FALLBACK_CASCADE_STEP): new default value * fvwm/placement.c (__pl_center_get_pos_simple): CenterPlacement properly handles Xinerama screens 2007-01-25 Viktor Griph * configure.ac: always substiture datarootdir 2007-01-21 Dominik Vogt * fvwm/add_window.c (GetWindowSizeHints): * fvwm/geometry.c (constrain_size): undefine macros after use (constrain_size): reindented and cleaned up do not grow a window because of aspect ratio if this is not explicitly allowed by the CS_ROUND_UP flag (constrain_size): (__cs_handle_aspect_ratio): broken into separate functions and cleaned up 2007-01-20 Renato Caldas * fvwm/module_list.c (module_receive): (module_input_discard): allocate input data in just one call - better perfomance 2007-01-20 Dominik Vogt * fvwm/placement.c (__place_get_wm_pos): simplified to a simple loop (__explain_placement): added explanation of new placement styles * fvwm/placement.c (__place_get_wm_pos): cleanup (__pl_center_get_pos_simple): (__pl_under_mouse_get_pos_simple): (__pl_cascade_get_pos_simple): (__pl_manual_get_pos_simple): (__place_get_wm_pos): use new placement interface for CenterPlacement, UnderMousePlacement, ManualPlacement, CascadePlacement * fvwm/placement.c (__sp_get_first_pos): (__sp_get_next_pos): (__sp_get_pos_penalty): (__place_get_wm_pos): use new placement interface for SmartPlacement (SmartPlacement): removed function * fvwm/placement.c: don't use inline functions (CleverPlacement): (placement_loop): renamed function and generalized the placement interface to deal with any algorithm in the same way (__place_get_wm_pos): use new placement interface * NEWS: * configure.ac: increased version to 2.5.22 * NEWS: * configure.ac: updated for 2.5.21 release 2007-01-19 Dan Espen * fvwm/read.h: Compile syntax error fix. 2007-01-20 Dominik Vogt * fvwm/placement.c (SmartPlacement): fixed broken SmartPlacement 2007-01-19 Viktor Griph * fvwm/expand.c (expand_vars_extended): free allocated icon path 2007-01-19 Dominik Vogt * fvwm/fvwm.1.in: some cleanup * fvwm/virtual.c: fix compile error 2007-01-19 Viktor Griph * NEWS: * fvwm/fvwm.1.in (Scroll): * fvwm/virtual.c (__drag_viewport, CMD_Scroll): add interactive scrolling. * fvwm/stack.c (is_transient_subtree_straight): check first above the tree root, then beneth it. 2007-01-17 Renato Caldas * fvwm/module_interface.h * fvwm/module_interface.c (module_input_enqueue): (module_input_execute): new functions based on AddToCommandQueue and ExecuteModuleCommand * fvwm/module_list.c (CMD_ModuleSynchronous): (PositiveWrite): * fvwm/events.c (My_XNextEvent): * fvwm/module_interface.c (ExecuteCommandQueue): using the above two new functions instead of AddToCommandQueue and ExecuteModuleCommand * fvwm/module_interface.c (cqueue_object_type): removed typedef * fvwm/module_interface.h * fvwm/module_interface.c (AddToCommandQueue): (ExecuteModuleCommand): removed functions 2007-01-16 Viktor Griph * fvwm/fvwm.h (window_style): * fvwm/style.c (style_parse_one_style_option): icon background relief and icon title relief changed to sigend char; should fix problem with ppc and negative values for these. 2007-01-16 Renato Caldas * fvwm/module_list.h: * fvwm/module_list.c (module_receive): (module_input_discard): (module_input_expect): new functions to deal with module input * fvwm/module_list.h: * fvwm/module_list.c (HandleModuleInput): replaced by the above three functions * fvwm/events.c (My_XNextEvent): * fvwm/module_list.c (CMD_ModuleSynchronous): (PositiveWrite): adapted to use the above three functions instead of HandleModuleInput 2007-01-16 Viktor Griph * configure.ac (HAVE_PNG): don't mangle png_LIBS, use --with-png-library 2007-01-15 Viktor Griph * NEWS: removed news about previous change after move of version-2_5_20 tag on ChangeLog and fvwm/stack.c to the last revision and rebuilt tar balls. * fvwm/stack.c (__restack_window): fix so new transient windows with StackTransientParent on top layer don't make all windows raise above the pan frames. * NEWS: * configure.ac: increased version to 2.5.21 * NEWS: * configure.ac: updated for 2.5.20 release 2007-01-15 Renato Caldas * fvwm/fvwm.c (main): remove the call to module_init_list, the list head is instead set to NULL upon declaration * fvwm/module_list.h: * fvwm/module_list.c (module_init_list): removed function 2007-01-14 Viktor Griph * fvwm/stack.c (is_transient_subtree_straight) (is_transient_subtree_stack_straight): use <= 32 character function name (mark_transient_subtree, is_transient_subtree_straight) (__mark_transient_subtree_test): move common tests to function to avoid code duplication * fvwm/fvwm.1.in (IconifyWindowGroups): Correctly document that windows are iconified together if the are in the same window group, not if the group leader is iconified. 2007-01-14 Dominik Vogt * fvwm/add_window.c (GetWindowSizeHints): * libs/vpacket.h (ConfigWinPacket): * fvwm/module_interface.c (CONFIGARGS): * fvwm/fvwm.h (FvwmWindow): add orig_hints_width_inc and orig_hints_height_inc values to store the original resize inc for use in FvwmIdent * fvwm/fvwm.1.in: * fvwm/style.c (style_parse_one_style_option): deprecated some "No..." styles (style_parse_one_style_option): add a NoResizeHintOverride style * fvwm/add_window.c (GetWindowSizeHints): only ignore the min_width/min_height/max_width/max_height with the ResizeHintOverride style * fvwm/icons.c (DeIconify): corrected previous fix * fvwm/placement.c (CleverPlacement): (SmartPlacement): (__place_get_wm_pos): (__place_get_nowm_pos): (__place_window): fixed smart placement unified placement func interface 2007-01-14 Viktor Griph * NEWS: * fvwm/icons.c (DeIconify): don't loop forever. * fvwm/stack.c (is_transient_subtree_stacked_straight): fix detection of non needed lower operations (__restack_window): BroadcastRestack to modules even if non is done. (To cancel effect of already sent M_RAISE/M_LOWER) don't do raise hacks if no restack was done. * fvwm/fvwm.h (FvwmWindow): icon_nalloc_pixels is int instead of unsined int * libs/PictureUtils.h (PictureCloseImageColorAllocator): * libs/PictureUtils.c (PictureCloseImageColorAllocator): use int instead of unsigned int. * fvwm/menugeometry.c (menu_get_geometry) (menu_get_outer_geometry): * fvwm/focus.c (CMD_WarpToWindow): * fvwm/geometry.c (get_title_button_geometry): * fvwm/session.c (SaveWindowStates): * fvwm/conditional.c (CMD_WindowId): * fvwm/placement.c (__place_get_wm_pos): * fvwm/frame.c (frame_create_move_resize_args): * fvwm/icons.c (GetIconBitmap, GetIconWindow): * fvwm/add_window.c (CaptureOneWindow, AddWindow): * fvwm/builtins.c (CMD_Destroy, CMD_Close): * fvwm/style.c (style_parse_icon_box_style): * fvwm/move_resize.c (resize_move_window, InteractiveMove) (AnimatedMoveAnyWindow, __move_window, __move_loop) (__resize_window): * fvwm/events.c (HandlePropertyNotify) (__is_bpress_window_handled): * fvwm/menus.c (paint_menu_gradient_background, pop_menu_up) (get_menu_options): fix geometry signed pointer warnings * libs/Graphics.c (CalculateGradientDimensions): cast pointer to unsigned int* * libs/FScreen.h (FScreenGetScrRect, FScreenGetResistanceRect): * libs/FScreen.c (FScreenGetScrRect, FScreenClipToScreen) (FScreenCenterOnScreen, FScreenGetResistanceRect, FScreenGetGeometry): change unsigned int* parameter to int*. It get's info stored in an unsigned short, so it should be OK. * fvwm/externs.h: * fvwm/fvwm.c: JunkMask is unsigned * fvwm/stack.c (__mark_group_member) (is_transient_subtree_stacked_straight, __is_restack_needed) (__restack_window, mark_transient_subtree): don't raise or lower windows if they are already at the right place. 2007-01-13 Renato Caldas * fvwm/module_interface.c (struct cqueue_object_type): * fvwm/module_list.h (struct fmodule_input): reused cqueue_object_type as a struct to store module input data renamed it to fmodule_input and moved it to module_list.h typedef'ed it to cqueue_object_type in module_interface.c 2007-01-13 Dominik Vogt * fvwm/placement.c (__cp_get_next_x): (__cp_get_next_y): (__cp_get_first_pos): (__cp_get_next_pos): (__cp_get_avoidance_penalty): (__cp_test_fit): (CleverPlacement): restructured and cleaned up CleverPlacement code * fvwm/style.c (style_parse_icon_box_style): * fvwm/virtual.c (HandlePaging): * fvwm/stack.c (verify_stack_ring_consistency): (ResyncFvwmStackRing): * fvwm/repeat.c: * fvwm/read.c (cursor_control): * fvwm/placement.c (__place_get_wm_pos): * fvwm/move_resize.c (GetMoveArguments): (ParseOneResizeArgument): (GetResizeArguments): (GetResizeMoveArguments): (resize_move_window): (resize_move_window): (InteractiveMove): (__move_window): (DoSnapAttract): (DoSnapAttract): (__resize_step): (__resize_window): (__resize_window): (__resize_window): (MaximizeHeight): (MaximizeWidth): (maximize_fvwm_window): (CMD_Maximize): (CMD_Maximize): * fvwm/misc.c: * fvwm/menustyle.h (MenuStyle): * fvwm/menus.c (MenuSizingParameters): (make_menu_window): (paint_menu_gradient_background): (paint_menu_gradient_background): (select_menu_item): (do_menus_overlap): (pop_menu_up): (pop_menu_down_and_repaint_parent): (__mloop_handle_action_without_mi): (do_menu): (get_menu_options): (get_menu_options): * fvwm/menuroot.h (MenuRootStatic): (MenuRootDynamic): * fvwm/menuitem.h (MenuPaintItemParameters): * fvwm/menugeometry.h: * fvwm/menubindings.c (menu_shortcuts): * fvwm/icons.c (SetIconPixmapSize): (GetIconPicture): (DrawIconTitleWindow): (AutoPlaceIcon): (do_all_iconboxes): (GetIconWindow): (GetIconBitmap): * fvwm/gnome.c (GNOME_GetHintIcons): * fvwm/functions.c (FvwmFunction): (__execute_function): (__cf_cleanup): (execute_complex_function): * fvwm/fvwm.c (JunkWidth): (JunkHeight): (JunkBW): (JunkDepth): (JunkMask): (main): * fvwm/externs.h (JunkWidth): (JunkHeight): (JunkBW): (JunkDepth): (JunkMask): * fvwm/focus.c (CMD_WarpToWindow): * fvwm/expand.c (__eae_parse_range): (expand_args_extended): (expand_vars_extended): (expand_vars_extended): * fvwm/ewmh_names.c (EWMH_WMIconName): (EWMH_WMName): * fvwm/ewmh_intern.h: * fvwm/ewmh_icons.c (ewmh_WMIcon): (EWMH_DoUpdateWmIcon): (ewmh_SetWmIconFromPixmap): (ewmh_SetWmIconFromPixmap): (EWMH_DeleteWmIcon): (extract_wm_icon): (extract_wm_icon): (EWMH_SetIconFromWMIcon): * fvwm/ewmh_events.c (ewmh_WMDesktop): (ewmh_WMState): (ewmh_WMIconGeometry): (ewmh_WMStrut): * fvwm/ewmh.h: * fvwm/ewmh.c (ewmh_ChangeProperty): (ewmh_ChangeProperty): (atom_get): (ewmh_AtomGetByName): (ewmh_AddToKdeSysTray): (EWMH_GetWorkAreaIntersection): (ewmh_HandleWindowType): (ewmh_check_wm_pid): * fvwm/geometry.c (constrain_size): * fvwm/geometry.h: * fvwm/events.c (__handle_cr_on_client): (WaitForButtonsUp): * fvwm/events.h: * libs/PictureImageLoader.c: * libs/PictureImageLoader.h: * libs/WinMagic.c: * libs/fvwmlib.h: * libs/Graphics.c (ParseGradient): (CalculateGradientDimensions): (CreateGradientPixmap): (CreateGradientPixmapFromString): * fvwm/colorset.c (update_root_pixmap): * fvwm/builtins.c (CMD_Echo): (CMD_State): * fvwm/add_window.c (AddWindow): * fvwm/screen.h (DecorFace): use int instead of unsigned int * libs/Flocale.c (FlocaleChar2bOneCharToUtf8): * fvwm/colormaps.c (EnterSubWindowColormap): (LeaveSubWindowColormap): (FetchWmColormapWindows): * libs/vpacket.h: * libs/CombineChars.c (char_combclass): use short instead of short int use long instead of long int * libs/PictureBase.h (FvwmPictureAttributes): (FvwmRenderAttributes): * libs/Flocale.h (FlocaleFont): * fvwm/style.c (style_parse_icon_grid_style): * fvwm/menus.c (size_menu_horizontally): (size_menu_vertically): (paint_menu): (AddToMenu): * fvwm/menuitem.c (menuitem_paint): (menuitem_free): * fvwm/menuitem.h (MenuItem): * fvwm/geometry.c (set_window_border_size): * fvwm/decorations.c (SelectDecor): use int instead of short * fvwm/screen.h (FvwmAcs): (DecorFace): * fvwm/menus.c (MenuSizingParameters): (size_menu_horizontally): (update_menu): (paint_menu_gradient_background): * fvwm/menuroot.h (MenuRootStatic): * fvwm/menuitem.h (MenuItem): (MenuItemPartSizesT): * fvwm/menuitem.c (menuitem_get_size): * fvwm/menudim.h (MenuDimensions): use int instead of unsigned short 2007-01-13 Dominik Vogt * libs/gravity.h: * libs/gravity.c (gravity_move_resize_parent_child): * fvwm/frame.h: * fvwm/frame.c (mr_args_internal): (frame_setup_border): (frame_setup_titlebar): (frame_get_resize_decor_gravities): (frame_get_titlebar_dimensions): use rectangle instead of signed_rectangle * libs/fvwmrect.c (fvwmrect_subtract_rectangles): * libs/fvwmrect.h (signed_rectangle): removed type (rectangle): (size_rect): widht and height are now signed values * fvwm/placement.c (get_next_x): (__cp_get_next_x): (get_next_x): (__cp_get_next_y): (__test_fit): (__cp_test_fit): renamed functions * fvwm/placement.c (get_next_x): (get_next_y): (test_fit): (CleverPlacement): cleanup 2007-01-13 Viktor Griph * NEWS: NEWS entry for StickyIcon, StickyAcrossPagesIcon and StickyAcrossDesksIcon. 2007-01-13 Serge Koksharov * fvwm/conditional.c (CreateConditionMask): added conditions StickyIcon, StickyAcrossPagesIcon and StickyAcrossDesksIcon. * fvwm/fvwm.1.in: documented new conditional tests. removed descriptions of styles StickyIconPage & StickyIconDesk which actually don't exists in fvwm. moved StickyIcon/SlipperyIcon descriptions immediately after Sticky/Slippery description. 2007-01-13 Dominik Vogt * fvwm/placement.c (SmartPlacemen): (__sp_test_window): cleaned up SmartPlacement code 2007-01-13 Viktor Griph * fvwm/ConfigFvwmMenuDefaults: Mouse 0 MS A MenuLeaveSubmenu instead. * fvwm/ConfigFvwmMenuDefaults: Mouse 0 MS A MenuClose to make sidepic and border behave as before menu bindings. * fvwm/fvwm.1.in: * libs/wcontext.h (enum): * fvwm/menubindings.c (menu_binding): (menu_shortcuts): Add menu contexts 'I' (for items) 'S' '[', ']', '_', '-'. * fvwm/menustyle.c (menustyle_parse_old_style): add a message of deprecation. 2007-01-10 Renato Caldas * fvwm/module_list.h: * fvwm/module_list.c: new files for module handling code. * fvwm/module_list.h: * fvwm/module_interface.h: * fvwm/module_list.c: * fvwm/module_interface.c: (struct mqueue_object_type): (msg_mask_set): (module_alloc): (module_insert): (module_remove): (module_free): (module_get_next): (set_message_mask): (get_pipe_name): (initModules): (ClosePipes): (do_execute_module): (executeModuleDesperate): (CMD_Module): (CMD_ModuleListenOnly): (CMD_ModuleSynchronous): (HandleModuleInput): (DeadPipe): (KillModule): (KillModuleByName): (CMD_KillModule): (PositiveWrite): (DeleteMessageQueueBuff): (FlushMessageQueue): (FlushAllMessageQueues): (CMD_set_mask): (CMD_set_sync_mask): (CMD_set_nograb_mask): (skipModuleAliasToken): (countModules): (struct msg_masks_t): (struct fmodule): moved from module_interface.c/h to module_list.c/h * fvwm/module_list.h (do_execute_module): * fvwm/module_interface.h (AddToCommandQueue): (ExecuteModuleCommand): initialy static functions are exposed for now. Should be fixed soon. * fvwm/Makefile.am: added module_list.h and module_list.c reorganized the c files by size * fvwm/module_list.h: * fvwm/module_list.c: * fvwm/events.c: * fvwm/fvwm.c: * fvwm/session.c: * fvwm/stack.c: (initModules): (module_init_list): (ClosePipes): (module_kill_all): (KillModule): (module_kill): (countModules): (module_count): renamed functions to a unified style * fvwm/module_interface.h: * fvwm/module_interface.c: * fvwm/fvwm.c: * fvwm/events.c: * fvwm/modconf.c * fvwm/session.c: * fvwm/stack.c: * fvwm/windowshade.c: * fvwm/functions.c: * fvwm/move_resize.c: include file cleanup * fvwm/module_list.c (do_execute_module): made absolutely sure the module's read fd is >=0 before inserting the module on the list * fvwm/events.c (My_XNextEvent): * fvwm/module_list.c (PositiveWrite): (CMD_ModuleSynchronous): assume module read fd is allways >=0 (remove the tests) * fvwm/module_list.c (module_free): no need to test if fd >=0 when closing the pipes. 2007-01-10 Viktor Griph * fvwm/menuitem.c (draw_higlight_background): fix x-origin of HGradients 2007-01-10 Renato Caldas * fvwm/module_interface.c (FlushMessageQueues): fixed not flushing the first module on the list 2007-01-10 Viktor Griph * libs/Flocale.c (FlocaleGetFftFont): add sanity check for NULL fontname. * NEWS: * fvwm/fvwm.1.in: * fvwm/menuitem.c (menuitem_paint): (draw_hilight_background): make all kinds of pixmaps work with hilight background * libs/Colorset.h (CreateOffsetBackgroundPixmap): * libs/Colorset.c (CreateOffsetBackgroundPixmap) (CreateBackgroundPixmap): added CreateOffsetBackgroundPixmap with the ability to create transparent images at an offset relative to the window. 2007-01-09 Viktor Griph * fvwm/menus.c (__mloop_exit): (struct): (__mloop_get_event) (__mloop_handle_event): don't warp to parent item when entering other item with mouse. * NEWS: * fvwm/fvwm.1.in: * fvwm/menustyle.c (menustyle_update): make use of colorset TiledPixmap option with HiglightBack and HiglightTitleBack menu styles. 2007-01-09 Dominik Vogt * libs/FScreen.c: reformatted 2007-01-09 Viktor Griph * libs/FScreen.c (FScreenParseGeometry): don't look up screen info if screen is undefined 2007-01-07 Dominik Vogt * ONEWS: * NEWS: moved the NEWS of 2.2.x and 2.3.x to ONEWS * libs/fio.c (fvwm_send): compile fixes * libs/defaults.h (FVWMCONSOLE_CONNECTION_TO_SECS): added macro * libs/fio.c: * libs/fio.h: new utility files to wrap writing/reading standard lib functions that might be interrupted 2007-01-05 Serge Koksharov * fvwm/ewmh_intern.h: compilation fix with EWMH_DEBUG enabled: include instead of . * fvwm/windowlist.h: removed unneeded file. * fvwm/Makefile.am: removed windowlist.h from build list. * libs/PictureUtils.c: include "ftime.h" instead of . fvwmlib.h header name should be in double quotes not in angle brackets. * libs/System.c: include "ftime.h" instead of . 2007-01-05 Viktor Griph * ChangeLog: make my email less spider-friendly * fvwm/bindings.c (binding_cmd): (ParseBinding): fix core 2007-01-05 Dominik Vogt * fvwm/screen.h (ScreenInfo): made MyDisplayWidth and MyDisplayHeight signed integer values to avoid casting signed values in calculations to be cast to unsigned * fvwm/focus.c (__activate_window_by_command): don't warp the viewport if the center of the window is already in view fixed a bug in window positioning 2007-01-03 Serge Koksharov * NEWS: FvwmIconBox IconColorset's bg wasn't updated immediately. 2007-01-03 Dominik Vogt * fvwm/fvwm.c (main): close all open fds upon startup reopen stdin, stdout and stderr if necessary (reopen_fd): new function * fvwm/module_interface.c (do_execute_module): simplified error handling check maximum fd when creating modules * fvwm/events.c (My_XNextEvent): * fvwm/fvwm.c (main): replaced fd_width with fvwmlib_max_fd * libs/fvwmlib.h: * libs/System.c (fvwmlib_init_max_fd): added function and fvwmlib_max_fd * fvwm/events.c (My_XNextEvent): * fvwm/module_interface.c (CMD_ModuleSynchronous): switch back to using FD_SET * fvwm/events.c (My_XNextEvent: * fvwm/module_interface.h: * fvwm/module_interface.c: hide module structure members with access macros and use them everywhere 2007-01-02 Renato Caldas * fvwm/module_interface.c (module_add_to_fdsets): * fvwm/module_interface.h: created new function that also checks for too many open fds * fvwm/module_interface.c (CMD_ModuleSynchronous): * fvwm/events.c (My_XNextEvent): now using module_add_to_fdset to add pipes to the fdsets 2007-01-01 Renato Caldas * libs/defaults.h (MAX_NUM_MODULES): * fvwm/module_interface.c (module_alloc): (do_execute_module): removed check for MAX_NUM_MODULES - not needed, done by the O.S. * fvwm/module_interface.c (do_execute_module): moved the allocation call to the end of the sanity checks and pipe creation - better for performance 2007-01-01 Dominik Vogt END MODULE STRUCT PATCHES * fvwm/module_interface.c (do_execute_module): fixed another memory leak 2007-01-01 Renato Caldas * fvwm/module_interface.h: * fvwm/module_interface.c: * fvwm/modconf.c: renamed struct module member "pipeName" and "pipeAlias" to "name" and "alias" * fvwm/module_interface.c (do_execute_module): fixed possible memory leak 2007-01-01 Dominik Vogt * fvwm/events.c (My_XNextEvent): * fvwm/module_interface.c (module_alloc): (do_execute_module): (KillModule): * fvwm/module_interface.h (fmodule): replaced int with a flag struct * fvwm/module_interface.h: * fvwm/events.c (My_XNextEvent): * fvwm/module_interface.c (module_alloc): (module_free): (module_insert): (ClosePipes): add new modules at front of list again removed global variable init_fdset; use a flag in the module struct instead removed the now obsolete module slot count 2007-01-01 Renato Caldas * fvwm/module_interface.c (module_remove): (KillModule): moved module remotion code to module_remove() 2007-01-01 Dominik Vogt * fvwm/events.c (My_XNextEvent): fixed startup commands * fvwm/module_interface.c (module_insert): (module_free): (KillModule): (ClosePipes): append modules at end of list * fvwm/events.c (My_XNextEvent): fixed core * fvwm/module_interface.c (ExecuteModuleCommand): (PositiveWrite): (KillModuleByName): (BroadcastPacket): (BroadcastNewPacket): (BroadcastName): (BroadcastFvwmPicture): (BroadcastColorset): (BroadcastPropertyChange): (BroadcastConfigInfoString): (CMD_SendToModule): (FlushAllMessageQueues): (countModules): (CMD_set_mask): (CMD_set_sync_mask): (CMD_set_nograb_mask): cleanup (skipModuleAliasToken): use MAX_MODULE_ALIAS_LEN * fvwm/module_interface.c (KillModule): (do_execute_module): (module_alloc): added a "slot" member to the module struct to fix the init_fdset hack for now * libs/defaults.h (MAX_NUM_MODULES): (MAX_MODULE_ALIAS_LEN): new config values * fvwm/module_interface.c (do_execute_module): rewrote module struct initialization (HandleModuleInput): use %p to print module address, don't cast it to int * fvwm/module_interface.c (ClosePipes): (KillModule): use module_free (msg_mask_set): (module_insert): (module_alloc): new functions() * fvwm/module_interface.c (FreeModule): (module_free): renamed function * fvwm/module_interface.c (KillModule): (FreeModule): * fvwm/events.c (My_XNextEvent): * fvwm/execcontext.h: * fvwm/modconf.c (CMD_Send_ConfigInfo): (ModuleConfig): * fvwm/stack.c (BroadcastRestack): cleanup * fvwm/module_interface.c (module_get_next): * fvwm/module_interface.h: new function 2007-01-01 Renato Caldas * fvwm/modconf.c (ModuleConfig): (SendConfigToModule): (send_xinerama_state): (send_desktop_names): (send_desktop_geometry): (send_image_path): (send_color_limit): (send_colorsets): (send_click_time): (send_move_threshold): (send_ignore_modifiers): (CMD_Send_ConfigInfo): * fvwm/functions.c (__execute_function): * fvwm/events.c (My_XNextEvent): * fvwm/module_interface.h (msg_masks_t): (fmodule): * fvwm/execcontext.c (__exc_change_context): (exc_create_null_context): * fvwm/execcontext.h: Initial module struct patches BEGIN MODULE STRUCT PATCHES 2006-12-31 Dominik Vogt * fvwm/events.c (HandleFocusOut): (__refocus_stolen_focus_win): (HandleEnterNotify): less disruptive way of restoring focus to the window it was stolen from 2006-12-31 Viktor Griph * fvwm/events.c (HandleEnterNotify): restore focus to windows that had it stolen by unmanaged windows on enter of any unmanaged windows. 2006-12-30 Dominik Vogt * fvwm/menubindings.c: don't include menus.h * fvwm/ConfigFvwmMenuDefaults: all bindings are silent 2006-12-30 Viktor Griph * fvwm/ConfigFvwmMenuDefaults: make all numpad keys silent -- not all keyboads have a numpad add KP_Separator for MenuClose 2006-12-30 Serge Koksharov * fvwm/fvwm.1.in: documented missing menu bindings. * fvwm/ConfigFvwmMenuDefaults: fixed wrong menu bindings. 2006-12-29 Dominik Vogt * fvwm/menubindings.c: * fvwm/menubindings.h: * fvwm/menucmd.c: * fvwm/menudim.c: * fvwm/menudim.h: * fvwm/menugeometry.c: * fvwm/menugeometry.h: * fvwm/menuitem.c: * fvwm/menuitem.h: * fvwm/menuroot.h: * fvwm/menus.c: * fvwm/menus.h: * fvwm/move_resize.c: * fvwm/move_resize.h: * fvwm/windowlist.c: simplified including header files * fvwm/menus.c (__mloop_handle_event): * fvwm/menuparameters.h: * fvwm/menubindings.c (menu_shortcuts): do not call find_entry directly but return MENU_NEWITEM_FIND instead * fvwm/menus.c (__mloop_handle_event): * fvwm/menuparameters.h: * fvwm/menubindings.c (menu_shortcuts): do not call move_any_menu directly but return MENU_NEWITEM_MOVEMENU instead * fvwm/menus.h (MenuParameters): (MenuOptions): (MenuPosHints): (MenuRC): (MenuReturn): (MenuRepaintTransparentParameters): * fvwm/menuparameters.h (MenuParameters): (MenuOptions): (MenuPosHints): (MenuRC): (MenuReturn): (MenuRepaintTransparentParameters): moved to menuparameters.h * fvwm/menus.h (MenuRoot): (MenuRootDynamic): (MenuRootStatic): * fvwm/menutypes.h (MenuRoot): (MenuRootDynamic): (MenuRootStatic): moved to menuroot.h * fvwm/menus.c (menu_get_geometry): (menu_get_outer_geometry): * fvwm/menugeometry.c (menu_get_geometry): (menu_get_outer_geometry): moved to menugeometry.c * fvwm/menuparameters.h: * fvwm/menutypes.h: * fvwm/menugeometry.c: * fvwm/menugeometry.h: * fvwm/Makefile.am: new files * fvwm/menubindings.h (enum): * fvwm/menus.c (enum): moved enum menu_shortcut_action to menubindings.h (get_selectable_item_index): (get_selectable_item_from_index): (get_selectable_item_from_section): (get_selectable_item_count): (parse_menu_action): moved to menubindings.c * fvwm/menus.c (enum): (parse_menu_action): (menuShortcuts): renamed enum shortcut_action to menu_shortcut_action * fvwm/fvwm.c (SetRCDefaults): read default config file after all other defaults 2006-12-29 Viktor Griph * fvwm/ConfigFvwmMenuDefaults: * fvwm/fvwm.c (SetRCDefaults): make the hard coded menu bindings load before ConfigFvwmDefaults move Mouse 0 ... to ConfigFvwmMenuDefaults 2006-12-28 Dominik Vogt * fvwm/ConfigFvwmMenuDefaults: * fvwm/fvwm.c (SetRCDefaults): added hard coded default menu bindings 2006-12-29 Serge Koksharov * fvwm/fvwm.1.in: documentation fixes. 2006-12-28 Dominik Vogt * fvwm/bindings.c: * fvwm/menubindings.h: * fvwm/menubindings.c: * fvwm/menus.h: * fvwm/menus.c: * fvwm/Makefile.am: moved new menu binding code to menubindings.c, menubindings.h split binding into a regular list and a fallback list that can not be modified * libs/fvwmrect.c (fvwmrect_move_into_rectangle): fixed calculation of new geometry if x or y is negative * fvwm/geometry.c (maximize_adjust_offset): fixed calculations of normal geometry when maximized 2006-12-27 Viktor Griph * NEWS: * fvwm/ConfigFvwmMenuDefaults: * fvwm/fvwm.c (SetRCDefaults): * fvwm/menus.c (parse_menu_action): * fvwm/fvwm.1.in: rename menu action to menu bindings and make menu binding commands more verbose. Move "Mouse 0 M A MenuSelectItem" to SetRCDefaults to ensure basic function with ConfigFvwmMenuDefaults missing. 2006-12-27 Dominik Vogt * fvwm/menus.c (menuShortcuts): fixed compiler warning. 2006-12-27 Viktor Griph * fvwm/fvwm.1.in: corrected mis-spelling * AUTHORS: * NEWS: * fvwm/fvwm.1.in: * fvwm/menus.h: * fvwm/menus.c (handle_emacs_bindings): (parse_menu_action) (menuShortcuts): (__mloop_handle_event): (menu_binding): * fvwm/bindings.c (ParseBinding): * fvwm/Makefile.am (config_DATA): * fvwm/ConfigFvwmDefaults: * fvwm/ConfigFvwmMenuDefaults: fully configurable mouse any key bindings for menu navigation. 2006-12-22 Dominik Vogt * fvwm/virtual.c (HandlePaging): removed bogus comment * fvwm/move_resize.c (__move_loop): cleanup (__resize_window): allow paging during resize with "EdgeScroll 0 0" as documented in the man page fixed disappearing windows with "maximize; resize - abort; unmaximize" * fvwm/fvwm.h (FvwmWindow): * fvwm/add_window.c (AddWindow): * fvwm/add_window.c (setup_frame_window): * fvwm/add_window.c (setup_parent_window) * fvwm/borders.c (border_draw_decorations): * fvwm/borders.c (border_draw_one_border_part): * fvwm/borders.c (border_get_parts_and_pos_to_draw) * fvwm/borders.c (border_get_titlebar_descr) * fvwm/builtins.c (__remove_window_decors): * fvwm/conditional.c (MatchesConditionMask): * fvwm/events.c (HandleMapNotify): * fvwm/events.c (HandleMapRequestKeepRaised) * fvwm/events.c (HandlePropertyNotify): * fvwm/events.c (HandleShapeNotify): * fvwm/events.c (__cr_detect_icccm_move) * fvwm/events.c (__cr_get_grav_position): * fvwm/events.c (__cr_get_static_position) * fvwm/events.c (__handle_configure_request) * fvwm/events.c (__handle_cr_on_client): * fvwm/ewmh.c (EWMH_fullscreen): * fvwm/focus.c (__activate_window_by_command): * fvwm/focus.c (__set_focus_to_fwin): * fvwm/focus.c (warp_to_fvwm_window): * fvwm/frame.c (__frame_setup_window): * fvwm/frame.c (frame_create_move_resize_args) * fvwm/frame.c (frame_free_move_resize_args): * fvwm/frame.c (frame_move_resize_step) * fvwm/frame.c (frame_reshape_border): * fvwm/geometry.c (constrain_size): * fvwm/geometry.c (get_icon_corner) * fvwm/geometry.c (get_page_offset): * fvwm/geometry.c (get_page_offset_check_visible): * fvwm/geometry.c (get_shaded_client_window_pos): * fvwm/geometry.c (get_title_button_geometry): * fvwm/geometry.c (get_title_geometry) * fvwm/geometry.c (get_unshaded_geometry): * fvwm/geometry.c (get_visible_window_or_icon_geometry) * fvwm/geometry.c (gravity_constrain_size): * fvwm/geometry.c (maximize_adjust_offset): * fvwm/geometry.c (update_absolute_geometry): * fvwm/geometry.c (update_relative_geometry) * fvwm/gnome.c (GNOME_SetWinArea): * fvwm/icons.c (AutoPlaceIcon): * fvwm/icons.c (DeIconify): * fvwm/icons.c (Iconify): * fvwm/module_interface.c (CONFIGARGS): * fvwm/move_resize.c (AnimatedMoveAnyWindow) * fvwm/move_resize.c (CMD_Maximize): * fvwm/move_resize.c (CMD_ResizeMaximize): * fvwm/move_resize.c (CMD_ResizeMoveMaximize): * fvwm/move_resize.c (__move_loop): * fvwm/move_resize.c (__move_window): * fvwm/move_resize.c (__resize_window): * fvwm/move_resize.c (maximize_fvwm_window): * fvwm/move_resize.c (resize_move_window): * fvwm/move_resize.c (stick_across_pages): * fvwm/move_resize.c (unmaximize_fvwm_window): * fvwm/placement.c (__explain_placement): * fvwm/placement.c (__place_get_wm_pos): * fvwm/placement.c (get_next_x): * fvwm/placement.c (get_next_y): * fvwm/placement.c (test_fit) * fvwm/session.c (MatchWinToSM): * fvwm/session.c (SaveWindowStates): * fvwm/update.c (apply_window_updates): * fvwm/virtual.c (MoveViewport): * fvwm/windowlist.c (CMD_WindowList): * fvwm/windowshade.c (CMD_WindowShade): put some of the window geometry members into a separate struct window_g with members frame, normal, max, max_defect, max_offset 2006-12-21 Viktor Griph * NEWS: * AUTHORS: * fvwm/window_flags.h: * fvwm/style.h: * fvwm/style.c (style_parse_one_style_option): * fvwm/icons.c (DrawIconTitleWindow): * fvwm/fvwm.h (common_flags_t): * fvwm/fvwm.1.in (Style): * fvwm/borders.c: (border_draw_title_stick_lines): Applied Stippled patch by Thomas Adam with some fixes. 2006-12-10 Viktor Griph * NEWS: FvwmWinList button/list syncronization fixed (bug #1393) 2006-12-09 Viktor Griph * NEWS: * configure.ac: updated for 2.5.20. * NEWS: * configure.ac: updated for 2.5.19 release * NEWS: updated after 2.4.20 release * NEWS: * fvwm/focus.c (focus_get_fpol_context_flag): * fvwm/events.c (__check_click_to_focus_or_raise) (__handle_click_to_focus): Treat EWMH desktop as client window under click to focus. (#1492) 2006-12-08 Viktor Griph * libs/Module.h (MX_REPLY): (MAX_EXTENDED_MESSAGES): (MAX_XMSG_MASK): * fvwm/module_interface.c (CMD_Send_Reply): * fvwm/functable.c (func_table): * fvwm/commands.h: Added Send_Reply module only command. 2006-11-26 Viktor Griph * libs/PictureUtils.c (init_static_colors_table): fix fvwm for < 8 bit depth, bug #1677 2006-11-20 Viktor Griph * fvwm/misc.c (IsRectangleOnThisPage): new fix for signedness problems. 2006-10-13 Viktor Griph * fvwm/misc.c (IsRectangleOnThisPage): fix signedness problem with test introduced by gcc4 fix below. 2006-09-19 Viktor Griph * libs/fvwmrect.h (fvwmrect_subtract_rectangles): (size_rect): (rectangle) (signed_rectangle): * libs/fvwmrect.c (fvwmrect_subtract_rectangles): * libs/gravity.h (gravity_move_resize_parent_child): * libs/gravity.c (gravity_move_resize_parent_child): * fvwm/frame.h (frame_get_titlebar_dimensions) * fvwm/frame.c (frame_get_titlebar_dimensions_only) (frame_get_resize_decor_gravities): (mr_args_internal): (frame_setup_border): (frame_setup_titlebar) (frame_get_resize_decor_gravities): (frame_get_titlebar_dimensions): split rectangle into a signed size and an unsigned size type. * fvwm/screen.h (ScreenInfo): * libs/FScreen.h (FScreenGetScrRect): (FScreenGetResistanceRect): * libs/FScreen.c (XineramaScreenInfo): (FScreenGetGeometry) (FScreenGetScrRect): (FScreenClipToScreen): (FScreenCenterOnScreen) (FScreenGetResistanceRect): (FScreenIsRectangleOnScreen): * fvwm/fvwm.h (FvwmWindow): * fvwm/screen.h (DecorFace): * libs/fvwmlib.h (CreateGradientPixmap): * libs/Graphics.c (CreateGradientPixmap): * libs/PictureUtils.h (PictureCloseImageColorAllocator): * libs/PictureUtils.c (PictureCloseImageColorAllocator): * libs/PictureImageLoader.h (PImageCreatePixmapFromArgbData) (PImageLoadPixmapFromFile): (PImageLoadPixmapFromXpmData): * libs/PictureImageLoader.c (FIMAGE_CMD_ARGS) (PImageCreatePixmapFromArgbData): (PImageLoadPixmapFromFile) (PImageLoadFvwmPictureFromFile): (PImageLoadPixmapFromXpmData): * libs/PictureGraphics.c (PGraphicsRenderPixmaps): * fvwm/ewmh_icons.c (EWMH_DeleteWmIcon): (EWMH_SetIconFromWMIcon): * fvwm/ewmh.h (EWMH_GetWorkAreaIntersection): * fvwm/ewmh.c (EWMH_GetWorkAreaIntersection): * fvwm/colorset.c (parse_colorset): * fvwm/icons.c (DrawIconTitleWindow): (AutoPlaceIcon) (do_all_iconboxes): * fvwm/menus.h (MenuRootDynamic): * fvwm/menus.c (update_menu): (pop_menu_up): (do_menu) (get_menu_options): * fvwm/move_resize.c (GetMoveArguments): (ParseOneResizeArgument) (GetResizeArguments): (GetResizeMoveArguments): (DoSnapAttract) (__move_loop): (CMD_Maximize): change dimensions and allocation counts to unsigned types. * libs/Flocale.h (FlocaleStringNumberOfBytes) (FlocaleStringByteToCharOffset): (FlocaleStringCharToByteOffset) (FlocaleStringCharLength) * libs/Flocale.c (FlocaleStringNumberOfBytes) (FlocaleStringByteToCharOffset): (FlocaleStringCharToByteOffset) (FlocaleStringCharLength): (FlocaleUtf8ToUnicodeStr2b) (FlocaleStringToString2b): (FlocaleEncodeString): * libs/Ficonv.c (convert_charsets): change most string types to char* from unsigned char* to match with system headers without casts. * libs/Flocale.c (FlocaleLoadFont): init shadow_dir to make gcc 4 happy. * libs/Colorset.h (CSETS_IS_TRANSPARENT_PR_TINT) (CSETS_IS_TRANSPARENT_ROOT_TRAN): (CSETS_IS_TRANSPARENT_ROOT_PURE) (CSETS_IS_TRANSPARENT_PR_PURE): (CSETS_IS_TRANSPARENT_ROOT) (CSETS_IS_TRANSPARENT): compare pointer with NULL, not >= 0. * libs/FTips.h (ftips_position_t): * fvwm/expand.c (partial_extended_vars): * fvwm/placement.c (preason_screen_t): remove comma last in enums. * fvwm/style.c (style_parse_focus_policy_style): change 0xffffffff to ~0 to silience truncation warning. * fvwm/session.h (mwtsm_state_args): make flags unsigned. * fvwm/schedule.c (sq_object_type): change // to /* ... */ * libs/Fft.c (FftGetFontWidths): (FftTextWidth): * libs/FScreen.c (FScreenConfigureSLSScreens): * fvwm/ewmh_names.c (EWMH_SetVisibleName): (EWMH_SetDesktopNames): * fvwm/fvwm.c (LoadDefaultLeftButton): (LoadDefaultRightButton): * fvwm/builtins.c (ReadDecorFace): (CMD_State): silence signedness warnings by casts. * fvwm/borders.c (ROTATE_RECTANGLE): make sure tr is initialized. * fvwm/add_window.c (FetchWmProtocols): use unsigned type for l_protocols. 2006-09-17 Viktor Griph * fvwm/events.c (HandleFocusIn): (HandleFocusOut): * fvwm/focus.c (__set_focus_to_fwin): fix focus decoration when unmanaged are focused, unless FlickeringQtDialogsWorkaround is on. Closes bug #758. 2006-09-15 Dominik Vogt * fvwm/geometry.c (constrain_size): repeat aspect-resizing in a loop to get a stable result that does not change the next time the frame is set up 2006-09-11 Dominik Vogt * NEWS: * configure.ac: increased version to 2.5.19 released 2.5.18 * NEWS: * configure.ac: updated for 2.5.18 release 2006-09-04 Renato Caldas * acinclude.m4: removed the unused test for imlib removed the Imlib.h header from gdk_imlib test programs 2006-08-31 Dominik Vogt * fvwm/ewmh.c (atom_get): fix offset and length args for XGetWindowProperty() (to support 64bit architectures) 2006-08-30 Dominik Vogt * fvwm/events.c (HandleUnmapNotify): immediately handle MapRequests after unmapping a window while we still have the context fvwm window; this is necessary to allow the client to re-map a window before fvwm can reparent it to the root window (HandleMapRequestKeepRaised): cleaned up 2006-08-29 Dominik Vogt * fvwm/ewmh.c (ewmh_HandleDesktop): fixed handling of ClickToFocusPassesClick with the EWMH desktop window 2006-08-29 Harald Dunkel * fvwm/icccm2.c: * fvwm/gnome.c: * fvwm/decorations.c: fix offset and length args for XGetWindowProperty() (to support 64bit architectures) 2006-08-26 Viktor Griph * NEWS: * fvwm/expand.c (expand_vars_extended): correctly expand break. * fvwm/conditional.c (__rc_matches_rcstring_consume): fix matching break. 2006-08-26 Viktor Griph * fvwm/decorations.h (is_function_allowed): * fvwm/decorations.c (__is_resize_allowed): (is_function_allowed): work on 'const FvwmWindow *' * fvwm/fvwm.h (action_flags): * fvwm/style.c (check_window_style_change): * fvwm/module_interface.c (__get_allowed_actions) (CONFIGARGS): * libs/vpacket.h (ConfigWinPacket): expose fvwm allowed actions to modules 2006-08-09 Dominik Vogt * fvwm/move_resize.c (__move_icon): *do* map icon windows for pictured icons on move, but only if they end up on the current desk 2006-08-09 Viktor Griph * fvwm/move_resize.c (__move_icon): don't map icon windows for pictured icons on move 2006-08-09 Dominik Vogt * fvwm/style.c (remove_all_of_style_from_list): (__simplify_style_list): (blockor): (blockand): (blockunmask) (blockissubset): (style_ids_are_equal): (style_id_equals_id) (styles_have_same_id): (fw_match_style_id) (one_fw_can_match_both_ids): (check_window_style_change): use int/0/1 instead of Bool/False/True * fvwm/move_resize.c (stick_across_pages): use False instead of FALSE * fvwm/style.c (fw_match_style_id): * fvwm/read.c (run_command_file): (push_read_file): * fvwm/add_window.c (MappedNotOverride): * libs/wild.c (matchWildcards): use 0 and 1 instead of FALSE and TRUE * fvwm/fvwm.h: removed TRUE and FALSE 2006-08-07 Viktor Griph * NEWS: FvwmPager !IconTitle style bugfix. 2006-07-31 Scott Smedley * fvwm/fvwm.1.in: Updated description of Wait command in man page. 2006-07-29 Dominik Vogt * libs/Flocale.c (FlocaleFontStructDrawString) (FlocaleRotateDrawString): (FlocaleDrawString): fixed drawing of forecolor/hilightfore * fvwm/ewmh_events.c (ewmh_WMStateFullScreen): always unmaximize and resize window when leaving fullscreen state, not just if it did not start as fullscreen 2006-07-17 Renato Caldas * fvwm/fvwm.1.in (MenuStyle): added a reference to the prefered ! style negation flag, and listed the other deprecated negative forms in one place. (ActiveForeOff): (AnimationOff): (AutomaticHotkeysOff): (HilightBackOff): (TitleWarpOff): changed to the ! negation form and listed as deprecated. (ActiveBack): removed relics from the man page 2006-07-19 Dominik Vogt * NEWS: * configure.ac: increased version to 2.5.18 released 2.5.17 * NEWS: * configure.ac: updated for 2.5.17 release 2006-07-17 Dominik Vogt * fvwm/move_resize.c (__move_window): allow moving a window without an icon while it's iconified based on the frame geometry 2006-07-17 Serge Koksharov * fvwm/menustyle.c (menustyle_copy): Now 'TitleColorset' also copied by 'CopyMenuStyle' command. 2006-07-17 Renato Caldas * fvwm/fvwm.1.in: NoTitle, StippledTitleOff, NoHandles, NoButton, NoIconTitle styles changed the manpage to reflect the prefered style negation method, that is, using the !* negation sign. 2006-07-16 Viktor Griph * fvwm/fvwm.1.in (COMMAND EXPANSION): removed documentation of filters. * NEWS: * fvwm/expand.c (check_first_filter): (apply_filters) (expand_args_extended): (expand_vars_extended): (expand_vars): removed variable filter implementation and backslash-escaping. 2006-07-15 Viktor Griph * NEWS: News blurb for variable filters and backslash-escaping. * fvwm/fvwm.1.in: documentation of variable filters. 2006-07-14 Viktor Griph * fvwm/expand.c (chec): (first_filter): (apply_filters) (expand_args_extended): (expand_vars_extended): (expand_vars): implemented variable filters. * fvwm/expand.c (expand_vars): made backslash work as escape character within extended variables. * libs/Strings.h (QuoteEscapeString): (QuoteEscapeStringLength): * libs/Strings.c (QuoteEscapeString): (QuoteEscapeStringLength): new functions: QuoteEscapeString and QuoteEscapeStringLength for generic quoting. * fvwm/expand.c (expand_args_extended): make upper limit inclusive. * fvwm/functions.c (__execute_function): Changed PeekToken to GetNextToken before expand_vars call. * fvwm/fvwm.1.in: updated documentation regarding quoting in expand_args_extended 2006-07-14 Dominik Vogt * fvwm/expand.c (__eae_parse_range): reject everything that does not begin with a digit * libs/Parse.c (SkipNTokens): stop skipping tokens at the end of input * fvwm/expand.c (__eae_parse_range): bugfixes (expand_vars): reformatted (__eae_parse_range): fixed parsing of $[n-] 2006-07-13 Dominik Vogt * fvwm/expand.c (expand_args_extended): fixed core dump added range check for positional parameters (expand_args_extended): (__eae_parse_range): cleaned up and simplified parsing code properly unquote arguments when expanding removed the patch below 2006-07-13 Viktor Griph * fvwm/expand.c (expand_args_extended): removed range check for positional parameters make single arguments not use the 'upper' variable changed back to PeekToken for single arguemnts. improved some comments. 2006-07-13 Viktor Griph * fvwm/expand.c (expand_args_extended): Fix segfault when called with a tokenless string for single arguments. 2006-07-12 Scott Smedley * docs/FAQ: Usage of FvwmAuto module in FAQ 7.17 was incorrect. Reported by Serge Koksharov. 2006-07-12 Dominik Vogt * fvwm/placement.c (__explain_placement): print initial size of window too * libs/Makefile.am (libfvwm_a_SOURCES): * libs/fvwm_sys_stat.h: added compat file * configure.ac: added O_NOFOLLOW replacement and always include fcntl.h 2006-07-12 Scott Smedley * libs/Parse.c: Added DV's mailing-list comments about how PeekToken & GetNextToken work as comments to the source code. (slightly modified) 2006-07-11 Dominik Vogt * fvwm/schedule.c (CMD_Schedule): Fixed parsing of "Periodic" option. 2006-07-11 Viktor Griph * NEWS: Fix for tempfile vulnerabilities in FvwmCommand. * configure.ac: Added check for lstat. 2006-07-12 Scott Smedley * fvwm/schedule.c: * NEWS: * AUTHORS: * fvwm/fvwm.1.in: Added "Periodic" option to Schedule command. 2006-07-11 Dominik Vogt * fvwm/module_interface.c (KillModule): (ClosePipes): fixed KillModule 2006-07-09 Renato Caldas * fvwm/fvwm.c (main): changed the -blackout warning to say it will be removed in 3.0 * fvwm/fvwm.1.in (-blackout): updated the manual regarding the future remotion of -blackout 2006-07-08 Viktor Griph * NEWS: * configure.ac: added $EXEEXT to FvwmGtk in order to compile on Cygwin (bug #3772). 2006-07-08 Renato Caldas *libs/alloca.c (DEBUG_I00FUNC) removed old debug code 2006-07-07 Renato Caldas * libs/debug.c: removed the old unused file * libs/Makefile.am (libfvwm_a_SOURCES): removed the reference to debug.c * libs/fvwmlib.h: removed the code related to libs/debug.c * fvwm/module_interface.c (make_named_packet) removed the #if 0'ed debug code related to debug.c fvwm/focus.h (DEBUG_FOCUS) removed the #ifdef'ed to 0 debug code related to debug.c 2006-07-06 Renato Caldas * libs/PictureUtils.c (PICTURE_DEBUG_COLORS_ALLOC_FAILURE): removed useles definition. * modules/FvwmPager/FvwmPager.c (main): (ParseOptions): removed most of the debug code. changed termination debug to use 'isTerminated' instead of 'debug_term_signal'. changed termination debug to compile on FVWM_DEBUG_MSGS instead of DEBUG. * libs/fvwmsignal.h (FVWM_DEBUG_MSGS): * libs/fvwmsignal.c (FVWM_DEBUG_MSGS): (fvwmSetTerminate): removed unused debug_term_signal. 2006-07-05 Viktor Griph * NEWS: Work around for Cygwin not requiering '_GNU_SOURCE' to use stdio's getline; news entry. 2006-06-24 Dominik Vogt * fvwm/commands.h: * fvwm/module_interface.c (CMD_ModuleListenOnly): (do_execute_module): (PositiveWrite): (ClosePipes): (KillModule): * fvwm/commands.h (enum): * fvwm/functable.c (func_table): new command ModuleListenOnly 2006-06-15 Dominik Vogt * fvwm/move_resize.c (__move_loop): make sure a window is snapped in __move_loop when a button is released if it was snapped before 2006-06-04 Mikhael Goikhman * fvwm/expand.c (expand_vars_extended): convert function to have a single return point; this is good to implement doc/todo-vars filters in the future; fix $[w.name], $[w.iconname], $[w.class] and $[w.resource] to behave like deprecated $n, $c and $r, i.e. quote them 2006-06-03 Mikhael Goikhman * fvwm/expand.c: multiple minor tweaks: remove trailing spaces and other re-spacing and re-indenting, remove old "#if 0" code 2006-06-02 Dominik Vogt * fvwm/move_resize.c (ParseOneResizeArgument): rewrote parsing of resize arguments new prefix 'w' for resizing 2006-05-29 Dominik Vogt * fvwm/conditional.c (MatchesConditionMask): fixed handling of some conditions (iconifiable, fixed, ...) 2005-01-28 Scott Smedley * fvwm/fvwm.1.in: s/reverted/negated/ * fvwm/conditional.c: Output an error message if an unrecognised conditional is used with the Test or TestRc commands. 2006-05-11 Dominik Vogt * fvwm/frame.c (frame_mrs_hide_changing_parts): do not map hide windows if their width or height is zero 2006-05-09 Serge Koksharov * fvwm/ewmh_events.c: * fvwm/fvwm.1.in: * fvwm/gnome.c: * libs/FlocaleCharset.c: corrected typos * libs/Flocale.c: corrected typos in warning messages * libs/Colorset.c: * libs/PictureGraphics.c: * libs/PictureGraphics.h: renamed function PGraphicsCreateTransprency to PGraphicsCreateTransparency 2006-04-17 Viktor Griph * fvwm/fvwm.1.in (COMMAND EXPANSION): * fvwm/expand.c (expand_args_extended): fixed $[n] to work exactly as $n, i.e. dequote the expansion. 2006-04-16 Viktor Griph * NEWS: * fvwm/fvwm.1.in (COMMAND EXPANSION): * fvwm/expand.c (expand_args_extended): (expand_vars): added support for $[n], $[n-m], $[n-] and $[*] variable expansion. * fvwm/conditional.c (CMD_All): * fvwm/fvwm.1.in (All): changed Reverse and UseStack options to have free order. * NEWS: * fvwm/fvwm.1.in (WindowShade): * fvwm/windowshade.c (CMD_WindowShade): * fvwm/add_window.c (setup_window_structure): added last direction to WindowShade command. 2006-04-14 Viktor Griph * fvwm/fvwm.1.in (All): corrected typo 2006-04-13 Viktor Griph * NEWS: * fvwm/fvwm.1.in (All): * fvwm/conditional.c (CMD_All): added reverse option to All command to do the action in opposite order added UseStack option to All command to use the stack ring instead of the window ring. 2006-04-07 Serge Koksharov * bin/fvwm-bug.in: changed fallback editor from `emacs' to `vi' because it much more widespread on non-Linux systems fixed errors (because of incorrect syntax fallback entries were not used) now script honors `TMPDIR' env. variable and if it's not set it fallback to `/tmp' directory when creating temporary file 2006-04-06 Viktor Griph * fvwm/fvwm.1.in: changed description of the fvwmstyle resource usage to state that it's used in addition to the other matches * fvwm/style.c (fw_match_style_id): fixed a typo in style_name matching 2006-04-06 Dominik Vogt * fvwm/style.c (fw_match_style_id): reformatted code and fixed a warning 2006-04-04 Serge Koksharov * ChangeLog: * bin/ChangeLog: * libs/Fft.c (FftGetFont): * libs/System.c: corrected typos * libs/System.c (fvwm_mkstemp): because of typo in the 'ifdef' pragma underlying OS's 'mkstemp' function was never used, even if it was considered secure by configure script. 2006-04-05 Viktor Griph * AUTHORS: added some more suff to the list of what I've done. * NEWS: * fvwm/fvwm.1.in: * fvwm/add_window.c (__add_window_handle_x_resources) (destroy_window): (AddWindow): * fvwm/fvwm.h (FvwmWindow): added fvwmstyle resource to override style name 2006-03-27 Dominik Vogt * fvwm/menus.c (pop_menu_up): as documented, do not warp to title for root menus with TitleWarp 2006-03-21 Serge Koksharov * fvwm/fvwm.1.in: Removed duplicated 'NoIcon' style option description in the end of the `The Style command...' section. Removed `Recapture True' option setting in example of BusyCursor description, because `Recapture' isn't valid option of `BusyCursor' command anymore. Updated ewmh specification URL (the old was 404) Added URL to ICCCM 2.0 manual * modules/FvwmAnimate/FvwmAnimate.c: corrected delay for Zoom3D animation effect * modules/FvwmConsole/FvwmConsoleC.pl.1.in: * modules/FvwmConsole/FvwmConsole.1.in: replaced all `Cntl' modificator key mentions with `Ctrl' to be consistent with rest of the documentation and because it's more conventional abbreviation. * modules/FvwmTaskBar/FvwmTaskBar.1.in: slightly clarified the `StartName' option description added the undocumented `MailDir' option description. Somebody violated section `K' of the convention list. * fvwm/fvwm.1.in: * fvwm/ConfigFvwmSetup: * modules/FvwmForm/FvwmForm.1.in: * modules/FvwmForm/FvwmForm-Rlogin: * sample.fvwmrc/system.fvwm2rc: * sample.fvwmrc/system.fvwm2rc-sample-1: replaced all mentions of `rsh' with `ssh'. rsh is obsolete and inherently insecure. We shouldn't teach our users bad things, should we? * AUTHORS: * Changelog: * INSTALL.fvwm: * NEWS: * bin/fvwm-config.1.in: * bin/fvwm-menu-headlines.1: * bin/fvwm-menu-headlines.in: * bin/fvwm-perllib.in: * bin/fvwm-root.1.in: * docs/CONVENTIONS: * docs/FAQ: * fvwm/fvwm.1.in: * fvwm/fvwm.h: * fvwm/virtual.c: * libs/PictureGraphics.c: * libs/Picture.h: * modules/FvwmBacker/FvwmBacker.1.in: * modules/FvwmDebug/FvwmGtkDebug.in: * modules/FvwmDebug/FvwmGtkDebug.1: * modules/FvwmEvent/FvwmEvent.1.in: * modules/FvwmForm/FvwmForm.1.in: * modules/FvwmIconMan/xmanager.c: * modules/FvwmIdent/FvwmIdent.c: * modules/FvwmIdent/FvwmIdent.1.in: * modules/FvwmPerl/FvwmPerl.in: * modules/FvwmPerl/FvwmPerl.1: * modules/FvwmScript/FvwmScript.1.in: * modules/FvwmScript/Widgets/Menu.c: * modules/FvwmTabs/ConfigFvwmTabs: * modules/FvwmTabs/FvwmTabs-DefaultSetup: * modules/FvwmTaskBar/FvwmTaskBar.1.in: * modules/FvwmTheme/FvwmTheme.1.in: * perllib/FVWM/Module/Tk.pm: * perllib/FVWM/Tracker.pm: * perllib/FVWM/Module.pm.in: corrected typos 2006-03-21 Viktor Griph * fvwm/style.c (style_parse_focus_policy_style): fix ISO C90 compability with unconsumed styleoption warnings 2006-03-20 Viktor Griph * fvwm/events.c (HandlePropertyNotify): fix for bug 1557/3950 (possible free of Untilted constant or already used name (if app reset the name already given to them)) 2006-03-07 Dominik Vogt * fvwm/focus.c (__activate_window_by_command) (warp_to_fvwm_window): (CMD_WarpToWindow): * fvwm/builtins.c (CMD_CursorMove): set last pointer event position after warping the pointer * libs/FEvent.h: * libs/FEvent.c (FWarpPointerUpdateEvpos): new function 2006-03-02 Dominik Vogt * acinclude.m4 (AM_PATH_GTK): (AM_PATH_IMLIB): (AM_PATH_GDK_IMLIB): (AM_CHECK_FT2): (AM_CHECK_XFT): (AM_CHECK_FC): fixed to cope with 4 digit version numbers 2006-02-15 Viktor Griph * NEWS: * fvwm/style.c (parse_and_set_window_style) (style_parse_one_style_option): (style_parse_icon_fill_style) (style_parse_icon_grid_style): (style_parse_icon_box_style) (style_parse_icon_size_style): (style_parse_focus_policy_style) (style_parse_button_style): warn if parts of style options are not consumed 2006-02-15 Dominik Vogt * fvwm/menuitem.c (menuitem_paint): use the MenuColorset in all cases if TitleColorset is not given 2006-02-11 Dominik Vogt * fvwm/style.c (style_parse_one_style_option): * fvwm/placement.c (__place_get_wm_pos): (__explain_placement): new placement style UnderMousePlacement 2006-02-11 Viktor Griph * NEWS: * fvwm/fvwm.1.in (EdgeScroll): * fvwm/virtual.c (CMD_EdgeScroll): fixed EdgeScroll dividing pixel sizes by 1000 if > 1000 (bug 3162) added wrap/wrapx/wrapy option to EdgeScroll 2006-02-10 Mikhael Goikhman * fvwm/fvwm.1.in: spell check the whole file (dozens of typos) 2006-02-10 Dominik Vogt * fvwm/module_interface.c (do_execute_module): removed accidentally committed FVWM_MODULE_ALIAS patch 2006-02-09 Dominik Vogt * fvwm/module_interface.c (do_execute_module): unset envvars FVWM_VISUALID and FVWM_COLORMAP if they are not needed * fvwm/menus.c (size_menu_horizontally): fix for drawing menus with sidepic on the right * libs/Flocale.c (FlocaleFontStructDrawString): (FlocaleDrawString): set the foreground colour before drawing a string * fvwm/menustyle.h: * fvwm/menustyle.c (menustyle_get_styleopt_index): (menustyle_free): (menustyle_update): (menustyle_parse_style): (menustyle_copy): * fvwm/menus.c (calculate_item_sizes): (size_menu_vertically): (UpdateMenuColorset): * fvwm/menuitem.c (menuitem_paint): Applied patch by David Maciver new menu styles TitleColorset, HilightTitleBack and TitleFont 2006-02-09 Renato Caldas * libs/Module.h: * libs/Module.c (ParseModuleArgs): added variable "namelen" to ModuleArgs struct 2006-02-02 Dominik Vogt * libs/Module.h: removed duplicate declaration 2006-01-29 Dominik Vogt * fvwm/fvwm.c (main): replaced previous patch with a better one * fvwm/virtual.c (unmap_window): * fvwm/menus.c (do_menu): * fvwm/events.c (fake_map_unmap_notify): (HandleMapNotify): * fvwm/add_window.c (MappedNotOverride): Added XFlush after XSelectInput 2006-01-28 Viktor Griph * NEWS: * fvwm/fvwm.c (main): fix for fvwm not detecting non ICCCM2 wm (bug #3151) 2006-01-20 Dominik Vogt * NEWS: * configure.ac: increased version to 2.5.17 released 2.5.16 * NEWS: * configure.ac: updated for 2.5.16 release * acinclude.m4 (CHECK_LIBCHARSET): removed debug code 2006-01-19 Dominik Vogt * fvwm/functions.c (execute_complex_function): print a message to the console instead of ringing the bell when a grab fails 2006-01-14 Viktor Griph * NEWS: fixed typo (NEWS still said 2.5.15) 2006-01-14 Dominik Vogt * NEWS: * configure.ac: increased version to 2.5.16 released 2.5.15 * NEWS: * configure.ac: updated for 2.5.15 release 2006-01-13 Dominik Vogt * fvwm/move_resize.c (GetOnePositionArgument): (GetMoveArguments): new option "screen" to Move type commands 2006-01-08 Dominik Vogt * acinclude.m4 (smr_SWITCH): updated 2006-01-08 Mikhael Goikhman * Makefile.am restore requirement of automake-1.4; 1.8 is too new even for my system 2006-01-07 Dominik Vogt * configure.in: * configure.ac: renamed configure.in to configure.ac * acinclude.m4: some updates for new autoconf/automake versions * configure.in: * acconfig.h: removed acconfig.h * configure.in: require autoconf-2.53 or later * Makefile.am (AUTOMAKE_OPTIONS): require automake-1.8 or later * configure.in: check for X library path before X library checks removed obsolete C++ compiler check removed duplicate type size checks replaced M4 comment ("dnl") with shell comment ("#") in many places * acinclude.m4: fixed aclocal warnings 2006-01-01 Viktor Griph * fvwm/style.c (style_parse_button_style): corrected typo in error message, and made errorous buttons not apply (style_parse_one_style_option): changed NoButton to use style_parse_button_style 2005-12-23 Viktor Griph * libs/Fft.h: new fix for incompatible pointer type warning with gcc 3.4. 2005-12-21 Viktor Griph * NEWS: * AUTHORS: * fvwm/menuitem.c: * fvwm/menustyle.h: * fvwm/fvwm.1.in: commited patch by Malcolm Still adding TrianglesUseFore MenuStyle option. 2005-12-07 Dominik Vogt * fvwm/fvwm.1.in: corrected typos 2005-11-27 Dominik Vogt * fvwm/frame.c (frame_free_move_resize_args): fixed drawing of transparent decorations or when using lazy shading during resize 2005-11-26 Dominik Vogt * configure.in: * libs/fvwmsignal.c: * libs/Graphics.c: c89 fixes * fvwm/ewmh_names.c: * libs/CombineChars.c: * libs/FGettext.c: * libs/FScreen.c: * libs/FTips.c: * libs/Flocale.c: * libs/Parse.c: * libs/PictureUtils.c: * libs/System.c: * libs/XError.c: * libs/alloca.c: * libs/envvar.c: * libs/safemalloc.c: * libs/strdup.c: * libs/usleep.c: do not #include stdlib.h (comes from config.h) * libs/Flocale.c: do not #include string.h (comes from config.h) * acconfig.h: fixed detection of string.h/strings.h 2005-11-26 Viktor Griph * libs/Fft.c (FftGetFont): fixed compiler warning with gcc 3.4.4 2005-11-25 Dominik Vogt * fvwm/menuitem.c (menuitem_paint): properly undraw unselected item area 2005-11-25 Dominik Vogt * fvwm/menuitem.c (menuitem_paint): * fvwm/menus.c (get_menu_paint_item_parameters) (get_menu_paint_item_parameters): (make_menu): fixed text offset of menu items with icons but with an item format that disables icons (size_menu_horizontally): allow sidepic to be placed in the middle of menu items; this is better than ignoring the item format completely but does not draw the items properly either * fvwm/menus.c (__mloop_handle_event): (menu_expose): fixed delayed menu drawing issue (select_menu_item): do not draw the selected menu item before the menu is drawn for the first time (repaint_transparent_menu): (select_menu_item): (paint_menu): don't call get_menu_paint_item_parameters when the result is not used (get_menu_paint_item_parameters): 2005-11-10 Viktor Griph * fvwm/ewmh.h (EWMH_CMD_Style): * fvwm/ewmh_conf.c (EWMH_CMD_Style): * fvwm/style.c (style_parse_one_style_option): Added support for inverting boolean EWMH styles with !. * NEWS: * fvwm/fvwm.h * fvwm/style.h: * fvwm/window_flags.h: * fvwm/ewmh_conf.c (EWMH_CMD_Style): * fvwm/ewmh.c (ewmh_HandleWindowType): * fvwm/fvwm.1.in: Added style EWMHIgnoreWindowType to make fvwm ignore window types. 2005-10-29 Dominik Vogt * fvwm/icons.c (GetIconWindow): * fvwm/fvwm.h (FvwmWindow): * fvwm/events.c (__handle_cr_on_icon): properly handle icon border width; fixes an xterm active icon loop 2005-10-27 Viktor Griph * fvwm/borders.c (border_draw_one_border_part): fix for the TiledPixmap borderstyle fix not to affect RootTransparent borders. 2005-10-25 Dominik Vogt * fvwm/menustyle.c (menustyle_copy_face): (menustyle_copy): (menustyle_free_face): (menustyle_free): (menustyle_parse_style): use new functions and fix a bug * fvwm/Makefile.am: * fvwm/colors.c: * fvwm/colors.h: removed empty files colors.c and colors.h * fvwm/colors.c (CopyColor): (FreeColors): moved to libs/ColorUtils.c and renamed to fvwmlib_free_colors and fvwmlib_copy_color * fvwm/frame.c (frame_reshape_border): removed unused code 2005-10-23 Viktor Griph * fvwm/menustyle.c (menustyle_copy_face): separated from menustyle_copy; color copies are reallocated. (menustyle_free): all colors freed (menustyle_copy): color copies are reallocated. * fvwm/colors.c (CopyColor): * fvwm/colors.h (CopyColor): added CopyColor 2005-10-20 Viktor Griph * fvwm/move_resize.c (__resize_window): fix for not being able to finish resize with mouse when resizing on click with modifiers active. (intruduced with 'removed duplicate pointer query' at sep 29) * NEWS: * fvwm/fvwm.1.in: * fvwm/menustyle.c (menustyle_parse_style): made style pairs negatable with '!' prefix ActiveForeOff and HilightBackOff frees colors used. * fvwm/menustyle.c (menustyle_copy): fix for freeing color from sorce instead of destination. 2005-10-19 Viktor Griph * fvwm/functions.c (__execute_function): fixed an error in yesterdays patch to complex fuctions. the commands pressed window were not retored correctly after running move functions without it, and functions would be run twice. 2005-10-18 Viktor Griph * fvwm/fvwm.1.in: added NoLayer to list of allowed options for WindowList command fixed grammar of test-conditions list. formatting fixes for MoveToPage command. Added CirculateSkipIcon / CirculateHitIcon to style option list. * NEWS: * fvwm/functions.c (__execute_function) (__run_complex_function_items): (execute_complex_function): fix for moving/resizing reference window usage with complex functions. 2005-10-16 Viktor Griph * fvwm/move_resize.c (__move_loop): reimplemented a fix for the place with keyboard setting a button as used for place bug; this time without breaking escape key. 2005-10-15 Dominik Vogt * fvwm/move_resize.c (__move_loop): removed the previous patch as it breaks aborting window motion with the escape key. 2005-10-03 Viktor Griph * fvwm/move_resize.c (__move_loop): fixed bug where finishing movment with keyboard would set a random button as used for placement. 2005-09-30 Viktor Griph * NEWS * fvwm/frame.c (frame_setup_border): reverted change for move of window parts (reset of PressedW). 2005-09-29 Dominik Vogt * fvwm/frame.c (frame_setup_border): fixed a Warning 2005-09-29 Viktor Griph * NEWS: * fvwm/move_resize.c (__resize_window): removed duplicate pointer query for enter/leave notify events. resizing of shaded windows in the shaded direction no longer results in bogus ref points. * fvwm/frame.c (frame_setup_border): reset PressedW if the part has moved. This prevents strange ref points in resize if called from some complex functions. * fvwm/frame.c (frame_create_move_resize_args): shaded windows use get_client_geometry for client geometry. 2005-09-25 Viktor Griph * NEWS: * AUTHORS: * fvwm/fvwm.h (window_flags): (WindowConditionMask): (FvwmWindow): * fvwm/window_flags.h (IS_PLACED_BY_WB3): (SET_PLACED_WB3) (SETM_PLACED_WB3): * fvwm/session.c (_match): (SaveWindowStates): (LoadWindowStates): * fvwm/conditional.c (MatchesConditionMask): (CreateConditionMask): * fvwm/add_window.c (setup_window_structure): * fvwm/move_resize.h (placement_binding): * fvwm/move_resize.c (__move_loop): (placement_binding): * fvwm/bindings.c (ParseBinding): * libs/wcontext.c (win_contexts): * libs/wcontext.h (enum): * fvwm/fvwm.1.in: Added placement context for simple mouse bindings to allow specification of buttons to finish/cancel movment. Buttons >3 may now be used to place windows. Replaced window flag placed_wb3 with placed_by_button FvwmWindow member. Added window condition PlacedByButton. 2005-09-22 Viktor Griph * NEWS: * AUTHORS: * fvwm/menustyle.h (enum): (MenuFeel): (ST_DO_SCROLL): (MST_DO_SCROLL) (ST_SCROLL_OFF_PAGE): (MST_SCROLL_OFF_PAGE): * fvwm/menustyle.c (menustyle_copy): (menustyle_get_styleopt_index): (menustyle_parse_style): (CMD_MenuStyle): * fvwm/menus.c (menuShortcuts): (enum): (__mloop_handle_event): (menu_get_outer_geometry): (move_any_menu): * fvwm/fvwm.1.in: added MouseWheel and ScrollOffPage menu styles 2005-09-20 Viktor Griph * NEWS: * fvwm/menus.c (append_item_to_menu): fixed bug #1121: Use of pointer without checking for NULL 2005-09-19 Mikhael Goikhman * NEWS: * fvwm/expand.c (expand_vars): warn on usage of obsolete one-letter variables 2005-09-19 Viktor Griph * NEWS: * AUTHORS: * fvwm/expand.c (expand_vars_extended): (expand_vars): allow nesting of variables 2005-09-18 Dominik Vogt * fvwm/ewmh.c (EWMH_SetWMDesktop): * fvwm/ewmh_events.c (ewmh_WMDesktop): (ewmh_WMDesktop): 64-bit fixes 2005-09-03 Mikhael Goikhman * fvwm/borders.c (border_draw_one_border_part) (border_draw_all_border_parts): fix the previous patch to work with title-less windows too 2005-08-30 Mikhael Goikhman * fvwm/borders.c (border_draw_one_border_part) (border_draw_all_border_parts): improve offsets when drawing borders for "BorderStyle TiledPixmap" windows to make the borders look homogeneous (based on the patch of Evgeny Stambulchik) 2005-08-26 Mikhael Goikhman * NEWS: * acconfig.h: * configure.in: * libs/FBidi.c: support new spelling FRIBIDI_CHAR_SET_NOT_FOUND introduced in fribidi-0.10.5; autodetect old spelling FRIBIDI_CHARSET_NOT_FOUND 2005-08-24 Dominik Vogt * NEWS: * configure.in: increased version to 2.5.15 released 2.5.14 * NEWS: * configure.in: updated for 2.5.14 release * fvwm/ewmh_events.c (ewmh_WMStateShaded) (ewmh_WMStateSkipTaskBar): (ewmh_WMStateSkipPager): (ewmh_WMStateModal): fixed several ewmh-hints 2005-08-24 Mikhael Goikhman * fvwm/fvwm.1.in: fix TestRc example error, s/Any/All/ 2005-08-17 Jonathan Kotta * NEWS: * AUTHORS: * fvwm/fvwm.1.in: * fvwm/conditions.c (MatchesConditionMask): (CreateConditionMask): added FixedPosition condition 2005-08-15 Dominik Vogt * fvwm/virtual.c (HandlePaging): use FQueryPointer every time to track the pointer position; this fixes fvwm hanging in HandlePaging for the given delay once the pointer touches the pan frames 2005-08-13 Dominik Vogt * fvwm/session.c (SaveWindowStates): (LoadWindowStates): (MatchWinToSM): save and restore the default layer during a restart 2005-08-13 Mikhael Goikhman * fvwm/conditional.c (CMD_Test): * fvwm/fvwm.1.in: rename previously added Test conditions to EnvIsSet and EnvMatch, tweak the logic when the variable is set, but empty 2005-08-13 Viktor Griph * fvwm/conditional.c (CMD_Test): * fvwm/fvwm.1.in: added test conditions EdgeHasPointer and EdgeIsActive 2005-08-12 Dominik Vogt * fvwm/virtual.c (raisePanFrames): prevent cycling of pan frame window stacking order 2005-08-12 Mikhael Goikhman * fvwm/conditional.c (CMD_Test): * fvwm/fvwm.1.in: add Test conditions IsEnvSet and MatchEnv 2005-08-07 Dominik Vogt * fvwm/menus.c (pop_menu_up): * fvwm/menustyle.c (menustyle_copy): two fixes by Viktor Griph * fvwm/events.c (HandleEvents): simplify the style list if there is nothing else to do * fvwm/style.c (__simplify_style_list): (styles_have_same_id): (style_id_equals_id): (style_ids_are_equals): (__style_command): (remove_all_of_style_from_list): (one_fw_can_match_both_ids): pass pointers instead of the whole style structure (__simplify_style_list): fixed memory leak and tweaked the code * libs/Strings.c (CatString3): fixed a buffer overflow 2005-08-04 Dominik Vogt * configure.in: detect if Window, Pixel or void * are bigger than long and refuse to compile * libs/vpacket.h (ConfigWinPacket): * fvwm/windowshade.c (CMD_WindowShade): * fvwm/virtual.c (MoveViewport): (goto_desk): (CMD_DesktopSize): (CMD_GotoDeskAndPage): * fvwm/update.c (apply_window_updates): * fvwm/stack.c (BroadcastRestack): (RaiseWindow): (LowerWindow): * fvwm/icons.c (DeIconify): (Iconify): * fvwm/geometry.c (broadcast_icon_geometry): * fvwm/events.c (HandleEnterNotify): (HandleFocusIn): (HandleLeaveNotify): (HandleMapNotify): (HandleMapRequestKeepRaised): * fvwm/add_window.c (destroy_window): * fvwm/module_interface.c (SendFvwmPicture) (BroadcastFvwmPicture): (CMD_Send_WindowList): * fvwm/modconf.c (CMD_Send_ConfigInfo): * fvwm/ewmh_events.c (ewmh_WMIconGeometry): 64-bit fixes * fvwm/virtual.c (GetDeskNumber): fixed bug #1396: applied patch by srivasta@debian.org to fix wrapping around the given desk range with a relative desk * fvwm/focus.c (focus_grab_buttons_on_layer): fixed a hang * fvwm/gnome.c: * fvwm/stack.c: * fvwm/ewmh.c: reindented some code and renamed some variables 2005-08-03 Dominik Vogt * fvwm/events.c (__check_click_to_focus_or_raise): small cleanup patch 2005-08-01 Dominik Vogt * FvwmIconMan/xmanager.c (set_win_iconified): fixed select/focus button state lost when deiconifying a window 2005-07-31 Dominik Vogt * fvwm/ewmh_events.c (ewmh_WMIconGeometry): fixed bogus warning * libs/Colorset.c (get_aspect_dimensions): fixed aspectpixmap size calculations 2005-07-30 Dominik Vogt * fvwm/ewmh_events.c (ewmh_WMIconGeometry): fixed a core dump * fvwm/ewmh_events.c (ewmh_WMDesktop): (ewmh_CurrentDesktop): (ewmh_DesktopGeometry): (ewmh_NumberOfDesktops): (ewmh_WMDesktop): (ewmh_WMIconGeometry): * fvwm/gnome.c (GNOME_ProcessClientMessage): print error messages for broken gnome client messages * fvwm/ewmh_events.c (ewmh_DesktopGeometry): removed duplicate call of execute_function_override_window * fvwm/stack.c (new_layer): fixed a hang if a window sets an layer < 0 via gnome hints * fvwm/add_window.c (GetWindowSizeHints): * fvwm/misc.c (fvwm_msg_report_app): (fvwm_msg_report_app_and_workers): new utility functions 2005-07-28 Dominik Vogt * fvwm/stack.c (dump_stack_ring): (verify_stack_ring_consistency): * fvwm/module_interface.c (HandleModuleInput): * fvwm/events.c (__cr_detect_icccm_move): * fvwm/style.c (print_styles): 64-bit fixes 2005-07-19 Mikhael Goikhman * libs/FlocaleCharset.c: support euc-jp encodings (Yasuhiro Nakazaki) 2005-07-18 Dominik Vogt * fvwm/ewmh_events.c (ewmh_WMIconGeometry): * fvwm/ewmh_names.c (EWMH_WMName): (EWMH_WMIconName): * fvwm/ewmh.c (EWMH_SetCurrentDesktop): (EWMH_SetNumberOfDesktops): (EWMH_SetDesktopViewPort): (EWMH_SetDesktopGeometry): (EWMH_SetWMDesktop): (ewmh_SetWorkArea): (EWMH_SetFrameStrut): (EWMH_Init): * fvwm/gnome.c (AtomGet): (atom_size): (GNOME_GetHintIcons): (GNOME_GetHintLayer): (GNOME_GetHintState): (GNOME_GetExpandedSize): (GNOME_SetAreaCount): (GNOME_SetCurrentArea): (GNOME_SetDeskCount): (GNOME_SetCurrentDesk): (GNOME_SetCurrentDesk): (GNOME_SetWinArea): (GNOME_Init): (CMD_GnomeShowDesks): (GNOME_SetHints): (GNOME_SetDesk): (GNOME_SetLayer): * libs/fsm.c (GetClientID): (set_session_manager): * fvwm/session.c (GetClientID): * fvwm/fvwm.h (FvwmWindow): * fvwm/colorset.c (get_root_pixmap): * fvwm/add_window.c (FetchWmProtocols): * libs/FTips.c (__initialize_window): * fvwm/icccm2.c (convertProperty) (icccm2_handle_selection_request) * fvwm/fvwm.c (SetMWM_INFO): 64-bit fixes 2005-07-17 Dominik Vogt * fvwm/move_resize.c (GetOnePositionArgument): don't use the unportable fuction rintf() 2005-07-16 Dominik Vogt * NEWS: * configure.in: increased version to 2.5.14 released 2.5.13 * ANNOUNCE: * NEWS: * configure.in: updated for 2.5.13 release 2005-07-06 Dominik Vogt * libs/Graphics.c (do_relieve_rectangle_with_rotation): fixed drawing of relief with very small rectangles, i.e. when line_width * 2 > height or width 2005-07-04 Dan Espen * NEWS: fvwm-menu-desktop changes. 2005-07-05 Dominik Vogt * fvwm/placement.c (get_next_x): fixed collision detection of windows on pages other than the current one during placement 2005-06-17 Olivier Chapuis * fvwm/move_resize.c (__resize_window): Fixed interactive resize (reduction) via the bottom border * libs/Fpng.h: Typo 2005-06-02 Dan Espen * NEWS: * fvwm/fvwm.1.in: Spelling fix contition -> condition 2005-04-11 Dominik Vogt * fvwm/style.c (style_ids_are_equals): (style_id_equals_id): (styles_have_same_id): (fw_match_style_id): (one_fw_can_match_both_ids): (cleanup_style_defaults): * libs/fsm.c (fprintfhex): (CloseDownClient): * libs/FGettext.c (fgettext_free_fgpath_list): * libs/Parse.c (_get_suffixed_integer_arguments): * libs/Graphics.c (AllocNonlinearGradient): * libs/PictureUtils.c (build_mapping_table): (finish_ct_init): made static * libs/setpgrp.c: * libs/Event.c: * libs/FRenderInit.c: include own header file * libs/System.c (getFileStamp): * libs/Fft.c (FftPDumyFunc): * libs/FScreen.c (FScreenSetDefaultModuleScreen): exported 2005-03-01 Dan Espen * fvwm/fvwm.1.in (Example): Piperead in dynamic menu example, not exec. 2005-02-25 Dan Espen * fvwm/fvwm.1.in (Focus): Typos in focus section. 2005-02-12 Dominik Vogt * fvwm/conditional.c (Circulate): added tests for fw == Scr.FvwmRoot again to fix a crash 2005-02-05 Dan Espen * AUTHORS: New author, FvwmScript patch. 2005-01-28 Scott Smedley * fvwm/fvwm.1.in: elaborate on how window-specific bindings work. * AUTHORS: s/Hover/Active/ 2005-01-19 Dan Espen * fvwm/bindings.c (ParseBinding): Patch from Frank Gruellich, avoid dump with empty key/mouse binding command. * fvwm/conditional.c (direction_cmd): Safety check after PeekToken Checked all other uses of PeekToken in fvwm dir. 2005-01-08 Olivier Chapuis * fvwm/session.c (matchWin): (SaveWindowStates): On restarts compare window ids only. Base our matching decision on window role only if we have a client id. * fvwm/move_resize.c (GetOnePositionArgument): Fixed a one pixel bug in the Move and AnimatedMove commands by rounding float values to nearest int 2005-01-06 Olivier Chapuis * AUTHORS: * fvwm/move_resize.c (CMD_Maximize): Applied Arnaud Vrac patch which fixes maximize by growing vs EWMH working area 2004-12-12 Dominik Vogt * fvwm/builtins.c (do_button_style): ButtonStyle Reset takes effect immediately 2004-12-08 Dan Espen * fvwm/fvwm.1.in: lang check. 2004-12-06 Olivier Chapuis * fvwm/fvwm.1.in: Really commit EWMHUseStackingOrderHints documentation update 2004-12-02 Olivier Chapuis * fvwm/fvwm.1.in: Fixed bug #1480 by updating EWMHUseStackingOrderHints documentation * NEWS: FvwmIconMan new options * libs/FTips.c (new file): * libs/FTips.h (new file): * libs/defaults.h: * libs/Makefile.am: Added a set of functions for implementing tool tips 2004-11-30 Dan Espen * fvwm/fvwm.1.in: Fix keysym description add XKeysymDB. 2004-11-01 Dominik Vogt * fvwm/menus.c (__mloop_get_event): * fvwm/functions.c (execute_complex_function): * fvwm/add_window.c (AddWindow): * fvwm/module_interface.c (ExecuteModuleCommand): * fvwm/move_resize.c (__move_loop): (__resize_window): properly set the "state" member of faked motion and key events; fixes broken "nosnap" feature 2004-10-26 Dominik Vogt * fvwm/bindings.c (ParseBinding): reformatted * libs/Bindings.c (bindingAppliesToWindow): (__compare_binding): * fvwm/module_interface.c (CMD_ModuleSynchronous): * fvwm/builtins.c (CMD_Wait): (CMD_StrokeFunc): * fvwm/events.c (__handle_bpress_on_root): (HandleButtonRelease): fixed crash in window specific binding code fixed handling of root window in window specific binding code renamed some functions 2004-10-17 Dominik Vogt * fvwm/focus.c (__update_windowlist): replaced while loop by for loop * fvwm/style.c (style_destroy_style): * fvwm/conditional.c (Circulate): removed useless check whether fw == &Scr.FvwmRoot * fvwm/icons.c (DeIconify): defused possible endless loop when a window iconified by the transientfor window loses the "transient" relationship 2004-10-13 Dominik Vogt * fvwm/move_resize.c (__move_loop): (__resize_window): fixed overwriting the initial button_mask during move/resize * fvwm/menus.c (__mloop_handle_action_with_mi): do not "post" a submenu menu item it the submenu does not exist 2004-10-12 Dominik Vogt * fvwm/events.c (__handle_bpress_on_managed): do not draw the decorations pressed in if executing a function is forbidden * libs/Parse.c (CopyToken): fixed parsing of delimiters 2004-10-11 Dominik Vogt * fvwm/virtual.c (GetDeskNumber): fixed MoveToDesk without argument 2004-10-10 Dominik Vogt * fvwm/fvwm.1.in: re-formatted and some spelling corrections * fvwm/colorset.c (CMD_CleanupColorsets): (CMD_Colorset): * fvwm/builtins.c (CMD_Colorset): (CMD_CleanupColorsets): moved functions to colorset.c 2004-10-09 Dominik Vogt * libs/Parse.c (CopyToken): skip any whitespace before a delimiter; this allows to have spaces before the commas in an option list 2004-10-08 Dominik Vogt * fvwm/frame.c (frame_reshape_border): re-shaping shaded windows no longer unshades them re-shaping unshaded windows on pages other than 0 0 no longer moves them out of the current page 2004-10-06 Dominik Vogt * fvwm/events.c (__cr_detect_icccm_move): * fvwm/screen.h (ScreenInfo): * fvwm/builtins.c (CMD_BugOpts): new BugOpts option DebugCRMotionMethod for ConfigureRequest debugging * fvwm/move_resize.c (__move_loop): (__resize_window): query the pointer position in the move loop when an EnterNotify/LeaveNotify event arrives; same change in resize loop. * NEWS: * configure.in: increased version to 2.5.13 released 2.5.12 * ANNOUNCE: * NEWS: * configure.in: updated for 2.5.12 release * fvwm/frame.c (frame_create_move_resize_args): fixed xemacs growing or shrinking when title height changed; this was caused by calculating the old client window geometry using the new title dimensions; query the window size instead 2004-10-05 Dominik Vogt * fvwm/events.c (test_map_request): (test_button_event): (test_typed_window_event): (test_resizing_event): (__predicate_button_click): (__merge_cr_moveresize): (HandleUnmapNotify): (flush_property_notify): (is_resizing_event_pending): (__test_for_motion): use type XPointer for last argument of predicate procedures for XCheckPeekIfEvent and XCheckIfEvent, not char * (HandleUnmapNotify): fixed core dump 2004-10-03 Dominik Vogt * fvwm/window_flags.h: removed useless and broken SETM_ macros * fvwm/update.c (init_style): fixed resetting user states 2004-10-02 Dominik Vogt * libs/envvar.c (add_to_envlist): fixed crash 2004-09-30 Dominik Vogt * fvwm/builtins.c (CMD_UnsetEnv): use flib_unsetenv * libs/envvar.c (flib_unsetenv): (add_to_envlist): new functions (flib_putenv): split in ftwo functions * configure.in: check for unsetenv function * fvwm/builtins.c (CMD_SetEnv): assume an empty value if no value is given 2004-09-30 Rafal Bisingier * fvwm/commands.h: * fvwm/events.c: * fvwm/functable.c: * fvwm/fvwm.1.in: * fvwm/fvwm.c: * fvwm/screen.h: * fvwm/virtual.c: * perllib/FVWM/Commands.pm: new command EdgeLeaveCommand 2004-09-30 Dominik Vogt * NEWS: updated for 2.4.19 * NEWS: * configure.in: increased version to 2.5.12 released 2.5.11 * NEWS: * configure.in: updated for 2.5.11 release 2004-09-27 Dominik Vogt * fvwm/geometry.c (get_page_offset): (get_page_offset_rectangle): (get_absolute_geometry): new functions * fvwm/virtual.c (CMD_GotoPage): * fvwm/move_resize.c (__move_window): * fvwm/virtual.c (CMD_GotoPage): (get_page_arguments): new options wrapx, wrapy, nodesklimitx, nodesklimity to MoveToPage command 2004-09-24 Dominik Vogt * libs/Flocale.c (FlocaleGetNameProperty): fixed freeing uninitialized pointer 2004-09-06 Dominik Vogt * fvwm/conditional.c (select_cmd): (direction_cmd): (CMD_NoWindow): (CMD_All): fixed conditional return code in Pick, PointerWindow, ThisWindow, All, WindowId and Direction commands; fixes break from these commands * fvwm/geometry.c (get_shaded_geometry): shading geometry fix for windows without decoration * libs/FScreen.c (XineramaQueryExtension): fixed xinerama crash 2004-09-04 Scott Smedley * configure.in: Parse man pages with config.status so man pages have correct date. Man pages also specify FVWM version that they relate to. * bin/fvwm-bug.1: * bin/fvwm-config.1: * bin/fvwm-convert-2.2.1: * bin/fvwm-convert-2.4.1: * bin/fvwm-convert-2.6.1: * bin/fvwm-menu-desktop.1: * bin/fvwm-root.1: * modules/FvwmAnimate/FvwmAnimate.1: * modules/FvwmAuto/FvwmAuto.1: * modules/FvwmBacker/FvwmBacker.1: * modules/FvwmBanner/FvwmBanner.1: * modules/FvwmButtons/FvwmButtons.1: * modules/FvwmCommand/FvwmCommand.1: * modules/FvwmConsole/FvwmConsole.1: * modules/FvwmConsole/FvwmConsoleC.pl.1: * modules/FvwmCpp/FvwmCpp.1: * modules/FvwmDragWell/FvwmDragWell.1: * modules/FvwmEvent/FvwmEvent.1: * modules/FvwmForm/FvwmForm.1: * modules/FvwmGtk/FvwmGtk.1: * modules/FvwmIconBox/FvwmIconBox.1: * modules/FvwmIconMan/FvwmIconMan.1: * modules/FvwmIdent/FvwmIdent.1: * modules/FvwmM4/FvwmM4.1: * modules/FvwmPager/FvwmPager.1: * modules/FvwmProxy/FvwmProxy.1: * modules/FvwmRearrange/FvwmRearrange.1: * modules/FvwmSave/FvwmSave.1: * modules/FvwmSaveDesk/FvwmSaveDesk.1: * modules/FvwmScript/FvwmScript.1: * modules/FvwmScroll/FvwmScroll.1: * modules/FvwmTaskBar/FvwmTaskBar.1: * modules/FvwmTheme/FvwmTheme.1: * modules/FvwmWharf/FvwmWharf.1: * modules/FvwmWinList/FvwmWinList.1: These man pages were renamed to have a .in suffix. ie. bin/fvwm-bug.1 renamed to bin/fvwm-bug.1.in 2004-09-03 Dominik Vogt * fvwm/placement.c (__place_window): fixed starting desk output with bugopts explainwindowplacement 2004-09-03 Olivier Chapuis * fvwm/eventhandler.h: * fvwm/events.c (InitEventHandlerJumpTable): (__handle_key): (HandleKeyPress): (HandleKeyRelease): Fixed window specific bindings "patch" by sending key release event when needed 2004-09-01 Dominik Vogt * libs/defaults.h: * fvwm/screen.h: * fvwm/move_resize.c: * fvwm/fvwm.c: * fvwm/fvwm.h: * fvwm/frame.h: * fvwm/decorations.c: * fvwm/frame.c: * fvwm/builtins.c: * fvwm/borders.c: * fvwm/add_window.c: * fvwm/bindings.c: * fvwm/style.c: renamed NUMBER_OF_BUTTONS to NUMBER_OF_TITLE_BUTTONS to avoid confusing it with NUMBER_OF_MOUSE_BUTTONS * fvwm/style.c (style_parse_focus_policy_style): * fvwm/focus_policy.h: * libs/Bindings.c (GrabWindowButton): * fvwm/bindings.c (bind_get_bound_button_contexts): (ParseBinding): * fvwm/events.c (WaitForButtonsUp): * fvwm/style.c (style_parse_focus_policy_style): * fvwm/builtins.c (__fake_event): fixed use of NUMBER_OF_MOUSE_BUTTONS vs. NUMBER_OF_EXTENDED_MOUSE_BUTTONS 2004-08-30 Dominik Vogt * configure.in: put -Wall -Wno-implicit-int before user specified flags * libs/FScreen.c: Applied below patch again. It didn't make it to CVS (?) 2004-08-26 Dan Espen * libs/FScreen.c: Fixed case error. Patch from Chris Ross. 2004-08-26 Dominik Vogt * libs/FScreen.c: cleaned up ifdef hell * configure.in: fixed solaris xinerama test 2004-08-25 Dan Espen * configure.in: * acconfig.h: * libs/FScreen.c (solaris_XineramaQueryScreens): Solaris Xinerama support. * AUTHORS: Update. Patch by Chris Ross. 2004-08-25 Dominik Vogt * fvwm/events.c (__handle_cr_on_client): don't reevaluate window geometry when a ConfigureRequest has no size or position set 2004-08-20 Dominik Vogt * fvwm/menus.c (get_menu_options): (do_menu): new menu option TearOffImmediately 2004-08-19 Dominik Vogt * fvwm/placement.c (__place_get_wm_pos): cascade placemnt fix by Paul Vojta 2004-08-10 Dominik Vogt * fvwm/geometry.c (constrain_size): Don't touch the aspect ratio if modifying the width/height does not improve the situation * fvwm/frame.c (frame_free_move_resize_args): (__frame_setup_window): (frame_update_hidden_window_pos): (frame_mrs_resize_move_windows): (frame_create_move_resize_args): * fvwm/move_resize.c (__resize_window): some event handling fixes * fvwm/geometry.c (constrain_size): look up the latest size hints if necessary 2004-08-07 Dominik Vogt * fvwm/geometry.c (constrain_size): * fvwm/ewmh.c (EWMH_fullscreen): * fvwm/window_flags.h (DO_DISABLE_CONSTRAIN_SIZE_FULLSCREEN): (SET_DISABLE_CONSTRAIN_SIZE_FULLSCREEN): (SETM_DISABLE_CONSTRAIN_SIZE_FULLSCREEN): * fvwm/fvwm.h (window_flags_t): allow windows to override their size hints when going fullscreen: minimum and maximum size, size inc, aspect ratio, etc. 2004-08-06 Dominik Vogt * fvwm/decorations.c (struct): MWM hints on 64 bit machines fix 2004-07-20 Dominik Vogt * fvwm/fvwm.1.in (Note): * fvwm/read.c (CMD_Read): (CMD_PipeRead): the Read and PipeRead commands have a return code * fvwm/read.c (run_command_stream): (CMD_Read): (CMD_PipeRead): removed debug code 2004-07-19 Dominik Vogt * fvwm/move_resize.c (GetResizeArguments): (GetMoveArguments): fixed parsing of the frame option to the resize command and the pointer option to the move command * fvwm/conditional.c (CMD_None): Fixed CMD_None return code 2004-07-16 Dominik Vogt * fvwm/stack.c (is_above_unmanaged): windows on other Desks are always considered on top * fvwm/conditional.c (CreateConditionMask): (MatchesConditionMask): * fvwm/fvwm.h (WindowConditionMask): new condition Overlapped * config.h: inproved strings.h / sring.h iclusion logic * libs/PictureUtils.c (finish_ct_init): (PictureInitColors): use flib_putenv instead of putenv 2004-07-15 Dominik Vogt * fvwm/screen.h: * libs/gravity.h (enum): * libs/wcontext.h (enum): -pedantic fixes * fvwm/fvwm.c (StartupStuff): do not ungrab the pointer while the startup functions execute (Done): ungrab the pointer only after executing the RestartFunction or ExitFunciton. Otherwise these functions may not be executed if some other application grabs the pointer. * fvwm/fvwm.h: * fvwm/conditional.c (CreateConditionMask): renamed CurrentGlobbalPageAnyDesk to CurrentGlobalPageAnyDesk new condition AnyScreen * libs/Bindings.c: * fvwm/builtins.c (__fake_event): * fvwm/bindings.c (ParseBinding): removed C++ comments 2004-07-15 Scott Smedley * NEWS: New options for FvwmButtons module. 2004-07-12 Mikhael Goikhman * fvwm/fvwm.1.in: use commas between conditions 2004-07-11 Dominik Vogt * fvwm/builtins.c (CMD_Wait): ignore MapNotify reported to any window except the root window * fvwm/module_interface.c (CONFIGARGS): correct number of CONFIGARGS arguments * libs/vpacket.h (ConfigWinPacket): frame_x and frame_y are signed 2004-07-11 Scott Smedley * fvwm/conditional.c: * fvwm/fvwm.h: * fvwm/fvwm.1.in: * AUTHORS: Committed patch by Norman Yarvin (with a few minor mods) to extend conditionals to handle multiple window names. 2004-07-10 Dominik Vogt * fvwm/module_interface.c (CONFIGARGS): * libs/vpacket.h (ConfigWinPacket): put window_flags at end of structure 2004-07-09 Dominik Vogt * fvwm/module_interface.c (CONFIGARGS): (OLDCONFIGARGS): (SETOLDFLAGS): (SendConfig): (BroadcastConfig): removed old module interface (CONFIGARGS): * libs/vpacket.h (ConfigWinPacket): 64 bit fix 2004-07-08 Dominik Vogt * fvwm/execcontext.c (__exc_change_context): fixed handling of etrigger event, fixing a problem with PropertyNotify events during resizing and possibly other problems too * fvwm/add_window.c (RestoreWithdrawnLocation): fixed travelling windows if application changed gravity hint before recapture * fvwm/frame.c (combine_decor_gravities): (combine_gravities): renamed (frame_restore_client_gravities): fixed window gravity after resize * libs/FEvent.c (FPeekEvent): (FPeekIfEvent): (FCheckPeekIfEvent): fixed some event handling bugs * fvwm/conditional.c (CMD_Test): (match_version): corrected use of Bool types (match_version): simplified, fixed compilation (ver): use int as return type * libs/Ficonv.c (convert_charsets): reindented * libs/Ficonv.c (convert_charsets): * acinclude.m4 (ICONV_SECOND_ARG): rewrote iconf configure test to save an ifdef 2004-07-07 Scott Smedley * fvwm/fvwm.1.in: * libs/Bindings.h: * libs/Bindings.c: * fvwm/bindings.c: Allow user to specify window-specific bindings that should NOT be intercepted by FVWM. This is accomplished with an '--' binding action. 2004-07-06 Dominik Vogt * fvwm/move_resize.c (__resize_window): Fixed event handling * fvwm/virtual.c (HandlePaging): removed check for leave events on pan frames; better query the pointer each time 2004-07-06 Scott Smedley * fvwm/fvwm.1.in: * fvwm/conditional.c: Extend "Test (Version >= x.y.z)" syntax to allow version comparison. 2004-07-01 Dominik Vogt * fvwm/move_resize.c (GetResizeArguments): (GetResizeMoveArguments): (__resize_window): (__resize_step): (__resize_get_refpos): (__resize_get_dir_proximity): (__resize_get_dir_from_window): implemented fluxbox-like Alt-Button3 resizing * fvwm/virtual.c (HandlePaging): * fvwm/events.c (__merge_cr_moveresize): (__test_for_motion): (flush_property_notify): do not use XPutBackEvent as it shuffles events on the queue (test_button_event): (test_typed_window_event): new functions * libs/FEvent.c (fev_get_evpos_or_query): take pointer position from EnterNotify and LeaveNotify events * fvwm/move_resize.c (__move_loop): fixed multiple paging with certain SnapGrid / Move interactions (__resize_window): (__move_loop): * fvwm/virtual.c (HandlePaging): Workaround for buggy XFree not delivering some Pointer events simplified code * fvwm/virtual.c (MoveViewport): don't eat MotionNotify events * libs/FEvent.c (fev_get_last_event): new function (FWindowEvent): (FPutBackEvent): (FPeekIfEvent): (FPeekEvent): (FNextEvent): (FMaskEvent): (FIfEvent): (FCheckWindowEvent): (FCheckTypedWindowEvent): (FCheckTypedEvent): (FCheckMaskEvent): (FCheckIfEvent): keep a copy of the previous event in case FPutBackEvent is called 2004-06-30 Scott Smedley * fvwm/fvwm.1.in: Indicate optional window argument in section headings for Key, Mouse, PointerKey & Stroke commands. Remove strange "-Key" option listed for PointerKey. 2004-06-29 Dominik Vogt * libs/Fft.c (FftDrawString): * fvwm/session.c (get_version_string): * fvwm/module_interface.c (FlushMessageQueue): * fvwm/fvwm.c (SaveDesktopState): * fvwm/colorset.h: * fvwm/colorset.c (cleanup_colorsets): * libs/PictureUtils.c (struct): fixed compilation with -Wall -Wstrict-prototypes -Wpointer-arith 2004-06-25 Dominik Vogt * fvwm/events.c (__cr_detect_icccm_move): windows with ewmh hints are assumed to use icccm2 compliant movement * fvwm/ewmh_events.c (ewmh_WMStateMaxVert): (ewmh_WMStateMaxHoriz): fixed restart/maximized problem * libs/fvwmsignal.c (fvwmReapChildren): * fvwm/fvwm.c (ReapChildren): moved function to lib 2004-06-14 Dominik Vogt * fvwm/modconf.c (send_desktop_geometry): (send_color_limit): (send_click_time): (send_move_threshold): (send_ignore_modifiers): increased static buffer size 2004-06-13 Marcus Lundblad * libs/CombineChars.c (convert_to_ucs2): Replace illegal UTF-8 character sequences in input 2004-06-11 Scott Smedley * libs/Bindings.c: bugfix: wrong stroke action being invoked. 2004-06-10 Scott Smedley * fvwm/builtins.c: * fvwm/events.c: * libs/Bindings.c: Active _last_ matching binding. (ie. same behaviour as before win-specific bindings patch.) bugfix: segfault when looking up stroke bindings in root context. 2004-06-07 Scott Smedley * fvwm/bindings.c: * fvwm/builtins.c: * fvwm/events.c: * fvwm/fvwm.1.in: * fvwm/module_interface.c: * libs/Bindings.c: * libs/Bindings.h: * modules/FvwmScript/FvwmScript.c: * modules/FvwmScript/Instructions.c: Implemented window-specific key/mouse bindings. * modules/FvwmIconBox/FvwmIconBox.h: * libs/fvwmlib.h: * libs/wild.c: * libs/wild.h: Make args to matchWildcards() const. 2004-06-03 Dominik Vogt * fvwm/ewmh_events.c (ewmh_WMStateFullScreen): use EWMH_fullscreen * fvwm/ewmh.c (EWMH_fullscreen): new function * fvwm/add_window.c (AddWindow): implemented MAXVERT, MAXHORIZ and FULLSCREEN initial EWMH states * fvwm/ewmh_events.c (ewmh_WMStateMaxHoriz): (ewmh_WMStateMaxVert): (ewmh_WMStateShaded): (ewmh_WMStateSticky): (ewmh_WMStateStaysOnBottom): fixed core dumps (ewmh_WMState): don't try to maximize window when looking up the style (ewmh_WMDesktop): (ewmh_WMStateFullScreen): (ewmh_WMStateHidden): (ewmh_WMStateMaxVert): (ewmh_WMStateModal): (ewmh_WMStateShaded): (ewmh_WMStateSkipPager): (ewmh_WMStateSticky): (ewmh_WMStateStaysOnBottom): fixed ignoring ewmh hints * fvwm/expand.c (expand_vars_extended): include full path in iconfile and miniiconfile variables 2004-06-02 Dominik Vogt * fvwm/functions.c (execute_complex_function): (CheckActionType): fixed double click patch 2004-06-01 Dominik Vogt * fvwm/ewmh.c (EWMH_SetWMDesktop): use 0xFFFFFFFF instead of 0xFFFFFFFE for "sticky across all desks" 2004-05-31 Dan Espen * fvwm/fvwm.1.in (COLORSETS): Moved FvwmTheme description of colorsets into fvwm man page. 2004-05-29 Norbert Buchmuller * libs/FImage.c (FShmSafeCreateImage): Yet another fix to SHM remote client problem 2004-05-26 Francis Litterio * fvwm/fvwm.1.in * fvmw/fvwm.h * fvwm/placement.c (__place_get_wm_pos) * fvwm/style.c (style_parse_one_style_option) Added support for new CenterPlacement style (cf. macro PLACE_CENTER). 2004-05-29 Dominik Vogt * fvwm/events.c (HandleEnterNotify): fixed endless loop of edge commands when doing something that grabs the pointer * fvwm/functions.c (CheckActionType): (execute_complex_function): double clicks no longer work when pressing different buttons 2004-05-26 Dominik Vogt * fvwm/placement.c (__place_get_wm_pos): fixed placement in top left corner when pressing escape during manual placement 2004-05-23 Mikhael Goikhman * configure.in: * AUTHORS: added Chinese translations 2004-05-18 Olivier Chapuis * fvwm/ewmh.c (EWMH_SetFrameStrut): Fixed a miss-print 2004-05-09 Mikhael Goikhman * fvwm/conditional.c: * fvwm/fvwm.1.in: clean up Test code and documentation, add new False condition, unrecognized conditions produce Error return code now 2004-05-06 Dan Espen * fvwm/style.c: Remove extra char. 2004-05-01 Olivier Chapuis * fvwm/ewmh.c (ewmh_atom_client_win): * fvwm/ewmh_intern.h: * fvwm/ewmh_events.c (EWMH_ProcessClientMessage): (ewmh_MoveResizeWindow): Added _NET_RESTACK_WINDOW as it is similar than _NET_MOVERESIZE_WINDOW * fvwm/events.c (__handle_cr_on_client): (__handle_configure_request): (events_handle_configure_request): Some renaming for consistency, force restacking if the event come from an ewmh restack * fvwm/ewmh_events.c (ewmh_MoveResize): Fixed _NET_WM_MOVERESIZE * fvwm/ewmh_events.c (ewmh_MoveResizeWindow): Removed debug code * fvwm/ewmh.c (ewmh_atom_fvwm_win): (EWMH_SetFrameStrut): Added _NET_FRAME_EXTENTS as it is just _KDE_NET_WM_FRAME_STRUT 2004-04-29 Olivier Chapuis * libs/FImage.c (FShmSafeCreateImage): Finished to fix SHM remote client problem 2004-04-29 Olivier Chapuis * libs/FImage.c (FShmSafeCreateImage): Fixed when we are a remote client 2004-04-21 Mikhael Goikhman * INSTALL.fvwm: * NEWS: * acconfig.h: * fvwm/fvwm.1.in: * fvwm/fvwm.c: * fvwm/gnome.h: * fvwm/session.c: * libs/envvar.c: * libs/envvar.h: new default ~/.fvwm/config file is now recommended instead of still supported ~/.fvwm/.fvwm2rc 2004-04-21 Dominik Vogt * fvwm/menus.c (NewMenuRoot): do not strip whitespace from menu names when creating a new menu 2004-04-20 Dominik Vogt * fvwm/menuitem.c (menuitem_get_size): * fvwm/menuitem.h: renamed remaining "mips" to mipst 2004-04-09 Olivier Chapuis * fvwm/events.c (HandleMapRequestKeepRaised): * fvwm/ewmh_events.c (ewmh_DesktopGeometry): Fixed EWMH DesktopGeometry and Stacking list 2004-04-05 Dominik Vogt * fvwm/virtual.c (GetDeskNumber): (CMD_MoveToDesk): (CMD_GotoDesk): fixed MoveToDesk with one argument 2004-04-02 Dominik Vogt * fvwm/style.c (style_parse_one_style_option): * fvwm/style.h: * fvwm/conditional.c (MatchesConditionMask): * fvwm/fvwm.h: * fvwm/window_flags.h: new style "State" 2004-03-31 Dominik Vogt * fvwm/fvwm.1.in: corrected a typo 2004-03-31 Dominik Vogt * fvwm/move_resize.c (unmaximize_fvwm_window): fixed redrawing of maximize button when unmaximizing but when the size and position does not change 2004-03-30 Dominik Vogt * fvwm/expand.c (expand_vars_extended): new extended variable $[w.layer] * fvwm/move_resize.c (MaximizeHeight): (MaximizeWidth): (CMD_Maximize): applied modified layer patch for maximize by Rafal Bisingier 2004-03-29 Dominik Vogt * fvwm/add_window.c (setup_frame_attributes): Hopefully fixed BackingStore code and removed now useless backing store for decorations * fvwm/expand.c (expand_vars_extended): new extended variable $[w.desk] 2004-03-19 Dominik Vogt * NEWS: * configure.in: increased version to 2.5.11 released 2.5.10 * NEWS: * configure.in: updated for 2.5.10 release * libs/Graphics.c (do_relieve_rectangle_with_rotation): improved rotation code * libs/gravity.c (gravity_add_rotations): new function 2004-03-17 Dominik Vogt * fvwm/placement.c (__explain_placement): new function * libs/FScreen.c (FScreenIsRectangleOnScreen): new function * fvwm/builtins.c (CMD_BugOpts): * fvwm/screen.h (ScreenInfo): new BugOpts option ExplainWindowPlacement renamed some members of Screen 2004-03-16 Dominik Vogt * fvwm/placement.c (__place_get_wm_pos): (__place_get_nowm_pos): (__place_get_placement_flags): (__place_window): (__place_handle_x_resources): (setup_window_placement): split into multiple functions cleaned up a little 2004-03-15 Dominik Vogt * fvwm/add_window.c (setup_window_placement): * fvwm/placement.c (setup_window_placement): moved function to placement.c fixed using PLACE_AGAIN placement mode (PlaceWindow): (__place_window): renamed function 2004-03-15 Chris Ross * libs/Graphics.c (do_relieve_rectangle_with_rotation) allow a negative line_width to invert the relief 2004-03-06 Marcus Lundblad * libs/Flocale.c (FlocaleDrawString) (FlocaleDrawUnderline) (FlocaleTextWidth): reduced redundant calls to iconv 2004-03-02 Dominik Vogt * fvwm/move_resize.c (CMD_XorValue): fixed a very small outline drawing problem caused by using 0 line width instead of 1 * NEWS: * configure.in: increased version to 2.5.10 * configure.in: * NEWS: updated for 2.5.9 release * fvwm/functions.c (execute_function_override_window): * fvwm/module_interface.c (ExecuteModuleCommand): * fvwm/conditional.c (circulate_cmd): sometimes, DeferExecution was called although a window was already selected, for example with the "Current" commend; fixed 2004-02-28 Olivier Chapuis * libs/FImage.c (FShmSafeCreateImage): Fixed some safety tests 2004-02-26 Dominik Vogt * fvwm/events.c (__handle_cr_on_client): fixed a bug in the Jave configure request workaround 2004-02-23 Dominik Vogt * fvwm/events.c (__cr_detect_icccm_move): improved motion method detection for fullscreen requests 2004-02-19 Dominik Vogt * fvwm/add_window.c (AddWindow): * fvwm/screen.h (ScreenInfo): * fvwm/builtins.c (CMD_BugOpts): new BugOpts option DisplayNewWindowNames intended for debugging 2004-02-17 Dominik Vogt * libs/Bindings.c (FvwmStringToKeysym): small performance enhancement * fvwm/move_resize.c (AnimatedMoveAnyWindow): (__move_loop): fixed the FlickeringMoveWorkaround option which did nothing before 2004-02-16 Dominik Vogt * fvwm/style.c (style_parse_one_style_option): * fvwm/fvwm.h: * fvwm/style.h (SIS_UNMANAGED): * fvwm/add_window.c (AddWindow): New style Unmanaged * fvwm/expand.c (expand_vars_extended): new variables $[w.iconfile] and $[w.miniiconfile] * libs/Graphics.c (do_relieve_rectangle_with_rotation): made left side of a relief one pixel longer at the bottom 2004-02-05 Dominik Vogt * libs/defaults.h (DEF_FP_SORT_WINDOWLIST_BY): * fvwm/style.c (style_set_old_focus_policy): fixed default window list order with ClickToFocus 2004-02-04 Marcus Lundblad * fvwm/libs/Flocale.h: * fvwm/libs/Flocale.c (FlocaleStringNumberOfBytes) (FlocaleStringByteToCharOffset) (FlocaleStringCharToByteOffset) (FlocaleStringCharLength): Made utility functions available outside of Flocale 2004-01-31 Olivier Chapuis * fvwm/events.c (__test_for_motion): Fixed a lockup, see the long comment in the code 2004-01-26 Dominik Vogt * fvwm/schedule.c (execute_obj_func): fixed using uninitialised return code 2004-01-25 Olivier Chapuis * fvwm/builtins.c (do_title_style): Fixed MinHeight, it must reset the Height 2004-01-06 Dominik Vogt * fvwm/menus.c (menuShortcuts): applied menu navigation patch by Anton Kazennikov 2003-12-18 Dominik Vogt * libs/gravity.c (gravity_dir_to_string): (gravity_parse_dir_argument): use a constant for the dir table 2003-12-16 Marcus Lundblad * fvwm/Flocale.c (FlocaleEncodeString) (FlocaleDrawUnderline): Fixed crash when there's no Iconv support 2003-12-16 olicha * fvwm/functions.h: Used the FUNC_FLAGS_TYPE in find_func_t declaration * sample.fvwmrc/system.fvwm2rc-sample-95: Added some Xft fonts 2003-12-12 olicha * fvwm/ewmh_events.c (ewmh_WMStateFullScreen): Fixed ewmh FullScreen when an application start fullscreen and desactivate this state 2003-12-04 olicha * fvwm/placement.c (test_fit): * fvwm/ewmh.h: * fvwm/ewmh.c (ewmh_GetStrutIntersection): (EWMH_GetBaseStrutIntersection): (EWMH_GetStrutIntersection): Fixed placement vs the base struts 2003-11-29 Mikhael Goikhman * sample.fvwmrc/system.fvwm2rc-sample-95: improved Debian specific menu 2003-11-15 Mikhael Goikhman * sample.fvwmrc/system.fvwm2rc-sample-95: several updates; added Debian menu if found 2003-11-07 Dominik Vogt * configure.in: new configure option --en/disable-iconv 2003-11-03 Dominik Vogt * fvwm/menus.c (__mloop_handle_event): * fvwm/menustyle.c (menustyle_parse_style): (menustyle_copy): new MenuStyle options PopupIgnore and PopupClose 2003-11-02 Dan Espen * fvwm/menus.c (menu_binding): Remove debug code. * fvwm/bindings.c (ParseBinding): Hand off menu bindings to menu code. * fvwm/menus.h: Add menu_binding function. * fvwm/fvwm.1.in: Document the menu context in the mouse command for tear off menus. * fvwm/menus.c (__mloop_handle_event): Really crude ability to disable button 2 tearoff. * libs/wcontext.h (enum): Add MENU context. * libs/wcontext.c (win_contexts): More common binding contexts first in table. * libs/charmap.c (charmap_string_to_mask): Space before char in error message. 2003-11-01 Mikhael Goikhman * NEWS: * configure.in: increase version to 2.5.9 2003-10-31 Mikhael Goikhman * Makefile.am: fixed deb creation * configure.in: * NEWS: updated for 2.5.8 release 2003-10-29 Mikhael Goikhman * Makefile.am: * configure.in: initially added files for deb package auto-creating procedure 2003-10-26 Mikhael Goikhman * AUTHORS: * configure.in: added Swedish translations by Johan Svedberg * NEWS: updated 2003-10-25 Mikhael Goikhman * fvwm/add_window.c (GetWindowSizeHints): reindented broken hint messages 2003-10-23 Mikhael Goikhman * configure.in: improved Perl detection messages, restored FvwmGtkDebug independence from gtk libs 2003-10-15 Mikhael Goikhman * configure.in: * AUTHORS: added German translations by Andrei Mitrofanow * fvwm/fvwm.1.in: typos 2003-10-11 Mikhael Goikhman * NEWS: added 2.4.17 NEWS 2003-09-24 Dominik Vogt * fvwm/fvwm.1.in: * fvwm/conditional.c (CreateConditionMask): (MatchesConditionMask): (CreateConditionMask): * fvwm/fvwm.h (WindowConditionMask): !CurrentPage, !CurrentDesk, !Layer ... now work as they should 2003-09-23 olicha * libs/FImage.c (FShmInit): Removed debug code 2003-09-23 Dominik Vogt * fvwm/focus.c (warp_to_fvwm_window): don't unnecessarily call MoveViewport 2003-09-10 Dominik Vogt * fvwm/decorations.c (__is_resize_allowed): fixed a condition 2003-09-06 malu * libs/FBidi.c (FBidiConvert): * libs/CombineChars.c (CombineChars): Fixed drawing combining characters on correct positions in right-to-left context 2003-09-05 malu * libs/Flocale.c (FlocaleDrawString): (FlocaleTextWidth): Fixed drawing of combining characters with font shadow (character offsets were miscalculated, since FlocaleTextWidth adds shadow width) 2003-09-05 malu * libs/Flocale.c (FlocaleDrawUnderline): Fixed bug with text width when a string contains only "orphaned" combining characters (compensation for font shadowd was counted twice) 2003-09-04 olicha * todo-2.6: Added E.18, added comments on C.9 and C.15 2003-09-03 olicha * libs/Flocale.c (FlocaleTextWidth): Fixed a comb_char core dump * libs/Makefile.am: Fixed compilation if either iconv, libpng or Xrender headers are not at a standard place 2003-09-03 Mikhael Goikhman * acinclude.m4: fixed error message for incorrect --with-SOMETHING-library argument 2003-09-03 olicha * todo-2.6: Closed C.2 as Dominik fix it on 2003-03-13. Move B.5 to C.27 2003-09-02 olicha * todo-2.6: C.12 is fixed 2003-09-01 olicha * libs/gravity.c (gravity_dir_to_string): A new interface function to transform a direction_t to a string 2003-08-31 S. Anderson * libs/defaults.h (FLOCALE_MB_FALLBACK_FONT): Fixed missing font charsets 2003-08-28 olicha * fvwm/move_resize.c (__move_loop): (AnimatedMoveAnyWindow): Updated bg of transparent tear off menu when moved * fvwm/events.c (HandlePropertyNotify): Updated ParentRelative tear off menu on bg change * fvwm/menus.c (UpdateMenuColorset): Updated colorsets of tear off menu when they change, this handle the case of root background change for RootTransparent * fvwm/menus.h: * fvwm/menus.c (menu_redraw_pr_tear_off_menu): An utility function for redrawing transparent tear off menu. Maybe we can merge * fvwm/add_window.c (validate_transientfor): Fixed transient for an ewmh desktop 2003-08-27 olicha * libs/FRender.c (FRenderRender): * libs/PictureGraphics.c (PGraphicsCreateTranslucent): Removed and fixed some unused code 2003-08-25 olicha * fvwm/misc.c (GrabEm): Fixed fvwm freeze if GRAB_FREEZE_CURSOR fail repeatedly * fvwm/modconf.c (send_color_limit): ifndefed color limit config info message which is not used anymore * fvwm/colorset.c (parse_colorset): Added a note on average bg 2003-08-23 olicha * fvwm/style.c (print_styles): More info on memory used * fvwm/style.c (__simplify_style_list): Fixed upward simplication 2003-08-14 olicha * fvwm/ewmh.c (ewmh_HandleMenu): Fixed the MENU window type, they are tear off menus * fvwm/fvwm.h: * fvwm/update.c (apply_window_updates): * fvwm/stack.c (new_layer): * fvwm/ewmh.c (EWMH_GetStyle): Fixed EWMHUseStackingHints update * fvwm/window_flags.h: * fvwm/fvwm.h: * fvwm/ewmh_events.c (ewmh_WMStateFullScreen): (ewmh_WMStateMaxHoriz): (ewmh_WMStateMaxVert): * fvwm/move_resize.c (unmaximize_fvwm_window): Fixed _NET_WM_STATE_FULLSCREEN: set the correct _NET_WM_STATE, uniconify and unshade when putting a window fullscreen * fvwm/ewmh_intern.h: * fvwm/ewmh.c (ewmh_AllowsFullScreen): Added _NET_WM_ACTION_FULLSCREEN as we have _NET_WM_STATE_FULLSCREEN * fvwm/move_resize.c (unmaximize_fvwm_window): (CMD_Resize): (CMD_ResizeMove): * fvwm/ewmh_events.c (ewmh_WMStateFullScreen): * fvwm/decorations.c (SelectDecor): * fvwm/windowshade.c (CMD_WindowShade): Removed the decor for EWMH fullscreen windows, forbid shading and allows Resize and MoveResize without unsetting the fullscreen/maximized state * fvwm/move_resize.c (CMD_ResizeMoveMaximize): (CMD_ResizeMaximize): Fixed ewmh state which was not set after these cmds 2003-08-09 olicha * todo-2.6: Updated 2003-08-08 olicha * fvwm/borders.c (border_draw_vector_to_pixmap): Fixed inversion of fg and bg in vector buttons * fvwm/style.c (__simplify_style_list): Fixed a memory leak * libs/System.c (fvwm_mkstemp): Removed debug code 2003-08-07 olicha * configure.in: * acinclude.m4 (AM_SAFETY_CHECK_MKSTEMP): * acconfig.h: * libs/System.c (fvwm_mkstemp): * libs/fvwmlib.h: Added fvwm_mkstemp for replacing tempnam. configure check if mkstemp exists and work correctly, if not a replacement function is used (written by Michael Han in 2001-02 and inspired by the glibc mkstemp implementation). * libs/fsm.c (unique_filename): (SetAuthentication): * fvwm/session.c (getUniqueStateFilename): Replaced tempnam by fvwm_mkstemp 2003-08-07 olicha * libs/Makefile.am: * libs/FSMlib.h (new file): * fvwm/session.c (*): * fvwm/session.h: fvwmize SMlib and ICElib * fvwm/session.c (matchWin): Fixed window matching for windows with no SM_CLIENT_ID and a window_role * libs/fsm.c (new file): * libs/fsm.h (new file): * fvwm/ConfigFvwmDefaults A set of functions for implementing a dummy session manager * fvwm/fvwm.1.in: GNOME 1 hints and EWHM support is not a configure time option (anymore). 2003-08-06 Robert Wittek * fvwm/add_window.c (AddWindow): fixed stickyness across desks over a restart 2003-08-06 olicha * fvwm/ewmh.c (EWMH_WindowInit): (EWMH_SetFrameStrut): Fixed position of kde tray windows in kicker 2003-07-29 Dominik Vogt * fvwm/module_interface.c (FlushMessageQueue): retry writing pipe if write returns EINTR 2003-07-28 olicha * fvwm/events.c (events_handle_configure_request): (HandleConfigureRequest): (__handle_configure_request): (__handle_cr_on_client): * fvwm/ewmh.c (ewmh_atom_client_win): * fvwm/ewmh_intern.h: * fvwm/ewmh_events.c (ewmh_MoveResizeWindow): (EWMH_ProcessClientMessage): Implemented _NET_MOVERESIZE_WINDOW * fvwm/fvwm.c (main): A -Wall fix 2003-07-25 olicha * fvwm/ewmh.c (ewmh_HandleWindowType): Fixed handling of the _NET_WINDOW_TYPE prop when there are more that one type and we do not support the first one. * fvwm/expand.c (expand_vars_extended): Fixed conflict between extended variables name (desk.name and desk.n) * fvwm/session.c (callback_save_yourself): Respect the SmSaveGlobal save type. This should fix some session locking in the sm protocol * fvwm/session.c (setSmProperties): (SessionInit): Set some sm properties when fvwm start for fixing a problem with the restart style hint after a restart. * fvwm/fvwm.c (get_display_name): (usage): (main): * fvwm/session.c (setSmProperties): * fvwm/fvwm.1.in Added a possible positive or null arg to --single-screen which forces fvwm to start on the "current" display and the given screen. Use this to fix fvwm starting under a session manager: specify only the screen and not the display.screen for the restart sm command. * fvwm/fvwm.c (main): Fixed possible memory corruption if a display has more than 10 screens. * fvwm/session.c (*): Better debuging msg 2003-07-24 Mikhael Goikhman * acinclude.m4: fixed xft/fontconfig detection with pkg-config * fvwm/fvwm.1.in: corrections in some long option names 2003-07-23 Dominik Vogt * fvwm/add_window.c (setup_style_and_decor): * fvwm/geometry.c (set_window_border_size): * fvwm/fvwm.h (FvwmWindow): * fvwm/events.c (HandleShapeNotify): * fvwm/frame.c (frame_free_move_resize_args): (frame_setup_shape): (frame_reshape_border): fixed resizing of window borders if a window shape was added or deleted after the initial window setup * fvwm/update.c (apply_window_updates): removed unused code * fvwm/events.c (__cr_detect_icccm_move): disable motion method detection for shaped windows 2003-07-21 olicha * fvwm/add_window.c (setup_window_structure): * fvwm/session.c (MatchWinToSM): Preserve is_name_changed window_flags within restart, session loading and recapture 2003-07-20 olicha * fvwm/ewmh.c (EWMH_Init): fixed _NET_WM_NAME for our ewmh WM_CHECK window * fvwm/fvwm.c (InternUsefulAtoms): * fvwm/externs.h: * fvwm/session.c (GetWindowRole): Some applications use WINDOW_ROLE and not WM_WINDOW_ROLE * fvwm/session.c (GetClientID): Better determination of the CLIENT_LEADER * fvwm/session.c (setSmProperties): Set the CloneCommand for gnome-session editor (the sm spec says this properties is required). Removed the commented XSM ifdef. * fvwm/session.c (matchWin): (SaveWindowStates): Consider client only if it has a client id or a wm command. Removed the "two entries" session previous commit 2003-07-16 olicha * fvwm/session.c (MatchWinToSM): Fixed restoring session state, if two window session entries have the same identifier ignore these entries 2003-07-16 olicha * NEWS: * fvwm/style.h (SID_GET_NAME): (SID_SET_NAME): (SID_GET_WINDOW_ID): (SID_SET_WINDOW_ID): (SID_SET_HAS_NAME): (SID_GET_HAS_NAME): (SID_SET_HAS_WINDOW_ID): (SID_GET_HAS_WINDOW_ID): (SGET_ID): (SGET_WINDOW_ID): (SSET_WINDOW_ID): (SSET_ID_HAS_NAME): (SGET_ID_HAS_NAME): (SSET_ID_HAS_WINDOW_ID): (SGET_ID_HAS_WINDOW_ID): * fvwm/style.c (style_ids_are_equals): (style_id_equals_id): (styles_have_same_id): (fw_match_style_id): (one_fw_can_match_both_ids): (remove_all_of_style_from_list): (__simplify_style_list): (style_parse_one_style_option): (__style_command): (style_destroy_style): (print_styles): (CMD_Style): (CMD_WindowStyle): (CMD_FocusStyle): (CMD_DestroyStyle): (CMD_DestroyWindowStyle): * fvwm/fvwm.h (style_id_t): (window_style): * fvwm/functable.c (func_table): * fvwm/add_window.c (destroy_window): * fvwm/commands.h: * fvwm/fvwm.1: New WindowStyle and DestroyWindowStyle command for setting styles per window 2003-07-14 Marcus Lundblad * libs/Flocale.c (FlocaleDrawString): * libs/FBidi.c (FBidiConvert): fixed drawing of combining characters in the case where a string consists of only combining characters 2003-07-13 Marcus Lundblad * libs/CombineChars.c (CombineChars): bugfix: array mapping visual to logical position was allocated to small (factor 2) in decoposing code 2003-07-11 Marcus Lundblad * libs/Flocale.c (FlocaleEncodeWinString): fixed a memory leak * libs/Flocale.c (FlocaleDrawString): (FlocaleRotatedDrawString): removed some code duplication 2003-07-09 Marcus Lundblad * libs/CombineChars.c (combclass_table): (CombineChars): fixed supporting drawing marks superimposed that are in a combining class 2003-07-09 Marcus Lundblad * libs/Flocale.c (FlocaleRotateDrawString): (FlocaleDrawString) fixed core dump when composing characters can't be converted to locale charset 2003-07-09 Marcus Lundblad * AUTHORS: updated 2003-07-09 Marcus Lundblad * todo-2.6 (todo): updated summary 2003-07-09 Marcus Lundblad * NEWS: updated with reagrds to combing characters 2003-07-09 Marcus Lundblad * todo-2.6 closed B.8 2003-07-09 Marcus Lundblad * libs/Flocale.c (FlocaleEncodeString): (FlocaleEncodeWinString): (FlocaleRotateDrawString): (FlocaleDrawString): (FlocaleDrawUnderline): fixed rendering combining characters using Unicode font in a non-UTF-8 locale 2003-07-08 Dominik Vogt * fvwm/fvwm.1.in: renamed MoveWindowByProgramMethod to MoveByProgramMethod 2003-07-08 Marcus Lundblad * libs/FBidi.h: fixed FBidi.h macro to work with no FriBIDI 2003-07-08 Marcus Lundblad * libs/CombineChars.h (CombineChars): * libs/CombineChars.c (CombineChars): * libs/FBidi.h (FBidiConvert): * libs/FBidi.c (FBidiConvert): * libs/Flocale.c (FlocaleEncodeString): (FlocaleEncodeWinString): (FlocaleDrawUnderline): (FlocaleTextWidth): fixed drawing of underlines on characters to work in with BIDI and combining characters 2003-07-08 Mikhael Goikhman * todo-2.6: closed D.1 with "no consensus" resolution 2003-07-08 Dominik Vogt * fvwm/fvwm.1.in: documented tear off menus * fvwm/placement.c (PlaceWindow): StartsOnPage + SkipMapping overrides PPosition 2003-07-07 Mikhael Goikhman * fvwm/functable.c: solved a problem with CMD_Dummy and exact command spelling * libs/CombineChars.c: * libs/CombineChars.h: * libs/FBidi.c: minor reformattings (use TABs not 8 spaces and a space after keywords like for, if or while) 2003-07-06 Dominik Vogt * fvwm/update.c (apply_window_updates): * fvwm/update.h: * fvwm/add_window.c (setup_style_and_decor): * fvwm/style.h: * fvwm/style.c (style_parse_one_style_option): (check_window_style_change): new style MoveWindowByProgramMethod * libs/PictureImageLoader.c (PImageLoadXpm): use RETSIGTYPE and SIGNAL_RETURN for all signal handlers * fvwm/ewmh_events.c (ewmh_WMStateFullScreen): implemented _NET_WM_STATE_FULLSCREEN handling * fvwm/move_resize.c (GetOnePositionArgument): fixed parsing of "+-x +-y" Move arguments (CMD_Maximize): use get_page_offset_check_visible * fvwm/geometry.c (get_page_offset_check_visible): new convenience function * fvwm/events.c (__handle_cr_on_client): fixed handling of gravities other than NW or Static (__cr_detect_icccm_move): fixed several bugs 2003-07-06 Marcus Lundblad * libs/BidiJoin.c: * libs/BidiJoin.h: * libs/BidiJoin.c: * libs/BidiJoin.h: * libs/CombineChars.c: * libs/CombineChars.h: * libs/Flocale.c (FlocaleEncodeString): * libs/FBidi.c: * libs/FBidi.h: * libs/Makefile.am: Removed "F" prefix on FBidiJoin.c, FBidiJoin.h, FCombineChars.c and FCombineChars.h 2003-07-06 olicha * libs/FRender.c (FRenderRender): Fixed compilation 2003-07-06 Dominik Vogt * fvwm/ewmh.c (ewmh_check_wm_pid): (EWMH_WindowInit): detect whether a window has _NET_WM_PID set; use that to detect ICCCM compliant ConfigureNotify handling 2003-07-05 Marcus Lundblad * libs/Flocale.c (FlocaleDrawUnderline): Commented out some non-working new code 2003-07-05 Marcus Lundblad * libs/Flocale.c (FlocaleDrawString): fixed drawing superimposed characters with a fontset 2003-07-05 Dominik Vogt * fvwm/events.c (__cr_detect_icccm_move): (__handle_cr_on_client): (__cr_get_grav_position): (__cr_get_static_position): * fvwm/window_flags.h: * fvwm/fvwm.h: try to autodetect whether application uses the icccm way of moving windows of the traditional way always using static gravity * acconfig.h: moved SIGNAL_RETURN macro definition to acconfig.h * fvwm/module_interface.c (DeadPipe): * fvwm/fvwm.c (SigDone): (Restart): (ReapChildren): use SIGNAL_RETURN macro * fvwm/events.c (__handle_cr_on_client): (__merge_cr_moveresize): (__cr_detect_icccm_move): * fvwm/events.c (__handle_cr_on_unmanaged): (__handle_cr_on_icon): (__handle_cr_on_shaped): (__handle_cr_restack): (__handle_cr_on_client): (HandleConfigureRequest): split the ConfigureRequest code into multiple functions * fvwm/update.c (apply_window_updates): fixed drawing of window decorations when "Style * Neverfocus" is used * fvwm/events.c (HandleKeyPress): fixed a bug with key binding contexts * fvwm/functions.c (__execute_function): * fvwm/expand.c (expand_vars): (expand_vars_extended): new extended variable $[func.context] * libs/Bindings.h: * libs/Bindings.c: moved some code to the new files * libs/charmap.h: * libs/charmap.c: * libs/modifiers.h: * libs/modifiers.c: * libs/wcontext.c: * libs/wcontext.h: new files * libs/Bindings.c: fixed a problem with uninitialised global variable 2003-07-04 Dominik Vogt * libs/Bindings.c (key_modifiers): moved to new file wcontext.c * libs/gravity.c (gravity_parse_dir_argument): added aliases for compass directions: - = N _ = S [ = W ] = E ^ = NE > = SE v = SW [ = nw . = center 2003-07-02 Marcus Lundblad * libs/FBidi.h: * libs/Flocale.c (FlocaleDrawString): (FlocaleRotateDrawString): Fixes to work without Fribidi 2003-07-01 Marcus Lundblad * todo-2.6: Updated 2003-07-01 Marcus Lundblad * libs/FbidiJoin.c (get_shaped_combined_char): (shape_n_join): Removed unused (get_shaped_combined_char) and commented out code Combining ligatures done in FCombineChars 2003-07-01 Marcus Lundblad * libs/Flocale.c (FlocaleDrawString): (FlocaleRotateDrawString): (FlocaleTextWidth): * libs/FBidi.h: * libs/FBidi.c (FBidiConvert): * libs/FBidiJoin.c: * libs/FCombineChars.h: * libs/FCombineChars.c (FCombineChars): Added support for drawing superimposed combining characters 2003-07-01 Dominik Vogt * fvwm/commands.h: * fvwm/functable.c (func_table): * fvwm/functions.c (CMD_TearMenuOff): (CMD_Title): (CMD_Silent): (CMD_Function): (CMD_KeepRc): merged all dummy commands into one: CMD_Dummy 2003-07-01 olicha * fvwm/menus.c (DestroyMenu): (do_menu): Cleanup 2003-07-01 Dominik Vogt * fvwm/menustyle.c (menustyle_copy): (copy_menu_style): renamed function 2003-06-30 Marcus Lundblad * todo-2.6: Updated 2003-06-30 olicha * fvwm/menus.c (do_menu): (DestroyMenu): (do_menu_close_tear_off_menu): (menu_close_tear_off_menu): Allowed to destroy tear off menu! * fvwm/menus.c (menu_tear_off): (menu_close_tear_off_menu): (do_menu_close_tear_off_menu): (clone_menu_root_static): (pop_menu_up): (menu_tear_off): (make_menu_window): (make_menu): (update_menu): Fixed client leaks (only create new client for menu if it is a tear off menu). Created a dedicated menu style for each tear off menu. * fvwm/menustyle.c (CMD_CopyMenuStyle): (copy_menu_style): * fvwm/menustyle.h: Split CMD_CopyMenuStyle into CMD_CopyMenuStyle and copy_menu_style 2003-06-30 Dominik Vogt * fvwm/virtual.c (do_move_window_to_desk): (UnmapDesk): fixed "Visible" condition on non current desks 2003-06-29 Dominik Vogt * **/*.c: * **/*.h: shortened some comments removed GPL from .h files added GPL to all .c files include config.h in all .c files added "/* -*-c-*- */" where missing some reformatting and reindenting * fvwm/module_interface.c: * fvwm/module_interface.h: * libs/Fft.c: * libs/Flocale.c: * libs/gravity.h: * libs/Flocale.h: * fvwm/screen.h: * fvwm/misc.c: * fvwm/misc.h: * fvwm/windowshade.c: * fvwm/virtual.c: * fvwm/conditional.c: * fvwm/geometry.h: * fvwm/geometry.c: * fvwm/borders.c: * fvwm/frame.h: * fvwm/frame.c: * fvwm/update.c: * fvwm/session.c: * fvwm/placement.c: * fvwm/menus.c: * fvwm/icons.c: * fvwm/events.c: * fvwm/add_window.c: * fvwm/session.h: * fvwm/placement.h: * fvwm/icons.h: * fvwm/eventhandler.h: * fvwm/fvwm.h: * fvwm/add_window.h: * fvwm/repeat.c: * fvwm/functions.c: * fvwm/functable.c: * fvwm/functable.h: * fvwm/functions.h: renamed types func_type, repeat_t, initial_window_options_t, frame_title_layout_type, rotation_t, direction_t, fvwm_msg_t, last_added_item_type, common_flags_type, multi_direction_type, msg_masks_type to ..._t * fvwm/functions.c (__execute_function): (execute_complex_function): * fvwm/condrc.c (condrc_init): new function in new file to encapsulate all cond_rc_t handling * fvwm/condrc.h: * fvwm/fvwm.h (cond_rc_t): (cond_rc_enum): moved typed to new file * fvwm/functable.h: * fvwm/commands.h: * fvwm/functable.c (func_table): * fvwm/functions.c (__run_complex_function_items): (__execute_function): * fvwm/conditional.c (CMD_Break): (__rc_matches_rcstring_consume): Break takes the number of function levels to break out of as an argument * fvwm/expand.c (expand_vars_extended): * fvwm/conditional.c (circulate_cmd): (select_cmd): (direction_cmd): (__rc_matches_rcstring_consume): (CMD_All): (CMD_WindowId): (CMD_TestRc): (CMD_Test): * fvwm/read.c: * fvwm/read.h: * fvwm/functions.h: * fvwm/functions.c: (__run_complex_function_items): (execute_complex_function): * fvwm/expand.h: * fvwm/expand.c: * fvwm/fvwm.h: * fvwm/conditional.c: renamed fvwm_cond_func_rc by cond_rc_t made a type a struct added a member to indicate the number of function levels to break out of * fvwm/functable.c (func_table): * fvwm/conditional.c (CMD_TestRc): replaced conditional commands: Cond -> TestRc CondCase -> KeepRc TestRc On -> Test (__rc_matches_rcstring_consume): new function * fvwm/conditional.c (CMD_CondCase): fixed the CondCase command 2003-06-19 Dominik Vogt * configure.in: new configure option --deisable-gtk to disable detection of gtk library * fvwm/fvwm.1.in: cleaned up documentation of conditional commands general man page cleanup 2003-06-17 Dan Espen * fvwm/builtins.c (ReadDecorFace): Off by one patch from Anil Madhavapeddy. 2003-06-17 Dominik Vogt * fvwm/fvwm.1.in: cleaned up of CirculateHit... conditions 2003-06-15 olicha * fvwm/style.c (__simplify_style_list): Fixed is_merged_allowed: rest it to True when cur change Added "upward" simplification 2003-06-14 olicha * fvwm/style.c (__simplify_style_list): (blocksintersect): (blockand): Fixed blockand which always returned True. Added blocksintersect which returns the same value as blockand but faster. 2003-06-13 olicha * configure.in: * acinclude.m4: Fixed fontconfig and xft2 for version without *-config binnary. Used pkg-config for this: new macro AM_CHECK_PKG_CONFIG. Really reject fontconfig and xft2 if the version is < the required version (even if --disable-*test). 2003-06-10 Dominik Vogt * libs/Graphics.c: define M_PI and M_PI_2 if they are not defined by math.h 2003-06-10 Mikhael Goikhman * libs/Colorset.c (LoadColorset): added a note to update Colorsets.pm too when the format is changed 2003-06-09 Mikhael Goikhman * WindowStyle_proposal.txt: s/WindowId/ThisWindow/ and other minor changes 2003-06-06 olicha * libs/PictureImageLoader.c (PImageLoadPng): Fixed loading of png images if the caller want no alpha 2003-06-04 olicha * libs/Flocale.c (FlocaleEncodeString): Fixed memroy leaks 2003-06-03 Mikhael Goikhman * libs/Makefile.am: only FCombineChars.c was distributed not FCombineChars.h 2003-06-03 Marcus Lundblad * libs/FCombineChars.c (convert_to_utf8) fixed a bug when converting back to UTF-8 and a bug giving garbage at end of string in some cases * libs/Flocale.c (FlocaleEncodeString) fixed problem regarding combining-characters when BIDI is used 2003-05-31 Marcus Lundblad * libs/Makefile.am: * libs/Flocale.c (FlocaleEncodeString): * libs/FCombineChars.c: * libs/FCombineChars.h: implemeted support for combining characters 2003-05-31 Mikhael Goikhman * configure.in: set the version 2.5.8 2003-05-30 Mikhael Goikhman * fvwm/builtins.c: * fvwm/fvwm2.1: SetEnv with only one parameter is ignored now 2003-05-30 Dan Espen * NEWS: Add 2.4.16 news. 2003-05-29 Mikhael Goikhman * fvwm/functions.c (expand_extended_var): (expand): fixed expanding variables that are empty, for example $[w.resource] or $[gt.a] or $[version.info] or $[EMPTY_STRING] * fvwm/fvwm.1.in: s/$w/$[w.id]/ 2003-05-29 olicha * fvwm/ewmh.c (ewmh_atom_wm_state): Do not claim that we support _NET_WM_STATE_FULLSCREEN 2003-05-28 olicha * NEWS: A TaskBar news 2003-05-27 Dominik Vogt * fvwm/focus.c (__update_windowlist): don't fiddle with the window list for windows that are going to be destroyed * fvwm/add_window.c (delete_client_context): (destroy_auxiliary_windows): (destroy_window): fixed empty frame windows when X reused the window id for a new window while the old one was scheduled to be destroyed 2003-05-26 olicha * fvwm/icons.c (GetIconBitmap): (set_icon_pixmap_background): (CreateIconWindow): (DrawIconPixmapWindow): (DrawIconWindow): Fixed loading of application supplied pixmap on 8/24 depth screen 2003-05-25 Dan Espen * fvwm/builtins.c (CMD_Exec): Another attempt to fix problem with Rox Filer. * fvwm/decorations.c: Sync up motif hints structure to aix,hp, solaris. 2003-05-24 Dominik Vogt * fvwm/misc.c (GrabEm): do not confine the pointer to the root window when grabbed; this can cause the pointer to be warped to another screen * fvwm/menus.c (get_menu_options): fixed placement of menus on Xinerama screens * libs/FScreen.c (FScreenGetResistanceRect): fixed function to do something useful * libs/Flocale.c (FlocaleDrawString): support font shadowing without colorsets * libs/ColorUtils.c: reformatted file * fvwm/menuitem.c (menuitem_paint): do not use colorsets in menus if they are not defined * fvwm/menustyle.c (menustyle_parse_style): fixed initialisation of MenuStyle colorsets when mwm/fvwm menu style is issued again 2003-05-23 olicha * fvwm/bindings.c (ParseBinding): (bind_get_bound_button_contexts): * libs/Bindings.c (GrabWindowButton): Fixed window button grabbing 2003-05-22 olicha * fvwm/colorset.c (parse_colorset): Fixed an uninit mem * fvwm/borders.c (border_fill_pixmap_background): Fixed problem with depth 1 pixmap * fvwm/conditional.c (CMD_On): Fixed memory leaks * fvwm/conditional.c (CreateConditionMask): Fixed memory leaks for layer and state 2003-05-22 Mikhael Goikhman * configure.in: added perllib/FVWM/Tracker/Makefile 2003-05-22 olicha * fvwm/fvwm.1.in: * fvwm/style.h: * fvwm/style.c (print_styles): * fvwm/builtins.c (CMD_PrintInfo): New style subject to PrintInfo 2003-05-20 olicha * libs/Flocale.c (FlocaleGetFontOrFontSet): Allowed empty xft font name * libs/Makefile.am: * libs/flist.c (new file): * libs/flist.h (new file): Added a flist structure and some basic function for handling such stucture * libs/FGettext.c (*): Use the new flist struct and functions interface * fvwm/screen.h (ScreenInfo): * fvwm/update.c (destroy_scheduled_windows): * fvwm/add_window.c (destroy_window): Added a list for the windows which are scheduled for destroy Remove a fw at once from the fw list when we destroy_window 2003-05-19 Dominik Vogt * fvwm/style.c (CMD_DestroyStyle): do not update windows if no style was deleted (check_window_style_change): fixed update of window styles w/ DestroyStyle 2003-05-18 olicha * fvwm/conditional.c (CMD_On): Added x,r,w,f and i file condition to the On command * fvwm/add_window.c (destroy_window): Fixed a memory leak (a FvwmWindow !) when a window is not destroyed but scheduled for destroy. Not sure that the fix is good. * fvwm/functions.c (__execute_function): * libs/defaults.h: Limited the depth of function to MAX_FUNCTION_DEPTH (=512). This fixes some cores dumps with "recursives" functions * fvwm/borders.c (border_create_root_transparent_pixmap): (border_draw_decor_to_pixmap): Fixed a core dump with a root transparent rotated title Fixed X errors 56 with RootTransparent titlebar and no E pixmap * libs/FGettext.c (fgettext_add_one_path): (FGettextInit): (FGettextSetLocalePath): Fixed memory leak and chainning * fvwm/builtins.c (CMD_PrintInfo): Fixed a parsing leak * fvwm/conditional.c (Circulate): Fixed a mask memory leaks * libs/defaults.h: * libs/Flocale.c (FlocaleGetFont): (FlocaleGetFontSet): (FlocaleGetFftFont): Fixed a core dump when a 0 font is given with an encoding hints. Added a default FFT font * fvwm/builtins.c (CMD_DefaultFont): Fixed a core dump when the default font change and a redraw (icon or window) is proceeded before flush_window_updates is called * fvwm/menustyle.c (CMD_CopyMenuStyle): Fixed gradients copy * fvwm/menustyle.c (menustyle_parse_style): Fixed UMR's related to colorset * fvwm/builtins.c (ReadDecorFace): Removed inconsistent #if 0 code and comments about leak and MiniIcon decor style. * fvwm/menustyle.h: * fvwm/menustyle.c (menustyle_free): Fixed a fore stipple gc leak * fvwm/windowlist.c (CMD_WindowList): Fixed a sor_keyname memory leak * fvwm/fvwm.c (ResetAllButtons): Fixed the default buttons memory leak 2003-05-08 olicha * fvwm/windowlist.c (CMD_WindowList): Fixed a memory leak if MaxLabelWidth is used 2003-05-08 Dominik Vogt * fvwm/functions.c (__context_has_window): (__execute_function): * fvwm/functions.h: fixed excution of functions requiring a window without a window when called with "silent" from a complex function 2003-05-07 olicha * libs/System.c (searchPath): Fixed a core dump 2003-05-04 Dominik Vogt * fvwm/move_resize.c (__move_loop): (__resize_window): fixed core dumps 2003-05-03 olicha * todo-2.6: Updated 2003-05-01 Bob Woodside * fvwm/NEWS: Minor typo corrections. 2003-04-28 Dominik Vogt * fvwm/move_resize.c (__move_loop): fixed UMR removed debug code (__resize_window): fixed UMR 2003-04-28 olicha * fvwm/ewmh.c (ewmh_atom_wm_state): (ewmh_HandleDock): * fvwm/ewmh_events.c (ewmh_WMStateStaysOnTop): (ewmh_WMStateStaysOnBottom): Fixed EwmhUseStackingHints and EwmhIgnoreStackingHints style update 2003-04-27 Dominik Vogt * fvwm/module_interface.c (do_execute_module): * fvwm/fvwm.c (main): * libs/envvar.c (flib_putenv): * fvwm/builtins.c (add_to_env_list): (CMD_SetEnv): (CMD_UnsetEnv): fixed putenv memory leaks * libs/envvar.c (strIns): removed debug code reformatted file (flib_putenv): replacement for putenv without memory leaks * fvwm/frame.c: removed debug code * fvwm/fvwm.c (StartupStuff): fixed UMR * fvwm/add_window.c (free_window_names): fixed memory leaks * fvwm/events.c (HandlePropertyNotify): fixed memory leak * fvwm/menus.c (do_menu): fixed core dump (__mloop_exit_selected): safety patch * fvwm/menucmd.c (menu_func): fixed memory leak * fvwm/builtins.c (CMD_Destroy): (CMD_Close): call destroy_window right after XKillClient; do not wait for the window to die on its own * fvwm/menucmd.c (menu_func): * fvwm/windowlist.c (CMD_WindowList): fixed core dumps 2003-04-26 Mikhael Goikhman * INSTALL.fvwm: several updates (FvwmGtk, gettext) 2003-04-26 Dominik Vogt * fvwm/menucmd.c (menu_func): * fvwm/windowlist.c (CMD_WindowList): * fvwm/menus.h: * fvwm/menus.c (is_double_click): (pop_menu_up): (pop_menu_down): (pop_menu_down_and_repaint_parent): (__mloop_get_event_timeout_loop): (__mloop_get_event): (__mloop_handle_event): (__mloop_select_item): (__mloop_make_popup): (__mloop_get_mi_actions): (__mloop_do_popup): (__mloop_do_menu): (__mloop_handle_action_with_mi): (__mloop_handle_action_without_mi): (__mloop_exit): (menu_enter_tear_off_menu): (menu_close_tear_off_menu): (do_menu): replaced the pfw and pcontext members of the MenuParameters structure with an execution context pointer (_menu_execute_function): wrapper function to simplyfy command execution from within menus (do_menu): fixed warping pointer to first menu item when invoked with the mouse * fvwm/execcontext.c: removed debug code 2003-04-26 Mikhael Goikhman * libs/XError.c: reformatted * fvwm.1.in: * fvwm.c: replaced "Mouse 0 R N Menu MenuFvwmRoot" binding with "Mouse 1 R A" 2003-04-25 Dominik Vogt * fvwm/menus.c (do_menu): the NoWarp position hint option works with root menus too * fvwm/ConfigFvwmDefaults: removed GrabFocusOff and GrabFocusTransient since they nullify the default with the plain focus policies 2003-04-24 olicha * fvwm/ewmh_events.c (ewmh_WMStateStaysOnBottom): Fixed a miss print in my previous commit * fvwm/ewmh_events.c (ewmh_WMStateStaysOnBottom): (ewmh_MoveResize) (ewmh_WMStateStaysOnBottom): * fvwm/ewmh.c (ewmh_AllowsMinimize): * fvwm/ewmh_intern.h: Added comment on the implementation at the top of ewmh.c. Fixed _NET_WM_MOVERESIZE. Added _NET_WM_ACTION_MINIMIZE in _NET_WM_ALLOWED_ACTIONS (almost nothing todo). Added _NET_WM_STATE_ABOVE (just an alias of _NET_WM_STATE_STAYS_ON_TOP) and _NET_WM_STATE_BELOW. * AUTHORS: Added David Fries. Updated my entries. * todo-2.6: One update 2003-04-23 olicha * fvwm/module_interface.c (CMD_KillModule): Fixed a leak when we have an alias * libs/Picture.c (PFreeFvwmPictureData): * libs/Picture.h: New interface function for just freeing the allocated data (not the pixmaps). 2003-04-22 olicha * fvwm/colorset.c (get_root_pixmap): Fixed a minor memory leak * fvwm/functions.c (execute_complex_function): Fixed uninitialized d.type * libs/Ficonv.c (FiconvSetupConversion): (FiconvUtf8ToCharset): (FiconvCharsetToUtf8): Formating clean-up * fvwm/ewmh_names.c (EWMH_SetVisibleName): (EWMH_WMIconName): (EWMH_WMName): Fixed a core dump and safety check related to not loaded font 2003-04-19 Dominik Vogt * libs/Module.h: reformatted 2003-04-16 olicha * fvwm/ewmh_events.c (ewmh_CloseWindow): (ewmh_MoveResize): (ewmh_WMState): (ewmh_WMStateHidden): Check if functions are allowed * fvwm/ewmh.c (ewmh_HandleDesktop): (ewmh_HandleDock): Set Desktop and Dock uniconifiable and unmaximazable * fvwm/menuitem.c (menuitem_paint): * fvwm/screen.h: Fixed greyed action with EWMH desktop 2003-04-16 Mikhael Goikhman * NEWS: documented FvwmEvent behaviour of executing window related event handlers within a window context * fvwm/fvwm.1.in: updated WindowId entry 2003-04-15 Dominik Vogt * fvwm/schedule.c (deschedule): (squeue_execute): (execute_obj_func): * fvwm/module_interface.c (DeleteMessageQueueBuff): (ExecuteCommandQueue): * libs/queue.c (fqueue_init): (fqueue_remove_or_operate_from_front): (fqueue_remove_or_operate_from_end): (fqueue_remove_or_operate_all): (fqueue_init): (fqueue_unlock_queue): (fqueue_lock_queue): (fqueue_add_at_front): (fqueue_add_inside): (fqueue_get_first): core dump fixes * libs/queue.c (fqueue_remove_or_operate_all): (fqueue_remove_or_operate_from_end): (fqueue_remove_or_operate_from_front): * fvwm/module_interface.c (DeleteMessageQueueBuff): (ExecuteCommandQueue): * fvwm/schedule.c (deschedule): (check_deschedule_obj_func): (deschedule_obj_func): (squeue_execute): (check_execute_obj_func): (execute_obj_func): (copy_obj_func): core dump fixes 2003-04-15 Mikhael Goikhman * fvwm/ConfigFvwmDefaults: * fvwm/fvwm.1.in: * fvwm/windowlist.c: * sample.fvwmrc/system.fvwm2rc-sample-95: * NEWS: WindowListFunc is executed now within a window context, so "WindowId $0" is not needed anymore in its definition 2003-04-14 olicha * fvwm/fvwm.1.in: * NEWS: Documented LocalePath and $[gt.str]. FvwmScript news. * fvwm/expand.c (expand_vars_extended): Fixed $[gt.str] expansion * configure.in: New gettext domain FvwmScript * libs/FGettext.c (FGettextCopy): * libs/FGettext.h: New interface function which copies the string 2003-04-14 Dominik Vogt * fvwm/conditional.c (CMD_Cond): allow to negate the condition code with '!' prefix * fvwm/schedule.c (CMD_Schedule): (CMD_Deschedule): support hexadecimal ids * libs/Parse.c (GetIntegerArguments): (_get_suffixed_integer_arguments): (GetSuffixedIntegerArguments): (GetIntegerArgumentsAnyBase): new utitily function to allow hexadecimal integer arguments 2003-04-10 olicha * libs/Flocale.c (FlocaleGetFullNameOfFontStruct): (FlocaleGetCharsetOfFontStruct): (FlocaleGetCharsetFromName): (FlocaleFixNameForFontSet): (FlocaleGetFontSet): (FlocalePrintLocaleInfo): * libs/FlocaleCharset.h: * libs/FlocaleCharset.c (FlocaleCharsetIsCharsetXLocale): (FlocaleCharsetPrintXOMInfo): Load a FontSet only when this is reasonable. Finished PrintInfo locale 2 2003-04-08 olicha * libs/defaults.h (FLOCALE_MB_FALLBACK_FONT): fixed the default font name 2003-04-07 Mikhael Goikhman * fvwm/events.c (HandlePropertyNotify): * fvwm/ewmh_names.c (EWMH_WMName, EWMH_WMIconName): completely ignore application requests to set exactly the same window name or icon name (xmms sets it every second), this avoids some redundant module messages and redraws 2003-04-05 Mikhael Goikhman * Makefile.am: fixed DIST 2003-04-04 olicha * configure.in: Fixed a miss print in fribidi config check 2003-04-04 Dominik Vogt * fvwm/focus.c (__restore_focus_after_unmap): iconified windows without an icon do not receive focus 2003-03-29 Dominik Vogt * fvwm/virtual (CMD_GotoDeskAndPage): different "GotoDeskAndPage prev" fix that works with any viewports, not just multiples of the screen size 2003-03-29 Mikhael Goikhman * fvwm/virtual (CMD_GotoDeskAndPage): fixed "GotoDeskAndPage prev" with desks larger than 2x2 2003-03-28 Dominik Vogt * ETHICAL_LICENSE: added file * fvwm/menucmd.c (menu_func): fixed double key presses to choose default menu action * fvwm/focus.c (__update_windowlist): fixed order of window list with SloopyFocus when using the Focus command 2003-03-22 Mikhael Goikhman * fvwm/fvwm.1.in: clarified some things, typo fixed 2003-03-19 Dominik Vogt * libs/Colorset.c (CreateBackgroundPixmap): (GetWindowBackgroundPixmapSize): (get_aspect_dimensions): fixed size calculation of aspect pixmaps 2003-03-16 Dominik Vogt * fvwm/icons.c (clear_icon): (clear_icon): (AutoPlaceIcon): (Iconify): * fvwm/geometry.c (get_icon_geometry): (modify_icon_position): set a valid icon picture position if there is neither a picture nor a title 2003-03-15 Dominik Vogt * NEWS: * AUTHORS: reformatted to fit better on the web page 2003-03-15 Mikhael Goikhman * todo-2.6: added items from "My TODO" message on 2003-01-02 * fvwm/fvwm.1.in: actually remove duplicate Iconify entry, use $[w.id] not $w, more fixes 2003-03-14 Dominik Vogt * libs/FScreen.c: removed debug output 2003-03-13 Dominik Vogt * libs/FScreen.c (FScreenMangleScreenIntoUSPosHints): (FScreenFetchMangledScreenFromUSPosHints): two functions to allow USPosition hints from modules and StartsOnScreen work at the same time * fvwm/conditional.c (direction_cmd): Some fixes, reformatting and improvements. 2003-03-12 Dominik Vogt * fvwm/icons.c (Iconify): initialise icon position to +0+0 if there is neiter a picture nor a title * fvwm/functions.c (DeferExecution): action trigger fix * todo-2.6 (todo): closed some items * fvwm/update.c (apply_window_updates): fixed drawing of sticky icon titles when the stickyicon style is being set 2003-03-11 Dominik Vogt * fvwm/placement.c (CMD_PlaceAgain): * fvwm/add_window.c (setup_window_placement): * fvwm/virtual.c (MapDesk): update the GNOME hints desk when changing desks; fixes placeagain with stickyicon style some placeagain fixes * fvwm/fvwm.1.in (Example): removed duplicate Iconify section * todo-2.6 (todo): closed C.11 * fvwm/functable.c (func_table): * fvwm/functions.h (func_type): * fvwm/functions.c (__execute_function): (execute_complex_function): (DeferExecution): fixed a new and and old window selection bug 2003-03-09 Dan Espen * todo-2.6 (todo): Close C.13 (861): cant reproduce, no problems detected with Purify. 2003-03-09 Dominik Vogt * libs/Colorset.c (SetWindowBackgroundWithOffset): use None, not 0 for Window structures * fvwm/events.c (InitEventHandlerJumpTable): (HandleKeyRelease): (__handle_key_event): * fvwm/bindings.c (ParseBinding): (activate_binding): * libs/Bindings.h: * fvwm/fvwm.1.in: removed key release binding because they can not work reliably 2003-03-03 Dominik Vogt * fvwm/functable.c (func_table): trigger on ButtonPress for many of the functions * fvwm/functions.c (__execute_function): (__execute_function): fixed conditional commands a la "Current" triggered on root window 2003-03-01 Dan Espen * todo-2.6: Closed B.2, C.21. 2003-02-28 olicha * libs/defaults.h: * fvwm/events.c (HandleConfigureRequest): Added a workaround for application with broken max/min size hints vs a size configure request. This "fixes" floating java JToolBar. * fvwm/add_window.c (GetWindowSizeHints): Check that the max size hint is not broken relatively to the the base size hint 2003-02-28 Dominik Vogt * NEWS: * configure.in: released 2.5.6, set version to 2.5.7 * NEWS: * configure.in: updated for 2.5.6 2003-02-26 Tony Finch * fvwm/borders.c (border_draw_one_border_part): Don't draw the handle relief marks when the border is flat. 2003-02-27 Mikhael Goikhman * configure.in: s/fribdi_in_path/fribidi_in_path/ * todo-2.6: spell checking and some reformatting 2003-02-26 olicha * fvwm/borders.c (border_setup_bar_pixmaps): Fixed a miss-print which can cause a core dump * todo-2.6: Added a 2.6 TODO file 2003-02-25 Dan Espen * fvwm/focus.c (focus_grab_buttons): Fix compile problems Forte7, void functioin cannot return a value. 2003-02-25 olicha * configure.in: Fixed compilation warning if fribidi is in path 2003-02-24 Dominik Vogt * fvwm/windowlist.c (CMD_WindowList): removed unused instruction 2003-02-22 Dan Espen * configure.in: Remove nested function from -Werror check. Lets configure work without gcc. * fvwm/read.h: * fvwm/read.c (run_command_stream): Make Break work from PipeRead. 2003-02-21 Dan Espen * fvwm/functions.c (__run_complex_function_items): Make Break start working again. 2003-02-21 Dominik Vogt * fvwm/move_resize.c (get_outline_rects): (draw_move_resize_grid): initial drawing and final undrawing of wire frame no longer toggles the pixel in the top left corner of the screen * fvwm/expand.c (expand_vars): disabled warnings about one letter variables 2003-02-17 Dan Espen * README: Update to reflect release 2.5.x. * NEWS: Update news for FvwmPager drag fix. 2003-02-15 olicha * fvwm/fvwm.1.in: Fixed a typo 2003-02-13 olicha * fvwm/gnome.c (GNOME_SetClientList): Applied David Fries patch which fixes a possible crash with more than 256 windows (GNOME_SetClientList): malloc -> safemalloc 2003-02-09 Dan Espen * fvwm/fvwm.1.in (Note): Update %space/%tab description in menu. Give the XorValue range. 2003-02-08 Dan Espen * fvwm/fvwm.1.in: Fully document the emulate command. 2003-02-06 olicha * fvwm/borders.c (get_common_decorations): (border_get_border_background): 2003-02-05 Dan Espen * fvwm/builtins.c (CMD_Exec): Use STDIN_FILENO instead of a zero. 2003-02-03 Dominik Vogt * fvwm/menuitem.h: * fvwm/menuitem.c (menuitem_get_size): * fvwm/menus.c (calculate_item_sizes): renamed "mips" to mipst * fvwm/menuitem.c (menuitem_get_item_size): * fvwm/menus.c (_calculate_item_sizes): backed out patch from 30-Jan-2003 2003-01-30 Dominik Vogt * fvwm/menuitem.h: * fvwm/menuitem.c (menuitem_get_item_size): * fvwm/menus.c (_calculate_item_sizes): functions renamed due to global name space collision with IRIX 6.5 2003-01-26 Dominik Vogt * configure.in: added tests/hints/Makefile.am 2003-01-24 Dan Espen * fvwm/fvwm.1.in: Fixed next->previous in Prev command. 2003-01-20 Dan Espen * sample.fvwmrc/DecorWin95: * sample.fvwmrc/DecorMwm: Remove bad mouse binding, that I meant to Replace a long time ago. 2003-01-20 Dominik Vogt * fvwm/stack.c (new_layer): (collect_transients_recursive): (__restack_window): fixed Layer command * fvwm/events.c (HandleConfigureRequest): fixed placement of icons fixed size calculations of icons 2003-01-18 Mikhael Goikhman * fvwm/expand.c: fixed $[desk.name] that was masked by $[desk.n], added $[desk.pagesx] and $[desk.pagesy] 2003-01-16 Dan Espen * NEWS: Update news. Spelling fixes 2.5.x news. * fvwm/builtins.c (CMD_Exec): Close stdin so the exec'd process knows its not interactive. 2003-01-12 Mikhael Goikhman * fvwm/functable.c: added a short description together with the commands 2003-01-12 Marcus Lundblad * NEWS: Added conditionals Closable,Iconifiable,Maximizable,FixedSize and HasHandles 2003-01-11 Mikhael Goikhman * expand.c: * NEWS: deprecate all single letter variables, new variables are supported now $[w.id], $[w.name], $[w.iconname], $[w.class], $[w.resource], $[desk.n], $[version.num], $[version.info], $[version.line]. 2003-01-07 Marcus Lundblad * fvwm/style.c (style_parse_one_style_option): * fvwm/fvwm.1.in: Removed duplicate styles Unclosable,Unmaximizable,Uniconifiable and DisallowMaximizeFixedSize 2003-01-06 Dan Espen * fvwm/fvwm.1.in: Lang check. 2003-01-03 olicha * fvwm/commands.h: * INSTALL.fvwm: * fvwm/ewmh.h: * fvwm/ewmh_intern.h: * fvwm/ewmh_names.c: * fvwm/ewmh_icons.c: * fvwm/ewmh_events.c: * fvwm/ewmh_conf.c: * fvwm/ewmh.c: * fvwm/gnome.c: * fvwm/gnome.h: * fvwm/functable.c (func_table): * fvwm/fvwm.c (setVersionInfo): * acconfig.h: * configure.in: Removed GNOME and HAVE_EWMH ifdef * fvwm/fvwm.1.in: Documented UseTitleDecorRotation 2003-01-03 Mikhael Goikhman * fvwm/module_interface.c (MoveViewport): * fvwm/virtual.c (CMD_DesktopSize, CMD_Send_WindowList): M_NEW_PAGE now has 7 arguments 2003-01-02 olicha * fvwm/fvwm.1.in: Documented the new icon style options * fvwm/fvwm.h: * fvwm/icons.h: * fvwm/icons.c (DrawIconTitleWindow): (DrawIconPixmapWindow): (setup_icon_title_size): * fvwm/style.c (style_parse_one_style_option): Fixed IconTitleRelief and IconBackgroundRelief arguments * fvwm/icons.c (GetIconPicture): (SetIconPixmapSize): Fixed IconSize style for non shaped depth > 1 pixmaps 2003-01-02 Mikhael Goikhman * NEWS: * fvwm/commands.h: * fvwm/conditional.c (CMD_On): * fvwm/functable.c: * fvwm/fvwm.1.in: new conditional command On for non-window related conditions * fvwm/execcontext.h: * fvwm/fvwm.c (Done, SetRCDefaults, StartupStuff): two new exec contexts for restarting 2003-01-02 olicha * fvwm/builtins.c (ReadMultiPixmapDecor): StretchedPixmap -> AdjustedPixmap * fvwm/fvwm.1.in: Documented Colorset in BorderStyle, TitleStyle and ButonsStyle Documented the new MultiPixmap syntax 2002-12-31 Mikhael Goikhman * NEWS: * fvwm/fvwm.1.in: * fvwm/builtins.c (ReadTitleButton): * fvwm/screen.h: new button state shortcuts AllActiveUp, AllActiveDown, AllInactiveUp, AllInactiveDown 2002-12-31 olicha * libs/PictureGraphics.c (PCopyArea): Fixed rendering of depth 1 pixmap with a mask * fvwm/update.c (apply_window_updates): Fixed icon bg cset update * fvwm/events.c (HandlePropertyNotify): * fvwm/geometry.c (move_icon_to_position): Fixed non shaped icons with a bg padding but without cs bg * NEWS: * fvwm/style.c (style_parse_icon_size_style): (merge_styles): * fvwm/fvwm.h (window_style): * fvwm/add_window.c (setup_icon_size_limits): * fvwm/icons.c (SetIconPixmapSize): (GetIconPicture): New option to IconSize style: Adjusted, Streched, Shrunk * fvwm/icons.c (SetIconPixmapSize): (GetIconPicture): Always center the icon with IconSize if the icon has a background 2002-12-30 Mikhael Goikhman * configure.in: FvwmWindowMenu renaming; compact long diagnostics into half of line * NEWS: documeted and corrected new features * fvwm/fvwm.1.in: removed a "deprecated" tag from TitleStyle/ButtonStyle/BorderStyle since these are the only way currently to create themes * fvwm/fvwm.c: small reformatting 2002-12-30 olicha * NEWS: * fvwm/icons.c (setup_icon_title_size): (set_icon_pixmap_background): (CreateIconWindow): (DrawIconTitleWindow): (DrawIconPixmapWindow): (DrawIconWindow): (ChangeIconPixmap): (RedoIconName): * fvwm/events.c (HandleEnterNotify): (HandleExpose): (HandleLeaveNotify): (HandlePropertyNotify): * fvwm/borders.c (border_draw_decorations): * fvwm/default.h: * fvwm/fvwm.h: * fvwm/add_window.c (setup_icon_background_parameters): (setup_icon_title_parameters): (setup_style_and_decor): (setup_icon_font): * fvwm/geometry.c (move_icon_to_position): * fvwm/style.h: * fvwm/style.c (check_window_style_change): (update_style_colorset): (update_icon_title_cs_style): (update_icon_title_cs_hi_style): (update_icon_background_cs_style): (merge_styles): * fvwm/update.h: * fvwm/update.c (apply_window_updates): New style options IconBackgroundColorset, IconTitleColorset, HilightIconTitleColorset, IconTitleRelief, IconBackgroundRelief and IconBackgroundPadding 2002-12-28 Mikhael Goikhman * libs/FShm.h: fixed compilation without XShm * fvwm/borders.c (border_rotate_titlebar_descr): fixed warning: deprecated use of label at end of compound statement 2002-12-27 olicha * fvwm/ConfigFvwmDefaults: UseTitleDecorRotation is a default * libs/Graphics.c (do_relieve_rectangle_with_rotation): (do_relieve_rectangle): * libs/fvwmlib.h: * fvwm/borders.c (border_draw_title_stick_lines): (border_create_root_transparent_pixmap): (border_mp_render_into_pixmap): (border_draw_decor_to_pixmap): (border_mp_render_into_pixmap): (border_mp_get_titlebar_descr): (border_mp_draw_mp_titlebar): (border_draw_decor_to_pixmap): (border_set_button_pixmap): (border_get_titlebar_draw_descr): (border_set_title_pixmap): (border_rotate_titlebar_descr): (border_get_titlebar_descr): Completed UseTitleDecorRotation 2002-12-26 olicha * fvwm/update.c (apply_window_updates): * fvwm/frame.c (frame_get_titlebar_dimensions): (frame_set_decor_gravities): * fvwm/borders.c (border_set_button_pixmap): (border_get_titlebar_descr): (border_draw_one_button): Buttons order follows the title text rotations. More UseTitleDecorRotation preparation * fvwm/borders.c (border_draw_decor_to_pixmap): Fixed SolidButton 2002-12-24 olicha * fvwm/borders.c (border_mp_render_into_pixmap): (border_fill_pixmap_background): Some borders drawing fixes * libs/Graphics.c (CreateRotatedPixmap): * fvwm/geometry.c (get_title_font_size_and_offset): * fvwm/update.c (apply_window_updates): * fvwm/borders.c (border_set_button_pixmap): (border_get_titlebar_draw_descr): (border_draw_title): (border_rotate_titlebar_descr): (border_get_titlebar_descr): More UseTitleDecorRotation preparation 2002-12-22 Dan Espen * fvwm/add_window.c (GetWindowSizeHints): Change hint warning message so we won't get so many application bugs report to fvwm-workers. * fvwm/fvwm.1.in: Grammar: allows to -> allows for. 2002-12-21 Marcus Lundblad * fvwm/style.c (style_parse_one_style_option): * fvwm/style.h: * fvwm/fvwm.h: * fvwm/window_flags: * fvwm/decorations.c (is_function_allowed, __is_resize_allowed): Added styles Closable, Iconifiable, Maximizable and AllowMaximizeFixedSize * fvwm/conditional.c (MatchesConditionMask, CreateConditionMask): Added conditionals Closable,Iconifiable and Maximizable * fvwm/fvwm.1.in: Documented styles Closable, Iconifiable, Maximizable and AllowMaximizeFixedSize and conditionals Closable,Iconifiable and Maximizable 2002-12-20 olicha * fvwm/window_flags.h: * fvwm/update.h: * fvwm/update.c (apply_window_updates): * fvwm/style.h: * fvwm/style.c (style_parse_one_style_option): * fvwm/fvwm.h: UseTitleDecorRotation style preparation * fvwm/fvwm.c (main): Use best TrueColor visual * fvwm/borders.c (border_get_border_gcs): Create the transparent_gc with the Scr.NoFocusWin and not the FW_W_FRAME window which may have a depth != Pdepth * fvwm/menus.c (paint_side_pic): * fvwm/menuitem.c (menuitem_paint): * fvwm/icons.c (DrawIconPixmapWindow): * fvwm/colorset.c (parse_colorset): * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): Used Scr.AlphaGC 2002-12-19 olicha * libs/Graphics.c (CreateRotatedPixmap): * libs/fvwmlib.h: New interface function CreateRotatedPixmap * libs/PictureImageLoader.c (PImageCreatePixmapFromArgbData): (PImageLoadXpm): * libs/PictureGraphics.c (PCreateRenderPixmap): (PCreateDitherPixmap): * libs/Graphics.c (CreateGradientPixmap): (CreateRotatedPixmap): * acconfig.h: * configure.in: * libs/FShm.h (new file): * libs/FImage.h (new file): * libs/FImage.c (new file): * libs/Makefile.am: * fvwm/fvwm.c (setVersionInfo): Added MIT Shared Memory Extension for XImage * NEWS: Some news * fvwm/screen.h: * fvwm/builtins.c (ReadDecorFace): (FreeDecorFace): * fvwm/borders.c (border_draw_decor_to_pixmap): (border_fill_pixmap_background): AdjustedPixmap, StretchedPixmap and ShrunkPixmap 2002-12-17 Mikhael Goikhman * libs/FBidiJoin.c: shape-and-join fixes from Nadim Shaikli (slightly modified) 2002-12-16 olicha * libs/PictureGraphics.h: * libs/PictureGraphics.c (PTileRectangle): (PGraphicsCreateTiledPicture): * libs/Graphics.c (CreateTiledPixmap): New interface function: PGraphicsCreateTiledPicture * fvwm/screen.h: * fvwm/fvwm.c (CreateGCs): Added a global (Scr) alpha GC * configure.in: * fvwm/screen.h: * fvwm/builtins.c (ReadMultiPixmapDecor): (update_decorface_colorset): (FreeDecorFace): * fvwm/borders.c (border_get_tb_parts_to_draw): (border_fill_pixmap_background): (border_setup_bar_pixmaps): (border_get_bar_pixmaps): (border_free_bar_pixmaps): (border_mp_render_into_pixmap): (border_mp_get_length): (border_mp_get_titlebar_descr): (border_mp_get_geometry): (border_mp_get_use_title_style_parts_and_geometry): (border_mp_draw_mp_titlebar): (border_draw_decor_to_pixmap): (border_draw_title_deep): (border_get_titlebar_draw_descr): (border_setup_use_title_style): (border_get_titlebar_descr_state): (border_get_titlebar_descr): (border_get_transparent_decorations_part): (border_draw_title_stick_lines): MultiPixmap can use Colorset and Solid color. Various others minor improvement in MultiPixmap. "Merge" the MultiPixmap code into the "main" drawing code and remove the #ifdef. New option to ButtonStyle and TitleStyle: StretchedPixmap. Use the new Scr.AlphaGC. 2002-12-16 Dominik Vogt * fvwm/add_window.c (validate_transientfor): do not ignore transientfor hint for iconified windows 2002-12-12 Jason Weber * fvwm/fvwm.1.in: * fvwm/conditional.c (CMD_ScanForWindow): * fvwm/commands.h: * fvwm/functable.c: rename ScanWindow to ScanForWindow 2002-12-12 Dominik Vogt * fvwm/menuitem.c (menuitem_paint): * fvwm/colorset.c (parse_colorset): * fvwm/icons.c (DrawIconPixmapWindow): * fvwm/focus.c (_SetFocusWindow): (_ReturnFocusWindow): (_DeleteFocus): (_ForceDeleteFocus): (__activate_window_by_command): patches to prevent UMR messages in memory debuggers 2002-12-11 Jason Weber * fvwm/fvwm.1.in: Added ScanWindow * fvwm/conditional.c (CMD_Direction, CMD_ScanWindow, direction_cmd): * fvwm/commands.h: * fvwm/functable.c: Generalized CMD_Direction into direction_cmd. Pipe CMD_Direction and CMD_ScanWindow into direction_cmd. Replace Cycle prefix with secondary direction argument. 2002-12-10 Dan Espen * fvwm/fvwm.1.in: Applied Mikhael's quote fix. 2002-12-05 Marcus Lundblad * fvwm/conditional.c (CreateConditionMask): Implemented conditional "FixedSize" and "HasHandles" * fvwm/fvwm.1.in Documented conditional options "FixedSize" and "HasHandles". 2002-12-08 Dominik Vogt * fvwm/placement.c (PlaceWindow): fixed StickyAcrossDesks w/ StartsOnPage * fvwm/functable.c: * fvwm/commands.h: * fvwm/ewmh_conf.c (set_state_workaround): * fvwm/update.c (apply_window_updates): * fvwm/windowlist.c (CMD_WindowList): * fvwm/ewmh_events.c (ewmh_WMDesktop): (ewmh_WMStateSticky): * fvwm/conditional.c (CreateConditionMask): * fvwm/gnome.c (GNOME_SetHints): (GNOME_GetStyle): (GNOME_HandlePropRequest): * fvwm/placement.c (SmartPlacement): (get_next_x): (get_next_y): (test_fit): (PlaceWindow): * fvwm/session.c (SaveWindowStates): (MatchWinToSM): (MatchWinToSM): * fvwm/ewmh.c (check_desk): (EWMH_SetWMDesktop): (ewmh_ComputeAndSetWorkArea): (ewmh_HandleDynamicWorkArea): (ewmh_HandleDesktop): (ewmh_HandleDock): (ewmh_HandleMenu): (ewmh_HandleToolBar): * fvwm/virtual.c (UnmapDesk): (MapDesk): (MoveViewport): (do_move_window_to_desk): * fvwm/icons.c (setup_icon_title_size): (DrawIconTitleWindow): (AutoPlaceIcon): (Iconify): * fvwm/borders.c (is_button_toggled): (get_common_decorations): (border_draw_title_stick_lines): * fvwm/add_window.c (AddWindow): * fvwm/move_resize.c (__move_window): (__move_window): (is_window_sticky_across_pages): (is_window_sticky_across_desks): (MaximizeHeight): (MaximizeWidth): (stick_page): (stick_desk): (CMD_Stick): (CMD_StickAcrossPages): (CMD_StickAcrossDesks): (stick_across_pages): (stick_across_desks): (handle_stick_across_desks): (handle_stick_across_pages): (handle_stick): * fvwm/fvwm.h (struct): * fvwm/style.c (style_parse_one_style_option): (check_window_style_change): * fvwm/style.h: * fvwm/window_flags.h: renamed StickDesk to StickAcrossDesks, StickyDesk to StickyAcrossDesks, StickPage to StickAcrossPages and StickyPage to StickyAcrossPages everywhere * fvwm/focus.c (CMD_Focus): (CMD_FlipFocus): (__activate_window_by_command): (__update_windowlist): (__set_focus_to_fwin): (_SetFocusWindow): (_ReturnFocusWindow): (_DeleteFocus): (_ForceDeleteFocus): fixed window list order with FlipFocus command 2002-12-08 Mikhael Goikhman * AUTHORS: * NEWS: document bidi entry undocumented in 2.5.5 2002-12-06 olicha * acinclude.m4: Fixed the "detection" of the LINGUAS variable * configure.in: Added ar to ALL_LINGUAS 2002-12-05 Dominik Vogt * fvwm/move_resize.c (__resize_window): fixed handling of MontionNotify and PropertyNotify events 2002-12-03 olicha * fvwm/borders.c (border_draw_decor_to_pixmap): (border_get_border_background): (get_common_decorations): BorderGC cleanup * fvwm/builtins.c (CMD_PrintInfo): New subject nls to PrintInfo * libs/FGettext.c (*): New command FlocalePath 2002-12-02 Dominik Vogt * NEWS: * configure.in: changed version to 2.5.6 * NEWS: * configure.in: updated for 2.5.5 2002-12-02 olicha * libs/FRenderInit.c (FRenderInit): Fixed alpha depth if !XRenderSupport * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): * libs/PictureImageLoader.c (PImageCreatePixmapFromArgbData): (PImageLoadPng): * libs/PictureImageLoader.h: Fixed image loading on bigedian machine 2002-12-01 Mikhael Goikhman * libs/FBidi.c (FBidiConvert): several small changes * libs/FBidiJoin.c (shape_n_join): enabled a new bidi shaping code 2002-11-29 Dominik Vogt * fvwm/frame.c (frame_restore_client_gravities): (frame_free_move_resize_args): fixed a redrawing problem after shading a window 2002-11-29 olicha * acinclude.m4: Defined AM_PATH_PROG_WITH_TEST and re-enable it * configure.in: * Makefile.am: Fixed two missprints 2002-11-29 Dominik Vogt * fvwm/bindings.c (ParseBinding): fix for stroke-less compile 2002-11-29 olicha * fvwm/commands.h (enum): * fvwm/functable.c (func_table): * fvwm/builtins.c (CMD_LocalePath): * libs/FGettext.c (FGettextSetLocalePath): * libs/FGettext.h: Preparation for LocalePath command * fvwm/screen.h (ScreenInfo): * fvwm/fvwm.c (CreateGCs): Rename Scr.TileGC to Scr.BordersGC * acinclude.m4: A libintl autoconf fix * libs/Colorset.c (CreateBackgroundPixmap): Do not grab the server when we dump the E setroot pixmap 2002-11-29 olicha * acconfig.h: * fvwm/Makefile.am: * Makefile.am: * configure.in: * acinclude.m4: Added NLS support with gnu gettext * fvwm/fvwm.c (main): FGettextInit * fvwm/expand.c (expand_vars_extended): New extanded variable $[gt.any_string] * fvwm/virtual.c (CMD_DesktopName): * fvwm/windowlist.c (get_desk_title): * fvwm/expand.c (expand_vars_extended): * fvwm/fvwm.c (SetRCDefaults): * fvwm/ConfigFvwmSetup: Mark some strings to be translated * libs/FGettext.c (new file): * libs/FGettext.c (new file): * libs/Makefile.am: gnu gettext libintl warper 2002-11-29 Dominik Vogt * fvwm/add_window.c (RestoreWithdrawnLocation): rixed rxvts with S/E gravity travelling off screen upon recapture after they were resized. * fvwm/events.c (__handle_key_event): * fvwm/bindings.c (activate_binding): (__rebind_global_key): fixed unbinding pointerkey bindings removing the grab for this key completely * fvwm/events.c (__is_bpress_window_handled): fixed click on override redirect windows being handled by the root window * fvwm/misc.c (GrabEm): confine the pointer to the root window when grabbed * fvwm/events.c (HandleUnmapNotify): fixed reparenting problem with restarts from desks != 0 2002-11-28 Dominik Vogt * fvwm/events.c: removed experimental code 2002-11-28 olicha * fvwm/borders.c (border_get_border_background): (border_draw_decor_to_pixmap): (border_fill_pixmap_background): Scr.TitleGC/Scr.TileGC cleanup. I will rename TileGC to BorderGC soon. 2002-11-26 Mikhael Goikhman * fvwm/fvwm.c (InitVariables): fixed DEFAULT_EDGE_SCROLL being interpretted as 100 pixels instead of 100% * fvwm/virtual.c (CMD_EdgeScroll): minor spacing * fvwm/ConfigFvwmDefaults: do not include empty ConfigFvwmProxyDefaults, added one binding 2002-11-26 olicha * libs/Colorset.c (CreateBackgroundPixmap): * fvwm/colorset.c (parse_colorset): Be more safe with the E root pixmap 2002-11-25 olicha * fvwm/move_resize.c (__move_loop): Redraw the transparent decoration parts when a move is abored * fvwm/colorset.c (parse_colorset): Fixed the fgsh Colorset colors when the Image change but not the bg 2002-11-24 Jason Weber * fvwm/conditional.c (CMD_Direction): Extended Direction to allow CycleWest, CycleEast, etc that guarantees eventual traversal of all windows over repeated calls. It also cycles back to the opposite extent when it hits the limit in the given direction. 2002-11-22 olicha * fvwm/borders.h: * fvwm/borders.c (get_common_decorations): (border_get_parts_and_pos_to_draw): (border_get_changed_border_parts): (border_get_frame_pixmap, new): (border_get_border_background): (border_draw_one_border_part): (border_draw_decorations): (border_get_tb_parts_to_draw): (border_fill_pixmap_background): (border_get_titlebar_descr_state, new): (border_draw_titlebar): (border_setup_bar_pixmaps, new): (border_get_bar_pixmaps, new): (border_free_bar_pixmaps, new): (border_setup_use_title_style, new): (border_set_button_pixmap): (border_set_title_pixmap): (border_draw_one_button): (border_set_button_pixmap): (border_draw_title_deep): (border_get_transparent_decorations_part, new): Title, Border and Buttons Style Colorset Option: Drawing * fvwm/move_resize.c (AnimatedMoveAnyWindow): (__move_window): (__move_loop): * fvwm/frame.c (__frame_setup_window): (frame_has_handles_and_tiled_border): (frame_create_move_resize_args): (frame_free_move_resize_args): Title, Border and Buttons Style Colorset Option: External drawing stuff. Basically additional redrawing for RootTransparent * fvwm/builtins.c (update_decorface_colorset, new): (update_titlebutton_colorset, new): (update_decors_colorset, new): (update_fvwm_colorset): Title, Border and Buttons Style Colorset Option: Dynamic updating * fvwm/screen.h: * fvwm/builtins.c (ReadDecorFace): Title, Border and Buttons Style Colorset Option: Configuration * libs/Colorset.c (GetWindowBackgroundPixmapSize, new): * libs/Colorset.h: Title, Border and Buttons Style Colorset Option: Convinent macros and function 2002-11-18 Dan Espen * libs/Makefile.am: Add missing Bindings.h. 2002-11-18 Dominik Vogt * fvwm/move_resize.c (__move_loop): send M_CONFIGURE_WINDOW only when the window actually moves 2002-11-16 Mikhael Goikhman * libs/FBidi.c: * libs/FBidi.h: * libs/FBidiJoin.c: * libs/FBidiJoin.h: * libs/Makefile.am: incorporated a shape-and-join bidi functionality from Nadim Shaikli with minor improvements; it is disabled for now (#if 0) since some Arabic chars cause core dump 2002-11-15 Dominik Vogt * fvwm/fvwm.1.in (Examples): added documentation of Icon option for PlaceAgain command * fvwm/events.c (__handle_key_event): fixed global key binding problem 2002-11-15 olicha * libs/Bindings.c (MatchBindingExactly): (__compare_binding): compile fixes w/o stroke lib * NEWS: * fvwm/geometry.c (get_title_font_size_and_offset): * fvwm/builtins.c (do_title_style): New MinHeight option to TitleStyle 2002-11-15 olicha * fvwm/builtins.c (update_fvwm_colorset): (CMD_Colorset): (do_title_style): * fvwm/builtins.h: * fvwm/colorset.c (update_root_transparent_colorset): Fixed update of the RootTransparent colorset in fvwm 2002-11-15 Dominik Vogt * libs/Bindings.c (__compare_binding): (MatchBindingExactly): compoile fixes w/o stroke lib 2002-11-14 olicha * fvwm/fvwm.1.in: * INSTALL.fvwm: * NEWS Removed any reference on "xft and flickering" 2002-11-14 Dominik Vogt * fvwm/eventmask.h (XEVMASK_ICONW): * fvwm/events.c (HandleKeyRelease): (HandleKeyPress): (__handle_key_event): * fvwm/bindings.c (ParseBinding): (activate_binding): * libs/Bindings.h (enum): implemented key release bindings; prefix the key name with a '-'; does not work well with some applications 2002-11-13 Dominik Vogt * libs/Bindings.h: new file * fvwm/bindings.c (ParseBinding): (binding_cmd): (activate_binding): (bind_get_bound_button_contexts): (ParseBinding): (CMD_Stroke): (CMD_Mouse): (CMD_PointerKey): (CMD_Key): (RemoveMatchingBinding): (AddBinding): (AreBindingsEqual): (GrabWindowKey): (GrabWindowButton): (GrabAllWindowKeysAndButtons): * fvwm/module_interface.c (CMD_ModuleSynchronous): * fvwm/events.c (__handle_bpress_on_root): (__handle_bpress_on_managed): (HandleButtonRelease): * fvwm/builtins.c (CMD_Wait): (CMD_StrokeFunc): * libs/fvwmlib.h (enum): fixed Key vs. PointerKey with "A"ny context 2002-11-12 Dominik Vogt * fvwm/icons.c (Iconify): icon placement safety patch (CreateIconWindow): fixed initial position of application provided icon windows * fvwm/session.c (LoadWindowStates): fixed parsing of strings beginning with whitespace in session file * fvwm/fvwm.1.in (Note): * fvwm/style.c (style_set_old_focus_policy): * libs/defaults.h (DEF_FP_MODIFIERS): set default modifiers for raising/focusing to N again 2002-11-11 olicha * fvwm/fvwm.1.in: * fvwm/fvwm.c (main): (usage): named-palette -> visual-palette, -N -> -P 2002-11-11 Dominik Vogt * fvwm/ConfigFvwmDefaults: include ConfigFvwmProxyDefaults * fvwm/fvwm.c (usage): polished usage message 2002-11-10 Dominik Vogt * fvwm/fvwm.c (usage): (main): cleaned up usage and error messages use short option names in usage message an man page synopsis all options are case sensitive do not mention the "-" style long options in the man page; instead use the "--" style * fvwm/add_window.c (setup_frame_window): * fvwm/events.c (HandleMapNotify): * fvwm/eventmask.h (XEVMASK_FRAMEW_RECAPTURE): fixed empty decorations after recapture * fvwm/geometry.c (get_icon_geometry): * fvwm/icons.c (clear_icon): fixed icon jumping to 0 0 when the icon layout changes after the icon has been moved manually * fvwm/move_resize.c (__move_icon): fixed MoveToPage with icons 2002-11-09 olicha * libs/Fft.c (FftGetRotatedFont): (FftGetFont): * libs/Fft.h: Check the return result of FftPatternGetMatrix * libs/Flocale.h: * libs/PictureBase.h: Added two macro 2002-11-09 Dominik Vogt * fvwm/ewmh_conf.c (set_state_workaround): * fvwm/functable.c (func_table): * fvwm/update.c (apply_window_updates): * fvwm/windowlist.c (CMD_WindowList): * fvwm/ewmh_events.c (ewmh_WMDesktop): (ewmh_WMStateSticky): * fvwm/conditional.c (CreateConditionMask): (CreateConditionMask): * fvwm/gnome.c (GNOME_SetHints): (GNOME_GetStyle): (GNOME_HandlePropRequest): * fvwm/placement.c (SmartPlacement): (get_next_x): (test_fit): (get_next_y): (PlaceWindow): * fvwm/session.c (SaveWindowStates): (MatchWinToSM): * fvwm/ewmh.c (check_desk): (EWMH_SetWMDesktop): (ewmh_ComputeAndSetWorkArea): (ewmh_HandleDynamicWorkArea): (ewmh_HandleDesktop): (ewmh_HandleDock): (ewmh_HandleMenu): (ewmh_HandleToolBar): * fvwm/virtual.c (UnmapDesk): (MapDesk): (MoveViewport): (MoveViewport): (do_move_window_to_desk): * fvwm/icons.c (setup_icon_title_size): (DrawIconTitleWindow): (AutoPlaceIcon): (Iconify): * fvwm/borders.c (is_button_toggled): (get_common_decorations): (border_draw_title_stick_lines): * fvwm/add_window.c (AddWindow): * fvwm/move_resize.c (__move_window): (is_window_sticky_on_page): (is_window_sticky_on_desk): (MaximizeWidth): (MaximizeHeight): (stick_page): (stick_desk): (handle_stick): (handle_stick_page): (handle_stick_desk): (__handle_stick_exit): (CMD_StickDesk): (CMD_StickPage): * fvwm/style.c (style_parse_one_style_option): (check_window_style_change): * fvwm/style.h: * fvwm/fvwm.h: New Style options stickypage and stickydesk New WindowList options NoStickyPage, NoStickyDesk, StickyPage, StickyDesk, OnlyStickyPage, OnlyStickyDesk New conditions StickyPage and StickyDesk New commands StickPage and StickDesk * fvwm/move_resize.c (__move_window): do not unstick a window when using MoveToScreen * fvwm/ewmh_conf.c: reindented * fvwm/commands.h: * fvwm/functable.c (func_table): * fvwm/ewmh_conf.c (CMD_EwmhBaseStruts): renamed EWMHBaseStrut to EwmhBaseStruts * fvwm/style.c (style_set_old_focus_policy): SloppyFocus and MouseFocus use "FPFocusClickModifiers N" by default (style_parse_one_style_option): renamed "Border" style to "Borders" removed "NoBorder" style; use !Borders instead renamed PlacmentOverlapPenalties to MinOverlapPlacementPenalties renamed PlacmentOverlapPercentPenalties to MinOverlapPercentPlacementPenalties * fvwm/fvwm.1.in: * NEWS: corrected typo * libs/Fft.c: Fixed compiler warnings 2002-11-09 Mikhael Goikhman * configure.in: autogenerate FvwmWindowLister files * fvwm/fvwm.1.in: mention fvwm-menu-directory and fvwm-menu-desktop as examples of MissingSubmenuFunction and DynamicPopupAction 2002-11-08 olicha * libs/PictureUtils.c (alloc_color_proportion): (alloc_color_proportion_dither): (alloc_color_proportion_grey): (alloc_color_x): (free_colors_in_table): (free_colors_x): (init_static_colors_table): (PictureFreeColors): (PictureInitColors): (PicturePrintColorInfo): Fixed StaticColor visual. Rename some of the color allocators. Clean up free colors stuff 2002-11-07 Dominik Vogt * fvwm/move_resize.c (__move_window): ignore MoveToPage with sticky windows * fvwm/conditional.c (Circulate): (circulate_cmd): Next and Prev commands begin looking at the context window, if any * fvwm/focus.c (__focus_grab_buttons): fixed initial button grabbing on client window * fvwm/stack.c (BroadcastRestack): split long packets, fixed a bug and cleaned up * libs/Module.c (ReadFvwmPacket): ignore packets that are too long * fvwm/fvwm.1.in: document PopupDelay and PopdownDelay defaults 2002-11-06 olicha * libs/Fft.c (FftGetFont): (FftGetRotatedFont): Use a more perfectioned method for loading font with Xft/Fc. This method allows sanity check. Preserve the matrix when rotating Xft/Fc fonts. * libs/Flocale.c (FlocaleGetMinOffset): (FlocaleRotateDrawString): (FlocaleGetFontSet): (FlocaleGetFont): * libs/Fft.c (FftDrawString): (FftGetFont): * libs/FftInterface.h: * fvwm/geometry.c (get_title_font_size_and_offset): Move the computation of the good "y" for drawing text into Flocale. Use the max ascent, descent and height for font metric (in the place of the min's one). * libs/Flocale.c (FlocalePrintLocaleInfo): * libs/Flocale.h: * libs/Fft.c (FftPrintPatternInfo): * libs/Fft.h: * fvwm/builtins.c (CMD_PrintInfo): * NEWS: * fvwm.1.in: New option "Locale" to PrintInfo Command 2002-11-06 Dominik Vogt * fvwm/events.c (HandleExpose): removed no-op 2002-11-04 Dan Espen * fvwm/fvwm.1.in: colour -> color Language check. 2002-11-04 Dominik Vogt * fvwm/fvwm.1.in: * fvwm/fvwm.c (usage): (main): pallet -> palette 2002-11-04 olicha * configure.in: Added -lXrender in Xft 1 tests (Ethan Blanton ) * libs/PictureUtils.c (alloc_color_dynamic_no_limit): (finish_ct_init): (PictureFreeColors): (PicturePrintColorInfo): Trace colours allocation out of the pallet in depth <= 8. Better information on coulours * libs/Fft.c (FftGetRotatedFont): * libs/Fft.h: Fixed rotated font when the original font has a matrix * libs/PictureBase.c (PictureInitCMapRoot): * libs/PictureUtils.h: * libs/PictureUtils.c (PictureInitColors): (PictureAllocColorTable): * libs/PictureBase.h (PictureColorLimitOption): * fvwm/fvwm.c (main): * fvwm/fvwm.1.in New options -strict-color-limit, -allocate-pallet, -static-pallet, -named-pallet. -color-limit now take only integer argument. 2002-11-04 Dominik Vogt * libs/Module.h (struct): new type FvwmWinPacketBodyHeader to access the standard fields in a packet with a window 2002-11-01 Dominik Vogt * NEWS: updated for 2.4.13 * fvwm/functable.c (func_table): * fvwm/commands.h: * fvwm/style.c (style_parse_one_style_option): (parse_and_set_window_style): (__style_command): (CMD_Style): (CMD_FocusStyle): added a new command FocusStyle as a shorthand for "Style * FP..., FP..." * fvwm/builtins.c (__parse_vector_line_one_coord): (__parse_vector_line): (ReadDecorFace): split vector line parsing into sub functions (FreeDecorFace): fixed core dump in vector button offset patch 2002-11-01 Marcus Lundblad * fvwm/screen.h (vector_coords): added fields for offsets * fvwm/builtins.c (ReadDecorFace): rewrote parser for vector definitions to accept optional offsets * fvwm/fvwm.c (LoadDefaultLeftButton): (LoadDefaultRightButton) set default values for offsets * fvwm/borders.c (border_draw_vector_to_pixmap): updated XDrawLine call to take offsets into account * fvwm/fvwm.1.in: documented new options for vector offsets 2002-11-01 olicha * libs/PictureGraphics.c (PGraphicsRenderPixmaps): Fixed icon tint pixel, it was set to icon tint percent during some renaming 2002-10-31 olicha * libs/PictureUtils.c (PictureAllocColorImage): (PictureOpenImageColorAllocator): (PictureCloseImageColorAllocator): * libs/PictureImageLoader.c (PImageCreatePixmapFromArgbData): (FIMAGE_CMD_ARGS): (PImageLoadXpm): (PImageCreatePixmapFromArgbData): (PImageLoadPixmapFromFile): * libs/PictureBase.h (FvwmPictureThing): (PictureImageColorAllocator): * libs/Picture.h: * libs/Picture.c (PDestroyFvwmPicture): (PLoadFvwmPictureFromPixmap): * libs/Graphics.c (CreateGradientPixmap): * fvwm/fvwm.c: * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): Added a new way to allocate colors for image and gradient. This method allows, in particular, to save (in a "fast" way) the allocated pixels with a minimal memory usage. Fixed color leaks for png, ewmh and dithered xpm images. * fvwm/add_window.c (destroy_icon): * fvwm/fvwm.h (FvwmWindow): * fvwm/icons.c (GetIconFromFile): Fixed color leaks 2002-10-31 Dominik Vogt * fvwm/commands.h: * fvwm/functable.c: * fvwm/stack.c (enum): (position_new_window_in_stack_ring): (new_layer): (must_move_transients): (restack_windows): (__restack_window): (__raise_lower_recursion): (__raise_or_lower_window): (raise_or_lower_window): (collect_transients_recursive): (__is_restack_transients_needed): (RestackWindow): (CMD_RestackTransients): new command RestackTransients which works like Raise and Lower but does not restack windows that are not transient renamed some functions general cleanup * fvwm/fvwm.1.in: corrected cursor movement key bindings * fvwm/bindings.c (activate_binding): fixed problem w/ bindings being overridden by applications OpenOffice and the Gnome panel 2002-10-29 Mikhael Goikhman * configure.in: * NEWS: switched to 2.5.5 * configure.in: include FvwmProxy to build 2002-10-29 Mikhael Goikhman * configure.in: exclude FvwmProxy from build * configure.in: * NEWS: updated for 2.5.4 2002-10-29 Dominik Vogt * configure.in: added FvwmProxy module 2002-10-29 Mikhael Goikhman * fvwm/fvwm.1.in: * fvwm/windowlist.c (CMD_WindowList): renamed SortClassName to SortByClass 2002-10-29 Dominik Vogt * fvwm/menustyle.c (menustyle_update): (menustyle_parse_style): (menustyle_get_styleopt_index): (menustyle_parse_style): (CMD_CopyMenuStyle): * fvwm/menustyle.h: removed HilightRelief MenuStyle and hard coded it 2002-10-28 Dominik Vogt * fvwm/menus.c (make_menu_window): fixed updating menu background with "Menustyle * Background" * fvwm/stack.c (__get_stacking_sibling): (restack_windows): fixed another stacking problem 2002-10-28 Mikhael Goikhman * acinclude.m4: * configure.in: corrected and lined up several help lines * INSTALL.fvwm: added --enable-xinerama-emulation description 2002-10-27 Dominik Vogt * fvwm/stack.c (restack_windows): (__get_stacking_sibling): fixed another stacking problem 2002-10-26 Dominik Vogt * fvwm/add_window.c (AddWindow): braodcast M_RESTACK_WINDOW after M_ADD_WINDOW to fix problem with windows starting lowered or on other layers in FvwmPager * fvwm/stack.c (restack_windows): (__get_visible_window): fixed a stacking problem with layers 2002-10-25 Dominik Vogt * fvwm/functable.c (func_table): fixed Pick command 2002-10-24 Mikhael Goikhman * NEWS: * fvwm/fvwm.1.in: * fvwm/windowlist.c: new WindowList option SortByResource * fvwm/style.c (check_window_style_change): * libs/FlocaleCharset.c: fixed gcc warning * AUTHORS: place recent authors to the top, not bottom * fvwm/builtins.c: corrected typo in error message 2002-10-23 Dan Espen * fvwm/fvwm.1.in: Lang check done. 2002-10-24 Dominik Vogt * fvwm/menus.c: work on new menu loop code * libs/timeout.h: * libs/timeout.c: new files * fvwm/menus.c (__mloop_handle_event): (__mloop_get_event): (__mloop_handle_action_with_mi): * fvwm/menus.h (MenuReturn): renamed MenuReturn member menu to target_menu * fvwm/menus.c (__mloop_handle_event): * fvwm/menus.h (MenuReturn): removed a "write only" member of MenuReturn * fvwm/conditional.c (circulate_cmd): fixed the "Any" command 2002-10-23 Dominik Vogt * fvwm/stack.c (mark_transient_subtree): fixed stack ring corruption with iconified transients (restack_windows): fixed a problem with lowering windows below the icons of their transients 2002-10-22 Dominik Vogt * libs/Colorset.c: * fvwm/menustyle.c: * libs/Colorset.h: * libs/Flocale.h: * libs/PictureBase.h: * fvwm/menuitem.c: * fvwm/geometry.c: * fvwm/colorset.c: renamed colorset_struct to colorset_t 2002-10-22 olicha * libs/PictureUtils.c: Minor fixes and add #if O experimental code 2002-10-22 Dominik Vogt * fvwm/icons.c (DrawIconPixmapWindow): (DrawIconWindow): * fvwm/events.c (HandlePropertyNotify): * libs/Fft.c (FftDrawString): * libs/Colorset.c (DumpColorset): (LoadColorset): * libs/PictureGraphics.c (PGraphicsRenderPixmaps): use renamed colorset_struct members * libs/Colorset.h (colorset_struct): renamed and re-sorted members and cut down bit field lengths for percentile members * fvwm/menustyle.c (menustyle_update): fixed core dump * fvwm/stack.c (restack_windows): fixed flickering when raising transients; can't prevent flickering when lowering a window completely (restack_windows): fixed unnecessary error message * fvwm/fvwm.c (main): init Scr to zeros * fvwm/stack.c (__restack_window): fixed a stacking problem with icons * fvwm/add_window.c (destroy_icon): fixed a memory leak 2002-10-21 Dominik Vogt * fvwm/menuitem.c (menuitem_paint): * fvwm/menustyle.c (menustyle_parse_style): * fvwm/menus.c (paint_side_pic): (paint_menu): (select_menu_item): (repaint_transparent_menu): * fvwm/menustyle.h (MenuLook): cleaned up menu drawing code, fixed last patch * fvwm/menuitem.c (menuitem_paint): * fvwm/menustyle.c (menustyle_parse_style): fixed HilightBack default * fvwm/bindings.c (binding_cmd): (bind_get_bound_button_contexts): (ParseBinding): * fvwm/screen.h (ScreenInfo): fixed mouse bindings with buttons > 5 * fvwm/menuitem.c (menuitem_paint): * fvwm/menustyle.c (menustyle_parse_style): (menustyle_parse_style): (CMD_CopyMenuStyle): (menustyle_update): (menustyle_free): * fvwm/menus.c (repaint_transparent_menu): * fvwm/menustyle.h: HilightBack and ActiveFore are now independent 2002-10-18 olicha * libs/PictureUtils.c (get_color_index): (create_mapping_table): (PictureAllocColorTable): Use a new distance and method for color approximation. Use 68 colors for the default under depth 8. I am happy with this, should use a similar distance method for dithering * libs/PictureUtils.c (alloc_color_dynamic_no_limit): (PictureAllocColorTable): (PictureDitherByDefault): (PictureUseBWOnly): (PictureIitColors): (PicturePrintColorInfo): * libs/PictureUtils.h: Allows -color-limit to work with any visual and depth for testing propose. Should replace (Pdepht < 2) test by (PictureUseBWOnly()) * fvwm/colorset.c: Replaced (Pdepht < 2) test by (PictureUseBWOnly()) 2002-10-18 Dominik Vogt * fvwm/add_window.c (get_default_window_attributes): cleaned up * fvwm/builtins.c (CMD_ChangeDecor): removed some duplicate redrawing * fvwm/update.c (apply_decor_change): suppress duplicate window update upon ChangeDecor (apply_window_updates): do not delete the focus window 2002-10-17 olicha * NEWS: A bunch of news * libs/Colorset.c (CreateBackgroundPixmap): Use a 1x1 pixmap and not a widthxheight pixmap for Plain color * fvwm/builtins.c (CMD_Colorset): Do not BroadcastColorset in CMD_Colorset, parse_colorset do that! 2002-10-17 Dominik Vogt * fvwm/add_window.c (AddWindow): * fvwm/update.c (apply_window_updates): * fvwm/move_resize.c (handle_stick): (CMD_Stick): suppress drawing of sticky decorations initially reduce module communication overhead when (un)sticking windows * fvwm/borders.c (border_draw_decorations): * fvwm/window_flags.h: * fvwm/fvwm.h: * fvwm/frame.c (frame_create_move_resize_args): (get_resize_decor_gravities_one_axis): (frame_mrs_setup_draw_decorations): (mr_args_internal): initialize window decorations with a "None" pixmap; delay drawing window decorations initially to prevent drawing multiple times; => windows grabbing the focus upon startup are drawn focused immediately * fvwm/frame.c (frame_free_move_resize_args): reparent the frame hide windows to NoFocusWin instead of Root to suppress unnecessary ReparentNotify events 2002-10-16 olicha * fvwm/fvwm.c (main): Fixed a typo * libs/FRender.h: Fixed compilation with X cvs * libs/Colorset.c (CreateBackgroundPixmap): Fixed a GC leak * fvwm/events.c (HandlePropertyNotify): * fvwm/colorset.c (update_root_pixmap): Use _XROOTPMAP_ID and not ESETROOT_PMAP_ID neither XSETROOT_ID to found a root pixmap 2002-10-16 Dominik Vogt * fvwm/bindings.c (bind_get_bound_button_contexts): another mouse binding fix * fvwm/conditional.c (CreateConditionMask): simplified parsing all conditions have a negation with '!' prepended (Circulate): (CMD_All): (select_cmd): Current, All, Pick, ThisWindow and PointerWindow imply the CirculateHitShaded condition. * fvwm/focus.c (__focus_grab_buttons): * libs/defaults.h (NUMBER_OF_EXTENDED_MOUSE_BUTTONS): fixed bindings using mouse buttons >= 6 2002-10-15 olicha * libs/PictureUtils.c (PicturePrintColorInfo): (print_colormap): * fvwm/commands.h: * fvwm/functable.c (func_table): * fvwm/builtins.c (CMD_PrintInfo): * fvwm/fvwm.1.in: New cmd PrintInfo. Only one arg at present time: "Colors" * fvwm/fvwm.c (main): Auto detect card with 2 hardware colormaps and choose the best visual and colormap * libs/PictureUtils.c (PictureInitColors): (*): * libs/PictureUtils.h: * fvwm/fvwm.c (main): * libs/PictureBase.c (PictureInitCMapRoot): (PictureInitCMap): * libs/PictureBase.h: Try to support DirectColor visual in a good way, I do not think this is really useful. Added a flexible interface function PictureInitColors for colors allocation initialization. Some cleanup in color allocation and some preparation for a new method for saving and freeing colors allocated by images and gradients. Removed some ifdefed to 0 debug code. * libs/Picture.c (*): * libs/Picture.h: * libs/PictureImageLoader.c (*): * libs/PictureImageLoader.h: Replace Root by win 2002-10-14 Dominik Vogt * fvwm/add_window.c (setup_key_and_button_grabs): * fvwm/bindings.c (ParseBinding): (activate_binding): * fvwm/add_window.c (setup_key_and_button_grabs): don't grab window context specific bindings anymore; instead, set Scr.buttons2grab accordingly * fvwm/bindings.c (activate_binding): fixed stroke bindings on window context being ignored if no other action was bound to that context * fvwm/add_window.c (destroy_icon): fixed duplicate icon pixmap when switching from NoIconOverride to IconOverride 2002-10-13 Dominik Vogt * fvwm/icons.c: re-indented some code (AutoPlaceIcon): fixed random position of icon title for icons with a position hint * fvwm/fvwm.1.in: corrected default of Use/NoIconPosition style 2002-10-12 Dominik Vogt * fvwm/windowlist.c (CMD_WindowList): fixed random string for iconified windows in the WindowList 2002-10-10 Dominik Vogt * NEWS: updated for 2.4.12 2002-10-08 olicha * libs/PictureBase.c (*): (PictureInitCMapRoot) (PictureSetupWhiteAndBlack): (PictureWhitePixel): (PictureBlackPixel): (PictureDefaultGC): New interface function PictureWhitePixel, PictureBlackPixel. Analogue of the Xlib WhitePixel and BlackPixel functions but in the Pvisaul. New interface function PictureInitCMapRoot analogue to PictureInitCMap, but always use the root visual and allows to set or not a private color limit table. New interface PictureDefaultGC, analogue of Xlib DefaultGC function but which respects the Pvisual * libs/PictureGraphics.c (*): * libs/FScreen.c (FScreenInit): * libs/FRender.c (FRenderRender): * libs/Fft.c (FftDrawString): * fvwm/icons.c (CreateIconWindow): * fvwm/colorset.c (parse_colorset): * fvwm/move_resize.c (CMD_XorValue): * fvwm/colorset.c (alloc_colorset): * fvwm/fvwm.c (main): Use the new interface functions and some fix if the fvwm depth != the root depth. * libs/PictureUtils.c (PictureAllocColorTable): Change the default color table to a 4x4x4 cc + 4 grey 2002-10-07 Dan Espen * fvwm/fvwm.1.in: Use built-in, not builtin. 2002-10-06 Mikhael Goikhman * configure.in: s/FvwmNewDebug/FvwmDebug/ * fvwm/commands.h: * fvwm/conditional.c (CMD_NoWindow): * fvwm/functable.c: * NEWS: new command NoWindow to remove window context * fvwm/fvwm.1.in: use "fvwm" spelling, at least in the middle of sentences 2002-10-06 Dan Espen * fvwm/fvwm.1.in: Dont refer to fvwm commands as builtin commands. Use "builtin", not "built in" or "built-in". Other adjustments. 2002-10-06 Dominik Vogt * libs/Graphics.c (do_relieve_rectangle): removed debug message * fvwm/focus.c (__update_windowlist): (__set_focus_to_fwin): fixed reversal of __update_windowlist arguments causing FlipFocus to break [and maybe other things] 2002-10-05 olicha * libs/PictureUtils.c (alloc_color_cube): It si possible to enable "gamma correction" for colors cubes (disabled, define USE_GAMMA_CORRECTION to 1 and set COLOR_GAMMA and GREY_GAMMA) * libs/PictureUtils.c (get_color_index): (create_mapping_table): Use a more exact approximation of colors for pur cc without the big 16x16x16 cc * libs/PictureUtils.c (PictureFreeColors): Fixed a memory leak * libs/Graphics.c (CreateGradientPixmap): (CreateGradientPixmapFromString): Cleanup 2002-10-04 olicha * libs/PictureUtils.c (*): Used a better color approximation for color cube when we do not dither. Added some new colors tables: color cube with some grey colors. Change the default to a 4x4x3 cc with 6 grey (54 colors). Some visual fixes. * fvwm/fvwm.c (main): Fixed the visual option 2002-10-03 Mikhael Goikhman * configure.in: generate FvwmNewDebug and FvwmGtkDebug 2002-10-02 olicha * libs/PictureUtils.c (USED_DIST): Used the euclidian distance for colors distance * libs/Fft.c (FftGetFont): Disable Xft if the Xserver does not support XRender 2002-10-01 olicha * libs/Fft.c (FftGetFont): Disable Xft if the Xserver does not support XRender * libs/FRender.c (FRenderRender): * libs/PictureGraphics.c (PGraphicsTintRectangle): Fixed * libs/Colorset.c (SetRectangleBackground): (SetClippedRectangleBackground): * libs/Colorset.h: New interface function for drawing a subset of a colorset rectangle 2002-09-26 olicha * fvwm/update.c (apply_window_updates): Fixed icons colorset update * libs/FRender.c (FRenderRender): Fixed bitmap rendering * fvwm/update.c (apply_window_updates): * fvwm/geometry.c (move_icon_to_position): * fvwm/events.c (HandleEnterNotify): (HandleExpose): (HandleLeaveNotify): (HandlePropertyNotify): * fvwm/add_window.c (setup_icon_font): * fvwm/icons.c (DrawIconWindow): (DrawIconTitleWindow): (DrawIconPixmapWindow): (ChangeIconPixmap): (RedoIconName): Fixed focus/unfocus flickering 2002-09-25 olicha * fvwm/icons.c (DrawIconTitleWindow): One more drawing fix 2002-09-24 olicha * fvwm/icons.c (DrawIconTitleWindow): An other drawing fix 2002-09-24 Dominik Vogt * fvwm/move_resize.c (__move_loop): fixed uninitialised variable (InteractiveMove): fixed starting move at random position 2002-09-24 olicha * fvwm/update.c (apply_window_updates): * fvwm/geometry.c (move_icon_to_position): * fvwm/events.c (HandleEnterNotify): (HandleExpose): (HandleLeaveNotify): (HandlePropertyNotify): * fvwm/add_window.c (setup_icon_font): * fvwm/icons.c (DrawIconWindow): (DrawIconTitleWindow): (DrawIconPixmapWindow): (ChangeIconPixmap): (RedoIconName): Fixed icon drawing. Split icon window drawing. * libs/FRender.c (*): Fixed compilation and small clean up 2002-09-23 Dominik Vogt * fvwm/conditional.c (CreateFlagString): fixed quoting in conditional command conditions * fvwm/menus.c (__mloop_handle_event): removed unnecessary querying of pointer position on button release in menus (__menu_loop): fixed posting menus * fvwm/bindings.c (ParseBinding): increased maximum allowed key symbol name length to 200 characters * fvwm/execcontext.h (enum): * fvwm/fvwm.c (Done): (SetRCDefaults): (main): (StartupStuff): use new contexts * fvwm/execcontext.h (enum): added EXCT_INIT ['I'] and EXCT_EXIT ['X'] contexts * fvwm/menus.c (pop_menu_up): fixed accidental menu animation with certain menu position hints 2002-09-23 olicha * libs/FRender.c (*): Fixed(?) XRender rendering with some Xserver * fvwm/update.c (apply_window_updates): * fvwm/geometry.c (move_icon_to_position): * fvwm/events.c (HandleEnterNotify): (HandleExpose): (HandleLeaveNotify): (HandlePropertyNotify): * fvwm/add_window.c (setup_icon_font): * fvwm/icons.c (DrawIconWindow): (ChangeIconPixmap): (RedoIconName): Clip text and icon drawing for the icons 2002-09-21 Mikhael Goikhman * NEWS: * libs/System.c: Path commands now support form: "path1;ext1:path2:path3;ext3" where ext1 (for example, ".png") means all files in path1 should be forced to have extention ".png" even if the requested icon has ".xpm" ("calculator.xpm" or has no extention at all ("calculator") * fvwm/execcontext.h: small changes in latters used for EXCT_* constants * fvwm/module_interface.c: * libs/Picture.c: * libs/PictureBase.c: * fvwm/cursor.c: some spacing reindentation 2002-09-21 olicha * libs/FRender.c (FRenderCompositeAndCheck): Temporally take GraphicsExposure in account 2002-09-20 Mikhael Goikhman * libs/vpacket.h: fixed incorrect MiniIconPacket definition: s/char *name/char name[1]/ 2002-09-20 olicha * fvwm/icons.c (GetIconPicture): * fvwm/ewmh_icons.c (ewmh_SetWmIconFromPixmap): Fixed the alpha channel 2002-09-20 Dominik Vogt * NEWS: updated for 2.4.11 2002-09-20 olicha * libs/FRender.c (FRenderTintPicture): (FRenderTintRectangle): (FRenderRender): * libs/FRenderInterface.h: * libs/PictureGraphics.c (PGraphicsTintRectangle): Make FRender code more modular. Add a 24+8 tinting method and enable it in the place of the 32 tinting method (which can be enabled by defining USE_ABSOLUTE_FORMATE) 2002-09-19 olicha * fvwm/menus.c (get_menu_repaint_transparent_parameters): (animated_move_back): (pop_menu_up): (repaint_transparent_menu): * fvwm/move_resize.c (AnimatedMoveOfWindow): (AnimatedMoveAnyWindow): * fvwm/move_resize.h: Support the new colorset transparent options and fix greyed item of transparent animated menus * fvwm/menus.c (pop_menu_up): (animated_move_back): * libs/Rectangles.c: * libs/Rectangles.h: * libs/Makefile.am: New libs files for rectangles, segments, regions ..etc * fvwm/menus.c (clear_expose_menu_area): (get_menu_paint_item_parameters): (paint_menu): (select_menu_item): (ParentalMenuRePaint): (ParentalMenuRePaint): * fvwm/menuitem.c (clear_menu_item_background): (menuitem_paint): * fvwm/menuitem.h (MenuPaintItemParameters): Clip the item icons and text drawing * fvwm/menus.c (__mloop_exit): Fixed an indirect uninitialized variable bug * fvwm/menus.c (__mloop_handle_event): * (__mloop_handle_action_with_mi): * Update some comments * libs/FRender.c (FRenderVisualInit): (FRenderRender): * fvwm/colorset.c (parse_colorset): Small clean up 2002-09-19 Dominik Vogt * fvwm/menus.c (__menu_loop): (__mloop_handle_action_with_mi): fixed parent menu redrawing * fvwm/style.c (check_window_style_change): * fvwm/update.c (apply_window_updates): * fvwm/add_window.c (setup_icon_size_limits): honour changes in IconSize style without recapture * fvwm/focus.c (focus_query_open_grab_focus): * fvwm/events.c (HandlePropertyNotify): * fvwm/add_window.c (setup_transientfor): take care of various funny initial transientfor settings * fvwm/stack.c (__raise_lower_recursion): new function fixed stacking core dump 2002-09-18 Dominik Vogt * libs/Graphics.c: ANSI C fixes * configure.in: added a program that tests for -Werror option and similar; bug out of configure if the test program doesn't compile 2002-09-17 Dominik Vogt * fvwm/fvwm.1.in: * configure.in: add a "do not edit" warning at the beginning of the man page * configure.in: enable the original CFLAGS and CPPFLAGS before generating the Makefiles * libs/FScreen.c (XineramaQueryScreens): fixed linking problem when compiling without Xinerama * fvwm/cursor.c (CMD_CursorStyle): fixed cursorstyle command being applied to windows without handles * fvwm/ewmh.h (EWMH_ProcessClientMessage): (EWMH_ProcessPropertyNotify): * fvwm/gnome.h (GNOME_ProcessClientMessage): (GNOME_HandlePropRequest): fixed dummy macros when compiling without gnome/ewmh support 2002-09-16 Dominik Vogt * libs/queue.c (fqueue_add_inside): add a new command with the same execution time as a previous one behind it * configure.in: override CFLAGS and CPPFLAGS with empty strings instead of generating an error message * fvwm/functions.c (__execute_function): * fvwm/execcontext.h (exec_context_type_t): replace enum values with letters for readability * fvwm/functions.c (__execute_function): improved command log output * fvwm/schedule.c (execute_obj_func): fixed schedule queue timing * configure.in: refuse to run configure if CFLAGS is not empty 2002-09-16 Mikhael Goikhman * fvwm/misc.c: fixed compilation with --enable-command-log; simplified fvwm_msg() * libs/Module.c: reformatted; don't send end-of-line with SET_*MASK 2002-09-15 Dominik Vogt * fvwm/borders.c (border_draw_multi_pixmap_titlebar): fixed multipixmap title drawing * fvwm/frame.h (struct): * fvwm/frame.c (frame_get_titlebar_dimensions): removed unused code * fvwm/events.c (HandlePropertyNotify): applied FlocaleGetNameProperty core dump fix by Suzanne Skinner * libs/Fft.c (FftDrawString): -Wall fix when compiling w/o Xft 2002-09-15 olicha * libs/Colorset.c (CreateBackgroundPixmap): Fixed a dpy problem with FvwmBacker * libs/Colorset.c (CreateBackgroundPixmap): Fixed creation a root transparent pixmap for small root pixmap 2002-09-14 olicha * libs/Fft.c (FftDrawString): Fixed clip region with shadow font * libs/PictureGraphics.c (PGraphicsCreateTranslucent): Added a function to create translucent pixmaps * libs/Colorset.c (CreateBackgroundPixmap): A small fix * libs/FRender.c (FRenderRender): Allows to use the root window as src pixmap 2002-09-13 Dominik Vogt * fvwm/fvwm.1.in: Fixed open double quotes in ButtonState section 2002-09-13 Dan Espen * fvwm/fvwm.1.in: Add -cmd module timeout information. 2002-09-13 olicha * libs/Colorset.c (CreateBackgroundPixmap): (UpdateBackgroundTransparency): (SetRectangleBackground): * libs/Colorset.h: * fvwm/colorset.c (*): * fvwm/colorset.h: * fvwm/events.c (HandlePropertyNotify): Starting implementation of RootTransparent colorset. Worked on tinted Transparent colorset. Various colorset parsing fixes. * libs/Fft.c (FftDrawString): * libs/Flocale.h: Added the possibility to draw with a clipping region. * libs/FRender.c (FRenderRender): * libs/PictureGraphics.c (PGraphicsRenderPixmaps): (PCreateRenderPixmap): (PGraphicsCreateTransprency): (PGraphicsTintRectangle): Improve current rendering functions to be able to tint the ParentalRelative pixmap or the background of a window. Re-enabled XRender rendering. * fvwm/borders.c: remove a #if 0 debug "render" code 2002-09-13 Mikhael Goikhman * fvwm/builtins.c (ReadTitleButton): * fvwm/screen.h: new button state shortcuts AllNormal, AllToggled, AllActive, AllInactive, AllUp, AllDown * fvwm/module_interface.c: minor reformatting * acconfig.h: possibly fixed compilation with non gcc 2002-09-12 Dominik Vogt * fvwm/focus.c (_focus_grab_buttons): (__focus_grab_buttons): renamed (__focus_grab_one_button): grab all modifier combinations on client windows by default if necessary; this saves a lot of traffic but may grab unnecessary modifiers with mouse bindings on the client window * fvwm/fvwm.1: * libs/defaults.h (DEF_FP_MODIFIERS): * fvwm/events.c (__handle_focus_raise_click): * fvwm/style.c (style_parse_focus_policy_style): * fvwm/focus_policy.h (FPOL_ANY_MODIFIER_MASK): default is now to use any modifiers for clicktofocus/raise purposes * fvwm/menus.c (__mloop_get_event): fixed menu hang (menu_tear_off): fixed tear off menus * libs/FEvent.c (FCheckIfEvent): (FCheckMaskEvent): (FCheckTypedEvent): (FCheckTypedWindowEvent): (FCheckWindowEvent): fixed FCheck...Event functions thus fixing Menu command behaving like Popup * fvwm/move_resize.c (InteractiveMove): fixed offset between pointer and window when dragging * fvwm/virtual.c (HandlePaging): * fvwm/icons.c (CMD_Iconify): * fvwm/move_resize.c (InteractiveMove): * fvwm/menus.c (get_menu_options): (get_menu_options): * libs/FScreen.c (GetMouseXY): use new function fev_get_evpos_or_query() * libs/Makefile.am: * libs/Pointer.c: removed file (GetLocationFromEventOrQuery): moved to FEvent.c and renamed to fev_get_evpos_or_query() * libs/FEvent.c (fev_set_evpos): new function * fvwm/functions.c (__execute_function): (execute_complex_function): fixed complex action clicking logic * fvwm/add_window.c (CaptureOneWindow): fixed RecaptureWindow (CaptureAllWindows): fixed Restart * fvwm/functable.c (func_table): fixed running RecaptureWindow without a context window * fvwm/conditional.c (circulate_cmd): fixed action to run * fvwm/events.c (HandleVisibilityNotify): fixed VisibilityNotify handling * fvwm/functions.c (execute_complex_function): fixed memory corruption (__execute_function): fixed using wrong context (__execute_function): removed conditional that was always true now (DeferExecution): fixed core dump * fvwm/module_interface.c (ExecuteModuleCommand): initialise module number 2002-09-11 Dominik Vogt * fvwm/add_window.c (CaptureOneWindow): fixed memory corruption * fvwm/icons.c (Iconify): (DeIconify): fixed bug introduced with transient stacking patch * fvwm/functions.c (DeferExecution): (__execute_function): (execute_complex_function): cleaned up and optimized exec_context handling * fvwm/schedule.c: * fvwm/menucmd.c: * fvwm/update.c: * fvwm/windowlist.c: * fvwm/conditional.c: * fvwm/focus.c: * fvwm/functions.c: * fvwm/placement.c: * fvwm/colorset.c: * fvwm/stack.c: * fvwm/virtual.c: * fvwm/module_interface.c: * fvwm/icons.c: * fvwm/builtins.c: * fvwm/add_window.c: * fvwm/move_resize.c: * fvwm/fvwm.h (F_CMD_ARGS): (F_PASS_ARGS): completely removed the builtin command arguments fw, w, and context * fvwm/functions.c (DeferExecution): fixed core dump * fvwm/stack.c (BroadcastRestack): removed global lastTimestamp * fvwm/ewmh_events.c (EWMH_ProcessClientMessage): (EWMH_ProcessPropertyNotify): (ewmh_WMStateShaded): (ewmh_WMStateSticky): (ewmh_WMStateHidden): (ewmh_WMState): (ewmh_MoveResize): (ewmh_WMDesktop): (ewmh_CloseWindow): (ewmh_DesktopGeometry): (ewmh_ActiveWindow): use new function interface * fvwm/menus.c (do_menu): * fvwm/menucmd.c (menu_func): * fvwm/windowlist.c (CMD_WindowList): use new function interface replaced "(XEvent *)1" hack with a regular flag 2002-09-10 Dominik Vogt * fvwm/add_window.c (destroy_window): * fvwm/update.c (destroy_scheduled_windows): * fvwm/screen.h (ScreenInfo): new member is_executing_menu_function * fvwm/windowlist.c (CMD_WindowList): * fvwm/menucmd.c (menu_func): * fvwm/gnome.c (CMD_GnomeButton): (GNOME_ProcessClientMessage): (GNOME_HandlePropRequest): * fvwm/modconf.c (CMD_Send_ConfigInfo): * fvwm/update.c (apply_window_updates): * fvwm/repeat.c (CMD_Repeat): * fvwm/conditional.c (circulate_cmd): (CMD_Prev): (CMD_Next): (CMD_None): (CMD_Any): (CMD_Current): (CMD_Cond): (CMD_CondCase): (select_cmd): (CMD_All): (CMD_Direction): (CMD_WindowId): * fvwm/focus.c (warp_to_fvwm_window): (CMD_WarpToWindow): * fvwm/read.c (run_command_stream): (run_command_file): (CMD_Read): (CMD_PipeRead): * fvwm/fvwm.c (Done): (SetRCDefaults): (StartupStuff): (main): use new function interface (main): fixed running startup script under random module number * fvwm/functions.c (execute_function_override_window): * fvwm/functions.c (execute_function_override_wcontext): new convenience functions * fvwm/gnome.c: * fvwm/modconf.c: * fvwm/session.c: re-indented * fvwm/module_interface.c (CMD_Send_WindowList): (CMD_set_mask): (CMD_set_sync_mask): (CMD_set_nograb_mask): fixed core dumps don't use "Module" argument anymore (ExecuteModuleCommand): made static use new function interface * fvwm/add_window.c (CaptureOneWindow): (do_recapture): (CaptureAllWindows): * fvwm/events.c (HandleMapRequestKeepRaised): * fvwm/add_window.c (AddWindow): AddWindow takes executiuon context as its argument instead of the window; changed caller don't use "Event" anymore * fvwm/fvwm.c (StartupStuff): generate an execution context for startup * fvwm/move_resize.c (DoResize): (__resize_step): (moveLoop): (__move_loop): renamed and used new function interface in args * fvwm/geometry.c (constrain_size): added XEvent *e argument to remove use of global "Event"; changed all callers 2002-09-09 Dominik Vogt * fvwm/stack.c (get_next_window_in_stack_ring): (get_prev_window_in_stack_ring): (get_transientfor_fvwmwindow): * fvwm/icons.c (SetMapStateProp): * fvwm/events.c (fake_map_unmap_notify): * fvwm/misc.c (IsRectangleOnThisPage): * fvwm/menus.c (menu_enter_tear_off_menu): (menu_close_tear_off_menu): * fvwm/icons.c (DrawIconWindow): * fvwm/focus.c: * fvwm/colormaps.c (InstallWindowColormaps): made FvwmWindow * arguments const in many functions * fvwm/menus.c (pop_menu_up): (pop_menu_down): (__mloop_do_menu): (__mloop_do_popup): (do_menu): (menu_enter_tear_off_menu): (__mloop_get_event): (__mloop_get_event_timeout_loop): (__mloop_do_menu): (__mloop_get_mi_actions): (is_double_click): * fvwm/events.c (HandleEnterNotify): * fvwm/move_resize.c (AnimatedMoveAnyWindow): (__move_window): (__move_loop): (__resize_step): (__resize_window): * fvwm/functions.c (DeferExecution): (__execute_function): * fvwm/windowlist.c (CMD_WindowList): * fvwm/colormaps.c (colormap_handle_colormap_notify): * fvwm/module_interface.c (CMD_ModuleSynchronous): (ExecuteModuleCommand): * fvwm/builtins.c (CMD_Wait): * fvwm/events.c (WaitForButtonsUp): (HandleShapeNotify): (HandleVisibilityNotify): (HandleUnmapNotify): (HandleSelectionRequest): (HandleReparentNotify): (HandlePropertyNotify): (HandleMotionNotify): (HandleMapRequestKeepRaised): (HandleMapRequest): (HandleMappingNotify): (HandleMapNotify): (HandleLeaveNotify): (HandleKeyPress): (HandleFocusOut): (HandleFocusIn): (HandleExpose): (HandleEnterNotify): (HandleDestroyNotify): (HandleColormapNotify): (HandleClientMessage): (HandleButtonRelease): (HandleButtonPress): (__handle_bpress_on_root): (__handle_bpress_action): (__handle_click_to_raise): (__handle_click_to_focus): (__is_bpress_window_handled): (__handle_focus_raise_click): don't use "Event", "Fw" and old_execute_function() anymore * fvwm/events.c (dispatch_event): removed preserve_tmpwin argument; changed all callers * fvwm/events.c (CoerceEnterNotifyOnCurrentWindow): fixed random focus member of faked event * fvwm/gnome.c (GNOME_ProcessClientMessage): * fvwm/ewmh_events.c (EWMH_ProcessClientMessage): (EWMH_ProcessPropertyNotify): * fvwm/move_resize.c (DisplaySize): (DisplayPosition): (position_geometry_window): * fvwm/geometry.c (get_window_borders): (get_window_borders_no_title): made args const * fvwm/events.c (dispatch_event): create event execution context (HandleClientMessage): removed useless local "button" (GetContext): don't fiddle with global Fw anymore; added argument to return context window; changed all callers * fvwm/events.c (CoerceEnterNotifyOnCurrentWindow): * fvwm/move_resize.c (__resize_window): use new event handle interface * fvwm/events.c: * fvwm/eventhandler.h: new event handler interface * fvwm/functions.c (CMD_Plus): * fvwm/builtins.c (AddToDecor): (CMD_AddToDecor): (CMD_DestroyDecor): use F_CMD_ARGS in AddToDecor (CMD_StrokeFunc): removed useless check for realloc return value use new function interface fixed another memory leak * fvwm/builtins.c (__remove_window_decors): replace old_execute_function with execute_function * fvwm/add_window.c (setup_window_placement): * fvwm/placement.c (PlaceWindow): * fvwm/schedule.c (execute_obj_func): * fvwm/colorset.c (add_to_junk): use new function call interface * fvwm/fvwm.h (F_EXEC_ARGS): (F_PASS_EXEC_ARGS): removed now unused macros * fvwm/functions.c (CheckActionType): (cf_cleanup): (DeferExecution): (__execute_function): (__run_complex_function_items): (execute_complex_function): rewrote function call interface * fvwm/functions.c (__run_complex_function_items): new function split off from execute_complex_function * fvwm/externs.h: * fvwm/events.c: removed "Event" global 2002-09-08 Dan Espen * fvwm/fvwm.1.in: Language check. 2002-09-08 Dominik Vogt * fvwm/functions.c (old_execute_function): removed * fvwm/module_interface.c (do_execute_module): don't write module argument anymore; code claimed that writing 0 into *Module prevented WaitForButtonsUp from being called, but that was either a lie or a relic of the past * fvwm/fvwm.h (exec_func_args_type): removed type (F_CMD_ARGS): (F_PASS_ARGS): removed *Module argument * fvwm/functions.c (__execute_function): new interface * fvwm/functions.h (enum): added more function execution falgs * fvwm/fvwm.h: add exec_context_t *exc to builtin arguments * libs/FEvent.c (fev_copy_last_event): new function * fvwm/execcontext.h: * fvwm/execcontext.c: new files introducing the "exec_context_t" structure that shall replace the builtin command interface * fvwm/stack.c (__RaiseOrLowerWindow): (RaiseOrLowerWindow): (__restack_window): (mark_transient_subtree): (__sort_transient_ring): properly handle restacking of windows with more than one transient and multiple levels of transients at the same time (__RaiseOrLowerWindow): (RaiseOrLowerWindow): renamed function and added wrapper * fvwm/fvwm.h (FvwmWindow): added new scratch registers 2002-09-06 Mikhael Goikhman * configure.in: * Makefile.am: minor improvements in the new release procedure 2002-09-06 Dominik Vogt * fvwm/stack.c (RaiseOrLowerWindow): (__restack_window): (mark_transient_subtree): (must_move_transients): (is_on_top_of_layer_ignore_rom): handle restacking trees of transient windows; still does not work too well if a window has multiple transients at the same time 2002-09-05 Dominik Vogt * fvwm/stack.h: * fvwm/stack.c: restored versions from before 9th of September (RaiseOrLowerWindow): fixed StackTransientParent style without RaiseTransient or LowerTransient on transient_for window StackTransientParent works only on window in the same layer (mark_transient_subtree): fixed handling of window group hint w/ iconify (restack_windows): (RaiseOrLowerWindow): (new_layer): fixed flickering when overlapping transients aree lowered * fvwm/move_resize.c (__resize_window): * fvwm/colorset.c (add_to_junk): cleaned up event handling * fvwm/move_resize.c (__resize_window): renamed function and changed callers * fvwm/fvwm.h (F_PASS_ARGS): (F_CMD_ARGS): removed eventp command argument * fvwm/events.c (DispatchEvent): (dispatch_event): renamed function, added event argument and changed all callers * libs/FEvent.c (fev_fake_event): * libs/FEvent.c (fev_get_evtype__remove_me): new functions * fvwm/menus.c (menuShortcuts): (is_double_click): (pop_menu_up): (pop_menu_up): (pop_menu_down): (pop_menu_down): (__mloop_init): (__mloop_get_event_timeout_loop): (__mloop_get_event): (__mloop_do_popup): (__mloop_do_popup): (do_menu): * fvwm/builtins.c (CMD_FakeClick): * fvwm/functions.c (CheckActionType): (CheckActionType): * fvwm/focus.c (__try_program_focus): (__try_program_focus): * fvwm/icccm2.c (SetupICCCM2): * fvwm/virtual.c (HandlePaging): * fvwm/module_interface.c (make_vpacket): (make_new_vpacket): * fvwm/schedule.c (squeue_get_next_ms): (squeue_get_next_ms): (CMD_Schedule): * fvwm/stack.c (BroadcastRestack): * fvwm/move_resize.c (resize_window): (moveLoop): * libs/FEvent.c (fev_get_evtime): removed global lastTimestamp; use fev_get_evtime() from FEvent.c instead * fvwm/events.c (HandleEnterNotify): (DispatchEvent): (My_XNextEvent): (discard_events): (discard_window_events): * fvwm/move_resize.c (AnimatedMoveAnyWindow): (moveLoop): (resize_window): * fvwm/menus.c (__mloop_get_event): * fvwm/virtual.c (HandlePaging): (MoveViewport): * fvwm/functions.c (DeferExecution): (CheckActionType): * fvwm/misc.c (get_server_time): * fvwm/builtins.c (CMD_StrokeFunc): * fvwm/menus.c (pop_menu_up): (pop_menu_down): (__mloop_init): * libs/FEvent.c (fev_update_last_timestamp): removed StashEventTime function; handle this directly in FEvent.c * fvwm/module_interface.c (ExecuteModuleCommand): * fvwm/misc.c (Keyboard_shortcuts): * fvwm/colormaps.c (colormap_handle_colormap_notify): * fvwm/events.c (handle_all_expose): (dispatch_event): (HandleEvents): (HandleKeyPress): don't use Event global anymore * fvwm/bindings.c (activate_binding): fixed key bindings on window corners * libs/fvwmlib.h (C_DECOR): context including all parts of the decorations 2002-09-04 Mikhael Goikhman * libs/FEvent.h: fixed compilation warning in #endif comment * fvwm/borders.c: removed debug fprintf * acconfig.h: * configure.in: * fvwm/fvwm.c: * fvwm/fvwm.1: another solution for reporting the cvs status 2002-09-04 Dominik Vogt * configure.in (LIBOBJS): * acinclude.m4 (smr_SWITCH): fix for autoconf 2.53 * fvwm/*.[ch]: removed unnecessary includes * fvwm/Makefile.am (fvwm_SOURCES): * fvwm/events.h: * fvwm/eventmasks.h: * fvwm/eventhandlers.h: new files split from events.h * fvwm/icccm2.c (HandleSelectionRequest): (HandleSelectionClear): * fvwm/colormaps.c (HandleColormapNotify): * fvwm/menus.c (menu_tear_off): * fvwm/move_resize.c (resize_window): * fvwm/events.c: * fvwm/events.h: new argument avh_args_t to the event handler functions; still unused moved all event handlers to events.c remove now unnecessary includes in some files * fvwm/icccm2.c (HandleSelectionRequest): re-indented file * **/*.c: use replacements for X event functions everywhere 2002-09-03 Mikhael Goikhman * fvwm/defaults.h: * fvwm/screen.h: * fvwm/borders.c (border_flags_to_button_state): (CMD_ButtonState): * fvwm/builtins.c (ReadTitleButton): * fvwm.1.in (ButtonStyle, TitleStyle, ButtonState): * fvwm/fvwm.c (InitVariables): Imlemented new title and button states InactiveUp and InactiveDown, new state shortcuts Active, Inactive, ToggledActive, ToggledInactive. So now there are 4+4 states and 2+2 aliases instead of 3+3 states. Updated all ButtonStyle, TitleStyle and ButtonState commands. * fvwm/fvwm.c: reformat license info in -version to be 3 lines and one empty line instead of 5 non-empty lines, for readability 2002-09-03 Dominik Vogt * libs/FEvent.c: * libs/FEvent.h: * libs/Makefile.am: new files * fvwm/stack.c (__raise_or_lower_recursion): (RaiseOrLowerWindow): split into two functions renamed to __raise_or_lower_window (mark_transient_subtree): new flag MARK_CLEAR (position_new_window_in_stack_ring): (RaiseWindow): (LowerWindow): cleaned up stacking code * fvwm/menus.c (paint_menu): fixed a minor drawing problem with menu item reliefs 2002-09-02 Dominik Vogt * fvwm/move_resize.c (InteractiveMove): removed eventp from interface changed all callers * fvwm/menucmd.c (menu_func): * fvwm/gnome.c (GNOME_ProxyButtonEvent): * fvwm/windowlist.c (CMD_WindowList): * fvwm/read.c (run_command_file): (run_command_stream): * fvwm/focus.c (warp_to_fvwm_window): * libs/Event.c (GetSubwindowFromEvent): * fvwm/events.c (GetContext): * libs/Pointer.c (GetLocationFromEventOrQuery): * fvwm/builtins.c (CMD_StrokeFunc): (CMD_StrokeFunc): * fvwm/events.c (StashEventTime): * fvwm/move_resize.c (InteractiveMove): * fvwm/functions.c (DeferExecution): (old_execute_function): * fvwm/fvwm.h (F_CMD_ARGS): (F_EXEC_ARGS): make eventp argument const to ease clean up work * fvwm/windowlist.c (CMD_WindowList): * fvwm/move_resize.c (InteractiveMove): * fvwm/menucmd.c (menu_func): * fvwm/icons.c (CMD_Iconify): always query pointer position in case a script modified the position in the input event * fvwm/focus.c (SetPointerEventPosition): removed function since it modifies the global event variable * fvwm/functable.c (func_table): added cursor and event type members fo DeferExecution call * fvwm/functions.c (DeferExecution): made static, call from inside functions.c only removed calls everywhere * fvwm/builtins.c (CMD_StrokeFunc): fixed memory leak * fvwm/virtual.c (HandlePaging): (MoveViewport): don't use global "Event" anymore (HandlePaging): pass in event structure through arguments changed all callers 2002-09-02 olicha * libs/Colorset.c (*): * libs/Colorset.h: * libs/colorset.c (parse_colorset): * libs/PictureGraphics.c (PGrabXImage): (PCreateRenderPixmap):sx (PGraphicsCreateTransprency): * libs/PictureGraphics.h: An experimental implementation of ParentalRelative tinted background * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): * libs/PictureImageLoader.c (PImageCreatePixmapFromArgbData): (PImageLoadPng): * libs/PictureGraphics.c (PGraphicsCreateStretchPicture): * libs/FRenderInit.c (FRenderInit): (FRenderGetAlphaDepth): * libs/FRenderInit.h: Fixed alpha blending for xserver without depth 8 pixmap (maybe a tmp fix) * fvwm/fvwm.1.in typo 2002-09-01 olicha * NEWS: Colorset and alpha blending news 2002-08-31 olicha * libs/Ficonv.c (convert_charsets): Fixed compilation on systems that do not have EILSEQ 2002-08-30 olicha * libs/PictureGraphics.c (PGraphicsCreateStretchPicture): Fixed compilation of certain modules * fvwm/borders.c (border_render_into_pixmap): * libs/PictureGraphics.c (PGraphicsCreateStretchPicture): * libs/PictureGraphics.h: * libs/Graphics.c (CreateStretchPixmap): (CreateStretchYPixmap): (CreateStretchXPixmap): Progress with masks in multipixmap title * libs/PictureGraphics.c (PCopyArea): (PTileRectangle): (PCreateRenderPixmap): * fvwm/borders.c (border_fill_pixmap_background): Some drawing fixes * fvwm/icons.c (DrawIconWindow): * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): Fixed the shape mask of ewmh icons and icons with some alpha 2002-08-30 olicha * libs/PictureGraphics.c (PCreateRenderPixmap): (PGrabImageErrorHandler): (PGraphicsCopyPixmaps): (PGraphicsCopyFvwmPicture): (PGraphicsTileRectangle): (PGraphicsRenderPixmaps): (PGraphicsRenderPicture): * libs/PictureGraphics.h: * libs/PictureBase.h: Replaced PGraphicsTileRectangle with a more powerful function, PCreateRenderPixmap, which performs *full* XRender simulation. So alpha blending is now supported even without Xrender support. New interface function PGraphicsRenderPixmaps and PGraphicsRenderPicture for direct rendering with tint and alpha channel. * libs/FRender.c (FRenderVisualInit): (FRenderCopyArea): (FRenderTintRectangle): (FRenderRender): * libs/FRenderInterface.h: Replaced FRenderCopyArea and FRenderTintRectangle with a more general and more powerfull function FRenderRender * libs/PictureImageLoader.c (PImageCreatePixmapFromArgbData): (PImageLoadPng): * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): Load the alpha even without Xrender support * libs/Colorset.h: * fvwm/colorset.c (parse_pixmap_tint): (parse_colorset): (alloc_colorset): Implemented IconTint, IconAlpha, bgTint. Tint (~ PixmapTint or ImageTint or obsolete TintMask) also tints gradients and the tint is applied only to the pixmap not the bg color. The average bg is computed from the "original" pixmap and not the tinted one, bgTint should be used to get a real average bg in the case the pixmap is tinted * fvwm/icons.c (DrawIconWindow): (CreateIconWindow): * fvwm/menuitem.c (menuitem_paint): * fvwm/menus.c (paint_side_pic): * fvwm/borders.c (border_get_border_background): (border_draw_decor_to_pixmap): (border_fill_pixmap_background): * fvwm/events.c (HandlePropertyNotify): Picture rendering use the new PGraphicsRenderPixmaps and PGraphicsRenderPicture libs functions. Respect new colorset options * fvwm/colorset.c (parse_colorset): (alloc_colorset): (CMD_ReadWriteColors): * fvwm/fvwm.1.in: Removed the read write colorset codes * libs/Graphics.c (CalculateGradientDimensions): Fixed the size of dithered H and V gradients * libs/PictureUtils.c (*): * libs/PictureUtils.h: Some cleanup 2002-08-29 Dominik Vogt * fvwm/menus.c (paint_menu_gradient_background): fixed drawing of SidePic menu background when not using SideColor 2002-08-28 Hippo * FvwmIconBox/icons.c: Fixed core dump 2002-08-26 Mikhael Goikhman * NEWS: mention new FvwmButtons additions and TitleStyle MultiPixmap 2002-08-26 Mikhael Goikhman * configure.in: fixed --disable-ewmh * libs/Picture.c: * libs/Picture.h: added const to some prototypes 2002-08-25 Dominik Vogt * fvwm/menus.c (MenuInteraction): (__menu_loop): renamed MenuInteraction to __menu_loop * fvwm/menus.c (pop_menu_up): (do_menu): (MenuInteraction): removed pdo_warp_to_title argument of pop_menu_up and changed all callers; logic is now in last_saved_position_hints (__menu_get_next_event_timeout_loop): began to split MenuInteraction into several sub functions go away, evil "goto"! * fvwm/style.c (style_parse_one_style_option): all boolean styles - and *only* boolean styles, can be prefixed with a '!' to invert their meaning (style_parse_button_style): moved Button and NoButton styles to separate function * configure.in: * NEWS: updated for 2.5.4-devel * configure.in: 2.5.3 was released * configure.in: * NEWS: updated for 2.5.3 * fvwm/menuitem.h (struct): * fvwm/menus.c (paint_menu_gradient_background): (paint_menu_pixmap_background): (paint_menu): (clear_expose_menu_area): fixed TiledPixmap menu background drawing bug sorted function in file and removed forward declarations 2002-08-25 Dominik Vogt * fvwm/Makefile.am (LDADD): put -lfvwm at front of library list * fvwm/windowlist.c (CMD_WindowList): print window's page instead of current page in windowlist 2002-08-24 Bob Woodside * fvwm/events.c (HandleButtonPress, HandleEnterNotify): Fix for Experimental RaiseOverUnmanaged Handling. 2002-08-22 Bob Woodside * fvwm/focus.h: * fvwm/stack.h: New defs for Experimental RaiseOverUnmanaged Handling. * fvwm/events.c (HandleEnterNotify): * fvwm/focus.c: (set_focus_to_fwin) (focus_query_grab_buttons) (_focus_grab_buttons) (focus_grab_buttons) (focus_grab_buttons_client_entered) (_SetFocusWindow) (__activate_window_by_command) (_ReturnFocusWindow) (_DeleteFocus) (_ForceDeleteFocus) * fvwm/stack.c: (raise_over_unmanaged) (is_above_unmanaged) (_is_on_top_of_layer) (is_on_top_of_layer) (is_on_top_of_layer_and_above_unmanaged) Experimental RaiseOverUnmanaged Handling - an attempt to fix the interaction of RaiseOverUnmanaged with various focus policies, particularly mouse focus + client click raises; issue mouse button grabs when and only when they are actually needed; and fix the old "xfm + MouseFocusClickRaises" bug once and for all. (Thanks to the GFPR, this is much more straightforward to do!) 2002-08-22 Dominik Vogt * fvwm/fvwm.1.in: added a paragraph about scripting and complex functions. * fvwm/style.c (style_parse_one_style_option): fixed flag_mask and change_mask of TitleAt... styles that broke left and bottom titles 2002-08-21 Dominik Vogt * fvwm/fvwm.1.in: describe new focus policy styles 2002-08-20 Dominik Vogt * fvwm/style.c (merge_styles): fixed applying style updates immediately * fvwm/geometry.c (constrain_size): fixed font resizing of maximized windows * fvwm/window_flags.h: * fvwm/fvwm.h (has_new_wm_normal_hints): new window flags * fvwm/events.c (HandleEnterNotify): fixed UngrabNotify returning focus to just unfocused window * fvwm/focus.h: added debug code * fvwm/style.c (merge_styles): (free_style_mask): (__simplify_style_list): fixed default style calculations * fvwm/events.c (HandleConfigureRequest): disabled debug output * fvwm/style.c (merge_styles): * fvwm/fvwm.h (window_style): new style member default_mask to allow two levels of defaults; fixes focus policy defaults * fvwm/style.h: rewrote many of the macros; changed all callers * fvwm/borders.c (RenderIntoPixmap): (DrawMultiPixmapTitlebar): (border_render_into_pixmap): (border_draw_multi_pixmap_titlebar): applied Suzanne Skinner's multi pixmap titles fix renamed functions and changed all callers * libs/FScreen.c (FScreenGetScrRect): (FindScreen): (FScreenGetScrId): new utility functions * fvwm/windowlist.c (CMD_WindowList): new option MaxLabelWidth for the WIndowList command based on patch by Maxim F. Ischenko new options NoLayer, ShowPage, ShowPageX, ShowPageY and ShowScreen to WindowList command. * fvwm/events.c (HandleConfigureRequest): removed debug code now that the EXPERIMENTAL_ANTI_RACE_CONDITION_CODE seems to work without problems 2002-08-19 Dominik Vogt * fvwm/style.c (merge_styles): fixed style defaults getting stuck to on once set * configure.in: fixed a number of non portable uses of the "test" command and unified the used syntax of all calls to reduce chance of copy-and-paste problems 2002-08-17 Mikhael Goikhman * configure.in: * fvwm/fvwm.1.in: minor typos and improvements; better string quotings and detection of fribidi for autoconf-2.53 * fvwm/Makefile.am: don't include *.in in EXTRA_DIST, they are auto-included 2002-08-17 Dominik Vogt * fvwm/events.c (HandleConfigureRequest): (HandlePropertyNotify): (is_resizing_event_pending): fixed uninitialised return code of test_resizing_event 2002-08-16 Dominik Vogt * fvwm/decorations.c (SelectDecor): * fvwm/style.h: * fvwm/window_flags.h: * fvwm/fvwm.h: moved common.s.has_no_border window flag to common.has_no_border to fix windows getting stuck without a border once the HandleWidth or BorderWidth was set to 0 and then increased again * fvwm/fvwm.1.in: removed reference to BUGS and TODO * configure.in: moved a lot of constant definitions to configure.in; the fvwm.lsm and fvwm.1 files don't have to be updated for a release anymore; the release number and date are set by configure * fvwm/fvwm.c (setVersionInfo): fixed output of "fvwm -version" 2002-08-15 Dominik Vogt * fvwm/style.c (style_parse_one_style_option): Old focus styles override less of the behaviour specified with the FP... styles; use defaults instead without setting the mask (style_parse_one_style_option): removed the styles MouseFocusClickIgnoreMotion and MouseFocusClickIgnoreMotionOff, use the corresponfing FP... styles instead (style_parse_one_style_option): ClickToFocusRaises now works only on the client window, not on the decorations (style_parse_one_style_option): fixed FocusFollowsMouse style (style_set_old_focus_policy): moved old default focus settings to a separate function, simplified code 2002-08-14 Dan Espen * fvwm/fvwm.1: Add hot-spot is an offset information, fix spelling, "hot-spot", not "hotspot" (too bad its wrong in the xpm docs). 2002-08-14 Dominik Vogt * fvwm/style.c (style_parse_focus_policy_style): fixed parsing of FPFocusClickButtons and FocusClickModifiers * libs/Makefile.am: added missing files * fvwm/events.c (HandleConfigureRequest): fixed ConfigureRequest race condition 2002-08-13 Dominik Vogt * configure.in: quote environment variables 2002-08-13 olicha * NEWS: Color limit and dithering news * fvwm/fvwm.1: Added a minimal doc for the -color-limit option * fvwm/builtins.c (CMD_ColorLimit): ColorLimit is obsolete * fvwm/builtins.c (ReadDecorFace): * libs/PictureUtils.c (my_dither_depth_15_16_init): (PictureAllocColorAllProp): Implemented dithering for depth 16 and 15. This is off by default in colorset (use the dither colorset option) and on by default for window title gradient. Gradient are visibly more smooth. * libs/PictureUtils.c (*): Some cleanup 2002-08-13 Mikhael Goikhman * fvwm/fvwm.1: corrected the pixmap cursor description, added an example 2002-08-13 Dominik Vogt * fvwm/menus.c (select_menu_item): (paint_menu_gradient_background): fixed a redrawing problem with H/Vgradient menu faces (MenuInteraction): fixed a minor problem w/ entering submenus via keyboard 2002-08-12 Dominik Vogt * fvwm/move_resize.c (CMD_ResizeMove): (CMD_Resize): (CMD_Maximize): (CMD_ResizeMaximize): (CMD_ResizeMoveMaximize): commands can be used on iconified windows again * ONEWS: * NEWS: moved pre-2.2 NEWS to ONEWS * libs/strdup.c: * libs/safemalloc.c: * libs/envvar.c: * libs/alloca.c: * libs/Target.c: * libs/Parse.c: * libs/Bindings.c: * fvwm/menustyle.c: * fvwm/menus.c: * fvwm/menuitem.c: * fvwm/menucmd.c: * fvwm/frame.c: * fvwm/events.c: * fvwm/borders.c: let config.h include strinh.h or strings.h * fvwm/style.c (style_parse_one_style_option): (style_parse_one_style_option): fixed icon box crash * fvwm/bindings.c (update_nr_buttons): fixed extra buttons on window decorations * fvwm/style.c (style_parse_one_style_option): fixed parsing of the FP... and !FP... styles 2002-08-12 Bob Woodside * fvwm/style.c (style_parse_one_style_option): Fixed a typo so that ClickToFocusRaisesOff actually turns the option off instead of on. 2002-08-12 Dominik Vogt * fvwm/focus.c (focus_grab_buttons): only grab necessary buttons on the client window 2002-08-11 olicha * libs/PictureUtils.c (PICTURE_DEBUG_COLORS_ALLOC_FAILURE): Removed some debug code * fvwm/fvwm.c (main): (usage): Added -color-limit to fvwm usage 2002-08-11 Dominik Vogt * fvwm/style.c (style_parse_one_style_option): (style_parse_focus_policy_style): added style options "FP..." to control focus policy removed OverrideGrabFocus and AllowGrabFocus styles * fvwm/style.c (merge_styles): fixed style defaults != 0 * fvwm/focus.c (__restore_focus_after_unmap): fixed a bug w/ reverting the focus from transients to the parent * fvwm/ewmh.c (ewmh_HandleDesktop): * fvwm/style.c (style_parse_one_style_option): fixed defaults for various focus styles * NEWS: updated for 2.4.9 * fvwm/frame.c (frame_mrs_resize_move_windows): backed out anti-flicker patch that slowed down command processing * fvwm/bindings.c (update_nr_buttons): (ParseBinding): fixed sluggish processing of mouse bindings * fvwm/events.c (__handle_bpress_action): fixed drawing of pressed decorations w/o bindings * fvwm/frame.c (frame_move_resize): removed debug code that broke focus handling * fvwm/style.c (style_parse_one_style_option): fixed passing the focus click to the app by default * fvwm/events.c (__handle_click_to_focus): * fvwm/focus.c (set_focus_to_fwin): (__set_focus_to_fwin): removed drawing code that broke as many places as it fixed; plus it cause unnecessary redraws * fvwm/events.c (HandleConfigureRequest): send a synthetical ConfigureNotify if an application is not granted its wishes from a ConfigureRequest; this is necessary for FixedPPosition and FixedPSize to work properly; also to be ICCCM compliant always force border_width 0 in these events in the experimental cr merging code, send a number of cn events equal to the number of merged events * libs/Parse.c: * fvwm/style.c: reformatted * fvwm/style.c (style_parse_focus_policy_style): (style_parse_icon_size_style): (style_parse_icon_box_style): (style_parse_icon_grid_style): (style_parse_icon_fill_style): (style_parse_one_style_option): (parse_and_set_window_style): split into separate functions (style_parse_one_style_option): simplified and cleaned up * fvwm/events.h: * fvwm/decorations.c: * fvwm/cursor.h: * fvwm/cursor.c: * fvwm/conditional.h: * fvwm/conditional.c: * fvwm/colorset.h: * fvwm/colors.h: * fvwm/colors.c: * fvwm/colormaps.c: * fvwm/bindings.h: * fvwm/bindings.c: reformatted and cleaned up 2002-08-11 olicha * libs/PictureUtils.c (*): * libs/PictureUtils.h: * libs/PictureDitherMatrice.h (new file): * libs/PictureImageLoader.c (*): * libs/PictureImageLoader.h: * libs/PictureGraphics.c (PGraphicsCreateDitherPixmap): (PCreateDitherPixmap): (PCreateTintedPixmap): * libs/PictureGraphics.h: * libs/PictureBase.c (PictureInitCMap): * libs/PictureBase.h: * libs/Picture.c (*): * libs/Picture.h: * libs/Fxpm.h: * libs/Colorset.c (DumpColorset): (LoadColorset): * libs/Colorset.h: * libs/Graphics.c (all gradient functions): * libs/fvwmlib.h: * fvwm/screen.h: * fvwm/move_resize.c (CMD_XorPixmap): * fvwm/colors.c (FreeColors): * fvwm/builtins.c (CMD_DefaultColors): * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): * fvwm/builtins.c (FreeDecorFace): (ReadDecorFace): * fvwm/menus.c (pop_menu_down): (paint_menu_gradient_background): (scanForPixmap): * fvwm/menus.h: * fvwm/menustyle.c (menustyle_free_face): (menustyle_parse_face): (menustyle_free): (menustyle_update): (menustyle_parse_style): (CMD_CopyMenuStyle): * fvwm/menustyle.h: * fvwm/icons.c (GetIconFromFile): * fvwm/builtins.c (ReadMultiPixmapDecor): (ReadDecorFace): * fvwm/borders.c (border_draw_decor_to_pixmap): * fvwm/add_window.c (setup_mini_icon): * fvwm/fvwm.c (main): * fvwm/colorset.c (free_colorset_background): (parse_pixmap): (parse_shape): (parse_colorset): New color limit method and implement dithering in depth <= 8. Added a "fvwm picture attributes" structure for loading image. Some colors leaks fix. Add some (weak) color leaks. New option -color-limit for fvwm. 257 fix. Some prepartion for tint and alpha in colorset. 2002-08-11 Dominik Vogt * libs/Flocale.c (FlocaleRotateDrawString): fixed a crash 2002-08-10 Dominik Vogt * fvwm/style.c (parse_and_set_window_style): fixed the default for passing the click-to-raise click for mousey focus * fvwm/events.c (__handle_click_to_focus): removed redundant code (WaitForButtonsUp): fixed sluggish motion event handling when waiting for buttons to be released * fvwm/focus.c (__set_focus_to_fwin): (set_focus_to_fwin): fixed redrawing the border w/ mousey focus when the window was entered, then the border was clicked before the FocusIn event arrived * fvwm/events.c (__handle_bpress_on_managed): * fvwm/style.c (parse_and_set_window_style): fixed some small focus problems * fvwm/fvwm.c: reformatted and cleaned up * fvwm/fvwm.1: formatting fixes * fvwm/focus.c (focus_query_click_to_raise): (focus_query_click_to_focus): * fvwm/style.c (parse_and_set_window_style): * fvwm/events.c (__test_for_motion): (__check_click_to_focus_or_raise): (__handle_focus_raise_click): (__is_bpress_window_handled): (__handle_click_to_focus): (__handle_click_to_raise): (__handle_bpress_stroke): (__handle_bpress_action): (__handle_bpress_on_root): (__handle_bpress_on_unmanaged): (__handle_bpress_on_managed): (HandleButtonPress): GFPR: completely rewrote ButtonPress handler, thus finishing the core of the new focus code; only the parsing for the new styles is missing * fvwm/virtual.c (is_pan_frame): new function 2002-08-09 Dominik Vogt * fvwm/add_window.c (AddWindow): fixed compile error * fvwm/events.c (__handle_focus_raise_click): (HandleButtonPress): clean up * fvwm/events.c (__handle_focus_raise_click): * fvwm/fvwm.h (struct): * fvwm/style.c (check_window_style_change): (parse_and_set_window_style): * fvwm/session.c (MatchWinToSM): * fvwm/window_flags.h: eliminated parts of the old focus code * fvwm/focus.c (__set_focus_to_fwin): (set_focus_to_fwin): * fvwm/fvwm.c (InitVariables): * fvwm/add_window.c (destroy_window): * fvwm/events.c (__handle_focus_raise_click): * fvwm/screen.h (ScreenInfo): eliminated Scr.Ungrabbed global * fvwm/update.c (apply_window_updates): (flush_window_updates): * fvwm/icons.c (DeIconify): (Iconify): * fvwm/move_resize.c (CMD_Maximize): (__move_window): (handle_stick): * fvwm/frame.c (frame_free_move_resize_args): (__frame_setup_window): * fvwm/virtual.c (do_move_window_to_desk): (CMD_GotoDeskAndPage): (goto_desk): (MoveViewport): * fvwm/stack.c (LowerWindow): * fvwm/events.c (HandleMapNotify): (HandleVisibilityNotify): (DispatchEvent): (HandleFocusIn): (__handle_focus_raise_click): (HandleEnterNotify): (HandleMapRequestKeepRaised): * fvwm/add_window.c (setup_key_and_button_grabs): (setup_focus_policy): (destroy_window): * fvwm/focus.c (__try_other_screen_focus): (__set_focus_to_fwin): (set_focus_to_fwin): (focus_grab_buttons_on_pointer_window): (focus_grab_buttons_on_layer): (focus_grab_buttons_new): cleaned up focus grab handling. * fvwm/focus.c (focus_grab_buttons_on_pointer_window): clean up 2002-08-08 Dominik Vogt * fvwm/add_window.c (setup_window_structure): (AddWindow): discarded unused return code * fvwm/focus.c (focus_grab_buttons): split into two fucntions and fixed a bug with ungrabbing buttons * fvwm/focus_policy.c (fpol_query_allow_set_focus): * fvwm/style.c (parse_and_set_window_style): * fvwm/icons.c (DeIconify): (DeIconify): * fvwm/events.c (HandleButtonPress): (HandleEnterNotify): (HandleLeaveNotify): (HandleMapNotify): (HandleMapRequestKeepRaised): * fvwm/add_window.c (CaptureAllWindows): * fvwm/virtual.c (UnmapDesk): (MapDesk): (do_move_window_to_desk): * fvwm/update.c (flush_window_updates): * fvwm/focus.c (set_focus_model): (DeleteFocus): (__restore_focus_after_unmap): much more GFPR work; these patches may break lots of things * fvwm/focus.c (set_focus_to_fwin): (__activate_window_by_command): (SetFocusWindow): (ReturnFocusWindow): (DeleteFocus): (ForceDeleteFocus): renamed MoveFocus to set_focus_to_fwin 2002-08-07 Mikhael Goikhman * libs/Fft.c (FftDrawString): removed redudant and buggy code that called DrawStringFunc before this pointer gets initialized * fvwm/focus.c (focus_query_click_to_raise): fixed possibly-uninitialized variable warning * fvwm/Makefile.am: specify stroke includes before Xft includes, may improve some cases 2002-08-07 Dominik Vogt * configure.in: fixed sys/time.h detection * fvwm/events.c (HandleMappingNotify): * libs/Bindings.c (AddBinding): added MappingNotify event handler * fvwm/events.c (HandleMapRequest): removed debug code * fvwm/events.c (InitEventHandlerJumpTable): another attempt at handling "unknown" modifiers in key bindings 2002-08-06 Dominik Vogt * fvwm/stack.c (is_on_top_of_layer_ignore_rom): * fvwm/add_window.c (destroy_window): * fvwm/focus.c (focus_grab_buttons): fixed core dump 2002-08-05 Dominik Vogt * fvwm/focus.c (focus_force_refresh_focus): * fvwm/events.c (HandleEnterNotify): (HandlePropertyNotify): (HandleButtonPress): * fvwm/icons.c (DeIconify): * fvwm/virtual.c (MapDesk): * fvwm/focus_policy.c (fpol_query_allow_user_focus): * fvwm/update.c (apply_window_updates): * fvwm/module_interface.c: * fvwm/conditional.c (MatchesConditionMask): more GFPR work * fvwm/icons.c (Iconify): removed "#if 0"ed code * fvwm/module_interface.c: disabled the old ConfigureWindow module interface * vms/vms.c: * libs/fvwmsignal.h: * libs/Picture.c: * fvwm/ewmh_intern.h: * fvwm/events.c: * fvwm/module_interface.c: * fvwm/misc.c: use ftime.h * libs/ftime.h: new file to encapsulate time.h and sys/time.h inclusion * fvwm/stack.c: re-indented (mark_transient_subtree): (__mark_group_member): cleaned up and split into two functions * fvwm/focus.c (CMD_Focus): (CMD_FlipFocus): * fvwm/icons.c (DeIconify): clean up (FocusOn) (__activate_window_by_command): renamed function * fvwm/focus_policy.c (fpol_query_allow_set_focus): * fvwm/focus_policy.h (fpol_set_focus_by_t): * fvwm/style.c (parse_and_set_window_style): (parse_and_set_window_style): began implementing new focus control styles * fvwm/focus.c (DoSetFocus): (__restore_focus_after_unmap): (MoveFocus): (refresh_focus): more GFPR work (DoSetFocus): (__set_focus_to_fwin): function renamed * fvwm/conditional.c (MatchesConditionMask): * fvwm/focus.c (focus_query_open_grab_focus): (focus_query_close_restore_focus): (focus_does_accept_input_focus): (MoveFocus): * fvwm/events.c (HandleUnmapNotify): (HandleEnterNotify): (HandleMapNotify): (HandleMapRequestKeepRaised): renamed some functions * libs/defaults.h: * fvwm/focus_policy.c: * fvwm/focus_policy.h: prepared some future focus policy flags * configure.in: enable error message when png or xpm test compilation fails * fvwm/style.h: * fvwm/window_flags.h: * fvwm/ewmh.c (ewmh_HandleDesktop): * fvwm/style.c (parse_and_set_window_style): (check_window_style_change): * fvwm/events.c (HandleButtonPress): (HandleVisibilityNotify): began GFPR migration of *raises* focus policy flags * fvwm/focus.c (focus_is_focusd): new function * libs/Bindings.c (AddBinding): fixed handling of "unknown" modifiers in key bindings * fvwm/focus.c (focus_grab_buttons): (focus_query_grab_buttons): moved focus policy code into separate function 2002-08-02 Mikhael Goikhman * Makefile.am: DESTDIR fix 2002-08-01 Dominik Vogt * fvwm/style.c (parse_and_set_window_style): * fvwm/focus.c (focus_query_grab_focus): * fvwm/events.c (HandleMapNotify): (HandlePropertyNotify): * fvwm/focus_policy.c (fpol_init_default_fp): * libs/defaults.h: new styles OverrideGrabFocus and AllowGrabFocus cleaned up focus grabbing code and moved to focus.c 2002-07-30 Dominik Vogt * fvwm/focus.c (CMD_WarpToWindow): fixed negative arguments for unmanaged windows * fvwm/conditional.c (CMD_Direction): use PeekToken instead of GetNextToken cleaned up new direction "center" 2002-07-29 Dominik Vogt * fvwm/events.c (addkbsubinstoarray): disabled experimental pointer warping code * fvwm/menus.c: removed menu crash debug code 2002-07-26 Dominik Vogt * fvwm/menus.c: added tons of crash debug code * fvwm/add_window.c: made a lot of internal functions static * fvwm/add_window.c (setup_button_windows): (destroy_title_window): (destroy_button_windows): (destroy_resize_handle_windows): (destroy_auxiliary_windows): (destroy_icon): (destroy_window): * fvwm/icons.c (CreateIconWindow): safety patches w/ XDeleteContext * fvwm/menus.c (DestroyMenu): fixed a crash w/ accessing already deleted menus 2002-07-25 Dominik Vogt * fvwm/menus.c (get_menu_options): fixed menu context rectangle "icon" if the icon was not just a pixmap 2002-07-24 Dominik Vogt * fvwm/events.c (HandleMapNotify): (HandleMapRequestKeepRaised): (HandleUnmapNotify): * fvwm/ewmh_events.c (ewmh_WMStateModal): * fvwm/ewmh.c (ewmh_HandleDesktop): * fvwm/style.c (parse_and_set_window_style): removed old do_grab_focus_when_created and *_when_transient_* flags 2002-07-23 Dominik Vogt * fvwm/conditional.c (MatchesConditionMask): * fvwm/focus.c (DoSetFocus): * fvwm/session.c (MatchWinToSM): * fvwm/module_interface.c (SETOLDFLAGS): removed old is_lenient flag * fvwm/bindings.c: * fvwm/style.c (__simplify_style_list): (simplify_style_list): reformatted * fvwm/window_flags.h: * fvwm/style.h: access macros for focus policy flags structures reformatted * fvwm/focus_policy.c: * fvwm/focus_policy.h: new files, begin great focus policy rewrite aka GFPR 2002-07-22 Bob Woodside * fvwm/placement.c (PlaceWindow): Fixed interaction between CascadePlacement and StartsOnPage 2002-07-22 Dominik Vogt * libs/fvwmsignal.c (fvwmSelect): call alloca(0) in fvwmSelect to make sure the memory is not leaked in modules 2002-07-21 Dominik Vogt * fvwm/add_window.c (CaptureOneWindow): fixed a core dump w/ windows being destroyed during a recapture (AddWindow): removed duplicate check if new windows still exist * fvwm/placement.c (CMD_PlaceAgain): * fvwm/move_resize.c (move_window_doit): (__move_icon): * fvwm/virtual.c (MapDesk): (MoveViewport): (do_move_window_to_desk): * fvwm/icons.c (AutoPlaceIcon): (ChangeIconPixmap): (Iconify): some cleanup in movement code new option "Icon" to PlaceAgain command adapted documentation accordingly * fvwm/move_resize.c (move_window_doit): (__move_window): renamed function 2002-07-20 Dominik Vogt * libs/Flocale.c (FlocaleRotateDrawString): create gcs only once * fvwm/fvwm.1: removed some references to Recapture UseDecor, UseStyle, AddToDecor, ChangeDecor, DestroyDecor, UpdateDecor, ButtonStyle, BorderStyle and TitleStyle are planned to be removed in 3.0 * libs/gravity.c (gravity_parse_multi_dir_argument): fixed "all" multidir selecting "center" too * libs/Fft.c (FftDrawString): * libs/Flocale.c (FlocaleRotateDrawString): (FlocaleFontStructDrawString): (FlocaleDrawString): fixed some text placement bugs w/ shadow text (FlocaleGetShadowTextPosition): implemented "center" shadows 2002-07-20 olicha * libs/Flocale.c (FlocaleRotateDrawString): Removed some static declarations 2002-07-19 Dominik Vogt * libs/gravity.c (gravity_multi_dir_to_dir): * libs/gravity.h (enum): new function, cleaned up (enum): * fvwm/fvwm.h (FvwmWindow): * libs/Fft.c: * fvwm/geometry.c: * fvwm/borders.c: moved text_rotation_type to gravity.h and renamed to rotation_type * libs/Flocale.h: fixed several bugs in the access macros * libs/Flocale.c: removed unused static FlocaleSeted (FlocaleFontStructDrawString): simplified function * fvwm/virtual.c (CMD_EdgeCommand): * fvwm/windowshade.c (CMD_WindowShade): * fvwm/conditional.c (CMD_Direction): adapted to changes in ParseDirectionArgument * libs/gravity.h: * libs/gravity.c (ParseDirectionArgument): new direction "Center" * fvwm/virtual.c (CMD_EdgeCommand): reformatted 2002-07-18 olicha * libs/PictureUtils.c (PictureRGBtoPixel): (decompose_mask): Fixed(??) color allocation for some visuals 2002-07-18 Dominik Vogt * libs/Flocale.c (FlocaleFontStructDrawString): a little code cleanup * fvwm/events.c (HandleEnterNotify): removed debug code anothe click+drag fix * libs/Pointer.c (GetLocationFromEventOrQuery): * fvwm/focus.c (SetPointerEventPosition): * fvwm/functions.c (CheckActionType): * fvwm/builtins.c (CMD_StrokeFunc): * fvwm/move_resize.c (moveLoop): (resize_window): fixed some bugs w/ pointer on wrong screen 2002-07-17 Dominik Vogt * fvwm/events.c (HandleLeaveNotify): fixed problem w/ click+drag and mousey focus * fvwm/menus.c (size_menu_horizontally): fixed menu style SubmenusLeft w/ icons in menu items 2002-07-14 Dominik Vogt * fvwm/menuitem.c (menuitem_paint): * fvwm/menus.h: * fvwm/menus.c (paint_menu_gradient_background): (get_menu_paint_item_parameters): removed circular dependency of menus.c and menuitem.c by using callback functions 2002-07-17 olicha * fvwm/menuitem.c: A -Wall fix * fvwm/fvwm.c (InitVariables): (main): * fvwm/colorset.c (parse_colorset): (alloc_colorset): (CMD_ReadWriteColors): * fvwm/builtins.c (CMD_ColorLimit): * libs/PictureUtils.h: * libs/PictureUtils.c (PictureReduceColor): (PictureReduceRGBColor): (PictureRGBtoPixel): (PictureAllocColor): (PictureFreeColors): (PictureGetNextColor): (colors_alloc_fail): (my_alloc_color): (AllocColors*): (AllocColorTable): (PictureAllocColorTable): * libs/PictureImageLoader.c (PImageXpmAllocColor): (PImageXpmFreeColor): (PImageLoadXpm): * libs/PictureBase.c (PictureInitCMap): * libs/Graphics.c (AllocLinearGradient): * libs/ColorUtils.c (GetShadow): (GetHilite): (GetForeShadow): (GetTintedPixel): (GetSimpleColor): (GetColor): (fvwmlib_clone_color): * libs/PictureGraphics.c (PGraphicsTintRectangle): Implemented a new color limit method 2002-07-17 Dominik Vogt * fvwm/move_resize.c (moveLoop): fixed problem moving the pointer off screen while moving a window (AnimatedMoveAnyWindow): fixed pointer warping w/ multiple screens and animated window motion 2002-07-12 olicha * fvwm/menus.c (get_menu_paint_item_parameters): (paint_menu_gradient_background): * fvwm/menuitem.c (menuitem_paint): * fvwm/menuitem.h: * fvwm/menus.h: Fixed B/DGradient with Xft fonts * libs/Colorset.h: * libs/ColorUtils.c (GetTintedColor): (GetTintedPixel): * fvwm/colorset.c (parse_simple_tint): (parse_colorset): (alloc_colorset): Implemented fgTint colorset option * libs/PictureImageLoader.c: * libs/PictureUtils.c: * libs/PictureUtils.h: * libs/Makefile.am: Moved color limitation and some rgb to pixel functions from PictureImageLoader to new files PictureUtils.c, PictureUtils.h * fvwm/colorset.c (parse_colorset): * libs/PictureGraphics.c (PCreateTintedPixmap): (PGraphicsTintRectangle): Implemented tinting for X server without Xrender support and did color limitation when tinting 2002-07-10 Dominik Vogt * fvwm/events.c (WaitForButtonsUp): fixed handling of button release events 2002-07-10 Dominik Vogt * fvwm/menus.c (MenuInteraction): fixed core dump w/ dynamic popdown action destroying a menu (paint_menu_gradient_background): fixed hang and/or incorrect drawing of b and d gradients in menus * fvwm/events.c (HandleEnterNotify): (HandleLeaveNotify): improved LEAVE_WINDOW/ENTER_WINDOW handling 2002-07-09 Dominik Vogt * libs/Colorset.c (SetWindowBackground): (SetWindowBackgroundWithOffset): (ScrollPixmap): implemented new functions to allow pixmap backgrounds with an offset 2002-07-07 Dominik Vogt * fvwm/events.c (HandleMapRequestKeepRaised): send Map/UnmapNotify before iconyfying, not after 2002-07-06 Dominik Vogt * fvwm/events.c (HandleMapRequestKeepRaised): fake a MapNotify and then an UnmapNotify when a window is created iconic * fvwm/add_window.c (AddWindow): workaround for buggy TK menu positioning * fvwm/module_interface.c (FlushMessageQueue): (PositiveWrite): (get_pipe_name): tried to fix module communication deadlock w/ sync mask and a full write pipe * libs/Strings.c: re-indented file * libs/defaults.h: 2002-07-06 olicha * libs/Flocale.c (FlocaleGetFontSet): Removed some unwanted code 2002-07-06 Dominik Vogt * fvwm/events.c (HandleLeaveNotify): (HandleEnterNotify): reduced the number of MX_LEAVE/ENTER_WINDOW messages * fvwm/events.c (CMD_XSync): very experimental patch to cycle through subwindows accepting keyboard input; call Xsync command repeatedly to test; crashes fvwm if more than 1000 subwindows are used; * fvwm/focus.c (CMD_WarpToWindow): fixed a bug in warpttowindow command with subwindows of unmanaged windows 2002-07-05 Dominik Vogt * fvwm/events.c (HandlePropertyNotify): * fvwm/events.h: handle changes in the size_inc and base_size hints during opaque resizing. * fvwm/events.c (HandleButtonPress): ClickToFocus + ClickToFocusPassesClickOff now blocks event handling until the button is released again; this restores the old behaviour from 2.3.23 and before with click+drag and rxvt/aterm 2002-06-30 Dominik Vogt * fvwm/update.c (apply_window_updates): fixed applying neverfocus to currently focused window; decorations partially drawn hilighted 2002-07-05 Dominik Vogt * fvwm/menucmd.c (menu_func): another module/menu/context window fix do not use global Fw anymore 2002-07-05 olicha * libs/Flocale.c (FlocaleStringToString2b): Fixed crash with big5-0 FontStruct 2002-07-04 Dominik Vogt * fvwm/menucmd.c (menu_func): fixed context window of menus invoked by a module (menu_func): fixed context menus on windows * libs/vpacket.h (ConfigWinPacket): * fvwm/module_interface.c (CONFIGARGSNEW): * fvwm/fvwm.h (FvwmWindow): fixed bugs in type conversions for transmitting certain information to modules * fvwm/functions.c (CheckActionType): fixed window selection problem w/ menus invoked from modules 2002-07-03 Dominik Vogt * fvwm/gnome.c (GNOME_HandlePropRequest): -Wall fixes * fvwm/module_interface.c (ExecuteCommandQueue): fixed compile bug w/ --enable-debug-msgs 2002-06-30 Dominik Vogt * fvwm/events.c (HandleButtonPress): (HandleKeyPress): * fvwm/menus.c (MenuInteraction): (do_menu): * fvwm/windowlist.c (CMD_WindowList): * fvwm/menucmd.c (menu_func): * fvwm/module_interface.c (ExecuteModuleCommand): * fvwm/add_window.c (adjust_fvwm_internal_windows): go away, evil globals! [removed the useless global variable "ButtonWindow"] * fvwm/events.c (HandleUnmapNotify): (HandleMapNotify): * fvwm/icons.c (Iconify): * fvwm/window_flags.h (IS_ICONIFY_PENDING): * fvwm/fvwm.h (struct): renamed is_deiconify_pending to is_iconify_pending some re-indenting 2002-06-29 Dominik Vogt * fvwm/menus.c (MenuInteraction): (pop_menu_down): (menu_enter_tear_off_menu): (do_menu): * fvwm/events.c (HandleButtonPress): (HandleButtonRelease): (HandleKeyPress): (GetContext): * fvwm/menucmd.c (menu_func): (menu_func): * fvwm/module_interface.c (ExecuteModuleCommand): go away, evil globals! [removed the useless global variable "Context"] removed is_menu_from_frame_or_window_or_titlebar flag * fvwm/module_interface.c: * fvwm/windowlist.c: re-indented files 2002-06-28 Mikhael Goikhman * fvwm/menuitem.c (menuitem_paint): fixed fg color of the inactive disabled menu item * NEWS: old typo * fvwm/fvwm.1: removed a mention of RedHat (I don't think it is correct), reworded a mention of fvwm95 2002-06-26 Mikhael Goikhman * **/*.c: tabify only the leading spaces, untabify the middle of line 2002-06-25 David Fries * fvwm/fvwm.1: * fvwm/windowlist.c: Added code to sort based on the class name of a window for the WindowList function. 2002-06-25 olicha * acinclude.m4: A minor fix 2002-06-25 Mikhael Goikhman * AUTHORS: add Anders Andersson (spelling fixes in all man pages) and Steve Talley 2002-06-24 Steve Talley * fvwm/add_window.c: * fvwm/add_window.h: * fvwm/fvwm.1: * fvwm/fvwm.h: * fvwm/icons.c: * fvwm/icons.h: * fvwm/style.c: * fvwm/style.h: * libs/defaults.h: New Style option IconSize 2002-06-24 Mikhael Goikhman * NEWS, configure.in: changed version to 2.5.3 2002-06-24 Mikhael Goikhman * INSTALL.fvwm: removed C++ section * fvwm/fvwm.1: * libs/FlocaleCharset.c: small fixes 2002-06-23 Dominik Vogt * fvwm/events.c (WaitForButtonsUp): use the wait cursot only after the 20th pass through the loop 2002-06-21 Dan Espen * fvwm/fvwm.1 (Examples): Language check. PipeRead as synchronous Exec. Better example for PipeRead. 2002-06-21 olicha * fvwm/fvwm.1: * NEWS: Documented StringEncoding= in font name * INSTALL.fvwm Removed --disable-compound-text doc 2002-06-20 olicha * libs/FBidi.h (FBidiConvert): Fixed compile if !HAVE_BIDI 2002-06-19 olicha * fvwm/fvwm.c (InitVariables): (StartupStuff): Allocate colorset 0 in InitVariable in the place of StartupStuff. This fix a "null expression" at init in menustyle.c (menustyle_update) 2002-06-19 Mikhael Goikhman * configure.in: reworded supported feature listing, fixed the default xft detection * INSTALL.fvwm: added the "Supported Features" section 2002-06-19 olicha * fvwm/colorset.h: Removed not useful #define/#undef FVWM_COLORSET_PRIVATE * INSTALL.fvwm: Removed --enable-mulibyte and --disable-compound-text config option documentation. s/enable-xft/disable-xft/ and document --disable-xrender * configure.in: Xft is on by default no * libs/FlocaleCharset.c (*): * libs/FlocaleCharset.h: * libs/Ficonv.c (*): * libs/Ficonv.h: * libs/Flocale.c (*): * libs/Flocale.h: * libs/Fft.c (*): * libs/FftInterface.h: * libs/FBidi.c: * libs/FBidi.h: * fvwm/ewmh_names.c (): Some cleanup. Implemented StringEncoding= in font names. Fixed string encoding for xft fonts. Try to be more cleaver about defaults charsets. Improvement in the locale charset table. * fvwm/fvwm.1: Some documentation cleanup regarding Xft 2002-06-19 Dominik Vogt * fvwm/functions.c (find_func_type): fixed bug i introduced w/ last commit * fvwm/fvwm.c (Done): (StartupStuff): * fvwm/functions.c (functions_is_complex_function): * fvwm/builtins.c (CMD_DestroyFunc): (CMD_AddToFunc): (CMD_Plus): moved functions to functions.c general cleanup * fvwm/functable.c: * fvwm/functable.h: * fvwm/functions.h: * fvwm/commands.h: * fvwm/functions.c: moved some types and functions to other/new files * fvwm/functions.c: * fvwm/expand.c (expand_vars_extended): (expand_vars): functions moved to new file * fvwm/functions.c: reindented file 2002-06-18 Dominik Vogt * fvwm/events.c (CoerceEnterNotifyOnCurrentWindow): fixed colourmap focus problem * **/*.[ch]: tabified all files and removed all trailing spaces * fvwm/move_resize.c (move_window_doit): * fvwm/virtual.c (CMD_MoveToDesk): MoveToPage and MoveToDesk no longer unstick windows 2002-06-17 Mikhael Goikhman * INSTALL.fvwm: small improvements * configure.in: reworded some names of supported features 2002-06-17 Dominik Vogt * fvwm/update.c (apply_window_updates): * fvwm/session.c (MatchWinToSM): * fvwm/add_window.c (setup_window_structure): * fvwm/windowshade.c (CMD_WindowShade): * fvwm/window_flags.h: fixed a problem w/ shaded windows changind the title direction * fvwm/geometry.c (get_shaded_geometry): fixed shading window to 0 width or height * fvwm/add_window.c (AddWindow): fixed a memory leak and an initial window placement bug 2002-06-15 Mikhael Goikhman * configure.in: minor improvements in output, added bin/fvwm-perllib 2002-06-12 Mikhael Goikhman * fvwm/menustyle.c (CMD_CopyMenuStyle): fixed copying PopupOffset values in CopyMenuStyle * NEWS: Copied 2.4.8 NEWS 2002-06-10 Mikhael Goikhman * libs/Strings.c: * libs/Strings.h: added CopyStringWithQuotes, not perfect, but works for now 2002-06-08 Dominik Vogt * fvwm/functions.h: * fvwm/commands.h: * fvwm/functions.c (func_config): * libs/FScreen.c (FScreenConfigureSLSScreens): (FScreenConfigureModule): * fvwm/virtual.c (CMD_XineramaSlsScreens): new command XineramaSLSScreens * libs/FScreen.c: cleaned up Xinerama ifdefs 2002-06-07 Dan Espen * NEWS: * fvwm/fvwm.1 (FONT SHADOW EFFECTS): Reword. 2002-06-07 olicha * libs/Flocale.h: * libs/Flocale.c (FlocaleGetShadowTextPosition): Some shadow text position fixes 2002-06-06 olicha * fvwm/update.c (apply_window_updates): Fixed the position of shaded windows after certain style update * acinclude.m4: Fixed some options names 2002-06-06 Mikhael Goikhman * fvwm/module_interface.c (CMD_SendToModule): fixed SendToModule when the first parameter contains quotes 2002-06-06 olicha * fvwm/fvwm.c (main): * fvwm/ewmh.c (EWMH_Init): Init the EWMH before reading the config. Always setup the working area. 2002-06-05 olicha * fvwm/update.c (apply_window_updates): Fixed the position of a shaded window during a style update (do_redecorate) * libs/Flocale.c (FlocaleRotateDrawString): (FlocaleGetShadowTextPosition): Fixed side title text position if the font has no shadow * acconfig.h: * libs/Ficonv.c (FiconvInit): * libs/FlocaleCharset.c (FlocaleInit_X_Charset): * libs/Flocale.c (FlocaleInit): (FlocaleRotateDrawString): (FlocaleGetFontSet): (FlocaleGetFontOrFontSet): (FlocaleLoadFont): (FlocaleDrawString): (FlocaleTextWidth): (FlocaleFreeNameProperty): (FlocaleGetNameProperty): (FlocaleTextListToTextProperty): Finish to remove the multibyte patch. This gives a more clean code and can only prevent bugs 2002-06-05 Mikhael Goikhman * fvwm/placement.c (PlaceWindow): fixed CascadePlacement with huge windows (xterm -g 240x100), that were aligned to bottom-right instead of top-left; small adjustments (removed border_width from calculations, don't place normal windows at 0, commented out some strange code) 2002-06-04 Mikhael Goikhman * NEWS: document CascadePlacement and FvwmIconMan improvements * fvwm/fvwm.1: typo 2002-06-03 Mikhael Goikhman * fvwm/add_window.c (adjust_fvwm_internal_windows): * fvwm/fvwm.c (InitVariables): * fvwm/placement.c (PlaceWindow): * fvwm/screen.h (struct ScreenInfo): improved *CascadePlacement, if the last placed window does not exist any more, reuse the last used position instead of adding a new cascade 2002-06-03 Dominik Vogt * fvwm/events.c (HandleEnterNotify): * fvwm/fvwm.c (InitVariables): * fvwm/events.h: Fixed colormap handling over decorative parts of a window 2002-06-03 olicha * fvwm/module_interface.c (make_named_packet): Fixed an write out of memory bug. This complete Mikhail Kruk patch related to named module packet 2002-06-03 Dominik Vogt * fvwm/focus.c (focus_grab_buttons): * fvwm/events.c (HandleButtonPress): fixed a problem w/ ClickToFocus + ClickToFocusRaisesOff 2002-06-03 Mikhael Goikhman * fvwm/bindings.c (ParseBinding): replaced an error "Illegal mouse button" with a descriptive warning when a button number is greater than NUMBER_OF_MOUSE_BUTTONS 2002-05-31 Dominik Vogt * fvwm/events.c (GetContext): fixed key bindings on decorations * fvwm/events.h: removed XEVMASK_DECORW 2002-05-31 olicha * NEWS: * fvwm/fvwm.1: Documented shadow effect in a new section FONT EFFECTS 2002-05-31 olicha * libs/Fft.c (FftDrawString): * libs/Colorset.c (DumpColorset): (LoadColorset): * libs/Colorset.h: * fvwm/colorset.c (parse_colorset): New colorset option fg_alpha which defines an alpha for rendering text with Xft 2002-05-29 olicha * libs/Fft.c (FftSetupEncoding): * libs/Fft.h: * libs/FRender.h: Added Xft2 support * acinclude.m4: * configure.in: Added detection for fontconfig and Xft2. Added FT2 CFLAGS and LIBS to Xft FLAGS and LIBS * fvwm/Makefile.am: * libs/Makefile.am: Put $(Xft_CFLAGS) before $(X_CFLAGS) to be able to use an independent Xft2 library. Removed FT2 CFLAGS and LIBS 2002-05-27 olicha * acinclude.m4: * acconfig.h: * configure.in: Some Xft2 and fontconfig preparation * libs/Flocale.h: * libs/Flocale.c (FlocaleParseShadow): (FlocaleLoadFont): (FlocaleGetShadowTextPosition): Added offset to shadow text * libs/Flocale.h: Fixed the position of ne shadow text and remove some unused #define 2002-05-27 Dominik Vogt * fvwm/colorset.c (parse_colorset): fixed integer overflow in average colour calculation 2002-05-27 olicha * libs/gravity.c (GetNextMultiDirection): (ParseMultiDirectionArgument): * libs/gravity.h: Added a multi direction type which is a "<<" version of direction type. Added a parse and a next functions * libs/Flocale.h: * libs/Flocale.c (FlocaleParseShadow): (FlocaleGetNextShadowDirection): (FlocaleGetShadowTextPosition): Used gravity multi direction type and functions. Removed FlocaleGetNextShadowDirection 2002-05-27 Dominik Vogt * fvwm/focus.c (restore_focus_after_unmap): fixed a problem w/ colormap transition when transient window died * fvwm/add_window.c (AddWindow): clean up * fvwm/session.c (getUniqueStateFilename): applied security patch by Jan Echternach * fvwm/fvwm.c (InitVariables): Properly initialise Scr.flags.is_pointer_on_this_screen * libs/fvwmlib.h (FvwmFont): * fvwm/fvwm.c (setVersionInfo): * configure.in: * config.h.in: * acconfig.h (MULTIBYTE): removed MULTIBYTE option (unconditionally on) 2002-05-26 Dominik Vogt * libs/gravity.c (ParseDirectionArgument): allow "t", "u", ... shortcuts as direction arguments * fvwm/style.c (check_window_style_change): (parse_and_set_window_style): * fvwm/frame.c (frame_setup_border): (frame_get_shading_laziness): (frame_get_sidebar_geometry): * fvwm/decorations.c (SelectDecor): * fvwm/add_window.c (setup_style_and_decor): (setup_resize_handle_cursors): (setup_resize_handle_windows): (change_resize_handle_windows): (destroy_auxiliary_windows): * fvwm/borders.c (border_get_border_gcs): (border_draw_border_parts): * fvwm/style.h (SCSET_HAS_BORDER): * fvwm/fvwm.h (FvwmWindow): * fvwm/window_flags.h (SET_HAS_BORDER): new styles NoBorder/Border 2002-05-26 olicha * libs/Flocale.h: * libs/Flocale.c (FlocaleParseShadow): (FlocaleGetNextShadowDirection): (FlocaleGetShadowTextPosition): (FlocaleLoadFont): Implemented multidirectional shadow text rendering * libs/Flocale.h: * libs/Flocale.c (FlocaleFontStructDrawString): (FlocaleRotateDrawString): (FlocaleLoadFont): (FlocaleDrawString): (FlocaleTextWidth): * libs/FlocaleCharset.c (FlocaleCharsetSetFlocaleCharset): * libs/Fft.c (FftDrawString): Cleanup the FlocaleFont structure by addings some flags 2002-05-26 Dominik Vogt * fvwm/events.c (HandleFocusIn): * fvwm/add_window.c (adjust_fvwm_internal_windows): * fvwm/screen.h (ScreenInfo): * fvwm/focus.c (FocusOn): ignore EnterNotify events while a window is waiting to receive focus from the Focus or FlipFocus commands; should prevent plenty of race contidions caused by executing complex functions by a key press, button press or from a menu; fixes Alt-Tab problem * fvwm/events.c (HandleMapNotify): immediately draw window decorations when window is mapped; the new frame drawing code takes care of suppressing unnecessary redraws (HandleLeaveNotify): fixed a bug w/ LeaveNotify event with NotifyGrab 2002-05-22 olicha * libs/Flocale.h: * libs/Fft.c (FftDrawString): * libs/Flocale.c (FlocaleFontStructDrawString): (FlocaleRotateDrawString): (FlocaleLoadFont): (FlocaleGetShadowTextPosition): (FlocaleDrawString): (FlocaleDrawUnderline): (FlocaleTextWidth): Implemented negative shadow text 2002-05-22 Dominik Vogt * fvwm/menucmd.c (CMD_AddToMenu): * fvwm/windowlist.c (CMD_WindowList): * fvwm/menus.h: * fvwm/menus.c changed signature of AddToMenu * fvwm/menus.c (clone_menu_root_static): fixed problem w/ menu style usage count and tear off menus fixed core dump w/ not copying the missing sub menu function in tear off menus (clone_menu_item_list): (AddToMenu): (add_another_menu_item): (size_menu_vertically): fixed additional "More..." items in sub menus of torn off menus 2002-05-22 Mikhael Goikhman * libs/colorset.h: fixed #endif warning * fvwm/ConfigFvwmDefaults: added CirculateSkip to tear off menus * fvwm.1: fixed ShadeAgain quoting 2002-05-21 Dominik Vogt * fvwm/events.c (HandleButtonPress): allow to pass the focus click to applications and have a function bound to it at the same time * fvwm/fvwm.c: * fvwm/colorset.h: fixed compilation problem 2002-05-20 olicha * libs/PictureImageLoader.c (PImageRGBtoPixel): Fixed blue colour in png image and ewmh icons * libs/Flocale.c (FlocaleLoadFont): Removed some debug code * fvwm/colorset.c (parse_colorset): * libs/fvwmlib.h: * libs/ColorUtils.c (GetForeShadowColor): Added Mikhael algo to compute the default fgsh 2002-05-18 Mikhael Goikhman * fvwm/functions.c (expand_extended_var): expand $[fgsh.csN], use constants instead of numbers 2002-05-17 olicha * libs/Flocale.c (FlocaleDrawString): (FlocaleDrawUnderline): * libs/Flocale.h: Removed some unused and debug code 2002-05-17 olicha * fvwm/menuitem.c (draw_underline): * libs/Flocale.h: * libs/Flocale.c (FlocaleDrawUnderline): Move draw_underline into Flocale.c and fix underline position with shadow rendering 2002-05-17 olicha * fvwm/style.c (update_window_color_style): (update_window_color_hi_style): * fvwm/move_resize.c (DisplayPosition): (DisplaySize): * fvwm/menuitem.c (menuitem_paint): * fvwm/borders.c (get_common_decorations): (border_get_titlebar_draw_descr): * fvwm/fvwm.h: * fvwm/icons.c (DrawIconWindow): Pass the colorset to text drawing via the FlocaleWinString structure * libs/fvwmlib.h: * libs/ColorUtils.c (GetForeShadowColor): (GetForeShadow): * fvwm/colorset.c (parse_colorset): * libs/Colorset.h: * libs/Colorset.c (DumpColorset): (LoadColorset): Added fgsh colorset and two new functions GetForeShadowColor and GetForeShadow which should be modified * libs/Makefile.am: * libs/Fft.h: * libs/FftInterface.h (new file): * libs/Fft.c (FftDrawString): * libs/Flocale.h: * libs/Flocale.c (FlocaleFontStructDrawString): (FlocaleRotateDrawString): (FlocaleDrawString): (FlocaleTextWidth): (FlocaleLoadFont): Implemented text shadow rendering 2002-05-11 olicha * fvwm/builtins.h: * fvwm/builtins.c (refresh_window): * fvwm/update.c (apply_window_updates): * fvwm/update.h: * fvwm/style.c (check_window_style_change): ParentalRelativity style is now dynamic 2002-05-10 Dominik Vogt * fvwm/menuitem.c (menuitem_paint): fixed menu item hilight area 2002-05-09 olicha * libs/Makefile.am: * libs/XError.c (request_name): * libs/PictureImageLoader.c (PImageLoadPng): (PImageCreatePixmapFromArgbData): * libs/PictureGraphics.c (PGraphicsTintRectangle): (PGraphicsTileRectangle): (PGraphicsCopyFvwmPicture): * libs/FRenderInit.c (new file): * libs/FRenderInit.h (new file): * libs/FRenderInterface.h: * libs/FRender.c (*): * fvwm/colorset.c (parse_tint): (parse_colorset): * fvwm/fvwm.c (main): * fvwm/events.c (HandlePropertyNotify): Change the design of the previous commit. Now a module should call FRenderInit when it wants to use a function which depends on XRender. 2002-05-09 olicha * fvwm/colorset.c: A -Wall fix * libs/Flocale.h: * libs/Fft.h: Fixed Compilation Include Fft.h include FRender.h as Xft.h include Xrender.h * libs/FRenderInterface.h: * libs/FRender.h: * libs/FRender.c (FRenderInit): (FRenderGetErrorCodeBase): (FRenderGetMajorOpCode): (FRenderGetExtensionSupported): (FRenderGetErrorText): Improve XRender initialization, check if the XRender extension is enabled and get the error code base and the major op code. Add error functions for the X error handler. * libs/XError.c (PrintXErrorAndCoredump): (request_name): Really enable USE_GET_ERROR_TEXT and take in account XRender error code and major op code * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): * fvwm/events.c (HandlePropertyNotify): * fvwm/colorset.c (parse_tint): (parse_colorset): * libs/PictureImageLoader.c (PImageLoadPng): (PImageCreatePixmapFromArgbData): * libs/PictureGraphics.c (PGraphicsCopyPixmaps): (PGraphicsCopyFvwmPicture): (PGraphicsTileRectangle): * libs/FRender.c (FRenderCopyArea): (FRenderTintRectangle): Check if the XRender extension is enabled on the display before performing XRender operations 2002-05-09 Dominik Vogt * fvwm/menuitem.c (menuitem_paint): fixed item hilighting problems 2002-05-07 olicha * fvwm/colorset.c (parse_colorset): More coloset fixes 2002-05-07 Dominik Vogt * fvwm/events.c (HandlePropertyNotify): workaround for xterm resize problem * fvwm/colorset.c (parse_colorset): (free_colorset_background): (parse_pixmap): (parse_tint): fixed various bugs and core dumps w/ the cs->picture structure; note: it's a pointer, so compare with NULL, not with None * fvwm/frame.c (frame_setup_window): (frame_setup_window_app_request): (frame_force_setup_window): (frame_setup_window_internal): (frame_create_move_resize_args): (frame_free_move_resize_args): * fvwm/add_window.c (setup_window_attr): * fvwm/events.c (HandleConfigureRequest): (HandlePropertyNotify): fixed [?] bit_gravity/resize problem * fvwm/events.c (HandleEnterNotify): reformatted EdgeCommand code 2002-05-06 olicha * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): Resize an ewmh icon to the wanted size if it is to big * fvwm/ewmh.c (EWMH_WindowDestroyed): Set also the stacking list when a window is destroyed 2002-05-03 Dan Espen * fvwm/fvwm.1: Finish language check. Fix typo in Mouse section, context should be on new line. 2002-05-02 Dan Espen * fvwm/fvwm.1 (file): Restore icons and images text with some improvement. Started on lang check, not done yet. 2002-05-02 Mikhail Kruk * fvwm/module_interface.c (make_named_packet): Applied Mikhail Kruk patch 2002-05-02 olicha * libs/FlocaleCharset.h: * libs/Ficonv.c (FiconvSetupConversion): * libs/FlocaleCharset.c (FlocaleCharsetSetFlocaleCharset): * libs/Flocale.h: * libs/Flocale.c (FlocaleGetFftFont): (FlocaleGetFontSet): (FlocaleGetFont): (FlocaleLoadFont): (FlocaleUnloadFont): * fvwm/fvwm.1: Implemented charset/iconv hints in font name 2002-04-29 Stian Sletner * fvwm/windowlist.c (CMD_WindowList): Added new Windowlist option IconifiedAtEnd 2002-04-30 Mikhael Goikhman * fvwm/module_interface.c: * libs/Module.c: * libs/Module.h: moved two constant strings to Module.h, so they may be used by perllib 2002-04-29 olicha * libs/FlocaleCharset.c (FlocaleCharsetSetFlocaleCharset): Fixed a core dump if the charset is not found * libs/Flocale.c (FlocaleStringToString2b): Removed some debug code 2002-04-29 olicha * libs/Fft.c (FftGetFontWidths): (FftGetFontWidths): * libs/Fft.h * libs/Flocale.h: * libs/Flocale.c (FlocaleGetFont): (FlocaleGetFontSet): (FlocaleGetFftFont): Removed min_char_offset member of the FlocaleFont as it is not use since we rotate string for side title * libs/Ficonv.c (FiconvSetupConversion): * libs/FlocaleCharset.c (FlocaleGetBidiCharset): (FlocaleCharsetSetFlocaleCharset): * libs/Flocale.h: * libs/Flocale.c (FlocaleTextWidth): (FlocaleDrawString): (FlocaleUtf8ToUnicodeStr2b): (FlocaleLoadFont): (FlocaleStringToString2b): (FlocaleRotateDrawString): (FlocaleFontStructDrawString): Added support for drawing string with 10646-1 fonts without an utf8 locale. Also, drawing strings with a multibyte font now work not so bad even if the locale have nothing to do with the font. * libs/Fft.c (FftUtf8ToFftString16): (FftDrawString): (FftTextWidth): Added utf8 rendering with iso10646-1 fonts on system without Xft Utf8 functions * fvwm/colorset.c (reset_cs_pixmap): (parse_pixmap): (parse_shape): (parse_tint): (parse_colorset): Colorset now accept bitmaps. Split a bit parse_colorset for readability 2002-04-28 Mikhael Goikhman * fvwm/menus.c: fixed core dump on default Alt-Tab (Alt released when mouse is outside) 2002-04-27 Mikhael Goikhman * fvwm/move_resize.c: don't start Move with snap disabled if Alt is initially pressed 2002-04-26 Mikhael Goikhman * NEWS, configure.in: changed version to 2.5.2 2002-04-25 Mikhael Goikhman * fvwm/fvwm.1: improved main headers, added new COLORSETS section; documented State condition * NEWS: documented Tint in colorsets and utility renaming * libs/Flocale.c: corrected several error reporting problems 2002-04-25 Dominik Vogt * fvwm/events.h: fixed leaving tear off menus 2002-04-24 Dominik Vogt * fvwm/borders.c (border_draw_part_relief): (border_set_button_pixmap): (border_draw_title_stick_lines): (border_draw_title_mono): (border_draw_title_relief): * libs/fvwmlib.h (RelieveRectangle2): (RelieveRectangle): replaced functions by macros * libs/Graphics.c (do_relieve_rectangle): applied performance patch by Dave Trollope 2002-04-24 Mikhael Goikhman * libs/FBidi.c: * libs/FBidi.h: * libs/Flocale.c: * libs/Flocale.h: * libs/FlocaleCharset.c: FBidi is now independent from Flocale* again; iso8859-6.8x fonts recognized now as bidi-enabled 2002-04-23 Mikhael Goikhman * libs/Flocale.c: fixed --disable-multibyte 2002-04-23 Dominik Vogt * fvwm/borders.c (border_draw_title_deep): (border_set_title_pixmap): (border_set_button_pixmap): fixed SolidButton title and button style 2002-04-23 Mikhael Goikhman * fvwm/fvwm.1: * NEWS: * AUTHORS: added new entry about CurrentAtEnd * colorset.c: minor reformatting and spell checking 2002-04-23 Jochen Klenner * fvwm/windowlist.c (CMD_WindowList): Added new Windowlist option CurrentAtEnd 2002-04-22 olicha * fvwm/colorset.c (parse_colorset): * libs/Colorset.h: Fixed an enormous core dump which comes from a cvs merging problem * fvwm/Makefile.am: * acconfig.h: * configure.in: Added Xrender detection and link fvwm if needed * libs/PictureGraphics.c: * libs/PictureGraphics.h: * libs/FRender.c: * libs/FRender.h: * libs/FRenderInterface.h: * libs/PictureGrpahics.c (*): * libs/PictureGrpahics.h: New libs files to acheive alpha-blend rendering and better XBM support. PictureGraphics contains elaborated version and also simplified version of XFillRectangle, XCopyPlan and XCopyArea Xlib functions. * fvwm/fvwm.h: * fvwm/icons.c (clear_icon): (GetIconPicture): (DrawIconWindow): (GetIconFromFile): * fvwm/events.c (HandlePropertyNotify): * fvwm/borders.c (border_fill_pixmap_background): (border_get_border_background): (border_draw_decor_to_pixmap): * fvwm/menuitem.c (menuitem_paint): * fvwm/add_window.c (destroy_icon): * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): * fvwm/geometry.c (move_icon_to_position): * fvwm/colorset.c (free_colorset_background): (parse_colorset): * libs/Colorset.h: Implemented alpha-blend rendering with the new libs function * fvwm/colorset.c (free_colorset_background): (parse_colorset): * libs/Colorset.h: Implemented tinting of a Pixmap background colorset * fvwm/colorset.c (parse_colorset): Use the Scr.NoFocusWin as main window in the place of the Scr.SizeWindow, this fix a lot of X errors in my machine. * fvwm/ewmh_icons.c (ewmh_SetWmIconFromPixmap): Donated our alpha channel * libs/vpacket.h: * fvwm/module_interface.h: * fvwm/module_interface.c (SendFvwmPicture): (BroadcastMiniIcon): (SendMiniIcon): (BroadcastFvwmPicture): (CMD_Send_WindowList): * fvwm/add_window.c (change_mini_icon): (broadcast_mini_icon): * fvwm/ewmh_icons.c: Replace BroadcastMiniIcon and SendMiniIcon by BroadcastFvwmPicture and SendFvwmPicture which send the alpha. Add a MiniIconPacket structure * libs/Makefile.am: * libs/PictureBase.c (*): * libs/PictureBase.h: * libs/Picture.c (*): * libs/Picture.h: * libs/PictureImageLoader.c (*): * libs/PictureImageLoader.h: * fvwm/*: Rename some libs file InitPicture -> PictureBase, FImageLoader -> PictureImageLoader. Rename some libs function: InitPictureCMap -> PictureInitCMap, UseDefaultVisual -> PictureUseDefaultVisual, UseFvwmVisual -> PictureUseFvwmVisual, PictureSaveFvwmVisual -> SaveFvwmVisual, SetImagePath -> PictureSetImagePath, findImageFile -> PictureFindImageFile, PictureList -> FvwmPictureList, LoadFvwmPicture removed now PImageLoadFvwmPictureFromFile replace it, GetPicture -> PGetFvwmPicture, CachePicture -> PCacheFvwmPicture, DestroyPicture -> PDestroyFvwmPicture, LoadPictureFromPixmap -> PLoadFvwmPictureFromPixmap, CachePictureFromPixmap -> PCacheFvwmPictureFromPixmap, fvwm_clone_picture -> PCloneFvwmPicture. Also renamed more recent functions in PictureImageLoader. * fvwm/borders.c (border_draw_one_border_part): (border_draw_decor_to_pixmap): Fixed drawing of a TiledPixmap borded and fixed position of buttons pixmap * fvwm/menus.c (pop_menu_up): (animated_move_back): (ParentalMenuRePaint): * fvwm/move_resize.h (resize_geometry_window): * fvwm/move_resize.c (move_window_doit): (AnimatedMoveAnyWindow): (AnimatedMoveOfWindow): (AnimatedMoveFvwmWindow): Fixed transparent animated menu 2002-04-21 Mikhael Goikhman * fvwm/fvwm.1: fixed two places 2002-04-19 Hippo * fvwm/colorset.c: * libs/Colorset.c: fixed running out of colors on 8bpp with ReadWriteColors; simulate colorsets on monochrome displays using three 1-bit pixmaps 2002-04-19 Mikhael Goikhman * configure.in: fixed $PERL detection again 2002-04-18 Hippo * configure.in: added -Wno-implicit-int to -Wall in case of gcc * fvwm/colorset.c: * fvwm/fvwm.c: fixed ReadWriteColors on a PseudoColor display 2002-04-18 Dominik Vogt * fvwm/move_resize.c (move_window_doit): set the is_icon_moved too flag if the icon was moved non-interactively 2002-04-16 Hippo * fvwm/*.[ch]: * NEWS: Moved FvwmTheme functionality into fvwm. Added new commands Colorset, ReadWriteColors, CleanupColorsets. 2002-04-17 Mikhael Goikhman * configure.in: fixed $PERL detection * fvwm/fvwm.1: * fvwm/ConfigFvwmDefaults: several fixes and spelling 2002-04-15 Dominik Vogt * libs/Bindings.c (CheckBinding): (MatchBinding): (GrabWindowKey): (GrabWindowButton): (MatchBindingExactly): patch by yeti@physics.muni.cz to help with a weird problem w/ czech keyboards 2002-04-12 Mikhael Goikhman * configure.in: configure now uses $PERL if set * **: all programs installed into ${bindir} have now fvwm- prefix; documentation updated 2002-04-11 Mikhael Goikhman * **: renamed fvwm2 executable to fvwm, fvwm2 man page to fvwm; documentation updated 2002-04-11 Mikhael Goikhman * NEWS: added 2.4.7 entries 2002-04-10 Dan Espen * AUTHORS: New author. * NEWS: Edge Command. 2002-04-09 Uwe Pross * fvwm/fvwm2.1: Added EdgeCommand paragraph. * fvwm/events.c (HandleEnterNotify): Added execution of Scr.PanFrame*.command if set * fvwm/fvwm.c (InitVariables): Added init strings for pan frame commands. * fvwm/virtual.c: * fvwm/virtual.h: (checkPanFrames): Avoid hiding of pan frames if pan frame command is set. (CMD_EdgeCommand): Implementation of the buildin command EdgeCommand. First implementation of this function. * fvwm/screen.h (struct): added char * command in structure Panframe to store the pan frame command. * fvwm/functions.c: added declaration of CMD_ENTRY("edgecommand") * fvwm/functions.h: added definition of Flag F_EDGE_COMMAND * fvwm/commands.h: added definition of CMD_EdgeCommand(F_CMD_ARGS) 2002-04-10 Mikhael Goikhman * fvwm/fvwm2.1: added "BI-DIRECTIONAL TEXTS" section * libs/System.c: added #include to fix endless loop on QNX 2002-04-10 Dominik Vogt * fvwm/fvwm2.1: changed description of focus models 2002-04-09 olicha * configure.in: Check for libpng libpng 1.0.4a or better 2002-04-08 Mikhael Goikhman * fvwm/add_window.c (setup_title_geometry): * fvwm/fvwm.h: * fvwm/fvwm2.1: * fvwm/geometry.c (get_title_font_size_and_offset): * fvwm/geometry.h: * fvwm/style.c (parse_and_set_window_style, check_window_style_change): * fvwm/style.h: * fvwm/window_flags.h: * libs/Fft.c (FftGetRotatedFont, FftGetFont, FftDrawString): * libs/Fft.h: * libs/Flocale.c (FlocaleRotateDrawString, FlocaleDrawString): * libs/Flocale.h: new Style options TopTitleRotated / TopTitleNotRotated, BottomTitleRotated / BottomTitleNotRotated 2002-04-08 olicha * libs/Makefile.am: Fixed make dist again 2002-04-07 Dan Espen * fvwm/fvwm2.1 (ICONS AND IMAGES): Language fix, then rewrite. 2002-04-07 Mikhael Goikhman * INSTALL.fvwm: minor wording fixes * NEWS: mention a new FvwmIconMan syntax * sample.fvwmrc/new-features: * sample.fvwmrc/system.fvwm2rc: * sample.fvwmrc/system.fvwm2rc-sample-95: use a new module syntax 2002-04-06 olicha * fvwm/fvwm2.1: * INSTALL.fvwm: Forget to save some file * libs/FImageLoader.c (c100_init_base_table): Allows init even if !XPM * libs/Makefile.am: Remove a F * configure.in: Fixed png detection * libs/FImageLoader.c (FImageCreatePixmapFromArgbData): Fixed a GC memory leaks. * fvwm/fvwm.c (setVersionInfo): * fvwm/fvwm2.1: Updated -version for png, bidi and xft * fvwm/fvwm2.1: Modified the ICONS section. Rename it ICONS AND IMAGES and document PNG file format. Replace "xpm or bitmap file" by "image file" in a few place. * INSTALL.fvwm: * NEWS: PNG news and documented libpng in the "Optional libraries used by FVWM" section 2002-04-05 olicha * libs/FImageLoader.c (c100_init_base_table): (FImageReduceRGBColor): (FImageCreatePixmapFromArgbData): Speed up color limitation for png image and ewmh icons Respect color limit even with DirectColor and TrueColor * configure.in: * acconfig.h (HAVE_PNG): Added test for libpng. Enable FvwmBanner, FvwmScript and xpmroot even without XPM support * libs/Makefile.am * libs/InitPicture.c (new file): * libs/InitPicture.h (new file): * libs/Picture.c: * libs/Picture.h: * libs/FImageLoader.c (new file): * libs/FImageLoader.h (new file): * libs/Fxpm.h (new file): * libs/Fpng.h (new file): Images are loaded in FImageLoader. PNG image can be loaded, the loader come from Imlib2 and the argb loader from fvwm/ewmh_icons.c. ColorLimit stuff is applied to PNG image. Split Picture.c, Picture.h into InitPicture.c, InitPicture.h, Picture.c and Picture.h. InitPicture contains the Picture structure, initialize the visual, depth and color map and contains image path stuff as Picture contains Picture manipulations. * libs/ColorUtils.c: * libs/Picture.h: Moved the Picture color utils func to ColorUtils * fvwm/Makefile.am: links against libpng * fvwm/icons.c (GetIconPicture): (GetXPMFile): (GetBitmapFile): (GetIconFromFile): Replace GetXPMFile and GetBitmapFile by GetIconFromFile which use the libs image loader * fvwm/cursor.c (CMD_CursorStyle): Use FImageLoadCursorPixmapFromFile (no PNG support here) * fvwm/ewmh_icons.c (create_pixmap_from_ewmh_icon): (EWMH_SetIconFromWMIcon): Use the argb loader of the libs. ColorLimit are now applied to ewmh icons * fvwm/modconf.c: Send the ColorLimit to module in any case * libs/fvwmlib.h: * libs/Graphics.c: * libs/Flocale.c * libs/Fft.c: * libs/Colorset.c: * fvwm/add_window.c: * fvwm/builtins.c: * fvwm/fvwm.h: * fvwm/menus.c: * fvwm/menustyle.c: * fvwm/move_resize.c: include cleanup 2002-04-02 Dominik Vogt * fvwm/events.c (test_map_request): (test_resizing_event): fixed endless loop in HandleConfigureRequest 2002-03-31 Dominik Vogt * fvwm/add_window.c (setup_style_and_decor): fixed borderless transients * fvwm/events.c (test_resizing_event): (HandleConfigureRequest): * fvwm/frame.c (frame_create_move_resize_args): * fvwm/add_window.c (AddWindow): * fvwm/fvwm.h: * fvwm/window_flags.h: tried to improve ConfigureRequest handling * fvwm/events.c (HandlePropertyNotify): recalculate window size when the base_width or base_height hint changes; fixes some problems with xemacs * fvwm/virtual.c (map_window): redraw decorations * fvwm/borders.c (border_draw_decorations): don't redraw windows on a different desk keep track of Scr.Hilite 2002-03-31 Dominik Vogt * fvwm/virtual.c (unmap_window): * fvwm/move_resize.c (resize_window): * fvwm/icons.c (Iconify): * fvwm/add_window.c (CaptureOneWindow): * fvwm/borders.c (border_undraw_decorations): mark window decorations as not drawn whenever the frame is unmapped 2002-03-30 Dan Espen * fvwm/fvwm2.1: Fixup IconBox geometry examples. 2002-03-29 Mikhael Goikhman * libs/FBidi.c: use safemalloc and alloca instead of malloc 2002-03-29 olicha * libs/FlocaleCharset.c (FlocaleCharsetSetFlocaleCharset): Set the X locale charset on system without XOpenOM 2002-03-27 Mikhael Goikhman * configure.in: fixed multibyte support reporting 2002-03-27 Dominik Vogt * libs/fvwmlib.h: * fvwm/fvwm.h: * config.h.in: moved gcc extension __attribute__ handling to config.h * fvwm/fvwm.c (main): * fvwm/stack.c (add_window_to_stack_ring_after): * fvwm/icons.c (GetIconWindow): (GetIconBitmap): * fvwm/add_window.c: fixed core dumps and other bugs in debug messages 2002-03-27 olicha * libs/FlocaleCharset.c (FlocaleInit_X_Charset): (FlocaleCharsetSetFlocaleCharset): * acconfig.h: * configure.in (problem_multibyte): Fixed compilation for system without XOpenOM in Xlib.h * libs/FlocaleCharset.c (FlocaleInit_X_Charset): * libs/Ficonv.c (FiconvInit): Be more safe * fvwm/fvwm.c: include only libs/Flocale.h 2002-03-26 Mikhael Goikhman * configure.in: fixed detection of fribidi-0.9.0, it is incompatible (not good for us) * libs/FBidi.c: * libs/FBidi.h: * libs/Flocale.c: * libs/FlocaleCharset.c: minor modifications, like removed #include; fixed core dump with bidi and utf-8 2002-03-25 Dominik Vogt * fvwm/frame.c (frame_update_hidden_window_pos): fixed shade/maximize/unshade * fvwm/builtins.c (FreeDecorFace): fixed memory leak * fvwm/borders.c (get_common_decorations): (border_get_border_style): * fvwm/style.c (parse_and_set_window_style): * fvwm/style.h: * fvwm/window_flags.h: * fvwm/fvwm.h (struct): * fvwm/frame.c (frame_mrs_setup_draw_decorations): (frame_create_move_resize_args): (frame_move_resize_step): (frame_next_move_resize_args): new styles WindowShadeLazy [default], WindowShadeBusy and WindowShadeAlwaysLazy * fvwm/frame.c (frame_set_decor_gravities): fixed window bit gravities split into smaller functions (frame_move_resize_step): fixed a bug w/ the parent gravity (frame_hide_changing_window_parts): fixed flickering in one of the corners during shade animation (frame_mrs_hide_changing_parts): renamed function (frame_mrs_prepare_vars): (frame_mrs_hide_unhide_parent): (frame_mrs_setup_draw_decorations): (frame_mrs_resize_move_windows): new functions 2002-03-25 olicha * libs/Fft.c (FftSetupEncoding): Fixed compilation * libs/Flocale.c (FlocaleDrawString): * libs/FBidi.c (FBidiConvert): * libs/FBidi.h: Pass the font to FBidiConvert * acconfig.h (HAVE_LIBCHARSET): * acinclude.m4 (CHECK_LIBCHARSET): * configure.in: If libiconv is used check for libcharset * libs/Makefile.am: * libs/FlocaleCharset.h: * libs/FlocaleCharset.c: * libs/Flocale.h: * libs/Flocale.c (*): * libs/Fft.c (FftSetupEncoding): * libs/Fft.h: New structure FlocaleCharset to handle font, iconv and fribidi charsets. FlocaleFont has such a member which is set when charset info are needed. FlocaleCharset.c contains a big table which associates to an X charset various possible locale charsets and the fribidi charset. If libiconv is used, libcharset is used to compute the locale charset. Various Flocale clean up. * fvwm/fvwm.c (main): Removed the call to FlocaleInitCharset, it is now done automatically when needed * libs/Makefile.am: * libs/Ficon.h: * libs/Ficonv.c: * fvwm/ewmh.c (ewmh_atom_property_notify[]): * fvwm/ewmh.h: * fvwm/ewmh_names.c (EWMH_SetVisibleName): (EWMH_WMIconName): (EWMH_WMName): (EWMH_SetDesktopNames): Moved iconv conversions into the library. Try to found the good iconv charset with the help of the font and of the FlocaleCharset table. 2002-03-25 Dominik Vogt * libs/Module.c (SendFvwmPipe): * libs/Graphics.c (do_relieve_rectangle): * fvwm/menustyle.c (menustyle_parse_old_style): * fvwm/add_window.c (setup_window_structure): memory management patches by Dave Trollope * fvwm/frame.c (frame_get_sidebar_geometry): hide the handles when using the NoHandles style * fvwm/borders.c (border_redraw_decorations): change in title rotation is applied immediately, don't use the value "2" to force redrawing * fvwm/style.c (parse_and_set_window_style): removed "TitleLeft" and "TitleRight" styles; only the "TitleAt..." styles can be used documented the new title directions (parse_and_set_window_style): removed the ...TitleRotated[Counter]ClockWise use ...CW and ...CCW instead documented these styles * fvwm/add_window.c (CaptureOneWindow): (CaptureAllWindows): (AddWindow): cleaned up * fvwm/icons.c (DeIconify): fiexd fucoused window not hilighting after deiconification 2002-03-24 Dominik Vogt * fvwm/update.c (apply_window_updates): windows are not unshaded when the decoration layout changes * fvwm/frame.c (frame_create_move_resize_args): fixed excessive redrawing (frame_get_hidden_pos): fixed parent geometry when window is hidden * fvwm/add_window.c (setup_frame_stacking): fixed stacking of right buttons * fvwm/frame.c (frame_set_decor_gravities): fixed title and button bit gravities * fvwm/add_window.c (setup_frame_stacking): (change_auxiliary_windows): fixed "button" style * fvwm/geometry.c (get_title_button_geometry): * fvwm/menus.c (pop_menu_up): fixed menu placement relative to window titles * libs/Flocale.c (FlocaleDrawString): fixed compiler warning w/o fribidi * fvwm/virtual.c (MoveViewport): (MapDesk): (do_move_window_to_desk): * fvwm/update.c (apply_window_updates): * fvwm/icons.c (Iconify): (CMD_Iconify): * fvwm/module_interface.c (SETOLDFLAGS): * fvwm/ewmh_events.c (ewmh_WMStateHidden): * fvwm/style.c (parse_and_set_window_style): * fvwm/window_flags.h: * fvwm/session.c (MatchWinToSM): * fvwm/placement.c (PlaceWindow): * fvwm/add_window.c (CaptureAllWindows): (setup_window_placement): (CaptureOneWindow): (AddWindow): (destroy_window): * fvwm/menus.c (menu_tear_off): * fvwm/events.c (HandleMapRequestKeepRaised): (HandleMapNotify): * fvwm/fvwm.h: removed some of those pesky globals: PPosOverride, isIconicState and isIconifiedByParent; pass round a structure instead removed the do_start_iconic window flag removed do_delete_icon_moved flag 2002-03-24 Mikhael Goikhman * acconfig.h: * configure.in: renamed HAVE_FRIBIDI to HAVE_BIDI * libs/FBidi.c: * libs/FBidi.h: added more comments * fvwm/Makefile.am: * libs/Flocale.c: * libs/Makefile.am: added a dummy call to FBidi to test linking against bidi libs 2002-03-24 Dominik Vogt * fvwm/windowshade.c (CMD_WindowShade): changed syntax of windowshade with direction (CMD_WindowShade): update button state after unshading * fvwm/add_window.c (AddWindow): fixed mini icon update * fvwm/events.c (HandleEnterNotify): fixed icon picture redrawing icon titles are no longer raised and expanded if the icon has only a title * fvwm/move_resize.c (resize_window): fixed core dump * libs/gravity.c (gravity_move_resize_parent_child): * fvwm/frame.c (frame_get_titlebar_dimensions): (frame_prepare_animation_shape): (frame_move_resize_step): (frame_get_titlebar_dimensions_only): (frame_get_hidden_pos): (frame_update_hidden_window_pos): (frame_free_move_resize_args): (frame_create_move_resize_args): fixed shading of shaped windows * fvwm/borders.c: clean up * fvwm/fvwm.c (main): * fvwm/misc.c (GrabEm): fixed a problem with the cursor shape during window shading * fvwm/update.c (apply_window_updates): fixed drawing of hilighted window after a decoration change * fvwm/update.c (apply_window_updates): * fvwm/ewmh_icons.c (EWMH_SetIconFromWMIcon): * fvwm/borders.c (RedrawDecorations): renamed RedrawDecorations() * fvwm/move_resize.c (move_window_doit): * libs/fvwmrect.c: * fvwm/misc.c (move_into_rectangle): (intersect_xrectangles): functions renamed and moved to fvwmrect.c * fvwm/borders.c (border_get_changed_border_parts): (frame_get_changed_border_parts): reduced border redrawing moved fucntion to borders.c * fvwm/events.c (HandleButtonPress): (DispatchEvent): suppress button events on frame windows * fvwm/frame.c (frame_setup_border): fixed a problem with the border setup * fvwm/borders.c (border_draw_decorations): * fvwm/events.c (HandleEnterNotify): fixed icon title drawing * fvwm/misc.c (GrabEm): fixed a pointer grab hang with xmag? * fvwm/move_resize.c (resize_window): use frame_move_resize function to improve performance * fvwm/add_window.c (AddWindow): fixed recaturing shaded windows * fvwm/borders.c: suppress unnecessary title redraws * fvwm/frame.c: window shading works again; there are still some problems with recapture, restart, border drawing and shaped windows 2002-03-23 Dominik Vogt * fvwm/geometry.c (get_shaded_geometry_with_dir): new function * fvwm/frame.c (frame_get_title_bar_dimensions): fixed minor button layout bug (frame_update_hidden_window_pos): * fvwm/ewmh_names.c (EWMH_WMName): * fvwm/gnome.c (GNOME_HandlePropRequest): * fvwm/focus.c (DoSetFocus): * fvwm/stack.c (new_layer): * fvwm/icons.c (DeIconify): (Iconify): * fvwm/events.c (HandleFocusIn): (HandlePropertyNotify): (HandleExpose): (HandleMapNotify): (HandleButtonPress): (HandleLeaveNotify): * fvwm/builtins.c (CMD_ChangeDecor): (CMD_UpdateDecor): * fvwm/move_resize.c (resize_move_window): (resize_window): (resize_window): (maximize_fvwm_window): (handle_stick): * fvwm/borders.c (DrawDecorations): (RedrawDecorations): removed function DrawDecorations() (border_draw_decorations): renamed draw_decorations_with_geom() to border_draw_decorations() * fvwm/events.c (HandleExpose): fixed drawing icon titles * fvwm/add_window.c (adjust_fvwm_internal_windows): * fvwm/events.c (HandleFocusIn): (HandleFocusOut): * fvwm/screen.h (ScreenInfo): return the focus to the window that had the focus before an or window stole it and then died. * fvwm/menus.c (scanForColor): removed duplicate call of strlen use alloca instead of safemalloc * fvwm/menustyle.c (menustyle_parse_style): don't call memset right before memcpy * fvwm/module_interface.c (AddToMessageQueue): (DeleteMessageQueueBuff): removed one safemalloc and inline'd the function merged AddToMessageQueue into PositiveWrite * fvwm/borders.c (border_draw_decor_to_pixmap): fixed pixmap and mini icon buttons (border_fill_pixmap_background): fixed an X error (border_get_tb_parts_to_draw): buttons and title background using the border style is updated when the buttons moves * fvwm/events.c (WaitForButtonsUp): don't grab the whole server but merely the pointer to allow applications redrawing themselves * fvwm/borders.c: finished writing title drawing code * fvwm/move_resize.c (resize_window): (resize_move_window): (unmaximize_fvwm_window): removed now unnecessary calls to DrawDecorations() * fvwm/frame.c (frame_hide_changing_window_parts): fixed hiding bottom/right titles * fvwm/add_window.c (AddWindow): fixed recapturing shaded windows * fvwm/misc.c (GrabEm): fixed the cursor over the title window while resizing 2002-03-22 Dominik Vogt * libs/Graphics.c (CreateTiledPixmap): improved efficience: let the X server tile a pixmap via the GC settings * fvwm/fvwm.c (CreateGCs): * fvwm/screen.h (ScreenInfo): added new global GC Scr.TileGC * fvwm/borders.c (border_fill_pixmap_background): * fvwm/ewmh_icons.c (create_pixmap_from_ewmh_icon): use already created gcs * fvwm/ewmh_icons.c (create_pixmap_from_ewmh_icon): * fvwm/menus.c (paint_menu_gradient_background): fixed using a randow members in gcs 2002-03-22 Mikhael Goikhman * configure.in: added compilation test for fribidi 2002-03-22 Dan Espen * NEWS: Document FvwmForm timeout. 2002-03-22 Dominik Vogt * fvwm/session.c (MatchWinToSM): * fvwm/add_window.c (AddWindow): preserve user states over a restart * fvwm/add_window.c (setup_window_structure): preserve user states over a recapture * fvwm/functions.c (execute_function): "Silent" suppresses the "No such command ..." message * fvwm/frame.c (frame_move_resize): * fvwm/misc.c (GrabEm): fixed the cursor shape during resizing fixed button looks in small windows 2002-03-22 Mikhael Goikhman * libs/FBidi.c: * libs/FBidi.h: new files 2002-03-22 Dominik Vogt * fvwm/fvwm.c (LoadDefaultLeftButton): (LoadDefaultRightButton): * fvwm/borders.c (border_draw_vector_to_pixmap): * fvwm/screen.h (DecorFace): * fvwm/builtins.c (ReadDecorFace): fixed transparent vector line support * libs/Graphics.c (CreateGradientPixmap): fixed potential core dump with illegal gradients 2002-03-21 Dominik Vogt * fvwm/fvwm.h (FvwmWindow): removed button_background_pixmap member * fvwm/update.c (apply_window_updates): fixed changing the decoration size * fvwm/windowshade.c (CMD_WindowShade): * fvwm/frame.c (frame_setup_border): * fvwm/functions.c (execute_complex_function): removed debug code * fvwm/move_resize.c (resize_window): fixed aboting of a opaque resize w/ maximized windows (ParseOneResizeArgument): resize arguments don't take the border into account (GetResizeArguments): implemented new option "Frame" to the Resize and ResizeMove commands 2002-03-20 Dominik Vogt * fvwm/fvwm2.1: * fvwm/builtins.c (ReadDecorFace): * fvwm/borders.c (DrawLinePattern): implemented transparent drawing color in vector buttons: C == 4 * libs/defaults.h (MAX_TITLE_BUTTON_VECTOR_LINES): * fvwm/builtins.c (ReadDecorFace): increased allowed number of lines in a vector button to 10000 and moved the definition to defaults.h * fvwm/virtual.c (MoveViewport): don't send useless M_NEW_PAGE packets * fvwm/frame.c: * fvwm/borders.c: started work on new button/title drawing code * fvwm/events.c (HandleExpose): don't handle expose on the title bar * fvwm/borders.c: * fvwm/frame.c (frame_get_sidebar_geometry): * fvwm/fvwm.h (FvwmWindow): replaced border_state with decor_state * libs/defaults.h (NR_RIGHT_BUTTONS): added a comment * fvwm/events.h: * fvwm/events.c (HandleExpose): * fvwm/frame.c (frame_setup_border): hide sidebars if they are too small, i.e. 0 pixels 2002-03-20 olicha * libs/Flocale.c (FlocaleFreeNameProperty): Fixed random core dump 2002-03-19 olicha * fvwm/ConfigFvwmDefaults: RightTitleRotatedCW is a default 2002-03-19 Dominik Vogt * fvwm/frame.c (frame_get_sidebar_geometry): window corners are always at least the border width thick * fvwm/geometry.c (update_absolute_geometry): fixed south/east shading * fvwm/frame.c (frame_move_resize_step): did the best I could to prevent rxvt from flashing in the background colour * fvwm/add_window.c (get_default_window_attributes): (get_default_window_attributes): (setup_resize_handle_windows): * fvwm/borders.c (border_get_border_gcs): applied -visual fix by Hippo * fvwm/cursor.c (CMD_CursorStyle): fixed endless loop * fvwm/frame.c (frame_get_title_bar_dimensions): fixed order of right buttons (frame_move_resize_step): reduced flashing when maximizing * fvwm/geometry.c (update_absolute_geometry): adapted for horizontal shading 2002-03-19 Mikhael Goikhman * fvwm/borders.c: * fvwm/builtins.c: * fvwm/fvwm.h: * fvwm/geometry.c: * libs/Fft.c: * libs/Flocale.c: * libs/Flocale.h: several renamings of text_direction to text_rotation 2002-03-19 Dominik Vogt * fvwm/windowshade.c (CMD_WindowShade): * fvwm/frame.c (frame_create_move_resize_args): (frame_move_resize_step): hack to enable non-animated window shading for the time being * fvwm/style.c (parse_and_set_window_style): (parse_and_set_window_style): allow to abbreviate [Counter]ClockWise with [C]CW * fvwm/frame.c (frame_move_resize_step): fixed * fvwm/geometry.c (gravity_constrain_size): removed useless code * fvwm/update.c (apply_window_updates): * fvwm/add_window.c (AddWindow): * fvwm/move_resize.c (unmaximize_fvwm_window): (resize_window): do not write into frame_g. only frame.c should do this * libs/defaults.h (MIN_WINDOW_TITLEBUTTON_LENGTH): (MIN_WINDOW_TITLE_LENGTH): new default values * fvwm/frame.c (frame_setup_title_bar): (get_resize_decor_gravities_one_axis): (frame_setup_window_internal): (frame_move_resize_step): (frame_create_move_resize_args): rewrote frame_setup_title_bar function * fvwm/add_window.c (setup_frame_stacking): fixed title bar stacking order * fvwm/frame.c (frame_setup_title_bar): removed yesterday's 'fix' * fvwm/add_window.c (hide_screen): (setup_title_window): (setup_resize_handle_windows): (setup_button_windows): fixed visual and depth of decoration windows 2002-03-18 Dominik Vogt * fvwm/frame.c (frame_setup_title_bar): fixed title layout bug * fvwm/move_resize.c (MaximizeHeight): fixed bug in "grow" option of the Maximize command * fvwm/geometry.h: fixed broken prototype for get_title_font_size_and_offset * fvwm/geometry.c (get_title_font_size_and_offset): simplified code a bit 2002-03-18 olicha * fvwm/geometry.h: * fvwm/geometry.c (get_title_font_size_and_offset): * fvwm/add_window.c (setup_title_geometry): * fvwm/style.h: * fvwm/style.c (parse_and_set_window_style): (check_window_style_change): * fvwm/update.c (apply_window_updates): * fvwm/window_flags.h: * fvwm/fvwm.h: Reworte side title direction styles and use LeftTitleRotatedClockWise / LeftTitleRotatedCounterClockWise, RightTitleRotatedClockWise / RightTitleRotatedCounterClockWise 2002-03-18 Dominik Vogt * acconfig.h: * vms/config.h (FMiniIconsSupported): removed last traces of MINI_ICONS ifdef * fvwm/windowlist.c (CMD_WindowList): * fvwm/update.c (apply_window_updates): * fvwm/style.h: * fvwm/style.c (merge_styles): (parse_and_set_window_style): (check_window_style_change): * fvwm/screen.h: * fvwm/module_interface.c (SendMiniIcon): (BroadcastMiniIcon): (CMD_Send_WindowList): * fvwm/fvwm.h (FvwmWindow): * fvwm/ewmh_icons.c (ewmh_WMIcon): (EWMH_DoUpdateWmIcon): (ewmh_SetWmIconFromPixmap): (EWMH_DeleteWmIcon): (EWMH_SetIconFromWMIcon): * fvwm/builtins.c (ReadDecorFace): * fvwm/borders.c (DrawButton): (CMD_BorderStyle): (CMD_BorderStyle): * fvwm/add_window.c (setup_window_structure): (setup_mini_icon): (destroy_mini_icon): (change_mini_icon): (AddWindow): * acconfig.h (FMiniIconsSupported): replaced all MINI_ICONS ifdefs with FMiniIconsSupported to enable compiler checks * fvwm/screen.h: removed an FANCY_TITLEBARS ifdef * fvwm/borders.c (border_draw_one_part): (border_draw_border_parts): (border_draw_all_parts): (draw_clipped_decorations_with_geom): performance enhancement 2002-03-17 Dominik Vogt * fvwm/frame.c (frame_move_resize_step): force setting up the border when function is called with FRAME_MR_SETUP (frame_setup_window_internal): removed duplicate frame setup * fvwm/borders.c (border_get_parts_and_pos_to_draw): fixed logic bug (draw_clipped_decorations_with_geom): do not flush the X queue after drawing; let the caller do it * fvwm/frame.c (frame_get_sidebar_geometry): fixed layout of windows with a small height (frame_hide_changing_window_parts): fixed flickering * fvwm/borders.c: * fvwm/frame.c: made good progress with frame layout rewrite. I think it is already considerably faster. some general clean up * fvwm/add_window.c (setup_decor_window): function removed * fvwm/windowshade.c (CMD_WindowShade): * fvwm/stack.c (verify_stack_ring_consistency): (RaiseOrLowerWindow): * fvwm/move_resize.c (resize_move_window): (move_window_doit): (draw_move_resize_grid): * fvwm/icons.c (DrawIconWindow): * fvwm/icccm2.c (CloseICCCM2): (convertProperty): (HandleSelectionRequest): * fvwm/fvwm.c (main): (SaveDesktopState): * fvwm/focus.c (DoSetFocus): * fvwm/ewmh.c (EWMH_ManageKdeSysTray): * fvwm/events.c (HandlePropertyNotify): (HandleButtonPress): (HandleConfigureRequest): * fvwm/add_window.c (RestoreWithdrawnLocation): (Reborder): * fvwm/builtins.c (CMD_Delete): (CMD_Destroy): (CMD_Close): (CMD_FakeClick): * fvwm/menus.c (paint_menu): (DestroyMenu): * fvwm/misc.c (UngrabEm): (GrabEm): * fvwm/schedule.c (execute_obj_func): * fvwm/add_window.c (hide_screen): (destroy_window): use XFlush instead of XSync when the latter is not necessary * libs/fvwmrect.c (fvwmrect_rectangles_equal): new function * fvwm/add_window.c (adjust_fvwm_internal_windows): inform frame module if the window with the hide windows dies * fvwm/placement.c (PlaceWindow): (CMD_PlaceAgain): * fvwm/add_window.c (setup_window_attr): (setup_frame_attributes): (AddWindow): (RestoreWithdrawnLocation): (setup_window_placement): * fvwm/geometry.c (gravity_translate_to_northwest_geometry): (get_title_geometry): * fvwm/fvwm.c (InitVariables): * fvwm/frame.c (frame_setup_frame): * fvwm/colormaps.c (HandleColormapNotify): (InstallWindowColormaps): * fvwm/events.c (HandleConfigureRequest): (HandleUnmapNotify): * fvwm/fvwm.h (FvwmWindow): removed attr member of FvwmWindow and replaced by a structure defined ourselves that is much smaller * fvwm/add_window.c (hide_screen): don't use save_unders and backing_store for the window used in recapture * fvwm/frame.c (frame_init): * fvwm/fvwm.c (main): new function to initialise frame module * libs/fvwmrect.c (fvwmrect_subtract_rectangles): new function 2002-03-16 Dominik Vogt * fvwm/frame.c: clean up * fvwm/borders.h (enum): * fvwm/borders.c (draw_clipped_decorations_with_geom): (border_get_parts_and_pos_to_draw): * fvwm/fvwm.h (struct): some clean up fixed calculations of which border parts to draw * fvwm/fvwm2.1: corrected some typos * fvwm/frame.c: * fvwm/borders.c: handle marks work again 2002-03-16 Dan Espen * AUTHORS: New author added. 2002-03-16 Dominik Vogt * fvwm/frame.c: * fvwm/borders.c: * fvwm/add_window.c (setup_frame_stacking): * fvwm/cursor.c (CMD_CursorStyle): * fvwm/events.c (HandleExpose): (HandleMapNotify): (HandleEnterNotify): (HandleLeaveNotify): (GetContext): * fvwm/geometry.c (get_title_button_geometry): * fvwm/virtual.c (map_window): * fvwm/add_window.c (setup_parent_window): (setup_resize_handle_cursors): (setup_resize_handle_windows): (resize_resize_handle_windows): (change_resize_handle_windows): some progress with new frame layout * fvwm/add_window.c (setup_visible_name): fixed off-by-one bug in setup_visible_name maximum window number can be set in defaults.h 2002-03-15 Dominik Vogt * fvwm/windowlist.h: * fvwm/virtual.h: * fvwm/update.h: * fvwm/style.h: * fvwm/read.h: * fvwm/placement.h: * fvwm/menus.h: * fvwm/move_resize.h: * fvwm/icons.h: * fvwm/geometry.h: * fvwm/frame.h: * fvwm/focus.h: * fvwm/events.h: * fvwm/borders.h: * fvwm/add_window.h: * fvwm/ewmh_names.c: * fvwm/ewmh_icons.c: * fvwm/ewmh_events.c: * fvwm/ewmh.c: * fvwm/frame.c: * fvwm/menucmd.c: * fvwm/schedule.c: * fvwm/geometry.c: * fvwm/gnome.c: * fvwm/windowlist.c: * fvwm/cursor.c: * fvwm/update.c: * fvwm/bindings.c: * fvwm/colormaps.c: * fvwm/decorations.c: * fvwm/conditional.c: * fvwm/misc.c: * fvwm/read.c: * fvwm/placement.c: * fvwm/fvwm.c: * fvwm/virtual.c: * fvwm/session.c: * fvwm/functions.c: * fvwm/stack.c: * fvwm/icons.c: * fvwm/module_interface.c: * fvwm/style.c: * fvwm/add_window.c: * fvwm/events.c: * fvwm/builtins.c: * fvwm/move_resize.c: * fvwm/borders.c: * fvwm/menus.c: * fvwm/fvwm.h (FvwmWindow): moved all windows into a separate sub structure and wrote access macros renamed FvwmWindow argument to builtin commands to "fw" renamed tmp_win to fw everywhere * fvwm/borders.c (RedrawBorder): * fvwm/decorations.c (SelectDecor): * fvwm/add_window.c (setup_style_and_decor): (setup_resize_handle_cursors): * fvwm/window_flags.h: * fvwm/fvwm.h (struct): added new member has_handles and new macro HAS_HANDLES * fvwm/decorations.c (SelectDecor): fixed the NoHandles style * fvwm/decorations.c (SelectDecor): * fvwm/style.c (check_window_style_change): (parse_and_set_window_style): * fvwm/style.h: * fvwm/fvwm.h (struct): renamed has_no_handles to has_no_border 2002-03-15 olicha * libs/Flocale.h: * libs/Fft.c (is_utf8_encoding): Compilation fixes * libs/Flocale.h: s/COMPUND_TEXT/COMPOUND_TEXT * fvwm/fvwm2.1: Removed matrix xft specification doc as now it is use internally by fvwm * libs/Flocale.c (FlocaleRotateDrawString): (FlocaleUnloadFont): (FlocaleDrawString): (FlocaleTextWidth): * libs/Fft.h: * libs/Fft.c (FftGetRotatedFont): (FftGetFont): (FftDrawString): (FftTextWidth): * fvwm/borders.c (DrawMultiPixmapTitlebar): (RedrawTitle): * fvwm/geometry.c (get_title_font_size_and_offset): * fvwm/style.c (parse_and_set_window_style): (check_window_style_change): * fvwm/update.c (apply_window_updates): * fvwm/update.h: * fvwm/style.h: * fvwm/fvwm.h: * fvwm/window_flags.h: Implemented vertical text rendering, new style SideTitleTextDefault, SideTitleTextTopToBottom, SideTitleTextBottomToTop 2002-03-13 Dominik Vogt * fvwm/fvwm.h: removed inclusion of fvwmdebug.h * libs/gravity.c (ParseDirectionArgument): fixed direction parsing * fvwm/menus.c (get_menu_options): fixed a compiler warning 2002-03-12 Dominik Vogt * fvwm/bindings.c (ParseBinding): fixed compiler warning * fvwm/ewmh_events.c (EWMH_GetIconGeometry): * fvwm/ewmh.h: fixed compilation w/ --disable-ewmh * fvwm/windowlist.c (CMD_WindowList): fixed parsing of conditions versus position of window list broken with a recent "fix" 2002-03-11 Dominik Vogt * libs/Fft.h: * libs/Fft.c (FftTextWidth): (is_utf8_encoding): (FftGetFontWidths): (FftDrawString): removed the HAVE_XFT_UTF8 ifdefs and fixed not setting FftUtf8Support if HAVE_XFT was not set. * fvwm/events.h (XEVMASK_DECORW): select EnterNotify and LeaveNotify on frame instead of decor_w * fvwm/add_window.c (setup_title_window): (setup_button_windows): (setup_resize_handle_windows): frame window is the new parent of the title, button and handle windows (setup_frame_stacking): new stacking order of decoration windows * fvwm/menuitem.c (menuitem_paint): * fvwm/events.c (HandleExpose): xft fixes * fvwm/move_resize.c (unmaximize_fvwm_window): don't force to redraw the frame * libs/gravity.c (gravity_get_offsets): (gravity_move): (gravity_resize): functions moved to gravity.c 2002-03-10 olicha * acconfig.h (HAVE_XFT_UTF8): * configure.in: * libs/Fft.c (is_utf8_encoding): (FftGetFontWidths): (FftDrawString): (FftTextWidth): Detected if Xft can handle utf8 string * libs/Fft.h: * fvwm/menuitem.c (menuitem_paint): * fvwm/events.c (HandleExpose): Fixed Xft related compilation failure and warning 2002-03-10 Dominik Vogt * fvwm/virtual.c: * fvwm/update.c: * fvwm/move_resize.c: * fvwm/icons.c: * fvwm/focus.c: * fvwm/events.c: * fvwm/builtins.c: * fvwm/add_window.c: * fvwm/frame.c (frame_setup_window): (frame_force_setup_window): (frame_setup_shape): SetupFrame renamed to frame_setup_window ForceSetupFrame renamed to frame_force_setup_window SetShape renamed to frame_setup_shape * fvwm/windowshade.c: moved most code to frame.c * fvwm/frame.c (SetShape): (SetupTitleBar): (set_decor_gravity): (ForceSetupFrame): (SetupFrame): functions moved to new file (SetupTitleBar): (frame_setup_title_bar): renamed function * libs/Parse.h: direction code moved to gravity.c and gravity.h * fvwm/windowshade.c (CMD_WindowShade): * fvwm/geometry.c (get_shaded_geometry): * libs/FScreen.c (FScreenInit): (FScreenUpdateEmulationMapState): changed Xinerame emulation layout * fvwm/fvwm2.1: Corrected the description of the XineramaPrimaryScreen command that was essentially lying. 2002-03-09 Dominik Vogt * fvwm/menus.c (menu_tear_off): (unlink_item_from_menu): (menu_strip_tear_off_title): use the text from a title item as the tear off menu title if the menu begins with a title; skip separators and tear off bars at the front of the menu * **/*.[ch]: implemented titleatleft and titleatright styles; titles are not drawn vertically yet * fvwm/style.c (check_window_style_change): * fvwm/update.c (apply_window_updates): * fvwm/ewmh_names.c (EWMH_WMIconName): (EWMH_WMName): (charset_to_utf8): * fvwm/ewmh.c (ksmserver_workarround): * fvwm/update.c (apply_window_updates): * fvwm/conditional.c (MatchesConditionMask): * fvwm/fvwm.c (main): * fvwm/session.c (SaveWindowStates): (matchWin): (MatchWinToSM): * fvwm/functions.c (expand): * fvwm/stack.c (dump_stack_ring): (verify_stack_ring_consistency): * fvwm/module_interface.c (BroadcastWindowIconNames): (CMD_Send_WindowList): * fvwm/add_window.c (free_window_names): (free_window_names): * fvwm/events.c (HandlePropertyNotify): * fvwm/builtins.c (CMD_Wait): * fvwm/style.c (CMD_DestroyStyle): (lookup_style): Adapted to changes of Flocale.h * acconfig.h: removed COMPUND_TEXT ifdef * configure.in: mutibyte defaults to on * acconfig.h: * libs/Flocale.c: * libs/Flocale.h: * fvwm/fvwm.h (FvwmWindow): cleaned up Flocale stuff for better information hiding * libs/Flocale.c (get_FlocaleFontSet): (get_FlocaleFont): added a new font strucht member min_char_offset for vertical text * libs/Flocale.c (get_FlocaleFontSet): fixed a bug in descent calculation * fvwm/fvwm.h (FvwmWindow): removed title_g * fvwm/borders.c (RedrawButtons): (SetupTitleBar): (RedrawBorder): (SetupFrame): (RedrawTitle): (DrawMultiPixmapTitlebar): don't use title_g or boundary_width * libs/Flocale.c (FlocaleTextWidth): * libs/Flocale.c (FlocaleDrawString): added interface for vertical strings * libs/Flocale.h (FlocaleWinString): added flags structure w/ is_vertical_string flag * fvwm/borders.c (RedrawTitle): (DrawMultiPixmapTitlebar): * fvwm/screen.h (ScreenInfo): * fvwm/icons.c (DrawIconWindow): * fvwm/move_resize.c (DisplayPosition): (DisplaySize): * fvwm/screen.h (ScreenInfo): removed ScratchStr and TitleStr; *please* don't use global variables without need * fvwm/move_resize.c (ParseOneResizeArgument): (GetResizeArguments): (GetResizeMoveArguments): (resize_window): (resize_move_window): * fvwm/module_interface.c (CONFIGARGS): (OLDCONFIGARGS): (CONFIGARGSNEW): * fvwm/placement.c (PlaceWindow): * fvwm/add_window.c (setup_title_window): (setup_button_windows): (setup_parent_window): (resize_resize_handle_windows): (change_resize_handle_windows): (AddWindow): * fvwm/geometry.c (get_window_borders): (gravity_get_naked_geometry): (gravity_add_decoration): (constrain_size): don't use title_g.width and title_g.height anymore * libs/defaults.h (EXTRA_TITLE_FONT_WIDTH): new macro * fvwm/borders.c (SetupTitleBar): * fvwm/add_window.c (setup_title_window): don't use title_g.x and title_g.y anymore (setup_title_geometry): new function * fvwm/fvwm.h (FvwmWindow): replaced title_g by title_length and title_thickness renamed title_text_y to title_text_offset * fvwm/add_window.c (setup_style_and_decor): (setup_parent_window): * fvwm/decorations.c (SelectDecor): * fvwm/placement.c (PlaceWindow): * fvwm/windowlist.c (CMD_WindowList): * fvwm/events.c (SendConfigureNotify): (HandlePropertyNotify): (HandleMapNotify): * fvwm/move_resize.c (DisplaySize): (ParseOneResizeArgument): (GetResizeArguments): (GetResizeMoveArguments): (resize_window): (resize_move_window): * fvwm/geometry.c (gravity_get_naked_geometry): (gravity_add_decoration): (constrain_size): don't use boundary_width anymore * fvwm/borders.c (SetupTitleBar): made static * fvwm/fvwmdebug.c: removed outdated file that was never used * fvwm/move_resize.c (move_window_doit): fixed GNOME and EWMH hints when unsticking a window * fvwm/virtual.c (CMD_MoveToDesk): unstick windows when MoveToDesk is used * fvwm/builtins.c: * fvwm/windowshade.c (CMD_WindowShade): (CMD_WindowShadeAnimate): functions moved to windowshade.c * fvwm/window_flags.h: * fvwm/menus.c (pop_menu_up): * fvwm/builtins.c (CMD_WindowShade): * fvwm/move_resize.c (resize_window): * fvwm/icons.c (AutoPlaceIcon): * fvwm/borders.c (SetupFrame): don't use HAS_BOTTOM_TITLE any more (ButtonPosition): function removed * fvwm/geometry.c (get_title_font_width_and_offset): * fvwm/geometry.c (set_window_border_size): * fvwm/geometry.c (is_window_border_minimal): * fvwm/geometry.c (get_window_borders_no_title): * fvwm/geometry.c (get_shaded_client_window_pos): * fvwm/geometry.c (get_icon_corner): * fvwm/geometry.c (get_title_gravity): * fvwm/geometry.c (get_title_geometry): * fvwm/borders.c (get_button_number): new functions * fvwm/borders.c (SetupFrame): (SetShape): * fvwm/events.c (HandleShapeNotify): * fvwm/borders.c (SetupTitleBar): * fvwm/update.c (apply_window_updates): * fvwm/add_window.c (setup_window_font): removed title_top_height * libs/defaults.h (WINDOW_FREAKED_OUT_SIZE): renamed * fvwm/events.c (SendConfigureNotify): * fvwm/events.c (HandleConfigureRequest): preparations for W/E titles don't use title_top_height any more * fvwm/ewmh_events.c (ewmh_WMStateShaded): use title_dir flags * fvwm/geometry.c (get_window_borders): * fvwm/style.c (parse_and_set_window_style): (check_window_style_change): * fvwm/style.h (SCSET_TITLE_DIR): * fvwm/window_flags.h (GET_TITLE_DIR): * fvwm/fvwm.h (struct): replaced has_bottom_title flag with title_dir that can be DIR_N, DIR_S, DIR_W or DIR_E * libs/Parse.c (ParseDirectionArgument): * libs/Parse.h: use new type direction_type 2002-03-06 Dominik Vogt * fvwm/ewmh.c (EWMH_SetFrameStrut): use function from geometry.c to get the border size * fvwm/geometry.c (get_shaded_geometry): added code for shading in all directions 2002-03-07 Dan Espen * fvwm/bindings.c (ParseBinding): Handle key_string lengths up to 30. 2002-03-07 olicha * libs/Flocale.c (FInitLocale): * fvwm/fvwm.c (main): Set the locale using "" as locale argument 2002-03-07 Mikhael Goikhman * fvwm/fvwm2.1: fixed some typos and indentation of several new variable entries 2002-03-06 Dominik Vogt * fvwm/functions.h (enum): * fvwm/functions.c (func_config): * fvwm/commands.h: * fvwm/conditional.c (CMD_ThisWindow): renamed command "This" to "ThisWindow" * fvwm/conditional.c (Circulate): "Current" no longer selects a random window when no window is focused * fvwm/icccm2.c (SetupICCCM2): removed debug fprintf * fvwm/functions.c (expand_extended_var): implemented new extended variables pointer.x, pointer.x, pointer.wx, pointer.wy, pointer.cx and pointer.cy. * libs/Parse.c (ParseDirectionArgument): allow N, S, W, E, NW, SW, SE, NE for direction arguments * fvwm/builtins.c (CMD_WindowShade): fixes for animated shading w/ titleatbottom+north and titleattop+south 2002-03-06 Dominik Vogt * fvwm/move_resize.c (moveLoop): (resize_window): * fvwm/virtual.c (HandlePaging): moving/resizing windows opaque is much faster 2002-03-05 Dominik Vogt * fvwm/add_window.c (resize_resize_handle_windows): (change_resize_handle_windows): (setup_window_font): fixed changing the handlewidth style * fvwm/update.c (apply_window_updates): * fvwm/geometry.c (update_absolute_geometry): * fvwm/builtins.c (CMD_WindowShade): * fvwm/ewmh_events.c (ewmh_WMStateShaded): * fvwm/conditional.c (CreateConditionMask): * fvwm/geometry.c (get_shaded_geometry): * fvwm/session.c (MatchWinToSM): * fvwm/add_window.c (setup_window_structure): (AddWindow): * fvwm/window_flags.h (SHADED_DIR): * fvwm/fvwm.h (struct): implemented new WindowShade options "North" and "South" to allow shading a window in either direction, regardless of if the title is at the top or bottom. * libs/Module.c (module_expand_action): new convenience function for modules 2002-03-03 Dan Espen * fvwm/fvwm2.1: Fixes to the font section. 2002-03-03 Dominik Vogt * fvwm/conditional.c (CMD_WindowId): set the correct context window for unmanaged windows * fvwm/icons.c (DrawIconWindow): raise the icon title even if it's too small to be expanded * fvwm/conditional.c (CMD_Cond): Fixed it the right way this time (CMD_Any): same fix for the 'Any' command (circulate_cmd): (CMD_Prev): (CMD_Next): (CMD_None): (CMD_Any): (CMD_Current): unified circulating functions into a single one (CMD_Pick): Pick allows to pick functions that have CirculateSkip set fixed a memory leak (select_cmd): (CMD_This): (CMD_Pick): (CMD_PointerWindow): unified selecting functions into a single one (CMD_PointerKey): (CMD_All): Allow user to override the default CirculateHit of these functions * fvwm/conditional.c (CMD_Cond): Fixed a problem w/ the window selection * fvwm/menus.h: * fvwm/menus.c: * fvwm/menudim.h: * fvwm/menudim.c: * fvwm/menustyle.h: * fvwm/menustyle.c: * fvwm/menucmd.c: * fvwm/menuitem.c: * fvwm/menuitem.h: moved some of the menu code into separate files more work on tear off menus; windowlist can now be torn off without a memory leak * fvwm/template.c: * fvwm/template.h: added templates for new source files * libs/Picture.c (fvwmlib_clone_color): new function * fvwm/menus.c (make_menu): (update_menu): removed unused parameter from make_menu() * fvwm/fvwm2.1 (Example): corrected statement about CaptureHonorsStartsOnPage being the default 2002-03-03 Mikhael Goikhman * INSTALL.fvwm: * Makefile.am: * configure.in: added and documented --disable-bidi and --disable-perllib 2002-03-01 Dominik Vogt * fvwm/geometry.c (get_window_borders): fixed calculation of $[cw.y] and $[cw.height] * fvwm/move_resize.c (resize_move_window): windows are mo longer hilighted after ResizeMove or ResizeMoveMaximize 2002-03-01 Dominik Vogt * fvwm/move_resize.c (resize_move_window): 2002-02-28 Dominik Vogt * configure.in: re-added --enable-xinerama-emulation option that was removed recently 2002-02-28 Mikhael Goikhman * INSTALL.fvwm: * NEWS: * fvwm/fvwm2.1: several corrections and rewording 2002-02-28 olicha * fvwm/fvwm2.1: New section FONT NAMES AND FONT LOADING * INSTALL.fvwm: * NEWS: Document --enable-xft * libs/Fft.c (get_FlocaleXftFont): Used the xft font height in the place of ascent+descent * fvwm/icons.c (DrawIconWindow): Fixed the fg colors of the icon title 2002-02-27 Dominik Vogt * fvwm/conditional.c (CMD_CondCase): fixed CondCase command (CMD_Cond): fixed numeric return codes * fvwm/add_window.c (CMD_Recapture): fixed focus loss w/ SloppyFocus and MouseFocus after RecaptureWindow * acinclude.m4 (smr_CHECK_LIB): disabled a destructing gnome_prefix logic again * fvwm/events.c (GetContext): * libs/Bindings.c (win_contexts): * libs/fvwmlib.h: new contexts for individual parts of the window border 2002-02-26 Mikhael Goikhman * acinclude.m4: disabled a destructing gnome_prefix logic * configure.in: replaced fribidi detection mechanism, now fribidi-config is used 2002-02-26 olicha * acconfig.h (HAVE_XFT): * acinclude.m4: * configure.in: * libs/Fft.c (new file): * libs/Flocale.c (FlocaleLoadFont): (FlocaleUnloadFont): (FlocaleDrawString): (FlocaleTextWidth): (get_FlocaleFontSet): (get_FlocaleFont): (get_FlocaleFontOrFontSet): * libs/Flocale.h: * fvwm/Makefile.am: Added anti-alised font rendering using Xft. This is off by default. A font can now be given as a ";" separated list of either "," separated list of XFLD font name or Xft font name with "xft:" as prefix, e.g.: xft:Verdana:Regular:size=12:rgba=rgb;-adobe-*-medium-r-*--12-*,fixed See Flocale.h for details * fvwm/events.c (HandleExpose): * fvwm/menus.c (paint_item): Always clear the text area before drawing text with an Xft font 2002-02-26 Dominik Vogt * acinclude.m4 (smr_CHECK_LIB): fixed a bug with variable expansion and autoconf cache values 2002-02-24 Dominik Vogt * fvwm/menus.c (seek_submenu_instance): (FindPopup): * fvwm/fvwm.c (InitVariables): some general menu clean up * fvwm/move_resize.c (AnimatedMoveAnyWindow): * fvwm/move_resize.h (resize_geometry_window): * fvwm/menus.c (animated_move_back): (pop_menu_up): (ParentalMenuRePaint): Removed the global variables for parental relativity. Please *do not* use globals in menus.c or anywhere else. I'm trying to remove most globals in the long run. * libs/Graphics.c (do_relieve_rectangle): removed debug code * fvwm/menus.c (MenuInteraction): fixed tearing off menus by selecting a tear off item with the keyboard * fvwm/menus.c (MenuInteraction): fixed menus not popping down sometimes * fvwm/functions.c (CMD_TearMenuOff): * fvwm/menus.c (AddToMenu): (MenuInteraction): (warp_pointer_to_item): (get_selectable_item_index): (get_selectable_item_from_index): (get_selectable_item_from_section): (menuShortcuts): (paint_item): (draw_tear_off_bar): * fvwm/menus.h (MI_IS_TEAR_OFF_BAR): New command "TearMenuOff" in menus. In a normal item, this tears off the menu when selected. If the item has no title, it is drawn as a dashed line too. Pressing button 2 over a title tears out the menu too. some clean up * fvwm/menus.c (make_menu_window): fixed problem w/ mapping menus, performance enhancement * fvwm/builtins.c (CMD_Destroy): (CMD_Close): fixed core dump * fvwm/functions.c (execute_function): (expand_extended_var): (expand): new variable cond.rc that returns the last return code of a conditinal command 2002-02-23 Dominik Vogt * fvwm/conditional.c (CMD_Cond): (CMD_CondCase): (CMD_Break): * fvwm/commands.h: * fvwm/functions.h: * fvwm/functions.c: new conditional commands Cond, CondCase and Break * fvwm/ewmh_events.c (ewmh_WMStateSticky): (ewmh_WMStateShaded): (ewmh_WMState): (ewmh_MoveResize): (ewmh_WMStateHidden): (ewmh_WMDesktop): (ewmh_CloseWindow): (ewmh_ActiveWindow): (ewmh_DesktopGeometry): * fvwm/gnome.c (GNOME_HandlePropRequest): * fvwm/windowlist.c (CMD_WindowList): * fvwm/update.c (apply_window_updates): * fvwm/conditional.c (CMD_Pick): (CMD_Prev): (CMD_Next): (CMD_None): (CMD_Any): (CMD_Current): (CMD_PointerWindow): (CMD_This): (CMD_All): (CMD_Direction): (CMD_WindowId): * fvwm/read.c (run_command_stream): * fvwm/fvwm.c (Done): (SetRCDefaults): (StartupStuff): (main): * fvwm/module_interface.c (ExecuteModuleCommand): * fvwm/move_resize.c (handle_stick): * fvwm/add_window.c (AddWindow): * fvwm/events.c (HandleKeyPress): (HandleButtonPress): (HandleClientMessage): (HandleButtonRelease): (HandlePropertyNotify): * fvwm/builtins.c (CMD_DestroyDecor): (AddToDecor): (CMD_StrokeFunc): * fvwm/functions.h (func_type): * fvwm/functions.c (old_execute_function): (execute_function): (execute_complex_function): * fvwm/fvwm.h (fvwm_cond_func_rc): inplemented return codes OK, NO_MATCH and ERROR for conditional commands * fvwm/ConfigFvwmDefaults: set some default styles for tear off menu windows * fvwm/menus.c (menuShortcuts): ignore actions that would normally close a menu if it's a tear off menu creates a tear off menu closes a tear off menu * fvwm/builtins.c (CMD_Delete): (CMD_Destroy): (CMD_Close): * fvwm/menus.c (DestroyMenu): (make_menu_window): (MenuInteraction): * fvwm/menus.h (MenuRootDynamic): Each menu window is created with a unique display to prevent fvwm from being killed when a tear off menu is destroyed. Of course this is inefficient, but still better than writing a menu module. 2002-02-23 Mikhael Goikhman * configure.in: autogenerate perllib/FVWM/Module/Makefile 2002-02-23 Dominik Vogt * fvwm/move_resize.c (moveLoop): fixed a problem with keyboard movement vs. EdgeResistance 2002-02-22 Dominik Vogt * fvwm/events.c: fixed problem with root bindings and xfishtank * fvwm/windowlist.c (CMD_WindowList): applied patch by to Darren Marshall to fix placement of window list on wrong xinerama screen * libs/Parse.c (GetSuffixedIntegerArguments): integer arguments that must not have a suffix but have one are ignored * fvwm/icons.c (DeIconify): (Iconify): applied patch by Markus Schwarzenberg to fix a rare problem with the is_map_pending flag, iconified icons and restart 2002-02-22 Mikhael Goikhman * fvwm/commands.h: * fvwm/conditional.c (CMD_This): * fvwm/functions.c: * fvwm/functions.h: * fvwm/fvwm2.1: * NEWS: added new conditional command This 2002-02-21 Mikhael Goikhman * acconfig.h: * configure.in: added fribidi library detection 2002-02-12 olicha * libs/Flocale.h (FlocaleFont): * libs/Flocale.c (get_FlocaleFont): (get_FlocaleFontSet): Compute the ascent and descent of the FlocaleFont structure directly from the XFontSetExtents data in the case of a fontset Added max_char_width to the FlocaleFont structure * libs/Makefile.am (libfvwm_a_SOURCES): * libs/GetFont.c: Removed libs/GetFont.c * fvwm/menus.c (FreeMenuStyle): (UpdateMenuStyle): (NewMenuStyle): (CMD_CopyMenuStyle): * fvwm/menus.h (MenuLook): Fixed default font handling font by using a new MenuLook flags USING_DEFAULT_FONT * fvwm/menus.c (UpdateMenuStyle): Fixed default font update * fvwm/fvwm.c (SetRCDefaults): (InitVariables): Load the real default font FALLBACK_FONT or MB_FALLBACK_FONT at fvwm initialization 2002-02-11 Mikhael Goikhman * configure.in: added FvwmPerl/* file generation 2002-02-11 olicha * INSTALL.fvwm: * NEWS: Multibyte news. Document --disable-compound-text and --disable-ewmh. * libs/Flocale.h: Added more documentation and change the MB_FALLBACK_FONT to "-*-fixed-medium-r-semicondensed-*-13-*,-*-fixed-medium-r-normal-*-14-*, -*-medium-r-normal-*-16-*" (with XFree) this should gives something more consistent with the none multibyte case. 2002-02-10 olicha * fvwm/ewmh.c (EWMH_RestoreInitialStates): (EWMH_ExitStuff): * fvwm/events.c (HandleUnmapNotify): (HandleReparentNotify): * fvwm/ewmh_events.c (ewmh_WMStateShaded): (ewmh_WMStateSticky): (ewmh_WMStateHidden): Restore various ewmh initial states when a window is unmapped or reparented 2002-02-10 Mikhael Goikhman * Makefile.am: * configure.in: added support for new perllib directory 2002-02-09 olicha * libs/fvwmlib.h: * libs/Flocale.c: * libs/Flocale.h: * acconfig.h: * configure.in: Rename I18N_MB to MULTIBYTE Added --disable-compound-text (COMPOUND_TEXT), so this is on by default * libs/Flocale.c (*): * libs/Flocale.h: New Font and Text API. A cache is used for fonts information. Font loading is more powerfull as both font or fontset can be loaded. See Flocale.h for details, more comments will be added soon. Fortunately, it seems that there are no more memory problems with --enable-multibyte! If COMPOUND_TEXT, then non XA_STRING text properties are converted with XmbTextPropertyToTextList * fvwm/events.c (HandlePropertyNotify): * fvwm/misc.c (NewFontAndColor): * fvwm/icons.h: * fvwm/misc.h: * fvwm/menus.c (FreeMenuStyle): (NewMenuStyle): (CMD_CopyMenuStyle): (draw_underline): (calculate_item_sizes): (size_menu_horizontally): (paint_item): * fvwm/builtins.c (CMD_DefaultFont): (ApplyDefaultFontAndColors): * fvwm/add_window.c (destroy_icon_font): (setup_icon_font): (destroy_window_font): (setup_window_font): (free_window_names): (setup_window_name): (setup_icon): * fvwm/fvwm.h (FvwmWindow): * fvwm/move_resize.c (DisplayPosition): (resize_geometry_window): (DisplaySize): * fvwm/fvwm.c (InitVariables): * fvwm/icons.c (DrawIconWindow): (setup_icon_title_size): * fvwm/borders.c (RedrawTitle): (DrawMultiPixmapTitlebar): * fvwm/screen.h (ScreenInfo): Use the new Text and Font API 2002-02-07 Dominik Vogt * fvwm/module_interface.c (PositiveWrite): fixed core dump when a module died in the select of PositiveWrite() * fvwm/module_interface.c (initModules): (ClosePipes): (do_execute_module): (KillModule): (KillModuleByName): (CMD_SendToModule): (PositiveWrite): * fvwm/modconf.c (ModuleConfig): removed WITHOUT_KILLMODULE_ALIAS_SUPPORT ifdef; always off now * fvwm/icons.c (GetXPMFile): suppress unnecessary error message for xmb icons * fvwm/misc.c (fvwm_msg): * fvwm/misc.h (enum): added new fvwm_msg type "OLD" for deprecated commands 2002-02-07 Mikhael Goikhman * configure.in: generate fvwmbug, not fvwmbug.sh; prepare LOCAL_BUGADDR for it * INSTALL.fvwm: New section "Bug Reports". 2002-02-06 Dominik Vogt * fvwm/update.c (apply_window_updates): fixed propagation of window border and title colours to the modules 2002-02-05 Dominik Vogt * fvwm/menus.c (do_menu): fixed leaving tear off menus when something is selected with the mouse 2002-02-03 Dominik Vogt * fvwm/events.c (HandleEnterNotify): * fvwm/menus.c: more work on tear off menus 2002-02-02 Dominik Vogt * fvwm/events.h (XEVMASK_TEAR_OFF_MENU): * fvwm/menus.c (menu_enter_tear_off_menu): (find_entry): (menuShortcuts): (MenuInteraction): (pop_menu_up): properly calculate pointer position in tear off menus (MenuInteraction): fixed active wait w/ poopup/popdown delays * fvwm/windowlist.c (CMD_WindowList): don't initialise some variables twice 2002-01-31 Dominik Vogt * fvwm/add_window.c (CaptureOneWindow): properly recapture tear off menus (IS_MESSAGE_IN_MASK): (is_message_selected): (PositiveWrite): (PositiveWrite): * fvwm/schedule.c (deschedule): (squeue_execute): * fvwm/events.c (My_XNextEvent): * libs/queue.h: * fvwm/module_interface.c (ClosePipes): (CMD_ModuleSynchronous): (KillModule): performance enhancements; made macros out of simple functions * fvwm/builtins.c (CMD_WindowShade): don't redraw the decorations if window was not shaded or unshaded * fvwm/schedule.c (deschedule_obj_func): (execute_obj_func): fixed core dump when a scheduled command deschedules itself 2002-01-31 olicha * NEWS: FvwmButtons news 2002-01-31 Mikhael Goikhman * NEWS: * fvwm/move.c (moveLoop): while moving if Mod1 (Alt/Meta) is pressed ignore snap attraction * fvwm/session.c (get_version_string): switch from static to date-based version string * configure.in: remove --enable-kanji compatibility option * fvwm/schedule.h: * libs/queue.h: fix warnings, gcc compains on having something after #endif 2002-01-31 Dominik Vogt * fvwm/builtins.c (CMD_Delete): (CMD_Close): (CMD_Destroy): don't crash fvwm when trying to close a tear off menu * fvwm/decorations.c (is_function_allowed): * fvwm/menus.c (menu_expose): (do_menu): * fvwm/events.c (HandleReparentNotify): (HandleUnmapNotify): * fvwm/add_window.c (AddWindow): (AddWindow): * fvwm/fvwm.h (struct): * fvwm/add_window.c (CaptureAllWindows): (CaptureOneWindow): * fvwm/events.h (flush_property_notify): * fvwm/events.c (HandleMapRequestKeepRaised): started work on tear off menus * fvwm/fvwm.c (main): * fvwm/events.c (CMD_Sync): (CMD_Synchronize): * fvwm/commands.h (CMD_Synchronize): * fvwm/functions.h (enum): * fvwm/functions.c (func_config): new commands XSync and XSynchronize for debugging * fvwm/conditional.c (CreateConditionMask): (MatchesConditionMask): * fvwm/builtins.c (CMD_State): * fvwm/fvwm.h (struct): * fvwm/functions.h: * fvwm/commands.h: * fvwm/functions.c (func_config): new command "State" new condition "State" * libs/queue.c: fixed core dump 2002-01-30 Dominik Vogt * fvwm/module_interface.c (AddToMessageQueue): (initModules): (DeleteMessageQueueBuff): (FlushMessageQueue): * fvwm/events.c (My_XNextEvent): * fvwm/module_interface.c (AddToCommandQueue): (ExecuteCommandQueue): use code from queue.c * fvwm/schedule.c: * fvwm/queue.c: * fvwm/queue.h: * fvwm/events.c (My_XNextEvent): "Schedule 0" commands are executed before event handling moved some of the chedule code into a new queue library 2002-01-30 olicha * libs/Flocale.c (FInitLocale): Fixed a miss print in an error msg 2002-01-30 olicha * libs/Flocale.c: * libs/Flocale.h: * libs/Makefile.am: * fvwm/fvwm.c (main): New libs files Flocale.c and Flocale.h with a function to set the locale as the Xlib prog man says to do it. Use it in fvwm.c. There is also a function to get the charset (from ewmh_name.c) and which setlocale if this has not been done with the above function. This function is also called at fvwm2 startup * fvwm/ewmh_names.c (charset_to_utf8): (utf8_to_charset): Use the Fcharset variable and remove get_charset * fvwm/ewmh_names.c (EWMH_SetVisibleName): A minor fix * libs/GetFont.c (GetFontSetOrFixed): Free the missing charset list as suggested by Alexander Kotelnikov. Report problems with missing charset only 5 times. Remove the STRICTLY_FIXED code 2002-01-30 Mikhael Goikhman * configure.in: a patch to config.status to generate scripts executable, may be handy; added generation of utils/fvwm24_convert 2002-01-30 Dominik Vogt * fvwm/schedule.c: * fvwm/functions.c (expand_extended_var): implemented $[schedule.last] and $[schedule.next] variables implemented new command "Deschedule" * fvwm/misc.c (get_server_time): fixed MouseFocus 2002-01-29 Dominik Vogt * fvwm/misc.c (get_server_time): * fvwm/events.c (My_XNextEvent): * fvwm/icccm2.c (SetupICCCM2): * fvwm/functions.h: * fvwm/commands.h: * fvwm/functions.c (func_config): * fvwm/schedule.c: implemented new command "Schedule" * fvwm/builtins.c (CMD_Exec): applied job control patch by Alexander Kotelnikov using the portable version of setpgrp() * libs/setpgrp.c (fvwm_setpgrp): * libs/setpgrp.h (fvwm_setpgrp): * libs/Makefile.am: * configure.in: added checks for setpgrp and setpgid 2002-01-29 olicha * acinclude.m4: Better test for iconv second argumeny * configure.in: Use gnu libiconv in priority against the system iconv 2002-01-29 Dominik Vogt * fvwm/stack.c (RaiseOrLowerWindow): (restack_windows): (collect_transients_recursive): * fvwm/icons.c (get_visible_icon_window_count): fixed stack ring corruption with icons that have either no picture or no title 2002-01-28 olicha * fvwm/ewmh_names.c (charset_to_utf8): (utf8_to_charset): (EWMH_SetVisibleName): (get_charset): Better message errors in get_charset, use UTF-8 in the place of UTF8, set the ewmh visible (icon) name only if the fvwm visible name is different from the ICCCM (icon) window name, limit the number of conversions error messages to 10 2002-01-28 olicha * fvwm/functions.c (func_config): * fvwm/commands.h: * fvwm/builtins.c (CMD_PropertyChange): New undocumented command PropertyChange to send MX_PROPERTY_CHANGE messages * fvwm/module_interface.h: * fvwm/module_interface.c (BroadcastPropertyChange): * libs/Module.h (MX_PROPERTY_CHANGE): New module message MX_PROPERTY_CHANGE for all propose messages. * fvwm/events.c (HandlePropertyNotify): * libs/defaults.h: Send a MX_PROPERTY_CHANGE message with MX_PROPERTY_CHANGE_BACKGROUND as argument when fvwm2 detects that the root background change Removed the ROOT_BG_CHANGE_STRING stuff 2002-01-27 Dominik Vogt * NEWS, configure.in: changed version to 2.5.1 * fvwm/misc.c (get_pointer_fvwm_window): * fvwm/commands.h: * fvwm/functions.c (func_config): * fvwm/conditional.c (CreateConditionMask): (MatchesConditionMask): (CMD_PointerWindow): (CreateConditionMask): (CMD_Any): * fvwm/fvwm.h (WindowConditionMask): new conditions focused, !focused, haspointer, !haspointer new command PointerWindow that works like Current but on the window that currently contains the pointer new command Any which works like None but inverts the condition fixed parsing of conditions with more than one comma * fvwm/module_interface.h: * fvwm/module_interface.c (do_execute_module): (initModules): * libs/Module.h (MAX_XMSG_MASK): fixed default message mask for modules * fvwm/update.c (flush_window_updates): * fvwm/virtual.c (UnmapDesk): (MapDesk): (do_move_window_to_desk): * fvwm/icons.c (DeIconify): (DeIconify): * fvwm/events.c (HandlePropertyNotify): (HandleMapRequestKeepRaised): (HandleMapNotify): (HandleButtonPress): (HandleEnterNotify): (HandleLeaveNotify): * fvwm/focus.c (DoSetFocus): (MoveFocus): (SetFocusWindow): (ReturnFocusWindow): (DeleteFocus): (ForceDeleteFocus): (FocusOn): (restore_focus_after_unmap): Fixed a race condition with M_FOCUS_CHANGE events and window updates by suppressing the M_FOCUS_CHANGE message if the focus does not change in the flush_window_updates() function. 2002-01-24 Dominik Vogt * fvwm/placement.c (PlaceWindow): minor performance enhancement 2002-01-23 Dominik Vogt * libs/defaults.h: * fvwm/menus.c (MenuInteraction): (pointer_in_active_item_area): (pointer_in_passive_item_area): new menu style PopupActiveArea 2002-01-22 Dominik Vogt * fvwm/move_resize.c (CMD_ResizeMaximize): (CMD_ResizeMoveMaximize): fixed ResizeMaximize and ResizeMoveMaximize on pages other than 0 0 2002-01-21 olicha * fvwm/fvwm2.1: s/Penalities/Penalties/g 2002-01-19 Dominik Vogt * fvwm/events.c (HandleLeaveNotify): (HandleEnterNotify): * fvwm/modconf.c (ModuleConfig): * fvwm/update.c (apply_window_updates): * fvwm/module_interface.c (BroadcastWindowIconNames): (CMD_Send_WindowList): (initModules): (do_execute_module): (PositiveWrite): (CMD_set_nograb_mask): (CMD_set_sync_mask): (CMD_set_mask): (set_mseggage_mask): (is_message_in_mask): (is_message_selected): * libs/Module.h: rewrote message interface to allow more than 32 messages with minimal changes in the existing interfaces. new module messages MX_ENTER_WINDOW and MX_LEAVE_WINDOW * fvwm/style.h: * fvwm/style.c (parse_and_set_window_style): * fvwm/fvwm.h (struct): * fvwm/events.c (HandleButtonPress): implemented new styles MouseFocusClickIgnoreMotion and MouseFocusClickIgnoreMotionOff * fvwm/focus.c (focus_grab_buttons): fixed button mask for > 5 buttons 2002-01-19 olicha * fvwm/ewmh_icons.c (ewmh_SetWmIconFromPixmap): Save and restore the icon_pixmap_w and add comments 2002-01-19 Dominik Vogt * fvwm/events.c (HandleEnterNotify): fixed EnterNotify events for icons 2002-01-18 Dominik Vogt * fvwm/*.c: * fvwm/stack.c (overlap_box): (overlap): * fvwm/icons.c (clear_icon): * fvwm/add_window.c (destroy_icon): * fvwm/fvwm.h (FvwmWindow): * fvwm/geometry.c (get_window_borders): (get_client_geometry): * libs/fvwmrect.h (struct): * fvwm/functions.c (expand_extended_var): implemented new extended variables cw.x, cw.y, cw.width, cw.height that return the geometry of the client window implemented new extended variables it.x, it.y, it.width, it.height that return the geometry of the icon title implemented new extended variables ip.x, ip.y, ip.width, ip.height that return the geometry of the icon picture implemented new extended variables i.x, i.y, i.width, i.height that return the geometry of the whole icon fixed $[w.height] when the window is shaded cleaned up icon geometry code 2002-01-17 Dominik Vogt * fvwm/commands.h: * fvwm/functions.c: * fvwm/functions.h: * fvwm/move_resize.c (unmaximize_fvwm_window): (maximize_fvwm_window): (CMD_Maximize): (CMD_ResizeMaximize): (CMD_Resize): (resize_window): (CMD_ResizeMove): (resize_move_window): (CMD_ResizeMoveMaximize): New command ResizeMaximize. Works like Resize, but modifies the maximized size of the window, not the normal size. New command ResizeMoveMaximize that works similarly. (resize_move_window): fixed ResizeMove command * fvwm/functions.c (expand): fixed core dump when using something like $[$v] in a command 2002-01-17 olicha * libs/defaults.h (ROOT_BG_CHANGE_STRING): * fvwm/events.c (HandlePropertyNotify): * fvwm/fvwm.c (InternUsefulAtoms): * fvwm/extern.h: Send the ROOT_BG_CHANGE_STRING to modules when fvwm2 detects that the root background has changed. This uses the _XSETROOT_ID and XROOTPMAP_ID properties * fvwm/ewmh.c (atom_get): Be paranoid 2002-01-17 Dominik Vogt * fvwm/update.c (flush_window_updates): fixed unnecessary window style updates * fvwm/style.c (parse_and_set_window_style): * fvwm/add_window.c (RestoreWithdrawnLocation): (AddWindow): (setup_frame_attributes): * fvwm/fvwm.h (FvwmWindow): Fvwm does no longer disable backing store on all of its windows. This cause too many problems with some applications, e.g. rdist. Introduced the new style BackingStoreWindowDefault that tells fvwm not to modify the backing store attribute on the client window - which now is the default. 2002-01-16 Dominik Vogt * fvwm/commands.h: * fvwm/functions.c (func_config): * libs/Module.c (SetMessageMask2): (SetNoGrabMask2): * libs/Module.h: * configure.in: fixed building with libstroke-0.5.1 on Solaris8 * fvwm/stack.c (new_layer): * fvwm/borders.c (DrawButton): (RedrawButtons): (RedrawTitle): * fvwm/builtins.c (SetLayerButtonFlag): (do_button_style): * fvwm/screen.h (struct): Applied the layer button patch by Richard Curnow with a few modifications * fvwm/icons.c (GetIconBitmap): (GetIconWindow): Ignore client icons that have the wrong depth * fvwm/events.c (HandleEnterNotify): Tried to fix focusing problem w/ unclutter. 2002-01-15 Dominik Vogt * fvwm/functions.c (CheckActionType): remove debug code * fvwm/menus.c (paint_item): * fvwm/misc.c (is_function_allowed): * fvwm/move_resize.c (is_move_allowed): (is_resize_allowed): (is_maximize_allowed): * fvwm/decorations.c (check_if_function_allowed): combined all these functions into a new one use this function everywhere use the Fixed... styles to decide if a menu item is greyed or not 2002-01-10 Dominik Vogt * fvwm/events.c (HandleExpose): eat up expose events even if the server claims that the expose count is zero; fixes a problem with many redraws of windows that are uncovered by shading a window above them 2002-01-10 olicha * fvwm/focus.c (DoSetFocus): * fvwm/move_resize.c (CMD_Maximize): (CMD_Maximize): (handle_stick): (CMD_ResizeMove): (CMD_Resize): * fvwm/icons.c (DeIconify): (DeIconify): (Iconify): * fvwm/gnome.c (GNOME_HandlePropRequest): * fvwm/ewmh_names.c (EWMH_WMName): * fvwm/events.c (HandleFocusIn): (HandlePropertyNotify): (HandleMapNotify): (HandleButtonPress): (HandleLeaveNotify): (HandleExpose): * fvwm/builtins.c (CMD_UpdateDecor): (CMD_WindowShade): * fvwm/borders.c (draw_clipped_decorations): (DrawDecorations): (RedrawDecorations): * fvwm/borders.h: Added a new argument to DrawDecoration similar to draw_window_parts, which indicate which part of the decor should be cleared. At present time only CLEAR_FRAME is taken in account and this is used in ShadeWindow to draw the decoration without flickering. This argument may be used in the future to reduce opaque resizing flickering * fvwm/builtins.c (CMD_WindowShade): Draw the decoration during unshading a window * fvwm/menus.c (ParentalMenuRePaint): Fixed transparent animated menu again * NEWS: Some update 2002-01-09 olicha * fvwm/style.c (CMD_Style): free all the elements of the ptmpstyle before freeing it * fvwm/menus.c (ParentalMenuRePaint): Fixed transparent animated menu with HilightBackOff 2002-01-09 Dominik Vogt * fvwm/style.c (merge_styles): fixed core dump w/ multiple use of the UseStyle style and HilightBack in the copied style 2002-01-07 Dominik Vogt * fvwm/modconf.c (send_ignore_modifiers): (send_move_threshold): (send_click_time): (send_colorsets): (send_color_limit): (send_image_path): (send_desktop_geometry): (CMD_Send_ConfigInfo): moved code into new functions * libs/defaults.h (DEFAULT_MODS_UNUSED): moved to defaults.h * fvwm/bindings.c (CMD_IgnoreModifiers): * fvwm/module_interface.c (broadcast_xinerama_state): * fvwm/modconf.c (send_ignore_modifiers): broadcast IgnoreModifiers to modules * fvwm/bindings.c (CMD_IgnoreModifiers): fixed IgnoreModifiers command without arguments * fvwm/fvwm2.1: corrected documentation of IgnoreModifiers command 2002-01-06 Dominik Vogt * fvwm/add_window.c: * fvwm/cursor.c: * fvwm/virtual.c: * fvwm/builtins.c: * fvwm/bindings.c: * fvwm/move_resize.c: * fvwm/events.c: * fvwm/stack.c: * fvwm/module_interface.c: * fvwm/focus.c: * fvwm/placement.c: * fvwm/menus.c: * fvwm/icons.c: * fvwm/fvwm.h (FvwmWindow): remnamed icon_w member to icon_title_w 2002-01-05 Dominik Vogt * fvwm/icons.c (RedoIconName): fixed sizing of icon title for icons without a pixmap (RedoIconName): (CreateIconWindow): (Iconify): (CreateIconWindow): rewrote icon title layout and moved the constants to defaults.h * fvwm/menus.c (menuShortcuts): (handle_emacs_bindings): implemented emacs style bindings in menus [ctrl-a/b/e/f/g/left/right] 2002-01-04 Dan Espen * fvwm/fvwm2.1: Language checks done. .IR command not in column 1 fixed. 2002-01-04 olicha * fvwm/move_resize.c (AnimatedMoveAnyWindow): (AnimatedMoveOfWindow): (AnimatedMoveFvwmWindow): (move_window_doit): * fvwm/menus.c (ParentalMenuRePaint): (animated_move_back): (pop_menu_up): Fixed transparent animated menu 2002-01-03 olicha * fvwm/move_resize.c (is_resize_allowed): (is_move_allowed): Do not check if moveing/resizeing is MWM allowed for a no user request This fix for example FvwmWinList with MwmFunctions & NoOverride * fvwm/move_resize.c (AnimatedMoveAnyWindow): * fvwm/move_resize.c (is_move_allowed): Allowed moving if tmp_win is null and check if move is allowed and not resize in AnimatedMoveAnyWindow. This fix animated menu * fvwm/ewmh.c (ewmh_AllowsMaximize): (ewmh_AllowsMove): (ewmh_AllowsResize): Check as a user request * fvwm/fvwm2.1: * fvwm/move_resize.c (CMD_Maximize): (MaximizeWidth): (MaximizeHeight): New global flags "layer" and "ewmiwa". layer causes the grow* methods to ignore the windows with a layer less or equal to the layer of the maximized window. ewmhiwa causes to ignore the ewmh working area. Reorder a bit the Maximize documentation * fvwm/fvwm2.1: * fvwm/functions.c (expand_extended_var): New variables $[desk.name] to get the desktop names 2002-01-01 Dan Espen * fvwm/read.c (CMD_Read): Correct message on missing file when using Read with full path. 2002-01-01 Dominik Vogt * libs/defaults.h: * fvwm/misc.c (GrabEm): reduced number of grab attempts from 500 to 50 @ 10 ms = 0.5 seconds */ * fvwm/events.c (HandleUnmapNotify): (HandleMapRequestKeepRaised): (check_map_request): fixed unmanaged window when window was mapped/unmapped/mapped too fast * fvwm/add_window.c (FetchWmProtocols): (setup_wm_hints): * fvwm/fvwm.h (FvwmWindow): * fvwm/events.c (HandleEnterNotify): (HandlePropertyNotify): * fvwm/focus.c (refresh_focus): (set_focus_model): fixed focus problems with netscape and ddd 2001-12-31 Dominik Vogt * libs/Target.c (fvwmlib_keyboard_shortcuts): * libs/Pointer.c (GetLocationFromEventOrQuery): * fvwm/virtual.c (HandlePaging): * fvwm/move_resize.c (GetOnePositionArgument): (InteractiveMove): (AnimatedMoveAnyWindow): (moveLoop): (CMD_Resize): * fvwm/module_interface.c (ExecuteModuleCommand): * fvwm/menus.c (do_menu): (menuShortcuts): (MenuInteraction): (get_menu_options): * fvwm/functions.c (execute_complex_function): * fvwm/events.c (HandleClientMessage): (WaitForButtonsUp): * fvwm/conditional.c (CMD_Direction): * fvwm/builtins.c (CMD_CursorMove): (CMD_FakeClick): (CMD_StrokeFunc): handle return code of XQueryPointer everywhere; necessary for dual head * fvwm/misc.c (GrabEm): Pointer was warped to other screen with a dual head setup 2001-12-31 olicha * fvwm/ewmh_events.c (ewmh_WMStateModal): Removed some code which try to raise ewmh modal window over its transientfor window; this seems not possible without a new style or a bad hack in stack.c 2001-12-30 Dan Espen * libs/GetFont.c (GetFontSetOrFixed): Cleanup the message about the fallback to fixed font so it shows the right font for I18N. 2001-12-30 olicha * fvwm/window_flags.h: * fvwm/session.c (MatchWinToSM): (LoadWindowStates): (SaveWindowStates): (get_version_string): * fvwm/move_resize.c (CMD_Maximize): (handle_stick): * fvwm/icons.c (CMD_Iconify): * fvwm/ewmh.c (EWMH_SetWMState): (EWMH_WindowInit): (EWMH_ExitStuff): (EWMH_SetAllowedActions): (EWMH_WindowInit): * fvwm/ewmh.h: * fvwm/ewmh_intern.h: * fvwm/ewmh_events.c (ewmh_WMState*): * fvwm/builtins.c (CMD_WindowShade): * fvwm/stack.c (new_layer): * fvwm/update.c (apply_window_updates): * fvwm/update.h (struct): * fvwm/add_window.c (setup_window_structure): (setup_window_name): (setup_icon): * fvwm/style.c (check_window_style_change): The skip list and modal ewmh window states are now updated after an use/ignore ewmh state style changes. The other ewmh states are starting state only. All the initial ewmh states are keep in memory for FvwmIdent. * fvwm/ewmh.c (EWMH_Handle*): * fvwm/fvwm.h: Set the ewmh_window_type to an int (and not the corresponding atom) accordingly to the window type * fvwm/ewmh_events.c (ewmh_WMStateModal): ewmh modal transient windows have RaiseTransient and GrabFocusTransient style * fvwm/ewmh.c (EWMH_GetStyle): * fvwm/ewmh_events.c (ewmh_WMDesktop): Respect the _NET_WM_DESKTOP hints at window mapping as a StartsOnDesk hints * libs/vpacket.h (ConfigWinPacket): * fvwm/module_interface.c (CONFIGARGSNEW): (OLDCONFIGARGS): (CONFIGARGS): Added ewmh_hint_layer, ewmh_hint_desktop and ewmh_window_type to the cfgpacket for FvwmIdent 2001-12-20 Dominik Vogt * fvwm/move_resize.c (resize_geometry_window): fixed wrong size calculation of geometry window 2001-12-19 olicha * fvwm/ewmh_names.c (convert_charsets): More precise error messages * fvwm/fvwm2.1: A few formatting fixes 2001-12-18 Dominik Vogt * fvwm/gnome.c (GNOME_SetHints): fixed window getting frozen into position upon a recapture or restart 2001-12-17 Dan Espen * fvwm/fvwm2.1: Fixup wording in EWMHIconicStateWorkaround. 2001-12-17 olicha * fvwm/fvwm2.1: Tried to clarify the EWMHIconicStateWorkaround BugOpts * fvwm/ewmh.c (delete_kst_item): (set_kde_sys_tray): (EWMH_IsKdeSysTrayWindow): (EWMH_ManageKdeSysTray): * fvwm/events.c (HandleReparentNotify): Fixed reparenting management of kde system tray windows and added some off debugging code * fvwm/virtual.c (CMD_DesktopName): Removed some debugging code 2001-12-16 Dominik Vogt * fvwm/fvwm.h (struct): * fvwm/window_flags.h (IS_FIXED_PPOS): * fvwm/style.h (SCSET_IS_FIXED_PPOS): * fvwm/style.c (parse_and_set_window_style): (check_window_style_change): implemented new styles FixedPPosition, FixedUSPosition, FixedSize, FixedUSSize, FixedPSize and Variable PPosition, ... * fvwm/events.c (HandleConfigureRequest): * fvwm/ewmh.c (ewmh_AllowsResize): (is_resize_allowed): (ewmh_AllowsMove): (ewmh_AllowsMove): * fvwm/gnome.c (GNOME_SetHints): (AnimatedMoveAnyWindow): (CMD_ResizeMove): use new functions * fvwm/move_resize.c (is_move_allowed): (is_resize_allowed): (is_maximize_allowed): new functions to clean up some code 2001-12-15 Dan Espen * fvwm/fvwm2.1: Doc fixups. 2001-12-15 olicha * fvwm/builtins (CMD_BugOpts): * fvwm/ewmh.c: * fvwm/ewmh_conf.c (EWMH_BugOpts): * fvwm/ewmh_events.c (ewmh_StateHidden): * fvwm/fvwm.c (InitVariables): * fvwm/fvwm2.1: * fvwm/icons.c (CMD_Iconify): * fvwm/screen.h: * fvwm/virtual.c (unmap_window): (map_window): Implemented the new _NET_WM_STATE_HIDDEN ewmh state that allows to fix the IconicState problems in vitrual.c. New BugOpts EWMHIconicStateWorkaround for supporting current KDE versions * fvwm/events.c (HandlePropertyNotify): * fvwm/ewmh.c (ewmh_AllowsYes): * fvwm/ewmh.h: (ewmh_AllowsClose): (ewmh_AllowsMaximize): (ewmh_AllowsMove): (ewmh_AllowsResize): (EWMH_SetAllowedActions): (EWMH_WindowInit): * fvwm/style.c (check_window_style_change): * fvwm/update.c (apply_window_updates): * fvwm/update.h: Implemented _NET_WM_ALLOWED_ACTIONS from version 1.2 of the wm-spec 2001-12-13 Dominik Vogt * fvwm/borders.c (RedrawTitle): * libs/defaults.h (WINDOW_TITLE_OFFSET): fixed 'stick' lines with long titles 2001-12-11 olicha * NEWS: * fvwm/commands.h: * fvwm/ewmh.c (ewmh_SetWorkArea): * fvwm/ewmh.h: (ewmh_ComputeAndSetWorkArea): (ewmh_HandleDynamicWorkArea): (EWMH_GetWorkAreaIntersection): (EWMH_GetStrutIntersection): (get_intersection): * fvwm/ewmh_name.c (EWMH_SetDeskNames): * fvwm/function.c: * fvwm/function.h: * fvwm/fvwm.c (InitVariables): * fvwm/fvwm2.1: * fvwm/modconf.c (send_desktop_names): (CMD_Send_ConfigInfo): * fvwm/placement.c (get_next_x): (get_next_y): * fvwm/screen.h: * fvwm/virtual.c (CMD_DesktopName): * fvwm/virtual.h: (GetDesktopName): New command "DesktopName desk name" to define desktops names for the FvwmPager, the WindowList and ewmh compliant pagers. Desktops information (desk, desk name, working areas) is stored in a new list sub structure of Scr, DesktopsInfo. The head of the list contains generic information for desks that are not in the list. * fvwm/windowlist.c (get_desk_title): (CMD_WindowList): * fvwm/fvwm2.1: * NEWS: New window list options NoDeskNum, NoCurrentDeskTitle, TitleForAllDesks, NoNumInDeskTitle. Document these options and also the NoGeometry and NoGeometryInfo options. * fvwm/ewmh.c: * fvwm/ewmh_names.c: * fvwm/ewmh_icons.c: Added some static declarations * fvwm/ewmh_names.c (EWMH_SetVisibleName): It seems that UTF8 names should not be terminated by a 0 * fvwm/ewmh.c (EWMH_SetClientListStacking): Set the stacking list in the good orders 2001-12-10 Dominik Vogt * vms/config.h: * fvwm/functions.c: * fvwm/commands.h: * fvwm/builtins.c: * fvwm/borders.c: removed all MULTISTYLE ifdefs * fvwm/borders.c (RedrawTitle): fixed title drawing into relief 2001-12-08 olicha * fvwm/style.c: * fvwm/style.h: * fvwm/fvwm.h: * fvwm/update.c: * fvwm/update.h: * fvwm/window_flags.h: * fvwm/fvwm2.1: s/extended_window_name/indexed_window_name/i s/extended_icon_name/indexed_icon_name/i s/do_update_window_name/do_update_visible_window_name/ s/do_update_icon_name/do_update_visible_icon_name/ * fvwm/style.c (CMD_Style): * fvwm/style.h: (parse_and_set_window_style): Split CMD_Style into CMD_Style and parse_and_set_window_style 2001-12-06 olicha * fvwm/add_window.c (setup_window_name_count): (setup_icon_name_count): Better determination of the window and icon names index * fvwm/add_window.c (AddWindow): (setup_icon): * fvwm/events.c (HandlePropertyNotify): * fvwm/ewmh_names.c (EWMH_WMName): (EWMH_WMIconName): * fvwm/module_interface.c (BroadcastWindowIconNames): * fvwm/module_interface.h: (CMD_Send_WindowList): (CMD_set_mask): (CMD_set_sync_mask): (CMD_set_nograb_mask): * fvwm/update.c (apply_window_updates): * libs/Module.h: New module messages type M_VISIBLE_NAME and M_VISIBLE_ICON_NAME which are send to modules with BroadcastWindowIconNames. The set mask cmds use unsigned long mask and not int mask! 2001-12-05 Dominik Vogt * fvwm/ewmh.h: * fvwm/ewmh.c: EWMH without iconv compile fix by Hippo 2001-12-05 olicha * fvwm/add_window.c: * fvwm/ewmh.c (*): * fvwm/ewmh.h: * fvwm/ewmh_conf.c (EWMH_CMD_Styles): * fvwm/ewmh_events.c: * fvwm/fvwm.h: * fvwm/fvwm2.1: * fvwm/move_resize.c (CMD_Maximize): * fvwm/placement.c (test_fit): (PlaceWindow): * fvwm/session.c (SaveWindowStates): * fvwm/style.c (merge_styles): * fvwm/style.h: (check_window_style_change): * fvwm/update.c (apply_window_updates): * fvwm/update.h: * fvwm/window_flags.h: New ewmh styles: EWMHMaximizeIgnoreWorkingArea / EWMHMaximizeUseWorkingArea / EWMHMaximizeUseDynamicWorkingArea, EWMHPlacementIgnoreWorkingArea / EWMHPlacementUseWorkingArea EWMHPlacementUseDynamicWorkingArea, EWMHUseStackingOrderHints / EWMHIgnoreStackingOrderHints, EWMHIgnoreStateHints / EWMHUseStateHints, EWMHIgnoreStrutHints / EWMHUseStrutHints * fvwm/ConfigFvwmDefaults: Use EWMHPlacementUseDynamicWorkingArea, EWMHMaximizeUseDynamicWorkingArea as default placement styles * NEWS: * fvwm/add_window.c (setup_placement_penalty): * fvwm/add_window.h: (setup_placement_penalty): (AddWindow): * fvwm/fvwm.h: * fvwm/placement.c (get_next_x): * fvwm/placement.h: (get_next_y): (test_fit): * fvwm/style.c (CMD_Style): * fvwm/style.h: (check_window_style_change): * fvwm/update.c (apply_window_updates): * fvwm/update.h: * fvwm/window_flags.h: * libs/default.h: New styles PlacementOverlapPenalties and PlacementOverlapPercentPenalties * NEWS: * fvwm/add_window.c (setup_window_name_count): * fvwm/add_window.h: (setup_icon_name_count): (setup_visible_name): (setup_window_name): (free_window_names): (setup_icon): * fvwm/borders.c (DrawMultiPixmapTitlebar): (RedrawTitle): * fvwm/events.c (HandlePropertyNotify): * fvwm/ewmh_names.c (EWMH_*): * fvwm/fvwm.h: * fvwm/icons.c (CreateIconWindow): (DrawIconWindow): (RedoIconName): (AutoPlaceIcon): (Iconify): * fvwm/session.c (MatchWinToSM): * fvwm/style.c (CMD_Style): * fvwm/style.h: (check_window_style_change): * fvwm/update.c (apply_window_updates): * fvwm/update.h: * fvwm/window_flags.h: New styles ExtendedWindowName / SimpleWindowName and ExtendedIconName / SimpleIconName. TODO: the modules implementation * fvwm/builtins.c (ReadMultiPixmapDecor): A -Wall fix * configure.in: Fixed gcc test * session.c (get_version_string): now is 2.5-3 * fvwm/stack.c (new_layer): (CMD_Layer): Fixed ewmh wm state * fvwm/ewmh_icons.c (ewmh_SetWmIconFromPixmap): Fixed creation of the ewmh icon in the case of the window is iconified 2001-11-28 Dominik Vogt * fvwm/placement.c (PlaceWindow): fixed manual placement on Xinerama screens other than the one with the top left corner of the total screen 2001-11-27 olicha * configure.in: * acinclude.m4: * acconfig.h: * fvwm/ewmh_name.c Check for the second argument of iconv * configure.in: Added -Wall to CFLAGS if cc is gcc 2001-11-26 Mikhael Goikhman * configure.in: * acconfig.h: s/extanded/extended/ 2001-11-26 olicha * fvwm/Makefile.am: Fixed (?) iconv_LIBS 2001-11-26 olicha * fvwm/functions.c (expand): Fixed n, c, r expansion 2001-11-25 Dan Espen * fvwm/fvwm2.1: Clean up ewmh stuff. 2001-11-24 olicha * fvwm/ewmh_internal.h: * fvwM/ewmh.c: Removed a non standard macro 2001-11-24 olicha * fvwm/fvwm2.1: Documented the previous ewmh style in a new Style subsection * fvwm/functions.c (expand): Clean up, removed 5 tmp_win and IS_EWMH_DESKTOP 2001-11-24 olicha * fvwm/add_window (setup_icon): (setup_window_structure): * fvwm/events.c (HandlePropertyNotify): * fvwm/ewmh.h: * fvwm/ewmh_conf.c (EWMH_CMD_Style): * fvwm/ewmh_icons.c (ewmh_WMIcon): (EWMH_DoUpdateWmIcon): (ewmh_SetWmIconFromPixmap): (EWMH_DeleteWmIcon): (EWMH_SetIconFromWMIcon): * fvwm/ewmh_intern.h: * fvwm/fvwm.h: * fvwm/icons.c (GetIcon): * fvwm/session.c (get_version_string): * fvwm/style.c (CMD_Style): * fvwm/style.h: (check_window_style_change) * fvwm/update.c (apply_window_updates): * fvwm/update.h: * fvwm/window_flags.h: New style EWMHMiniIconOverride / EWMHNoMiniIconOverride, EWMHDonateMiniIcon / EWMHDontDonateMiniIcon, EWMHDonateIcon / EWMHDontDonateIcon, Some ewmh icon code simplification. Ewmh icons priority: just after icon window. * fvwm/ewmh.c (EWMH_ExitStuff): * fvwm/ewmh.h: * fvwm/session.c (SaveWindowStates): (LoadWindowStates): (MatchWinToSM): * fvwm/fvwm.c (Done): Delete the ewmh icons we set ourself. Some ewmh session states do not need to be saved/restored anymore 2001-11-23 olicha * fvwm/ewmh_names.c (convert_charsets): Fixed infinite loop 2001-11-23 Dominik Vogt * fvwm/ewmh_names.c (convert_charsets): -Wall fix: 2nd parameter of iconv is char **, not const char ** as the man page states on Linux replaced goto with a loop 2001-11-22 olicha * fvwm/ewmh_icons.c (EWMH_SetWmIconFromPixmap): a -Wall fix * fvwm/ewmh_events.c: Fixed some styles update * fvwm/ewmh_conf.c: * fvwm/function.c (func_config): * fvwm/function.h: * fvwm/ewmh.c: * fvwm/ewmh.h: * fvwm/ewmh_events.c: * fvwm/ewmh_intern.h: * fvwm/Makefile.am: * fvwm/fvwm2.1: New file for ewmh styles and commands. New commands EWMHBaseStrut and EWMHNumberOfDesktops. More documentation in ewmh man page section. * fvwm/add_window.c: * fvwm/bindings.c: * fvwm/events.c: * fvwm/functions.c: * fvwm/ewmh.c (EWMH_Init): * fvwm/fvwm.h: * fvwm/fvwm.c (InitVariables): * fvwm/placement.c * fvwm/sceen.h: * fvwm/session.c: * fvwm/styles.c: * fvwm/update.c: * fvwm/update.h: * fvwm/window_flags.c: * libs/Bindings.c: * libs/Picture.c: * libs/Picture.h: * libs/fvwmlib.h: * configure.in: * acconfig.h: Remove all the HAVE_EWMH ifdef but the two in virtual.c (which are maybe problematic) and those in the ewmh* files to allow to disbale the ewmh code: with --disable-ewmh all the ewmh code should be dummy. --enable-ewmh is now the default. 2001-11-20 olicha * fvwm/icons.c (GetIcon): * fvwm/add_window.c (setup_icon): Fixed icons order choice and other minor bugs * fvwm/ewmh_icons.c (EWMH_SetWmIconFromPixmap): Fixed a core dump if there is no MiniIcon 2001-11-18 olicha * fvwm/ewmh.c (add_kst_item): * fvwm/ewmh.h: (ewmh_AddToKdeSysTray): (EWMH_IsKdeSysTrayWindow): (EWMH_ManageKdeSysTray): (EWMH_WindowInit): fvwm/ewmh_intern.h: * fvwm/events.c (HandleDestroyNotify): (HandleMapRequest): (HandleUnmapNotify): Fixed the KDE system tray implementation 2001-11-16 olicha * fvwm/ewmh.h: * fvwm/ewmh.c: fixed EWMH_WindowDestroyed and EWMH_DestroyWindow macros 2001-11-15 olicha * fvwm/ewmh.c (EWMH_DestroyWindow): * fvwm/ewmh.h: (EWMH_WindowDestroyed): * fvwm/events.c (HandleReparentNotify): (HandleDestroyNotify): (HandleUnmapNotify): * fvwm/add_window.c (destroy_window): Fixed the ewmh windows lists 2001-11-15 olicha * fvwm/Makefile.am: * fvwm/ewmh.c: * fvwm/ewmh.h: * fvwm/ewmh_intern.h: * fvwm/ewmh_events.c: * fvwm/ewmh_icons.c: * fvwm/ewmh_names.c: * fvwm/fvwm2.1: * NEWS: New files to achieve the extended WM hints support, off by default. This code is ifdefed a la gnome.c. This is work in progess (need to do so that every things are configurable). * configure.in: * acconfig.h (HAVE_EWMH, HAVE_ICONV, USE_LIBICONV, HAVE_CODSET): New configure option --enable-ewmh. Added tests for iconv and nl_langinfo for UTF8 conversions. * fvwm/add_window.c (AddWindow): (CaptureOneWindow): (destroy_window): (setup_window_name): (setup_icon): EWMH_SetWMState, EWMH_SetWMDesktop, EWMH_SetFrameStrut, EWMH_WindowDestroyed, EWMH_WMName, EWMH_SetVisibleName, SET_HAS_EWMH_ICON, EWMH_WMIconName * fvwm/add_window.c (setup_window_structure): * fvwm/fvwm.h (FvwmWindow): (window_flags): * fvwm/window_flags.h: * fvwm/session.c (get_version_string): (SaveWindowStates): (LoadWindowStates): Added some entries in FvwmWindow and some flags (more will be added). Some of these states need to be saved at restart and at recapture. This code is ifdefed, may be it should not: I was forced to ifdef the version string in get_version_string. * libs/Bindings.c (win_contexts): * libs/fvwmlib.h: * fvwm/events.c (GetContext): * fvwm/bindings.c (ParseBinding): (activate_binding): * fvwm/functions.c (expand_extended_var): (expand): (execute_function): (DeferExecution): * fvwm/screen.h (Scr): new context C_EWMH_DESKTOP named "D" for an ewmh desktop (kdesktop or Nautilus desktop). This context is something between C_ROOT and C_WINDOW. Added Scr.EwmhDesktop. * fvwm/bindings.c (activate_binding): Fixed immediate application of mouse/stroke bindings * fvwm/borders.h * fvwm/borders.c (RedrawDecorations): * fvwm/update.c (apply_window_updates): New function RedrawDecorations taken from apply_window_updates and called in ewmh_icons.c and update.c * fvwm/bultins.c (CMD_WindowShade): EWMH_SetWMState * fvwm/events.c (HandleFocusIn): (HandlePropertyNotify): (HandleClientMessage): (HandleMapRequestKeepRaised): (HandleUnmapNotify): EWMH_SetActiveWindow. Test for utf8 window and icon name, set the ewmh icon state. EWMH_ProcessPropertyNotify, EWMH_ProcessClientMessage, EWMH_SetClientList * fvwm/icons.c (GetIcon): * fvwm/icons.h: (CreateIconWindow): (ChangeIconPixmap): * fvwm/events.c (HandlePropertyNotify): New function GetIcon taken from CreateIconWindow which choose the icon, there is a new case for EWMH icons. New function ChangeIconPixmap taken from events.c. The two new functions are called from ewmh_icon.c (and icons.c). * fvwm/move_resize.c (handle_stick): (CMD_Maximize): (handle_stick): EWMH_SetWMState, EWMH_GetWorkAreaIntersection, EWMH_SetWMDesktop * libs/Picture.h: * libs/Picture.c (LoadPictureFromPixmap): (CachePictureFromPixmap): New functions for loading a picture from a pixmap. Nothing is cached but this simplify the MiniIcon code. * fvwm/placement.c (PlaceWindow): EWMH_GetWorkAreaIntersection * fvwm/screen.h (Scr): Added the working area, the dynamic working area and the ewmh Desktop window. * fvwm/stack.c (restack_windows): (CMD_Layer): EWMH_SetClientListStacking, EWMH_SetWMState * fvwm/style.c (check_window_style_change): * fvwm/update.c (apply_window_updates): * fvwm/update.h: Added do_update_list_skip to the update_win flags for EWMH_SetWMState. This code is ifdefed. * fvwm/style.c (lookup_style): EWMH_GetStyle * fvwm/virctual.c (goto_desk): (CMD_GotoDeskAndPage): (do_move_window_to_desk): EWMH_SetCurrentDesk, EWMH_SetWMDesktop 2001-11-10 Dominik Vogt * fvwm/update.c (apply_window_updates): * fvwm/gnome.c (GNOME_GetStyle): * fvwm/style.c (lookup_style): (check_window_style_change): * fvwm/add_window.c (setup_style_and_decor): fixed GnomeIgnoreHints style for some of the gnome hints * fvwm/fvwm.c (StartupStuff): Tried to fix font size problem * fvwm/placement.c (PlaceWindow): suppress an X error * fvwm/move_resize.c (moveLoop): * libs/Target.c (fvwmlib_keyboard_shortcuts): * fvwm/misc.c (Keyboard_shortcuts): modified keyboard shortcut functions so that it is possible to move windows with the keyboard even if the border is hit. does not work very nicely with paging * libs/Target.c (fvwmlib_keyboard_shortcuts): performance enhancement * fvwm/events.c (HandleButtonPress): fixed (?) some problem with passing the raise click in ctf to the app * fvwm/add_window.c (Reborder): * fvwm/virtual.c (MoveViewport): (MapDesk): (UnmapDesk): * fvwm/session.c (SaveWindowStates): * fvwm/fvwmdebug.c (DB_WI_WINDOWS): don't access stack_next and stack_prev directly but use the access functions from stack.h * fvwm/stack.c (remove_window_from_stack_ring): (add_window_to_stack_ring_after): safety patch * fvwm/add_window.c (adjust_fvwm_internal_windows): (destroy_window): when a window becomes scheduled for destruction, remove all traces of it from the fvwm internal variable so its not accessed accidentally when its fields are no longer valid 2001-11-05 Mikhael Goikhman * fvwm/borders.c: fixed compilation of I18N_MB 2001-10-30 Mikhael Goikhman * AUTHORS: * NEWS: * acconfig.h: * configure.in: * fvwm/borders.c: * fvwm/builtins.c: * fvwm/fvwm2.1: * fvwm/screen.h: exclude the TitleStyle MultiPixmap feature (only) before forking ... and restore it after that * NEWS: * configure.in: change version string to 2.5.0 * NEWS: added a missing entry for the stable release 2.4.0 (03-Jul-2001); added a link to the stable version 2.4.4 (not released yet) 2001-10-30 Mikhael Goikhman * NEWS: * configure.in: change version string to 2.4.4 before forking * make_fvwmdist.sh: strip end of line from date (adjust for a new length) 2001-10-29 olicha * fvwm/screen.h (DecorFaceStyle): Fixed the "lenght" of face_type if FANCY_TITLEBARS is defined, so that Solid colors work again 2001-10-28 olicha * fvwm/module_interface.c (skipModuleAliasToken): Allows '/' as alias character * NEWS Script news 2001-10-27 Mikhael Goikhman * configure.in: * acconfig.h: * NEWS: added --disable-multipixmap-titles for the Suzanne's patch, the default is enable * fvwm/fvwm2.1: some formatting fixes in TitleStyle entry 2001-10-27 Suzanne Britton * config.h.in: Added FANCY_TITLEBARS option, off by default * fvwm/fvwm2.1: Added info on TitleStyle MultiPixmap * fvwm/screen.h: [All changes #ifdeffed FANCY_TITLEBARS] Added TITLE_PADDING define for fancy titlebar rendering Added tb_pixmap_enum Added MultiPixmap to DecorFaceType enum Added Picture **multi_pixmaps and short multi_stretch_flags to DecorFace structure * fvwm/borders.c: [All changes #ifdeffed FANCY_TITLEBARS except the fix to RedrawButtons] (DrawButton): Handle UseTitleStyle where TitleStyle is MultiPixmap (RenderIntoWindow): [new] (DrawMultiPixmapTitlebar): [new] (RedrawButtons): Pass the left1right0 parameter properly to DrawButton, instead of always sending 1 (RedrawTitle): Call DrawFancyTitlebar for MultiPixmap style Skip DrawString calls for MultiPixmap style (title is drawn inside DrawMultiPixmapTitlebar) * fvwm/builtins.c: [All changes #ifdeffed FANCY_TITLEBARS] (FreeDecorFace): Free up multi_pixmaps array for a MultiPixmap decor (ReadDecorFace): Call ReadMultiPixmapDecor for a MultiPixmap TitleStyle (ReadMultiPixmapDecor): [new] 2001-10-26 Dan Espen * NEWS: FvwmForm: Customize pointers, support ISO_Tab key, buttons can activate on press or release, special pointer during grab, arrow key command recall. 2001-10-24 Mikhael Goikhman * fvwm/bindings.c (ParseBinding): * fvwm/bindings.h: * fvwm/fvwm2.1: binding commands now do not print error messages with Silent * fvwm/ConfigFvwmDefaults: * NEWS: don't use ReverseOrder in the default Alt-Tab like it was in 2.4.0; use Silent before Key Help * fvwm/add_window.c: changed the broken size hints message to notify the owner * docs/fvwm.lsm.in: small changes 2001-10-19 olicha * NEWS: Some FvwmScript news 2001-10-16 olicha * NEWS: Some FvwmScript news 2001-10-15 Dominik Vogt * fvwm/bindings.c (activate_binding): * libs/Bindings.c (GrabWindowKeyOrButton): activate mouse/stroke bindings immediately * fvwm/events.c (HandleButtonPress): it is possible to bind actions to the 'ClickToFocus' click 2001-10-14 Dominik Vogt * fvwm/virtual.c (HandlePaging): allow paging during move/resize when pressing keys * libs/XResource.c (MergeCmdLineResources): possible core dump fix * fvwm/add_window.c (setup_window_placement): fixed core dump * libs/Bindings.c (AddBinding): another attempt at cleaning up bindings with "Shift" 2001-10-13 olicha * NEWS FvwmScript news 2001-10-10 Mikhael Goikhman * move_resize.c: * fvwm/fvwm2.1: OpaqueMoveSize now accepts "unlimited" or negative argument. 2001-10-09 Mikhael Goikhman * fvwm/fvwm2.1: added missing "!" 2001-10-08 Dan Espen * libs/Makefile.am (libfvwm_a_SOURCES): Add new file. * libs/fvwmlib.h: * libs/Cursor.c: Create new libs function fvwmCursorNameToIndex. * fvwm/cursor.c: Extract cursor validation routine to become a libs routine. 2001-10-08 Dominik Vogt * NEWS, configure.in: changed version to 2.5.0 2001-10-08 olicha * fvwm/borders.c (RedrawTitle): Fixed drawing of leftJustified stippled title and suppress warnings in RelieveRectangle w/ RightJustified stippled title 2001-10-05 Dominik Vogt * fvwm/virtual.c (CMD_XineramaSlsSize): fixed ABR 2001-10-03 olicha * fvwm/style.c (CMD_Style): * fvwm/fvwm2.1 Added the possibility to add an Xinerama screen to the 4 numerics Iconbox format 2001-10-03 olicha * fvwm/icons.c (AutoPlaceIcon): Fixed a core dump with @c and fixed icon placement if the icon should not be on the current page 2001-10-02 Dominik Vogt * fvwm/icons.c (AutoPlaceIcon): * libs/FScreen.c (FScreenParseScreenBit): added 'w' screen specifier for icon boxes * fvwm/icons.c (AutoPlaceIcon): fixed placement of icons in icon boxes on different screen * fvwm/menus.c (get_menu_options): reduced code duplication 2001-10-02 olicha * fvwm/menus.c (get_menu_options): fixed Xinerama placement of menu with empty but not null position hints 2001-10-02 Dominik Vogt * fvwm/borders.c (RedrawTitle): * libs/defaults.h (WINDOW_TITLE_STICKY_GAP): suppress a warning in RelieveRectangle w/ small sticky windows 2001-09-30 Dominik Vogt * fvwm/menus.c (get_menu_options): A 'rectangle' context rectangle for menus honours the '@screen' bit * fvwm/move_resize.c (DisplayPosition): coordinates of a window are show in relation to the screen, not the page * libs/FScreen.c (FScreenTranslateCoordinates): * fvwm/placement.c (PlaceWindow): * fvwm/add_window.c (setup_window_placement): Applied patches by Sidik Isani that adds the "fvwmscreen" X resource; rewrote the library functionality to better match the rest of the interface * fvwm/builtins.c (DestroyFvwmDecor): removed useless code * fvwm/icons.c (DrawIconWindow): fixed race condition w/ expanding/collapsing icon titles * fvwm/windowlist.c (CMD_WindowList): fixed Xinerama placement of window list when called without options 2001-09-19 Dominik Vogt * libs/FScreen.c (FScreenSLSOnOff): fixed core dump when calling XineramaSls before XineramaSlsSize * configure.in: changed to 2.4.3 * libs/FShape.h (FHaveShapeExtension): set macro to 1 when compiling w/ shape extension 2001-09-17 Dominik Vogt * libs/Bindings.c (AddBinding): * fvwm/bindings.c (ParseBinding): print a warning if a key with the given name does not exist if there is an upper and a lower case version of the same key name, always bind to the lower case version; this is problematic if the upper case version is tied to a key without a modifier and the lower case version is tied to the same key, but with a modifier (or both are tied to different keys). I hope this good enough. * libs/Bindings.c (FreeBindingList): (MatchBindingExactly): (CollectBindingList): fixed some problems overriding keys reduced duplication of logic 2001-09-16 Dominik Vogt * NEWS, configure.in: changed version to 2.5.0 2001-09-16 Dominik Vogt * configure.in: changed version to 2.4.2 2001-09-16 Dominik Vogt * libs/Colorset.c: (SetWindowBackground): (SetRectangleBackground): * fvwm/builtins.c (CMD_WindowShade): * fvwm/add_window.c: (setup_style_and_decor): * fvwm/icons.c: (CreateIconWindow): (GetXPMFile): (GetIconWindow): (GetIconBitmap): * fvwm/events.c: (HandleConfigureRequest): (HandleShapeNotify): (InitEventHandlerJumpTable): * fvwm/borders.c (struct): (SetupFrame): (SetShape): * fvwm/decorations.c (SelectDecor): * fvwm/fvwm.c: (main): (setVersionInfo): * fvwm/externs.h: * fvwm/fvwm.h (FvwmWindow): * libs/FShape.h: * libs/FShape.c: moved shape support to library; its no longer necessary to '#ifdef SHAPE' any code * fvwm/borders.c (RedrawButtons): (RedrawTitle): fixed top border hilight drawing of title buttons * libs/Graphics.c (do_relieve_rectangle): (RelieveRectangle): (RelieveRectangle2): allow alternate shading for title buttons 2001-09-15 Dominik Vogt **/*.1: Applied man page patch by Dmitry Yu. Bolkhovityanov: Add a formal description of how fvwm maintains module's configs Change manpages of individual modules to refer to fvwm2(1) for details about specifying configuration * fvwm/add_window.c (setup_window_placement): desk and page can now really be given as X resources a la xterm.desk: 1 * libs/XResource.c (GetResourceString): resource -> lower case, class -> upper case changed signature * configure.in: changed version to 2.5.0 * Makefile.am (distcheck2): build distcheck before dist2; save a few seconds if the build fails * libs/alloca.c: * libs/ClientMsg.c: * libs/envvar.c: * libs/Event.c: * libs/fvwmrect.c: * libs/gethostname.c: * libs/Grab.c: * libs/Pointer.c: * libs/safemalloc.c: * libs/strcasecmp.c: * libs/strdup.c: * libs/strerror.c: * libs/strncasecmp.c: * libs/usleep.c: * libs/wild.c: * libs/WinMagic.c: * libs/XError.c: * libs/Graphics.c: include config.h * configure.in: changed version to 2.4.1 again 2001-09-14 Dominik Vogt * libs/Bindings.c (FvwmStringToKeysym): try both cases of the first letter of a key name * fvwm/ConfigFvwmDefaults: * fvwm/windowlist.c (winCompareReverse): (CMD_WindowList): new WindowList option ReverseOrder; use the new option in the default Alt-Tab binding. This makes it possible to hit Alt-Tab repeatedly to cycle through the whole window list. The old behaviour only toggled between two windows. Also, a simple Alt-Tab can be used to switch to the next window instead of Alt-Tab-Tab. * libs/FScreen.c (FScreenInit): fixed a Xinerama crash * configure.in: print a verbose error message and exit if X11 headers and libraries are not found 2001-09-13 Dominik Vogt * fvwm/fvwm.c (main): * libs/FShape.c: * libs/FShape.h: new library for X shape encapsulation * fvwm/builtins.c (CMD_WindowShade): * fvwm/borders.c (SetupFrame): fixed shading of windows without title and border fixed shading of shaped windows; fixes bug #732 * fvwm/builtins.c (CMD_SetEnv): calling SetEnv without a value is the same as UnsetEnv 2001-09-10 Dominik Vogt * fvwm/events.c (HandleReparentNotify): fixed vanishing windows in rapid map/unmap cycles; bug #770 * fvwm/add_window.c (hide_screen): fixed possible BadWindow error 2001-09-09 Dominik Vogt * fvwm/virtual.c (MoveViewport): (goto_desk): (CMD_GotoDeskAndPage): (CMD_GotoPage): GotoDeskAndPage records its own history of last visited desk/page * libs/FScreen.c (FScreenInit): fixed a memory allocation bug pointed out by Giuseppe Della Ricca 2001-09-05 olicha * fvwm/session.c (MatchWinToSM): * fvwm/add_window.c (setup_window_structure): * fvwm/move_resize.c (moveLoop): Fixed PlacedByButton3 condition 2001-09-05 Dominik Vogt * libs/FScreen.c: * fvwm/functions.c (func_config): * fvwm/module_interface.c (broadcast_xinerama_state): * fvwm/virtual.c (CMD_Xinerama): (CMD_XineramaPrimaryScreen): (CMD_XineramaSls): (CMD_XineramaSlsSize): added sls support split Xinerama command into Xinerama, XineramaPrimaryScreen, XineramaSls and XineramaSlsSize restructured parts of the FScreen code * fvwm/functions.c (func_config): new commands XineramaPrimaryScreen, XineramaSls and XineramaSlsSize * libs/Graphics.c (RelieveRectangle): allow calling the function with w == 0 or h == 0 without a message * fvwm/window_flags.h (SET_STYLE_DELETED): * fvwm/style.c (CMD_DestroyStyle): (check_window_style_change): * fvwm/fvwm.h (window_style): update windows when a style is deleted * configure.in: fixed xpm detection problem caused by wrong library order 2001-09-05 olicha * NEWS: PlacedByFvwm 2001-09-04 Dan Espen * fvwm/fvwm2.1 (PlacedByFvwm): Grammar. 2001-09-04 olicha * fvwm/fvwm.h: * fvwm/windows_flags.h: * fvwm/placement.c (PlaceWindow): * fvwm/add_window.c (setup_window_structure): * fvwm/conditional.c (CreateConditionMask): * fvwm/session.c (get_version_string): (MatchWinToSM): * fvwm/fvwm2.1: Added a new windows_flags is_placed_by_fvwm and a new condition PlacedByFvwm 2001-09-03 Dominik Vogt * fvwm/focus.c (focus_grab_buttons): (MoveFocus): disabled xt/double click patch for now 2001-09-01 Dominik Vogt * libs/Graphics.c (RelieveRectangle): print a warning if one of the dimensions is <= 0 * fvwm/placement.c (PlaceWindow): take care of windows that have both, PPosition and USPosition set take care of transient windows that have neither PPosition nor USPosition set 2001-09-01 olicha * libs/FScreen.c (FScreenInit): Fixed the position of the xinerama emulation delimiters 2001-08-31 Dominik Vogt * fvwm/fvwm2.1: Xinerama introduction * fvwm/icons.c (AutoPlaceIcon): try to place icons of screen with the window center, and if that fails on any screen * libs/FScreen.c (FScreenGetScrRect): performance improvement for non-xinerama systems * fvwm/update.c (apply_window_updates): (flush_window_updates): update icon boxes and icon position when xinerama layout changes * fvwm/icons.c (AutoPlaceIcon): limit placement of icons using no icon box to screen boundaries adapt icon boxes to xinerama layout whenever used * fvwm/placement.c (PlaceWindow): * fvwm/style.c (CMD_Style): (check_window_style_change): * fvwm/style.h (SUSE_NO_USPOSITION): (SUSE_NO_TRANSIENT_PPOSITION): (SUSE_NO_TRANSIENT_USPOSITION): * fvwm/fvwm.h (struct): implemented new styles NoUSPosition/UseUSPosition, NoTransientPPosition/UseTransientPPosition, NoTransientUSPosition/UseTransientUSPosition. These work exactly like NoPPosition/UsePPosition. Transient windows ignore the window position if neither the PPosition nor the USPosition hint is set. 2001-08-28 Dominik Vogt * fvwm/focus.c (restore_focus_after_unmap): fixed a bug transfering the focus when a window was iconified 2001-08-26 Dominik Vogt * fvwm/conditional.c (MatchesConditionMask): * fvwm/move_resize.c (position_geometry_window): * fvwm/placement.c (PlaceWindow): * fvwm/menus.c (pop_menu_up): * fvwm/move_resize.c (move_window_doit): * fvwm/icons.c (do_all_iconboxes): * fvwm/placement.c (PlaceWindow): * fvwm/menus.c (update_menu): adapted to new FScreen... signatures * libs/FScreen.c (FScreenClipToScreen): (FScreenGetScrCenterCenter): (FScreenCenterCurrent): (FScreenCenterPrimary): (FScreenGetCurrent00): (FScreenGetGlobalScrRect): (FScreenGetPrimaryScrRect): (FScreenGetScrRect): (FScreenIsRectangleOnScreen): unified all the FSCreen... functions using a common signature, removed most old functions * fvwm/style.c (CMD_Style): init icon box screen * fvwm/move_resize.c (move_window_doit): (CMD_Maximize): * libs/Makefile.am: * libs/XineramaSupport.c: * libs/XineramaSupport.h: * libs/FScreen.c: exported and renamed screen defines * libs/FScreen.h: renamed files * fvwm/virtual.c: * fvwm/style.c: * fvwm/placement.c: * fvwm/move_resize.c: * fvwm/module_interface.c: * fvwm/modconf.c: * fvwm/menus.c: * fvwm/icons.c: * fvwm/fvwm.c: * fvwm/conditional.c: * libs/XineramaSupport.c: renamed all XineramaSupport...() functions to FScreen...() * fvwm/style.c (CMD_Style): -Wall fix 2001-08-25 Dan Espen * fvwm/style.c (CMD_Style): * fvwm/fvwm.h (icon_boxes_struct): Add screen to iconbox struct when using geometry spec. 2001-08-25 Mikhael Goikhman * libs/Strings.c: * libs/Strings.h: new function QuoteString() to add and escape single quotes to strings * fvwm/menus.c (MenuInteraction): quote both missing function name and menu name for MissingSubmenuFunction * fvwm/functions.c (expand): use QuoteString() 2001-08-25 Dan Espen * fvwm/style.c (CMD_Style): Fix up iconboxes using negative geom specs. 2001-08-25 Dominik Vogt * fvwm/cursor.c (CMD_CursorStyle): * fvwm/icons.c (GetXPMFile): * libs/Colorset.c (SetWindowBackground): -Wall fixes * libs/Bindings.c (AddBinding): tired to help with problem binding keys that have a keycode with no modifiers and another keycode with some modifiers pressed, e.g. kc 95 = F11, kc 67 = F1, kc 67 + shift = F11, which caused pressing F1 generating the actioon bound to F11 sometimes * fvwm/focus.c (focus_grab_buttons): -Wall fix 2001-08-23 Dan Espen * libs/Bindings.c (MatchBinding): Unify XDisplayKeycodes avoidance. 2001-08-20 Bob Woodside * fvwm/focus.c (MoveFocus, focus_grab_buttons): Fixed passive button grab synchronization so apps using XtTranslations to catch double- clicks don't get confused by extraneous Leave/EnterNotify events. This fixes the "xfm/moxfm don't see double-clicks" problem. 2001-08-20 Dan Espen * fvwm/icons.c (AutoPlaceIcon): Fix bug. 2001-08-19 Dan Espen * fvwm/icons.c (AutoPlaceIcon): Apply screen dimensions as icon is placed. * fvwm/style.c (CMD_Style): Don't apply screen dimensions to iconbox until later when the window is actually placed. * fvwm/fvwm.h (icon_boxes_struct): Save sign for later screen position calculation. 2001-08-19 Dominik Vogt * fvwm/update.c (flush_window_updates): * fvwm/screen.h (ScreenInfo): * fvwm/virtual.c (CMD_Xinerama): * fvwm/move_resize.c (CMD_Maximize): * fvwm/placement.c (PlaceWindow): * libs/XineramaSupport.c (XineramaSupportGetNumberedScrRect): renamed function * fvwm/fvwm2.1: describe new maximize options * fvwm/move_resize.c (MaximizeWidth): (MaximizeHeight): (CMD_Maximize): applied Dmitry's Xinerama patch for Maximize command replaced "global" and "absolute" with "screen" which is more flexible 2001-08-16 Dominik Vogt * libs/Parse.c (SkipQuote): fixed a bug in handling of caller specified quote pairs * fvwm/move_resize.c (CMD_Maximize): keep window on correct page when viewport does not start on a page boundary * libs/XError.c (error_name): (request_name): fixed core dump in error handling 2001-08-15 Mikhael Goikhman * configure.in: * acinclude.m4: * INSTALL: * INSTALL.fvwm: renamed --disable-gnome to --disable-gnome-hints; documented configure options --with-gnome*; small improvements in documentation; use underscore in version instead of dash that causes rpm problems 2001-08-14 Mikhael Goikhman * libs/Makefile.am: added fvwmrect.h to dist 2001-08-14 Dan Espen * libs/XineramaSupport.c: Disable debug printing. 2001-08-13 Dominik Vogt * libs/defaults.h (DEFAULT_MENU_STYLE): reset colour sets in default menu style too 2001-08-13 Mikhael Goikhman * builtins.c: * events.c: completed the libstroke-0.5 compatibility fix 2001-08-10 Dominik Vogt * fvwm/move_resize.c (draw_move_resize_grid): fixed drawing of resize grid when invoked from button or key press * fvwm/placement.c (PlaceWindow): rewrote a condition to improve readability fixed StartsOn... w/ SkipMapping 2001-08-09 Dominik Vogt * fvwm/session.c (MatchWinToSM): (LoadWindowStates): (SaveWindowStates): * fvwm/move_resize.c (CMD_Resize): * fvwm/events.c (HandlePropertyNotify): (HandleConfigureRequest): * fvwm/move_resize.c (CMD_ResizeMove): (CMD_Maximize): (CMD_Resize): * fvwm/update.c (apply_window_updates): * fvwm/add_window.c (AddWindow): * fvwm/geometry.c (constrain_size): (gravity_constrain_size): the Resize command honors the window gravity changing the size increment of maximized windows no longer shrinks the window * fvwm/icons.c: keep expanded icon titles on screen 2001-08-08 Dominik Vogt * fvwm/icons.c (do_all_iconboxes): default icon box fills the primary screen * libs/XineramaSupport.c (XineramaSupportParseScreenBit): fixed default_screen argument * fvwm/style.c (merge_styles): * fvwm/fvwm.h (window_style): * fvwm/style.h (SSET_START_SCREEN): * fvwm/add_window.c (setup_window_placement): * fvwm/placement.c (PlaceWindow): (CMD_PlaceAgain): implemented StartsOnScreen style * fvwm/placement.c (PlaceWindow): (test_fit): (get_next_x): (get_next_y): (CleverPlacement): (SmartPlacement): Place new windows on xinerama screens * libs/XineramaSupport.c (XineramaSupportParseGeometryWithScreen): fixed core dump in debug output 2001-08-07 Dominik Vogt * fvwm/placement.c: removed unused variable 2001-08-07 olicha * NEWS: FvwmIconBox, FvwmTaskBar and FvwmWinList support aliases 2001-08-06 Dominik Vogt * fvwm/virtual.c (CMD_Xinerama): replaced XineramaEnable and ...Disable with XineramaCommand * libs/XineramaSupport.c (XineramaSupportParseScreenBit): (XineramaSupportGetScreenArgument): new functions * fvwm/functions.c (func_config): * fvwm/move_resize.c (move_window_doit): (CMD_Move): (CMD_AnimatedMove): (CMD_MoveToPage): (CMD_MoveToScreen): (handle_stick): added new command MoveToScreen 2001-08-05 Dominik Vogt * libs/fvwmrect.c: * libs/fvwmrect.h: new library files * libs/XineramaSupport.c (XineramaSupportParseGeometry): fixed parsing of negative geometries (XineramaSupportParseGeometryWithScreen): made global (XineramaSupportGetNumberedScreenRect): new function * sample.fvwmrc/system.fvwm2rc: * sample.fvwmrc/new-features: * sample.fvwmrc/system.fvwm2rc-sample-95: * sample.fvwmrc/system.fvwm2rc-sample-2: * sample.fvwmrc/system.fvwm2rc-sample-1: * fvwm/fvwm2.1: updated for new condition * fvwm/conditional.c (CreateConditionMask): (MatchesConditionMask): * fvwm/fvwm.h (WindowConditionMask): implemented new condition AcceptsFocus to cope with applications like xclock that have circulatehit but don't take focus 2001-08-02 Dominik Vogt * libs/XineramaSupport.c (XineramaSupportParseGeometry): handle Xinerama screens * fvwm/style.c (CMD_Style): * fvwm/menus.c (get_menu_options): cope with Xinerama like geometries with screen info * fvwm/virtual.c (CMD_XineramaEnable): XineramaEnable optionally takes the number of the primary screen as its argument * fvwm/events.c (GetContext): reindented code * fvwm/virtual.c (HandlePaging): * fvwm/events.c (HandleButtonPress): * fvwm/events.h (XEVMASK_PANFW): fixed button and key event handling over pan frames; fixes bug #752 * fvwm/menus.c (get_menu_options): fixed Xinerama placement of menus without options 2001-08-01 Mikhael Goikhman * NEWS: * fvwm/borders.c: * fvwm/builtins.c: * fvwm/fvwm.c: * fvwm/screen.h: Color enhancements in button vectors: @2 is bg color, @3 is fg color. In addition to the existing: @0 is shadow color, @1 is hilight color. * fvwm/fvwm2.1: Added the formal description of Vector that was absent. 2001-08-01 Dominik Vogt * fvwm/fvwm2.1: some man page corrections 2001-07-30 Dominik Vogt * fvwm/move_resize.c (handle_stick): also redraw buttons when a window becomes sticky/slippery to make sure that MWMDecorStick buttons are updated too; fixes bug #749 2001-07-30 Mikhael Goikhman * NEWS: documented previous changes * configure.in: improved output spacing * fvwm/fvwm2.1: minor typo 2001-07-29 Dominik Vogt * libs/XineramaSupport.c (XineramaSupportConfigureModule): * fvwm/modconf.c (send_xinerama_state): * fvwm/module_interface.c (broadcast_xinerama_state): * libs/defaults.h: revised module support for Xinerama * libs/XineramaSupport.c (XineramaSupportParseGeometryWithScreen): (XineramaSupportParseGeometry): (XineramaSupportGetGeometry): make interface compatible with XineramaSupportParseGeometry(). (XineramaSupportGetPrimaryScreen): new function * fvwm/stack.c (raise_over_unmanaged): fixed restacking of windows with RaiseOverUnmanaged - windows were raised in reverse order so that the top window became the bottom window of the ones that were raised also, ignore Scr.NoFocusWin and all InputOnly windows for raising since these are invisible 2001-07-28 Dominik Vogt * sample.fvwmrc/system.fvwm2rc-sample-95: fixed syntax of BugOpts command * fvwm/ConfigFvwmDefaults: resize window when clicking on the sides of the window by default instead of moving it * fvwm/events.c (HandleEnterNotify): do not delete MouseFocus when pointer moves from one particular sub window of a frame to another one. Helps with xv/xmms vs unclutter interaction and also with MouseFocus vs. Open Look applications * fvwm/move_resize.c (DoSnapAttract): * libs/XineramaSupport.c (XineramaSupportGetResistanceRect): fixed snapping to Xinerama screen edges (XineramaSupportIsEnabled): return False is the X server provides only a single screen * fvwm/fvwm2.1: Added descriptions of conditions CurrentDesk, CurrentPage, CurrentScreen, CurrentGlobalPage, CurrentPageAnyDesk and CurrentGlobalPageAnyDesk * fvwm/fvwm.h (rectangle): (position): typedefs moved to libs/fvwmlib.h * fvwm/conditional.c (MatchesConditionMask): * fvwm/fvwm.h (WindowConditionMask): * fvwm/conditional.c: introduced new conditions CurrentGlobalPage and CurrentGlobalPageAnyDesk for Xinerama support * fvwm/modconf.c (CMD_Send_ConfigInfo): (send_xinerama_state): * fvwm/module_interface.c (broadcast_xinerama_state): * libs/XineramaSupport.c (XineramaSUpportIsEnabled): * libs/defaults.h (DEFAULT_XINERAMA_DISABLED): communicate xinerama state at module startup 2001-07-27 Dominik Vogt * libs/XineramaSupport.c: next Xinerama patch 2001-07-25 Dominik Vogt * fvwm/move_resize.c (moveLoop): windows were lost off screen w/ non opaque interactive move when motion was aborted with Escape on a different page that it was started * fvwm/move_resize.c (position_geometry_window): (DisplayPosition): (DisplaySize): (InteractiveMove): (CMD_Resize): (moveLoop): (CMD_Resize): (DoResize): * libs/XineramaSupport.c (GetMouseXY): (XineramaSupportCenterCurrent): (XineramaSupportGetCurrent00): (XineramaSupportGetCurrentScrRect): allow to pass in an event with the pointer position minimize number of XQueryPointer calls in interactive move/resize * libs/defaults.h: * fvwm/move_resize.c (resize_geometry_window): (DisplayPosition): (DisplaySize): border width of geometry window moved to defaults.h moved strings for size window formatting to defaults.h reworked calculations of geometry window dimensions * fvwm/move_resize.c (resize_geometry_window): (position_geometry_window): (DisplaySize): (InteractiveMove): (CMD_Resize): * fvwm/builtins.c (ApplyDefaultFontAndColors): * fvwm/fvwm.c (main): funtions ResizeSizeWindow and PositionSizeWindow renamed to resize_geometry_window and position_geometry_window * fvwm/fvwm.c (main): fixed resizing geometry window before creating it * fvwm/move_resize.c (switch_move_resize_grid): (MoveOutline): * fvwm/virtual.c (HandlePaging): renamed MoveOutline to draw_move_resize_grid and made static new function switch_move_resize_grid for external calls delete grid before moving the geometry window to get rid of arifacts of the grid 2001-07-24 Dominik Vogt * libs/XineramaSupport.c (XineramaSupportInit): make the blank area in Xinerama emulation usable again 2001-07-23 Dominik Vogt * fvwm/menus.c (update_menu): (pop_menu_up): (make_menu): (calculate_item_sizes): (size_menu_horizontally): (size_menu_vertically): menus are resized to fit their Xinerama screen every time they are popped up and the screen size has changed 2001-07-23 olicha * libs/XineramaSupport.c (XineramaSupportInit): Draw the xinerama simulation screens with orr windows 2001-07-23 Dominik Vogt * fvwm/windowlist.c (CMD_WindowList): fixed windowlist placement w/ Xinerama 2001-07-22 Dominik Vogt * fvwm/menus.c (pop_menu_up): fixed calculations that force a menu on screen w/ Xinerama * fvwm/move_resize.c (DoSnapAttract): removed some code that slipped in with xinerama patch and broke vertical SnapAttraction * fvwm/virtual.c (CMD_EdgeResistance): removed debug code * libs/XineramaSupport.c (XineramaSupportClipToScreen): take reference position src_x/src_y to determine screen * fvwm/windowlist.c (CMD_WindowList): * fvwm/menus.c (get_menu_options): (get_popup_options): (MenuInteraction): (pop_menu_up): handle Xinerama screens for positioning menus w/ posthints * fvwm/menus.c (get_menu_options): renamed function fix for icon/window context rectangle when window is in wrong state 2001-07-22 Mikhael Goikhman * configure.in: s/XINERAMA/HAVE_XINERAMA/, now #ifdef'd xinerama code is finally ever compiled in; fixed linking by adding -lXinerama; small corrections 2001-07-22 Dan Espen * fvwm/fvwm2.1: Remove some test code, fix remaining .IP commands. 2001-07-22 Dominik Vogt * libs/XineramaSupport.c (XineramaSupportInit): added xinerama emulation for developers * fvwm/virtual.c (CMD_XineramaEnable): (CMD_XineramaDisable): * fvwm/module_interface.c (BroadcastConfigInfoString): added function to communicate Xinerama on/off to modules * fvwm/module_interface.c: include time.h to fix warning * libs/XineramaSupport.c: * fvwm/fvwm.c (setVersionInfo): * fvwm/Makefile.am: * configure.in: * acconfig.h: cleanded up xinerama detection added shape detection 2001-07-21 Dominik Vogt * fvwm/fvwm2.1: Added Xinerama introduction * fvwm/fvwm.c (setVersionInfo): print xinerama support * fvwm/conditional.c (CreateConditionMask): added CirculateHitShaded option for conditional commands that was described in the man page but not implemented * fvwm/fvwm.h (WindowConditionMask): removed unused flags * fvwm/conditional.c (MatchesConditionMask): fixed CirculateHitIcon option in conditional commands * fvwm/fvwm2.1: reformatted man page source to improve readability fixed some source formatting bugs * libs/XineramaSupport.c (GetMouseXY): don't poll the pointer if there is only one screen or if xinerama is turned off * fvwm/fvwm2.1: * fvwm/fvwm.c (main): removed -noxinerama option * fvwm/fvwm.c (main): size window is positioned and sized in move_resize.c * libs/XineramaSupport.c: reindented file * configure.in: print Xinerama support in configure summary * **/*: applied Xinerama patch by Dmitry Yu. Bolkhovityanov 2001-07-17 Mikhael Goikhman * acconfig.h: * acinclude.m4: * configure.in: implemented a new convenient autoconf macro mg_DEFINE_IF_NOT; define missing macros needed for old AIX keysymdef and old stroke.h * fvwm/bindings.c: * fvwm/menus.c: remove the previous compilation fixes, now handled by configure 2001-07-15 Dan Espen * fvwm/fvwm2.1: Remove .BI with more than 6 args. 2001-07-15 Mikhael Goikhman * bindings.c: use libstroke-0.5 constant names while still supporting 0.3/0.4 * menus.c: compiling fix for old AIX, which does not define XK_Page_Up/Down * module_interface.c: minor compiling fix for some proprietary preprocessors 2001-07-10 Mikhael Goikhman * fvwm/fvwm2.1: use more compatible and structured syntax in SYNOPSIS 2001-07-06 Mikhael Goikhman * acinclude.m4: Replaced forgotten instances of IMLIB_CFLAGS and IMLIB_LIBS to GDK_IMLIB_*. This fixes "make FvwmGtk" on systems with bogus imlib-config. 2001-07-05 Mikhael Goikhman * configure.in: changed version to 2.4.1 * acinclude.m4: small fix that should solve the problem with running autoconf (autoreconf is ok) from autoconf-2.50; applied a patch that adds gtk include dirs to gnome include dirs 2001-07-03 Dominik Vogt * NEWS, configure.in: changed version to 2.4.0.1 * *: fvwm 2.4 has been released :-)) fvwm-2.6.5.orig/configure.ac0000644000175000017500000015732711744240525014133 0ustar vwcvwcdnl Process this file with autoconf to produce a configure script. dnl AC_PREREQ(2.60) AC_INIT(fvwm/fvwm.c) dnl should be "yes" only within the released distribution ISRELEASED=yes version=2.6.5 VERSIONINFO="" dnl date of the released version (please zero pad the day in the last 2 dates) dnl for example: "4 February 2003", "04 Feb 2003", "2003-02-04" dnl date format strings: "%e %B %Y", "%d-%b-%Y", "%Y-%m-%d" RELDATELONG="20 April 2012" RELDATESHORT="02-Apr-2012" RELDATENUM="2012-04-20" # constant variable settings FVWMNAMELONG="F? Virtual Window Manager" FVWMHOMEPAGE="http://fvwm.org/" FVWMFTP="ftp.fvwm.org" FVWMFTPDIR="/pub/ftp" FVWMALTFTP="metalab.unc.edu" FVWMALTFTPDIR="/pub/Linux/X11/window-managers/" FVWMLIST="fvwm@fvwm.org" FVWMWORKERSLIST="fvwm-workers@fvwm.org" FVWMWORKERSLISTLONG="fvwm workers list " MANPAGE_PREAMBLE='.\" WARNING: This file was automatically generated. Edit the .in file instead.' if test ! x"$ISRELEASED" = xyes; then VERSIONINFO=" (from cvs)" RELDATELONG="(not released yet)" RELDATESHORT="(not released yet)" RELDATENUM="(not released yet)" # # migo: unfortunately this nice idea can not work, it is not updated. # # I will think more about this, maybe autoconf-2.50+ has a solution. # if test -d CVS/ -a -f CVS/Entries && \ # date +%Y-%m-%d -d 'Wed Sep 4 12:36:50 2002' >/dev/null 2>&1 # then # # this is not the exact date, but better than the current date # for file in CVS/Entries */CVS/Entries; do # changelog_date="`cat $file | grep /ChangeLog/ \ # | cut -d/ -f4`" # test ! x"$changelog_date" = x && \ # date +%Y-%m-%d -d "$changelog_date" >>changelog_dates # done # changelog_date=`cat changelog_dates | sort -r -u | head -1` # VERSIONINFO=" (from cvs $changelog_date)" # rm -f changelog_dates # fi fi AC_SUBST(ISRELEASED) AH_TEMPLATE([VERSIONINFO],[Additional version information, like date]) AC_DEFINE_UNQUOTED(VERSIONINFO, "$VERSIONINFO") AC_SUBST(VERSIONINFO) AC_SUBST(RELDATELONG) AC_SUBST(RELDATESHORT) AC_SUBST(RELDATENUM) AC_SUBST(FVWMNAMELONG) AC_SUBST(FVWMHOMEPAGE) AC_SUBST(FVWMFTP) AC_SUBST(FVWMFTPDIR) AC_SUBST(FVWMALTFTP) AC_SUBST(FVWMALTFTPDIR) AC_SUBST(FVWMLIST) AC_SUBST(FVWMWORKERSLIST) AC_SUBST(FVWMWORKERSLISTLONG) AC_SUBST(MANPAGE_PREAMBLE) AM_INIT_AUTOMAKE(fvwm, ${version}) AM_CONFIG_HEADER(config.h) # check for programs needed to build html docs AC_CHECK_PROG(SED, sed, sed, "") AC_SUBST(SED) #!!! PERL="" REQUIRED_PERL_VERSION=5.004 AC_SUBST(REQUIRED_PERL_VERSION) if test x"$PERL" = x; then AC_PATH_PROG(PERL, perl) fi if test ! x"$PERL" = x; then AC_MSG_CHECKING([for perl $REQUIRED_PERL_VERSION or better]) HAVE_PERL_FOR_DOCS=1 if ("$PERL" -e "require $REQUIRED_PERL_VERSION;") 2>/dev/null; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_MSG_WARN([$PERL not found or too old]) fi else HAVE_PERL_FOR_DOCS=0 AC_MSG_WARN([perl is not found, it is required for some scripts and modules]) AC_MSG_WARN([It is recommended to install perl $REQUIRED_PERL_VERSION or better later]) PERL=/usr/bin/perl fi AC_MSG_RESULT([assuming $PERL as perl location]) AC_SUBST(PERL) # installation paths FVWM_MODULESUBDIR=/${PACKAGE}/${VERSION} FVWM_DATASUBDIR=/${PACKAGE} FVWM_DOCSUBDIR=/doc/${PACKAGE} AC_ARG_ENABLE(package-subdirs, AS_HELP_STRING([--disable-package-subdirs], [do not create subdirs for modules and data]), [if test x"$enableval" = xno; then FVWM_MODULESUBDIR=""; FVWM_DATASUBDIR=""; fi], []) FVWM_MODULEDIR='${libexecdir}'"$FVWM_MODULESUBDIR" FVWM_DATADIR='${datadir}'"$FVWM_DATASUBDIR" FVWM_DOCDIR='${datadir}'"$FVWM_DOCSUBDIR" FVWM_PERLLIBDIR='${datadir}'"$FVWM_DATASUBDIR/perllib" FVWM_CONFDIR='${sysconfdir}'dnl used _only_ to search for system.fvwm2rc AC_SUBST(FVWM_MODULEDIR) AC_SUBST(FVWM_DATADIR) AC_SUBST(FVWM_PERLLIBDIR) AC_SUBST(FVWM_CONFDIR) AC_SUBST(FVWM_DOCDIR) AH_TEMPLATE([FVWM_CONFIG], [Name of config filenames in FVWM_USERDIR and FVWM_DATADIR]) AC_DEFINE(FVWM_CONFIG, "config") AH_TEMPLATE([FVWM2RC],[Suffix for old (to be deprecated) config filenames]) AC_DEFINE(FVWM2RC, ".fvwm2rc") # Various configure-time options AC_ARG_ENABLE(dmalloc, AS_HELP_STRING([--enable-dmalloc], [enable support for the dmalloc debugging library]), [ac_cv_dmalloc="$enableval"], [ac_cv_dmalloc="no"]) AC_ARG_ENABLE(efence, AS_HELP_STRING([--enable-efence], [enable support for the efence debugging library]), [ac_cv_efence="$enableval"], [ac_cv_efence="no"]) smr_SWITCH(command-log, command logging, off, FVWM_COMMAND_LOG,, [Produces a log of all executed commands and their times on stderr.]) AH_VERBATIM([_FVWM_COMMAND_LOG], [#ifdef FVWM_COMMAND_LOG # define FVWM_DEBUG_TIME 1 #endif]) smr_SWITCH(debug-msgs, debugging messages, off, FVWM_DEBUG_MSGS,, [if you would like to see lots of debug messages from fvwm, for debugging purposes, uncomment the next line]) AH_VERBATIM([_FVWM_DEBUG_MSGS], [#ifdef FVWM_DEBUG_MSGS # define DBUG(x,y) fvwm_msg(DBG,x,y) #else # define DBUG(x,y) /* no messages */ #endif]) dnl dummy: smr_SWITCH(sm, dummy for test script, on, SESSION) # Need to know where X is, for finding some libraries (e.g. xpm) no_x="" AC_PATH_XTRA if test x"$no_x" = x"yes"; then echo echo "X11 libraries or header files could not be found. Please make" echo "sure the X11 development package is installed on your system." echo "If it is definitely installed, try setting the include and library" echo "paths with the --x-include and --x-libraries options of configure." echo "Fvwm can not be compiled without the X11 development environment." echo echo "Aborting." echo exit 1 fi # FIXME: default value should be derived from computed path to X # includes. Actually, this should probably not appear in configure # at all: it is settable at runtime, and only confuses the issue to # have it settable here too. # AC_MSG_CHECKING(imagepath) val="/usr/include/X11/bitmaps:/usr/include/X11/pixmaps" AC_ARG_WITH(imagepath, AS_HELP_STRING([--with-imagepath=PATH], [colon-delimited search path for images]), [ case "$withval" in no) AC_MSG_ERROR([Can not disable image path.]) ;; yes) ;; *) val="$withval" ;; esac ]) AH_TEMPLATE([FVWM_IMAGEPATH],[Where to search for images.]) AC_DEFINE_UNQUOTED(FVWM_IMAGEPATH, "$val") FVWM_IMAGEPATH="$val" AC_SUBST(FVWM_IMAGEPATH) AC_MSG_RESULT($val) # Minimal checks for programs: enough to enable checking for # optional libraries. AC_PROG_CC AC_PROG_CPP # added -Wall for gcc, what about for others? if test "x$GCC" = "xyes"; then CFLAGS="-Wall -Wno-implicit-int $CFLAGS" fi # Help finding POSIX functions on some systems AC_ISC_POSIX AC_MINIX # catch -Werror and similar options when running configure AC_TRY_COMPILE([#include ], [int i; static j; int *p; char *c; switch (*p = p = *c) { case 0: printf("%Q", c, p); } *c = &i; c = p; while (1 || (unsigned int)3 >= 0 || ((int)-1) == ((unsigned int)1)); return;], , AC_MSG_ERROR(" configure is not able to compile programs with warnings. Please remove all offending options like -Werror from the CFLAGS and CPPFLAGS variables and run configure again.")) # check size of some types ac_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $X_CFLAGS" AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(Window, , [#include #include ]) AC_CHECK_SIZEOF(Pixel, , [#include #include ]) AC_CHECK_SIZEOF(void *) CFLAGS="$ac_save_CFLAGS" size_check_failed="" if test "$ac_cv_sizeof_void_p" -gt "$ac_cv_sizeof_long"; then echo "The type void * is bigger than long." size_check_failed=1 fi if test "$ac_cv_sizeof_Window" -gt "$ac_cv_sizeof_long"; then echo "The type Window is bigger than long." size_check_failed=1 fi if test "$ac_cv_sizeof_Pixel" -gt "$ac_cv_sizeof_long"; then echo "The type Pixel is bigger than long." size_check_failed=1 fi if test x"$size_check_failed" = x1; then echo "This is not supported by the module interface yet (make_new_vpacket)." echo "Detected type sizes are: int($ac_cv_sizeof_int), long($ac_cv_sizeof_long), void*($ac_cv_sizeof_void_p), Window($ac_cv_sizeof_Window), Pixel($ac_cv_sizeof_Pixel)" echo "Please report details of your system and this message to ${FVWMWORKERSLIST}." echo exit 1 fi # 'unset' is not portable, but setting to null is not enough to avoid using # the cached value! For ancient shells "rm config.cache" is a solution. UNSET=true if unset UNSET 2>/dev/null; then UNSET=unset; fi # ********* multibyte # FreeBSD has libxpg4, check this and use if found. AC_CANONICAL_HOST case $host_os in freebsd*) AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"]);; *) ;; esac # *** pkg-config # unfortunately, we need pkg-config for the detection of certain libs: # - version of fontconfig without fontconfig-config # - version of fribidi without fribidi-config AM_CHECK_PKG_CONFIG # Building man pages & HTML documentation (from XML source). # extract command names if test ! x"$SED" = x; then DOC_COMMANDS=` sed -n ' :findhead /#.*define.*CMD_ENT/bfindcmd n bfindhead :findcmd n /CMD_ENT/bfound bfindcmd :found /"#"/bfindcmd /"propertychange"/bfindcmd /"readwritecolors"/bfindcmd /"send_.*"/bfindcmd /"set_.*"/bfindcmd s/.*CMD_ENT.*CMD_// s/,.*// p n bfindcmd ' < fvwm/functable.c` DOC_COMMANDS=`echo $DOC_COMMANDS` # with .xml suffix DOC_COMMANDS_XML=`for i in $DOC_COMMANDS; do echo ${i}.xml; done` DOC_COMMANDS_XML=`echo $DOC_COMMANDS_XML` # with .xml suffix and path DOC_COMMANDS_XML_PATH=` for i in $DOC_COMMANDS; do echo ../commands/${i}.xml; done ` DOC_COMMANDS_XML_PATH=`echo $DOC_COMMANDS_XML_PATH` # with .html suffix DOC_COMMANDS_HTML=`for i in $DOC_COMMANDS; do echo ${i}.html; done` DOC_COMMANDS_HTML=`echo $DOC_COMMANDS_HTML` # extract module names DOC_MODULES="" DOC_MODULES=` for i in modules/*; do echo "$i"; done | sed -n ' :search /^modules.Fvwm/bfound bnext :found s/modules.// /FvwmTabs/bnext p :next n bsearch ' ` DOC_MODULES=`echo $DOC_MODULES` DOC_MODULES_HTML=`for i in $DOC_MODULES; do echo ${i}.html; done` DOC_MODULES_HTML=`echo $DOC_MODULES_HTML` # extract man page section names DOC_SECTIONS=`cat doc/fvwm/sections` DOC_SECTIONS=`echo $DOC_SECTIONS` DOC_SECTIONS_XML=`for i in $DOC_SECTIONS; do echo ${i}.xml; done` DOC_SECTIONS_XML=`echo $DOC_SECTIONS_XML` DOC_SECTIONS_XML_PATH=`for i in $DOC_SECTIONS; do echo ${i}.xml; done` DOC_SECTIONS_XML_PATH=`echo $DOC_SECTIONS_XML` else DOC_COMMANDS="" DOC_COMMANDS_XML="" DOC_COMMANDS_XML_PATH="" DOC_COMMANDS_HTML="" DOC_MODULES="" DOC_MODULES_HTML="" DOC_SECTIONS="" DOC_SECTIONS_XML="" DOC_SECTIONS_XML_PATH="" fi AC_SUBST(DOC_COMMANDS) AC_SUBST(DOC_COMMANDS_XML) AC_SUBST(DOC_COMMANDS_XML_PATH) AC_SUBST(DOC_COMMANDS_HTML) AC_SUBST(DOC_MODULES) AC_SUBST(DOC_MODULES_HTML) AC_SUBST(DOC_SECTIONS) AC_SUBST(DOC_SECTIONS_XML) AC_SUBST(DOC_SECTIONS_XML_PATH) problem_mandoc="" AC_CHECK_PROG(XSLTPROC, xsltproc, xsltproc, "") AC_ARG_ENABLE(mandoc, AS_HELP_STRING([--disable-mandoc], [disable generation of man pages]), [ if test x"$enableval" = xyes; then with_mandoc="yes, check" else with_mandoc="no" problem_mandoc=": Explicitly disabled" fi ], [ with_mandoc="not specified, check" ] ) if test ! x"$with_mandoc" = xno; then if test x"$XSLTPROC" = x ; then with_mandoc="no" problem_mandoc=": No xsltproc found in PATH" elif test x"$SED" = x ; then with_mandoc="no" problem_mandoc=": No sed found in PATH" elif test x"$HAVE_PERL_FOR_DOCS" = x0 ; then with_mandoc="no" problem_mandoc=": No perl found in PATH" else with_mandoc="yes" fi fi AM_CONDITIONAL([FVWM_BUILD_MANDOC], [test x"$with_mandoc" = xyes]) problem_htmldoc="" AC_ARG_ENABLE(htmldoc, AS_HELP_STRING([--enable-htmldoc],[enable generation of HTML documentation]), [ if test x"$enableval" = xyes; then with_htmldoc="yes, check" else with_htmldoc="no" problem_htmldoc=": Explicitly disabled" fi ], [ with_htmldoc="no" ] ) if test ! x"$with_htmldoc" = xno; then if test x"$XSLTPROC" = x ; then with_htmldoc="no" problem_htmldoc=": No xsltproc found in PATH" elif test x"$SED" = x ; then with_htmldoc="no" problem_htmldoc=": No sed found in PATH" elif test x"$HAVE_PERL_FOR_DOCS" = x0 ; then with_htmldoc="no" problem_htmldoc=": No perl found in PATH" else with_htmldoc="yes" fi fi AM_CONDITIONAL([FVWM_BUILD_HTMLDOC], [test x"$with_htmldoc" = xyes]) # ********* session management # Check the availability of SM; we don't have to add any extra libraries, # since -lSM -lICE are in X_PRE_LIBS when they exist. dnl [old check] AC_CHECK_LIB(SM, SmcOpenConnection, AC_DEFINE(SESSION), , dnl [old check] [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) problem_sm="" AC_ARG_ENABLE(sm, AS_HELP_STRING([--disable-sm],[disable session management support]), [ if test x"$enableval" = xyes; then with_sm="yes, check" else with_sm="no" problem_sm=": Explicitly disabled" fi ], [ with_sm="not specified, check" ] ) if test ! x"$with_sm" = xno; then dnl Uncomment the following and comment out AC_CHECK_LIB to get --with-sm-* dnl $UNSET ac_cv_lib_SM_SmcOpenConnection dnl $UNSET ac_cv_header_X11_SM_SMlib_h dnl smr_CHECK_LIB(sm, SM, adds session management support, SmcOpenConnection, dnl X11/SM/SMlib.h, dnl [$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS], $X_CFLAGS) dnl test "$sm_LIBS" && AC_DEFINE(SESSION) $UNSET ac_cv_lib_SM_SmcOpenConnection AH_TEMPLATE([SESSION],[Enables session management functionality.]) AC_CHECK_LIB(SM, SmcOpenConnection, with_sm=yes; AC_DEFINE(SESSION), with_sm=no; problem_sm=": Failed to detect libSM", [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) fi dnl AC_SUBST(sm_LIBS) dnl AC_SUBST(sm_CFLAGS) # Checking for optional libraries # Default is to use them if found; can be disable using --without # These are put up front so that if they are requested, but # configure fails to find them, we fail early. # ********* shape extension dnl smr_SWITCH(shape, shape extensions, on, SHAPE) AC_ARG_ENABLE(shape, AS_HELP_STRING([--disable-shape],[disable shaped window support]), [ if test x"$enableval" = xyes; then with_shape="yes, check" else with_shape="no" problem_shape=": Explicitly disabled" fi ], [ with_shape="not specified, check" ] ) AH_TEMPLATE(SHAPE, [ Define if you want the Shaped window extensions. Shaped window extensions seem to increase the window managers RSS by about 60 Kbytes. They provide for leaving a title-bar on the window without a border. If you don't use shaped window extension, you can either make your shaped windows undecorated, or live with a border and backdrop around all your shaped windows (oclock, xeyes) If you normally use a shaped window (xeyes or oclock), you might as well compile this extension in, since the memory cost is minimal in this case (The shaped window shared libs will be loaded anyway). If you don't normally use a shaped window, you have to decide for yourself. Note: if it is compiled in, run time detection is used to make sure that the currently running X server supports it.]) if test ! x"$with_shape" = xno; then $UNSET ac_cv_lib_Xext_XShapeQueryExtension AC_CHECK_LIB(Xext, XShapeQueryExtension, with_shape=yes; AC_DEFINE(SHAPE), with_shape=no; problem_shape=": Failed to detect Shape extension", [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) fi # ********* MIT Shared Memory Extension AC_ARG_ENABLE(shm, AS_HELP_STRING([--disable-shm],[disable MIT Shared Memory Extension]), [ if test x"$enableval" = xyes; then with_shm="yes, check" else with_shm="no" problem_shm=": Explicitly disabled" fi ], [ with_shm="not specified, check" ] ) AH_TEMPLATE([HAVE_XSHM],[Define if MIT Shared Memory extension is used.]) if test ! x"$with_shm" = xno; then $UNSET ac_cv_lib_Xext_XShmQueryExtension AC_CHECK_LIB(Xext, XShmQueryExtension, with_shm=yes; AC_DEFINE(HAVE_XSHM), with_shm=no; problem_shm=": Can't detect MIT Shared Memory ext.", [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) fi # ********* xinerama problem_xinerama="" AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama],[disable Xinerama multi screen support]), [ if test x"$enableval" = xyes; then with_xinerama="yes, check" else with_xinerama="no" problem_xinerama=": Explicitly disabled" fi ], [ with_xinerama="not specified, check" ] ) AH_TEMPLATE([HAVE_XINERAMA],[Define if Xinerama library is used.]) AH_TEMPLATE([HAVE_SOLARIS_XINERAMA], [Define if Solaris' Xinerama calls are being used. (Solaris 7 11/99 and later)]) AH_TEMPLATE([HAVE_SOLARIS_XINERAMA_H], [Define if Solaris' X11/extensions/xinerama.h header is provided. (Solaris 9 and later)]) if test ! x"$with_xinerama" = xno; then $UNSET ac_cv_lib_Xinerama_XineramaIsActive _check_solaris_xinerama=no AC_CHECK_LIB(Xinerama, XineramaIsActive, with_xinerama=yes; Xinerama_LIBS=-lXinerama; AC_DEFINE(HAVE_XINERAMA), _check_solaris_xinerama=yes, [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS]) if test x"$_check_solaris_xinerama" = xyes; then AC_CHECK_LIB(Xext, XineramaGetState, [ AC_DEFINE(HAVE_XINERAMA) AC_DEFINE(HAVE_SOLARIS_XINERAMA) with_xinerama=yes; Xinerama_LIBS=-lXext my_CPPFLAGS="$CPPFLAGS"; CPPFLAGS="$X_CPPFLAGS $CPPFLAGS" my_hdr="X11/extensions/xinerama.h" AC_CHECK_HEADER($my_hdr, AC_DEFINE(HAVE_SOLARIS_XINERAMA_H) problem_xinerama=" (Using Solaris Xinerama calls)", problem_xinerama=" (Using Solaris 9 prototypes for missing header)") CPPFLAGS="$my_CPPFLAGS"], with_xinerama=no; Xinerama_LIBS= problem_xinerama=": Failed to detect libXinerama", [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS]) fi $UNSET _check_solaris_xinerama fi AC_SUBST(Xinerama_LIBS) AC_SUBST(Xinerama_CFLAGS) # ********* xinerama-emulation smr_SWITCH( xinerama-emulation, [Xinerama emulation on one screen (useful only for developers)], off, USE_XINERAMA_EMULATION,, [Define if Xinerama should be emulated on a single screen.]) if test x"$enable_xinerama_emulation" = xyes; then with_xinerama_emulation=yes else with_xinerama_emulation=no fi # ********* xrender problem_xrender="" AC_ARG_ENABLE(xrender, AS_HELP_STRING([--disable-xrender],[disable Xrender alpha-blend rendering]), [ if test x"$enableval" = xyes; then with_xrender="yes, check" else with_xrender="no" problem_xrender=": Explicitly disabled" fi ], [ with_xrender="not specified, check" ] ) AH_TEMPLATE([HAVE_XRENDER],[Define if Xrender library is used.]) if test ! x"$with_xrender" = xno; then $UNSET ac_cv_lib_Xrender_XRenderComposite AC_CHECK_LIB(Xrender, XRenderComposite, with_xrender=yes; Xrender_LIBS=-lXrender; AC_DEFINE(HAVE_XRENDER), with_xrender=no; Xrender_LIBS= problem_xrender=": Failed to detect libXrender", [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS]) fi AC_SUBST(Xrender_LIBS) AC_SUBST(Xrender_CFLAGS) # ********* xcursor AH_TEMPLATE([HAVE_XCURSOR],[Define if Xcursor library is used.]) xcursor_CFLAGS="" xcursor_LIBS="" AC_ARG_ENABLE(xcursor, AS_HELP_STRING([--disable-xcursor], [disable Xcursor ARGB/animated cursor loading]), [ if test x"$enableval" = xno; then with_xcursor=no problem_xcursor=": Explicitly disabled" fi ], ) if test ! x"$with_xcursor" = xno; then with_xcursor=no if test ! x"$with_xrender" = xno; then $UNSET ac_cv_lib_Xrender_XRenderCreateCursor AC_CHECK_LIB(Xrender, XRenderCreateCursor, [ with_xcursor=yes ],[ problem_xcursor=": Your libXrender version is too old" ], [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS]) else problem_xcursor=": Need Xrender support" fi fi if test x"$with_xcursor" = xyes ; then $UNSET ac_cv_lib_Xcursor_XcursorImageLoadCursor AC_CHECK_LIB(Xcursor, XcursorImageLoadCursor, [ AC_DEFINE(HAVE_XCURSOR) Xcursor_LIBS=-lXcursor problem_xcursor="" ],[ with_xcursor=no problem_xcursor=": Failed to detect libXcursor" ],[$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS]) fi AC_SUBST(Xcursor_CFLAGS) AC_SUBST(Xcursor_LIBS) # ********* xft problem_xft="" AC_ARG_ENABLE(xft, AS_HELP_STRING([--disable-xft],[disable Xft anti-aliased font rendering]), [ if test x"$enableval" = xyes; then with_xft="yes, check" else with_xft="no" problem_xft=": Explicitly disabled" fi ], [ with_xft="not specified, check" ] ) AH_TEMPLATE([HAVE_XFT],[Define if Xft library is used.]) AH_TEMPLATE([HAVE_XFT2],[Define if Xft 2 library is used.]) AH_TEMPLATE([HAVE_XFT_UTF8],[Define if Xft library can handle utf8 encoding]) if test ! x"$with_xft" = xno; then # first check for freetype2 have_freetype=no AM_CHECK_FT2(6.1.0) if test x"$no_ft" = x; then have_freetype=yes else have_freetype=no problem_xft=": Can't detect freetype2 >= 6.1.0/2.0.6" fi # check for fontconfig for Xft 2 have_fontconfig=no if test ! x"$have_freetype" = xno ; then AM_CHECK_FC(1.0.1) if test x"$no_fc" = x ; then have_fontconfig=yes fontconfig_CFLAGS=`$PKG_CONFIG --cflags fontconfig` fontconfig_LIBS=`$PKG_CONFIG --libs fontconfig` CFLAGS="$CFLAGS $fontconfig_CFLAGS" LIBS="$LIBS $fontconfig_LIBS" else have_fontconfig=no problem_xft=": Can't detect fontconfig >= 1.0.1" fi fi # now check for Xft 2 with_xft=no if test ! x"$have_fontconfig" = xno ; then # Xft 2 AM_CHECK_XFT(2.0.0) if test x"$no_xft" = x; then with_xft=yes problem_xft=" (version 2)" AC_DEFINE(HAVE_XFT2) AC_DEFINE(HAVE_XFT) AC_DEFINE(HAVE_XFT_UTF8) Xft_LIBS=$XFT_LIBS Xft_CFLAGS=$XFT_CFLAGS else problem_xft=": Can't detect Xft2, detected fontconfig" fi fi # if Xft2 not detected check for Xft1 if test ! x"$have_freetype" = xno && test ! x"$with_xft" = xyes; then #Xft 1 $UNSET ac_cv_lib_XftConfigSubstitute $UNSET ac_cv_lib_Xft_XftFontOpen $UNSET ac_cv_lib_Xft_XftDrawStringUtf8 AC_CHECK_LIB(Xft, XftFontOpen, with_xft=yes, with_xft=no, [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $FT2_LIBS $Xrender_LIBS]) if test x"$with_xft" = xyes ; then AC_CHECK_LIB(Xft, XftConfigSubstitute, is_xft1=yes, is_xft1=no, [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $FT2_LIBS $Xrender_LIBS]) if test x"$is_xft1" = xyes; then Xft_LIBS="-lXft $FT2_LIBS" Xft_CFLAGS="$Xft_CFLAGS $FT2_CFLAGS" problem_xft=" (version 1)" AC_DEFINE(HAVE_XFT) else with_xft=no problem_xft=": Can't detect Xft 1 or fontconfig" fi else problem_xft=": Can't detect Xft 1 or 2 and fontconfig" fi if test x"$with_xft" = xyes; then AC_CHECK_LIB(Xft, XftDrawStringUtf8, AC_DEFINE(HAVE_XFT_UTF8),, [$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS $FT2_LIBS $Xrender_LIBS]) fi fi fi AC_SUBST(Xft_LIBS) AC_SUBST(Xft_CFLAGS) # ********* xpm problem_xpm=": Xpm library or header not found" $UNSET ac_cv_header_X11_xpm_h $UNSET ac_cv_lib_Xpm_XpmReadFileToXpmImage smr_CHECK_LIB(xpm, Xpm, for coloured or shaped icons, XpmReadFileToXpmImage, X11/xpm.h, [$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS], $X_CFLAGS) if test ! x"$xpm_LIBS" = x; then # Check for proper version of Xpm -- from XEmacs 21.x configure.in AC_MSG_CHECKING([for Xpm 3.4g or better]) my_CPPFLAGS="$CPPFLAGS" my_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $xpm_CFLAGS $X_CFLAGS" LIBS="$LIBS $xpm_LIBS $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" AC_TRY_RUN([#include int main(int c, char **v) { return c == 1 ? 0 : XpmIncludeVersion != XpmLibraryVersion() ? 1 : XpmIncludeVersion < 30407 ? 2 : 0 ;}], [./conftest dummy_arg; xpm_status=$?; if test x"$xpm_status" = x0; then with_xpm=yes problem_xpm="" else with_xpm=no; if test x"$xpm_status" = x1; then problem_xpm=": Xpm library and header versions don't match" elif test x"$xpm_status" = x2x; then problem_xpm=": Xpm library version is too old" else problem_xpm=": Internal xpm detection logic error" fi fi], [with_xpm=no; problem_xpm=": Xpm test error, see config.log"], [echo $ac_n "cross compiling; assumed OK... $ac_c"]) AC_MSG_RESULT($with_xpm) CPPFLAGS="$my_CPPFLAGS" LIBS="$my_LIBS" AH_TEMPLATE([XPM],[Define if Xpm library is used.]) if test x"$with_xpm" = xyes; then AC_DEFINE(XPM) # FVWMBANNER=FvwmBanner AC_SUBST(FVWMBANNER) # XPMROOT=xpmroot AC_SUBST(XPMROOT) # FVWMSCRIPT=FvwmScript AC_SUBST(FVWMSCRIPT) else xpm_LIBS= xpm_CFLAGS= fi fi AC_SUBST(xpm_LIBS) AC_SUBST(xpm_CFLAGS) # ********* png problem_png=": png library or header not found" $UNSET ac_cv_header_png_h $UNSET ac_cv_lib_png_png_read_info smr_CHECK_LIB(png, png, for coloured or shaped icons, png_read_info, png.h, -lz -lm,) if test ! x"$png_LIBS" = x; then # Check for proper version of png AC_MSG_CHECKING([for libpng 1.0.4a or better]) my_CPPFLAGS="$CPPFLAGS" my_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $png_CFLAGS" LIBS="$LIBS $png_LIBS -lz -lm" AC_TRY_RUN([#include int main(int c, char **v) { return c == 1 ? 0 : (PNG_LIBPNG_VER < 10005) ? 2 : 0 ;}], [./conftest dummy_arg; png_status=$?; if test x"$png_status" = x0; then with_png=yes; else with_png=no; if test x"$png_status" = x2; then problem_png=": png library version is too old" else problem_png=": Internal png detection logic error" fi fi], [with_png="no"; problem_png=": png test error, see config.log"], [echo $ac_n "cross compiling; assumed OK... $ac_c"]) AC_MSG_RESULT($with_png) CPPFLAGS="$my_CPPFLAGS" LIBS="$my_LIBS" fi AH_TEMPLATE([HAVE_PNG],[Define if ppm library is used.]) if test x"$with_png" = xyes; then AC_DEFINE(HAVE_PNG) png_LIBS="$png_LIBS -lz" problem_png="" else with_png=no fi AC_SUBST(png_LIBS) AC_SUBST(png_CFLAGS) # ** needed by the png support AC_C_BIGENDIAN # ********* rsvg rsvg_min_version=2.13.92 AH_TEMPLATE([HAVE_RSVG], [Define if librsvg library is used.]) AC_ARG_ENABLE(rsvg, AS_HELP_STRING([--disable-rsvg], [disable scalable vector graphics (SVG images)]), [ if test x"$enableval" = xno; then with_rsvg=no problem_rsvg=": Explicitly disabled" fi ], ) if test ! x"$with_rsvg" = xno; then with_rsvg=no if test ! x"$PKG_CONFIG" = xno ; then AC_MSG_CHECKING(for librsvg - version >= $rsvg_min_version) if $PKG_CONFIG --exists librsvg-2.0 ; then if $PKG_CONFIG --exists "librsvg-2.0 >= $rsvg_min_version" ; then AC_MSG_RESULT(yes) AC_MSG_CHECKING(for cairo svg backend) if $PKG_CONFIG --exists cairo-svg ; then svg_packages="librsvg-2.0 cairo-svg" elif $PKG_CONFIG --exists libsvg-cairo ; then svg_packages="librsvg-2.0 libsvg-cairo" elif $PKG_CONFIG --exists cairo ; then svg_packages="librsvg-2.0 cairo" else svg_packages="" fi if test ! x"$svg_packages" = x ; then AC_MSG_RESULT(yes) rsvg_CFLAGS=`$PKG_CONFIG --cflags $svg_packages` rsvg_LIBS=`$PKG_CONFIG --libs $svg_packages` with_rsvg=yes else AC_MSG_RESULT(no) AC_MSG_WARN([*** cairo was not found in the pkg-config search]) AC_MSG_WARN([*** path. Add the directory containing cairo.pc]) AC_MSG_WARN([*** to the PKG_CONFIG_PATH environment variable.]) problem_rsvg=": Cannot detect cairo backend" fi else AC_MSG_RESULT(no) AC_MSG_WARN([*** Your librsvg version is < $rsvg_min_version]) problem_rsvg=": Your librsvg version is too old" fi else AC_MSG_RESULT(no) AC_MSG_WARN([*** librsvg-2.0 was not found in the pkg-config search]) AC_MSG_WARN([*** path. Either librsvg is not installed or you need]) AC_MSG_WARN([*** to add the directory containing librsvg-2.0.pc to]) AC_MSG_WARN([*** the PKG_CONFIG_PATH environment variable.]) problem_rsvg=": librsvg library or header not found" fi else problem_rsvg=": pkg-config not found" fi fi if test x"$with_rsvg" = xyes ; then AC_MSG_CHECKING(whether a librsvg program compiles and runs) original_CFLAGS="$CFLAGS" original_LIBS="$LIBS" CFLAGS="$CFLAGS $rsvg_CFLAGS" LIBS="$LIBS $rsvg_LIBS" AC_TRY_RUN([ #include #include int main() { RsvgHandle *rsvg; g_type_init(); if(!(rsvg = rsvg_handle_new())) return 1; g_object_unref(G_OBJECT(rsvg)); return 0; } ], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) AC_MSG_WARN([*** The librsvg test program failed to run. If your system]) AC_MSG_WARN([*** has shared libraries outside the normal system library]) AC_MSG_WARN([*** path, you need to make sure that the LD_LIBRARY_PATH]) AC_MSG_WARN([*** (or the like) environment variable is correctly set.]) with_rsvg=no problem_rsvg=": Failed to run test program" ], [echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$original_CFLAGS" LIBS="$original_LIBS" fi if test x"$with_rsvg" = xyes ; then AC_DEFINE(HAVE_RSVG) problem_rsvg="" else rsvg_CFLAGS="" rsvg_LIBS="" fi AC_SUBST(rsvg_CFLAGS) AC_SUBST(rsvg_LIBS) # ********* rplay $UNSET ac_cv_header_rplay_h $UNSET ac_cv_lib_rplay_rplay_create # Add in X_EXTRA_LIBS here to get things like connect(). smr_CHECK_LIB(rplay, , adds audio capability, rplay_create, rplay.h, $X_EXTRA_LIBS) AH_TEMPLATE([HAVE_RPLAY],[Define if rplay library is used.]) test ! x"$rplay_LIBS" = x && AC_DEFINE(HAVE_RPLAY) AC_SUBST(rplay_LIBS) AC_SUBST(rplay_CFLAGS) # ********* stroke $UNSET ac_cv_header_stroke_h $UNSET ac_cv_lib_stroke_stroke_init dnl Add in X_LIBS for MOUSE_DROPPINGS? dnl As of 23/Mar/2000 the only libstroke RPM has /usr/X11R6/include/stroke.h AH_TEMPLATE([HAVE_STROKE],[Define if stroke library is used.]) smr_CHECK_LIB(stroke, , mouse strokes recognition, stroke_init, stroke.h, [$X_LIBS -lX11], $X_CFLAGS -I/usr/X11R6/include) test ! x"$stroke_LIBS" = x && AC_DEFINE(HAVE_STROKE) AH_VERBATIM([_HAVE_STROKE], [#ifdef HAVE_STROKE # define STROKE_ARG(x) x, # define STROKE_CODE(x) x #else # define STROKE_ARG(x) # define STROKE_CODE(x) #endif]) AC_SUBST(stroke_LIBS) AC_SUBST(stroke_CFLAGS) # ********* readline with_readline=no problem_readline=": Both termcap and ncurses disabled" smr_ARG_WITHLIB(termcap, , to accomplish readline) AH_TEMPLATE([HAVE_READLINE],[Define if readline is available.]) if test ! x"$with_termcap" = xno; then # Forget cached values, so user can re-run configure $UNSET ac_cv_header_readline_history_h $UNSET ac_cv_lib_readline_readline AC_MSG_CHECKING([with termcap]) smr_CHECK_LIB(readline, , line editing/history, readline, readline/history.h, $termcap_LIBS) if test ! x"$readline_LIBS" = x; then with_readline=yes readline_LIBS="$readline_LIBS $termcap_LIBS" AC_DEFINE(HAVE_READLINE) fi fi smr_ARG_WITHLIB(ncurses, , to accomplish readline) if test ! x"$with_ncurses" = xno && test x"$readline_LIBS" = x; then # We couldn't use readline with termcap; try with ncurses? # Doesn't this seem a hacky way to do this?? # unset cached values from last check... $UNSET ac_cv_header_readline_history_h $UNSET ac_cv_lib_readline_readline AC_MSG_CHECKING([with ncurses]) dnl We can not call smr_CHECK_LIB twice here without having the usage twice. dnl old_LIBS=$LIBS dnl AC_CHECK_LIB(readline, readline, , , $ncurses_LIBS) dnl LIBS=$old_LIBS dnl if test x"$ac_cv_lib_readline_readline" = xyes; then dnl AC_CHECK_HEADERS(readline/history.h) dnl if test x"$ac_cv_header_readline_history_h" = xyes; then dnl with_readline=yes dnl readline_LIBS="$readline_LIBS $ncurses_LIBS" dnl AC_DEFINE(HAVE_READLINE) dnl fi dnl fi smr_CHECK_LIB(readline, , line editing/history, readline, readline/history.h, $ncurses_LIBS) if test ! x"$readline_LIBS" = x; then with_readline=yes readline_LIBS="$readline_LIBS $ncurses_LIBS" AC_DEFINE(HAVE_READLINE) fi fi dnl We need to check if we have GNU readline or BSD editline AH_TEMPLATE([HAVE_GNU_READLINE],[Define if readline has full GNU interface]) if test x"$with_readline" = xyes; then AC_CHECK_LIB(readline, append_history, AC_DEFINE(HAVE_GNU_READLINE), [], $readline_LIBS) fi AC_SUBST(readline_LIBS) AC_SUBST(readline_CFLAGS) # Check if Xsetlocale() is available or not. AH_TEMPLATE([X_LOCALE],[Enables to use setlocale() provided by X]) AC_CHECK_LIB(X11, _Xsetlocale, AC_DEFINE(X_LOCALE),, $X_LIBS -lX11) # Check if Xsetlocale() is available or not. AH_TEMPLATE([HAVE_XOUTPUT_METHOD],[Enable X output method]) AC_CHECK_LIB(X11, XOpenOM, AC_DEFINE(HAVE_XOUTPUT_METHOD),, $X_LIBS -lX11) # ******** iconv with_iconv=no with_iconv_type=no with_lib_iconv=no with_sys_iconv=no problem_iconv=": Explicitly disabled" AC_ARG_ENABLE(iconv, AS_HELP_STRING([--disable-iconv], [disable support for iconv character conversion]), [ac_cv_iconv="$enableval"], [ac_cv_iconv="yes"]) AH_TEMPLATE([USE_LIBICONV], [define if we use libiconv (not needed in general: for example iconv is native with recent glibc)]) AH_TEMPLATE([HAVE_ICONV], [Define if iconv (in the libc) or libiconv is available]) if test ! x"$ac_cv_iconv" = xno; then # * first check for gnu libiconv $UNSET ac_cv_header_libiconv_h $UNSET ac_cv_lib_libiconv_libiconv_open smr_CHECK_LIB( iconv, , if not found sys iconv is used, libiconv_open, iconv.h) if test ! x"$iconv_LIBS" = x; then AC_DEFINE(USE_LIBICONV) with_lib_iconv=yes fi AC_SUBST(iconv_LIBS) AC_SUBST(iconv_CFLAGS) # * check for system iconv AC_CHECK_FUNC(iconv_open, with_sys_iconv=yes) if test x"$with_lib_iconv" = xyes && test x"$with_sys_iconv" = xyes; then AC_MSG_WARN([*** Both system iconv and libiconv found: use libiconv]) AC_MSG_WARN([*** Use --with-iconv-library=no to use the system iconv]) fi # * libiconv found check for libcharset to get the good iconv charset if test x"$with_lib_iconv" = xyes; then CHECK_LIBCHARSET fi test x"$with_lib_iconv" = xyes -o x"$with_sys_iconv" = xyes && with_iconv=yes && problem_iconv="" test x"$with_lib_iconv" = xyes && with_iconv_type="yes (libiconv)" test x"$with_sys_iconv" = xyes && with_iconv_type="yes (from C library)" if test x"$with_iconv" = xno; then AC_MSG_WARN([*** ]) AC_MSG_WARN([*** No iconv() implementation found in C library or libiconv]) AC_MSG_WARN([*** Please install libiconv ftp://ftp.gnu.org/pub/gnu/libiconv/]) AC_MSG_WARN([*** ]) fi if test x"$with_iconv" = xyes; then AC_DEFINE(HAVE_ICONV) ICONV_SECOND_ARG fi fi AH_VERBATIM([_HAVE_LIBCHARSET], [#ifdef USE_LIBICONV /* define to use locale_charset in the place of nl_langinfog if libiconv * is used */ #undef HAVE_LIBCHARSET #endif]) # ******** nl_langinfo and CODESET AH_TEMPLATE([HAVE_CODESET],[Have nl_langinfo (CODESET)]) AC_MSG_CHECKING([for nl_langinfo (CODESET)]) AC_TRY_COMPILE([#include #include ], [char *codeset = nl_langinfo(CODESET); setlocale(LC_CTYPE, "");], AC_DEFINE(HAVE_CODESET) have_codeset=yes, have_codeset=no) AC_MSG_RESULT($have_codeset) # ********* fribidi AC_ARG_ENABLE(bidi, AS_HELP_STRING([--disable-bidi],[disable bi-directional text support]), [ if test x"$enableval" = xyes; then with_bidi="yes, check" else with_bidi="no" problem_bidi=": Explicitly disabled" fi ], [ with_bidi="not specified, check" ] ) fribidi_min_version=0.19.2 if test ! x"$with_bidi" = xno; then AC_ARG_WITH(fribidi-bindir, AS_HELP_STRING([--with-fribidi-bindir=DIR], [directory of fribidi-config if not in PATH]), FRIBIDI_BINDIR="$withval", FRIBIDI_BINDIR=".") if test ! x"$PKG_CONFIG" = xno && $PKG_CONFIG --exists "fribidi >= $fribidi_min_version"; then FRIBIDI_CONFIG="$PKG_CONFIG fribidi" else AC_PATH_PROG(FRIBIDI_CONFIG, fribidi-config,, [$FRIBIDI_BINDIR:$PATH]) fi if test x"$FRIBIDI_CONFIG" = x; then with_bidi=no problem_bidi=": pkgconfig fribidi: fribidi version >= $fribidi_min_version needed." else Bidi_CFLAGS=`$FRIBIDI_CONFIG --cflags` Bidi_LIBS=`$FRIBIDI_CONFIG --libs` AC_CHECK_LIB(fribidi, fribidi_log2vis, with_bidi=yes; problem_bidi=, with_bidi=no; problem_bidi=": No good libs via $FRIBIDI_CONFIG", [$Bidi_LIBS $Bidi_CFLAGS]) fi fi if test ! x"$with_bidi" = xno; then fribidi_in_path=yes ac_save_LIBS="$LIBS" LIBS="$LIBS $Bidi_LIBS" AC_TRY_RUN([#include #include int main() { FriBidiChar *logical_unicode_str = (FriBidiChar *)malloc((4 + 1) * sizeof(FriBidiChar)); fribidi_charset_to_unicode( fribidi_parse_charset("iso8859-8"), "test", 4, logical_unicode_str); return 0; } ], [:], [fribidi_in_path=no]) LIBS="$ac_save_LIBS" if test ! x"$fribidi_in_path" = xyes; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $Bidi_CFLAGS" LIBS="$LIBS $Bidi_LIBS" AC_TRY_RUN([#include #include int main() { FriBidiChar *logical_unicode_str = (FriBidiChar *)malloc((4 + 1) * sizeof(FriBidiChar)); fribidi_charset_to_unicode( fribidi_parse_charset("iso8859-8"), "test", 4, logical_unicode_str); return 0; } ], [:], [with_bidi=no; problem_bidi=": Bad fribidi version, see config.log"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi if test ! x"$fribidi_in_path" = xno; then Bidi_CFLAGS= Bidi_LIBS=-lfribidi fi fi AH_TEMPLATE([HAVE_BIDI],[Define if fribidi library is used.]) AH_TEMPLATE([FRIBIDI_CHARSET_SPELLING], [Support fribidi-0.10.4 and older with "CHARSET" spelling.]) if test x"$with_bidi" = xno; then Bidi_CFLAGS= Bidi_LIBS= else AC_DEFINE(HAVE_BIDI) AC_TRY_RUN([#include int main(int c, char **v) { return FRIBIDI_CHARSET_NOT_FOUND * 0; } ], [AC_DEFINE(FRIBIDI_CHARSET_SPELLING)]) fi AH_VERBATIM([_FRIBIDI_CHARSET_SPELLING], [#ifdef FRIBIDI_CHARSET_SPELLING # define FRIBIDI_CHAR_SET_NOT_FOUND FRIBIDI_CHARSET_NOT_FOUND #endif]) AC_SUBST(Bidi_LIBS) AC_SUBST(Bidi_CFLAGS) # ********* perllib with_perllib="yes" problem_perllib="" FVWM_PERLLIB=perllib AC_ARG_ENABLE(perllib, AS_HELP_STRING([--disable-perllib],[disable installing fvwm perl library]), [ if test x"$enableval" = xno; then with_perllib="no" problem_perllib=": Explicitly disabled" FVWM_PERLLIB="" fi ], ) AC_SUBST(FVWM_PERLLIB) # ******* gettext ALL_LINGUAS="ar de fr sv_SE zh_CN" FVWM_DOMAIN="fvwm" FVWMTASKBAR_DOMAIN="FvwmTaskBar" FVWMSCRIPT_DOMAIN="FvwmScript" ALL_DOMAINS="$FVWM_DOMAIN $FVWMTASKBAR_DOMAIN $FVWMSCRIPT_DOMAIN" AC_SUBST(ALL_LINGUAS) AC_SUBST(FVWM_DOMAIN) AC_SUBST(FVWMTASKBAR_DOMAIN) AC_SUBST(FVWMSCRIPT_DOMAIN) AC_SUBST(ALL_DOMAINS) LOCALEDIR='${datadir}'"/locale" with_gettext="yes" problem_gettext="" AC_ARG_ENABLE(nls, AS_HELP_STRING([--disable-nls],[do not use Native Language Support]), [ if test x"$enableval" = xno; then with_gettext="no" problem_gettext=": Explicitly disabled" fi ], ) AH_TEMPLATE([HAVE_NLS], [Define to 1 if translation of program messages to the user's native language is requested.]) if test ! x"$with_gettext" = xno; then AM_GNU_FGETTEXT if test x"$USE_NLS" = "xyes"; then AC_DEFINE(HAVE_NLS, 1) else with_gettext="no" problem_gettext=": Failed to detected GNU gettext" fi else USE_NLS=no fi # libs and buil AC_SUBST(intl_LIBS) AC_SUBST(intl_CFLAGS) AC_SUBST(USE_NLS) AC_SUBST(POSUB) AC_SUBST(LOCALEDIR) AC_SUBST(MKINSTALLDIRS) # programs for devel AC_SUBST(XGETTEXT) AC_SUBST(GMSGFMT) AC_SUBST(MSGMERGE) AC_SUBST(MSGFMT) AC_SUBST(MSGUNIQ) #catalogs AC_SUBST(INST_LINGUAS) AC_SUBST(CATALOGS) AC_SUBST(POFILES) AC_SUBST(GMOFILES) AC_SUBST(UPDATEPOFILES) AC_SUBST(DUMMYPOFILES) AC_SUBST(CATOBJEXT) # Check for REQUIRED headers and functions before going any # further. # The module interface uses variadic functions for message passing. AC_CHECK_HEADERS(stdarg.h) AC_CHECK_FUNCS(vfprintf) if test x$ac_cv_header_stdarg_h = xno -o \ $ac_cv_func_vfprintf = no; then AC_MSG_ERROR([stdarg.h and vfprintf required]) fi # For reaping children, fvwm needs either waitpid() or wait3() # Some extra modules may need wait4() too AC_CHECK_FUNCS(waitpid) if test x$ac_cv_func_waitpid = xno; then AC_CHECK_FUNCS(wait3 wait4) if test x$ac_cv_func_wait3 = xno; then AC_MSG_ERROR([Either waitpid or wait3 function is required]) fi fi # C89/C99 signal handling AC_CHECK_FUNCS(sigsetjmp siglongjmp) # Look harder for a C preprocessor for FvwmCpp AC_PATH_PROG(FVWM_CPP, cpp, no, $PATH:/lib:/usr/lib:/usr/ccs/lib) if test x"$FVWM_CPP" = xno; then FVWM_CPP= AC_MSG_WARN([cannot locate a C preprocessor: run FvwmCpp with -cppprog]) fi dnl FIXME: make sure the cpp we found actually works... # Finish checking for programs. AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB dnl lex+yacc now only needed for FvwmScript developers when syntax is changed dnl AM_PROG_LEX dnl AC_PROG_YACC # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(stdlib.h fcntl.h limits.h malloc.h string.h memory.h unistd.h) AC_CHECK_HEADERS(getopt.h sys/select.h sys/systeminfo.h sys/time.h) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME dnl AC_STRUCT_TM AC_TYPE_SIGNAL # Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_STRFTIME AC_FUNC_SETPGRP AC_CHECK_FUNCS(gettimeofday mkfifo putenv setvbuf socket waitpid) AC_CHECK_FUNCS(strdup strstr strtol memmove memcpy strchr sysconf uname div) AC_CHECK_FUNCS(sigaction siginterrupt getpwuid) AC_CHECK_FUNCS(setpgrp setpgid) AC_CHECK_FUNCS(lstat) pds_CHECK_TYPE(sig_atomic_t, int, [#include ], [Specify a type for sig_atomic_t if it's not available.]) if test x$ac_cv_func_setvbuf = xyes; then AC_FUNC_SETVBUF_REVERSED fi AC_FUNC_SELECT if test ! x"$ac_cv_func_select" = xyes; then AC_MSG_ERROR([select required]) fi # Check for standard functions that we have replacements for. AC_REPLACE_FUNCS(gethostname strcasecmp strncasecmp strdup strerror usleep atexit) dnl dv: this is harmful with autoconf 2.53 and is done automatically anyway dnl AC_SUBST(LIBOBJS) # check for mkstemp, see the discution on this subject on the fvwm workers # list (2001-02-16 and 2001-02-24) AM_SAFETY_CHECK_MKSTEMP # If we do not have atexit(), then check for on_exit() if test x$ac_cv_func_atexit = xno; then AC_CHECK_FUNCS(on_exit) fi # Check for unsetenv function AC_CHECK_FUNCS(unsetenv) # ********* GTK, IMLIB, GNOME # Check the availability of gtk FVWMGTK="" MANFVWMGTK="" AC_ARG_ENABLE(gtk, AS_HELP_STRING([--disable-gtk],[do not build modules using gtk library]), enable_gtktest="$enableval", enable_gtktest=yes) if test x"$enable_gtktest" = xyes; then AM_PATH_GTK(1.1.0,[ FVWMGTK="FvwmGtk$EXEEXT" AC_SUBST(FVWMGTK) MANFVWMGTK=FvwmGtk.1 AC_SUBST(MANFVWMGTK) ],) if test x"$no_gtk" = x; then with_gtk=yes problem_gtk="" else with_gtk=no problem_gtk=": Failed to detect GTK, see config.log" fi else with_gtk=no problem_gtk=": Explicitly disabled" fi AC_SUBST(FVWMGTK) AC_SUBST(MANFVWMGTK) # Check the availability of gdk-imlib AH_TEMPLATE([GDK_IMLIB],[Define if gdk-imlib is used]) AM_PATH_GDK_IMLIB(1.8.0, AC_DEFINE(GDK_IMLIB)) if test x"$no_imlib" = x; then with_gdkimlib=yes problem_gdkimlib="" else with_gdkimlib=no problem_gdkimlib=": Failed on gdk-imlib, see config.log" fi GNOME_INIT_HOOK # Unfortunately we have 2 gnome supports: WM hints and gnome libs. # The $with_gnomehints below refers to the first, not GNOME_INIT_HOOK. if test ! x"$enable_gnome_hints" = xno; then with_gnomehints=yes problem_gnomehints="" else with_gnomehints=no problem_gnomehints=": Explicitly disabled" fi # Define some compatibility macros needed for config.h. mg_DEFINE_IF_NOT([#include ], [defined XK_Page_Up && defined XK_Page_Down], [COMPAT_OLD_KEYSYMDEF], [$X_CFLAGS], [Old AIX systems (3.2.5) don't define some common keysyms.]) AH_VERBATIM([_COMPAT_OLD_KEYSYMDEF], [#ifdef COMPAT_OLD_KEYSYMDEF # define XK_Page_Up XK_Prior # define XK_Page_Down XK_Next #endif]) if test x"$with_stroke" = xyes; then mg_DEFINE_IF_NOT([#include ], [defined STROKE_MAX_SEQUENCE], [COMPAT_OLD_LIBSTROKE], [$stroke_CFLAGS], [Old libstroke <= 0.4 does not use STROKE_ prefix for constants.]) fi AH_VERBATIM([_COMPAT_OLD_LIBSTROKE], [#ifdef COMPAT_OLD_LIBSTROKE /* currently we only use one constant */ # define STROKE_MAX_SEQUENCE MAX_SEQUENCE #endif]) # Allow building with dmalloc. Do this last to avoid screwing up any # other checks above. case "$ac_cv_dmalloc" in yes) AC_CHECK_HEADERS(dmalloc.h) AC_CHECK_LIB(dmalloc, dmalloc_shutdown) CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" ;; esac # Allow building with efence. case "$ac_cv_efence" in yes) AC_CHECK_LIB(efence, malloc) ;; esac # some explicit definitions for config.h file AH_VERBATIM([_ZEND_EXPLICIT_DEFINITIONS], [ /** * The next few defines are options that are only changed from their values * shown here on systems that _don't_ use the configure script. **/ /* Enable tests for missing too many XEvents. Usually you want this. */ #define WORRY_ABOUT_MISSED_XEVENTS 1 /* Define if the X11 ConnectionNumber is actually a file descriptor. */ #define HAVE_X11_FD 1 /* Define if fork() has unix semantics. On VMS, no child process is created until after a successful exec(). */ #define FORK_CREATES_CHILD 1 /* Suffix for executable filenames; NULL if no extension needed. */ #define EXECUTABLE_EXTENSION NULL /* Define to remove the extension from executable pathnames before calling exec(). */ #undef REMOVE_EXECUTABLE_EXTENSION /* Enables the "MiniIcon" Style option to specify a small pixmap which * can be used as one of the title-bar buttons, shown in window list, * utilized by modules, etc. Requires PIXMAP_BUTTONS to be defined * (see below). */ /* #undef MINI_ICONS */ /* NOTE: hard coded to 1 */ #if 1 #define FMiniIconsSupported 1 #else #define FMiniIconsSupported 0 #endif /* Enables tagged general decoration styles which can be assigned to * windows using the UseDecor Style option, or dynamically updated * with ChangeDecor. To create and destroy "decor" definitions, see * the man page entries for AddToDecor and DestroyDecor. There is a * slight memory penalty for each additionally defined decor. */ /* #undef USEDECOR */ /* NOTE: hard coded to 1 */ #define USEDECOR 1 #if RETSIGTYPE != void #define SIGNAL_RETURN return 0 #else #define SIGNAL_RETURN return #endif /* Allow GCC extensions to work, if you have GCC. */ #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ # define __attribute__(x) # endif /* The __-protected variants of `format' and `printf' attributes * are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #if HAVE_ALLOCA_H # include #else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_MEMORY_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #if defined (HAVE_MALLOC_H) && !defined (__FreeBSD__) && !defined (__OpenBSD__) && !defined(__NetBSD__) # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifndef HAVE_STRCHR # define strchr(_s,_c) index((_s),(_c)) # define strrchr(_s,_c) rindex((_s),(_c)) #endif #ifndef HAVE_MEMCPY # define memcpy(_d,_s,_l) bcopy((_s),(_d),(_l)) #endif #ifndef HAVE_MEMMOVE # define memmove(_d,_s,_l) bcopy((_s),(_d),(_l)) #endif #if HAVE_SYS_TYPES_H # include #endif #if HAVE_UNISTD_H # include #endif #ifndef min # define min(a,b) (((a)<(b)) ? (a) : (b)) #endif #ifndef max # define max(a,b) (((a)>(b)) ? (a) : (b)) #endif #ifndef abs # define abs(a) (((a)>=0)?(a):-(a)) #endif #include "libs/defaults.h" #ifndef FEVENT_C #include #include "libs/FEvent.h" #endif #ifndef O_NOFOLLOW #define O_NOFOLLOW 0 #endif #ifdef HAVE_LSTAT #define DO_USE_LSTAT 1 #define fvwm_lstat(x,y) lstat(x,y) #else #define DO_USE_LSTAT 0 #define fvwm_lstat(x,y) -1 #endif ]) # mainly for fvwm-config AC_SUBST(with_bidi) AC_SUBST(with_gtk) AC_SUBST(with_gdkimlib) AC_SUBST(with_gettext) AC_SUBST(with_gnomelibs) AC_SUBST(with_iconv) AC_SUBST(with_perllib) AC_SUBST(with_png) AC_SUBST(with_rsvg) AC_SUBST(with_readline) AC_SUBST(with_rplay) AC_SUBST(with_shape) AC_SUBST(with_shm) AC_SUBST(with_sm) AC_SUBST(with_stroke) AC_SUBST(with_xcursor) AC_SUBST(with_xft) AC_SUBST(with_xinerama) AC_SUBST(with_xrender) AC_SUBST(with_xpm) dnl with autoconf <2.60 this is needed AC_SUBST(datarootdir) AC_SUBST(docdir) LOCAL_BUGADDR=${FVWM_BUGADDR-${USER-${LOGNAME-`whoami`}}} AC_SUBST(LOCAL_BUGADDR) AC_OUTPUT( Makefile libs/Makefile fvwm/Makefile modules/Makefile dnl bin/fvwm-bug.1 bin/fvwm-config.1 bin/fvwm-convert-2.2.1 bin/fvwm-convert-2.4.1 bin/fvwm-convert-2.6.1 bin/fvwm-menu-desktop.1 dnl bin/fvwm-menu-directory.1 dnl bin/fvwm-menu-headlines.1 dnl bin/fvwm-menu-xlock.1 dnl bin/fvwm-perllib.1 bin/fvwm-root.1 modules/FvwmAnimate/FvwmAnimate.1 modules/FvwmAuto/FvwmAuto.1 modules/FvwmBacker/FvwmBacker.1 modules/FvwmBanner/FvwmBanner.1 modules/FvwmButtons/FvwmButtons.1 modules/FvwmCommand/FvwmCommand.1 modules/FvwmConsole/FvwmConsole.1 modules/FvwmConsole/FvwmConsoleC.pl.1 modules/FvwmCpp/FvwmCpp.1 dnl modules/FvwmDebug/FvwmDebug.1 dnl modules/FvwmDebug/FvwmGtkDebug.1 dnl modules/FvwmDebug/FvwmOldDebug.1 modules/FvwmDragWell/FvwmDragWell.1 modules/FvwmEvent/FvwmEvent.1 modules/FvwmForm/FvwmForm.1 modules/FvwmGtk/FvwmGtk.1 modules/FvwmIconBox/FvwmIconBox.1 modules/FvwmIconMan/FvwmIconMan.1 modules/FvwmIdent/FvwmIdent.1 modules/FvwmM4/FvwmM4.1 modules/FvwmPager/FvwmPager.1 dnl modules/FvwmPerl/FvwmPerl.1 modules/FvwmProxy/FvwmProxy.1 modules/FvwmRearrange/FvwmRearrange.1 modules/FvwmSave/FvwmSave.1 modules/FvwmSaveDesk/FvwmSaveDesk.1 modules/FvwmScript/FvwmScript.1 modules/FvwmScroll/FvwmScroll.1 modules/FvwmTaskBar/FvwmTaskBar.1 modules/FvwmTheme/FvwmTheme.1 modules/FvwmWharf/FvwmWharf.1 modules/FvwmWinList/FvwmWinList.1 dnl modules/FvwmWindowMenu/FvwmWindowMenu.1 dnl bin/Makefile bin/fvwm-config bin/fvwm-bug bin/fvwm-perllib bin/fvwm-menu-xlock bin/fvwm-menu-directory bin/fvwm-menu-desktop bin/fvwm-menu-headlines bin/fvwm-convert-2.4 bin/fvwm-convert-2.6 dnl utils/Makefile perllib/Makefile perllib/General/Makefile perllib/FVWM/Makefile perllib/FVWM/Module/Makefile perllib/FVWM/Tracker/Makefile perllib/FVWM/Module.pm rpm/Makefile rpm/fvwm.spec debian/Makefile debian/control doc/fvwm.ent doc/footer.html doc/Makefile doc/fvwm/Makefile doc/commands/Makefile doc/docbook-xml/Makefile doc/docbook-xml/ent/Makefile doc/docbook-xsl/Makefile doc/docbook-xsl/common/Makefile doc/docbook-xsl/manpages/Makefile doc/docbook-xsl/profiling/Makefile doc/docbook-xsl/highlighting/Makefile doc/docbook-xsl/lib/Makefile doc/docbook-xsl/html/Makefile doc/modules/Makefile doc/modules/images/Makefile doc/modules/images/FvwmTabs/Makefile doc/images/Makefile doc/images/svg_rendering/Makefile docs/fvwm.lsm docs/Makefile sample.fvwmrc/Makefile tests/Makefile tests/hints/Makefile po/Makefile dnl modules/FvwmAnimate/Makefile modules/FvwmAuto/Makefile modules/FvwmBacker/Makefile modules/FvwmBanner/Makefile modules/FvwmButtons/Makefile modules/FvwmCommand/Makefile modules/FvwmCommand/scripts/Makefile modules/FvwmConsole/Makefile modules/FvwmConsole/FvwmConsoleC.pl modules/FvwmCpp/Makefile modules/FvwmDebug/Makefile modules/FvwmDebug/FvwmDebug modules/FvwmDebug/FvwmGtkDebug modules/FvwmDragWell/Makefile modules/FvwmEvent/Makefile modules/FvwmForm/Makefile modules/FvwmIconBox/Makefile modules/FvwmIconMan/Makefile modules/FvwmIdent/Makefile modules/FvwmM4/Makefile modules/FvwmPager/Makefile modules/FvwmPerl/Makefile modules/FvwmPerl/FvwmPerl modules/FvwmProxy/Makefile modules/FvwmRearrange/Makefile modules/FvwmSave/Makefile modules/FvwmSaveDesk/Makefile modules/FvwmScript/Makefile modules/FvwmScript/Scripts/Makefile modules/FvwmScript/Widgets/Makefile modules/FvwmScroll/Makefile modules/FvwmTabs/Makefile modules/FvwmTabs/FvwmTabs modules/FvwmTaskBar/Makefile modules/FvwmTheme/Makefile modules/FvwmWharf/Makefile modules/FvwmWinList/Makefile modules/FvwmWindowMenu/Makefile modules/FvwmWindowMenu/FvwmWindowMenu modules/FvwmGtk/Makefile ) # --------------------------------------------------------------------------- # Original config.status is patched to make generated scripts executable. sed 's/> $ac_file/> $ac_file; test x"`head -1 $ac_file | cut -c1-2`" = x"#!" \&\& chmod a+rx $ac_file/' config.status-t && \ mv config.status-t config.status chmod +x config.status # --------------------------------------------------------------------------- # --------------------------------------------------------------------------- cat >config.status-t <>config.status-t && \ mv config.status-t config.status chmod +x config.status # --------------------------------------------------------------------------- eval my_bindir="`eval echo ${bindir}`" eval my_mandir="`eval echo ${mandir}`" eval my_moddir="`eval echo ${FVWM_MODULEDIR}`"; eval my_moddir="$my_moddir" eval my_datdir="`eval echo ${FVWM_DATADIR}`" eval my_docdir="`eval echo ${FVWM_DOCDIR}`" eval my_plldir="`eval echo ${FVWM_PERLLIBDIR}`" test x"$FVWM_PERLLIB" = x && my_plldir="(Not installed) $my_plldir" eval my_localedir="`eval echo ${LOCALEDIR}`" test x"$USE_NLS" = xno && my_localedir="(Not installed) $my_localdir" case "$with_gtk" in yes) fvwmgtk_msg=" With GDK image support in FvwmGtk? $with_gdkimlib$problem_gdkimlib With GNOME libs support in FvwmGtk? $with_gnomelibs$problem_gnomelibs" ;; no) fvwmgtk_msg="" ;; esac echo " Fvwm Configuration: Version: $VERSION$VERSIONINFO Executables: $my_bindir Man pages: $my_mandir Modules: $my_moddir Data files: $my_datdir Doc files: $my_docdir Perl lib: $my_plldir Locale msg: $my_localedir $INST_LINGUAS With Asian bi-direct. text support? $with_bidi$problem_bidi With Gettext Native Lang support? $with_gettext$problem_gettext With GTK+ required for FvwmGtk? $with_gtk$problem_gtk$fvwmgtk_msg With Iconv support? $with_iconv_type$problem_iconv With Mouse strokes (gestures)? $with_stroke$problem_stroke With PNG image support? $with_png$problem_png With ReadLine sup. in FvwmConsole? $with_readline$problem_readline With RPlay support in FvwmEvent? $with_rplay$problem_rplay With Shaped window support? $with_shape$problem_shape With Shared memory for XImage? $with_shm$problem_shm With Session Management support? $with_sm$problem_sm With SVG image support? $with_rsvg$problem_rsvg With Xcursor support? $with_xcursor$problem_xcursor With Xinerama multi-head support? $with_xinerama$problem_xinerama With Xft anti-alias font support? $with_xft$problem_xft With XPM image support? $with_xpm$problem_xpm With Xrender image support? $with_xrender$problem_xrender Build man pages? $with_mandoc$problem_mandoc Build HTML documentation? $with_htmldoc$problem_htmldoc See INSTALL.fvwm for the description of what this may mean." case "$with_xinerama_emulation" in yes) echo " Xinerama emulation enabled." ;; esac case "$ac_cv_dmalloc" in yes) echo " DMALLOC heap debugging library enabled." ;; esac case "$ac_cv_efence" in yes) echo " EFENCE debugging library enabled." ;; esac fvwm-2.6.5.orig/INSTALL0000644000175000017500000001725710360005277012667 0ustar vwcvwcBasic Installation ================== These are generic installation instructions, see also INSTALL.fvwm. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. fvwm-2.6.5.orig/Makefile.am0000644000175000017500000000504110655327373013671 0ustar vwcvwc## -*- Makefile -*- mode ## Process this file with automake to create Makefile.in ## Make sure we have a current version of automake AUTOMAKE_OPTIONS = 1.4 SUBDIRS = \ libs \ fvwm \ modules \ bin \ utils \ $(FVWM_PERLLIB) \ doc \ docs \ rpm \ debian \ sample.fvwmrc \ $(POSUB) \ tests EXTRA_DIST = \ INSTALL.fvwm \ vms/README \ vms/config.h \ vms/fvwmrc.dat \ vms/make_fvwm.mms \ vms/vms.c \ vms/vms.h \ vms/vms_shareables.opt ## --------------------------------------------------------------------------- ## Manage bzip2 archive together with gzip archive # Usage: # make dist2 # instead of make dist # make distcheck2 # instead of make distcheck # make distclean2 # instead of make distclean DISTCHECK_CONFIGURE_FLAGS = --enable-htmldoc dist2: dist gzip -dc $(distdir).tar.gz | bzip2 -9 >$(distdir).tar.bz2 distcheck2: distcheck dist2 @banner="$(distdir).tar.bz2 - ready for distribution"; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$banner"; \ echo "$$dashes" @if test "x$(ISRELEASED)" != xyes; then \ echo 'Warning: ISRELEASED is not set to "yes".'; \ echo ' So these can not be the official tarballs.'; \ fi distclean2: distclean ## --------------------------------------------------------------------------- ## Produce an rpm package using dist or from the given tarball ## (requires rpmbuild in your system) # Usage: # make rpm-dist # make release=1 rpm-dist # make rpm-this # make version=2.3.22 release=2 rpm-this # make rpm-dist cparams='--enable-multibyte --quiet' mparams='CFLAGS="-O2 -g"' # automatical regeneration is missing for other dirs, so do it explicitly rpm-regenerate: (cd rpm && $(MAKE) $(AM_MAKEFLAGS) Makefile *.spec) || exit 1 rpm-dist: dist rpm-this rpm-this: rpm-regenerate (cd rpm && $(MAKE) $(AM_MAKEFLAGS) this) || exit 1 ## ----------------------------------------------------------------- ## Produce a deb package using dist or from the given tarball ## (requires fakeroot, dpkg and debhelper in your system) # Usage: # make deb-dist # make release=1 deb-dist # make deb-this # make version=2.3.22 release=2 deb-this # make deb-dist cparams='--enable-gnome --quiet' mparams='CFLAGS="-O2 -g"' # make deb-inplace release=1.mg fullname=migo # works on sources directly deb-regenerate: (cd debian && $(MAKE) $(AM_MAKEFLAGS) Makefile control) || exit 1 deb-dist: dist deb-this deb-this: deb-regenerate $(MAKE) -f debian/Makefile $(AM_MAKEFLAGS) this || exit 1 deb-inplace: deb-regenerate $(MAKE) -f debian/Makefile $(AM_MAKEFLAGS) inplace || exit 1 fvwm-2.6.5.orig/bin/0000755000175000017500000000000011744241501012371 5ustar vwcvwcfvwm-2.6.5.orig/bin/fvwm-menu-desktop.10000644000175000017500000004774211744241304016062 0ustar vwcvwc.\" t .\" @(#)fvwm-2.6.5 20 April 2012 .de EX \"Begin example .ne 5 .if n .sp 1 .if t .sp .5 .nf .in +.5i .. .de EE .fi .in -.5i .if n .sp 1 .if t .sp .5 .. .ta .3i .6i .9i 1.2i 1.5i 1.8i .TH fvwm-menu-desktop 1 "20 April 2012 (2.6.5)" Fvwm "Fvwm Modules" .UC .SH NAME fvwm-menu-desktop \- builds GNOME and KDE menus and style commands for fvwm .SH SYNOPSIS fvwm-menu-desktop [ \fB\-\-help\fR|\fB\-h\fR|\fB\-?\fR ] [ \fB\-\-version\fR|\fB\-v\fR|\fB\-V\fR ] [ \fB\-\-install\-prefix\fR \fIDIR\fR ] [ \fB\-\-desktop\fR \fINAME\fR ] [ \fB\-\-type\fR NAME\fR ] [ \fB\-\-fvwmgtk\-alias\fR \fINAME\fR ] [ \fB\-\-title\fR \fINAME\fR ] [ \fB\-\-name\fR \fINAME\fR ] [ \fB\-\-merge-user-menu\fR ] [ \fB\-\-enable\-mini\-icons\fR ] [ \fB\-\-enable\-tran\-mini\-icons\fR ] [ \fB\-\-mini\-icons\-path\fR \fIDIR\fR ] [ \fB\-\-png\-icons\-path\fR \fIDIR\fR ] [ \fB\-\-tran\-mini\-icons\-path\fR \fIDIR\fR ] [ \fB\-\-check-mini\-icons\fR \fIPATH\fR ] [ \fB\-\-icon\-toptitle\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR:\fIside_pic\fR:\fIcolor\fR ] [ \fB\-\-icon\-title\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR:\fIside_pic\fR:\fIcolor\fR ] [ \fB\-\-icon\-folder\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR ] [ \fB\-\-icon\-app\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR ] [ \fB\-\-wm\-icons\fR ] [ \fB\-\-enable\-style\fR ] [ \fB\-\-enable\-tran\-style\fR ] [ \fB\-\-icon-style\fR \fImicon\fR:\fIicon\fR:\fIlaw\fR ] [ \fB\-\-icons\-path\fR \fIDIR\fR ] [ \fB\-\-tran\-icons\-path\fR \fIDIR\fR ] [ \fB\-\-check-icons\fR \fIPATH\fR ] [ \fB\-\-submenu\-name\-prefix\fR \fIname\fR ] [ \fB\-\-dir\fR \fIDIR\fR ] [ \fB\-\-destroy\-type\fR \fIFLAG\fR ] [ \fB\-\-xterm\fR \fICMD\fR ] [ \fB\-\-lang\fR \fINAME\fR ] [ \fB\-\-utf8\fR ] [ \fB\-\-uniconv\fR \fIcharset\fR ] [ \fB\-\-uniconv-exec\fR \fIexec\fR ] [ \fB\-\-menu-style\fR \fIname\fR ] [ \fB\-\-no\-check\-app\fR ] [ \fB\-\-time\-limit\fR \fINUM\fR ] [ \fB\-\-kde_config\fR \fIcommand\fR ] .SH DESCRIPTION This is a perl script which parses XDG (GNOME or KDE) menus definitions to build corresponding fvwm menus. The script can also build icon and mini\-icon style commands for the applications. .SH USAGE There are a lot of options. However the defaults are, I hope, good enough. If you want the application menu in the menu "Utilities" add the following lines in your .fvwm2rc file: .EX ... AddToMenu Utilities "Application Menu" Popup FvwmMenu ... PipeRead 'fvwm-menu-desktop' .EE If the KDE mini\-icons are in "mini/" relative to your fvwm ImagePath add the option \-\-enable-mini\-icons. (if the KDE mini\-icons are in some other place use the \-\-mini\-icons\-path option, e.g., they are in your ImagePath plus \-\-mini\-icons\-path). If you want to build Icon and MiniIcon style commands for KDE applications, add the option \-\-enable-style. If you want to have the KDE user menu replace "sys" by "user". If you use the KDE menu editor, you may want to pop this menu up dynamically. Then, put this into your .fvwm2rc file (note the destroy-type). .EX AddToMenu Utilities "KDE User Menu" Popup kde\-user ... AddToMenu kde\-user + DynamicPopupAction PipeRead 'fvwm-menu-desktop --desktop kde-user --enable-mini-icons [--destroy-type dynamic] [other options]' .EE The following example builds "all" GNOME menus (with some mini\-icons in the system menu). You need to specify the GNOME installation prefix if it is not /usr (with the option \-\-install\-prefix). Moreover, the GNOME icons need to be in your ImagePath and the non .png mini\-icons you use for the user\-menu need to be in mini/ (if not, use the \-\-png\-icons\-path option and the \-\-mini\-icons\-path option, respectively). .EX Module FvwmGtk *FvwmGtk: Destroy gnome-all *FvwmGtk: Menu gnome-all *FvwmGtk: Title "Gnome Menus" *FvwmGtk: Separator *FvwmGtk: Destroy gnome-sys *FvwmGtk: Submenu "System" gnome-sys *FvwmGtk: Destroy gnome-user *FvwmGtk: Submenu "User" gnome-user *FvwmGtk: Destroy gnome-redhat *FvwmGtk: Submenu "RedHat" gnome-redhat PipeRead 'fvwm-menu-desktop --type gtk --enable-mini-icons --icon-folder :re --icon-app :re --icon-title :re --icon-toptitle :re' PipeRead 'fvwm-menu-desktop --type gtk --desktop gnome-user --enable-mini-icons' PipeRead 'fvwm-menu-desktop --type gtk --desktop gnome-redhat --enable-mini-icons' # To obtain the menu above with Alt-button1 on the root window Mouse 1 R M SendToModule FvwmGtk gnome-all .EE You can specify FvwmGtk alias: Module FvwmGtk MyGnomeMenu. In this case you must pass an additional parameter to fvwm-menu-desktop: \-\-fvwmgtk-alias MyGnomeMenu. Of course you can build fvwm (i.e., no FvwmGtk) GNOME menus. GNOME and KDE2 use PNG icons which are not supported by fvwm menu. However, if you have XPM version of the GNOME or of the KDE2 (mini-)icons you can build fvwm menus and style commands with these icons using the option \-\-enable-tran-mini\-icons and \-\-enable\-tran\-style. The Fvwm Themes package (http://fvwm-themes.sourceforge.net/) contains an utility, fvwm-themes-images, which can convert automatically (with the help of ImageMagick) all GNOME and KDE2 icons to XPM icons. You can build sub menus using the \-\-dir options. However, if you want to use more than one submenu it is better to build the "all" menu and to use the submenu names. See the option \-\-submenu\-name\-prefix for information on submenu names. Nevertheless, you may put the menu in a tmp file using redirection to see the submenu names. If you think that fvwm-menu-desktop slows your startup too much do not use PipeRead. Instead run fvwm-menu-desktop and redirect the menu to a file and Read that file in your .fvwm2rc file. Another possibility is to use DynamicPopupAction (with fvwm menu), the menu (and the styles) will be built only if you pop up the menu. The following menu creates a "kde\-all" menu which contains the user menu which is built each time you pop up "kde\-all" and contains a pop up to the system menu which is built only the first time you pop it up. .EX AddToMenu kde\-all + DynamicPopupAction FuncRecreateKdeAll AddToMenu kde\-sys + DynamicPopupAction PipeRead 'fvwm-menu-desktop \\ \-\-desktop kde\-sys [options, but \-\-destroy-type d* or n*]' AddToFunc FuncRecreateKdeAll \\ I PipeRead 'fvwm-menu-desktop \\ \-\-desktop kde\-user \-\-enable\-mini\-icons \-\-name kde\-all \\ \-\-destroy-type dynamic [options you like]' + I AddToMenu "kde\-all" "" Nop + I AddToMenu "kde\-all" "Kde System%mini/mini\-k.xpm%" Popup kde\-sys .EE fvwm-menu-desktop takes into account your $LANG environment variable, which may be overwritten using the --lang option. Hint, if you need a different menu font or item format from the ones used in the default MenuStyle, you may use the --menus-style option to assign a non-default MenuStyle name to menus built by this script. Don't forget to create a new menu style in your .fvwm2rc, using CopyMenuStyle and MenuStyle commands. .SH OPTIONS .IP "Main Options" .IP "\fB\-\-help\fR" Show the help and exit. .IP "\fB\-\-version\fR" Show the version and exit. .IP "\fB\-\-install-prefix\fR \fIDIR\fR" The prefix of GNOME or KDE installation. Default is /usr for GNOME (other common prefixes: /usr/local, /opt/gnome). For KDE the default is $KDEDIR and you probably do not need to use this option. .IP "\fB\-\-desktop\fR \fINAME\fR" Use gnome\-sys for the GNOME system menu (this is the default), gnome\-user for the GNOME user menu, gnome\-redhat for the AnotherLevel menu of Red Hat, gnome\-mandriva for Mandriva menudrake menus, kde\-sys for the KDE system menu and kde\-user for the KDE user menu. It may be useful to use KDE or GNOME as a flag with the \-\-dir option. .IP "\fB\-\-type\fR \fINAME\fR" If NAME is fvwm, a native fvwm menu will be built (this is the default). If NAME is gtk, a FvwmGtk menu will be built. .IP "\fB\-\-fvwmgtk-alias\fR \fINAME\fR" The name for then FvwmGtk module to use instead of default FvwmGtk. .IP "\fB\-\-title\fR \fINAME\fR" Define the menu title of the top menu. Default is "Gnome System Menu" for gnome\-sys, "Gnome User Menu" for gnome\-user, "Gnome Red Hat Menu" for gnome\-redhat, "Gnome Mandriva Menu" for gnome\-mandriva. For KDE the default is given by KDE itself (or are similar to GNOME title). .IP "\fB\-\-name\fR \fINAME\fR" Define the menu name of the top menu. Default is the \-\-desktop name if you use one above. .IP "\fB\-\-merge-user-menu\fR" this option tries to merge the user menu with the system menu (gnome-sys or kde-sys, based on the --desktop option) and takes into account changes to the system menu that it is now possible to do in the "user directory" (at least with KDE version 2 menu editor). .IP "Icons Options" By default, fvwm-menu-desktop builds mini\-icon free menus. To enable mini\-icons use one of the two following options. .IP "\fB\-\-enable\-mini\-icons\fR" This option enables mini\-icons in the menu. The desktop hints are used if it is possible (fvwm menu can't use .png icons). Use the \-\-mini\-icons\-path and the \-\-png\-icons\-path to specify the good paths. By using the \-\-icon-* options below you can control mini\-icons in menus. .IP "\fB\-\-enable\-tran\-mini\-icons\fR" This option applies only to fvwm menus and is useful to build GNOME or KDE2 menus with mini\-icons (and if you have XPM version of the GNOME or KDE2 PNG icons). If this option is used any icon hint foo.png is translated to path/foo.xpm where path is determined by the \-\-tran\-mini\-icons\-path option (xpm icons are used as with the previous option). .IP "\fB\-\-mini\-icons\-path\fR \fIDIR\fR" Define the directory of the .xpm mini\-icons (relative to your ImagePath). Default is "mini/". .IP "\fB\-\-png\-icons\-path\fR \fIDIR\fR" Define the directory of .png icons. Default is "" (i.e., in your ImagePath). Useful only with FvwmGtk menus. .IP "\fB\-\-tran\-mini\-icons\-path\fR \fIDIR\fR" Define the directory of the mini\-icons for the \-\-enable\-tran\-mini\-icons option. Default is mini/. It is preferable to give the complete path so that fvwm-menu-desktop can check if the translated mini\-icons exists (and the "re" law will apply in a good way). .IP "\fB\-\-check\-mini\-icons\fR \fIPATH\fR" Where PATH is a list of directories with ":" as a separator. Then, fvwm-menu-desktop checks that the mini icons actually exist in one of these directories (this check is not done for the translated mini icons). .IP Comments To control mini\-icons in menus you can use the 4 following options which work similarly. In these options \fIlaw\fR may be \fIno\fR, \fIdh\fR, \fIre\fR or \fIow\fR. \fIno\fR means "do not use mini\-icon" (this does not affect side pic). \fIdh\fR means "use only the mini\-icons GNOME/KDE hints". \fIre\fR means "use mini\-icons GNOME/KDE hints but if it is empty use the specified mini\-icon". \fIow\fR means "override the mini\-icons GNOME/KDE hints by the specified mini\-icon". The path to the specified icons is given by the options \-\-mini\-icons\-path, \-\-png\-icons\-path or \-\-tran\-mini\-icons\-path (i.e., you just have to specify the icon, the path is computed). For the sidepic you need to give the complete relative path from your ImagePath. Note that for the fvwm menu (without the \-\-enable\-tran\-mini\-icons option) a .png icon hint is considered as an empty hint, so for the system menu use no=dh and re=ow (you may use .xpm icons in a user menu). If the \-\-tran\-mini\-icons\-path option is set with a complete path, then if the .xpm icon which corresponds to a .png icon hint does not exist, the icon hint is considered as empty. \fIplace\fR, \fIsidepic\fR and \fIcolor\fR apply only with fvwm menus. \fIplace\fR is either left or up. \fIleft\fR means that the icon will be placed on the left of the label. \fIup\fR means that the icon will be placed above the label. \fIsidepic\fR needs to be nothing or an icon (for a picture in the bottom left of the menu). \fIcolor\fR applies only if a sidepic icon is given and it is the color for the region of the menu containing the sidepic picture. When you use an option below, if an icon, a law ...etc is not specified (i.e., empty) the default is used (e.g, if you want, for an fvwm menu, the icon folder.xpm on the left of the top title and the sidepic fvwm2.xpm on the left of this menu use the following: \-\-icon\-toptitle :ow::fvwm2.xpm). .IP "\fB\-\-icon-toptitle\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR:\fIsidepic\fR:\fIcolor\fR" Mini\-icon for the top title and sidepic for the top menu. Default for fvwm menus: folder.xpm:no:left::. Default for fvwm menus with \-\-enable\-tran\-mini\-icons: gnome\-logo\-icon\-transparent.xpm:no:left:. Default for gtk menus: gnome\-logo\-icon\-transparent.png:no. .IP "\fB\-\-icon\-title\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR:\fIsidepic\fR:\fIcolor\fR" Use the option below for submenus. Default for fvwm menus: folder.xpm:dh:left::. Default for fvwm menus with \-\-enable\-tran\-mini\-icons: gnome\-folder.xpm:dh:left::. Default for gtk menus: gnome\-folder.png:dh .IP "\fB\-\-icon\-folder\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR:\fIsidepic\fR:\fIcolor\fR" Mini-icons for pop up item. Default for fvwm menus: folder.xpm:dh:left. Default for fvwm menus with \-\-enable\-tran\-mini\-icons: gnome\-folder.xpm:dh:left. Default for gtk menus: gnome\-folder.png:dh. .IP "\fB\-\-icon\-app\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR" Mini\-icon for applications item. Default for fvwm menus: mini\-x.xpm:dh. Default for fvwm menus with \-\-enable\-tran\-mini\-icons: gnome\-default.xpm:dh. Default for gtk menus: gnome\-default.png:dh .IP \fB--wm-icons\fR This is a shortcut, which can be used if you plan to use icons from the wm-icons package. Currently this is equivalent to: \-\-enable\-mini\-icons \-\-mini\-icons\-path '' \-\-icon\-toptitle menu/folder-open.xpm:ow \-\-icon\-title menu/folder-open.xpm:ow \-\-icon\-folder menu/folder.xpm:ow \-\-icon\-app menu/utility.xpm:ow. .IP "Style Options" .IP "\fB\-\-enable-style\fR \fImini\-icon\fR:\fIicon\fR:\fIlaw\fR:\fIaddstyle\fR" Build icons and mini\-icons style commands for the applications in the built menu. .IP "\fB\-\-style\-tran\fR" Only useful with FvwmGtk GNOME or KDE2 menus. Make translation as the enable\-tran\-mini\-icon option but only for style (not for mini\-icons menus). .IP "\fB\-\-icon-style\fR \fImini\-icon\fR:\fIicon\fR:\fIlaw\fR:\fIaddstyle\fR" This option is similar to the options \-\-icon-* above. Default law is "dh" (there is no "no" law). Default mini\-icon is mini\-x.xpm and default icon is x.xpm. You can add a style to all applications with addstyle. If you use the enable\-tran\-mini\-icon options the translated (mini\-)icons will be used (if translation is needed) and the default icons are gnome\-default.xpm. If you use the \-\-enable\-tran\-style options above the default icons are gnome\-default.xpm. The paths to mini\-icons are the same as those for the menus. The path to the icons is computed from the mini\-icons path: they are one directory up to the corresponding mini\-icons path (so the "defaults" are "" and this is consistent with KDE1 and XPM icons builded by fvwm-themes-images). .IP "\fB\-\-icons\-path\fR \fIDIR\fR" Not useful in a normal situation. Define the directory of the icons. Default is one directory up from the path given by the \-\-mini\-icons\-path option. To set the path to "" you need to use "inpath". .IP "\fB\-\-tran\-icons\-path\fR \fIDIR\fR" Similar to the above option. .IP "\fB\-\-check\-icons\fR \fIPATH\fR" Where PATH is a list of directories with ":" as a separator. Then, fvwm-menu-desktop checks that the icons actually exist in one of these directories (this chack is not done for the translated icons, use a full path in --tran-icons-path to do so). .IP "Other Options" .IP "\fB\-\-submenu\-name\-prefix\fR \fINAME\fR" May be useful in some unfortunate cases. By default the name of a sub menu is of the form prefix\-adirname\-level where prefix is the desktop flag, adirname is the name of the directory of the description of the sub menus (not a complete path) and where level is an integer equal to the number of "cd"s you need to do to go from the root to the directory of the description of the sub menus. You may change the prefix using the present option. .IP "\fB\-\-dir\fR \fIDIR\fR" Set the directory where fvwm-menu-desktop looks for a GNOME/KDE menu description to \fIDIR\fR. The name of the menu is 'desktop\-name' and the title is 'desktop' name where 'desktop' is either GNOME or KDE (if fvwm-menu-desktop can't find which desktop is concerned, you can help with the \-\-desktop option) and where 'name' is the name of the right directory of \fIDIR\fR (or a hint of the desktop for the title). Note that if this option is not set, the description directory is install\-prefix/share/gnome/apps if \-\-desktop is gnome\-sys, $HOME/.gnome/apps if \-\-desktop is gnome\-user, $HOME/.gnome/apps\-redhat if \-\-desktop is gnome\-redhat, $HOME/.gnome/apps\-mdk if \-\-desktop is gnome\-mandriva, $KDEDIR/share/applink if \-\-desktop is kde\-sys and $HOME/.kde/share/applnk if\-\-desktop is sys\-user. .IP "\fB\-\-destroy\-type\fR \fIflag\fR" flag may be "y(es)", "no", "d(ynamic)". Default is "yes" with fvwm menus, "no" with FvwmGtk menus and dynamic applies only with fvwm menus. If "yes" is used the top menu will be destroyed (DestroyMenu "name"), if "no" is used the top menu will not be destroyed (useful for FvwmGtk menus called by another menu via FvwmGtkSubMenu or to give the same name to two or more menus built by fvwm-menu-desktop). If dynamic is used the menu will be destroyed/recreated (may be useful with DynamicPopupAction). Note that all the built sub menus are always destroyed. .IP "\fB\-\-xterm\fR \fICMD\fR" Define complete X terminal command to run applications in it if needed. Default is 'xterm -e'. .IP "\fB\-\-lang\fR \fINAME\fR" Default is the value of $LANG. Useful if your language is not GNOME/KDE compliant and you prefer a non-English compliant language. Also useful if fvwm-menu-desktop gives bad result with your language. .IP "\fB\-\-utf8\fR" Assume that the desktop entries used UTF-8 encoding. This is the case with KDE version 2 and will be probably the case with GNOME version 2. At the present time this option work only if you have perl version 5.6 or better and if your language use latin-1 font. If one of these conditions is not satisfied, then this option is equivalent to \-\-lang en. For other languages/charsets use the \-\-uniconv option. The advantage of this option as compared to the following option is that it is fast. .IP "\fB\-\-uniconv\fR \fIcharset\fR" Use iconv, uniconv or internal method to translate utf8 desktop entries into an appropriate "charset". You can choose between one of the supported tools using \-\-uniconv-exec option. iconv comes with glibc >= 2.1.1 and uniconv comes with the utf8 editor yudit. Type "iconv --list" or "man uniconv" for the list of supported charsets. Of course you must also use the appropriate font using the MenuStyle command. Also, $LANG (or --lang xx) must be compatible with the charset. Note, if you don't use an internal method, fvwm-menu-desktop is very slow with this option: you probably need to use the --time-limit option and you should redirect the result into a file and read this file in your fvwm configuration. .IP "\fB\-\-uniconv-exec\fR \fIexec\fR" Not used, kept for legacy purposes. .IP "\fB\-\-menu-style\fR \fIname\fR" By default the generated fvwm menus use the default MenuStyle (i.e., the MenuStyle "*"). You can specify another MenuStyle name using this option. .IP "\fB\-\-[no]check-app\fR" Not used, kept for legacy purposes. .IP "\fB\-\-time-limit\fR \fINUM\fR" Not used, kept for legacy purposes. .IP "\fB\-\-kde_config\fR \fIcommand\fR" If available, this script uses the command kde-config or kde4-config to find the XDG menus. If the kde-config command has another name you can use this option to set the command name. If this script can't find any kde-config command, it does it's best to run without it. .SH BUGS This script needs more testing to see if all options work well (note that the script does not check for inconsistency of the given options). If Desktop menu hints are changed the script may not work as expected. I have tested the script with gnome-core-1.0.3, kde-1.1, kde-1.2 and kde-2.0. .SH AUTHORS Olivier Chapuis Mikhael Goikhman - some changes .SH COPYING The script is distributed by the same terms as fvwm itself. See GNU General Public License for details. fvwm-2.6.5.orig/bin/fvwm-convert-2.2.1.in0000644000175000017500000000210710656151546016026 0ustar vwcvwc.\" @(#)@PACKAGE@-@VERSION@ @RELDATELONG@ .TH fvwm-convert-2.2 1 "@RELDATELONG@ (@VERSION@)" Fvwm "Fvwm Modules" .SH NAME fvwm-convert-2.2 \- convert fvwm 1.xx configuration file to fvwm 2.xx style .SH SYNOPSIS .B fvwm-convert-2.2 .RI [ source ] .RI [ dest ] .SH DESCRIPTION .B fvwm-convert-2.2 is a simple program that tries to convert an fvwm 1.xx configuration file into an fvwm 2.xx compatible format. It is not perfect, especially with regards to Mouse and Key commands, but it provides a basically-working \fI.fvwm2rc\fR file which can be further modified at leisure. .PP By default, the program will convert \fI~/.fvwmrc\fR, saving the results in \fI~/.fvwm2rc\fR. Different source and destination files may be given, with a destination of `-' meaning standard output. If the destination file already exists, it will be backed up first to \fI~/.fvwm2rc.bak\fR (with whatever the destination file is called replacing \fI~/.fvwm2rc\fR). .SH COMPATIBILITY In the past this utility was called .IR fvwmrc_convert . .SH AUTHOR This manual page was written by Julian Gilbey . fvwm-2.6.5.orig/bin/fvwm-convert-2.6.10000644000175000017500000000707211744241304015422 0ustar vwcvwc.\" @(#)fvwm-2.6.5 20 April 2012 .TH fvwm-convert-2.6 1 "20 April 2012 (2.6.5)" Fvwm "Fvwm Modules" .SH NAME fvwm-convert-2.6 \- convert fvwm 2.4.x configuration file to fvwm 2.6 style .SH SYNOPSIS .B fvwm-convert-2.6 .RI [ --follow-read | -f ] .RI [ --help | -h ] .RI source .RI [ dest ] .SH OPTIONS The following options are supported: .IP "\fB\-\-help\fR | \fB\-h\fR" Prints a usage message to the screen. .IP "\fB\-\-follow\-read\fR | \fB\-f\fR" Follows files found along with the .B Read command. .SH DESCRIPTION .B fvwm-convert-2.6 converts an fvwm 2.4.x configuration file into a fvwm 2.6 file with compatible syntax. It is not suitable to convert older 2.x configuration files. Please use .B fvwm-convert-2.2 to convert these to the 2.2.x format first, and then if necessary .B fvwm-convert-2.4 .PP By default, .B fvwm-convert-2.6 won't look for a given config file. This must be specified as the first parameter to .B fvwm-convert-2.6. Different source and destination files may be given. If the destination file already exists, this program exits. If no destination file is given, then the filename is the same name as the source file with the suffix ".converted" added. Without an absolute path given as the destination path to the destination file, the program will create the destination file in the CWD. .PP .B fvwm-convert-2.6 makes the following changes: .TP 4 .B Style lines In fvwm 2.4, most style options could be negated from their counterparts using NoFoo -- fvwm-convert-2.6 corrects this by now using !Foo. .TP 4 .B ModulePath In fvwm 2.4 and beyond, the ModulePath is compiled into fvwm. .B fvwm-convert-2.6 comments out any ModulePath commands it finds. If you are using your own modules, (not the ones that come with fvwm), you will have to fix your configuration file after using .BR fvwm-convert-2.6 . .TP 4 .B Conditional command syntax In fvwm 2.4, the conditional command options were whitespace-separated -- they should now be comma-separated instead. In addition, the older syntax to Next and Prev of using [*] to denote all windows has been removed entirely. Both these checks and conversions are done on function commands, key/mouse bindings. .TP 4 .B WindowShadeSteps In fvwm 2.4, the WindowShadeSteps command is replaced by the WindowShadeSteps Style option. .B fvwm-convert-2.6 makes this change. .TP 4 .B FvwmTheme In fvwm 2.6, the FvwmTheme module is replaced by a series of Colorset commands. Whilst .B fvwm-convert-2.6 will try and make this change, it is still recommended that this is checked after conversion. .TP 4 .B EdgeResistance In fvwm 2.6, the EdgeResistance command is has been split to include an additional style option for EdgeMoveResistance. .B fvwm-convert-2.6 makes any changes necessary. .TP 4 .B StartFunction / RestartFunction / InitFunction In fvwm 2.6, the need for using InitFunction and/or RestartFunction is redundant when StartFunction is read at both of these times. .B fvwm-convert-2.6 attempts to convert this. .TP 4 .B Read If .B -f or .B --follow-read is given, any files .B fvwm-convert-2.6 can detect and open will be converted automatically, else a list of files that can be followed are printed to the screen. .TP 4 .SH BUGS .I InitFunction and .I RestartFunction and hence .I StartFunction are printed at the end of the files -- this slight reordering might put some comments before in an odd spot. When converting over FvwmTheme lines, the colorset definitions might well be broken, but these cannot easily be converted. Bug reports can be sent to the fvwm-workers mailing list (see the .IR FAQ ). .SH AUTHOR Thomas Adam fvwm-2.6.5.orig/bin/fvwm-root.10000644000175000017500000000720511744241304014420 0ustar vwcvwc'\" t .\" @(#)fvwm-2.6.5 20 April 2012 .TH fvwm-root 1 "20 April 2012 (2.6.5)" Fvwm "Fvwm Modules" .UC .SH NAME fvwm-root \- Sets the root window of the current X display to image .SH SYNOPSIS .B fvwm-root .RB [ "--retain-pixmap" | "-r" ] .RB [ "--no-retain-pixmap" ] .RB [ "--dummy" | "-d" ] .RB [ "--no-dummy" ] .RB [ "--dither" ] .RB [ "--no-dither" ] .RB [ "--color-limit" .RI [ ncolors "] ]" .RB [ "--no-color-limit" ] .RB [ "--help" | "-h" | "-?" ] .RB [ "--version" | "-V" ] .I image_file .SH DESCRIPTION .I fvwm-root reads the image file specified in the command line and displays it in the root window. The supported image formats are .IR XBM ", " XPM ", " PNG " and " SVG if appropriated libraries are compiled in. SVG rendering options .RB " (as described in the " " ICONS AND IMAGES " section of the main fvwm documentation) can be utilized. .SH OPTIONS These command line options are recognized by fvwm-root: .TP .BR "--retain-pixmap" " | " "-r" Causes fvwm-root to retain and publish the Pixmap with which the background has been set (the ESETROOT_PMAP_ID and _XROOTPMAP_ID properties are used). This is useful for applications which want to use the root Pixmap on the background to simulate transparency (for example, Eterm and Aterm use this method). This option should also be used for the RootTransparent colorset option, refer to the COLORSETS section of fvwm(1). If this option is not used, fvwm-root sets the _XSETROOT_ID property to None, and some programs, like fvwm modules, may use this to update their background if the background is transparent (Transparent colorset). Note, a well behaved program, like fvwm, should listen to both _XSETROOT_ID and _XROOTPMAP_ID property changes and update itself correspondingly. However some programs listen only to one of them, so you should either use this option or not depending on what part is implemented by these programs. You should also use this option to get fast root-transparent menus in fvwm. .TP .BI "--no-retain-pixmap" This is a default. May be useful to explicitely force the default even if "--retain-pixmap" is specified earlier. .TP .BR "--dummy" " | " "-d" Causes fvwm-root NOT to set the background, but to only free a memory associated with the ESETROOT_PMAP_ID property (if any). In any case the _XSETROOT_ID property is set to None. .TP .BI "--no-dummy" This is a default. May be useful to explicitely force the default even if "--dummy" is specified earlier. .TP .BI "--dither" Causes fvwm-root to dither images for "smoother" rendition on displays with color depth of 16 or lower. This the defaut with color depth less or equal to 8. .TP .BI "--no-dither" Causes fvwm-root NOT to dither images. This is the default with color depth greater than 8. .TP .BI "--color-limit " ncolors Causes fvwm-root to limit its color use to .I ncolors (if specified). This option is taken in account only with color depth less or equal to 8 (and a TrueColor or GrayScale visual). The default is to use the same color limit as fvwm. So in normal situation this option is not useful. However, if fvwm use a private colors map, as fvwm-root always use the default colors map you should use this option for limiting colors correctly. If .I ncolors is not specified a default is used. .TP .BI "--no-color-limit" Causes fvwm-root NOT to limit its color use. .TP .BI "--help" Shows a short usage. .TP .BI "--version" Shows a version number. .SH COMPATIBILITY In the past this utility was called .IR xpmroot . This name is still supported as a symlink. .SH BUGS Repeated use of fvwm-root with different xpm pixmaps will use up slots in your color table pretty darn fast. .SH AUTHOR Rob Nation Rewritten and enhanced by fvwm-workers. fvwm-2.6.5.orig/bin/fvwm-menu-headlines.10000644000175000017500000003444711161434720016342 0ustar vwcvwc.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.02) .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "fvwm-menu-headlines 1" .TH fvwm-menu-headlines 1 "2009-03-22" "2.5.28 (from cvs)" "Fvwm Utilities" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" fvwm\-menu\-headlines \- builds headlines menu definition for fvwm .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBfvwm-menu-headlines\fR [ \fB\-\-help\fR|\fB\-h\fR|\fB\-?\fR ] [ \fB\-\-version\fR|\fB\-V\fR ] [ \fB\-\-info\fR [site] ] [ \fB\-\-site\fR|\fB\-s\fR site ] [ \fB\-\-name\fR|\fB\-n\fR name ] [ \fB\-\-title\fR|\fB\-t\fR title ] [ \fB\-\-item\fR item ] [ \fB\-\-exec\fR|\fB\-e\fR exec-command ] [ \fB\-\-command\fR|\fB\-e\fR fvwm-command ] [ \fB\-\-icon\-title\fR icon ] [ \fB\-\-icon\-item\fR icon ] [ \fB\-\-icon\-home\fR icon ] [ \fB\-\-icon\-error\fR icon ] [ \fB\-\-wm\-icons\fR ] [ \fB\-\-frontpage\fR [where] ] [ \fB\-\-proxy\fR|\fB\-p\fR host:port ] [ \fB\-\-file\fR [file] ] [ \fB\-\-fake\fR [file] ] [ \fB\-\-timeout\fR seconds ] .SH "DESCRIPTION" .IX Header "DESCRIPTION" This configurable perl script builds an fvwm menu definition for headlines of popular news web sites: FreshMeat, Slashdot, LinuxToday, DaemonNews, GNOME-News, KDE-News, RootPrompt, LinuxFr, ThinkGeek, \s-1CNN\s0, \s-1BBC\s0 and more. .PP It is possible to specify a customized menu item format, change a command (usually launching a browser) and add menu icons (there is a support for the wm-icons package). .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-\-help\fR" 4 .IX Item "--help" show the help and exit .IP "\fB\-\-version\fR" 4 .IX Item "--version" show the version and exit .IP "\fB\-\-info\fR [site]" 4 .IX Item "--info [site]" if site name is given print the site specific info, otherwise print all site names .IP "\fB\-\-site\fR site" 4 .IX Item "--site site" defile a web site, headlines of which to show, this option also can be used together with \-\-help to get new defaults. Default site: freshmeat. .IP "\fB\-\-name\fR name" 4 .IX Item "--name name" define menu name (default is \*(L"MenuHeadlinesFreshmeat\*(R") .IP "\fB\-\-title\fR title" 4 .IX Item "--title title" define menu title (default is \*(L"Freshmeat Headlines\*(R"). .IP "\fB\-\-item\fR label-format" 4 .IX Item "--item label-format" .PD 0 .IP "\fB\-\-exec\fR command-format" 4 .IX Item "--exec command-format" .PD define format for menu item or command (what is shown and what is executed when the item is chosen). Default label is '%h\et%[(%Y\-%m\-%d \f(CW%H:\fR%M)]'. \s-1TAB\s0 can be specified as '\et', but in .fvwm2rc you should specify a double backslash or a real \s-1TAB\s0. .Sp Format specifiers for a headline format: .Sp .Vb 11 \& %h \- headline \& %u \- url \& %d \- date in the native format (that site backend supplied) \& %[strftime\-argument\-string] \- date/time, see strftime(3) \& the date/time is represented according to the local time; \& date and/or time fields that can\*(Aqt be guessed are stripped \& Example: %[|%d %B %Y| %H:%M %S] \& If site supplied only date \- this becomes %[|%d %B %Y|], \& if site supplied no date \- this becomes an empty string. \& %{name} \- site specific named value, like %{comments} \& %(text) \- arbitrary text, good for escaping or aligning .Ve .Sp These specifiers can receive an optional integer size, positive for right adjusted string or negative for left adjusted, example: \f(CW%8x\fR; and optional *num or *\-num, which means to leave only the first or last (if minus) num of chars, the num must be greater than 3, since the striped part is replaced with \*(L"...\*(R", example: %*30x. Both can be combined: %\-10*\-20x, this instructs to get only the 20 last characters, but if the length is less then 10 \- to fill with up to 10 spaces on the right. .Sp Example: .Sp .Vb 1 \& \-\-exec "iceweasel \-remote \*(AqopenURL(%u, new\-window)\*(Aq || iceweasel \*(Aq%u\*(Aq" .Ve .IP "\fB\-\-command\fR command-format" 4 .IX Item "--command command-format" like \fB\-\-exec\fR above, but enables to specify any fvwm command, for example, \*(L"Function FuncFvwmShowURL '%u'\*(R" not only Exec. .Sp In fact, \-\-exec=\*(L"mozilla '%u'\*(R" is equivalent to \-\-command=\*(L"Exec mozilla '%u'\*(R" .IP "\fB\-\-icon\-title\fR icon" 4 .IX Item "--icon-title icon" .PD 0 .IP "\fB\-\-icon\-item\fR icon" 4 .IX Item "--icon-item icon" .IP "\fB\-\-icon\-home\fR icon" 4 .IX Item "--icon-home icon" .IP "\fB\-\-icon\-error\fR icon" 4 .IX Item "--icon-error icon" .PD define menu icon for title, regular item, frontpage item and error item respectively. Default is no menu icons (equivalent to an empty icon argument). .IP "\fB\-\-wm\-icons\fR" 4 .IX Item "--wm-icons" define icon names suitable for use with wm-icons package. Currently this is equivalent to: \-\-icon\-title '' \-\-icon\-item menu/information.xpm \-\-icon\-home menu/home.xpm \-\-icon\-error menu/choice\-no.xpm. .IP "\fB\-\-frontpage\fR [where]" 4 .IX Item "--frontpage [where]" add the site frontpage item to the menu. Optional value can be used to specify where this item will be placed in the menu \- 'top' or 't', 'bottom' or 'b'. .IP "\fB\-\-proxy\fR host[:port]" 4 .IX Item "--proxy host[:port]" define a proxy to use. Example: \-\-proxy proxy.inter.net:3128 .IP "\fB\-\-file\fR [file]" 4 .IX Item "--file [file]" write the menu output to specified file. If no filename is given with this option (or empty filename), the default filename \s-1WORK_HOME/SITE\s0.menu is used. Without this option or with '\-' filename, the menu output is written to standard output. .IP "\fB\-\-fake\fR [file]" 4 .IX Item "--fake [file]" don't connect to the host using \s-1HTTP\s0 protocol, instead, read from \s-1WORK_HOME/SITE\s0.in file. The following reads input from freshmeat.in (downloaded http://freshmeat.net/backend/recentnews.txt) and saves output to segfault.menu (both files are in \s-1WORK_HOME\s0): fvwm-menu-headlines \-\-site freshmeat \-\-fake \-\-file .IP "\fB\-\-timeout\fR seconds" 4 .IX Item "--timeout seconds" limit a line reading from a socket to this timeout, the default timeout is 20 seconds. .PP \&\s-1WORK_HOME\s0 of this script is ~/.fvwm/.fvwm\-menu\-headlines. It is created if needed. .PP Option parameters can be specified either using '=' or in the next argument. Short options are ok if not ambiguous: \f(CW\*(C`\-h\*(C'\fR, \f(CW\*(C`\-t\*(C'\fR; but be careful with short options, what is now unambiguous, can become ambiguous in the next versions. .SH "USAGE" .IX Header "USAGE" 1. One of the ways to use this script is to define a crontab entry to run the script every hour or so for every monitored site: .PP .Vb 3 \& 0,30 * * * * fvwm\-menu\-headlines \-\-file \-\-site freshmeat \& 1,31 * * * * fvwm\-menu\-headlines \-\-file \-\-site linuxtoday \& 2,32 * * * * fvwm\-menu\-headlines \-\-file \-\-site slashdot .Ve .PP Then add these lines to your fvwm configuration file: .PP .Vb 3 \& DestroyFunc FuncFvwmMenuHeadlines \& AddToFunc FuncFvwmMenuHeadlines \& + I Read "$HOME/.fvwm/.fvwm\-menu\-headlines/$0.menu" \& \& DestroyMenu MenuHeadlines \& AddToMenu MenuHeadlines "Headlines" Title \& + MissingSubmenuFunction FuncFvwmMenuHeadlines \& + "FreshMeat" Popup freshmeat \& + "LinuxToday" Popup linuxtoday \& + "Slashdot" Popup slashdot .Ve .PP 2. Another way to use this script (only if you have fast network/proxy) is to run it every time you want to open your Headlines submenus. (Note, the submenu that is once created is not reloaded, use \*(L"Reset all\*(R".) .PP In this case your fvwm configuration lines could be: .PP .Vb 4 \& DestroyFunc FuncFvwmMenuHeadlines \& AddToFunc FuncFvwmMenuHeadlines \& + I PipeRead "fvwm\-menu\-headlines \-\-site $0" \& #+ I Schedule 900000 DestroyMenu $0 # reset generated menu in 15 minutes \& \& DestroyMenu MenuHeadlines \& AddToMenu MenuHeadlines "Headlines" Title \& + MissingSubmenuFunction FuncFvwmMenuHeadlines \& + "FreshMeat" Popup freshmeat \& + "Slashdot" Popup slashdot \& + "LinuxToday" Popup linuxtoday \& + "GNOME News" Popup gnome\-news \& + "KDE News" Popup kde\-news \& + "" Nop \& + "Reset all" FuncResetHeadlines \& \& DestroyFunc FuncResetHeadlines \& AddToFunc FuncResetHeadlines \& + I DestroyMenu freshmeat \& + I DestroyMenu linuxtoday \& + I DestroyMenu slashdot \& + I DestroyMenu gnome\-news \& + I DestroyMenu kde\-news .Ve .PP And finally, add \*(L"Popup MenuHeadlines\*(R" somewhere. .PP 3. Here is a usual usage. Use FvwmConsole or FvwmCommand to run fvwm commands from a shell script. Every time you want headlines from some site, execute (give any additional options if you want): .PP .Vb 3 \& PipeRead "fvwm\-menu\-headlines \-\-site newsforge \-\-name MenuHeadlinesNewsForge" \& # this may take several seconds, you may use: BusyCursor Read true \& Popup MenuHeadlinesNewsForge .Ve .SH "HOW TO ADD SITE HEADLINES" .IX Header "HOW TO ADD SITE HEADLINES" It is possible to add user defined site headlines without touching the script itself. Put your perl extensions to the file WORK_HOME/extension.pl. For each site add something similar to: .PP .Vb 8 \& $site_info\->{\*(Aqmyslashdot\*(Aq} = { \& \*(Aqname\*(Aq => "MySlashdot", \& \*(Aqhost\*(Aq => "myslashdot.org", \& \*(Aqpath\*(Aq => "/myslashdot.xml", \& \*(Aqfunc\*(Aq => \e&process_my_slashdot, \& # the following string is only used in \-\-info \& \*(Aqflds\*(Aq => \*(Aqtime, title, department, topic, author, url\*(Aq, \& }; \& \& sub process_my_slashdot () { \& return process_xml( \& \*(Aqstory\*(Aq, \& # mandatory \*(Aqh\*(Aq, \*(Aqu\*(Aq and \*(Aqd\*(Aq aliases or undef \& { \*(Aqh\*(Aq => \*(Aqtitle\*(Aq, \*(Aqu\*(Aq => \*(Aqurl\*(Aq, \*(Aqd\*(Aq => \*(Aqtime\*(Aq }, \& sub ($) { # convert \*(Aqd\*(Aq string to (y, m, d, H, M, S) \& $_[0] =~ /(\ed+)\-(\ed+)\-(\ed+) (\ed+):(\ed+):(\ed+)/; \& ($1, ($2 || 0) \- 1, $3, $4, $5, $6); \& }, +0, # timezone offset; already in UTC \& ); \& } \& \& 1; .Ve .SH "AUTHORS" .IX Header "AUTHORS" This script is inspired by WMHeadlines v1.3 by: .PP .Vb 2 \& Jeff Meininger \& (http://rive.boxybutgood.com/WMHeadlines/). .Ve .PP Reimplemented for fvwm and heavily enhanced by: .PP .Vb 1 \& Mikhael Goikhman , 16 Dec 1999. .Ve .SH "COPYING" .IX Header "COPYING" The script is distributed by the same terms as fvwm itself. See \s-1GNU\s0 General Public License for details. .SH "BUGS" .IX Header "BUGS" I try to keep all supported site info up to date, but sites often go down, change their backend formats, change their httpd responses, just stop to post news and so on; the script in the latest cvs may be more up to date. .PP The headline times may be off by one hour or more, since the time is displayed for your local time zone, and the time zone of the original time in the site backend output is often guessed (sometimes incorrectly); similarly it is guessed whether to apply the daylight saving correction. .PP Report bugs to fvwm\-bug@fvwm.org. fvwm-2.6.5.orig/bin/Makefile.in0000644000175000017500000006760311744241232014453 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = fvwm-root$(EXEEXT) subdir = bin DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/fvwm-bug.1.in $(srcdir)/fvwm-bug.in \ $(srcdir)/fvwm-config.1.in $(srcdir)/fvwm-config.in \ $(srcdir)/fvwm-convert-2.2.1.in \ $(srcdir)/fvwm-convert-2.4.1.in $(srcdir)/fvwm-convert-2.4.in \ $(srcdir)/fvwm-convert-2.6.1.in $(srcdir)/fvwm-convert-2.6.in \ $(srcdir)/fvwm-menu-desktop.1.in \ $(srcdir)/fvwm-menu-desktop.in \ $(srcdir)/fvwm-menu-directory.in \ $(srcdir)/fvwm-menu-headlines.in $(srcdir)/fvwm-menu-xlock.in \ $(srcdir)/fvwm-perllib.in $(srcdir)/fvwm-root.1.in ChangeLog ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = fvwm-bug.1 fvwm-config.1 fvwm-convert-2.2.1 \ fvwm-convert-2.4.1 fvwm-convert-2.6.1 fvwm-menu-desktop.1 \ fvwm-root.1 fvwm-config fvwm-bug fvwm-perllib fvwm-menu-xlock \ fvwm-menu-directory fvwm-menu-desktop fvwm-menu-headlines \ fvwm-convert-2.4 fvwm-convert-2.6 CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) fvwm_root_SOURCES = fvwm-root.c fvwm_root_OBJECTS = fvwm-root.$(OBJEXT) fvwm_root_LDADD = $(LDADD) am__DEPENDENCIES_1 = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' SCRIPTS = $(bin_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = fvwm-root.c DIST_SOURCES = fvwm-root.c man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ fvwm_root_SOURCE = fvwm-root.c fvwm_root_DEPENDENCIES = $(top_builddir)/libs/libfvwm.a bin_SCRIPTS = \ fvwm-config fvwm-bug fvwm-perllib \ fvwm-convert-2.4 fvwm-convert-2.6 \ fvwm-menu-xlock fvwm-menu-directory \ fvwm-menu-desktop fvwm-menu-headlines man_MANS = \ fvwm-root.1 fvwm-config.1 fvwm-bug.1 fvwm-perllib.1 \ fvwm-convert-2.4.1 fvwm-convert-2.6.1 \ fvwm-menu-xlock.1 fvwm-menu-directory.1 \ fvwm-menu-desktop.1 fvwm-menu-headlines.1 EXTRA_DIST = fvwm-convert-2.2 fvwm-convert-2.2.1 $(man_MANS) LDADD = -L$(top_builddir)/libs $(X_LIBS) -lfvwm $(xpm_LIBS) $(Xcursor_LIBS) \ $(X_PRE_LIBS) -lXext -lX11 -lm $(X_EXTRA_LIBS) $(Xrender_LIBS) \ $(Xcursor_LIBS) $(png_LIBS) $(rsvg_LIBS) INCLUDES = -I$(top_srcdir) $(xpm_CFLAGS) $(X_CFLAGS) $(png_CFLAGS) \ $(rsvg_CFLAGS) CLEANFILES = $(bin_SCRIPTS) $(bin_PROGRAMS) all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu bin/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu bin/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): fvwm-bug.1: $(top_builddir)/config.status $(srcdir)/fvwm-bug.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-config.1: $(top_builddir)/config.status $(srcdir)/fvwm-config.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-convert-2.2.1: $(top_builddir)/config.status $(srcdir)/fvwm-convert-2.2.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-convert-2.4.1: $(top_builddir)/config.status $(srcdir)/fvwm-convert-2.4.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-convert-2.6.1: $(top_builddir)/config.status $(srcdir)/fvwm-convert-2.6.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-menu-desktop.1: $(top_builddir)/config.status $(srcdir)/fvwm-menu-desktop.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-root.1: $(top_builddir)/config.status $(srcdir)/fvwm-root.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-config: $(top_builddir)/config.status $(srcdir)/fvwm-config.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-bug: $(top_builddir)/config.status $(srcdir)/fvwm-bug.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-perllib: $(top_builddir)/config.status $(srcdir)/fvwm-perllib.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-menu-xlock: $(top_builddir)/config.status $(srcdir)/fvwm-menu-xlock.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-menu-directory: $(top_builddir)/config.status $(srcdir)/fvwm-menu-directory.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-menu-desktop: $(top_builddir)/config.status $(srcdir)/fvwm-menu-desktop.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-menu-headlines: $(top_builddir)/config.status $(srcdir)/fvwm-menu-headlines.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-convert-2.4: $(top_builddir)/config.status $(srcdir)/fvwm-convert-2.4.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ fvwm-convert-2.6: $(top_builddir)/config.status $(srcdir)/fvwm-convert-2.6.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) fvwm-root$(EXEEXT): $(fvwm_root_OBJECTS) $(fvwm_root_DEPENDENCIES) @rm -f fvwm-root$(EXEEXT) $(LINK) $(fvwm_root_OBJECTS) $(fvwm_root_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fvwm-root.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` install-man1: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list=''; test -n "$(man1dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man1dir)" && rm -f $$files; } ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS \ install-exec-local install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-binSCRIPTS install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-exec-local install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-binSCRIPTS uninstall-man uninstall-man1 _fvwm-menu-xlock.1: fvwm-menu-xlock @TMP=tmp-$$$$ NAME=fvwm-menu-xlock && (\ mkdir $$TMP && \ cp $$NAME.in $$TMP/$$NAME && \ pod2man --center "Fvwm Utilities" --release "@VERSION@@VERSIONINFO@" \ --name $$NAME $$TMP/$$NAME >$$TMP/$$NAME.1 && \ mv $$TMP/$$NAME.1 .; \ rm -rf $$TMP) _fvwm-menu-directory.1: fvwm-menu-directory @TMP=tmp-$$$$ NAME=fvwm-menu-directory && (\ mkdir $$TMP && \ cp $$NAME.in $$TMP/$$NAME && \ pod2man --center "Fvwm Utilities" --release "@VERSION@@VERSIONINFO@" \ --name $$NAME $$TMP/$$NAME >$$TMP/$$NAME.1 && \ mv $$TMP/$$NAME.1 .; \ rm -rf $$TMP) _fvwm-menu-headlines.1: fvwm-menu-headlines @TMP=tmp-$$$$ NAME=fvwm-menu-headlines && (\ mkdir $$TMP && \ cp $$NAME.in $$TMP/$$NAME && \ pod2man --center "Fvwm Utilities" --release "@VERSION@@VERSIONINFO@" \ --name $$NAME $$TMP/$$NAME >$$TMP/$$NAME.1 && \ mv $$TMP/$$NAME.1 .; \ rm -rf $$TMP) _fvwm-perllib.1: fvwm-perllib @TMP=tmp-$$$$ NAME=fvwm-perllib && (\ mkdir $$TMP && \ cp $$NAME.in $$TMP/$$NAME && \ pod2man --center "Fvwm Utilities" --release "@VERSION@@VERSIONINFO@" \ --name $$NAME $$TMP/$$NAME >$$TMP/$$NAME.1 && \ mv $$TMP/$$NAME.1 .; \ rm -rf $$TMP) regenerate: \ _fvwm-menu-xlock.1 _fvwm-menu-directory.1 _fvwm-menu-headlines.1 \ _fvwm-perllib.1 install-exec-local: @rm -f $(DESTDIR)$(bindir)/xpmroot @$(LN_S) fvwm-root $(DESTDIR)$(bindir)/xpmroot || \ echo "Minor warning: $(bindir)/xpmroot symlink was not created" install-data-local: @rm -f $(DESTDIR)$(mandir)/man1/xpmroot.1 @$(LN_S) fvwm-root.1 $(DESTDIR)$(mandir)/man1/xpmroot.1 || \ echo "Minor warning: $(mandir)/man1/xpmroot.1 symlink was not created" # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/bin/fvwm-menu-xlock.in0000644000175000017500000001716111157754473016005 0ustar vwcvwc#!@PERL@ # Copyright (c) 1999-2009 Mikhael Goikhman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Filter this script to pod2man to get a man page: # pod2man -c "Fvwm Utilities" fvwm-menu-xlock | nroff -man | less -e use Getopt::Long; my $version = "@VERSION@"; my $name = 'XLockMenu'; my $title = 'XLock Modes'; my $itemf = '%n\t(%d)'; # may contain %n, %d, %D. my $icont = ''; my $iconi = ''; my $wm_icons = 0; my $special_first = 0; GetOptions( "help|h|?" => \&show_help, "version|V" => \&show_version, "name=s" => \$name, "title=s" => \$title, "item=s" => \$itemf, "icon-title=s" => \$icont, "icon-item=s" => \$iconi, "wm-icons" => \$wm_icons, "special-first" => \$special_first, ) || wrong_usage(); if ($wm_icons) { $icont ||= ""; $iconi ||= "menu/lock.xpm"; } my $icont_str = $icont ? "%$icont%" : ""; my $iconi_str = $iconi ? "%$iconi%" : ""; my $params = @ARGV ? ' ' . join(' ', @ARGV) : ''; my $lines1 = ""; # non-special mode lines my $lines2 = ""; # special mode lines my $start = 0; my $special = 0; $itemf =~ s/\\t/\t/g; open(XL, "xlock -display NONE -help 2>&1 |") || die "Exec echo 'Could not run xlock'\n"; print "DestroyMenu $name\n"; print "AddToMenu $name \"$icont_str$title\" Title\n"; while () { chomp; /where mode is one of:/ && do { $start = 1; next; }; if ($start && $_) { my ($misc, $name, $dsc) = split(/\s+/, $_, 3); next if $name =~ /^-/; my $dsc2 = $dsc =~ /^Shows (.*)$/ ? $1 : $dsc; my $item_str = $itemf; $item_str =~ s/\\t/\t/g; &expand_width_specifier(\$item_str, 'n', $name); &expand_width_specifier(\$item_str, 'd', $dsc); &expand_width_specifier(\$item_str, 'D', $dsc2); $special = 1 if !$special && $name eq 'blank'; ($special ? $lines2 : $lines1) .= qq(+ "$iconi_str$item_str" Exec xlock$params -mode $name\n); } } close XL; print $special_first ? qq($lines2+ "" Nop\n$lines1) : qq($lines1+ "" Nop\n$lines2); exit(0); # --------------------------------------------------------------------------- # Substitutes all %N1*N2x in $name by properly stripped and justified $value. sub expand_width_specifier (\$$$) { my ($name, $char, $value) = @_; $$name =~ s/%(-?\d+)?(\*(-?)(\d+))?$char/ my $value = !$2 || $4 <= 3 || $4 > length($value) ? $value : $3 ? "..." . substr($value, -$4 + 3, $4 - 3) : substr($value, 0, $4 - 3) . "..."; $1? sprintf("%$1s", $value): $value; /ge; } sub show_help { print "A small perl script which builds xlock menu for fvwm.\n\n"; print "Usage: $0 [OPTIONS] [-- XLOCK-OPTIONS]\n"; print "Options:\n"; print "\t--help show this help and exit\n"; print "\t--version show the version and exit\n"; print "\t--name=NAME menu name, default is '$name'\n"; print "\t--title=NAME menu title, default is '$title'\n"; print "\t--item=NAME menu item format, default is '$itemf'\n"; print "\t--icon-title=XPM menu title icon, default is no\n"; print "\t--icon-item=XPM menu item icon, default is no\n"; print "\t--wm-icons define icon names to use with wm-icons\n"; print "\t--special-first put special modes first\n"; print "Short options are ok if not ambiguous: -h, -t.\n"; print "\nSome useful xlock(1) options, 'xlock -h' for more:\n"; print "\t-delay usecs delay between batches of animations\n"; print "\t-nolock screensaver, don't lock the display\n"; print "\t-inwindow run in window as opposite to -inroot\n"; print "\t-sound turn on sound if enabled\n"; print "\t-nice level decrease the process priority (0 .. 19)\n"; exit 0; } sub show_version { print "$version\n"; exit 0; } sub wrong_usage { print STDERR "Try '$0 --help' for more information.\n"; exit -1; } __END__ # --------------------------------------------------------------------------- =head1 NAME fvwm-menu-xlock - builds xlock menu definition for fvwm =head1 SYNOPSIS B [ B<--help>|B<-h>|B<-?> ] [ B<--version>|B<-V> ] [ B<--name>|B<-n> name ] [ B<--title>|B<-t> title ] [ B<--item> format ] [ B<--icon-title> icon ] [ B<--icon-item> icon ] [ B<--special-first>|B<-s> ] [ -- xlock params ] =head1 DESCRIPTION A simple perl script which parses xlock's output to build an fvwm menu definition of all xlock's modes. =head1 OPTIONS =over 4 =item B<--help> show the help and exit =item B<--version> show the version and exit =item B<--name> name define menu name in the following argument. Default is "XLockMenu" =item B<--title> title define menu title in the following argument. Default is "XLock Modes". =item B<--item> format define menu item format in the following argument, default is '%n\t(%d)'. TAB can be specified as '\t', but in .fvwm2rc you should specify a double backslash or a real TAB. Format specifiers: %n - mode name %d - mode description %D - mode description without "Shows " prefix if any These specifiers can receive an optional integer size, positive for right adjusted string or negative for left adjusted, example: %8x; and optional *num or *-num, which means to leave only the first or last (if minus) num of chars, the num must be greater than 3, since the striped part is replaced with "...", example: %*30x. Both can be combined: %-10*-20x, this instructs to get only the 20 last characters, but if the length is less then 10 - to fill with up to 10 spaces on the right. =item B<--icon-title> icon =item B<--icon-item> icon define menu icon for title and regular item accordingly. Default is no menu icons (equivalent to an empty icon argument). =item B<--wm-icons> define icon names suitable for use with wm-icons package. Currently this is equivalent to: --icon-title '' --icon-item menu/lock.xpm. =item B<--special-first> instructs to include special modes (usually black, bomb and random) first. =back Option parameters can be specified either using '=' or in the next argument. Short options are ok if not ambiguous: -h, -t; but be careful with short options, what is now unambiguous, can became ambiguous in the next versions. Additional arguments (after B<-->) will be passed to xlock. Please see the B(1) man page for the xlock options. =head1 USAGE Add these lines to your fvwm configuration file: PipeRead 'fvwm-menu-xlock --name MenuSSaver --title "Screensaver" \ --icon-item mini-bball.xpm --special-first -- -nice 19 -nolock' PipeRead 'fvwm-menu-xlock --name MenuSLock --title "Lock Screen" \ --icon-item mini-rball.xpm --special-first -- -nice 19' AddToMenu "Utilities" "Screensaver%mini-monitor.xpm%" Popup MenuSSaver AddToMenu "Utilities" "Screenlock%mini-lock.xpm%" Popup MenuSLock =head1 AUTHORS Charles K. Hines , initial version. Mikhael Goikhman , from 24 Feb 1999. =head1 COPYING The script is distributed by the same terms as fvwm itself. See GNU General Public License for details. =head1 BUGS Depends on the output of xlock. Will produce an empty menu if the structure of the output is changed. Report bugs to fvwm-bug@fvwm.org. =cut # *************************************************************************** fvwm-2.6.5.orig/bin/fvwm-convert-2.6.in0000644000175000017500000003421311613251742015667 0ustar vwcvwc#!@PERL@ # -*-perl-*- # Convert .fvwm2rc from 2.4.x format to 2.6.x format. # # Original author: Thomas Adam Dec. 2009 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA use strict; use Cwd; use File::Basename; use Getopt::Long; # Global array for all our converted lines. my @converted_lines = (); # Global softref for addtofunc continuations. my $last_func_ref; my %converted_funcs = (); # Global for additional files... my @additional_files = (); # GetOpts my $follow_read = ''; my $process_read = 0; # Convert conditional command syntax correctly. sub __convert_conditionals { my( $cond ) = @_; my( $line ) = $cond->[-1]; my $condition_cmds = qr/(all|current|direction|next|none|prev|pick|thiswindow|windowid)/; # Take the last component. We no longer care for "[*]" as conditional # command parameters. But we shouldn't really put another conditional # in its place, so we'll just remove it. $line =~ s/\[\*\]//; # And convert over Next [$1] syntax. $line =~ s/$condition_cmds\s*\[(.*?)\]/\($1\)/io; $line = "$1 ". join( ', ', split( /[^,](\s+)[^,]/, $2 ) ) . " $3" if $line =~ /$condition_cmds\s*(\(.*?\))(.*)/io; $cond->[-1] = $line; } # Process the files specified and output them to a destination file. sub process_files { my( $files ) = @_; no strict "refs"; foreach my $f ( @$files ) { my( $s, $d ) = @$f; my $cwd_path = getcwd(); warn "Following: Read $s...\n" if $process_read; if( !defined $d or $d eq '' ) { my $fbasename = basename( $s ); $d = "$cwd_path/$fbasename.converted"; } if( -e $d ) { die "Destination file: $d exists\n"; } open( my $in_file, '<', $s ) or die "Unable to open source file: $!\n"; while( <$in_file> ) { chomp; # We have to handle continuation lines here, such as: # # Style foo !Bar, !Baz, \ # NoSomethingElse if( /\\\s*$/ ) { $_ .= <$in_file>; redo; } dispatch_line($_); } write_out_file($d); @converted_lines = (); %converted_funcs = (); } } # Convert style syntax over where applicable. sub convert_styles { my( $line ) = @_; my @converted; # At the very least, we can cheat and just negate everything. Whilst it # isn't deprecated yet, it will be -- so it won't hurt to do it here. # Split the line out first of all, between the "Style foo" part, and the # actual styles being applied. my( @style_parts ) = ($line =~ /^(style\s+\"??[\w+*?]\"??)(.*)$/i); # Convert the second part over. foreach( split( /\s*,\s*/, $style_parts[1] ) ) { # There is no !PPosition style, but there is !UsePPosition s/(?:No)(.*)/\!$1/ unless /nopposition/i; s/nopposition/!UsePPosition/i; push @converted, $_; } push @converted_lines, $style_parts[0] . join(', ', @converted); } # Buckshot approach at turning fvwmthemes into colorsets. Can't really do # much more than this, but at least gives the user something to go on. sub convert_fvwmtheme { my( $line ) = @_; $line =~ s/^\*fvwmtheme\s*:?//i; $line = undef if $line =~ /modulesynchronous.*?fvwmtheme/i; push @converted_lines, $line; } # Comment out the modulepath line -- grr. sub handle_modulepath { my( $line ) = @_; push( @converted_lines, "# Commented out by fvwm-convert-2.6: $line" ); } # This should have happened in the fvwm-2.4 convert script, but handle it # here anyway. sub convert_windowshadesteps { my( $line ) = @_; $line =~ /(\d+)p?/ ? $line = "Style * WindowShadeSteps $1" : $line = "Style * " . $line; push( @converted_lines, $line ); } sub convert_edge_resistance { my( $line ) = @_; # This gets converted into two parts. One is the EdgeResistance # command, the other is a style line. # # We could only ever have had two numbers as arguments to # EdgeResistance. my( $edge_res_arg, $move_res_arg ) = ( $line =~ /edgeresistance\s*(\d+)\s*(\d+)/i ); push( @converted_lines, qq| EdgeResistance $edge_res_arg Style * EdgeMoveResistance $move_res_arg| ); } sub convert_snapattraction { my( $line ) = @_; push( @converted_lines, "Style * " . $line ); } sub convert_key_mouse_bindings { my( $line ) = @_; my @components = split( /(\s+)/, $line, 5 ); # Also, conditional commands should now be separated with commas and not # whitespace, so try and fix these up where we can. It's not the # intention we'll catch them all, but at least try and do so based on # where they're likely to be used. __convert_conditionals(\@components); push( @converted_lines, join '', @components ); } sub handle_continuation { no strict "refs"; # Yes, yes... my( $line ) = @_; if( !defined $last_func_ref || $last_func_ref eq '' ) { my @func_parts = split( /(\+\s*\"?(?:i|c|d|h|m)\"?\s*)/i, $line, 2 ); __convert_conditionals(\@func_parts); push( @converted_lines, join '', @func_parts ); return; } eval { &{$last_func_ref}($line) }; warn "$@\n" if $@; } sub handle_read_file { my( $line ) = @_; my @read_parts = split( /\s+/, $line ); push( @converted_lines, $line ); # Crudely try and work out if the file is readable, and if it is add it # to the list of further files to convert. # # This won't handle having to interpolate out any env vars set via # SetEnv, or worse yet, outside of FVWM's environment. The user will # just have to run this script on that file manually. my $fname = $read_parts[1]; return unless defined $fname and $fname ne ''; if( -e $fname ) { push( @additional_files, [$fname] ); # We're done. return; } # If we have this: # # Read foo # # Or this: # # Read $./foo # # Then we assume FVWM_USERDIR ("$HOME/.fvwm/"), and if that file can't # be found there, try CWD, and if that fails we just give up. # Canonicalise the starting point by removing "$." -- we can guess what # it ought to be replaced with. $fname =~ s/^\$\.\/?//; if( -e "$ENV{FVWM_USERDIR}/$fname" ) { push( @additional_files, ["$ENV{FVWM_USERDIR}/$fname"] ); return; } if( -e "$ENV{HOME}/.fvwm/$fname" ) { push( @additional_files, ["$ENV{HOME}/.fvwm/$fname"] ); return; } my $cwd_path = getcwd(); if( -e "$cwd_path/$fname" ) { push( @additional_files, [$fname] ); return; } warn "Unable to follow: $line\n"; } sub check_func_definition { my( $line ) = @_; if( $line !~ /^addtofunc\s+(?:start|init|restart)function.*/i ) { $last_func_ref = ''; } # Then we have a standard function line in the form: # # + I SomeCommand # # Ensure we run it all through __convert_conditionals() my @func_parts = split( /(\s+)/, $line, 4 ); __convert_conditionals( \@func_parts ); push( @converted_lines, join '', @func_parts ); } sub convert_initfunc { my( $line ) = @_; $last_func_ref = "convert_initfunc"; if( $line =~ /addtofunc\s+initfunction\s+\"??[icmhd]{1}\"??\s+.*/i || $line =~ /addtofunc\s+initfunction\s*/i ) { $line =~ s/addtofunc\s+initfunction\s*//i; } $line =~ s/^\s*\+//; return if !defined $line || $line eq ''; # What we need to do now is convert this from: # # + I Foo # # to: # # + I Test (Init) Foo my @func_cmd = split( /\s+/, $line, 3 ); unshift( @func_cmd, '' ) unless @func_cmd > 2; # Remove any quotes around the action type --- they're not needed # anymore. $func_cmd[1] =~ s/\"//g; $func_cmd[1] .= q| Test (Init) |; # Run the command through the conditional function to ensure we # handle those correctly. __convert_conditionals( \@func_cmd ); push( @{ $converted_funcs{initfunction} }, join ' ', @func_cmd ); } sub convert_restartfunc { my( $line ) = @_; $last_func_ref = "convert_restartfunc"; # We treat this exactly like startfunction. if( $line =~ /addtofunc\s+restartfunction\s+\"??[icmhd]{1}\"??\s+.*/i ) { # Split this string. We can throw away the "AddToFunc" part as this # is irrelevant. But we want the following result: # ( 'I', 'Some Command' ) $line =~ s/addtofunc\s+restartfunction\s*//i; } $line =~ s/addtofunc\s+restartfunction\s*//i; return if $line eq ''; # Remove the continuation prefix as we can add this in when writing out # the function definitions later. $line =~ s/^\s*\+//; my @func_cmd = split( /\s+/, $line, 2 ); $func_cmd[1] =~ s/\"//g; # Run the command through the conditional function to ensure we # handle those correctly. __convert_conditionals( \@func_cmd ); push( @{ $converted_funcs{startfunction} }, join ' ', @func_cmd ); } sub convert_startfunc { my( $line ) = @_; $last_func_ref = "convert_startfunc"; # Now, it's possible that we have something like this: # # AddToFunc StartFunction I Some Command # # Extract the command part, add it to the hash for our functions, and # flag the fact we're dealing with StartFunction at this point for any # continuation lines (+ I Foo) since we can't determine the context of # them without such a thing. if( $line =~ /addtofunc\s+startfunction\s+\"??[icmhd]{1}\"??\s+.*/i ) { # Split this string. We can throw away the "AddToFunc" part as this # is irrelevant. But we want the following result: # ( 'I', 'Some Command' ) $line =~ s/addtofunc\s+startfunction\s*//i; } $line =~ s/addtofunc\s+startfunction\s*//i; # Remove the continuation prefix as we can add this in when writing out # the function definitions later. $line =~ s/^\s*\+//; return if !defined $line || $line eq ''; my @func_cmd = split( /\s+/, $line, 2 ); $func_cmd[1] =~ s/\"//g; # Run the command through the conditional function to ensure we # handle those correctly. __convert_conditionals( \@func_cmd ); push( @{ $converted_funcs{startfunction} }, join ' ', @func_cmd ); } sub write_out_file { my( $dest_file ) = @_; open( my $f, '>', $dest_file ) or die "Couldn't open $dest_file: $!\n"; # If we had any continuation lines, preserve them as best we can. @converted_lines = map { join "\\\n", split /\\/, $_ } @converted_lines; print $f join( "\n", @converted_lines ); # Write out the functions. if( defined $converted_funcs{initfunction} or defined $converted_funcs{startfunction} ) { print $f qq|\n\nDestroyFunc StartFunction\nAddToFunc StartFunction\n|; # Put the Init stuff before anything else. for( @{ $converted_funcs{initfunction} }, @{ $converted_funcs{startfunction } } ) { print $f "+ $_\n"; } } close( $f ); } sub dispatch_line { my( $line ) = @_; if( $line =~ /^style/i ) { convert_styles($line); } elsif( $line =~ /^\s*\*fvwmtheme:??/i ) { convert_fvwmtheme($line); } elsif( $line =~ /^\s*modulepath\s*/i ) { handle_modulepath( $line ); } elsif( $line =~ /^\s*windowshadesteps.*/i ) { convert_windowshadesteps($line); } elsif( $line =~ /^\s*module(?:synchronous)?.*?fvwmtheme$/i ) { convert_fvwmtheme($line); } elsif( $line =~ /^\s*edgeresistance\s*\d+\s*\d+/i ) { convert_edge_resistance($line); } elsif( $line =~ /^\s*key|mouse/i ) { convert_key_mouse_bindings($line); } elsif( $line =~ /^\s*snap(?:attraction|grid)/i ) { convert_snapattraction( $line ); } elsif( $line =~ /^\s*addtofunc\s+initfunction/i ) { convert_initfunc( $line ); } elsif( $line =~ /^\s*addtofunc\s+startfunction.*/i ) { convert_startfunc( $line ); } elsif( $line =~ /^\s*addtofunc\s+restartfunction/i ) { convert_restartfunc( $line ); } elsif( $line =~ /^\s*addtofunc\s+\w+.*/i ) { check_func_definition( $line ); } elsif( $line =~ /^\s*\+\s*\"??[ichmd]{1}\s*\"??\s+.*/i ) { handle_continuation( $line ); } elsif( $line =~ /^\s*read\s*[\/\w]+/i ) { handle_read_file( $line ); } else { # Could be a comment, or a continuation, or simply something we # don't need to convert. As far as continuation lines are # concerned, these are kept in order just by pushing them onto the # array --- but converting continuation lines is tricky since we'd # need to determine the context of the continuation. I can't be # bothered. push( @converted_lines, $_ ); } } sub usage { print "fvwm-convert-2.6 [-f] [-h] source-file destination-file\n"; exit; } GetOptions( "help|h" => \&usage, "follow-read|f" => \$follow_read, ) || usage(); # But we still require @ARGV to be populated with our filenames. usage() unless( @ARGV > 0 and @ARGV <=2 ); my @files = [@ARGV]; process_files( \@files ); if( @additional_files && !$follow_read ) { print "The following files were detected, but not processed:\n\n", join("\n", @$_ ) for @additional_files; print "\n"; } # Only do this is we've been asked. if( @additional_files && $follow_read ) { $process_read = 1; process_files( \@additional_files ); } fvwm-2.6.5.orig/bin/fvwm-bug.in0000644000175000017500000001056610656151546014475 0ustar vwcvwc#!/bin/sh - # # fvwm-bug - create a bug report and mail it to the bug address # - adapted from equivalent `bashbug' script # # The bug address could depend on the release status of fvwm. Currently # it doesn't. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA PACKAGE="@PACKAGE@" VERSION="@VERSION@" script=`basename $0` address="" while test $# -gt 0; do case "$1" in --help|-help|-h|-\?) cat <&2 "Unrecognized option $1 specified." echo >&2 "Run '$0 --help' to get the usage." exit 1 ;; *) if test x"$address" != x; then echo >&2 "You may specify only one address." echo >&2 "Run '$0 --help' to get the usage." exit 1 fi address="$1" ;; esac shift done PATH=/bin:/usr/bin:/usr/local/bin:$PATH export PATH : ${EDITOR:=vi} TEMP=`mktemp -q "${TMPDIR:-/tmp}/fvwm-bug.XXXXXX"` # Figure out how to echo a string without a trailing newline N=`echo 'hi there\c'` case "$N" in *c) n=-n c= ;; *) n= c='\c' ;; esac trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15 trap 'rm -f $TEMP $TEMP.x' 0 # Who is mail from? : ${USER:=${LOGNAME:-`whoami`}} # Who is mail to? if test x"$address" = x; then LOCAL=@LOCAL_BUGADDR@ WORKERS=fvwm-workers@fvwm.org if test "$LOCAL"; then echo "Do you want to send the report to the local maintainer <$LOCAL>," echo "the fvwm workers <$WORKERS>, or both?" echo $n "Send report to (l)ocal, (w)orkers, (b)oth? " $c read ans case "$ans" in l*|L*) BUGADDR=$LOCAL;; f*|F*|w*|W*) BUGADDR=$WORKERS;; b*|B*) BUGADDR=$LOCAL,$WORKERS;; *) echo "[Defaulting to LOCAL]"; BUGADDR=$LOCAL;; esac fi else BUGADDR=$address fi UN= if (uname) >/dev/null 2>&1; then UN=`uname -a` fi if [ -f /usr/lib/sendmail ] ; then RMAIL="/usr/lib/sendmail" elif [ -f /usr/sbin/sendmail ] ; then RMAIL="/usr/sbin/sendmail" else RMAIL=rmail fi prefix=@prefix@ exec_prefix=@exec_prefix@ datarootdir=@datarootdir@ datadir=@datadir@ libexecdir=@libexecdir@ : ${FVWM_USERDIR:=unset} FVWM_DATADIR=@FVWM_DATADIR@ FVWM_MODULEDIR=@FVWM_MODULEDIR@ cat > $TEMP <> $HOME/dead.fvwm-bug echo "$0: mail failed: report saved in $HOME/dead.fvwm-bug" >&2 } exit 0 fvwm-2.6.5.orig/bin/fvwm-perllib.in0000644000175000017500000004203611660744035015343 0ustar vwcvwc#!@PERL@ # Copyright (c) 2002-2009 Mikhael Goikhman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Filter this script to pod2man to get a man page: # pod2man -c "Fvwm Utilities" fvwm-perllib | nroff -man | less -e #use strict; # comment to make it faster BEGIN { # use vars qw($prefix $datarootdir $datadir $perllibdir); $prefix = "@prefix@"; $datarootdir = "@datarootdir@"; $datadir = "@datadir@"; $perllibdir = "@FVWM_PERLLIBDIR@"; # try to do it as fast as possible if ($ARGV[0] eq 'dir') { print $perllibdir; exit(0); } } use Getopt::Long; use lib $perllibdir; use General::FileSystem '-die'; my $version = "@VERSION@"; my $version_info = "@VERSIONINFO@"; my $pager = $ENV{PAGER} || "less -e"; my $do_man = 0; my $do_cat = 0; my $do_raw = 0; GetOptions( "help|h|?" => \&show_help, "version|v|V" => \&show_version, "man" => \$do_man, "cat" => \$do_cat, "raw" => \$do_raw, "dir" => sub { print $perllibdir; exit(0); }, ) || wrong_usage(); if ($ARGV[0] eq 'man') { $do_man = 1; shift; } elsif ($ARGV[0] eq 'cat') { $do_cat = 1; shift; } elsif ($ARGV[0] eq 'raw') { $do_raw = 1; shift; } wrong_usage() if !$do_man && !$do_cat && !$do_raw || @ARGV > 1; my $man_or_cat_str = $do_man || $do_raw ? "man" : "cat"; my $internal_pods = {}; $internal_pods->{index} = qq{ :head1 NAME index - lists all available help topics :head1 DESCRIPTION Recent I versions install the Perl library that makes creating fvwm modules in Perl possible and easy. You may read the Perl library documentation locally by running: % fvwm-perllib $man_or_cat_str Available topics: index tutorial events {{CLASS_NAMES}} For example: % fvwm-perllib $man_or_cat_str FVWM::Module :head1 AUTHOR Mikhael Goikhman . }; $internal_pods->{tutorial} = q{ :head1 NAME tutorial - common techniques for writting fvwm modules :head1 TUTORIAL :head2 What is a window manager A window manager is a program that runs on top of the X Window System and manages windows, menus, key and mouse bindings, virtual desktops and pages, draws window decorations using defined colors or images, title-bar buttons and fonts. The window manager defines window placement and focus policies. It may also manage such things as root background, mouse cursors, sounds, run applications and do other nice things. :head2 What is a module In the unix traditions, different functionality may be implemented by separate programs to reduce a bloat. A module is an optional program that is intended to extend the window manager using a defined module protocol. Fvwm modules are spawned by the main I executable. They usually listen to the window manager events, do some useful work and send back commands for execution. There are transient modules that exit immediately or shortly, and persistent modules that exit together with a window manager or when a user requests. Some modules may control windows or other modules. Some modules may supply a GUI, others may be non interactive. :head2 Creating a simple module Let's create a module that shows a flash window for one second when you change pages. We will use I with nifty options for our flash purposes, but you may use your fantasy to do this better. First, we should understand when our module works. Usually a module does nothing (sleeps) and is awaken when something interesting happens. This is achieved using events. A module defines events that it is interesting to receive and set-ups event handlers (perl functions) to be called when the event happens. Then a module enters the event loop where it sleeps all the time until one or another event happens. Most of the module work is done in the event handlers. When an event is processed, the module enters the event loop again. In our case, we should listen to an fvwm event I. The list of all events may be found in man page "events". When we receive the event we want to get new page coordinates and display them using our special xmessage window. Now, from theory to practice. The header of all modules written in Perl is pretty standard: #!/usr/bin/perl -w use lib `fvwm-perllib dir`; use FVWM::Module; Then create the actual module object: my $module = new FVWM::Module( Mask => M_NEW_PAGE | M_NEW_DESK, Debug => 1, ); The B option tells to print the event names that a module receives to help writing a module, it also echoes all sent commands. The B option tells which events a module wants to receive, in our case these are events generated on the page and desk changes. To handle events, event handlers that are perl functions, should be defined. It is ok not to define any event handler for I and to define two event handlers for I. But for our purposes one I would be more than enough: $module->add_handler(M_NEW_PAGE, \&got_new_page); It is a time to implement our C function that will be called every time the desktop page is changed. sub got_new_page { my ($module, $event) = @_; my $width = $event->_vp_width; my $height = $event->_vp_height; if (!$width || !$height) { # this may happen when doing DeskTopSize 1x1 on page 2 2 return; } my $page_nx = int($event->_vp_x / $width); my $page_ny = int($event->_vp_y / $height); # actually show the flash $module->send("Exec xmessage -name FlashWindow \ -bg cyan -fg white -center -timeout 1 -button '' \ -xrm '*cursorName: none' -xrm '*borderWidth: 2' \ -xrm '*borderColor: yellow' -xrm '*Margin: 12' \ '($page_nx, $page_ny)'"); } All event handlers are called with 2 parameters, a module and an event objects. The arguments for all events are defined in L. Each event type has its own arguments. Our I has 5 arguments: vp_x vp_y desk vp_width vp_height. We should do some calculations to get the page numbers from viewport coordinates. The B method passes the command to I for execution. It would be better to set-up the FlashWindow specially: $module->send("Style FlashWindow StaysOnTop, NoTitle, NoHandles, \ BorderWidth 10, WindowListSkip, NeverFocus, UsePPosition"); Finally, all persistent modules should enter the event loop: $module->event_loop; The full module source that we just wrote is available at ftp://ftp.fvwm.org/pub/fvwm/devel/sources/tests/perl/module-flash . To run it execute this fvwm command: Module /path/to/module-flash To kill the module, execute: KillModule /path/to/module-flash :head2 Using event trackers In fact, the task of calculating page coordinates, or managing information about all windows, or gathering colorset, module or global information is so often, that there are existing implentation in the form of event trackers. Tracker is an instance of L superclass. Currently these tracker classes are available (see their man pages): FVWM::Tracker::Colorsets FVWM::Tracker::GlobalConfig FVWM::Tracker::ModuleConfig FVWM::Tracker::PageInfo FVWM::Tracker::Scheduler FVWM::Tracker::WindowList Using a tracker is easy, something along lines: my $tracker = $module->track("WindowList"); my $colorset_tracker = $module->track("Colorsets"); Our module that we wrote above may be reduced if we use: my $viewport = $module->track("PageInfo"); my $page_nx = $viewport->data("page_nx"); my $page_ny = $viewport->data("page_ny"); Note that the tracker continues to work and maintain the up-to-date information about the current page and desk (or up-to-date windows or colorsets depending on the tracker type) at any given moment. Internally, trackers listen to appropriate events using the same event handler mechanism, so there is no speed advantage. However it is a good idea to reuse the existing verified code and reduce the number of events needed to be trapped manually. There is usually no problem if the developer and the tracker define handlers for the same events (besides the handler order maybe). :head2 On the module masks In our example above we explicitly defined Mask in constructor. This is not really needed. If not specified, the event mask is managed automatically (it is updated every time a new event handler is added). Note, there are actually two event masks, called "mask" and "xmask" (extended mask). If you are interested in the details, refer to the fvwm documentation or perllib sources. When trackers are added or removed, the module mask (and xmask) are automatically tweaked underhand. In short, there is often no reason to worry about the module masks. However, in rare cases you may want to define SyncMask (or SyncXMask), so that fvwm is synchronized with the module on certain events. :head2 Creating a more functional module Let's extend our new-page-flash example above and add a way to stop our module and to define another string format. This would be possible using the following I commands: SendToModule /path/to/module-flash stop SendToModule /path/to/module-flash format '[%d %d]' To handle such commands, we should define I event handler. use General::Parse; my $format = "(%d, %d)"; # the default format $module->mask($module->mask | M_STRING); $module->add_handler(M_STRING, sub { my ($module, $event) = @_; my $line = $event->_text; my ($action, @args) = get_tokens($line); if ($action eq "stop") { $module->terminate; } elsif ($action eq "format") { $format = $args[0]; } }); Now, let's convert our module to be GTK+ based and not to be dependent on I. use lib `fvwm-perllib dir`; use FVWM::Module::Gtk; use POSIX qw(SIGALRM); Gtk->init; my $format = "(%d, %d)"; my $module = new FVWM::Module::Gtk; my $pageinfo = $module->track("PageInfo"); $pageinfo->observe("desk/page changed", sub { my ($module, $tracker, $data) = @_; my $page_nx = $data->{page_nx}; my $page_ny = $data->{page_ny}; my $width = $data->{vp_width}; my $height = $data->{vp_height}; # actually show the flash my ($w, $h) = (80, 50); my $string = sprintf($format, $page_nx, $page_ny); my $window = new Gtk::Window('toplevel'); $window->set_title("FlashWindow"); $window->set_border_width(5); $window->set_usize($w, $h); $window->set_uposition(($width - $w) / 2, ($height - $h) / 2); my $frame = new Gtk::Frame(); $window->add($frame); $frame->set_shadow_type('etched_out'); my $label = new Gtk::Label($string); $frame->add($label); $window->show_all; POSIX::sigaction(SIGALRM, POSIX::SigAction->new( sub { $window->destroy(); } )); alarm(1); }); $module->event_loop; The full module source that we just wrote is available at ftp://ftp.fvwm.org/pub/fvwm/devel/sources/tests/perl/module-gtkflash . :head1 EXAMPLES Currently see I for examples. Learning the sources of B, B, B modules may help too. :head1 SEE ALSO See L and L for the module API. :head1 AUTHOR Mikhael Goikhman . }; $internal_pods->{events} = q{ :head1 NAME events - list of all fvwm events with arguments :head1 DESCRIPTION This list is automatically generated from L package. Given L object of certain event type, say I, here is the syntax to get value of its I argument: $win_id = $event->_win_id; There are several more ways to access arguments, like: $win_id = $event->arg_values->[0]; $text = $event->args->{text}; :head1 EVENTS WITH ARGUMENTS {{EVENT_NAMES}} :head1 ARGUMENT TYPE LEGEND Here is a mapping of fvwm argument types to perl native types: number - integer bool - boolean, true or false window - X window id in decimal, use sprintf("0x%07x", $wid) pixel - "rgb:" . join('/', sprintf("%06lx", $val) =~ /(..)(..)(..)/) string - string (scalar) wflags - window flags in binary string looped - loop of zero or more fixed argument bunches Run L or L to browse events. :head1 SEE ALSO See "tutorial", L, L and L. :head1 AUTHOR Mikhael Goikhman . }; my $topic = $ARGV[0] || "index"; my $file = "-"; my $text = ""; if (exists $internal_pods->{$topic}) { $text = $internal_pods->{$topic}; $text =~ s/^\t//mg; $text =~ s/^:/=/mg; if ($topic eq 'index') { my @class_names = sort @{list_filenames($perllibdir, 1)}; @class_names = map { s!\.pm$!!; s!/!::!g; $_ } @class_names; $text =~ s/{{CLASS_NAMES}}/join("\n ", @class_names)/seg; } if ($topic eq 'events') { my $content = `cat '$perllibdir/FVWM/EventNames.pm'`; my $result = ""; foreach ($content =~ /\t&([^\s]+.*?\t\tfields[^\n]+(?:\n\t\t\t[^\n]+)*)/sg) { my ($name, $rest) = /^([^\s]+).*?((?:\n\t\t\t[^\n]+)*)$/s; # ] $result .= " $name\n"; $rest =~ s/([^\s]+)\s*=>\s*([\w]+)/ $result .= sprintf(" %-16s\t%s\n", $1, $2) /eg; $result .= "\n"; } $text =~ s!{{EVENT_NAMES}}!$result!se; } } else { $file = "$perllibdir/$topic.pm"; $file =~ s!::!/!g; die "No $file found.\n" unless -f $file; } my $man_converter = $do_man ? " | nroff -man | $pager" : ""; open(MANPIPE, $do_cat ? "| pod2text '$file' | $pager" : "| pod2man --section 3 --release 'fvwm $version$version_info'" . " --center 'Fvwm Perl library' '$file'" . " | @SED@ 's//perllib/ig'$man_converter") or die "Can't open pipe to pod/man viewer\n"; print MANPIPE $text or die "Can't write to pod/man viewer\n"; close MANPIPE; # --------------------------------------------------------------------------- sub show_help { print "Shows documentation of the supplied FVWM Perl library.\n\n"; print "Usage: fvwm-perllib man|cat\n"; print "\tAn introduction to the FVWM Perl library\n\n"; print "Usage: fvwm-perllib man|cat|raw \n"; print "\tManual page for , try: man FVWM::Module\n"; print "\t\$PAGER is used for a pager, the default is '$pager'\n\n"; print "Usage: fvwm-perllib dir\n"; print "\tFor use in fvwm modules written in Perl\n\n"; print "Usage: fvwm-perllib [OPTIONS]\n"; print "Options:\n"; print "\t--help show this help and exit\n"; print "\t--version show the version and exit\n"; exit 0; } sub show_version { print "$version\n"; exit 0; } sub wrong_usage { print STDERR "Try '$0 --help' for more information.\n"; exit -1; } __END__ # --------------------------------------------------------------------------- =head1 NAME fvwm-perllib - shows the documentation of the Fvwm Perl library =head1 SYNOPSIS B [ B<--help>|B<-h>|B<-?> ] [ B<--version>|B<-v>|B<-V> ] [ B [ I ] ] [ B [ I ] ] [ B [ I ] ] [ B ] =head1 DESCRIPTION Starting from fvwm-2.5.x versions there is a built-in support for creating fvwm modules in Perl. This B utility provides help services for the Fvwm Perl library. =head1 OPTIONS B<--help> show the help and exit B<--version> show the version and exit B<--man> or B [ I ] show manual page just like man(1) B<--cat> or B [ I ] show manual page in plain text B<--raw> or B [ I ] generate output in man format (not human readable) B<--dir> or B print perllib directory without a trailing end of line =head1 USAGE Use this in the fvwm modules written in Perl: use lib `fvwm-perllib dir`; Introduction to the Fvwm Perl library: % fvwm-perllib man Manual page for the C class: % fvwm-perllib man FVWM::Module Standard options: % fvwm-perllib --help % fvwm-perllib --version =head1 AUTHORS Mikhael Goikhman . =head1 COPYING The script is distributed by the same terms as fvwm itself. See GNU General Public License for details. =head1 BUGS No known bugs. Report bugs to fvwm-bug@fvwm.org. =cut # *************************************************************************** fvwm-2.6.5.orig/bin/fvwm-config.10000644000175000017500000000607411744241304014705 0ustar vwcvwc.\" @(#)fvwm-2.6.5 20 April 2012 .de EX \"Begin example .ne 5 .if n .sp 1 .if t .sp .5 .nf .in +.5i .. .de EE .fi .in -.5i .if n .sp 1 .if t .sp .5 .. .ta .3i .6i .9i 1.2i 1.5i 1.8i .TH fvwm-config 1 "20 April 2012 (2.6.5)" Fvwm "Fvwm Modules" .UC .SH NAME fvwm-config \- query an existing fvwm installation .SH SYNOPSIS .B fvwm-config .RI [ --help ] .RI [ --version ] .RI [ --info ] .RI [ --prefix ] .RI [ --exec-prefix ] .RI [ --bindir ] .RI [ --datadir ] .RI [ --libexecdir ] .RI [ --sysconfdir ] .RI [ --mandir ] .RI [ --localedir ] .RI [ --fvwm-moduledir ] .RI [ --fvwm-datadir ] .RI [ --fvwm-perllibdir ] .RI [ --default-imagepath ] .RI [ --default-userdir ] .RI [ --fvwm-exe ] .RI [ --supports ] .RI [ --supports- ] .SH DESCRIPTION .B fvwm-config is a shell script that provides an information about the fvwm version, installation directories, built-in paths and supported features. .SH OPTIONS .B fvwm-config prints to the standard output in all options. Both short and long GNU-like option names may be used. .TP .B -h --help -? prints the short usage .TP .B -v --version -V prints the version .TP .B -i --info prints the full info page .TP .B -P --prefix prints the installation prefix .TP .B -E --exec-prefix prints the installation exec-prefix .TP .B -B --bindir prints the installation bindir .TP .B -D --datadir prints the installation datadir .TP .B -L --libexecdir prints the installation libexecdir .TP .B -S --sysconfdir prints the installation sysconfdir .TP .B -M --mandir prints the installation mandir .TP .B -O --localedir prints the installation localedir .TP .B -m --fvwm-moduledir prints FVWM_MODULEDIR, where the modules are installed .TP .B -d --fvwm-datadir prints FVWM_DATADIR, where the system wide configs are installed .TP .B -p --fvwm-perllibdir prints FVWM_PERLLIBDIR, where the perl library is installed .TP .B -I --default-imagepath prints the built-in ImagePath .TP .B -U --default-userdir prints the default FVWM_USERDIR, note: $HOME is not expanded .TP .B -e --fvwm-exe prints the fvwm executable name (in bindir) .TP .B -s --supports lists all supported features, one per line .TP .BI --supports- prints nothing, returns: 0 if the .I is supported, 100 if not, 200 if unknown. All or supported feature names may be found using .IR --info " or " --supports respectively. .TP .SH USAGE Here are some real life usages. Checks for xft support: .EX if fvwm-config --supports-xft; then echo 1; else echo 0; fi .EE .I fvwm-themes package checks for the correct .I fvwm version installed using: .EX fvwm-config --version .EE and tries to use the same installation directories: .EX fvwm-config --bindir --mandir --fvwm-datadir .EE A way to find the full path to the fvwm executable: .EX echo `fvwm-config --bindir`/`fvwm-config --fvwm-exe` .EE A way to start modules in perl: .EX use lib `fvwm-config -p | tr -d '\n'`; use FVWM::Module; .EE For a more human readable output, try: .EX fvwm-config --info .EE .SH COPYING .B fvwm-config is a part of fvwm package and distributed by the same terms, see GNU GPL. .SH AUTHOR Mikhael Goikhman fvwm-2.6.5.orig/bin/fvwm-menu-desktop.in0000644000175000017500000015227511705516564016340 0ustar vwcvwc#!@PERL@ # Modification History # Changed on 05/07/11 by (dane): # - new option kde_config for alternate name of optional # kde-config command. # - use kde4-config if kde-config isn't found. # - if no kde-config command at all, use some defaults. # Changed on 11/30/10 by (dane): # - changed DIR filehandles to scalars, they're stepping on each other. # was a bug in xdg-menu. # - changed default (only) format to fvwm2 and removed logic for other wms. # - move mainline before all subs (move it back?). # - removed the xdg_menu cache logic. # - Remove $flag, $MENU_TYPE, $MENU_DESTROY for gtk vs. fvwm menu mode. # Actually removed all GTK MENU logic. # - Added option to menu to regenerate the menus. # - Remove xdg option root_menu. # - Added fvwm-menu option to use Fvwm Icons package. # - Style options from fvwmmenudesktop not carried over, # WM hints are sufficient to set mini-icon and icon. # - Removed prototypes. None were needed. # - All filehandle names made local. # - New option for su_gui, do path check for alternatives. # - Change menu prefix from xdg-menu to FvwmMenu # # FIXME: # - No testing for wm_icons has been done (is that fvwm-themes?). # - Docs need to be updated. # - fvwm-icons: okay, maybe the cat isn't a good default for Exec... # - Running alacarte, I can see there are Application menus, and System menus. # Figure out the options to get both. # - There are good programs like alacarte that are marked GNOME-ONLY. # Figure out how to get them in menus. # - I think this should default to mini-icons enabled, but which # icon package should be assumed? # - Need a way to select the /usr/share/icons icon sets with themes like # default/hicolor and size like 16x16 and 24x24. # - Regenerate menus should prompt for a new command line. # - sidepics, etc not tested. # - iconname::: syntax needs investigation, I think some of it is obsolete, # needs a verifier, and some defaults. # - Far too many lexical globals not bound to subroutines (c.f. # modularisation.) # - I don't see the point to the path arguments. I think they should # be obsoleted. # - If I pass --fvwm-icons I don't need to set --enable-mini-icons. # Therefore I think enable mini-icons is pointless. # - The "check" functions are useless. Since this module doesn't get the # built in path, or the users path, it can't do the check. # - Looks like there is no such thing as fvwm_toptitle, must have been a gtk thing? # --------------------------------------------------------------------------- # fvwm-menu-desktop # See the man page fvwm-menu-desktop.1 for instructions. # # Created on 22/07/1999 by Olivier Chapuis # # Updated on 15/08/1999 by Mikhael Goikhman # # Updated on 24/12/2010 by Dan Espen for xdg menus (see copyright below) # --------------------------------------------------------------------------- # COPYING # # The script is distributed by the same terms as fvwm itself. # See GNU General Public License for details. # #---------------------------------------------------------------------------- # 25/12/2010 re-written, based heavily on # xdg-menu for archlinux. based on suse xdg-menu written by # Sergej Pupykin # # >> Copyright (c) 2003 SuSE Linux AG, Nuernberg, Germany. All rights reserved. # >> # >> Author: nadvornik@suse.cz # FILES: # This script uses the following files if present: # /usr/share with /applications/ # /opt/gnome/share with /applications/ # kde-config --path xdgdata-apps with /applications/ # /opt/kde3/share with /desktop-directories/ # /opt/gnome/share with /desktop-directories/ # /etc/opt/kde3/share/applnk # /opt/kde3/share/applnk # kde-config --path apps # /etc/xdg use 5.008; use strict; use warnings; use Getopt::Long; use Encode; use I18N::Langinfo qw(langinfo CODESET); use POSIX qw(locale_h); use Digest::MD5 qw(md5_hex); # TA: 2011-04-16: This module is non-standard, so bail if we don't find # it. eval "use XML::Parser; 1" or die "fvwm-menu-desktop: XML::Parser not installed.\n"; my $xdg_data_dirs = $ENV{XDG_DATA_DIRS} || ''; my @PATH_DIRS = split(':',$ENV{PATH}); # for checking if applications exist my $version = '@VERSION@'; my $menu_prefix='FvwmMenu'; my $DefaultAppDirs; my $DefaultDirectoryDirs; my @KDELegacyDirs; my $desktop_name = 'fvwm2'; my $language = ''; my $charset = 'iso-8859-1'; my $root_cmd; my $kde_cmd; my $die_on_error = 0; my $verbose = 0; my @language_keys; #my @accessed_files; my $TERM_CMD = "xterm -e"; my %Desktop_entries; my %Directory_entries; my $root_menu; my $help; # Default for the mini-icons is mini/ (relatively to the ImagePath) my $MINI_ICONS_DIR = 'mini/'; # Then the default for icon is ImagePath (consistent with kde, fvwm2gnome # and almost consistent with wm-icons) my $ICONS_DIR = ''; # For png icons my $PNG_ICONS = ''; my $TRAN_MINI_ICONS = 'mini/'; my $TRAN_ICONS = ''; my $MINI_ICONS = 0; # mini-icon disabled (enable =1) my $TRAN = 0; # mini-icon translation disabled (enable =1) my $wm_icons = 0; # use wm-icons compatible menu icon names my $fvwm_icons = 0; # use fvwm-icons compatible menu icon names # check icons my $check_icons = ""; my $check_mini_icons = ""; my @check_icons_path = (); my @check_mini_icons_path = (); my %DI; my %dmicon; # Menu Style option my $MENU_STYLE = ""; my @menus_for_style = (); # default for style $DI{fvwm_app} = 'mini-x.xpm:dh:%::'; # micon:law:placement:unused $DI{fvwm_folder} = 'folder.xpm:dh:%::'; # idem $DI{fvwm_title} = 'folder.xpm:dh:%::'; # micon:law:place:spic:color $DI{fvwm_toptitle} = 'mini-k.xpm:no:%::'; # idem my $OPT_INSTALL_PREFIX = ''; warn "invoked with args @ARGV\n" if $verbose; GetOptions( "enable-mini-icons" => \$MINI_ICONS, "enable-tran-mini-icons" => \$TRAN, "mini-icons-path:s" => \$MINI_ICONS_DIR, "png-icons-path:s" => \$PNG_ICONS, "tran-mini-icons-path:s" => \$TRAN_MINI_ICONS, "icon-toptitle:s" => \$DI{"fvwm_toptitle"}, "icon-title:s" => \$DI{"fvwm_title"}, "icon-folder:s" => \$DI{"fvwm_folder"}, "icon-app:s" => \$DI{"fvwm_app"}, "icon-style:s" => \&obsolete, "icons-path:s" => \$ICONS_DIR, "tran-icons-path:s" => \$TRAN_ICONS, "wm-icons" => \$wm_icons, "fvwm-icons" => \$fvwm_icons, "check-mini-icon=s" => \$check_mini_icons, "check-icons=s" => \$check_icons, "help|h|?" => \&show_help, "version|V" => \&show_version, "install-prefix:s" => $OPT_INSTALL_PREFIX, "type:s" => \&obsolete, "fvwmgtk-alias=s" => \&obsolete, "title:s" => \&obsolete, "name:s" => \&obsolete, "enable-style" => \&obsolete, "enable-tran-style" => \&obsolete, "submenu-name-prefix:s" => \&obsolete, "dir:s" => \&obsolete, "destroy-type:s" => \&obsolete, "xterm:s" => \$TERM_CMD, "lang:s" => \$language, "utf8" => \&obsolete, "uniconv=s" => \$charset, "uniconv-exec=s" => \&obsolete, "menu-style=s" => \$MENU_STYLE, "check-app!" => \&obsolete, "time-limit=s" => \&obsolete, "merge-user-menu" => \&obsolete, "desktop=s" => \&obsolete, "su_gui" => \$root_cmd, "kde_config" => \$kde_cmd, "verbose" => \$verbose ); icon_init(); # kde-config helps us find things. # sometimes it has funny names. # we can get by without it. if ( ! defined $kde_cmd) { foreach ("kde-config", "kde4-config") { if (check_app($_)) { $kde_cmd = $_; last; } } } $DefaultAppDirs = get_app_dirs(); $DefaultDirectoryDirs = get_desktop_dirs(); $root_menu = get_root_menu(); @KDELegacyDirs = get_KDE_legacy_dirs(); $charset = langinfo(CODESET); $language = setlocale(LC_MESSAGES); if (! defined $root_cmd ) { foreach (qw(gnomesu kdesu xdg_menu_su)) { if (check_app($_)) { $root_cmd = $_; last; } } } if ($verbose) { warn qq| DEBUG: root menu is $root_menu. DEBUG: charset is $charset. DEBUG: language is $language. DEBUG: root-cmd is $root_cmd.|; if (defined $kde_cmd) { warn "\tDEBUG: kde-config command is $kde_cmd."; } else { warn "\tDEBUG: No kde-config command found, using defaults."; } } @language_keys = prepare_language_keys($language); unless (-f $root_menu) { warn "ERROR: Can't find root menu file.\n" if $verbose; exit 1; } my $tree = read_menu($root_menu); merge_menus($tree); move_menus($tree); my $menu = interpret_root($tree, ''); remove_allocated($menu); preprocess_menu($menu); remove_empty_menus($menu); my $output = output_fvwm2_menu($menu); print $output; # output the menu style if ($MENU_STYLE ne "") { foreach (@menus_for_style) { print qq|ChangeMenuStyle "$MENU_STYLE" "$_"\n|; } } exit 0; # Set DI to list of icons to use: sub icon_init { my @list=(); my %law; my %place; my %spic; my %scolor; my $j = ""; my $l = ""; my $tmp_icon =""; if ($wm_icons) { $MINI_ICONS = 1; $MINI_ICONS_DIR = ""; $DI{"fvwm_toptitle"} = "menu/folder-open.xpm:ow"; $DI{"fvwm_title"} = "menu/folder-open.xpm:ow"; $DI{"fvwm_folder"} = "menu/folder.xpm:ow"; $DI{"fvwm_app"} = "menu/utility.xpm:ow"; } if ($fvwm_icons) { $MINI_ICONS = 1; $MINI_ICONS_DIR = ""; $DI{"fvwm_toptitle"} = "mini.fvwm.xpm::%"; $DI{"fvwm_title"} = "mini.folder.xpm::%"; $DI{"fvwm_folder"} = "mini.ofolder.xpm::%"; $DI{"fvwm_app"} = "mini.cat.xpm::%"; } foreach my $i (keys(%DI)) { @list = split(':',$DI{$i}); $dmicon{$i} = $list[0]; # "default" mini-icon $law{$i} = $list[1]; # default law $place{$i} = $list[2]; # default position $spic{$i} = $list[3]; # sidepic icon $scolor{$i} = $list[4]; # color for sidepic $DI{$i} = ''; } if ($TRAN) { $MINI_ICONS = 1; } if ($MINI_ICONS_DIR ne 'mini/' or $ICONS_DIR ne '') { if ($MINI_ICONS_DIR ne '') { $MINI_ICONS_DIR =~ s/\/*$/\//; } if ($ICONS_DIR eq '') { $ICONS_DIR = up_directory($MINI_ICONS_DIR); } elsif ($ICONS_DIR eq 'inpath') { $ICONS_DIR = ''; } else { $ICONS_DIR =~ s/\/*$/\// if $MINI_ICONS_DIR ne ''; } } if ($TRAN_MINI_ICONS ne 'mini/' or $TRAN_ICONS ne '') { if ($TRAN_MINI_ICONS ne '') { $TRAN_MINI_ICONS =~ s/\/*$/\//; } if ($TRAN_ICONS eq '') { $TRAN_ICONS = up_directory($TRAN_MINI_ICONS); } elsif ($TRAN_ICONS eq 'inpath') { $TRAN_ICONS = ''; } else { $TRAN_ICONS =~ s/\/*$/\// if $TRAN_ICONS ne ''; } } $PNG_ICONS =~ s/\/*$/\// if $PNG_ICONS ne ''; # init default mini-icons, law, place, sidepic, color foreach my $i (qw(fvwm_app fvwm_folder fvwm_title fvwm_toptitle)) { warn "DEBUG: foreach $i.\n" if $verbose; # dje debug # With the mini-icons-tran options we "use" gtk default if ($TRAN) { $j = substr($i,index($i,'_')); $j = "gtk$j"; $law{$i} = $law{$j}; $tmp_icon = $dmicon{$j}; $tmp_icon =~ s/\.png$/\.xpm/; $dmicon{$i} = "$TRAN_MINI_ICONS$tmp_icon"; } else { $dmicon{$i} = "$MINI_ICONS_DIR$dmicon{$i}"; } if ($verbose) { while (my ($key,$value) = each %dmicon) { warn "INTERMEDIATE icons to use $key -> $value.\n"; } } @list = split(':',$DI{$i}); $l = @list; while ($l <= 5) { push(@list,''); ++$l; } $law{$i} = $list[1] if ($list[1] eq 'no' or $list[1] eq 'ow' or $list[1] eq 're' or $list[1] eq 'dh'); $dmicon{$i} = "$MINI_ICONS_DIR$list[0]" if $list[0] ne ''; $place{$i} = '*' if $list[2] eq 'up'; $dmicon{$i} = "$place{$i}$dmicon{$i}$place{$i}"; $dmicon{$i} = '' if $law{$i} eq 'no' or $MINI_ICONS == 0; if ($list[3] ne '') { $spic{$i} = "\@$list[3]\@"; } else { $spic{$i} = ''; } if ($list[4] ne '' and $list[3] ne '') { $scolor{$i} = "\^$list[4]\^"; } else { $scolor{$i} = ''; } if ($check_mini_icons ne "") { @check_mini_icons_path = split(":", $check_mini_icons); } if ($check_icons ne "") { @check_icons_path = split(":", $check_icons); } if ($verbose) { while (my ($key, $value) = each %dmicon) { warn "icons to use $key -> $value.\n"; } } } } # Compute cd .. sub up_directory { my($dir) = @_; if ($dir eq '') { return '../'; } chop($dir); if ($dir !~ /\//) { return ''; } $dir = substr($dir, 0, rindex($dir, '/') + 1); return $dir; } sub check_file { my ($file) = @_; unless (-e $file) { return ''; } if (-d $file) { return 'D'; } return 'F'; } my %__scanmap = (); sub scan_AppDir { my ($pool, $dir, $topdir) = @_; $topdir = $dir unless defined $topdir; return if exists $__scanmap{$dir}; opendir( my $dir_fh, $dir ) or return; foreach my $entry ( readdir($dir_fh) ) { if ($entry =~ /\.desktop$/) { read_desktop_entry($pool, "$dir/$entry", $topdir); } elsif (-d _ and $entry !~ /^\.{1,2}$/ and $entry ne '.hidden') { scan_AppDir($pool, "$dir/$entry", $topdir); delete $__scanmap{$dir}; } } closedir $dir_fh; } sub scan_DirectoryDir { my ($pool, $dir, $topdir) = @_; $topdir = $dir unless defined $topdir; return if exists $__scanmap{$dir}; opendir( my $dir_fh, $dir ) or return; foreach my $entry (readdir($dir_fh)) { if (-f "$dir/$entry" and $entry =~ /\.directory$/) { read_directory_entry( $pool, "$dir/$entry", $topdir ); } elsif (-d _ and $entry !~ /^\.{1,2}$/ and $entry ne '.hidden') { scan_DirectoryDir($pool, "$dir/$entry", $topdir); delete $__scanmap{$dir}; } } closedir $dir_fh; } sub read_directory_entry { my ($pool, $file, $topdir) = @_; unless (defined $Directory_entries{$file}) { if ($verbose) { warn "Read directory entry, opening file $file.\n"; } open( my $file_fh, "<", $file ) or return; my $in_desktop_entry = 0; my %entry; while (<$file_fh>) { if (/^\[/) { if (/^\[Desktop Entry\]/) { $in_desktop_entry = 1; } elsif (/^\[.*\]/) { $in_desktop_entry = 0; } } elsif ($in_desktop_entry and /^([^=]*)=([^[:cntrl:]]*)/) { $entry{$1} = $2; } } close($file_fh); my $id = $file; $id =~ s/^$topdir//; $id =~ s/^\/*//; $id =~ s/\//-/g; $entry{'id'} = $id; $Directory_entries{$file} = \%entry; } my $entry = $Directory_entries{$file}; $pool->{'Directory_entries'}{ $entry->{'id'} } = $entry; } sub check_show_in { my ($entry) = @_; return 1 unless defined $entry; my (%OnlyShowIn, %NotShowIn); if (defined $entry->{'OnlyShowIn'}) { foreach my $showin (split /;/, $entry->{'OnlyShowIn'}) { $OnlyShowIn{$showin} = 1; } return 0 unless defined $OnlyShowIn{$desktop_name}; } if (defined $entry->{'NotShowIn'}) { foreach my $showin (split /;/, $entry->{'NotShowIn'}) { $NotShowIn{$showin} = 1; } return 0 if defined $NotShowIn{$desktop_name}; } return 1; } sub read_desktop_entry { my ($pool, $file, $topdir) = @_; unless (defined $Desktop_entries{$file}) { if ($verbose) { warn "Read desktop entry, opening file $file.\n"; } open( my $file_fh, "<", $file ) or return; my $in_desktop_entry = 0; my %entry; while (<$file_fh>) { if (/^\[/) { if (/^\[Desktop Entry\]/) { $in_desktop_entry = 1; } elsif (/^\[.*\]/) { $in_desktop_entry = 0; } } elsif ($in_desktop_entry && /^([^=]*)=([^[:cntrl:]]*)/) { $entry{$1} = $2; } } close($file_fh); my $id = $file; $id =~ s/^$topdir//; $id =~ s/^\/*//; $id =~ s/\//-/g; $entry{'id'} = $id; $entry{'refcount'} = 0; $Desktop_entries{$file} = \%entry; } else { warn "Desktop_entry for $file defined\n" if $verbose; } my $entry = $Desktop_entries{$file}; if (! defined $entry->{'Name'} or ! defined $entry->{'Exec'}) { warn "Name or Exec is not defined\n"; } return unless defined $entry->{'Name'}; return unless defined $entry->{'Exec'}; if (defined $entry->{'Hidden'} and $entry->{'Hidden'} eq 'true') { warn "Hidden entry for $file\n" if $verbose; return; } #FIXME, an option for this would be good if (defined $entry->{'NoDisplay'} and $entry->{'NoDisplay'} eq 'true') { warn "NoDisplay entry for $file\n" if $verbose; return; } if (!check_show_in($entry)) { warn "entry not shown in $file\n" if $verbose; return; } # return unless check_show_in($entry); if (defined $entry->{'NotShowIn'} and $entry->{'NotShowIn'} eq $desktop_name) { warn "entry not shown in 2 $file\n" if $verbose; return; } if (defined $pool and defined $entry->{'Categories'}) { foreach my $category (split /;/, $entry->{'Categories'}) { $pool->{'Categories'}{$category} = [] unless defined $pool->{'Categories'}{$category}; push @{ $pool->{'Categories'}{$category} }, $entry; } $pool->{'Desktop_entries'}{ $entry->{'id'} } = $entry; } return $entry; } sub read_desktop_entries { my ($directory_paths, $desktop_paths) = @_; my $pool = { 'Desktop_entries' => {}, 'Categories' => {}, 'Directory_entries' => {}, 'Directory_paths' => $directory_paths, 'Desktop_paths' => $desktop_paths }; foreach my $dir (split /:/, $directory_paths) { next if $dir =~ /^\s*$/; scan_DirectoryDir( $pool, $dir ); } foreach my $dir (split /:/, $desktop_paths) { next if $dir =~ /^\s*$/; scan_AppDir( $pool, $dir ); } return $pool; } sub get_directory_entry { my ($entry, $pool) = @_; return $pool->{'Directory_entries'}{$entry}; } sub interpret_Include { my ( $tree, $entries, $pool ) = @_; my %exist; my @list = interpret_entry_node( $tree, 'Or', $pool ); foreach my $e (@$entries) { if ( $e->{type} eq 'desktop' ) { $exist{ $e->{desktop} } = 1; } } foreach my $entry (@list) { next if $exist{$entry}; push @$entries, { type => 'desktop', desktop => $entry }; $entry->{'refcount'}++; $exist{$entry} = 1; } } sub interpret_Exclude { my ( $tree, $entries, $pool ) = @_; my @list = interpret_entry_node( $tree, 'Or', $pool ); foreach my $entry (@list) { my $i = 0; while ( defined $entries->[$i] ) { my $exist = $entries->[$i]; if ($exist->{type} eq 'desktop' and $exist->{desktop} eq $entry ) { splice @$entries, $i, 1; $entry->{'refcount'}--; } else { $i++; } } } } sub interpret_entry_node { my ( $tree, $node, $pool ) = @_; my $i = 0; $i++ if ( ref( $tree->[$i] ) eq 'HASH' ); my @subtree; while (defined $tree->[$i]) { if ($tree->[$i] eq 'Filename') { $i++; if (ref( $tree->[$i][0] ) eq 'HASH' and $tree->[$i][1] eq '0') { my $entry = $tree->[$i][2]; if (defined $pool->{'Desktop_entries'}{$entry}) { push @subtree, [ $pool->{'Desktop_entries'}{$entry} ]; } else { push @subtree, []; } } else { warn "Filename\n"; exit 1 if $die_on_error; } $i++; } elsif ($tree->[$i] eq 'Category') { $i++; if (ref( $tree->[$i][0] ) eq 'HASH' and $tree->[$i][1] eq '0') { my $category = $tree->[$i][2]; if (defined $pool->{'Categories'}{$category}) { push @subtree, $pool->{'Categories'}{$category}; } else { push @subtree, []; } } else { warn "Category\n"; exit 1 if $die_on_error; } $i++; } elsif ($tree->[$i] eq 'All') { $i++; if (values %{ $pool->{'Desktop_entries'} } > 0) { push @subtree, [ values %{ $pool->{'Desktop_entries'} } ]; } else { push @subtree, []; } $i++; } elsif ($tree->[$i] eq '0') { $i++; $i++; } else { my @res = interpret_entry_node( $tree->[ $i + 1 ], $tree->[$i], $pool ); push @subtree, \@res; $i++; $i++; } } if ($node eq 'Or') { my %used; my @res; foreach my $st (@subtree) { foreach my $entry (@$st) { if (!defined $used{$entry}) { push @res, $entry; $used{$entry} = 1; } } } return @res; } elsif ($node eq 'And') { my %used; my @res; my $cnt = @subtree; my $min = @{ $subtree[0] }; my $min_idx = 0; my $idx = 0; foreach my $st (@subtree) { my $num = @$st; if ($num < $min) { $min = $num; $min_idx = $idx; } my %dupes; foreach my $entry (@$st) { next if $dupes{$entry}; $dupes{$entry} = 1; if (!defined $used{$entry}) { $used{$entry} = 1; } else { $used{$entry}++; } } $idx++; } return () if $cnt == 0; foreach my $entry (@{ $subtree[$min_idx] }) { push @res, $entry if $used{$entry} == $cnt; } return @res; } elsif ($node eq 'Not') { my %used; my @res; my $cnt = @subtree; foreach my $st (@subtree) { foreach my $entry (@$st) { $used{$entry} = 1; } } return if $cnt == 0; foreach my $entry (values %{ $pool->{'Desktop_entries'} }) { push @res, $entry if !defined $used{$entry}; } return @res; } else { warn "Can't use '$node' inside or \n"; exit 1 if $die_on_error; return (); } } sub interpret_root { my ($tree, $topdir) = @_; if ($tree->[0] eq 'Menu') { return interpret_menu( $tree->[1] ); } else { warn "No toplevel Menu\n"; exit 1 if $die_on_error; return; } } sub interpret_menu { my ($tree, $directory_paths, $desktop_paths) = @_; $directory_paths = '' unless defined $directory_paths; $desktop_paths = '' unless defined $desktop_paths; my %menu = ( 'entries' => [], 'OnlyUnallocated' => 0, 'DontShowIfEmpty' => 0, 'Deleted' => 0 ); my $i = 0; $i++ if ref $tree->[$i] eq 'HASH'; while (defined $tree->[$i]) { if ($tree->[$i] eq 'AppDir') { if (ref( $tree->[ $i + 1 ][0] ) eq 'HASH' and $tree->[ $i + 1 ][1] eq '0') { $desktop_paths .= ':' . $tree->[ $i + 1 ][2]; splice @$tree, $i, 2; } else { warn "wrong AppDir\n"; exit 1 if $die_on_error; $i++; $i++; } } elsif ($tree->[$i] eq 'DefaultAppDirs') { $desktop_paths .= ':' . $DefaultAppDirs; splice @$tree, $i, 2; } elsif ($tree->[$i] eq 'DirectoryDir') { if (ref( $tree->[ $i + 1 ][0]) eq 'HASH' and $tree->[ $i + 1 ][1] eq '0') { $directory_paths .= ':' . $tree->[ $i + 1 ][2]; splice @$tree, $i, 2; } else { warn "wrong DirectoryDir\n"; exit 1 if $die_on_error; $i++; $i++; } } elsif ($tree->[$i] eq 'DefaultDirectoryDirs') { $directory_paths .= ':' . $DefaultDirectoryDirs; splice @$tree, $i, 2; } else { $i++; $i++; } } $menu{directory_paths} = $directory_paths; $menu{desktop_paths} = $desktop_paths; my $pool = read_desktop_entries( $directory_paths, $desktop_paths ); $i = 0; $i++ if ref $tree->[$i] eq 'HASH'; while (defined $tree->[$i]) { if ($tree->[$i] eq 'Menu') { $i++; my $submenu = interpret_menu( $tree->[$i], $directory_paths, $desktop_paths ); push( @{ $menu{'entries'} }, { type => 'menu', menu => $submenu } ); $i++; } elsif ($tree->[$i] eq 'Name') { $i++; if (ref($tree->[$i][0]) eq 'HASH' and $tree->[$i][1] eq '0') { $menu{'Name'} = $tree->[$i][2]; exit 1 if $die_on_error; } $i++; } elsif ($tree->[$i] eq 'Directory') { $i++; if (ref( $tree->[$i][0] ) eq 'HASH' and $tree->[$i][1] eq '0') { $menu{'Directory'} = get_directory_entry( $tree->[$i][2], $pool ); } else { warn "wrong Directory\n"; exit 1 if $die_on_error; } $i++; } elsif ($tree->[$i] eq 'OnlyUnallocated') { $menu{'OnlyUnallocated'} = 1; $i++; $i++; } elsif ($tree->[$i] eq 'DontShowIfEmpty') { $menu{'DontShowIfEmpty'} = 1; $i++; $i++; } elsif ($tree->[$i] eq 'Deleted') { $menu{'Deleted'} = 1; $i++; $i++; } elsif ($tree->[$i] eq 'NotDeleted') { $menu{'Deleted'} = 0; $i++; $i++; } elsif ($tree->[$i] eq 'Include') { $i++; interpret_Include($tree->[$i], $menu{'entries'}, $pool); $i++; } elsif ($tree->[$i] eq 'Exclude') { $i++; interpret_Exclude($tree->[$i], $menu{'entries'}, $pool); $i++; } elsif ($tree->[$i] eq 'Layout' or $tree->[$i] eq 'DefaultLayout') { $i+=2; # Ignore } elsif ($tree->[$i] eq '0') { $i++; if ($tree->[$i] !~ /^\s*$/) { print STDERR "skip '$tree->[$i]'\n"; exit 1 if $die_on_error; } $i++; } else { warn "Unknown '$tree->[$i]':\n"; $i++; warn " '@{$tree->[$i]}'\n"; $i++; exit 1 if $die_on_error; } } return \%menu; } sub read_menu { my ($file, $basedir) = @_; if ($file !~ /^\// and defined $basedir) { $file = "$basedir/$file"; } unless (defined $basedir) { $basedir = $file; $basedir =~ s/\/[^\/]*$//; } unless (-e $file) { warn "WARNING: '$file' does not exist\n" if $verbose; return [ 'Menu', [ {} ] ]; } warn "reading menu '$file'\n" if $verbose; my $parser = XML::Parser->new(Style => 'Tree'); my $tree = $parser->parsefile($file); my $DefaultMergeDir = $file; $DefaultMergeDir =~ s/^.*\///; $DefaultMergeDir =~ s/\.menu$/-merged/; read_includes($tree, $basedir, $DefaultMergeDir); return $tree; } sub read_menu_dir { my ($dir, $basedir) = @_; my $out = []; if ($dir !~ /^\// and defined $basedir) { $dir = "$basedir/$dir"; } # TA: XXX: FIXME! opendir( my $dir_fh, $dir ) or return $out; foreach my $entry (grep { -f && /\.menu$/ } readdir($dir_fh)) { my $menu = read_menu("$dir/$entry"); $menu = remove_toplevel_Menu($menu); push @$out, @$menu; } closedir $dir_fh; return $out; } sub quote_xml { my ($txt) = @_; $txt =~ s/&/&/g; $txt =~ s//>/g; return $txt; } sub read_legacy_dir { my ($dir, $basedir) = @_; my $out; $dir =~ s/\/*$//; $basedir = $dir unless defined $basedir; $out = "\n"; if ($dir eq $basedir) { my $xmldir = quote_xml($dir); $out .= "$xmldir\n"; $out .= "$xmldir\n"; } else { my $name = $dir; $name =~ s/\/*$//; $name =~ s/^.*\///; $name = quote_xml($name); $out .= "$name\n"; } if (-f "$dir/.directory") { my $dir_id = "$dir/.directory"; $dir_id =~ s/^$basedir//; $dir_id =~ s/^\///; $dir_id = quote_xml($dir_id); $out .= "$dir_id\n"; } if (opendir(my $dir_fh, $dir)) { foreach my $entry (readdir($dir_fh)) { if (-f "$dir/$entry" and $entry =~ /\.desktop$/) { my $id = "$dir/$entry"; $id =~ s/^$basedir//; $id =~ s/^\///; $id =~ s/\//-/g; $id = quote_xml($id); my $desktop = read_desktop_entry( undef, "$dir/$entry", $basedir ); $out .= "$id\n" unless defined $desktop->{'Categories'}; } elsif (-d "$dir/$entry" and $entry !~ /^\.{1,2}$/ and $entry ne '.hidden') { $out .= read_legacy_dir( "$dir/$entry", $basedir ); } } closedir $dir_fh; } $out .= "\n"; return $out; } sub remove_toplevel_Menu { my ($tree) = @_; if ($tree->[0] eq 'Menu') { shift @{ $tree->[1] } if ref $tree->[1][0] eq 'HASH'; return $tree->[1]; } else { warn "No toplevel Menu\n"; exit 1 if $die_on_error; return; } } sub read_includes { my ($tree, $basedir, $DefaultMergeDir) = @_; my $i = 0; $i++ if ref $tree->[$i] eq 'HASH'; while (defined $tree->[$i]) { if ($tree->[$i] eq 'MergeFile') { if (ref( $tree->[ $i + 1 ][0]) eq 'HASH' and $tree->[ $i + 1 ][1] eq '0') { my $add_tree = read_menu( $tree->[ $i + 1 ][2], $basedir ); $add_tree = remove_toplevel_Menu($add_tree); splice @$tree, $i, 2, @$add_tree; } else { warn "wrong MergeFile\n"; exit 1 if $die_on_error; $i++; $i++; } } elsif ($tree->[$i] eq 'MergeDir') { if (ref( $tree->[ $i + 1 ][0] ) eq 'HASH' and $tree->[ $i + 1 ][1] eq '0') { my $add_tree = read_menu_dir( $tree->[ $i + 1 ][2], $basedir ); splice @$tree, $i, 2, @$add_tree; } else { warn "wrong MergeFile\n"; exit 1 if $die_on_error; $i++; $i++; } } elsif ($tree->[$i] eq 'DefaultMergeDirs') { my $add_tree = read_menu_dir( $DefaultMergeDir, $basedir ); splice @$tree, $i, 2, @$add_tree; } elsif ($tree->[$i] eq 'LegacyDir') { if (ref( $tree->[ $i + 1 ][0] ) eq 'HASH' and $tree->[ $i + 1 ][1] eq '0') { if (-d $tree->[ $i + 1 ][2]) { my $xml = read_legacy_dir( $tree->[ $i + 1 ][2] ); warn "reading legacy directory '" . $tree->[ $i + 1 ][2] . "'\n" if $verbose; my $parser = XML::Parser->new(Style => 'Tree'); my $add_tree = $parser->parse($xml); $add_tree = remove_toplevel_Menu($add_tree); splice @$tree, $i, 2, @$add_tree; } else { warn "legacy directory '" . $tree->[ $i + 1 ][2] . "' not found\n" if $verbose; splice @$tree, $i, 2, (); } } else { warn "wrong LegacyDir\n"; exit 1 if $die_on_error; $i++; $i++; } } elsif ($tree->[$i] eq 'KDELegacyDirs') { my @out; foreach my $dir (@KDELegacyDirs) { my $xml = read_legacy_dir($dir); warn "reading legacy directory '$dir'\n" if $verbose; my $parser = new XML::Parser( Style => 'Tree' ); my $add_tree = $parser->parse($xml); $add_tree = remove_toplevel_Menu($add_tree); push @out, @$add_tree; } splice @$tree, $i, 2, @out; } elsif ($tree->[$i] eq 'Menu') { $i++; read_includes( $tree->[$i], $basedir, $DefaultMergeDir ); $i++; } else { $i++; $i++; } } } sub get_menu_name { my ($tree) = @_; my $name; my $i = 0; $i++ if ref $tree->[$i] eq 'HASH'; while (defined $tree->[$i]) { if ($tree->[$i] eq 'Name') { $i++; if (ref( $tree->[$i][0] ) eq 'HASH' and $tree->[$i][1] eq '0') { $name = $tree->[$i][2]; last; } else { warn "wrong Name\n"; } $i++; } else { $i++; $i++; } } unless (defined $name) { warn "Menu has no name element\n"; } return $name; } sub append_menu { my ($target, $source) = @_; my $i = 0; $i++ if ref $source->[$i] eq 'HASH'; while (defined $source->[$i]) { if ($source->[$i] ne 'Name') { push @$target, $source->[$i]; push @$target, $source->[ $i + 1 ]; } $i++; $i++; } } sub merge_menus { my ($tree) = @_; my %used; #menu name already used my $i = 0; $i++ if ref $tree->[$i] eq 'HASH'; while (defined $tree->[$i]) { if ($tree->[$i] eq 'Menu') { my $name = get_menu_name($tree->[ $i + 1 ]); if (defined $used{$name}) { my $target = $used{$name}; append_menu($tree->[$target], $tree->[ $i + 1 ]); splice @$tree, $i, 2; } else { # first appearance $used{$name} = $i + 1; $i++; $i++; } } else { $i++; $i++; } } $i = 0; $i++ if ref $tree->[$i] eq 'HASH'; while (defined $tree->[$i]) { if ($tree->[$i] eq 'Menu') { merge_menus($tree->[ $i + 1 ]); } $i++; $i++; } } sub read_Move { my ( $tree, $hash ) = @_; my $i = 0; my $old = ''; $i++ if ref $tree->[$i] eq 'HASH'; while (defined $tree->[$i]) { if ($tree->[$i] eq 'Old') { $i++; if (ref( $tree->[$i][0] ) eq 'HASH' and $tree->[$i][1] eq '0') { $old = $tree->[$i][2]; } else { warn "wrong Old\n"; exit 1 if $die_on_error; } $i++; } if ($tree->[$i] eq 'New') { $i++; if (ref( $tree->[$i][0] ) eq 'HASH' and $tree->[$i][1] eq '0') { $hash->{$old} = $tree->[$i][2]; } else { warn "wrong New\n"; exit 1 if $die_on_error; } $i++; } else { $i++; $i++; } } } sub find_menu_in_tree { my ( $path, $tree ) = @_; my $root = $path; $root =~ s/\/.*$//; my $subpath = $path; $subpath =~ s/^[^\/]*\/*//; my $i = 0; $i++ if ref $tree->[$i] eq 'HASH'; while (defined $tree->[$i]) { if ($tree->[$i] eq 'Menu') { if ($root eq get_menu_name( $tree->[ $i + 1 ])) { if ($subpath eq '') { return { 'parent' => $tree, 'index' => $i, 'menu' => $tree->[ $i + 1 ] }; } return find_menu_in_tree( $subpath, $tree->[ $i + 1 ] ); } } $i++; $i++; } #FIXME - TA: Don't return undef here, it's bad. return undef; } sub copy_menu { my ($path, $tree) = @_; my $tail; my $child; foreach my $elem (reverse split( /\//, $path)) { next if $elem eq ''; my $menu = [ {}, 'Name', [ {}, 0, $elem ] ]; push @$menu, ( 'Menu', $child ) if defined $child; $tail = $menu unless defined $tail; $child = $menu; } append_menu( $tail, $tree ); return $child; } sub move_menus { my ($tree) = @_; my %move; my $i = 0; $i++ if ref $tree->[$i] eq 'HASH'; while (defined $tree->[$i]) { if ($tree->[$i] eq 'Move') { read_Move($tree->[ $i + 1 ], \%move); splice @$tree, $i, 2; } else { $i++; $i++; } } foreach my $source (keys %move) { my $sourceinfo = find_menu_in_tree($source, $tree); if (defined $sourceinfo) { my $target = copy_menu($move{$source}, $sourceinfo->{'menu'}); splice @{ $sourceinfo->{'parent'} }, $sourceinfo->{'index'}, 2; push @$tree, ('Menu', $target); merge_menus($tree); } } $i = 0; $i++ if ref $tree->[$i] eq 'HASH'; while (defined $tree->[$i]) { if ($tree->[$i] eq 'Menu') { move_menus($tree->[ $i + 1 ]); } $i++; $i++; } } sub remove_allocated { my ($menu) = @_; my $i = 0; while ($i < @{ $menu->{'entries'} }) { my $entry = $menu->{'entries'}[$i]; if ($entry->{type} eq 'menu') { remove_allocated( $entry->{menu} ); $i++; } elsif ($entry->{type} eq 'desktop' and $menu->{'OnlyUnallocated'} and $entry->{desktop}{'refcount'} > 1) { $entry->{desktop}{'refcount'}--; splice @{ $menu->{'entries'} }, $i, 1; } else { $i++; } } return 0; } sub remove_empty_menus { my ($menu) = @_; my $i = 0; while ($i < @{ $menu->{'entries'} }) { my $entry = $menu->{'entries'}[$i]; if ($entry->{type} eq 'menu' and remove_empty_menus($entry->{menu})) { splice @{ $menu->{'entries'} }, $i, 1; } else { $i++; } } @{ $menu->{'entries'} } == 0 ? return 1 : return 0; } sub prepare_exec { my ( $exec, $desktop ) = @_; # Take out filename flags, etc. $exec =~ s/%f//g; $exec =~ s/%F//g; $exec =~ s/%u//g; $exec =~ s/%U//g; $exec =~ s/%d//g; $exec =~ s/%D//g; $exec =~ s/%n//g; $exec =~ s/%N//g; $exec =~ s/%i//g; $exec =~ s/%k//g; $exec =~ s/%v//g; $exec =~ s/%m//g; my $caption = $desktop->{Name}; $exec =~ s/%c/$caption/g; $exec =~ s/%%/%/g; if (defined $desktop->{Terminal}) { if ($desktop->{Terminal} eq '1' or $desktop->{Terminal} eq 'true') { $exec = "$TERM_CMD $exec"; } } if (defined $desktop->{'X-KDE-SubstituteUID'}) { if ($desktop->{'X-KDE-SubstituteUID'} eq '1' or $desktop->{'X-KDE-SubstituteUID'} eq 'true') { $exec = "$root_cmd $exec" } } return $exec; } sub get_loc_entry { my ( $desktop, $entry ) = @_; foreach my $key (@language_keys) { my $loc_entry = $entry . "[$key]"; if (defined $desktop->{$loc_entry} and $desktop->{$loc_entry} !~ /^\s*$/) { return $desktop->{$loc_entry}; } } return $desktop->{$entry}; } sub preprocess_menu { # localize, sort, prepare_exec my ($menu) = @_; return 0 if $menu->{'Deleted'}; return 0 unless check_show_in( $menu->{'Directory'} ); if( defined $menu->{'Directory'} and defined $menu->{'Directory'}->{'NoDisplay'} and $menu->{'Directory'}->{'NoDisplay'} eq 'true') { return 0; } my $menu_name = $menu->{'Name'}; if (defined $menu->{'Directory'}) { my $directory = $menu->{'Directory'}; my $directory_name = get_loc_entry( $directory, 'Name' ); if (defined $directory_name) { if( !defined $directory->{"Encoding"} or $directory->{"Encoding"} eq 'UTF-8') { Encode::from_to($directory_name, "utf8", $charset); } $menu_name = $directory_name; } } $menu->{'PrepName'} = $menu_name; my $i = 0; while ( defined $menu->{'entries'}[$i] ) { my $entry = $menu->{'entries'}[$i]; if ( $entry->{'type'} eq 'desktop' ) { my $desktop = $entry->{desktop}; my $name = $desktop->{'id'}; my $desktop_name = get_loc_entry( $desktop, 'Name' ); if ( defined $desktop_name ) { Encode::from_to( $desktop_name, "utf8", $charset ) if !defined $desktop->{"Encoding"} || $desktop->{"Encoding"} eq 'UTF-8'; $name = $desktop_name; } $desktop->{'PrepName'} = $name; $entry->{'Name'} = $name; $entry->{'PrepName'} = $name; $desktop->{'PrepExec'} = prepare_exec( $desktop->{Exec}, $desktop ); $i++; } elsif ( $entry->{type} eq 'menu' ) { if ( preprocess_menu( $entry->{'menu'} ) ) { $entry->{'Name'} = $entry->{'menu'}{'Name'}; $entry->{'PrepName'} = $entry->{'menu'}{'PrepName'}; $i++; } else { splice @{ $menu->{'entries'} }, $i, 1; } } else { warn "wrong menu entry type: $entry->{type}"; exit 1 if $die_on_error; splice @{ $menu->{'entries'} }, $i, 1; } } $menu->{'entries'} = [ sort { $b->{'type'} cmp $a->{'type'} || $a->{'PrepName'} cmp $b->{'PrepName'} } @{ $menu->{'entries'} } ]; $i = 0; my $prev_entry; while ( defined $menu->{'entries'}[$i] ) { my $entry = $menu->{'entries'}[$i]; if (defined $prev_entry and $entry->{'type'} eq 'desktop' and $prev_entry->{'type'} eq 'desktop' and $prev_entry->{'PrepName'} eq $entry->{'PrepName'} and $prev_entry->{'desktop'}->{'PrepExec'} eq $entry->{'desktop'}->{'PrepExec'} ) { splice @{ $menu->{'entries'} }, $i, 1; } else { $prev_entry = $entry; $i++; } } return 1; } sub output_fvwm2_menu { my ($menu, $toplevel, $path) = @_; $path = '' unless defined $path; $toplevel = 1 unless defined $toplevel; my $output = ''; my $label = ''; my $menu_name = $menu->{'PrepName'}; my $menu_id = "$path-" . $menu->{'Name'}; $menu_id =~ s/\s/_/g; $menu_id = $menu_prefix if $toplevel; foreach my $entry ( @{ $menu->{'entries'} } ) { if ( $entry->{type} eq 'menu' ) { $output .= output_fvwm2_menu( $entry->{'menu'}, 0, $menu_id ); } } $output .= "DestroyMenu \"$menu_id\"\n"; $output .= "AddToMenu \"$menu_id\" \"$dmicon{'fvwm_title'}$label$menu_name\" Title\n"; if ($MENU_STYLE ne '') { push @menus_for_style, $menu_id; } foreach my $entry ( @{ $menu->{'entries'} } ) { if ( $entry->{type} eq 'desktop' ) { my $desktop = $entry->{desktop}; my $name = $desktop->{'PrepName'}; my $exec = $desktop->{'PrepExec'}; $output .= "+ \"$dmicon{'fvwm_app'}$name\" Exec $exec\n"; } elsif ( $entry->{type} eq 'menu') { my $name = $entry->{'menu'}{'PrepName'}; my $id = "$menu_id-" . $entry->{'menu'}{'Name'}; $id =~ s/\s/_/g; $output .= "+ \"$dmicon{'fvwm_folder'}$name\" Popup \"$id\"\n"; } else { warn "wrong menu entry type: $entry->{type}"; } } $output .= "\n"; if ("$menu_id" eq "$menu_prefix-System_Tools") { $output .= "AddToMenu \"$menu_prefix-System_Tools\" " . "\"$dmicon{'fvwm_app'}Regenerate Applications Menu\" " . "FvwmForm FvwmForm-Desktop\n"; } return $output; } sub get_root_menu { my $xdg_config_dirs = $ENV{XDG_CONFIG_DIRS} || ''; my $xdg_menu_prefix = $ENV{XDG_MENU_PREFIX} || ''; foreach my $dir (split(/:/, $xdg_config_dirs), "/etc/xdg") { my $menu_file="$dir/menus/${xdg_menu_prefix}applications.menu"; # warn "looking for root menu $menu_file\n" if $verbose; return "$menu_file" if -f "$menu_file"; } return ""; } sub get_app_dirs { my %used; my $ret = ''; my @kde_xdgdata; if ( defined $kde_cmd ) { @kde_xdgdata = split( /:/, `$kde_cmd --path xdgdata-apps` ); } else { @kde_xdgdata = ("$ENV{HOME}/.local/share/applications/", "/usr/share/kde-settings/kde-profile/default/share/applications/", "/usr/share/applications/", "/usr/local/share/applications/"); } foreach (@kde_xdgdata) { s/\/applications\/*\s*$//; } foreach my $d (split( /:/, $xdg_data_dirs ), @kde_xdgdata, "/usr/share", "/opt/gnome/share") { my $dir = $d; $dir =~ s/\/*$//; next if defined $used{$dir}; next if check_file("$dir/applications") ne 'D'; $ret .= ':' if $ret ne ''; $ret .= "$dir/applications"; $used{$dir} = 1; } if ($verbose) { foreach ( split( ':', $ret ) ) { warn "app dirs $_\n"; } } return $ret; } sub get_desktop_dirs { my %used; my $ret = ''; foreach my $dir ( split( /:/, $xdg_data_dirs ), qw(/usr/share /opt/kde3/share /opt/gnome/share) ) { next if defined $used{$dir}; next if check_file("$dir/desktop-directories") ne 'D'; $ret .= ':' if $ret ne ''; $ret .= "$dir/desktop-directories"; $used{$dir} = 1; } warn "desktop dirs $ret\n" if $verbose; return $ret; } sub get_KDE_legacy_dirs { my %used; my @ret = (); my @legacy_dirs = (qw( /usr/share/applications /etc/opt/kde3/share/applnk /opt/kde3/share/applnk ) ); if ( defined $kde_cmd) { push @legacy_dirs, reverse(split(/:/,`$kde_cmd --path apps` )); } foreach my $d ( @legacy_dirs ) { my $dir = $d; chomp $dir; $dir =~ s/\/*$//; next if defined $used{$dir}; next if check_file("$dir") ne 'D'; $used{$dir} = 1; push @ret, $dir; } warn "KDE legacy dirs @ret\n" if $verbose; return @ret; } sub prepare_language_keys { my ($language) = @_; my @keys; $language =~ s/\.[^@]*//; # remove .ENCODING if ( $language =~ /^([^_]*)_([^@]*)@(.*)$/) { # LANG_COUNTRY@MODIFIER push @keys, $1 . '_' . $2 . '@' . $3; push @keys, $1 . '_' . $2; push @keys, $1 . '@' . $3; push @keys, $1; } elsif ($language =~ /^([^_]*)_([^@]*)$/) { # LANG_COUNTRY push @keys, $1 . '_' . $2; push @keys, $1; } elsif ($language =~ /^([^_]*)@(.*)$/) { # LANG@MODIFIER push @keys, $1 . '@' . $2; push @keys, $1; } elsif ($language =~ /^([^_@]*)$/) { # LANG push @keys, $1; } return @keys; } # Fixme, remove unsupported options. sub show_help { print <. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "fvwm-perllib 1" .TH fvwm-perllib 1 "2009-03-22" "2.5.28 (from cvs)" "Fvwm Utilities" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" fvwm\-perllib \- shows the documentation of the Fvwm Perl library .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBfvwm-perllib\fR [ \fB\-\-help\fR|\fB\-h\fR|\fB\-?\fR ] [ \fB\-\-version\fR|\fB\-v\fR|\fB\-V\fR ] [ \fBman\fR [ \fIPerl::Class\fR ] ] [ \fBcat\fR [ \fIPerl::Class\fR ] ] [ \fBraw\fR [ \fIPerl::Class\fR ] ] [ \fBdir\fR ] .SH "DESCRIPTION" .IX Header "DESCRIPTION" Starting from fvwm\-2.5.x versions there is a built-in support for creating fvwm modules in Perl. This \fBfvwm-perllib\fR utility provides help services for the Fvwm Perl library. .SH "OPTIONS" .IX Header "OPTIONS" \&\fB\-\-help\fR show the help and exit .PP \&\fB\-\-version\fR show the version and exit .PP \&\fB\-\-man\fR or \fBman\fR [ \fIPerl::Class\fR ] show manual page just like \fIman\fR\|(1) .PP \&\fB\-\-cat\fR or \fBcat\fR [ \fIPerl::Class\fR ] show manual page in plain text .PP \&\fB\-\-raw\fR or \fBraw\fR [ \fIPerl::Class\fR ] generate output in man format (not human readable) .PP \&\fB\-\-dir\fR or \fBdir\fR print perllib directory without a trailing end of line .SH "USAGE" .IX Header "USAGE" Use this in the fvwm modules written in Perl: .PP .Vb 1 \& use lib \`fvwm\-perllib dir\`; .Ve .PP Introduction to the Fvwm Perl library: .PP .Vb 1 \& % fvwm\-perllib man .Ve .PP Manual page for the \f(CW\*(C`FVWM::Module\*(C'\fR class: .PP .Vb 1 \& % fvwm\-perllib man FVWM::Module .Ve .PP Standard options: .PP .Vb 2 \& % fvwm\-perllib \-\-help \& % fvwm\-perllib \-\-version .Ve .SH "AUTHORS" .IX Header "AUTHORS" Mikhael Goikhman . .SH "COPYING" .IX Header "COPYING" The script is distributed by the same terms as fvwm itself. See \s-1GNU\s0 General Public License for details. .SH "BUGS" .IX Header "BUGS" No known bugs. .PP Report bugs to fvwm\-bug@fvwm.org. fvwm-2.6.5.orig/bin/fvwm-config.1.in0000644000175000017500000000611111705520306015301 0ustar vwcvwc.\" @(#)@PACKAGE@-@VERSION@ @RELDATELONG@ .de EX \"Begin example .ne 5 .if n .sp 1 .if t .sp .5 .nf .in +.5i .. .de EE .fi .in -.5i .if n .sp 1 .if t .sp .5 .. .ta .3i .6i .9i 1.2i 1.5i 1.8i .TH fvwm-config 1 "@RELDATELONG@ (@VERSION@)" Fvwm "Fvwm Modules" .UC .SH NAME fvwm-config \- query an existing fvwm installation .SH SYNOPSIS .B fvwm-config .RI [ --help ] .RI [ --version ] .RI [ --info ] .RI [ --prefix ] .RI [ --exec-prefix ] .RI [ --bindir ] .RI [ --datadir ] .RI [ --libexecdir ] .RI [ --sysconfdir ] .RI [ --mandir ] .RI [ --localedir ] .RI [ --fvwm-moduledir ] .RI [ --fvwm-datadir ] .RI [ --fvwm-perllibdir ] .RI [ --default-imagepath ] .RI [ --default-userdir ] .RI [ --fvwm-exe ] .RI [ --supports ] .RI [ --supports- ] .SH DESCRIPTION .B fvwm-config is a shell script that provides an information about the fvwm version, installation directories, built-in paths and supported features. .SH OPTIONS .B fvwm-config prints to the standard output in all options. Both short and long GNU-like option names may be used. .TP .B -h --help -? prints the short usage .TP .B -v --version -V prints the version .TP .B -i --info prints the full info page .TP .B -P --prefix prints the installation prefix .TP .B -E --exec-prefix prints the installation exec-prefix .TP .B -B --bindir prints the installation bindir .TP .B -D --datadir prints the installation datadir .TP .B -L --libexecdir prints the installation libexecdir .TP .B -S --sysconfdir prints the installation sysconfdir .TP .B -M --mandir prints the installation mandir .TP .B -O --localedir prints the installation localedir .TP .B -m --fvwm-moduledir prints FVWM_MODULEDIR, where the modules are installed .TP .B -d --fvwm-datadir prints FVWM_DATADIR, where the system wide configs are installed .TP .B -p --fvwm-perllibdir prints FVWM_PERLLIBDIR, where the perl library is installed .TP .B -I --default-imagepath prints the built-in ImagePath .TP .B -U --default-userdir prints the default FVWM_USERDIR, note: $HOME is not expanded .TP .B -e --fvwm-exe prints the fvwm executable name (in bindir) .TP .B -s --supports lists all supported features, one per line .TP .BI --supports- prints nothing, returns: 0 if the .I is supported, 100 if not, 200 if unknown. All or supported feature names may be found using .IR --info " or " --supports respectively. .TP .SH USAGE Here are some real life usages. Checks for xft support: .EX if fvwm-config --supports-xft; then echo 1; else echo 0; fi .EE .I fvwm-themes package checks for the correct .I fvwm version installed using: .EX fvwm-config --version .EE and tries to use the same installation directories: .EX fvwm-config --bindir --mandir --fvwm-datadir .EE A way to find the full path to the fvwm executable: .EX echo `fvwm-config --bindir`/`fvwm-config --fvwm-exe` .EE A way to start modules in perl: .EX use lib `fvwm-config -p | tr -d '\n'`; use FVWM::Module; .EE For a more human readable output, try: .EX fvwm-config --info .EE .SH COPYING .B fvwm-config is a part of fvwm package and distributed by the same terms, see GNU GPL. .SH AUTHOR Mikhael Goikhman fvwm-2.6.5.orig/bin/fvwm-menu-directory.10000644000175000017500000003631711161434720016410 0ustar vwcvwc.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.02) .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "fvwm-menu-directory 1" .TH fvwm-menu-directory 1 "2009-03-22" "2.5.28 (from cvs)" "Fvwm Utilities" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" fvwm\-menu\-directory \- builds a directory browsing menu for fvwm .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBfvwm-menu-directory\fR [ \fB\-\-help\fR|\fB\-h\fR|\fB\-?\fR ] [ \fB\-\-version\fR|\fB\-V\fR ] [ \fB\-\-name\fR|\fB\-na\fR \s-1NAME\s0 ] [ \fB\-\-title\fR|\fB\-t\fR \s-1NAME\s0 ] [ \fB\-\-item\fR|\fB\-it\fR \s-1NAME\s0 ] [ \fB\-\-icon\-title\fR|\fB\-icon\-t\fR \s-1XPM\s0 ] [ \fB\-\-icon\-dir\fR|\fB\-icon\-d\fR \s-1XPM\s0 ] [ \fB\-\-icon\-file\fR|\fB\-icon\-f\fR \s-1XPM\s0 ] [ \fB\-\-icon\-app\fR|\fB\-icon\-a\fR \s-1XPM\s0 ] [ \fB\-\-wm\-icons\fR ] [ \fB\-\-dir\fR|\fB\-d\fR \s-1NAME\s0 ] [ \fB\-\-order\fR|\fB\-o\fR \s-1NUM\s0 ] [ \fB\-\-[no]all\fR|\fB\-a\fR ] [ \fB\-\-[no]links\fR|\fB\-l\fR ] [ \fB\-\-xterm\fR|\fB\-x\fR \s-1CMD\s0 ] [ \fB\-\-exec\-title\fR|\fB\-exec\-t\fR \s-1CMD\s0 ] [ \fB\-\-exec\-file\fR|\fB\-exec\-f\fR \s-1CMD\s0 ] [ \fB\-\-exec\-app\fR|\fB\-exec\-a\fR [\s-1CMD\s0] ] [ \fB\-\-command\-title\fR|\fB\-command\-t\fR \s-1CMD\s0 ] [ \fB\-\-command\-file\fR|\fB\-command\-f\fR \s-1CMD\s0 ] [ \fB\-\-command\-app\fR|\fB\-command\-a\fR \s-1CMD\s0 ] [ \fB\-\-[no]reuse\fR|\fB\-r\fR ] [ \fB\-\-[no]check\-subdirs\fR|\fB\-ch\fR ] [ \fB\-\-special\-dirs\fR|\fB\-s\fR [\s-1VALUE\s0] ] [ \fB\-\-[no]memory\-for\-speed\fR|\fB\-mem\fR ] [ \fB\-\-menu\-style\fR|\fB\-men\fR \s-1NAME\s0 ] [ \fB\-\-func\-name\fR|\fB\-f\fR \s-1NAME\s0 ] .SH "DESCRIPTION" .IX Header "DESCRIPTION" A perl script which provides an output to read in with PipeRead to build an fvwm menu containing a directory listing. Almost everything can be configured. .SH "HINTS" .IX Header "HINTS" The title item with its own attached action is usually added to the menu. This may be used to define an action for the directory for which the menu is built, such as starting a terminal in this directory (the default). However, this may annoy some users. To disable the title action use \fB\-\-command\-title\fR "", to remove the title completely use \fB\-\-title\fR "". .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-\-help\fR" 4 .IX Item "--help" show the usage and exit .IP "\fB\-\-version\fR" 4 .IX Item "--version" show version and exit .IP "\fB\-\-name\fR name" 4 .IX Item "--name name" menu name, used only with \-\-reuse, default is MenuBrowser .IP "\fB\-\-title\fR title" 4 .IX Item "--title title" menu title format, default is '%*\-40p' \- last 40 characters of the current full path. \s-1TAB\s0 can be specified as '\et', but in .fvwm2rc you should specify a double backslash or a real \s-1TAB\s0. .Sp Format specifiers: \f(CW%d\fR \- the current directory name \f(CW%p\fR \- the current directory full path .Sp These specifiers can receive an optional integer size, positive for right adjusted string or negative for left adjusted, example: \f(CW%8x\fR; and optional *num or *\-num, which means to leave only the first or last (if minus) num of chars, the num must be greater than 3, since the striped part is replaced with \*(L"...\*(R", example: %*30x. Both can be combined: %\-10*\-20x, this instructs to get only the 20 last characters, but if the length is less then 10 \- to fill with up to 10 spaces on the right. .IP "\fB\-\-item\fR format" 4 .IX Item "--item format" menu item format, default is '%n'. \s-1TAB\s0 and width modifiers for \f(CW%n\fR, \f(CW%N\fR and \f(CW%s\fR can be specified as described in \fB\-\-title\fR above. Note, specifying a non default format slows the script. .Sp Format specifiers: .Sp .Vb 7 \& %n \- file/dir name (without the path) \& %N \- file/dir name (full with the path) \& %d \- file/dir date (yyyy\-mm\-dd HH:MM:SS) \& %D \- file/dir date (yyyy\-mm\-dd) \& %s \- file/dir size (in bytes) \& %t \- file/dir type (File|Dir |Link|Sock|Blck|Char|Pipe) \& %T \- file/dir type (F|D|L|S|B|C|P) .Ve .Sp Example: \-\-title '%*\-40p\etDate, Type\etSize' \-\-item '%*40n\et%d \f(CW%t\fR\et%s' .IP "\fB\-\-icon\-title\fR icon" 4 .IX Item "--icon-title icon" menu title icon, default is none .IP "\fB\-\-icon\-dir\fR icon" 4 .IX Item "--icon-dir icon" menu dir icon, default is none .IP "\fB\-\-icon\-file\fR icon" 4 .IX Item "--icon-file icon" menu file icon, default is none .IP "\fB\-\-icon\-app\fR icon" 4 .IX Item "--icon-app icon" menu application icon, default is none .IP "\fB\-\-wm\-icons\fR" 4 .IX Item "--wm-icons" define icon names suitable for use with wm-icons package. Currently this is equivalent to: \-\-icon\-title menu/folder\-open.xpm \-\-icon\-item menu/file.xpm \-\-icon\-dir menu/folder.xpm \-\-icon\-app menu/utility.xpm. .IP "\fB\-\-dir\fR dir" 4 .IX Item "--dir dir" starting dir, default is ${\s-1HOME\-\s0.} .IP "\fB\-\-order\fR number" 4 .IX Item "--order number" in the range (\-6 .. 6), default is 5: .Sp .Vb 3 \& 1 \- do not sort, 2 \- dirs first, 3 \- files first \& 4 \- sort by name, 5 \- dirs first, 6 \- files first \& Negative number represents reverse order. .Ve .IP "\fB\-\-[no]all\fR" 4 .IX Item "--[no]all" show hidden files, like in 'ls \-A', default is \-\-noall .IP "\fB\-\-[no]links\fR" 4 .IX Item "--[no]links" follow linked directories, default is \-\-nolinks .IP "\fB\-\-xterm\fR command" 4 .IX Item "--xterm command" X terminal call, default is 'xterm \-e' .IP "\fB\-\-exec\-title\fR command" 4 .IX Item "--exec-title command" an fvwm Exec command on directory title (usually the shell), default is ${SHELL\-/bin/sh}. '\-' means no Exec command, i.e. Nop. If the command is not started with '^' X terminal call is prepended. The command is started in the currently browsed directory. .IP "\fB\-\-exec\-file\fR command" 4 .IX Item "--exec-file command" an fvwm Exec command on regular files, default is ${EDITOR\-vi}. '\-' means no Exec command, i.e. Nop. If the command is not started with '^' X terminal call is prepended. The actual file name is appended to the command. .IP "\fB\-\-exec\-app\fR [command]" 4 .IX Item "--exec-app [command]" an fvwm Exec command on +x files, default is '\-', which means the same command as on regular files. If no command is given, it is assumed to be empty \- simply run the +x file. If the command is not started with '^' X terminal call is prepended. The actual file name is appended to the command. .IP "\fB\-\-command\-title\fR command" 4 .IX Item "--command-title command" an fvwm command to execute on title. If this option is not given (or command is '\-'), the \f(CW\*(C`\-\-exec\-title\*(C'\fR is used instead. In the command, \f(CW%d\fR is substituted with the full directory path. .Sp In fact, \fI\-\-exec\-title=tcsh\fR is equivalent to \fI\-\-command\-title='Exec cd \*(L"%d\*(R"; xterm \-e tcsh'\fR .Sp The empty value disables the title action. .IP "\fB\-\-command\-file\fR command" 4 .IX Item "--command-file command" an fvwm command to execute on regular files. If this option is not given (or command is '\-'), the \f(CW\*(C`\-\-exec\-file\*(C'\fR is used instead. In the command, \f(CW%f\fR is substituted with the full file path. .Sp In fact, \-\-exec\-file=vi is equivalent to \-\-command\-file='Exec xterm \-e vi \*(L"%f\*(R"' .IP "\fB\-\-command\-app\fR command" 4 .IX Item "--command-app command" an fvwm command to execute on +x files. If this option is not given (or command is '\-'), the \f(CW\*(C`\-\-command\-app\*(C'\fR is used instead. In the command, \f(CW%f\fR is substituted with the full file path. .Sp In fact, \-\-exec\-app=^exec is equivalent to \-\-command\-app='Exec exec \*(L"%f\*(R"' .IP "\fB\-\-[no]reuse\fR" 4 .IX Item "--[no]reuse" no pop-up menus, reuse the same menu, default is \-\-noreuse. When you specify this option the Menu action is used, not Popup. Also, the \-\-name parameter is not ignored, and \-\-dir parameter is ignored if there is ~/.fvwm/.fvwm\-menu\-directory.dir file. This file is only created or used with this option specified, it is the only solution for the current fvwm menu state. .IP "\fB\-\-[no]check\-subdirs\fR" 4 .IX Item "--[no]check-subdirs" check all subdirs for having execute (+x) permission and replace \*(L"Popup\*(R"/\*(L"Menu\*(R" command with \*(L"Nop\*(R" for these without permissions. This has a visual effect of disabling popup triangle in the subdirectory item. The default is \-\-nocheck\-subdirs, because: 1) enabling this slows a bit the script, 2) with this option enabled, if no icons used and no dir/file separate sorting used there is no way to know that the item is directory and not file. .IP "\fB\-\-special\-dirs\fR value" 4 .IX Item "--special-dirs value" add .. or ~ or / special directories according to given optional value. Without with option these directories are not added. Default value if not specified is \*(L"1,2\*(R". The value is comma separated ordered special directory indexes, where 1 is parent directory, 2 is home directory, 3 is root directory. If minus is prepended to the value, special directories are added at the bottom of menu instead of top. Value \*(L"0\*(R" or any bad value is equivalent to non-specifying this option at all. .IP "\fB\-\-[no]memory\-for\-speed\fR" 4 .IX Item "--[no]memory-for-speed" use speed optimization, i.e. use previously created directory menus without destroying it when closed, default is \-\-nomemory\-for\-speed .Sp .Vb 2 \& Warning: speed optimization takes up a lot of memory \& that is never free\*(Aqd again while fvwm is running. .Ve .IP "\fB\-\-menu\-style\fR name" 4 .IX Item "--menu-style name" assign MenuStyle name to the menus .IP "\fB\-\-func\-name\fR name" 4 .IX Item "--func-name name" overwrite the default MissingSubmenuFunction name that is \*(L"FuncFvwmMenuDirectory\*(R" .PP Option parameters can be specified either using '=' or in the next argument. Short options are ok if not ambiguous: \f(CW\*(C`\-a\*(C'\fR, \f(CW\*(C`\-x\*(C'\fR, \f(CW\*(C`\-icon\-f\*(C'\fR; but be careful with short options, what is now unambiguous, can become ambiguous in the next versions. .SH "USAGE" .IX Header "USAGE" Put this into your fvwm configuration file to invoke the script: .PP .Vb 2 \& AddToFunc FuncFvwmMenuDirectory \& + I PipeRead "fvwm\-menu\-directory \-d \*(Aq$0\*(Aq" .Ve .PP More complex example: .PP .Vb 4 \& # AddToFunc FuncFvwmMenuDirectory \& # + I PipeRead "fvwm\-menu\-directory \-d \*(Aq$0\*(Aq \-x \*(AqEterm \-g 80x40 \-e\*(Aq \e\e \& \-a \-l \-o 6 \-\-exec\-app \-\-exec\-title \*(Aqtcsh \-l\*(Aq \-\-exec\-file \*(Aqvim \-R\*(Aq \e\e \& \-t \*(AqGo to: %d\*(Aq \-\-wm\-icons" .Ve .PP And put this in the menu from which you want to pop-up the directory menus: .PP .Vb 3 \& AddToMenu SomeMenu MissingSubmenuFunction FuncFvwmMenuDirectory \& + "Home Directory" Popup $[HOME] \& + "Httpd Directory" Popup /home/httpd .Ve .PP Note: please use absolute path names. .PP It is a good idea to set the menu pop-up delay to something positive and enable busy cursor .PP .Vb 2 \& MenuStyle * PopupDelayed, PopupDelay 200 \& BusyCursor DynamicMenu True .Ve .PP in your configuration file when using this script for better results. .PP Another interesting usage (\f(CW\*(C`\-\-reuse\*(C'\fR or \f(CW\*(C`\-r\*(C'\fR is mandatary for this): .PP .Vb 4 \& AddToMenu Browser \& + DynamicPopupAction PipeRead \e\e \& "fvwm\-menu\-directory \-r \-na Browser \-d / \-s" \& AddToMenu SomeMenu "My Browser" Menu Browser .Ve .PP Here the \f(CW\*(C`\-\-dir\*(C'\fR parameter (starting directory) is ignored if there is ~/.fvwm/.fvwm\-menu\-directory.dir file, which you can delete. .SH "AUTHORS" .IX Header "AUTHORS" Inspired on 1999\-06\-07 by Dominik Vogt . .PP Rewritten on 1999\-08\-05 by Mikhael Goikhman . .SH "COPYING" .IX Header "COPYING" The script is distributed by the same terms as fvwm itself. See \s-1GNU\s0 General Public License for details. .SH "BUGS" .IX Header "BUGS" Report bugs to fvwm\-bug@fvwm.org. fvwm-2.6.5.orig/bin/fvwm-bug.1.in0000644000175000017500000000274610656151546014635 0ustar vwcvwc.\" @(#)@PACKAGE@-@VERSION@ @RELDATELONG@ .TH fvwm-bug 1 "@RELDATELONG@ (@VERSION@)" Fvwm "Fvwm Modules" .SH NAME fvwm-bug \- report a bug in fvwm .SH SYNOPSIS \fBfvwm-bug\fP [\fI--help\fP] [\fI--version\fP] [\fIaddress\fP] .SH DESCRIPTION .B fvwm-bug is a shell script to help the user compose and mail bug reports concerning fvwm in a standard format. .B fvwm-bug invokes the editor specified by the environment variable .SM .B EDITOR on a temporary copy of the bug report format outline. The user must fill in the appropriate fields and exit the editor. .B fvwm-bug then mails the completed report to the local fvwm maintainer, the fvwm workers list \fIfvwm-workers@fvwm.org\fP, or \fIaddress\fP. If the report cannot be mailed, it is saved in the file \fIdead.fvwm-bug\fP in the invoking user's home directory. .PP The bug report format outline consists of several sections. The first section provides information about the machine, operating system, the fvwm version, and the compilation environment. The second section should be filled in with a description of the bug. The third section should be a description of how to reproduce the bug. The optional fourth section is for a proposed fix. Fixes are encouraged. .SH ENVIRONMENT .B fvwm-bug will utilize the following environment variables if they exist: .TP .B EDITOR Specifies the preferred editor. If .SM .B EDITOR is not set, .B fvwm-bug defaults to .BR emacs . .TP .B HOME Directory in which the failed bug report is saved if the mail fails. fvwm-2.6.5.orig/bin/fvwm-convert-2.4.1.in0000644000175000017500000001007210656151546016030 0ustar vwcvwc.\" @(#)@PACKAGE@-@VERSION@ @RELDATELONG@ .TH fvwm-convert-2.4 1 "@RELDATELONG@ (@VERSION@)" Fvwm "Fvwm Modules" .SH NAME fvwm-convert-2.4 \- convert fvwm 2.2.x configuration file to fvwm 2.4 syntax .SH SYNOPSIS .B fvwm-convert-2.4 .RI [ source ] .RI [ dest ] .SH DESCRIPTION .B fvwm-convert-2.4 converts an fvwm 2.2.x configuration file into an fvwm 2.4 compatible syntax. It is not suitable to convert older 1.x configuration files. Please use .B fvwm-convert-2.2 to convert these to the 2.2.x format first. .PP By default, .B fvwm-convert-2.4 converts .I ~/.fvwm2rc, saving the results in .I ~/.fvwm/.fvwm2rc. You must create the .I ~/.fvwm directory before running this command. Starting with the 2.4 release, the directory .I ~/.fvwm is the default location for fvwm user configuration files. Different source and destination files may be given. If the destination file already exists, this program exits. While the program runs it will generate a temporary file with the same name as the destination file with the suffix ".pass1" added. .PP .B fvwm-convert-2.4 makes the following changes: .TP 4 .B PixmapPath/IconPath In fvwm 2.4, the PixmapPath and IconPath commands are replaced by the ImagePath command. In addition, the ImagePath can be compiled into fvwm. .B fvwm-convert-2.4 changes the PixmapPath and IconPath commands to ImagePath commands and removes any directories that are compiled into fvwm. Paths starting with a dollar sign are also removed. .TP 4 .B ModulePath In fvwm 2.4, the ModulePath is compiled into fvwm. .B fvwm-convert-2.4 removes any ModulePath commands it finds. If you are using your own modules, (not the ones that come with fvwm), you will have to fix your configuration file after using .BR fvwm-convert-2.4 . .TP 4 .B HilightColor In fvwm 2.4, the HighlightColor command is replaced by a Style command using the HilightFore and HilightBack arguments. .B fvwm-convert-2.4 makes these changes. .TP 4 .B HilightColorset In fvwm 2.4, the HighlightColorset command that was present in some of the 2.3.x beta releases is replaced by a Style command using the HilightColorset style. .B fvwm-convert-2.4 makes these changes. .TP 4 .B WindowShadeAnimate In fvwm 2.4, the WindowShadeAnimate command is replaced by the WindowShadeSteps Style option. .B fvwm-convert-2.4 makes this change. .TP 4 .B WindowFont In fvwm 2.4, the WindowFont command is replaced by a Style command using the Font argument. .B fvwm-convert-2.4 makes this change. .TP 4 .B ColorLimit In fvwm 2.4, the ColorLimit command is automatic. If you have a limited colormap, color limiting is the default. .B fvwm-convert-2.4 removes any ColorLimit command that it finds. .TP 4 .B GlobalOpts The GlobalOpts command is converted to .B Style options and the .B BugOpts command. Some options can not be converted automatically, though. .TP 4 .B Read Prints a message identifying any read commands found. The files being read may need to be converted also. .TP 4 .B Placement Styles Any of the old placement Styles found in the file can not be converted automatically. Instead, .B fvwm-convert-2.4 prints a warning. For details about the conversion, please refer to the "Window manager placement" section of the fvwm man page. .TP 4 .B FvwmConfig and FvwmPipe These modules are no longer a part of the fvwm distribution. .B fvwm-convert-2.4 prints a warning if these modules are found in the file. .TP 4 .B FvwmButtons panels The syntax of panels in FvwmButtons has changed. The conversion can not be done automatically. .B fvwm-convert-2.4 prints a message when it encounters a potential panel definition. For details about the conversion, please refer to the "CONVERTING OLD PANEL CONFIGURATIONS" section of the FvwmButtons man page. .SH BUGS You need Perl to be installed. .I WindowFont and .I HilightColor commands embedded in functions are not found. If you have either of these commands in functions, they are not detected. Known bugs can be found in the fvwm bug tracking system (accessible from the fvwm home page). Bug reports can be sent to the fvwm-workers mailing list (see the .IR FAQ ). .SH AUTHOR Dan Espen . fvwm-2.6.5.orig/bin/fvwm-convert-2.4.10000644000175000017500000001005511744241304015413 0ustar vwcvwc.\" @(#)fvwm-2.6.5 20 April 2012 .TH fvwm-convert-2.4 1 "20 April 2012 (2.6.5)" Fvwm "Fvwm Modules" .SH NAME fvwm-convert-2.4 \- convert fvwm 2.2.x configuration file to fvwm 2.4 syntax .SH SYNOPSIS .B fvwm-convert-2.4 .RI [ source ] .RI [ dest ] .SH DESCRIPTION .B fvwm-convert-2.4 converts an fvwm 2.2.x configuration file into an fvwm 2.4 compatible syntax. It is not suitable to convert older 1.x configuration files. Please use .B fvwm-convert-2.2 to convert these to the 2.2.x format first. .PP By default, .B fvwm-convert-2.4 converts .I ~/.fvwm2rc, saving the results in .I ~/.fvwm/.fvwm2rc. You must create the .I ~/.fvwm directory before running this command. Starting with the 2.4 release, the directory .I ~/.fvwm is the default location for fvwm user configuration files. Different source and destination files may be given. If the destination file already exists, this program exits. While the program runs it will generate a temporary file with the same name as the destination file with the suffix ".pass1" added. .PP .B fvwm-convert-2.4 makes the following changes: .TP 4 .B PixmapPath/IconPath In fvwm 2.4, the PixmapPath and IconPath commands are replaced by the ImagePath command. In addition, the ImagePath can be compiled into fvwm. .B fvwm-convert-2.4 changes the PixmapPath and IconPath commands to ImagePath commands and removes any directories that are compiled into fvwm. Paths starting with a dollar sign are also removed. .TP 4 .B ModulePath In fvwm 2.4, the ModulePath is compiled into fvwm. .B fvwm-convert-2.4 removes any ModulePath commands it finds. If you are using your own modules, (not the ones that come with fvwm), you will have to fix your configuration file after using .BR fvwm-convert-2.4 . .TP 4 .B HilightColor In fvwm 2.4, the HighlightColor command is replaced by a Style command using the HilightFore and HilightBack arguments. .B fvwm-convert-2.4 makes these changes. .TP 4 .B HilightColorset In fvwm 2.4, the HighlightColorset command that was present in some of the 2.3.x beta releases is replaced by a Style command using the HilightColorset style. .B fvwm-convert-2.4 makes these changes. .TP 4 .B WindowShadeAnimate In fvwm 2.4, the WindowShadeAnimate command is replaced by the WindowShadeSteps Style option. .B fvwm-convert-2.4 makes this change. .TP 4 .B WindowFont In fvwm 2.4, the WindowFont command is replaced by a Style command using the Font argument. .B fvwm-convert-2.4 makes this change. .TP 4 .B ColorLimit In fvwm 2.4, the ColorLimit command is automatic. If you have a limited colormap, color limiting is the default. .B fvwm-convert-2.4 removes any ColorLimit command that it finds. .TP 4 .B GlobalOpts The GlobalOpts command is converted to .B Style options and the .B BugOpts command. Some options can not be converted automatically, though. .TP 4 .B Read Prints a message identifying any read commands found. The files being read may need to be converted also. .TP 4 .B Placement Styles Any of the old placement Styles found in the file can not be converted automatically. Instead, .B fvwm-convert-2.4 prints a warning. For details about the conversion, please refer to the "Window manager placement" section of the fvwm man page. .TP 4 .B FvwmConfig and FvwmPipe These modules are no longer a part of the fvwm distribution. .B fvwm-convert-2.4 prints a warning if these modules are found in the file. .TP 4 .B FvwmButtons panels The syntax of panels in FvwmButtons has changed. The conversion can not be done automatically. .B fvwm-convert-2.4 prints a message when it encounters a potential panel definition. For details about the conversion, please refer to the "CONVERTING OLD PANEL CONFIGURATIONS" section of the FvwmButtons man page. .SH BUGS You need Perl to be installed. .I WindowFont and .I HilightColor commands embedded in functions are not found. If you have either of these commands in functions, they are not detected. Known bugs can be found in the fvwm bug tracking system (accessible from the fvwm home page). Bug reports can be sent to the fvwm-workers mailing list (see the .IR FAQ ). .SH AUTHOR Dan Espen . fvwm-2.6.5.orig/bin/fvwm-menu-directory.in0000644000175000017500000005575411157754473016703 0ustar vwcvwc#!@PERL@ # Copyright (c) 1999-2009 Mikhael Goikhman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Filter this script to pod2man to get a man page: # pod2man -c "Fvwm Utilities" fvwm-menu-directory | nroff -man | less -e # To speed up the script, several optimizations were made: trying to minimize # the number of additional file operations, function calls and includes. #print STDERR "fvwm-menu-directory @ARGV\n"; use strict; use Getopt::Long; my $version = "@VERSION@"; my $name = "MenuBrowser"; # used only with --reuse my $title = "%*-40p"; # may contain specifiers %d, %p. my $itemf = "%n"; # may contain specifiers %n, %t, %T, %d, %D, %s. my $icont = ""; my $icond = ""; my $iconf = ""; my $icona = ""; my $home = $ENV{'HOME'} || '/tmp'; my $dir = $home; my $xterm = "xterm -e"; # the X terminal program to invoke my $exect = $ENV{'SHELL'} || '/bin/sh'; my $execf = $ENV{'EDITOR'} || "vi"; # the command to execute on plain files my $execa = undef; my $commt = undef; my $commf = undef; my $comma = undef; my $all = 0; # whether show hidden files (like in 'ls -A') my $links = 0; # whether follow linked dirs or not my $order = 5; # -6, -5, -4, -3, -2, -1, 1, 2, 3, 4, 5, 6 my $reuse = 0; # non-popup mode my $wm_icons = 0; my $check_subdirs = 0; # whether check subdirs for +x permissions my $special_dir_val = undef; # which of (.. ~ /) dirs include or none my $memory_for_speed = 0; my $submenu_pos = " item +100 c"; # " menu +0 +0" my $fvwm_user_dir = $ENV{'FVWM_USERDIR'} || "$home/.fvwm"; $fvwm_user_dir = $home unless -d $fvwm_user_dir; my $dir_filename = "$fvwm_user_dir/.fvwm-menu-directory.dir"; my $change_menu_style = ""; my $func_name = "FuncFvwmMenuDirectory"; GetOptions( "help|h|?" => \&show_help, "version|V" => \&show_version, "name=s" => \$name, "title=s" => \$title, "item=s" => \$itemf, "icon-title=s" => \$icont, "icon-dir=s" => \$icond, "icon-file=s" => \$iconf, "icon-app=s" => \$icona, "dir=s" => \$dir, "order=i" => \$order, "all!" => \$all, "links!" => \$links, "xterm=s" => \$xterm, "exec-title=s" => \$exect, "exec-file=s" => \$execf, "exec-app:s" => \$execa, "command-title=s" => \$commt, "command-file=s" => \$commf, "command-app=s" => \$comma, "reuse!" => \$reuse, "wm-icons" => \$wm_icons, "check-subdirs!" => \$check_subdirs, "special-dirs:s" => \$special_dir_val, "memory-for-speed!" => \$memory_for_speed, "menu-style=s" => \$change_menu_style, "func-name=s" => \$func_name, ) || wrong_usage(); wrong_usage() if @ARGV; $name = $dir unless $reuse; $dir =~ s:^~(/|$):$home$1:; chomp($dir = `cat "$dir_filename"`) if $reuse && -f $dir_filename; unless (-d $dir) { # the next line may be commented not to throw error #die "$dir does not exist, exiting.\n"; $dir = $home; } $links || !-l $dir || exit(-1); # exit if linked directories are disabled chdir($dir) || exit(-1); # exit if no execute permission on the directory # expand title &expand_width_specifier(\$title, 'd', (split('/', $dir))[-1] || '/') if $title =~ /%(-?\d+)?(\*-?\d+)?d/; &expand_width_specifier(\$title, 'p', $dir) if $title =~ /%(-?\d+)?(\*-?\d+)?p/; $title =~ s/\\t/\t/g; $itemf =~ s/\\t/\t/g; # item format optimization variables my $itemf_eval = $itemf ne '%f'; # evaluation needed my $itemf_name = undef; my $itemf_stat = undef; # stat() needed my $itemf_date = undef; my $itemf_size = undef; my $itemf_type = undef; if ($itemf_eval) { $itemf_name = $itemf =~ /%(-?\d+)?(\*-?\d+)?[nN]/; $itemf_date = $itemf =~ /%[dD]/; $itemf_size = $itemf =~ /%(-?\d+)?(\*-?\d+)?s/; $itemf_type = $itemf =~ /%[tT]/; $itemf_stat = $itemf_size || $itemf_date || $itemf_size || $itemf_type; } my @type1 = ("Sock", "Link", "File", "Blck", "Dir ", "Char", "Pipe"); my @type2 = ("S", "L", "F", "B", "D", "C", "P"); if ($wm_icons) { $icont ||= "menu/folder-open.xpm"; $icond ||= "menu/folder.xpm"; $iconf ||= "menu/file.xpm"; $icona ||= "menu/utility.xpm"; } my $icont_str = $icont ? "%$icont%" : ""; my $icond_str = $icond ? "%$icond%" : ""; my $iconf_str = $iconf ? "%$iconf%" : ""; my $icona_str = $icona ? "%$icona%" : ""; $exect = undef if defined $exect && $exect eq '-'; $execf = undef if defined $execf && $execf eq '-'; $execa = undef if defined $execa && $execa eq '-'; $exect = $exect =~ /^\^(.*)$/ ? $1 : "$xterm $exect" if defined $exect; $execf = $execf =~ /^\^(.*)$/ ? $1 : "$xterm $execf" if defined $execf; $execa = $execa =~ /^\^(.*)$/ ? $1 : "$xterm $execa" if defined $execa; $commt = undef if defined $commt && $commt eq '-'; $commf = undef if defined $commf && $commf eq '-'; $comma = undef if defined $comma && $comma eq '-'; $commt = defined $exect ? qq(Exec cd "%d"; $exect): "Nop" if !defined $commt; $commf = defined $execf ? qq(Exec $execf "%f"): "Nop" if !defined $commf; $comma = defined $execa ? qq(Exec $execa "%f"): $commf if !defined $comma; # manage special directories if needed my ($special_dir_lines, $special_dir_pos, @special_dirs) = (""); $special_dir_val = "1,2" if defined $special_dir_val && $special_dir_val eq ""; if ($special_dir_val && $special_dir_val =~ /([\d,]+)(-?)/) { @special_dirs = grep(/^[1-3]$/, split(/,+/, $1)); $special_dir_pos = $2 ? -1 : 1; } if (@special_dirs) { my $parent_dir = $dir eq '/' || $dir !~ m!^(.*)/[^\/]+$! ? undef : $1; $parent_dir = '/' if defined $parent_dir && $parent_dir eq ''; my @special_dir_def = ( [ '..' => $parent_dir ], [ '~' => $home ], [ '/' => '/' ], ); foreach (@special_dirs) { $special_dir_lines .= qq(+ "" Nop\n) if $special_dir_lines; $special_dir_lines .= &eval_folder_line(@{$special_dir_def[$_ - 1]}); } } else { $special_dir_pos = 0; } # create file listing opendir(DIR, "."); my @files = readdir(DIR); closedir(DIR); @files = grep /^[^.]/, @files unless $all; my $abs_order = abs($order); # To avoid warnings, '!!' must be added before '-d'. Will this slow things? my $sort_sub = $abs_order == 2 ? sub { -d $b <=> -d $a } : $abs_order == 3 ? sub { -d $a <=> -d $b } : $abs_order == 4 ? sub { $a cmp $b } : $abs_order == 5 ? sub { -d $b <=> -d $a || $a cmp $b } : $abs_order == 6 ? sub { -d $a <=> -d $b || $a cmp $b } : sub { 0 }; @files = sort $sort_sub @files if $abs_order != 1; @files = reverse @files if $order < 0; # dump all menu items and start adding new items my $menu_name = &escape_fvwm_name($name); my $menu_name2 = &escape_menu_name($name); print qq(DestroyMenu recreate "$menu_name"\nAddToMenu "$menu_name2"\n); # destroy the menu after it is popped down print qq(+ DynamicPopDownAction DestroyMenu "$menu_name"\n) unless $memory_for_speed || $reuse; # set the 'missing submenu function' print qq(+ MissingSubmenuFunction $func_name\n) unless $reuse; # add a new title (item and separator, or real Title if no action) my $title_act = $commt; $title_act =~ s/%d/$dir/g; if ($title ne "") { if ($title_act eq "") { print qq(+ "$icont_str$title" Title\n); } else { print qq(+ "$icont_str$title" $title_act\n+ "" Nop\n); } } # add special dirs at the top if needed print qq($special_dir_lines+ "" Nop\n) if $special_dir_pos > 0; # add directory contents foreach (@files) { next if $_ eq '.' or $_ eq '..'; my $file_path = "$dir/$_"; $file_path =~ s|/+|/|g; if (-d) { # it's a directory print &eval_folder_line($_, $file_path); } else { # something else, apply editor to it or run itself my $item_str = $itemf_eval ? &eval_item($_, $file_path) : $_; $item_str = &escape_item_name($item_str); my $is_app = -x && -f; my $icon_str = $is_app && $icona_str ? $icona_str : $iconf_str; my $file_act = $is_app ? $comma : $commf; $file_act =~ s/%f/&escape_file_name($file_path)/ge; print qq(+ "$icon_str$item_str" $file_act\n); } } # add special dirs at the bottom if needed print qq(+ "" Nop\n$special_dir_lines) if $special_dir_pos < 0; # add style: if ($change_menu_style ne "") { print qq(ChangeMenuStyle "$change_menu_style" "$menu_name"\n); } exit(0); # --------------------------------------------------------------------------- sub escape_fvwm_name ($) { my $name = shift; $name =~ s/\\/\\\\/g; $name =~ s/"/\\"/g; $name =~ s/\$/\$\$/g; $name; } sub escape_menu_name ($) { my $name = escape_fvwm_name(shift()); # fvwm is really inconsistent here $name =~ s/\^/^^/g; $name =~ s/@/@@/g; $name; } sub escape_item_name ($) { my $name = escape_fvwm_name(shift()); $name =~ s/%/%%/g; $name =~ s/&/&&/g; $name =~ s/\*/**/g; $name =~ s/\n/ /g; $name; } sub escape_file_name ($) { my $name = shift; $name =~ s/\\/\\\\/g; $name =~ s/"/\\"/g; $name =~ s/\$/\\\$\$/g; $name =~ s/\n/\\\n/g; $name; } sub eval_folder_line ($$) { my ($_name, $dir) = @_; my $item_str = $dir && $itemf_eval ? &eval_item($_name, $dir) : $_name; $item_str = escape_item_name($item_str); my $act = !$dir || $check_subdirs && !-x $dir ? "Nop" : !$reuse ? qq(Popup ") . escape_file_name($dir) . qq("$submenu_pos) : qq(PipeRead 'echo ") . escape_file_name($dir) . qq(" >$dir_filename; ) . qq(echo Menu ") . escape_fvwm_name($name) . qq(" WarpTitle'); return qq(+ "$icond_str$item_str" $act\n); } sub eval_item ($$) { my ($name, $file) = @_; return $name unless $itemf_eval; my $item_str = "$itemf"; if ($itemf_name) { &expand_width_specifier(\$item_str, 'n', $name); &expand_width_specifier(\$item_str, 'N', $file); } return $item_str unless $itemf_stat; # / $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, # \ $size, $atime, $mtime, $ctime, $blksize, $blocks my ($misc1, $misc2, $mode, $misc3, $misc4, $misc5, $misc6, $size, $misc7, $time) = stat($file); if ($itemf_date) { eval 'use POSIX qw(strftime);' unless defined $POSIX::VERSION; my @time = localtime($time); my $date1 = strftime("%Y-%m-%d %H:%M:%S", @time); my $date2 = strftime("%Y-%m-%d", @time); $item_str =~ s/%d/$date1/g; $item_str =~ s/%D/$date2/g; } if ($itemf_size) { &expand_width_specifier(\$item_str, 's', $size); } if ($itemf_type) { my $type; # $type = 2 if ($mode & 0100000); # regular # $type = 4 if ($mode & 0040000); # directory # $type = 0 if ($mode & 0140000); # socket # $type = 1 if ($mode & 0120000); # symlink # $type = 3 if ($mode & 0060000); # block # $type = 5 if ($mode & 0020000); # char-dev # $type = 6 if ($mode & 0010000); # fifo $type = -p _ ? 6 : -c _ ? 5 : -b _ ? 3 : -l $file ? 1 : -S _ ? 0 : -d _ ? 4 : 2; $item_str =~ s/%t/$type1[$type]/g; $item_str =~ s/%T/$type2[$type]/g; } return $item_str; } # Substitutes all %N1*N2x in $name by properly stripped and justified $value. sub expand_width_specifier (\$$$) { my ($name, $char, $value) = @_; $$name =~ s/%(-?\d+)?(\*(-?)(\d+))?$char/ my $value = !$2 || $4 <= 3 || $4 > length($value) ? $value : $3 ? "..." . substr($value, -$4 + 3, $4 - 3) : substr($value, 0, $4 - 3) . "..."; $1 ? sprintf("%$1s", $value) : $value; /ge; } sub show_help { print "A perl script that builds directory listing for fvwm.\n\n"; print "Usage: $0 [OPTIONS]\n"; print "Options:\n"; print "\t--help show this help and exit\n"; print "\t--version show the version and exit\n"; print "\t--name=NAME menu name, default is '$name'\n"; print "\t--title=NAME menu title, default is '$title'\n"; print "\t--item=NAME menu item format, default is '$itemf'\n"; print "\t--icon-title=XPM menu title icon, default is none\n"; print "\t--icon-dir=XPM menu dir icon, default is none\n"; print "\t--icon-file=XPM menu file icon, default is none\n"; print "\t--icon-app=XPM menu +x icon, default is none\n"; print "\t--wm-icons define icon names to use with wm-icons\n"; print "\t--dir=NAME starting dir, default is '$dir'\n"; print "\t--order=NUM NUM (-6 .. 6), default is 5\n"; print "\t\t1 - do not sort, 2 - dirs first, 3 - files first\n"; print "\t\t4 - sort by name, 5 - dirs first, 6 - files first\n"; print "\t\tNegative number represents reverse order.\n"; print "\t--all show hidden files, default is no\n"; print "\t--links follow linked dirs, default is no\n"; print "\t--xterm=CMD xterm call, default is '$xterm'\n"; print "\t--exec-title=CMD title exec command, default is '$exect'\n"; print "\t--exec-file=CMD file exec command, default is '$execf'\n"; print "\t--exec-app[=CMD] +x files exec command, default is '-'\n"; print "\t--command-title=CMD title fvwm command, default is '-'\n"; print "\t--command-file=CMD file fvwm command, default is '-'\n"; print "\t--command-app=CMD +x files fvwm command, default is '-'\n"; print "\t--reuse no popups, reuse the same menu (no)\n"; print "\t--check-subdirs check subdir for +x permission (no)\n"; print "\t--special-dirs[=X] include .. and ~ directories (no)\n"; print "\t--memory-for-speed use speed optimization (no)\n"; print "\t--menu-style=NAME assign specified MenuStyle name to menus\n"; print "Short options are ok if not ambiguous: -a, -icon-f.\n"; exit 0; } sub show_version { print "$version\n"; exit 0; } sub wrong_usage { print STDERR "Try '$0 --help' for more information.\n"; exit -1; } __END__ # --------------------------------------------------------------------------- =head1 NAME fvwm-menu-directory - builds a directory browsing menu for fvwm =head1 SYNOPSIS B [ B<--help>|B<-h>|B<-?> ] [ B<--version>|B<-V> ] [ B<--name>|B<-na> NAME ] [ B<--title>|B<-t> NAME ] [ B<--item>|B<-it> NAME ] [ B<--icon-title>|B<-icon-t> XPM ] [ B<--icon-dir>|B<-icon-d> XPM ] [ B<--icon-file>|B<-icon-f> XPM ] [ B<--icon-app>|B<-icon-a> XPM ] [ B<--wm-icons> ] [ B<--dir>|B<-d> NAME ] [ B<--order>|B<-o> NUM ] [ B<--[no]all>|B<-a> ] [ B<--[no]links>|B<-l> ] [ B<--xterm>|B<-x> CMD ] [ B<--exec-title>|B<-exec-t> CMD ] [ B<--exec-file>|B<-exec-f> CMD ] [ B<--exec-app>|B<-exec-a> [CMD] ] [ B<--command-title>|B<-command-t> CMD ] [ B<--command-file>|B<-command-f> CMD ] [ B<--command-app>|B<-command-a> CMD ] [ B<--[no]reuse>|B<-r> ] [ B<--[no]check-subdirs>|B<-ch> ] [ B<--special-dirs>|B<-s> [VALUE] ] [ B<--[no]memory-for-speed>|B<-mem> ] [ B<--menu-style>|B<-men> NAME ] [ B<--func-name>|B<-f> NAME ] =head1 DESCRIPTION A perl script which provides an output to read in with PipeRead to build an fvwm menu containing a directory listing. Almost everything can be configured. =head1 HINTS The title item with its own attached action is usually added to the menu. This may be used to define an action for the directory for which the menu is built, such as starting a terminal in this directory (the default). However, this may annoy some users. To disable the title action use B<--command-title> "", to remove the title completely use B<--title> "". =head1 OPTIONS =over 4 =item B<--help> show the usage and exit =item B<--version> show version and exit =item B<--name> name menu name, used only with --reuse, default is MenuBrowser =item B<--title> title menu title format, default is '%*-40p' - last 40 characters of the current full path. TAB can be specified as '\t', but in .fvwm2rc you should specify a double backslash or a real TAB. Format specifiers: %d - the current directory name %p - the current directory full path These specifiers can receive an optional integer size, positive for right adjusted string or negative for left adjusted, example: %8x; and optional *num or *-num, which means to leave only the first or last (if minus) num of chars, the num must be greater than 3, since the striped part is replaced with "...", example: %*30x. Both can be combined: %-10*-20x, this instructs to get only the 20 last characters, but if the length is less then 10 - to fill with up to 10 spaces on the right. =item B<--item> format menu item format, default is '%n'. TAB and width modifiers for %n, %N and %s can be specified as described in B<--title> above. Note, specifying a non default format slows the script. Format specifiers: %n - file/dir name (without the path) %N - file/dir name (full with the path) %d - file/dir date (yyyy-mm-dd HH:MM:SS) %D - file/dir date (yyyy-mm-dd) %s - file/dir size (in bytes) %t - file/dir type (File|Dir |Link|Sock|Blck|Char|Pipe) %T - file/dir type (F|D|L|S|B|C|P) Example: --title '%*-40p\tDate, Type\tSize' --item '%*40n\t%d %t\t%s' =item B<--icon-title> icon menu title icon, default is none =item B<--icon-dir> icon menu dir icon, default is none =item B<--icon-file> icon menu file icon, default is none =item B<--icon-app> icon menu application icon, default is none =item B<--wm-icons> define icon names suitable for use with wm-icons package. Currently this is equivalent to: --icon-title menu/folder-open.xpm --icon-item menu/file.xpm --icon-dir menu/folder.xpm --icon-app menu/utility.xpm. =item B<--dir> dir starting dir, default is ${HOME-.} =item B<--order> number in the range (-6 .. 6), default is 5: 1 - do not sort, 2 - dirs first, 3 - files first 4 - sort by name, 5 - dirs first, 6 - files first Negative number represents reverse order. =item B<--[no]all> show hidden files, like in 'ls -A', default is --noall =item B<--[no]links> follow linked directories, default is --nolinks =item B<--xterm> command X terminal call, default is 'xterm -e' =item B<--exec-title> command an fvwm Exec command on directory title (usually the shell), default is ${SHELL-/bin/sh}. '-' means no Exec command, i.e. Nop. If the command is not started with '^' X terminal call is prepended. The command is started in the currently browsed directory. =item B<--exec-file> command an fvwm Exec command on regular files, default is ${EDITOR-vi}. '-' means no Exec command, i.e. Nop. If the command is not started with '^' X terminal call is prepended. The actual file name is appended to the command. =item B<--exec-app> [command] an fvwm Exec command on +x files, default is '-', which means the same command as on regular files. If no command is given, it is assumed to be empty - simply run the +x file. If the command is not started with '^' X terminal call is prepended. The actual file name is appended to the command. =item B<--command-title> command an fvwm command to execute on title. If this option is not given (or command is '-'), the C<--exec-title> is used instead. In the command, %d is substituted with the full directory path. In fact, I<--exec-title=tcsh> is equivalent to I<--command-title='Exec cd "%d"; xterm -e tcsh'> The empty value disables the title action. =item B<--command-file> command an fvwm command to execute on regular files. If this option is not given (or command is '-'), the C<--exec-file> is used instead. In the command, %f is substituted with the full file path. In fact, --exec-file=vi is equivalent to --command-file='Exec xterm -e vi "%f"' =item B<--command-app> command an fvwm command to execute on +x files. If this option is not given (or command is '-'), the C<--command-app> is used instead. In the command, %f is substituted with the full file path. In fact, --exec-app=^exec is equivalent to --command-app='Exec exec "%f"' =item B<--[no]reuse> no pop-up menus, reuse the same menu, default is --noreuse. When you specify this option the Menu action is used, not Popup. Also, the --name parameter is not ignored, and --dir parameter is ignored if there is ~/.fvwm/.fvwm-menu-directory.dir file. This file is only created or used with this option specified, it is the only solution for the current fvwm menu state. =item B<--[no]check-subdirs> check all subdirs for having execute (+x) permission and replace "Popup"/"Menu" command with "Nop" for these without permissions. This has a visual effect of disabling popup triangle in the subdirectory item. The default is --nocheck-subdirs, because: 1) enabling this slows a bit the script, 2) with this option enabled, if no icons used and no dir/file separate sorting used there is no way to know that the item is directory and not file. =item B<--special-dirs> value add .. or ~ or / special directories according to given optional value. Without with option these directories are not added. Default value if not specified is "1,2". The value is comma separated ordered special directory indexes, where 1 is parent directory, 2 is home directory, 3 is root directory. If minus is prepended to the value, special directories are added at the bottom of menu instead of top. Value "0" or any bad value is equivalent to non-specifying this option at all. =item B<--[no]memory-for-speed> use speed optimization, i.e. use previously created directory menus without destroying it when closed, default is --nomemory-for-speed Warning: speed optimization takes up a lot of memory that is never free'd again while fvwm is running. =item B<--menu-style> name assign MenuStyle name to the menus =item B<--func-name> name overwrite the default MissingSubmenuFunction name that is "FuncFvwmMenuDirectory" =back Option parameters can be specified either using '=' or in the next argument. Short options are ok if not ambiguous: C<-a>, C<-x>, C<-icon-f>; but be careful with short options, what is now unambiguous, can become ambiguous in the next versions. =head1 USAGE Put this into your fvwm configuration file to invoke the script: AddToFunc FuncFvwmMenuDirectory + I PipeRead "fvwm-menu-directory -d '$0'" More complex example: # AddToFunc FuncFvwmMenuDirectory # + I PipeRead "fvwm-menu-directory -d '$0' -x 'Eterm -g 80x40 -e' \\ -a -l -o 6 --exec-app --exec-title 'tcsh -l' --exec-file 'vim -R' \\ -t 'Go to: %d' --wm-icons" And put this in the menu from which you want to pop-up the directory menus: AddToMenu SomeMenu MissingSubmenuFunction FuncFvwmMenuDirectory + "Home Directory" Popup $[HOME] + "Httpd Directory" Popup /home/httpd Note: please use absolute path names. It is a good idea to set the menu pop-up delay to something positive and enable busy cursor MenuStyle * PopupDelayed, PopupDelay 200 BusyCursor DynamicMenu True in your configuration file when using this script for better results. Another interesting usage (C<--reuse> or C<-r> is mandatary for this): AddToMenu Browser + DynamicPopupAction PipeRead \\ "fvwm-menu-directory -r -na Browser -d / -s" AddToMenu SomeMenu "My Browser" Menu Browser Here the C<--dir> parameter (starting directory) is ignored if there is ~/.fvwm/.fvwm-menu-directory.dir file, which you can delete. =head1 AUTHORS Inspired on 1999-06-07 by Dominik Vogt . Rewritten on 1999-08-05 by Mikhael Goikhman . =head1 COPYING The script is distributed by the same terms as fvwm itself. See GNU General Public License for details. =head1 BUGS Report bugs to fvwm-bug@fvwm.org. =cut # *************************************************************************** fvwm-2.6.5.orig/bin/fvwm-menu-xlock.10000644000175000017500000001711611161434720015520 0ustar vwcvwc.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.02) .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "fvwm-menu-xlock 1" .TH fvwm-menu-xlock 1 "2009-03-22" "2.5.28 (from cvs)" "Fvwm Utilities" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" fvwm\-menu\-xlock \- builds xlock menu definition for fvwm .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBfvwm-menu-xlock\fR [ \fB\-\-help\fR|\fB\-h\fR|\fB\-?\fR ] [ \fB\-\-version\fR|\fB\-V\fR ] [ \fB\-\-name\fR|\fB\-n\fR name ] [ \fB\-\-title\fR|\fB\-t\fR title ] [ \fB\-\-item\fR format ] [ \fB\-\-icon\-title\fR icon ] [ \fB\-\-icon\-item\fR icon ] [ \fB\-\-special\-first\fR|\fB\-s\fR ] [ \*(-- xlock params ] .SH "DESCRIPTION" .IX Header "DESCRIPTION" A simple perl script which parses xlock's output to build an fvwm menu definition of all xlock's modes. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-\-help\fR" 4 .IX Item "--help" show the help and exit .IP "\fB\-\-version\fR" 4 .IX Item "--version" show the version and exit .IP "\fB\-\-name\fR name" 4 .IX Item "--name name" define menu name in the following argument. Default is \*(L"XLockMenu\*(R" .IP "\fB\-\-title\fR title" 4 .IX Item "--title title" define menu title in the following argument. Default is \*(L"XLock Modes\*(R". .IP "\fB\-\-item\fR format" 4 .IX Item "--item format" define menu item format in the following argument, default is '%n\et(%d)'. \s-1TAB\s0 can be specified as '\et', but in .fvwm2rc you should specify a double backslash or a real \s-1TAB\s0. .Sp Format specifiers: .Sp .Vb 3 \& %n \- mode name \& %d \- mode description \& %D \- mode description without "Shows " prefix if any .Ve .Sp These specifiers can receive an optional integer size, positive for right adjusted string or negative for left adjusted, example: \f(CW%8x\fR; and optional *num or *\-num, which means to leave only the first or last (if minus) num of chars, the num must be greater than 3, since the striped part is replaced with \*(L"...\*(R", example: %*30x. Both can be combined: %\-10*\-20x, this instructs to get only the 20 last characters, but if the length is less then 10 \- to fill with up to 10 spaces on the right. .IP "\fB\-\-icon\-title\fR icon" 4 .IX Item "--icon-title icon" .PD 0 .IP "\fB\-\-icon\-item\fR icon" 4 .IX Item "--icon-item icon" .PD define menu icon for title and regular item accordingly. Default is no menu icons (equivalent to an empty icon argument). .IP "\fB\-\-wm\-icons\fR" 4 .IX Item "--wm-icons" define icon names suitable for use with wm-icons package. Currently this is equivalent to: \-\-icon\-title '' \-\-icon\-item menu/lock.xpm. .IP "\fB\-\-special\-first\fR" 4 .IX Item "--special-first" instructs to include special modes (usually black, bomb and random) first. .PP Option parameters can be specified either using '=' or in the next argument. Short options are ok if not ambiguous: \-h, \-t; but be careful with short options, what is now unambiguous, can became ambiguous in the next versions. .PP Additional arguments (after \fB\-\-\fR) will be passed to xlock. .PP Please see the \fBxlock\fR(1) man page for the xlock options. .SH "USAGE" .IX Header "USAGE" Add these lines to your fvwm configuration file: .PP .Vb 6 \& PipeRead \*(Aqfvwm\-menu\-xlock \-\-name MenuSSaver \-\-title "Screensaver" \e \& \-\-icon\-item mini\-bball.xpm \-\-special\-first \-\- \-nice 19 \-nolock\*(Aq \& PipeRead \*(Aqfvwm\-menu\-xlock \-\-name MenuSLock \-\-title "Lock Screen" \e \& \-\-icon\-item mini\-rball.xpm \-\-special\-first \-\- \-nice 19\*(Aq \& AddToMenu "Utilities" "Screensaver%mini\-monitor.xpm%" Popup MenuSSaver \& AddToMenu "Utilities" "Screenlock%mini\-lock.xpm%" Popup MenuSLock .Ve .SH "AUTHORS" .IX Header "AUTHORS" Charles K. Hines , initial version. .PP Mikhael Goikhman , from 24 Feb 1999. .SH "COPYING" .IX Header "COPYING" The script is distributed by the same terms as fvwm itself. See \s-1GNU\s0 General Public License for details. .SH "BUGS" .IX Header "BUGS" Depends on the output of xlock. Will produce an empty menu if the structure of the output is changed. .PP Report bugs to fvwm\-bug@fvwm.org. fvwm-2.6.5.orig/bin/fvwm-convert-2.2.10000644000175000017500000000207211744241304015411 0ustar vwcvwc.\" @(#)fvwm-2.6.5 20 April 2012 .TH fvwm-convert-2.2 1 "20 April 2012 (2.6.5)" Fvwm "Fvwm Modules" .SH NAME fvwm-convert-2.2 \- convert fvwm 1.xx configuration file to fvwm 2.xx style .SH SYNOPSIS .B fvwm-convert-2.2 .RI [ source ] .RI [ dest ] .SH DESCRIPTION .B fvwm-convert-2.2 is a simple program that tries to convert an fvwm 1.xx configuration file into an fvwm 2.xx compatible format. It is not perfect, especially with regards to Mouse and Key commands, but it provides a basically-working \fI.fvwm2rc\fR file which can be further modified at leisure. .PP By default, the program will convert \fI~/.fvwmrc\fR, saving the results in \fI~/.fvwm2rc\fR. Different source and destination files may be given, with a destination of `-' meaning standard output. If the destination file already exists, it will be backed up first to \fI~/.fvwm2rc.bak\fR (with whatever the destination file is called replacing \fI~/.fvwm2rc\fR). .SH COMPATIBILITY In the past this utility was called .IR fvwmrc_convert . .SH AUTHOR This manual page was written by Julian Gilbey . fvwm-2.6.5.orig/bin/fvwm-convert-2.4.in0000644000175000017500000002263010557217743015676 0ustar vwcvwc#!@PERL@ # -*-perl-*- # Convert .fvwm2rc from 2.2.x format to 2.4.x format. # Originally written by Dan Espen Sept 2000 # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ($source,$dest) = @ARGV; if ( $source eq "") { $source = "$ENV{'HOME'}/.fvwm2rc"; } if ( ! -e $source ) { die "Can't find source file $source, giving up.\n"; } if ($dest eq "") { $dest = "$ENV{'HOME'}/.fvwm/.fvwm2rc"; } $dest2 = "$dest.pass1"; if ( -e $dest ) { die "Output file $dest already exists, exiting.\n"; } if ( -e $dest2 ) { die "Output file $dest2 already exists, exiting.\n"; } system "cp -p $source $dest 2>/dev/null"; # try to preserve permissions system "cp -p $source $dest2 2>/dev/null"; # try to preserve permissions $[ = 1; # set array base to 1 $, = ' '; # set output field separator $\ = "\n"; # set output record separator # GlobalOpts that became Styles: %OPTS = ('SMARTPLACEMENTISREALLYSMART','MinOverlapPlacement', 'SMARTPLACEMENTISNORMAL','TileCascadePlacement', 'ACTIVEPLACEMENTHONORSSTARTSONPAGE', 'ManualPlacementHonorsStartsOnPage', 'ACTIVEPLACEMENTIGNORESSTARTSONPAGE', 'ManualPlacementIgnoresStartsOnPage', 'CLICKTOFOCUSDOESNTPASSCLICK', 'ClickToFocusPassesClickOff', 'CLICKTOFOCUSDOESNTRAISE', 'ClickToFocusRaisesOff', 'MOUSEFOCUSCLICKDOESNTRAISE', 'MouseFocusClickRaisesOff', 'NOSTIPLEDTITLES', 'StippledTitleOff', 'STIPLEDTITLES', 'StippledTitle'); # GlobalOpts that became BugOpts: %BUGOPTS= ('RAISEOVERNATIVEWINDOWS','RaiseOverNativeWindows on', 'IGNORENATIVEWINDOWS','RaiseOverNativeWindows off'); print "Input from $source, output to $dest\n"; parse_pass($source, $dest2, 1); parse_pass($dest2, $dest, 2); unlink($dest2); exit 0; sub parse_pass { local($sourcefile, $destfile, $pass) = @_; open(IN, $sourcefile) || die "Can't open $source"; open(STDOUT, ">$destfile") || die "Can't redirect stdout to $dest2"; if ($pass == 2) { print '# This file changed by the .fvwm2rc to .fvwm/.fvwm2rc converter'; } # create assoc array by imagepath: $imagepath = '@FVWM_IMAGEPATH@'; $isize = (@iarray = split(/:/, $imagepath, 9999)); for ($i = 1; $i <= $isize; ++$i) { $iassoc{$iarray[$i]} = '1'; } $newwarn = ""; $commchar="#"; # help un-confuse emacs. line: while ( ) { chomp; # strip record separator @Fld = split(' ', $_, 9999); if (/^\s*[$commchar]/) { # Comment, pass it thru print $_; $line = $_; while (substr($line, length($line), 1) eq "\\") { # backslashed lines $line = &Getline1(); print $line; } next line; } if (/^\s*$/) { # Empty line, pass it thru print $_; next line; } $lastwarn = $newwarn; $newwarn = ""; # Adds "path" to "newpath": if (/^\s*ICONPATH|^\s*PIXMAPPATH/i) { # Fix up IconPath/PixmapPath: $newpath = ''; &add_to_path($Fld[2]); $line = $_; # prime possible loop while (substr($line, length($line), 1) eq "\\") { $line = &Getline1(); &add_to_path($line); } if ($newpath eq '') { print '# To use your own icons, uncomment and change the next line'; print "#ImagePath \$HOME/icons:+"; } else { print 'ImagePath ' . $newpath . ':+'; } next line; } # Change GlobOpts to "Style * xxx, ..." commands if (/^\s*globalopts/i) { # Fix up GlobalOpts: $newopts = ''; @rest=@Fld; # copy the whole line shift @rest; # remove first element &add_to_opts(join($",@rest)); # pass rest of line $line = $_; # prime possible loop while (substr($line, length($line), 1) eq "\\") { # backslashed lines $line = &Getline1(); &add_to_opts($line); # build up newopts } if ($newopts eq '') { next line; # GlobalOpts without argument, drop silently } else { print 'Style "*" ' . $newopts; # print as style command } next line; } if (/^\s*MODULEPATH/i) { # Deletes continuation lines too, although if there are # continuation lines, there might be some part of the path we want to # Delete them anyway. print '# Removed by fvwm-convert-2.4: ' . $_; while (substr($_, length($_), 1) eq "\\") { $_ = &Getline1(); print '# Removed by fvwm-convert-2.4: ' . $_; } next line; } $single_lines = $_; if ($pass == 2) { $line = $_; # collect continuation lines while (substr($line, length($line), 1) eq "\\") { # backslashed lines $old_line = substr($line, 1, length($line) - 1); $new_line = &Getline1(); $single_lines = "$single_lines\n$new_line"; $line = "$old_line$new_line"; } $_ = $line; } if (/^\s*HILIGHTCOLOR\s/i) { @colors = split("/", $Fld[2], 9999); if ($colors[2] eq '') { $colors[1] = $Fld[2]; $colors[2] = $Fld[3]; } print "Style \"*\" HilightFore " . $colors[1] . ', HilightBack ' . $colors[2]; next line; } if (/^\s*HILIGHTCOLORSET/i) { print "Style \"*\" HilightColorset " . $Fld[2]; next line; } if (/^\s*WINDOWSHADEANIMATE/i) { print "Style \"*\" WindowShadeSteps " . $Fld[2]; next line; } if (/^\s*WINDOWFONT/i) { print "Style \"*\" Font " . $Fld[2]; next line; } if (/^\s*ICONFONT/i) { print "Style \"*\" IconFont " . $Fld[2]; next line; } if (/^\s*COLORLIMIT/i) { print '# Removed by fvwm-convert-2.4: ' . $_; next line; } # generate warnings in pass 2 only if ($pass == 2) { if (/^\s*[*].+PANEL/i) { if ($lastwarn ne "panel") { print STDERR "Possible old style FvwmButtons Panel definition found"; print STDERR " See FvwmButtons(1), \"CONVERTING OLD PANEL CONFIGURATIONS\""; } print STDERR " $_"; print $_; $newwarn = "panel"; next line; } if (/^\s*READ/i) { if ($lastwarn ne "read") { print STDERR "Read command found, file(s) must be converted in a separate run:"; } print STDERR " $_"; print $_; $newwarn = "read"; next line; } if (/FvwmConfig/i) { print STDERR "The FvwmConfig module is no longer part of fvwm:"; print STDERR " $_"; if (/^\s*[*]?\s*FvwmConfig/i) { print STDERR " Line commented out."; print '# Removed by fvwm-convert-2.4: ' . $_; next line; } else { print $_; } next line; } if (/FvwmPipe/i) { print STDERR "The FvwmPipe module is no longer part of fvwm:"; print STDERR " $_"; if (/^\s*[*]?\s*FvwmPipe/i) { print STDERR " Line commented out."; print '# Removed by fvwm-convert-2.4: ' . $_; } else { print $_; } next line; } if (/RANDOMPLACEMENT|ACTIVEPLACEMENT|SMARTPLACEMENT/i || /DUMBPLACEMENT|CLEVERPLACEMENT/i) { $newwarn = "placement"; if ($lastwarn ne $newwarn) { print STDERR "Placement style names can not be converted automatically:"; print STDERR " See fvwm(1), \"Window manager placement\" for instructions."; } print STDERR " $_"; print $_; $newwarn = "placement"; next line; } } $lastwarn = ""; print $single_lines; # pass everything else thru } close(IN); close(STDOUT); } sub add_to_path { local($path) = @_; $psize = (@parray = split(/:/, $path, 9999)); # split them up for ($i = 1; $i <= $psize; ++$i) { # Drop any builtin imagepath: if ($iassoc{$parray[$i]} eq '1') { next; } if ($parray[$i] eq "\\") { next; } # Maybe this next line should only skip files starting with $, # that dont start with $HOME. if (substr($parray[$i], 1, 1) eq "\$") { next; } if ($newpath eq '') { $newpath = $parray[$i]; } else { $newpath = $newpath . ':' . $parray[$i]; } } } # take one GlobalOpt and convert it to a style argument -or- # just print any bugOpts sub add_to_opts { local($opts) = @_; $psize = (@parray = split(/[ ,\t]/, $opts, 9999)); # split them up for ($i = 1; $i <= $psize; ++$i) { if ($parray[$i] eq "\\") { next; } if ($parray[$i] eq "") { next; } # Convert args: # Some args are the same in a style command # Some are changed a little, # the native window stuff becomes a BugOpt $work = $parray[$i]; # init w. unconverted arg $uwork = uc $work; # uppercase version for lookup $newStyleArg = $OPTS{$uwork}; # do conversion using hash if ($newStyleArg ne '') { # if arg got converted $work = $newStyleArg; # save new arg } $bugArg = $BUGOPTS{$uwork}; # convert using hash if ($bugArg ne '') { # if converted print 'BugOpts ' . $bugArg; } else { # if not bugOpt, accum if ($newopts eq '') { # first time, just arg $newopts = $work; } else { $newopts = $newopts . ', ' . $work; # add comma and arg } } # end bugArg vs. style } # end for } sub Getline1 { local($_); if ($getline_ok = (($_ = ) ne '')) { chomp; # strip record separator } $_; } fvwm-2.6.5.orig/bin/fvwm-config.in0000644000175000017500000001513311705520201015140 0ustar vwcvwc#!/bin/sh # Querying fvwm installation. Author: Mikhael Goikhman. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA PACKAGE="@PACKAGE@" VERSION="@VERSION@" script=`basename $0` usage() { cat <] return: 0 (yes), 100 (no), 200 (unknown) EOF exit $1 } if test $# -eq 0; then usage 1 1>&2 fi prefix="@prefix@" exec_prefix="@exec_prefix@" bindir="@bindir@" datarootdir="@datarootdir@" datadir="@datadir@" libexecdir="@libexecdir@" sysconfdir="@sysconfdir@" mandir="@mandir@" localedir="@LOCALEDIR@" fvwm_moduledir="@FVWM_MODULEDIR@" fvwm_datadir="@FVWM_DATADIR@" fvwm_perllibdir="@FVWM_PERLLIBDIR@" fvwm_imagepath="@FVWM_IMAGEPATH@" fvwm_userdir='$HOME/.fvwm' fvwm_exe='fvwm' VERSIONINFO="@VERSIONINFO@" release_date="@RELDATENUM@" with_bidi=@with_bidi@ with_gettext=@with_gettext@ with_gtk=@with_gtk@ with_gdkimlib=@with_gdkimlib@ with_gnomelibs=@with_gnomelibs@ with_iconv=@with_iconv@ with_perllib=@with_perllib@ with_png=@with_png@ with_readline=@with_readline@ with_rplay=@with_rplay@ with_rsvg=@with_rsvg@ with_shape=@with_shape@ with_shm=@with_shm@ with_sm=@with_sm@ with_stroke=@with_stroke@ with_xcursor=@with_xcursor@ with_xinerama=@with_xinerama@ with_xft=@with_xft@ with_xpm=@with_xpm@ with_xrender=@with_xrender@ while test $# -gt 0; do case "$1" in --help|-help|-h|-\?) usage 0 ;; --version|-version|-v|-V) echo "$VERSION" ;; --prefix|-prefix|-P) echo "$prefix" ;; --exec-prefix|-exec-prefix|-E) echo "$exec_prefix" ;; --bindir|-bindir|-B) echo "$bindir" ;; --datarootdir|-datarootdir) echo "$datarootdir" ;; --datadir|-datadir|-D) echo "$datadir" ;; --libexecdir|-libexecdir|-L) echo "$libexecdir" ;; --sysconfdir|-sysconfdir|-S) echo "$sysconfdir" ;; --mandir|-mandir|-M) echo "$mandir" ;; --localedir|-localedir|-O) echo "$localedir" ;; --fvwm-moduledir|-fvwm-moduledir|-m) echo "$fvwm_moduledir" ;; --fvwm-datadir|-fvwm-datadir|-d) echo "$fvwm_datadir" ;; --fvwm-perllibdir|-fvwm-perllibdir|--perllibdir|-perllibdir|-p) echo "$fvwm_perllibdir" ;; --default-imagepath|-default-imagepath|-I) echo "$fvwm_imagepath" ;; --default-userdir|-default-userdir|-U) echo "$fvwm_userdir" ;; --fvwm-exe|-fvwm-exe|-e) echo "$fvwm_exe" ;; --supports|-supports|-s) test "$with_bidi" = "yes" && echo "bidi" test "$with_gettext" = "yes" && echo "gettext" test "$with_gtk" = "yes" && echo "gtk" test "$with_gdkimlib" = "yes" && echo "gdk-imlib" test "$with_gnomelibs" = "yes" && echo "gnome-libs" test "$with_iconv" = "yes" && echo "iconv" test "$with_perllib" = "yes" && echo "perllib" test "$with_png" = "yes" && echo "png" test "$with_readline" = "yes" && echo "readline" test "$with_rplay" = "yes" && echo "rplay" test "$with_rsvg" = "yes" && echo "rsvg" test "$with_shape" = "yes" && echo "shape" test "$with_shm" = "yes" && echo "shm" test "$with_sm" = "yes" && echo "sm" test "$with_stroke" = "yes" && echo "stroke" test "$with_xcursor" = "yes" && echo "xcursor" test "$with_xinerama" = "yes" && echo "xinerama" test "$with_xft" = "yes" && echo "xft" test "$with_xpm" = "yes" && echo "xpm" test "$with_xrender" = "yes" && echo "xrender" ;; --supports-*) feature=`echo "$1" | sed 's/^--supports-//'` feature=`echo "$feature" | sed 's/[-_]//g'` test "$feature" = "gnomewm" && feature="gnomehints" with=`eval echo '$'with_"$feature"` test "$with" = "yes" && exit 0 test "$with" = "no" && exit 100 exit 200 ;; --info|-info|-i) echo "Package: $PACKAGE" echo "Version: $VERSION$VERSIONINFO" echo "" echo "Instalation options:" echo " prefix: $prefix" echo " exec-prefix: $exec_prefix" echo " bindir: $bindir" echo " datadir: $datadir" echo " libexecdir: $libexecdir" echo " sysconfdir: $sysconfdir" echo " mandir: $mandir" echo " localedir: $localedir" echo "" echo "Compiled-in paths:" echo " Module directory: $fvwm_moduledir" echo " Data directory: $fvwm_datadir" echo " Perl lib directory: $fvwm_perllibdir" echo " Default ImagePath: $fvwm_imagepath" echo " Default UserDir: $fvwm_userdir" echo "" echo "Support for features:" echo " bidi (bi-directionality): $with_bidi" echo " gettext (Native Lang Support): $with_gettext" echo " gtk (required for FvwmGtk): $with_gtk" echo " gdk-imlib (in FvwmGtk): $with_gdkimlib" echo " gnome-libs (in FvwmGtk): $with_gnomelibs" echo " perllib (Perl library installed): $with_perllib" echo " iconv (i18n conversions): $with_iconv" echo " png: $with_png" echo " readline: $with_readline" echo " rplay: $with_rplay" echo " shape (shaped windows): $with_shape" echo " shm (shared memory): $with_shm" echo " sm (session management): $with_sm" echo " stroke (mouse gestures): $with_stroke" echo " rsvg (SVG icons and images): $with_rsvg" echo " xcursor (ARGB/animated cursors): $with_xcursor" echo " xinerama (multi-head): $with_xinerama" echo " xft (FreeType anti-alias font): $with_xft" echo " xpm: $with_xpm" echo " xrender (XFree86 Xrender extention): $with_xrender" ;; --is-final|-is-final) test "$is_final" = yes && echo yes test "$is_final" != yes && echo no ;; *) echo >&2 "$script: unknown argument '$1'." echo >&2 "Run '$script --help' to get the usage." exit 1 ;; esac shift done exit 0 fvwm-2.6.5.orig/bin/fvwm-menu-desktop.1.in0000644000175000017500000004775711561324761016503 0ustar vwcvwc.\" t .\" @(#)@PACKAGE@-@VERSION@ @RELDATELONG@ .de EX \"Begin example .ne 5 .if n .sp 1 .if t .sp .5 .nf .in +.5i .. .de EE .fi .in -.5i .if n .sp 1 .if t .sp .5 .. .ta .3i .6i .9i 1.2i 1.5i 1.8i .TH fvwm-menu-desktop 1 "@RELDATELONG@ (@VERSION@)" Fvwm "Fvwm Modules" .UC .SH NAME fvwm-menu-desktop \- builds GNOME and KDE menus and style commands for fvwm .SH SYNOPSIS fvwm-menu-desktop [ \fB\-\-help\fR|\fB\-h\fR|\fB\-?\fR ] [ \fB\-\-version\fR|\fB\-v\fR|\fB\-V\fR ] [ \fB\-\-install\-prefix\fR \fIDIR\fR ] [ \fB\-\-desktop\fR \fINAME\fR ] [ \fB\-\-type\fR NAME\fR ] [ \fB\-\-fvwmgtk\-alias\fR \fINAME\fR ] [ \fB\-\-title\fR \fINAME\fR ] [ \fB\-\-name\fR \fINAME\fR ] [ \fB\-\-merge-user-menu\fR ] [ \fB\-\-enable\-mini\-icons\fR ] [ \fB\-\-enable\-tran\-mini\-icons\fR ] [ \fB\-\-mini\-icons\-path\fR \fIDIR\fR ] [ \fB\-\-png\-icons\-path\fR \fIDIR\fR ] [ \fB\-\-tran\-mini\-icons\-path\fR \fIDIR\fR ] [ \fB\-\-check-mini\-icons\fR \fIPATH\fR ] [ \fB\-\-icon\-toptitle\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR:\fIside_pic\fR:\fIcolor\fR ] [ \fB\-\-icon\-title\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR:\fIside_pic\fR:\fIcolor\fR ] [ \fB\-\-icon\-folder\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR ] [ \fB\-\-icon\-app\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR ] [ \fB\-\-wm\-icons\fR ] [ \fB\-\-enable\-style\fR ] [ \fB\-\-enable\-tran\-style\fR ] [ \fB\-\-icon-style\fR \fImicon\fR:\fIicon\fR:\fIlaw\fR ] [ \fB\-\-icons\-path\fR \fIDIR\fR ] [ \fB\-\-tran\-icons\-path\fR \fIDIR\fR ] [ \fB\-\-check-icons\fR \fIPATH\fR ] [ \fB\-\-submenu\-name\-prefix\fR \fIname\fR ] [ \fB\-\-dir\fR \fIDIR\fR ] [ \fB\-\-destroy\-type\fR \fIFLAG\fR ] [ \fB\-\-xterm\fR \fICMD\fR ] [ \fB\-\-lang\fR \fINAME\fR ] [ \fB\-\-utf8\fR ] [ \fB\-\-uniconv\fR \fIcharset\fR ] [ \fB\-\-uniconv-exec\fR \fIexec\fR ] [ \fB\-\-menu-style\fR \fIname\fR ] [ \fB\-\-no\-check\-app\fR ] [ \fB\-\-time\-limit\fR \fINUM\fR ] [ \fB\-\-kde_config\fR \fIcommand\fR ] .SH DESCRIPTION This is a perl script which parses XDG (GNOME or KDE) menus definitions to build corresponding fvwm menus. The script can also build icon and mini\-icon style commands for the applications. .SH USAGE There are a lot of options. However the defaults are, I hope, good enough. If you want the application menu in the menu "Utilities" add the following lines in your .fvwm2rc file: .EX ... AddToMenu Utilities "Application Menu" Popup FvwmMenu ... PipeRead 'fvwm-menu-desktop' .EE If the KDE mini\-icons are in "mini/" relative to your fvwm ImagePath add the option \-\-enable-mini\-icons. (if the KDE mini\-icons are in some other place use the \-\-mini\-icons\-path option, e.g., they are in your ImagePath plus \-\-mini\-icons\-path). If you want to build Icon and MiniIcon style commands for KDE applications, add the option \-\-enable-style. If you want to have the KDE user menu replace "sys" by "user". If you use the KDE menu editor, you may want to pop this menu up dynamically. Then, put this into your .fvwm2rc file (note the destroy-type). .EX AddToMenu Utilities "KDE User Menu" Popup kde\-user ... AddToMenu kde\-user + DynamicPopupAction PipeRead 'fvwm-menu-desktop --desktop kde-user --enable-mini-icons [--destroy-type dynamic] [other options]' .EE The following example builds "all" GNOME menus (with some mini\-icons in the system menu). You need to specify the GNOME installation prefix if it is not /usr (with the option \-\-install\-prefix). Moreover, the GNOME icons need to be in your ImagePath and the non .png mini\-icons you use for the user\-menu need to be in mini/ (if not, use the \-\-png\-icons\-path option and the \-\-mini\-icons\-path option, respectively). .EX Module FvwmGtk *FvwmGtk: Destroy gnome-all *FvwmGtk: Menu gnome-all *FvwmGtk: Title "Gnome Menus" *FvwmGtk: Separator *FvwmGtk: Destroy gnome-sys *FvwmGtk: Submenu "System" gnome-sys *FvwmGtk: Destroy gnome-user *FvwmGtk: Submenu "User" gnome-user *FvwmGtk: Destroy gnome-redhat *FvwmGtk: Submenu "RedHat" gnome-redhat PipeRead 'fvwm-menu-desktop --type gtk --enable-mini-icons --icon-folder :re --icon-app :re --icon-title :re --icon-toptitle :re' PipeRead 'fvwm-menu-desktop --type gtk --desktop gnome-user --enable-mini-icons' PipeRead 'fvwm-menu-desktop --type gtk --desktop gnome-redhat --enable-mini-icons' # To obtain the menu above with Alt-button1 on the root window Mouse 1 R M SendToModule FvwmGtk gnome-all .EE You can specify FvwmGtk alias: Module FvwmGtk MyGnomeMenu. In this case you must pass an additional parameter to fvwm-menu-desktop: \-\-fvwmgtk-alias MyGnomeMenu. Of course you can build fvwm (i.e., no FvwmGtk) GNOME menus. GNOME and KDE2 use PNG icons which are not supported by fvwm menu. However, if you have XPM version of the GNOME or of the KDE2 (mini-)icons you can build fvwm menus and style commands with these icons using the option \-\-enable-tran-mini\-icons and \-\-enable\-tran\-style. The Fvwm Themes package (http://fvwm-themes.sourceforge.net/) contains an utility, fvwm-themes-images, which can convert automatically (with the help of ImageMagick) all GNOME and KDE2 icons to XPM icons. You can build sub menus using the \-\-dir options. However, if you want to use more than one submenu it is better to build the "all" menu and to use the submenu names. See the option \-\-submenu\-name\-prefix for information on submenu names. Nevertheless, you may put the menu in a tmp file using redirection to see the submenu names. If you think that fvwm-menu-desktop slows your startup too much do not use PipeRead. Instead run fvwm-menu-desktop and redirect the menu to a file and Read that file in your .fvwm2rc file. Another possibility is to use DynamicPopupAction (with fvwm menu), the menu (and the styles) will be built only if you pop up the menu. The following menu creates a "kde\-all" menu which contains the user menu which is built each time you pop up "kde\-all" and contains a pop up to the system menu which is built only the first time you pop it up. .EX AddToMenu kde\-all + DynamicPopupAction FuncRecreateKdeAll AddToMenu kde\-sys + DynamicPopupAction PipeRead 'fvwm-menu-desktop \\ \-\-desktop kde\-sys [options, but \-\-destroy-type d* or n*]' AddToFunc FuncRecreateKdeAll \\ I PipeRead 'fvwm-menu-desktop \\ \-\-desktop kde\-user \-\-enable\-mini\-icons \-\-name kde\-all \\ \-\-destroy-type dynamic [options you like]' + I AddToMenu "kde\-all" "" Nop + I AddToMenu "kde\-all" "Kde System%mini/mini\-k.xpm%" Popup kde\-sys .EE fvwm-menu-desktop takes into account your $LANG environment variable, which may be overwritten using the --lang option. Hint, if you need a different menu font or item format from the ones used in the default MenuStyle, you may use the --menus-style option to assign a non-default MenuStyle name to menus built by this script. Don't forget to create a new menu style in your .fvwm2rc, using CopyMenuStyle and MenuStyle commands. .SH OPTIONS .IP "Main Options" .IP "\fB\-\-help\fR" Show the help and exit. .IP "\fB\-\-version\fR" Show the version and exit. .IP "\fB\-\-install-prefix\fR \fIDIR\fR" The prefix of GNOME or KDE installation. Default is /usr for GNOME (other common prefixes: /usr/local, /opt/gnome). For KDE the default is $KDEDIR and you probably do not need to use this option. .IP "\fB\-\-desktop\fR \fINAME\fR" Use gnome\-sys for the GNOME system menu (this is the default), gnome\-user for the GNOME user menu, gnome\-redhat for the AnotherLevel menu of Red Hat, gnome\-mandriva for Mandriva menudrake menus, kde\-sys for the KDE system menu and kde\-user for the KDE user menu. It may be useful to use KDE or GNOME as a flag with the \-\-dir option. .IP "\fB\-\-type\fR \fINAME\fR" If NAME is fvwm, a native fvwm menu will be built (this is the default). If NAME is gtk, a FvwmGtk menu will be built. .IP "\fB\-\-fvwmgtk-alias\fR \fINAME\fR" The name for then FvwmGtk module to use instead of default FvwmGtk. .IP "\fB\-\-title\fR \fINAME\fR" Define the menu title of the top menu. Default is "Gnome System Menu" for gnome\-sys, "Gnome User Menu" for gnome\-user, "Gnome Red Hat Menu" for gnome\-redhat, "Gnome Mandriva Menu" for gnome\-mandriva. For KDE the default is given by KDE itself (or are similar to GNOME title). .IP "\fB\-\-name\fR \fINAME\fR" Define the menu name of the top menu. Default is the \-\-desktop name if you use one above. .IP "\fB\-\-merge-user-menu\fR" this option tries to merge the user menu with the system menu (gnome-sys or kde-sys, based on the --desktop option) and takes into account changes to the system menu that it is now possible to do in the "user directory" (at least with KDE version 2 menu editor). .IP "Icons Options" By default, fvwm-menu-desktop builds mini\-icon free menus. To enable mini\-icons use one of the two following options. .IP "\fB\-\-enable\-mini\-icons\fR" This option enables mini\-icons in the menu. The desktop hints are used if it is possible (fvwm menu can't use .png icons). Use the \-\-mini\-icons\-path and the \-\-png\-icons\-path to specify the good paths. By using the \-\-icon-* options below you can control mini\-icons in menus. .IP "\fB\-\-enable\-tran\-mini\-icons\fR" This option applies only to fvwm menus and is useful to build GNOME or KDE2 menus with mini\-icons (and if you have XPM version of the GNOME or KDE2 PNG icons). If this option is used any icon hint foo.png is translated to path/foo.xpm where path is determined by the \-\-tran\-mini\-icons\-path option (xpm icons are used as with the previous option). .IP "\fB\-\-mini\-icons\-path\fR \fIDIR\fR" Define the directory of the .xpm mini\-icons (relative to your ImagePath). Default is "mini/". .IP "\fB\-\-png\-icons\-path\fR \fIDIR\fR" Define the directory of .png icons. Default is "" (i.e., in your ImagePath). Useful only with FvwmGtk menus. .IP "\fB\-\-tran\-mini\-icons\-path\fR \fIDIR\fR" Define the directory of the mini\-icons for the \-\-enable\-tran\-mini\-icons option. Default is mini/. It is preferable to give the complete path so that fvwm-menu-desktop can check if the translated mini\-icons exists (and the "re" law will apply in a good way). .IP "\fB\-\-check\-mini\-icons\fR \fIPATH\fR" Where PATH is a list of directories with ":" as a separator. Then, fvwm-menu-desktop checks that the mini icons actually exist in one of these directories (this check is not done for the translated mini icons). .IP Comments To control mini\-icons in menus you can use the 4 following options which work similarly. In these options \fIlaw\fR may be \fIno\fR, \fIdh\fR, \fIre\fR or \fIow\fR. \fIno\fR means "do not use mini\-icon" (this does not affect side pic). \fIdh\fR means "use only the mini\-icons GNOME/KDE hints". \fIre\fR means "use mini\-icons GNOME/KDE hints but if it is empty use the specified mini\-icon". \fIow\fR means "override the mini\-icons GNOME/KDE hints by the specified mini\-icon". The path to the specified icons is given by the options \-\-mini\-icons\-path, \-\-png\-icons\-path or \-\-tran\-mini\-icons\-path (i.e., you just have to specify the icon, the path is computed). For the sidepic you need to give the complete relative path from your ImagePath. Note that for the fvwm menu (without the \-\-enable\-tran\-mini\-icons option) a .png icon hint is considered as an empty hint, so for the system menu use no=dh and re=ow (you may use .xpm icons in a user menu). If the \-\-tran\-mini\-icons\-path option is set with a complete path, then if the .xpm icon which corresponds to a .png icon hint does not exist, the icon hint is considered as empty. \fIplace\fR, \fIsidepic\fR and \fIcolor\fR apply only with fvwm menus. \fIplace\fR is either left or up. \fIleft\fR means that the icon will be placed on the left of the label. \fIup\fR means that the icon will be placed above the label. \fIsidepic\fR needs to be nothing or an icon (for a picture in the bottom left of the menu). \fIcolor\fR applies only if a sidepic icon is given and it is the color for the region of the menu containing the sidepic picture. When you use an option below, if an icon, a law ...etc is not specified (i.e., empty) the default is used (e.g, if you want, for an fvwm menu, the icon folder.xpm on the left of the top title and the sidepic fvwm2.xpm on the left of this menu use the following: \-\-icon\-toptitle :ow::fvwm2.xpm). .IP "\fB\-\-icon-toptitle\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR:\fIsidepic\fR:\fIcolor\fR" Mini\-icon for the top title and sidepic for the top menu. Default for fvwm menus: folder.xpm:no:left::. Default for fvwm menus with \-\-enable\-tran\-mini\-icons: gnome\-logo\-icon\-transparent.xpm:no:left:. Default for gtk menus: gnome\-logo\-icon\-transparent.png:no. .IP "\fB\-\-icon\-title\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR:\fIsidepic\fR:\fIcolor\fR" Use the option below for submenus. Default for fvwm menus: folder.xpm:dh:left::. Default for fvwm menus with \-\-enable\-tran\-mini\-icons: gnome\-folder.xpm:dh:left::. Default for gtk menus: gnome\-folder.png:dh .IP "\fB\-\-icon\-folder\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR:\fIsidepic\fR:\fIcolor\fR" Mini-icons for pop up item. Default for fvwm menus: folder.xpm:dh:left. Default for fvwm menus with \-\-enable\-tran\-mini\-icons: gnome\-folder.xpm:dh:left. Default for gtk menus: gnome\-folder.png:dh. .IP "\fB\-\-icon\-app\fR \fImicon\fR:\fIlaw\fR:\fIplace\fR" Mini\-icon for applications item. Default for fvwm menus: mini\-x.xpm:dh. Default for fvwm menus with \-\-enable\-tran\-mini\-icons: gnome\-default.xpm:dh. Default for gtk menus: gnome\-default.png:dh .IP \fB--wm-icons\fR This is a shortcut, which can be used if you plan to use icons from the wm-icons package. Currently this is equivalent to: \-\-enable\-mini\-icons \-\-mini\-icons\-path '' \-\-icon\-toptitle menu/folder-open.xpm:ow \-\-icon\-title menu/folder-open.xpm:ow \-\-icon\-folder menu/folder.xpm:ow \-\-icon\-app menu/utility.xpm:ow. .IP "Style Options" .IP "\fB\-\-enable-style\fR \fImini\-icon\fR:\fIicon\fR:\fIlaw\fR:\fIaddstyle\fR" Build icons and mini\-icons style commands for the applications in the built menu. .IP "\fB\-\-style\-tran\fR" Only useful with FvwmGtk GNOME or KDE2 menus. Make translation as the enable\-tran\-mini\-icon option but only for style (not for mini\-icons menus). .IP "\fB\-\-icon-style\fR \fImini\-icon\fR:\fIicon\fR:\fIlaw\fR:\fIaddstyle\fR" This option is similar to the options \-\-icon-* above. Default law is "dh" (there is no "no" law). Default mini\-icon is mini\-x.xpm and default icon is x.xpm. You can add a style to all applications with addstyle. If you use the enable\-tran\-mini\-icon options the translated (mini\-)icons will be used (if translation is needed) and the default icons are gnome\-default.xpm. If you use the \-\-enable\-tran\-style options above the default icons are gnome\-default.xpm. The paths to mini\-icons are the same as those for the menus. The path to the icons is computed from the mini\-icons path: they are one directory up to the corresponding mini\-icons path (so the "defaults" are "" and this is consistent with KDE1 and XPM icons builded by fvwm-themes-images). .IP "\fB\-\-icons\-path\fR \fIDIR\fR" Not useful in a normal situation. Define the directory of the icons. Default is one directory up from the path given by the \-\-mini\-icons\-path option. To set the path to "" you need to use "inpath". .IP "\fB\-\-tran\-icons\-path\fR \fIDIR\fR" Similar to the above option. .IP "\fB\-\-check\-icons\fR \fIPATH\fR" Where PATH is a list of directories with ":" as a separator. Then, fvwm-menu-desktop checks that the icons actually exist in one of these directories (this chack is not done for the translated icons, use a full path in --tran-icons-path to do so). .IP "Other Options" .IP "\fB\-\-submenu\-name\-prefix\fR \fINAME\fR" May be useful in some unfortunate cases. By default the name of a sub menu is of the form prefix\-adirname\-level where prefix is the desktop flag, adirname is the name of the directory of the description of the sub menus (not a complete path) and where level is an integer equal to the number of "cd"s you need to do to go from the root to the directory of the description of the sub menus. You may change the prefix using the present option. .IP "\fB\-\-dir\fR \fIDIR\fR" Set the directory where fvwm-menu-desktop looks for a GNOME/KDE menu description to \fIDIR\fR. The name of the menu is 'desktop\-name' and the title is 'desktop' name where 'desktop' is either GNOME or KDE (if fvwm-menu-desktop can't find which desktop is concerned, you can help with the \-\-desktop option) and where 'name' is the name of the right directory of \fIDIR\fR (or a hint of the desktop for the title). Note that if this option is not set, the description directory is install\-prefix/share/gnome/apps if \-\-desktop is gnome\-sys, $HOME/.gnome/apps if \-\-desktop is gnome\-user, $HOME/.gnome/apps\-redhat if \-\-desktop is gnome\-redhat, $HOME/.gnome/apps\-mdk if \-\-desktop is gnome\-mandriva, $KDEDIR/share/applink if \-\-desktop is kde\-sys and $HOME/.kde/share/applnk if\-\-desktop is sys\-user. .IP "\fB\-\-destroy\-type\fR \fIflag\fR" flag may be "y(es)", "no", "d(ynamic)". Default is "yes" with fvwm menus, "no" with FvwmGtk menus and dynamic applies only with fvwm menus. If "yes" is used the top menu will be destroyed (DestroyMenu "name"), if "no" is used the top menu will not be destroyed (useful for FvwmGtk menus called by another menu via FvwmGtkSubMenu or to give the same name to two or more menus built by fvwm-menu-desktop). If dynamic is used the menu will be destroyed/recreated (may be useful with DynamicPopupAction). Note that all the built sub menus are always destroyed. .IP "\fB\-\-xterm\fR \fICMD\fR" Define complete X terminal command to run applications in it if needed. Default is 'xterm -e'. .IP "\fB\-\-lang\fR \fINAME\fR" Default is the value of $LANG. Useful if your language is not GNOME/KDE compliant and you prefer a non-English compliant language. Also useful if fvwm-menu-desktop gives bad result with your language. .IP "\fB\-\-utf8\fR" Assume that the desktop entries used UTF-8 encoding. This is the case with KDE version 2 and will be probably the case with GNOME version 2. At the present time this option work only if you have perl version 5.6 or better and if your language use latin-1 font. If one of these conditions is not satisfied, then this option is equivalent to \-\-lang en. For other languages/charsets use the \-\-uniconv option. The advantage of this option as compared to the following option is that it is fast. .IP "\fB\-\-uniconv\fR \fIcharset\fR" Use iconv, uniconv or internal method to translate utf8 desktop entries into an appropriate "charset". You can choose between one of the supported tools using \-\-uniconv-exec option. iconv comes with glibc >= 2.1.1 and uniconv comes with the utf8 editor yudit. Type "iconv --list" or "man uniconv" for the list of supported charsets. Of course you must also use the appropriate font using the MenuStyle command. Also, $LANG (or --lang xx) must be compatible with the charset. Note, if you don't use an internal method, fvwm-menu-desktop is very slow with this option: you probably need to use the --time-limit option and you should redirect the result into a file and read this file in your fvwm configuration. .IP "\fB\-\-uniconv-exec\fR \fIexec\fR" Not used, kept for legacy purposes. .IP "\fB\-\-menu-style\fR \fIname\fR" By default the generated fvwm menus use the default MenuStyle (i.e., the MenuStyle "*"). You can specify another MenuStyle name using this option. .IP "\fB\-\-[no]check-app\fR" Not used, kept for legacy purposes. .IP "\fB\-\-time-limit\fR \fINUM\fR" Not used, kept for legacy purposes. .IP "\fB\-\-kde_config\fR \fIcommand\fR" If available, this script uses the command kde-config or kde4-config to find the XDG menus. If the kde-config command has another name you can use this option to set the command name. If this script can't find any kde-config command, it does it's best to run without it. .SH BUGS This script needs more testing to see if all options work well (note that the script does not check for inconsistency of the given options). If Desktop menu hints are changed the script may not work as expected. I have tested the script with gnome-core-1.0.3, kde-1.1, kde-1.2 and kde-2.0. .SH AUTHORS Olivier Chapuis Mikhael Goikhman - some changes .SH COPYING The script is distributed by the same terms as fvwm itself. See GNU General Public License for details. fvwm-2.6.5.orig/bin/fvwm-convert-2.6.1.in0000644000175000017500000000710711320704536016027 0ustar vwcvwc.\" @(#)@PACKAGE@-@VERSION@ @RELDATELONG@ .TH fvwm-convert-2.6 1 "@RELDATELONG@ (@VERSION@)" Fvwm "Fvwm Modules" .SH NAME fvwm-convert-2.6 \- convert fvwm 2.4.x configuration file to fvwm 2.6 style .SH SYNOPSIS .B fvwm-convert-2.6 .RI [ --follow-read | -f ] .RI [ --help | -h ] .RI source .RI [ dest ] .SH OPTIONS The following options are supported: .IP "\fB\-\-help\fR | \fB\-h\fR" Prints a usage message to the screen. .IP "\fB\-\-follow\-read\fR | \fB\-f\fR" Follows files found along with the .B Read command. .SH DESCRIPTION .B fvwm-convert-2.6 converts an fvwm 2.4.x configuration file into a fvwm 2.6 file with compatible syntax. It is not suitable to convert older 2.x configuration files. Please use .B fvwm-convert-2.2 to convert these to the 2.2.x format first, and then if necessary .B fvwm-convert-2.4 .PP By default, .B fvwm-convert-2.6 won't look for a given config file. This must be specified as the first parameter to .B fvwm-convert-2.6. Different source and destination files may be given. If the destination file already exists, this program exits. If no destination file is given, then the filename is the same name as the source file with the suffix ".converted" added. Without an absolute path given as the destination path to the destination file, the program will create the destination file in the CWD. .PP .B fvwm-convert-2.6 makes the following changes: .TP 4 .B Style lines In fvwm 2.4, most style options could be negated from their counterparts using NoFoo -- fvwm-convert-2.6 corrects this by now using !Foo. .TP 4 .B ModulePath In fvwm 2.4 and beyond, the ModulePath is compiled into fvwm. .B fvwm-convert-2.6 comments out any ModulePath commands it finds. If you are using your own modules, (not the ones that come with fvwm), you will have to fix your configuration file after using .BR fvwm-convert-2.6 . .TP 4 .B Conditional command syntax In fvwm 2.4, the conditional command options were whitespace-separated -- they should now be comma-separated instead. In addition, the older syntax to Next and Prev of using [*] to denote all windows has been removed entirely. Both these checks and conversions are done on function commands, key/mouse bindings. .TP 4 .B WindowShadeSteps In fvwm 2.4, the WindowShadeSteps command is replaced by the WindowShadeSteps Style option. .B fvwm-convert-2.6 makes this change. .TP 4 .B FvwmTheme In fvwm 2.6, the FvwmTheme module is replaced by a series of Colorset commands. Whilst .B fvwm-convert-2.6 will try and make this change, it is still recommended that this is checked after conversion. .TP 4 .B EdgeResistance In fvwm 2.6, the EdgeResistance command is has been split to include an additional style option for EdgeMoveResistance. .B fvwm-convert-2.6 makes any changes necessary. .TP 4 .B StartFunction / RestartFunction / InitFunction In fvwm 2.6, the need for using InitFunction and/or RestartFunction is redundant when StartFunction is read at both of these times. .B fvwm-convert-2.6 attempts to convert this. .TP 4 .B Read If .B -f or .B --follow-read is given, any files .B fvwm-convert-2.6 can detect and open will be converted automatically, else a list of files that can be followed are printed to the screen. .TP 4 .SH BUGS .I InitFunction and .I RestartFunction and hence .I StartFunction are printed at the end of the files -- this slight reordering might put some comments before in an odd spot. When converting over FvwmTheme lines, the colorset definitions might well be broken, but these cannot easily be converted. Bug reports can be sent to the fvwm-workers mailing list (see the .IR FAQ ). .SH AUTHOR Thomas Adam fvwm-2.6.5.orig/bin/ChangeLog0000644000175000017500000011061111705520634014147 0ustar vwcvwc2012-01-18 Thomas Adam * fvwm-config.in: * fvwm-config.1.in: Remove --is-final, --is-released, --is-stable from fvwm-config It no longer makes sense to report on this information, given how fvwm is developed. 2011-12-30 Thomas Adam * fvwm-menu-desktop.in: Remove redundant stat(2) calls when performing file-system checks for constructing XDG menus. 2011-11-03 Dominik Vogt * fvwm-perllib.in: used @SED@ from configure.ac 2011-05-07 * fvwm-menu-desktop.1.in: Some updates, needs a lot of work. Later. * fvwm-menu-desktop.in: new option kde_config for alternate name of optional kde-config command. use kde4-config if kde-config isn't found. if no kde-config command at all, use some defaults. 2011-04-28 Thomas Adam * fvwm-menu-desktop.in: Remove #! line hard-coded to #!/usr/bin/perl @PERL@ exists here for just this reason. 2011-04-27 * fvwm-menu-desktop.in: Silently ignore --desktop x. Add support for XDG_MENU_PREFIX which according to standards identifies an alternate prefix for the applications menu. Only warn about missing menu files if verbose flag set. 2011-04-19 * fvwm-menu-desktop.in (interpret_menu): Silently ignore Layout/DefaultLayout. 2011-04-16 Thomas Adam * fvwm-menu-desktop.in: Fix version check (5.008) 2011-04-16 Thomas Adam * fvwm-menu-desktop.in: Fix version check (5.008) Make looking for XML::Parser a runtime check. 2011-04-10 Thomas Adam * fvwm-menu-desktop.in (get_root_menu): Make the root menu look for more than one place. Should fix the fact that Debian (and by association, Ubuntu) like to be special in what the XDG menu files are called. 2011-04-10 * fvwm-menu-desktop.in: Restore some missing code. Remove some duplicated code. 2011-03-27 Thomas Adam * fvwm-convert-2.6.in (convert_startfunc): Fix StartFunction handling When converting a StartFunction block, set the function definition early on so that further lines with "+" are handled properly. 2010-12-27 * fvwm-menu-desktop.in: New root menu name, FvwmMenu. Regenerate menu using a prompt for new options. Comments about more changes. 2010-12-25 * fvwm-menu-desktop.in: change to work with xdg menu standard. make filehandles local. fix root-cmd default and search. 2010-05-13 Thomas Adam * fvwm-convert-2.6.in (__convert_conditionals): Be more specific about conditional command corrections. When converting over "Foo [blah]", don't blindly substitute anything in square brackets, as this will obliterate legitimate statements such as "$[foo]" when referring to environment variable interpolation. Instead, ensure we only process this if it's preceeded by a conditional command. 2010-05-13 Thomas Adam * fvwm-convert-2.6.in: Remove trailing comma. 2010-05-12 Thomas Adam * fvwm-convert-2.6.in (__convert_conditionals): Preserve comma-separated options in conditional commands. If we encounter options in conditon commands already separated with commas, ensure we don't double-up on commas when converting any further options -- because the assumption was that options to conditional commands were just whitespace-delimited. 2010-01-05 Thomas Adam * fvwm-convert-2.6.in: * fvwm-convert-2.6.1.in: Minor style cleanups. Tidy up of some of the code. Fix some odd wording in the man page. 2010-01-05 Thomas Adam * fvwm-convert-2.6.in: Convert all function lines where possible. Ensure we run all function lines through __convert_conditionals() and not just functions we're explicitly converting. 2010-01-05 Thomas Adam * fvwm-convert-2.6.in (write_out_file): Don't write out StartFunction if not defined. Don't put a blank template for StartFunction if there isn't one in the config file. 2010-01-03 Thomas Adam * fvwm-convert-2.6.in (check_func_definition): * fvwm-convert-2.6.in (handle_continuation): Handle "+ foo" lines correctly by not culling them. Because of how we collate "+ foo" lines for startfunction, etc., we want to also ensure we keep them around for functions we don't care to explicitly convert over. 2010-01-03 Thomas Adam * fvwm-convert-2.6.in (write_out_file): If no output filename given, put files in CWD. Actually do what the man page says and put processed files in the CWD if no output files are given (implied if -f is used for any Read files.) 2010-01-03 Thomas Adam * fvwm-convert-2.6.in (convert_key_mouse_bindings): Retain white space between Mouse/Key fields. Don't cull any deliberate whitespace between fields if we end up converting some of the options found. 2010-01-02 Thomas Adam * fvwm-convert-2.6.in: Be more strict in file handling when following Read statements. Ensure we don't overwrite any previously defined file when following Read files picked up by using "-f". 2010-01-02 Thomas Adam * fvwm-convert-2.6.in: * fvwm-convert-2.6.1.in: Handle continuation lines. Process those lines ending in a backslash by prepending them to the previous line and just shunting it to a common function. When writing out the file, ensure we preserve the split lines. 2010-01-01 Thomas Adam * fvwm-convert-2.6.in: Use !UsePPosition over NoPPosition when negating style lines.. When converting styles over, use !UsePPosition, and not convert to !PPosition -- which would have happened due to how the negation for style command works for other styles. 2010-01-01 Thomas Adam * fvwm-convert-2.6.in: Retain "Read foo" lines when calling handle_read_file() Ensure we retain this line when spitting out the converted file, otherwise the file from Read will never get processed by FVWM. 2010-01-01 Thomas Adam * fvwm-convert-2.6.in: * fvwm-convert-2.6.1.in: Convert over to use GetOpt::Long and introduce -f and -h. --follow-read|-f : Follow files found via "Read". --help|-h : Print help message. No longer allow fvwm-convert-2.6 to follow Read files automatically -- force this via -f instead. In the case of -f not given, still print out files found on the command line to make the user aware there's additional files that will need processing. 2010-01-01 Thomas Adam * fvwm-convert-2.6.in: Fix command-line parsing, and allow for destination file to be honoured -- stupid logic bug on my part. 2009-03-22 Mikhael Goikhman * Makefile.am: add fvwm version to automatically generated man pages * fvwm-menu-directory.1: * fvwm-menu-headlines.1: * fvwm-menu-xlock.1: * fvwm-perllib.1: regenerated 2009-03-17 Mikhael Goikhman * fvwm-menu-desktop.in: * fvwm-menu-directory.in: * fvwm-menu-headlines.in: * fvwm-menu-xlock.in: * fvwm-perllib.in: convert my old code to use var_name and function_name coding style * Makefile.am: rename target "pod2man" to "regenerate" * fvwm-menu-*.1: regenerated 2009-03-10 Mikhael Goikhman * fvwm-perllib.in: hide "use Gtk;" pseudo-dependency from annoying package builders 2009-03-10 Mikhael Goikhman * fvwm-config.in: fix wrong spacing in the output caused by libXcursor patch * fvwm-menu-headlines.in: switch the default broswer from "netscape" to "firefox", fix parsing of "ꯍ" entities in xml and RootPrompt site 2007-08-07 Dominik Vogt * fvwm-menu-directory.1: * fvwm-config.1.in: * fvwm-convert-2.2.1.in: * fvwm-bug.in: * fvwm-menu-headlines.in: * fvwm-convert-2.4.1.in: * fvwm-root.1.in: * fvwm-menu-xlock.1: * fvwm-convert-2.6.1.in: * fvwm-bug.1.in: * fvwm-perllib.1: * fvwm-perllib.in: * fvwm-menu-headlines.1: * fvwm-menu-directory.in: * fvwm-menu-desktop.1.in: * fvwm-menu-xlock.in: write fvwm in lower case 2007-07-19 Dominik Vogt * Makefile.am (LDADD): fixed building with libXcursor 2007-06-22 Simon Griph * fvwm-config.in: * Makefile.am (LDADD): 2007-01-28 Dominik Vogt * fvwm-convert-2.6.in: * fvwm-convert-2.4.in: * fvwm-config.in: * fvwm-bug.in: added GPL notice * fvwm-root.c: #includes from library path with "..." not <...> 2007-01-28 Simon Griph * Makefile.am (LDADD, INCLUDES): added rsvg_LIBS, rsvg_CFLAGS * fvwm-config.in: * fvwm-root.1.in (DESCRIPTION): * fvwm-root.c (usage): documented new svg support (SetRootWindow): added Frsvg_init() call 2007-01-27 Dominik Vogt * fvwm-root.c: use new library header files 2007-01-26 Viktor Griph * fvwm-root.c (SetRootWindow): use image path in fvwm-root, but prepend pwd to it. * fvwm-root.c (SetRootWindow): don't use image path in fvwm-root 2007-01-15 Viktor Griph * fvwm-config.in: * fvwm-bug.in (datarootdir): * fvwm-perllib.in: use datarootdir 2007-01-14 Viktor Griph * fvwm-root.c (SetRootWindow): use int instead of unsigned int. 2006-12-18 Viktor Griph * Makefile.am (man_MANS, EXTRA_DIST): don't install fvwm-convert-2.2 man page 2006-11-13 Dan Espen * fvwm-menu-directory.in: Use escapeFileName on directory name. Security patch from Tavis Ormandy. 2006-09-19 Viktor Griph * fvwm-root.c (SetRootWindow): silence gcc4 warnings 2006-04-07 Serge Koksharov * fvwm-bug.in: changed fallback editor from `emacs' to `vi' because it much more widespread on non-Linux systems fixed errors (because of incorrect syntax fallback entries were not used) now script honors `TMPDIR' env. variable and if it's not set it fallback to `/tmp' directory when creating temporary file 2006-04-04 Serge Koksharov * ChangeLog: corrected typo 2006-03-02 Serge Koksharov * fvwm-config.1.in: * fvwm-menu-headlines.1: * fvwm-menu-headlines.in: * fvwm-perllib.in: * fvwm-root.1.in: corrected typos 2005-09-21 Mikhael Goikhman * fvwm-perllib.in: enhance "tutorial", add "events" man page 2005-09-19 Olivier Chapuis * fvwm-root.c (main): 64-bit refixes 2005-07-18 Dominik Vogt * fvwm-root.c (main): 64-bit fixes 2005-07-08 Dominik Vogt * fvwm-menu-directory: applied patch by Stephen Dennison to correct a typo 2005-07-04 Dan Espen * fvwm-menu-desktop.1.in: Add option gnome-mandriva. * fvwm-menu-desktop.in (check_app): When checking if executable exists, allow full path. Add new option, gnome-mandriva. 2005-03-17 Dan Espen * fvwm-menu-desktop.1.in: Fix .IP. 2004-08-10 Dominik Vogt * fvwm-root.c: fixed compiling 2004-08-08 Dominik Vogt * fvwm-root.c (SetRootWindow): (main): fail with exit code 1 if image does not exist 2004-06-29 Mikhael Goikhman * fvwm-menu-directory.in: * fvwm-menu-directory.1: new option --func-name 2004-03-19 Dominik Vogt * fvwm-bug.in: script safety patch; see http://securitytracker.com/alerts/2004/Jan/1008781.html 2004-01-01 Mikhael Goikhman * fvwm-menu-directory.in: security fix for file names with eoln 2003-12-16 olicha * fvwm-menu-desktop.in: Tried to found KDE3 icons and mini icons 2003-11-29 Mikhael Goikhman * fvwm-menu-headlines.1: * fvwm-menu-headlines.in: update/fix Kuro5hin, GNOME-News, NewsForge, LinuxApps; support redirection to other host to reduce problems in the future; don't cache with explicit or implicit web proxies; added Schedule hint 2003-09-12 Mikhael Goikhman * fvwm-config.in: added iconv reporting 2003-09-03 Mikhael Goikhman * fvwm-menu-directory.1: * fvwm-menu-directory.in: --title and --command-title now support empty argument (suppress title action or title completely) 2003-07-08 Mikhael Goikhman * fvwm-menu-headlines.1: * fvwm-menu-headlines.in: replace old BBC-World and BBC-SciTech with new BBC headlines 2003-04-18 Mikhael Goikhman * fvwm-config.in: fixed --localedir * fvwm-config.1: updated 2003-03-22 Mikhael Goikhman * fvwm-menu-directory.1: * fvwm-menu-directory.in: * fvwm-menu-headlines.1: * fvwm-menu-headlines.in: * fvwm-menu-xlock.1: * fvwm-menu-xlock.in: make the scripts to be warning safe 2003-03-15 Mikhael Goikhman * fvwm-menu-*.1: regenerated 2003-01-29 Mikhael Goikhman * fvwm-menu-directory.1: * fvwm-menu-directory.in: * fvwm-menu-headlines.1: * fvwm-menu-headlines.in: * fvwm-menu-xlock.1: * fvwm-menu-xlock.in: fixed one problem with pod caused some man page paragraphs to disappear 2003-01-03 olicha * fvwm-config.in: * fvwm-config.1: Removed HAVE_GNOME and HAVE_EWMH 2002-12-19 olicha * fvwm-config.in: MIT Shared Memory Extension 2002-11-29 Mikhael Goikhman * fvwm-menu-desktop.in: * fvwm-menu-desktop.1: --uniconv now uses perl internal convertion if possible (much faster) 2002-11-28 olicha * fvwm-config.1: * fvwm-config.in: localedir and gettext 2002-11-10 Mikhael Goikhman * fvwm-bug.1: * fvwm-bug.in: * fvwm-config.1: * fvwm-config.in: * fvwm-menu-desktop.1: * fvwm-menu-desktop.in: * fvwm-menu-directory.1: * fvwm-menu-directory.in: * fvwm-menu-headlines.1: * fvwm-menu-headlines.in: * fvwm-menu-xlock.1: * fvwm-menu-xlock.in: * fvwm-perllib.1: * fvwm-perllib.in: * fvwm-root.1: * fvwm-root.c: all programs now support --help, -h, -?, --version, -V and some (that supported it in 2.4.x also support -v) 2002-11-09 Dominik Vogt * fvwm-root.c: removed long option names with "-" instead of "--" 2002-11-09 Mikhael Goikhman * Makefile.am (bin_SCRIPTS): * fvwm_make_browse_menu.sh: * fvwm_make_directory_menu.sh: moved from bin to utils again 2002-11-07 Dominik Vogt * Makefile.am (bin_SCRIPTS): install below shell scripts too * fvwm_make_browse_menu.sh: * fvwm_make_directory_menu.sh: moved from utils to bin 2002-11-04 Dominik Vogt * fvwm-root.c (SetRootWindow): fixed compile error 2002-10-31 olicha * fvwm-root.c (SetRootWindow): Updated PImageLoadPixmapFromFile 2002-10-27 Mikhael Goikhman * fvwm-root.c: * fvwm-root.1: switch to --option names in documentation, -option works too; added --no-retain-pixmap and --no-dummy for completeness 2002-10-27 olicha * fvwm-root.c: * fvwm-root.1: added --retain-pixmap; added documentation 2002-10-18 olicha * Makefile.am (bin_SCRIPTS): fvwm-root depends on libfvwm 2002-10-15 Dominik Vogt * fvwm-root.1: applied patch by Cameron Simpson 2002-10-15 olicha * fvwm-root.c (SetRootWindow): Updated PictureInitCMapRoot 2002-10-12 Mikhael Goikhman * fvwm-bug.in: show VERSIONINFO 2002-10-09 Mikhael Goikhman * fvwm-perllib.in: more on tutorial 2002-10-08 olicha * fvwm-root.c (*): ColorLimit Visual fixes 2002-09-17 Mikhael Goikhman * fvwm-perllib.in: progress in writing tutorial 2002-09-14 Mikhael Goikhman * fvwm-perllib.in: some work on documentation 2002-09-06 Mikhael Goikhman * fvwm-config.in: added options --is-final, --is-stable, --release-date 2002-08-11 olicha * fvwm-root.c (main): New options -no-dither, -dither and -no-cl (SetRootWindow): Update the PImageLoadPixmapFromFile args 2002-08-02 Mikhael Goikhman * Makefile.am: DESTDIR fix 2002-08-01 Mikhael Goikhman * fvwm-menu-headlines.in: support http redirections; update BBC headlines to work again 2002-06-20 Mikhael Goikhman * fvwm-root.c: fixed build without xpm; search in built-in image-path first 2002-06-19 Mikhael Goikhman * fvwm-menu-headlines.in: added timeout on initial connection * fvwm-config.in: added png and xft reporting 2002-06-17 Mikhael Goikhman * fvwm-menu-desktop.1: some improvements * fvwm-perllib.1: * fvwm-perllib.in: improved documentation and code 2002-06-15 Mikhael Goikhman * fvwm-menu-headlines.1: * fvwm-menu-headlines.in: added support for CNN, BBC-World, BBC-SciTech headlines; do not show time or/and date fields that can't be guessed instead of showing a fake time/date * fvwm-perllib.1: * fvwm-perllib.in: added a new script for perllib documentation 2002-06-09 Mikhael Goikhman * fvwm-menu-headlines.1: * fvwm-menu-headlines.in: fix for a bad httpd responce, new option --icon-error 2002-06-02 Mikhael Goikhman * fvwm-menu-headlines.1: * fvwm-menu-headlines.in: add timeouts on socket reading (default is 20 seconds) and --timeout; updated NewsForge, LinuxFr; disabled SegFault, AppWatch, JustLinux, FreeKDE as non-functional 2002-05-28 Mikhael Goikhman * fvwm-config.in: removed multibyte reporting 2002-05-09 olicha * fvwm-root.c (SetRootWindow): A fix 2002-04-25 Mikhael Goikhman * *.1: improved main headers and updated for 2.5.1 * fvwm-config.in: report xrender support 2002-04-23 Mikhael Goikhman * fvwm-root.c: minor reformatting and spell checking 2002-04-22 olicha * fvwm-root.c (*): Some renaming. 2002-04-12 Mikhael Goikhman * *: split directory utils/ into 2 directories: bin/ - for programs installed into ${bindir} utils/ - for developer and miscellaneous utilities renamed programs: xpmroot -> fvwm-root fvwmbug -> fvwm-bug fvwmrc_convert -> fvwm-convert-2.2 fvwm24_convert -> fvwm-convert-2.4 added: fvwm-convert-2.6.{in,1} * Makefile.am: setup compatibility symlinks for xpmroot and xpmroot.1 2002-04-05 olicha * Makefile.am: Added -lm to LDADD * fvwm-menu-desktop.in (get_info): Allows png icons in fvwm menu * xpmroot.c (SetRootWindow): (main): * Makefile.am: xpmroot can load xbm and png image file. It is enabled even without xpm support 2002-03-03 Mikhael Goikhman * fvwm-config.in: added --supports-bidi (renamed) and --supports-perllib 2002-03-01 Mikhael Goikhman * configure_dev.sh: s/autolocal/aclocal/; pass arguments to ./configure 2002-03-01 Dominik Vogt * configure_dev.sh: added autolocal 2002-02-21 Mikhael Goikhman * fvwm-config.in: added --supports-fribidi 2002-02-10 Mikhael Goikhman * fvwm-config.in: * fvwm-config.1: added --fvwm-perllibdir 2002-02-07 Mikhael Goikhman * Makefile.am: do not generate fvwmbug (and fvwmbug.sh), it is generated by configure * fvwmbug.in: renamed from fvwmbug.sh.in and minor changes 2002-02-01 Dan Espen * fvwm-menu-xlock.1: * fvwm-menu-headlines.1: * fvwm-menu-directory.1: * fvwm-menu-desktop.1: fvwmrc -> .fvwm2rc 2002-01-30 Mikhael Goikhman * fvwm24_convert.in: * Makefile.am: use the same generation as for other perl scripts * BuildXLockMenu: remove compatibility script 2002-01-21 olicha * xpmroot.c (main): * xpmroot.1: Removed the -np option and uncomment the -fe and -d documentation 2002-01-19 Dan Espen * xpmroot.1: Language check done, options still commented out. 2002-01-19 olicha * xpmroot.c: Some reformating and fixed a miss print 2002-01-18 olicha * xpmroot.1: Remove the documentations of the new xpmroot options as There is something that I do not understand with the "memory of the background of the root window" 2002-01-16 olicha * xpmroot.c (main): New option -np which causes to set _XSETROOT_ID to None and to do not keep the pixmap in memory. New option -d which free the _XSETROOT_ID pixmap and set it to None and which forces xpmroot to do not set the background. New options -fe for freeing the ESETROOT_PMAP_ID pixmap. 2001-11-26 Mikhael Goikhman * fvwm-config.in: make ewmh entry consistent with others 2001-11-15 olicha * fvwm-config.in: Added ewmh 2001-11-10 Dominik Vogt * fvwm24_convert: Print an error message if source file is not writable 2001-10-13 olicha * fvwm-menu-desktop.in: One or two fixes 2001-10-09 Mikhael Goikhman * fvwm-menu-headlines.in: improved support for linuxfr.org, added thinkgeek.com * make_fvwmdist.sh: s/autormake/automake/ 2001-09-05 olicha * fvwm-menu-headlines.in: * fvwm-menu-headlines.1: Added linuxfr.org and fix a man page misprint 2001-08-25 Mikhael Goikhman * fvwm-menu-directory.in: * fvwm-menu-directory.1: fixed several kinds of escaping in menu names, menu items and shell commands 2001-08-15 Mikhael Goikhman * fvwm-config.in: * fvwm-config.1: s/gnome-wm/gnome-hints/ 2001-07-30 Mikhael Goikhman * fvwm-menu-headlines.in: improved xml parsing, added support for newsforge.com, kuro5hin.org, bbspot.com 2001-07-25 Mikhael Goikhman * fvwm-menu-headlines.in: * fvwm-menu-headlines.1: several improvements and enhancements: better comply with HTTP/1.1, so AppWatch does not freeze the script and --buggyproxy is not needed, fixed FreshMeat time format (they changed it), show network errors in the menu with a possibility to reload when network returns instead of dying AND added support for 7 more free software sites 2001-07-22 Mikhael Goikhman * fvwm-config.in: added xinerama and shape support; resorting 2001-07-10 Mikhael Goikhman * fvwm24_convert.in: update $dest2 only after all changes to $dest, not before 2001-07-08 Mikhael Goikhman * fvwm24_convert.in: use a correct form $ENV{'HOME'} not $$HOME * fvwm-config.1: created the man page 2001-06-30 Mikhael Goikhman * make_fvwmdist.sh: changed date format in NEWS file to actually match the one in NEWS 2001-06-23 Dominik Vogt * make_fvwmdist.sh: changed date format in NEWS file 2001-06-23 Mikhael Goikhman * fvwm-menu-directory.1: * fvwm-menu-directory.in: be consistent in code and doc: s/--check-subdir/--check-subdirs/ 2001-06-23 Dominik Vogt * make_fvwmdist.sh: corrected typos update version number in FAQ too 2001-05-06 Mikhael Goikhman * fvwm-config.in: fixed --supports-feature broken in the previous commit 2001-05-04 Mikhael Goikhman * fvwm-config.in: report gdk-imlib support in FvwmGtk, rename gnome support to gnome-wm 2001-04-09 Dan Espen * make_fvwmdist.sh: Figure our user full name. 2001-04-03 Mikhael Goikhman * Makefile.am: don't build and install xselection, there is a more powerful package of the same name 2001-03-24 Mikhael Goikhman * fvwm-menu-desktop.1: * fvwm-menu-desktop.in: rewordings 2001-03-24 Dominik Vogt * fvwm24_convert.1: updated * fvwm24_convert.in: use \s instead of [ \t] removed conversion of placement names, print a message instead print warnings about FvwmConfig and FvwmPipe improved comment detection detect continuation lines fixed typo fixed line continuations do not merge continuation lines if possible 2001-03-23 olicha * fvwm-menu-desktop.in: * fvwm-menu-desktop.1: New option --merge-user-menu for KDE version 2 New options --check-[mini-]icons to fix problems if no icons are found for the styles 2001-03-23 Dominik Vogt * fvwm24_convert.in (line): fixed HilightColor conversion added HilightColorset conversion convert WindowShadeAnimate command 2001-03-22 Dominik Vogt * fvwm24_convert.in (line): enhanced button panel line recognition 2001-03-21 Dan Espen * fvwm24_convert.in: Add detection of old style FvwmButtons panel definitions. 2000-03-20 Mikhael Goikhman * fvwm-config.in: added --fvwm-exe option for potential forward compatibility * fvwm-menu-desktop.1: * fvwm-menu-desktop.in: * fvwm-menu-directory.1: * fvwm-menu-directory.in: * fvwm-menu-xlock.1: * fvwm-menu-xlock.in: be compatible with a new wm-icons-0.3.0 icon list * fvwm-menu-headlines.1: simply regenerated with a new fancy perl-5.6.0 man page format 2001-03-18 Dan Espen * make_fvwmdist.sh: Add instruction to increase release number in FAQ. * fvwm24_convert.in: Changes in GlobalOpts conversions. 2001-03-18 Dominik Vogt * fvwm24_convert.in (line): replace "IconFont" with "Style * IconFont" 2001-03-11 Dominik Vogt * fvwm-menu-headlines.1: * fvwm-menu-directory.1: * fvwm-menu-xlock.in: * fvwm-menu-headlines.in: * fvwm-menu-directory.in: changed some comments so that they don't look like cvs conflict markers 2001-02-26 Dan Espen * make_fvwmdist.sh (VER): Add instructions for NEWS update on stable branch. 2001-02-25 Dan Espen * make_fvwmdist.sh (wrong_dir): Use portable way of redirecting the grep output. 2001-01-27 Dominik Vogt * make_fvwmdist.sh (wrong_dir): fixed logic partially rewritten for portability reasons new options -R: skip to next release series number after building -M: skip to next major release number after building -w: disable -Werror in compiler flags -a, -b, -s: build an alpha/beta/stable release 2001-01-26 Dominik Vogt * make_fvwmdist.sh (wrong_dir): portability fixes 2000-01-24 Mikhael Goikhman fvwm-config.in: show gnomelibs and multibyte support in summary and options 2000-01-21 Mikhael Goikhman * fvwm-menu-desktop.{in,1}: * fvwm-menu-directory.{in,1}: rewordings 2000-01-20 olicha * fvwm-menu-desktop.in: * fvwm-menu-desktop.1: New option --menu-style and fix check for perl >= 5.6 (the value of $] is 5.006). * fvwm-menu-directory.in: * fvwm-menu-directory.1: New option --menu-style 2000-01-01 Mikhael Goikhman * fvwm-menu-desktop.in: fixed execution on older perl < 5.6 2000-12-12 olicha * fvwm-menu-desktop.in: * fvwm-menu-desktop.1: New option --uniconv and --uniconv-exec for UTF8 encoding 2000-12-09 olicha * fvwm-menu-desktop.in: * fvwm-menu-desktop.1: New option --utf8 for UTF8 encoding (in KDE2) 2000-12-05 Dominik Vogt * make_fvwmdist.sh: added environment variable to allow bringing up the network programmatically documentation in file 2000-11-23 Dominik Vogt * make_fvwmdist.sh: make distcheck2 2000-11-19 Mikhael Goikhman * Makefile.am: fixed 'make distcheck' by adding $(top_srcdir)/utils/ path 2000-11-17 Dominik Vogt * rebuild_dev.sh: added script that reconfigures and rebuilds fvwm * configure_dev.sh: script that calls automake, autoconf and configure * build_dev.sh: script that rebuilds fvwm with -Wall and -Werror 2000-11-13 Mikhael Goikhman * Makefile.am: replaced unportable $< 2000-11-10 Mikhael Goikhman * make_fvwmdist.sh: small fix in cvs log message, now also auto-updating the NEWS file 2000-11-02 Dan Espen * fvwm24_convert.1: * fvwm24_convert.in: Convert GlobalOpts to Style commands or BugOpts as needed. 2000-10-11 Dan Espen * fvwm24_convert.1: * fvwm24_convert.in: Convert to perl, print warning on read commands, do caseless matching on commands. 2000-10-09 Mikhael Goikhman * fvwm-menu-directory.{in,1}: * fvwm-menu-headlines.{in,1}: added --command options, which enhance --exec ones; use ~/.fvwm ($FVWM_USERDIR) for state files/dirs, not $HOME 2000-10-08 Dominik Vogt * xpmroot.c (SetRootWindow): honour return code of XGetWindowAttributes() 2000-10-04 Mikhael Goikhman * utils/fvwm-menu-desktop.in: use a non-conflicting module syntax; be more tolerant to read permission problems; validate an alias parameter 2000-09-28 Dan Espen * fvwm24_convert.in: Handle space in HighlightColor. Leave commented out ModulePath and ColorLimit commands. * fvwm24_convert.1: document more limitations/features. 2000-09-26 Dan Espen * fvwm24_convert.1: new man page. * Makefile.am (man_MANS): add fvwm24_convert.1 man page. 2000-09-25 Mikhael Goikhman * Makefile.am (EXTRA_DIST): s/fvwm24_convert/fvwm24_convert.in/ 2000-09-24 Dan Espen * Makefile.am (fvwm24_convert): Rules to build fvwm24_convert. * fvwm24_convert.in: Works for me. Docs next. 2000-09-18 Dan Espen * fvwm24_convert.in: preliminary version. Not done yet. 2000-08-19 Mikhael Goikhman * utils/fvwm-menu-desktop.1: * utils/fvwm-menu-desktop.in: be more quiet; rename --fvwm-gtk-name to --fvwmgtk-alias 2000-05-14 Mikhael Goikhman * make_fvwmdist.sh: s/$VRELEASE_$VMAJOR_VMINOR/${VRELEASE}_${VMAJOR}_$VMINOR/ 2000-05-04 Mikhael Goikhman * Makefile.am, fvwmbun.sh.in: fixed minor info bug, small rearrangings * fvwm-config.in: added gnome support query 2000-04-26 Mikhael Goikhman * fvwm-config.in, fvwmbug.sh.in: Changes in defaults of FVWM_DATADIR & FVWM_USERDIR; renamings and rewordings. 2000-04-12 Mikhael Goikhman * fvwm-config.in: added --supports, --supports- options, some enhancements. 2000-04-06 Mikhael Goikhman * fvwm-config.in: a new fvwm script, to be used for querying fvwm instalation 2000-02-25 Dominik Vogt * make_fvwmdist.sh (VERSION_STRING): improved release building script 2000-02-05 Mikhael Goikhman * fvwm-menu-*.{in,1}: some clean up in code and man; ~ in file names is now mostly expanded; added --wm-icons; changed to work with Redhat 5.1 perl * fvwm-menu-xlock.in: actually renamed --format to the previously documented --item, --item format now can contain width specifiers like in other scripts; renamed --icon to --icon-item, added --icon-title; * fvwm-menu-directory.in: actually renamed --format to the previously documented --item; changed data file name used in --reuse to .fvwm-menu-directory.dir * fvwm-menu-headlines.in: timezones of sites are now taken in account, still daylight saving time is evaluated approximately for dumb sites dumping local time for own zone without specifying it instead of GMC; support for AppWatch site, support for user defined sites; added --info, --icon-title, --icon-item, --icon-home. * fvwm-menu-desktop.{in,1}: change --i-know-what-i-do (flag) to --time-limit (integer) 2000-01-02 Dominik Vogt * fvwmrc_convert: use new styles Font, IconFont, Hilight... 2000-01-01 Dominik Vogt * fvwmrc_convert: updated for WindowFont and HilightColor(set) 1999-12-17 Mikhael Goikhman * fvwm-menu-headlines.in: * fvwm-menu-headlines.1: A new configurable script to show popular web site headlines in fvwm menus. Currently supported FreshMeat, LinuxToday, SlashDot, Segfault. * fvwm-menu-directory.in: --special-dirs gets an argument now * fvwm-menu-{directory,xlock}: --format renamed to --item * Makefile.am: added fvwm-menu-headlines; fvwm-menu scripts now are installed 1999-11-27 Dominik Vogt * make_fvwmdist.sh: new script to help building the distribution 1999-11-24 Dan Espen * fvwm-menu-desktop.1: Removed 8 bit character that was causing Solaris nroff to core out. Did a little proofreading. 1999-11-17 Mikhael Goikhman * Makefile.am: removed FORCE from fvwmbug, added fvwmbug to CLEANFILES; fvwm-menu-{xlock,directory}.1 are not autogenerated now, because of 'cvs update' timestamp bug; use: make _fvwm-menu-xlock.1 1999-11-15 Dominik Vogt * fvwm-menu-directory.in: * fvwm-menu-desktop.in: * fvwmrc_convert.1: * fvwm-menu-directory.1: * fvwm-menu-desktop.1: ispell session 1999-11-05 Dominik Vogt * fvwm_make_browse_menu.sh: applied fix by Brad Giaccio 1999-10-30 Mikhael Goikhman migo@homemail.com * fvwm-menu-directory.in: --reuse option works again 1999-09-23 Paul D. Smith * Makefile.am (LDADD): Move the $(X_LIBS) reference earlier in all LDADD variables, before (for example) the $(xpm_LIBS) reference; sometimes the latter doesn't contain its own -L options, and uses X's. 1999-09-05 Mikhael Goikhman * fvwmrc_convert: Replaced several occurrences of InitFunction and/or RestartFunction with StartFunction. 1999-09-04 Mikhael Goikhman * Makefile.am: removed use of $< on explicit rule; more code to satisfy both pod2man and 'make -j' * fvwm-menu-directory.in: removed @VERSION@ from the man page part 1999-08-23 Mikhael Goikhman * fvwm-menu-directory.in: new option --format to put the file size, date, type, full name etc. into the menu label; the option --title is extended (new default is "*-40p" now). * fvwm-menu-xlock.in: new options --format and --special-first; special and non-special modes are now separated * fvwm_make_browse_menu.sh: improved the simulation command line 1999-08-17 Mikhael Goikhman * BuildXLockMenu: created the compatibility wrapper to fvwm-menu-xlock * fvwm_make_browse_menu.sh: * fvwm_make_directory_menu.sh: restored (used by fvwm2.1) with a pointer to fvwm-menu-directory * fvwm-menu-xlock.in: * fvwm-menu-directory.in: * fvwm-menu-desktop.in: * fvwm-menu-desktop.1: some small documentation fixes, added some useful xlock options 1999-08-17 Dominik Vogt * fvwm-menu-xlock.in: * fvwm-menu-directory.in: use FVWM instead of F{ine,antastic,eline} VWM 1999-08-16 Dominik Vogt * fvwm-menu-xlock.1: * fvwm-menu-directory.1: * fvwm-menu-desktop.1: use FVWM instead of F{ine,antastic,eline} VWM 1999-08-16 Mikhael Goikhman * ChangeLog: * fvwm-menu-xlock.in: * fvwm-menu-xlock.1: * fvwm-menu-directory.in: * fvwm-menu-directory.1: * fvwm-menu-desktop.in: * fvwm-menu-desktop.1: New files added. fvwm-menu perl scripts can be used to auto build fvwm menus. All scripts are very configurable, see --help and man pages. * BuildXLockMenu.in: * BuildXLockMenu.1: * fvwm_make_browse_menu.sh: * fvwm_make_directory_menu.sh: Removed in favor of new more configurable scripts. fvwm-2.6.5.orig/bin/fvwm-root.c0000644000175000017500000001675510557141600014513 0ustar vwcvwc/* -*-c-*- */ /* * This is an all new program to set the root window to an Xpm pixmap. * Copyright 1993, Rob Nation * You may use this file for anything you want, as long as the copyright * is kept intact. No guarantees of any sort are made in any way regarding * this program or anything related to it. */ #include "config.h" #include #include #include #include #include "libs/fvwmlib.h" #include "libs/Picture.h" #include "libs/Graphics.h" #include "libs/Fsvg.h" int save_colors = 0; Display *dpy; int screen; Window root; char *display_name = NULL; Pixmap rootImage = None; Bool NoDither = False; Bool Dither = False; Bool NoColorLimit = False; int opt_color_limit = -1; Bool use_our_color_limit = False; void usage(int verbose) { FILE *output = verbose ? stdout : stderr; fprintf( output, "fvwm-root version %s with support for: XBM" #ifdef XPM ", XPM" #endif #ifdef HAVE_PNG ", PNG" #endif #ifdef HAVE_RSVG ", SVG" #endif "\n", VERSION); fprintf(output, "\nUsage: fvwm-root [ options ] file\n"); if (verbose) { fprintf(output, "Options:\n" "\t--dither\n" "\t--no-dither\n" "\t--retain-pixmap\n" "\t--no-retain-pixmap\n" "\t--color-limit l\n" "\t--no-color-limit\n" "\t--dummy\n" "\t--no-dummy\n" "\t--help\n" "\t--version\n"); } } int SetRootWindow(char *tline) { Pixmap shapeMask = None, temp_pix = None, alpha = None; int w, h; int depth; int nalloc_pixels = 0; Pixel *alloc_pixels = NULL; char *file_path; FvwmPictureAttributes fpa; if (use_our_color_limit) { PictureColorLimitOption colorLimitop = {-1, -1, -1, -1, -1}; colorLimitop.color_limit = opt_color_limit; PictureInitCMapRoot( dpy, !NoColorLimit, &colorLimitop, True, True); } else { /* this use the default visual (not the fvwm one) as * getenv("FVWM_VISUALID") is NULL in any case. But this use * the same color limit than fvwm. * This is "broken" when fvwm use depth <= 8 and a private * color map (i.e., fvwm is started with the -visual{ID} * option), because when fvwm use a private color map the * default color limit is 244. There is no way to know here if * getenv("FVWM_VISUALID") !=NULL. * So, in this unfortunate case the user should use the * --color-limit option */ PictureInitCMap(dpy); } Frsvg_init(); /* try built-in image path first, but not before pwd */ PictureSetImagePath(".:+"); file_path = PictureFindImageFile(tline, NULL, R_OK); if (file_path == NULL) { file_path = tline; } fpa.mask = FPAM_NO_ALLOC_PIXELS | FPAM_NO_ALPHA; if (Pdepth <= 8 && !NoDither) { fpa.mask |= FPAM_DITHER; } else if (Pdepth <= 16 && Dither) { fpa.mask |= FPAM_DITHER; } if (NoColorLimit) { fpa.mask |= FPAM_NO_COLOR_LIMIT; } if (!PImageLoadPixmapFromFile( dpy, root, file_path, &temp_pix, &shapeMask, &alpha, &w, &h, &depth, &nalloc_pixels, &alloc_pixels, 0, fpa)) { fprintf( stderr, "[fvwm-root] failed to load image file '%s'\n", tline); return -1; } if (depth == Pdepth) { rootImage = temp_pix; } else { XGCValues gcv; GC gc; gcv.background= WhitePixel(dpy, screen); gcv.foreground= BlackPixel(dpy, screen); gc = fvwmlib_XCreateGC( dpy, root, GCForeground | GCBackground, &gcv); rootImage = XCreatePixmap(dpy, root, w, h, Pdepth); XCopyPlane(dpy, temp_pix, rootImage, gc, 0, 0, w, h, 0, 0, 1); XFreePixmap(dpy, temp_pix); XFreeGC(dpy, gc); } XSetWindowBackgroundPixmap(dpy, root, rootImage); save_colors = 1; XClearWindow(dpy, root); return 0; } int main(int argc, char **argv) { Atom prop = None; Atom e_prop = None; Atom m_prop = None; Atom type; int format; unsigned long length, after; unsigned char *data; int i = 1; Bool e_killed = False; Bool Dummy = False; Bool RetainPixmap = False; if (argc < 2) { usage(0); fprintf(stderr, "Nothing to do, try again.\n"); exit(1); } dpy = XOpenDisplay(display_name); if (!dpy) { fprintf( stderr, "fvwm-root: unable to open display '%s'\n", XDisplayName (display_name)); exit(2); } screen = DefaultScreen(dpy); root = RootWindow(dpy, screen); for (i = 1; i < argc - 1; i++) { if ( strcasecmp(argv[i], "-r") == 0 || strcasecmp(argv[i], "--retain-pixmap") == 0) { RetainPixmap = True; } else if ( strcasecmp(argv[i], "--no-retain-pixmap") == 0) { RetainPixmap = False; } else if ( strcasecmp(argv[i], "-d") == 0 || strcasecmp(argv[i], "--dummy") == 0) { Dummy = True; } else if ( strcasecmp(argv[i], "--no-dummy") == 0) { Dummy = False; } else if ( strcasecmp(argv[i], "--dither") == 0) { Dither = True; } else if ( strcasecmp(argv[i], "--no-dither") == 0) { NoDither = True; } else if ( strcasecmp(argv[i], "--color-limit") == 0) { use_our_color_limit = True; if (i+1 < argc) { i++; opt_color_limit = atoi(argv[i]); } } else if ( strcasecmp(argv[i], "--no-color-limit") == 0) { NoColorLimit = True; } else if ( strcasecmp(argv[i], "-h") == 0 || strcasecmp(argv[i], "-?") == 0 || strcasecmp(argv[i], "--help") == 0) { usage(1); exit(0); } else if ( strcasecmp(argv[i], "-V") == 0 || strcasecmp(argv[i], "--version") == 0) { fprintf(stdout, "%s\n", VERSION); exit(0); } else { fprintf( stderr, "fvwm-root: unknown option '%s'\n", argv[i]); fprintf( stderr, "Run '%s --help' to get the usage.\n", argv[0]); exit(1); } } if ( Dummy || strcasecmp(argv[argc-1], "-d") == 0 || strcasecmp(argv[argc-1], "--dummy") == 0) { Dummy = True; } else if ( strcasecmp(argv[argc-1], "-h") == 0 || strcasecmp(argv[argc-1], "-?") == 0 || strcasecmp(argv[argc-1], "--help") == 0) { usage(1); exit(0); } else if ( strcasecmp(argv[argc-1], "-V") == 0 || strcasecmp(argv[argc-1], "--version") == 0) { fprintf(stdout, "%s\n", VERSION); exit(0); } else { int rc; rc = SetRootWindow(argv[argc-1]); if (rc == -1) { exit(1); } } prop = XInternAtom(dpy, "_XSETROOT_ID", False); (void)XGetWindowProperty( dpy, root, prop, 0L, 1L, True, AnyPropertyType, &type, &format, &length, &after, &data); if (type == XA_PIXMAP && format == 32 && length == 1 && after == 0 && data != NULL && (Pixmap)(*(long *)data) != None) { XKillClient(dpy, *((Pixmap *)data)); } if (data != NULL) XFree(data); e_prop = XInternAtom(dpy, "ESETROOT_PMAP_ID", False); (void)XGetWindowProperty( dpy, root, e_prop, 0L, 1L, True, AnyPropertyType, &type, &format, &length, &after, &data); if (type == XA_PIXMAP && format == 32 && length == 1 && after == 0 && data != NULL && (Pixmap)(*(long *)data) != None) { e_killed = True; XKillClient(dpy, *((Pixmap *)data)); } if (e_killed && !Dummy) { m_prop = XInternAtom(dpy, "_XROOTPMAP_ID", False); XDeleteProperty(dpy, root, m_prop); } if (RetainPixmap && !Dummy) { long prop; prop = rootImage; if (data != NULL) XFree(data); XSetCloseDownMode(dpy, RetainPermanent); if (e_prop == None) e_prop = XInternAtom(dpy, "ESETROOT_PMAP_ID", False); if (m_prop == None) m_prop = XInternAtom(dpy, "_XROOTPMAP_ID", False); XChangeProperty( dpy, root, e_prop, XA_PIXMAP, 32, PropModeReplace, (unsigned char *) &prop, 1); XChangeProperty( dpy, root, m_prop, XA_PIXMAP, 32, PropModeReplace, (unsigned char *) &prop, 1); } else { long dp = (long)None; if (prop == None) prop = XInternAtom(dpy, "_XSETROOT_ID", False); XChangeProperty( dpy, root, prop, XA_PIXMAP, 32, PropModeReplace, (unsigned char *) &dp, 1); } XCloseDisplay(dpy); return 0; } fvwm-2.6.5.orig/bin/Makefile.am0000644000175000017500000000520011161434720014422 0ustar vwcvwc## Process this file with automake to create Makefile.in bin_PROGRAMS = fvwm-root fvwm_root_SOURCE= fvwm-root.c fvwm_root_DEPENDENCIES = $(top_builddir)/libs/libfvwm.a bin_SCRIPTS = \ fvwm-config fvwm-bug fvwm-perllib \ fvwm-convert-2.4 fvwm-convert-2.6 \ fvwm-menu-xlock fvwm-menu-directory \ fvwm-menu-desktop fvwm-menu-headlines man_MANS = \ fvwm-root.1 fvwm-config.1 fvwm-bug.1 fvwm-perllib.1 \ fvwm-convert-2.4.1 fvwm-convert-2.6.1 \ fvwm-menu-xlock.1 fvwm-menu-directory.1 \ fvwm-menu-desktop.1 fvwm-menu-headlines.1 EXTRA_DIST = fvwm-convert-2.2 fvwm-convert-2.2.1 $(man_MANS) LDADD = -L$(top_builddir)/libs $(X_LIBS) -lfvwm $(xpm_LIBS) $(Xcursor_LIBS) \ $(X_PRE_LIBS) -lXext -lX11 -lm $(X_EXTRA_LIBS) $(Xrender_LIBS) \ $(Xcursor_LIBS) $(png_LIBS) $(rsvg_LIBS) INCLUDES = -I$(top_srcdir) $(xpm_CFLAGS) $(X_CFLAGS) $(png_CFLAGS) \ $(rsvg_CFLAGS) ## The long generation for *.1 is to make both pod2man and 'make -j' happy. _fvwm-menu-xlock.1: fvwm-menu-xlock @TMP=tmp-$$$$ NAME=fvwm-menu-xlock && (\ mkdir $$TMP && \ cp $$NAME.in $$TMP/$$NAME && \ pod2man --center "Fvwm Utilities" --release "@VERSION@@VERSIONINFO@" \ --name $$NAME $$TMP/$$NAME >$$TMP/$$NAME.1 && \ mv $$TMP/$$NAME.1 .; \ rm -rf $$TMP) _fvwm-menu-directory.1: fvwm-menu-directory @TMP=tmp-$$$$ NAME=fvwm-menu-directory && (\ mkdir $$TMP && \ cp $$NAME.in $$TMP/$$NAME && \ pod2man --center "Fvwm Utilities" --release "@VERSION@@VERSIONINFO@" \ --name $$NAME $$TMP/$$NAME >$$TMP/$$NAME.1 && \ mv $$TMP/$$NAME.1 .; \ rm -rf $$TMP) _fvwm-menu-headlines.1: fvwm-menu-headlines @TMP=tmp-$$$$ NAME=fvwm-menu-headlines && (\ mkdir $$TMP && \ cp $$NAME.in $$TMP/$$NAME && \ pod2man --center "Fvwm Utilities" --release "@VERSION@@VERSIONINFO@" \ --name $$NAME $$TMP/$$NAME >$$TMP/$$NAME.1 && \ mv $$TMP/$$NAME.1 .; \ rm -rf $$TMP) _fvwm-perllib.1: fvwm-perllib @TMP=tmp-$$$$ NAME=fvwm-perllib && (\ mkdir $$TMP && \ cp $$NAME.in $$TMP/$$NAME && \ pod2man --center "Fvwm Utilities" --release "@VERSION@@VERSIONINFO@" \ --name $$NAME $$TMP/$$NAME >$$TMP/$$NAME.1 && \ mv $$TMP/$$NAME.1 .; \ rm -rf $$TMP) regenerate: \ _fvwm-menu-xlock.1 _fvwm-menu-directory.1 _fvwm-menu-headlines.1 \ _fvwm-perllib.1 ## Create compatibility symlinks if available install-exec-local: @rm -f $(DESTDIR)$(bindir)/xpmroot @$(LN_S) fvwm-root $(DESTDIR)$(bindir)/xpmroot || \ echo "Minor warning: $(bindir)/xpmroot symlink was not created" install-data-local: @rm -f $(DESTDIR)$(mandir)/man1/xpmroot.1 @$(LN_S) fvwm-root.1 $(DESTDIR)$(mandir)/man1/xpmroot.1 || \ echo "Minor warning: $(mandir)/man1/xpmroot.1 symlink was not created" CLEANFILES = $(bin_SCRIPTS) $(bin_PROGRAMS) fvwm-2.6.5.orig/bin/fvwm-convert-2.20000755000175000017500000004103207455643143015267 0ustar vwcvwc#!/bin/sh # Some time ago, Martin Kraemer posted an # incomplete script to convert fvwm-1 'rc' files to fvwm-2. I've just # recently fixed and enhanced that script; it's complete (or nearly # so) now. This should help if you choose to convert. # # I've also made a couple of other minor changes to make life easier # for our users here: I changed the default initialization from "Read # .fvwmrc" to "Read .fvwm2rc" (in fvwm/fvwmc), and I installed fvwm 2 # as "fvwm2". With these changes, users can easily convert at their # leisure. # # Herewith the script. It's using GNU awk (gawk), but will run with # any "new" awk (nawk on Suns (SunOS 4, Solaris), awk on most other # systems). If you do not use gawk, it will be case-sensitive (the # case of the fvwm commands must match those in the script # exactly). With gawk, it'll be case-insensitive. # It's not perfect: some old commands slip through, especially in the # context of Mouse and Key commands. But it provides a good basis on # which to go further. # # Convert fvwm 1.x configuration file to 2.2 configuration file # # Originally written by Martin Kraemer # Corrected, extended, and modified by Grant McDorman # 24 May 95 # Additional corrections and extensions by Bill Oswald # 8 Mar 96 thru 18 Jul 96 # Minor corrections to make it easier to customize by Charles Hines 08/01/96 # Further minor corrections by Julian Gilbey based on those # of Austin Donnelly , 1 Mar 1999 # Further major corrections by Julian Gilbey , 3 Mar 1999 # and minor corrections March - May 1999. # Correct some major gaffs: Julian Gilbey, January 2000, with thanks to # Victor Meghesan echo "fvwmrc-to-fvwm2rc" >&2 # gawk has IGNORECASE, so we use it if possible. if [ -n `command -v gawk 2>/dev/null` ] then AWK=`command -v gawk` elif [ -x /usr/bin/gawk ] then AWK=/usr/bin/gawk elif [ -n `command -v awk 2>/dev/null` ] then AWK=`command -v awk` elif [ -x /usr/bin/awk ] then AWK=/usr/bin/awk fi if [ ! -x $AWK ];then echo "Can't find any awk, cannot run!" >&2 exit 1 fi source=${1:-$HOME/.fvwmrc} if [ ! -r $source ] ; then echo "Can't find source file $source, giving up" >&2 exit 1 fi dest=${2:-$HOME/.fvwm2rc} if [ "$dest" != "-" ] ;then echo "Output to $dest" >&2 if [ -f $dest ] ; then echo "Saving existing $dest as $dest.bak" >&2 cp -p $dest $dest.bak || { echo "Couldn't save; aborting" >&2; exit 1; } else cp -p $source $dest 2>/dev/null # try to preserve permissions fi exec >$dest || { echo "Couldn't write to $dest, aborting" >&2; exit 1; } TTY=`tty` if [ ! -w "$TTY" ] ;then TTY=/dev/stderr fi else TTY=/dev/stderr fi if [ ! -w "$TTY" ] ;then TTY=/dev/null fi cat $source | $AWK ' BEGIN { printf ("# Trying to compile an old .fvwrc to the new fvwm-2.xx Format\n"); TRUE=1; FALSE=0; IGNORECASE=TRUE; hiforecolor=""; dflt["hiforecolor"] = "black"; hibackcolor=""; dflt["hibackcolor"] = "CadetBlue"; hilightcolor = FALSE; stdforecolor=""; dflt["stdforecolor"] = "black"; stdbackcolor=""; dflt["stdbackcolor"] = "grey70"; inpopup=FALSE; infunction=FALSE; prefix=""; placement = FALSE; dflt["placement"] = "ActivePlacement, DumbPlacement" } /^[ \t]*#/ { # Comment, pass it thru print $0; next; } /^[ \t]*$/ { # Empty line, pass it thru print $0; next; } ################ Rename common items ############## /Restart/ && /fvwm/ { gsub("fvwm", "fvwm2"); gsub("fvwm22","fvwm2"); # try to leave paths alone } /GoodStuff/ { gsub("GoodStuff", "FvwmButtons"); } ############ Chop off trailing "&" from Exec commands ########## /^Exec[ \t]+/ || /[ \t]+Exec[ \t]+/ { gsub ("\&[ \t]*$",""); } ################ Highlight Colors ############## /^[ \t]*HiBackColor[ \t]*/ { dflt["hibackcolor"]=hibackcolor=$2; printf ("#!%s (new command=HilightColor)\n", $0); if (hibackcolor != "" && hiforecolor != "" && !hilightcolor) { printf ("\n#Set the foreground and background color for selected windows\n"); printf ("HilightColor %s %s\n", hiforecolor, hibackcolor); hilightcolor=TRUE; } else hilightcolor=FALSE; next; } /^[ \t]*HiForeColor[ \t]*/ { dflt["hiforecolor"]=hiforecolor=$2; printf ("#!%s (new command=HilightColor)\n", $0); if (hibackcolor != "" && hiforecolor != "" && !hilightcolor) { printf ("\n#Set the foreground and background color for selected windows\n"); printf ("HilightColor %s %s\n", hiforecolor, hibackcolor); hilightcolor=TRUE; } else hilightcolor=FALSE; next; } ########## Menu Colors, Style and Font ########### /^[ \t]*MenuForeColor[ \t]*/ { printf ("#!%s\n", $0); printf ("MenuStyle * Foreground %s\n", $2); next; } /^[ \t]*MenuBackColor[ \t]*/ { printf ("#!%s\n", $0); printf ("MenuStyle * Background %s\n", $2); next; } /^[ \t]*MenuStippleColor[ \t]*/ { printf ("#!%s\n", $0); printf ("MenuStyle * Greyed %s\n", $2); next; } /^[ \t]*MWMMenus[ \t]*/ { printf ("#!%s\n", $0); printf ("MenuStyle * mwm\n"); next; } /^[ \t]*Font[ \t]*/ { printf ("#!%s\n", $0); printf ("MenuStyle * Font %s\n", $2); next; } # Translate both old ButtonStyle formats to the new format: /^[ \t]*ButtonStyle[ \t]*/ { if ($2 == ":") { # new style already if (NF != $4+4) print "ERROR: ButtonStyle command incorrect\n" NR ": " $0 >"'$TTY'"; printf ("%s %d %d", $1, $3, $4); for (i=5; i<=NF; ++i) printf (" %s", $i); printf ("\n"); } else { print "Note: Conversion of old ButtonStyle; values rounded" \ >"'$TTY'" printf ("#! Old line was: %s\n", $0); p=index ($3,"x"); x=substr($3,1,p-1)/2; y=substr($3,p+1)/2; printf ("%s %s 5 %dx%d@0 %dx%d@0 %dx%d@0 %dx%d@1 %dx%d@1\n", $1, $2, 50-x,50+y, 50+x,50+y, 50+x,50-y, 50-x,50-y, 50-x,50+y); } next; } ########## Standard Colors ########### /^[ \t]*StdForeColor[ \t]*/ { dflt["stdforecolor"]=stdforecolor=$2; printf ("#!%s (new command=Style \"*\" Color f/b)\n", $0); print "Style \"*\" ForeColor " $2; next; } /^[ \t]*StdBackColor[ \t]*/ { dflt["stdbackcolor"]=stdbackcolor=$2; printf ("#!%s (new command=Style \"*\" Color f/b)\n", $0); print "Style \"*\" BackColor " $2; next; } ########## Icon Related Stuff ########## /^[ \t]*IconBox[ \t]*/ { print "Style \"*\" " $0; next; } /^[ \t]*IconFont[ \t]*/ { print $0; next; } /^[ \t]*SuppressIcons[ \t]*/ { print "Style \"*\" NoIcon"; next; } /^[ \t]*StickyIcons[ \t]*/ { print "Style \"*\" StickyIcon"; next; } /^[ \t]*ModulePath[ \t]*/ { print "#! (ModulePath command commented out)\n#" $0; next; } /^[ \t]*PixmapPath[ \t]*/ { print $0; next; } /^[ \t]*IconPath[ \t]*/ { print $0; next; } # note: Icon must be followed by some white space /^[ \t]*Icon[ \t]+/ { printf "Style %s Icon %s\n", $2, $3; next; } ########## MWM hints ########## /^[ \t]*MWMFunctionHints[ \t]*/ { printf ("Style \"*\" MWMFunctions\n"); next; } /^[ \t]*MWMDecor[ \t]*/ { printf ("Style \"*\" MWMDecor\n"); next; } /^[ \t]*MWMDecorHints[ \t]*/ { printf ("Style \"*\" MWMDecor\n"); next; } /^[ \t]*MWMBorders[ \t]*/ { printf ("Style \"*\" MWMBorder\n"); next; } /^[ \t]*MWMButtons[ \t]*/ { printf ("Style \"*\" MWMButtons\n"); next; } /^[ \t]*MWMHintOverride[ \t]*/ { printf ("Style \"*\" HintOverride\n"); next; } ########## Placement & Focus styles ########## /^[ \t]*RandomPlacement[ \t]*/ { print "Style \"*\" " $0; placement = TRUE; next; } /^[ \t]*SmartPlacement[ \t]*/ { print "Style \"*\" " $0; placement = TRUE; next; } /^[ \t]*Sticky(Back|Fore)Color[ \t]*/ { print "#! " $0 " (not supported in FVWM2)"; next; } /^[ \t]*Sticky[ \t]+/ { printf "Style \"%s\" Sticky\n", $2; next; } /^[ \t]*NoPPosition[ \t]*/ { print "Style \"*\" " $0; next; } /^[ \t]*ClickToFocus[ \t]*/ { print "Style \"*\" " $0; next; } /^[ \t]*SloppyFocus[ \t]*/ { print "Style \"*\" " $0; next; } /^[ \t]*StaysOnTop[ \t]*/ { printf "Style \"%s\" StaysOnTop\n", $2; next; } /^[ \t]*AutoRaise[ \t]*/ { print "#! " $0 " (use Module FvwmAuto)"; print "AddToFunc \"InitFunction\" \"I\" Module FvwmAuto " $2; print "AddToFunc \"RestartFunction\" \"I\" Module FvwmAuto " $2; next; } ########## Decoration styles ########## /^[ \t]*BorderWidth[ \t]*/ { print "Style \"*\" " $0; next; } /^[ \t]*HandleWidth[ \t]*/ { print "Style \"*\" " $0; next; } /^[ \t]*DecorateTransients[ \t]*/ { print "Style \"*\" DecorateTransient"; next; } /^[ \t]*XORvalue[ \t]*/ { print $0; next; } /^[ \t]*BoundaryWidth[ \t]*/ { printf "Style \"*\" HandleWidth %s\n", $2; next; } /^[ \t]*NoBoundaryWidth[ \t]*/ { print "Style \"*\" BorderWidth " $2; next; } /^[ \t]*NoTitle[ \t]*/ { print "Style \"*\" " $0; next; } /^[ \t]*NoBorder[ \t]*/ { print "Style \"*\" " $0; next; } ########## Etc ########## /^[ \t]*Lenience[ \t]*/ { print "Style \"*\" " $0; next; } /^[ \t]*Style[ \t]*/ { print $0; next; } # Key keyname context mods (Exec|Module|Restart) ... # used to be followed by a "name"; it is no longer /^[ \t]*Key[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+(Exec|Module|Restart)[ \t]+\"/ { # not going to handle escaped quotes label=$6; first=7; quoted=substr(label, 1, 1)=="\"" && substr(label, length(label), 1)!="\""; for (i=7;i<=NF && quoted;i++) { label=$i; quoted=substr(label, length(label), 1)!="\""; first=i + 1; } printf ("%s %s %s %s %s", $1, $2, $3, $4, $5); for (i=first; i<=NF; ++i) printf (" %s", $i); printf ("\n"); next; } # Any other Key command /^[ \t]*Key[ \t]*/ { print $0; next; } # Similarly with Mouse commands /^[ \t]*Mouse[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+[^ \t]+[ \t]+(Exec|Module|Restart)[ \t]+\"/ { # not going to handle escaped quotes label=$6; first=7; quoted=substr(label, 1, 1)=="\"" && substr(label, length(label), 1)!="\""; for (i=7;i<=NF && quoted;i++) { label=$i; quoted=substr(label, length(label), 1)!="\""; first=i + 1; } printf ("%s %s %s %s %s", $1, $2, $3, $4, $5); for (i=first; i<=NF; ++i) printf (" %s", $i); printf ("\n"); next; } /^[ \t]*Mouse[ \t]*/ { print $0; next; } # This is probably not necessary # /^[ \t]*Mouse[ \t]*/ { # if (sub("[ \t]Pop[uU]p[ \t]", " Menu ")) { # if (!warn["Mouse"]) { # print "Note: Setting mouse bindings to sticky menus">"'$TTY'"; # warn["Mouse"] = TRUE; # } # sub("$", " Nop"); # } # print $0; next; # } /^[ \t]*WindowListSkip[ \t]*/ { printf "Style %s WindowListSkip\n", $2; next; } /^[ \t]*WindowFont[ \t]*/ { print $0; next; } /^[ \t]*ClickTime[ \t]*/ { print $0; next; } /^[ \t]*OpaqueMove[ \t]*/ { print "OpaqueMoveSize " $2; next; } /^[ \t]*EdgeScroll[ \t]*/ { print $0; next; } /^[ \t]*EdgeResistance[ \t]*/ { print $0; next; } /^[ \t]*DeskTopSize[ \t]*/ { print $0; next; } /^[ \t]*DeskTopScale[ \t]*/ { printf ("#!%s (new command=*FvwmPagerDeskTopScale )\n", $0); print "*FvwmPagerDeskTopScale " $2; next; } /^[ \t]*FvwmButtons[ \t]*/ { sub("[ ]Swallow[ ]*[^ ]*", "& Exec"); print $0; if (length($0) > 199) { print "Warning: line" NR "too long" >"'$TTY'"; print ">> " $0 >"'$TTY'"; } if (!warn["GoodStuff"]) { print "Note: GoodStuff renamed to FvwmButtons" >"'$TTY'"; print "Note: FvwmButtons syntax may now be wrong; please check!" >"'$TTY'"; warn["GoodStuff"]=TRUE; } next; } /^\*/ { # other Module Configuration commands are passed thru print $0; next; } # hack: Modules spawned outside of a function, menu, or popup cannot have leading whitespace. # add these to the initfunction /^Module[ \t]*/ { printf "AddToFunc \"InitFunction\" \"I\" %s \n", $0; next; } # hack: function declarations cannot have leading whitespace /^Function[ \t]*/ { if (inpopup) print "ERROR: EndPopup missing\n" NR ": " $0 >"'$TTY'"; inpopup=FALSE; if (infunction) print "ERROR: EndFunction missing\n" NR ": " $0 >"'$TTY'"; infunction=TRUE; prefix="AddToFunc " $2; next; } /^[ \t]*EndFunction[ \t]*/ { if (!infunction) print "ERROR: EndFunction outside of function" >"'$TTY'"; infunction=FALSE; prefix=""; next; } # hack: popup declarations cannot have leading whitespace /^Popup/ { if (inpopup) print "ERROR: EndPopup missing\n" NR ": " $0 >"'$TTY'"; if (infunction) print "ERROR: EndFunction missing\n" NR ": " $0 >"'$TTY'"; infunction=FALSE; inpopup=TRUE; label=$2; if (index($2, "\"") == 1) { # not going to handle escaped quotes first=3; quoted=substr(label, 1, 1)=="\"" && substr(label, length(label), 1)!="\""; for (i=3;i<=NF && quoted;i++) { label=label " " $i; quoted=substr(label, length(label), 1)!="\""; first=i + 1; } } prefix="AddToMenu " label; next; } /^[ \t]*EndPopup[ \t]*/ { if (!inpopup) print "ERROR: EndPopup outside of popup\n" NR ": " $0 >"'$TTY'"; inpopup=FALSE; prefix=""; next; } ########## Deleted Commands ########## /^[ \t]*DontMoveOff[ \t]*/ || /^[ \t]*BackingStore[ \t]*/ || /^[ \t]*AppsBackingStore[ \t]*/ || /^[ \t]*SaveUnders[ \t]*/ || /^[ \t]*StubbornIcons[ \t]*/ || /^[ \t]*StubbornIconPlacement[ \t]*/ || /^[ \t]*StubbornPlacement[ \t]*/ || /^[ \t]*Cursor[ \t]*/ { print "#! " $0 " [deleted]"; if (warned[$1]==FALSE) { print "Warning: " $1 " not in Fvwm2, command dropped" >"'$TTY'"; warned[$1] = TRUE; } next; } /^[ \t]*Pager[ \t]*/ { print "#! " $0 " [deleted]"; print "#! An FvwmPager config to emulate builtin pager would be as follows:" print "# *FvwmPagerBack SlateGrey"; print "# *FvwmPagerFore Black"; print "# *FvwmPagerFont none"; print "# *FvwmPagerHilight SlateBlue4"; print "# *FvwmPagerGeometry "; print "# *FvwmPagerSmallFont -*-times-medium-r-*-*-*-80-*-*-*-*-*-*"; print "# *FvwmPagerDeskTopScale 32"; print "# #! Now start pager"; print "# Module FvwmPager 0 0"; if (warned[$1]==FALSE) { print "Warning: " $1 " omitted, internal pager is obsolete (use FvwmPager)" >"'$TTY'"; warned[$1] = TRUE; } next; } /^[ \t]*PagingDefault[ \t]*/ || /^[ \t]*TogglePage[ \t]*/ { print "#! " $0 " (use EdgeScroll 0 0)"; next; print "Warning: " $1 " not in Fvwm2, use EdgeScroll">"'$TTY'"; } ########## Old Internal Pager Colors ########### /^[ \t]*PagerForeColor[ \t]*/ || /^[ \t]*PagerBackColor[ \t]*/ { printf ("#!%s (new command=Style FvwmPager Color fore_color/back_color)\n", $0); if (warned[$1]==FALSE) { print "Warning: " $1 " omitted, internal pager is obsolete (use FvwmPager)" >"'$TTY'"; warned[$1] = TRUE; } next; } ########## Sticky Colors ########### /^[ \t]*StickyForeColor[ \t]*/ { printf ("#!%s (no sticky foreground color in fvwm2)\n", $0); if (warned[$1]==FALSE) { print "Warning: StickyForeColor not in fvwm2, omitted" > "'$TTY'" print " Use the Style command to assign each sticky window the same ForeColor" > "'$TTY'" } next; } /^[ \t]*StickyBackColor[ \t]*/ { printf ("#!%s (no sticky background color in fvwm2)\n", $0); if (warned[$1]==FALSE) { print "Warning: StickyBackColor not in fvwm2, omitted" >"'$TTY'" print " Use the Style command to assign each sticky window the same BackColor" > "'$TTY'" } next; } { if (infunction) { #gsub("[ ]PopUp[ ]", " "); } if ($2 == "\"Motion\"") context="\"M\""; else if ($2 == "\"Click\"") context="\"C\""; else if ($2 == "\"DoubleClick\"") context="\"D\""; else if ($2 == "\"Immediate\"") context="\"I\""; else context=$2; printf "%s", prefix " " context " " $1; for (i=3; i<=NF; ++i) printf (" %s", $i); printf ("\n"); prefix="+ "; next; } else if (inpopup) { # not going to handle escaped quotes label=$2; first=3; quoted=substr(label, 1, 1)=="\"" && substr(label, length(label), 1)!="\""; for (i=3;i<=NF && quoted;i++) { label=label " " $i; quoted=substr(label, length(label), 1)!="\""; first=i + 1; } printf ("%s %s %s", prefix, label, $1); for (i=first; i<=NF; ++i) printf (" %s", $i); printf ("\n"); prefix="+ "; next; } if (warned[$1]==FALSE) { printf ("#!Warning: Keyword \"%s\" not handled yet\n", $1); warned[$1]=TRUE; print "Warning: Unknown keyword "$1" passed through">"'$TTY'"; } print $0; next; } END { if (!hilightcolor) { printf ("\n#Set the foreground and background color for selected windows\n"); printf ("HilightColor %s %s\n", dflt["hiforecolor"], dflt["hibackcolor"]); } if (!placement) { printf "# overide default RandomPlacement and SmartPlacement Styles\n"; printf "Style \"*\" %s\n", dflt["placement"]; } } ' exit fvwm-2.6.5.orig/bin/fvwm-menu-headlines.in0000644000175000017500000010372111157754473016617 0ustar vwcvwc#!@PERL@ # Copyright (c) 1999-2009 Mikhael Goikhman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Filter this script to pod2man to get a man page: # pod2man -c "Fvwm Utilities" fvwm-menu-headlines | nroff -man | less -e require 5.002; use strict; use vars qw($site_info @smonths @lmonths %smonth_hash %lmonth_hash); use vars qw($entity_map $error_menu_content); use Getopt::Long; use Socket; use POSIX qw(strftime); use Time::Local; my $version = "@VERSION@"; local $site_info = { 'freshmeat' => { 'name' => "FreshMeat", 'host' => "freshmeat.net", 'path' => "/backend/recentnews.txt", 'func' => \&process_freshmeat, 'flds' => 'headline, date, url', }, 'slashdot' => { 'name' => "Slashdot", 'host' => "slashdot.org", 'path' => "/slashdot.xml", 'func' => \&process_slashdot, 'flds' => 'title, url, time, author, department, topic, comments, section, image', }, 'linuxtoday' => { 'name' => "LinuxToday", 'host' => "linuxtoday.com", 'path' => "/lthead.txt", 'func' => \&process_linuxtoday, 'flds' => 'headline, url, date', }, 'old-segfault' => { 'name' => "Old-Segfault (empty now)", 'host' => "segfault.org", 'path' => "/stories.txt", 'func' => \&process_segfault, 'flds' => 'headline, url, date, author_name, author_email, type', }, 'old-appwatch' => { 'name' => "Old-AppWatch (closed by ZDNet)", 'host' => "www.appwatch.com", 'path' => "/appwatch.rdf", 'func' => \&process_poor_rdf, 'flds' => 'title, link, description', }, 'old-linuxapps' => { 'name' => "Old-LinuxApps (moved/closed)", 'host' => "www.linuxapps.com-closed", 'path' => "/backend/linux_basic.txt", 'func' => undef, 'flds' => 'headline, date, url', }, 'old-justlinux' => { 'name' => "Old-JustLinux (no headlines?)", 'host' => "www.justlinux.com", 'path' => "/backend/discussion.rdf", 'func' => \&process_poor_rdf, 'flds' => 'title, link', }, 'daemonnews' => { 'name' => "DaemonNews", 'host' => "daily.daemonnews.org", 'path' => "/ddn.rdf.php3", 'func' => \&process_poor_rdf, 'flds' => 'title, link', }, # this is now called FootNotes or GNOME Desktop News, was news.gnome.org 'gnome-news' => { 'name' => "GNOME-News", 'host' => "www.gnomedesktop.org", 'path' => "/backend.php", 'func' => \&process_poor_rdf, 'flds' => 'title, link', }, 'kde-news' => { 'name' => "KDE-News", 'host' => "news.kde.org", 'path' => "/rdf", 'func' => \&process_kde_news, 'flds' => 'title, link', }, 'old-freekde' => { 'name' => "Old-FreeKDE (taken off?)", 'host' => "freekde.org", 'path' => "/freekdeorg.rdf", 'func' => \&process_freekde, 'flds' => 'title, link', }, 'rootprompt' => { 'name' => "RootPrompt", 'host' => "rootprompt.org", 'path' => "/rss/", 'func' => \&process_rootprompt, 'flds' => 'title, link, description', }, 'newsforge' => { 'name' => "NewsForge", 'host' => "www.newsforge.com", 'path' => "/newsforge.xml", 'func' => \&process_slashdot, 'flds' => 'title, url, time, author, department, topic, comments, section, image', }, 'kuro5hin' => { 'name' => "Kuro5hin", 'host' => "www.kuro5hin.org", 'path' => "/backend.rdf", 'func' => \&process_kuro5hin, 'flds' => 'title, link, description', }, 'bbspot' => { 'name' => "BBSpot", 'host' => "bbspot.com", 'path' => "/bbspot.rdf", 'func' => \&process_poor_rdf, 'flds' => 'title, link', }, 'linuxfr' => { 'name' => "LinuxFr", 'host' => "linuxfr.org", # 'path' => "/short.php3", 'path' => "/backend.rss", 'func' => \&process_linuxfr, # 'flds' => 'headline, url, author_name, author_email, type', 'flds' => 'title, link', }, 'thinkgeek' => { 'name' => "ThinkGeek", 'host' => "www.thinkgeek.com", 'path' => "/thinkgeek.rdf", 'func' => \&process_poor_rdf, 'flds' => 'title, link', }, 'cnn' => { 'name' => "CNN", 'host' => "www.cnn.com", 'path' => "/desktop/content.html", 'func' => \&process_cnn, 'flds' => 'headline, url', }, # to be removed 'bbc-world' => { 'name' => "BBC-World (obsolete)", 'host' => "news.bbc.co.uk", 'path' => "/low/english/world/default.stm", 'func' => \&process_old_bbc, 'flds' => 'headline, url, abstract', }, # to be removed 'bbc-scitech' => { 'name' => "BBC-SciTech (obsolete)", 'host' => "news.bbc.co.uk", 'path' => "/low/english/sci/tech/default.stm", 'func' => \&process_old_bbc, 'flds' => 'headline, url, abstract', }, 'bbc' => { 'name' => "BBC", 'host' => "news.bbc.co.uk", 'host0' => "tickers.bbc.co.uk", 'path' => "/tickerdata/story2.dat", 'func' => \&process_bcc, 'flds' => 'story, headline, url', }, }; # Site specific parsers may use these constants to convert month to unix time. local @smonths = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); local @lmonths = qw(January February March April May June July August September October November December); local (%smonth_hash, %lmonth_hash) = (); foreach (0 .. 11) { $smonth_hash{$smonths[$_]} = $_; $lmonth_hash{$lmonths[$_]} = $_; } my $TIMEFIELDS_DATE_TIME = 1; my $TIMEFIELDS_ONLY_DATE = 2; my $TIMEFIELDS_NONE = 3; my $home = $ENV{'HOME'} || '/tmp'; my $fvwm_user_dir = $ENV{'FVWM_USERDIR'} || "$home/.fvwm"; $fvwm_user_dir = $home unless -d $fvwm_user_dir; my $work_home = "$fvwm_user_dir/.fvwm-menu-headlines"; require "$work_home/extension.pl" if -r "$work_home/extension.pl"; my $info = undef; my $default_site = 'freshmeat'; my $site = undef; my $name = undef; my $title = undef; my $itemf = '%h\t%[(%Y-%m-%d %H:%M)]'; my $execf = q(firefox '%u'); my $commf = undef; my $icont = ''; my $iconi = ''; my $iconh = ''; my $icone = ''; my $wm_icons = 0; my $proxy = undef; my $port = 80; my $frontpage = undef; my @time = localtime(); my $menu_filename = undef; my $fake_filename = undef; my $timeout = 20; my $endl = "\r\n"; # this is preferable for http sockets to "\n" GetOptions( "help|h|?" => \&show_help, "version|V" => \&show_version, "info:s" => \$info, "site=s" => \$site, "name=s" => \$name, "title=s" => \$title, "item=s" => \$itemf, "exec=s" => \$execf, "command=s" => \$commf, "icon-title=s" => \$icont, "icon-item=s" => \$iconi, "icon-home=s" => \$iconh, "icon-error=s" => \$icone, "wm-icons" => \$wm_icons, "proxy=s" => \$proxy, "frontpage:s" => \$frontpage, "file:s" => \$menu_filename, "fake:s" => \$fake_filename, "timeout=i" => \$timeout, ) || wrong_usage(); wrong_usage() if @ARGV; if (defined $info) { if ($info) { my $_info = $site_info->{lc($info)}; die "Unsupported site '$info'; try --info.\n" unless $_info; my $host0 = $_info->{'host0'} || $_info->{'host'}; print "Site Name:\n\t$_info->{'name'}\n", "Home Page:\n\thttp://$_info->{'host'}/\n", "Headlines:\n\thttp://$host0$_info->{'path'}\n", "Headline fields:\n\t$_info->{'flds'}\n"; } else { print "All supported sites:\n\t", join(", ", &get_all_site_names()), "\n\nSpecify a site name after --info to get a site headlines info.\n"; } exit(0); } $site ||= $default_site; $site = lc($site); die "Unsupported site '$site'; try --info.\n" unless exists $site_info->{$site}; #$name ||= "MenuHeadlines$site_info->{$site}->{'name'}"; $name ||= $site; $title ||= "$site_info->{$site}->{'name'} Headlines"; my $site_name = $site_info->{$site}->{'name'}; my $site_host = $site_info->{$site}->{'host'}; my $site_path = $site_info->{$site}->{'path'}; my $site_func = $site_info->{$site}->{'func'}; $commf ||= "Exec $execf"; $title =~ s/\\t/\t/g; $itemf =~ s/\\t/\t/g; $commf =~ s/\\t/\t/g; if ($wm_icons) { $icont ||= ""; $iconi ||= "menu/information.xpm"; $iconh ||= "menu/home.xpm"; $icone ||= "menu/choice-no.xpm"; } my $icont_str = $icont ? "%$icont%" : ""; my $iconi_str = $iconi ? "%$iconi%" : ""; my $iconh_str = $iconh ? "%$iconh%" : ""; my $icone_str = $icone ? "%$icone%" : ""; if (defined $proxy && $proxy =~ /^(.+):(\d+)$/) { $proxy = $1; $port = $2; } # Three cases: # 1) no --file option or value '-' specified (STDOUT is used) # 2) no or empty menu file in --file specified (the default name is used) # 3) non-empty menu file specified (use it) $menu_filename = undef if defined $menu_filename && $menu_filename eq '-'; if ($menu_filename) { $menu_filename =~ s:^~(/|$):$home$1:; $menu_filename =~ m:^(.+)/[^/]+$:; $work_home = $1 || "."; } elsif (defined $menu_filename) { $menu_filename = "$work_home/$site.menu"; } my $content = ""; $content .= qq(DestroyMenu $name\n); $content .= qq(AddToMenu $name "$icont_str$title" Title\n); local $error_menu_content = $content; my $frontpage_entry = ""; if (defined $frontpage) { my $cmd = &expand_all_width_specifiers($commf, {'u' => "http://$site_host/"}); $frontpage_entry = qq(+ "$iconh_str$site_name Frontpage" $cmd\n); $error_menu_content .= qq($frontpage_entry\n+ "" Nop\n); } $error_menu_content .= "+ `$icone_str` DestroyMenu $name\n"; if (defined $frontpage && $frontpage !~ /^b/) { $content .= qq($frontpage_entry\n+ "" Nop\n); } unless (defined $fake_filename) { $site_host = $site_info->{$site}->{'host0'} if defined $site_info->{$site}->{'host0'}; my $redirect_depth = 0; HTTP_CONNECTION: my $host = $proxy || $site_host; my $iaddr = inet_aton($host) || &die_net("Can't resolve host $host"); my $paddr = sockaddr_in($port, $iaddr); my $proto = getprotobyname('tcp'); local $SIG{ALRM} = sub { die "timeout\n"; }; alarm($timeout); eval { socket(SOCK, PF_INET, SOCK_STREAM, $proto) && connect(SOCK, $paddr) } || &die_net("Can't connect host $host"); alarm(0); select(SOCK); $| = 1; select(STDOUT); # do http request my $http_headers = "$endl" . "Host: $site_host$endl" . "Connection: close$endl" . "User-Agent: fvwm-menu-headlines/$version$endl" . "Pragma: no-cache$endl" . "$endl"; if (defined $proxy) { print SOCK "GET http://$site_host$site_path HTTP/1.1$http_headers"; } else { print SOCK "GET $site_path HTTP/1.1$http_headers"; } unless (read_line() =~ m{HTTP/1\.\d (\d+) \w+}) { &die_net("Invalid HTTP response from http://$site_host$site_path", 0); } my $status = $1; if ($status =~ /^301|302$/ && ++$redirect_depth < 5) { # redirection while (1) { my $line = read_line(); $line =~ s/[\n\r]+$//s; last unless $line; if ($line =~ m{Location: http://([^/]+)(/.*)}i) { $site_host = $1; $site_path = $2; goto HTTP_CONNECTION; } } } &die_net("Unexpected HTTP response $status from http://$site_host$site_path", 0) unless $status eq "200"; # skip http response headers while (read_line() !~ /^\r?\n?$/s) {} } else { if ($fake_filename) { $fake_filename =~ s:^~(/|$):$home$1:; } else { $fake_filename = "$work_home/$site.in"; } open(SOCK, "<$fake_filename") || &die_sys("Can't open $fake_filename"); } my $entries = &$site_func; close(SOCK) || &die_net("Error closing socket"); foreach (@$entries) { my $text = &expand_all_width_specifiers($itemf, $_); my $comm = &expand_all_width_specifiers($commf, $_); $text =~ s/"/\\"/g; $content .= qq(+ "$iconi_str$text" $comm\n); } if (defined $frontpage && $frontpage =~ /^b/) { $content .= qq(+ "" Nop\n$frontpage_entry); } if (defined $menu_filename) { unless (-d $work_home) { mkdir($work_home, 0775) || &die_sys("Can't create $work_home"); } open(MENU_FILE, ">$menu_filename") || &die_sys("Can't open $menu_filename"); print MENU_FILE $content; close(MENU_FILE) || &die_sys("Can't close $menu_filename"); } else { print $content; } exit(); # --------------------------------------------------------------------------- sub read_line { local $SIG{ALRM} = sub { die "timeout\n"; }; alarm($timeout); my $line = eval { }; if ($@) { &die_net("Timeout of $timeout seconds reached") if $@ eq "timeout\n"; &die_net($@); } alarm(0); print STDERR $line if $ENV{"DEBUG_DUMP_RESPONSE"}; return $line; } sub read_all_lines { local $SIG{ALRM} = sub { die "timeout\n"; }; alarm($timeout * 2); my $lines = eval { join('', ) }; if ($@) { &die_net("Timeout of $timeout seconds reached") if $@ eq "timeout\n"; &die_net($@); } alarm(0); print STDERR $lines if $ENV{"DEBUG_DUMP_RESPONSE"}; return $lines; } # make unix time from year (2001 or 101), mon (0..11), day, hour, min, sec sub make_time { # ($$$$$$$) my ($h_offset, $year, $mon, $day, $hour, $min, $sec) = @_; $h_offset ||= 0; my $type = $TIMEFIELDS_DATE_TIME; unless (defined $hour || defined $min) { unless ($year || $day) { $type = $TIMEFIELDS_NONE; return [ 0, $type ]; } else { $type = $TIMEFIELDS_ONLY_DATE; } } $year = 1973 unless $year && $year > 0; # it's my year :-) $mon = 0 unless $mon && $mon > 0 && $mon <= 11; $day = 1 unless $day && $day > 0 && $day <= 31; $hour = 12 unless $hour && $hour >= 0 && $hour < 24; $min = 0 unless $min && $min >= 0 && $min < 60; $sec = 0 unless $sec && $sec >= 0 && $sec < 60; return [ timegm($sec, $min, $hour, $day, $mon, $year) - $h_offset * 60 * 60, $type ]; } sub set_entry_aliases_and_time ($$$$) { my $entry = shift; my $aliases = shift; my $time_func = shift; my $h_offset = shift; my ($alias, $orig); while (($alias, $orig) = each %$aliases) { $entry->{$alias} = !$orig ? "" : ref($orig) eq 'CODE' ? &{$orig}($entry) : $entry->{$orig}; $entry->{$alias} = "" unless defined $entry->{$alias}; } $entry->{'_'} = make_time($h_offset, &{$time_func}($entry->{'d'})); } BEGIN { $entity_map = { 'gt' => '>', 'lt' => '<', 'quot' => '"', 'amp' => '&', }; } sub process_xml ($$$$) { my $entry_tag = shift; my $aliases = shift; my $time_func = shift; my $h_offset = shift; my @entries = (); my $doc = read_all_lines(); ENTRY: foreach ($doc =~ m!<$entry_tag\b[^>]*>(.*?)!sg) { s/&quot;/"/g; # fix buggy html in some backends # replace ' with single quote and " with double quote s/&(?:(\w+)|#(\d{2,})|#x([\da-fA-F]{2,4}));/ $1 ? $entity_map->{$1} || "{$1}" : chr($2 || hex($3)) /ge; my $entry = {}; foreach (m!(<.*?>.*?)!sg) { m!<(.*?)>\s*(.*?)\s*!s; # ignore incorect fields or throw error? next unless $1 && $2 && $3; next if $1 ne $3; $entry->{$1} = $2; } set_entry_aliases_and_time($entry, $aliases, $time_func, $h_offset); push @entries, $entry; } return \@entries; } sub process_text ($$$$) { my $fields = shift; my $aliases = shift; my $time_func = shift; my $h_offset = shift; my @entries = (); ENTRY: while (1) { my $entry = {}; foreach (@$fields) { my $line = read_line(); last ENTRY unless defined $line; next if $_ eq '_ignore_'; chomp($line); $line =~ s/"/\\"/g; # $line =~ s/<.*?>//g; # $line =~ s/&\w{1,5}?;/ /g; $entry->{$_} = $line; } set_entry_aliases_and_time($entry, $aliases, $time_func, $h_offset); push @entries, $entry; } return \@entries; } sub process_slashdot () { return process_xml( 'story', { 'h' => 'title', 'u' => 'url', 'd' => 'time' }, sub ($) { $_[0] =~ /(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/; ($1, ($2 || 0) - 1, $3, $4, $5, $6); }, +0, ); } sub process_freshmeat () { return process_text( [ qw( headline date url ) ], { 'h' => 'headline', 'u' => 'url', 'd' => 'date' }, sub ($) { $_[0] =~ /^(?:\w+, )?(\w+) (\d+)\w* (\d+),? (\d+):(\d+)/; ($3, $lmonth_hash{$1}, $2, $4, $5, 0); }, -5 + (abs((localtime())[4] - 5.5) < 3), ); } sub process_linuxtoday () { my $line; while ($line = read_line()) { last if $line =~ /linuxtoday.com/; # skip the text note last if $line =~ /&&/ and read_line() x 3; # if it was replaced } return process_text( [ qw( _ignore_ headline url date ) ], { 'h' => 'headline', 'u' => 'url', 'd' => 'date' }, sub ($) { $_[0] =~ /(\w+) (\d+), (\d+), (\d+):(\d+):(\d+)/; ($3, $smonth_hash{$1}, $2, $4, $5, $6); }, +0, ); } sub process_segfault () { my $line; while ($line = read_line()) { last if $line =~ /^%%/; # skip the text note } return process_text( [ qw( headline url date author_name author_email type _ignore_ ) ], { 'h' => 'headline', 'u' => 'url', 'd' => 'date' }, sub ($) { $_[0] =~ /(\d+) (\w+) (\d+):(\d+):(\d+) (\d+)/; ($6, $smonth_hash{$2}, $1, $3, $4, $5); }, -8 + (abs((localtime())[4] - 5.5) < 3), ); } sub process_poor_rdf () { return process_xml( 'item', { 'h' => 'title', 'u' => 'link', 'd' => undef }, sub ($) { # this site's rdf does not supply the time, how weird... #(gmtime())[5,4,3,2,1,0]; () }, +0, ); } sub process_linuxapps_old () { return process_text( [ qw( headline date url ) ], { 'h' => 'headline', 'u' => 'url', 'd' => 'date' }, sub ($) { $_[0] =~ /(\w+) (\d+) (\d+):(\d+):(\d+) \w+ (\d+)/; ($6, $smonth_hash{$1}, $2, $3, $4, $5); }, -5, ); } sub process_kde_news () { my $link_to_time = sub ($) { $_[0]->{'link'} =~ m|/(\d+)/?$|; $1; }; return process_xml( 'item', { 'h' => 'title', 'u' => 'link', 'd' => $link_to_time }, sub ($) { (gmtime($_[0]))[5,4,3,2,1,0]; }, +0, ); } sub process_freekde () { my $link_to_date = sub ($) { $_[0]->{'link'} =~ m|/(\d\d/\d\d/\d\d)/|; $1 ? "20$1" : ''; }; return process_xml( 'item', { 'h' => 'title', 'u' => 'link', 'd' => $link_to_date }, sub ($) { $_[0] =~ m|(\d+)/(\d+)/(\d+)|; ($1, ($2 || 0) - 1, $3); }, +0, ); } sub process_rootprompt () { my $title_stripped = sub ($) { $_[0]->{'title'} =~ /(.*) \([^\(\)]+\)$/ ? $1 : $_[0]->{'title'}; }; my $title_to_date = sub ($) { $_[0]->{'title'} =~ / \((\d+ \w{3} \d{4})\)$/; $1; }; return process_xml( 'item', { 'h' => $title_stripped, 'u' => 'link', 'd' => $title_to_date }, sub ($) { $_[0] =~ /(\d+) (\w+) (\d+)/; ($3, $smonth_hash{$2}, $1); }, +0, ); } sub process_kuro5hin () { my $link_to_date = sub ($) { $_[0]->{'link'} =~ m|/(\d\d\d\d/\d{1,2}/\d{1,2})/|; $1; }; return process_xml( 'item', { 'h' => 'title', 'u' => 'link', 'd' => $link_to_date }, sub ($) { $_[0] =~ m|(\d+)/(\d+)/(\d+)|; ($1, ($2 || 0) - 1, $3); }, +0, ); } sub process_linuxfr () { my $link_to_date = sub ($) { $_[0]->{'link'} =~ m|/(\d\d\d\d/\d\d/\d\d)/|; $1; }; my $hack_for_url = sub ($) { # hack for mozilla -remote openURL my $u = $_[0]->{'link'}; $u =~ s|,|\%2c|g; $u; }; return process_xml( 'item', { 'h' => 'title', 'u' => $hack_for_url, 'd' => $link_to_date }, sub ($) { $_[0] =~ m|(\d+)/(\d+)/(\d+)|; ($1, ($2 || 0) - 1, $3); }, +0, ); } sub process_linuxfr_old () { my $link_to_date = sub ($) { $_[0]->{'url'} =~ m|/(\d\d\d\d/\d\d/\d\d)/|; $1; }; my $hack_for_url = sub ($) { # hack for mozilla -remote openURL my $u = $_[0]->{'url'}; $u =~ s|,|\%2c|g; $u; }; my $line; while ($line = read_line()) { last if $line =~ /^%%/; # skip the text note } return process_text( [ qw( headline url author_name author_email type _ignore_ ) ], { 'h' => 'headline', 'u' => $hack_for_url, 'd' => $link_to_date }, sub ($) { $_[0] =~ m|(\d+)/(\d+)/(\d+)|; ($1, ($2 || 0) - 1, $3); }, +0, ); } sub process_cnn () { my $contents = read_all_lines(); my @entries = (); my $link_to_date = sub ($) { $_[0]->{'url'} =~ m|/(\d\d\d\d).*?(/\d\d/\d\d)/|; "$1$2"; }; $contents =~ s{(.*?)}{ my $entry = {}; $entry->{'url'} = "http://www.cnn.com$1"; $entry->{'headline'} = $2; set_entry_aliases_and_time( $entry, { 'h' => 'headline', 'u' => 'url', 'd' => $link_to_date }, sub ($) { $_[0] =~ m|(\d+)/(\d+)/(\d+)| ? ($1, ($2 || 0) - 1, $3) : (); }, -5, ); push @entries, $entry; "" }sige; return \@entries; } sub process_old_bbc () { my $contents = read_all_lines(); $contents =~ s!\r\n...\r\n!!sg; # they insert this randomly! $contents =~ s!\s*<(br|/h3|h3|span[^>]*|/span|img [^>]+)>[ \t\r]*\n?!!sig; my @entries = (); $contents =~ s{\s+\s*([^\s][^<]+?)\s*\s*([^<]+?)\s*(?:\n|
{'headline'} = $2; $entry->{'abstract'} = $3; $path =~ s|^(/\d+)?/low/|$1/hi/|; $entry->{'url'} = "http://news.bbc.co.uk$path"; set_entry_aliases_and_time( $entry, { 'h' => 'headline', 'u' => 'url', 'd' => undef }, sub ($) { (); # no time... }, +0, ); push @entries, $entry; "" }sige; return \@entries; } sub process_bcc () { read_all_lines() =~ /STORY 1\nHEADLINE Last update at (\d+:\d+)\nURL \n(.*)$/s; my ($time, $contents) = ($1, $2); die_net("Parse error. Did BBC site change format?", "") unless defined $time; my @entries = (); $contents =~ s{STORY (\d+)\nHEADLINE (.*?)\nURL (.*?)\n}{ my $entry = {}; my $date = undef; $entry->{'story'} = $1; my $headline = $2; my $url = $3; if ($headline =~ /^(.+?) (\d+ \w+ \d+)$/) { $headline = $1; $date = $2 . " $time"; } $entry->{'headline'} = $headline; $url =~ s|^(http://.*?/).*/-/(.*)$|$1$2|; $url = "http://news.bbc.co.uk/" if $url eq ""; $entry->{'url'} = $url; $entry->{'date'} = $date; set_entry_aliases_and_time( $entry, { 'h' => 'headline', 'u' => 'url', 'd' => 'date' }, sub ($) { return () unless defined $_[0] && $_[0] =~ /^(\d+) (\w+) (\d+) (\d+):(\d+)/; ($3, $lmonth_hash{$2}, $1, $4, $5); }, +0, ); push @entries, $entry; "" }sige; return \@entries; } # --------------------------------------------------------------------------- sub die_sys ($) { my $msg = shift; $msg = "$0: $msg: [$!]\n"; print STDERR $msg # # be quiet in non interactive shells? # if ($ENV{'SHLVL'} || 0) == 1 || defined($ENV{'PS1'}) ; exit(-1); } sub die_net ($;$) { my $msg = shift; my $check_network_msg = @_ ? "" : "; check network connection"; #die_sys($msg); $error_menu_content =~ s//$msg$check_network_msg/; print $error_menu_content; exit(-1); } # like strftime, but gets unix time, instead of sec/min/hour/day/mon/year. sub format_time ($$) { my ($fmt, $time_pair) = @_; $time_pair = [] unless ref($time_pair) eq 'ARRAY'; my ($time, $type) = @$time_pair; $time ||= time(); $type ||= $TIMEFIELDS_NONE; if ($type == $TIMEFIELDS_NONE) { return ""; } elsif ($type == $TIMEFIELDS_ONLY_DATE) { $fmt =~ s/[:\. -]?%[HIklMprSTX][:\. -]?//g; $fmt =~ s/%c/%a %b %d %Z %Y/g; } return strftime($fmt, localtime($time)); } # Substitutes all %N1*N2x in $name by properly stripped and justified $values. # $name example: %[%d %b %y %H:%M], %*-7(some text), %-32*30h, %{url}. # $values is a hash of named values to substitute. sub expand_all_width_specifiers ($$) { my ($name, $values) = @_; $name =~ s/%(-?\d+)?(\*(-?)(\d+))?(\w|{\w+}|\(.*?\)|\[.*?\])/ my $tag = substr($5, 0, 1); my $arg = length($5) == 1 ? $5 : substr($5, 1, -1); my $value = $tag eq '(' ? $arg : $tag eq '[' ? format_time($arg, $values->{'_'}) : $values->{$arg}; $value = "(%$5 is not defined)" unless defined $value; $value = !$2 || $4 <= 3 || $4 > length($value) ? $value : $3? "..." . substr($value, -$4 + 3, $4 - 3): substr($value, 0, $4 - 3) . "..."; $1 ? sprintf("%$1s", $value) : $value; /ge; return $name; } sub get_all_site_names () { return sort map { $site_info->{$_}->{'name'} } keys %$site_info; } sub show_help { $site ||= $default_site; #$name ||= "MenuHeadlines$site_info->{$site}->{'name'}"; $name ||= $site; $title ||= "$site_info->{$site}->{'name'} Headlines"; print "A perl script which builds headlines menu for fvwm.\n"; print "Supported sites: ", join(', ', get_all_site_names()), "\n\n"; print "Usage: $0 [OPTIONS]\n"; print "Options:\n"; print "\t--help show this help and exit\n"; print "\t--version show the version and exit\n"; print "\t--info=[NAME] information about a site\n"; print "\t--site=NAME headlines site, default is $site\n"; print "\t--name=NAME menu name, default is '$name'\n"; print "\t--title=NAME menu title, default is '$title'\n"; print "\t--item=FORMAT menu item format, default is '$itemf'\n"; print "\t--exec=FORMAT exec command, default is {$execf}\n"; print "\t--command=FORMAT fvwm command, default is no\n"; print "\t--icon-title=XPM menu title icon, default is no\n"; print "\t--icon-item=XPM menu item icon, default is no\n"; print "\t--icon-home=XPM menu home icon, default is no\n"; print "\t--icon-error=XPM menu error icon, default is no\n"; print "\t--wm-icons define icon names to use with wm-icons\n"; print "\t--frontpage[=V] show frontpage item; values: top, bottom\n"; print "\t--proxy=host[:port] specify proxy host and port (80)\n"; print "\t--file[=FILE] menu file, default is $work_home/$site.menu\n"; print "\t--fake[=FILE] don't connect, read input from file\n"; print "\t--timeout=SECS timeout for a line reading from a socket\n"; print "Short options are ok if not ambiguous: -h, -t.\n"; exit 0; } sub show_version { print "$version\n"; exit 0; } sub wrong_usage { print STDERR "Try '$0 --help' for more information.\n"; exit -1; } __END__ # --------------------------------------------------------------------------- =head1 NAME fvwm-menu-headlines - builds headlines menu definition for fvwm =head1 SYNOPSIS B [ B<--help>|B<-h>|B<-?> ] [ B<--version>|B<-V> ] [ B<--info> [site] ] [ B<--site>|B<-s> site ] [ B<--name>|B<-n> name ] [ B<--title>|B<-t> title ] [ B<--item> item ] [ B<--exec>|B<-e> exec-command ] [ B<--command>|B<-e> fvwm-command ] [ B<--icon-title> icon ] [ B<--icon-item> icon ] [ B<--icon-home> icon ] [ B<--icon-error> icon ] [ B<--wm-icons> ] [ B<--frontpage> [where] ] [ B<--proxy>|B<-p> host:port ] [ B<--file> [file] ] [ B<--fake> [file] ] [ B<--timeout> seconds ] =head1 DESCRIPTION This configurable perl script builds an fvwm menu definition for headlines of popular news web sites: FreshMeat, Slashdot, LinuxToday, DaemonNews, GNOME-News, KDE-News, RootPrompt, LinuxFr, ThinkGeek, CNN, BBC and more. It is possible to specify a customized menu item format, change a command (usually launching a browser) and add menu icons (there is a support for the wm-icons package). =head1 OPTIONS =over 4 =item B<--help> show the help and exit =item B<--version> show the version and exit =item B<--info> [site] if site name is given print the site specific info, otherwise print all site names =item B<--site> site defile a web site, headlines of which to show, this option also can be used together with --help to get new defaults. Default site: freshmeat. =item B<--name> name define menu name (default is "MenuHeadlinesFreshmeat") =item B<--title> title define menu title (default is "Freshmeat Headlines"). =item B<--item> label-format =item B<--exec> command-format define format for menu item or command (what is shown and what is executed when the item is chosen). Default label is '%h\t%[(%Y-%m-%d %H:%M)]'. TAB can be specified as '\t', but in .fvwm2rc you should specify a double backslash or a real TAB. Format specifiers for a headline format: %h - headline %u - url %d - date in the native format (that site backend supplied) %[strftime-argument-string] - date/time, see strftime(3) the date/time is represented according to the local time; date and/or time fields that can't be guessed are stripped Example: %[|%d %B %Y| %H:%M %S] If site supplied only date - this becomes %[|%d %B %Y|], if site supplied no date - this becomes an empty string. %{name} - site specific named value, like %{comments} %(text) - arbitrary text, good for escaping or aligning These specifiers can receive an optional integer size, positive for right adjusted string or negative for left adjusted, example: %8x; and optional *num or *-num, which means to leave only the first or last (if minus) num of chars, the num must be greater than 3, since the striped part is replaced with "...", example: %*30x. Both can be combined: %-10*-20x, this instructs to get only the 20 last characters, but if the length is less then 10 - to fill with up to 10 spaces on the right. Example: --exec "iceweasel -remote 'openURL(%u, new-window)' || iceweasel '%u'" =item B<--command> command-format like B<--exec> above, but enables to specify any fvwm command, for example, "Function FuncFvwmShowURL '%u'" not only Exec. In fact, --exec="mozilla '%u'" is equivalent to --command="Exec mozilla '%u'" =item B<--icon-title> icon =item B<--icon-item> icon =item B<--icon-home> icon =item B<--icon-error> icon define menu icon for title, regular item, frontpage item and error item respectively. Default is no menu icons (equivalent to an empty icon argument). =item B<--wm-icons> define icon names suitable for use with wm-icons package. Currently this is equivalent to: --icon-title '' --icon-item menu/information.xpm --icon-home menu/home.xpm --icon-error menu/choice-no.xpm. =item B<--frontpage> [where] add the site frontpage item to the menu. Optional value can be used to specify where this item will be placed in the menu - 'top' or 't', 'bottom' or 'b'. =item B<--proxy> host[:port] define a proxy to use. Example: --proxy proxy.inter.net:3128 =item B<--file> [file] write the menu output to specified file. If no filename is given with this option (or empty filename), the default filename WORK_HOME/SITE.menu is used. Without this option or with '-' filename, the menu output is written to standard output. =item B<--fake> [file] don't connect to the host using HTTP protocol, instead, read from WORK_HOME/SITE.in file. The following reads input from freshmeat.in (downloaded http://freshmeat.net/backend/recentnews.txt) and saves output to segfault.menu (both files are in WORK_HOME): fvwm-menu-headlines --site freshmeat --fake --file =item B<--timeout> seconds limit a line reading from a socket to this timeout, the default timeout is 20 seconds. =back WORK_HOME of this script is ~/.fvwm/.fvwm-menu-headlines. It is created if needed. Option parameters can be specified either using '=' or in the next argument. Short options are ok if not ambiguous: C<-h>, C<-t>; but be careful with short options, what is now unambiguous, can become ambiguous in the next versions. =head1 USAGE 1. One of the ways to use this script is to define a crontab entry to run the script every hour or so for every monitored site: 0,30 * * * * fvwm-menu-headlines --file --site freshmeat 1,31 * * * * fvwm-menu-headlines --file --site linuxtoday 2,32 * * * * fvwm-menu-headlines --file --site slashdot Then add these lines to your fvwm configuration file: DestroyFunc FuncFvwmMenuHeadlines AddToFunc FuncFvwmMenuHeadlines + I Read "$HOME/.fvwm/.fvwm-menu-headlines/$0.menu" DestroyMenu MenuHeadlines AddToMenu MenuHeadlines "Headlines" Title + MissingSubmenuFunction FuncFvwmMenuHeadlines + "FreshMeat" Popup freshmeat + "LinuxToday" Popup linuxtoday + "Slashdot" Popup slashdot 2. Another way to use this script (only if you have fast network/proxy) is to run it every time you want to open your Headlines submenus. (Note, the submenu that is once created is not reloaded, use "Reset all".) In this case your fvwm configuration lines could be: DestroyFunc FuncFvwmMenuHeadlines AddToFunc FuncFvwmMenuHeadlines + I PipeRead "fvwm-menu-headlines --site $0" #+ I Schedule 900000 DestroyMenu $0 # reset generated menu in 15 minutes DestroyMenu MenuHeadlines AddToMenu MenuHeadlines "Headlines" Title + MissingSubmenuFunction FuncFvwmMenuHeadlines + "FreshMeat" Popup freshmeat + "Slashdot" Popup slashdot + "LinuxToday" Popup linuxtoday + "GNOME News" Popup gnome-news + "KDE News" Popup kde-news + "" Nop + "Reset all" FuncResetHeadlines DestroyFunc FuncResetHeadlines AddToFunc FuncResetHeadlines + I DestroyMenu freshmeat + I DestroyMenu linuxtoday + I DestroyMenu slashdot + I DestroyMenu gnome-news + I DestroyMenu kde-news And finally, add "Popup MenuHeadlines" somewhere. 3. Here is a usual usage. Use FvwmConsole or FvwmCommand to run fvwm commands from a shell script. Every time you want headlines from some site, execute (give any additional options if you want): PipeRead "fvwm-menu-headlines --site newsforge --name MenuHeadlinesNewsForge" # this may take several seconds, you may use: BusyCursor Read true Popup MenuHeadlinesNewsForge =head1 HOW TO ADD SITE HEADLINES It is possible to add user defined site headlines without touching the script itself. Put your perl extensions to the file WORK_HOME/extension.pl. For each site add something similar to: $site_info->{'myslashdot'} = { 'name' => "MySlashdot", 'host' => "myslashdot.org", 'path' => "/myslashdot.xml", 'func' => \&process_my_slashdot, # the following string is only used in --info 'flds' => 'time, title, department, topic, author, url', }; sub process_my_slashdot () { return process_xml( 'story', # mandatory 'h', 'u' and 'd' aliases or undef { 'h' => 'title', 'u' => 'url', 'd' => 'time' }, sub ($) { # convert 'd' string to (y, m, d, H, M, S) $_[0] =~ /(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/; ($1, ($2 || 0) - 1, $3, $4, $5, $6); }, +0, # timezone offset; already in UTC ); } 1; =head1 AUTHORS This script is inspired by WMHeadlines v1.3 by: Jeff Meininger (http://rive.boxybutgood.com/WMHeadlines/). Reimplemented for fvwm and heavily enhanced by: Mikhael Goikhman , 16 Dec 1999. =head1 COPYING The script is distributed by the same terms as fvwm itself. See GNU General Public License for details. =head1 BUGS I try to keep all supported site info up to date, but sites often go down, change their backend formats, change their httpd responses, just stop to post news and so on; the script in the latest cvs may be more up to date. The headline times may be off by one hour or more, since the time is displayed for your local time zone, and the time zone of the original time in the site backend output is often guessed (sometimes incorrectly); similarly it is guessed whether to apply the daylight saving correction. Report bugs to fvwm-bug@fvwm.org. =cut # =========================================================================== fvwm-2.6.5.orig/bin/fvwm-bug.10000644000175000017500000000273111744241304014211 0ustar vwcvwc.\" @(#)fvwm-2.6.5 20 April 2012 .TH fvwm-bug 1 "20 April 2012 (2.6.5)" Fvwm "Fvwm Modules" .SH NAME fvwm-bug \- report a bug in fvwm .SH SYNOPSIS \fBfvwm-bug\fP [\fI--help\fP] [\fI--version\fP] [\fIaddress\fP] .SH DESCRIPTION .B fvwm-bug is a shell script to help the user compose and mail bug reports concerning fvwm in a standard format. .B fvwm-bug invokes the editor specified by the environment variable .SM .B EDITOR on a temporary copy of the bug report format outline. The user must fill in the appropriate fields and exit the editor. .B fvwm-bug then mails the completed report to the local fvwm maintainer, the fvwm workers list \fIfvwm-workers@fvwm.org\fP, or \fIaddress\fP. If the report cannot be mailed, it is saved in the file \fIdead.fvwm-bug\fP in the invoking user's home directory. .PP The bug report format outline consists of several sections. The first section provides information about the machine, operating system, the fvwm version, and the compilation environment. The second section should be filled in with a description of the bug. The third section should be a description of how to reproduce the bug. The optional fourth section is for a proposed fix. Fixes are encouraged. .SH ENVIRONMENT .B fvwm-bug will utilize the following environment variables if they exist: .TP .B EDITOR Specifies the preferred editor. If .SM .B EDITOR is not set, .B fvwm-bug defaults to .BR emacs . .TP .B HOME Directory in which the failed bug report is saved if the mail fails. fvwm-2.6.5.orig/doc/0000755000175000017500000000000011744241501012366 5ustar vwcvwcfvwm-2.6.5.orig/doc/index.html0000644000175000017500000001102610656151546014375 0ustar vwcvwc Fvwm: Documentation
Home ⋅ All Commands ⋅ Grouped Commands ⋅ Modules ⋅ FAQ

fvwm Documentation

Getting Started General Command Reference
Developer Resources Licence


???
fvwm 2.5.x
fvwm-2.6.5.orig/doc/docbook-xsl/0000755000175000017500000000000011744241502014613 5ustar vwcvwcfvwm-2.6.5.orig/doc/docbook-xsl/profiling/0000755000175000017500000000000011744241502016604 5ustar vwcvwcfvwm-2.6.5.orig/doc/docbook-xsl/profiling/Makefile.in0000644000175000017500000003065311744241232020660 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/docbook-xsl/profiling DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ EXTRA_DIST = \ profile-mode.xsl \ profile.xsl all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/docbook-xsl/profiling/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/docbook-xsl/profiling/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/doc/docbook-xsl/profiling/profile.xsl0000644000175000017500000000342510632525732021005 0ustar vwcvwc fvwm-2.6.5.orig/doc/docbook-xsl/profiling/profile-mode.xsl0000644000175000017500000002013710632525732021726 0ustar vwcvwc 1 fvwm-2.6.5.orig/doc/docbook-xsl/profiling/Makefile.am0000644000175000017500000000006010655362500020636 0ustar vwcvwcEXTRA_DIST = \ profile-mode.xsl \ profile.xsl fvwm-2.6.5.orig/doc/docbook-xsl/Makefile.in0000644000175000017500000004677511744241232016703 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/docbook-xsl DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ SUBDIRS = common highlighting html lib manpages profiling EXTRA_DIST = \ VERSION all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/docbook-xsl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/docbook-xsl/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic ctags \ ctags-recursive distclean distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ tags-recursive uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/doc/docbook-xsl/manpages/0000755000175000017500000000000011744241502016406 5ustar vwcvwcfvwm-2.6.5.orig/doc/docbook-xsl/manpages/docbook.xsl0000644000175000017500000003020010574437366020570 0ustar vwcvwc MAN.MANIFEST Note: No refentry elements found in " ... " fvwm-2.6.5.orig/doc/docbook-xsl/manpages/utility.xsl0000644000175000017500000004525510574437366020673 0ustar vwcvwc \fB \fR \fI \fR \% .sp .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .sp .RS .RE .\" fvwm-2.6.5.orig/doc/docbook-xsl/manpages/html-synop.xsl0000644000175000017500000013432210574437366021274 0ustar vwcvwc

. . ( )  

( )

⌂sp ⌂nf
    
    
  
⌂fi

.

( ) ; ... ) ; , ) ; . ; ( )
 
padding-bottom: 1em
( ) ;   ... ) ;   , ) ;       ; ( ) ;

( void) ; ... ) ; , ) ; ( ) padding-bottom: 1em
 
( void) ;   ... ) ;     , ) ;   , ) ; ( ) java Unrecognized language on : . ⌂sp ⌂nf
    
    
    
       extends
      
      
        
.

	    
      
    
    
      implements
      
      
        
.

	    
      
    
    
      throws
      
    
     {
    
.

    
    }
  
⌂fi
,   , , ,    ;     void  0 , .      ( ) .     throws  ; ⌂sp ⌂nf
    
    
    
      : 
      
      
        
.

	    
      
    
    
       implements
      
      
        
.

	    
      
    
    
       throws
      
    
     {
    
.

    
    }
  
⌂fi
,   , , ,    ;     void  ,    ( ) .     throws  ; ⌂sp ⌂nf
    
    interface 
    
    
      : 
      
      
        
.

	    
      
    
    
       implements
      
      
        
.

	    
      
    
    
       throws
      
    
     {
    
.

    
    }
  
⌂fi
,   , , ,    ;     void  ,    ( ) .     raises( ) ; ⌂sp ⌂nf
    
    package 
    
    ;
    
.


    
      @ISA = (
      
      );
      
.

    

    
  
⌂fi
,   , , ,    ;     void  , sub { ... };
fvwm-2.6.5.orig/doc/docbook-xsl/manpages/inline.xsl0000644000175000017500000001266210574437366020442 0ustar vwcvwc ( ) © ® fvwm-2.6.5.orig/doc/docbook-xsl/manpages/Makefile.in0000644000175000017500000003115011744241232020453 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/docbook-xsl/manpages DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ EXTRA_DIST = \ ChangeLog.20020917 \ block.xsl \ charmap.groff.xsl \ docbook.xsl \ endnotes.xsl \ html-synop.xsl \ info.xsl \ inline.xsl \ lists.xsl \ other.xsl \ param.xsl \ refentry.xsl \ synop.xsl \ table.xsl \ utility.xsl all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/docbook-xsl/manpages/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/docbook-xsl/manpages/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/doc/docbook-xsl/manpages/block.xsl0000644000175000017500000002463110574437366020255 0ustar vwcvwc .PP . .sp .RS 4n .PP .RE .sp Yes .sp .RS .ft .nf .fi .ft .nf .fi .RE .sp before .PP .sp .RS .RE [IMAGE] [ ] fvwm-2.6.5.orig/doc/docbook-xsl/manpages/table.xsl0000644000175000017500000006675110574437366020263 0ustar vwcvwc : allbox center expand
.PP . *[nested▀table] .sp -1n .TS H tab( ) ; .TH .T& .TE .sp
T{ T} Warn tbl convert : Extracted a nested table [\fInested▀table\fR]* . ^ c r n l t ^ s .br ftn. # [ ]
fvwm-2.6.5.orig/doc/docbook-xsl/manpages/param.xsl0000644000175000017500000001756410574437366020272 0ustar vwcvwc 0 0 0 0 0 0 4 BI B B B MAN.MANIFEST man/ 1 1 1 , 0 @*[local-name() = 'block'] = 'Miscellaneous Technical' or (@*[local-name() = 'block'] = 'C1 Controls And Latin-1 Supplement (Latin-1 Supplement)' and @*[local-name() = 'class'] = 'symbols' ) or (@*[local-name() = 'block'] = 'General Punctuation' and (@*[local-name() = 'class'] = 'spaces' or @*[local-name() = 'class'] = 'dashes' or @*[local-name() = 'class'] = 'quotes' or @*[local-name() = 'class'] = 'bullets' ) ) or @*[local-name() = 'name'] = 'HORIZONTAL ELLIPSIS' or @*[local-name() = 'name'] = 'WORD JOINER' or @*[local-name() = 'name'] = 'SERVICE MARK' or @*[local-name() = 'name'] = 'TRADE MARK SIGN' or @*[local-name() = 'name'] = 'ZERO WIDTH NO-BREAK SPACE' ---- ======================================================================== 0 0 0 0 0 0 0 (($info[//date])[last()]/date)[1]| (($info[//pubdate])[last()]/pubdate)[1] refmeta/refmiscinfo[1]/node() (($info[//title])[last()]/title)[1]| ../title/node() refmeta/refmiscinfo[1]/node() (($info[//productname])[last()]/productname)[1]| (($info[//corpname])[last()]/corpname)[1]| (($info[//corpcredit])[last()]/corpcredit)[1]| (($info[//corpauthor])[last()]/corpauthor)[1]| (($info[//orgname])[last()]/orgname)[1]| (($info[//publishername])[last()]/publishername)[1] (($info[//productnumber])[last()]/productnumber)[1]| (($info[//edition])[last()]/edition)[1]| (($info[//releaseinfo])[last()]/releaseinfo)[1] 20 30 30 0 0 0 1 fvwm-2.6.5.orig/doc/docbook-xsl/manpages/info.xsl0000644000175000017500000006346210574437366020123 0ustar vwcvwc \n(zqu < > .SH " Author Authors " .PP .br .PP .PP .PP .sp -1n .IP "" . <\& \&> , .br , .br .br .sp -1n .IP "" . .sp -1n .IP "" . .sp -1n .IP "" . . .sp -1n .IP "" .PP .br .SH " Copyright " .br .br fvwm-2.6.5.orig/doc/docbook-xsl/manpages/refentry.xsl0000644000175000017500000002411210574437366021013 0ustar vwcvwc .br .SH " " , - .SH " " .SH " " .SS " " .RS .RE .RS .RE .ti (\n(SNu * 5u / 3u) (\n(SNu) .RS (\n(SNu) .RE fvwm-2.6.5.orig/doc/docbook-xsl/manpages/other.xsl0000644000175000017500000007127510574437366020312 0ustar vwcvwc \ \e . \. - \- ' \'   \ .\" Title: .\" Author: .\" Generator: DocBook v <http://docbook.sf.net/> .\" Date: .\" Manual: .\" Source: .\" .TH " " " " " " " " " " .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" store initial "default indentation value" .nr zq \n(IN .\" adjust default indentation .nr IN .\" adjust indentation of SS headings .nr SN \n(IN .\" enable line breaks after slashes .cflags 4 / Note: Note: (soelim stub) Note: (manifest file) fvwm-2.6.5.orig/doc/docbook-xsl/manpages/ChangeLog.200209170000644000175000017500000001532210574437366021105 0ustar vwcvwcNote: This changelog is a record of descriptions of all changes made to the DocBook XSL manpages stylesheets during the time when they were maintained in their original home in the [cvs]/docbook/contrib/xsl/db2man area of the DocBook Project source-code repository at Sourceforge; that is, from October 2001 (when they were contributed to the project by Martijn van Beers) until September 2002 (when they were moved to the [cvs]/docbook/xsl/manpages area and became a standard part of all subsequent DocBook XSL Stylesheets releases). 2002-09-17 Norman Walsh * README, db2man.xsl, lists.xsl, sect23.xsl, synop.xsl, xref.xsl: Moved to docbook/xsl/manpages * db2man.xsl, synop.xsl: Patch from Joe Orton 2002-06-16 * db2man.xsl: commit patch sent by Joe Orton: This patch adds support for using the productname, date and title out of a if one is present, rather than having to add each of these individually for every refentry. * db2man.xsl: Tim Waugh sent: This patch normalizes space in each refname before displaying it in the name section. 2002-05-21 * xref.xsl: from Joe Orton: this patch allows cross-referencing to a specific refname. I need this since I'm documenting several different (but related) functions per refentry, and want to cross-reference them individually, rather than just by the title used for the refentry as a whole. 2002-05-17 * lists.xsl: apply glosslist support patch from twaugh 2002-05-15 * db2man.xsl: slightly sanitize the filenames we generate. again from twaugh * db2man.xsl: Apply twaugh's fix for making the entity transform stuff work 2002-05-14 * db2man.xsl: generalize the tip template for all admonitions (caution,important,note,tip,warning) * db2man.xsl: Apply Joe Orton's patch, modified to be indented. Also show "Tip" in the title. so if foo, you get Tip: foo * synop.xsl: rewrote funcprototype. It used to convert all its children to a single string and the split it up again through recursion. Now has a nice foreach loop for the paramdefs, which seems much cleaner than throwing everything in a big string before processing it. 2002-05-10 * db2man.xsl: add support for simpara * db2man.xsl, lists.xsl: fix refsect2 titles * synop.xsl: also from twaugh: I found some input that goes wrong with the synop.xsl we have in CVS: -o FILE --output=FILE It gets rendered as (with *bold* and _italic_): [*-o FILE* | *--output=FILE*] The desired markup should look like: The following macro does the trick: [\fB-o \fIFILE\fR\fR | \fB--output=\fIFILE\fR\fR] The trouble is that the named template 'bold' uses value-of, and so strips of its significance. Another thing I found is that the arg/replaceable template is superfluous altogether: db2man.xsl has a 'replaceable' template which does the same thing. Here is a patch to make those two modifications. NOTE TO SELF: must try to fix bold template so we can use it everywhere 2002-05-09 * db2man.xsl: oops, removed too much * db2man.xsl: remove stuff that's apparently left-over from sect23.xsl * db2man.xsl, lists.xsl, synop.xsl: batch of patches from twaugh: * This patch (based on one from Jirka Kosek) adds support for block-level elements inside s---s for example, or lists. * This patch replaces entities (like '舒') with sensible characters or groups of characters. * This patch adds support for sbr. * This patch normalizes spaces in varlistentry terms. * This patch normalizes spaces in terminal varlistentry terms. * This patch allows variable lists to be nested (once). * This patch prevents variable list item paragraphs from merging into one another. * This patch improves the rendering of itemized lists, and adds support for ordered lists and procedures. * This patch makes some small adjustments to group/arg: don't put extra spaces in where they aren't needed, and normalize the space of $arg. * This patch makes adjustments to cmdsynopsis elements. In particular, they can now be wrapped if no is provided. * This patch adds funcsynopsis//* support. Again, wrapping is done automatically. * synop.xsl: make synopsises work for --arg=foo s too * synop.xsl: remove unneccesary adding of whitespace for arg/replaceable 2002-05-01 * db2man.xsl: This patch adds support for multiple refnames. (another twaugh patch) * db2man.xsl: modified ulink patch from twaugh. Be nice to content-less ulinks. But we don't accomodate silly people who don't understand ulink and put the url as the content too. * db2man.xsl, synop.xsl: db2man.xsl: * temporarily add some params that chunker.xsl needs * fix bold/italic templates * update calls to bold/italic templates for new syntax synop.xsl: * add support for synopfragment * update calls to bold/italic templates for new syntax 2002-04-30 * db2man.xsl: Add twaug's patch for xref support * db2man.xsl: This patch adds support for: - Multiple authors. - A (single) man page editor. (another patch from twaugh) * db2man.xsl: more twaugh patches: - Use refentrytitle, not refname[1], for title. - Upper-case it. - Use date, productname, and title. - Pick up author from main document if not contained in refentry. - Use refname[1] for man page filename, not refentrytitle. * db2man.xsl: add varname support * db2man.xsl: This patch makes userinput (an inline element) have inline formatting. * db2man.xsl: This patch adds support for the top-level document being something other than an article. It also emits a helpful warning if no refentry elements are found. * db2man.xsl: next twaugh patch: Instead of writing to stdout, create a file for each refentry. Plus, for bonus points, a file for each additional refname within that entry (pointing to the main page). * db2man.xsl: Add named templates for bold-ifying and italicizing stuff. Inspired by yet another twaugh patch * db2man.xsl, lists.xsl, sect23.xsl: consistently use instead of a newline * db2man.xsl, synop.xsl: * add support for informalexample, screen, errorcode, constant, type, quote, programlisting and citerefentry * use the 'bold' and 'italic' named templates * xref.xsl: New file. 2001-12-01 Norman Walsh * README, db2man.xsl, lists.xsl, sect23.xsl, synop.xsl: New file. fvwm-2.6.5.orig/doc/docbook-xsl/manpages/Makefile.am0000644000175000017500000000036010655362500020443 0ustar vwcvwcEXTRA_DIST = \ ChangeLog.20020917 \ block.xsl \ charmap.groff.xsl \ docbook.xsl \ endnotes.xsl \ html-synop.xsl \ info.xsl \ inline.xsl \ lists.xsl \ other.xsl \ param.xsl \ refentry.xsl \ synop.xsl \ table.xsl \ utility.xsl fvwm-2.6.5.orig/doc/docbook-xsl/manpages/charmap.groff.xsl0000644000175000017500000045314610717552354021701 0ustar vwcvwc fvwm-2.6.5.orig/doc/docbook-xsl/manpages/lists.xsl0000644000175000017500000003145010574437366020316 0ustar vwcvwc \n(zqu .sp .PP .PP .br .RS .RE .sp .sp .RS \h'- 0 ' \h'+ 0 ' .RE .sp .RS \h'- 0 ' \h'+ 0 ' .RE .PP .sp .RE .PP .IP "" , .IP "" .PP .\" line length increase to cope w/ tbl weirdness .ll +(\n(LLu * 62u / 100u) .TS l . .TE .\" line length decrease back to previous value .ll -(\n(LLu * 62u / 100u) .sp T{ T} fvwm-2.6.5.orig/doc/docbook-xsl/manpages/synop.xsl0000644000175000017500000002647310574437366020341 0ustar vwcvwc | ( ) .sp -1n .HP ( ) .br▒ .ad l .hy 0 .HP .ad .hy .ad l .hy 0 .ad .hy .HP . " ( " void); ...); , ); "░" "░" ( ) fvwm-2.6.5.orig/doc/docbook-xsl/manpages/endnotes.xsl0000644000175000017500000004734610574437366021012 0ustar vwcvwc \% \&[ ] .SH " " .IP " . " .RS \% .RE fvwm-2.6.5.orig/doc/docbook-xsl/lib/0000755000175000017500000000000011744241502015361 5ustar vwcvwcfvwm-2.6.5.orig/doc/docbook-xsl/lib/Makefile.in0000644000175000017500000003060111744241232017426 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/docbook-xsl/lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ EXTRA_DIST = \ lib.xsl all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/docbook-xsl/lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/docbook-xsl/lib/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/doc/docbook-xsl/lib/lib.xsl0000644000175000017500000005215410574437366016705 0ustar vwcvwc http://... Unrecognized unit of measure: . Unrecognized unit of measure: . filename 1 / / Error: To process character-map subsets, you must use an XSLT engine that supports the evaluate() XSLT extension function. Your XSLT engine does not support it. fvwm-2.6.5.orig/doc/docbook-xsl/lib/Makefile.am0000644000175000017500000000003010655362500017410 0ustar vwcvwcEXTRA_DIST = \ lib.xsl fvwm-2.6.5.orig/doc/docbook-xsl/html/0000755000175000017500000000000011744241502015557 5ustar vwcvwcfvwm-2.6.5.orig/doc/docbook-xsl/html/docbook.xsl0000644000175000017500000004207410574437341017746 0ustar vwcvwc Element in namespace ' ' encountered in , but no template matches. < > </ > white black #0000FF #840084 #0000FF <xsl:copy-of select="$title"/> Stripping namespace from DocBook 5 document. Processing stripped document. Unable to strip the namespace from DB5 document, cannot proceed. ID ' ' not found in document. 0 fvwm-2.6.5.orig/doc/docbook-xsl/html/keywords.xsl0000644000175000017500000000230410574437341020165 0ustar vwcvwc , fvwm-2.6.5.orig/doc/docbook-xsl/html/graphics.xsl0000644000175000017500000015343710574437341020134 0ustar vwcvwc 1 1
0 0 0 1 0 1.0 1.0 1.0 px px px px 0 0 middle Warning: imagemaps not supported on scaled images 0 middle height: px
background-color:
calspair , , , Warning: only calspair or otherunits='imagemap' supported in imageobjectco
middle
No insertfile extension available.
No insertfile extension available.
No insertfile extension available.
fvwm-2.6.5.orig/doc/docbook-xsl/html/glossary.xsl0000644000175000017500000003634710574437341020177 0ustar vwcvwc %common.entities; ]>

0 1 ( )
0 1 ( )
0 1
, , ,

Warning: glosssee @otherterm reference not found: .

Warning: glossseealso @otherterm reference not found: . , Warning: processing automatic glossary without a glossary.collection file. Warning: processing automatic glossary but unable to open glossary.collection file ' '
fvwm-2.6.5.orig/doc/docbook-xsl/html/inline.xsl0000644000175000017500000013023310574437341017577 0ustar vwcvwc ]> 1 0 XLink to nonexistent id: span ( ) , , abbr acronym http://example.com/cgi-bin/man.cgi? ( ) emphasis SM Warning: glossary.collection specified, but there are automatic glossaries There's no entry for in Error: no glossentry for glossterm: . element </ > & ; &# ; % ; <? > <? ?> < > < /> <!-- --> < mailto: > + - - - - ( ) [ ] [ ]

fvwm-2.6.5.orig/doc/docbook-xsl/html/biblio-iso690.xsl0000644000175000017500000015626110574437341020621 0ustar vwcvwc In fvwm-2.6.5.orig/doc/docbook-xsl/html/math.xsl0000644000175000017500000002173110574437341017254 0ustar vwcvwc Unsupported TeX math notation: \nopagenumbers \bye \special{dvi2bitmap outputfile } $ $ \vfill\eject \special{dvi2bitmap outputfile } $$ $$ \vfill\eject \documentclass{article} \pagestyle{empty} \begin{document} \end{document} \special{dvi2bitmap outputfile } $ $ \newpage \special{dvi2bitmap outputfile } $$ $$ \newpage 0 0 1 fvwm-2.6.5.orig/doc/docbook-xsl/html/htmltbl.xsl0000644000175000017500000000306210574437341017766 0ustar vwcvwc fvwm-2.6.5.orig/doc/docbook-xsl/html/Makefile.in0000644000175000017500000003173311744241232017633 0ustar vwcvwc# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/docbook-xsl/html DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ ALL_DOMAINS = @ALL_DOMAINS@ ALL_LINGUAS = @ALL_LINGUAS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ Bidi_CFLAGS = @Bidi_CFLAGS@ Bidi_LIBS = @Bidi_LIBS@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOC_COMMANDS = @DOC_COMMANDS@ DOC_COMMANDS_HTML = @DOC_COMMANDS_HTML@ DOC_COMMANDS_XML = @DOC_COMMANDS_XML@ DOC_COMMANDS_XML_PATH = @DOC_COMMANDS_XML_PATH@ DOC_MODULES = @DOC_MODULES@ DOC_MODULES_HTML = @DOC_MODULES_HTML@ DOC_SECTIONS = @DOC_SECTIONS@ DOC_SECTIONS_XML = @DOC_SECTIONS_XML@ DOC_SECTIONS_XML_PATH = @DOC_SECTIONS_XML_PATH@ DUMMYPOFILES = @DUMMYPOFILES@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FC_CFLAGS = @FC_CFLAGS@ FC_CONFIG = @FC_CONFIG@ FC_LIBS = @FC_LIBS@ FRIBIDI_CONFIG = @FRIBIDI_CONFIG@ FT2_CFLAGS = @FT2_CFLAGS@ FT2_CONFIG = @FT2_CONFIG@ FT2_LIBS = @FT2_LIBS@ FVWMALTFTP = @FVWMALTFTP@ FVWMALTFTPDIR = @FVWMALTFTPDIR@ FVWMFTP = @FVWMFTP@ FVWMFTPDIR = @FVWMFTPDIR@ FVWMGTK = @FVWMGTK@ FVWMHOMEPAGE = @FVWMHOMEPAGE@ FVWMLIST = @FVWMLIST@ FVWMNAMELONG = @FVWMNAMELONG@ FVWMSCRIPT_DOMAIN = @FVWMSCRIPT_DOMAIN@ FVWMTASKBAR_DOMAIN = @FVWMTASKBAR_DOMAIN@ FVWMWORKERSLIST = @FVWMWORKERSLIST@ FVWMWORKERSLISTLONG = @FVWMWORKERSLISTLONG@ FVWM_CONFDIR = @FVWM_CONFDIR@ FVWM_CPP = @FVWM_CPP@ FVWM_DATADIR = @FVWM_DATADIR@ FVWM_DOCDIR = @FVWM_DOCDIR@ FVWM_DOMAIN = @FVWM_DOMAIN@ FVWM_IMAGEPATH = @FVWM_IMAGEPATH@ FVWM_MODULEDIR = @FVWM_MODULEDIR@ FVWM_PERLLIB = @FVWM_PERLLIB@ FVWM_PERLLIBDIR = @FVWM_PERLLIBDIR@ GDK_IMLIB_CFLAGS = @GDK_IMLIB_CFLAGS@ GDK_IMLIB_LIBS = @GDK_IMLIB_LIBS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GNOMEUI_LIBS = @GNOMEUI_LIBS@ GNOME_CONFIG = @GNOME_CONFIG@ GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ GNOME_LIBDIR = @GNOME_LIBDIR@ GNOME_LIBS = @GNOME_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_CONFIG = @GTK_CONFIG@ GTK_LIBS = @GTK_LIBS@ IMLIBCONF = @IMLIBCONF@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INST_LINGUAS = @INST_LINGUAS@ ISRELEASED = @ISRELEASED@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LOCALEDIR = @LOCALEDIR@ LOCAL_BUGADDR = @LOCAL_BUGADDR@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANFVWMGTK = @MANFVWMGTK@ MANPAGE_PREAMBLE = @MANPAGE_PREAMBLE@ MKDIR_P = @MKDIR_P@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGUNIQ = @MSGUNIQ@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ RELDATELONG = @RELDATELONG@ RELDATENUM = @RELDATENUM@ RELDATESHORT = @RELDATESHORT@ REQUIRED_PERL_VERSION = @REQUIRED_PERL_VERSION@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ UPDATEPOFILES = @UPDATEPOFILES@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ VERSIONINFO = @VERSIONINFO@ XFT_CFLAGS = @XFT_CFLAGS@ XFT_CONFIG = @XFT_CONFIG@ XFT_LIBS = @XFT_LIBS@ XGETTEXT = @XGETTEXT@ XMKMF = @XMKMF@ XSLTPROC = @XSLTPROC@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ Xcursor_CFLAGS = @Xcursor_CFLAGS@ Xcursor_LIBS = @Xcursor_LIBS@ Xft_CFLAGS = @Xft_CFLAGS@ Xft_LIBS = @Xft_LIBS@ Xinerama_CFLAGS = @Xinerama_CFLAGS@ Xinerama_LIBS = @Xinerama_LIBS@ Xrender_CFLAGS = @Xrender_CFLAGS@ Xrender_LIBS = @Xrender_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ iconv_CFLAGS = @iconv_CFLAGS@ iconv_LIBS = @iconv_LIBS@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ intl_CFLAGS = @intl_CFLAGS@ intl_LIBS = @intl_LIBS@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ png_CFLAGS = @png_CFLAGS@ png_LIBS = @png_LIBS@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ readline_CFLAGS = @readline_CFLAGS@ readline_LIBS = @readline_LIBS@ rplay_CFLAGS = @rplay_CFLAGS@ rplay_LIBS = @rplay_LIBS@ rsvg_CFLAGS = @rsvg_CFLAGS@ rsvg_LIBS = @rsvg_LIBS@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ stroke_CFLAGS = @stroke_CFLAGS@ stroke_LIBS = @stroke_LIBS@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_bidi = @with_bidi@ with_gdkimlib = @with_gdkimlib@ with_gettext = @with_gettext@ with_gnomelibs = @with_gnomelibs@ with_gtk = @with_gtk@ with_iconv = @with_iconv@ with_perllib = @with_perllib@ with_png = @with_png@ with_readline = @with_readline@ with_rplay = @with_rplay@ with_rsvg = @with_rsvg@ with_shape = @with_shape@ with_shm = @with_shm@ with_sm = @with_sm@ with_stroke = @with_stroke@ with_xcursor = @with_xcursor@ with_xft = @with_xft@ with_xinerama = @with_xinerama@ with_xpm = @with_xpm@ with_xrender = @with_xrender@ xpm_CFLAGS = @xpm_CFLAGS@ xpm_LIBS = @xpm_LIBS@ EXTRA_DIST = \ admon.xsl \ annotations.xsl \ autoidx.xsl \ autotoc.xsl \ biblio-iso690.xsl \ biblio.xsl \ block.xsl \ callout.xsl \ chunker.xsl \ component.xsl \ division.xsl \ docbook.xsl \ ebnf.xsl \ footnote.xsl \ formal.xsl \ glossary.xsl \ graphics.xsl \ highlight.xsl \ html-rtf.xsl \ html.xsl \ htmltbl.xsl \ index.xsl \ info.xsl \ inline.xsl \ keywords.xsl \ lists.xsl \ manifest.xsl \ math.xsl \ param.xsl \ pi.xsl \ qandaset.xsl \ refentry.xsl \ sections.xsl \ synop.xsl \ table.xsl \ task.xsl \ titlepage.templates.xsl \ titlepage.xsl \ toc.xsl \ verbatim.xsl \ xref.xsl all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/docbook-xsl/html/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/docbook-xsl/html/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fvwm-2.6.5.orig/doc/docbook-xsl/html/task.xsl0000644000175000017500000000445010574437341017264 0ustar vwcvwc before
fvwm-2.6.5.orig/doc/docbook-xsl/html/footnote.xsl0000644000175000017500000002312410574437341020156 0ustar vwcvwc #ftn. [ ] [ ] #ftn. [ ] ftn. #

[ ]

ftn. # [ ]


The following annotations are from this essay. You are seeing them here because your browser doesn’t support the user-interface techniques used to make them appear as ‘popups’ on modern browsers.

Warning: footnote number may not be generated correctly; unexpected as first child of footnote.
fvwm-2.6.5.orig/doc/docbook-xsl/html/block.xsl0000644000175000017500000002747310574437341017426 0ustar vwcvwc

 
   
  --

--

nbsp , ,

fvwm-2.6.5.orig/doc/docbook-xsl/html/ebnf.xsl0000644000175000017500000002370510574437341017240 0ustar vwcvwc $Id: ebnf.xsl,v 1.1 2007/03/10 05:15:13 scott Exp $ Walsh Norman 19992000 Norman Walsh HTML EBNF Reference
Introduction This is technical reference documentation for the DocBook XSL Stylesheets; it documents (some of) the parameters, templates, and other elements of the stylesheets. This reference describes the templates and parameters relevant to formatting EBNF markup. This is not intended to be user documentation. It is provided for developers writing customization layers for the stylesheets, and for anyone who's interested in how it works. Although I am trying to be thorough, this documentation is known to be incomplete. Don't forget to read the source, too :-)
1 EBNF for
EBNF productions
[ ]   Error: no ID for productionrecap linkend: . Warning: multiple "IDs" for productionrecap linkend: . |
production Non-terminals with no content must point to production elements in the current document. Invalid xpointer for empty nt: ??? /*   */
constraintdef : :  ]

fvwm-2.6.5.orig/doc/docbook-xsl/html/annotations.xsl0000644000175000017500000001303110574437341020652 0ustar vwcvwc