Index: geanyprj/src/xproject.c
===================================================================
--- geanyprj/src/xproject.c	(revision 328)
+++ geanyprj/src/xproject.c	(working copy)
@@ -30,7 +30,7 @@
 #include "document.h"
 #include "filetypes.h"
 #include "utils.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "project.h"
 
@@ -47,14 +47,14 @@
 add_tag(G_GNUC_UNUSED gpointer key, gpointer value, G_GNUC_UNUSED gpointer user_data)
 {
 	debug("%s file=%s\n", __FUNCTION__, (const gchar *) key);
-	p_tm->workspace_add_object((TMWorkObject *) value);
+	tm_workspace_add_object((TMWorkObject *) value);
 }
 
 static void
 remove_tag(G_GNUC_UNUSED gpointer key, gpointer value, G_GNUC_UNUSED gpointer user_data)
 {
 	debug("%s file=%s\n", __FUNCTION__, (const gchar *) key);
-	p_tm->workspace_remove_object((TMWorkObject *) value, FALSE, FALSE);
+	tm_workspace_remove_object((TMWorkObject *) value, FALSE, FALSE);
 }
 
 /* This fonction should keep in sync with geany code */
@@ -66,7 +66,7 @@
 	if (!geany->app->project)
 		return;
 
-	p_ui->set_statusbar(TRUE, _("Project \"%s\" closed."), geany->app->project->name);
+	ui_set_statusbar(TRUE, _("Project \"%s\" closed."), geany->app->project->name);
 
 	g_free(geany->app->project->name);
 	g_free(geany->app->project->description);
@@ -117,7 +117,7 @@
 	if (!p)
 		return;
 
-	p_ui->set_statusbar(TRUE, _("Project \"%s\" opened."), p->name);
+	ui_set_statusbar(TRUE, _("Project \"%s\" opened."), p->name);
 
 	geany->app->project = g_new0(struct GeanyProject, 1);
 	geany->app->project->type = PROJECT_TYPE;
@@ -144,7 +144,7 @@
 		tm_obj = g_hash_table_lookup(g_current_project->tags, filename);
 		if (tm_obj)
 		{
-			p_tm->source_file_update(tm_obj, TRUE, FALSE, TRUE);
+			tm_source_file_update(tm_obj, TRUE, FALSE, TRUE);
 		}
 	}
 
@@ -155,7 +155,7 @@
 					    filename);
 		if (tm_obj)
 		{
-			p_tm->source_file_update(tm_obj, TRUE, FALSE, TRUE);
+			tm_source_file_update(tm_obj, TRUE, FALSE, TRUE);
 		}
 	}
 }
@@ -175,7 +175,7 @@
 		tm_obj = (TMWorkObject *) g_hash_table_lookup(g_current_project->tags, path);
 		if (tm_obj)
 		{
-			p_tm->workspace_add_object((TMWorkObject *) tm_obj);
+			tm_workspace_add_object((TMWorkObject *) tm_obj);
 		}
 		sidebar_refresh();
 		return TRUE;
@@ -196,7 +196,7 @@
 	tm_obj = (TMWorkObject *) g_hash_table_lookup(g_current_project->tags, path);
 	if (tm_obj)
 	{
-		p_tm->workspace_remove_object(tm_obj, FALSE, FALSE);
+		tm_workspace_remove_object(tm_obj, FALSE, FALSE);
 	}
 
 	if (geany_project_remove_file(g_current_project, path))
Index: geanyprj/src/geanyprj.c
===================================================================
--- geanyprj/src/geanyprj.c	(revision 328)
+++ geanyprj/src/geanyprj.c	(working copy)
@@ -30,7 +30,7 @@
 #include "filetypes.h"
 #include "utils.h"
 #include "ui_utils.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #ifdef HAVE_LOCALE_H
 # include <locale.h>
@@ -40,7 +40,7 @@
 
 #include "geanyprj.h"
 
-PLUGIN_VERSION_CHECK(82);
+PLUGIN_VERSION_CHECK(115);
 PLUGIN_SET_INFO(_("Project"), _("Alternative project support."), VERSION,
 		_("Yura Siamashka <yurand2@gmail.com>"));
 
@@ -58,7 +58,7 @@
 
 	debug("%s\n", __FUNCTION__);
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	if (doc == NULL || doc->file_name == NULL)
 		return;
 
@@ -159,7 +159,7 @@
 plugin_init(G_GNUC_UNUSED GeanyData * data)
 {
 	GtkWidget *prj =
-		p_support->lookup_widget(GTK_WIDGET(geany->main_widgets->window), "menu_project1");
+		ui_lookup_widget(GTK_WIDGET(geany->main_widgets->window), "menu_project1");
 
 	locale_init();
 	tools_menu_init();
@@ -178,7 +178,7 @@
 {
 	GeanyProject *project = geany->app->project;
 	GtkWidget *prj =
-		p_support->lookup_widget(GTK_WIDGET(geany->main_widgets->window), "menu_project1");
+		ui_lookup_widget(GTK_WIDGET(geany->main_widgets->window), "menu_project1");
 	gtk_widget_set_child_visible(prj, TRUE);
 	gtk_widget_set_size_request(prj, -1, -1);
 
Index: geanyprj/src/utils.c
===================================================================
--- geanyprj/src/utils.c	(revision 328)
+++ geanyprj/src/utils.c	(working copy)
@@ -22,8 +22,8 @@
 
 #include "geany.h"
 #include "plugindata.h"
-#include "pluginmacros.h"
 #include "utils.h"
+#include "geanyfunctions.h"
 
 extern GeanyData *geany_data;
 extern GeanyFunctions *geany_functions;
@@ -173,7 +173,7 @@
 save_config(GKeyFile * config, const gchar * path)
 {
 	gchar *data = g_key_file_to_data(config, NULL, NULL);
-	p_utils->write_file(path, data);
+	utils_write_file(path, data);
 	g_free(data);
 }
 
Index: geanyprj/src/menu.c
===================================================================
--- geanyprj/src/menu.c	(revision 328)
+++ geanyprj/src/menu.c	(working copy)
@@ -30,7 +30,7 @@
 #include "keybindings.h"
 #include "utils.h"
 #include "ui_utils.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "project.h"
 
@@ -78,14 +78,14 @@
 	GtkWidget *bbox;
 	GtkWidget *label;
 	GtkTooltips *tooltips =
-		GTK_TOOLTIPS(p_support->lookup_widget(geany->main_widgets->window, "tooltips"));
+		GTK_TOOLTIPS(ui_lookup_widget(geany->main_widgets->window, "tooltips"));
 	PropertyDialogElements *e;
 	gchar *dir = NULL;
 	gchar *basename = NULL;
 	gint i;
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 
 	if (doc && doc->file_name != NULL && g_path_is_absolute(doc->file_name))
 	{
@@ -127,7 +127,7 @@
 		gtk_dialog_add_action_widget(GTK_DIALOG(e->dialog), button, GTK_RESPONSE_OK);
 	}
 
-	vbox = p_ui->dialog_vbox_new(GTK_DIALOG(e->dialog));
+	vbox = ui_dialog_vbox_new(GTK_DIALOG(e->dialog));
 
 	table = gtk_table_new(5, 2, FALSE);
 	gtk_table_set_row_spacings(GTK_TABLE(table), 5);
@@ -140,7 +140,7 @@
 	gtk_entry_set_max_length(GTK_ENTRY(e->name), MAX_NAME_LEN);
 	gtk_entry_set_text(GTK_ENTRY(e->name), basename);
 
-	p_ui->table_add_row(GTK_TABLE(table), 0, label, e->name, NULL);
+	ui_table_add_row(GTK_TABLE(table), 0, label, e->name, NULL);
 
 	label = gtk_label_new(_("Location:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);
@@ -150,18 +150,18 @@
 	if (properties)
 	{
 		gtk_widget_set_sensitive(e->file_name, FALSE);
-		p_ui->table_add_row(GTK_TABLE(table), 1, label, e->file_name, NULL);
+		ui_table_add_row(GTK_TABLE(table), 1, label, e->file_name, NULL);
 	}
 	else
 	{
 		button = gtk_button_new();
 		image = gtk_image_new_from_stock("gtk-open", GTK_ICON_SIZE_BUTTON);
 		gtk_container_add(GTK_CONTAINER(button), image);
-		bbox = p_ui->path_box_new(_("Choose Project Location"),
+		bbox = ui_path_box_new(_("Choose Project Location"),
 					  GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
 					  GTK_ENTRY(e->file_name));
 		gtk_entry_set_text(GTK_ENTRY(e->file_name), dir);
-		p_ui->table_add_row(GTK_TABLE(table), 1, label, bbox, NULL);
+		ui_table_add_row(GTK_TABLE(table), 1, label, bbox, NULL);
 	}
 
 
@@ -173,11 +173,11 @@
 			     _("Base directory of all files that make up the project. "
 			       "This can be a new path, or an existing directory tree. "
 			       "You can use paths relative to the project filename."), NULL);
-	bbox = p_ui->path_box_new(_("Choose Project Base Path"),
+	bbox = ui_path_box_new(_("Choose Project Base Path"),
 				  GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, GTK_ENTRY(e->base_path));
 	gtk_entry_set_text(GTK_ENTRY(e->base_path), dir);
 
-	p_ui->table_add_row(GTK_TABLE(table), 2, label, bbox, NULL);
+	ui_table_add_row(GTK_TABLE(table), 2, label, bbox, NULL);
 
 	label = gtk_label_new(_(""));
 	e->regenerate = gtk_check_button_new_with_label(_("Generate file list on load"));
@@ -187,7 +187,7 @@
 			       "you checked this option, since your modification will be lost on "
 			       "on next project load"), NULL);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(e->regenerate), TRUE);
-	p_ui->table_add_row(GTK_TABLE(table), 3, label, e->regenerate, NULL);
+	ui_table_add_row(GTK_TABLE(table), 3, label, e->regenerate, NULL);
 
 
 	label = gtk_label_new(_("Type:"));
@@ -198,7 +198,7 @@
 		gtk_combo_box_append_text(GTK_COMBO_BOX(e->type), project_type_string[i]);
 	gtk_combo_box_set_active(GTK_COMBO_BOX(e->type), 0);
 
-	p_ui->table_add_row(GTK_TABLE(table), 4, label, e->type, NULL);
+	ui_table_add_row(GTK_TABLE(table), 4, label, e->type, NULL);
 
 	gtk_container_add(GTK_CONTAINER(vbox), table);
 	g_free(dir);
@@ -228,7 +228,7 @@
 
 		if (g_file_test(path, G_FILE_TEST_EXISTS))
 		{
-			p_ui->set_statusbar(TRUE, _("Project file \"%s\" already exists"), path);
+			ui_set_statusbar(TRUE, _("Project file \"%s\" already exists"), path);
 			g_free(path);
 			goto retry;
 		}
@@ -248,7 +248,7 @@
 
 		geany_project_save(prj);
 		geany_project_free(prj);
-		p_document->open_file(path, FALSE, NULL, NULL);
+		document_open_file(path, FALSE, NULL, NULL);
 	}
 
 	gtk_widget_destroy(e->dialog);
@@ -308,10 +308,10 @@
 	if (!g_current_project)
 		return;
 
-	if (p_dialogs->show_question("Do you really wish to delete current project:\n%s?",
+	if (dialogs_show_question("Do you really wish to delete current project:\n%s?",
 				     g_current_project->name))
 	{
-		path = p_utils->get_locale_from_utf8(g_current_project->path);
+		path = utils_get_locale_from_utf8(g_current_project->path);
 		xproject_close(FALSE);
 		g_unlink(path);
 		g_free(path);
@@ -323,7 +323,7 @@
 {
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc && doc->file_name != NULL && g_path_is_absolute(doc->file_name));
 
 	if (!g_current_project)
@@ -341,7 +341,7 @@
 
 	dir = g_path_get_dirname(g_current_project->path);
 	setptr(dir, g_build_filename(dir, g_current_project->base_path, NULL));
-	p_search->show_find_in_files_dialog(dir);
+	search_show_find_in_files_dialog(dir);
 	g_free(dir);
 }
 
@@ -352,7 +352,7 @@
 	gboolean badd_file;
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc != NULL && doc->file_name != NULL);
 
 	cur_file_exists = doc && doc->file_name != NULL && g_path_is_absolute(doc->file_name);
Index: geanyprj/src/project.c
===================================================================
--- geanyprj/src/project.c	(revision 328)
+++ geanyprj/src/project.c	(working copy)
@@ -30,7 +30,7 @@
 #include "document.h"
 #include "filetypes.h"
 #include "utils.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "project.h"
 
@@ -50,8 +50,8 @@
 static gboolean
 project_filter_c_cpp(const gchar * file)
 {
-	if (p_filetypes->detect_from_file(file)->id == GEANY_FILETYPES_C ||
-	    p_filetypes->detect_from_file(file)->id == GEANY_FILETYPES_CPP)
+	if (filetypes_detect_from_file(file)->id == GEANY_FILETYPES_C ||
+	    filetypes_detect_from_file(file)->id == GEANY_FILETYPES_CPP)
 		return TRUE;
 	return FALSE;
 }
@@ -59,7 +59,7 @@
 static gboolean
 project_filter_c(const gchar * file)
 {
-	if (p_filetypes->detect_from_file(file)->id == GEANY_FILETYPES_C)
+	if (filetypes_detect_from_file(file)->id == GEANY_FILETYPES_C)
 		return TRUE;
 	return FALSE;
 }
@@ -67,7 +67,7 @@
 static gboolean
 project_filter_python(const gchar * file)
 {
-	if (p_filetypes->detect_from_file(file)->id == GEANY_FILETYPES_PYTHON)
+	if (filetypes_detect_from_file(file)->id == GEANY_FILETYPES_PYTHON)
 		return TRUE;
 	return FALSE;
 }
@@ -75,7 +75,7 @@
 static gboolean
 project_filter_all(const gchar * file)
 {
-	if (p_filetypes->detect_from_file(file)->id != GEANY_FILETYPES_NONE)
+	if (filetypes_detect_from_file(file)->id != GEANY_FILETYPES_NONE)
 		return TRUE;
 	return FALSE;
 }
@@ -99,7 +99,7 @@
 static void
 free_tag_object(gpointer obj)
 {
-	p_tm->workspace_remove_object((TMWorkObject *) obj, TRUE, FALSE);
+	tm_workspace_remove_object((TMWorkObject *) obj, TRUE, FALSE);
 }
 
 struct GeanyPrj *
@@ -141,24 +141,24 @@
 	ret = geany_project_new();
 	geany_project_set_path(ret, path);
 
-	tmp = p_utils->get_setting_string(config, "project", "name", GEANY_STRING_UNTITLED);
+	tmp = utils_get_setting_string(config, "project", "name", GEANY_STRING_UNTITLED);
 	geany_project_set_name(ret, tmp);
 	g_free(tmp);
 
-	tmp = p_utils->get_setting_string(config, "project", "description", "");
+	tmp = utils_get_setting_string(config, "project", "description", "");
 	geany_project_set_description(ret, tmp);
 	g_free(tmp);
 
-	tmp = p_utils->get_setting_string(config, "project", "base_path", "");
+	tmp = utils_get_setting_string(config, "project", "base_path", "");
 	geany_project_set_base_path(ret, tmp);
 	g_free(tmp);
 
-	tmp = p_utils->get_setting_string(config, "project", "run_cmd", "");
+	tmp = utils_get_setting_string(config, "project", "run_cmd", "");
 	geany_project_set_run_cmd(ret, tmp);
 	g_free(tmp);
 
 	geany_project_set_type_string(ret,
-				      p_utils->get_setting_string(config, "project", "type",
+				      utils_get_setting_string(config, "project", "type",
 								  project_type_string[0]));
 	geany_project_set_regenerate(ret,
 				     g_key_file_get_boolean(config, "project", "regenerate", NULL));
@@ -175,15 +175,14 @@
 		{
 			filename = get_full_path(path, file);
 
-			locale_filename = p_utils->get_locale_from_utf8(filename);
-			tm_obj = p_tm->source_file_new(locale_filename, FALSE,
-						       p_filetypes->
-						       detect_from_file(filename)->name);
+			locale_filename = utils_get_locale_from_utf8(filename);
+			tm_obj = tm_source_file_new(locale_filename, FALSE,
+						       filetypes_detect_from_file(filename)->name);
 			g_free(locale_filename);
 			if (tm_obj)
 			{
 				g_hash_table_insert(ret->tags, filename, tm_obj);
-				p_tm->source_file_update(tm_obj, TRUE, FALSE, TRUE);
+				tm_source_file_update(tm_obj, TRUE, FALSE, TRUE);
 			}
 			else
 				g_free(filename);
@@ -354,14 +353,14 @@
 
 	for (tmp = files; tmp != NULL; tmp = g_slist_next(tmp))
 	{
-		locale_filename = p_utils->get_locale_from_utf8(tmp->data);
-		tm_obj = p_tm->source_file_new(locale_filename, FALSE,
-					       p_filetypes->detect_from_file(tmp->data)->name);
+		locale_filename = utils_get_locale_from_utf8(tmp->data);
+		tm_obj = tm_source_file_new(locale_filename, FALSE,
+					       filetypes_detect_from_file(tmp->data)->name);
 		g_free(locale_filename);
 		if (tm_obj)
 		{
 			g_hash_table_insert(prj->tags, g_strdup(tmp->data), tm_obj);
-			p_tm->source_file_update(tm_obj, TRUE, FALSE, TRUE);
+			tm_source_file_update(tm_obj, TRUE, FALSE, TRUE);
 		}
 	}
 }
@@ -410,14 +409,14 @@
 		return TRUE;
 	}
 
-	filename = p_utils->get_locale_from_utf8(path);
-	tm_obj = p_tm->source_file_new(filename, FALSE,
-				       p_filetypes->detect_from_file(path)->name);
+	filename = utils_get_locale_from_utf8(path);
+	tm_obj = tm_source_file_new(filename, FALSE,
+				       filetypes_detect_from_file(path)->name);
 	g_free(filename);
 	if (tm_obj)
 	{
 		g_hash_table_insert(prj->tags, g_strdup(path), tm_obj);
-		p_tm->source_file_update(tm_obj, TRUE, FALSE, TRUE);
+		tm_source_file_update(tm_obj, TRUE, FALSE, TRUE);
 	}
 	geany_project_save(prj);
 	return TRUE;
Index: geanyprj/src/sidebar.c
===================================================================
--- geanyprj/src/sidebar.c	(revision 328)
+++ geanyprj/src/sidebar.c	(working copy)
@@ -31,7 +31,7 @@
 #include "keybindings.h"
 #include "utils.h"
 #include "ui_utils.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "project.h"
 
@@ -74,7 +74,7 @@
 
 	gtk_tree_model_get_iter(model, &iter, treepath);
 	gtk_tree_model_get(model, &iter, FILEVIEW_COLUMN_NAME, &name, -1);
-	setptr(name, p_utils->get_locale_from_utf8(name));
+	setptr(name, utils_get_locale_from_utf8(name));
 	setptr(name, get_full_path(g_current_project->path, name));
 	return name;
 }
@@ -92,7 +92,7 @@
 		gchar *fname = get_tree_path_filename(treepath);
 		files = g_slist_append(files, fname);
 	}
