changeset 14836:bfcdd361357e

[gaim-migrate @ 17605] Do things right and fix the compile warnings. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 28 Oct 2006 19:52:30 +0000
parents 061157db8017
children 118fd0dc5b6e
files console/libgnt/gntbox.c console/libgnt/gntbutton.c console/libgnt/gntcheckbox.c console/libgnt/gntentry.c console/libgnt/gntlabel.c console/libgnt/gntline.c console/libgnt/gntstyle.c console/libgnt/gnttree.c console/libgnt/gntwidget.c console/libgnt/gntwidget.h
diffstat 10 files changed, 11 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/console/libgnt/gntbox.c	Sat Oct 28 19:37:48 2006 +0000
+++ b/console/libgnt/gntbox.c	Sat Oct 28 19:52:30 2006 +0000
@@ -9,7 +9,6 @@
 };
 
 static GntWidgetClass *parent_class = NULL;
-static guint signals[SIGS] = { 0 };
 
 static GntWidget * find_focusable_widget(GntBox *box);
 
--- a/console/libgnt/gntbutton.c	Sat Oct 28 19:37:48 2006 +0000
+++ b/console/libgnt/gntbutton.c	Sat Oct 28 19:52:30 2006 +0000
@@ -9,7 +9,6 @@
 };
 
 static GntWidgetClass *parent_class = NULL;
-static guint signals[SIGS] = { 0 };
 
 static void
 gnt_button_draw(GntWidget *widget)
--- a/console/libgnt/gntcheckbox.c	Sat Oct 28 19:37:48 2006 +0000
+++ b/console/libgnt/gntcheckbox.c	Sat Oct 28 19:52:30 2006 +0000
@@ -34,19 +34,6 @@
 }
 
 static void
-gnt_check_box_size_request(GntWidget *widget)
-{
-}
-
-static void
-gnt_check_box_map(GntWidget *widget)
-{
-	if (widget->priv.width == 0 || widget->priv.height == 0)
-		gnt_widget_size_request(widget);
-	GNTDEBUG;
-}
-
-static void
 toggle_selection(GntWidget *widget)
 {
 	GNT_CHECK_BOX(widget)->checked = !GNT_CHECK_BOX(widget)->checked;
@@ -77,11 +64,6 @@
 }
 
 static void
-gnt_check_box_destroy(GntWidget *widget)
-{
-}
-
-static void
 gnt_check_box_class_init(GntCheckBoxClass *klass)
 {
 	GntWidgetClass *wclass = GNT_WIDGET_CLASS(klass);
--- a/console/libgnt/gntentry.c	Sat Oct 28 19:37:48 2006 +0000
+++ b/console/libgnt/gntentry.c	Sat Oct 28 19:52:30 2006 +0000
@@ -3,6 +3,7 @@
 
 #include "gntbox.h"
 #include "gntentry.h"
+#include "gntstyle.h"
 #include "gnttree.h"
 #include "gntutils.h"
 
@@ -339,7 +340,7 @@
 {
 	char ch;
 	ch = *text;
-#define SAME(a,b)    ((isalpha(a) && isalpha(b)) || (isdigit(a) && isdigit(b)) || (isblank(a) && isblank(b)))
+#define SAME(a,b)    ((isalpha(a) && isalpha(b)) || (isdigit(a) && isdigit(b)) || (isspace(a) && isspace(b)))
 	while (--text >= begin) {
 		if (!SAME(ch, *text))
 			break;
@@ -354,7 +355,6 @@
 {
 	GntEntry *entry = GNT_ENTRY(widget);
 	const char *iter = entry->cursor - 1;
-	int count;
 
 	if (iter < entry->start)
 		return TRUE;
@@ -586,7 +586,7 @@
 	gnt_widget_class_register_action(parent_class, "history-next", history_next,
 				"\033" GNT_KEY_CTRL_UP, NULL);
 
-	gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), klass);
+	gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), parent_class);
 
 	GNTDEBUG;
 }
--- a/console/libgnt/gntlabel.c	Sat Oct 28 19:37:48 2006 +0000
+++ b/console/libgnt/gntlabel.c	Sat Oct 28 19:52:30 2006 +0000
@@ -9,7 +9,6 @@
 };
 
 static GntWidgetClass *parent_class = NULL;
