]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkaboutdialog.c
docs: correct various spelling and grammar errors
[~andy/gtk] / gtk / gtkaboutdialog.c
index 4844ed792d6e5b017589e700582b4dd92a5a9cd6..f50fed0af12473491817512203f8b8d36d113402 100644 (file)
@@ -14,9 +14,7 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
 
 #include <string.h>
 
-#include <gdk/gdkkeysyms.h>
-
 #include "gtkaboutdialog.h"
-#include "gtkalignment.h"
 #include "gtkbutton.h"
 #include "gtkbbox.h"
 #include "gtkdialog.h"
 #include "gtkgrid.h"
-#include "gtkhbox.h"
+#include "gtkbox.h"
 #include "gtkimage.h"
 #include "gtklabel.h"
 #include "gtklinkbutton.h"
 #include "gtkscrolledwindow.h"
 #include "gtkstock.h"
 #include "gtktextview.h"
-#include "gtkvbox.h"
 #include "gtkiconfactory.h"
 #include "gtkshow.h"
 #include "gtkmain.h"
 #include "gtkmessagedialog.h"
 #include "gtktogglebutton.h"
+#include "gtktypebuiltins.h"
 #include "gtkprivate.h"
 #include "gtkintl.h"
 
  *                        "title" _("About ExampleCode"),
  *                        NULL);
  * </programlisting></informalexample>
+ *
+ * It is also possible to show a #GtkAboutDialog like any other #GtkDialog,
+ * e.g. using gtk_dialog_run(). In this case, you might need to know that
+ * the 'Close' button returns the #GTK_RESPONSE_CANCEL response id.
  */
 
 static GdkColor default_link_color = { 0, 0, 0, 0xeeee };
@@ -102,7 +101,7 @@ static GdkColor default_visited_link_color = { 0, 0x5555, 0x1a1a, 0x8b8b };
 /* Translators: this is the license preamble; the string at the end
  * contains the URL of the license.
  */
-static const gchar *gtk_license_preamble = N_("This program comes with ABSOLUTELY NO WARRANTY; for details, visit <a href=\"%s\">%s</a>");
+static const gchar *gtk_license_preamble = N_("This program comes with ABSOLUTELY NO WARRANTY;\nfor details, visit <a href=\"%s\">%s</a>");
 
 /* URLs for each GtkLicense type; keep in the same order as the enumeration */
 static const gchar *gtk_license_urls[] = {
@@ -121,6 +120,12 @@ static const gchar *gtk_license_urls[] = {
   "http://opensource.org/licenses/artistic-license-2.0.php"
 };
 
+typedef struct
+{
+  gchar *heading;
+  gchar **people;
+} CreditSection;
+
 struct _GtkAboutDialogPrivate 
 {
   gchar *name;
@@ -136,6 +141,9 @@ struct _GtkAboutDialogPrivate
   gchar **documenters;
   gchar **artists;
 
+
+  GSList *credit_sections;
+
   gint credits_page;
   gint license_page;
 
@@ -162,6 +170,8 @@ struct _GtkAboutDialogPrivate
   guint wrap_license : 1;
 };
 
+
+
 #define GTK_ABOUT_DIALOG_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GTK_TYPE_ABOUT_DIALOG, GtkAboutDialogPrivate))
 
 
@@ -398,8 +408,7 @@ gtk_about_dialog_class_init (GtkAboutDialogClass *klass)
   /**
    * GtkAboutDialog:website-label:
    *
-   * The label for the link to the website of the program. If this is not set,
-   * it defaults to the URL specified in the #GtkAboutDialog:website property.
+   * The label for the link to the website of the program.
    *
    * Since: 2.6
    */
@@ -407,7 +416,7 @@ gtk_about_dialog_class_init (GtkAboutDialogClass *klass)
                                    PROP_WEBSITE_LABEL,
                                    g_param_spec_string ("website-label",
                                                         P_("Website label"),
-                                                        P_("The label for the link to the website of the program. If this is not set, it defaults to the URL"),
+                                                        P_("The label for the link to the website of the program"),
                                                         NULL,
                                                         GTK_PARAM_READWRITE));
 
