view plugins/toc_commands.c @ 1771:213607e89598

[gaim-migrate @ 1781] plug mem leak. don't show evil level if it decreased. mid's utf8 patch for jabber. my girlfriend got an accounting calculator today, you know, with the paper and the printing and things. it's kinda loud. she's really happy about having it. she had bought a different one yesterday but it didn't work so we returned it today. we also went to Albertson's and bought groceries. we bought 72 cans of soda for $15. That's 20 cents per soda. Not bad. we also bought a cow; i'm going to cook it tonight. ben&jerry's ice cream is good. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 30 Apr 2001 01:25:30 +0000
parents ece2d1543b20
children 94e81315be2a
line wrap: on
line source

#define GAIM_PLUGINS
#include "gaim.h"

#include <gtk/gtk.h>

void enter_callback(GtkWidget *widget, GtkWidget *entry) {
	gchar *entry_text;
	entry_text = gtk_entry_get_text(GTK_ENTRY(entry));
	/* this is bad, but you really shouldn't be using this plugin */
	sflap_send(connections->data, entry_text, strlen(entry_text), TYPE_DATA);
}

void destroy_callback(GtkWidget *widget, void *handle) {
	gtk_widget_destroy(widget);
	gaim_plugin_unload(handle);
}

GtkWidget *window;
char *gaim_plugin_init(GModule *h) {
	GtkWidget *entry;

	window = gtk_window_new(GTK_WINDOW_DIALOG);
	gtk_window_set_title(GTK_WINDOW(window), "Gaim - SFLAP interface");

	entry = gtk_entry_new();
	gtk_signal_connect(GTK_OBJECT(entry), "activate",
			   (GtkSignalFunc)enter_callback,
			   entry);
	gtk_container_add(GTK_CONTAINER(window), entry);
	gtk_widget_show(entry);

	gtk_signal_connect(GTK_OBJECT(window), "destroy",
			   (GtkSignalFunc)destroy_callback,
			   h);

	gtk_widget_show(window);

	return NULL;
}

void gaim_plugin_remove() {
	gtk_widget_destroy(window);
}

char *name() {
	return "TOC Interface";
}

char *description() {
	return "Allows you to talk directly to the TOC server, bypassing gaim.";
}