From e9577b84e03ee6e05bec4372c29077a184e645f3 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Sat, 6 Oct 2018 22:28:37 +0900 Subject: [PATCH] remove menu app, doesn't work without a base window --- apps/menu.c | 56 ----------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 apps/menu.c diff --git a/apps/menu.c b/apps/menu.c deleted file mode 100644 index 739d12af..00000000 --- a/apps/menu.c +++ /dev/null @@ -1,56 +0,0 @@ -/* vim: tabstop=4 shiftwidth=4 noexpandtab - * This file is part of ToaruOS and is released under the terms - * of the NCSA / University of Illinois License - see LICENSE.md - * Copyright (C) 2018 K. Lange - * - * menu - Display a menu file and print actions - * - * This is a demo of the menu library, and can be used by scripts - * to display menus. It may be broken without a root window for - * the menus to display on, though? - */ -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -static yutani_t * yctx; - -static void _action_callback(struct MenuEntry * self) { - struct MenuEntry_Normal * _self = (void *)self; - - fprintf(stdout, "%s\n", _self->action); - exit(0); -} - -int main(int argc, char * argv[]) { - - if (argc < 2) { - fprintf(stderr, "%s: expected argument\n", argv[0]); - return 1; - } - - yctx = yutani_init(); - - /* Create menu from file. */ - struct MenuSet * menu = menu_set_from_description(argv[1], _action_callback); - menu_show(menu_set_get_root(menu), yctx); - - while (1) { - yutani_msg_t * m = yutani_poll(yctx); - if (menu_process_event(yctx, m)) { - return 1; - } - free(m); - } - - return 0; -}