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

Simple Bar. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

struct MuttWindowsbar_new (struct MuttWindow *parent)
 Add the Simple Bar (status) More...
 
void sbar_set_title (struct MuttWindow *win, const char *title)
 Set the title for the Simple Bar. More...
 

Detailed Description

Simple Bar.

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 sbar.h.

Function Documentation

◆ sbar_new()

struct MuttWindow* sbar_new ( struct MuttWindow parent)

Add the Simple Bar (status)

Parameters
parentParent Window
Return values
ptrNew Simple Bar

Definition at line 197 of file sbar.c.

198 {
199  struct MuttWindow *win_sbar =
202 
203  win_sbar->wdata = sbar_data_new();
204  win_sbar->wdata_free = sbar_wdata_free;
205  win_sbar->recalc = sbar_recalc;
206  win_sbar->repaint = sbar_repaint;
207 
210 
211  return win_sbar;
212 }
static int sbar_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t.
Definition: sbar.c:145
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:160
Window uses all available vertical space.
Definition: mutt_window.h:38
static int sbar_repaint(struct MuttWindow *win)
Repaint the Window - Implements MuttWindow::repaint() -.
Definition: sbar.c:94
Container for Accounts, Notifications.
Definition: neomutt.h:36
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:53
Status Bar containing extra info about the Index/Pager/etc.
Definition: mutt_window.h:102
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:138
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
Window has a fixed size.
Definition: mutt_window.h:47
Colour has changed, NotifyColor, EventColor.
Definition: notify_type.h:39
static int sbar_recalc(struct MuttWindow *win)
Recalculate the Window data - Implements MuttWindow::recalc() -.
Definition: sbar.c:81
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition: mutt_window.h:52
static int sbar_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t.
Definition: sbar.c:118
static void sbar_wdata_free(struct MuttWindow *win, void **ptr)
Free the private data attached to the MuttWindow - Implements MuttWindow::wdata_free() -...
Definition: sbar.c:173
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
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
void * wdata
Private data.
Definition: mutt_window.h:145
static struct SBarPrivateData * sbar_data_new(void)
Free the private data attached to the MuttWindow.
Definition: sbar.c:185
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sbar_set_title()

void sbar_set_title ( struct MuttWindow win,
const char *  title 
)

Set the title for the Simple Bar.

Parameters
winWindow of the Simple Bar
titleString to set
Note
The title string will be copied

Definition at line 221 of file sbar.c.

222 {
223  if (!win || !win->wdata || (win->type != WT_STATUS_BAR))
224  return;
225 
226  struct SBarPrivateData *priv = win->wdata;
227  mutt_str_replace(&priv->display, title);
228 
229  win->actions |= WA_REPAINT;
230 }
#define WA_REPAINT
Redraw the contents of the Window.
Definition: mutt_window.h:111
char * display
Cached display string.
Definition: sbar.c:75
Status Bar containing extra info about the Index/Pager/etc.
Definition: mutt_window.h:102
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
Definition: mutt_window.h:132
Private data for the Simple Bar.
Definition: sbar.c:73
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:446
void * wdata
Private data.
Definition: mutt_window.h:145
enum WindowType type
Window type, e.g. WT_SIDEBAR.
Definition: mutt_window.h:144
+ Here is the call graph for this function:
+ Here is the caller graph for this function: