Files
amiwm-neo/module.h
Adrian Chadd 18e858ae80 [amiwm] MVP for initial battery stuff
Totally not ready for prod, but at least I'm making progress
figuring out how to add extra bits to this thing.

* add a second widget to the menu bar, next to the title bar
* add a new module command to update the battery information
* add a freebsd specific Battery module, not linked into the
  build right now.
* amiwm will print out whenever we get battery information from the
  module.

Right now I'm trying to figure out how to get some kind of periodic
background event into the module main loop.  Launcher does it
using cx_broker(), but I dunno if I can adapt that pattern here.
2022-04-25 21:28:49 -07:00

70 lines
1.2 KiB
C

#define MCMD_NOP 1
#define MCMD_GET_VERSION 2
#define MCMD_SEND_EVENT 4
#define MCMD_SET_BROKER 5
#define MCMD_ROTATE_SCREEN 6
#define MCMD_ADD_KEYGRAB 7
#define MCMD_DEL_KEYGRAB 8
#define MCMD_FRONT 9
#define MCMD_BACK 10
#define MCMD_ICONIFY 11
#define MCMD_CREATEAPPICON 12
#define MCMD_ERRORMSG 14
#define MCMD_SETAPPWINDOW 15
#define MCMD_GETICONDIR 16
#define MCMD_GETICONPALETTE 17
#define MCMD_MANAGEMENU 18
#define MCMD_ROTATE_WINDOW_RAISE 19
#define MCMD_ROTATE_WINDOW_LOWER 20
#define MCMD_UPDATE_BATTERY 21
struct mcmd_header {
XID id;
int cmd;
int len;
};
struct mcmd_event {
unsigned long mask;
XEvent event;
};
struct mcmd_keygrab {
struct mcmd_keygrab *next;
int id;
struct module *owner;
int keycode;
unsigned int modifiers;
};
struct NewAppIcon {
int x, y;
Pixmap pm1, pm2, pmm;
char name[1];
};
struct mcmd_update_battery {
int battery_time;
int battery_pct;
int battery_cap;
int battery_ac;
int battery_charging;
};
extern struct module {
struct module *next;
int in_fd, out_fd;
pid_t pid;
struct mcmd_header mcmd;
char *in_ptr;
int in_left;
int in_phase;
char *in_buf;
int in_buf_size;
struct {
int exists;
unsigned long mask;
} broker;
struct Item *menuitems;
} *modules;