2008-11-24 Claudio Saavedra <csaavedra@igalia.com>
authorClaudio Saavedra <csaavedra@igalia.com>
Mon, 24 Nov 2008 16:58:31 +0000 (16:58 +0000)
committerClaudio Saavedra <csaavedra@igalia.com>
Mon, 24 Nov 2008 16:58:31 +0000 (16:58 +0000)
Based on initial code by Christian Dywan (christian@imendio.com)

* doc/hildon-docs.sgml: Add section for hildon-main.
* examples/*.c: (main): Replace gtk_main() calls with hildon_gtk_main().
* src/Makefile.am: Add new hildon-main.[ch]
* src/hildon-defines.h: Update the icon sizes.
* src/hildon-main.c: (+hildon_init), (+hildon_gtk_init): Add
new library initialization files and register icon sizes.
* src/hildon-main.h: New declarations.
* src/hildon.h: Include hildon-main.h

Add new initialization functions to the library. These methods
will register the hildon specific icon sizes and can be used in the
future for other hildon specific bits.

Fixes: NB#92476 (Update icon size constants to Fremantle (hildon-defines.h))
Fixes: NB#93075 (Update icon size constants to Fremantle)

67 files changed:
ChangeLog
doc/hildon-docs.sgml
examples/hildon-app-menu-example.c
examples/hildon-banner-example.c
examples/hildon-banner-long-example.c
examples/hildon-bread-crumb-trail-example.c
examples/hildon-button-example.c
examples/hildon-caption-example.c
examples/hildon-check-button-example.c
examples/hildon-code-dialog-example.c
examples/hildon-color-button-example.c
examples/hildon-color-chooser-example.c
examples/hildon-color-pop-example.c
examples/hildon-controlbar-example.c
examples/hildon-date-button-example.c
examples/hildon-date-editor-example.c
examples/hildon-dialog-example.c
examples/hildon-edit-toolbar-example.c
examples/hildon-entry-example.c
examples/hildon-find-toolbar-example.c
examples/hildon-finger-example.c
examples/hildon-get-password-dialog-example.c
examples/hildon-hvolumebar-example.c
examples/hildon-hvolumebar-insensitive-example.c
examples/hildon-hvolumebar-insensitive-map-example.c
examples/hildon-hvolumebar-timer-example.c
examples/hildon-icon-sizes-example.c
examples/hildon-insensitive-example.c
examples/hildon-logical-color-example.c
examples/hildon-login-dialog-example.c
examples/hildon-lookup-example.c
examples/hildon-note-example.c
examples/hildon-number-editor-example.c
examples/hildon-pannable-area-buttons-scroll-example.c
examples/hildon-pannable-area-gesture-signals-example.c
examples/hildon-pannable-area-scroll-jump-example.c
examples/hildon-pannable-area-touch-grid-example.c
examples/hildon-pannable-area-touch-list-example.c
examples/hildon-pannable-area-tree-view-example.c
examples/hildon-picker-button-example.c
examples/hildon-picker-button-multicolumn-example.c
examples/hildon-scrolled-window-example.c
examples/hildon-seekbar-example.c
examples/hildon-set-password-dialog-example.c
examples/hildon-sort-dialog-example.c
examples/hildon-stackable-window-example.c
examples/hildon-text-view-example.c
examples/hildon-thumb-scrollbar-example.c
examples/hildon-time-button-example.c
examples/hildon-time-editor-example.c
examples/hildon-time-picker-example.c
examples/hildon-toolbar-example.c
examples/hildon-toolbar-seekbar-example.c
examples/hildon-touch-selector-entry-example.c
examples/hildon-touch-selector-example.c
examples/hildon-touch-selector-multi-cells-example.c
examples/hildon-vvolumebar-example.c
examples/hildon-weekday-picker-example.c
examples/hildon-window-cmn-menu-example.c
examples/hildon-window-example.c
examples/hildon-window-menu-example.c
examples/hildon-wizard-dialog-example.c
src/Makefile.am
src/hildon-defines.h
src/hildon-main.c [new file with mode: 0644]
src/hildon-main.h [new file with mode: 0644]
src/hildon.h

index ffa8461..30bdfa3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2008-11-24  Claudio Saavedra  <csaavedra@igalia.com>
+
+       Based on initial code by Christian Dywan (christian@imendio.com)
+
+       * doc/hildon-docs.sgml: Add section for hildon-main.
+       * examples/*.c: (main): Replace gtk_main() calls with hildon_gtk_main().
+       * src/Makefile.am: Add new hildon-main.[ch]
+       * src/hildon-defines.h: Update the icon sizes.
+       * src/hildon-main.c: (+hildon_init), (+hildon_gtk_init): Add
+       new library initialization files and register icon sizes.
+       * src/hildon-main.h: New declarations.
+       * src/hildon.h: Include hildon-main.h
+
+       Add new initialization functions to the library. These methods
+       will register the hildon specific icon sizes and can be used in the
+       future for other hildon specific bits.
+
+       Fixes: NB#92476 (Update icon size constants to Fremantle (hildon-defines.h))
+       Fixes: NB#93075 (Update icon size constants to Fremantle)
+
 2008-11-21  Claudio Saavedra  <csaavedra@igalia.com>
 
        * src/hildon-window.c: (hildon_window_realize),
index 890ed97..f9b4e4c 100644 (file)
@@ -97,6 +97,7 @@
 
   <chapter>
     <title>Other</title>
+    <xi:include href="xml/hildon-main.xml"/>
     <xi:include href="xml/hildon-gtk.xml"/>
     <xi:include href="xml/hildon-sound.xml"/>
     <xi:include href="xml/hildon-helper.xml"/>
index f05090d..afb7034 100644 (file)
@@ -99,7 +99,7 @@ main                                            (int argc,
     HildonAppMenu *menu;
     GtkAccelGroup *accel;
 
-    gtk_init (&argc, &argv);
+    hildon_gtk_init (&argc, &argv);
 
     label = gtk_label_new ("This is an example of the\nHildonAppMenu widget.\n\n"
                            "Click on the titlebar\nto pop up the menu.");
index b4c1a8e..d1f85f7 100644 (file)
@@ -68,10 +68,10 @@ on_progress_clicked                             (GtkWidget *widget)
 
 int
 main                                            (int argc, 
-                                                 char **args)
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
index 7e3bf5a..f0ce84c 100644 (file)
@@ -38,10 +38,10 @@ on_fire_clicked                                 (GtkWidget *widget)
 
 int
 main                                            (int argc, 
-                                                 char **args)
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
index b7483ed..983bd88 100644 (file)
@@ -240,7 +240,7 @@ int main (int argc, char **argv)
   GtkCellRenderer *renderer;
   GtkTreeViewColumn *column;
 
-  gtk_init (&argc, &argv);
+  hildon_gtk_init (&argc, &argv);
 
   /* Main window */
 #if 1
