NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
module.c File Reference

Definition of the Helpbar Module. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "module_data.h"
+ Include dependency graph for module.c:

Go to the source code of this file.

Functions

static bool helpbar_init (struct NeoMutt *n)
 Initialise a Module - Implements Module::init()
 
static bool helpbar_config_define_variables (struct NeoMutt *n, struct ConfigSet *cs)
 Define the Config Variables - Implements Module::config_define_variables()
 
static bool helpbar_cleanup (struct NeoMutt *n, void *data)
 Clean up a Module - Implements Module::cleanup()
 

Variables

struct ConfigDef HelpbarVars []
 Config definitions for the Helpbar.
 
const struct Module ModuleHelpbar
 Module for the Helpbar library.
 

Detailed Description

Definition of the Helpbar Module.

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 module.c.

Function Documentation

◆ helpbar_init()

static bool helpbar_init ( struct NeoMutt * n)
static

Initialise a Module - Implements Module::init()

Definition at line 42 of file module.c.

43{
44 struct HelpbarModuleData *mod_data = MUTT_MEM_CALLOC(1, struct HelpbarModuleData);
46
47 mod_data->notify = notify_new();
48 notify_set_parent(mod_data->notify, n->notify);
49
50 return true;
51}
#define MUTT_MEM_CALLOC(n, type)
Definition memory.h:52
@ MODULE_ID_HELPBAR
ModuleHelpbar, Help bar
Definition module_api.h:68
struct Notify * notify_new(void)
Create a new notifications handler.
Definition notify.c:62
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition notify.c:95
void neomutt_set_module_data(struct NeoMutt *n, enum ModuleId id, void *data)
Set the private data for a Module.
Definition neomutt.c:677
Helpbar private Module data.
Definition module_data.h:30
struct Notify * notify
Notifications.
Definition module_data.h:31
struct Notify * notify
Notifications handler.
Definition neomutt.h:45
+ Here is the call graph for this function:

◆ helpbar_config_define_variables()

static bool helpbar_config_define_variables ( struct NeoMutt * n,
struct ConfigSet * cs )
static

Define the Config Variables - Implements Module::config_define_variables()

Definition at line 56 of file module.c.

57{
59}
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition set.c:290
struct ConfigDef HelpbarVars[]
Config definitions for the Helpbar.
Definition config.c:37
+ Here is the call graph for this function:

◆ helpbar_cleanup()

static bool helpbar_cleanup ( struct NeoMutt * n,
void * data )
static

Clean up a Module - Implements Module::cleanup()

Definition at line 64 of file module.c.

65{
66 struct HelpbarModuleData *mod_data = data;
67
68 notify_free(&mod_data->notify);
69
70 FREE(&mod_data);
71 return true;
72}
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition notify.c:75
+ Here is the call graph for this function:

Variable Documentation

◆ HelpbarVars

struct ConfigDef HelpbarVars[]
extern

Config definitions for the Helpbar.

Definition at line 37 of file config.c.

37 {
38 // clang-format off
39 { "help", DT_BOOL, true, 0, NULL,
40 "Display a help line with common key bindings"
41 },
42 { NULL },
43 // clang-format on
44};
@ DT_BOOL
boolean option
Definition types.h:32

◆ ModuleHelpbar

const struct Module ModuleHelpbar
Initial value:
= {
"helpbar",
NULL,
NULL,
NULL,
NULL,
}
static bool helpbar_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:42
static bool helpbar_cleanup(struct NeoMutt *n, void *data)
Clean up a Module - Implements Module::cleanup()
Definition module.c:64
static bool helpbar_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:56

Module for the Helpbar library.

Definition at line 77 of file module.c.

77 {
79 "helpbar",
81 NULL, // config_define_types
83 NULL, // commands_register
84 NULL, // gui_init
85 NULL, // gui_cleanup
87};