@@ -561,6 +570,7 @@ update_credits_button_visibility (GtkAboutDialog *about)
   show = (priv->authors != NULL ||
           priv->documenters != NULL ||
           priv->artists != NULL ||
+          priv->credit_sections != NULL ||
          (priv->translator_credits != NULL &&
           strcmp (priv->translator_credits, "translator_credits") &&
           strcmp (priv->translator_credits, "translator-credits")));
@@ -733,8 +743,8 @@ gtk_about_dialog_init (GtkAboutDialog *about)
   gtk_widget_show (hbox);
 
   /* Add the close button */
-  close_button = gtk_dialog_add_button (GTK_DIALOG (about), GTK_STOCK_CLOSE,
-                                        GTK_RESPONSE_CANCEL);
+  close_button = gtk_dialog_add_button (GTK_DIALOG (about),
+                                        GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL);
   gtk_dialog_set_default_response (GTK_DIALOG (about), GTK_RESPONSE_CANCEL);
 
   /* Add the credits button */
@@ -775,6 +785,15 @@ gtk_about_dialog_init (GtkAboutDialog *about)
   gtk_about_dialog_set_logo (about, NULL);
 }
 
+static void
+destroy_credit_section (gpointer data)
+{
+  CreditSection *cs = data;
+  g_free (cs->heading);
+  g_strfreev (cs->people);
+  g_slice_free (CreditSection, data);
+}
+
 static void
 gtk_about_dialog_finalize (GObject *object)
 {
@@ -794,11 +813,13 @@ gtk_about_dialog_finalize (GObject *object)
   g_strfreev (priv->documenters);
   g_strfreev (priv->artists);
 
+  g_slist_free_full (priv->credit_sections, destroy_credit_section);
+
   g_slist_foreach (priv->visited_links, (GFunc)g_free, NULL);
   g_slist_free (priv->visited_links);
 
-  gdk_cursor_unref (priv->hand_cursor);
-  gdk_cursor_unref (priv->regular_cursor);
+  g_object_unref (priv->hand_cursor);
+  g_object_unref (priv->regular_cursor);
 
   G_OBJECT_CLASS (gtk_about_dialog_parent_class)->finalize (object);
 }
@@ -993,7 +1014,7 @@ update_website (GtkAboutDialog *about)
       else
         {
           markup = g_strdup_printf ("<a href=\"%s\">%s</a>",
-                                    priv->website_url, _("Homepage"));
+                                    priv->website_url, _("Website"));
         }
 
       gtk_label_set_markup (GTK_LABEL (priv->website_label), markup);
