]> git.street.me.uk Git - andy/viking.git/blobdiff - src/background.h
Menu option to (re)open an MBTiles file.
[andy/viking.git] / src / background.h
index e12734b331e0b9874a254b325a44d03b5fae215d..5608ee19cd6282e08017c66901b3ec15366995e6 100644 (file)
 #include <glib.h>
 #include <gtk/gtk.h>
 
-#include "vikstatus.h"
+#include "vikwindow.h"
+#include "config.h"
+
+G_BEGIN_DECLS
 
 typedef void(*vik_thr_free_func)(gpointer);
 typedef void(*vik_thr_func)(gpointer,gpointer);
 
-/* the new way */
-void a_background_thread ( GtkWindow *parent, const gchar *message, vik_thr_func func, gpointer userdata, vik_thr_free_func userdata_free_func, vik_thr_free_func userdata_cancel_cleanup_func, gint number_items );
+typedef enum {
+  BACKGROUND_POOL_REMOTE, // i.e. Network requests - can have an arbitary large pool
+  BACKGROUND_POOL_LOCAL,  // i.e. CPU bound tasks - pool should be no larger than available CPUs for best performance
+#ifdef HAVE_LIBMAPNIK
+  BACKGROUND_POOL_LOCAL_MAPNIK,  // Due to potential issues with multi-threading a separate configurable pool for Mapnik
+#endif
+} Background_Pool_Type;
+
+void a_background_thread ( Background_Pool_Type bp, GtkWindow *parent, const gchar *message, vik_thr_func func, gpointer userdata, vik_thr_free_func userdata_free_func, vik_thr_free_func userdata_cancel_cleanup_func, gint number_items );
 int a_background_thread_progress ( gpointer callbackdata, gdouble fraction );
 int a_background_testcancel ( gpointer callbackdata );
 void a_background_show_window ();
 void a_background_init ();
+void a_background_post_init ();
 void a_background_uninit ();
-void a_background_add_status(VikStatusbar *vs);
-void a_background_remove_status(VikStatusbar *vs);
+void a_background_add_window (VikWindow *vw);
+void a_background_remove_window (VikWindow *vw);
+
+G_END_DECLS
 
 #endif