/* * This file is part of firk's window manager for x11 (fwm) * Copyright (C) 2022 firk * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * 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. */ #ifndef _FWM_MENU_DIRSCAN_H_ #define _FWM_MENU_DIRSCAN_H_ #define MAX_MENU_DIRS 100 #define MAX_MENU_ENTRIES 256 #define MAX_MENU_NESTING 100 typedef struct menu_list t_menu_list; typedef struct menu_entry t_menu_entry; struct menu_list { char const *myname; /* not allocated */ int *fds; struct { /* entries */ size_t n; size_t sel_stable; size_t sel; size_t display_start; size_t display_count; size_t display_sstep; t_menu_entry *list; } e; struct { Window win; int x0, y0; unsigned w, h; int sub_dir; /* direction of submenus */ int hpad_need_redraw; int vpad_need_redraw; } gui; }; struct menu_entry { size_t fd_idx; char const *name; int isdir; t_desktop_file xdg; int need_redraw; }; extern char const *dirs[MAX_MENU_DIRS]; extern size_t ND; extern t_menu_list menus[MAX_MENU_NESTING]; extern size_t NM; extern int debug_dirscan; extern void menu_list_open(char const *name); extern void menu_list_close(void); #endif