* doc/visual_index.xml Fix reference to HildonLoginDialog in documentation
authorAlberto Garcia <agarcia@igalia.com>
Tue, 13 May 2008 17:34:34 +0000 (17:34 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Tue, 13 May 2008 17:34:34 +0000 (17:34 +0000)
* doc/hildon-docs.sgml
* doc/hildon.types
* examples/Makefile.am
* examples/hildon-dialog-example.c
* src/Makefile.am
* src/hildon-dialog.c
* src/hildon-dialog.h
* src/hildon.h
New HildonDialog widget.

ChangeLog
doc/hildon-docs.sgml
doc/hildon.types
doc/visual_index.xml
examples/Makefile.am
examples/hildon-dialog-example.c [new file with mode: 0644]
src/Makefile.am
src/hildon-dialog.c [new file with mode: 0644]
src/hildon-dialog.h [new file with mode: 0644]
src/hildon.h

index cabba62..1ea289d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2008-05-13 Victor Jaquez <vjaquez@igalia.com>
+
+       * doc/visual_index.xml
+       Fix reference to HildonLoginDialog in documentation
+
+       * doc/hildon-docs.sgml
+       * doc/hildon.types
+       * examples/Makefile.am
+       * examples/hildon-dialog-example.c
+       * src/Makefile.am
+       * src/hildon-dialog.c
+       * src/hildon-dialog.h
+       * src/hildon.h
+       New HildonDialog widget.
+
 2008-05-09 Alberto Garcia <agarcia@igalia.com>
 
        * src/hildon-pannable-area.c
index c7349b1..c33f05e 100644 (file)
@@ -64,6 +64,7 @@
 
   <chapter>
     <title>Dialogs</title>
+    <xi:include href="xml/hildon-dialog.xml"/>
     <xi:include href="xml/hildon-set-password-dialog.xml"/>
     <xi:include href="xml/hildon-get-password-dialog.xml"/>
     <xi:include href="xml/hildon-login-dialog.xml"/>
index 1a7d392..d5a225b 100644 (file)
@@ -33,6 +33,7 @@
 #include                                        <src/hildon-window.h>
 #include                                        <src/hildon-wizard-dialog.h>
 #include                                        <src/hildon-calendar.h>
+#include                                        <src/hildon-dialog.h>
 
 hildon_banner_get_type
 hildon_calendar_popup_get_type
@@ -65,3 +66,4 @@ hildon_window_get_type
 hildon_wizard_dialog_get_type
 hildon_window_get_type
 hildon_calendar_get_type
+hildon_dialog_get_type
index 13002e4..8e5d589 100644 (file)
@@ -32,7 +32,7 @@
   <link linkend="HildonHVolumebar">
           <inlinegraphic fileref="hvolumebar.png" format="PNG"></inlinegraphic>
   </link> 
-  <link linkend="HildonDialog">
+  <link linkend="HildonLoginDialog">
           <inlinegraphic fileref="login-dialog.png" format="PNG"></inlinegraphic>
   </link> 
   <link linkend="HildonNote">
index 07405e8..f72d758 100644 (file)
@@ -40,7 +40,8 @@ noinst_PROGRAMS                               = hildon-window-example                         \
                                          hildon-hvolumebar-timer-example               \
                                          hildon-toolbar-seekbar-example                \
                                          hildon-pannable-area-example                  \
-                                         hildon-logical-color-example
+                                         hildon-logical-color-example                  \
+                                         hildon-dialog-example
 
 # Hildon window
 hildon_window_example_LDADD            = $(HILDON_OBJ_LIBS)
@@ -242,4 +243,9 @@ hildon_pannable_area_example_LDADD          = $(HILDON_OBJ_LIBS)
 hildon_pannable_area_example_CFLAGS            = $(HILDON_OBJ_CFLAGS)
 hildon_pannable_area_example_SOURCES           = hildon-pannable-area-example.c
 
+# Hildon dialog
+hildon_dialog_example_LDADD            = $(HILDON_OBJ_LIBS)
+hildon_dialog_example_CFLAGS           = $(HILDON_OBJ_CFLAGS)
+hildon_dialog_example_SOURCES          = hildon-dialog-example.c
+
 endif
diff --git a/examples/hildon-dialog-example.c b/examples/hildon-dialog-example.c
new file mode 100644 (file)
index 0000000..f34eda0
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * This file is a part of hildon examples
+ *
+ * Copyright (C) 2008 Nokia Corporation, all rights reserved.
+ *
+ * Author: Victor Jaquez <vjaquez@igalia.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, 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
+ *
+ */
+
+#include                                        "hildon.h"
+
+int
+main                                            (int argc,
+                                                 char **args)
+{
+    HildonDialog *d;
+    GtkWidget *label;
+
+    gtk_init (&argc, &args);
+
+    d = HILDON_DIALOG (hildon_dialog_new ());
+    label = gtk_label_new ("Hello, world!");
+
+    gtk_window_set_title (GTK_WINDOW (d), "Hi!");
+    gtk_dialog_add_button (GTK_DIALOG (d), GTK_STOCK_OK, GTK_RESPONSE_NONE);
+    gtk_container_add (GTK_CONTAINER (GTK_DIALOG(d)->vbox), label);
+
+    gtk_widget_show_all (GTK_WIDGET (d));
+
+    gtk_dialog_run (GTK_DIALOG (d));
+
+    return 0;
+}
index 78e9c75..ff288fd 100644 (file)
@@ -62,7 +62,8 @@ libhildon_@API_VERSION_MAJOR@_la_SOURCES              = hildon-private.c                              \
                                                          hildon-pannable-area.c                        \
                                                          hildon-bread-crumb-trail.c                    \
                                                          hildon-bread-crumb.c                          \
-                                                         hildon-bread-crumb-widget.c
+                                                         hildon-bread-crumb-widget.c                   \
+                                                         hildon-dialog.c
 
 libhildon_@API_VERSION_MAJOR@_built_public_headers  = \
                                                          hildon-enum-types.h                           \
@@ -107,6 +108,7 @@ libhildon_@API_VERSION_MAJOR@_public_headers                = hildon-banner.h                               \
                                                          hildon-pannable-area.h                        \
                                                          hildon-bread-crumb-trail.h                    \
                                                          hildon-bread-crumb.h                          \
+                                                         hildon-dialog.h                               \
                                                          hildon-version.h
 
 libhildon_@API_VERSION_MAJOR@_include_HEADERS          = $(libhildon_@API_VERSION_MAJOR@_public_headers)                       \
diff --git a/src/hildon-dialog.c b/src/hildon-dialog.c
new file mode 100644 (file)
index 0000000..199d068
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * This file is a part of hildon
+ *
+ * Copyright (C) 2008 Nokia Corporation, all rights reserved.
+ *
+ * Contact: Karl Lattimer <karl.lattimer@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, 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-dialog
+ * @short_description: Widget representing a popup window in the Hildon framework.
+ * @see_also: #HildonCodeDialog, #HildonColorChooserDialog, #HildonFontSelectionDialog, #HildonGetPasswordDialog, #HildonLoginDialog, #HildonSetPasswordDialog, #HildonSortDialog, #HildonWizardDialog
+ *
+ * The HildonDialog is a GTK widget which represent a popup window in the
+ * Hildon framework. It is derived from the GtkDialog and provides additional
+ * commodities specific to the Hildon framework.
+ *
+ * <example>
+ * <title>Simple <structname>HildonDialog</structname> usage</title>
+ * <programlisting>
+ * void quick_message (gchar *message)
+ * {
+ * <!-- -->
+ *     GtkWidget *dialog, *label;
+ * <!-- -->
+ *     dialog = hildon_dialog_new ();
+ *     label = gtk_label_new (message);
+ * <!-- -->
+ *     g_signal_connect_swapped (dialog,
+ *                               "response",
+ *                               G_CALLBACK (gtk_widget_destroy),
+ *                               dialog);
+ * <!-- -->
+ *     gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox),
+ *                        label);
+ *     gtk_widget_show_all (dialog);
+ * <!-- -->
+ * }
+ * </programlisting>
+ * </example>
+ */
+
+#include                                        "hildon-dialog.h"
+
+G_DEFINE_TYPE (HildonDialog, hildon_dialog, GTK_TYPE_DIALOG);
+
+static void
+hildon_dialog_class_init                        (HildonDialogClass * dialog_class)
+{
+}
+
+static void
+hildon_dialog_init (HildonDialog *self)
+{
+}
+
+/**
+ * hildon_dialog_new:
+ *
+ * Creates a new #HildonDialog widget
+ *
+ * Returns: the newly created #HildonDialog
+ */
+GtkWidget*
+hildon_dialog_new                               (void)
+{
+    GtkWidget *self = g_object_new (HILDON_TYPE_DIALOG, NULL);
+
+    return self;
+}
diff --git a/src/hildon-dialog.h b/src/hildon-dialog.h
new file mode 100644 (file)
index 0000000..dfb11be
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * This file is a part of hildon
+ *
+ * Copyright (C) 2008 Nokia Corporation, all rights reserved.
+ *
+ * Contact: Karl Lattimer <karl.lattimer@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, 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
+ *
+ */
+
+#ifndef                                         __HILDON_DIALOG_H__
+#define                                         __HILDON_DIALOG_H__
+
+#include                                        <glib.h>
+#include                                        <glib-object.h>
+#include                                        <gtk/gtkdialog.h>
+
+#include                                        "hildon-defines.h"
+
+G_BEGIN_DECLS
+
+#define                                         HILDON_TYPE_DIALOG \
+                                                (hildon_dialog_get_type ())
+
+#define                                         HILDON_DIALOG(obj) \
+                                                (GTK_CHECK_CAST (obj, HILDON_TYPE_DIALOG, HildonDialog))
+
+#define                                         HILDON_DIALOG_CLASS(klass) \
+                                                (GTK_CHECK_CLASS_CAST ((klass),\
+                                                HILDON_TYPE_DIALOG, HildonDialogClass))
+
+#define                                         HILDON_IS_DIALOG(obj) \
+                                                (GTK_CHECK_TYPE (obj, HILDON_TYPE_DIALOG))
+
+#define                                         HILDON_IS_DIALOG_CLASS(klass) \
+                                                (GTK_CHECH_CLASS_TYPE ((klass), HILDON_TYPE_DIALOG))
+
+#define                                         HILDON_DIALOG_GET_CLASS(obj) \
+                                                ((HildonDialogClass *) G_OBJECT_GET_CLASS (obj))
+
+typedef struct                                  _HildonDialog HildonDialog;
+
+typedef struct                                  _HildonDialogClass HildonDialogClass;
+
+struct                                          _HildonDialog
+{
+    GtkDialog parent;
+};
+
+struct                                          _HildonDialogClass
+{
+    GtkDialogClass parent_class;
+
+    /* Padding for future extension */
+    void (*_hildon_reserved1)(void);
+    void (*_hildon_reserved2)(void);
+    void (*_hildon_reserved3)(void);
+};
+
+GType G_GNUC_CONST
+hildon_dialog_get_type                          (void);
+
+GtkWidget*
+hildon_dialog_new                               (void);
+
+G_END_DECLS
+
+#endif                                          /* __HILDON_DIALOG_H__ */
index a01e3b6..bb6b03d 100644 (file)
@@ -63,5 +63,6 @@
 #include                                        "hildon-calendar.h"
 #include                                        "hildon-bread-crumb-trail.h"
 #include                                        "hildon-pannable-area.h"
+#include                                        "hildon-dialog.h"
 
 #endif