+2007-02-13 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ * examples/Makefile.am:
+ * examples/hildon-hvolumebar-example.c: A hvolumebar test program.
+
+ * src/hildon-code-dialog.c:
+ * src/hildon-code-dialog.h: Adding a patch by Santtu Lakkala that adds
+ an 'input' signal to the code dialog that is fired each time the user
+ presses any of the dialog input buttons.
+
+ * examples/hildon-code-dialog-example.c: Adding test case for the
+ new signal.
+
2007-02-12 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
* examples/hildon-window-example.c: Adding some title setting to check
hildon-window-cmn-menu-example \
hildon-vvolumebar-example \
hildon-toolbar-example \
- hildon-code-dialog-example
+ hildon-code-dialog-example \
+ hildon-hvolumebar-example
# HIldon window
hildon_window_example_LDADD = $(HILDON_OBJ_LIBS)
# HIldon window menu example
hildon_window_menu_example_LDADD = $(HILDON_OBJ_LIBS)
hildon_window_menu_example_CFLAGS = $(HILDON_OBJ_CFLAGS)
-hildon_window_menu__example_SOURCES = hildon-window-menu-example.c
+hildon_window_menu_example_SOURCES = hildon-window-menu-example.c
# Hildon window common menu example
hildon_window_cmn_menu_example_LDADD = $(HILDON_OBJ_LIBS)
hildon_vvolumebar_example_CFLAGS = $(HILDON_OBJ_CFLAGS)
hildon_vvolumebar_example_SOURCES = hildon-vvolumebar-example.c
+# Hildon hvolume bar example
+hildon_hvolumebar_example_LDADD = $(HILDON_OBJ_LIBS)
+hildon_hvolumebar_example_CFLAGS = $(HILDON_OBJ_CFLAGS)
+hildon_hvolumebar_example_SOURCES = hildon-hvolumebar-example.c
+
# Hildon toolbar example
hildon_toolbar_example_LDADD = $(HILDON_OBJ_LIBS)
hildon_toolbar_example_CFLAGS = $(HILDON_OBJ_CFLAGS)
#include <gtk/gtk.h>
#include "hildon.h"
+static gboolean
+on_input (void);
+
+gboolean
+on_input (void)
+{
+ g_debug ("Input in the code dialog!");
+ return TRUE;
+}
+
int
-main (int argc, char **args)
+main (int argc,
+ char **args)
{
gtk_init (&argc, &args);
GtkDialog *dialog = GTK_DIALOG (hildon_code_dialog_new ());
+ g_signal_connect (G_OBJECT (dialog), "input", G_CALLBACK (on_input), NULL);
gtk_widget_show_all (GTK_WIDGET (dialog));
gtk_dialog_run (dialog);
--- /dev/null
+/*
+ * This file is a part of hildon examples
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
+ *
+ * Author: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; version 2.1 of
+ * the License.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <glib.h>
+#include <gtk/gtk.h>
+#include "hildon.h"
+
+int
+main (int argc,
+ char **args)
+{
+ gtk_init (&argc, &args);
+
+ GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
+
+ HildonHVolumebar *bar = HILDON_HVOLUMEBAR (hildon_hvolumebar_new ());
+
+ gtk_box_pack_start (GTK_BOX (dialog->vbox), GTK_WIDGET (bar), FALSE, FALSE, 0);
+ gtk_dialog_add_button (dialog, "Close", GTK_RESPONSE_CLOSE);
+
+ gtk_widget_show_all (GTK_WIDGET (dialog));
+ gtk_dialog_run (dialog);
+
+ return 0;
+}
+
+
* @short_description: A keypad-like widget used to enter pincodes.
*
* #HildonCodeDialog displays a keypad that can be used to enter
- * numerical pin codes or lock codes.
+ * numerical pin codes or lock codes. It emits a 'input' signal each time
+ * an input action is performed on the dialog.
*
*/
GdkEventKey *event,
gpointer user_data);
+static void
+hildon_code_dialog_real_input (HildonCodeDialog *dialog);
+
+static void
+hildon_code_dialog_input (HildonCodeDialog *dialog);
+
static GtkDialogClass* parent_class = NULL;
+static guint input_signal;
+
/**
* hildon_code_dialog_get_type:
*
{
parent_class = GTK_DIALOG_CLASS (g_type_class_peek_parent (cd_class));
g_type_class_add_private (cd_class, sizeof (HildonCodeDialogPrivate));
+
+ cd_class->input = hildon_code_dialog_real_input;
+
+ /* FIXME Document this signal! */
+ input_signal = g_signal_new("input",
+ HILDON_TYPE_CODE_DIALOG,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (HildonCodeDialogClass, input),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
}
static void
/* make the Ok button sensitive */
gtk_widget_set_sensitive (priv->buttons[4][0], TRUE);
}
+
+ hildon_code_dialog_input (dialog);
}
static gboolean
gtk_label_set_text (GTK_LABEL (priv->help_text), text);
}
+
+static void
+hildon_code_dialog_real_input (HildonCodeDialog *dialog)
+{
+}
+
+static void
+hildon_code_dialog_input (HildonCodeDialog *dialog)
+{
+ /* Emit the signal */
+ g_signal_emit (dialog, input_signal, 0);
+}
struct _HildonCodeDialogClass
{
GtkDialogClass parent_class;
+ void (*input) (HildonCodeDialog *dialog);
};
GType G_GNUC_CONST