From d5736fd47ddb0f6d67e47b884370c56def27f08f Mon Sep 17 00:00:00 2001 From: Michael Dominic Kostrzewa Date: Fri, 17 Nov 2006 15:05:22 +0000 Subject: [PATCH] 2006-11-17 Michael Dominic Kostrzewa * 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. --- ChangeLog | 38 +++ Makefile.am | 2 +- configure.ac | 14 +- examples/Makefile.am | 7 + examples/hildon-window/hildon-window-example.c | 28 ++ src/Makefile.am | 2 + src/hildon-banner.c | 19 ++ src/hildon-banner.h | 6 + src/hildon-caption.c | 6 +- src/hildon-code-dialog.c | 2 +- src/hildon-color-button.c | 2 +- src/hildon-color-chooser-button.c | 2 +- src/hildon-color-chooser-button.h | 4 +- src/hildon-color-chooser-dialog.c | 4 +- src/hildon-color-chooser-dialog.h | 4 +- src/hildon-date-editor.c | 23 +- src/hildon-defines.c | 10 +- src/hildon-find-toolbar.c | 2 +- src/hildon-font-selection-dialog.c | 391 ------------------------ src/hildon-get-password-dialog.c | 24 +- src/hildon-note.c | 7 +- src/hildon-number-editor.c | 5 +- src/hildon-range-editor.c | 4 +- src/hildon-set-password-dialog.c | 17 +- src/hildon-sort-dialog.c | 5 +- src/hildon-sort-dialog.h | 7 + src/hildon-sound.c | 92 ++++++ src/hildon-sound.h | 32 ++ src/hildon-time-editor.h | 2 +- src/hildon-time-picker.c | 2 - src/hildon-widgets.h | 1 - src/hildon-window.c | 4 +- src/hildon-wizard-dialog.c | 2 +- 33 files changed, 310 insertions(+), 460 deletions(-) create mode 100644 examples/Makefile.am create mode 100644 examples/hildon-window/hildon-window-example.c create mode 100644 src/hildon-sound.c create mode 100644 src/hildon-sound.h diff --git a/ChangeLog b/ChangeLog index 0443f77..bcb4951 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,41 @@ +2006-11-17 Michael Dominic Kostrzewa + + * 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 * src/Makefile.am: diff --git a/Makefile.am b/Makefile.am index 28bd044..1d0f13d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = src po pkgconfig +SUBDIRS = src po pkgconfig examples EXTRA_DIST = \ debian/changelog \ diff --git a/configure.ac b/configure.ac index ee19cde..ef05ac1 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,8 @@ AC_PROG_AWK 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 @@ -75,9 +76,20 @@ if test "x$enable_rebuilds" = "xyes" && \ 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 diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 0000000..6b7d4d7 --- /dev/null +++ b/examples/Makefile.am @@ -0,0 +1,7 @@ +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 diff --git a/examples/hildon-window/hildon-window-example.c b/examples/hildon-window/hildon-window-example.c new file mode 100644 index 0000000..f153896 --- /dev/null +++ b/examples/hildon-window/hildon-window-example.c @@ -0,0 +1,28 @@ +#include +#include +#include +#include +#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; +} + + diff --git a/src/Makefile.am b/src/Makefile.am index ab18502..ff38281 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,6 +29,7 @@ libhildonwidgets_la_SOURCES = hildon-composite-widget.c \ hildon-color-selector.c \ hildon-note.c \ hildon-volumebar.c \ + hildon-sound.c \ hildon-volumebar-range.c \ hildon-hvolumebar.c \ hildon-vvolumebar.c \ @@ -65,6 +66,7 @@ libhildonwidgets_includedir = $(includedir)/hildon-widgets libhildonwidgets_include_HEADERS = hildon-controlbar.h \ hildon-note.h \ + hildon-sound.h \ hildon-seekbar.h \ hildon-color-selector.h \ hildon-volumebar.h \ diff --git a/src/hildon-banner.c b/src/hildon-banner.c index 1b267d8..79b0e64 100644 --- a/src/hildon-banner.c +++ b/src/hildon-banner.c @@ -623,6 +623,25 @@ void hildon_banner_show_information(GtkWidget *widget, 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 diff --git a/src/hildon-banner.h b/src/hildon-banner.h index fe8c5d2..65f01b6 100644 --- a/src/hildon-banner.h +++ b/src/hildon-banner.h @@ -28,6 +28,7 @@ #include #include #include +#include G_BEGIN_DECLS @@ -57,6 +58,11 @@ void hildon_banner_show_information (GtkWidget *widget, 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); diff --git a/src/hildon-caption.c b/src/hildon-caption.c index c481213..5e328b5 100644 --- a/src/hildon-caption.c +++ b/src/hildon-caption.c @@ -181,7 +181,7 @@ static void hildon_caption_class_init( HildonCaptionClass *caption_class ) 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; @@ -521,7 +521,7 @@ static gboolean hildon_caption_button_press( GtkWidget *widget, /* 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)) && @@ -873,7 +873,7 @@ void hildon_caption_set_icon_position( HildonCaption *caption, 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; diff --git a/src/hildon-code-dialog.c b/src/hildon-code-dialog.c index 9a53ff1..315cdda 100644 --- a/src/hildon-code-dialog.c +++ b/src/hildon-code-dialog.c @@ -356,7 +356,7 @@ static void hildon_code_dialog_insert_text (GtkEditable *editable, if (length == MAX_PINCODE_LEN) { - hildon_banner_show_information (dialog, + hildon_banner_show_information (GTK_WIDGET (dialog), NULL, DEVICELOCK_MAX_CHAR_REACHED); } diff --git a/src/hildon-color-button.c b/src/hildon-color-button.c index 430bc94..d5b4518 100644 --- a/src/hildon-color-button.c +++ b/src/hildon-color-button.c @@ -358,7 +358,7 @@ hildon_color_button_clicked(GtkButton *button) { /* 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)); diff --git a/src/hildon-color-chooser-button.c b/src/hildon-color-chooser-button.c index ec5ca29..3e63fca 100644 --- a/src/hildon-color-chooser-button.c +++ b/src/hildon-color-chooser-button.c @@ -71,7 +71,7 @@ static gboolean hildon_color_chooser_button_area_expose(GtkWidget *widget, GdkEv 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; diff --git a/src/hildon-color-chooser-button.h b/src/hildon-color-chooser-button.h index 9dcb446..f546009 100644 --- a/src/hildon-color-chooser-button.h +++ b/src/hildon-color-chooser-button.h @@ -72,8 +72,8 @@ struct HildonColorChooserButtonClass_ }; -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); diff --git a/src/hildon-color-chooser-dialog.c b/src/hildon-color-chooser-dialog.c index bb367a4..afa787b 100644 --- a/src/hildon-color-chooser-dialog.c +++ b/src/hildon-color-chooser-dialog.c @@ -55,7 +55,7 @@ static void hildon_color_chooser_dialog_init(HildonColorChooserDialog *object); 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; @@ -124,7 +124,7 @@ static void hildon_color_chooser_dialog_class_init(HildonColorChooserDialogClass * * 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); diff --git a/src/hildon-color-chooser-dialog.h b/src/hildon-color-chooser-dialog.h index e03492a..f196998 100644 --- a/src/hildon-color-chooser-dialog.h +++ b/src/hildon-color-chooser-dialog.h @@ -63,9 +63,9 @@ struct HildonColorChooserDialogClass_ { }; -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); diff --git a/src/hildon-date-editor.c b/src/hildon-date-editor.c index 82e4742..586f155 100644 --- a/src/hildon-date-editor.c +++ b/src/hildon-date-editor.c @@ -50,6 +50,7 @@ #include "hildon-marshalers.h" #include "hildon-enum-types.h" #include "hildon-time-editor.h" +#include "hildon-banner.h" #ifdef HAVE_CONFIG_H #include @@ -222,7 +223,7 @@ hildon_date_editor_class_init(HildonDateEditorClass * editor_class) 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", @@ -1142,36 +1143,36 @@ hildon_date_editor_date_error(HildonDateEditor *editor, 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 ?*/ diff --git a/src/hildon-defines.c b/src/hildon-defines.c index 18a239f..b51c412 100644 --- a/src/hildon-defines.c +++ b/src/hildon-defines.c @@ -90,9 +90,9 @@ static void hildon_change_style_recursive_from_ld (GtkWidget *widget, GtkStyle * { /* 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 @@ -204,7 +204,7 @@ gulong hildon_gtk_widget_set_logical_font (GtkWidget *widget, const gchar *logic /* 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 */ @@ -253,7 +253,7 @@ gulong hildon_gtk_widget_set_logical_color (GtkWidget *widget, GtkRcFlags rcflag /* 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 */ diff --git a/src/hildon-find-toolbar.c b/src/hildon-find-toolbar.c index 33a9e69..6fd5bbf 100644 --- a/src/hildon-find-toolbar.c +++ b/src/hildon-find-toolbar.c @@ -418,7 +418,7 @@ hildon_find_toolbar_class_init(HildonFindToolbarClass *klass) 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", diff --git a/src/hildon-font-selection-dialog.c b/src/hildon-font-selection-dialog.c index a3951aa..760f37d 100644 --- a/src/hildon-font-selection-dialog.c +++ b/src/hildon-font-selection-dialog.c @@ -212,30 +212,6 @@ static void color_modified_cb (HildonColorButton *button, 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, @@ -1291,373 +1267,6 @@ hildon_font_selection_dialog_show_available_sizes } } -/* 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) { diff --git a/src/hildon-get-password-dialog.c b/src/hildon-get-password-dialog.c index 60b782d..9490582 100644 --- a/src/hildon-get-password-dialog.c +++ b/src/hildon-get-password-dialog.c @@ -42,11 +42,11 @@ #include -#include "gtk-infoprint.h" #include "hildon-input-mode-hint.h" #include #include +#include "hildon-banner.h" #ifdef HAVE_CONFIG_H #include @@ -118,12 +118,12 @@ hildon_get_password_set_property(GObject * object, 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 @@ -166,13 +166,13 @@ hildon_get_password_get_property(GObject * object, 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)); @@ -183,7 +183,7 @@ hildon_get_password_get_property(GObject * object, 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: @@ -456,7 +456,7 @@ const gchar 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; @@ -526,14 +526,14 @@ void hildon_get_password_dialog_set_max_characters (HildonGetPasswordDialog *dia /* 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 @@ -544,6 +544,6 @@ static void _invalid_input(GtkWidget *widget, GtkInvalidInputType reason, 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)); } } diff --git a/src/hildon-note.c b/src/hildon-note.c index aec578a..6db8568 100644 --- a/src/hildon-note.c +++ b/src/hildon-note.c @@ -44,9 +44,10 @@ #include #include #include -#include -#include -#include /* 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 #include diff --git a/src/hildon-number-editor.c b/src/hildon-number-editor.c index 6cff032..2caf164 100644 --- a/src/hildon-number-editor.c +++ b/src/hildon-number-editor.c @@ -45,6 +45,7 @@ #include #include #include "hildon-enum-types.h" +#include "hildon-banner.h" #ifdef HAVE_CONFIG_H #include @@ -802,8 +803,8 @@ hildon_number_editor_range_error(HildonNumberEditor *editor, /* 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); } diff --git a/src/hildon-range-editor.c b/src/hildon-range-editor.c index 253ee5e..b3d69ff 100644 --- a/src/hildon-range-editor.c +++ b/src/hildon-range-editor.c @@ -40,7 +40,7 @@ #include #include #include - +#include "hildon-banner.h" #include "hildon-range-editor.h" #ifdef HAVE_CONFIG_H @@ -418,7 +418,7 @@ hildon_range_editor_entry_validate(HildonRangeEditor *editor, 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]) { diff --git a/src/hildon-set-password-dialog.c b/src/hildon-set-password-dialog.c index 527fc30..37b2c80 100644 --- a/src/hildon-set-password-dialog.c +++ b/src/hildon-set-password-dialog.c @@ -59,6 +59,7 @@ #include #include #include +#include "hildon-banner.h" #include #define _(String) dgettext(PACKAGE, String) @@ -384,7 +385,7 @@ hildon_set_password_response_change(GtkDialog * dialog, gint arg1, /* 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 { @@ -393,7 +394,7 @@ hildon_set_password_response_change(GtkDialog * dialog, gint arg1, "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)); } @@ -402,11 +403,11 @@ hildon_set_password_response_change(GtkDialog * dialog, gint arg1, 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)); @@ -478,14 +479,14 @@ hildon_set_password_response_set(GtkDialog * dialog, gint arg1, /* 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 { @@ -493,11 +494,11 @@ hildon_set_password_response_set(GtkDialog * dialog, gint arg1, 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)); diff --git a/src/hildon-sort-dialog.c b/src/hildon-sort-dialog.c index 2c28552..e8cf98f 100644 --- a/src/hildon-sort-dialog.c +++ b/src/hildon-sort-dialog.c @@ -64,9 +64,6 @@ static void hildon_sort_dialog_get_property(GObject * object, 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); @@ -145,7 +142,7 @@ static void hildon_sort_dialog_class_init(HildonSortDialogClass * class) 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; diff --git a/src/hildon-sort-dialog.h b/src/hildon-sort-dialog.h index 5ef6bcf..ceb9ef7 100644 --- a/src/hildon-sort-dialog.h +++ b/src/hildon-sort-dialog.h @@ -64,5 +64,12 @@ void hildon_sort_dialog_set_sort_order(HildonSortDialog * dialog, 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__ */ diff --git a/src/hildon-sound.c b/src/hildon-sound.c new file mode 100644 index 0000000..76ce0cc --- /dev/null +++ b/src/hildon-sound.c @@ -0,0 +1,92 @@ +/* + * This file is part of hildon-libs + * + * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved. + * + * Contact: Michael Dominic Kostrzewa + * + * 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 +#include +#include "hildon-sound.h" +#include + +#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); +} diff --git a/src/hildon-sound.h b/src/hildon-sound.h new file mode 100644 index 0000000..0178017 --- /dev/null +++ b/src/hildon-sound.h @@ -0,0 +1,32 @@ +/* + * This file is part of hildon-libs + * + * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved. + * + * Contact: Michael Dominic Kostrzewa + * + * 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__ */ diff --git a/src/hildon-time-editor.h b/src/hildon-time-editor.h index 740b8aa..3118a2c 100644 --- a/src/hildon-time-editor.h +++ b/src/hildon-time-editor.h @@ -62,7 +62,7 @@ typedef enum 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; diff --git a/src/hildon-time-picker.c b/src/hildon-time-picker.c index 0b59015..6e4d5ab 100644 --- a/src/hildon-time-picker.c +++ b/src/hildon-time-picker.c @@ -36,7 +36,6 @@ #include "hildon-time-picker.h" #include "hildon-defines.h" #include "hildon-private.h" -#include "gtk-infoprint.h" #include #include #include @@ -285,7 +284,6 @@ static void hildon_time_picker_init( HildonTimePicker *picker ) const struct tm *local = NULL; time_t stamp; gint i = 0; - GtkSizeGroup *size_group; picker->priv = priv; diff --git a/src/hildon-widgets.h b/src/hildon-widgets.h index 4005fb9..d31a675 100644 --- a/src/hildon-widgets.h +++ b/src/hildon-widgets.h @@ -25,7 +25,6 @@ #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" diff --git a/src/hildon-window.c b/src/hildon-window.c index b2a074f..790a542 100644 --- a/src/hildon-window.c +++ b/src/hildon-window.c @@ -140,7 +140,6 @@ static gboolean hildon_window_window_state_event (GtkWidget *widget, GdkEventWindowState *event); - static void hildon_window_notify (GObject *gobject, GParamSpec *param); @@ -1153,6 +1152,7 @@ hildon_window_window_state_event (GtkWidget *widget, } } +/* static void hildon_window_title_notify (GObject *gobject, GParamSpec *arg1, @@ -1162,7 +1162,7 @@ hildon_window_title_notify (GObject *gobject, hildon_window_update_title (window); -} +}*/ /*******************/ /* General */ diff --git a/src/hildon-wizard-dialog.c b/src/hildon-wizard-dialog.c index d775d5a..f7fe18a 100644 --- a/src/hildon-wizard-dialog.c +++ b/src/hildon-wizard-dialog.c @@ -322,7 +322,7 @@ set_property (GObject *object, /* 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) -- 1.7.9.5