-	p_document->open_files(files, FALSE, NULL, NULL);
+	document_open_files(files, FALSE, NULL, NULL);
 	g_slist_foreach(files, (GFunc) g_free, NULL);	// free filenames
 	g_slist_free(files);
 }
@@ -254,7 +254,7 @@
 	gtk_widget_show(item);
 	gtk_container_add(GTK_CONTAINER(menu), item);
 	g_signal_connect_swapped((gpointer) item, "activate",
-				 G_CALLBACK(p_keybindings->send_command),
+				 G_CALLBACK(keybindings_send_command),
 				 GINT_TO_POINTER(GEANY_KEYS_VIEW_SIDEBAR));
 
 	return menu;
@@ -267,7 +267,7 @@
 	gboolean badd_file;
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 
 	cur_file_exists = doc && doc->file_name != NULL && g_path_is_absolute(doc->file_name);
 
Index: geanydbg/src/dbg.c
===================================================================
--- geanydbg/src/dbg.c	(revision 328)
+++ geanydbg/src/dbg.c	(working copy)
@@ -40,7 +40,7 @@
 #include "utils.h"
 
 #include "plugindata.h"		/* this defines the plugin API */
-#include "pluginmacros.h"	/* some useful macros to avoid typing geany_data so often */
+#include "geanyfunctions.h"	/* some useful macros to avoid typing geany_data so often */
 
 /* These items are set by Geany before init() is called. */
 PluginFields *plugin_fields;
@@ -52,7 +52,7 @@
 
 /* Check that Geany supports plugin API version 78 or later, and check
  * for binary compatibility. */
-PLUGIN_VERSION_CHECK(78);
+PLUGIN_VERSION_CHECK(115);
 /* All plugins must set name, description, version and author. */
 PLUGIN_SET_INFO(_("DBG"), _("Run external debugger."), VERSION,
 		_("Yura Siamshka <yurand2@gmail.com>"));
@@ -158,7 +158,7 @@
 
 	keyb1 = gtk_menu_item_new();
 
-	p_keybindings->set_item(plugin_key_group, KB_DBG_START, kb_dbg,
+	keybindings_set_item(plugin_key_group, KB_DBG_START, kb_dbg,
 				0, 0, kb_label1, kb_label1, keyb1);
 }
 
Index: geanydoc/src/config.c
===================================================================
--- geanydoc/src/config.c	(revision 328)
+++ geanydoc/src/config.c	(working copy)
@@ -31,7 +31,7 @@
 #include "filetypes.h"
 #include "utils.h"
 #include "project.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "geanydoc.h"
 
@@ -66,7 +66,7 @@
 config_init()
 {
 	config_file = g_build_filename(geany->app->configdir, "plugins", "geanydoc", NULL);
-	p_utils->mkdir(config_file, TRUE);
+	utils_mkdir(config_file, TRUE);
 
 	setptr(config_file, g_build_filename(config_file, "geanydoc.conf", NULL));
 
@@ -107,7 +107,7 @@
 	config = cfg;
 
 	data = g_key_file_to_data(config, NULL, NULL);
-	p_utils->write_file(config_file, data);
+	utils_write_file(config_file, data);
 	g_free(data);
 }
 
@@ -116,17 +116,17 @@
 {
 	gchar *ret, *tmp;
 	gchar *key = g_strdup_printf("command%d", cmd_num);
-	ret = p_utils->get_setting_string(config, lang, key, "");
+	ret = utils_get_setting_string(config, lang, key, "");
 	g_free(key);
 	if (!NZV(ret))
 		return ret;
 	key = g_strdup_printf("command%d", cmd_num + 1);
-	tmp = p_utils->get_setting_string(config, lang, key, "");
+	tmp = utils_get_setting_string(config, lang, key, "");
 	g_free(key);
 	if (NZV(tmp))
 		*intern = TRUE;
 	else
-		*intern = p_utils->get_setting_boolean(config, lang, "internal", FALSE);
+		*intern = utils_get_setting_boolean(config, lang, "internal", FALSE);
 	g_free(tmp);
 	return ret;
 }
Index: geanydoc/src/geanydoc.c
===================================================================
--- geanydoc/src/geanydoc.c	(revision 328)
+++ geanydoc/src/geanydoc.c	(working copy)
@@ -39,7 +39,7 @@
 #include "utils.h"
 
 #include "plugindata.h"		/* this defines the plugin API */
-#include "pluginmacros.h"	/* some useful macros to avoid typing geany_data so often */
+#include "geanyfunctions.h"	/* some useful macros to avoid typing geany_data so often */
 
 #include "geanydoc.h"
 
@@ -54,7 +54,7 @@
 
 /* Check that Geany supports plugin API version 71 or later, and check
  * for binary compatibility. */
-PLUGIN_VERSION_CHECK(78)
+PLUGIN_VERSION_CHECK(115)
 /* All plugins must set name, description, version and author. */
 	PLUGIN_SET_INFO(_("Doc"), _("Call documentation viewer on current symbol."), VERSION,
 		_("Yura Siamshka <yurand2@gmail.com>"));
@@ -97,23 +97,23 @@
 	gchar c;
 	gint text_len;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_val_if_fail(doc != NULL && doc->file_name != NULL, NULL);
 
-	text_len = p_sci->get_selected_text_length(doc->editor->sci);
+	text_len = sci_get_selected_text_length(doc->editor->sci);
 	if (text_len > 1)
 	{
 		txt = g_malloc(text_len + 1);
-		p_sci->get_selected_text(doc->editor->sci, txt);
+		sci_get_selected_text(doc->editor->sci, txt);
 		return txt;
 	}
 
-	pos = p_sci->get_current_position(doc->editor->sci);
+	pos = sci_get_current_position(doc->editor->sci);
 	if (pos > 0)
 		pos--;
 
 	cstart = pos;
-	c = p_sci->get_char_at(doc->editor->sci, cstart);
+	c = sci_get_char_at(doc->editor->sci, cstart);
 
 	if (!word_check_left(c))
 		return NULL;
@@ -122,25 +122,25 @@
 	{
 		cstart--;
 		if (cstart >= 0)
-			c = p_sci->get_char_at(doc->editor->sci, cstart);
+			c = sci_get_char_at(doc->editor->sci, cstart);
 		else
 			break;
 	}
 	cstart++;
 
 	cend = pos;
-	c = p_sci->get_char_at(doc->editor->sci, cend);
-	while (word_check_right(c) && cend < p_sci->get_length(doc->editor->sci))
+	c = sci_get_char_at(doc->editor->sci, cend);
+	while (word_check_right(c) && cend < sci_get_length(doc->editor->sci))
 	{
 		cend++;
-		c = p_sci->get_char_at(doc->editor->sci, cend);
+		c = sci_get_char_at(doc->editor->sci, cend);
 	}
 
 	if (cstart == cend)
 		return NULL;
 	txt = g_malloc0(cend - cstart + 1);
 
-	p_sci->get_text_range(doc->editor->sci, cstart, cend, txt);
+	sci_get_text_range(doc->editor->sci, cstart, cend, txt);
 	return txt;
 }
 
