--- /dev/null
+Maintainer:
+ Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+Previous maintainers:
+ Luc Pionchon <luc.pionchon@nokia.com>
+2006-08-30 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [Merging 0.13.1 => TRUNK]
+
+ * ./: Merging the experimental color selector branch. Fixes: #NB37010,
+ #NB38559, #33217, #NB37172.
+ Maintainer change:
+ Michael Dominic Kostrzewa
+ <michael.kostrzewa@nokia.com>
+
+ * configure.ac: Bumping the version number to 0.14.0.
+
+2006-08-30 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * ./: Cosmetics.
+
+2006-08-30 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * AUTHORS: Adding an AUTHORS file with maintainer/contact information.
+
+ * debian/control:
+ * debian/copyright:
+ * hildon-widgets-plugins/hildon-color-chooser-dialog-hsv.c:
+ * hildon-widgets-plugins/hildon-color-chooser-hsv.c:
+ * hildon-widgets/gtk-infoprint.c:
+ * hildon-widgets/gtk-infoprint.h:
+ * hildon-widgets/hildon-add-home-dialog.c:
+ * hildon-widgets/hildon-add-home-dialog.h:
+ * hildon-widgets/hildon-app-private.h:
+ * hildon-widgets/hildon-app.c:
+ * hildon-widgets/hildon-app.h:
+ * hildon-widgets/hildon-appview.c:
+ * hildon-widgets/hildon-appview.h:
+ * hildon-widgets/hildon-banner.c:
+ * hildon-widgets/hildon-banner.h:
+ * hildon-widgets/hildon-calendar-popup.c:
+ * hildon-widgets/hildon-calendar-popup.h:
+ * hildon-widgets/hildon-caption.c:
+ * hildon-widgets/hildon-caption.h:
+ * hildon-widgets/hildon-code-dialog.c:
+ * hildon-widgets/hildon-code-dialog.h:
+ * hildon-widgets/hildon-color-button.c:
+ * hildon-widgets/hildon-color-button.h:
+ * hildon-widgets/hildon-color-chooser-button.c:
+ * hildon-widgets/hildon-color-chooser-button.h:
+ * hildon-widgets/hildon-color-chooser-dialog.c:
+ * hildon-widgets/hildon-color-chooser-dialog.h:
+ * hildon-widgets/hildon-color-chooser.c:
+ * hildon-widgets/hildon-color-chooser.h:
+ * hildon-widgets/hildon-color-popup.c:
+ * hildon-widgets/hildon-color-popup.h:
+ * hildon-widgets/hildon-color-selector.c:
+ * hildon-widgets/hildon-color-selector.h:
+ * hildon-widgets/hildon-composite-widget.c:
+ * hildon-widgets/hildon-composite-widget.h:
+ * hildon-widgets/hildon-controlbar.c:
+ * hildon-widgets/hildon-controlbar.h:
+ * hildon-widgets/hildon-date-editor.c:
+ * hildon-widgets/hildon-date-editor.h:
+ * hildon-widgets/hildon-defines.c:
+ * hildon-widgets/hildon-defines.h:
+ * hildon-widgets/hildon-dialoghelp.c:
+ * hildon-widgets/hildon-dialoghelp.h:
+ * hildon-widgets/hildon-file-handling-note.c:
+ * hildon-widgets/hildon-file-handling-note.h:
+ * hildon-widgets/hildon-find-toolbar.c:
+ * hildon-widgets/hildon-find-toolbar.h:
+ * hildon-widgets/hildon-font-selection-dialog.c:
+ * hildon-widgets/hildon-font-selection-dialog.h:
+ * hildon-widgets/hildon-get-password-dialog.c:
+ * hildon-widgets/hildon-get-password-dialog.h:
+ * hildon-widgets/hildon-grid-item-private.h:
+ * hildon-widgets/hildon-grid-item.c:
+ * hildon-widgets/hildon-grid-item.h:
+ * hildon-widgets/hildon-grid.c:
+ * hildon-widgets/hildon-grid.h:
+ * hildon-widgets/hildon-hvolumebar.c:
+ * hildon-widgets/hildon-hvolumebar.h:
+ * hildon-widgets/hildon-input-mode-hint.h:
+ * hildon-widgets/hildon-name-password-dialog.c:
+ * hildon-widgets/hildon-name-password-dialog.h:
+ * hildon-widgets/hildon-note.c:
+ * hildon-widgets/hildon-note.h:
+ * hildon-widgets/hildon-number-editor.c:
+ * hildon-widgets/hildon-number-editor.h:
+ * hildon-widgets/hildon-plugin-widget.c:
+ * hildon-widgets/hildon-plugin-widget.h:
+ * hildon-widgets/hildon-private.h:
+ * hildon-widgets/hildon-program.c:
+ * hildon-widgets/hildon-program.h:
+ * hildon-widgets/hildon-range-editor.c:
+ * hildon-widgets/hildon-range-editor.h:
+ * hildon-widgets/hildon-scroll-area.c:
+ * hildon-widgets/hildon-scroll-area.h:
+ * hildon-widgets/hildon-seekbar.c:
+ * hildon-widgets/hildon-seekbar.h:
+ * hildon-widgets/hildon-set-password-dialog.c:
+ * hildon-widgets/hildon-set-password-dialog.h:
+ * hildon-widgets/hildon-sort-dialog.c:
+ * hildon-widgets/hildon-sort-dialog.h:
+ * hildon-widgets/hildon-system-sound.c:
+ * hildon-widgets/hildon-system-sound.h:
+ * hildon-widgets/hildon-telephone-editor.c:
+ * hildon-widgets/hildon-telephone-editor.h:
+ * hildon-widgets/hildon-time-editor.c:
+ * hildon-widgets/hildon-time-editor.h:
+ * hildon-widgets/hildon-time-picker.c:
+ * hildon-widgets/hildon-time-picker.h:
+ * hildon-widgets/hildon-volumebar-private.h:
+ * hildon-widgets/hildon-volumebar-range.c:
+ * hildon-widgets/hildon-volumebar-range.h:
+ * hildon-widgets/hildon-volumebar.c:
+ * hildon-widgets/hildon-volumebar.h:
+ * hildon-widgets/hildon-vvolumebar.c:
+ * hildon-widgets/hildon-vvolumebar.h:
+ * hildon-widgets/hildon-weekday-picker.c:
+ * hildon-widgets/hildon-weekday-picker.h:
+ * hildon-widgets/hildon-window-private.h:
+ * hildon-widgets/hildon-window.c:
+ * hildon-widgets/hildon-window.h:
+ * hildon-widgets/hildon-wizard-dialog.c:
+ * hildon-widgets/hildon-wizard-dialog.h:
+ * timer/timer.c:
+ * timer/timer.h:
+ * ut/hildon-clock-widgets_tests.c:
+ * ut/hildon-widgets_tests.c:
+ * ut/tc_banner_truncate.c: Adding myself as the contact
+ person/maintainer. FIxing copyright notices to include 2006 as new things
+ were added this year.
+
+2006-08-30 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets/hildon-app.h:
+ * hildon-widgets/hildon-defines.h: Undoing the Johan's new
+ key-handling changes from 2006-08-10. That requires a fix at a
+ different level, waiting for Daniel Stone.
+
+2006-08-30 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * debian==/changelog: Adding some missing entries about bugs being
+ fixed.
+
+ * debian/copyright: Adding information about the license version of
+ the package.
+
+2006-08-29 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets/hildon-window.c: Properly ref the attached menus,
+ allow NULL to be passed to the attach function to remove the existing
+ menu. Fixes NB#32845.
+
+2006-08-29 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * debian/control: Removing unnecessary manual dependencies, fixes
+ NB#34225.
+
+2006-08-29 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets-plugins/Makefile.am:
+ * hildon-widgets-plugins/hildon-color-chooser-dialog_hsv.c:
+ * hildon-widgets-plugins/hildon-color-chooser_hsv.c:
+ * hildon-widgets-plugins/hildoncolorchooser_hsv.c:
+ * hildon-widgets-plugins/hildoncolorchooserdialog_hsv.c: Removing
+ left overs from the old color selector code, making the file names
+ more sane.
+
+2006-08-29 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets-plugins/hildon-color-chooser-dialog_hsv.c:
+ * hildon-widgets-plugins/hildon-color-chooser_hsv.c:
+ * hildon-widgets-plugins/hildoncolorchooser_hsv.c:
+ * hildon-widgets/gtk-infoprint.c:
+ * hildon-widgets/gtk-infoprint.h:
+ * hildon-widgets/hildon-add-home-dialog.c:
+ * hildon-widgets/hildon-add-home-dialog.h:
+ * hildon-widgets/hildon-app-private.h:
+ * hildon-widgets/hildon-app.c:
+ * hildon-widgets/hildon-app.h:
+ * hildon-widgets/hildon-appview.c:
+ * hildon-widgets/hildon-appview.h:
+ * hildon-widgets/hildon-banner.c:
+ * hildon-widgets/hildon-banner.h:
+ * hildon-widgets/hildon-calendar-popup.c:
+ * hildon-widgets/hildon-calendar-popup.h:
+ * hildon-widgets/hildon-caption.c:
+ * hildon-widgets/hildon-caption.h:
+ * hildon-widgets/hildon-code-dialog.c:
+ * hildon-widgets/hildon-code-dialog.h:
+ * hildon-widgets/hildon-color-button.c:
+ * hildon-widgets/hildon-color-button.h:
+ * hildon-widgets/hildon-color-chooser-button.c:
+ * hildon-widgets/hildon-color-chooser-button.h:
+ * hildon-widgets/hildon-color-chooser-dialog.c:
+ * hildon-widgets/hildon-color-chooser-dialog.h:
+ * hildon-widgets/hildon-color-chooser.h:
+ * hildon-widgets/hildon-color-popup.c:
+ * hildon-widgets/hildon-color-popup.h:
+ * hildon-widgets/hildon-color-selector.c:
+ * hildon-widgets/hildon-color-selector.h:
+ * hildon-widgets/hildon-composite-widget.c:
+ * hildon-widgets/hildon-composite-widget.h:
+ * hildon-widgets/hildon-controlbar.c:
+ * hildon-widgets/hildon-controlbar.h:
+ * hildon-widgets/hildon-date-editor.c:
+ * hildon-widgets/hildon-date-editor.h:
+ * hildon-widgets/hildon-defines.c:
+ * hildon-widgets/hildon-defines.h:
+ * hildon-widgets/hildon-dialoghelp.c:
+ * hildon-widgets/hildon-dialoghelp.h:
+ * hildon-widgets/hildon-file-handling-note.c:
+ * hildon-widgets/hildon-file-handling-note.h:
+ * hildon-widgets/hildon-find-toolbar.c:
+ * hildon-widgets/hildon-find-toolbar.h:
+ * hildon-widgets/hildon-font-selection-dialog.c:
+ * hildon-widgets/hildon-font-selection-dialog.h:
+ * hildon-widgets/hildon-get-password-dialog.c:
+ * hildon-widgets/hildon-get-password-dialog.h:
+ * hildon-widgets/hildon-grid-item-private.h:
+ * hildon-widgets/hildon-grid-item.c:
+ * hildon-widgets/hildon-grid-item.h:
+ * hildon-widgets/hildon-grid.c:
+ * hildon-widgets/hildon-grid.h:
+ * hildon-widgets/hildon-hvolumebar.c:
+ * hildon-widgets/hildon-hvolumebar.h:
+ * hildon-widgets/hildon-input-mode-hint.h:
+ * hildon-widgets/hildon-name-password-dialog.c:
+ * hildon-widgets/hildon-name-password-dialog.h:
+ * hildon-widgets/hildon-note.c:
+ * hildon-widgets/hildon-note.h:
+ * hildon-widgets/hildon-number-editor.c:
+ * hildon-widgets/hildon-number-editor.h:
+ * hildon-widgets/hildon-plugin-widget.c:
+ * hildon-widgets/hildon-private.h:
+ * hildon-widgets/hildon-program.c:
+ * hildon-widgets/hildon-program.h:
+ * hildon-widgets/hildon-range-editor.c:
+ * hildon-widgets/hildon-range-editor.h:
+ * hildon-widgets/hildon-scroll-area.c:
+ * hildon-widgets/hildon-scroll-area.h:
+ * hildon-widgets/hildon-seekbar.c:
+ * hildon-widgets/hildon-seekbar.h:
+ * hildon-widgets/hildon-set-password-dialog.c:
+ * hildon-widgets/hildon-set-password-dialog.h:
+ * hildon-widgets/hildon-sort-dialog.c:
+ * hildon-widgets/hildon-sort-dialog.h:
+ * hildon-widgets/hildon-system-sound.c:
+ * hildon-widgets/hildon-system-sound.h:
+ * hildon-widgets/hildon-telephone-editor.c:
+ * hildon-widgets/hildon-telephone-editor.h:
+ * hildon-widgets/hildon-time-editor.c:
+ * hildon-widgets/hildon-time-editor.h:
+ * hildon-widgets/hildon-time-picker.c:
+ * hildon-widgets/hildon-time-picker.h:
+ * hildon-widgets/hildon-volumebar-private.h:
+ * hildon-widgets/hildon-volumebar-range.c:
+ * hildon-widgets/hildon-volumebar-range.h:
+ * hildon-widgets/hildon-volumebar.c:
+ * hildon-widgets/hildon-volumebar.h:
+ * hildon-widgets/hildon-vvolumebar.c:
+ * hildon-widgets/hildon-vvolumebar.h:
+ * hildon-widgets/hildon-weekday-picker.c:
+ * hildon-widgets/hildon-weekday-picker.h:
+ * hildon-widgets/hildon-window-private.h:
+ * hildon-widgets/hildon-window.c:
+ * hildon-widgets/hildon-window.h:
+ * hildon-widgets/hildon-wizard-dialog.c:
+ * hildon-widgets/hildon-wizard-dialog.h:
+ * timer/timer.c:
+ * timer/timer.h:
+ * ut/hildon-clock-widgets_tests.c:
+ * ut/hildon-widgets_tests.c:
+ * ut/tc_banner_truncate.c: Fixing the license banners (adding them
+ if missing, correcting "... version 2 or any later version" to "version
+ 2."
+
+2006-08-29 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets/hildon-window.c: Put extra ref on the GdkWindow
+ before emitting the signal so that we don't lose it in event free
+ function. Fixes NB#38996.
+
+2006-08-28 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * configure.ac: Bumping the version number to 0.13.1.6.
+
+ * hildon-widgets-plugins/Makefile.am: Adding the proper symlinks for
+ default plugin targets during installation. Fixes a crasher bug in the
+ selector.
+
+ * hildon-widgets/hildon-color-button.c:
+ * hildon-widgets/hildon-color-chooser-dialog.c:
+ * hildon-widgets/hildon-plugin-widget.c: Adding some basic sanity checks.
+
+2006-08-24 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * ./: Merging with the 0.13.1-1_pluged-in-color-selector branch.
+
+2006-08-24 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets/hildon-number-editor.c: When a range error occurs,
+ set the correct value before calling the range-error signal, so that
+ the widget consumer has a chance to actually adjust the value to it's
+ liking in the signal. Fixes NB#33260.
+
+2006-08-24 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets/hildon-wizard-dialog.c: Fixing a small compilation
+ whoops.
+
+2006-08-24 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets/hildon-time-picker.c: Fixing
+ NB#37489.
+
+2006-08-23 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets/hildon-wizard-dialog.c:
+ * hildon-widgets/hildon-wizard-dialog.h: Cleaning up, fixing some
+ bugs.
+
+2006-08-22 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets/hildon-add-home-dialog.h:
+ * hildon-widgets/hildon-app.h:
+ * hildon-widgets/hildon-appview.h:
+ * hildon-widgets/hildon-calendar-popup.h:
+ * hildon-widgets/hildon-code-dialog.h:
+ * hildon-widgets/hildon-color-button.h:
+ * hildon-widgets/hildon-color-selector.h:
+ * hildon-widgets/hildon-controlbar.h:
+ * hildon-widgets/hildon-date-editor.h:
+ * hildon-widgets/hildon-file-handling-note.h:
+ * hildon-widgets/hildon-find-toolbar.h:
+ * hildon-widgets/hildon-grid-item-private.h:
+ * hildon-widgets/hildon-grid-item.h:
+ * hildon-widgets/hildon-grid.h:
+ * hildon-widgets/hildon-input-mode-hint.h:
+ * hildon-widgets/hildon-marshalers.h:
+ * hildon-widgets/hildon-name-password-dialog.h:
+ * hildon-widgets/hildon-private.h:
+ * hildon-widgets/hildon-program.h:
+ * hildon-widgets/hildon-range-editor.h:
+ * hildon-widgets/hildon-scroll-area.h:
+ * hildon-widgets/hildon-seekbar.h:
+ * hildon-widgets/hildon-sort-dialog.h:
+ * hildon-widgets/hildon-telephone-editor.h:
+ * hildon-widgets/hildon-time-picker.h:
+ * hildon-widgets/hildon-weekday-picker.h:
+ * hildon-widgets/hildon-window-private.h:
+ * hildon-widgets/hildon-window.h:
+ * hildon-widgets/hildon-wizard-dialog.h:
+ * timer/timer.h: Just cosmetic cleanups in defines for consistency.
+
+ * COPYING: Removing the executable bit from the text file.
+
+2006-08-22 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+
+ [0.13.1 branch]
+
+ * Makefile.am:
+ * doc/Makefile.am:
+ * hildon-widgets-plugins/Makefile.am:
+ * hildon-widgets/Makefile.am:
+ * po/Makefile.am:
+ * timer/Makefile.am:
+ * ut/Makefile.am: Fixing the build system so that `make
+ maintainer-clean` can be used safely.
+
+2006-08-22 Kuisma Salonen <kuisma.salonen@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets-plugins/hildoncolorchooser_hsv.c:
+ Grayscale dimming re-enabled.
+
+2006-08-16 Johan Bilien <johan.bilien@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets/hildon-app.c:
+ (hildon_app_switch_to_desktop): Removed unused function
+ (hildon_app_key_snooper): Removed handling of the Home hardware key
+
+ NB#35076
+
+ * configure.ac: 0.13.1.4
+
+2006-08-11 Fernando Herrera <fernando.herrera-de-las-heras@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets/hildon-plugin-widget.c
+ (ascii_decapitalize_without_dashes): Fixed.
+
+2006-08-10 Johan Bilien <johan.bilien@nokia.com>
+
+ [0.13.1 branch]
+
+ * hildon-widgets/hildon-{app.h,defines.h}:
+ switched HILDON_MENU_KEY to now match GDK_F10
+ WARNING: This breaks compatibility with IT-2006
+
+ * configure.ac: 0.13.1.3
+
+2006-08-08 Luc Pionchon <luc.pionchon@nokia.com>
+
+ [0.13.1 branch]
+
+ * configure.ac: 0.13.1.2
+
2006-08-07 Johan Bilien <johan.bilien@nokia.com>
* hildon-widgets/hildon-program.c
NB#22808
-
2006-08-01 Luc Pionchon <luc.pionchon@nokia.com>
* configure.ac: 0.12.22
-
2006-07-31 Johan Bilien <johan.bilien@nokia.com>
* hildon-widgets/hildon-code-dialog.c
NB#36309
+2006-07-26 Kuisma Salonen <kuisma.salonen@nokia.com>
+
+ [0.13.1 branch]
+
+ Added plugged-in color chooser,
+
+ -- Plugin infrastructure:
+
+ * hildon-widgets/hildon-plugin-widget.[ch]: API to help loading
+ widgets from plugins.
+
+ * hildon-widgets-plugins/: directory containing widget
+ implementations which are going to be built into separate shared
+ object files (plugins)
+
+ * hildon-widgets-plugins/Makefile.am: automake file for the plugins.
+
+ * doc/design/abstract_vs_modular_plugin_widgets.dia:
+ * doc/design/hildon-plugin-widget.txt: design doc
+
+
+ -- ColorChooser plugin:
+
+ * hildon-widgets-plugins/hildoncolorchooser_hsv.c: Implementation of a
+ HildonColorChooser, HSV based one.
+
+ * hildon-widgets-plugins/hildoncolorchooserdialog_hsv.c: HSV based
+ implementation of color chooser dialog.
+
+
+ -- Uses the plugin infrastructure:
+
+ * hildon-widgets/hildon-color-chooser.[ch] : An abstract class for
+ color chooser widget. The _new function utilizes plugin widget
+ helper functions to initialize the widget.
+
+ * hildon-widgets/hildon-color-chooser-dialog.[ch] : Same as color
+ chooser, but a dialog widget to choose a color.
+
+ * hildon-widgets/hildon-color-button.c: HildonColorButton uses now
+ HildonColorChooserDialog instead of HildonColorSelector.
+
2006-07-25 Fernando Herrera <fernando.herrera-de-las-heras@nokia.com>
* configure.ac: 0.12.21
NB#34340
-
2006-07-18 Fernando Herrera <fernando.herrera-de-las-heras@nokia.com>
* hildon-widgets/hildon-number-editor.c:
2006-06-13 Luc Pionchon <luc.pionchon@nokia.com>
- * configure.ac: 0.12.20
+ [0.13.1 branch]
+
+ * configure.ac: 0.13.1.1
+
+2006-06-13 Luc Pionchon <luc.pionchon@nokia.com>
+
+ [0.13.1 branch]
+ * added experimental plugged-in color selector
+
+2006-06-13 Luc Pionchon <luc.pionchon@nokia.com>
+
+ * configure.ac: 0.12.20
2006-06-12 Luc Pionchon <luc.pionchon@nokia.com>
NB#32302
-
2006-06-12 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-banner.c:
NB#31256
-
2006-06-05 Luc Pionchon <luc.pionchon@nokia.com>
* configure.ac: 0.12.19
-
2006-06-05 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-color-button.c
NB#31604
-
2006-06-05 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-time-editor.c
NB#30937
-
2006-06-05 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-grid.c (hildon_grid_class_init): do not
NB#29888 / M#483
-
2006-06-05 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-window.c
NB#28836
-
2006-06-02 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-app.c (hildon_app_key_snooper): Add code
NB#26383 (bis)
-
2006-06-02 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-time-editor.c
function, now that situation is imposible. It was causing the
interlock.
-
2006-05-31 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-banner.c
2006-05-30 Luc Pionchon <luc.pionchon@nokia.com>
+ [0.13.1 branch]
+
+ * configure.ac: 0.13.1 unstable branch
+
+2006-05-30 Luc Pionchon <luc.pionchon@nokia.com>
+
* hildon-libs.pc.in (Description): updated description
2006-05-29 Luc Pionchon <luc.pionchon@nokia.com>
NB#26383
-
2006-05-29 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-banner.c
(hildon_banner_check_position): Added cast to widget argument in
call to force_to_wrap_truncated in order to avoid a compilation
warning.
-
2006-05-29 Luc Pionchon <luc.pionchon@nokia.com>
- Added time-error signal - NB#22155
+ Added time-error signal - NB#22155
* hildon-widgets/hildon-time-editor.c:
(hildon_time_editor_class_init): added time-error signal
* hildon-widgets/Makefile.am (hildon-libs-enum-types.c): added time-editor.h
-
2006-05-23 Luc Pionchon <luc.pionchon@nokia.com>
* configure.ac: 0.12.17
* doc/Makefile.am: likewise
* ut/Makefile.am: likewise
-
2006-05-21 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/gtk-infoprint.c
(gtk_confirmation_banner_with_icon_name):
added bold markup for backward compatibility. NB#28370 (bis)
-
2006-05-21 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-grid.c (get_child_index_by_coord): returns
if empty grid. NB#29883
-
2006-05-21 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/gtk-intoprint.c (find_banner_for_parent): Added
check for "is-timed" property. NB#26546
-
2006-05-21 Johan Bilien <johan.bilien@nokia.com>
* hildon-widgets/hildon-window.c
* hildon-widgets/gtk-infoprint.c (gtk_confirmation_banner): added
bold markup for backward compatibility. NB#28370
-
2006-05-15 Luc Pionchon <luc.pionchon@nokia.com>
* configure.ac: 0.12.15
-
2006-05-15 Johan Bilien <johan.bilien@nokia.com>
* hildon-widgets/hildon-window.[ch]:
* doc/hildon-libs-docs.sgml: added index for 0.12.0 new symbols
-
2006-05-10 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-time-editor.c:
(hildon_caption_expose): allocation, subtract the left margin
which we have added to the children widgets when we paint the
selection box.
-
+
NB#28483
3006-05-10 Tapani Palli <tapani.palli@nokia.com>
N#28654
-
2006-05-09 Marius Vollmer <marius.vollmer@nokia.com>
* hildon-widgets/hildon-find-toolbar.c
* doc/Makefile.am: really "include". "-include" is not followed by
automake, as a result gtk-doc.make would not be processed.
-
2006-05-03 Luc Pionchon <luc.pionchon@nokia.com>
N#27000 (additional fixes to patch from 2006-05-01)
Force label size also when width_text == width_max.
-
2006-05-03 Luc Pionchon <luc.pionchon@nokia.com>
* configure.ac: 0.12.13
-
2006-05-03 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-font-selection-dialog.c:
(hildon_font_selection_dialog_show_available_fonts): call filter_out_internal_fonts
Fixes N#21854
-
2006-05-01 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-libs/hildon-widgets/hildon-time-editor.c
* hildon-libs/hildon-widgets/hildon-time-picker.c
- * hildon-libs/hildon-widgets/hildon-wizard-dialog.h
+ * hildon-libs/hildon-widgets/hildon-wizard-dialog.h:
added comments to anonymous enums
-
2006-05-01 Luc Pionchon <luc.pionchon@nokia.com>
Hildon banner truncations,
* ut/tc_banner_truncate.c: new file. Test cases for banner truncations.
-
2006-05-01 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-banner.[ch]: code cleanup.
-
2006-04-29 Johan Bilien <johan.bilien@nokia.com>
* hildon-widgets/hildon-window.c:
AM/PM symbols. Use the string as it is given by the locale. Makes
it coherent with hildon time picker. Fixes N#27963
-
2006-04-26 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-set-password-dialog.c
* hildon-widgets/hildon-set-password-dialog.h: indent cleanup
-
2006-04-26 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-file-handling-note.c (gettext macro): use
2006-04-24 Marius Vollmer <marius.vollmer@nokia.com>
- From Murray Cumming <murrayc@murrayc.com>, M#183.
+ From Murray Cumming <murrayc@murrayc.com>, M#183.
* hildon-widgets/hildon-calendar-popup.c:
(hildon_calendar_popup_new): Use only g_object_new(), passing
* configure.ac: 0.12.11
-
2006-04-19 Tapani Palli <tapani.palli@nokia.com>
* thread safety (N#24348), fixed timeout and idle callbacks :
2006-04-17 Luc Pionchon <luc.pionchon@nokia.com>
* doc/hildon-libs-docs.sgml: added index for new symbols.
-
2006-04-17 Luc Pionchon <luc.pionchon@nokia.com>
* doc/Makefile.am (version.xml): generates version.xml
* doc/hildon-libs-docs.sgml: added &version; entity, and display
the version number in the doc title.
-
2006-04-17 Luc Pionchon <luc.pionchon@nokia.com>
* gtk-infoprint.c
* hildon-date-editor.h
-
2006-04-16 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-time-editor.c
(hildon_time_editor_set_show_hours)
(hildon_time_editor_get_show_hours): added gtk-doc tag 'Since:'
-
2006-04-15 Luc Pionchon <luc.pionchon@nokia.com>
N#22557
2.6.10-1.osso4, instead of GTK private symbol
_gtk_button_set_depressed
-
2006-04-15 Marius Vollmer <marius.vollmer@nokia.com>
From Murray Cummings (M#185 M#283), with slight changes:
(hildon_number_editor_class_init):
"range_error".
-
2006-04-13 Luc Pionchon <luc.pionchon@nokia.com>
M#90 - Use standard GLib macro names.
* hildon-widgets/hildon-volumebar-range.c:
* hildon-widgets/hildon-weekday-picker.c:
-
2006-04-13 Johan Bilien <johan.bilien@nokia.com>
* hildon-widgets/hildon-code-dialog.c: Fixed L10n logical ids
* hildon-widgets/hildon-time-editor.c
(convert_to_12h): removed m and s paramters (useless)
(convert_to_24h): likewise.
-
2006-04-13 Luc Pionchon <luc.pionchon@nokia.com>
(hildon_time_editor_inserted_text): new function.
On inserted text, if entry has two digits, jumps to the next field.
-
2006-04-13 Luc Pionchon <luc.pionchon@nokia.com>
Pops up the color selector on 'select' hardkey (IMP-15)
(hildon_color_button_key_released): new function.
Pops up the color selector on 'select' hardkey release
-
2006-04-13 Luc Pionchon <luc.pionchon@nokia.com>
Hildon grid, set items to be focus-and-activate instead of single
2006-04-07 Tomas Junnonen <tomas.junnonen@nokia.com>
- - Added support for Pango markup
+ - Added support for Pango markup
Added hildon_banner_show_information_with_markup
- - Removed hildon_banner_show_confirmation
- - Re-position the banner when its content changes
- - Banner now doesn't truncate strings nor insert linebreaks
+ - Removed hildon_banner_show_confirmation
+ - Re-position the banner when its content changes
+ - Banner now doesn't truncate strings nor insert linebreaks
- fixes N#24339 - Information banners do not resize
* hildon-widgets/hildon-banner.[ch]
2006-03-01 Luc Pionchon <luc.pionchon@nokia.com>
- Cleanup name-password dialog:
+ Cleanup name-password dialog:
* hildon-widgets/hildon-name-password-dialog.[ch]
duplicated code replaced with calls to relevant public functions
(hildon_name_password_dialog_init): fixed leaking group variable;
- reworked to have captions as local variables and captioned entries
- in the private struct
+ reworked to have captions as local variables and captioned entries
+ in the private struct
(hildon_name_password_dialog_new_with_default): name and password
arguments declared const
(hildon_name_password_dialog_set_domain): domain argument declared
const; type check added + cleanup
-
2006-03-01 Luc Pionchon <luc.pionchon@nokia.com>
Cleanup get-password dialog:
(hildon_get_password_dialog_set_max_characters): broken type check fixed
(_invalid_input): gpointer data argument renamed unused
-
2006-02-28 Luc Pionchon <luc.pionchon@nokia.com>
(*_get_type): declared G_GNUC_CONST
2006-02-28 Luc Pionchon <luc.pionchon@nokia.com>
- Volume bars cleanup
+ Volume bars cleanup
* hildon-widgets/hildon-volumebar.c
(hildon_volumebar_class_init): object class casts cleaned up
* hildon-widgets/hildon-vvolumebar.h
(hildon_vvolumebar_get_type): declared G_GNUC_CONST
-
2006-02-28 Luc Pionchon <luc.pionchon@nokia.com>
* hildon-widgets/hildon-weekday-picker.c
(_HildonWeekdayPickerPrivate): Removed members: dayorder, days,
last_index; added day_order_buttons
- (hildon_weekday_picker_mnemonic_activate): removed.
- mnemonics are no longer used.
+ * (hildon_weekday_picker_mnemonic_activate): removed.
+ mnemonics are no longer used.
- (hildon_weekday_picker_class_init): Removed mnemonic_activate
+ * (hildon_weekday_picker_class_init): Removed mnemonic_activate
function. Rewritten creation of buttons. Unref'ed size group.
- (button_toggle): Removed bit mask checking, simplified function
+ * (button_toggle): Removed bit mask checking, simplified function
- (hildon_weekday_picker_set_day):
- (hildon_weekday_picker_unset_day): Removed bit mask checking, date
- adjustment, unecessary for loop
+ * (hildon_weekday_picker_set_day):
+ * (hildon_weekday_picker_unset_day): Removed bit mask checking, date
+ adjustment, unecessary for loop
- (hildon_weekday_picker_toggle_day): Removed date adjustment and
+ * (hildon_weekday_picker_toggle_day): Removed date adjustment and
unecessary for loop. Simplified button toggling
- (hildon_weekday_picker_set_all):
- (hildon_weekday_picker_unset_all): Removed bit mask checking and
- simplified for loop
+ * (hildon_weekday_picker_set_all):
+ * (hildon_weekday_picker_unset_all): Removed bit mask checking and
+ simplified for loop
(hildon_weekday_picker_isset_day): Removed date adjustment and
- unecessary for loop;
+ unecessary for loop;
2006-02-21 Luc Pionchon <luc.pionchon@nokia.com>
- Added hildon-banner, as a clean replacement for gtk-infoprint
+ Added hildon-banner, as a clean replacement for gtk-infoprint
* hildon-widgets/hildon-banner.[ch]: implementation and header
* hildon-widgets/Makefile.am: reference new files
* hildon-widgets/gtk-infoprint.c: removed implementation, now just
* configure.ac: do not depend anymore on hildon-lgpl nor
hildon-fm, check for libmb, added Makefile output for timer/
-
-
2006-01-18 Luc Pionchon <luc.pionchon@nokia.com>
2006-01-11 Luc Pionchon <luc.pionchon@nokia.com>
- N#21063 hildon_note_new_confirmation_add_buttons has misleading docs
+ N#21063 hildon_note_new_confirmation_add_buttons has misleading docs
* hildon-widgets/hildon-note.c:
(hildon_note_new_confirmation_add_buttons): updated doc
(hildon_note_set_button_texts): likewise.
2005-11-18 Luc Pionchon <luc.pionchon@nokia.com>
-
Gazpacho support, added the following properties:
* hildon-widgets/hildon-insert-object-dialog.c: "name", "mimetype"
* hildon-widgets/hildon-color-button.c: minor cleanup
-
2005-11-18 Luc Pionchon <luc.pionchon@nokia.com>
- Started new development
+ Started new development
(branche for maintenance continues with versions 0.9.x)
2005-11-03 Luc Pionchon <luc.pionchon@nokia.com>
2005-10-31 Luc Pionchon <luc.pionchon@nokia.com>
same fix for,
- N#19283 Control panel - The values entered are not saved.
+ N#19283 Control panel - The values entered are not saved.
N#19648 Hildon Date Editor widget detects values too high
- (note: complete fix include also fixes in GTk+)
+ (note: complete fix include also fixes in GTk+)
* hildon-widgets/hildon-calendar-popup.c
(hildon_calendar_popup_set_property),
2005-10-12 Luc Pionchon <luc.pionchon@nokia.com>
- N#19140 System alerts still audible despite being turned off
+ N#19140 System alerts still audible despite being turned off
* hildon-widgets/hildon-note.c (sound_handling):
hildon_play_system_sound.
(hildon_note_init): Signal handler id is changed to be in private
structure, not in global variable.
-
+
* hildon-note.c: Removed unused defines etc.
- * Makefile.am: Appended new files to build rules.
+ * Makefile.am: Appended new files to build rules.
2005-10-05 Luc Pionchon <luc.pionchon@nokia.com>
(hildon_grid_class_init, hildon_grid_init): Replaced default empty
label by logical name "Ckct_wi_grid_no_items"
-
2005-08-31 Luc Pionchon <luc.pionchon@nokia.com>
* po/en_GB.po (ecdg_ti_verify_password): translation update.
-SUBDIRS = hildon-widgets timer doc
+SUBDIRS = hildon-widgets hildon-widgets-plugins timer doc ut po
EXTRA_DIST = \
debian/changelog \
debian/control \
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = hildon-libs.pc
+MAINTAINERCLEANFILES = \
+ Makefile.in aclocal.m4 configure \
+ config.h.in \
+ ltmain.sh depcomp missing \
+ install-sh config.sub \
+ config.guess intltool-extract.in \
+ intltool-merge.in intltool-update.in \
+ mkinstalldirs build-stamp configure-stamp \
+ gtk-doc.make
+
distclean-am:
-rm -rf autom4te.cache
-rm -f config.status config.cache config.log configure.lineno
tar zxvf ../$(PACKAGE)-$(VERSION).tar.gz && \
cd $(PACKAGE)-$(VERSION) && dpkg-buildpackage -rfakeroot
-
-#luc: will do this properly later,
-clean-all:
- rm -rf configure Makefile.in config.log depcomp config.guess config.h ltmain.sh config.sub gtk-doc.make hildon-libs.pc Makefile stamp-h.in mkinstalldirs config.status stamp-h1 config.h.in libtool autom4te.cache missing aclocal.m4 install-sh timer/Makefile.in hildon-widgets/hildon-libs-enum-types.c hildon-widgets/hildon-libs-enum-types.h hildon-widgets/Makefile.in hildon-widgets/.deps hildon-widgets/.libs debian/build doc/hildon-libs-decl-list.txt doc/xml doc/Makefile.in doc/version.xml doc/html doc/hildon-libs-decl.txt doc/hildon-libs-sections.txt doc/hildon-libs-undocumented.txt ut/Makefile.in ut/.libs ut/.deps ut/Makefile po/porules.mk po/Makefile.in po/POTFILES po/Makefile timer/.deps timer/Makefile hildon-widgets/Makefile doc/Makefile build-stamp timer/libtimer.a debian/hildon-libs0.substvars debian/tmp debian/files debian/hildon-libs0 debian/hildon-libs0-dbg
AC_INIT(Makefile.am)
-AM_INIT_AUTOMAKE(hildon-libs, 0.12.22)
+AM_INIT_AUTOMAKE(hildon-libs, 0.14.0)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
AC_OUTPUT(Makefile \
hildon-widgets/Makefile \
+ hildon-widgets-plugins/Makefile \
timer/Makefile \
ut/Makefile \
po/Makefile \
-hildon-libs (0.12.22-1) unstable; urgency=low
+hildon-libs (0.14.0) unstable; urgency=low
+
+ * fixes NB#38996 - HildonApp/HildonWindow: _escape_timeout() ref.count issue
+ * fixes NB#37010 - Time pickers in Set alarm and Date and time dialogs
+ * fixes NB#34225 - hildon-libs0: unneeded library dependency
+ * fixes NB#32845 - hildon_window_set_menu is buggy
+ * fixes NB#38559 - Progress banner does not fit enough text
+ * fixes NB#33217 - No borders for the custom defined color boxes in hildon color selector
+ * fixes NB#37172 - Colour selector for background color shows logical string
+
+ * Merging the new color selector branch (0.13.1) with the main trunk code.
+ * Maintainer change: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+ * Correcting the license headers
+ * Removing the redundant files
+ * Allowing menus to be removed from windows by passing NULL to set_menu
+ function (documented).
+ * Removing the Johan's new key handling (introduced in 0.13.1.3) for the
+ time being. That requires a fix at a different level.
+
+ -- Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com> Wed, 30 Aug 2006 14:30:00 +0300
+
+hildon-libs (0.13.1.6-1) unstable; urgency=low
+
+ * fixes NB#33260 - wrong value set in the enter page number option of page dialog
+ * fixes NB#37489 - "4" needs little more space
+ * fixes NB#37257 - color slider and selection area not dimmed when tapping on a predefined color
+ * fixes NB#30972 - 'set background image' when selected using hard-keys opens the color selector.
+ * fixes NB#37076 - logical string appears for color selection dialog title
+ * fixing the symlinks to default plugin targets
+
+ -- Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com> Wed, 30 Aug 2006 09:30:00 +0300
+
+hildon-libs (0.13.1.5-1) unstable; urgency=low
+
+ * fixing some package build isssues
+ * some code cleanups
+ * integrating the new color selector code
+
+ -- Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com> Wed, 25 Aug 2006 19:00:00 +0300
+
+hildon-libs (0.13.1.4-1) unstable; urgency=low
+
+ * fixes NB#35076 - hildonapp should not handle the home key
+
+ -- Johan Bilien <johan.bilien@nokia.com> Wed, 16 Aug 2006 15:30:28 +0300
+
+hildon-libs (0.13.1.3-1) unstable; urgency=low
+
+ * hildon-widgets/hildon-{app.h,defines.h}
+ switched HILDON_MENU_KEY to now match GDK_F10
+
+ -- Johan Bilien <johan.bilien@nokia.com> Thu, 10 Aug 2006 15:35:52 +0300
+
+hildon-libs (0.13.1.2-1) unstable; urgency=low
+
+ * reworked the color selector
+ * fixes bugs related to visual aspect (color boxes with no frame, etc.)
+
+ -- Kuisma Salonen <kuisma.salonen@nokia.com> Mon, 24 Jul 2006 16:28:09 +0300
+
+hildon-libs (0.13.1.1-1) unstable; urgency=low
+
+ * INTERNAL RELEASE with experimental plugged-in color selector
+
+ -- Luc Pionchon <luc.pionchon@nokia.com> Mon, 12 Jun 2006 23:45:04 +0300
+
+hildon-libs (0.13.1-1) unstable; urgency=low
+
+ * debian/hildon-libs-dev.install: removed "usr/lib/*.a"hildon-libs (0.12.22-1) unstable; urgency=low
* fixes NB#36309 - HildonCodeDialog uses untranslated string
* autogen.sh, do not exit if gtkdocize is missing (quick workaround for autobuilder)
-
-- Luc Pionchon <luc.pionchon@nokia.com> Wed, 19 Apr 2006 17:28:32 +0300
hildon-libs (0.12.10-1) unstable; urgency=low
Source: hildon-libs
Section: x11
Priority: optional
-Maintainer: Luc Pionchon <luc.pionchon@nokia.com>
+Maintainer: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
Build-Depends: debhelper (>= 4.0.0), pkg-config, libgtk2.0-dev (>= 2:2.6.10-1.osso4), osso-esd-dev, libmatchbox-dev (>= 1.3-2), libxi-dev, libxt-dev, libpng12-dev, libgconf2-dev, gtk-doc-tools
Standards-Version: 3.6.0
Architecture: any
Conflicts: hildon-lgpl0 (<< 0.12)
Replaces: hildon-lgpl0 (<< 0.12)
-Depends: ${shlibs:Depends}, ${misc:Depends}, osso-sounds-ui, osso-esd, libgconf2-6, hildon-libs-l10n-mr0 | hildon-libs-l10n-mr
+Depends: ${shlibs:Depends}, ${misc:Depends}, osso-sounds-ui, hildon-libs-l10n-mr0 | hildon-libs-l10n-mr
Description: Hildon libraries
Package: hildon-libs0-dbg
-Copyright: (c) 2005 Nokia Corporation
+Copyright: (c) 2005, 2006 Nokia Corporation
-This package is licensed under the LGPL
+This package is licensed under the LGPL, version 2.1
usr/lib/*.so.*
+usr/lib/hildon-widgets/*.so
--- /dev/null
+/usr/lib/hildon-widgets/hildoncolorchooser_hsv.so /usr/lib/hildon-widgets/hildoncolorchooser_default.so
+/usr/lib/hildon-widgets/hildoncolorchooserdialog_hsv.so /usr/lib/hildon-widgets/hildoncolorchooserdialog_default.so
# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
# of using the various options.
+MAINTAINERCLEANFILES = Makefile.in
+
# The name of the module, e.g. 'glib'.
DOC_MODULE=hildon-libs
--- /dev/null
+PURPOSE OF EXISTANCE
+
+ The API is made to provide very simple layer to load widgets that are
+inherited from some other widget type (and therefore providing it's interface)
+from plugins. Primary goal is simplicity.
+
+ The API is to prevent of duplication of same piece of code which is needed
+by some sort of plugin-based-widget implementation. Originally meant to be
+used in widgets _new () function, but also eases custom type loading in some
+other parts of API.
+
+
+WHAT IT PROVIDES
+
+ The API layer is thin and simple. It provides functions to open module
+containing plugin-based widget code, creating instance of this type loaded
+from module and to unload the module (and destruct the data). The module
+should not be unloaded as long as instances of loaded type exist.
+
+ The module loading (and "object" (really a structure) creation) also
+provides possibility to choose for a specific implementation, or to use the
+default one. See next section for details. The created struct is a pointer to
+HildonPluginWidgetInfo, which is private structs which acts similar way to
+module handle: after deinitializing it, you cannot use functions within the
+module (in this particular case, you cannot use instances of type within the
+module).
+
+
+MODEL OVERVIEW
+
+ Short explanation by example situation: we have widget called HildonA which
+is abstract widget having some widget specific interface and we want to
+implement the widget inside a plugin, so we could have variance in actual
+implementation (for example theming/configuration alternatives).
+
+ First, we create abstract widget and decide whatking of interface it should
+have. Next we create public ocnstructor for the widget. At this point, we
+don't use typical g_type_create_instance () or alternative function for our
+type, but we have (commonly global) HildonPluginWidgetInfo structure which is
+typically initialized on first time needed by using the interface to load the
+default module, and then hold the module handle (there is no absolute need to
+unload the module) and each time _new () function is called, create instance
+by the function within the API and return it.
+
+ The module loading function needs to know parent type of widget which is
+contained in the module, for our example the parent type would be type of
+HildonA. Also if requesting specific module it should know it's nickname, but
+abstract types shouldn't request for specific module.
+
+ The actual widget will be implemented within module. The module is shared
+object containing a function called 'export_type', which should return needed
+GType for the type contained withing the module. The module is also expected
+to properly implement interface of parent type.
+
+ The module lookup function looks up modules from the widget plugin directory
+which is built-time defined where "/usr/lib/hildon-widgets/" is the fallback
+directory. The name of plugin file is <decapitalizedtypename>_<nickname>.so
+and the nickname is plugins nickname passed to module loading function. If
+nothing is passed as nickname (the default is beign used), the nickname will
+be looked up from GtkSettings, variable name is <TypeName>-plugin. If that is
+not defined, nickname "default" will be used.
+
+ The GtkSettings definition allows flexibility from system configuration
+point of view. To set up proper installation, widget developer should have
+some rather simple implementation of the widget as default fallback, or at
+least provide some implementation and symlink "default" nicknamed .so file to
+it. If nothing is defined at the GtkSettings, the flexibility is in system
+installation: it's rather trivial to replace one minor file. If someone else
+wants to make alternative implementation for the widget, (s)he can just add
+another implementation to the dir and by for example gtkrc modification use
+the specific implementation for some specific theme.
+
+ This also allows one important thing from platform implementation point of
+view: by using abstract widgets which provide guaranteed functionality, you
+are guaranteed to have proper systems look & feel for the widget as long as
+the system is proper installation. The proper installation in this case means
+that the abstract widget is supported and there is at least proper .so default
+file installed into plugin dir (and the theme shouldn't specify anything which
+would break this). The system configuration has the change to provide the
+proper widget implementation without touching the library code.
+
+ The plugin implementor basically needs just to implement function called
+'export_type' which returns proper GType. The proper GType in this case means
+that the type should be proper GType in the means that it doesn't break up the
+type system AND that all interfaces of ancestors are implemented, in other
+words all functions defined in class hierarchy should be implemented within
+the class hierarchy or in the plugin, usually abstract parent-defined
+functions aren't implemented there so they should be implemented within the
+module.
+
+
+POSSIBLE ERRORS
+
+ There are several things that can go wrong. If the module is unloaded and
+instances of module-implemented type exist, using these instances will most
+probably cause segmentation fault (the usual unloaded-module-access behavior).
+Another problem is that the module opening function can return NULL, the
+application should be aware of that this could happen (however this happens
+only because module opening functions have failed), if this happened when
+requesting specific implementation, the requester code should try again, this
+time requesting default one.
+
+
+OTHER ALTERNATIVES FOR PLUGGABLE WIDGETS
+
+ How system basically works is that there is abstract widget class for some
+widget and widgets can be loaded through hildon-plugin-widget API (althrough
+nothing prevents custom loading). This means there can be multiple
+implementations of the abstract widget. Probably most major alternative would
+be having pluggable type widget (instead of abstract type loaded from plugin)
+which would be more consistent with GType system (for example would implement
+the GTypeModule interface).
+
+ The idea of later is that we would have some plugin type system which would
+get the type from plugin automatically by the GTypeModule implementation. This
+removes need of extra interface (hildon-plugin-widget in this case).
+
+ There is two major adventages in both:
+ * Abstract type: Easy[1] to have multiple different child types.
+ * Modular type: Fits better to the type hierarchy without introducing any
+ new things to the type hierarchy.
+
+ The adventage of abstract type in the case of Hildon libraries is relevant,
+the practical example is HSV based color chooser dialog. There is HSV based
+color chooser dialog which has child widget, a color chooser, which is also
+plugin based. Now if there would be only the default type for plugin based
+widgets, this could mean that inside HSV color chooser dialog would be some
+other color chooser widget than the HSV based one. With the abstract widget
+type and inheritance-within plugins the HSV color chooser dialog can
+explicitly request for a HSV based color chooser.
+
+
+COMMENTS
+
+[1] easy in the sense not doing any kludges to break the uniformness of
+ architecture
+
+
+SEE ALSO
+
+ * abstract_vs_modular_plugin_widgets.dia (or .png)
<chapter>
<title>Selectors</title>
<xi:include href="xml/hildon-color-button.xml"/>
+ <xi:include href="xml/hildon-color-chooser-dialog.xml"/>
<xi:include href="xml/hildon-color-selector.xml"/>
<xi:include href="xml/hildon-color-popup.xml"/>
<xi:include href="xml/hildon-controlbar.xml"/>
<xi:include href="xml/hildon-system-sound.xml"/>
<xi:include href="xml/hildon-input-mode-hint.xml"/>
<xi:include href="xml/hildon-defines.xml"/>
+ <xi:include href="xml/hildon-plugin-widget.xml"/>
</chapter>
<index>
#include <hildon-widgets/hildon-weekday-picker.h>
#include <hildon-widgets/hildon-window.h>
#include <hildon-widgets/hildon-wizard-dialog.h>
+#include <hildon-widgets/hildon-color-chooser.h>
+#include <hildon-widgets/hildon-color-chooser-dialog.h>
+#include <hildon-widgets/hildon-plugin-widget.h>
hildon_add_home_dialog_get_type
hildon_app_get_type
hildon_weekday_picker_get_type
hildon_window_get_type
hildon_wizard_dialog_get_type
+hildon_color_chooser_get_type
+hildon_color_chooser_dialog_get_type
--- /dev/null
+<!-- ##### SECTION Title ##### -->
+HildonColorChooserDialog
+
+<!-- ##### SECTION Short_Description ##### -->
+A dialog to choose a color. Relies on pluggable widget framework, which means
+the API won't guarantee whatkind of dialog will be shown as it depends on
+theming.
+
+On proper installations the widget should provide platform look-and-feel
+compatible dialog capable of choosing a color.
+
+<!-- ##### SECTION Long_Description ##### -->
+
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### FUNCTION hildon_color_chooser_dialog_new ##### -->
+<para>
+
+</para>
+
+@Returns:
+
+
+<!-- ##### FUNCTION hildon_color_chooser_dialog_get_color ##### -->
+<para>
+
+</para>
+
+@chooser:
+@color:
+
+
+<!-- ##### FUNCTION hildon_color_chooser_dialog_set_color ##### -->
+<para>
+
+</para>
+
+@chooser:
+@color:
+
+
--- /dev/null
+<!-- ##### SECTION Title ##### -->
+HildonColorChooser
+
+<!-- ##### SECTION Short_Description ##### -->
+A widget to choose a color. Relies on pluggable widget framework, which means
+the API won't guarantee whatkind of dialog will be shown as it depends on
+theming.
+
+On proper installations the widget API should provide platform look-and-feel
+compatible widget capable of choosing a color.
+
+<!-- ##### SECTION Long_Description ##### -->
+
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### SECTION Stability_Level ##### -->
+
+
+<!-- ##### FUNCTION hildon_color_chooser_new ##### -->
+<para>
+
+</para>
+
+@Returns:
+
+
+<!-- ##### FUNCTION hildon_color_chooser_get_color ##### -->
+<para>
+
+</para>
+
+@chooser:
+@color:
+
+
+<!-- ##### FUNCTION hildon_color_chooser_set_color ##### -->
+<para>
+
+</para>
+
+@chooser:
+@color:
+
+
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+
+INCLUDES = $(GTK_CFLAGS) $(GCONF_CFLAGS) -DLOCALEDIR=\"$(localedir)\" \
+ -I$(srcdir)/..
+
+LDFLAGS = -module -avoid-version
+LIBADD = -L$(srcdir)/../hildon-widgets/.libs -lhildonwidgets $(GTK_LIBS)
+
+pluginwidgetdir = $(libdir)/hildon-widgets
+pluginwidget_LTLIBRARIES = hildoncolorchooser_hsv.la \
+ hildoncolorchooserdialog_hsv.la
+
+hildoncolorchooser_hsv_la_SOURCES = hildon-color-chooser-hsv.c
+
+hildoncolorchooserdialog_hsv_la_SOURCES = hildon-color-chooser-dialog-hsv.c
+hildoncolorchooserdialog_hsv_la_LIBADD = $(GCONF_LIBS)
+
+install-exec-local: installdirs
+ @echo "Creating default symlink for color chooser..."
+ @ln -f -s 'hildoncolorchooser_hsv.so' '$(DESTDIR)/$(libdir)/hildon-widgets/hildoncolorchooser_default.so'
+ @echo "Creating default symlink for color chooser dialog..."
+ @ln -f -s 'hildoncolorchooserdialog_hsv.so' '$(DESTDIR)/$(libdir)/hildon-widgets/hildoncolorchooserdialog_default.so'
+
+
+
+
+
--- /dev/null
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation.
+ *
+ * Author: Kuisma Salonen <kuisma.salonen@nokia.com>
+ * 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
+ *
+ */
+
+
+#include <memory.h>
+#include <string.h>
+
+#include <libintl.h>
+
+#include <gdk/gdk.h>
+#include <gdk/gdkkeysyms.h>
+
+#include <gtk/gtk.h>
+
+#include <gconf/gconf-client.h>
+
+
+#include <hildon-widgets/hildon-color-chooser-dialog.h>
+#include <hildon-widgets/hildon-color-chooser.h>
+
+#include <hildon-widgets/hildon-plugin-widget.h>
+
+#include <hildon-widgets/hildon-defines.h>
+
+#include <hildon-widgets/hildon-banner.h>
+
+
+#define _(String) dgettext("hildon-libs", String)
+
+
+const char *parent_name = "HildonColorChooserDialog";
+const char *plugin_name = "HSV color chooser dialog";
+
+GType export_type(void);
+
+
+static HildonPluginWidgetInfo *chooser_plugin = NULL;
+
+static HildonColorChooserDialogClass *parent_klass = NULL;
+
+
+/* darkened EGA palette to be used as predefined colors if style doesn't
+ define anything else (darker colors are darkened 0x8000 -> 0x6666) */
+static GdkColor hardcoded_colors[16] = {{0, 0x0000, 0x0000, 0x0000},
+ {0, 0x6666, 0x6666, 0x6666},
+ {0, 0x6666, 0x0000, 0x0000},
+ {0, 0x0000, 0x6666, 0x0000},
+ {0, 0x0000, 0x0000, 0x6666},
+ {0, 0x6666, 0x6666, 0x0000},
+ {0, 0x6666, 0x0000, 0x6666},
+ {0, 0x0000, 0x6666, 0x6666},
+ {0, 0xffff, 0xffff, 0xffff},
+ {0, 0xc000, 0xc000, 0xc000},
+ {0, 0xffff, 0x0000, 0x0000},
+ {0, 0x0000, 0xffff, 0x0000},
+ {0, 0x0000, 0x0000, 0xffff},
+ {0, 0xffff, 0xffff, 0x0000},
+ {0, 0xffff, 0x0000, 0xffff},
+ {0, 0x0000, 0xffff, 0xffff}};
+
+
+typedef struct {
+ GtkBorder radio_sizes;
+ GtkBorder cont_sizes;
+ GtkBorder num_buttons;
+ GtkBorder last_num_buttons;
+
+ GdkColor default_color;
+} HildonColorChooserStyleInfo;
+
+
+typedef struct _HildonColorChooserDialogHSV HildonColorChooserDialogHSV;
+typedef struct _HildonColorChooserDialogHSVClass HildonColorChooserDialogHSVClass;
+
+
+struct _HildonColorChooserDialogHSV {
+ HildonColorChooserDialog parent;
+
+ GtkWidget *hbox;
+ GtkWidget *vbox;
+
+ GtkWidget *align_custom, *align_defined;
+ GtkWidget *area_custom, *area_defined;
+ GtkWidget *separator;
+
+ GtkWidget *chooser;
+
+ GdkColor *colors_custom, *colors_defined;
+ GdkGC **gc_array;
+
+ gint selected;
+
+ HildonColorChooserStyleInfo style_info;
+
+
+ gint has_style;
+
+ GdkColor pending_color;
+
+
+ struct {
+ GConfClient *client;
+ } gconf_data;
+};
+
+struct _HildonColorChooserDialogHSVClass {
+ HildonColorChooserDialogClass parent_klass;
+};
+
+
+#define HILDON_COLOR_CHOOSER_DIALOG_HSV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), export_type(), HildonColorChooserDialogHSV))
+#define HILDON_COLOR_CHOOSER_DIALOG_HSV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), export_type(), HildonColorChooserDialogHSVClass))
+
+
+GtkType export_type(void);
+
+
+static void hildon_color_chooser_dialog_hsv_init(HildonColorChooserDialogHSV *object);
+static void hildon_color_chooser_dialog_hsv_class_init(HildonColorChooserDialogHSVClass *klass);
+
+static void hildon_color_chooser_dialog_hsv_size_request(GtkWidget *widget, GtkRequisition *req);
+static void hildon_color_chooser_dialog_hsv_size_allocate(GtkWidget *widget, GtkAllocation *alloc);
+
+static void hildon_color_chooser_dialog_hsv_realize(GtkWidget *widget);
+static void hildon_color_chooser_dialog_hsv_unrealize(GtkWidget *widget);
+
+static void hildon_color_chooser_dialog_hsv_style_set(GtkWidget *widget, GtkStyle *previous_style);
+
+static void hildon_color_chooser_dialog_hsv_show(GtkWidget *widget);
+static void hildon_color_chooser_dialog_hsv_show_all(GtkWidget *widget);
+
+static gboolean hildon_color_chooser_dialog_hsv_key_press_event(GtkWidget *widget, GdkEventKey *event);
+static gboolean hildon_color_chooser_dialog_hsv_key_release_event(GtkWidget *widget, GdkEventKey *event);
+
+
+static void hildon_color_chooser_dialog_hsv_destroy(GtkObject *object);
+
+
+static void hildon_color_chooser_dialog_hsv_set_color(HildonColorChooserDialog *dialog, GdkColor *color);
+
+
+static gboolean hildon_color_chooser_dialog_hsv_area_expose(GtkWidget *widget, GdkEventExpose *event, gpointer data);
+
+static gboolean hildon_color_chooser_dialog_hsv_area_button_press(GtkWidget *widget, GdkEventButton *event, gpointer data);
+
+
+static void hildon_color_chooser_dialog_hsv_chooser_color_changed(HildonColorChooser *chooser, GdkColor *color, gpointer data);
+
+static void hildon_color_chooser_dialog_hsv_chooser_insensitive_press(GtkWidget *widget, gpointer data);
+
+
+static void hildon_color_chooser_dialog_hsv_refresh_style_info(HildonColorChooserDialogHSV *dialog);
+
+static void hildon_color_chooser_dialog_hsv_set_color_num(HildonColorChooserDialogHSV *dialog, gint num);
+
+static void hildon_color_chooser_dialog_hsv_ascii_hex_to_color(gchar *s, GdkColor *color);
+static void hildon_color_chooser_dialog_hsv_color_to_ascii_hex(gchar *s, GdkColor *color);
+
+
+GType export_type()
+{
+ static GType dialog_type = 0;
+
+ if (!dialog_type) {
+ static const GTypeInfo dialog_info =
+ {
+ sizeof (HildonColorChooserDialogHSVClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) hildon_color_chooser_dialog_hsv_class_init,
+ NULL,
+ NULL,
+ sizeof (HildonColorChooserDialogHSV),
+ 0,
+ (GInstanceInitFunc) hildon_color_chooser_dialog_hsv_init,
+ NULL
+ };
+
+ dialog_type = g_type_register_static (HILDON_TYPE_COLOR_CHOOSER_DIALOG, "HildonColorChooserDialogHSV", &dialog_info, 0);
+ }
+
+ return dialog_type;
+}
+
+
+static void hildon_color_chooser_dialog_hsv_init(HildonColorChooserDialogHSV *object)
+{
+ if(!chooser_plugin) {
+ chooser_plugin = hildon_plugin_info_initialize(HILDON_TYPE_COLOR_CHOOSER, "hsv");
+ }
+
+
+ gtk_dialog_set_has_separator(GTK_DIALOG(object), FALSE);
+
+ gtk_window_set_title(GTK_WINDOW(object), _("ecdg_ti_colour_selector"));
+
+
+ object->chooser = hildon_plugin_info_construct_widget(chooser_plugin);
+
+ object->hbox = gtk_hbox_new(FALSE, 0);
+ object->vbox = gtk_vbox_new(FALSE, 0);
+
+ gtk_box_pack_start(GTK_BOX(object->hbox), object->chooser, TRUE, TRUE, 0);
+ gtk_box_pack_end(GTK_BOX(object->hbox), object->vbox, FALSE, FALSE, 0);
+
+
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(object)->vbox), object->hbox, TRUE, TRUE, 0);
+
+
+ object->align_custom = gtk_alignment_new(0.5, 1.0, 0.0, 0.0);
+ object->align_defined = gtk_alignment_new(0.5, 1.0, 0.0, 0.0);
+
+ object->area_custom = gtk_drawing_area_new();
+ object->area_defined = gtk_drawing_area_new();
+
+
+ gtk_container_add(GTK_CONTAINER(object->align_custom), object->area_custom);
+ gtk_container_add(GTK_CONTAINER(object->align_defined), object->area_defined);
+
+
+ object->separator = gtk_hseparator_new();
+
+
+ gtk_box_pack_start(GTK_BOX(object->vbox), object->align_defined, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(object->vbox), object->separator, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(object->vbox), object->align_custom, FALSE, FALSE, 0);
+
+
+ gtk_dialog_add_button(GTK_DIALOG(object), _("ecdg_bd_colour_selector_ok"), GTK_RESPONSE_OK);
+ gtk_dialog_add_button(GTK_DIALOG(object), _("ecdg_bd_colour_selector_cancel"), GTK_RESPONSE_CANCEL);
+
+
+ g_signal_connect(G_OBJECT(object->chooser), "insensitive-press", G_CALLBACK(hildon_color_chooser_dialog_hsv_chooser_insensitive_press), object);
+
+
+ g_signal_connect(G_OBJECT(object->area_custom), "expose-event", G_CALLBACK(hildon_color_chooser_dialog_hsv_area_expose), object);
+ g_signal_connect(G_OBJECT(object->area_defined), "expose-event", G_CALLBACK(hildon_color_chooser_dialog_hsv_area_expose), object);
+
+ g_signal_connect(G_OBJECT(object->area_custom), "button-press-event", G_CALLBACK(hildon_color_chooser_dialog_hsv_area_button_press), object);
+ g_signal_connect(G_OBJECT(object->area_defined), "button-press-event", G_CALLBACK(hildon_color_chooser_dialog_hsv_area_button_press), object);
+
+ gtk_widget_add_events(object->area_custom, GDK_BUTTON_PRESS_MASK);
+ gtk_widget_add_events(object->area_defined, GDK_BUTTON_PRESS_MASK);
+
+
+ object->selected = 0;
+
+
+ g_signal_connect(G_OBJECT(object->chooser), "color-changed", G_CALLBACK(hildon_color_chooser_dialog_hsv_chooser_color_changed), object);
+
+
+ object->gconf_data.client = gconf_client_get_default();
+
+
+ memset(&object->style_info, 0, sizeof(HildonColorChooserStyleInfo));
+
+
+ object->colors_custom = NULL;
+ object->colors_defined = NULL;
+
+ object->gc_array = NULL;
+
+
+ object->has_style = 0;
+}
+
+static void hildon_color_chooser_dialog_hsv_class_init(HildonColorChooserDialogHSVClass *klass)
+{
+ GtkWidgetClass *widget_klass = GTK_WIDGET_CLASS(klass);
+ GtkObjectClass *object_klass = GTK_OBJECT_CLASS(klass);
+ HildonColorChooserDialogClass *dialog_klass = HILDON_COLOR_CHOOSER_DIALOG_CLASS(klass);
+ gchar tmp[32];
+ gint i;
+
+
+ widget_klass->size_request = hildon_color_chooser_dialog_hsv_size_request;
+ widget_klass->size_allocate = hildon_color_chooser_dialog_hsv_size_allocate;
+
+ widget_klass->realize = hildon_color_chooser_dialog_hsv_realize;
+ widget_klass->unrealize = hildon_color_chooser_dialog_hsv_unrealize;
+
+ widget_klass->style_set = hildon_color_chooser_dialog_hsv_style_set;
+
+ widget_klass->show = hildon_color_chooser_dialog_hsv_show;
+ widget_klass->show_all = hildon_color_chooser_dialog_hsv_show_all;
+
+ widget_klass->key_press_event = hildon_color_chooser_dialog_hsv_key_press_event;
+ widget_klass->key_release_event = hildon_color_chooser_dialog_hsv_key_release_event;
+
+
+ object_klass->destroy = hildon_color_chooser_dialog_hsv_destroy;
+
+
+ dialog_klass->set_color = hildon_color_chooser_dialog_hsv_set_color;
+
+
+ parent_klass = g_type_class_peek_parent(klass);
+
+
+ gtk_widget_class_install_style_property(widget_klass,
+ g_param_spec_boxed("container_sizes",
+ "Container sizes",
+ "Container specific sizes",
+ GTK_TYPE_BORDER,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property(widget_klass,
+ g_param_spec_boxed("radio_sizes",
+ "Color radio sizes",
+ "Color radio specific sizes",
+ GTK_TYPE_BORDER,
+ G_PARAM_READABLE));
+
+ gtk_widget_class_install_style_property(widget_klass,
+ g_param_spec_boxed("num_buttons",
+ "Number of buttons",
+ "Number of color store buttons",
+ GTK_TYPE_BORDER,
+ G_PARAM_READABLE));
+
+
+ gtk_widget_class_install_style_property(widget_klass,
+ g_param_spec_boxed("default_color", "Default color",
+ "Default color for nonpainted custom colors",
+ GDK_TYPE_COLOR,
+ G_PARAM_READABLE));
+
+
+ for(i = 0; i < 32; i++) {
+ memset(tmp, 0, 32);
+ g_snprintf(tmp, 32, "defined_color%d", i);
+
+ gtk_widget_class_install_style_property(widget_klass,
+ g_param_spec_boxed(tmp, "Defined color",
+ "Pre-defined colors for the dialog",
+ GDK_TYPE_COLOR,
+ G_PARAM_READABLE));
+ }
+}
+
+
+static void hildon_color_chooser_dialog_hsv_size_request(GtkWidget *widget, GtkRequisition *req)
+{
+ HildonColorChooserDialogHSV *dialog = HILDON_COLOR_CHOOSER_DIALOG_HSV(widget);
+
+
+ gtk_container_set_border_width(GTK_CONTAINER(dialog->hbox), dialog->style_info.cont_sizes.left);
+
+ gtk_box_set_spacing(GTK_BOX(dialog->hbox), dialog->style_info.cont_sizes.right);
+ gtk_box_set_spacing(GTK_BOX(dialog->vbox), dialog->style_info.cont_sizes.top);
+ gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(widget)->vbox), dialog->style_info.cont_sizes.bottom);
+
+
+ gtk_widget_set_size_request(dialog->area_custom,
+ (dialog->style_info.radio_sizes.left + 2*dialog->style_info.radio_sizes.bottom)*(dialog->style_info.num_buttons.top) +
+ (dialog->style_info.num_buttons.top-1)*dialog->style_info.radio_sizes.top,
+ (dialog->style_info.radio_sizes.right + 2*dialog->style_info.radio_sizes.bottom)*(dialog->style_info.num_buttons.bottom) +
+ (dialog->style_info.num_buttons.bottom-1)*dialog->style_info.radio_sizes.top);
+ gtk_widget_set_size_request(dialog->area_defined,
+ (dialog->style_info.radio_sizes.left + 2*dialog->style_info.radio_sizes.bottom)*(dialog->style_info.num_buttons.left) +
+ (dialog->style_info.num_buttons.left-1)*dialog->style_info.radio_sizes.top,
+ (dialog->style_info.radio_sizes.right + 2*dialog->style_info.radio_sizes.bottom)*(dialog->style_info.num_buttons.right) +
+ (dialog->style_info.num_buttons.right-1)*dialog->style_info.radio_sizes.top);
+
+
+ GTK_WIDGET_CLASS(parent_klass)->size_request(widget, req);
+}
+
+static void hildon_color_chooser_dialog_hsv_size_allocate(GtkWidget *widget, GtkAllocation *alloc)
+{
+ HildonColorChooserDialogHSV *dialog = HILDON_COLOR_CHOOSER_DIALOG_HSV(widget);
+ GdkRectangle rect;
+ int i, tmp, tmp2;
+
+
+ GTK_WIDGET_CLASS(parent_klass)->size_allocate(widget, alloc);
+
+
+ if(GTK_WIDGET_REALIZED(widget)) {
+ tmp = (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right);
+ tmp2 = (dialog->style_info.num_buttons.top * dialog->style_info.num_buttons.bottom);
+
+ for(i = 0; i < tmp; i++) {
+ rect.x = ((i % dialog->style_info.num_buttons.left) * (dialog->style_info.radio_sizes.left + dialog->style_info.radio_sizes.top +
+ 2*dialog->style_info.radio_sizes.bottom)) + dialog->style_info.radio_sizes.bottom;
+ rect.y = ((i / dialog->style_info.num_buttons.left) * (dialog->style_info.radio_sizes.right + dialog->style_info.radio_sizes.top +
+ 2*dialog->style_info.radio_sizes.bottom)) + dialog->style_info.radio_sizes.bottom;
+ rect.width = dialog->style_info.radio_sizes.left;
+ rect.height = dialog->style_info.radio_sizes.right;
+
+ gdk_gc_set_clip_rectangle(dialog->gc_array[i], &rect);
+ }
+
+ for(i = 0; i < tmp2; i++) {
+ rect.x = ((i % dialog->style_info.num_buttons.top) * (dialog->style_info.radio_sizes.left + dialog->style_info.radio_sizes.top +
+ 2*dialog->style_info.radio_sizes.bottom)) + dialog->style_info.radio_sizes.bottom;
+ rect.y = ((i / dialog->style_info.num_buttons.top) * (dialog->style_info.radio_sizes.right + dialog->style_info.radio_sizes.top +
+ 2*dialog->style_info.radio_sizes.bottom)) + dialog->style_info.radio_sizes.bottom;
+ rect.width = dialog->style_info.radio_sizes.left;
+ rect.height = dialog->style_info.radio_sizes.right;
+
+ gdk_gc_set_clip_rectangle(dialog->gc_array[i + tmp], &rect);
+ }
+ }
+}
+
+
+static void hildon_color_chooser_dialog_hsv_realize(GtkWidget *widget)
+{
+ HildonColorChooserDialogHSV *dialog = HILDON_COLOR_CHOOSER_DIALOG_HSV(widget);
+ GdkRectangle rect;
+ int i, tmp, tmp2;
+
+
+ GTK_WIDGET_CLASS(parent_klass)->realize(widget);
+
+
+ tmp = (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right) +
+ (dialog->style_info.num_buttons.top * dialog->style_info.num_buttons.bottom);
+
+ for(i = 0; i < tmp; i++) {
+ dialog->gc_array[i] = gdk_gc_new(widget->window);
+ }
+
+
+
+ tmp = (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right);
+ tmp2 = (dialog->style_info.num_buttons.top * dialog->style_info.num_buttons.bottom);
+
+ for(i = 0; i < tmp; i++) {
+ gdk_gc_set_rgb_fg_color(dialog->gc_array[i], &dialog->colors_defined[i]);
+
+ rect.x = ((i % dialog->style_info.num_buttons.left) * (dialog->style_info.radio_sizes.left + dialog->style_info.radio_sizes.top +
+ 2*dialog->style_info.radio_sizes.bottom)) + dialog->style_info.radio_sizes.bottom;
+ rect.y = ((i / dialog->style_info.num_buttons.left) * (dialog->style_info.radio_sizes.right + dialog->style_info.radio_sizes.top +
+ 2*dialog->style_info.radio_sizes.bottom)) + dialog->style_info.radio_sizes.bottom;
+ rect.width = dialog->style_info.radio_sizes.left;
+ rect.height = dialog->style_info.radio_sizes.right;
+
+ gdk_gc_set_clip_rectangle(dialog->gc_array[i], &rect);
+ }
+
+ for(i = 0; i < tmp2; i++) {
+ gdk_gc_set_rgb_fg_color(dialog->gc_array[i + tmp], &dialog->colors_custom[i]);
+
+ rect.x = ((i % dialog->style_info.num_buttons.top) * (dialog->style_info.radio_sizes.left + dialog->style_info.radio_sizes.top +
+ 2*dialog->style_info.radio_sizes.bottom)) + dialog->style_info.radio_sizes.bottom;
+ rect.y = ((i / dialog->style_info.num_buttons.top) * (dialog->style_info.radio_sizes.right + dialog->style_info.radio_sizes.top +
+ 2*dialog->style_info.radio_sizes.bottom)) + dialog->style_info.radio_sizes.bottom;
+ rect.width = dialog->style_info.radio_sizes.left;
+ rect.height = dialog->style_info.radio_sizes.right;
+
+ gdk_gc_set_clip_rectangle(dialog->gc_array[i + tmp], &rect);
+ }
+}
+
+static void hildon_color_chooser_dialog_hsv_unrealize(GtkWidget *widget)
+{
+ HildonColorChooserDialogHSV *dialog = HILDON_COLOR_CHOOSER_DIALOG_HSV(widget);
+ int i, tmp;
+
+
+ tmp = (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right) +
+ (dialog->style_info.num_buttons.top * dialog->style_info.num_buttons.bottom);
+
+ for(i = 0; i < tmp; i++) {
+ g_object_unref(dialog->gc_array[i]);
+ }
+
+
+ GTK_WIDGET_CLASS(parent_klass)->unrealize(widget);
+}
+
+
+static void hildon_color_chooser_dialog_hsv_style_set(GtkWidget *widget, GtkStyle *previous_style)
+{
+ HildonColorChooserDialogHSV *dialog = HILDON_COLOR_CHOOSER_DIALOG_HSV(widget);
+ GdkColor *tmpcolor;
+ gchar tmp[32], key[128], *val;
+ int i, tmpn, setcolor = 0;
+
+
+ if(!dialog->has_style)
+ setcolor = 1;
+
+ dialog->has_style = 1;
+
+
+ gtk_widget_style_get(widget, "default_color", &tmpcolor, NULL);
+ if(tmpcolor) {
+ dialog->style_info.default_color = *tmpcolor;
+ } else {
+ dialog->style_info.default_color.red = 0x0000;
+ dialog->style_info.default_color.green = 0x0000;
+ dialog->style_info.default_color.blue = 0x0000;
+ dialog->style_info.default_color.pixel = 0x00000000;
+ }
+
+
+ hildon_color_chooser_dialog_hsv_refresh_style_info(dialog);
+
+
+ if(memcmp(&dialog->style_info.num_buttons, &dialog->style_info.last_num_buttons, sizeof(GtkBorder))) {
+ if(dialog->colors_custom) {
+ g_free(dialog->colors_custom);
+ } if(dialog->colors_defined) {
+ g_free(dialog->colors_defined);
+ } if(dialog->gc_array) {
+ if(GTK_WIDGET_REALIZED(widget)) {
+ tmpn = (dialog->style_info.last_num_buttons.left * dialog->style_info.last_num_buttons.right) +
+ (dialog->style_info.last_num_buttons.top * dialog->style_info.last_num_buttons.bottom);
+
+ for(i = 0; i < tmpn; i++) {
+ g_object_unref(dialog->gc_array[i]);
+ }
+ }
+
+ g_free(dialog->gc_array);
+ }
+
+ dialog->colors_custom = (GdkColor *)g_malloc0(sizeof(GdkColor) * (dialog->style_info.num_buttons.top * dialog->style_info.num_buttons.bottom));
+ dialog->colors_defined = (GdkColor *)g_malloc0(sizeof(GdkColor) * (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right));
+
+
+ tmpn = (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right) +
+ (dialog->style_info.num_buttons.top * dialog->style_info.num_buttons.bottom);
+ dialog->gc_array = (GdkGC **)g_malloc0(sizeof(GdkGC *) * tmpn);
+
+
+ if(dialog->gconf_data.client) {
+ for(i = 0; i < (dialog->style_info.num_buttons.top * dialog->style_info.num_buttons.bottom); i++) {
+ memset(key, 0, 128);
+ g_snprintf(key, 128, "/system/osso/af/color_chooser/custom_color%d", i);
+ val = gconf_client_get_string(dialog->gconf_data.client, key, NULL);
+ if(val) {
+ hildon_color_chooser_dialog_hsv_ascii_hex_to_color(val, &dialog->colors_custom[i]);
+ g_free(val);
+ } else {
+ dialog->colors_custom[i] = dialog->style_info.default_color;
+ }
+ }
+ } else {
+ for(i = 0; i < (dialog->style_info.num_buttons.top * dialog->style_info.num_buttons.bottom); i++) {
+ dialog->colors_custom[i] = dialog->style_info.default_color;
+ }
+ }
+ }
+
+
+ tmpn = (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right);
+
+ hildon_color_chooser_set_color(HILDON_COLOR_CHOOSER(dialog->chooser),
+ (dialog->selected < tmpn) ? &dialog->colors_defined[dialog->selected] : &dialog->colors_custom[dialog->selected - tmpn]);
+
+
+ for(i = 0; i < (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right); i++) {
+ memset(tmp, 0, 32);
+ g_snprintf(tmp, 32, "defined_color%d", i);
+
+ gtk_widget_style_get(widget, tmp, &tmpcolor, NULL);
+
+ if(tmpcolor) {
+ dialog->colors_defined[i] = *tmpcolor;
+ } else {
+ if(i < 16) {
+ dialog->colors_defined[i] = hardcoded_colors[i];
+ } else { /* fallback to prevent segfault */
+ dialog->colors_defined[i].red = 0x0000;
+ dialog->colors_defined[i].green = 0x0000;
+ dialog->colors_defined[i].blue = 0x0000;
+ dialog->colors_defined[i].pixel = 0x00000000;
+ }
+ }
+ }
+
+
+ if(GTK_WIDGET_REALIZED(widget)) {
+ for(i = 0; i < (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right); i++) {
+ gdk_gc_set_rgb_fg_color(dialog->gc_array[i], &dialog->colors_defined[i]);
+ }
+ }
+
+
+ if(setcolor)
+ hildon_color_chooser_dialog_hsv_set_color(HILDON_COLOR_CHOOSER_DIALOG(dialog), &dialog->pending_color);
+
+
+ gtk_widget_queue_resize(widget);
+
+
+ GTK_WIDGET_CLASS(parent_klass)->style_set(widget, previous_style);
+}
+
+
+static void hildon_color_chooser_dialog_hsv_show(GtkWidget *widget)
+{
+ HildonColorChooserDialogHSV *dialog = HILDON_COLOR_CHOOSER_DIALOG_HSV(widget);
+
+
+ gtk_widget_show(dialog->hbox);
+ gtk_widget_show(dialog->vbox);
+
+ gtk_widget_show(dialog->chooser);
+
+ gtk_widget_show(dialog->align_custom);
+ gtk_widget_show(dialog->align_defined);
+
+ gtk_widget_show(dialog->separator);
+
+ gtk_widget_show(dialog->area_custom);
+ gtk_widget_show(dialog->area_defined);
+
+
+ GTK_WIDGET_CLASS(parent_klass)->show(widget);
+}
+
+static void hildon_color_chooser_dialog_hsv_show_all(GtkWidget *widget)
+{
+ hildon_color_chooser_dialog_hsv_show(widget);
+}
+
+
+static gboolean hildon_color_chooser_dialog_hsv_key_press_event(GtkWidget *widget, GdkEventKey *event)
+{
+ HildonColorChooserDialogHSV *dialog = HILDON_COLOR_CHOOSER_DIALOG_HSV(widget);
+ int tmp, tot, sel;
+
+
+ if(event->keyval == HILDON_HARDKEY_UP || event->keyval == HILDON_HARDKEY_DOWN ||
+ event->keyval == HILDON_HARDKEY_LEFT || event->keyval == HILDON_HARDKEY_RIGHT) {
+ tmp = (dialog->style_info.num_buttons.top * dialog->style_info.num_buttons.bottom);
+ tot = (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right) + tmp;
+
+ switch(event->keyval) {
+ case HILDON_HARDKEY_UP:
+ if(dialog->selected >= dialog->style_info.num_buttons.top) {
+ if(dialog->selected - dialog->style_info.num_buttons.left >= tmp) {
+ sel = dialog->selected - dialog->style_info.num_buttons.left;
+ } else {
+ sel = dialog->selected - dialog->style_info.num_buttons.top;
+ }
+
+ hildon_color_chooser_dialog_hsv_set_color_num(dialog, sel);
+ }
+ break;
+ case HILDON_HARDKEY_DOWN:
+ if(dialog->selected < tot - dialog->style_info.num_buttons.left) {
+ if(dialog->selected < tmp) {
+ sel = dialog->selected + dialog->style_info.num_buttons.top;
+ } else {
+ sel = dialog->selected + dialog->style_info.num_buttons.left;
+ }
+
+ hildon_color_chooser_dialog_hsv_set_color_num(dialog, sel);
+ }
+ break;
+ case HILDON_HARDKEY_LEFT:
+ if((dialog->selected < tmp ? (dialog->selected % dialog->style_info.num_buttons.top) : ((dialog->selected - tmp) % dialog->style_info.num_buttons.left)) > 0) {
+ sel = dialog->selected - 1;
+
+ hildon_color_chooser_dialog_hsv_set_color_num(dialog, sel);
+ }
+ break;
+ case HILDON_HARDKEY_RIGHT:
+ if((dialog->selected < tmp) ? (dialog->selected % dialog->style_info.num_buttons.top < dialog->style_info.num_buttons.top - 1) :
+ ((dialog->selected - tmp) % dialog->style_info.num_buttons.left < dialog->style_info.num_buttons.left - 1)) {
+ sel = dialog->selected + 1;
+
+ hildon_color_chooser_dialog_hsv_set_color_num(dialog, sel);
+ }
+ break;
+ default:
+ break;
+ }
+
+ return FALSE;
+ }
+
+ return GTK_WIDGET_CLASS(parent_klass)->key_press_event(widget, event);
+}
+
+static gboolean hildon_color_chooser_dialog_hsv_key_release_event(GtkWidget *widget, GdkEventKey *event)
+{
+ if(event->keyval == HILDON_HARDKEY_UP || event->keyval == HILDON_HARDKEY_DOWN ||
+ event->keyval == HILDON_HARDKEY_LEFT || event->keyval == HILDON_HARDKEY_RIGHT) {
+ return FALSE;
+ }
+
+ return GTK_WIDGET_CLASS(parent_klass)->key_press_event(widget, event);
+}
+
+
+static void hildon_color_chooser_dialog_hsv_destroy(GtkObject *object)
+{
+ HildonColorChooserDialogHSV *dialog = HILDON_COLOR_CHOOSER_DIALOG_HSV(object);
+ gchar key[128], color[13];
+ int i, tmp;
+
+
+ if(dialog->gconf_data.client) {
+ memset(color, 0, 13);
+
+ tmp = (dialog->style_info.num_buttons.top * dialog->style_info.num_buttons.bottom);
+
+ for(i = 0; i < tmp; i++) {
+ memset(key, 0, 128);
+ g_snprintf(key, 128, "/system/osso/af/color_chooser/custom_color%d", i);
+ hildon_color_chooser_dialog_hsv_color_to_ascii_hex(color, &dialog->colors_custom[i]);
+ gconf_client_set_string(dialog->gconf_data.client, key, color, NULL);
+ }
+
+ g_object_unref(dialog->gconf_data.client);
+ dialog->gconf_data.client = NULL;
+ }
+
+
+ if(dialog->gc_array) {
+ g_free(dialog->gc_array);
+ dialog->gc_array = NULL;
+ } if(dialog->colors_defined) {
+ g_free(dialog->colors_defined);
+ dialog->colors_defined = NULL;
+ } if(dialog->colors_custom) {
+ g_free(dialog->colors_custom);
+ dialog->colors_custom = NULL;
+ }
+
+
+ GTK_OBJECT_CLASS(parent_klass)->destroy(object);
+}
+
+
+static void hildon_color_chooser_dialog_hsv_set_color(HildonColorChooserDialog *dialog, GdkColor *color)
+{
+ HildonColorChooserDialogHSV *dialog_hsv = HILDON_COLOR_CHOOSER_DIALOG_HSV(dialog);
+ int i, found = -1, tmp, tmp2;
+
+
+ if(!dialog_hsv->has_style) {
+ dialog_hsv->pending_color = *color;
+ return;
+ }
+
+
+ tmp = (dialog_hsv->style_info.num_buttons.left * dialog_hsv->style_info.num_buttons.right);
+ tmp2 = (dialog_hsv->style_info.num_buttons.top * dialog_hsv->style_info.num_buttons.bottom);
+
+ for(i = 0; i < tmp; i++) {
+ if(dialog_hsv->colors_defined[i].red == color->red &&
+ dialog_hsv->colors_defined[i].green == color->green &&
+ dialog_hsv->colors_defined[i].blue == color->blue) {
+ found = i;
+ break;
+ }
+ }
+
+ if(found == -1) {
+ for(i = 0; i < tmp2; i++) {
+ if(dialog_hsv->colors_custom[i].red == color->red &&
+ dialog_hsv->colors_custom[i].green == color->green &&
+ dialog_hsv->colors_custom[i].blue == color->blue) {
+ found = i + tmp;
+ break;
+ }
+ }
+ }
+
+
+ if(found == -1) {
+ dialog_hsv->colors_custom[tmp2-1] = *color;
+ if(GTK_WIDGET_REALIZED(GTK_WIDGET(dialog))) {
+ gdk_gc_set_rgb_fg_color(dialog_hsv->gc_array[tmp2-1], color);
+ }
+ hildon_color_chooser_dialog_hsv_set_color_num(dialog_hsv, tmp2-1);
+ } else {
+ hildon_color_chooser_dialog_hsv_set_color_num(dialog_hsv, found);
+ }
+}
+
+
+static gboolean hildon_color_chooser_dialog_hsv_area_expose(GtkWidget *widget, GdkEventExpose *event, gpointer data)
+{
+ HildonColorChooserDialogHSV *dialog = HILDON_COLOR_CHOOSER_DIALOG_HSV(data);
+ int i, num_selected, tot_w, tot_h, spacing, brd, x, y;
+ GdkGC **start_gc;
+ int tmp, w, h;
+
+
+ tmp = (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right);
+
+ if(widget == dialog->area_custom) {
+ num_selected = dialog->selected - tmp;
+ start_gc = dialog->gc_array + tmp;
+ tmp = (dialog->style_info.num_buttons.top * dialog->style_info.num_buttons.bottom);
+ w = dialog->style_info.num_buttons.top; h = dialog->style_info.num_buttons.bottom;
+ } else { /* widget == dialog->area_defined */
+ num_selected = dialog->selected;
+ start_gc = dialog->gc_array;
+ w = dialog->style_info.num_buttons.left; h = dialog->style_info.num_buttons.right;
+ }
+
+ spacing = dialog->style_info.radio_sizes.top;
+ brd = dialog->style_info.radio_sizes.bottom;
+ tot_w = dialog->style_info.radio_sizes.left + 2*brd;
+ tot_h = dialog->style_info.radio_sizes.right + 2*brd;
+
+
+ for(i = 0; i < tmp; i++) {
+ x = ((i % w) * (tot_w + spacing));
+ y = ((i / w) * (tot_h + spacing));
+
+ if(brd) {
+ gtk_paint_box(gtk_widget_get_style(GTK_WIDGET(dialog)), widget->window, (i == num_selected) ? GTK_STATE_SELECTED : GTK_STATE_NORMAL,
+ (i == num_selected) ? GTK_SHADOW_IN : GTK_SHADOW_OUT, &event->area, GTK_WIDGET(dialog), "color-radio", x, y, tot_w, tot_h);
+ }
+
+ gdk_draw_rectangle(widget->window, start_gc[i], TRUE, event->area.x, event->area.y, event->area.width, event->area.height);
+ }
+
+
+ return FALSE;
+}
+
+
+static gboolean hildon_color_chooser_dialog_hsv_area_button_press(GtkWidget *widget, GdkEventButton *event, gpointer data)
+{
+ HildonColorChooserDialogHSV *dialog = HILDON_COLOR_CHOOSER_DIALOG_HSV(data);
+ int i, hskip, vskip, brd, selection = -1;
+ int x, y, tmp, tmp2, w;
+
+
+ x = event->x;
+ y = event->y;
+
+
+ brd = dialog->style_info.radio_sizes.bottom;
+ hskip = dialog->style_info.radio_sizes.left + dialog->style_info.radio_sizes.top + 2*brd;
+ vskip = dialog->style_info.radio_sizes.right + dialog->style_info.radio_sizes.top + 2*brd;
+
+
+ tmp = (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right);
+ tmp2 = (dialog->style_info.num_buttons.top * dialog->style_info.num_buttons.bottom);
+
+
+ if(widget == dialog->area_defined) {
+ w = dialog->style_info.num_buttons.left;
+
+ for(i = 0; i < tmp; i++) {
+ if(x >= hskip*(i % w) + brd && x < hskip*(i % w) + brd + dialog->style_info.radio_sizes.left &&
+ y >= vskip*(i / w) + brd && y < hskip*(i / w) + brd + dialog->style_info.radio_sizes.right) {
+ selection = i;
+ break;
+ }
+ }
+ } else {
+ w = dialog->style_info.num_buttons.top;
+ for(i = 0; i < tmp2; i++) {
+ if(x >= hskip*(i % w) + brd && x < hskip*(i % w) + brd + dialog->style_info.radio_sizes.left &&
+ y >= vskip*(i / w) + brd && y < hskip*(i / w) + brd + dialog->style_info.radio_sizes.right) {
+ selection = i + tmp;
+ break;
+ }
+ }
+ }
+
+
+ if(selection != -1) {
+ hildon_color_chooser_dialog_hsv_set_color_num(dialog, selection);
+ }
+
+
+ return FALSE;
+}
+
+
+static void hildon_color_chooser_dialog_hsv_chooser_color_changed(HildonColorChooser *chooser, GdkColor *color, gpointer data)
+{
+ HildonColorChooserDialogHSV *dialog = HILDON_COLOR_CHOOSER_DIALOG_HSV(data);
+ HildonColorChooserDialog *dia = HILDON_COLOR_CHOOSER_DIALOG(data);
+ char key[128], color_str[13];
+ int tmp;
+
+
+ dia->color = *color;
+
+
+ tmp = (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right);
+
+
+ if(dialog->selected >= tmp) {
+ dialog->colors_custom[dialog->selected - tmp] = *color;
+
+ gdk_gc_set_rgb_fg_color(dialog->gc_array[dialog->selected], &dialog->colors_custom[dialog->selected - tmp]);
+
+ gtk_widget_queue_draw(dialog->area_custom);
+
+
+ if(dialog->gconf_data.client) {
+ memset(key, 0, 128);
+ memset(color_str, 0, 13);
+ g_snprintf(key, 128, "/system/osso/af/color_chooser/custom_color%d", dialog->selected - tmp);
+ hildon_color_chooser_dialog_hsv_color_to_ascii_hex(color_str, &dialog->colors_custom[dialog->selected - tmp]);
+ gconf_client_set_string(dialog->gconf_data.client, key, color_str, NULL);
+ }
+ }
+}
+
+
+static void hildon_color_chooser_dialog_hsv_chooser_insensitive_press(GtkWidget *widget, gpointer data)
+{
+ hildon_banner_show_information(widget, NULL, _("ecdg_ib_colour_selector_predefined"));
+}
+
+ /* function has size defaults */
+static void hildon_color_chooser_dialog_hsv_refresh_style_info(HildonColorChooserDialogHSV *dialog)
+{
+ GtkBorder *tmp1, *tmp2, *tmp3;
+
+
+ gtk_widget_style_get(GTK_WIDGET(dialog), "container_sizes", &tmp1,
+ "radio_sizes", &tmp2, "num_buttons", &tmp3, NULL);
+
+
+ dialog->style_info.last_num_buttons = dialog->style_info.num_buttons;
+
+
+ if(tmp1) {
+ dialog->style_info.cont_sizes = *tmp1;
+ g_free(tmp1);
+ } else {
+ dialog->style_info.cont_sizes.left = 0;
+ dialog->style_info.cont_sizes.right = 8;
+ dialog->style_info.cont_sizes.top = 4;
+ dialog->style_info.cont_sizes.bottom = 0;
+ }
+
+ if(tmp2) {
+ dialog->style_info.radio_sizes = *tmp2;
+ g_free(tmp2);
+ } else {
+ dialog->style_info.radio_sizes.left = 16;
+ dialog->style_info.radio_sizes.right = 16;
+ dialog->style_info.radio_sizes.top = 4;
+ dialog->style_info.radio_sizes.bottom = 2;
+ }
+
+ if(tmp3) {
+ dialog->style_info.num_buttons = *tmp3;
+ g_free(tmp3);
+ } else {
+ dialog->style_info.num_buttons.left = 8;
+ dialog->style_info.num_buttons.right = 2;
+ dialog->style_info.num_buttons.top = 8;
+ dialog->style_info.num_buttons.bottom = 2;
+ }
+}
+
+
+static void hildon_color_chooser_dialog_hsv_set_color_num(HildonColorChooserDialogHSV *dialog, gint num)
+{
+ HildonColorChooserDialog *dia = HILDON_COLOR_CHOOSER_DIALOG(dialog);
+ int tmp;
+
+
+ tmp = (dialog->style_info.num_buttons.left * dialog->style_info.num_buttons.right);
+
+
+ if(num < tmp) {
+ gtk_widget_set_sensitive(dialog->chooser, FALSE);
+ } else {
+ gtk_widget_set_sensitive(dialog->chooser, TRUE);
+ }
+
+
+ dialog->selected = num;
+
+ gtk_widget_queue_draw(dialog->area_custom);
+ gtk_widget_queue_draw(dialog->area_defined);
+
+ dia->color = (num < tmp) ? dialog->colors_defined[num] : dialog->colors_custom[num - tmp];
+
+ hildon_color_chooser_set_color(HILDON_COLOR_CHOOSER(dialog->chooser), (num < tmp) ? &dialog->colors_defined[num] : &dialog->colors_custom[num - tmp]);
+}
+
+
+static void hildon_color_chooser_dialog_hsv_ascii_hex_to_color(gchar *s, GdkColor *color)
+{
+ int vals[12], i;
+
+
+ for(i = 0; i < 12; i++) {
+ if(s[i] >= '0' && s[i] <= '9') {
+ vals[i] = s[i] - 0x30;
+ } else if(s[i] >= 'a' && s[i] <= 'f') {
+ vals[i] = s[i] - 0x57;
+ } else {
+ vals[i] = 0;
+ }
+ }
+
+
+ color->red = (vals[0] << 12) | (vals[1] << 8) | (vals[2 ] << 4) | (vals[3 ] );
+ color->green = (vals[4] << 12) | (vals[5] << 8) | (vals[6 ] << 4) | (vals[7 ] );
+ color->blue = (vals[8] << 12) | (vals[9] << 8) | (vals[10] << 4) | (vals[11] );
+}
+
+static void hildon_color_chooser_dialog_hsv_color_to_ascii_hex(gchar *s, GdkColor *color)
+{
+ g_snprintf(s, 12, "%x%x%x%x%x%x%x%x%x%x%x%x",
+ (color->red >> 12) & 0xf, (color->red >> 8) & 0xf,
+ (color->red >> 4) & 0xf, (color->red ) & 0xf,
+ (color->green >> 12) & 0xf, (color->green >> 8) & 0xf,
+ (color->green >> 4) & 0xf, (color->green ) & 0xf,
+ (color->blue >> 12) & 0xf, (color->blue >> 8) & 0xf,
+ (color->blue >> 4) & 0xf, (color->blue ) & 0xf);
+}
--- /dev/null
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation.
+ *
+ * Author: Kuisma Salonen <kuisma.salonen@nokia.com>
+ * 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
+ *
+ */
+
+#include <gtk/gtk.h>
+
+#include <hildon-widgets/hildon-color-chooser.h>
+
+
+const char *parent_name = "HildonColorChooser";
+const char *plugin_name = "HSV color chooser";
+
+GType export_type(void);
+
+
+typedef struct {
+ HildonColorChooser parent;
+
+ GtkAllocation hba;
+ GtkAllocation spa;
+
+ unsigned short currhue;
+ unsigned short currsat;
+ unsigned short currval;
+
+ int mousestate;
+ gboolean mousein;
+
+
+ GdkWindow *event_window;
+
+
+ struct {
+ unsigned short last_expose_hue;
+
+ GTimeVal last_expose_time;
+
+ int expose_queued;
+ } expose_info;
+} HildonColorChooserHSV;
+
+typedef struct {
+ HildonColorChooserClass parent;
+} HildonColorChooserHSVClass;
+
+
+#define HILDON_COLOR_CHOOSER_HSV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), export_type(), HildonColorChooserHSV))
+#define HILDON_COLOR_CHOOSER_HSV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), export_type(), HildonColorChooserHSVClass))
+
+
+static HildonColorChooserClass *parent_class = NULL;
+
+
+ /* "crosshair" is hardcoded for now */
+static gchar crosshair[64] = { 0, 0, 0, 2, 2, 0, 0, 0,
+ 0, 2, 2, 3, 3, 2, 2, 0,
+ 0, 2, 3, 0, 0, 3, 2, 0,
+ 2, 3, 0, 0, 0, 0, 3, 2,
+ 2, 3, 0, 0, 0, 0, 3, 2,
+ 0, 2, 3, 0, 0, 3, 2, 0,
+ 0, 2, 2, 3, 3, 2, 2, 0,
+ 0, 0, 0, 2, 2, 0, 0, 0};
+
+
+static void hildon_color_chooser_hsv_init(HildonColorChooserHSV *sel);
+static void hildon_color_chooser_hsv_class_init(HildonColorChooserHSVClass *klass);
+
+static void hildon_color_chooser_hsv_destroy(GtkObject *obj);
+
+static void hildon_color_chooser_hsv_size_request(GtkWidget *widget, GtkRequisition *req);
+static void hildon_color_chooser_hsv_size_allocate(GtkWidget *widget, GtkAllocation *alloc);
+
+static void hildon_color_chooser_hsv_realize(GtkWidget *widget);
+
+static void hildon_color_chooser_hsv_map(GtkWidget *widget);
+static void hildon_color_chooser_hsv_unmap(GtkWidget *widget);
+
+static gboolean hildon_color_chooser_hsv_expose(GtkWidget *widget, GdkEventExpose *event);
+
+static gboolean hildon_color_chooser_button_press(GtkWidget *widget, GdkEventButton *event);
+static gboolean hildon_color_chooser_button_release(GtkWidget *widget, GdkEventButton *event);
+static gboolean hildon_color_chooser_pointer_motion(GtkWidget *widget, GdkEventMotion *event);
+
+static void hildon_color_chooser_hsv_set_color(HildonColorChooser *sel, GdkColor *color);
+
+
+static void internal_get_border(GtkWidget *w, char *name, GtkBorder *b);
+static void _internal_init_borders(GtkWidget *w, GtkBorder *inner, GtkBorder *outer);
+
+static void internal_invoke_color_changed(HildonColorChooserHSV *sel);
+
+
+inline void inline_clip_to_alloc(void *s, GtkAllocation *a);
+
+inline void inline_sub_times(GTimeVal *result, GTimeVal *greater, GTimeVal *lesser);
+
+inline void inline_limited_expose(HildonColorChooserHSV *sel);
+
+inline void inline_draw_hue_bar(GtkWidget *widget, int x, int y, int w, int h, int sy, int sh);
+inline void inline_draw_hue_bar_dimmed(GtkWidget *widget, int x, int y, int w, int h, int sy, int sh);
+
+inline void inline_draw_sv_plane(HildonColorChooserHSV *sel, int x, int y, int w, int h);
+inline void inline_draw_sv_plane_dimmed(HildonColorChooserHSV *sel, int x, int y, int w, int h);
+
+inline void inline_draw_crosshair(unsigned char *buf, int x, int y, int w, int h);
+
+
+inline void inline_h2rgb(unsigned short hue, unsigned long *rgb);
+
+
+static gboolean hildon_color_chooser_hsv_expose_timer(gpointer data);
+
+
+GType export_type()
+{
+ static GType chooser_type = 0;
+
+ if (!chooser_type) {
+ static const GTypeInfo chooser_info =
+ {
+ sizeof (HildonColorChooserHSVClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) hildon_color_chooser_hsv_class_init,
+ NULL,
+ NULL,
+ sizeof (HildonColorChooserHSV),
+ 0,
+ (GInstanceInitFunc) hildon_color_chooser_hsv_init,
+ NULL
+ };
+
+ chooser_type = g_type_register_static (HILDON_TYPE_COLOR_CHOOSER,
+ "HildonColorChooserHSV",
+ &chooser_info, 0);
+ }
+
+ return chooser_type;
+}
+
+static void hildon_color_chooser_hsv_init(HildonColorChooserHSV *sel)
+{
+ GTK_WIDGET_SET_FLAGS (sel, GTK_NO_WINDOW);
+
+
+ sel->currhue = 0;
+ sel->currsat = 0;
+ sel->currval = 0;
+
+ sel->mousestate = 0;
+ sel->mousein = FALSE;
+
+
+ g_get_current_time(&sel->expose_info.last_expose_time);
+
+ sel->expose_info.last_expose_hue = sel->currhue;
+ sel->expose_info.expose_queued = 0;
+}
+
+static void hildon_color_chooser_hsv_class_init(HildonColorChooserHSVClass *klass)
+{
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS(klass);
+
+ HildonColorChooserClass *selection_class = HILDON_COLOR_CHOOSER_CLASS(klass);
+
+
+ parent_class = g_type_class_peek_parent(klass);
+
+
+ object_class->destroy = hildon_color_chooser_hsv_destroy;
+
+
+ widget_class->size_request = hildon_color_chooser_hsv_size_request;
+ widget_class->size_allocate = hildon_color_chooser_hsv_size_allocate;
+
+ widget_class->realize = hildon_color_chooser_hsv_realize;
+
+ widget_class->map = hildon_color_chooser_hsv_map;
+ widget_class->unmap = hildon_color_chooser_hsv_unmap;
+
+ widget_class->expose_event = hildon_color_chooser_hsv_expose;
+
+ widget_class->button_press_event = hildon_color_chooser_button_press;
+ widget_class->button_release_event = hildon_color_chooser_button_release;
+ widget_class->motion_notify_event = hildon_color_chooser_pointer_motion;
+
+
+ selection_class->set_color = hildon_color_chooser_hsv_set_color;
+
+
+ gtk_widget_class_install_style_property(widget_class,
+ g_param_spec_boxed("inner_size",
+ "Inner sizes",
+ "Sizes of SV plane, H bar and spacing",
+ GTK_TYPE_BORDER,
+ G_PARAM_READABLE));
+ gtk_widget_class_install_style_property(widget_class,
+ g_param_spec_boxed("graphic_border",
+ "Graphical borders",
+ "Size of graphical border",
+ GTK_TYPE_BORDER,
+ G_PARAM_READABLE));
+}
+
+
+static void hildon_color_chooser_hsv_destroy(GtkObject *obj)
+{
+ GTK_OBJECT_CLASS(parent_class)->destroy(obj);
+}
+
+
+static void hildon_color_chooser_hsv_size_request(GtkWidget *widget, GtkRequisition *req)
+{
+ GtkBorder inner, outer;
+
+
+ _internal_init_borders(widget, &inner, &outer);
+
+
+ req->width = inner.left + inner.top + inner.bottom + outer.left + outer.right;
+ req->height = inner.right + outer.top + outer.bottom;
+}
+
+static void hildon_color_chooser_hsv_size_allocate(GtkWidget *widget, GtkAllocation *alloc)
+{
+ HildonColorChooserHSV *sel = HILDON_COLOR_CHOOSER_HSV(widget);
+ GtkBorder outer, inner;
+
+
+ widget->allocation = *alloc;
+
+
+ _internal_init_borders(widget, &inner, &outer);
+
+
+ sel->hba.height = alloc->height - outer.top - outer.bottom;
+ sel->hba.y = alloc->y + outer.top;
+ sel->hba.width = inner.top;
+ sel->hba.x = alloc->x + alloc->width - outer.right - inner.top;
+
+ sel->spa.x = alloc->x + outer.left;
+ sel->spa.y = alloc->y + outer.top;
+ sel->spa.height = alloc->height - outer.top - outer.bottom;
+ sel->spa.width = alloc->width - outer.left - outer.right - inner.top - inner.bottom;
+
+
+ if(GTK_WIDGET_REALIZED(widget)) {
+ gdk_window_move_resize(sel->event_window, widget->allocation.x, widget->allocation.y, widget->allocation.width, widget->allocation.height);
+ }
+}
+
+
+static void hildon_color_chooser_hsv_realize(GtkWidget *widget)
+{
+ HildonColorChooserHSV *sel = HILDON_COLOR_CHOOSER_HSV(widget);
+ GdkWindowAttr attributes;
+ gint attributes_mask;
+
+ attributes.x = widget->allocation.x;
+ attributes.y = widget->allocation.y;
+ attributes.width = widget->allocation.width;
+ attributes.height = widget->allocation.height;
+ attributes.wclass = GDK_INPUT_ONLY;
+ attributes.window_type = GDK_WINDOW_CHILD;
+ attributes.event_mask = gtk_widget_get_events(widget) | GDK_BUTTON_PRESS_MASK |
+ GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK |
+ GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK |
+ GDK_BUTTON1_MOTION_MASK;
+ attributes.visual = gtk_widget_get_visual(widget);
+ attributes.colormap = gtk_widget_get_colormap(widget);
+
+ attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_WMCLASS;
+ sel->event_window = gdk_window_new (widget->parent->window, &attributes, attributes_mask);
+
+
+ gdk_window_set_user_data(sel->event_window, widget);
+
+
+ widget->window = gtk_widget_get_parent_window(widget);
+
+
+ widget->style = gtk_style_attach(widget->style, widget->window);
+
+
+ GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);
+}
+
+
+static void hildon_color_chooser_hsv_map(GtkWidget *widget)
+{
+ HildonColorChooserHSV *sel = HILDON_COLOR_CHOOSER_HSV(widget);
+
+
+ GTK_WIDGET_CLASS(parent_class)->map(widget);
+
+ if(sel->event_window) {
+ gdk_window_show(sel->event_window);
+ }
+}
+
+static void hildon_color_chooser_hsv_unmap(GtkWidget *widget)
+{
+ HildonColorChooserHSV *sel = HILDON_COLOR_CHOOSER_HSV(widget);
+
+
+ if(sel->event_window) {
+ gdk_window_hide(sel->event_window);
+ }
+
+ GTK_WIDGET_CLASS(parent_class)->unmap(widget);
+}
+
+
+inline void inline_clip_to_alloc(void *s, GtkAllocation *a)
+{
+ struct {
+ int x, y, w, h;
+ } *area = s;
+
+
+ if(area->x < a->x) {
+ area->w -= a->x - area->x;
+ area->x = a->x;
+ } if(area->y < a->y) {
+ area->h -= a->y - area->y;
+ area->y = a->y;
+ }
+ if(area->x + area->w > a->x + a->width) area->w = a->width - (area->x - a->x);
+ if(area->y + area->h > a->y + a->height) area->h = a->height - (area->y - a->y);
+}
+
+static gboolean hildon_color_chooser_hsv_expose(GtkWidget *widget, GdkEventExpose *event)
+{
+ HildonColorChooserHSV *sel = HILDON_COLOR_CHOOSER_HSV(widget);
+ GtkBorder graphical_border;
+ struct {
+ int x, y, w, h;
+ } area;
+
+
+ if(!GTK_WIDGET_REALIZED(widget)) {
+ return FALSE;
+ }
+
+
+ internal_get_border(widget, "graphic_border", &graphical_border);
+
+
+ if(event->area.width || event->area.height) {
+ if(graphical_border.top) {
+ gtk_paint_box(gtk_widget_get_style(widget), widget->window, GTK_WIDGET_STATE(widget),
+ GTK_SHADOW_NONE, &event->area, widget, "border-top",
+ sel->hba.x - graphical_border.left, sel->hba.y - graphical_border.top,
+ sel->hba.width + graphical_border.left + graphical_border.right,
+ graphical_border.top);
+ gtk_paint_box(gtk_widget_get_style(widget), widget->window, GTK_WIDGET_STATE(widget),
+ GTK_SHADOW_NONE, &event->area, widget, "border-top",
+ sel->spa.x - graphical_border.left, sel->spa.y - graphical_border.top,
+ sel->spa.width + graphical_border.left + graphical_border.right,
+ graphical_border.top);
+ }
+
+ if(graphical_border.bottom) {
+ gtk_paint_box(gtk_widget_get_style(widget), widget->window, GTK_WIDGET_STATE(widget),
+ GTK_SHADOW_NONE, &event->area, widget, "border-bottom",
+ sel->hba.x - graphical_border.left, sel->hba.y + sel->hba.height,
+ sel->hba.width + graphical_border.left + graphical_border.right,
+ graphical_border.bottom);
+ gtk_paint_box(gtk_widget_get_style(widget), widget->window, GTK_WIDGET_STATE(widget),
+ GTK_SHADOW_NONE, &event->area, widget, "border-bottom",
+ sel->spa.x - graphical_border.left, sel->spa.y + sel->spa.height,
+ sel->spa.width + graphical_border.left + graphical_border.right,
+ graphical_border.bottom);
+ }
+
+ if(graphical_border.left) {
+ gtk_paint_box(gtk_widget_get_style(widget), widget->window, GTK_WIDGET_STATE(widget),
+ GTK_SHADOW_NONE, &event->area, widget, "border-left",
+ sel->hba.x - graphical_border.left, sel->hba.y,
+ graphical_border.left, sel->hba.height);
+ gtk_paint_box(gtk_widget_get_style(widget), widget->window, GTK_WIDGET_STATE(widget),
+ GTK_SHADOW_NONE, &event->area, widget, "border-left",
+ sel->spa.x - graphical_border.left, sel->spa.y,
+ graphical_border.left, sel->spa.height);
+ }
+
+ if(graphical_border.right) {
+ gtk_paint_box(gtk_widget_get_style(widget), widget->window, GTK_WIDGET_STATE(widget),
+ GTK_SHADOW_NONE, &event->area, widget, "border-right",
+ sel->hba.x + sel->hba.width, sel->hba.y,
+ graphical_border.right, sel->hba.height);
+ gtk_paint_box(gtk_widget_get_style(widget), widget->window, GTK_WIDGET_STATE(widget),
+ GTK_SHADOW_NONE, &event->area, widget, "border-right",
+ sel->spa.x + sel->spa.width, sel->spa.y,
+ graphical_border.right, sel->spa.height);
+ }
+ }
+
+
+ if(sel->expose_info.expose_queued) {
+ if(GTK_WIDGET_SENSITIVE(widget)) {
+ inline_draw_hue_bar(widget, sel->hba.x, sel->hba.y, sel->hba.width, sel->hba.height, sel->hba.y, sel->hba.height);
+
+ inline_draw_sv_plane(sel, sel->spa.x, sel->spa.y, sel->spa.width, sel->spa.height);
+ } else {
+ inline_draw_hue_bar_dimmed(widget, sel->hba.x, sel->hba.y, sel->hba.width, sel->hba.height, sel->hba.y, sel->hba.height);
+
+ inline_draw_sv_plane_dimmed(sel, sel->spa.x, sel->spa.y, sel->spa.width, sel->spa.height);
+ }
+
+
+ sel->expose_info.expose_queued = 0;
+
+ g_get_current_time(&sel->expose_info.last_expose_time);
+ } else {
+ /* clip hue bar region */
+ area.x = event->area.x;
+ area.y = event->area.y;
+ area.w = event->area.width;
+ area.h = event->area.height;
+
+ inline_clip_to_alloc(&area, &sel->hba);
+
+ if(GTK_WIDGET_SENSITIVE(widget)) {
+ inline_draw_hue_bar(widget, area.x, area.y, area.w, area.h, sel->hba.y, sel->hba.height);
+ } else {
+ inline_draw_hue_bar_dimmed(widget, area.x, area.y, area.w, area.h, sel->hba.y, sel->hba.height);
+ }
+
+
+ area.x = event->area.x;
+ area.y = event->area.y;
+ area.w = event->area.width;
+ area.h = event->area.height;
+
+ inline_clip_to_alloc(&area, &sel->spa);
+
+ if(GTK_WIDGET_SENSITIVE(widget)) {
+ inline_draw_sv_plane(sel, area.x, area.y, area.w, area.h);
+ } else {
+ inline_draw_sv_plane_dimmed(sel, area.x, area.y, area.w, area.h);
+ }
+ }
+
+
+ return FALSE;
+}
+
+
+inline void inline_sub_times(GTimeVal *result, GTimeVal *greater, GTimeVal *lesser)
+{
+ result->tv_sec = greater->tv_sec - lesser->tv_sec;
+ result->tv_usec = greater->tv_usec - lesser->tv_usec;
+
+ if(result->tv_usec < 0) {
+ result->tv_sec--;
+ result->tv_usec += 1000000;
+ }
+}
+
+#define EXPOSE_INTERVAL 50000
+inline void inline_limited_expose(HildonColorChooserHSV *sel)
+{
+ GTimeVal curr_time, result;
+ GdkEventExpose event;
+
+
+ if(!GTK_WIDGET_REALIZED(GTK_WIDGET(sel))) {
+ return;
+ }
+
+
+ if(sel->currhue == sel->expose_info.last_expose_hue) {
+ return; /* no need to redraw */
+ }
+
+
+ sel->expose_info.last_expose_hue = sel->currhue;
+
+
+ g_get_current_time(&curr_time);
+
+ inline_sub_times(&result, &curr_time, &sel->expose_info.last_expose_time);
+
+ if(result.tv_sec != 0 || result.tv_usec >= EXPOSE_INTERVAL) {
+ sel->expose_info.expose_queued = 1;
+
+#if 1
+ event.type = GDK_EXPOSE;
+ event.area.width = 0;
+ event.area.height = 0;
+ event.window = GTK_WIDGET(sel)->window;
+
+ gtk_widget_send_expose(GTK_WIDGET(sel), (GdkEvent *)&event);
+#else
+ gtk_widget_queue_draw(GTK_WIDGET(sel));
+#endif
+ } else if(!sel->expose_info.expose_queued) {
+ sel->expose_info.expose_queued = 1;
+
+
+ g_timeout_add((EXPOSE_INTERVAL - result.tv_usec)/1000, hildon_color_chooser_hsv_expose_timer, sel);
+ }
+}
+
+static gboolean hildon_color_chooser_button_press(GtkWidget *widget, GdkEventButton *event)
+{
+ HildonColorChooserHSV *sel = HILDON_COLOR_CHOOSER_HSV(widget);
+ int x, y, tmp;
+
+
+ x = (int)event->x + widget->allocation.x;
+ y = (int)event->y + widget->allocation.y;
+
+
+ if(x >= sel->spa.x && x <= sel->spa.x + sel->spa.width &&
+ y >= sel->spa.y && y <= sel->spa.y + sel->spa.height) {
+ tmp = y - sel->spa.y;
+ sel->currsat = tmp * 0xffff / sel->spa.height;
+ tmp = x - sel->spa.x;
+ sel->currval = tmp * 0xffff / sel->spa.width;
+
+ internal_invoke_color_changed(sel);
+ gtk_widget_queue_draw(widget);
+
+ sel->mousestate = 1;
+ sel->mousein = TRUE;
+
+ gtk_grab_add(widget);
+ } else if(x >= sel->hba.x && x <= sel->hba.x + sel->hba.width &&
+ y >= sel->hba.y && y <= sel->hba.y + sel->hba.height) {
+ tmp = y - sel->hba.y;
+ sel->currhue = tmp * 0xffff / sel->hba.height;
+
+ internal_invoke_color_changed(sel);
+ inline_limited_expose(sel);
+
+ sel->mousestate = 2;
+ sel->mousein = TRUE;
+
+ gtk_grab_add(widget);
+ }
+
+
+ return FALSE;
+}
+
+static gboolean hildon_color_chooser_button_release(GtkWidget *widget, GdkEventButton *event)
+{
+ HildonColorChooserHSV *sel = HILDON_COLOR_CHOOSER_HSV(widget);
+
+
+ if(sel->mousestate) {
+ gtk_grab_remove(widget);
+ }
+
+
+ sel->mousestate = 0;
+ sel->mousein = FALSE;
+
+
+ return FALSE;
+}
+
+static gboolean hildon_color_chooser_pointer_motion(GtkWidget *widget, GdkEventMotion *event)
+{
+ HildonColorChooserHSV *sel = HILDON_COLOR_CHOOSER_HSV(widget);
+ GdkModifierType mods;
+ gint x, y, tmp;
+
+
+ if (event->is_hint || (event->window != widget->window))
+ gdk_window_get_pointer (widget->window, &x, &y, &mods);
+
+
+ if(sel->mousestate == 1) {
+ if(x >= sel->spa.x && x <= sel->spa.x + sel->spa.width &&
+ y >= sel->spa.y && y <= sel->spa.y + sel->spa.height) {
+ sel->currsat = (((long)(y - sel->spa.y)) * 0xffff)/sel->spa.height;
+ sel->currval = (((long)(x - sel->spa.x)) * 0xffff)/sel->spa.width;
+
+ internal_invoke_color_changed(sel);
+ gtk_widget_queue_draw(widget);
+ } else if(sel->mousein == TRUE) {
+ }
+ } else if(sel->mousestate == 2) {
+ if(x >= sel->hba.x && x <= sel->hba.x + sel->hba.width &&
+ y >= sel->hba.y && y <= sel->hba.y + sel->hba.height) {
+ tmp = y - sel->hba.y;
+ tmp *= 0xffff;
+ tmp /= sel->hba.height;
+
+ if(tmp != sel->currhue) {
+ sel->currhue = tmp;
+
+ internal_invoke_color_changed(sel);
+ inline_limited_expose(sel);
+ }
+ } else if(sel->mousein == TRUE) {
+ }
+ }
+
+ return FALSE;
+}
+
+
+static void internal_get_border(GtkWidget *w, char *name, GtkBorder *b)
+{
+ GtkBorder *tb;
+
+ gtk_widget_style_get(w, name, &tb, NULL);
+
+ if(tb) {
+ *b = *tb;
+ g_free(tb);
+ } else {
+ b->left = 0;
+ b->right = 0;
+ b->top = 0;
+ b->bottom = 0;
+ }
+}
+
+
+static void _internal_init_borders(GtkWidget *w, GtkBorder *inner, GtkBorder *outer)
+{
+ GtkBorder *tb;
+
+
+ internal_get_border(w, "outer_border", outer);
+
+
+ gtk_widget_style_get(w, "inner_size", &tb, NULL);
+
+ if(tb) {
+ *inner = *tb;
+ g_free(tb);
+ } else {
+ inner->left = 64;
+ inner->right = 64;
+ inner->top = 12;
+ inner->bottom = 2;
+ }
+
+ if(inner->left < 2) inner->left = 2;
+ if(inner->right < 2) inner->right = 2;
+ if(inner->top < 2) inner->top = 2;
+}
+
+ /* calculate RGB color & emit signal */
+static void internal_invoke_color_changed(HildonColorChooserHSV *sel)
+{
+ HildonColorChooser *parent_sel = HILDON_COLOR_CHOOSER(sel);
+ GdkVisual *system_visual = gdk_visual_get_system();
+ unsigned long rgb[3], rgb2[3];
+
+
+ inline_h2rgb(sel->currhue, rgb);
+
+ rgb2[0] = 0xffffff - rgb[0];
+ rgb2[1] = 0xffffff - rgb[1];
+ rgb2[2] = 0xffffff - rgb[2];
+
+
+ parent_sel->color.red = ((rgb[0] >> 8) + ((rgb2[0] >> 8) * (0xffff - sel->currsat) / 0xffff)) * sel->currval / 0xffff;
+ parent_sel->color.green = ((rgb[1] >> 8) + ((rgb2[1] >> 8) * (0xffff - sel->currsat) / 0xffff)) * sel->currval / 0xffff;
+ parent_sel->color.blue = ((rgb[2] >> 8) + ((rgb2[2] >> 8) * (0xffff - sel->currsat) / 0xffff)) * sel->currval / 0xffff;
+
+ parent_sel->color.pixel = ((parent_sel->color.red >> (16 - system_visual->red_prec)) << system_visual->red_shift) |
+ ((parent_sel->color.green >> (16 - system_visual->green_prec)) << system_visual->green_shift) |
+ ((parent_sel->color.blue >> (16 - system_visual->blue_prec)) << system_visual->blue_shift);
+
+
+ hildon_color_chooser_emit_color_changed(HILDON_COLOR_CHOOSER(sel));
+}
+
+ /* do the RGB -> HSV conversion here, not so time critical */
+static void hildon_color_chooser_hsv_set_color(HildonColorChooser *sel, GdkColor *color)
+{
+ HildonColorChooserHSV *sel_hsv = HILDON_COLOR_CHOOSER_HSV(sel);
+ unsigned short hue, sat, val;
+ unsigned long min, max;
+ signed long tmp, diff;
+
+ /* ugly nesting */
+ min = MIN(MIN(color->red, color->green), color->blue);
+ max = MAX(MAX(color->red, color->green), color->blue);
+ diff = max - min;
+
+
+ val = max;
+
+ if(val > 0 && diff != 0) {
+ sat = (diff * 0x0000ffff) / max;
+
+ if(color->red == max) {
+ tmp = (signed)color->green - (signed)color->blue;
+ tmp *= 10922;
+ tmp /= diff;
+ if(tmp < 0) {
+ tmp += 65532;
+ }
+ hue = tmp;
+ } else if(color->green == max) {
+ hue = (((signed long)color->blue - (signed long)color->red)*10922 / diff) + 21844;
+ } else {
+ hue = (((signed long)color->red - (signed long)color->green)*10922 / diff) + 43688;
+ }
+ } else {
+ hue = 0;
+ sat = 0;
+ }
+
+
+ sel_hsv->currhue = hue;
+ sel_hsv->currsat = sat;
+ sel_hsv->currval = val;
+
+
+ inline_limited_expose(sel_hsv);
+}
+
+
+#define FULL_COLOR 0x00ffffff
+inline void inline_h2rgb(unsigned short hue, unsigned long *rgb)
+{
+ unsigned short hue_rotation, hue_value;
+
+ hue_rotation = hue / 10922;
+ hue_value = hue % 10922;
+
+
+ switch(hue_rotation) {
+ case 0:
+ case 6:
+ rgb[0] = FULL_COLOR;
+ rgb[1] = hue_value * 6*256;
+ rgb[2] = 0;
+ break;
+ case 1:
+ rgb[0] = FULL_COLOR - (hue_value * 6*256);
+ rgb[1] = FULL_COLOR;
+ rgb[2] = 0;
+ break;
+ case 2:
+ rgb[0] = 0;
+ rgb[1] = FULL_COLOR;
+ rgb[2] = hue_value * 6*256;
+ break;
+ case 3:
+ rgb[0] = 0;
+ rgb[1] = FULL_COLOR - (hue_value * 6*256);
+ rgb[2] = FULL_COLOR;
+ break;
+ case 4:
+ rgb[0] = hue_value * 6*256;
+ rgb[1] = 0;
+ rgb[2] = FULL_COLOR;
+ break;
+ case 5:
+ rgb[0] = FULL_COLOR;
+ rgb[1] = 0;
+ rgb[2] = FULL_COLOR - (hue_value * 6*256);
+ break;
+ default:
+ rgb[0] = 0;
+ rgb[1] = 0;
+ rgb[2] = 0;
+ break;
+ }
+}
+
+#define FULL_COLOR8 0xff
+static void intern_h2rgb8(unsigned short hue, unsigned char *rgb)
+{
+ unsigned short hue_rotation, hue_value;
+
+ hue >>= 8;
+ hue_rotation = hue / 42;
+ hue_value = hue % 42;
+
+
+ switch(hue_rotation) {
+ case 0:
+ case 6:
+ rgb[0] = FULL_COLOR8;
+ rgb[1] = hue_value * 6;
+ rgb[2] = 0;
+ break;
+ case 1:
+ rgb[0] = FULL_COLOR8 - (hue_value * 6);
+ rgb[1] = FULL_COLOR8;
+ rgb[2] = 0;
+ break;
+ case 2:
+ rgb[0] = 0;
+ rgb[1] = FULL_COLOR8;
+ rgb[2] = hue_value * 6;
+ break;
+ case 3:
+ rgb[0] = 0;
+ rgb[1] = FULL_COLOR8 - (hue_value * 6);
+ rgb[2] = FULL_COLOR8;
+ break;
+ case 4:
+ rgb[0] = hue_value * 6;
+ rgb[1] = 0;
+ rgb[2] = FULL_COLOR8;
+ break;
+ case 5:
+ rgb[0] = FULL_COLOR8;
+ rgb[1] = 0;
+ rgb[2] = FULL_COLOR8 - (hue_value * 6);
+ break;
+ default:
+ rgb[0] = 0;
+ rgb[1] = 0;
+ rgb[2] = 0;
+ break;
+ }
+}
+
+
+ /* optimization: do not ask hue for each round but have bilinear vectors */
+ /* rethink: benefits from handling data 8 bit? (no shift round) */
+inline void inline_draw_hue_bar(GtkWidget *widget, int x, int y, int w, int h, int sy, int sh)
+{
+ HildonColorChooserHSV *sel = HILDON_COLOR_CHOOSER_HSV(widget);
+ unsigned short hvec, hcurr;
+ unsigned char *buf, *ptr, tmp[3];
+ int i, j, tmpy;
+
+
+ if(w <= 0 || h <= 0) {
+ return;
+ }
+
+
+ buf = (unsigned char *)g_malloc(w*h*3);
+
+ hvec = 65535/sh;
+ hcurr = hvec * (y - sy);
+
+ ptr = buf;
+
+
+ for(i = 0; i < h; i++) {
+ intern_h2rgb8(hcurr, tmp);
+
+ for(j = 0; j < w; j++) {
+ ptr[0] = tmp[0];
+ ptr[1] = tmp[1];
+ ptr[2] = tmp[2];
+ ptr += 3;
+ }
+
+ hcurr += hvec;
+ }
+
+
+ gdk_draw_rgb_image(widget->parent->window, widget->style->fg_gc[0], x, y, w, h, GDK_RGB_DITHER_NONE, buf, w*3);
+
+ tmpy = sel->hba.y + (sel->currhue * sel->hba.height / 0xffff);
+ gdk_draw_line(widget->parent->window, widget->style->fg_gc[GTK_WIDGET_STATE(widget)], sel->hba.x, tmpy, sel->hba.x + sel->hba.width - 1, tmpy);
+
+ if((((sel->currhue * sel->hba.height) & 0xffff) > 0x8000) && (tmpy < (sel->hba.y + sel->hba.height))) {
+ gdk_draw_line(widget->parent->window, widget->style->fg_gc[GTK_WIDGET_STATE(widget)], sel->hba.x, tmpy+1, sel->hba.x + sel->hba.width - 1, tmpy+1);
+ } else if(tmpy > sel->hba.y) {
+ gdk_draw_line(widget->parent->window, widget->style->fg_gc[GTK_WIDGET_STATE(widget)], sel->hba.x, tmpy-1, sel->hba.x + sel->hba.width - 1, tmpy-1);
+ }
+
+
+ g_free(buf);
+}
+
+inline void inline_draw_hue_bar_dimmed(GtkWidget *widget, int x, int y, int w, int h, int sy, int sh)
+{
+ unsigned short hvec, hcurr, avg;
+ unsigned char *buf, *ptr, tmp[3];
+ int i, j;
+
+
+ if(w <= 0 || h <= 0) {
+ return;
+ }
+
+
+ buf = (unsigned char *)g_malloc(w*h*3);
+
+ hvec = 65535/sh;
+ hcurr = hvec * (y - sy);
+
+ ptr = buf;
+
+
+ for(i = 0; i < h; i++) {
+ intern_h2rgb8(hcurr, tmp);
+
+ for(j = 0; j < w; j++) {
+ avg = ((unsigned short)tmp[0]*3 + (unsigned short)tmp[1]*2 + (unsigned short)tmp[2])/6;
+ ptr[0] = avg;
+ ptr[1] = avg;
+ ptr[2] = avg;
+ ptr += 3;
+ }
+
+ hcurr += hvec;
+ }
+
+
+ gdk_draw_rgb_image(widget->parent->window, widget->style->fg_gc[0], x, y, w, h, GDK_RGB_DITHER_NONE, buf, w*3);
+
+
+ g_free(buf);
+}
+
+
+inline void inline_draw_crosshair(unsigned char *buf, int x, int y, int w, int h)
+{
+ int i, j, sx, sy;
+
+ /* bad "clipping", clip the loop to save cpu */
+ for(i = 0; i < 8; i++) {
+ for(j = 0; j < 8; j++) {
+ sx = j + x; sy = i + y;
+
+ if(sx >= 0 && sx < w && sy >= 0 && sx < h) {
+ if(crosshair[j + 8*i]) {
+ if(crosshair[j + 8*i] & 0x1) {
+ buf[(sx)*3+(sy)*w*3+0] = 255;
+ buf[(sx)*3+(sy)*w*3+1] = 255;
+ buf[(sx)*3+(sy)*w*3+2] = 255;
+ } else {
+ buf[(sx)*3+(sy)*w*3+0] = 0;
+ buf[(sx)*3+(sy)*w*3+1] = 0;
+ buf[(sx)*3+(sy)*w*3+2] = 0;
+ }
+ }
+ }
+ }
+ }
+}
+
+
+inline void inline_draw_sv_plane(HildonColorChooserHSV *sel, int x, int y, int w, int h)
+{
+ GtkWidget *widget = GTK_WIDGET(sel);
+ unsigned char *buf, *ptr;
+ unsigned long rgbx[3] = { 0x00ffffff, 0x00ffffff, 0x00ffffff }, rgbtmp[3];
+ signed long rgby[3];
+ int tmp = sel->spa.width*sel->spa.height, i, j;
+
+
+ if(w <= 0 || h <= 0) {
+ return;
+ }
+
+
+ buf = (unsigned char *)g_malloc(w*h*3);
+
+ ptr = buf;
+
+
+ inline_h2rgb(sel->currhue, rgbtmp);
+
+ rgby[0] = rgbtmp[0] - rgbx[0];
+ rgby[1] = rgbtmp[1] - rgbx[1];
+ rgby[2] = rgbtmp[2] - rgbx[2];
+
+ rgbx[0] /= sel->spa.width;
+ rgbx[1] /= sel->spa.width;
+ rgbx[2] /= sel->spa.width;
+
+ rgby[0] /= tmp;
+ rgby[1] /= tmp;
+ rgby[2] /= tmp;
+
+
+ rgbx[0] += (y - sel->spa.y)*rgby[0];
+ rgbx[1] += (y - sel->spa.y)*rgby[1];
+ rgbx[2] += (y - sel->spa.y)*rgby[2];
+
+
+ for(i = 0; i < h; i++) {
+ rgbtmp[0] = rgbx[0] * (x - sel->spa.x);
+ rgbtmp[1] = rgbx[1] * (x - sel->spa.x);
+ rgbtmp[2] = rgbx[2] * (x - sel->spa.x);
+
+ for(j = 0; j < w; j++) {
+ ptr[0] = rgbtmp[0] >> 16;
+ ptr[1] = rgbtmp[1] >> 16;
+ ptr[2] = rgbtmp[2] >> 16;
+ rgbtmp[0] += rgbx[0];
+ rgbtmp[1] += rgbx[1];
+ rgbtmp[2] += rgbx[2];
+ ptr += 3;
+ }
+
+ rgbx[0] += rgby[0];
+ rgbx[1] += rgby[1];
+ rgbx[2] += rgby[2];
+ }
+
+
+ inline_draw_crosshair(buf, (sel->spa.width * sel->currval / 0xffff) - x + sel->spa.x - 4, (sel->spa.height * sel->currsat / 0xffff) - y + sel->spa.y - 4, w, h);
+
+
+ gdk_draw_rgb_image(widget->parent->window, widget->style->fg_gc[0], x, y, w, h, GDK_RGB_DITHER_NONE, buf, w*3);
+
+
+ g_free(buf);
+}
+
+inline void inline_draw_sv_plane_dimmed(HildonColorChooserHSV *sel, int x, int y, int w, int h)
+{
+ GtkWidget *widget = GTK_WIDGET(sel);
+ unsigned char *buf, *ptr;
+ unsigned long rgbx[3] = { 0x00ffffff, 0x00ffffff, 0x00ffffff }, rgbtmp[3];
+ unsigned long avg;
+ signed long rgby[3];
+ int tmp = sel->spa.width*sel->spa.height, i, j;
+
+
+ if(w <= 0 || h <= 0) {
+ return;
+ }
+
+
+ buf = (unsigned char *)g_malloc(w*h*3);
+
+ ptr = buf;
+
+
+ /* possibe optimization: as we are drawing grayscale plane, there might
+ be some simpler algorithm to do this*/
+ rgbtmp[0] = 0x00ffffff;
+ rgbtmp[1] = 0x00000000;
+ rgbtmp[2] = 0x00000000;
+
+ rgby[0] = rgbtmp[0] - rgbx[0];
+ rgby[1] = rgbtmp[1] - rgbx[1];
+ rgby[2] = rgbtmp[2] - rgbx[2];
+
+ rgbx[0] /= sel->spa.width;
+ rgbx[1] /= sel->spa.width;
+ rgbx[2] /= sel->spa.width;
+
+ rgby[0] /= tmp;
+ rgby[1] /= tmp;
+ rgby[2] /= tmp;
+
+
+ rgbx[0] += (y - sel->spa.y)*rgby[0];
+ rgbx[1] += (y - sel->spa.y)*rgby[1];
+ rgbx[2] += (y - sel->spa.y)*rgby[2];
+
+
+ for(i = 0; i < h; i++) {
+ rgbtmp[0] = rgbx[0] * (x - sel->spa.x);
+ rgbtmp[1] = rgbx[1] * (x - sel->spa.x);
+ rgbtmp[2] = rgbx[2] * (x - sel->spa.x);
+
+ for(j = 0; j < w; j++) {
+ avg = (rgbtmp[0] + rgbtmp[1] + rgbtmp[2])/3;
+ avg >>= 16;
+ ptr[0] = avg;
+ ptr[1] = avg;
+ ptr[2] = avg;
+ rgbtmp[0] += rgbx[0];
+ rgbtmp[1] += rgbx[1];
+ rgbtmp[2] += rgbx[2];
+ ptr += 3;
+ }
+
+ rgbx[0] += rgby[0];
+ rgbx[1] += rgby[1];
+ rgbx[2] += rgby[2];
+ }
+
+
+ gdk_draw_rgb_image(widget->parent->window, widget->style->fg_gc[0], x, y, w, h, GDK_RGB_DITHER_NONE, buf, w*3);
+
+
+ g_free(buf);
+}
+
+
+static gboolean hildon_color_chooser_hsv_expose_timer(gpointer data)
+{
+ HildonColorChooserHSV *sel = HILDON_COLOR_CHOOSER_HSV(data);
+
+
+ if(sel->expose_info.expose_queued) {
+ gtk_widget_queue_draw(GTK_WIDGET(data));
+ }
+
+
+ return FALSE;
+}
lib_LTLIBRARIES = libhildonwidgets.la
+MAINTAINERCLEANFILES = \
+ Makefile.in hildon-libs-enum-types.c hildon-libs-enum-types.h
+
EXTRA_DIST = hildon-marshalers.list
libhildonwidgets_la_LDFLAGS = -version-info 5:0:5
hildon-program.h \
hildon-code-dialog.c \
hildon-code-dialog.h \
+ hildon-plugin-widget.c \
+ hildon-plugin-widget.h \
+ hildon-color-chooser.c \
+ hildon-color-chooser.h \
+ hildon-color-chooser-dialog.c \
+ hildon-color-chooser-dialog.h \
+ hildon-color-chooser-button.c \
+ hildon-color-chooser-button.h \
$(hildonlibs_built_headers) \
$(hildonlibs_built_cfiles)
hildon-window.h \
hildon-program.h \
hildon-window-private.h \
- hildon-code-dialog.h
+ hildon-code-dialog.h \
+ hildon-plugin-widget.h \
+ hildon-color-chooser.h \
+ hildon-color-chooser-dialog.h \
+ hildon-color-chooser-button.h
headers_to_scan_for_enums = $(hildonwidgetsincludeinst_DATA)
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
const gchar *hildon_add_home_dialog_get_name(HildonAddHomeDialog * dialog);
G_END_DECLS
-#endif
+#endif /* __HILDON_ADD_HOME_DIALOG_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
typedef struct _HildonAppPrivate HildonAppPrivate;
-static void
-hildon_app_switch_to_desktop (void);
static gboolean
hildon_app_key_press (GtkWidget *widget, GdkEventKey *keyevent);
static gboolean
if (priv->key_snooper)
{
- /* removing the snooper that handles MENU and HOME key presses */
+ /* removing the snooper that handles MENU key presses */
gtk_key_snooper_remove(priv->key_snooper);
priv->key_snooper = 0;
}
/*
- * Generates and sends an event of type _NET_SHOWING_DESKTOP to the XServer,
- * which will be then caught by the window Manager.
- */
-static void
-hildon_app_switch_to_desktop (void)
-{
-
- XEvent ev;
- Atom showing_desktop = XInternAtom(GDK_DISPLAY(),
- "_NET_SHOWING_DESKTOP", False);
- memset(&ev, 0, sizeof(ev));
- ev.xclient.type = ClientMessage;
- gdk_error_trap_push();
- ev.xclient.window = GDK_ROOT_WINDOW();
- ev.xclient.message_type = showing_desktop;
- ev.xclient.format = 32;
- ev.xclient.data.l[0] = 1;
- gdk_error_trap_push();
- XSendEvent(GDK_DISPLAY(), GDK_ROOT_WINDOW(), False,
- SubstructureRedirectMask, &ev);
- gdk_error_trap_pop();
-}
-
-/*
* Handles the key press of the Escape, Increase and Decrease keys. Other keys
* are handled by the parent GtkWidgetClass.
*/
}
/*
- * Handles the MENU and HOME key presses.
+ * Handles the MENU key presses.
*/
static gboolean
hildon_app_key_snooper (GtkWidget *widget, GdkEventKey *keyevent, HildonApp *app)
closes all existing menus that might be open */
return FALSE;
}
-
- /* Home key handling is done here. */
- if ((keyevent->type == GDK_KEY_RELEASE) &&
- HILDON_KEYEVENT_IS_HOME_KEY (keyevent))
- {
- hildon_app_switch_to_desktop();
-
- return TRUE;
- }
return FALSE;
}
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
GtkUIManager *hildon_app_get_ui_manager(HildonApp *self);
G_END_DECLS
-#endif /* HILDON_APP_H */
+#endif /* __HILDON_APP_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
*/
-#ifndef HILDON_APPVIEW_H
-#define HILDON_APPVIEW_H
+#ifndef __HILDON_APPVIEW_H__
+#define __HILDON_APPVIEW_H__
#include <glib.h>
#include <glib-object.h>
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
guint * day);
G_END_DECLS
-#endif
+#endif /* __HILDON_CALENDAR_POPUP_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
*
* Copyright (C) 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
*
* Copyright (C) 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
*
*/
-#ifndef HILDON_CODE_DIALOG_H
-#define HILDON_CODE_DIALOG_H
+#ifndef __HILDON_CODE_DIALOG_H__
+#define __HILDON_CODE_DIALOG_H__
#include <gtk/gtkdialog.h>
G_END_DECLS
-#endif
+#endif /* __HILDON_CODE_DIALOG_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/**
* SECTION:hildon-color-button
- * @short_description: A widget to open HildonColorSelector
- * @see_also: #HildonColorSelector, #HildonColorPopup
+ * @short_description: A widget to open HildonColorChooserDialog
+ * @see_also: #HildonColorChooserDialog, #HildonColorPopup
*
- * HildonColorButton is a widget to open a HildonColorSelector.
+ * HildonColorButton is a widget to open a HildonColorChooserDialog.
* The selected color is shown in the button.
* The selected color is a property of the button.
* The property name is "color" and its type is GtkColor.
#include <hildon-widgets/hildon-defines.h>
#include "hildon-color-button.h"
-#include "hildon-color-selector.h"
+#include "hildon-color-chooser-dialog.h"
#define HILDON_COLOR_BUTTON_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE\
((obj), HILDON_TYPE_COLOR_BUTTON, HildonColorButtonPrivate))
hildon_color_button_clicked(GtkButton *button)
{
HildonColorButton *cb = HILDON_COLOR_BUTTON(button);
- HildonColorSelector *cs_dialog = HILDON_COLOR_SELECTOR(cb->priv->dialog);
-
+ HildonColorChooserDialog *cs_dialog = HILDON_COLOR_CHOOSER_DIALOG(cb->priv->dialog);
+
/* Popup the color selector dialog */
if (!cs_dialog)
{
/* The dialog hasn't been created yet, do it. */
GtkWidget *parent = gtk_widget_get_toplevel(GTK_WIDGET(cb));
- cb->priv->dialog = hildon_color_selector_new(GTK_WINDOW(parent));
- cs_dialog = HILDON_COLOR_SELECTOR(cb->priv->dialog);
-
+ cb->priv->dialog = hildon_color_chooser_dialog_new(GTK_WINDOW(parent));
+ cs_dialog = HILDON_COLOR_CHOOSER_DIALOG(cb->priv->dialog);
if (parent)
gtk_window_set_transient_for(GTK_WINDOW(cs_dialog), GTK_WINDOW(parent));
}
-
+
/* Set the initial color for the color selector dialog */
- hildon_color_selector_set_color(cs_dialog, &cb->priv->color);
-
+ hildon_color_chooser_dialog_set_color(cs_dialog, &cb->priv->color);
+
/* Update the color for color button if selection was made */
if (gtk_dialog_run(GTK_DIALOG(cs_dialog)) == GTK_RESPONSE_OK)
{
- cb->priv->color = *hildon_color_selector_get_color(cs_dialog);
+ hildon_color_chooser_dialog_get_color(cs_dialog, &cb->priv->color);
hildon_color_button_set_color( HILDON_COLOR_BUTTON( button ),
&(cb->priv->color) );
}
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
G_END_DECLS
-#endif /* __GTK_COLOR_BUTTON_H__ */
+#endif /* __HILDON_COLOR_BUTTON_H__ */
--- /dev/null
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation.
+ *
+ * Author: Kuisma Salonen <kuisma.salonen@nokia.com>
+ * 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
+ *
+ */
+
+
+#include <gtk/gtk.h>
+
+
+#include "hildon-color-chooser-button.h"
+
+#include "hildon-color-chooser-dialog.h"
+
+
+enum {
+ COLOR_CHANGED,
+ LAST_SIGNAL
+};
+
+
+static guint color_chooser_button_signals[LAST_SIGNAL] = { 0 };
+
+
+static GtkButtonClass *parent_klass = NULL;
+
+
+static void hildon_color_chooser_button_init(HildonColorChooserButton *object);
+static void hildon_color_chooser_button_class_init(HildonColorChooserButtonClass *klass);
+
+
+static void hildon_color_chooser_button_size_request(GtkWidget *widget, GtkRequisition *req);
+static void hildon_color_chooser_button_size_allocate(GtkWidget *widget, GtkAllocation *alloc);
+
+static void hildon_color_chooser_button_realize(GtkWidget *widget);
+static void hildon_color_chooser_button_unrealize(GtkWidget *widget);
+
+static void hildon_color_chooser_button_style_set(GtkWidget *widget, GtkStyle *previous_style);
+
+static void hildon_color_chooser_button_show(GtkWidget *widget);
+static void hildon_color_chooser_button_show_all(GtkWidget *widget);
+
+static void hildon_color_chooser_button_virtual_set_color(HildonColorChooserButton *button, GdkColor *color);
+static void hildon_color_chooser_button_virtual_color_changed(HildonColorChooserButton *button, GdkColor *color);
+
+static void hildon_color_chooser_button_clicked(GtkButton *button);
+
+
+static gboolean hildon_color_chooser_button_area_expose(GtkWidget *widget, GdkEventExpose *event, gpointer data);
+
+
+static void hildon_color_chooser_button_helper_get_style_info(HildonColorChooserButton *button);
+
+
+GtkType hildon_color_chooser_button_get_type ()
+{
+ static GtkType button_type = 0;
+
+ if (!button_type)
+ {
+ static const GtkTypeInfo button_info =
+ {
+ "HildonColorChooserButton",
+ sizeof (HildonColorChooserButton),
+ sizeof (HildonColorChooserButtonClass),
+ (GtkClassInitFunc) hildon_color_chooser_button_class_init,
+ (GtkObjectInitFunc) hildon_color_chooser_button_init,
+ /* reserved_1 */ NULL,
+ /* reserved_1 */ NULL,
+ (GtkClassInitFunc) NULL
+ };
+
+ button_type = gtk_type_unique (GTK_TYPE_BUTTON, &button_info);
+ }
+
+ return button_type;
+}
+
+
+ /* initializer functions */
+static void hildon_color_chooser_button_init(HildonColorChooserButton *object)
+{
+ object->color.red = 0x0000;
+ object->color.green = 0x0000;
+ object->color.blue = 0x0000;
+ object->color.pixel = 0x00000000;
+
+
+ object->area = gtk_drawing_area_new();
+
+ gtk_container_add(GTK_CONTAINER(object), object->area);
+
+
+ g_signal_connect(G_OBJECT(object->area), "expose-event",
+ G_CALLBACK(hildon_color_chooser_button_area_expose), object);
+}
+
+static void hildon_color_chooser_button_class_init(HildonColorChooserButtonClass *klass)
+{
+ GtkWidgetClass *widget_klass = GTK_WIDGET_CLASS(klass);
+ GtkButtonClass *button_klass = GTK_BUTTON_CLASS(klass);
+ GtkObjectClass *object_klass = GTK_OBJECT_CLASS(klass);
+
+
+ parent_klass = g_type_class_peek_parent(klass);
+
+
+ klass->set_color = hildon_color_chooser_button_virtual_set_color;
+ klass->color_changed = hildon_color_chooser_button_virtual_color_changed;
+
+
+ button_klass->clicked = hildon_color_chooser_button_clicked;
+
+
+ widget_klass->size_request = hildon_color_chooser_button_size_request;
+ widget_klass->size_allocate = hildon_color_chooser_button_size_allocate;
+
+ widget_klass->realize = hildon_color_chooser_button_realize;
+ widget_klass->unrealize = hildon_color_chooser_button_unrealize;
+
+ widget_klass->style_set = hildon_color_chooser_button_style_set;
+
+ widget_klass->show = hildon_color_chooser_button_show;
+ widget_klass->show_all = hildon_color_chooser_button_show_all;
+
+
+ gtk_widget_class_install_style_property(widget_klass,
+ g_param_spec_boxed("outer_border",
+ "Outer border",
+ "Size of the outer border",
+ GTK_TYPE_BORDER,
+ G_PARAM_READABLE));
+ gtk_widget_class_install_style_property(widget_klass,
+ g_param_spec_boxed("inner_border",
+ "Inner border",
+ "Size of the inner border",
+ GTK_TYPE_BORDER,
+ G_PARAM_READABLE));
+ gtk_widget_class_install_style_property(widget_klass,
+ g_param_spec_boxed("minimum_size",
+ "minimum_size",
+ "Minimum size of the color area",
+ GTK_TYPE_BORDER,
+ G_PARAM_READABLE));
+
+
+ color_chooser_button_signals[COLOR_CHANGED] = g_signal_new("color-changed", G_OBJECT_CLASS_TYPE (object_klass),
+ G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (HildonColorChooserButtonClass, color_changed),
+ NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, GDK_TYPE_COLOR);
+}
+
+
+ /* virtual widget functions */
+static void hildon_color_chooser_button_size_request(GtkWidget *widget, GtkRequisition *req)
+{
+ HildonColorChooserButton *button = HILDON_COLOR_CHOOSER_BUTTON(widget);
+
+
+ req->width = button->style_info.outer.left + button->style_info.min.left + button->style_info.outer.right;
+ req->height = button->style_info.outer.top + button->style_info.min.right + button->style_info.outer.bottom;
+}
+
+static void hildon_color_chooser_button_size_allocate(GtkWidget *widget, GtkAllocation *alloc)
+{
+ HildonColorChooserButton *button = HILDON_COLOR_CHOOSER_BUTTON(widget);
+ GtkAllocation child_alloc;
+ GdkRectangle clip_rect;
+
+
+ GTK_WIDGET_CLASS(parent_klass)->size_allocate(widget, alloc);
+ child_alloc = *alloc;
+
+
+ child_alloc.x += button->style_info.outer.left;
+ child_alloc.y += button->style_info.outer.top;
+
+ child_alloc.width -= (button->style_info.outer.left + button->style_info.outer.right);
+ child_alloc.height -= (button->style_info.outer.top + button->style_info.outer.bottom);
+
+
+ gtk_widget_size_allocate(button->area, &child_alloc);
+
+
+ if(GTK_WIDGET_REALIZED(widget)) {
+ clip_rect.x = button->style_info.inner.left;
+ clip_rect.y = button->style_info.inner.top;
+ clip_rect.width = button->area->allocation.width - button->style_info.inner.left - button->style_info.inner.right;
+ clip_rect.height = button->area->allocation.height - button->style_info.inner.top - button->style_info.inner.bottom;
+
+ gdk_gc_set_clip_rectangle(button->color_gc, &clip_rect);
+ }
+}
+
+
+static void hildon_color_chooser_button_realize(GtkWidget *widget)
+{
+ HildonColorChooserButton *button = HILDON_COLOR_CHOOSER_BUTTON(widget);
+ GdkRectangle clip_rect;
+
+
+ GTK_WIDGET_CLASS(parent_klass)->realize(widget);
+
+
+ button->color_gc = gdk_gc_new(widget->window);
+ gdk_gc_set_rgb_fg_color(button->color_gc, &button->color);
+
+
+ clip_rect.x = button->style_info.inner.left;
+ clip_rect.y = button->style_info.inner.top;
+ clip_rect.width = button->area->allocation.width - button->style_info.inner.left - button->style_info.inner.right;
+ clip_rect.height = button->area->allocation.height - button->style_info.inner.top - button->style_info.inner.bottom;
+
+ gdk_gc_set_clip_rectangle(button->color_gc, &clip_rect);
+}
+
+static void hildon_color_chooser_button_unrealize(GtkWidget *widget)
+{
+ HildonColorChooserButton *button = HILDON_COLOR_CHOOSER_BUTTON(widget);
+
+
+ g_object_unref(button->color_gc);
+ button->color_gc = NULL;
+
+
+ GTK_WIDGET_CLASS(parent_klass)->unrealize(widget);
+}
+
+
+static void hildon_color_chooser_button_style_set(GtkWidget *widget, GtkStyle *previous_style)
+{
+ HildonColorChooserButton *button = HILDON_COLOR_CHOOSER_BUTTON(widget);
+ GdkRectangle clip_rect;
+
+
+ hildon_color_chooser_button_helper_get_style_info(button);
+
+
+ if(GTK_WIDGET_REALIZED(widget)) {
+ clip_rect.x = button->style_info.inner.left;
+ clip_rect.y = button->style_info.inner.top;
+ clip_rect.width = button->area->allocation.width - button->style_info.inner.left - button->style_info.inner.right;
+ clip_rect.height = button->area->allocation.height - button->style_info.inner.top - button->style_info.inner.bottom;
+
+ gdk_gc_set_clip_rectangle(button->color_gc, &clip_rect);
+ }
+}
+
+
+static void hildon_color_chooser_button_show(GtkWidget *widget)
+{
+ HildonColorChooserButton *button = HILDON_COLOR_CHOOSER_BUTTON(widget);
+
+
+ gtk_widget_show(button->area);
+
+ GTK_WIDGET_CLASS(parent_klass)->show(widget);
+}
+
+static void hildon_color_chooser_button_show_all(GtkWidget *widget)
+{
+ hildon_color_chooser_button_show(widget);
+}
+
+
+static void hildon_color_chooser_button_virtual_set_color(HildonColorChooserButton *button, GdkColor *color)
+{
+ button->color = *color;
+
+ if(GTK_WIDGET_REALIZED(button)) {
+ gdk_gc_set_rgb_fg_color(button->color_gc, &button->color);
+
+ gtk_widget_queue_draw(button->area);
+ }
+
+
+ g_signal_emit(button, color_chooser_button_signals[COLOR_CHANGED], 0, &button->color);
+}
+
+static void hildon_color_chooser_button_virtual_color_changed(HildonColorChooserButton *button, GdkColor *color)
+{
+}
+
+
+static void hildon_color_chooser_button_clicked(GtkButton *button)
+{
+ HildonColorChooserButton *color_button = HILDON_COLOR_CHOOSER_BUTTON(button);
+ GtkWidget *dialog;
+ GdkColor color;
+ gint result = 0;
+
+
+ dialog = hildon_color_chooser_dialog_new();
+ gtk_widget_realize(dialog);
+ hildon_color_chooser_dialog_set_color(HILDON_COLOR_CHOOSER_DIALOG(dialog), &color_button->color);
+ gtk_widget_show(dialog);
+
+
+ result = gtk_dialog_run(GTK_DIALOG(dialog));
+
+
+ if(result == GTK_RESPONSE_OK) {
+ hildon_color_chooser_dialog_get_color(HILDON_COLOR_CHOOSER_DIALOG(dialog), &color);
+ hildon_color_chooser_button_virtual_set_color(color_button, &color);
+ }
+
+
+/*g_object_unref(G_OBJECT(dialog));*/
+ gtk_widget_destroy(dialog);
+}
+
+
+ /* signal handlers */
+static gboolean hildon_color_chooser_button_area_expose(GtkWidget *widget, GdkEventExpose *event, gpointer data)
+{
+ HildonColorChooserButton *button = HILDON_COLOR_CHOOSER_BUTTON(data);
+ GtkWidget *button_widget = GTK_WIDGET(data);
+
+
+ if(button->style_info.inner.left > 0 || button->style_info.inner.right > 0 ||
+ button->style_info.inner.top > 0 || button->style_info.inner.bottom > 0) {
+ gtk_paint_box(gtk_widget_get_style(button_widget), widget->window, GTK_WIDGET_STATE(button_widget), GTK_SHADOW_NONE,
+ &event->area, button_widget, "color-button", 0, 0, widget->allocation.width, widget->allocation.height);
+ }
+
+
+ gdk_draw_rectangle(widget->window, button->color_gc, TRUE, event->area.x, event->area.y, event->area.width, event->area.height);
+
+
+ return FALSE;
+}
+
+
+ /* additional use-only-here functions */
+static void hildon_color_chooser_button_helper_get_style_info(HildonColorChooserButton *button)
+{
+ GtkBorder *in, *out, *min;
+
+ gtk_widget_style_get(GTK_WIDGET(button), "inner_border", &in,
+ "outer_border", &out,
+ "minimum_size", &min, NULL);
+
+
+ if(in) {
+ button->style_info.inner = *in;
+ g_free(in);
+ } else {
+ button->style_info.inner.left = 0;
+ button->style_info.inner.right = 0;
+ button->style_info.inner.top = 0;
+ button->style_info.inner.bottom = 0;
+ }
+
+ if(out) {
+ button->style_info.outer = *out;
+ g_free(out);
+ } else {
+ button->style_info.outer.left = 4;
+ button->style_info.outer.right = 4;
+ button->style_info.outer.top = 4;
+ button->style_info.outer.bottom = 4;
+ }
+
+ if(min) {
+ button->style_info.min = *min;
+ g_free(min);
+ } else {
+ button->style_info.min.left = 8;
+ button->style_info.min.right = 8;
+ button->style_info.min.top = 0;
+ button->style_info.min.bottom = 0;
+ }
+}
+
+
+ /* public API */
+GtkWidget *hildon_color_chooser_button_new()
+{
+ return gtk_type_new(HILDON_TYPE_COLOR_CHOOSER_BUTTON);
+}
+
+
+void hildon_color_chooser_button_set_color(HildonColorChooserButton *button, GdkColor *color)
+{
+ HILDON_COLOR_CHOOSER_BUTTON_CLASS(G_OBJECT_GET_CLASS(button))->set_color(button, color);
+}
+
+void hildon_color_chooser_button_get_color(HildonColorChooserButton *button, GdkColor *color)
+{
+ *color = button->color;
+}
--- /dev/null
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation.
+ *
+ * Author: Kuisma Salonen <kuisma.salonen@nokia.com>
+ * 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_COLOR_CHOOSER_BUTTON_H__
+#define __HILDON_COLOR_CHOOSER_BUTTON_H__
+
+
+#include <gdk/gdkcolor.h>
+
+#include <gtk/gtkwidget.h>
+
+
+#define HILDON_TYPE_COLOR_CHOOSER_BUTTON (hildon_color_chooser_button_get_type())
+
+#define HILDON_COLOR_CHOOSER_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HILDON_TYPE_COLOR_CHOOSER_BUTTON, HildonColorChooserButton))
+#define HILDON_COLOR_CHOOSER_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HILDON_TYPE_COLOR_CHOOSER_BUTTON, HildonColorChooserButtonClass))
+#define HILDON_IS_COLOR_CHOOSER_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_COLOR_CHOOSER_BUTTON))
+
+
+typedef struct HildonColorChooserButton_ HildonColorChooserButton;
+typedef struct HildonColorChooserButtonClass_ HildonColorChooserButtonClass;
+
+
+struct HildonColorChooserButton_
+{
+ GtkButton parent;
+
+ GdkColor color;
+
+ GtkWidget *area;
+
+ GdkGC *color_gc;
+
+
+ struct {
+ GtkBorder outer;
+ GtkBorder inner;
+ GtkBorder min;
+ } style_info;
+};
+
+struct HildonColorChooserButtonClass_
+{
+ GtkButtonClass parent;
+
+ void (*color_changed) (HildonColorChooserButton *button, GdkColor *color);
+
+ void (*set_color) (HildonColorChooserButton *, GdkColor *);
+};
+
+
+GtkType hildon_color_chooser_button_get_type();
+GtkWidget *hildon_color_chooser_button_new();
+
+void hildon_color_chooser_button_set_color(HildonColorChooserButton *button, GdkColor *color);
+void hildon_color_chooser_button_get_color(HildonColorChooserButton *button, GdkColor *color);
+
+
+#endif /* __HILDON_COLOR_CHOOSER_BUTTON_H__ */
--- /dev/null
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation.
+ *
+ * Author: Kuisma Salonen <kuisma.salonen@nokia.com>
+ * 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-color-chooser-dialog
+ * @short_description: A dialog to choose a color.
+ * @see_also: #HildonColorButton, #HildonColorChooser
+ *
+ * HildonColorChooserDialog is a widget widget to choose a color.
+ */
+#include <gtk/gtk.h>
+
+
+#include "hildon-color-chooser-dialog.h"
+
+#include "hildon-plugin-widget.h"
+
+
+enum {
+ COLOR_CHANGED,
+ LAST_SIGNAL
+};
+
+
+static HildonPluginWidgetInfo *global_plugin = NULL;
+
+
+static guint color_chooser_dialog_signals[LAST_SIGNAL] = { 0 };
+
+
+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 ()
+{
+ static GtkType chooser_type = 0;
+
+ if (!chooser_type)
+ {
+ static const GtkTypeInfo chooser_info =
+ {
+ "HildonColorChooserDialog",
+ sizeof (HildonColorChooserDialog),
+ sizeof (HildonColorChooserDialogClass),
+ (GtkClassInitFunc) hildon_color_chooser_dialog_class_init,
+ (GtkObjectInitFunc) hildon_color_chooser_dialog_init,
+ /* reserved_1 */ NULL,
+ /* reserved_1 */ NULL,
+ (GtkClassInitFunc) NULL
+ };
+
+ chooser_type = gtk_type_unique (GTK_TYPE_DIALOG, &chooser_info);
+ }
+
+ return chooser_type;
+}
+
+
+static void hildon_color_chooser_dialog_init(HildonColorChooserDialog *object)
+{
+ int i;
+
+
+ object->color.red = 0x0000;
+ object->color.green = 0x0000;
+ object->color.blue = 0x0000;
+ object->color.pixel = 0x00000000;
+
+
+ for(i = 0; i < 32; i++) {
+ object->reserved[i] = 0;
+ }
+}
+
+static void hildon_color_chooser_dialog_class_init(HildonColorChooserDialogClass *klass)
+{
+ GtkObjectClass *object_klass = GTK_OBJECT_CLASS(klass);
+ int i;
+
+
+ for(i = 0; i < 32; i++) {
+ klass->reserved[i] = 0;
+ }
+
+ klass->set_color = 0;
+
+
+ color_chooser_dialog_signals[COLOR_CHANGED] = g_signal_new("color-changed", G_OBJECT_CLASS_TYPE (object_klass),
+ G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (HildonColorChooserDialogClass, color_changed),
+ NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, GDK_TYPE_COLOR);
+}
+
+/**
+ * hildon_color_chooser_dialog_new:
+ *
+ * Creates a new color chooser dialog. The dialog is created through
+ * HildonPluginWidget API and is loaded from plugin. The initially selected
+ * color can be anything, so it's recommended to call
+ * hildon_color_chooser_dialog_set_color () after creating the widget.
+ *
+ * Returns: a new color chooser dialog
+ */
+GtkWidget *hildon_color_chooser_dialog_new()
+{
+ if(!global_plugin) {
+ global_plugin = hildon_plugin_info_initialize(HILDON_TYPE_COLOR_CHOOSER_DIALOG, NULL);
+ g_return_val_if_fail (global_plugin != NULL, NULL);
+ }
+
+ return hildon_plugin_info_construct_widget(global_plugin);
+}
+
+/**
+ * hildon_color_chooser_dialog_set_color:
+ * @chooser: a #HildonColorChooserDialog
+ * @color: a color to be set
+ *
+ * Sets the color selected in the dialog.
+ */
+void hildon_color_chooser_dialog_set_color(HildonColorChooserDialog *chooser, GdkColor *color)
+{
+ HildonColorChooserDialogClass *klass = HILDON_COLOR_CHOOSER_DIALOG_CLASS(G_OBJECT_GET_CLASS(chooser));
+
+
+ chooser->color = *color;
+
+ if(klass->set_color) {
+ klass->set_color(chooser, color);
+ }
+}
+
+/**
+ * hildon_color_chooser_dialog_get_color:
+ * @chooser: a #HildonColorChooserDialog
+ * @color: a pointer to #GdkColor to be filled by the function
+ *
+ * Gets the color selected in the dialog.
+ */
+void hildon_color_chooser_dialog_get_color(HildonColorChooserDialog *chooser, GdkColor *color)
+{
+ *color = chooser->color;
+}
+
+
+void hildon_color_chooser_dialog_emit_color_changed(HildonColorChooserDialog *chooser)
+{
+ g_signal_emit(chooser, color_chooser_dialog_signals[COLOR_CHANGED], 0, &chooser->color);
+}
--- /dev/null
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation.
+ *
+ * Author: Kuisma Salonen <kuisma.salonen@nokia.com>
+ * 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_COLOR_CHOOSER_DIALOG_H__
+#define __HILDON_COLOR_CHOOSER_DIALOG_H__
+
+
+#include <gdk/gdkcolor.h>
+
+#include <gtk/gtkdialog.h>
+
+
+#define HILDON_TYPE_COLOR_CHOOSER_DIALOG (hildon_color_chooser_dialog_get_type())
+
+#define HILDON_COLOR_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HILDON_TYPE_COLOR_CHOOSER_DIALOG, HildonColorChooserDialog))
+#define HILDON_COLOR_CHOOSER_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HILDON_TYPE_COLOR_CHOOSER_DIALOG, HildonColorChooserDialogClass))
+#define HILDON_IS_COLOR_CHOOSER_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_COLOR_CHOOSER_DIALOG))
+
+
+typedef struct HildonColorChooserDialog_ HildonColorChooserDialog;
+typedef struct HildonColorChooserDialogClass_ HildonColorChooserDialogClass;
+
+
+struct HildonColorChooserDialog_ {
+ GtkDialog parent;
+
+ GdkColor color;
+
+ guint32 reserved[32];
+};
+
+struct HildonColorChooserDialogClass_ {
+ GtkDialogClass parent_class;
+
+ gboolean (*color_changed) (HildonColorChooserDialog *chooser, GdkColor *color);
+
+ void (*set_color) (HildonColorChooserDialog *, GdkColor *);
+
+ void (*reserved[32]) (void *);
+};
+
+
+GtkType hildon_color_chooser_dialog_get_type();
+
+GtkWidget *hildon_color_chooser_dialog_new();
+
+void hildon_color_chooser_dialog_set_color(HildonColorChooserDialog *chooser, GdkColor *color);
+void hildon_color_chooser_dialog_get_color(HildonColorChooserDialog *chooser, GdkColor *color);
+
+void hildon_color_chooser_dialog_emit_color_changed(HildonColorChooserDialog *chooser);
+
+
+#endif /* __HILDON_COLOR_CHOOSER_DIALOG_H__ */
--- /dev/null
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation.
+ *
+ * Author: Kuisma Salonen <kuisma.salonen@nokia.com>
+ * 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-color-chooser
+ * @short_description: A widget to choose a color.
+ * @see_also: #HildonColorChooserDialog, #HildonColorButton
+ *
+ * HildonColorChooser is a widget to choose a color.
+ */
+#include <gtk/gtk.h>
+
+
+#include "hildon-color-chooser.h"
+
+#include "hildon-plugin-widget.h"
+
+
+enum {
+ COLOR_CHANGED,
+ LAST_SIGNAL
+};
+
+
+static HildonPluginWidgetInfo *global_plugin = NULL;
+
+
+static guint color_chooser_signals[LAST_SIGNAL] = { 0 };
+
+
+static void hildon_color_chooser_init(HildonColorChooser *sel);
+static void hildon_color_chooser_class_init(HildonColorChooserClass *klass);
+
+
+GtkType hildon_color_chooser_get_type ()
+{
+ static GtkType chooser_type = 0;
+
+ if (!chooser_type)
+ {
+ static const GtkTypeInfo chooser_info =
+ {
+ "HildonColorChooser",
+ sizeof (HildonColorChooser),
+ sizeof (HildonColorChooserClass),
+ (GtkClassInitFunc) hildon_color_chooser_class_init,
+ (GtkObjectInitFunc) hildon_color_chooser_init,
+ /* reserved_1 */ NULL,
+ /* reserved_1 */ NULL,
+ (GtkClassInitFunc) NULL
+ };
+
+ chooser_type = gtk_type_unique (GTK_TYPE_WIDGET, &chooser_info);
+ }
+
+ return chooser_type;
+}
+
+
+static void hildon_color_chooser_init(HildonColorChooser *sel)
+{
+ sel->color.red = 0x0000;
+ sel->color.green = 0x0000;
+ sel->color.blue = 0x0000;
+ sel->color.pixel = 0x00000000;
+}
+
+static void hildon_color_chooser_class_init(HildonColorChooserClass *klass)
+{
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
+ GtkObjectClass *object_class = GTK_OBJECT_CLASS(klass);
+
+ klass->set_color = NULL;
+
+
+ gtk_widget_class_install_style_property(widget_class,
+ g_param_spec_boxed("outer_border",
+ "Outer border",
+ "Size of outer border",
+ GTK_TYPE_BORDER,
+ G_PARAM_READABLE));
+
+ color_chooser_signals[COLOR_CHANGED] = g_signal_new("color-changed", G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (HildonColorChooserClass, color_changed),
+ NULL, NULL, g_cclosure_marshal_VOID__BOXED, G_TYPE_NONE, 1, GDK_TYPE_COLOR);
+}
+
+/**
+ * hildon_color_chooser_new:
+ *
+ * Creates a new color chooser widget. The dialog is created through
+ * HildonPluginWidget API and is loaded from plugin. The initially selected
+ * color can be anything, so it's recommended to call
+ * hildon_color_chooser_dialog_set_color () after creating the widget.
+ *
+ * Returns: a new color chooser widget
+ */
+GtkWidget *hildon_color_chooser_new()
+{
+ if(!global_plugin) {
+ global_plugin = hildon_plugin_info_initialize(HILDON_TYPE_COLOR_CHOOSER, NULL);
+ }
+
+
+ return hildon_plugin_info_construct_widget(global_plugin);
+}
+
+/**
+ * hildon_color_chooser_set_color:
+ * @chooser: a #HildonColorChooser
+ * @color: a color to be set
+ *
+ * Sets the color selected in the widget.
+ */
+void hildon_color_chooser_set_color(HildonColorChooser *chooser, GdkColor *color)
+{
+ HildonColorChooserClass *klass = HILDON_COLOR_CHOOSER_CLASS(G_OBJECT_GET_CLASS(chooser));
+
+
+ chooser->color = *color;
+
+ if(klass->set_color) {
+ klass->set_color(chooser, color);
+ }
+}
+
+/**
+ * hildon_color_chooser_get_color:
+ * @chooser: a #HildonColorChooser
+ * @color: a pointer to #GdkColor to be filled by the function
+ *
+ * Gets the color selected in the widget.
+ */
+void hildon_color_chooser_get_color(HildonColorChooser *chooser, GdkColor *color)
+{
+ *color = chooser->color;
+}
+
+
+void hildon_color_chooser_emit_color_changed(HildonColorChooser *chooser)
+{
+ g_signal_emit(chooser, color_chooser_signals[COLOR_CHANGED], 0, &chooser->color);
+}
--- /dev/null
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation.
+ *
+ * Author: Kuisma Salonen <kuisma.salonen@nokia.com>
+ * 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_COLOR_CHOOSER_H__
+#define __HILDON_COLOR_CHOOSER_H__
+
+
+#include <gdk/gdkcolor.h>
+
+#include <gtk/gtkwidget.h>
+
+
+#define HILDON_TYPE_COLOR_CHOOSER (hildon_color_chooser_get_type())
+
+#define HILDON_COLOR_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HILDON_TYPE_COLOR_CHOOSER, HildonColorChooser))
+#define HILDON_COLOR_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HILDON_TYPE_COLOR_CHOOSER, HildonColorChooserClass))
+#define HILDON_IS_COLOR_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HILDON_TYPE_COLOR_CHOOSER))
+
+
+typedef struct HildonColorChooser_ HildonColorChooser;
+typedef struct HildonColorChooserClass_ HildonColorChooserClass;
+
+
+struct HildonColorChooser_
+{
+ GtkWidget parent;
+
+ GdkColor color;
+};
+
+struct HildonColorChooserClass_
+{
+ GtkWidgetClass parent;
+
+ void (*color_changed) (HildonColorChooser *selection, GdkColor *color);
+
+ void (*set_color) (HildonColorChooser *, GdkColor *);
+};
+
+
+GtkType hildon_color_chooser_get_type(void);
+GtkWidget *hildon_color_chooser_new(void);
+
+void hildon_color_chooser_set_color(HildonColorChooser *chooser, GdkColor *color);
+void hildon_color_chooser_get_color(HildonColorChooser *chooser, GdkColor *color);
+
+void hildon_color_chooser_emit_color_changed(HildonColorChooser *chooser);
+
+
+#endif /* __HILDON_COLOR_CHOOSER_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
GdkColor * color);
G_END_DECLS
-#endif
+#endif /* __HILDON_COLOR_SELECTOR_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
gint max);
G_END_DECLS
-#endif
+#endif /* __HILDON_CONTROLBAR_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
guint hildon_date_editor_get_day(HildonDateEditor *editor);
G_END_DECLS
-#endif
+#endif /* __HILDON_DATE_EDITOR_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
G_END_DECLS
#endif /* HILDON_DISABLE_DEPRECATED */
-#endif /* __HILDON_NOTE_H__ */
+#endif /* __HILDON_FILE_HANDLING_NOTE_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
G_END_DECLS
-#endif
+#endif /* __HILDON_FIND_TOOLBAR_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
* grid can call semi-public functions of an item.
*/
-#ifndef HILDON_GRID_ITEM_PRIVATE_H_
-#define HILDON_GRID_ITEM_PRIVATE_H_
+#ifndef __HILDON_GRID_ITEM_PRIVATE_H__
+#define __HILDON_GRID_ITEM_PRIVATE_H__
#include <hildon-widgets/hildon-grid-item.h>
G_END_DECLS
-#endif /* ifndef HILDON_GRID_ITEM_PRIVATE_H_ */
+#endif /* __HILDON_GRID_ITEM_PRIVATE_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
* emblem and a label.
*/
-#ifndef HILDON_GRID_ITEM_H_
-#define HILDON_GRID_ITEM_H_
+#ifndef __HILDON_GRID_ITEM_H__
+#define __HILDON_GRID_ITEM_H__
#include <gtk/gtkcontainer.h>
#include <gtk/gtkitem.h>
G_END_DECLS
-#endif /* ifndef HILDON_GRID_ITEM_H_ */
+#endif /* __HILDON_GRID_ITEM_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
* which have single-tap activated items.
*/
-#ifndef HILDON_GRID_H_
-#define HILDON_GRID_H_
+#ifndef __HILDON_GRID_H__
+#define __HILDON_GRID_H__
#include <gtk/gtkcontainer.h>
#include <hildon-widgets/hildon-grid-item.h>
void hildon_grid_activate_child(HildonGrid * grid, HildonGridItem * item);
G_END_DECLS
-#endif /* ifndef HILDON_GRID_H_ */
+#endif /* __HILDON_GRID_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
} HildonInputModeHint;
G_END_DECLS
-#endif /* HILDON_INPUT_MODE_HINT_H */
+#endif /* __HILDON_INPUT_MODE_HINT_H__ */
-#ifndef ___hildon_marshal_MARSHAL_H__
-#define ___hildon_marshal_MARSHAL_H__
+#ifndef ___HILDON_MARSHALERS_H__
+#define ___HILDON_MARSHALERS_H__
#include <glib-object.h>
G_END_DECLS
-#endif /* ___hildon_marshal_MARSHAL_H__ */
+#endif /* __HILDON_MARSHALERS_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
const gchar *domain);
G_END_DECLS
-#endif
+#endif /* __HILDON_NAME_PASSWORD_DIALOG_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
{
/* If entry is empty and intermediate forms are nor allowed,
emit error signal */
- g_signal_emit(editor, HildonNumberEditor_signal[RANGE_ERROR],
- 0, error_code, &r);
/* Change to default value */
hildon_number_editor_set_value(editor, fixup_value);
+ g_signal_emit(editor, HildonNumberEditor_signal[RANGE_ERROR],
+ 0, error_code, &r);
add_select_all_idle(priv);
}
}
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
--- /dev/null
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation.
+ *
+ * Author: Kuisma Salonen <kuisma.salonen@nokia.com>
+ * 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-plugin-widget
+ * @short_description: A simple interface to load plugin based widgets. Not
+ * compatible with GObject.
+ *
+ * #HildonPluginWidgetInfo is a struct containing information about loaded
+ * module which contains code for a widget.
+ */
+
+
+#include <stdio.h>
+#include <memory.h>
+#include <string.h>
+
+#include <gtk/gtk.h>
+
+
+#include "hildon-plugin-widget.h"
+
+
+#ifndef PLUGIN_DIR
+#define PLUGIN_DIR "/usr/lib/hildon-widgets"
+#endif
+
+
+struct HildonPluginWidgetInfo_ {
+ GType base_type;
+
+ gchar *filename;
+
+ GModule *module;
+ int refcount;
+
+ GType (*get_type) ();
+};
+
+
+static gchar *hildon_plugin_filename(GType base_type, const gchar *name);
+
+ /* WARNING: works properly only with ASCII */
+static gchar *ascii_decapitalize_without_dashes(gchar *source);
+
+static gchar *hildon_plugin_default_name(gchar *typename);
+
+/**
+ * hildon_plugin_info_initialize:
+ * @base_type: a #GType representing parent type of object that will be
+ * loaded.
+ * @name: Name of child. To load default (or #GtkSettings defined), NULL
+ * should be passed as name. To load specific child type, decapitalized name
+ * should be passed here.
+ *
+ * Creates a new #HildonPluginWidgetInfo structure and opens a module.
+ *
+ * The naming of child widgets (or objects) doesn't matter, but for plugins
+ * the file names should be type
+ * <decapitalized-parent-type-name-with-dashes>-<pluginname>.so where the
+ * decapitalized type name would be for example for #GtkWidget gtk-widget.
+ *
+ * The name comes from name argument or from #GtkSettings where the variable
+ * storing it is with name <ParentTypeName>-plugin, for #GtkWidget this would
+ * be "GtkWidget-plugin". If nothing is defined in #GtkSettings, name
+ * "default" is assumed. For this case there should be symlink to some child
+ * type plugin named <parent-type-name>-default.so
+ *
+ * Returns: a #HildonPluginWidgetInfo struct pointer upon success, NULL if
+ * failed.
+ */
+HildonPluginWidgetInfo *hildon_plugin_info_initialize(GType base_type, const gchar *name)
+{
+ HildonPluginWidgetInfo *ret;
+ GModule *module;
+ gchar *filename;
+
+
+ if(!base_type) {
+ return NULL;
+ }
+
+
+ filename = hildon_plugin_filename(base_type, name);
+ g_return_val_if_fail (filename != NULL, NULL);
+
+
+ module = g_module_open(filename, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
+ if(!module) {
+ g_warning ("Failed to load plugin for '%s' (filename: '%s')", name, filename);
+ g_free(filename);
+ return NULL;
+ }
+
+
+ ret = (HildonPluginWidgetInfo *)g_malloc0(sizeof(HildonPluginWidgetInfo) + strlen(filename) + 1);
+ ret->filename = (gchar *)ret + sizeof(HildonPluginWidgetInfo);
+
+ ret->base_type = base_type;
+
+ ret->module = module;
+
+ g_module_symbol(module, "export_type", (void **)&ret->get_type);
+
+ memcpy(ret->filename, filename, strlen(filename));
+
+
+ g_free(filename);
+
+
+ return ret;
+}
+
+/**
+ * hildon_plugin_info_construct_widget:
+ * @info: pointer to a #HildonPluginWidgetInfo struct.
+ *
+ * Creates instance of loaded type from module stored in
+ * #HildonPluginWidgetInfo struct. Designed for loading types inherited from
+ * GtkWidget, but could be basically any GTK+ type.
+ *
+ * Returns: a GtkWidget pointer to instance of loaded type.
+ */
+GtkWidget *hildon_plugin_info_construct_widget(HildonPluginWidgetInfo *info)
+{
+ g_return_val_if_fail (info != NULL, NULL);
+ info->refcount++;
+
+
+ return GTK_WIDGET(g_type_create_instance(info->get_type()));
+}
+
+/**
+ * hildon_plugin_info_kill:
+ * @info: a pointer to a #HildonPluginWidgetInfo struct that should be
+ * destroyed.
+ *
+ * Frees the plugin information structure and unloads the module.
+ */
+void hildon_plugin_info_kill(HildonPluginWidgetInfo *info)
+{
+ if(!info) {
+ return;
+ }
+
+
+ g_module_close(info->module);
+
+
+ g_free(info);
+}
+
+
+static gchar *hildon_plugin_filename(GType base_type, const gchar *name)
+{
+ gchar *ret, *name2, *plgbuf;
+ gchar *typename = (gchar *)g_type_name(base_type);
+ int retsize;
+
+
+ plgbuf = ascii_decapitalize_without_dashes(typename);
+
+
+ if(name) {
+ name2 = g_strdup(name);
+ } else {
+ name2 = hildon_plugin_default_name(typename);
+ }
+
+
+ retsize = strlen(PLUGIN_DIR) + strlen(plgbuf) + strlen(name2) + 6;
+ ret = (gchar *)g_malloc0(retsize);
+ g_snprintf(ret, retsize, "%s/%s_%s.so", PLUGIN_DIR, plgbuf, name2);
+
+
+ g_free(name2);
+ g_free(plgbuf);
+
+
+ return ret;
+}
+
+ /* possible speedup: pre-allocate more memory and ditch the first loop */
+static gchar *ascii_decapitalize_without_dashes(gchar *source)
+{
+ gchar *ptr, *ret = g_strdup (source);
+
+
+ for(ptr = ret; *ptr; ptr++) {
+ if(*ptr >= 'A' && *ptr <= 'Z') {
+ *ptr += 0x20;
+ }
+ }
+
+
+ return ret;
+}
+
+
+static gchar *hildon_plugin_default_name(gchar *typename)
+{
+ GtkSettings *settings;
+ gchar *ret, *val, *tmp;
+ int tmplen;
+
+
+ tmplen = strlen(typename) + strlen("-plugin") + 1;
+ tmp = (gchar *)g_malloc0(tmplen);
+ g_snprintf(tmp, tmplen, "%s-plugin", typename);
+
+
+ gtk_settings_install_property(g_param_spec_string(tmp,
+ tmp,
+ "Plugin for this pecific widget",
+ NULL,
+ G_PARAM_READWRITE));
+
+ settings = gtk_settings_get_default();
+
+ g_object_get(G_OBJECT(settings), tmp, &val, NULL);
+
+ g_free(tmp);
+
+
+ if(val) {
+ ret = (gchar *)g_malloc0(strlen(val)+1);
+ memcpy(ret, val, strlen(val));
+ g_free(val);
+ } else {
+ ret = (gchar *)g_malloc0(strlen("default")+1);
+
+
+ g_snprintf(ret, strlen("default")+1, "default");
+ }
+
+
+ return ret;
+}
--- /dev/null
+/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation.
+ *
+ * Author: Kuisma Salonen <kuisma.salonen@nokia.com>
+ * 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_PLUGIN_WIDGET_H__
+#define __HILDON_PLUGIN_WIDGET_H__
+
+
+#include <glib-object.h>
+
+#include <gtk/gtkwidget.h>
+
+
+/**
+ * HildonPluginWidgetInfo:
+ *
+ * Contains information about the loaded module which has some widget
+ * inherited from some non-plugin widget. The struct should be considered
+ * private and should not be used directly.
+ */
+typedef struct HildonPluginWidgetInfo_ HildonPluginWidgetInfo;
+
+
+HildonPluginWidgetInfo *hildon_plugin_info_initialize(GType base_type, const gchar *name);
+
+
+GtkWidget *hildon_plugin_info_construct_widget(HildonPluginWidgetInfo *info);
+
+
+void hildon_plugin_info_kill(HildonPluginWidgetInfo *info);
+
+
+
+#endif /* __HILDON_PLUGIN_WIDGET_H__ */
*
* Copyright (C) 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
*/
-#ifndef HILDON_PRIVATE_H
-#define HILDON_PRIVATE_H
+#ifndef __HILDON_PRIVATE_H__
+#define __HILDON_PRIVATE_H__
#include <gtk/gtklabel.h>
GtkLabel *ms_sep_label);
G_END_DECLS
-#endif /* HILDON_PRIVATE_H */
+#endif /* __HILDON_PRIVATE_H__ */
*
* Copyright (C) 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
*
* Copyright (C) 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
hildon_program_get_is_topmost (HildonProgram *self);
G_END_DECLS
-#endif /* HILDON_PROGRAM_H */
+#endif /* __HILDON_PROGRAM_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
*
*/
-#ifndef HILDON_RANGE_EDITOR_H
-#define HILDON_RANGE_EDITOR_H
+#ifndef __HILDON_RANGE_EDITOR_H__
+#define __HILDON_RANGE_EDITOR_H__
#include <gtk/gtkcontainer.h>
const gchar *hildon_range_editor_get_separator (HildonRangeEditor *editor);
G_END_DECLS
-#endif
+#endif /* __HILDON_RANGE_EDITOR_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
* (ie. by gtk_bin_get_child)
*/
-#ifndef HILDON_SCROLL_AREA_H
-#define HILDON_SCROLL_AREA_H
+#ifndef __HILDON_SCROLL_AREA_H__
+#define __HILDON_SCROLL_AREA_H__
#include <gtk/gtkwidget.h>
GtkWidget * hildon_scroll_area_new(GtkWidget * sw, GtkWidget * child);
G_END_DECLS
-#endif /* HILDON_SCROLL_AREA_H */
+#endif /* __HILDON_SCROLL_AREA_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
guint hildon_seekbar_get_fraction(HildonSeekbar *seekbar);
G_END_DECLS
-#endif
+#endif /* __HILDON_SEEKBAR_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
const gchar * sort_key);
G_END_DECLS
-#endif
+#endif /* __HILDON_SORT_DIALOG_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
const gchar * number);
G_END_DECLS
-#endif
+#endif /* __HILDON_TELEPHONE_EDITOR_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
static void
hildon_time_picker_map( GtkWidget *widget );
+static void
+frame_size_request (GtkWidget *widget, GtkRequisition *requistion);
GType hildon_time_picker_get_type( void )
{
g_type_class_add_private( klass, sizeof(HildonTimePickerPrivate) );
}
+/* Okay, this is really bad. We make the requisition of the frames a bit larger
+ * so that it doesn't "change" when digits are changed (see #37489). It's a
+ * really bad solution to a problem, but the whole layout of the time picker is
+ * on crack anyways */
+static void frame_size_request (GtkWidget *widget, GtkRequisition *requistion)
+{
+ int framed = requistion->width / 10;
+ requistion->width = (framed + 1) * 10;
+}
+
static void hildon_time_picker_init( HildonTimePicker *picker )
{
HildonTimePickerPrivate *priv = HILDON_TIME_PICKER_GET_PRIVATE(picker);
if (i != WIDGET_GROUP_AMPM)
{
gtk_table_attach(table, group->frame, table_column, table_column + 1,
- 1, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
+ 1, 2, GTK_EXPAND, GTK_EXPAND, 0, 0);
+
+
}
/* FIXME: is it needed to force it to 0 here? */
gtk_container_set_border_width(GTK_CONTAINER(group->frame), 0);
/* Create label inside eventbox */
group->label = GTK_LABEL(gtk_label_new(NULL));
+ g_signal_connect(group->frame, "size-request",
+ G_CALLBACK(frame_size_request),
+ NULL);
+ gtk_misc_set_alignment (GTK_MISC (group->label), 0.5, 0.5);
gtk_container_add(GTK_CONTAINER(group->eventbox), GTK_WIDGET(group->label));
if (i != WIDGET_GROUP_AMPM)
gtk_table_set_row_spacing( table, 0, 6 );
gtk_table_set_row_spacing( table, 1, 6 );
- /* Put minute labels and buttons into same size group, so they each have
- the exact same horizontal width. */
- size_group = gtk_size_group_new( GTK_SIZE_GROUP_HORIZONTAL );
- for (i = WIDGET_GROUP_10_MINUTES; i < WIDGET_GROUP_1_MINUTES; i++)
- {
- gtk_size_group_add_widget(size_group, priv->widgets[i].frame);
- gtk_size_group_add_widget(size_group, priv->widgets[i].buttons[BUTTON_UP]);
- gtk_size_group_add_widget(size_group,
- priv->widgets[i].buttons[BUTTON_DOWN]);
- }
- g_object_unref( size_group ); /* Added widgets hold references */
-
if (priv->show_ampm)
{
gint table_column = widget_group_table_column_pos[WIDGET_GROUP_AMPM];
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
G_END_DECLS
-#endif
+#endif /* __HILDON_TIME_PICKER_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
GDateWeekday day);
G_END_DECLS
-#endif
+#endif /* __HILDON_WEEKDAY_PICKER_H__ */
*
* Copyright (C) 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
*/
-#ifndef HILDON_WINDOW_PRIVATE_H
-#define HILDON_WINDOW_PRIVATE_H
+#ifndef __HILDON_WINDOW_PRIVATE_H__
+#define __HILDON_WINDOW_PRIVATE_H__
G_BEGIN_DECLS
hildon_window_update_title (HildonWindow *window);
G_END_DECLS
-#endif /* HILDON_WINDOW_H */
+#endif /* __HILDON_WINDOW_PRIVATE_H__ */
*
* Copyright (C) 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/* Send fake event, simulation a situation that user
pressed 'x' from the corner */
event = gdk_event_new(GDK_DELETE);
- ((GdkEventAny *)event)->window = GTK_WIDGET(data)->window;
+ ((GdkEventAny *)event)->window = GDK_WINDOW (g_object_ref (GTK_WIDGET(data)->window));
gtk_main_do_event(event);
+
+ /* That unrefs the window, so we're reffing it above */
gdk_event_free(event);
priv->escape_timeout = 0;
*
* Sets the menu to be used for this window. This menu overrides
* a program-wide menu that may have been set with
- * hildon_program_set_common_menu.
+ * hildon_program_set_common_menu. Pass NULL to remove the current
+ * menu.
**/
void
hildon_window_set_menu (HildonWindow *self, GtkMenu *menu)
{
- g_return_if_fail (self && HILDON_IS_WINDOW (self) &&
- menu && GTK_IS_MENU (menu));
+ g_return_if_fail (HILDON_IS_WINDOW (self));
- if (self->priv->menu)
- {
+ if (self->priv->menu != NULL) {
+ gtk_menu_detach (GTK_MENU (self->priv->menu));
g_object_unref (self->priv->menu);
}
- self->priv->menu = GTK_WIDGET (menu);
- gtk_widget_set_name (GTK_WIDGET (self->priv->menu),
- "menu_force_with_corners");
- gtk_widget_show_all (self->priv->menu);
+ self->priv->menu = (menu != NULL) ? GTK_WIDGET (menu) : NULL;
+ if (self->priv->menu != NULL) {
+ gtk_widget_set_name (self->priv->menu, "menu_force_with_corners");
+ gtk_menu_attach_to_widget (GTK_MENU (self->priv->menu), GTK_WIDGET (self), &detach_menu_func);
+ g_object_ref (GTK_MENU (self->priv->menu));
+ }
- gtk_menu_attach_to_widget (menu, GTK_WIDGET (self), &detach_menu_func);
+ gtk_widget_show_all (GTK_WIDGET (self));
}
/**
*
* Copyright (C) 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
*/
-#ifndef HILDON_WINDOW_H
-#define HILDON_WINDOW_H
+#ifndef __HILDON_WINDOW_H__
+#define __HILDON_WINDOW_H__
#include <glib.h>
#include <glib-object.h>
G_END_DECLS
-#endif /* HILDON_WINDOW_H */
+#endif /* __HILDON_WINDOW_H__ */
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+ * Fixes: 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
static GtkDialogClass *parent_class;
-static void hildon_wizard_dialog_class_init (HildonWizardDialogClass * wizard_dialog_class);
-static void hildon_wizard_dialog_init (HildonWizardDialog * wizard_dialog);
-static void hildon_wizard_dialog_create_title(HildonWizardDialog * wizard_dialog);
+static void class_init (HildonWizardDialogClass *wizard_dialog_class);
-static void hildon_wizard_dialog_set_property(GObject * object,
- guint property_id,
- const GValue * value,
- GParamSpec * pspec);
+static void init (HildonWizardDialog *wizard_dialog);
-static void hildon_wizard_dialog_get_property(GObject * object,
- guint property_id,
- GValue * value,
- GParamSpec * pspec);
+static void create_title (HildonWizardDialog *wizard_dialog);
-static void hildon_wizard_dialog_finalize (GObject * object);
+static void set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
-static void hildon_wizard_dialog_response (HildonWizardDialog * wizard,
- gint response_id,
- gpointer unused);
+static void get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
+
+static void finalize (GObject *object);
+
+static void response (HildonWizardDialog *wizard,
+ gint response_id,
+ gpointer unused);
+
+static void make_buttons_sensitive (HildonWizardDialog *wizard_dialog,
+ gboolean previous,
+ gboolean finish,
+ gboolean next);
enum {
- PROP_WIZARD_NAME = 1,
+ PROP_ZERO,
+ PROP_WIZARD_NAME,
PROP_WIZARD_NOTEBOOK
};
};
-GType hildon_wizard_dialog_get_type(void)
+GType
+hildon_wizard_dialog_get_type (void)
{
static GType wizard_dialog_type = 0;
if (!wizard_dialog_type) {
static const GTypeInfo wizard_dialog_info = {
- sizeof(HildonWizardDialogClass),
+ sizeof (HildonWizardDialogClass),
NULL, /* base_init */
NULL, /* base_finalize */
- (GClassInitFunc) hildon_wizard_dialog_class_init,
+ (GClassInitFunc) class_init,
NULL, /* class_finalize */
NULL, /* class_data */
- sizeof(HildonWizardDialog),
+ sizeof (HildonWizardDialog),
0, /* n_preallocs */
- (GInstanceInitFunc) hildon_wizard_dialog_init,
+ (GInstanceInitFunc) init,
};
- wizard_dialog_type = g_type_register_static(GTK_TYPE_DIALOG,
- "HildonWizardDialog",
- &wizard_dialog_info,
- 0);
+ wizard_dialog_type = g_type_register_static (GTK_TYPE_DIALOG,
+ "HildonWizardDialog",
+ &wizard_dialog_info,
+ 0);
}
+
return wizard_dialog_type;
}
-
static void
-hildon_wizard_dialog_class_init(HildonWizardDialogClass * wizard_dialog_class)
+class_init (HildonWizardDialogClass *wizard_dialog_class)
{
- GObjectClass *object_class = G_OBJECT_CLASS(wizard_dialog_class);
+ GObjectClass *object_class = G_OBJECT_CLASS (wizard_dialog_class);
- parent_class = g_type_class_peek_parent(wizard_dialog_class);
+ parent_class = g_type_class_peek_parent (wizard_dialog_class);
- g_type_class_add_private(wizard_dialog_class,
- sizeof(HildonWizardDialogPrivate));
+ g_type_class_add_private (wizard_dialog_class,
+ sizeof(HildonWizardDialogPrivate));
/* Override virtual methods */
- object_class->set_property = hildon_wizard_dialog_set_property;
- object_class->get_property = hildon_wizard_dialog_get_property;
- object_class->finalize = hildon_wizard_dialog_finalize;
+ object_class->set_property = set_property;
+ object_class->get_property = get_property;
+ object_class->finalize = finalize;
/**
* HildonWizardDialog:wizard-name:
*
* The name of the wizard.
*/
- g_object_class_install_property(object_class, PROP_WIZARD_NAME,
- g_param_spec_string("wizard-name",
- "Wizard Name",
- "The name of the HildonWizardDialog",
- NULL,
- G_PARAM_READWRITE));
+ g_object_class_install_property (object_class, PROP_WIZARD_NAME,
+ g_param_spec_string
+ ("wizard-name",
+ "Wizard Name",
+ "The name of the HildonWizardDialog",
+ NULL,
+ G_PARAM_READWRITE));
/**
* HildonWizardDialog:wizard-notebook:
* The notebook object, which is used by the HildonWizardDialog.
*/
g_object_class_install_property(object_class, PROP_WIZARD_NOTEBOOK,
- g_param_spec_object("wizard-notebook",
- "Wizard Notebook",
- "GtkNotebook object to be used in the "
- "HildonWizardDialog",
- GTK_TYPE_NOTEBOOK, G_PARAM_READWRITE));
+ g_param_spec_object
+ ("wizard-notebook",
+ "Wizard Notebook",
+ "GtkNotebook object to be used in the "
+ "HildonWizardDialog",
+ GTK_TYPE_NOTEBOOK, G_PARAM_READWRITE));
}
-static void hildon_wizard_dialog_finalize(GObject * object)
+static void
+finalize (GObject *object)
{
- g_free(HILDON_WIZARD_DIALOG(object)->priv->wizard_name);
- if (G_OBJECT_CLASS(parent_class)->finalize)
- G_OBJECT_CLASS(parent_class)->finalize(object);
+ HildonWizardDialog *dialog = HILDON_WIZARD_DIALOG (object);
+ g_return_if_fail (dialog != NULL);
+
+ if (dialog->priv->wizard_name != NULL)
+ g_free (HILDON_WIZARD_DIALOG (object)->priv->wizard_name);
+
+ if (G_OBJECT_CLASS (parent_class)->finalize)
+ G_OBJECT_CLASS (parent_class)->finalize(object);
}
-/* Disable/enable the Previous, Next and Finish buttons */
+/* Disable or enable the Previous, Next and Finish buttons */
static void
-hildon_wizard_dialog_buttons_sensitive(HildonWizardDialog * wizard_dialog,
- gboolean previous,
- gboolean finish,
- gboolean next)
+make_buttons_sensitive (HildonWizardDialog *wizard_dialog,
+ gboolean previous,
+ gboolean finish,
+ gboolean next)
{
- gtk_dialog_set_response_sensitive(GTK_DIALOG(wizard_dialog),
- HILDON_WIZARD_DIALOG_PREVIOUS,
- previous);
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (wizard_dialog),
+ HILDON_WIZARD_DIALOG_PREVIOUS,
+ previous);
- gtk_dialog_set_response_sensitive(GTK_DIALOG(wizard_dialog),
- HILDON_WIZARD_DIALOG_FINISH,
- finish);
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (wizard_dialog),
+ HILDON_WIZARD_DIALOG_FINISH,
+ finish);
- gtk_dialog_set_response_sensitive(GTK_DIALOG(wizard_dialog),
- HILDON_WIZARD_DIALOG_NEXT,
- next);
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (wizard_dialog),
+ HILDON_WIZARD_DIALOG_NEXT,
+ next);
}
-static void hildon_wizard_dialog_init(HildonWizardDialog * wizard_dialog)
+static void
+init (HildonWizardDialog *wizard_dialog)
{
/* Initialize private structure for faster member access */
HildonWizardDialogPrivate *priv =
- G_TYPE_INSTANCE_GET_PRIVATE(wizard_dialog,
- HILDON_TYPE_WIZARD_DIALOG,
- HildonWizardDialogPrivate);
- GtkDialog *dialog = GTK_DIALOG(wizard_dialog);
+ G_TYPE_INSTANCE_GET_PRIVATE (wizard_dialog,
+ HILDON_TYPE_WIZARD_DIALOG,
+ HildonWizardDialogPrivate);
+
+ GtkDialog *dialog = GTK_DIALOG (wizard_dialog);
/* Init internal widgets */
- GtkWidget *vbox = gtk_vbox_new(FALSE, 0);
- gtk_dialog_set_has_separator(dialog, FALSE);
+ GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
+ gtk_dialog_set_has_separator (dialog, FALSE);
wizard_dialog->priv = priv;
- priv->box = GTK_BOX(gtk_hbox_new(FALSE, 0));
- priv->image = gtk_image_new_from_icon_name("qgn_widg_wizard",
- HILDON_ICON_SIZE_WIDG_WIZARD);
+ priv->box = GTK_BOX (gtk_hbox_new (FALSE, 0));
+ priv->image = gtk_image_new_from_icon_name ("qgn_widg_wizard",
+ HILDON_ICON_SIZE_WIDG_WIZARD);
/* Default values for user provided properties */
priv->notebook = NULL;
priv->wizard_name = NULL;
/* Build wizard layout */
- gtk_box_pack_start_defaults(GTK_BOX(dialog->vbox), GTK_WIDGET(priv->box));
- gtk_box_pack_start_defaults(GTK_BOX(priv->box), GTK_WIDGET(vbox));
- gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(priv->image), FALSE, FALSE, 0);
+ gtk_box_pack_start_defaults (GTK_BOX (dialog->vbox), GTK_WIDGET (priv->box));
+ gtk_box_pack_start_defaults (GTK_BOX (priv->box), GTK_WIDGET (vbox));
+ gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (priv->image), FALSE, FALSE, 0);
/* Add response buttons: cancel, previous, next, finish */
- gtk_dialog_add_button(dialog, _("ecdg_bd_wizard_cancel"), HILDON_WIZARD_DIALOG_CANCEL);
- gtk_dialog_add_button(dialog, _("ecdg_bd_wizard_previous"), HILDON_WIZARD_DIALOG_PREVIOUS);
- gtk_dialog_add_button(dialog, _("ecdg_bd_wizard_next"), HILDON_WIZARD_DIALOG_NEXT);
- gtk_dialog_add_button(dialog, _("ecdg_bd_wizard_finish"), HILDON_WIZARD_DIALOG_FINISH);
+ gtk_dialog_add_button (dialog, _("ecdg_bd_wizard_cancel"), HILDON_WIZARD_DIALOG_CANCEL);
+ gtk_dialog_add_button (dialog, _("ecdg_bd_wizard_previous"), HILDON_WIZARD_DIALOG_PREVIOUS);
+ gtk_dialog_add_button (dialog, _("ecdg_bd_wizard_next"), HILDON_WIZARD_DIALOG_NEXT);
+ gtk_dialog_add_button (dialog, _("ecdg_bd_wizard_finish"), HILDON_WIZARD_DIALOG_FINISH);
/* Set initial button states: previous and finish buttons are disabled */
- hildon_wizard_dialog_buttons_sensitive(wizard_dialog, FALSE, FALSE, TRUE);
+ make_buttons_sensitive (wizard_dialog, FALSE, FALSE, TRUE);
/* connect to dialog's response signal */
- g_signal_connect(G_OBJECT(dialog), "response",
- G_CALLBACK(hildon_wizard_dialog_response), NULL);
+ g_signal_connect (G_OBJECT (dialog), "response",
+ G_CALLBACK (response), NULL);
}
-
static void
-hildon_wizard_dialog_set_property(GObject * object, guint property_id,
- const GValue * value, GParamSpec * pspec)
+set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
HildonWizardDialogPrivate *priv = HILDON_WIZARD_DIALOG(object)->priv;
switch (property_id) {
- case PROP_WIZARD_NAME:
-
- /* Set new wizard name. This name will appear in titlebar */
- if (priv->wizard_name)
- g_free(priv->wizard_name);
- priv->wizard_name = g_strdup((gchar *) g_value_get_string(value));
-
- /* We need notebook in order to create title, since page information
- is used in title generation */
- if (priv->notebook)
- hildon_wizard_dialog_create_title(HILDON_WIZARD_DIALOG(object));
- break;
- case PROP_WIZARD_NOTEBOOK:
- priv->notebook = GTK_NOTEBOOK(g_value_get_object(value));
-
- /* Set the default properties for the notebook (disable tabs,
- * and remove borders) to make it look like a nice wizard widget */
- gtk_notebook_set_show_tabs (priv->notebook, FALSE);
- gtk_notebook_set_show_border (priv->notebook, FALSE);
- gtk_box_pack_start_defaults (GTK_BOX(priv->box), GTK_WIDGET(priv->notebook));
-
- /* Update dialog title to reflect current page stats etc */
- if (priv->wizard_name)
- hildon_wizard_dialog_create_title(HILDON_WIZARD_DIALOG
- (object));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
- break;
+
+ case PROP_WIZARD_NAME:
+
+ /* Set new wizard name. This name will appear in titlebar */
+ if (priv->wizard_name)
+ g_free (priv->wizard_name);
+
+ gchar *str = (gchar *) g_value_get_string (value);
+ g_return_if_fail (str != NULL);
+
+ priv->wizard_name = g_strdup (str);
+
+ /* We need notebook in order to create title, since page information
+ is used in title generation */
+
+ if (priv->notebook)
+ create_title (HILDON_WIZARD_DIALOG (object));
+
+ break;
+
+ case PROP_WIZARD_NOTEBOOK: {
+
+ GtkNotebook *book = GTK_NOTEBOOK (g_value_get_object (value));
+ g_return_if_fail (book != NULL);
+
+ priv->notebook = book;
+
+ /* Set the default properties for the notebook (disable tabs,
+ * and remove borders) to make it look like a nice wizard widget */
+ gtk_notebook_set_show_tabs (priv->notebook, FALSE);
+ gtk_notebook_set_show_border (priv->notebook, FALSE);
+ gtk_box_pack_start_defaults (GTK_BOX( priv->box), GTK_WIDGET (priv->notebook));
+
+ /* Update dialog title to reflect current page stats etc */
+ if (priv->wizard_name)
+ create_title (HILDON_WIZARD_DIALOG (object));
+
+ } break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
}
}
-/*
- * Creates the title of the dialog taking into account the current
- * page of the notebook.
- */
static void
-hildon_wizard_dialog_get_property(GObject * object,
- guint property_id,
- GValue * value,
- GParamSpec * pspec)
+get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- HildonWizardDialogPrivate *priv = HILDON_WIZARD_DIALOG(object)->priv;
+ HildonWizardDialogPrivate *priv = HILDON_WIZARD_DIALOG (object)->priv;
switch (property_id) {
- case PROP_WIZARD_NAME:
- g_value_set_string(value, priv->wizard_name);
- break;
- case PROP_WIZARD_NOTEBOOK:
- g_value_set_object(value, priv->notebook);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
- break;
+
+ case PROP_WIZARD_NAME:
+ g_value_set_string (value, priv->wizard_name);
+ break;
+
+ case PROP_WIZARD_NOTEBOOK:
+ g_value_set_object (value, priv->notebook);
+ break;
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
}
}
* page of the notebook.
*/
static void
-hildon_wizard_dialog_create_title(HildonWizardDialog * wizard_dialog)
+create_title (HildonWizardDialog *wizard_dialog)
{
gint pages, current;
gchar *str = NULL;
return;
/* Get page information, we'll need that when creating title */
- pages = gtk_notebook_get_n_pages(notebook);
- current = gtk_notebook_get_current_page(priv->notebook);
+ pages = gtk_notebook_get_n_pages (notebook);
+ current = gtk_notebook_get_current_page (priv->notebook);
if (current < 0)
current = 0;
/* the welcome title on the initial page */
if (current == 0) {
- str = g_strdup_printf(_("ecdg_ti_wizard_welcome"),
- priv->wizard_name, pages);
+ str = g_strdup_printf (_("ecdg_ti_wizard_welcome"),
+ priv->wizard_name, pages);
} else {
- const gchar *steps = gtk_notebook_get_tab_label_text(notebook,
- gtk_notebook_get_nth_page(notebook, current));
- str = g_strdup_printf(_("ecdg_ti_wizard_step"),
- priv->wizard_name, current + 1, pages, steps);
+ const gchar *steps = gtk_notebook_get_tab_label_text (notebook,
+ gtk_notebook_get_nth_page (notebook, current));
+
+ str = g_strdup_printf (_("ecdg_ti_wizard_step"),
+ priv->wizard_name, current + 1, pages, steps);
}
/* Update the dialog to display the generated title */
- gtk_window_set_title(GTK_WINDOW(wizard_dialog), str);
- g_free(str);
+ gtk_window_set_title (GTK_WINDOW (wizard_dialog), str);
+ g_free (str);
}
/*
* want to change pages and, dimm certain response buttons. Overriding the
* virtual function would not work because that would be called after the
* signal handler implemented by GtkDialog.
+ * FIXME: There is a much saner way to do that [MDK]
*/
-
-static void hildon_wizard_dialog_response(HildonWizardDialog *wizard_dialog,
- gint response_id,
- gpointer unused)
+static void
+response (HildonWizardDialog *wizard_dialog,
+ gint response_id,
+ gpointer unused)
{
HildonWizardDialogPrivate *priv = wizard_dialog->priv;
GtkNotebook *notebook = priv->notebook;
gint current = 0;
- gint last = gtk_notebook_get_n_pages(notebook) - 1;
+ gint last = gtk_notebook_get_n_pages (notebook) - 1;
gboolean is_first, is_last;
- switch (response_id)
- {
+ switch (response_id) {
+
case HILDON_WIZARD_DIALOG_PREVIOUS:
- gtk_notebook_prev_page(notebook); /* go to previous page */
+ gtk_notebook_prev_page (notebook); /* go to previous page */
break;
+
case HILDON_WIZARD_DIALOG_NEXT:
- gtk_notebook_next_page(notebook); /* go to next page */
+ gtk_notebook_next_page (notebook); /* go to next page */
break;
+
case HILDON_WIZARD_DIALOG_CANCEL:
case HILDON_WIZARD_DIALOG_FINISH:
return;
+
}
- current = gtk_notebook_get_current_page(notebook);
+ current = gtk_notebook_get_current_page (notebook);
is_last = current == last;
is_first = current == 0;
/* If first page, previous and finish are disabled,
if last page, next is disabled */
- hildon_wizard_dialog_buttons_sensitive(wizard_dialog,
- !is_first, !is_first, !is_last);
+ make_buttons_sensitive (wizard_dialog,
+ !is_first, !is_first, !is_last);
/* Don't let the dialog close */
- g_signal_stop_emission_by_name(wizard_dialog, "response");
+ g_signal_stop_emission_by_name (wizard_dialog, "response");
/* We show the default image on first and last pages */
if (current == last || current == 0)
- gtk_widget_show(GTK_WIDGET(priv->image));
+ gtk_widget_show (GTK_WIDGET(priv->image));
else
- gtk_widget_hide(GTK_WIDGET(priv->image));
+ gtk_widget_hide (GTK_WIDGET(priv->image));
/* New page number may appear in the title, update it */
- hildon_wizard_dialog_create_title(wizard_dialog);
+ create_title (wizard_dialog);
}
-
/**
* hildon_wizard_dialog_new:
* @parent: a #GtkWindow
*
* Returns: a new #HildonWizardDialog
*/
-GtkWidget *hildon_wizard_dialog_new(GtkWindow * parent,
- const char * wizard_name,
- GtkNotebook * notebook)
+GtkWidget*
+hildon_wizard_dialog_new (GtkWindow *parent,
+ const char *wizard_name,
+ GtkNotebook *notebook)
{
GtkWidget *widget;
- g_return_val_if_fail(GTK_IS_NOTEBOOK(notebook), NULL);
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
+
+ widget = GTK_WIDGET (g_object_new
+ (HILDON_TYPE_WIZARD_DIALOG,
+ "wizard-name", wizard_name,
+ "wizard-notebook", notebook, NULL));
- widget = GTK_WIDGET(g_object_new(HILDON_TYPE_WIZARD_DIALOG,
- "wizard-name", wizard_name,
- "wizard-notebook", notebook, NULL));
if (parent)
- gtk_window_set_transient_for(GTK_WINDOW(widget), parent);
+ gtk_window_set_transient_for (GTK_WINDOW (widget), parent);
return widget;
}
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
+ * Fixes: 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
#ifndef __HILDON_WIZARD_DIALOG_H__
#define __HILDON_WIZARD_DIALOG_H__
-#include<gtk/gtkwidget.h>
-#include<gtk/gtkwindow.h>
-#include<gtk/gtknotebook.h>
-#include<gtk/gtkdialog.h>
+#include <gtk/gtkwidget.h>
+#include <gtk/gtkwindow.h>
+#include <gtk/gtknotebook.h>
+#include <gtk/gtkdialog.h>
G_BEGIN_DECLS
-#define HILDON_TYPE_WIZARD_DIALOG ( hildon_wizard_dialog_get_type() )
-#define HILDON_WIZARD_DIALOG(obj) (GTK_CHECK_CAST (obj,\
- HILDON_TYPE_WIZARD_DIALOG, HildonWizardDialog))
-#define HILDON_WIZARD_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass),\
- HILDON_TYPE_WIZARD_DIALOG, HildonWizardDialogClass))
-#define HILDON_IS_WIZARD_DIALOG(obj) (GTK_CHECK_TYPE (obj,\
- HILDON_TYPE_WIZARD_DIALOG))
-#define HILDON_IS_WIZARD_DIALOG_CLASS(klass) \
- (GTK_CHECK_CLASS_TYPE ((klass), HILDON_TYPE_WIZARD_DIALOG))
+
+#define HILDON_TYPE_WIZARD_DIALOG (hildon_wizard_dialog_get_type())
+
+#define HILDON_WIZARD_DIALOG(obj) (GTK_CHECK_CAST ((obj), \
+ HILDON_TYPE_WIZARD_DIALOG, HildonWizardDialog))
+
+#define HILDON_WIZARD_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), \
+ HILDON_TYPE_WIZARD_DIALOG, HildonWizardDialogClass))
+
+#define HILDON_IS_WIZARD_DIALOG(obj) (GTK_CHECK_TYPE ((obj), \
+ HILDON_TYPE_WIZARD_DIALOG))
+
+#define HILDON_IS_WIZARD_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), \
+ HILDON_TYPE_WIZARD_DIALOG))
+
typedef struct _HildonWizardDialog HildonWizardDialog;
+
typedef struct _HildonWizardDialogClass HildonWizardDialogClass;
-typedef struct _HildonWizardDialogPrivate HildonWizardDialogPrivate;
+typedef struct _HildonWizardDialogPrivate HildonWizardDialogPrivate;
/* button response IDs */
enum {
};
struct _HildonWizardDialog {
- GtkDialog parent;
- HildonWizardDialogPrivate *priv;
+ GtkDialog parent;
+ HildonWizardDialogPrivate *priv;
};
struct _HildonWizardDialogClass {
- GtkDialogClass parent_class;
- void (*_gtk_reserved1) (void);
- void (*_gtk_reserved2) (void);
- void (*_gtk_reserved3) (void);
- void (*_gtk_reserved4) (void);
+ GtkDialogClass parent_class;
+ void (*_gtk_reserved1) (void);
+ void (*_gtk_reserved2) (void);
+ void (*_gtk_reserved3) (void);
+ void (*_gtk_reserved4) (void);
};
-GType hildon_wizard_dialog_get_type(void) G_GNUC_CONST;
+GType hildon_wizard_dialog_get_type (void) G_GNUC_CONST;
-GtkWidget *hildon_wizard_dialog_new(GtkWindow * parent,
- const char *wizard_name,
- GtkNotebook * notebook);
+GtkWidget* hildon_wizard_dialog_new (GtkWindow *parent,
+ const char *wizard_name,
+ GtkNotebook *notebook);
G_END_DECLS
-#endif
+
+#endif /* __HILDON_WIZARD_DIALOG_H__ */
debian/control \
debian/rules \
debian/hildon-libs-l10n-engb.install
+MAINTAINERCLEANFILES = Makefile.in POTFILES
%.mo: %.po
msgfmt --statistics -v -o$(top_builddir)/po/$@ $(srcdir)/$<
--- /dev/null
+style "colorchoosar"
+{
+ HildonColorChooser::outer-border = { 3, 3, 3, 3 }
+
+ HildonColorChooserHSV::inner-size = { 202, 202, 26, 18 }
+ HildonColorChooserHSV::graphic-border = { 3, 3, 3, 3 }
+
+
+ engine "pixmap"
+ {
+ image
+ {
+ function = BOX
+ detail = "border-top"
+ file = "border_n.png"
+ border = { 3, 3, 0, 0}
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ detail = "border-bottom"
+ file = "border_s.png"
+ border = { 3, 3, 0, 0}
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ detail = "border-left"
+ file = "leftie.png"
+ border = { 1, 1, 1, 1}
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ detail = "border-right"
+ file = "rightie.png"
+ border = { 1, 1, 1, 1}
+ stretch = TRUE
+ }
+ }
+}
+class "HildonColorChooser" style "colorchoosar"
+
+
+style "chooserdialog"
+{
+ HildonColorChooserDialogHSV::radio-sizes = { 26, 26, 0, 3 }
+ HildonColorChooserDialogHSV::container-sizes = { 18, 12, 6, 0 }
+
+ HildonColorChooserDialogHSV::num-buttons = { 8, 2, 8, 4 }
+
+ HildonColorChooserDialogHSV::defined-color0 = "#000000"
+ HildonColorChooserDialogHSV::defined-color1 = "#660000"
+ HildonColorChooserDialogHSV::defined-color2 = "#0000FF"
+ HildonColorChooserDialogHSV::defined-color3 = "#FF00FF"
+ HildonColorChooserDialogHSV::defined-color4 = "#006600"
+ HildonColorChooserDialogHSV::defined-color5 = "#666600"
+ HildonColorChooserDialogHSV::defined-color6 = "#666666"
+ HildonColorChooserDialogHSV::defined-color7 = "#FF0000"
+ HildonColorChooserDialogHSV::defined-color8 = "#00FFFF"
+ HildonColorChooserDialogHSV::defined-color9 = "#FFFFFF"
+ HildonColorChooserDialogHSV::defined-color10 = "#00FF00"
+ HildonColorChooserDialogHSV::defined-color11 = "#FFFF00"
+
+ HildonColorChooserDialogHSV::defined-color12 = "#000066"
+ HildonColorChooserDialogHSV::defined-color13 = "#660066"
+ HildonColorChooserDialogHSV::defined-color14 = "#006666"
+ HildonColorChooserDialogHSV::defined-color15 = "#CCCCCC"
+
+ HildonColorChooserDialogHSV::default-color = "#ffffff"
+
+
+ engine "pixmap"
+ {
+ image
+ {
+ function = BOX
+ detail = "color-radio"
+ state = SELECTED
+ file = "radio_selected.png"
+ border = { 3, 3, 3, 3 }
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ detail = "color-radio"
+ state = NORMAL
+ file = "radio_normal.png"
+ border = { 3, 3, 3, 3 }
+ stretch = TRUE
+ }
+ }
+}
+class "HildonColorChooserDialog" style "chooserdialog"
--- /dev/null
+style "colorchoosar"
+{
+ HildonColorChooser::outer-border = { 3, 3, 3, 3 }
+
+ HildonColorChooserHSV::inner-size = { 202, 202, 26, 18 }
+ HildonColorChooserHSV::graphic-border = { 3, 3, 3, 3 }
+
+
+ engine "pixmap"
+ {
+ image
+ {
+ function = BOX
+ detail = "border-top"
+ file = "border_n.png"
+ border = { 3, 3, 0, 0}
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ detail = "border-bottom"
+ file = "border_s.png"
+ border = { 3, 3, 0, 0}
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ detail = "border-left"
+ file = "leftie.png"
+ border = { 1, 1, 1, 1}
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ detail = "border-right"
+ file = "rightie.png"
+ border = { 1, 1, 1, 1}
+ stretch = TRUE
+ }
+ }
+}
+class "HildonColorChooser" style "colorchoosar"
+
+
+style "chooserdialog"
+{
+ HildonColorChooserDialogHSV::radio-sizes = { 26, 26, 0, 3 }
+ HildonColorChooserDialogHSV::container-sizes = { 18, 12, 6, 0 }
+
+ HildonColorChooserDialogHSV::num-buttons = { 6, 2, 6, 4 }
+
+ HildonColorChooserDialogHSV::defined-color0 = "#000000"
+ HildonColorChooserDialogHSV::defined-color1 = "#816d6e"
+ HildonColorChooserDialogHSV::defined-color2 = "#d03e3f"
+ HildonColorChooserDialogHSV::defined-color3 = "#137f34"
+ HildonColorChooserDialogHSV::defined-color4 = "#272fd0"
+ HildonColorChooserDialogHSV::defined-color5 = "#01fff2"
+ HildonColorChooserDialogHSV::defined-color6 = "#ffc801"
+ HildonColorChooserDialogHSV::defined-color7 = "#ff00cd"
+ HildonColorChooserDialogHSV::defined-color8 = "#c3ff01"
+ HildonColorChooserDialogHSV::defined-color9 = "#01a1ff"
+ HildonColorChooserDialogHSV::defined-color10 = "#ff2301"
+ HildonColorChooserDialogHSV::defined-color11 = "#ebebeb"
+
+ HildonColorChooserDialogHSV::default-color = "#ffffff"
+
+
+ engine "pixmap"
+ {
+ image
+ {
+ function = BOX
+ detail = "color-radio"
+ state = SELECTED
+ file = "radio_selected.png"
+ border = { 3, 3, 3, 3 }
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ detail = "color-radio"
+ state = NORMAL
+ file = "radio_normal.png"
+ border = { 3, 3, 3, 3 }
+ stretch = TRUE
+ }
+ }
+}
+class "HildonColorChooserDialog" style "chooserdialog"
--- /dev/null
+style "colorchoosar"
+{
+ HildonColorChooser::outer-border = { 3, 3, 3, 3 }
+
+ HildonColorChooserHSV::inner-size = { 202, 202, 26, 18 }
+ HildonColorChooserHSV::graphic-border = { 3, 3, 3, 3 }
+
+
+ engine "pixmap"
+ {
+ image
+ {
+ function = BOX
+ detail = "border-top"
+ file = "border_n.png"
+ border = { 3, 3, 0, 0}
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ detail = "border-bottom"
+ file = "border_s.png"
+ border = { 3, 3, 0, 0}
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ detail = "border-left"
+ file = "leftie.png"
+ border = { 1, 1, 1, 1}
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ detail = "border-right"
+ file = "rightie.png"
+ border = { 1, 1, 1, 1}
+ stretch = TRUE
+ }
+ }
+}
+class "HildonColorChooser" style "colorchoosar"
+
+
+style "chooserdialog"
+{
+ HildonColorChooserDialogHSV::radio-sizes = { 26, 26, 0, 3 }
+ HildonColorChooserDialogHSV::container-sizes = { 18, 12, 6, 0 }
+
+ HildonColorChooserDialogHSV::num-buttons = { 6, 2, 6, 4 }
+
+ HildonColorChooserDialogHSV::defined-color0 = "#000000"
+ HildonColorChooserDialogHSV::defined-color1 = "#816d6e"
+ HildonColorChooserDialogHSV::defined-color2 = "#d03e3f"
+ HildonColorChooserDialogHSV::defined-color3 = "#137f34"
+ HildonColorChooserDialogHSV::defined-color4 = "#272fd0"
+ HildonColorChooserDialogHSV::defined-color5 = "#01fff2"
+ HildonColorChooserDialogHSV::defined-color6 = "#ffc801"
+ HildonColorChooserDialogHSV::defined-color7 = "#ff00cd"
+ HildonColorChooserDialogHSV::defined-color8 = "#c3ff01"
+ HildonColorChooserDialogHSV::defined-color9 = "#01a1ff"
+ HildonColorChooserDialogHSV::defined-color10 = "#ff2301"
+ HildonColorChooserDialogHSV::defined-color11 = "#ebebeb"
+
+ HildonColorChooserDialogHSV::default-color = "#ffffff"
+
+
+ engine "pixmap"
+ {
+ image
+ {
+ function = BOX
+ detail = "color-radio"
+ state = SELECTED
+ file = "radio_selected.png"
+ border = { 3, 3, 3, 3 }
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ detail = "color-radio"
+ state = NORMAL
+ file = "radio_normal.png"
+ border = { 3, 3, 3, 3 }
+ stretch = TRUE
+ }
+ }
+}
+class "HildonColorChooserDialog" style "chooserdialog"
EXTRA_DIST =
+MAINTAINERCLEANFILES = Makefile.in
+
libtimer_a_SOURCES = timer.h timer.c
timerincludeinstdir=$(includedir)/hildon-lgpl/timer
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
#else
-#ifndef TIMER_H
-#define TIMER_H
+#ifndef __TIMER_H__
+#define __TIMER_H__
#define TIMER_START( filename ) timer_start( filename );
#define TIMER_STOP() timer_stop()
void timer_stop( void );
void print_timestamp( char * );
-#endif /* TIMER_H */
+#endif /* __TIMER_H__ */
#endif /* HILDON_USE_TIMESTAMPING */
+MAINTAINERCLEANFILES = Makefile.in
+
outomodule_LTLIBRARIES = \
libhildonwidgets_unittests.la \
libhildonwidgets_clock_unittests.la
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
* This file is part of hildon-libs
*
- * Copyright (C) 2005 Nokia Corporation.
+ * Copyright (C) 2005, 2006 Nokia Corporation.
*
- * Contact: Luc Pionchon <luc.pionchon@nokia.com>
+ * 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; either version 2.1 of
- * the License, or (at your option) any later version.
+ * 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
/*
+ * This file is part of hildon-libs
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation.
+ *
+ * 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
+ *
+ */
+
+/*
gcc `pkg-config --cflags gtk+-2.0 hildon-libs` `pkg-config --libs gtk+-2.0 hildon-libs` -o tc_banner_truncate tc_banner_truncate.c && DISPLAY=:2 run-standalone.sh ./tc_banner_truncate 1