changeset 5224:5160333a80df

[gaim-migrate @ 5594] Update for new plugin api committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Sat, 26 Apr 2003 14:55:40 +0000
parents e2e5bc3ca705
children 0bf1ced10b2b
files plugins/win32/transparency/win2ktrans.c plugins/win32/winprefs/winprefs.c src/Makefile.mingw src/event.c src/plugin.h
diffstat 5 files changed, 101 insertions(+), 69 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/win32/transparency/win2ktrans.c	Sat Apr 26 09:05:51 2003 +0000
+++ b/plugins/win32/transparency/win2ktrans.c	Sat Apr 26 14:55:40 2003 +0000
@@ -20,26 +20,26 @@
  * foundation, inc., 59 temple place, suite 330, boston, ma  02111-1307  usa
  *
  */
-#define GAIM_PLUGINS
-
-#include <gtk/gtk.h>
 #include <gdk/gdkwin32.h>
+#include <gmodule.h>
 #include "gaim.h"
+#include "gtkplugin.h"
 #include "gtklist.h"
 #include "win32dep.h"
 
 /*
  *  MACROS & DEFINES
  */
-#define WINTRANS_VERSION 1
+#define WINTRANS_PLUGIN_ID              "win-gaim-trans"
+#define WINTRANS_VERSION                1
 
 /* These defines aren't found in mingw's winuser.h */
 #ifndef LWA_ALPHA
-#define LWA_ALPHA               0x00000002
+#define LWA_ALPHA                       0x00000002
 #endif
 
 #ifndef WS_EX_LAYERED
-#define WS_EX_LAYERED           0x00080000
+#define WS_EX_LAYERED                   0x00080000
 #endif
 
 /* Transparency plugin configuration */
@@ -346,17 +346,16 @@
 /*
  *  EXPORTED FUNCTIONS
  */
-
-G_MODULE_EXPORT char *gaim_plugin_init(GModule *handle) {
-	gaim_signal_connect(handle, event_new_conversation, gaim_new_conversation, NULL); 
-	gaim_signal_connect(handle, event_signon, blist_created, NULL);
+G_MODULE_EXPORT gboolean plugin_load(GaimPlugin *plugin) {
+	gaim_signal_connect(plugin, event_new_conversation, gaim_new_conversation, NULL); 
+	gaim_signal_connect(plugin, event_signon, blist_created, NULL);
 	MySetLayeredWindowAttributes = (void*)wgaim_find_and_loadproc("user32.dll", "SetLayeredWindowAttributes" );
 	load_trans_prefs();
 
-	return NULL;
+	return TRUE;
 }
 
-G_MODULE_EXPORT void gaim_plugin_remove() {
+G_MODULE_EXPORT gboolean plugin_unload(GaimPlugin *plugin) {
 	debug_printf("Removing win2ktrans.dll plugin\n");
 
 	/* Remove slider bars */
@@ -376,29 +375,10 @@
 		SetWindowPos(GDK_WINDOW_HWND(blist->window), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
 		set_wintrans_off(blist);
 	}
+	return TRUE;
 }
 
-struct gaim_plugin_description desc; 
-
-G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() {
-	desc.api_version = PLUGIN_API_VERSION;
-	desc.name = g_strdup(_("Transparency"));
-	desc.version = g_strdup(VERSION);
-	desc.description = g_strdup(_("This plugin enables variable alpha transparency on conversation windows.\n\n* Note: This plugin requires Win2000 or WinXP.")); 
-	desc.authors = g_strdup("Rob Flynn &lt;rob@marko.net&gt;");
-	desc.url = g_strdup(WEBSITE);
-	return &desc;
-}
-
-G_MODULE_EXPORT char *name() {
-	return _("Transparency");
-}
-
-G_MODULE_EXPORT char *description() {
-	return _("This plugin enables variable alpha transparency on conversation windows.\n\n* Note: This plugin requires Win2000 or WinXP.");
-}
-
-G_MODULE_EXPORT GtkWidget *gaim_plugin_config_gtk() {
+G_MODULE_EXPORT GtkWidget *get_config_frame(GaimPlugin *plugin) {
 	GtkWidget *ret;
 	GtkWidget *imtransbox, *bltransbox;
 	GtkWidget *hbox;
@@ -490,3 +470,42 @@
 	gtk_widget_show_all(ret);
 	return ret;
 }
+
+static GaimGtkPluginUiInfo ui_info =
+{
+	get_config_frame
+};
+
+static GaimPluginInfo info =
+{
+	2,                                                /**< api_version    */
+	GAIM_PLUGIN_STANDARD,                             /**< type           */
+	GAIM_GTK_PLUGIN_TYPE,                             /**< ui_requirement */
+	0,                                                /**< flags          */
+	NULL,                                             /**< dependencies   */
+	GAIM_PRIORITY_DEFAULT,                            /**< priority       */
+
+	WINTRANS_PLUGIN_ID,                               /**< id             */
+	N_("Transparency"),                               /**< name           */
+	VERSION,                                          /**< version        */
+	                                                  /**  summary        */
+	N_("This plugin enables variable alpha transparency on conversation windows.\n\n* Note: This plugin requires Win2000 or WinXP."),
+	                                                  /**  description    */
+	N_("This plugin enables variable alpha transparency on conversation windows.\n\n* Note: This plugin requires Win2000 or WinXP."),
+	"Herman Bloggs <hermanator12002@yahoo.com>",      /**< author         */
+	WEBSITE,                                          /**< homepage       */
+
+	plugin_load,                                      /**< load           */
+	plugin_unload,                                    /**< unload         */
+	NULL,                                             /**< destroy        */
+
+	&ui_info,                                         /**< ui_info        */
+	NULL                                              /**< extra_info     */
+};
+
+static void
+__init_plugin(GaimPlugin *plugin)
+{
+}
+
+GAIM_INIT_PLUGIN(wintrans, __init_plugin, info);
--- a/plugins/win32/winprefs/winprefs.c	Sat Apr 26 09:05:51 2003 +0000
+++ b/plugins/win32/winprefs/winprefs.c	Sat Apr 26 14:55:40 2003 +0000
@@ -18,19 +18,18 @@
  * foundation, inc., 59 temple place, suite 330, boston, ma  02111-1307  usa
  *
  */
-#define GAIM_PLUGINS
 #include <windows.h>
 #include <winreg.h>
 #include <winerror.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkwin32.h>
 #include "gaim.h"
+#include "gtkplugin.h"
 #include "win32dep.h"
 
 /*
  *  MACROS & DEFINES
  */
-#define WINPREFS_VERSION 1
+#define WINPREFS_PLUGIN_ID             "gaim-winprefs"
+#define WINPREFS_VERSION                 1
 
 /* Plugin options */
 #define OPT_WGAIM_AUTOSTART               0x00000001
@@ -129,35 +128,7 @@
 /*
  *  EXPORTED FUNCTIONS
  */
-
-G_MODULE_EXPORT char *gaim_plugin_init(GModule *handle) {
-	return NULL;
-}
-
-G_MODULE_EXPORT void gaim_plugin_remove() {
-}
-
-struct gaim_plugin_description desc; 
-
-G_MODULE_EXPORT struct gaim_plugin_description *gaim_plugin_desc() {
-	desc.api_version = PLUGIN_API_VERSION;
-	desc.name = g_strdup(_("WinGaim Options"));
-	desc.version = g_strdup(VERSION);
-	desc.description = g_strdup(_("Options specific to Windows Gaim.")); 
-	desc.authors = g_strdup("Herman Bloggs &lt;hermanator12002@yahoo.com&gt;");
-	desc.url = g_strdup(WEBSITE);
-	return &desc;
-}
-
-G_MODULE_EXPORT char *name() {
-	return _("WinGaim Options");
-}
-
-G_MODULE_EXPORT char *description() {
-	return _("Options specific to Windows Gaim.");
-}
-
-G_MODULE_EXPORT GtkWidget *gaim_plugin_config_gtk() {
+static GtkWidget* get_config_frame(GaimPlugin *plugin) {
 	GtkWidget *ret;
 	GtkWidget *button;
 	GtkWidget *vbox;
@@ -181,3 +152,37 @@
 	gtk_widget_show_all(ret);
 	return ret;
 }
+
+static GaimGtkPluginUiInfo ui_info =
+{
+	get_config_frame
+};
+
+static GaimPluginInfo info =
+{
+	2,
+	GAIM_PLUGIN_STANDARD,
+	GAIM_GTK_PLUGIN_TYPE,
+	0,
+	NULL,
+	GAIM_PRIORITY_DEFAULT,
+	WINPREFS_PLUGIN_ID,
+	N_("WinGaim Options"),
+	VERSION,
+	N_("Options specific to Windows Gaim."),
+	N_("Options specific to Windows Gaim."),
+	"Herman Bloggs <hermanator12002@yahoo.com>",
+	WEBSITE,
+	NULL,
+	NULL,
+	NULL,
+	&ui_info,
+	NULL
+};
+
+static void
+__init_plugin(GaimPlugin *plugin)
+{
+}
+
+GAIM_INIT_PLUGIN(winprefs, __init_plugin, info);
--- a/src/Makefile.mingw	Sat Apr 26 09:05:51 2003 +0000
+++ b/src/Makefile.mingw	Sat Apr 26 14:55:40 2003 +0000
@@ -81,15 +81,19 @@
 			buddy_chat.c \
 			conversation.c \
 			core.c \
+			debug.c \
 			dialogs.c \
 			dnd-hints.c \
+			event.c \
 			ft.c \
 			gaim-disclosure.c \
 			gaimrc.c \
 			gtkconv.c \
 			gtkcellrendererprogress.c \
+			gtkdebug.c \
 			gtkft.c \
 			gtkimhtml.c \
+			gtkplugin.c \
 			gtkpounce.c \
 			gtkutils.c \
 			html.c \
@@ -98,9 +102,8 @@
 			log.c \
 			main.c \
 			md5.c \
-			module.c \
 			multi.c \
-			perl.c \
+			plugin.c \
 			pounce.c \
 			prefs.c \
 			proxy.c \
--- a/src/event.c	Sat Apr 26 09:05:51 2003 +0000
+++ b/src/event.c	Sat Apr 26 14:55:40 2003 +0000
@@ -28,6 +28,10 @@
 #include <stdio.h>
 #include <string.h>
 
+#ifdef _WIN32
+#include "win32dep.h"
+#endif
+
 /**
  * A signal callback.
  */
--- a/src/plugin.h	Sat Apr 26 09:05:51 2003 +0000
+++ b/src/plugin.h	Sat Apr 26 14:55:40 2003 +0000
@@ -22,6 +22,7 @@
  */
 #ifndef _GAIM_PLUGIN_H_
 #define _GAIM_PLUGIN_H_
+#include <gmodule.h>
 
 typedef enum   _GaimPluginType GaimPluginType;     /**< GaimPluginType   */
 typedef struct _GaimPlugin     GaimPlugin;         /**< GaimPlugin       */
@@ -126,7 +127,7 @@
 	}
 #else /* if !STATIC_MODULE */
 # define GAIM_INIT_PLUGIN(pluginname, initfunc, plugininfo) \
-	gboolean gaim_init_plugin(GaimPlugin *plugin) { \
+	G_MODULE_EXPORT gboolean gaim_init_plugin(GaimPlugin *plugin) { \
 		plugin->info = &(plugininfo); \
 		initfunc((plugin)); \
 		return gaim_plugin_register(plugin); \