index 740b1a8..306eb74 100644 (file)
@@ -248,7 +248,7 @@ main                                            (int    argc,
     GtkBox *hbox;
     GtkWidget *align;
 
-    gtk_init (&argc, &argv);
+    hildon_gtk_init (&argc, &argv);
 
     vbox = GTK_BOX (gtk_vbox_new (FALSE, 10));
     hbox = GTK_BOX (gtk_hbox_new (TRUE, 10));
index 1704865..57b3156 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
 
     GtkSizeGroup *size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
index e0a1013..c9805f3 100644 (file)
@@ -43,7 +43,7 @@ main                                            (int    argc,
     GtkWidget *table;
     int i;
 
-    gtk_init (&argc, &argv);
+    hildon_gtk_init (&argc, &argv);
 
     win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
     vbox = GTK_BOX (gtk_vbox_new (FALSE, 10));
index 5e5d24e..2936de4 100644 (file)
@@ -40,10 +40,10 @@ on_input                                        (void)
 
 int
 main                                            (int argc, 
-                                                 char **args)
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (hildon_code_dialog_new ());
     g_signal_connect (G_OBJECT (dialog), "input", G_CALLBACK (on_input), NULL);
 
index e50294f..2c7a3c9 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
     GtkWidget *button = hildon_color_button_new ();
     GtkWidget *label = gtk_label_new ("Pick the color:");
index 420b2a7..b9b2946 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
     GtkWidget *chooser = hildon_color_chooser_new ();
 
index f160bcf..9dc5525 100644 (file)
@@ -52,11 +52,11 @@ new_thread_func                                 (gpointer data)
 
 int
 main                                            (int argc, 
-                                                 char **args)
+                                                 char **argv)
 {
     g_thread_init (NULL);
-    gtk_init (&argc, &args);
-   
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
index 3732a9b..9999b83 100644 (file)
@@ -39,11 +39,11 @@ on_show_value_clicked                           (GtkWidget *widget, HildonContro
 }
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
index 18b508d..d3f0134 100644 (file)
@@ -32,13 +32,13 @@ on_picker_value_changed (HildonPickerButton * button, gpointer data)
 }
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
   HildonProgram *program = NULL;
   GtkWidget *window = NULL;
   GtkWidget *button;
 
-  gtk_init (&argc, &args);
+  hildon_gtk_init (&argc, &argv);
 
   program = hildon_program_get_instance ();
   g_set_application_name ("hildon-date-button-example");
index 5e795f4..e498335 100644 (file)
@@ -39,12 +39,12 @@ on_error (GtkWidget *widget, HildonDateTimeError error_type)
 }
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
     guint y, m, d;
 
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
     HildonDateEditor *date_editor = HILDON_DATE_EDITOR (hildon_date_editor_new ());
 
