1 /*********************************************************************** 2 * afterstep FEEL include file 3 ***********************************************************************/ 4 #ifndef ASFEEL_HEADER_FILE_INCLUDED 5 #define ASFEEL_HEADER_FILE_INCLUDED 6 7 #ifdef __cplusplus 8 extern "C" { 9 #endif 10 11 /* Cursor types */ 12 enum ASCursorTypes 13 { 14 ASCUR_Position = 0, /* upper Left corner cursor */ 15 ASCUR_Title, /* title-bar cursor */ 16 ASCUR_Default, /* cursor for apps to inherit */ 17 ASCUR_Sys, /* sys-menu and iconify boxes cursor */ 18 ASCUR_Move, /* resize cursor */ 19 ASCUR_Wait, /* wait a while cursor */ 20 ASCUR_Menu, /* menu cursor */ 21 ASCUR_Select, /* dot cursor for f.move, etc. from menus */ 22 ASCUR_Destroy, /* skull and cross bones, f.destroy */ 23 ASCUR_Top, 24 ASCUR_Right, 25 ASCUR_Bottom, 26 ASCUR_Left, 27 ASCUR_TopLeft, 28 ASCUR_TopRight, 29 ASCUR_BottomLeft, 30 ASCUR_BottomRight, 31 ASCUR_UsefulCursors 32 }; 33 34 /* MENU SORT MODS : */ 35 #define SORTBYALPHA 1 36 #define SORTBYDATE 2 37 38 typedef enum ASWinListSortOrderVals { 39 ASO_Circulation = 0, 40 ASO_Alpha, 41 /* TODO: */ 42 ASO_Stacking, 43 ASO_Creation, 44 ASO_Default = ASO_Circulation 45 }ASWinListSortOrderVals; 46 47 struct name2const { 48 const char* name; 49 const int value; 50 }; 51 52 /* for the flags value - these used to be separate Bool's */ 53 typedef enum /* feel file flags */ 54 { 55 ClickToFocus = (1 << 0), /* Focus follows or click to focus */ 56 DecorateTransients = (1 << 1), /* decorate transient windows? */ 57 DontMoveOff = (1 << 2), /* make sure windows stay on desk */ 58 SuppressIcons = (1 << 3), /* prevent generating icon win */ 59 StickyIcons = (1 << 4), /* Icons always sticky? */ 60 EdgeWrapX = (1 << 5), /* Should EdgeScroll wrap around? */ 61 EdgeWrapY = (1 << 6), 62 CenterOnCirculate = (1 << 7), /* center window on circulate ? */ 63 KeepIconWindows = (1 << 8), 64 ClickToRaise = (1 << 9), 65 EatFocusClick = (1 << 10), 66 NoPPosition = (1 << 11), 67 CirculateSkipIcons = (1 << 12), 68 StubbornIcons = (1 << 13), 69 StubbornPlacement = (1 << 14), 70 StubbornIconPlacement = (1 << 15), 71 BackingStore = (1 << 16), 72 AppsBackingStore = (1 << 17), 73 SaveUnders = (1 << 18), 74 SloppyFocus = (1 << 19), 75 IconTitle = (1 << 20), 76 FollowTitleChanges = (1 << 21), 77 AutoTabThroughDesks = (1 << 22), 78 DoHandlePageing = (1 << 23), 79 DontRestoreFocus = (1 << 24), 80 PersistentMenus = (1 << 25), 81 DontAnimateBackground = (1 << 26), 82 WinListHideIcons = (1 << 27), 83 AnimateDeskChange = (1 << 28), 84 DontCoverDesktop = (1 << 29), 85 WarpPointer = (1 << 30) 86 }FeelFlags; 87 88 /* since we have too many feel flags - we want another enum for 89 feel set flags, that will indicate which option is set ny user */ 90 typedef enum /* feel file set flags */ 91 { 92 FEEL_ClickTime = (0x01<<0), 93 FEEL_OpaqueMove = (0x01<<1), 94 FEEL_OpaqueResize = (0x01<<2), 95 FEEL_AutoRaise = (0x01<<3), 96 FEEL_AutoReverse = (0x01<<4), 97 FEEL_DeskAnimationType = (0x01<<5), 98 FEEL_DeskAnimationSteps = (0x01<<6), 99 100 FEEL_XorValue = (0x01<<7), 101 FEEL_Xzap = (0x01<<8), 102 FEEL_Yzap = (0x01<<9), 103 104 FEEL_ClickToRaise = (0x01<<10), 105 106 FEEL_EdgeScroll = (0x01<<11), 107 FEEL_EdgeResistance = (0x01<<12), 108 FEEL_ShadeAnimationSteps = (0x01<<13), 109 FEEL_ExternalMenus = (0x01<<14), 110 FEEL_EdgeResistanceToDragging = (0x01<<15) 111 112 }FeelSetValFlags; 113 114 115 116 typedef enum{ 117 ASP_SmartPlacement = 0, 118 ASP_RandomPlacement, 119 ASP_Tile, 120 ASP_Cascade, 121 ASP_UnderPointer, 122 ASP_Manual 123 }ASPlacementStrategy ; 124 125 typedef enum 126 { 127 ASP_UseMainStrategy = 0, 128 ASP_UseBackupStrategy 129 }ASUsePlacementStrategy ; 130 131 typedef struct ASWindowBox 132 { 133 134 #define ASA_Virtual (0x01<<0) 135 #define ASA_ReverseOrderH (0x01<<1) 136 #define ASA_ReverseOrderV (0x01<<2) 137 #define ASA_ReverseOrder (ASA_ReverseOrderH|ASA_ReverseOrderV) 138 #define ASA_VerticalPriority (0x01<<3) 139 #define ASA_AreaSet (0x01<<4) 140 #define ASA_MainStrategySet (0x01<<5) 141 #define ASA_BackupStrategySet (0x01<<6) 142 #define ASA_MinWidthSet (0x01<<7) 143 #define ASA_MinHeightSet (0x01<<8) 144 #define ASA_MaxWidthSet (0x01<<9) 145 #define ASA_MaxHeightSet (0x01<<10) 146 #define ASA_DesktopSet (0x01<<11) 147 #define ASA_MinLayerSet (0x01<<12) 148 #define ASA_MaxLayerSet (0x01<<13) 149 #define ASA_XSpacingSet (0x01<<14) 150 #define ASA_YSpacingSet (0x01<<15) 151 152 ASFlagType set_flags; 153 ASFlagType flags; 154 155 char *name ; 156 ASGeometry area ; /* could be aither screen region or virtual region */ 157 158 ASPlacementStrategy main_strategy; /* how to place window in the empty space :Smart, Random Or Tile */ 159 ASPlacementStrategy backup_strategy ; /* how to place window if no empty space of 160 * sufficient size exists: Random, Cascade or Manual*/ 161 unsigned int min_width, min_height ; 162 unsigned int max_width, max_height ; 163 int min_layer, max_layer ; 164 165 int desk ; 166 167 int x_spacing, y_spacing ; 168 /* this store status : */ 169 unsigned int cascade_pos ; /* gets incremented every time window is cascaded */ 170 171 }ASWindowBox; 172 173 typedef enum { 174 AST_OneDirection = 0, 175 AST_ClosedLoop = 1, 176 AST_OpenLoop = 2 177 }ASTabbingReverse; 178 179 typedef struct MouseButton 180 { 181 int Button; 182 int Context; 183 int Modifier; 184 struct MouseButton *NextButton; 185 struct FunctionData *fdata; 186 }MouseButton; 187 188 typedef struct FuncKey 189 { 190 struct FuncKey *next; /* next in the list of function keys */ 191 char *name; /* key name */ 192 KeyCode keycode; /* X keycode */ 193 int cont; /* context */ 194 int mods; /* modifiers */ 195 196 struct FunctionData *fdata ; 197 }FuncKey; 198 199 typedef struct ASFeel 200 { 201 unsigned long magic; 202 203 unsigned long set_flags; /* what options were set by user */ 204 unsigned long flags; /* feel file flags */ 205 206 /* for compatibility with old configs : */ 207 #define FEEL_DEPRECATED_RandomPlacement (0x01 << 0) /* random windows placement */ 208 #define FEEL_DEPRECATED_SmartPlacement (0x01 << 1) /* smart placement */ 209 ASFlagType deprecated_flags; 210 211 ASFlagType set_val_flags; /* see enum FeelSetValFlags */ 212 213 unsigned int ClickTime; /* Max buttonclickdelay for Function built-in */ 214 unsigned int OpaqueMove; /* Keep showing window while being moved if size<N% */ 215 unsigned int OpaqueResize; /* Keep showing window while being resized if size<N% */ 216 int AutoRaiseDelay; /* Delay between setting focus and raisingwin */ 217 218 #define FEEL_WARP_ONEWAY 0 219 #define FEEL_WARP_YOYO 1 220 #define FEEL_WARP_ENDLESS 2 221 unsigned int AutoReverse; 222 223 int XorValue ; 224 int Xzap, Yzap; 225 226 long RaiseButtons; /* The buttons to do click-to-raise */ 227 228 int EdgeScrollX; /* % of the screen width to scroll on screen edge */ 229 int EdgeScrollY; /* % of the screen height to scroll on screen edge */ 230 int EdgeResistanceScroll; /* #pixels to scroll on screen edge */ 231 int EdgeAttractionScreen; /* #pixels to scroll on screen edge */ 232 int EdgeAttractionWindow; /* #pixels to scroll on screen edge */ 233 int EdgeResistanceMove; /* #pixels to scroll on screen edge */ 234 int EdgeResistanceDragScroll; /* #pixels to scroll on screen edge while dragging the window */ 235 int ShadeAnimationSteps; 236 237 struct ASHashTable *Popups ; 238 struct ASHashTable *ComplexFunctions ; 239 240 struct MouseButton *MouseButtonRoot; 241 struct FuncKey *FuncKeyRoot; 242 243 Cursor cursors[MAX_CURSORS]; 244 245 ASFlagType buttons2grab ; /* calculated after all the mouse bindings are set */ 246 /* TODO: add no_snaping_mod to Feel parsing code : */ 247 unsigned int no_snaping_mod ; /* modifyer mask that disables snapping to edges whle move/resizing the window */ 248 249 ASWindowBox *window_boxes ; 250 ASWindowBox *default_window_box ; 251 char *default_window_box_name ; 252 unsigned int window_boxes_num ; 253 254 unsigned int recent_submenu_items; 255 256 unsigned int desk_cover_animation_steps ; 257 unsigned int desk_cover_animation_type ; 258 259 int conserve_memory ; 260 261 ASWinListSortOrderVals winlist_sort_order; 262 }ASFeel; 263 264 265 266 /***************************************************************************/ 267 /* Function Prototypes */ 268 /***************************************************************************/ 269 270 void init_asfeel( ASFeel *feel ); 271 ASFeel *create_asfeel (); 272 void destroy_asfeel( ASFeel *feel, Bool reusable ); 273 void check_feel_sanity(ASFeel *feel); 274 275 void apply_context_cursor( Window w, ASFeel *feel, unsigned long context ); 276 void recolor_feel_cursors( ASFeel *feel, CARD32 fore, CARD32 back ); 277 278 279 ASWindowBox *create_aswindow_box( const char *name ); 280 void destroy_aswindow_box( ASWindowBox *aswbox, Bool reusable ); 281 void print_window_box (ASWindowBox *aswbox, int index); 282 ASWindowBox* find_window_box( ASFeel *feel, const char *name ); 283 284 285 void init_list_of_menus(ASHashTable **list, Bool force); 286 287 #ifdef __cplusplus 288 } 289 #endif 290 291 292 293 #endif /* SFEEL_HEADER_FILE_INCLUDED */ 294