#include <windows.h>
#endif
-#include <libsoup/soup.h>
-
#include "gtkmapserver.h"
static void gtk_mapserver_class_init (GtkMapserverClass *klass);
return gtk_mapserver;
}
-void
-gtk_mapserver_set_home (GtkMapserver *gtkm,
- const gchar *url)
+SoupMessage
+*gtk_mapserver_get_soup_message (GtkMapserver *gtkm,
+ const gchar *url)
{
- GError *error;
SoupMessage *msg;
- GdkPixbufLoader *pxb_loader;
GtkMapserverPrivate *priv = GTK_MAPSERVER_GET_PRIVATE (gtkm);
+ msg = NULL;
+
msg = soup_message_new (SOUP_METHOD_GET, url);
if (SOUP_IS_MESSAGE (msg))
{
if (!SOUP_IS_MESSAGE (msg) || !SOUP_STATUS_IS_SUCCESSFUL (msg->status_code))
{
- g_warning ("Error on retrieving url.");
+ g_warning ("Error on retrieving url: %s.", url);
+ msg = NULL;
+ }
+
+ return msg;
+}
+
+void
+gtk_mapserver_set_home (GtkMapserver *gtkm,
+ const gchar *url)
+{
+ GError *error;
+ SoupMessage *msg;
+ GdkPixbufLoader *pxb_loader;
+
+ GtkMapserverPrivate *priv = GTK_MAPSERVER_GET_PRIVATE (gtkm);
+
+ msg = gtk_mapserver_get_soup_message (gtkm, url);
+
+ if (msg == NULL)
+ {
pxb_loader = NULL;
}
else
priv->sel_y_start = y;
}
}
+
+/* UTILS */
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
+
#include <goocanvas.h>
+#include <libsoup/soup.h>
G_BEGIN_DECLS
GtkWidget *gtk_mapserver_new (void);
+SoupMessage *gtk_mapserver_get_soup_message (GtkMapserver *gtkm,
+ const gchar *url);
+
void gtk_mapserver_set_home (GtkMapserver *gtkm, const gchar *url);