index 9d8cdab..a6d2f03 100644 (file)
 
 int
 main                                            (int argc,
-                                                 char **args)
+                                                 char **argv)
 {
     HildonDialog *d, *d2;
     GtkWidget *label, *label2;
 
-    gtk_init (&argc, &args);
+    hildon_gtk_init (&argc, &argv);
 
     /* First dialog, using hildon_dialog_new() */
 
index 9366a7b..d87f09b 100644 (file)
@@ -176,7 +176,7 @@ main                                            (int    argc,
   GtkWidget *button;
   GtkWidget *area;
 
-  gtk_init (&argc, &argv);
+  hildon_gtk_init (&argc, &argv);
 
   gtk_rc_parse_string ("style \"fremantle-widget\" {\n"
                        "  GtkWidget::hildon-mode = 1\n"
index 13549f0..bd2a1e6 100644 (file)
@@ -64,7 +64,7 @@ main                                            (int    argc,
     GtkWidget *placeholderentry, *placeholderbutton, *placeholderhbox;
     GtkBox *vbox;
 
-    gtk_init (&argc, &argv);
+    hildon_gtk_init (&argc, &argv);
 
     /* Window and vbox to pack everything */
     win = hildon_stackable_window_new ();
index a65eb91..de7ba1e 100644 (file)
@@ -41,11 +41,11 @@ on_history_append                               (void)
 }
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
index 5b05606..a6e4f5e 100644 (file)
@@ -49,11 +49,11 @@ on_button_press                                 (GtkWidget *widget,
 }
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
     GtkDrawingArea *area = GTK_DRAWING_AREA (gtk_drawing_area_new ());
     gtk_widget_set_size_request (GTK_WIDGET (area), 320, 240);
index 43defdf..8079a71 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (hildon_get_password_dialog_new (NULL, TRUE));
     
     hildon_get_password_dialog_set_message ((HildonGetPasswordDialog *) dialog, "Enter secret password");
index 27e8b86..2e664c4 100644 (file)
@@ -42,11 +42,12 @@ on_mute_clicked                                 (GtkWidget *clicked,
 }
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
     GtkButton *button = GTK_BUTTON (gtk_button_new_with_label ("mute"));
 
index 4f50b25..dcc1756 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
 
     HildonHVolumebar *bar_1 = HILDON_HVOLUMEBAR (hildon_hvolumebar_new ());
index 8c7ae07..bb1a6eb 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
 
     HildonHVolumebar *bar = HILDON_HVOLUMEBAR (hildon_hvolumebar_new ());
index c3336b2..69c3d77 100644 (file)
@@ -83,9 +83,9 @@ on_idle                                         (void)
 
 int
 main                                            (int argc, 
-                                                 char **args)
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
+    hildon_gtk_init (&argc, &argv);
 
     g_timeout_add (2000, (GSourceFunc) on_idle, NULL);
 
index 435e4bd..953bc28 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
+    hildon_gtk_init (&argc, &argv);
 
+    g_debug ("Extra small pixel size: %d", HILDON_ICON_PIXEL_SIZE_XSMALL);
     g_debug ("Small pixel size: %d", HILDON_ICON_PIXEL_SIZE_SMALL);
+    g_debug ("Stylus pixel size: %d", HILDON_ICON_PIXEL_SIZE_STYLUS);
+    g_debug ("Finger pixel size: %d", HILDON_ICON_PIXEL_SIZE_FINGER);
+    g_debug ("Thumb pixel size: %d", HILDON_ICON_PIXEL_SIZE_THUMB);
+    g_debug ("Large pixel size: %d", HILDON_ICON_PIXEL_SIZE_LARGE);
+    g_debug ("Extra large pixel size: %d", HILDON_ICON_PIXEL_SIZE_XLARGE);
     g_debug ("Wizard pixel size: %d", HILDON_ICON_PIXEL_SIZE_WIZARD);
     g_debug ("Toolbar pixel size: %d", HILDON_ICON_PIXEL_SIZE_TOOLBAR);
     g_debug ("Note pixel size: %d", HILDON_ICON_PIXEL_SIZE_NOTE);
     g_debug ("Big note pixel size: %d", HILDON_ICON_PIXEL_SIZE_BIG_NOTE);
-    
+
     return 0;
 }
 
index 266a3eb..6aa6f3f 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonWindow *window = HILDON_WINDOW (hildon_window_new ());
     GtkWidget *button = gtk_button_new_with_label ("Click me");
 
index 17703b3..b772a27 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
index e8dd368..d8fd0a4 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (hildon_login_dialog_new (NULL));
-    
+
     hildon_login_dialog_set_message ((HildonLoginDialog *) dialog, "Enter password to login");
 
     gtk_widget_show_all (GTK_WIDGET (dialog));
index 7a27f90..776f523 100644 (file)
@@ -50,11 +50,11 @@ create_button_with_icon                         (const gchar *icon)
 }
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-   
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
     gtk_window_set_title (GTK_WINDOW (dialog), "icons");
 
index 7d0e17c..aee5372 100644 (file)
@@ -90,11 +90,11 @@ on_progress_clicked                             (GtkWidget *widget, gpointer dat
 }
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
index 14badb1..bdfd3dd 100644 (file)
 
 int
 main                                            (int argc, 
-                                                 char **args)
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
     GtkWidget *editor = hildon_number_editor_new (2, 5);
     GtkWidget *label = gtk_label_new ("Enter number:");
index 8f49e2e..c6f031e 100644 (file)
@@ -46,14 +46,14 @@ find_button_clicked (GtkButton *button,
 }
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
     int i;
     HildonProgram *program;
     GtkWidget *window, *panarea, *button;
     GtkWidget *hbox, *vbox;
 
-    gtk_init (&argc, &args);
+    hildon_gtk_init (&argc, &argv);
 
     program = hildon_program_get_instance ();
 
index 75fc852..a738d1c 100644 (file)
@@ -103,7 +103,7 @@ get_sawtooth_label (gchar **label, guint num)
 }
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
     int i;
     HildonProgram *program;
@@ -112,7 +112,7 @@ main (int argc, char **args)
     GtkCellRenderer *renderer;
     GtkListStore *store;
 
-    gtk_init (&argc, &args);
+    hildon_gtk_init (&argc, &argv);
 
     program = hildon_program_get_instance ();
 
index 4e6723a..d9f9912 100644 (file)
@@ -104,7 +104,7 @@ search_button_clicked (GtkButton *button,
 }
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
   int i;
   HildonProgram *program;
@@ -118,7 +118,7 @@ main (int argc, char **args)
   gboolean jump = FALSE;
   GSList *stocks, *item;
 
-  gtk_init (&argc, &args);
+  hildon_gtk_init (&argc, &argv);
 
   program = hildon_program_get_instance ();
 
index 7acacfc..1f5ec0c 100644 (file)
@@ -163,7 +163,7 @@ main (int argc, char **argv)
   GtkWidget *padbox;
   GtkWidget *button;
 
-  gtk_init (&argc, &argv);
+  hildon_gtk_init (&argc, &argv);
 
   gtk_rc_parse_string ("style \"fremantle-widget\" {\n"
                        "  GtkWidget::hildon-mode = 1\n"
index 89c314d..c1089d4 100644 (file)
@@ -173,7 +173,7 @@ main (int argc, char **argv)
   GtkWidget *padbox;
   GtkWidget *button;
 
-  gtk_init (&argc, &argv);
+  hildon_gtk_init (&argc, &argv);
 
   gtk_rc_parse_string ("style \"fremantle-widget\" {\n"
                        "  GtkWidget::hildon-mode = 1\n"
index 008a740..3a95619 100644 (file)
@@ -55,7 +55,7 @@ get_sawtooth_label (gchar **label, guint num)
 }
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
     int i;
     HildonProgram *program;
@@ -64,7 +64,7 @@ main (int argc, char **args)
     GtkCellRenderer *renderer;
     GtkListStore *store;
 
-    gtk_init (&argc, &args);
+    hildon_gtk_init (&argc, &argv);
 
     program = hildon_program_get_instance ();
 
index 7f99d2a..d1cdbb5 100644 (file)
@@ -26,14 +26,14 @@ on_picker_value_changed (HildonPickerButton * button, gpointer data)
 }
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
   HildonProgram *program = NULL;
   GtkWidget *window = NULL;
   GtkWidget *button;
   GtkWidget *selector;
 
-  gtk_init (&argc, &args);
+  hildon_gtk_init (&argc, &argv);
 
   program = hildon_program_get_instance ();
   g_set_application_name ("hildon-picker-button-example");
index bdc87eb..0913eb1 100644 (file)
@@ -72,14 +72,14 @@ on_picker_value_changed (HildonPickerButton * button, gpointer data)
 }
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
   HildonProgram *program = NULL;
   GtkWidget *window = NULL;
   GtkWidget *button;
   GtkWidget *selector;
 
-  gtk_init (&argc, &args);
+  hildon_gtk_init (&argc, &argv);
 
   program = hildon_program_get_instance ();
   g_set_application_name ("hildon-picker-button-example");
index 5b78c92..0ef67e3 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
index 0175b85..8f1c432 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
 
     HildonSeekbar *bar = HILDON_SEEKBAR (hildon_seekbar_new ());
index 4cb7e13..a16b10d 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (hildon_set_password_dialog_new (NULL, TRUE));
     
     hildon_set_password_dialog_set_message ((HildonSetPasswordDialog *) dialog, "Enter new password");
index da38660..8bdfcf3 100644 (file)
 #include                                        "hildon.h"
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (hildon_sort_dialog_new (NULL));
 
     hildon_sort_dialog_add_sort_key (HILDON_SORT_DIALOG (dialog), "First key");