@@ -1001,9 +1022,7 @@ update_website (GtkAboutDialog *about)
     }
   else
     {
-      if (priv->website_url)
-        gtk_label_set_text (GTK_LABEL (priv->website_label), priv->website_url);
-      else if (priv->website_text)
+      if (priv->website_text)
         gtk_label_set_text (GTK_LABEL (priv->website_label), priv->website_text);
       else
         gtk_widget_hide (priv->website_label);
@@ -1029,7 +1048,7 @@ gtk_about_dialog_show (GtkWidget *widget)
  *
  * Since: 2.12
  */
-G_CONST_RETURN gchar *
+const gchar *
 gtk_about_dialog_get_program_name (GtkAboutDialog *about)
 {
   GtkAboutDialogPrivate *priv;
@@ -1109,7 +1128,7 @@ gtk_about_dialog_set_program_name (GtkAboutDialog *about,
  *
  * Since: 2.6
  */
-G_CONST_RETURN gchar *
+const gchar *
 gtk_about_dialog_get_version (GtkAboutDialog *about)
 {
   g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
@@ -1157,7 +1176,7 @@ gtk_about_dialog_set_version (GtkAboutDialog *about,
  *
  * Since: 2.6
  */
-G_CONST_RETURN gchar *
+const gchar *
 gtk_about_dialog_get_copyright (GtkAboutDialog *about)
 {
   g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
@@ -1216,7 +1235,7 @@ gtk_about_dialog_set_copyright (GtkAboutDialog *about,
  *
  * Since: 2.6
  */
-G_CONST_RETURN gchar *
+const gchar *
 gtk_about_dialog_get_comments (GtkAboutDialog *about)
 {
   g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
@@ -1273,7 +1292,7 @@ gtk_about_dialog_set_comments (GtkAboutDialog *about,
  *
  * Since: 2.6
  */
-G_CONST_RETURN gchar *
+const gchar *
 gtk_about_dialog_get_license (GtkAboutDialog *about)
 {
   g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
@@ -1384,7 +1403,7 @@ gtk_about_dialog_set_wrap_license (GtkAboutDialog *about,
  *
  * Since: 2.6
  */
-G_CONST_RETURN gchar *
+const gchar *
 gtk_about_dialog_get_website (GtkAboutDialog *about)
 {
   GtkAboutDialogPrivate *priv;
@@ -1436,7 +1455,7 @@ gtk_about_dialog_set_website (GtkAboutDialog *about,
  *
  * Since: 2.6
  */
-G_CONST_RETURN gchar *
+const gchar *
 gtk_about_dialog_get_website_label (GtkAboutDialog *about)
 {
   GtkAboutDialogPrivate *priv;
@@ -1454,7 +1473,6 @@ gtk_about_dialog_get_website_label (GtkAboutDialog *about)
  * @website_label: the label used for the website link
  *
  * Sets the label to be used for the website link.
- * It defaults to the website URL.
  *
  * Since: 2.6
  */
@@ -1485,13 +1503,13 @@ gtk_about_dialog_set_website_label (GtkAboutDialog *about,
  * Returns the string which are displayed in the authors tab
  * of the secondary credits dialog.
  *
- * Return value: A %NULL-terminated string array containing
- *  the authors. The array is owned by the about dialog
- *  and must not be modified.
+ * Return value: (array zero-terminated=1) (transfer none): A
+ *  %NULL-terminated string array containing the authors. The array is
+ *  owned by the about dialog and must not be modified.
  *
  * Since: 2.6
  */
-G_CONST_RETURN gchar * G_CONST_RETURN *
+const gchar * const *
 gtk_about_dialog_get_authors (GtkAboutDialog *about)
 {
   GtkAboutDialogPrivate *priv;
@@ -1540,13 +1558,13 @@ gtk_about_dialog_set_authors (GtkAboutDialog  *about,
  * Returns the string which are displayed in the documenters
  * tab of the secondary credits dialog.
  *
- * Return value: A %NULL-terminated string array containing
- *  the documenters. The array is owned by the about dialog
- *  and must not be modified.
+ * Return value: (array zero-terminated=1) (transfer none): A
+ *  %NULL-terminated string array containing the documenters. The
+ *  array is owned by the about dialog and must not be modified.
  *
  * Since: 2.6
  */
-G_CONST_RETURN gchar * G_CONST_RETURN *
+const gchar * const *
 gtk_about_dialog_get_documenters (GtkAboutDialog *about)
 {
   GtkAboutDialogPrivate *priv;
@@ -1595,13 +1613,13 @@ gtk_about_dialog_set_documenters (GtkAboutDialog *about,
  * Returns the string which are displayed in the artists tab
  * of the secondary credits dialog.
  *
- * Return value: A %NULL-terminated string array containing
- *  the artists. The array is owned by the about dialog
- *  and must not be modified.
+ * Return value: (array zero-terminated=1) (transfer none): A
+ *  %NULL-terminated string array containing the artists. The array is
+ *  owned by the about dialog and must not be modified.
  *
  * Since: 2.6
  */
-G_CONST_RETURN gchar * G_CONST_RETURN *
+const gchar * const *
 gtk_about_dialog_get_artists (GtkAboutDialog *about)
 {
   GtkAboutDialogPrivate *priv;
@@ -1655,7 +1673,7 @@ gtk_about_dialog_set_artists (GtkAboutDialog *about,
  *
  * Since: 2.6
  */
-G_CONST_RETURN gchar *
+const gchar *
 gtk_about_dialog_get_translator_credits (GtkAboutDialog *about)
 {
   g_return_val_if_fail (GTK_IS_ABOUT_DIALOG (about), NULL);
@@ -1711,9 +1729,9 @@ gtk_about_dialog_set_translator_credits (GtkAboutDialog *about,
  *
  * Returns the pixbuf displayed as logo in the about dialog.
  *
- * Return value: the pixbuf displayed as logo. The pixbuf is
- *   owned by the about dialog. If you want to keep a reference
- *   to it, you have to call g_object_ref() on it.
+ * Return value: (transfer none): the pixbuf displayed as logo. The
+ *   pixbuf is owned by the about dialog. If you want to keep a
+ *   reference to it, you have to call g_object_ref() on it.
  *
  * Since: 2.6
  */
@@ -1811,7 +1829,7 @@ gtk_about_dialog_set_logo (GtkAboutDialog *about,
  *
  * Since: 2.6
  */
-G_CONST_RETURN gchar *
+const gchar *
 gtk_about_dialog_get_logo_icon_name (GtkAboutDialog *about)
 {
   GtkAboutDialogPrivate *priv;
@@ -1883,7 +1901,6 @@ follow_if_link (GtkAboutDialog *about,
           GdkColor *style_visited_link_color;
           GdkColor color;
 
-          gtk_widget_ensure_style (GTK_WIDGET (about));
           gtk_widget_style_get (GTK_WIDGET (about),
                                 "visited-link-color", &style_visited_link_color,
                                 NULL);
@@ -1946,7 +1963,7 @@ text_view_event_after (GtkWidget      *text_view,
 
   button_event = (GdkEventButton *)event;
 
-  if (button_event->button != 1)
+  if (button_event->button != GDK_BUTTON_PRIMARY)
     return FALSE;
 
   buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
@@ -2045,6 +2062,9 @@ text_view_visibility_notify_event (GtkWidget          *text_view,
     {
       GdkDevice *dev = d->data;
 
+      if (gdk_device_get_source (dev) == GDK_SOURCE_KEYBOARD)
+        continue;
+
       gdk_window_get_device_position (gtk_widget_get_window (text_view), dev,
                                       &wx, &wy, NULL);
 
@@ -2055,6 +2075,8 @@ text_view_visibility_notify_event (GtkWidget          *text_view,
       set_cursor_if_appropriate (about, GTK_TEXT_VIEW (text_view), dev, bx, by);
     }
 
+  g_list_free (devices);
+
   return FALSE;
 }
 
@@ -2073,12 +2095,10 @@ text_view_new (GtkAboutDialog  *about,
   GdkColor color;
   GdkColor link_color;
   GdkColor visited_link_color;
-  gint size;
-  PangoFontDescription *font_desc;
-
   GtkAboutDialogPrivate *priv = about->priv;
+  GtkTextIter start_iter, end_iter;
+  GtkTextTag *tag;
 
-  gtk_widget_ensure_style (GTK_WIDGET (about));
   gtk_widget_style_get (GTK_WIDGET (about),
                         "link-color", &style_link_color,
                         "visited-link-color", &style_visited_link_color,
@@ -2106,11 +2126,11 @@ text_view_new (GtkAboutDialog  *about,
   gtk_text_view_set_editable (text_view, FALSE);
   gtk_text_view_set_wrap_mode (text_view, wrap_mode);
 
-  size = pango_font_description_get_size (gtk_widget_get_style (view)->font_desc);
-  font_desc = pango_font_description_new ();
-  pango_font_description_set_size (font_desc, size * PANGO_SCALE_SMALL);
-  gtk_widget_modify_font (view, font_desc);
-  pango_font_description_free (font_desc);
+  gtk_text_buffer_get_start_iter (buffer, &start_iter);
+  gtk_text_buffer_get_start_iter (buffer, &end_iter);
+  tag = gtk_text_tag_new (NULL);
+  g_object_set (tag, "font-scale", PANGO_SCALE_SMALL, NULL);
+  gtk_text_buffer_apply_tag (buffer, tag, &start_iter, &end_iter);
 
   gtk_text_view_set_left_margin (text_view, 8);
   gtk_text_view_set_right_margin (text_view, 8);
@@ -2239,7 +2259,8 @@ add_credits_section (GtkAboutDialog *about,
   label = gtk_label_new (markup);
   gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
   g_free (markup);
-  gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+  gtk_widget_set_halign (label, GTK_ALIGN_END);
+  gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
   gtk_grid_attach (grid, label, 0, *row, 1, 1);
 
   for (p = people; *p; p++)
@@ -2278,6 +2299,7 @@ add_credits_section (GtkAboutDialog *about,
             {
               gchar *link;
               gchar *text;
+              gchar *name;
 
               if (*q1 == '<')
                 {
@@ -2285,6 +2307,7 @@ add_credits_section (GtkAboutDialog *about,
                   gchar *escaped;
 
                   text = g_strstrip (g_strndup (q0, q1 - q0));
+                  name = g_markup_escape_text (text, -1);
                   q1++;
                   link = g_strndup (q1, q2 - q1);
                   q2++;
@@ -2292,22 +2315,25 @@ add_credits_section (GtkAboutDialog *about,
                   g_string_append_printf (str,
                                           "<a href=\"mailto:%s\">%s</a>",
                                           escaped,
-                                          text);
+                                          name[0] ? name : link);
                   g_free (escaped);
                   g_free (link);
                   g_free (text);
+                  g_free (name);
                 }
               else
                 {
                   /* uri */
                   text = g_strstrip (g_strndup (q0, q1 - q0));
+                  name = g_markup_escape_text (text, -1);
                   link = g_strndup (q1, q2 - q1);
                   g_string_append_printf (str,
                                           "<a href=\"%s\">%s</a>",
                                           link,
-                                          text);
+                                          name[0] ? name : link);
                   g_free (link);
                   g_free (text);
+                  g_free (name);
                 }
 
               q0 = q2;
@@ -2323,12 +2349,15 @@ add_credits_section (GtkAboutDialog *about,
       label = gtk_label_new (str->str);
       gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
       g_string_free (str, TRUE);
-      gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
+      gtk_widget_set_halign (label, GTK_ALIGN_START);
+      gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
       gtk_grid_attach (grid, label, 1, *row, 1, 1);
       (*row)++;
     }
 
   /* skip one at the end */
+  label = gtk_label_new ("");
+  gtk_grid_attach (grid, label, 1, *row, 1, 1);
   (*row)++;
 }
 
@@ -2339,7 +2368,6 @@ create_credits_page (GtkAboutDialog *about)
   GtkWidget *page_vbox;
   GtkWidget *sw;
   GtkWidget *grid;
-  GtkWidget *alignment;
   gint row;
 
   page_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
@@ -2347,21 +2375,24 @@ create_credits_page (GtkAboutDialog *about)
   priv->credits_page = gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), page_vbox, NULL);
 
   sw = gtk_scrolled_window_new (NULL, NULL);
-  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_NONE);
+  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
                                   GTK_POLICY_NEVER,
                                   GTK_POLICY_AUTOMATIC);
   gtk_box_pack_start (GTK_BOX (page_vbox), sw, TRUE, TRUE, 0);
 
-  alignment = gtk_alignment_new (0.5, 0, 0, 0);
-  gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), alignment);
-
   grid = gtk_grid_new ();
   gtk_container_set_border_width (GTK_CONTAINER (grid), 5);
   gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL);
-  gtk_grid_set_column_spacing (GTK_GRID (grid), 2);
-  gtk_grid_set_row_spacing (GTK_GRID (grid), 12);
-  gtk_container_add (GTK_CONTAINER (alignment), grid);
+  gtk_grid_set_column_spacing (GTK_GRID (grid), 8);
+  gtk_grid_set_row_spacing (GTK_GRID (grid), 2);
+  gtk_widget_set_halign (grid, GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (grid, GTK_ALIGN_START);
+  gtk_container_add (GTK_CONTAINER (sw), grid);
+  gtk_style_context_add_class (gtk_widget_get_style_context (gtk_bin_get_child (GTK_BIN (sw))),
+                               GTK_STYLE_CLASS_VIEW);
+
+  row = 0;
 
   if (priv->authors != NULL)
     add_credits_section (about, GTK_GRID (grid), &row, _("Created by"), priv->authors);
@@ -2374,17 +2405,26 @@ create_credits_page (GtkAboutDialog *about)
       strcmp (priv->translator_credits, "translator_credits") != 0 &&
       strcmp (priv->translator_credits, "translator-credits") != 0)
     {
-      gchar *translators[2];
-
-      translators[0] = priv->translator_credits;
-      translators[1] = NULL;
+      gchar **translators;
 
+      translators = g_strsplit (priv->translator_credits, "\n", 0);
       add_credits_section (about, GTK_GRID (grid), &row, _("Translated by"), translators);
+      g_strfreev (translators);
     }
 
   if (priv->artists != NULL)
     add_credits_section (about, GTK_GRID (grid), &row, _("Artwork by"), priv->artists);
 
+  if (priv->credit_sections != NULL)
+    {
+      GSList *cs;
+      for (cs = priv->credit_sections; cs != NULL; cs = cs->next)
+       {
+         CreditSection *section = cs->data;
+         add_credits_section (about, GTK_GRID (grid), &row, section->heading, section->people);
+       }
+    }
+
   gtk_widget_show_all (sw);
 }
 
@@ -2414,7 +2454,6 @@ create_license_page (GtkAboutDialog *about)
   priv->license_page = gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), page_vbox, NULL);
 
   sw = gtk_scrolled_window_new (NULL, NULL);
-  gtk_container_set_border_width (GTK_CONTAINER (sw), 5);
   gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
                                   GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
@@ -2463,7 +2502,11 @@ gtk_about_dialog_new (void)
 static void
 close_cb (GtkAboutDialog *about)
 {
+  GtkAboutDialogPrivate *priv = about->priv;
+
   switch_page (about, 0);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->credits_button), FALSE);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->license_button), FALSE);
   gtk_widget_hide (GTK_WIDGET (about));
 }
 
@@ -2471,7 +2514,7 @@ close_cb (GtkAboutDialog *about)
  * gtk_show_about_dialog:
  * @parent: (allow-none): transient parent, or %NULL for none
  * @first_property_name: the name of the first property
- * @Varargs: value of first property, followed by more properties, %NULL-terminated
+ * @...: value of first property, followed by more properties, %NULL-terminated
  *
  * This is a convenience function for showing an application's about box.
  * The constructed dialog is associated with the parent window and
@@ -2615,3 +2658,35 @@ gtk_about_dialog_get_license_type (GtkAboutDialog *about)
 
   return about->priv->license_type;
 }
+
+/**
+ * gtk_about_dialog_add_credit_section:
+ * @about: A #GtkAboutDialog
+ * @section_name: The name of the section
+ * @people: (array zero-terminated=1): The people who belong to that section
+ *
+ * Creates a new section in the Credits page.
+ *
+ * Since: 3.4
+ */
+void
+gtk_about_dialog_add_credit_section (GtkAboutDialog  *about,
+                                     const gchar     *section_name,
+                                     const gchar    **people)
+{
+  GtkAboutDialogPrivate *priv;
+  CreditSection *new_entry;
+
+  g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
+  g_return_if_fail (section_name != NULL);
+  g_return_if_fail (people != NULL);
+
+  priv = about->priv;
+
+  new_entry = g_slice_new (CreditSection);
+  new_entry->heading = g_strdup ((gchar *)section_name);
+  new_entry->people = g_strdupv ((gchar **)people);
+
+  priv->credit_sections = g_slist_append (priv->credit_sections, new_entry);
+  update_credits_button_visibility (about);
+}