Trivial formatting fixes

Just committing these is easier than writing them up.
This commit is contained in:
Matthias Clasen
2011-08-09 00:10:00 +02:00
parent a58a2dc0d3
commit a18fab88a1
4 changed files with 119 additions and 120 deletions

View File

@ -110,7 +110,7 @@ struct _GtkFontChooserPrivate
#define ROW_FORMAT_STRING "<span weight=\"bold\" size=\"small\">%s</span>\n<span size=\"x-large\" font_desc=\"%s\">%s</span>"
#define NO_FONT_MATCHED_SEARCH "No fonts matched your serach entry.You can revise your serach and try again."
#define NO_FONT_MATCHED_SEARCH "No fonts matched your search. You can revise your search and try again."
/* These are what we use as the standard font sizes, for the size list.
*/
@ -522,7 +522,6 @@ row_deleted_cb (GtkTreeModel *model,
gtk_container_add (GTK_CONTAINER (priv->list_scrolled_window),
priv->empty_list);
}
}
}
#endif
@ -757,9 +756,7 @@ populate_list (GtkFontChooser *fontchooser,
gchar *font_desc = pango_font_description_to_string (pango_desc);
/* foreground_color, family_name, face_name, desc, sample string */
g_string_printf (family_and_face, "%s %s",
fam_name,
face_name);
g_string_printf (family_and_face, "%s %s", fam_name, face_name);
g_string_printf (tmp, ROW_FORMAT_STRING,
family_and_face->str,
@ -852,7 +849,7 @@ visible_func (GtkTreeModel *model,
}
static void
gtk_font_chooser_bootstrap_fontlist (GtkFontChooser* fontchooser)
gtk_font_chooser_bootstrap_fontlist (GtkFontChooser *fontchooser)
{
GtkTreeView *treeview = GTK_TREE_VIEW (fontchooser->priv->family_face_list);
GtkCellRenderer *cell;
@ -914,7 +911,6 @@ gtk_font_chooser_screen_changed (GtkWidget *widget,
populate_list (fontchooser,
GTK_TREE_VIEW (fontchooser->priv->family_face_list),
fontchooser->priv->model);
return;
}
static void
@ -927,7 +923,6 @@ gtk_font_chooser_style_updated (GtkWidget *widget)
populate_list (fontchooser,
GTK_TREE_VIEW (fontchooser->priv->family_face_list),
fontchooser->priv->model);
return;
}
static void
@ -966,11 +961,11 @@ gtk_font_chooser_ref_face (GtkFontChooser *fontchooser,
* @fontchooser: a #GtkFontChooser
*
* Gets the #PangoFontFamily representing the selected font family.
* Font families are a collection of font faces.
*
* Return value: (transfer none): A #PangoFontFamily representing the
* selected font family. Font families are a collection of font
* faces. The returned object is owned by @fontchooser and must not
* be modified or freed.
* selected font family. The returned object is owned by @fontchooser
* and must not be modified or freed.
*
* Since: 3.2
*/
@ -1030,14 +1025,16 @@ gtk_font_chooser_get_size (GtkFontChooser *fontchooser)
*
* Note that this can be a different string than what you set with
* gtk_font_chooser_set_font_name(), as the font chooser widget may
* normalize font names and thus return a string with a different structure.
* For example, "Helvetica Italic Bold 12" could be normalized to
* "Helvetica Bold Italic 12". Use pango_font_description_equal()
* if you want to compare two font descriptions.
* normalize font names and thus return a string with a different
* structure. For example, "Helvetica Italic Bold 12" could be
* normalized to "Helvetica Bold Italic 12".
*
* Return value: (transfer full) (allow-none): A string with the name of the
* current font, or %NULL if no font is selected. You must free this
* string with g_free().
* Use pango_font_description_equal() if you want to compare two
* font descriptions.
*
* Return value: (transfer full) (allow-none): A string with the name
* of the current font, or %NULL if no font is selected. You must
* free this string with g_free().
*
* Since: 3.2
*/
@ -1051,8 +1048,6 @@ gtk_font_chooser_get_font_name (GtkFontChooser *fontchooser)
if (!fontchooser->priv->face)
return NULL;
desc = pango_font_face_describe (fontchooser->priv->face);
font_desc_name = pango_font_description_to_string (desc);
pango_font_description_free (desc);
@ -1062,8 +1057,6 @@ gtk_font_chooser_get_font_name (GtkFontChooser *fontchooser)
return font_name;
}
/* This sets the current font, then selecting the appropriate list rows. */
/**
* gtk_font_chooser_set_font_name:
* @fontchooser: a #GtkFontChooser
@ -1071,13 +1064,14 @@ gtk_font_chooser_get_font_name (GtkFontChooser *fontchooser)
*
* Sets the currently-selected font.
*
* Note that the @fontchooser needs to know the screen in which it will appear
* for this to work; this can be guaranteed by simply making sure that the
* @fontchooser is inserted in a toplevel window before you call this function.
* Note that the @fontchooser needs to know the screen in which
* it will appear for this to work; this can be guaranteed by simply
* making sure that the @fontchooser is inserted in a toplevel window
* before you call this function.
*
* Return value: %TRUE if the font could be set successfully; %FALSE if no
* such font exists or if the @fontchooser doesn't belong to a particular
* screen yet.
* Return value: %TRUE if the font could be set successfully; %FALSE
* if no such font exists or if the @fontchooser doesn't belong
* to a particular screen yet.
*
* Since: 3.2
*/
@ -1130,7 +1124,6 @@ gtk_font_chooser_set_font_name (GtkFontChooser *fontchooser,
pango_font_description_set_size (tmp_desc,
pango_font_description_get_size (desc));
if (pango_font_description_equal (desc, tmp_desc))
{
GtkTreePath *path;
@ -1194,6 +1187,7 @@ const gchar*
gtk_font_chooser_get_preview_text (GtkFontChooser *fontchooser)
{
g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL);
return (const gchar*)fontchooser->priv->preview_text;
}
@ -1231,8 +1225,11 @@ gtk_font_chooser_set_preview_text (GtkFontChooser *fontchooser,
* gtk_font_chooser_get_show_preview_entry:
* @fontchooser: a #GtkFontChooser
*
* Return value: %TRUE if the preview entry is shown or %FALSE if
* it is hidden.
* Returns whether the preview entry is shown or not.
*
* Return value: %TRUE if the preview entry is shown
* or %FALSE if it is hidden.
*
* Since: 3.2
*/
gboolean
@ -1249,6 +1246,7 @@ gtk_font_chooser_get_show_preview_entry (GtkFontChooser *fontchooser)
* @show_preview_entry: whether to show the editable preview entry or not
*
* Shows or hides the editable preview entry.
*
* Since: 3.2
*/
void

View File

@ -80,6 +80,7 @@ void gtk_font_chooser_set_preview_text (GtkFontChooser *fontchoo
gboolean gtk_font_chooser_get_show_preview_entry (GtkFontChooser *fontchooser);
void gtk_font_chooser_set_show_preview_entry (GtkFontChooser *fontchooser,
gboolean show_preview_entry);
G_END_DECLS
#endif /* __GTK_FONT_CHOOSER_H__ */

View File

@ -70,12 +70,11 @@ struct _GtkFontChooserDialogPrivate
*/
static void gtk_font_chooser_dialog_buildable_interface_init (GtkBuildableIface *iface);
static GObject* gtk_font_chooser_dialog_buildable_get_internal_child (GtkBuildable *buildable,
static GObject *gtk_font_chooser_dialog_buildable_get_internal_child (GtkBuildable *buildable,
GtkBuilder *builder,
const gchar *childname);
G_DEFINE_TYPE_WITH_CODE (GtkFontChooserDialog, gtk_font_chooser_dialog,
GTK_TYPE_DIALOG,
G_DEFINE_TYPE_WITH_CODE (GtkFontChooserDialog, gtk_font_chooser_dialog, GTK_TYPE_DIALOG,
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
gtk_font_chooser_dialog_buildable_interface_init))
@ -132,8 +131,7 @@ gtk_font_chooser_dialog_init (GtkFontChooserDialog *fontchooserdiag)
GTK_RESPONSE_CANCEL,
-1);
gtk_window_set_title (GTK_WINDOW (fontchooserdiag),
_("Font Selection"));
gtk_window_set_title (GTK_WINDOW (fontchooserdiag), _("Font Selection"));
gtk_widget_pop_composite_child ();
}
@ -172,7 +170,7 @@ gtk_font_chooser_dialog_new (const gchar *title,
* Returns: (transfer none): the embedded #GtkFontChooser
*
* Since: 3.2
**/
*/
GtkWidget*
gtk_font_chooser_dialog_get_font_chooser (GtkFontChooserDialog *fcd)
{
@ -217,11 +215,13 @@ gtk_font_chooser_dialog_buildable_get_internal_child (GtkBuildable *buildable,
* gtk_font_chooser_dialog_set_font_name(), as the font chooser widget
* may normalize font names and thus return a string with a different
* structure. For example, "Helvetica Italic Bold 12" could be normalized
* to "Helvetica Bold Italic 12". Use pango_font_description_equal()
* if you want to compare two font descriptions.
* to "Helvetica Bold Italic 12".
*
* Return value: A string with the name of the current font, or %NULL if no
* font is selected. You must free this string with g_free().
* Use pango_font_description_equal() if you want to compare two
* font descriptions.
*
* Return value: A string with the name of the current font, or %NULL
* if no font is selected. You must free this string with g_free().
*
* Since: 3.2
*/