index aabeda0..a6ac028 100644 (file)
@@ -96,11 +96,11 @@ add_window                                      (GtkWidget *w)
 
 int
 main                                            (int argc,
-                                                 char **args)
+                                                 char **argv)
 {
     GtkWidget *window;
 
-    gtk_init (&argc, &args);
+    hildon_gtk_init (&argc, &argv);
 
     g_set_application_name ("stack");
 
index 9b81bc6..bf70973 100644 (file)
@@ -69,7 +69,7 @@ main                                            (int    argc,
     GtkWidget *textviewframe;
     GtkBox *vbox;
 
-    gtk_init (&argc, &argv);
+    hildon_gtk_init (&argc, &argv);
 
     /* Window and vbox to pack everything */
     win = hildon_stackable_window_new ();
index 0264e46..cab55f6 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
index 10d4bfe..9da3a35 100644 (file)
@@ -10,13 +10,13 @@ on_picker_value_changed (HildonPickerButton * button, gpointer data)
 }
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
   HildonProgram *program = NULL;
   GtkWidget *window = NULL;
   GtkWidget *button;
 
-  gtk_init (&argc, &args);
+  hildon_gtk_init (&argc, &argv);
 
   program = hildon_program_get_instance ();
   g_set_application_name ("hildon-time-button-example");
index 62b11b6..ae23277 100644 (file)
 #include                                        "hildon.h"
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
     HildonTimeEditor *time_editor = HILDON_TIME_EDITOR (hildon_time_editor_new ());
 
index 5e1cbd1..36b026b 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (hildon_time_picker_new (NULL));
 
     gtk_widget_show_all (GTK_WIDGET (dialog));
index 11d7a83..f444ea4 100644 (file)
@@ -84,11 +84,11 @@ on_hide_clicked                                 (GtkWidget *widget)
 }
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     window = HILDON_WINDOW (hildon_window_new ());
index 424c60c..b9a9175 100644 (file)
 
 int
 main                                            (int argc, 
-                                                 char **args)
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
     hildon_program_add_window (program, HILDON_WINDOW (window));
 
-    gtk_init (&argc, &args);
-    
     HildonSeekbar *bar = HILDON_SEEKBAR (hildon_seekbar_new ());
     gtk_widget_set_size_request (GTK_WIDGET (bar), 400, -1);
 
index 06619e6..8f4b0d1 100644 (file)
@@ -59,7 +59,7 @@ static const gchar* artists [] = {
 };
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
   HildonProgram *program = NULL;
   GtkWidget *window = NULL;
@@ -67,7 +67,7 @@ main (int argc, char **args)
   GtkWidget *selector;
   gint i;
 
-  gtk_init (&argc, &args);
+  hildon_gtk_init (&argc, &argv);
 
   program = hildon_program_get_instance ();
   g_set_application_name
index 54e1f51..5c940f0 100644 (file)
@@ -111,12 +111,12 @@ get_visible_content (GtkWidget * window)
 }
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
   HildonProgram *program = NULL;
   GtkWidget *window = NULL;
 
-  gtk_init (&argc, &args);
+  hildon_gtk_init (&argc, &argv);
 
   program = hildon_program_get_instance ();
   g_set_application_name
index 341a2e7..e324d97 100644 (file)
@@ -124,12 +124,12 @@ get_visible_content (GtkWidget * window)
 }
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
   HildonProgram *program = NULL;
   GtkWidget *window = NULL;
 
-  gtk_init (&argc, &args);
+  hildon_gtk_init (&argc, &argv);
 
   program = hildon_program_get_instance ();
   g_set_application_name
index 87eb31c..15f76ed 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
 
     HildonVVolumebar *bar = HILDON_VVOLUMEBAR (hildon_vvolumebar_new ());
index 889997f..dfd90b1 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     GtkDialog *dialog = GTK_DIALOG (gtk_dialog_new ());
 
     GtkWidget *picker = hildon_weekday_picker_new ();
index 29176d5..b1f2915 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
index 79fe838..f75fc55 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
index 2e6d200..4347399 100644 (file)
 #include                                        "hildon.h"
 
 int