@@ -155,28 +155,28 @@
 
 	if (std_output)
 	{
-		cur_doc = p_document->get_current();
-		doc = p_document->find_by_filename(name);
+		cur_doc = document_get_current();
+		doc = document_find_by_filename(name);
 		if (doc == NULL)
 		{
-			doc = p_document->new_file(name,
-						   filetypes_array->pdata[filetype_new_file],
+			doc = document_new_file(name,
+						   filetypes_index(filetype_new_file),
 						   std_output);
 		}
 		else
 		{
-			p_sci->set_text(doc->editor->sci, std_output);
+			sci_set_text(doc->editor->sci, std_output);
 			book = GTK_NOTEBOOK(geany->main_widgets->notebook);
 			page = gtk_notebook_page_num(book, GTK_WIDGET(doc->editor->sci));
 			gtk_notebook_set_current_page(book, page);
 		}
-		p_document->set_text_changed(doc, FALSE);
-		p_document->set_encoding(doc, (force_encoding ? force_encoding : "UTF-8"));
-		p_navqueue->goto_line(cur_doc, p_document->get_current(), 1);
+		document_set_text_changed(doc, FALSE);
+		document_set_encoding(doc, (force_encoding ? force_encoding : "UTF-8"));
+		navqueue_goto_line(cur_doc, document_get_current(), 1);
 	}
 	else
 	{
-		p_ui->set_statusbar(FALSE, _("Could not parse the output of command"));
+		ui_set_statusbar(FALSE, _("Could not parse the output of command"));
 	}
 }
 
@@ -189,7 +189,7 @@
 	gchar *tmp;
 	gboolean intern;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc != NULL && doc->file_name != NULL);
 
 	ftype = doc->file_type->name;
@@ -250,7 +250,7 @@
 	/* run the dialog and check for the response code */
 	if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)
 	{
-		entry = p_support->lookup_widget(dialog, "entry_word");
+		entry = ui_lookup_widget(dialog, "entry_word");
 		word = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
 	}
 	gtk_widget_destroy(dialog);
@@ -266,9 +266,9 @@
 on_comboboxType_changed(GtkComboBox * combobox, G_GNUC_UNUSED gpointer user_data)
 {
 	gchar *from, *to;
-	GtkWidget *cmd0 = p_support->lookup_widget(GTK_WIDGET(combobox), "entryCommand0");
-	GtkWidget *cmd1 = p_support->lookup_widget(GTK_WIDGET(combobox), "entryCommand1");
-	GtkWidget *intern = p_support->lookup_widget(GTK_WIDGET(combobox), "cbIntern");
+	GtkWidget *cmd0 = ui_lookup_widget(GTK_WIDGET(combobox), "entryCommand0");
+	GtkWidget *cmd1 = ui_lookup_widget(GTK_WIDGET(combobox), "entryCommand1");
+	GtkWidget *intern = ui_lookup_widget(GTK_WIDGET(combobox), "cbIntern");
 
 	gchar *cmd0_txt = (gchar *) gtk_entry_get_text(GTK_ENTRY(cmd0));
 	gchar *cmd1_txt = (gchar *) gtk_entry_get_text(GTK_ENTRY(cmd1));
@@ -293,9 +293,9 @@
 	}
 	g_object_set_data(G_OBJECT(combobox), "current", g_strdup(to));
 
-	cmd0_txt = p_utils->get_setting_string(config, to, "command0", "");
-	cmd1_txt = p_utils->get_setting_string(config, to, "command1", "");
-	intern_b = p_utils->get_setting_boolean(config, to, "internal", FALSE);
+	cmd0_txt = utils_get_setting_string(config, to, "command0", "");
+	cmd1_txt = utils_get_setting_string(config, to, "command1", "");
+	intern_b = utils_get_setting_boolean(config, to, "internal", FALSE);
 
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(intern), intern_b);
 	gtk_entry_set_text(GTK_ENTRY(cmd0), cmd0_txt);
@@ -451,9 +451,9 @@
 	keyb1 = gtk_menu_item_new();
 	keyb2 = gtk_menu_item_new();
 
-	p_keybindings->set_item(plugin_key_group, KB_DOCUMENT_WORD, kb_doc,
+	keybindings_set_item(plugin_key_group, KB_DOCUMENT_WORD, kb_doc,
 				0, 0, kb_label1, kb_label1, keyb1);
-	p_keybindings->set_item(plugin_key_group, KB_DOCUMENT_WORD_ASK, kb_doc_ask,
+	keybindings_set_item(plugin_key_group, KB_DOCUMENT_WORD_ASK, kb_doc_ask,
 				0, 0, kb_label2, kb_label2, keyb2);
 }
 
@@ -463,14 +463,13 @@
 	guint i;
 	GtkWidget *cbTypes;
 
-	cbTypes = p_support->lookup_widget(dialog, "comboboxType");
+	cbTypes = ui_lookup_widget(dialog, "comboboxType");
 	g_object_set(cbTypes, "wrap-width", 3, NULL);
 
-	for (i = 0; i < filetypes_array->len; i++)
+	for (i = 0; i < geany->filetypes_array->len; i++)
 	{
 		gtk_combo_box_append_text(GTK_COMBO_BOX(cbTypes),
-					  ((struct GeanyFiletype *) (filetypes_array->pdata[i]))->
-					  name);
+					  filetypes_index(i)->name);
 	}
 	g_object_set_data(G_OBJECT(cbTypes), "config", config_clone());
 	g_object_set_data(G_OBJECT(cbTypes), "current", NULL);
@@ -490,7 +489,7 @@
 	dialog = create_Configure();
 	init_Configure(dialog);
 
-	cbTypes = p_support->lookup_widget(dialog, "comboboxType");
+	cbTypes = ui_lookup_widget(dialog, "comboboxType");
 
 	/* run the dialog and check for the response code */
 
Index: geanyvc/externdiff.c
===================================================================
--- geanyvc/externdiff.c	(revision 328)
+++ geanyvc/externdiff.c	(working copy)
@@ -29,7 +29,7 @@
 #include "ui_utils.h"
 #include "project.h"
 #include "prefs.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 
 #include "geanyvc.h"
@@ -81,7 +81,7 @@
 	argv[1] = (gchar *) src;
 	argv[2] = (gchar *) dest;
 
-	p_utils->spawn_sync(NULL, argv, NULL,
+	utils_spawn_sync(NULL, argv, NULL,
 			    G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL |
 			    G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, NULL, NULL, NULL, NULL);
 }
Index: geanyvc/vc_svn.c
===================================================================
--- geanyvc/vc_svn.c	(revision 328)
+++ geanyvc/vc_svn.c	(working copy)
@@ -27,7 +27,7 @@
 #include "document.h"
 #include "filetypes.h"
 #include "utils.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "geanyvc.h"
 
Index: geanyvc/utils.c
===================================================================
--- geanyvc/utils.c	(revision 328)
+++ geanyvc/utils.c	(working copy)
@@ -22,7 +22,7 @@
 #include "geany.h"
 #include "utils.h"
 #include "plugindata.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 extern GeanyData *geany_data;
 extern GeanyFunctions *geany_functions;
Index: geanyvc/vc_git.c
===================================================================
--- geanyvc/vc_git.c	(revision 328)
+++ geanyvc/vc_git.c	(working copy)
@@ -27,7 +27,7 @@
 #include "document.h"
 #include "filetypes.h"
 #include "utils.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "geanyvc.h"
 
Index: geanyvc/vc_cvs.c
===================================================================
--- geanyvc/vc_cvs.c	(revision 328)
+++ geanyvc/vc_cvs.c	(working copy)
@@ -27,7 +27,7 @@
 #include "document.h"
 #include "filetypes.h"
 #include "utils.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "geanyvc.h"
 
Index: geanyvc/vc_bzr.c
===================================================================
--- geanyvc/vc_bzr.c	(revision 328)
+++ geanyvc/vc_bzr.c	(working copy)
@@ -27,7 +27,7 @@
 #include "document.h"
 #include "filetypes.h"
 #include "utils.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "geanyvc.h"
 
Index: geanyvc/vc_hg.c
===================================================================
--- geanyvc/vc_hg.c	(revision 328)
+++ geanyvc/vc_hg.c	(working copy)
@@ -27,7 +27,7 @@
 #include "document.h"
 #include "filetypes.h"
 #include "utils.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "geanyvc.h"
 
Index: geanyvc/vc_svk.c
===================================================================
--- geanyvc/vc_svk.c	(revision 328)
+++ geanyvc/vc_svk.c	(working copy)
@@ -27,7 +27,7 @@
 #include "document.h"
 #include "filetypes.h"
 #include "utils.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "geanyvc.h"
 
Index: geanyvc/geanyvc.c
===================================================================
--- geanyvc/geanyvc.c	(revision 328)
+++ geanyvc/geanyvc.c	(working copy)
@@ -38,13 +38,13 @@
 #include "ui_utils.h"
 #include "prefs.h"
 #include "keybindings.h"
-#include "pluginmacros.h"
+#include "highlighting.h"
+#include "geanyfunctions.h"
 
 #ifdef HAVE_LOCALE_H
 # include <locale.h>
 #endif
 
-#include "highlighting.h"
 #include "SciLexer.h"
 
 #include "geanyvc.h"
@@ -60,7 +60,7 @@
 GeanyFunctions *geany_functions;
 
 
-PLUGIN_VERSION_CHECK(104);
+PLUGIN_VERSION_CHECK(115);
 PLUGIN_SET_INFO(_("VC"), _("Interface to different Version Control systems."), VERSION,
 		_("Yura Siamashka <yurand2@gmail.com>,\nFrank Lanitz <frank@frank.uvena.de>"));
 
@@ -323,45 +323,45 @@
 		}
 		else if (argv[i] == ABS_DIRNAME)
 		{
-			ret[j] = p_utils->get_locale_from_utf8(abs_dir);
+			ret[j] = utils_get_locale_from_utf8(abs_dir);
 		}
 		else if (argv[i] == ABS_FILENAME)
 		{
-			ret[j] = p_utils->get_locale_from_utf8(filename);
+			ret[j] = utils_get_locale_from_utf8(filename);
 		}
 		else if (argv[i] == BASE_DIRNAME)
 		{
-			ret[j] = p_utils->get_locale_from_utf8(base_dirname);
+			ret[j] = utils_get_locale_from_utf8(base_dirname);
 		}
 		else if (argv[i] == BASE_FILENAME)
 		{
-			ret[j] = p_utils->get_locale_from_utf8(base_filename);
+			ret[j] = utils_get_locale_from_utf8(base_filename);
 		}
 		else if (argv[i] == BASENAME)
 		{
-			ret[j] = p_utils->get_locale_from_utf8(basename);
+			ret[j] = utils_get_locale_from_utf8(basename);
 		}
 		else if (argv[i] == FILE_LIST)
 		{
 			for (tmp = filelist; tmp != NULL; tmp = g_slist_next(tmp))
 			{
-				ret[j] = p_utils->get_locale_from_utf8((gchar *) tmp->data);
+				ret[j] = utils_get_locale_from_utf8((gchar *) tmp->data);
 				j++;
 			}
 			j--;
 		}
 		else if (argv[i] == MESSAGE)
 		{
-			ret[j] = p_utils->get_locale_from_utf8(message);
+			ret[j] = utils_get_locale_from_utf8(message);
 		}
 		else
 		{
 			repl = g_string_new(argv[i]);
-			p_utils->string_replace_all(repl, P_ABS_DIRNAME, abs_dir);
-			p_utils->string_replace_all(repl, P_ABS_FILENAME, filename);
-			p_utils->string_replace_all(repl, P_BASENAME, basename);
+			utils_string_replace_all(repl, P_ABS_DIRNAME, abs_dir);
+			utils_string_replace_all(repl, P_ABS_FILENAME, filename);
+			utils_string_replace_all(repl, P_BASENAME, basename);
 			ret[j] = g_string_free(repl, FALSE);
-			setptr(ret[j], p_utils->get_locale_from_utf8(ret[j]));
+			setptr(ret[j], utils_get_locale_from_utf8(ret[j]));
 		}
 	}
 	g_free(abs_dir);
@@ -382,26 +382,26 @@
 
 	if (std_output)
 	{
-		cur_doc = p_document->get_current();
-		doc = p_document->find_by_filename(name);
+		cur_doc = document_get_current();
+		doc = document_find_by_filename(name);
 		if (doc == NULL)
 		{
-			doc = p_document->new_file(name, NULL, std_output);
+			doc = document_new_file(name, NULL, std_output);
 		}
 		else
 		{
-			p_sci->set_text(doc->editor->sci, std_output);
+			sci_set_text(doc->editor->sci, std_output);
 			book = GTK_NOTEBOOK(geany->main_widgets->notebook);
 			page = gtk_notebook_page_num(book, GTK_WIDGET(doc->editor->sci));
 			gtk_notebook_set_current_page(book, page);
 		}
-		p_document->set_text_changed(doc, set_changed_flag);
-		p_document->set_encoding(doc, (force_encoding ? force_encoding : "UTF-8"));
-		p_navqueue->goto_line(cur_doc, doc, 1);
+		document_set_text_changed(doc, set_changed_flag);
+		document_set_encoding(doc, (force_encoding ? force_encoding : "UTF-8"));
+		navqueue_goto_line(cur_doc, doc, 1);
 	}
 	else
 	{
-		p_ui->set_statusbar(FALSE, _("Could not parse the output of command"));
+		ui_set_statusbar(FALSE, _("Could not parse the output of command"));
 	}
 }
 
@@ -445,14 +445,14 @@
 		argv = cur->data;
 		if (cur != g_slist_last(largv))
 		{
-			p_utils->spawn_sync(dir, cur->data, (gchar **) env,
+			utils_spawn_sync(dir, cur->data, (gchar **) env,
 					    G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL |
 					    G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, NULL, NULL,
 					    &exit_code, &error);
 		}
 		else
 		{
-			p_utils->spawn_sync(dir, cur->data, (gchar **) env,
+			utils_spawn_sync(dir, cur->data, (gchar **) env,
 					    G_SPAWN_SEARCH_PATH | (std_out ? 0 :
 								   G_SPAWN_STDOUT_TO_DEV_NULL) |
 					    (std_err ? 0 : G_SPAWN_STDERR_TO_DEV_NULL), NULL, NULL,
@@ -461,7 +461,7 @@
 		if (error)
 		{
 			g_warning("geanyvc: s_spawn_sync error: %s", error->message);
-			p_ui->set_statusbar(FALSE, _("geanyvc: s_spawn_sync error: %s"),
+			ui_set_statusbar(FALSE, _("geanyvc: s_spawn_sync error: %s"),
 					    error->message);
 			g_error_free(error);
 		}
@@ -471,13 +471,13 @@
 		if (std_out && *std_out)
 		{
 			tmp = g_string_new(*std_out);
-			p_utils->string_replace_all(tmp, "\r\n", "\n");
-			p_utils->string_replace_all(tmp, "\r", "\n");
+			utils_string_replace_all(tmp, "\r\n", "\n");
+			utils_string_replace_all(tmp, "\r", "\n");
 			setptr(*std_out, g_string_free(tmp, FALSE));
 
 			if (!g_utf8_validate(*std_out, -1, NULL))
 			{
-				setptr(*std_out, p_encodings->convert_to_utf8(*std_out,
+				setptr(*std_out, encodings_convert_to_utf8(*std_out,
 									      strlen(*std_out),
 									      NULL));
 			}
@@ -490,13 +490,13 @@
 		if (std_err && *std_err)
 		{
 			tmp = g_string_new(*std_err);
-			p_utils->string_replace_all(tmp, "\r\n", "\n");
-			p_utils->string_replace_all(tmp, "\r", "\n");
+			utils_string_replace_all(tmp, "\r\n", "\n");
+			utils_string_replace_all(tmp, "\r", "\n");
 			setptr(*std_err, g_string_free(tmp, FALSE));
 
 			if (!g_utf8_validate(*std_err, -1, NULL))
 			{
-				setptr(*std_err, p_encodings->convert_to_utf8(*std_err,
+				setptr(*std_err, encodings_convert_to_utf8(*std_err,
 									      strlen(*std_err),
 									      NULL));
 			}
@@ -562,12 +562,12 @@
 	const VC_RECORD *vc;
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc != NULL && doc->file_name != NULL);
 
 	if (doc->changed)
 	{
-		p_document->save_file(doc, FALSE);
+		document_save_file(doc, FALSE);
 	}
 
 	vc = find_vc(doc->file_name);
@@ -586,13 +586,13 @@
 			   4) rename file.geany.~NEW~ to origin file
 			   5) show diff
 			 */
-			localename = p_utils->get_locale_from_utf8(doc->file_name);
+			localename = utils_get_locale_from_utf8(doc->file_name);
 
 			new = g_strconcat(doc->file_name, ".geanyvc.~NEW~", NULL);
-			setptr(new, p_utils->get_locale_from_utf8(new));
+			setptr(new, utils_get_locale_from_utf8(new));
 
 			old = g_strconcat(doc->file_name, ".geanyvc.~BASE~", NULL);
-			setptr(old, p_utils->get_locale_from_utf8(old));
+			setptr(old, utils_get_locale_from_utf8(old));
 
 			if (g_rename(localename, new) != 0)
 			{
@@ -634,7 +634,7 @@
 	}
 	else
 	{
-		p_ui->set_statusbar(FALSE, _("No changes were made."));
+		ui_set_statusbar(FALSE, _("No changes were made."));
 	}
 }
 
@@ -647,12 +647,12 @@
 	const VC_RECORD *vc;
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc != NULL && doc->file_name != NULL);
 
 	if (doc->changed)
 	{
-		p_document->save_file(doc, FALSE);
+		document_save_file(doc, FALSE);
 	}
 
 	base_name = g_path_get_dirname(doc->file_name);
@@ -669,7 +669,7 @@
 	}
 	else
 	{
-		p_ui->set_statusbar(FALSE, _("No changes were made."));
+		ui_set_statusbar(FALSE, _("No changes were made."));
 	}
 
 	g_free(base_name);
@@ -687,12 +687,12 @@
 	const VC_RECORD *vc;
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc != NULL && doc->file_name != NULL);
 
 	if (doc && doc->changed && doc->file_name != NULL)
 	{
-		p_document->save_file(doc, FALSE);
+		document_save_file(doc, FALSE);
 	}
 
 	vc = find_vc(doc->file_name);
@@ -713,7 +713,7 @@
 	}
 	else
 	{
-		p_ui->set_statusbar(FALSE, _("No changes were made."));
+		ui_set_statusbar(FALSE, _("No changes were made."));
 	}
 	g_free(basedir);
 }
@@ -725,7 +725,7 @@
 	const VC_RECORD *vc;
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc != NULL && doc->file_name != NULL);
 
 	vc = find_vc(doc->file_name);
@@ -739,7 +739,7 @@
 	}
 	else
 	{
-		p_ui->set_statusbar(FALSE, _("No history avaible"));
+		ui_set_statusbar(FALSE, _("No history avaible"));
 	}
 }
 
@@ -751,10 +751,10 @@
 	const VC_RECORD *vc;
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc != NULL && doc->file_name != NULL);
 
-	p_ui->set_statusbar(TRUE, doc->file_name);
+	ui_set_statusbar(TRUE, doc->file_name);
 
 	vc = find_vc(doc->file_name);
 	g_return_if_fail(vc);
@@ -775,7 +775,7 @@
 	const VC_RECORD *vc;
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc != NULL && doc->file_name != NULL);
 
 	base_name = g_path_get_dirname(doc->file_name);
@@ -801,7 +801,7 @@
 	GeanyDocument *doc;
 	gchar *basedir;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc != NULL && doc->file_name != NULL);
 
 	vc = find_vc(doc->file_name);
@@ -828,12 +828,12 @@
 	const VC_RECORD *vc;
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc != NULL && doc->file_name != NULL);
 
 	if (doc->changed)
 	{
-		p_document->save_file(doc, FALSE);
+		document_save_file(doc, FALSE);
 	}
 
 	base_name = g_path_get_dirname(doc->file_name);
@@ -860,12 +860,12 @@
 	const VC_RECORD *vc;
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_val_if_fail(doc != NULL && doc->file_name != NULL, FALSE);
 
 	if (doc->changed)
 	{
-		p_document->save_file(doc, FALSE);
+		document_save_file(doc, FALSE);
 	}
 
 	if (ask)
@@ -900,14 +900,14 @@
 	gboolean ret;
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc != NULL && doc->file_name != NULL);
 
 	ret = command_with_question_activated(NULL, VC_COMMAND_REVERT_FILE,
 					      _("Do you really want to revert: %s?"), TRUE);
 	if (ret)
 	{
-		p_document->reload_file(doc, NULL);
+		document_reload_file(doc, NULL);
 	}
 }
 
@@ -928,8 +928,7 @@
 					      _("Do you really want to remove: %s?"), TRUE);
 	if (ret)
 	{
-		p_document->
-			remove_page(gtk_notebook_get_current_page
+		document_remove_page(gtk_notebook_get_current_page
 				    (GTK_NOTEBOOK(geany->main_widgets->notebook)));
 	}
 }
