+2007-04-02 Lucas Rocha <lucas.rocha@nokia.com>
+
+ * src/hildon-range-editor.c (hildon_range_editor_init),
+ src/hildon-seekbar.c (hildon_seekbar_get_fraction,
+ hildon_seekbar_set_fraction, hildon_seekbar_set_position),
+ src/hildon-time-editor.c (hildon_time_editor_tap_and_hold_setup,
+ hildon_time_editor_class_init, hildon_time_editor_init),
+ src/hildon-get-password-dialog.c (invalid_input,
+ hildon_get_password_set_property, hildon_get_password_get_property,
+ create_contents, hildon_get_password_dialog_set_max_characters),
+ src/hildon-set-password-dialog.c (create_contents),
+ src/hildon-date-editor.c (hildon_date_editor_init),
+ src/hildon-login-dialog.c (hildon_login_dialog_init),
+ src/hildon-number-editor.c (hildon_number_editor_init),
+ src/hildon-find-toolbar.c (hildon_find_toolbar_emit_invalid_input,
+ hildon_find_toolbar_emit_close, hildon_find_toolbar_init): made all
+ the Maemo GTK+ specific API optional by adding a --with-maemo-gtk
+ configure option and adding the respective checks in the code.
+ * src/hildon-calendar.c (hildon_calendar_paint_week_numbers,
+ hildon_calendar_drag_data_received): fixed some build warnings.
+
2007-03-29 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
* debian/changelog: A 1.0.0 release notes.
AC_MSG_NOTICE(Will not build examples )
fi
+# use maemo gtk+ specific api (or not)
+AC_ARG_WITH(maemo-gtk,
+ AC_HELP_STRING([--with-maemo-gtk], [Use Maemo GTK+ API]),
+ [
+ case "${withval}" in
+ yes) USE_MAEMO_GTK=yes ;;
+ no) USE_MAEMO_GTK=no ;;
+ *) AC_MSG_ERROR(bad value ${withval} for --with-maemo-gtk) ;;
+ esac],
+ [USE_MAEMO_GTK=yes])
+
+AM_CONDITIONAL(USE_MAEMO_GTK, test "x$USE_MAEMO_GTK" = "xyes")
+
+# just print out our status
+if test x$USE_MAEMO_GTK = xyes; then
+ AC_MSG_NOTICE(Will use Maemo GTK+ specific API)
+ AC_DEFINE(MAEMO_GTK, [], [Whether to use Maemo GTK+ specific API])
+else
+ AC_MSG_NOTICE(Will not use Maemo GTK+ specific API)
+fi
+
# build with assertion checks (or not)
AC_ARG_WITH(asserts,
AC_HELP_STRING([--with-asserts], [Build with the assertion checks]),
{
HildonCalendar *calendar;
GdkGC *gc;
- gint row, week = 0, year;
+ guint row, week = 0, year;
gint x_loc;
char buffer[10];
gint y_loc;
* supposed to call drag_status, not actually paste in the
* data.
*/
- str = gtk_selection_data_get_text (selection_data);
+ str = (gchar *) gtk_selection_data_get_text (selection_data);
if (str)
{
date = g_date_new ();
}
date = g_date_new ();
- str = gtk_selection_data_get_text (selection_data);
+ str = (gchar *) gtk_selection_data_get_text (selection_data);
if (str)
{
g_date_set_parse (date, str);
priv->m_entry = gtk_entry_new ();
priv->y_entry = gtk_entry_new ();
+#ifdef MAEMO_GTK
g_object_set (G_OBJECT(priv->d_entry), "hildon-input-mode",
HILDON_GTK_INPUT_MODE_NUMERIC, NULL);
g_object_set (G_OBJECT(priv->m_entry), "hildon-input-mode",
HILDON_GTK_INPUT_MODE_NUMERIC, NULL);
g_object_set (G_OBJECT(priv->y_entry), "hildon-input-mode",
HILDON_GTK_INPUT_MODE_NUMERIC, NULL);
+#endif
/* set entry look */
gtk_entry_set_width_chars (GTK_ENTRY (priv->d_entry), DAY_ENTRY_WIDTH);
hildon_find_toolbar_emit_close (GtkButton *button,
gpointer self);
+#ifdef MAEMO_GTK
static void
hildon_find_toolbar_emit_invalid_input (GtkEntry *entry,
GtkInvalidInputType type,
gpointer self);
+#endif
static void
hildon_find_toolbar_entry_activate (GtkWidget *widget,
hildon_find_toolbar_emit_close (GtkButton *button,
gpointer self)
{
+#ifdef MAEMO_GTK
HildonFindToolbarPrivate *priv = HILDON_FIND_TOOLBAR_GET_PRIVATE (self);
g_assert (priv);
{
hildon_gtk_im_context_hide (GTK_ENTRY (entry)->im_context);
}
+#endif
/* Clicked close button */
g_signal_emit_by_name (self, "close", NULL);
}
+#ifdef MAEMO_GTK
static void
hildon_find_toolbar_emit_invalid_input (GtkEntry *entry,
GtkInvalidInputType type,
if(type == GTK_INVALID_INPUT_MAX_CHARS_REACHED)
g_signal_emit_by_name (self, "invalid_input", NULL);
}
+#endif
static void
hildon_find_toolbar_entry_activate (GtkWidget *widget,
*
* Gets emitted when the maximum search prefix length is reached and
* user tries to type more.
- */
+ */
HildonFindToolbar_signal[INVALID_INPUT] =
g_signal_new(
"invalid_input", HILDON_TYPE_FIND_TOOLBAR,
/* ComboBoxEntry for search prefix string / history list */
priv->entry_combo_box = GTK_COMBO_BOX_ENTRY (gtk_combo_box_entry_new ());
+
+#ifdef MAEMO_GTK
g_signal_connect (hildon_find_toolbar_get_entry(priv),
"invalid_input",
G_CALLBACK(hildon_find_toolbar_emit_invalid_input), self);
+#endif
entry_combo_box_container = gtk_tool_item_new ();
static void
create_contents (HildonGetPasswordDialog *dialog);
+#ifdef MAEMO_GTK
static void
invalid_input (GtkWidget *widget,
GtkInvalidInputType reason,
gpointer unused);
+#endif
enum
{
break;
case PROP_NUMBERS_ONLY:
+#ifdef MAEMO_GTK
/* Set input mode for the password entry */
g_object_set(G_OBJECT (gtk_bin_get_child GTK_BIN ((priv->password_entry))),
"hildon-input-mode",
? HILDON_GTK_INPUT_MODE_NUMERIC
: HILDON_GTK_INPUT_MODE_FULL),
NULL);
+#endif
break;
case PROP_CAPTION_LABEL:
HildonGetPasswordDialogPrivate *priv;
const gchar *string;
gint max_length;
+#ifdef MAEMO_GTK
gint input_mode;
+#endif
priv = HILDON_GET_PASSWORD_DIALOG_GET_PRIVATE (dialog);
g_assert (priv);
break;
case PROP_NUMBERS_ONLY:
+#ifdef MAEMO_GTK
/* 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 (gtk_bin_get_child (GTK_BIN (priv->password_entry))),
"hildon-input-mode", &input_mode, NULL);
g_value_set_boolean (value,
(input_mode == HILDON_GTK_INPUT_MODE_NUMERIC));
+#else
+ g_value_set_boolean (value, FALSE);
+#endif
break;
case PROP_CAPTION_LABEL:
control = gtk_entry_new ();
gtk_entry_set_width_chars (GTK_ENTRY (control), 20);
+#ifdef MAEMO_GTK
g_object_set (control, "hildon-input-mode", HILDON_GTK_INPUT_MODE_FULL, NULL);
+#endif
gtk_entry_set_visibility (GTK_ENTRY(control), FALSE);
priv->password_entry = HILDON_CAPTION
* disconnected before connecting the new signal. Besides, this
* should go into the constructor */
+#ifdef MAEMO_GTK
/* Connect callback to show error banner if the limit is exceeded */
g_signal_connect (GTK_ENTRY
(gtk_bin_get_child
G_CALLBACK (invalid_input),
NULL
);
+#endif
}
+#ifdef MAEMO_GTK
/* Callback that gets called when maximum chars is reached in the entry */
static void
invalid_input (GtkWidget *widget,
hildon_banner_show_information (widget, NULL, _(HILDON_GET_PASSWORD_DIALOG_MAX_CHARS));
}
}
+#endif
/* Setup username entry */
priv->username_entry = GTK_ENTRY (gtk_entry_new ());
+
+#ifdef MAEMO_GTK
g_object_set (priv->username_entry, "hildon-input-mode", HILDON_GTK_INPUT_MODE_FULL, NULL);
+#endif
caption = HILDON_CAPTION (hildon_caption_new
(group,
/* Setup password entry */
priv->password_entry = GTK_ENTRY (gtk_entry_new ());
+
+#ifdef MAEMO_GTK
g_object_set (priv->password_entry, "hildon-input-mode", HILDON_GTK_INPUT_MODE_FULL, NULL);
+#endif
+
gtk_entry_set_visibility (GTK_ENTRY (priv->password_entry), FALSE);
caption = HILDON_CAPTION (hildon_caption_new (group,
G_CALLBACK (hildon_number_editor_button_released),
editor);
+#ifdef MAEMO_GTK
g_object_set (G_OBJECT (priv->num_entry),
"hildon-input-mode", HILDON_GTK_INPUT_MODE_NUMERIC, NULL);
+#endif
gtk_widget_show (priv->num_entry);
gtk_widget_show (priv->minus);
g_signal_connect (priv->end_entry, "changed",
G_CALLBACK (hildon_range_editor_entry_changed), editor);
+#ifdef MAEMO_GTK
g_object_set (G_OBJECT (priv->start_entry),
"hildon-input-mode", HILDON_GTK_INPUT_MODE_NUMERIC, NULL);
g_object_set( G_OBJECT (priv->end_entry),
"hildon-input-mode", HILDON_GTK_INPUT_MODE_NUMERIC, NULL);
+#endif
gtk_widget_show (priv->start_entry);
gtk_widget_show (priv->end_entry);
{
g_return_val_if_fail (HILDON_IS_SEEKBAR (seekbar), 0);
+#ifdef MAEMO_GTK
return gtk_range_get_fill_level (GTK_RANGE (seekbar));
+#else
+ return 0;
+#endif
}
/**
fraction = CLAMP (fraction, range->adjustment->lower,
range->adjustment->upper);
+#ifdef MAEMO_GTK
/* Update stream position of range widget */
gtk_range_set_fill_level (range, fraction);
+#endif
if (fraction < hildon_seekbar_get_position(seekbar))
hildon_seekbar_set_position(seekbar, fraction);
value = floor (adj->value);
if (time != value) {
value = (time < adj->upper) ? time : adj->upper;
+
+#ifdef MAEMO_GTK
if (value <= gtk_range_get_fill_level (range)) {
+#else
+ if (value) {
+#endif
adj->value = value;
gtk_adjustment_value_changed (adj);
/* Create the password field */
priv->pwd1st_entry = gtk_entry_new ();
+
+#ifdef MAEMO_GTK
g_object_set (priv->pwd1st_entry, "hildon-input-mode", HILDON_GTK_INPUT_MODE_FULL, NULL);
+#endif
+
gtk_entry_set_visibility (GTK_ENTRY(priv->pwd1st_entry), FALSE);
gtk_widget_show (priv->pwd1st_entry);
priv->pwd1st_caption = hildon_caption_new (group,
/* Create the password verify field */
priv->pwd2nd_entry = gtk_entry_new();
+
+#ifdef MAEMO_GTK
g_object_set (priv->pwd2nd_entry, "hildon-input-mode", HILDON_GTK_INPUT_MODE_FULL, NULL);
+#endif
+
gtk_widget_show (priv->pwd2nd_entry);
priv->pwd2nd_caption = hildon_caption_new (group,
priv->pwd2nd_caption_string,
static gboolean
hildon_time_editor_check_locale (HildonTimeEditor *editor);
+#ifdef MAEMO_GTK
static void
hildon_time_editor_tap_and_hold_setup (GtkWidget *widget,
GtkWidget *menu,
GtkCallback func,
GtkWidgetTapAndHoldFlags flags);
+#endif
+
static void
hildon_time_editor_validate (HildonTimeEditor *editor,
gboolean allow_intermediate);
object_class->set_property = hildon_time_editor_set_property;
widget_class->size_request = hildon_time_editor_size_request;
widget_class->size_allocate = hildon_time_editor_size_allocate;
+#ifdef MAEMO_GTK
widget_class->tap_and_hold_setup = hildon_time_editor_tap_and_hold_setup;
+#endif
widget_class->focus = hildon_private_composite_focus;
container_class->forall = hildon_time_editor_forall;
G_PARAM_READABLE | G_PARAM_WRITABLE) );
}
+#ifdef MAEMO_GTK
static void
hildon_time_editor_tap_and_hold_setup (GtkWidget *widget,
GtkWidget *menu,
gtk_widget_tap_and_hold_setup (priv->iconbutton, menu, func,
GTK_TAP_AND_HOLD_NONE);
}
+#endif
static void
hildon_time_editor_entry_changed (GtkWidget *widget,
/* No frames for entries, so that they all appear to be inside one long entry */
gtk_entry_set_has_frame (GTK_ENTRY (priv->entries[i]), FALSE);
+#ifdef MAEMO_GTK
/* Set the entries to accept only numeric characters */
g_object_set (priv->entries[i], "hildon-input-mode", HILDON_GTK_INPUT_MODE_NUMERIC, NULL);
+#endif
/* The entry fields all take exactly two characters */
gtk_entry_set_max_length (GTK_ENTRY (priv->entries[i]), 2);