-main                                            (int argc, 
-                                                 char **args)
+main                                            (int argc,
+                                                 char **argv)
 {
-    gtk_init (&argc, &args);
-    
+    hildon_gtk_init (&argc, &argv);
+
     HildonProgram *program = hildon_program_get_instance ();
 
     GtkWidget *window = hildon_window_new ();
index baf4d49..51f3817 100644 (file)
@@ -51,10 +51,10 @@ on_page_switch (GtkNotebook *notebook,
 }
 
 int
-main (int argc, char **args)
+main (int argc, char **argv)
 {
-    gtk_init (&argc, &args);
-   
+    hildon_gtk_init (&argc, &argv);
+
     GtkWidget *notebook = gtk_notebook_new ();
     GtkWidget *label_1 = gtk_label_new ("Page 1");
     GtkWidget *label_2 = gtk_label_new ("Page 2");
index db8aa1a..881130e 100644 (file)
@@ -83,7 +83,8 @@ libhildon_@API_VERSION_MAJOR@_la_SOURCES = \
                hildon-button.c                         \
                hildon-check-button.c                   \
                hildon-gtk.c                            \
-               hildon-dialog.c
+               hildon-dialog.c                         \
+               hildon-main.c
 
 libhildon_@API_VERSION_MAJOR@_built_public_headers  = \
                hildon-enum-types.h                     \
@@ -148,7 +149,8 @@ libhildon_@API_VERSION_MAJOR@_public_headers = \
                hildon-button.h                         \
                hildon-check-button.h                   \
                hildon-gtk.h                            \
-               hildon-version.h
+               hildon-version.h                        \
+               hildon-main.h
 
 libhildon_@API_VERSION_MAJOR@_include_HEADERS = \
                $(libhildon_@API_VERSION_MAJOR@_public_headers)         \
index 6ee3159..9d9e61d 100644 (file)
 
 G_BEGIN_DECLS
 
-#define                                         HILDON_ICON_SIZE_SMALL \
-                                                gtk_icon_size_from_name ("gtk-menu")
+/* New hildon icon sizes. */
+
+#define HILDON_ICON_SIZE_XSMALL                  gtk_icon_size_from_name ("hildon-xsmall")
+
+#define HILDON_ICON_SIZE_SMALL                   gtk_icon_size_from_name ("hildon-small")
+
+#define HILDON_ICON_SIZE_STYLUS                  gtk_icon_size_from_name ("hildon-stylus")
+
+#define HILDON_ICON_SIZE_FINGER                  gtk_icon_size_from_name ("hildon-finger")
+
+#define HILDON_ICON_SIZE_THUMB                   gtk_icon_size_from_name ("hildon-thumb")
+
+#define HILDON_ICON_SIZE_LARGE                   gtk_icon_size_from_name ("hildon-large")
+
+#define HILDON_ICON_SIZE_XLARGE                  gtk_icon_size_from_name ("hildon-xlarge")
+
+/* Old hildon icon sizes. To be removed. */
 
 #define                                         HILDON_ICON_SIZE_TOOLBAR \
                                                 gtk_icon_size_from_name ("gtk-menu")
@@ -49,9 +64,29 @@ G_BEGIN_DECLS
 
 /* Actual icon sizes */
 
+/* New sizes */
+#define                                         HILDON_ICON_PIXEL_SIZE_XSMALL \
+                                                hildon_get_icon_pixel_size (HILDON_ICON_SIZE_XSMALL)
+
 #define                                         HILDON_ICON_PIXEL_SIZE_SMALL \
                                                 hildon_get_icon_pixel_size (HILDON_ICON_SIZE_SMALL)
 
+#define                                         HILDON_ICON_PIXEL_SIZE_STYLUS \
+                                                hildon_get_icon_pixel_size (HILDON_ICON_SIZE_STYLUS)
+
+#define                                         HILDON_ICON_PIXEL_SIZE_FINGER \
+                                                hildon_get_icon_pixel_size (HILDON_ICON_SIZE_FINGER)
+
+#define                                         HILDON_ICON_PIXEL_SIZE_THUMB \
+                                                hildon_get_icon_pixel_size (HILDON_ICON_SIZE_THUMB)
+
+#define                                         HILDON_ICON_PIXEL_SIZE_LARGE \
+                                                hildon_get_icon_pixel_size (HILDON_ICON_SIZE_LARGE)
+
+#define                                         HILDON_ICON_PIXEL_SIZE_XLARGE \
+                                                hildon_get_icon_pixel_size (HILDON_ICON_SIZE_XLARGE)
+
+/* old sizes */
 #define                                         HILDON_ICON_PIXEL_SIZE_TOOLBAR \
                                                 hildon_get_icon_pixel_size (HILDON_ICON_SIZE_TOOLBAR)
 
diff --git a/src/hildon-main.c b/src/hildon-main.c
new file mode 100644 (file)
index 0000000..b9f1b58
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * This file is part of the hildon library
+ *
+ * Copyright (C) 2008 Nokia Corporation, all rights reserved.
+ *
+ * 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, or (at your option) any later version.
+ *
+ * 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-main
+ * @Short_Description: Library initialization.
+ *
+ */
+
+
+#include <gtk/gtk.h>
+#include "hildon-main.h"
+
+/**
+ * hildon_init:
+ * @argc: Address of the <parameter>argc</parameter>
+ * parameter of your main() function. Changed if any arguments were
+ * handled.
+ * @argv: Address of the <parameter>argv</parameter>
+ * parameter of main().  Any parameters understood by hildon_init()
+ * are stripped before return.
+ *
+ * Initializes the hildon library. Call this function after calling gtk_init()
+ * and before using any hildon or GTK+ functions in your program.
+ *
+ **/
+void
+hildon_init (void)
+{
+  /* Register icon sizes */
+  gtk_icon_size_register ("hildon-xsmall", 16, 16);
+  gtk_icon_size_register ("hildon-small", 24, 24);
+  gtk_icon_size_register ("hildon-stylus", 32, 32);
+  gtk_icon_size_register ("hildon-finger", 48, 48);
+  gtk_icon_size_register ("hildon-thumb", 64, 64);
+  gtk_icon_size_register ("hildon-large", 96, 96);
+  gtk_icon_size_register ("hildon-xlarge", 128, 128);
+}
+
+/**
+ * hildon_gtk_init:
+ * @argc: Address of the <parameter>argc</parameter>
+ * parameter of your main() function. Changed if any arguments were
+ * handled.
+ * @argv: Address of the <parameter>argv</parameter>
+ * parameter of main().  Any parameters understood by gtk_init()
+ * are stripped before return.
+ *
+ * Convenience function to initialize the GTK+ and hildon
+ * libraries. Use this function to replace a call to gtk_init() and also
+ * initialize the hildon library. See hildon_init() and gtk_init() for details.
+ *
+ **/
+void
+hildon_gtk_init (int *argc, char ***argv)
+{
+  gtk_init (argc, argv);
+  hildon_init ();
+}
diff --git a/src/hildon-main.h b/src/hildon-main.h
new file mode 100644 (file)
index 0000000..88b1694
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * This file is part of the hildon library
+ *
+ * Copyright (C) 2008 Nokia Corporation, all rights reserved.
+ *
+ * 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, or (at your option) any later version.
+ *
+ * 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
+ *
+ */
+
+G_BEGIN_DECLS
+
+void hildon_init     (void);
+void hildon_gtk_init (int *argc, char ***argv);
+
+G_END_DECLS
index f76eaa8..8bb6777 100644 (file)
@@ -80,5 +80,6 @@
 #include                                        "hildon-check-button.h"
 #include                                        "hildon-gtk.h"
 #include                                        "hildon-dialog.h"
+#include                                        "hildon-main.h"
 
 #endif