]> Dogcows Code - chaz/openbox/blobdiff - openbox/prompt.h
Merge branch 'master' into chaz
[chaz/openbox] / openbox / prompt.h
index 107aafd11fca3bc36e3fdb5862e7f740446d78de..13585740d8e1850209ca9ced5d82cbebd562ecfc 100644 (file)
@@ -21,7 +21,8 @@
 
 #include "window.h"
 #include "geom.h"
-#include "render/render.h"
+#include "obrender/render.h"
+#include "obt/keyboard.h"
 #include <glib.h>
 #include <X11/Xlib.h>
 
@@ -29,7 +30,8 @@ typedef struct _ObPrompt       ObPrompt;
 typedef struct _ObPromptElement ObPromptElement;
 typedef struct _ObPromptAnswer ObPromptAnswer;
 
-typedef void (*ObPromptCallback)(ObPrompt *p, gint result, gpointer data);
+typedef gboolean (*ObPromptCallback)(ObPrompt *p, gint result, gpointer data);
+typedef void (*ObPromptCleanup)(ObPrompt *p, gpointer data);
 
 struct _ObPromptElement {
     gchar *text;
@@ -37,6 +39,7 @@ struct _ObPromptElement {
 
     gint x, y, width, height;
     gboolean pressed;
+    gboolean hover;
     gint result;
 };
 
@@ -45,6 +48,7 @@ struct _ObPrompt
     ObInternalWindow super;
     gint ref;
 
+    ObtIC *ic;
     guint event_mask;
 
     /* keep a copy of this because we re-render things that may need it
@@ -69,6 +73,7 @@ struct _ObPrompt
     gint cancel_result;
 
     ObPromptCallback func;
+    ObPromptCleanup cleanup;
     gpointer data;
 };
 
@@ -90,12 +95,19 @@ void prompt_shutdown(gboolean reconfig);
          of having a button presssed
   @param func The callback function which is called when the dialog is closed
          or a button is pressed
+  @param cleanup The cleanup function which is called if the prompt system
+         is shutting down, and someone is still holding a reference to the
+         prompt.  This callback should cause the prompt's refcount to go to
+         zero so it can be freed, and free any other memory associated with
+         the prompt.  The cleanup function is also called if the prompt's
+         callback function returns TRUE.
   @param data User defined data which will be passed to the callback
 */
-ObPrompt* prompt_new(const gchar *msg,
+ObPrompt* prompt_new(const gchar *msg, const gchar *title,
                      const ObPromptAnswer *answers, gint n_answers,
                      gint default_result, gint cancel_result,
-                     ObPromptCallback func, gpointer data);
+                     ObPromptCallback func, ObPromptCleanup cleanup,
+                     gpointer data);
 void prompt_ref(ObPrompt *self);
 void prompt_unref(ObPrompt *self);
 
@@ -107,4 +119,7 @@ gboolean prompt_key_event(ObPrompt *self, XEvent *e);
 gboolean prompt_mouse_event(ObPrompt *self, XEvent *e);
 void prompt_cancel(ObPrompt *self);
 
+ObPrompt* prompt_show_message(const gchar *msg, const gchar *title,
+                              const gchar *answer);
+
 #endif
This page took 0.022359 seconds and 4 git commands to generate.