NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
simple.h File Reference

Simple Dialog Windows. More...

#include "menu/lib.h"
#include "mutt_window.h"
+ Include dependency graph for simple.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct MuttWindowsimple_dialog_new (enum MenuType mtype, enum WindowType wtype, const struct Mapping *help_data)
 Create a simple index Dialog. More...
 
void simple_dialog_free (struct MuttWindow **ptr)
 Destroy a simple index Dialog. More...
 

Detailed Description

Simple Dialog Windows.

Authors
  • Richard Russon

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 http://www.gnu.org/licenses/.

Definition in file simple.h.

Function Documentation

◆ simple_dialog_new()

struct MuttWindow* simple_dialog_new ( enum MenuType  mtype,
enum WindowType  wtype,
const struct Mapping help_data 
)

Create a simple index Dialog.

Parameters
mtypeMenu type, e.g. MENU_ALIAS
wtypeDialog type, e.g. WT_DLG_ALIAS
help_dataData for the Help Bar
Return values
ptrNew Dialog Window

Definition at line 128 of file simple.c.

130 {
131  struct MuttWindow *dlg =
134  dlg->help_menu = mtype;
135  dlg->help_data = help_data;
136 
137  struct MuttWindow *win_index = menu_new_window(mtype, NeoMutt->sub);
138  dlg->focus = win_index;
139  dlg->wdata = win_index->wdata;
140 
141  struct MuttWindow *win_sbar = sbar_new(dlg);
142  const bool c_status_on_top = cs_subset_bool(NeoMutt->sub, "status_on_top");
143  if (c_status_on_top)
144  {
145  mutt_window_add_child(dlg, win_sbar);
146  mutt_window_add_child(dlg, win_index);
147  }
148  else
149  {
150  mutt_window_add_child(dlg, win_index);
151  mutt_window_add_child(dlg, win_sbar);
152  }
153 
156  dialog_push(dlg);
157 
158  return dlg;
159 }
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:73
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
Definition: mutt_window.h:141
Window uses all available vertical space.
Definition: mutt_window.h:38
static int simple_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t.
Definition: simple.c:101
struct MuttWindow * sbar_new(struct MuttWindow *parent)
Add the Simple Bar (status)
Definition: sbar.c:197
Container for Accounts, Notifications.
Definition: neomutt.h:36
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:53
struct MuttWindow * focus
Focussed Window.
Definition: mutt_window.h:140
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:138
void dialog_push(struct MuttWindow *dlg)
Display a Window to the user.
Definition: dialog.c:105
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition: notify.c:189
static int simple_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t.
Definition: simple.c:79
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition: mutt_window.h:52
const struct Mapping * help_data
Data for the Help Bar.
Definition: mutt_window.h:142
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:468
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:42
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
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
Window wants as much space as possible.
Definition: mutt_window.h:48
void * wdata
Private data.
Definition: mutt_window.h:145
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ simple_dialog_free()

void simple_dialog_free ( struct MuttWindow **  ptr)

Destroy a simple index Dialog.

Parameters
ptrDialog Window to destroy

Definition at line 165 of file simple.c.

166 {
167  if (!ptr || !*ptr)
168  return;
169 
170  dialog_pop();
171  mutt_window_free(ptr);
172 }
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
Definition: mutt_window.c:200
void dialog_pop(void)
Hide a Window from the user.
Definition: dialog.c:139
+ Here is the call graph for this function:
+ Here is the caller graph for this function: