Make ObPrompt windows get managed as clients, and make them able to reconfigure as...
[dana/openbox.git] / openbox / prompt.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3    prompt.h for the Openbox window manager
4    Copyright (c) 2008        Dana Jansens
5
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.
10
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.
15
16    See the COPYING file for a copy of the GNU General Public License.
17 */
18
19 #ifndef ob__prompt_h
20 #define ob__prompt_h
21
22 typedef struct _ObPrompt       ObPrompt;
23 typedef struct _ObPromptElement ObPromptElement;
24
25 #include "window.h"
26 #include "geom.h"
27 #include "render/render.h"
28 #include <glib.h>
29
30 struct _ObPromptElement {
31     gchar *text;
32     Window window;
33
34     gint x, y, width, height;
35 };
36
37 struct _ObPrompt
38 {
39     InternalWindow super;
40     gint ref;
41
42     /* keep a copy of this because we re-render things that may need it
43        (i.e. the buttons) */
44     RrAppearance *a_bg;
45
46     gboolean mapped;
47     gint width, height;
48     gint msg_wbound;
49
50     ObPromptElement msg;
51
52     /* one for each answer */
53     ObPromptElement *button;
54     guint n_buttons;
55 };
56
57 void prompt_startup(gboolean reconfig);
58 void prompt_shutdown(gboolean reconfig);
59
60 ObPrompt* prompt_new(const gchar *msg, const gchar *const *answers);
61 void prompt_ref(ObPrompt *self);
62 void prompt_unref(ObPrompt *self);
63
64 /*! Show the prompt.  It will be centered within the given area rectangle */
65 void prompt_show(ObPrompt *self, struct _ObClient *parent);
66 void prompt_hide(ObPrompt *self);
67 void prompt_hide_window(Window window);
68
69 #endif