@@ -941,12 +940,12 @@
 	GeanyDocument *doc;
 	gboolean ret;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc != NULL && doc->file_name != NULL);
 
 	if (doc->changed)
 	{
-		p_document->save_file(doc, FALSE);
+		document_save_file(doc, FALSE);
 	}
 
 	ret = command_with_question_activated(&text, VC_COMMAND_UPDATE,
@@ -954,7 +953,7 @@
 					      set_add_confirmation);
 	if (ret)
 	{
-		p_document->reload_file(doc, NULL);
+		document_reload_file(doc, NULL);
 
 		if (NZV(text))
 			show_output(text, "*VC-UPDATE*", NULL);
@@ -1118,7 +1117,7 @@
 commit_toggled(G_GNUC_UNUSED GtkCellRendererToggle * cell, gchar * path_str, gpointer data)
 {
 	GtkTreeView *treeview = GTK_TREE_VIEW(data);
-	GtkWidget *diffView = p_support->lookup_widget(GTK_WIDGET(treeview), "textDiff");
+	GtkWidget *diffView = ui_lookup_widget(GTK_WIDGET(treeview), "textDiff");
 	GtkTreeModel *model = gtk_tree_view_get_model(treeview);
 	GtkTreeIter iter;
 	GtkTreePath *path = gtk_tree_path_new_from_string(path_str);
@@ -1182,7 +1181,7 @@
 	static GdkColor c = { 0, 0, 0, 0 };
 	const GeanyLexerStyle *s;
 
-	s = p_highlighting->get_style(GEANY_FILETYPES_DIFF, style);
+	s = highlighting_get_style(GEANY_FILETYPES_DIFF, style);
 	c.red = (s->foreground % 256) * 257;
 	c.green = s->foreground & -16711936;
 	c.blue = (s->foreground & 0xff0000) / 256;
@@ -1350,11 +1349,11 @@
 	GSList *lst;
 	GtkTreeModel *model;
 	GtkWidget *commit = create_commitDialog();
-	GtkWidget *treeview = p_support->lookup_widget(commit, "treeSelect");
-	GtkWidget *diffView = p_support->lookup_widget(commit, "textDiff");
-	GtkWidget *messageView = p_support->lookup_widget(commit, "textCommitMessage");
-	GtkWidget *vpaned1 = p_support->lookup_widget(commit, "vpaned1");
-	GtkWidget *vpaned2 = p_support->lookup_widget(commit, "vpaned2");
+	GtkWidget *treeview = ui_lookup_widget(commit, "treeSelect");
+	GtkWidget *diffView = ui_lookup_widget(commit, "textDiff");
+	GtkWidget *messageView = ui_lookup_widget(commit, "textCommitMessage");
+	GtkWidget *vpaned1 = ui_lookup_widget(commit, "vpaned1");
+	GtkWidget *vpaned2 = ui_lookup_widget(commit, "vpaned2");
 
 	GtkTextBuffer *mbuf;
 	GtkTextBuffer *diffbuf;
@@ -1374,7 +1373,7 @@
 	GError *spellcheck_error = NULL;
 #endif
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_if_fail(doc);
 	g_return_if_fail(doc->file_name);
 	dir = g_path_get_dirname(doc->file_name);
@@ -1386,7 +1385,7 @@
 	if (!lst)
 	{
 		g_free(dir);
-		p_ui->set_statusbar(FALSE, _("Nothing to commit."));
+		ui_set_statusbar(FALSE, _("Nothing to commit."));
 		return;
 	}
 
@@ -1432,7 +1431,7 @@
 	speller = gtkspell_new_attach(GTK_TEXT_VIEW(messageView), NULL, &spellcheck_error);
 	if (speller == NULL)
 	{
-		p_ui->set_statusbar(FALSE, _("Error initializing spell checking: %s"),
+		ui_set_statusbar(FALSE, _("Error initializing spell checking: %s"),
 				    spellcheck_error->message);
 		g_error_free(spellcheck_error);
 		spellcheck_error = NULL;
@@ -1442,7 +1441,7 @@
 		gtkspell_set_language(speller, lang, &spellcheck_error);
 		if (spellcheck_error != NULL)
 		{
-			p_ui->set_statusbar(TRUE,
+			ui_set_statusbar(TRUE,
 					    _
 					    ("Error while setting up language for spellchecking. Please check configuration. Error message was: %s"),
 					    spellcheck_error->message);
@@ -1503,7 +1502,7 @@
 
 	gchar *dir;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	have_file = doc && doc->file_name && g_path_is_absolute(doc->file_name);
 
 	if (have_file)
@@ -1645,9 +1644,9 @@
 #endif
 
 		if (!g_file_test(config_dir, G_FILE_TEST_IS_DIR)
-		    && p_utils->mkdir(config_dir, TRUE) != 0)
+		    && utils_mkdir(config_dir, TRUE) != 0)
 		{
-			p_dialogs->show_msgbox(GTK_MESSAGE_ERROR,
+			dialogs_show_msgbox(GTK_MESSAGE_ERROR,
 					       _
 					       ("Plugin configuration directory could not be created."));
 		}
@@ -1655,7 +1654,7 @@
 		{
 			// write config to file
 			data = g_key_file_to_data(config, NULL, NULL);
-			p_utils->write_file(config_file, data);
+			utils_write_file(config_file, data);
 			g_free(data);
 		}
 
@@ -1900,7 +1899,7 @@
 	GtkWidget *menu_vc_menu = NULL;
 	GtkTooltips *tooltips = NULL;
 
-	p_main->locale_init(LOCALEDIR, GETTEXT_PACKAGE);
+	main_locale_init(LOCALEDIR, GETTEXT_PACKAGE);
 
 	config_file =
 		g_strconcat(geany->app->configdir, G_DIR_SEPARATOR_S, "plugins", G_DIR_SEPARATOR_S,
@@ -2045,19 +2044,19 @@
 	gtk_widget_show_all(menu_vc);
 
 	/* init keybindins */
-	p_keybindings->set_item(plugin_key_group, VC_DIFF_FILE, kbdiff_file,
+	keybindings_set_item(plugin_key_group, VC_DIFF_FILE, kbdiff_file,
 	0, 0, "vc_show_diff_of_file", _("Show diff of file"), menu_vc_diff_file);
-	p_keybindings->set_item(plugin_key_group, VC_DIFF_DIR, kbdiff_dir,
+	keybindings_set_item(plugin_key_group, VC_DIFF_DIR, kbdiff_dir,
 	0, 0, "vc_show_diff_of_dir", _("Show diff of diretory"), menu_vc_diff_dir);
-	p_keybindings->set_item(plugin_key_group, VC_DIFF_BASEDIR, kbdiff_basedir,
+	keybindings_set_item(plugin_key_group, VC_DIFF_BASEDIR, kbdiff_basedir,
 	0, 0, "vc_show_diff_of_basedir", _("Show diff of basedir"), menu_vc_diff_basedir);
-	p_keybindings->set_item(plugin_key_group, VC_COMMIT, kbcommit,
+	keybindings_set_item(plugin_key_group, VC_COMMIT, kbcommit,
 	0, 0, "vc_commit", _("Commit changes"), menu_vc_commit);
-	p_keybindings->set_item(plugin_key_group, VC_STATUS, kbstatus,
+	keybindings_set_item(plugin_key_group, VC_STATUS, kbstatus,
 	0, 0, "vc_status", _("Show status") , menu_vc_status);
-	p_keybindings->set_item(plugin_key_group, VC_REVERT, kbrevert,
+	keybindings_set_item(plugin_key_group, VC_REVERT, kbrevert,
 	0, 0, "vc_revert", _("Revert changes"), menu_vc_revert_file);
-	p_keybindings->set_item(plugin_key_group, VC_UPDATE, kbupdate,
+	keybindings_set_item(plugin_key_group, VC_UPDATE, kbupdate,
 	0, 0, "vc_update", _("Update file"), menu_vc_update);
 
 	plugin_fields->menu_item = menu_vc;
Index: README
===================================================================

Property changes on: README
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Index: geanylipsum/src/geanylipsum.c
===================================================================
--- geanylipsum/src/geanylipsum.c	(revision 328)
+++ geanylipsum/src/geanylipsum.c	(working copy)
@@ -28,7 +28,7 @@
 #include "filetypes.h"
 #include "utils.h"
 #include "keybindings.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #ifdef HAVE_LOCALE_H
 # include <locale.h>
@@ -64,7 +64,7 @@
 GeanyData		*geany_data;
 GeanyFunctions	*geany_functions;
 
-PLUGIN_VERSION_CHECK(104)
+PLUGIN_VERSION_CHECK(115)
 PLUGIN_SET_INFO(_("Lipsum"), _("Creating dummy text with Geany"), VERSION, _("Frank Lanitz <frank@frank.uvena.de>"));
 
 static GtkWidget *main_menu_item = NULL;
@@ -74,12 +74,12 @@
 {
 	GeanyDocument *doc = NULL;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 
 	if (doc != NULL)
 	{
-		gint pos = p_sci->get_current_position(doc->editor->sci);
-		p_sci->insert_text(doc->editor->sci, pos, string);
+		gint pos = sci_get_current_position(doc->editor->sci);
+		sci_insert_text(doc->editor->sci, pos, string);
 	}
 }
 
@@ -99,7 +99,7 @@
  					GTK_WINDOW(geany->main_widgets->window),
 					GTK_DIALOG_DESTROY_WITH_PARENT,
  					GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
-	vbox = p_ui->dialog_vbox_new(GTK_DIALOG(dialog));
+	vbox = ui_dialog_vbox_new(GTK_DIALOG(dialog));
 	gtk_widget_set_name(dialog, "GeanyDialog");
 	gtk_box_set_spacing(GTK_BOX(vbox), 10);
 
@@ -149,7 +149,7 @@
 	GtkTooltips *tooltips = NULL;
 	tooltips = gtk_tooltips_new();
 
-	p_main->locale_init(LOCALEDIR, GETTEXT_PACKAGE);
+	main_locale_init(LOCALEDIR, GETTEXT_PACKAGE);
 
 	menu_lipsum = gtk_image_menu_item_new_with_mnemonic(_("_Lipsum"));
 	gtk_tooltips_set_tip(tooltips, menu_lipsum,
Index: filetree/src/filetree.c
===================================================================
--- filetree/src/filetree.c	(revision 328)
+++ filetree/src/filetree.c	(working copy)
@@ -35,14 +35,14 @@
 #include "project.h"
 
 #include "plugindata.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 
 PluginFields	*plugin_fields;
 GeanyData		*geany_data;
 
 
-PLUGIN_VERSION_CHECK(26)
+PLUGIN_VERSION_CHECK(115)
 
 PLUGIN_INFO(_("File Tree"), _("Adds a file tree tab to the sidebar."), VERSION,
 	_("The Geany developer team"))
@@ -115,7 +115,7 @@
 		{
 			const gchar *ext = exts[i];
 
-			if (p_utils->str_equal(&base_name[len - strlen(ext)], ext))
+			if (utils_str_equal(&base_name[len - strlen(ext)], ext))
 				return TRUE;
 		}
 	}
@@ -151,7 +151,7 @@
 	else
 		gtk_list_store_append(file_store, &iter);
 
-	utf8_name = p_utils->get_utf8_from_locale(name);
+	utf8_name = utils_get_utf8_from_locale(name);
 
 	gtk_list_store_set(file_store, &iter,
 		FILEVIEW_COLUMN_ICON, (dir) ? GTK_STOCK_DIRECTORY : GTK_STOCK_FILE,
@@ -184,7 +184,7 @@
 	clear();
 
 
-	list = p_utils->get_file_list(current_dir, NULL, NULL);
+	list = utils_get_file_list(current_dir, NULL, NULL);
 	if (list != NULL)
 	{
 		add_top_level_entry();
@@ -214,7 +214,7 @@
 	if (project)
 		dir = project->base_path;
 	if (NZV(dir))
-		return p_utils->get_locale_from_utf8(dir);
+		return utils_get_locale_from_utf8(dir);
 
 	return g_get_current_dir();
 }
@@ -224,7 +224,7 @@
 {
 	gchar *fname;
 	gchar *dir;
-	gint idx = p_document->get_cur_idx();
+	gint idx = document_get_cur_idx();
 
 	if (! DOC_IDX_VALID(idx) || doc_list[idx].file_name == NULL ||
 		! g_path_is_absolute(doc_list[idx].file_name))
@@ -234,7 +234,7 @@
 		return;
 	}
 	fname = doc_list[idx].file_name;
-	fname = p_utils->get_locale_from_utf8(fname);
+	fname = utils_get_locale_from_utf8(fname);
 	dir = g_path_get_dirname(fname);
 	g_free(fname);
 
@@ -248,7 +248,7 @@
 	if (gtk_tree_selection_count_selected_rows(treesel) == 1)
 		return TRUE;
 
-	p_ui->set_statusbar(FALSE, _("Too many items selected!"));
+	ui_set_statusbar(FALSE, _("Too many items selected!"));
 	return FALSE;
 }
 
@@ -270,7 +270,7 @@
 		gtk_tree_model_get_iter(model, &iter, treepath);
 		gtk_tree_model_get(model, &iter, FILEVIEW_COLUMN_ICON, &icon, -1);
 
-		if (p_utils->str_equal(icon, GTK_STOCK_DIRECTORY))
+		if (utils_str_equal(icon, GTK_STOCK_DIRECTORY))
 		{
 			dir_found = TRUE;
 			g_free(icon);
@@ -292,13 +292,13 @@
 	gtk_tree_model_get_iter(model, &iter, treepath);
 	gtk_tree_model_get(model, &iter, FILEVIEW_COLUMN_NAME, &name, -1);
 
-	if (p_utils->str_equal(name, ".."))
+	if (utils_str_equal(name, ".."))
 	{
 		fname = g_path_get_dirname(current_dir);
 	}
 	else
 	{
-		setptr(name, p_utils->get_locale_from_utf8(name));
+		setptr(name, utils_get_locale_from_utf8(name));
 		fname = g_build_filename(current_dir, name, NULL);
 	}
 	g_free(name);
@@ -320,18 +320,18 @@
 	else
 		dir = g_strdup(fname);
 
-	p_utils->string_replace_all(cmd_str, "%f", fname);
-	p_utils->string_replace_all(cmd_str, "%d", dir);
+	utils_string_replace_all(cmd_str, "%f", fname);
+	utils_string_replace_all(cmd_str, "%d", dir);
 
 	cmd = g_string_free(cmd_str, FALSE);
-	locale_cmd = p_utils->get_locale_from_utf8(cmd);
+	locale_cmd = utils_get_locale_from_utf8(cmd);
 	if (! g_spawn_command_line_async(locale_cmd, &error))
 	{
 		gchar *c = strchr(cmd, ' ');
 
 		if (c != NULL)
 			*c = '\0';
-		p_ui->set_statusbar(TRUE,
+		ui_set_statusbar(TRUE,
 			_("Could not execute configured external command '%s' (%s)."),
 			cmd, error->message);
 		g_error_free(error);
@@ -373,7 +373,7 @@
 }
 
 
-/* We use p_document->open_files() as it's more efficient. */
+/* We use document_open_files() as it's more efficient. */
 static void open_selected_files(GList *list)
 {
 	GSList *files = NULL;
@@ -386,7 +386,7 @@
 
 		files = g_slist_append(files, fname);
 	}
-	p_document->open_files(files, FALSE, NULL, NULL);
+	document_open_files(files, FALSE, NULL, NULL);
 	g_slist_foreach(files, (GFunc) g_free, NULL);	/* free filenames */
 	g_slist_free(files);
 }
@@ -439,7 +439,7 @@
 
 static void on_hide_sidebar(void)
 {
-	p_keybindings->send_command(GEANY_KEY_GROUP_VIEW, GEANY_KEYS_VIEW_SIDEBAR);
+	keybindings_send_command(GEANY_KEY_GROUP_VIEW, GEANY_KEYS_VIEW_SIDEBAR);
 }
 
 
@@ -601,7 +601,7 @@
 static GtkWidget *make_toolbar(void)
 {
 	GtkWidget *wid, *toolbar;
-	GtkTooltips *tooltips = GTK_TOOLTIPS(p_support->lookup_widget(
+	GtkTooltips *tooltips = GTK_TOOLTIPS(ui_lookup_widget(
 		app->window, "tooltips"));
 
 	toolbar = gtk_toolbar_new();
@@ -693,7 +693,7 @@
 	load_settings();
 
 	/* setup keybindings */
-	p_keybindings->set_item(plugin_key_group, KB_FOCUS_FILE_LIST, kb_activate,
+	keybindings_set_item(plugin_key_group, KB_FOCUS_FILE_LIST, kb_activate,
 		0, 0, "focus_file_list", _("Focus File List"), NULL);
 }
 
@@ -706,7 +706,7 @@
 	dialog = gtk_dialog_new_with_buttons(_("File Browser"),
 		GTK_WINDOW(parent), GTK_DIALOG_DESTROY_WITH_PARENT,
 		GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL);
-	vbox = p_ui->dialog_vbox_new(GTK_DIALOG(dialog));
+	vbox = ui_dialog_vbox_new(GTK_DIALOG(dialog));
 	gtk_widget_set_name(dialog, "GeanyDialog");
 	gtk_box_set_spacing(GTK_BOX(vbox), 6);
 
@@ -760,16 +760,16 @@
 		g_key_file_set_boolean(config, "filebrowser", "show_hidden_files", show_hidden_files);
 		g_key_file_set_boolean(config, "filebrowser", "hide_object_files", hide_object_files);
 
-		if (! g_file_test(config_dir, G_FILE_TEST_IS_DIR) && p_utils->mkdir(config_dir, TRUE) != 0)
+		if (! g_file_test(config_dir, G_FILE_TEST_IS_DIR) && utils_mkdir(config_dir, TRUE) != 0)
 		{
-			p_dialogs->show_msgbox(GTK_MESSAGE_ERROR,
+			dialogs_show_msgbox(GTK_MESSAGE_ERROR,
 				_("Plugin configuration directory could not be created."));
 		}
 		else
 		{
 			/* write config to file */
 			data = g_key_file_to_data(config, NULL, NULL);
-			p_utils->write_file(config_file, data);
+			utils_write_file(config_file, data);
 			g_free(data);
 		}
 
Index: geanylatex/src/geanylatex.c
===================================================================
--- geanylatex/src/geanylatex.c	(revision 328)
+++ geanylatex/src/geanylatex.c	(working copy)
@@ -24,7 +24,7 @@
 
 #include "geanylatex.h"
 
-PLUGIN_VERSION_CHECK(111)
+PLUGIN_VERSION_CHECK(115)
 
 PLUGIN_SET_INFO(_("LaTeX"), _("Plugin to provide better LaTeX support"), "0.3dev",
 	    "Frank Lanitz <frank@frank.uvena.de>")
@@ -63,12 +63,12 @@
 {
 	GeanyDocument *doc = NULL;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 
 	if (doc != NULL)
 	{
-		gint pos = p_sci->get_current_position(doc->editor->sci);
-		p_sci->insert_text(doc->editor->sci, pos, string);
+		gint pos = sci_get_current_position(doc->editor->sci);
+		sci_insert_text(doc->editor->sci, pos, string);
 	}
 }
 
@@ -99,7 +99,7 @@
 					     GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL,
 					     GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
 					     NULL);
-	vbox = p_ui->dialog_vbox_new(GTK_DIALOG(dialog));
+	vbox = ui_dialog_vbox_new(GTK_DIALOG(dialog));
 	gtk_widget_set_name(dialog, "GeanyDialog");
 	gtk_box_set_spacing(GTK_BOX(vbox), 10);
 
@@ -143,7 +143,7 @@
 					     GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL,
 					     GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
 					     NULL);
-	vbox = p_ui->dialog_vbox_new(GTK_DIALOG(dialog));
+	vbox = ui_dialog_vbox_new(GTK_DIALOG(dialog));
 	gtk_widget_set_name(dialog, "GeanyDialog");
 	gtk_box_set_spacing(GTK_BOX(vbox), 10);
 
@@ -362,12 +362,12 @@
 show_output(const gchar * output, const gchar * name, const gint local_enc)
 {
 	GeanyDocument *doc = NULL;
-	GeanyFiletype *ft = p_filetypes->lookup_by_name("LaTeX");
+	GeanyFiletype *ft = filetypes_lookup_by_name("LaTeX");
 
 	if (output)
 	{
-		doc = p_document->new_file(name, ft, output);
-		p_document->set_encoding(doc, p_encodings->get_charset_from_index(latex_encodings[local_enc].geany_enc));
+		doc = document_new_file(name, ft, output);
+		document_set_encoding(doc, encodings_get_charset_from_index(latex_encodings[local_enc].geany_enc));
 	}
 
 }
@@ -529,7 +529,7 @@
 					     GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL,
 					     GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
 					     NULL);
-	vbox = p_ui->dialog_vbox_new(GTK_DIALOG(dialog));
+	vbox = ui_dialog_vbox_new(GTK_DIALOG(dialog));
 	gtk_widget_set_name(dialog, "GeanyDialog");
 	gtk_box_set_spacing(GTK_BOX(vbox), 10);
 	gtk_container_add(GTK_CONTAINER(vbox), table);
@@ -684,17 +684,17 @@
 
 		if (classoptions != NULL)
 		{
-			p_utils->string_replace_all(code, "{CLASSOPTION}", classoptions);
+			utils_string_replace_all(code, "{CLASSOPTION}", classoptions);
 			g_free(classoptions);
 		}
 		if (documentclass_str != NULL)
 		{
-			p_utils->string_replace_all(code, "{DOCUMENTCLASS}", documentclass_str);
+			utils_string_replace_all(code, "{DOCUMENTCLASS}", documentclass_str);
 			g_free(documentclass_str);
 		}
 		if (enc_latex_char != NULL)
 		{
-			p_utils->string_replace_all(code, "{ENCODING}", enc_latex_char);
+			utils_string_replace_all(code, "{ENCODING}", enc_latex_char);
 			g_free(enc_latex_char);
 		}
 		if (author != NULL)
@@ -710,16 +710,16 @@
 					author = g_strconcat("\\author{", author, "}\n", NULL);
 				}
 
-				p_utils->string_replace_all(code, "{AUTHOR}", author);
+				utils_string_replace_all(code, "{AUTHOR}", author);
 			}
 			else
 				if (documentclass_int == 3)
 				{
-					p_utils->string_replace_all(code, "{AUTHOR}", "\% \\signature{}\n");
+					utils_string_replace_all(code, "{AUTHOR}", "\% \\signature{}\n");
 				}
 				else
 				{
-					p_utils->string_replace_all(code, "{AUTHOR}", "\% \\author{}\n");
+					utils_string_replace_all(code, "{AUTHOR}", "\% \\author{}\n");
 				}
 
 			g_free(author);
@@ -729,10 +729,10 @@
 			if (date[0] != '\0')
 			{
 				date = g_strconcat("\\date{", date, "}\n", NULL);
-				p_utils->string_replace_all(code, "{DATE}", date);
+				utils_string_replace_all(code, "{DATE}", date);
 			}
 			else
-				p_utils->string_replace_all(code, "{DATE}", "\% \\date{}\n");
+				utils_string_replace_all(code, "{DATE}", "\% \\date{}\n");
 			g_free(date);
 		}
 		if (title != NULL)
@@ -748,23 +748,23 @@
 					title = g_strconcat("\\title{", title, "}\n", NULL);
 				}
 
-				p_utils->string_replace_all(code, "{TITLE}", title);
+				utils_string_replace_all(code, "{TITLE}", title);
 			}
 			else
 				if (documentclass_int == 3)
 				{
-					p_utils->string_replace_all(code, "{TITLE}", "\% \\subject{} \n");
+					utils_string_replace_all(code, "{TITLE}", "\% \\subject{} \n");
 				}
 				else
 				{
-					p_utils->string_replace_all(code, "{TITLE}", "\% \\title{} \n");
+					utils_string_replace_all(code, "{TITLE}", "\% \\title{} \n");
 				}
 
 			g_free(title);
 		}
 
-		p_utils->string_replace_all(code, "{OPENING}", _("Dear Sir or Madame"));
-		p_utils->string_replace_all(code, "{CLOSING}", _("With kind regards"));
+		utils_string_replace_all(code, "{OPENING}", _("Dear Sir or Madame"));
+		utils_string_replace_all(code, "{CLOSING}", _("With kind regards"));
 
 		output = g_string_free(code, FALSE);
 		show_output(output, NULL, encoding_int);
@@ -800,7 +800,7 @@
 	GtkWidget *tmp = NULL;
 	int i;
 
-	p_main->locale_init(LOCALEDIR, GETTEXT_PACKAGE);
+	main_locale_init(LOCALEDIR, GETTEXT_PACKAGE);
 
 	init_encodings_latex();
 
@@ -813,7 +813,7 @@
 	gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_latex), menu_latex_menu);
 
 
-	menu_latex_wizzard = p_ui->image_menu_item_new(GTK_STOCK_NEW, _("LaTeX-_Wizard"));
+	menu_latex_wizzard = ui_image_menu_item_new(GTK_STOCK_NEW, _("LaTeX-_Wizard"));
 	gtk_container_add(GTK_CONTAINER(menu_latex_menu), menu_latex_wizzard);
 	gtk_tooltips_set_tip(tooltips, menu_latex_wizzard,
 			     _("Starts a Wizard to easily create LaTeX-documents"), NULL);
@@ -858,20 +858,20 @@
 
 	/* init keybindins */
 
-	p_keybindings->set_item(plugin_key_group, LATEX_WIZZARD_KB, kbwizard,
+	keybindings_set_item(plugin_key_group, LATEX_WIZZARD_KB, kbwizard,
 		0, 0, "run_latex_wizard", _("Run LaTeX-Wizard"), menu_latex_wizzard);
-	p_keybindings->set_item(plugin_key_group, LATEX_INSERT_LABEL_KB, kblabel_insert,
+	keybindings_set_item(plugin_key_group, LATEX_INSERT_LABEL_KB, kblabel_insert,
 		0, 0, "insert_latex_label", _("Insert \\label"), menu_latex_label);
-	p_keybindings->set_item(plugin_key_group, LATEX_INSERT_REF_KB, kbref_insert,
+	keybindings_set_item(plugin_key_group, LATEX_INSERT_REF_KB, kbref_insert,
 		0, 0, "insert_latex_ref", _("Insert \\ref"), menu_latex_ref);
-/*	p_keybindings->set_item(plugin_key_group, LATEX_INSERT_BIBTEX_ENTRY_KB,
+/*	keybindings_set_item(plugin_key_group, LATEX_INSERT_BIBTEX_ENTRY_KB,
 		kb_bibtex_entry_insert, 0, 0, "insert_latex_bibtex_entry", _("Add BiBTeX entry"),
 		menu_latex_bibtex); */
 
-	p_ui->add_document_sensitive(menu_latex_menu_special_char);
-	p_ui->add_document_sensitive(menu_latex_ref);
-	p_ui->add_document_sensitive(menu_latex_label);
-	p_ui->add_document_sensitive(menu_latex_bibtex);
+	ui_add_document_sensitive(menu_latex_menu_special_char);
+	ui_add_document_sensitive(menu_latex_ref);
+	ui_add_document_sensitive(menu_latex_label);
+	ui_add_document_sensitive(menu_latex_bibtex);
 
 	gtk_widget_set_sensitive(menu_latex_wizzard, TRUE);
 	gtk_widget_show_all(menu_latex);
Index: geanylatex/src/geanylatex.h
===================================================================
--- geanylatex/src/geanylatex.h	(revision 328)
+++ geanylatex/src/geanylatex.h	(working copy)
@@ -38,7 +38,7 @@
 #include "ui_utils.h"
 #include "keybindings.h"
 #include "prefs.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 #include "datatypes.h"
 #include "letters.h"
 #include "latexencodings.h"
Index: geanylatex/src/bibtex.c
===================================================================
--- geanylatex/src/bibtex.c	(revision 328)
+++ geanylatex/src/bibtex.c	(working copy)
@@ -132,7 +132,7 @@
 	int i;
 	if(str != NULL) {
 		for (i = 0; i < N_ENTRIES; i++) {
-			if (p_utils->str_casecmp(str, label_entry[i]) == 0)
+			if (utils_str_casecmp(str, label_entry[i]) == 0)
 				return i;
 		}
 	}
Index: geanydebug/src/geanydebug.c
===================================================================
--- geanydebug/src/geanydebug.c	(revision 328)
+++ geanydebug/src/geanydebug.c	(working copy)
@@ -39,7 +39,7 @@
 #include "msgwindow.h"
 
 #include "plugindata.h"
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "gdb-io.h"
 #include "gdb-ui.h"
@@ -51,7 +51,7 @@
 
 
 
-PLUGIN_VERSION_CHECK(78)
+PLUGIN_VERSION_CHECK(115)
 PLUGIN_SET_INFO(_("Debugger"), _("Integrated debugging with GDB."), VERSION, _("Jeff Pohlmeyer"))
 
 static GeanyData *geany_data;
@@ -75,7 +75,7 @@
 info_message_cb(const gchar * msg)
 {
 	show_compwin();
-	p_msgwindow->compiler_add(COLOR_BLACK, msg);
+	msgwin_compiler_add(COLOR_BLACK, msg);
 }
 
 
@@ -83,7 +83,7 @@
 warn_message_cb(const gchar * msg)
 {
 	show_compwin();
-	p_msgwindow->compiler_add(COLOR_RED, msg);
+	msgwin_compiler_add(COLOR_RED, msg);
 }
 
 
@@ -111,22 +111,22 @@
 	gint line_num = gdbio_atoi((gchar *) line) - 1;
 	if (reason)
 	{
-		p_msgwindow->compiler_add(COLOR_BLUE, reason);
+		msgwin_compiler_add(COLOR_BLUE, reason);
 	}
-	doc = p_document->open_file(filename, FALSE, NULL, NULL);
+	doc = document_open_file(filename, FALSE, NULL, NULL);
 	if (!(doc && doc->is_valid))
 	{
 		return;
 	}
 	page = gtk_notebook_page_num(NOTEBOOK, GTK_WIDGET(doc->editor->sci));
 	gtk_notebook_set_current_page(NOTEBOOK, page);
-	pos = p_sci->get_position_from_line(doc->editor->sci, line_num);
-	p_sci->ensure_line_is_visible(doc->editor->sci, line_num);
+	pos = sci_get_position_from_line(doc->editor->sci, line_num);
+	sci_ensure_line_is_visible(doc->editor->sci, line_num);
 	while (gtk_events_pending())
 	{
 		gtk_main_iteration();
 	}
-	p_sci->set_current_position(doc->editor->sci, pos, TRUE);
+	sci_set_current_position(doc->editor->sci, pos, TRUE);
 	gtk_widget_grab_focus(GTK_WIDGET(doc->editor->sci));
 	gtk_window_present(GTK_WINDOW(geany->main_widgets->window));
 }
@@ -140,17 +140,17 @@
 	gint pos, linenum, bol, bow, eow;
 	gchar *text = NULL;
 	gchar *rv = NULL;
-	document *doc = p_document->get_current();
+	document *doc = document_get_current();
 	if (!(doc && doc->is_valid))
 	{
 		return NULL;
 	}
-	pos = p_sci->get_current_position(doc->sci);
-	linenum = p_sci->get_line_from_position(doc->sci, pos);
-	bol = p_sci->get_position_from_line(doc->sci, linenum);
+	pos = sci_get_current_position(doc->sci);
+	linenum = sci_get_line_from_position(doc->sci, pos);
+	bol = sci_get_position_from_line(doc->sci, linenum);
 	bow = pos - bol;
 	eow = pos - bol;
-	text = p_sci->get_line(doc->sci, linenum);
+	text = sci_get_line(doc->sci, linenum);
 	word_chars = GEANY_WORDCHARS;
 	while ((bow > 0) && (strchr(word_chars, text[bow - 1]) != NULL))
 	{
@@ -192,23 +192,23 @@
 	gchar c;
 	gint text_len;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	g_return_val_if_fail(doc != NULL && doc->file_name != NULL, NULL);
 
-	text_len = p_sci->get_selected_text_length(doc->editor->sci);
+	text_len = sci_get_selected_text_length(doc->editor->sci);
 	if (text_len > 1)
 	{
 		txt = g_malloc(text_len + 1);
-		p_sci->get_selected_text(doc->editor->sci, txt);
+		sci_get_selected_text(doc->editor->sci, txt);
 		return txt;
 	}
 
-	pos = p_sci->get_current_position(doc->editor->sci);
+	pos = sci_get_current_position(doc->editor->sci);
 	if (pos > 0)
 		pos--;
 
 	cstart = pos;
-	c = p_sci->get_char_at(doc->editor->sci, cstart);
+	c = sci_get_char_at(doc->editor->sci, cstart);
 
 	if (!word_check_left(c))
 		return NULL;
@@ -217,25 +217,25 @@
 	{
 		cstart--;
 		if (cstart >= 0)
-			c = p_sci->get_char_at(doc->editor->sci, cstart);
+			c = sci_get_char_at(doc->editor->sci, cstart);
 		else
 			break;
 	}
 	cstart++;
 
 	cend = pos;
-	c = p_sci->get_char_at(doc->editor->sci, cend);
-	while (word_check_right(c) && cend < p_sci->get_length(doc->editor->sci))
+	c = sci_get_char_at(doc->editor->sci, cend);
+	while (word_check_right(c) && cend < sci_get_length(doc->editor->sci))
 	{
 		cend++;
-		c = p_sci->get_char_at(doc->editor->sci, cend);
+		c = sci_get_char_at(doc->editor->sci, cend);
 	}
 
 	if (cstart == cend)
 		return NULL;
 	txt = g_malloc0(cend - cstart + 1);
 
-	p_sci->get_text_range(doc->editor->sci, cstart, cend, txt);
+	sci_get_text_range(doc->editor->sci, cstart, cend, txt);
 	return txt;
 }
 
@@ -245,7 +245,7 @@
 static LocationInfo *
 location_query_cb()
 {
-	GeanyDocument *doc = p_document->get_current();
+	GeanyDocument *doc = document_get_current();
 	if (!(doc && doc->is_valid))
 	{
 		return NULL;
@@ -255,7 +255,7 @@
 		LocationInfo *abi;
 		gint line;
 		abi = g_new0(LocationInfo, 1);
-		line = p_sci->get_current_line(doc->editor->sci);
+		line = sci_get_current_line(doc->editor->sci);
 		abi->filename = g_strdup(doc->file_name);
 		if (line >= 0)
 		{
@@ -277,15 +277,15 @@
 	g_key_file_set_string(kf, unix_name, "term_cmd", gdbui_setup.options.term_cmd);
 	g_key_file_set_boolean(kf, unix_name, "show_tooltips", gdbui_setup.options.show_tooltips);
 	g_key_file_set_boolean(kf, unix_name, "show_icons", gdbui_setup.options.show_icons);
-	if (p_utils->mkdir(gdbio_setup.temp_dir, TRUE) != 0)
+	if (utils_mkdir(gdbio_setup.temp_dir, TRUE) != 0)
 	{
-		p_dialogs->show_msgbox(GTK_MESSAGE_ERROR,
+		dialogs_show_msgbox(GTK_MESSAGE_ERROR,
 				       _("Plugin configuration directory could not be created."));
 	}
 	else
 	{
 		gchar *data = g_key_file_to_data(kf, NULL, NULL);
-		p_utils->write_file(config_file, data);
+		utils_write_file(config_file, data);
 		g_free(data);
 	}
 	g_key_file_free(kf);
@@ -375,12 +375,12 @@
 	gdbui_setup.line_func = goto_file_line_cb;
 
 
-	msgbook = GTK_NOTEBOOK(p_support->lookup_widget(geany->main_widgets->window, "notebook_info"));
-	compwin = gtk_widget_get_parent(p_support->lookup_widget(geany->main_widgets->window, "treeview5"));
+	msgbook = GTK_NOTEBOOK(ui_lookup_widget(geany->main_widgets->window, "notebook_info"));
+	compwin = gtk_widget_get_parent(ui_lookup_widget(geany->main_widgets->window, "treeview5"));
 	frame = gtk_frame_new(NULL);
 	gtk_notebook_append_page(GTK_NOTEBOOK(geany->main_widgets->sidebar_notebook), frame,
 				 gtk_label_new("Debug"));
-	gdbui_set_tips(GTK_TOOLTIPS(p_support->lookup_widget(geany->main_widgets->window, "tooltips")));
+	gdbui_set_tips(GTK_TOOLTIPS(ui_lookup_widget(geany->main_widgets->window, "tooltips")));
 	gdbui_create_widgets(frame);
 	gtk_widget_show_all(frame);
 }
Index: spellcheck/src/gui.c
===================================================================
--- spellcheck/src/gui.c	(revision 328)
+++ spellcheck/src/gui.c	(working copy)
@@ -37,7 +37,7 @@
 #include "utils.h"
 #include "ui_utils.h"
 
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "gui.h"
 #include "scplugin.h"
@@ -62,11 +62,11 @@
 
 void gui_perform_check(GeanyDocument *doc)
 {
-	p_editor->indicator_clear(doc->editor, GEANY_INDICATOR_ERROR);
+	editor_indicator_clear(doc->editor, GEANY_INDICATOR_ERROR);
 	if (sc->use_msgwin)
 	{
-		p_msgwindow->clear_tab(MSG_MESSAGE);
-		p_msgwindow->switch_tab(MSG_MESSAGE, FALSE);
+		msgwin_clear_tab(MSG_MESSAGE);
+		msgwin_switch_tab(MSG_MESSAGE, FALSE);
 	}
 
 	speller_check_document(doc);
@@ -76,9 +76,9 @@
 static void print_typing_changed_message(void)
 {
 	if (sc->check_while_typing)
-		p_ui->set_statusbar(FALSE, _("Spell checking while typing is now enabled"));
+		ui_set_statusbar(FALSE, _("Spell checking while typing is now enabled"));
 	else
-		p_ui->set_statusbar(FALSE, _("Spell checking while typing is now disabled"));
+		ui_set_statusbar(FALSE, _("Spell checking while typing is now disabled"));
 }
 
 
@@ -115,8 +115,8 @@
 				_("Toggle spell check while typing."));
 #endif
 			gtk_widget_show(GTK_WIDGET(sc->toolbar_button));
-			p_plugin->add_toolbar_item(geany_plugin, sc->toolbar_button);
-			p_ui->add_document_sensitive(GTK_WIDGET(sc->toolbar_button));
+			plugin_add_toolbar_item(geany_plugin, sc->toolbar_button);
+			ui_add_document_sensitive(GTK_WIDGET(sc->toolbar_button));
 
 			g_signal_connect(sc->toolbar_button, "toggled",
 				G_CALLBACK(toolbar_item_toggled_cb), NULL);
@@ -136,10 +136,10 @@
 
 	g_return_if_fail(doc != NULL);
 
-	start_pos = p_sci->get_position_from_line(doc->editor->sci, line_number);
-	length = p_sci->get_line_length(doc->editor->sci, line_number);
+	start_pos = sci_get_position_from_line(doc->editor->sci, line_number);
+	length = sci_get_line_length(doc->editor->sci, line_number);
 
-	p_sci->indicator_clear(doc->editor->sci, start_pos, length);
+	sci_indicator_clear(doc->editor->sci, start_pos, length);
 }
 
 
@@ -152,31 +152,31 @@
 
 	g_return_if_fail(clickinfo.doc != NULL && clickinfo.pos != -1);
 
-	startword = p_sci->send_message(sci, SCI_WORDSTARTPOSITION, clickinfo.pos, 0);
-	endword = p_sci->send_message(sci, SCI_WORDENDPOSITION, clickinfo.pos, 0);
+	startword = scintilla_send_message(sci, SCI_WORDSTARTPOSITION, clickinfo.pos, 0);
+	endword = scintilla_send_message(sci, SCI_WORDENDPOSITION, clickinfo.pos, 0);
 
 	if (startword != endword)
 	{
 		gchar *word;
 
-		p_sci->set_selection_start(sci, startword);
-		p_sci->set_selection_end(sci, endword);
+		sci_set_selection_start(sci, startword);
+		sci_set_selection_end(sci, endword);
 
 		/* retrieve the old text */
-		word = g_malloc(p_sci->get_selected_text_length(sci) + 1);
-		p_sci->get_selected_text(sci, word);
+		word = g_malloc(sci_get_selected_text_length(sci) + 1);
+		sci_get_selected_text(sci, word);
 
 		/* retrieve the new text */
 		sugg = gtk_label_get_text(GTK_LABEL(gtk_bin_get_child(GTK_BIN(menuitem))));
 
 		/* replace the misspelled word with the chosen suggestion */
-		p_sci->replace_sel(sci, sugg);
+		sci_replace_sel(sci, sugg);
 
 		/* store the replacement for future checks */
 		speller_store_replacement(word, sugg);
 
 		/* remove indicator */
-		p_sci->indicator_clear(sci, startword, endword - startword);
+		sci_indicator_clear(sci, startword, endword - startword);
 
 		g_free(word);
 	}
@@ -204,22 +204,22 @@
 	/* Remove all indicators on the added/ignored word */
 	sci = clickinfo.doc->editor->sci;
 	str = g_string_sized_new(256);
-	doc_len = p_sci->get_length(sci);
+	doc_len = sci_get_length(sci);
 	for (i = 0; i < doc_len; i++)
 	{
-		startword = p_sci->send_message(sci, SCI_INDICATORSTART, 0, i);
+		startword = scintilla_send_message(sci, SCI_INDICATORSTART, 0, i);
 		if (startword >= 0)
 		{
-			endword = p_sci->send_message(sci, SCI_INDICATOREND, 0, startword);
+			endword = scintilla_send_message(sci, SCI_INDICATOREND, 0, startword);
 			if (startword == endword)
 				continue;
 
 			if (str->len < (guint)(endword - startword + 1))
 				str = g_string_set_size(str, endword - startword + 1);
-			p_sci->get_text_range(sci, startword, endword, str->str);
+			sci_get_text_range(sci, startword, endword, str->str);
 
 			if (strcmp(str->str, clickinfo.word) == 0)
-				p_sci->indicator_clear(sci, startword, endword - startword);
+				sci_indicator_clear(sci, startword, endword - startword);
 
 			i = endword;
 		}
@@ -240,11 +240,11 @@
 	gtk_widget_hide(sc->edit_menu_sep);
 
 	/* if we have a selection, prefer it over the current word */
-	if (p_sci->has_selection(doc->editor->sci))
+	if (sci_has_selection(doc->editor->sci))
 	{
-		gint len = p_sci->get_selected_text_length(doc->editor->sci);
+		gint len = sci_get_selected_text_length(doc->editor->sci);
 		search_word = g_malloc(len + 1);
-		p_sci->get_selected_text(doc->editor->sci, search_word);
+		sci_get_selected_text(doc->editor->sci, search_word);
 	}
 	else
 		search_word = g_strdup(word);
@@ -305,12 +305,12 @@
 		gtk_container_add(GTK_CONTAINER(sc->edit_menu_sub), menu_item);
 
 		label = g_strdup_printf(_("Add \"%s\" to Dictionary"), search_word);
-		menu_item = p_ui->image_menu_item_new(GTK_STOCK_ADD, label);
+		menu_item = ui_image_menu_item_new(GTK_STOCK_ADD, label);
 		gtk_container_add(GTK_CONTAINER(sc->edit_menu_sub), menu_item);
 		g_signal_connect((gpointer) menu_item, "activate",
 			G_CALLBACK(on_menu_addword_item_activate), GINT_TO_POINTER(0));
 
-		menu_item = p_ui->image_menu_item_new(GTK_STOCK_REMOVE, _("Ignore All"));
+		menu_item = ui_image_menu_item_new(GTK_STOCK_REMOVE, _("Ignore All"));
 		gtk_container_add(GTK_CONTAINER(sc->edit_menu_sub), menu_item);
 		g_signal_connect((gpointer) menu_item, "activate",
 			G_CALLBACK(on_menu_addword_item_activate), GINT_TO_POINTER(1));
@@ -350,28 +350,28 @@
 	/* set current time for the next key press */
 	time_prev = time_now;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 	/* bail out if we don't have a document or if we are not in the editor widget */
 	focusw = gtk_window_get_focus(GTK_WINDOW(geany->main_widgets->window));
 	if (doc == NULL || focusw != GTK_WIDGET(doc->editor->sci))
 		return FALSE;
 
 	if (ev->keyval == '\r' &&
-		p_sci->send_message(doc->editor->sci, SCI_GETEOLMODE, 0, 0) == SC_EOL_CRLF)
+		scintilla_send_message(doc->editor->sci, SCI_GETEOLMODE, 0, 0) == SC_EOL_CRLF)
 	{	/* prevent double line checking */
 		return FALSE;
 	}
 
-	line_number = p_sci->get_current_line(doc->editor->sci);
+	line_number = sci_get_current_line(doc->editor->sci);
 	if (ev->keyval == '\n' || ev->keyval == '\r')
 		line_number--; /* check previous line if we start a new one */
-	line = p_sci->get_line(doc->editor->sci, line_number);
+	line = sci_get_line(doc->editor->sci, line_number);
 
 	clear_indicators_on_line(doc, line_number);
 	if (speller_process_line(doc, line_number, line) != 0)
 	{
 		if (sc->use_msgwin)
-			p_msgwindow->switch_tab(MSG_MESSAGE, FALSE);
+			msgwin_switch_tab(MSG_MESSAGE, FALSE);
 	}
 
 	g_string_free(str, TRUE);
@@ -385,7 +385,7 @@
 {
 	GeanyDocument *doc;
 
-	doc = p_document->get_current();
+	doc = document_get_current();
 
 	/* Another language was chosen from the menu item, so make it default for this session. */
     if (gdata != NULL)
@@ -393,11 +393,11 @@
 
 	speller_reinit_enchant_dict();
 
-	p_editor->indicator_clear(doc->editor, GEANY_INDICATOR_ERROR);
+	editor_indicator_clear(doc->editor, GEANY_INDICATOR_ERROR);
 	if (sc->use_msgwin)
 	{
-		p_msgwindow->clear_tab(MSG_MESSAGE);
-		p_msgwindow->switch_tab(MSG_MESSAGE, FALSE);
+		msgwin_clear_tab(MSG_MESSAGE);
+		msgwin_switch_tab(MSG_MESSAGE, FALSE);
 	}
 
 	speller_check_document(doc);
@@ -422,7 +422,7 @@
 
 void gui_create_edit_menu(void)
 {
-	sc->edit_menu = p_ui->image_menu_item_new(GTK_STOCK_SPELL_CHECK, _("Spelling Suggestions"));
+	sc->edit_menu = ui_image_menu_item_new(GTK_STOCK_SPELL_CHECK, _("Spelling Suggestions"));
 	gtk_container_add(GTK_CONTAINER(geany->main_widgets->editor_menu), sc->edit_menu);
 	gtk_menu_reorder_child(GTK_MENU(geany->main_widgets->editor_menu), sc->edit_menu, 0);
 
Index: spellcheck/src/scplugin.c
===================================================================
--- spellcheck/src/scplugin.c	(revision 328)
+++ spellcheck/src/scplugin.c	(working copy)
@@ -42,7 +42,7 @@
 #include "utils.h"
 #include "ui_utils.h"
 
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "scplugin.h"
 #include "gui.h"
@@ -54,7 +54,7 @@
 GeanyFunctions	*geany_functions;
 
 
-PLUGIN_VERSION_CHECK(110)
+PLUGIN_VERSION_CHECK(115)
 PLUGIN_SET_INFO(_("Spell Check"), _("Checks the spelling of the current document."), "0.2",
 			_("The Geany developer team"))
 
@@ -160,16 +160,16 @@
 
 		gui_toolbar_update();
 
-		if (! g_file_test(config_dir, G_FILE_TEST_IS_DIR) && p_utils->mkdir(config_dir, TRUE) != 0)
+		if (! g_file_test(config_dir, G_FILE_TEST_IS_DIR) && utils_mkdir(config_dir, TRUE) != 0)
 		{
-			p_dialogs->show_msgbox(GTK_MESSAGE_ERROR,
+			dialogs_show_msgbox(GTK_MESSAGE_ERROR,
 				_("Plugin configuration directory could not be created."));
 		}
 		else
 		{
 			/* write config to file */
 			data = g_key_file_to_data(config, NULL, NULL);
-			p_utils->write_file(sc->config_file, data);
+			utils_write_file(sc->config_file, data);
 			g_free(data);
 		}
 		g_free(config_dir);
@@ -191,20 +191,20 @@
 		"spellcheck", G_DIR_SEPARATOR_S, "spellcheck.conf", NULL);
 
 	g_key_file_load_from_file(config, sc->config_file, G_KEY_FILE_NONE, NULL);
-	sc->default_language = p_utils->get_setting_string(config,
+	sc->default_language = utils_get_setting_string(config,
 		"spellcheck", "language", default_lang);
-	sc->check_while_typing = p_utils->get_setting_boolean(config,
+	sc->check_while_typing = utils_get_setting_boolean(config,
 		"spellcheck", "check_while_typing", FALSE);
-	sc->show_toolbar_item = p_utils->get_setting_boolean(config,
+	sc->show_toolbar_item = utils_get_setting_boolean(config,
 		"spellcheck", "show_toolbar_item", TRUE);
-	sc->use_msgwin = p_utils->get_setting_boolean(config, "spellcheck", "use_msgwin", FALSE);
+	sc->use_msgwin = utils_get_setting_boolean(config, "spellcheck", "use_msgwin", FALSE);
 	g_key_file_free(config);
 	g_free(default_lang);
 
 	locale_init();
 
 	sc->menu_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_SPELL_CHECK, NULL);
-	p_ui->add_document_sensitive(sc->menu_item);
+	ui_add_document_sensitive(sc->menu_item);
 
 	gui_toolbar_update();
 
@@ -219,9 +219,9 @@
 		"key-release-event", G_CALLBACK(gui_key_release_cb), NULL);
 
 	/* setup keybindings */
-	p_keybindings->set_item(plugin_key_group, KB_SPELL_CHECK, gui_kb_run_activate_cb,
+	keybindings_set_item(plugin_key_group, KB_SPELL_CHECK, gui_kb_run_activate_cb,
 		0, 0, "spell_check", _("Run Spell Check"), NULL);
-	p_keybindings->set_item(plugin_key_group, KB_SPELL_TOOGLE_TYPING,
+	keybindings_set_item(plugin_key_group, KB_SPELL_TOOGLE_TYPING,
 		gui_kb_toggle_typing_activate_cb, 0, 0, "spell_toggle_typing",
 		_("Toggle Check While Typing"), NULL);
 }
@@ -257,7 +257,7 @@
 	{
 		gtk_combo_box_append_text(GTK_COMBO_BOX(combo), g_ptr_array_index(sc->dicts, i));
 
-		if (p_utils->str_equal(g_ptr_array_index(sc->dicts, i), sc->default_language))
+		if (utils_str_equal(g_ptr_array_index(sc->dicts, i), sc->default_language))
 			gtk_combo_box_set_active(GTK_COMBO_BOX(combo), i);
 	}
 	/* if the default language couldn't be selected, select the first available language */
Index: spellcheck/src/speller.c
===================================================================
--- spellcheck/src/speller.c	(revision 328)
+++ spellcheck/src/speller.c	(working copy)
@@ -38,7 +38,7 @@
 #include "utils.h"
 #include "scintilla/SciLexer.h"
 
-#include "pluginmacros.h"
+#include "geanyfunctions.h"
 
 #include "speller.h"
 #include "scplugin.h"
@@ -83,7 +83,7 @@
 	if (start_pos == -1)
 		start_pos = end_pos - strlen(word);
 
-	p_editor->indicator_set_on_range(doc->editor, GEANY_INDICATOR_ERROR, start_pos, end_pos);
+	editor_indicator_set_on_range(doc->editor, GEANY_INDICATOR_ERROR, start_pos, end_pos);
 
 	if (sc->use_msgwin)
 	{
@@ -106,7 +106,7 @@
 				g_string_append_c(str, ' ');
 			}
 
-			p_msgwindow->msg_add(COLOR_RED, line_number + 1, doc, "%s", str->str);
+			msgwin_msg_add(COLOR_RED, line_number + 1, doc, "%s", str->str);
 
 			if (suggs != NULL && n_suggs > 0)
 				enchant_dict_free_string_list(speller_dict, suggs);
@@ -132,17 +132,17 @@
 
 	str = g_string_sized_new(256);
 
-	pos_start = p_sci->get_position_from_line(doc->editor->sci, line_number);
+	pos_start = sci_get_position_from_line(doc->editor->sci, line_number);
 	/* TODO use SCI_GETLINEENDPOSITION */
-	pos_end = p_sci->get_position_from_line(doc->editor->sci, line_number + 1);
+	pos_end = sci_get_position_from_line(doc->editor->sci, line_number + 1);
 
 	while (pos_start < pos_end)
 	{
-		wstart = p_sci->send_message(doc->editor->sci, SCI_WORDSTARTPOSITION, pos_start, TRUE);
-		wend = p_sci->send_message(doc->editor->sci, SCI_WORDENDPOSITION, wstart, FALSE);
+		wstart = scintilla_send_message(doc->editor->sci, SCI_WORDSTARTPOSITION, pos_start, TRUE);
+		wend = scintilla_send_message(doc->editor->sci, SCI_WORDENDPOSITION, wstart, FALSE);
 		if (wstart == wend)
 			break;
-		c = p_sci->get_char_at(doc->editor->sci, wstart);
+		c = sci_get_char_at(doc->editor->sci, wstart);
 		/* hopefully it's enough to check for these both */
 		if (ispunct(c) || isspace(c))
 		{
@@ -154,7 +154,7 @@
 		if (str->len < (guint)(wend - wstart))
 			g_string_set_size(str, wend - wstart);
 
-		p_sci->get_text_range(doc->editor->sci, wstart, wend, str->str);
+		sci_get_text_range(doc->editor->sci, wstart, wend, str->str);
 
 		suggestions_found += speller_check_word(doc, line_number, str->str, wstart, wend);
 
@@ -179,15 +179,15 @@
 
 	enchant_dict_describe(speller_dict, dict_describe, &dict_string);
 
-	if (p_sci->has_selection(doc->editor->sci))
+	if (sci_has_selection(doc->editor->sci))
 	{
-		first_line = p_sci->get_line_from_position(
-			doc->editor->sci, p_sci->get_selection_start(doc->editor->sci));
-		last_line = p_sci->get_line_from_position(
-			doc->editor->sci, p_sci->get_selection_end(doc->editor->sci));
+		first_line = sci_get_line_from_position(
+			doc->editor->sci, sci_get_selection_start(doc->editor->sci));
+		last_line = sci_get_line_from_position(
+			doc->editor->sci, sci_get_selection_end(doc->editor->sci));
 
 		if (sc->use_msgwin)
-			p_msgwindow->msg_add(COLOR_BLUE, -1, NULL,
+			msgwin_msg_add(COLOR_BLUE, -1, NULL,
 				_("Checking file \"%s\" (lines %d to %d using %s):"),
 				DOC_FILENAME(doc), first_line + 1, last_line + 1, dict_string);
 		g_message("Checking file \"%s\" (lines %d to %d using %s):",
@@ -196,9 +196,9 @@
 	else
 	{
 		first_line = 0;
-		last_line = p_sci->get_line_count(doc->editor->sci);
+		last_line = sci_get_line_count(doc->editor->sci);
 		if (sc->use_msgwin)
-			p_msgwindow->msg_add(COLOR_BLUE, -1, NULL, _("Checking file \"%s\" (using %s):"),
+			msgwin_msg_add(COLOR_BLUE, -1, NULL, _("Checking file \"%s\" (using %s):"),
 				DOC_FILENAME(doc), dict_string);
 		g_message("Checking file \"%s\" (using %s):", DOC_FILENAME(doc), dict_string);
 	}
@@ -206,21 +206,21 @@
 
 	for (i = first_line; i < last_line; i++)
 	{
-		line = p_sci->get_line(doc->editor->sci, i);
+		line = sci_get_line(doc->editor->sci, i);
 
 		suggestions_found += speller_process_line(doc, i, line);
 
 		g_free(line);
 	}
 	if (suggestions_found == 0 && sc->use_msgwin)
-		p_msgwindow->msg_add(COLOR_BLUE, -1, NULL, _("The checked text is spelled correctly."));
+		msgwin_msg_add(COLOR_BLUE, -1, NULL, _("The checked text is spelled correctly."));
 }
 
 
 static void broker_init_failed(void)
 {
 	const gchar *err = enchant_broker_get_error(speller_broker);
-	p_dialogs->show_msgbox(GTK_MESSAGE_ERROR,
+	dialogs_show_msgbox(GTK_MESSAGE_ERROR,
 		_("The Enchant library couldn't be initialized (%s)."),
 		(err != NULL) ? err : _("unknown error (maybe the chosen language is not available)"));
 }
@@ -230,7 +230,7 @@
 {
 	gboolean *supported = user_data;
 
-	if (p_utils->str_equal(sc->default_language, data))
+	if (utils_str_equal(sc->default_language, data))
 		*supported = TRUE;
 }
 
@@ -322,7 +322,7 @@
 	/* find duplicates and skip them */
 	for (i = 0; i < sc->dicts->len; i++)
 	{
-		if (p_utils->str_equal(g_ptr_array_index(sc->dicts, i), result))
+		if (utils_str_equal(g_ptr_array_index(sc->dicts, i), result))
 			return;
 	}
 
@@ -424,8 +424,8 @@
 	g_return_val_if_fail(doc != NULL, FALSE);
 	g_return_val_if_fail(pos >= 0, FALSE);
 
-	lexer = p_sci->send_message(doc->editor->sci, SCI_GETLEXER, 0, 0);
-	style = p_sci->get_style_at(doc->editor->sci, pos);
+	lexer = scintilla_send_message(doc->editor->sci, SCI_GETLEXER, 0, 0);
+	style = sci_get_style_at(doc->editor->sci, pos);
 
 	switch (lexer)
 	{
