+2006-11-17 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ * Makefile.am:
+ * configure.ac:
+ * examples:
+ * examples/Makefile.am:
+ * examples/hildon-program:
+ * examples/hildon-window:
+ * examples/hildon-window/hildon-window-example.c:
+ * src/Makefile.am:
+ * src/hildon-banner.c:
+ * src/hildon-banner.h:
+ * src/hildon-caption.c:
+ * src/hildon-code-dialog.c:
+ * src/hildon-color-button.c:
+ * src/hildon-color-chooser-button.c:
+ * src/hildon-color-chooser-button.h:
+ * src/hildon-color-chooser-dialog.c:
+ * src/hildon-color-chooser-dialog.h:
+ * src/hildon-date-editor.c:
+ * src/hildon-defines.c:
+ * src/hildon-find-toolbar.c:
+ * src/hildon-font-selection-dialog.c:
+ * src/hildon-get-password-dialog.c:
+ * src/hildon-note.c:
+ * src/hildon-number-editor.c:
+ * src/hildon-range-editor.c:
+ * src/hildon-set-password-dialog.c:
+ * src/hildon-sort-dialog.c:
+ * src/hildon-sort-dialog.h:
+ * src/hildon-sound.c:
+ * src/hildon-sound.h:
+ * src/hildon-time-editor.h:
+ * src/hildon-time-picker.c:
+ * src/hildon-widgets.h:
+ * src/hildon-window.c:
+ * src/hildon-wizard-dialog.c: Making the stuff compile with -Werror.
+
2006-11-16 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
* src/Makefile.am:
-SUBDIRS = src po pkgconfig
+SUBDIRS = src po pkgconfig examples
EXTRA_DIST = \
debian/changelog \
AC_HEADER_STDC
-CFLAGS="$CFLAGS -std=c99 -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations"
+CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wmissing-declarations -Werror -Wno-format"
+#CFLAGS="$CFLAGS -Wall -pedantic -Wmissing-prototypes -Wmissing-declarations -Werror -Wno-format"
# -Werror disabled due to the flaw in glib-2.0
# See http://bugzilla.gnome.org/show_bug.cgi?id=310175 and
# http://bugzilla.gnome.org/show_bug.cgi?id=310216
fi
AC_SUBST(REBUILD)
+# HILDON_WIDGETS__OBJ_*
+# default vars for the examples
+# includes all the low-level flags
+# FIXME Add esd and gconf flags
+HILDON_WIDGETS_OBJ_CFLAGS="\$(CFLAGS) \$(GTK_CFLAGS) -I\$(top_builddir)/src/"
+HILDON_WIDGETS_OBJ_LIBS="\$(top_builddir)/src/libhildonwidgets.la \$(GTK_LIBS)"
+AC_SUBST(HILDON_WIDGETS_OBJ_CFLAGS)
+AC_SUBST(HILDON_WIDGETS_OBJ_LIBS)
+
+
AC_CONFIG_FILES([Makefile src/Makefile \
po/Makefile po/porules.mk \
pkgconfig/Makefile \
+ examples/Makefile \
pkgconfig/hildon-widgets.pc])
AC_OUTPUT
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+
+noinst_PROGRAMS = hildon-window-example
+
+hildon_window_example_LDADD = $(HILDON_WIDGETS_OBJ_LIBS)
+hildon_window_example_CFLAGS = $(HILDON_WIDGETS_OBJ_CFLAGS)
+hildon_window_example_SOURCES = hildon-window/hildon-window-example.c
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <glib.h>
+#include <gtk/gtk.h>
+#include "hildon-widgets/hildon-window.h"
+#include "hildon-widgets/hildon-program.h"
+
+int
+main (int argc, char **args)
+{
+ gtk_init (&argc, &args);
+
+ HildonProgram *program = hildon_program_get_instance ();
+ GtkWidget *window = hildon_window_new ();
+ hildon_program_add_window (program, HILDON_WINDOW (window));
+
+ gtk_container_set_border_width (GTK_CONTAINER (window), 6);
+
+ GtkWidget *label = GTK_WIDGET (gtk_label_new ("Hello world!"));
+
+ gtk_container_add (GTK_CONTAINER (window), label);
+ gtk_widget_show_all (GTK_WIDGET (window));
+
+ gtk_main ();
+ return 0;
+}
+
+
hildon-color-selector.c \
hildon-note.c \
hildon-volumebar.c \
+ hildon-sound.c \
hildon-volumebar-range.c \
hildon-hvolumebar.c \
hildon-vvolumebar.c \
libhildonwidgets_include_HEADERS = hildon-controlbar.h \
hildon-note.h \
+ hildon-sound.h \
hildon-seekbar.h \
hildon-color-selector.h \
hildon-volumebar.h \
gtk_widget_show_all(GTK_WIDGET(banner));
}
+void hildon_banner_show_informationf (GtkWidget *widget,
+ const gchar *icon_name,
+ const gchar *format,
+ ...)
+{
+ g_return_if_fail (format != NULL);
+
+ gchar *message;
+ va_list args;
+
+ va_start(args, format);
+ message = g_strdup_vprintf(format, args);
+ va_end(args);
+
+ hildon_banner_show_information (widget, icon_name, message);
+
+ g_free (message);
+}
+
/**
* hildon_banner_show_information_with_markup:
* @widget: the #GtkWidget that wants to display banner
#include <gtk/gtkwindow.h>
#include <gtk/gtkprogressbar.h>
#include <gtk/gtklabel.h>
+#include <gdk/gdkx.h>
G_BEGIN_DECLS
const gchar *icon_name,
const gchar *text);
+void hildon_banner_show_informationf (GtkWidget *widget,
+ const gchar *icon_name,
+ const gchar *format,
+ ...);
+
void hildon_banner_show_information_with_markup (GtkWidget *widget,
const gchar *icon_name,
const gchar *markup);
gobject_class->get_property = hildon_caption_get_property;
gobject_class->set_property = hildon_caption_set_property;
- caption_class->activate = hildon_caption_activate;
+ caption_class->activate = (gpointer) hildon_caption_activate;
GTK_OBJECT_CLASS(caption_class)->destroy = hildon_caption_destroy;
/* nothing to do */
if (priv->is_focused == TRUE)
- return;
+ return FALSE;
/* If child can take focus, we simply grab focus to it */
if ((GTK_WIDGET_CAN_FOCUS(child) || GTK_IS_CONTAINER(child)) &&
HildonCaptionIconPosition hildon_caption_get_icon_position( const HildonCaption *caption )
{
- g_return_if_fail (HILDON_IS_CAPTION (caption));
+ g_return_val_if_fail (HILDON_IS_CAPTION (caption), 0);
HildonCaptionPrivate *priv = HILDON_CAPTION_GET_PRIVATE(caption);
return priv->icon_position;
if (length == MAX_PINCODE_LEN)
{
- hildon_banner_show_information (dialog,
+ hildon_banner_show_information (GTK_WIDGET (dialog),
NULL,
DEVICELOCK_MAX_CHAR_REACHED);
}
{
/* The dialog hasn't been created yet, do it. */
GtkWidget *parent = gtk_widget_get_toplevel(GTK_WIDGET(cb));
- cb->priv->dialog = hildon_color_chooser_dialog_new(GTK_WINDOW(parent));
+ cb->priv->dialog = hildon_color_chooser_dialog_new();
cs_dialog = HILDON_COLOR_CHOOSER_DIALOG(cb->priv->dialog);
if (parent)
gtk_window_set_transient_for(GTK_WINDOW(cs_dialog), GTK_WINDOW(parent));
static void hildon_color_chooser_button_helper_get_style_info(HildonColorChooserButton *button);
-GtkType hildon_color_chooser_button_get_type ()
+GtkType hildon_color_chooser_button_get_type (void)
{
static GtkType button_type = 0;
};
-GtkType hildon_color_chooser_button_get_type();
-GtkWidget *hildon_color_chooser_button_new();
+GtkType hildon_color_chooser_button_get_type(void);
+GtkWidget *hildon_color_chooser_button_new(void);
void hildon_color_chooser_button_set_color(HildonColorChooserButton *button, GdkColor *color);
void hildon_color_chooser_button_get_color(HildonColorChooserButton *button, GdkColor *color);
static void hildon_color_chooser_dialog_class_init(HildonColorChooserDialogClass *klass);
-GtkType hildon_color_chooser_dialog_get_type ()
+GtkType hildon_color_chooser_dialog_get_type (void)
{
static GtkType chooser_type = 0;
*
* Returns: a new color chooser dialog
*/
-GtkWidget *hildon_color_chooser_dialog_new()
+GtkWidget *hildon_color_chooser_dialog_new(void)
{
if(!global_plugin) {
global_plugin = hildon_plugin_info_initialize(HILDON_TYPE_COLOR_CHOOSER_DIALOG, NULL);
};
-GtkType hildon_color_chooser_dialog_get_type();
+GtkType hildon_color_chooser_dialog_get_type(void);
-GtkWidget *hildon_color_chooser_dialog_new();
+GtkWidget *hildon_color_chooser_dialog_new(void);
void hildon_color_chooser_dialog_set_color(HildonColorChooserDialog *chooser, GdkColor *color);
void hildon_color_chooser_dialog_get_color(HildonColorChooserDialog *chooser, GdkColor *color);
#include "hildon-marshalers.h"
#include "hildon-enum-types.h"
#include "hildon-time-editor.h"
+#include "hildon-banner.h"
#ifdef HAVE_CONFIG_H
#include<config.h>
container_class->forall = hildon_child_forall;
GTK_OBJECT_CLASS(editor_class)->destroy = hildon_date_editor_destroy;
- editor_class->date_error = hildon_date_editor_date_error;
+ editor_class->date_error = (gpointer) hildon_date_editor_date_error;
date_editor_signals[DATE_ERROR] =
g_signal_new("date-error",
switch(type)
{
case HILDON_DATE_TIME_ERROR_MAX_DAY:
- gtk_infoprintf(NULL, _("ckct_ib_maximum_value"), 31);
+ hildon_banner_show_informationf(GTK_WIDGET (editor), NULL, _("ckct_ib_maximum_value"), 31);
break;
case HILDON_DATE_TIME_ERROR_MAX_MONTH:
- gtk_infoprintf(NULL, _("ckct_ib_maximum_value"), 12);
+ hildon_banner_show_informationf(GTK_WIDGET (editor), NULL, _("ckct_ib_maximum_value"), 12);
break;
case HILDON_DATE_TIME_ERROR_MAX_YEAR:
- gtk_infoprintf(NULL, _("ckct_ib_maximum_value"), priv->max_year);
+ hildon_banner_show_informationf(GTK_WIDGET (editor), NULL, _("ckct_ib_maximum_value"), priv->max_year);
break;
case HILDON_DATE_TIME_ERROR_MIN_DAY:
case HILDON_DATE_TIME_ERROR_MIN_MONTH:
- gtk_infoprintf(NULL, _("ckct_ib_minimum_value"), 1);
+ hildon_banner_show_informationf(GTK_WIDGET (editor), NULL, _("ckct_ib_minimum_value"), 1);
break;
case HILDON_DATE_TIME_ERROR_MIN_YEAR:
- gtk_infoprintf(NULL, _("ckct_ib_minimum_value"), priv->min_year);
+ hildon_banner_show_informationf(GTK_WIDGET (editor), NULL, _("ckct_ib_minimum_value"), priv->min_year);
break;
case HILDON_DATE_TIME_ERROR_EMPTY_DAY:
- gtk_infoprintf(NULL, _("ckct_ib_set_a_value_within_range"), 1, 31);
+ hildon_banner_show_informationf(GTK_WIDGET (editor), NULL, _("ckct_ib_set_a_value_within_range"), 1, 31);
break;
case HILDON_DATE_TIME_ERROR_EMPTY_MONTH:
- gtk_infoprintf(NULL, _("ckct_ib_set_a_value_within_range"), 1, 12);
+ hildon_banner_show_informationf(GTK_WIDGET (editor), NULL, _("ckct_ib_set_a_value_within_range"), 1, 12);
break;
case HILDON_DATE_TIME_ERROR_EMPTY_YEAR:
- gtk_infoprintf(NULL, _("ckct_ib_set_a_value_within_range"),
+ hildon_banner_show_informationf(GTK_WIDGET (editor), NULL, _("ckct_ib_set_a_value_within_range"),
priv->min_year, priv->max_year);
break;
case HILDON_DATE_TIME_ERROR_INVALID_CHAR:
- gtk_infoprint(NULL, _("ckct_ib_illegal_character"));
+ hildon_banner_show_information(GTK_WIDGET (editor), NULL, _("ckct_ib_illegal_character"));
break;
case HILDON_DATE_TIME_ERROR_INVALID_DATE:
- gtk_infoprint(NULL, _("ckct_ib_date_does_not_exist"));
+ hildon_banner_show_information(GTK_WIDGET (editor), NULL, _("ckct_ib_date_does_not_exist"));
break;
default:
/*default error message ?*/
{
/* Change the style for child widgets */
if (GTK_IS_CONTAINER (widget)) {
- GSList *iterator = gtk_container_get_children (GTK_CONTAINER (widget));
- for (iterator; iterator; iterator = g_list_next (iterator))
- hildon_change_style_recursive_from_ld (iterator->data, prev_style, ld);
+ GList *iterator = gtk_container_get_children (GTK_CONTAINER (widget));
+ for (iterator = iterator; iterator != NULL; iterator = g_list_next (iterator))
+ hildon_change_style_recursive_from_ld (GTK_WIDGET (iterator->data), prev_style, ld);
}
/* gtk_widget_modify_*() emit "style_set" signals, so if we got here from
/* Disconnects the previously connected signals. That calls the closure notify
* and effectively disposes the allocated data (hildon_logical_data_free) */
g_signal_handlers_disconnect_matched (G_OBJECT (widget), G_SIGNAL_MATCH_FUNC,
- 0, NULL, NULL,
+ 0, 0, NULL,
G_CALLBACK (hildon_change_style_recursive_from_ld), NULL);
/* Change the font now */
/* Disconnects the previously connected signals. That calls the closure notify
* and effectively disposes the allocated data (hildon_logical_data_free) */
g_signal_handlers_disconnect_matched (G_OBJECT (widget), G_SIGNAL_MATCH_FUNC,
- 0, NULL, NULL,
+ 0, 0, NULL,
G_CALLBACK (hildon_change_style_recursive_from_ld), NULL);
/* Change the colors now */
object_class->get_property = hildon_find_toolbar_get_property;
object_class->set_property = hildon_find_toolbar_set_property;
- klass->history_append = hildon_find_toolbar_history_append;
+ klass->history_append = (gpointer) hildon_find_toolbar_history_append;
g_object_class_install_property(object_class, PROP_LABEL,
g_param_spec_string("label",
GParamSpec *pspec,
gpointer fsd_priv);
-static void check_tags (gpointer data,
- gpointer user_data);
-
-static void settings_init (HildonFontSelectionDialogSettings
- *setttings,
- HildonFontSelectionDialog
- *fsd);
-
-static void settings_apply (HildonFontSelectionDialogSettings
- *setttings);
-
-static void settings_destroy (HildonFontSelectionDialogSettings
- *setttings);
-
-static void bit_mask_toggle (gint mask, GtkToggleButton*
- button, GObject *object,
- const gchar *prop,
- const gchar *prop_set);
-
-static void combo_active (gint active, GtkComboBox *box,
- GObject *object,
- const gchar *prop,
- const gchar *prop_set);
-
static void add_preview_text_attr (PangoAttrList *list,
PangoAttribute *attr,
guint start,
}
}
-/* WARNING: This function is called only from deprecated API */
-static
-void check_tags(gpointer data, gpointer user_data)
-{
- gchar *font_family;
- GdkColor *fore_color = NULL;
- gint p_size, p_weight, p_style, p_underline, p_rise;
- gboolean b_st, ff_s, size_s, fgc_s, w_s, ss_s, u_s, sth_s, r_s;
-
- GtkTextTag *tag = (GtkTextTag*) data;
- HildonFontSelectionDialogSettings *settings =
- (HildonFontSelectionDialogSettings *) user_data;
- HildonFontSelectionDialogPrivate *priv =
- HILDON_FONT_SELECTION_DIALOG_GET_PRIVATE(settings->fsd);
-
- /*get all the properties*/
- g_object_get(G_OBJECT(tag),
- "family", &font_family, "family-set", &ff_s,
- "size", &p_size, "size-set", &size_s,
- "foreground-gdk", &fore_color, "foreground-set", &fgc_s,
- "weight", &p_weight, "weight-set", &w_s,
- "style", &p_style, "style-set", &ss_s,
- "underline", &p_underline, "underline-set", &u_s,
- "strikethrough", &b_st, "strikethrough-set", &sth_s,
- "rise", &p_rise, "rise-set", & r_s,
- NULL);
-
- /* Check that the given values are valid.
- * If not, set the combobox row indicator to 'inconsistent' */
- if(ff_s)
- {
- gint new_f = -1;
- gint i;
-
- for(i = 0; i < priv->n_families; i++)
- {
- if(strcmp(font_family,
- pango_font_family_get_name(priv->families[i])) == 0)
- {
- new_f = i;
- break;
- }
- }
-
- if(settings->family == -1)
- settings->family = new_f;
- else if(settings->family != -2 &&
- settings->family != new_f)
- settings->family = -2;/*inconsist*/
-
- g_free(font_family);
- }
-
- if(size_s)
- {
- gint new_size = -1;
- gint i;
-
- for(i = 0; i < G_N_ELEMENTS(font_sizes); i++)
- {
- if(p_size == font_sizes[i] * PANGO_SCALE)
- {
- new_size = i;
- break;
- }
- }
-
- if(settings->size == -1)
- settings->size = new_size;
- else if(settings->size != -2 &&
- settings->size != new_size)
- settings->size = -2;/*inconsist*/
- }
-
- if(fgc_s && settings->color == NULL
- && !settings->color_inconsist)
- settings->color = fore_color;
- else if(fore_color != NULL)
- {
- if(!gdk_color_equal(fore_color, settings->color)
- && fgc_s)
- settings->color_inconsist = TRUE;
-
- gdk_color_free(fore_color);
- }
-
- if(w_s)
- settings->weight |= p_weight == PANGO_WEIGHT_NORMAL ? OFF_BIT : ON_BIT;
-
- if(ss_s)
- settings->style |= p_style == PANGO_STYLE_NORMAL ? OFF_BIT : ON_BIT;
-
- if(u_s)
- settings->underline |=
- p_underline == PANGO_UNDERLINE_NONE ? OFF_BIT : ON_BIT;
-
- if(sth_s)
- settings->strikethrough |= b_st ? ON_BIT : OFF_BIT;
-
- if(r_s)
- {
- gint new_rs = -1;
-
- if(p_rise == 0)
- new_rs = 0;/*normal*/
- else if (p_rise > 0)
- new_rs = 1;/*super*/
- else
- new_rs = 2;/*sub*/
-
- if(settings->position == -1)
- settings->position = new_rs;
- else if(settings->position != -2 &&
- settings->position != new_rs)
- settings->position = -2;/*inconsist*/
- }
-}
-
-/* WARNING: This function is called only from deprecated API */
-static
-void check_attrs(gpointer data, gpointer user_data)
-{
- PangoAttribute *attr = (PangoAttribute *) data;
- HildonFontSelectionDialogSettings *settings =
- (HildonFontSelectionDialogSettings *) user_data;
- HildonFontSelectionDialogPrivate *priv =
- HILDON_FONT_SELECTION_DIALOG_GET_PRIVATE(settings->fsd);
-
- gchar *family;
- GdkColor color;
- gint i;
- gint size, weight, style, underline, strikethrough, rise;
- gint new_f = -1, new_size = -1, new_rise = -1;
-
- /* Check that the given values are valid.
- * If not, set the combobox row indicator to 'inconsistent' */
- switch(attr->klass->type)
- {
- case PANGO_ATTR_FAMILY:
- family = ((PangoAttrString *) attr)->value;
-
- for(i = 0; i < priv->n_families; i++)
- {
- if(strcmp(family,
- pango_font_family_get_name(priv->families[i])) == 0)
- {
- new_f = i;
- break;
- }
- }
-
- if(settings->family == -1)
- settings->family = new_f;
- else if(settings->family != -2 &&
- settings->family != new_f)
- settings->family = -2;/*inconsist*/
-
- break;
- case PANGO_ATTR_SIZE:
- size = ((PangoAttrInt *) attr)->value;
-
- for(i = 0; i < G_N_ELEMENTS(font_sizes); i++)
- {
- if(size == font_sizes[i] * PANGO_SCALE)
- {
- new_size = i;
- break;
- }
- }
-
- if(settings->size == -1)
- settings->size = new_size;
- else if(settings->size != -2 &&
- settings->size != new_size)
- settings->size = -2;/*inconsist*/
-
- break;
- case PANGO_ATTR_FOREGROUND:
- color.red = ((PangoAttrColor *) attr)->color.red;
- color.green = ((PangoAttrColor *) attr)->color.green;
- color.blue = ((PangoAttrColor *) attr)->color.blue;
-
- if(!settings->color_inconsist && settings->color == NULL)
- settings->color = gdk_color_copy(&color);
- else if(settings->color != NULL &&
- !gdk_color_equal(&color, settings->color))
- settings->color_inconsist = TRUE;
-
- break;
- case PANGO_ATTR_WEIGHT:
- weight = ((PangoAttrInt *) attr)->value;
-
- settings->weight |= weight == PANGO_WEIGHT_NORMAL ? OFF_BIT : ON_BIT;
-
- break;
- case PANGO_ATTR_STYLE:
- style = ((PangoAttrInt *) attr)->value;
-
- settings->style |= style == PANGO_STYLE_NORMAL ? OFF_BIT : ON_BIT;
-
- break;
- case PANGO_ATTR_UNDERLINE:
- underline = ((PangoAttrInt *) attr)->value;
-
- settings->underline |=
- underline == PANGO_UNDERLINE_NONE ? OFF_BIT : ON_BIT;
-
- break;
- case PANGO_ATTR_STRIKETHROUGH:
- strikethrough = ((PangoAttrInt *) attr)->value;
-
- settings->strikethrough |= strikethrough ? ON_BIT : OFF_BIT;
-
- break;
- case PANGO_ATTR_RISE:
- rise = ((PangoAttrInt *) attr)->value;
-
- if(rise == 0)
- new_rise = 0;/*normal*/
- else if (rise > 0)
- new_rise = 1;/*super*/
- else
- new_rise = 2;/*sub*/
-
- if(settings->position == -1)
- settings->position = new_rise;
- else if(settings->position != -2 &&
- settings->position != new_rise)
- settings->position = -2;/*inconsist*/
-
- break;
- default:
- break;
- }
-
- pango_attribute_destroy(attr);
-}
-
-/* WARNING: This function is called only from deprecated API */
-static void
-settings_init(HildonFontSelectionDialogSettings *settings,
- HildonFontSelectionDialog *fsd)
-{
- settings->fsd = fsd;
- settings->family = -1;
- settings->size = -1;
- settings->color = NULL;
- settings->color_inconsist = FALSE;
- settings->weight = 0;
- settings->style = 0;
- settings->underline = 0;
- settings->strikethrough = 0;
- settings->position = -1;
-}
-
-/* WARNING: This function is called only from deprecated API */
-static void
-bit_mask_toggle(gint mask, GtkToggleButton *button,
- GObject *object, const gchar *prop,
- const gchar *prop_set)
-{
-
- if(mask == 3)
- gtk_toggle_button_set_inconsistent(button, TRUE);
- else
- {
- gtk_toggle_button_set_inconsistent(button, FALSE);
-
- if(mask == 1)
- gtk_toggle_button_set_active(button, TRUE);
- else
- gtk_toggle_button_set_active(button, FALSE);
-
- g_object_notify(object, prop);
- }
-
- g_object_notify(object, prop_set);
-}
-
-/* WARNING: This function is called only from deprecated API */
-static void
-combo_active(gint active, GtkComboBox *box,
- GObject *object, const gchar *prop, const gchar *prop_set)
-{
- /*probaly not the best function, but we need all these
- * parameters to keep things together*/
-
-
- if(active >= 0)
- {
- gtk_combo_box_set_active(box, active);
- g_object_notify(object, prop);
- }
- else
- gtk_combo_box_set_active(box, -1);
-
- g_object_notify(object, prop_set);
-}
-
-/* WARNING: This function is called only from deprecated API */
-static void
-settings_apply(HildonFontSelectionDialogSettings *settings)
-{
-
- HildonFontSelectionDialogPrivate *priv =
- HILDON_FONT_SELECTION_DIALOG_GET_PRIVATE(settings->fsd);
-
- /*family*/
- combo_active(settings->family, GTK_COMBO_BOX(priv->cbx_font_type),
- G_OBJECT(settings->fsd), "family", "family-set");
-
- /*size*/
- combo_active(settings->size, GTK_COMBO_BOX(priv->cbx_font_size),
- G_OBJECT(settings->fsd), "size", "size-set");
-
- /*block our signal handler indicating color has been changed by
- * the user before set the color, and unblock it after setting
- * is done*/
-
- if(settings->color == NULL || settings->color_inconsist)
- {
- GdkColor black;
-
- black.red = black.green = black.blue = 0;
- g_signal_handler_block((gpointer) priv->font_color_button,
- priv->color_modified_signal_handler);
-
- g_object_set(G_OBJECT(settings->fsd), "color", &black, "color-set",
- FALSE, NULL);
-
- g_signal_handler_unblock((gpointer) priv->font_color_button,
- priv->color_modified_signal_handler);
- }
- else
- g_object_set(G_OBJECT(settings->fsd), "color", settings->color, NULL);
-
- /*weight*/
- bit_mask_toggle(settings->weight, GTK_TOGGLE_BUTTON(priv->chk_bold),
- G_OBJECT(settings->fsd), "bold", "bold-set");
-
- /*style*/
- bit_mask_toggle(settings->style, GTK_TOGGLE_BUTTON(priv->chk_italic),
- G_OBJECT(settings->fsd), "italic", "italic-set");
-
- /*underline*/
- bit_mask_toggle(settings->underline,
- GTK_TOGGLE_BUTTON(priv->chk_underline),
- G_OBJECT(settings->fsd), "underline", "underline-set");
-
- /*strikethrough*/
- bit_mask_toggle(settings->strikethrough,
- GTK_TOGGLE_BUTTON(priv->chk_strikethrough),
- G_OBJECT(settings->fsd), "strikethrough",
- "strikethrough-set");
-
- /*position*/
- combo_active(settings->position, GTK_COMBO_BOX(priv->cbx_positioning),
- G_OBJECT(settings->fsd), "position", "position-set");
-}
-
-static void
-settings_destroy(HildonFontSelectionDialogSettings *settings)
-{
- if(settings->color != NULL)
- gdk_color_free(settings->color);
-}
-
static void
toggle_clicked(GtkButton *button, gpointer unused)
{
#include <gtk/gtk.h>
-#include "gtk-infoprint.h"
#include "hildon-input-mode-hint.h"
#include <hildon-widgets/hildon-caption.h>
#include <hildon-widgets/hildon-get-password-dialog.h>
+#include "hildon-banner.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
break;
case PROP_PASSWORD:
gtk_entry_set_text(GTK_ENTRY
- (hildon_caption_get_control (priv->passwordEntry)),
+ (gtk_bin_get_child (GTK_BIN (priv->passwordEntry))),
g_value_get_string(value));
break;
case PROP_NUMBERS_ONLY:
/* Set input mode for the password entry */
- g_object_set(G_OBJECT(hildon_caption_get_control(priv->passwordEntry)),
+ g_object_set(G_OBJECT(gtk_bin_get_child GTK_BIN ((priv->passwordEntry))),
"input-mode",
(g_value_get_boolean(value)
? HILDON_INPUT_MODE_HINT_NUMERIC
g_value_set_string(value, string);
break;
case PROP_PASSWORD:
- string = gtk_entry_get_text(GTK_ENTRY (hildon_caption_get_control(priv->passwordEntry)));
+ string = gtk_entry_get_text(GTK_ENTRY (gtk_bin_get_child(GTK_BIN (priv->passwordEntry))));
g_value_set_string(value, string);
break;
case PROP_NUMBERS_ONLY:
/* This property is set if and only if the input mode
of the password entry has been set to numeric only */
- g_object_get(G_OBJECT(hildon_caption_get_control(priv->passwordEntry)),
+ g_object_get(G_OBJECT(gtk_bin_get_child(GTK_BIN (priv->passwordEntry))),
"input-mode", &input_mode, NULL);
g_value_set_boolean(value,
(input_mode == HILDON_INPUT_MODE_HINT_NUMERIC));
break;
case PROP_MAX_CHARS:
max_length = gtk_entry_get_max_length(
- GTK_ENTRY (hildon_caption_get_control (priv->passwordEntry)));
+ GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->passwordEntry))));
g_value_set_int(value, max_length);
break;
case PROP_GET_OLD:
priv = HILDON_GET_PASSWORD_DIALOG_GET_PRIVATE(dialog);
/* Retrieve the password entry widget */
- entry1 = GTK_ENTRY (hildon_caption_get_control(priv->passwordEntry));
+ entry1 = GTK_ENTRY (gtk_bin_get_child(GTK_BIN (priv->passwordEntry)));
text1 = GTK_ENTRY(entry1)->text;
return text1;
/* Apply the given length to password entry */
gtk_entry_set_max_length(GTK_ENTRY
- (hildon_caption_get_control
- (priv->passwordEntry)),
+ (gtk_bin_get_child
+ GTK_BIN ((priv->passwordEntry))),
max_characters);
/* Connect callback to show error banner if the limit is exceeded */
g_signal_connect(GTK_ENTRY
- (hildon_caption_get_control
- (priv->passwordEntry)),
+ (gtk_bin_get_child
+ GTK_BIN ((priv->passwordEntry))),
"invalid_input",
G_CALLBACK(_invalid_input),
NULL
gpointer unused)
{
if (reason==GTK_INVALID_INPUT_MAX_CHARS_REACHED) {
- gtk_infoprint(GTK_WINDOW(widget), _(HILDON_GET_PASSWORD_DIALOG_MAX_CHARS));
+ hildon_banner_show_information (widget, NULL, _(HILDON_GET_PASSWORD_DIALOG_MAX_CHARS));
}
}
#include <gtk/gtkvbox.h>
#include <gtk/gtkbutton.h>
#include <libintl.h>
-#include <hildon-widgets/hildon-defines.h>
-#include <hildon-widgets/hildon-system-sound.h>
-#include <hildon-widgets/hildon-banner.h> /* for _hildon_gtk_label_set_text_n_lines */
+#include "hildon-widgets/hildon-defines.h"
+#include "hildon-widgets/hildon-system-sound.h"
+#include "hildon-banner.h" /* for _hildon_gtk_label_set_text_n_lines */
+#include "hildon-enum-types.h"
#include <stdio.h>
#include <string.h>
#include <hildon-widgets/hildon-input-mode-hint.h>
#include <hildon-widgets/hildon-defines.h>
#include "hildon-enum-types.h"
+#include "hildon-banner.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
/* Infoprint error */
if (err_msg)
{
- gtk_infoprint(GTK_WINDOW(gtk_widget_get_ancestor(GTK_WIDGET(editor),
- GTK_TYPE_WINDOW)), err_msg);
+ hildon_banner_show_information(GTK_WIDGET (GTK_WINDOW(gtk_widget_get_ancestor(GTK_WIDGET(editor),
+ GTK_TYPE_WINDOW))), NULL, err_msg);
g_free(err_msg);
}
#include <string.h>
#include <stdlib.h>
#include <hildon-widgets/hildon-input-mode-hint.h>
-
+#include "hildon-banner.h"
#include "hildon-range-editor.h"
#ifdef HAVE_CONFIG_H
max = hildon_range_editor_get_max(editor);
}
- text = gtk_entry_get_text(edited_entry);
+ text = gtk_entry_get_text(GTK_ENTRY (edited_entry));
if (text && text[0])
{
#include <hildon-widgets/hildon-set-password-dialog.h>
#include <hildon-widgets/hildon-note.h>
#include <hildon-widgets/hildon-defines.h>
+#include "hildon-banner.h"
#include <libintl.h>
#define _(String) dgettext(PACKAGE, String)
/* Second field is empty, so show error, but don't clear fields */
g_signal_stop_emission_by_name(G_OBJECT(dialog),
"response");
- gtk_infoprint (NULL,
+ hildon_banner_show_information (GTK_WIDGET (dialog), NULL,
c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
gtk_widget_grab_focus(GTK_WIDGET(pwd2ndEntry));
} else {
"response");
gtk_entry_set_text(pwd1stEntry, "");
gtk_entry_set_text(pwd2ndEntry, "");
- gtk_infoprint (NULL,
+ hildon_banner_show_information (GTK_WIDGET (dialog), NULL,
c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
gtk_widget_grab_focus(GTK_WIDGET(pwd1stEntry));
}
g_signal_stop_emission_by_name(G_OBJECT(dialog), "response");
if (text2[0] == '\0') {
/* Error: Both fields are empty */
- gtk_infoprint (NULL, c_(HILDON_SET_PASSWORD_DIALOG_EMPTY));
+ hildon_banner_show_information (GTK_WIDGET (dialog), NULL, c_(HILDON_SET_PASSWORD_DIALOG_EMPTY));
} else {
/* Error: Second field doesn't match
the empty first field, so start over */
- gtk_infoprint (NULL, c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
+ hildon_banner_show_information (GTK_WIDGET (dialog), NULL, c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
gtk_entry_set_text(pwd2ndEntry, "");
}
gtk_widget_grab_focus(GTK_WIDGET(pwd1stEntry));
/* Second field is empty, so show error,
but don't clear the fields */
g_signal_stop_emission_by_name(G_OBJECT(dialog), "response");
- gtk_infoprint (NULL, c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
+ hildon_banner_show_information (GTK_WIDGET (dialog), NULL, c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
gtk_widget_grab_focus (GTK_WIDGET (priv->pwd2ndEntry));
} else {
/* Error: Passwords don't match, so start over */
g_signal_stop_emission_by_name(G_OBJECT(dialog), "response");
gtk_entry_set_text(pwd1stEntry, "");
gtk_entry_set_text(pwd2ndEntry, "");
- gtk_infoprint (NULL, c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
+ hildon_banner_show_information (GTK_WIDGET (dialog), NULL, c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
gtk_widget_grab_focus(GTK_WIDGET(priv->pwd1stEntry));
}
} else {
g_signal_stop_emission_by_name(G_OBJECT(dialog), "response");
if (text2[0] == '\0') {
/* Error: Both fields are empty */
- gtk_infoprint (NULL, c_(HILDON_SET_PASSWORD_DIALOG_EMPTY));
+ hildon_banner_show_information (GTK_WIDGET (dialog), NULL, c_(HILDON_SET_PASSWORD_DIALOG_EMPTY));
} else {
/* Error: Second field doesn't match
the empty first field, so start over */
- gtk_infoprint (NULL, c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
+ hildon_banner_show_information (GTK_WIDGET (dialog), NULL, c_(HILDON_SET_PASSWORD_DIALOG_MISMATCH));
gtk_entry_set_text(pwd2ndEntry, "");
}
gtk_widget_grab_focus(GTK_WIDGET(pwd1stEntry));
static void reconstruct_combo (HildonSortDialog * dialog,
gboolean remove,
gboolean reversed);
-static gint hildon_sort_dialog_add_sort_key_with_sorting(HildonSortDialog * dialog,
- const gchar * sort_key,
- gboolean sorting);
static void sort_key_changed(GtkWidget * widget,
HildonSortDialog * dialog);
static void hildon_sort_dialog_finalize(GObject * object);
G_PARAM_READWRITE));
}
-static gint hildon_sort_dialog_add_sort_key_with_sorting(HildonSortDialog * dialog, const gchar * sort_key, gboolean sorting)
+gint hildon_sort_dialog_add_sort_key_with_sorting(HildonSortDialog * dialog, const gchar * sort_key, gboolean sorting)
{
HildonSortDialogPrivate *priv;
gint hildon_sort_dialog_add_sort_key(HildonSortDialog * dialog,
const gchar * sort_key);
+gint hildon_sort_dialog_add_sort_key_with_sorting(HildonSortDialog * dialog,
+ const gchar * sort_key,
+ gboolean sorting);
+gint
+hildon_sort_dialog_add_sort_key_reversed(HildonSortDialog * dialog,
+ const gchar * sort_key);
+
G_END_DECLS
#endif /* __HILDON_SORT_DIALOG_H__ */
--- /dev/null
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
+ *
+ * Contact: 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
+ *
+ */
+
+/**
+ * SECTION:hildon-sound
+ * @short_description: An esd-based utility function for playing a sound
+ *
+ */
+
+#include <gconf/gconf-client.h>
+#include <esd.h>
+#include "hildon-sound.h"
+#include <unistd.h>
+
+#define ALARM_GCONF_PATH "/apps/osso/sound/system_alert_volume"
+
+/**
+ * hildon_play_system_sound:
+ * @sample: sound file to play
+ *
+ * Plays the given sample using esd sound daemon.
+ * Volume level is received from gconf.
+ */
+void hildon_play_system_sound(const gchar *sample)
+{
+ GConfClient *client;
+ GConfValue *value;
+ gint volume, scale, sock, sample_id;
+
+ client = gconf_client_get_default();
+ value = gconf_client_get(client, ALARM_GCONF_PATH, NULL);
+
+ /* We want error cases to match full volume, not silence, so
+ we do not want to use gconf_client_get_int */
+ if (!value || value->type != GCONF_VALUE_INT)
+ volume = 2;
+ else
+ volume = gconf_value_get_int(value);
+
+ if (value)
+ gconf_value_free(value);
+ g_object_unref(client);
+
+ switch (volume)
+ {
+ case 0:
+ return;
+ case 1:
+ scale = 0x80;
+ break;
+ case 2:
+ default:
+ scale = 0xff;
+ break;
+ };
+
+ sock = esd_open_sound(NULL);
+ if (sock <= 0)
+ return;
+
+ sample_id = esd_file_cache(sock, g_get_prgname(), sample);
+ if (sample_id < 0) {
+ close(sock);
+ return;
+ }
+
+ esd_set_default_sample_pan(sock, sample_id, scale, scale);
+ esd_sample_play(sock, sample_id);
+ esd_sample_free(sock, sample_id);
+ close(sock);
+}
--- /dev/null
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved.
+ *
+ * Contact: 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
+ *
+ */
+#ifndef __HILDON_SOUND_H__
+#define __HILDON_SOUND_H__
+
+G_BEGIN_DECLS
+
+void hildon_play_system_sound(const gchar *sample);
+
+G_END_DECLS
+#endif /* __HILDON_SYSTEM_SOUND_H__ */
HILDON_DATE_TIME_ERROR_MAX_DURATION,
HILDON_DATE_TIME_ERROR_INVALID_CHAR,
HILDON_DATE_TIME_ERROR_INVALID_DATE,
- HILDON_DATE_TIME_ERROR_INVALID_TIME,
+ HILDON_DATE_TIME_ERROR_INVALID_TIME
} HildonDateTimeEditorError;
typedef struct _HildonTimeEditor HildonTimeEditor;
#include "hildon-time-picker.h"
#include "hildon-defines.h"
#include "hildon-private.h"
-#include "gtk-infoprint.h"
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdk.h>
const struct tm *local = NULL;
time_t stamp;
gint i = 0;
- GtkSizeGroup *size_group;
picker->priv = priv;
#ifndef ___HILDON_WIDGETS_H___
#define ___HILDON_WIDGETS_H___
-#include "gtk-infoprint.h"
#include "hildon-banner.h"
#include "hildon-calendar-popup.h"
#include "hildon-caption.h"
hildon_window_window_state_event (GtkWidget *widget,
GdkEventWindowState *event);
-
static void
hildon_window_notify (GObject *gobject, GParamSpec *param);
}
}
+/*
static void
hildon_window_title_notify (GObject *gobject,
GParamSpec *arg1,
hildon_window_update_title (window);
-}
+}*/
/*******************/
/* General */
/* Show the notebook so that a gtk_widget_show on the dialog is
* all that is required to display the dialog correctly */
- gtk_widget_show (priv->notebook);
+ gtk_widget_show (GTK_WIDGET (priv->notebook));
/* Update dialog title to reflect current page stats etc */
if (priv->wizard_name && priv->autotitle)