NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
window.c
Go to the documentation of this file.
1 
70 #include "config.h"
71 #include "private.h"
72 #include "mutt/lib.h"
73 #include "gui/lib.h"
74 #include "lib.h"
75 #include "type.h"
76 
77 struct ConfigSubset;
78 
82 static int menu_recalc(struct MuttWindow *win)
83 {
84  if (win->type != WT_MENU)
85  return 0;
86 
87  // struct Menu *menu = win->wdata;
88 
89  win->actions |= WA_REPAINT;
90  mutt_debug(LL_DEBUG5, "recalc done, request WA_REPAINT\n");
91  return 0;
92 }
93 
97 static int menu_repaint(struct MuttWindow *win)
98 {
99  if (win->type != WT_MENU)
100  return 0;
101 
102  // struct Menu *menu = win->wdata;
103  // menu_redraw(menu);
104  // menu->redraw = MENU_REDRAW_NO_FLAGS;
105 
106  mutt_debug(LL_DEBUG5, "repaint done\n");
107  return 0;
108 }
109 
113 static void menu_wdata_free(struct MuttWindow *win, void **ptr)
114 {
115  menu_free((struct Menu **) ptr);
116 }
117 
125 {
126  struct MuttWindow *win =
129 
130  struct Menu *menu = menu_new(type, win, sub);
131 
132  win->recalc = menu_recalc;
133  win->repaint = menu_repaint;
134  win->wdata = menu;
136 
137  return win;
138 }
Convenience wrapper for the gui headers.
MenuType
Types of GUI selections.
Definition: type.h:35
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:160
Definition: lib.h:67
#define WA_REPAINT
Redraw the contents of the Window.
Definition: mutt_window.h:111
Window uses all available vertical space.
Definition: mutt_window.h:38
static int menu_recalc(struct MuttWindow *win)
Recalculate the Window data - Implements MuttWindow::recalc() -.
Definition: window.c:82
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
Definition: mutt_window.h:132
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
static void menu_wdata_free(struct MuttWindow *win, void **ptr)
Destroy a Menu Window - Implements MuttWindow::wdata_free() -.
Definition: window.c:113
A set of inherited config items.
Definition: subset.h:46
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition: mutt_window.h:52
static int menu_repaint(struct MuttWindow *win)
Repaint the Window - Implements MuttWindow::repaint() -.
Definition: window.c:97
#define mutt_debug(LEVEL,...)
Definition: logging.h:85
int(* repaint)(struct MuttWindow *win)
Definition: mutt_window.h:182
int(* recalc)(struct MuttWindow *win)
Definition: mutt_window.h:171
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
Definition: mutt_window.c:180
Log at debug level 5.
Definition: logging.h:44
Convenience wrapper for the library headers.
Window wants as much space as possible.
Definition: mutt_window.h:48
void * wdata
Private data.
Definition: mutt_window.h:145
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:144
An Window containing a Menu.
Definition: mutt_window.h:98
Menu types.