1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 prompt.h for the Openbox window manager
4 Copyright (c) 2008 Dana Jansens
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 See the COPYING file for a copy of the GNU General Public License.
22 typedef struct _ObPrompt ObPrompt;
23 typedef struct _ObPromptElement ObPromptElement;
27 #include "render/render.h"
31 struct _ObPromptElement {
35 gint x, y, width, height;
41 ObInternalWindow super;
46 /* keep a copy of this because we re-render things that may need it
56 /* one for each answer */
57 ObPromptElement *button;
60 /* points to the button with the focus */
61 ObPromptElement *focus;
64 void prompt_startup(gboolean reconfig);
65 void prompt_shutdown(gboolean reconfig);
67 ObPrompt* prompt_new(const gchar *msg, const gchar *const *answers);
68 void prompt_ref(ObPrompt *self);
69 void prompt_unref(ObPrompt *self);
71 /*! Show the prompt. It will be centered within the given area rectangle */
72 void prompt_show(ObPrompt *self, struct _ObClient *parent);
73 void prompt_hide(ObPrompt *self);
75 void prompt_key_event(ObPrompt *self, XEvent *e);
76 void prompt_mouse_event(ObPrompt *self, XEvent *e);