.PHONY: all docs clean install uninstall test
-all: $(BIN) test $(MAN1)
+all: $(BINS) test $(MAN1)
docs:
ronn --roff docs/*.md
MouseFunc right;
} MouseConfig;
-void win_init(char* name);
+void win_window(char* name);
+void win_dialog(char* name);
void win_loop(void);
void win_settext(WinRegion id, char* text);
void win_setruler(size_t ruler);
static ButtonState MouseBtns[MOUSE_BTN_COUNT] = {0};
KeyBinding* Keys = NULL;
-void win_init(char* name) {
+static void win_init(void) {
for (int i = 0; i < SCROLL; i++)
view_init(&(Regions[i].view), NULL);
x11_init(&Config);
Font = x11_font_load(FONTNAME);
+}
+
+void win_window(char* name) {
+ win_init();
x11_window(name, Width, Height);
}
+void win_dialog(char* name) {
+ win_init();
+ x11_dialog(name, Width, Height);
+}
+
void win_loop(void) {
x11_show();
x11_loop();
#ifndef TEST
int main(int argc, char** argv) {
- win_init("term");
+ win_window("term");
//win_setkeys(&Bindings);
//win_setmouse(&MouseHandlers);
win_loop();
static void initialize(void) {
ShellCmd[0] = "/bin/sh";
- win_init("edit");
+ win_window("edit");
XDisplay = XOpenDisplay(NULL);
win_setkeys(Bindings);
//win_setmouse(&MouseHandlers);
ShellCmd[0] = getenv("SHELL");
if (!ShellCmd[0]) ShellCmd[0] = "/bin/sh";
/* Create the window and enter the event loop */
- win_init("edit");
+ win_window("edit");
char* tags = getenv("EDITTAGS");
win_settext(TAGS, (tags ? tags : DEFAULT_TAGS));
win_setruler(80);
char* title = getenv("XPICKTITLE");
load_choices();
if (vec_size(&Choices) > 1) {
- win_init("xpick");
+ win_dialog("xpick");
win_setkeys(Bindings);
win_settext(STATUS, (title ? title : "xpick"));
if (argc >= 2) {