[evince] libdocument: Use G_PARAM_STATIC_STRINGS
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] libdocument: Use G_PARAM_STATIC_STRINGS
- Date: Sun, 24 Jun 2012 14:33:21 +0000 (UTC)
commit dcf5384712439542bee5e6c53f6cfd54283272e7
Author: Christian Persch <chpe gnome org>
Date: Wed Jun 13 21:07:22 2012 +0200
libdocument: Use G_PARAM_STATIC_STRINGS
This saves some string copies.
libdocument/ev-annotation.c | 49 ++++++++++++++++++++++-------------
libdocument/ev-attachment.c | 18 +++++++++----
libdocument/ev-link-action.c | 27 +++++++++++++------
libdocument/ev-link-dest.c | 32 +++++++++++++++--------
libdocument/ev-link.c | 6 +++-
libdocument/ev-transition-effect.c | 21 ++++++++++-----
libview/ev-view-presentation.c | 4 +-
shell/eggfindbar.c | 4 +-
8 files changed, 104 insertions(+), 57 deletions(-)
---
diff --git a/libdocument/ev-annotation.c b/libdocument/ev-annotation.c
index d270e74..19542a6 100644
--- a/libdocument/ev-annotation.c
+++ b/libdocument/ev-annotation.c
@@ -230,28 +230,32 @@ ev_annotation_class_init (EvAnnotationClass *klass)
"Page",
"The page wehere the annotation is",
EV_TYPE_PAGE,
- G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_ANNOT_CONTENTS,
g_param_spec_string ("contents",
"Contents",
"The annotation contents",
NULL,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_ANNOT_NAME,
g_param_spec_string ("name",
"Name",
"The annotation unique name",
NULL,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_ANNOT_MODIFIED,
g_param_spec_string ("modified",
"Modified",
"Last modified date as string",
NULL,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
/**
* EvAnnotation:color:
*
@@ -264,7 +268,8 @@ ev_annotation_class_init (EvAnnotationClass *klass)
g_param_spec_pointer ("color",
"Color",
"The annotation color",
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
/**
* EvAnnotation:rgba:
@@ -646,7 +651,8 @@ ev_annotation_markup_default_init (EvAnnotationMarkupInterface *iface)
"Label",
"Label of the markup annotation",
NULL,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_interface_install_property (iface,
g_param_spec_double ("opacity",
"Opacity",
@@ -654,28 +660,32 @@ ev_annotation_markup_default_init (EvAnnotationMarkupInterface *iface)
0,
G_MAXDOUBLE,
1.,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_interface_install_property (iface,
- g_param_spec_boolean ("has_popup",
+ g_param_spec_boolean ("has-popup",
"Has popup",
"Whether the markup annotation has "
"a popup window associated",
TRUE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_interface_install_property (iface,
g_param_spec_boxed ("rectangle",
"Rectangle",
"The Rectangle of the popup associated "
"to the markup annotation",
EV_TYPE_RECTANGLE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_interface_install_property (iface,
- g_param_spec_boolean ("popup_is_open",
+ g_param_spec_boolean ("popup-is-open",
"PopupIsOpen",
"Whether the popup associated to "
"the markup annotation is open",
FALSE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
initialized = TRUE;
}
}
@@ -775,9 +785,9 @@ ev_annotation_markup_class_install_properties (GObjectClass *klass)
g_object_class_override_property (klass, PROP_MARKUP_LABEL, "label");
g_object_class_override_property (klass, PROP_MARKUP_OPACITY, "opacity");
- g_object_class_override_property (klass, PROP_MARKUP_HAS_POPUP, "has_popup");
+ g_object_class_override_property (klass, PROP_MARKUP_HAS_POPUP, "has-popup");
g_object_class_override_property (klass, PROP_MARKUP_RECTANGLE, "rectangle");
- g_object_class_override_property (klass, PROP_MARKUP_POPUP_IS_OPEN, "popup_is_open");
+ g_object_class_override_property (klass, PROP_MARKUP_POPUP_IS_OPEN, "popup-is-open");
}
const gchar *
@@ -1013,14 +1023,16 @@ ev_annotation_text_class_init (EvAnnotationTextClass *klass)
"The icon fo the text annotation",
EV_TYPE_ANNOTATION_TEXT_ICON,
EV_ANNOTATION_TEXT_ICON_NOTE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_TEXT_IS_OPEN,
- g_param_spec_boolean ("is_open",
+ g_param_spec_boolean ("is-open",
"IsOpen",
"Whether text annot is initially open",
FALSE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
}
static void
@@ -1166,7 +1178,8 @@ ev_annotation_attachment_class_init (EvAnnotationAttachmentClass *klass)
"The attachment of the annotation",
EV_TYPE_ATTACHMENT,
G_PARAM_CONSTRUCT |
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
}
static void
diff --git a/libdocument/ev-attachment.c b/libdocument/ev-attachment.c
index 912a50e..d8b4ba9 100644
--- a/libdocument/ev-attachment.c
+++ b/libdocument/ev-attachment.c
@@ -162,7 +162,8 @@ ev_attachment_class_init (EvAttachmentClass *klass)
"The attachment name",
NULL,
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_DESCRIPTION,
g_param_spec_string ("description",
@@ -170,7 +171,8 @@ ev_attachment_class_init (EvAttachmentClass *klass)
"The attachment description",
NULL,
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_MTIME,
g_param_spec_ulong ("mtime",
@@ -178,7 +180,8 @@ ev_attachment_class_init (EvAttachmentClass *klass)
"The attachment modification date",
0, G_MAXULONG, 0,
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_CTIME,
g_param_spec_ulong ("ctime",
@@ -186,7 +189,8 @@ ev_attachment_class_init (EvAttachmentClass *klass)
"The attachment creation date",
0, G_MAXULONG, 0,
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_SIZE,
g_param_spec_uint ("size",
@@ -194,14 +198,16 @@ ev_attachment_class_init (EvAttachmentClass *klass)
"The attachment size",
0, G_MAXUINT, 0,
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_DATA,
g_param_spec_pointer ("data",
"Data",
"The attachment data",
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class->finalize = ev_attachment_finalize;
}
diff --git a/libdocument/ev-link-action.c b/libdocument/ev-link-action.c
index f7fcb2b..ccbebfb 100644
--- a/libdocument/ev-link-action.c
+++ b/libdocument/ev-link-action.c
@@ -315,14 +315,16 @@ ev_link_action_class_init (EvLinkActionClass *ev_link_action_class)
EV_TYPE_LINK_ACTION_TYPE,
EV_LINK_ACTION_TYPE_GOTO_DEST,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_DEST,
g_param_spec_pointer ("dest",
"Action destination",
"The link action destination",
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_URI,
g_param_spec_string ("uri",
@@ -330,7 +332,8 @@ ev_link_action_class_init (EvLinkActionClass *ev_link_action_class)
"The link action URI",
NULL,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_FILENAME,
g_param_spec_string ("filename",
@@ -338,7 +341,8 @@ ev_link_action_class_init (EvLinkActionClass *ev_link_action_class)
"The link action filename",
NULL,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_PARAMS,
g_param_spec_string ("params",
@@ -346,7 +350,8 @@ ev_link_action_class_init (EvLinkActionClass *ev_link_action_class)
"The link action params",
NULL,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_NAME,
g_param_spec_string ("name",
@@ -354,28 +359,32 @@ ev_link_action_class_init (EvLinkActionClass *ev_link_action_class)
"The link action name",
NULL,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_SHOW_LIST,
g_param_spec_pointer ("show-list",
"ShowList",
"The list of layers that should be shown",
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_HIDE_LIST,
g_param_spec_pointer ("hide-list",
"HideList",
"The list of layers that should be hidden",
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_TOGGLE_LIST,
g_param_spec_pointer ("toggle-list",
"ToggleList",
"The list of layers that should be toggled",
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
}
EvLinkAction *
diff --git a/libdocument/ev-link-dest.c b/libdocument/ev-link-dest.c
index 9d5d860..355c49b 100644
--- a/libdocument/ev-link-dest.c
+++ b/libdocument/ev-link-dest.c
@@ -300,7 +300,8 @@ ev_link_dest_class_init (EvLinkDestClass *ev_link_dest_class)
EV_TYPE_LINK_DEST_TYPE,
EV_LINK_DEST_TYPE_UNKNOWN,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_PAGE,
g_param_spec_int ("page",
@@ -310,7 +311,8 @@ ev_link_dest_class_init (EvLinkDestClass *ev_link_dest_class)
G_MAXINT,
0,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_LEFT,
g_param_spec_double ("left",
@@ -320,7 +322,8 @@ ev_link_dest_class_init (EvLinkDestClass *ev_link_dest_class)
G_MAXDOUBLE,
0,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_TOP,
g_param_spec_double ("top",
@@ -330,7 +333,8 @@ ev_link_dest_class_init (EvLinkDestClass *ev_link_dest_class)
G_MAXDOUBLE,
0,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_BOTTOM,
g_param_spec_double ("bottom",
@@ -340,7 +344,8 @@ ev_link_dest_class_init (EvLinkDestClass *ev_link_dest_class)
G_MAXDOUBLE,
0,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_RIGHT,
g_param_spec_double ("right",
@@ -350,7 +355,8 @@ ev_link_dest_class_init (EvLinkDestClass *ev_link_dest_class)
G_MAXDOUBLE,
0,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_ZOOM,
@@ -361,7 +367,8 @@ ev_link_dest_class_init (EvLinkDestClass *ev_link_dest_class)
G_MAXDOUBLE,
0,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_CHANGE,
g_param_spec_uint ("change",
@@ -371,7 +378,8 @@ ev_link_dest_class_init (EvLinkDestClass *ev_link_dest_class)
G_MAXUINT,
0,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_NAMED,
g_param_spec_string ("named",
@@ -379,15 +387,17 @@ ev_link_dest_class_init (EvLinkDestClass *ev_link_dest_class)
"The named destination",
NULL,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_PAGE_LABEL,
- g_param_spec_string ("page_label",
+ g_param_spec_string ("page-label",
"Label of the page",
"The label of the destination page",
NULL,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
}
EvLinkDest *
diff --git a/libdocument/ev-link.c b/libdocument/ev-link.c
index a9ad41e..0a51f23 100644
--- a/libdocument/ev-link.c
+++ b/libdocument/ev-link.c
@@ -160,14 +160,16 @@ ev_link_class_init (EvLinkClass *ev_window_class)
"The link title",
NULL,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_ACTION,
g_param_spec_pointer ("action",
"Link Action",
"The link action",
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
}
EvLink *
diff --git a/libdocument/ev-transition-effect.c b/libdocument/ev-transition-effect.c
index 96b6c1c..9250abc 100644
--- a/libdocument/ev-transition-effect.c
+++ b/libdocument/ev-transition-effect.c
@@ -154,7 +154,8 @@ ev_transition_effect_class_init (EvTransitionEffectClass *klass)
"Page transition effect type",
EV_TYPE_TRANSITION_EFFECT_TYPE,
EV_TRANSITION_EFFECT_REPLACE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_ALIGNMENT,
g_param_spec_enum ("alignment",
@@ -162,7 +163,8 @@ ev_transition_effect_class_init (EvTransitionEffectClass *klass)
"Alignment for the effect",
EV_TYPE_TRANSITION_EFFECT_ALIGNMENT,
EV_TRANSITION_ALIGNMENT_HORIZONTAL,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_DIRECTION,
g_param_spec_enum ("direction",
@@ -170,14 +172,16 @@ ev_transition_effect_class_init (EvTransitionEffectClass *klass)
"Direction for the effect",
EV_TYPE_TRANSITION_EFFECT_DIRECTION,
EV_TRANSITION_DIRECTION_INWARD,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_DURATION,
g_param_spec_int ("duration",
"Effect duration",
"Effect duration in seconds",
0, G_MAXINT, 0,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_ANGLE,
g_param_spec_int ("angle",
@@ -185,21 +189,24 @@ ev_transition_effect_class_init (EvTransitionEffectClass *klass)
"Effect angle in degrees, counted "
"counterclockwise from left to right",
0, 360, 0,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_SCALE,
g_param_spec_double ("scale",
"Effect scale",
"Scale at which the effect is applied",
0., 1., 1.,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_RECTANGULAR,
g_param_spec_boolean ("rectangular",
"Rectangular area",
"Whether the covered area is rectangular",
FALSE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_type_class_add_private (klass, sizeof (EvTransitionEffectPrivate));
}
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index e978b75..a6f8d80 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -1432,7 +1432,7 @@ ev_view_presentation_class_init (EvViewPresentationClass *klass)
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (gobject_class,
PROP_CURRENT_PAGE,
- g_param_spec_uint ("current_page",
+ g_param_spec_uint ("current-page",
"Current Page",
"The current page",
0, G_MAXUINT, 0,
@@ -1448,7 +1448,7 @@ ev_view_presentation_class_init (EvViewPresentationClass *klass)
G_PARAM_CONSTRUCT));
g_object_class_install_property (gobject_class,
PROP_INVERTED_COLORS,
- g_param_spec_boolean ("inverted_colors",
+ g_param_spec_boolean ("inverted-colors",
"Inverted Colors",
"Whether presentation is displayed with inverted colors",
FALSE,
diff --git a/shell/eggfindbar.c b/shell/eggfindbar.c
index a6d2b08..34937e7 100644
--- a/shell/eggfindbar.c
+++ b/shell/eggfindbar.c
@@ -145,7 +145,7 @@ egg_find_bar_class_init (EggFindBarClass *klass)
*/
g_object_class_install_property (object_class,
PROP_SEARCH_STRING,
- g_param_spec_string ("search_string",
+ g_param_spec_string ("search-string",
"Search string",
"The name of the string to be found",
NULL,
@@ -159,7 +159,7 @@ egg_find_bar_class_init (EggFindBarClass *klass)
*/
g_object_class_install_property (object_class,
PROP_CASE_SENSITIVE,
- g_param_spec_boolean ("case_sensitive",
+ g_param_spec_boolean ("case-sensitive",
"Case sensitive",
"TRUE for a case sensitive search",
FALSE,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]