assertdlg_gtk.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /* ///////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk/assertdlg_gtk.h
  3. // Purpose: GtkAssertDialog
  4. // Author: Francesco Montorsi
  5. // Copyright: (c) 2006 Francesco Montorsi
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////// */
  8. #ifndef _WX_GTK_ASSERTDLG_H_
  9. #define _WX_GTK_ASSERTDLG_H_
  10. #define GTK_TYPE_ASSERT_DIALOG (gtk_assert_dialog_get_type ())
  11. #define GTK_ASSERT_DIALOG(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_ASSERT_DIALOG, GtkAssertDialog))
  12. #define GTK_ASSERT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ASSERT_DIALOG, GtkAssertDialogClass))
  13. #define GTK_IS_ASSERT_DIALOG(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GTK_TYPE_ASSERT_DIALOG))
  14. #define GTK_IS_ASSERT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ASSERT_DIALOG))
  15. #define GTK_ASSERT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ASSERT_DIALOG, GtkAssertDialogClass))
  16. typedef struct _GtkAssertDialog GtkAssertDialog;
  17. typedef struct _GtkAssertDialogClass GtkAssertDialogClass;
  18. typedef void (*GtkAssertDialogStackFrameCallback)(void *);
  19. struct _GtkAssertDialog
  20. {
  21. GtkDialog parent_instance;
  22. /* GtkAssertDialog widgets */
  23. GtkWidget *expander;
  24. GtkWidget *message;
  25. GtkWidget *treeview;
  26. GtkWidget *shownexttime;
  27. /* callback for processing the stack frame */
  28. GtkAssertDialogStackFrameCallback callback;
  29. void *userdata;
  30. };
  31. struct _GtkAssertDialogClass
  32. {
  33. GtkDialogClass parent_class;
  34. };
  35. typedef enum
  36. {
  37. GTK_ASSERT_DIALOG_STOP,
  38. GTK_ASSERT_DIALOG_CONTINUE,
  39. GTK_ASSERT_DIALOG_CONTINUE_SUPPRESSING
  40. } GtkAssertDialogResponseID;
  41. GType gtk_assert_dialog_get_type(void);
  42. GtkWidget *gtk_assert_dialog_new(void);
  43. /* get the assert message */
  44. gchar *gtk_assert_dialog_get_message(GtkAssertDialog *assertdlg);
  45. /* set the assert message */
  46. void gtk_assert_dialog_set_message(GtkAssertDialog *assertdlg, const gchar *msg);
  47. /* get a string containing all stack frames appended to the dialog */
  48. gchar *gtk_assert_dialog_get_backtrace(GtkAssertDialog *assertdlg);
  49. /* sets the callback to use when the user wants to see the stackframe */
  50. void gtk_assert_dialog_set_backtrace_callback(GtkAssertDialog *assertdlg,
  51. GtkAssertDialogStackFrameCallback callback,
  52. void *userdata);
  53. /* appends a stack frame to the dialog */
  54. void gtk_assert_dialog_append_stack_frame(GtkAssertDialog *dlg,
  55. const gchar *function,
  56. const gchar *sourcefile,
  57. guint line_number);
  58. #endif /* _WX_GTK_ASSERTDLG_H_ */