-static guint signals[SIGS] = { 0 };
 
 static void
 gnt_label_destroy(GntWidget *widget)
--- a/console/libgnt/gntline.c	Sat Oct 28 19:37:48 2006 +0000
+++ b/console/libgnt/gntline.c	Sat Oct 28 19:52:30 2006 +0000
@@ -6,7 +6,6 @@
 };
 
 static GntWidgetClass *parent_class = NULL;
-static guint signals[SIGS] = { 0 };
 
 static void
 gnt_line_draw(GntWidget *widget)
--- a/console/libgnt/gntstyle.c	Sat Oct 28 19:37:48 2006 +0000
+++ b/console/libgnt/gntstyle.c	Sat Oct 28 19:52:30 2006 +0000
@@ -1,6 +1,7 @@
 #include "gntstyle.h"
 #include "gntcolors.h"
 
+#include <ctype.h>
 #include <string.h>
 
 #if GLIB_CHECK_VERSION(2,6,0)
--- a/console/libgnt/gnttree.c	Sat Oct 28 19:37:48 2006 +0000
+++ b/console/libgnt/gnttree.c	Sat Oct 28 19:52:30 2006 +0000
@@ -1,5 +1,6 @@
+#include "gntmarshal.h"
+#include "gntstyle.h"
 #include "gnttree.h"
-#include "gntmarshal.h"
 #include "gntutils.h"
 
 #include <string.h>
@@ -474,13 +475,6 @@
 	g_signal_emit(tree, signals[SIG_SELECTION_CHANGED], 0, old->key, current->key);
 }
 
-static GntTreeRow *
-get_nth_row(GntTree *tree, int n)
-{
-	gpointer key = g_list_nth_data(tree->list, n);
-	return g_hash_table_lookup(tree->hash, key);
-}
-
 static gboolean
 action_down(GntWidget *widget, GList *null)
 {
@@ -577,8 +571,6 @@
 {
 	GntTree *tree = GNT_TREE(widget);
 	GntTreeRow *old = tree->current;
-	GntTreeRow *row;
-	int dist;
 
 	if (text[0] == '\r')
 	{
@@ -720,7 +712,7 @@
 	gnt_widget_class_register_action(parent_class, "page-down", action_page_down,
 				"\033" GNT_KEY_PGDOWN, NULL);
 
-	gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), klass);
+	gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), parent_class);
 
 	GNTDEBUG;
 }
--- a/console/libgnt/gntwidget.c	Sat Oct 28 19:37:48 2006 +0000
+++ b/console/libgnt/gntwidget.c	Sat Oct 28 19:52:30 2006 +0000
@@ -415,7 +415,6 @@
 gboolean
 gnt_widget_perform_action_named(GntWidget *widget, const char *name, ...)
 {
-	GType type = G_OBJECT_TYPE(widget);
 	GntWidgetClass *klass = GNT_WIDGET_CLASS(G_OBJECT_GET_CLASS(widget));
 	GList *list = NULL;
 	va_list args;
@@ -440,7 +439,6 @@
 static gboolean
 gnt_widget_perform_action(GntWidget *widget, const char *keys)
 {
-	GType type = G_OBJECT_TYPE(widget);
 	GntWidgetClass *klass = GNT_WIDGET_CLASS(G_OBJECT_GET_CLASS(widget));
 	GntWidgetActionParam *param = g_hash_table_lookup(klass->bindings, keys);
 
--- a/console/libgnt/gntwidget.h	Sat Oct 28 19:37:48 2006 +0000
+++ b/console/libgnt/gntwidget.h	Sat Oct 28 19:52:30 2006 +0000
@@ -181,10 +181,14 @@
 void gnt_widget_action_free(GntWidgetAction *action);
 void gnt_widget_action_param_free(GntWidgetActionParam *param);
 
+void gnt_widget_register_binding(GntWidgetClass *klass, const char *name,
+			const char *trigger, ...);
 
 void gnt_widget_class_register_action(GntWidgetClass *klass, const char *name,
 			GntWidgetActionCallback callback, const char *trigger, ...);
 
+gboolean gnt_widget_perform_action_named(GntWidget *widget, const char *name, ...);
+
 G_END_DECLS
 
 #endif /* GNT_WIDGET_H */