Fix bug #3526 ‘autoconfiguration: get more detailed error message’
[claws.git] / src / gtk / gtkutils.h
index fbc073dea7afa1aeb94bbdeb7ea724689d2ee60b..7510387b158e706c55f1245cb9c58e75915f6ee5 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
 #define __GTKUTILS_H__
 
 #ifdef HAVE_CONFIG_H
-#  include "config.h"
+#include "claws-features.h"
 #endif
 
 #include <glib.h>
 #  include <wchar.h>
 #endif
 
-#ifdef MAEMO
-#ifdef CHINOOK
-#include <hildon/hildon-program.h>
-#else
-#include <hildon-widgets/hildon-program.h>
-#include <hildon-widgets/hildon-window.h>
-#endif
-#include "main.h"
-#endif
-
-#if !GTK_CHECK_VERSION(3, 0, 0)
 #include "gtkcmctree.h"
-#endif
 
 #ifndef GDK_KEY_Escape
 #include "gdkkeysyms-new.h"
@@ -98,7 +86,6 @@ void gtkut_stock_with_text_button_set_create(GtkWidget **bbox,
                                   GtkWidget **button2, const gchar *label2, const gchar *text2,
                                   GtkWidget **button3, const gchar *label3, const gchar *text3);
 
-#if !GTK_CHECK_VERSION(3, 0, 0)
 void gtkut_ctree_node_move_if_on_the_edge
                                        (GtkCMCTree     *ctree,
                                         GtkCMCTreeNode *node,
@@ -120,7 +107,6 @@ gboolean gtkut_ctree_node_is_parent (GtkCMCTreeNode         *parent,
                                         GtkCMCTreeNode         *node);
 void gtkut_ctree_set_focus_row         (GtkCMCTree     *ctree,
                                         GtkCMCTreeNode *node);
-#endif
 
 void gtkut_clist_set_focus_row         (GtkCMCList     *clist,
                                         gint            row);
@@ -175,8 +161,7 @@ GtkWidget *gtkut_get_browse_directory_btn(const gchar *label);
 GtkWidget *gtkut_get_replace_btn(const gchar *label);
 GtkWidget *gtkut_get_options_frame(GtkWidget *box, GtkWidget **frame, const gchar *frame_label);
 #if HAVE_LIBCOMPFACE
-GtkWidget *xface_get_from_header(const gchar *o_xface, GdkColor *background,
-                                GdkWindow *window);
+GtkWidget *xface_get_from_header(const gchar *o_xface);
 #endif
 gboolean get_tag_range(GtkTextIter *iter,
                                       GtkTextTag *tag,
@@ -224,6 +209,52 @@ claws_input_add    (gint         source,
                gtk_widget_set_has_tooltip(GTK_WIDGET(widget), FALSE);  \
 }
 
+#if (defined USE_GNUTLS && GLIB_CHECK_VERSION(2,22,0))
+typedef struct _AutoConfigureData {
+       const gchar *ssl_service;
+       const gchar *tls_service;
+       gchar *address;
+       gint resolver_error;
+
+       GtkEntry *hostname_entry;
+       GtkToggleButton *set_port;
+       GtkSpinButton *port;
+       gint default_port;
+       gint default_ssl_port;
+       GtkToggleButton *tls_checkbtn;
+       GtkToggleButton *ssl_checkbtn;
+       GtkToggleButton *auth_checkbtn;
+       GtkEntry *uid_entry;
+       GtkLabel *info_label;
+       GtkButton *configure_button;
+       GtkButton *cancel_button;
+       GCancellable *cancel;
+       GMainLoop *main_loop;
+} AutoConfigureData;
+
+void auto_configure_service(AutoConfigureData *data);
+gboolean auto_configure_service_sync(const gchar *service, const gchar *domain, gchar **srvhost, guint16 *srvport);
+#endif
+
+
+#if GTK_CHECK_VERSION (3, 2, 0)
+#define GTK_TYPE_VBOX GTK_TYPE_BOX
+#define GtkVBox GtkBox
+#define GtkVBoxClass GtkBoxClass
+#define gtk_vbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \
+    "homogeneous", hmg, "spacing", spc, \
+    "orientation", GTK_ORIENTATION_VERTICAL, NULL)
+#define GTK_TYPE_HBOX GTK_TYPE_BOX
+#define GtkHBox GtkBox
+#define GtkHBoxClass GtkBoxClass
+#define gtk_hbox_new(hmg,spc) g_object_new (GTK_TYPE_BOX, \
+    "homogeneous", hmg, "spacing", spc, \
+    "orientation", GTK_ORIENTATION_HORIZONTAL, NULL)
+#define gtk_hseparator_new() g_object_new (GTK_TYPE_SEPARATOR, NULL)
+#define gtk_hpaned_new() g_object_new (GTK_TYPE_PANED, NULL)
+#define gtk_vpaned_new() g_object_new (GTK_TYPE_PANED, \
+    "orientation", GTK_ORIENTATION_VERTICAL, NULL)
+#endif
 #if !GTK_CHECK_VERSION(2,22,0)
 #define gdk_drag_context_get_selected_action(x) ((x)->action)
 #define gdk_drag_context_get_actions(x) ((x)->actions)