[evince/wip/app] libview: Use G_PARAM_STATIC_STRINGS
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince/wip/app] libview: Use G_PARAM_STATIC_STRINGS
- Date: Wed, 13 Jun 2012 19:08:35 +0000 (UTC)
commit a7a11f48b4f80f6501608a07c66005cb43c52636
Author: Christian Persch <chpe gnome org>
Date: Wed Jun 13 21:07:22 2012 +0200
libview: Use G_PARAM_STATIC_STRINGS
This saves some string copies.
libview/ev-annotation-window.c | 6 ++++--
libview/ev-document-model.c | 30 ++++++++++++++++++++----------
libview/ev-loading-window.c | 3 ++-
libview/ev-print-operation.c | 3 ++-
libview/ev-timeline.c | 9 ++++++---
libview/ev-transition-animation.c | 9 ++++++---
libview/ev-view-presentation.c | 12 ++++++++----
7 files changed, 48 insertions(+), 24 deletions(-)
---
diff --git a/libview/ev-annotation-window.c b/libview/ev-annotation-window.c
index c0229ce..09762c4 100644
--- a/libview/ev-annotation-window.c
+++ b/libview/ev-annotation-window.c
@@ -550,7 +550,8 @@ ev_annotation_window_class_init (EvAnnotationWindowClass *klass)
"The annotation associated to the window",
EV_TYPE_ANNOTATION_MARKUP,
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_PARENT,
g_param_spec_object ("parent",
@@ -558,7 +559,8 @@ ev_annotation_window_class_init (EvAnnotationWindowClass *klass)
"The parent window",
GTK_TYPE_WINDOW,
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
signals[CLOSED] =
g_signal_new ("closed",
G_TYPE_FROM_CLASS (g_object_class),
diff --git a/libview/ev-document-model.c b/libview/ev-document-model.c
index ccf11d4..0e8fbb9 100644
--- a/libview/ev-document-model.c
+++ b/libview/ev-document-model.c
@@ -196,35 +196,40 @@ ev_document_model_class_init (EvDocumentModelClass *klass)
"Document",
"The current document",
EV_TYPE_DOCUMENT,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_PAGE,
g_param_spec_int ("page",
"Page",
"Current page",
-1, G_MAXINT, -1,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_ROTATION,
g_param_spec_int ("rotation",
"Rotation",
"Current rotation angle",
0, 360, 0,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_INVERTED_COLORS,
g_param_spec_boolean ("inverted-colors",
"Inverted Colors",
"Whether document is displayed with inverted colors",
FALSE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_SCALE,
g_param_spec_double ("scale",
"Scale",
"Current scale factor",
0., G_MAXDOUBLE, 1.,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_SIZING_MODE,
g_param_spec_enum ("sizing-mode",
@@ -232,35 +237,40 @@ ev_document_model_class_init (EvDocumentModelClass *klass)
"Current sizing mode",
EV_TYPE_SIZING_MODE,
EV_SIZING_FIT_WIDTH,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_CONTINUOUS,
g_param_spec_boolean ("continuous",
"Continuous",
"Whether document is displayed in continuous mode",
TRUE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_DUAL_PAGE,
g_param_spec_boolean ("dual-page",
"Dual Page",
"Whether document is displayed in dual page mode",
FALSE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_DUAL_PAGE_ODD_LEFT,
g_param_spec_boolean ("dual-odd-left",
"Odd Pages Left",
"Whether odd pages are displayed on left side in dual mode",
FALSE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (g_object_class,
PROP_FULLSCREEN,
g_param_spec_boolean ("fullscreen",
"Fullscreen",
"Whether document is displayed in fullscreen mode",
FALSE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
/* Signals */
signals [PAGE_CHANGED] =
diff --git a/libview/ev-loading-window.c b/libview/ev-loading-window.c
index c4872d6..2c2af6f 100644
--- a/libview/ev-loading-window.c
+++ b/libview/ev-loading-window.c
@@ -254,7 +254,8 @@ ev_loading_window_class_init (EvLoadingWindowClass *klass)
"The parent window",
GTK_TYPE_WINDOW,
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
}
/* Public methods */
diff --git a/libview/ev-print-operation.c b/libview/ev-print-operation.c
index c12e8f7..a5561ac 100644
--- a/libview/ev-print-operation.c
+++ b/libview/ev-print-operation.c
@@ -142,7 +142,8 @@ ev_print_operation_class_init (EvPrintOperationClass *klass)
"The document to print",
EV_TYPE_DOCUMENT,
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
signals[DONE] =
g_signal_new ("done",
G_TYPE_FROM_CLASS (g_object_class),
diff --git a/libview/ev-timeline.c b/libview/ev-timeline.c
index 90bddb5..9e47494 100644
--- a/libview/ev-timeline.c
+++ b/libview/ev-timeline.c
@@ -222,7 +222,8 @@ ev_timeline_class_init (EvTimelineClass *class)
1,
G_MAXUINT,
DEFAULT_FPS,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_DURATION,
g_param_spec_uint ("duration",
@@ -231,14 +232,16 @@ ev_timeline_class_init (EvTimelineClass *class)
0,
G_MAXUINT,
0,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_LOOP,
g_param_spec_boolean ("loop",
"Loop",
"Whether the timeline loops or not",
FALSE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
signals[STARTED] =
g_signal_new ("started",
G_TYPE_FROM_CLASS (object_class),
diff --git a/libview/ev-transition-animation.c b/libview/ev-transition-animation.c
index 49d77f7..8e574a2 100644
--- a/libview/ev-transition-animation.c
+++ b/libview/ev-transition-animation.c
@@ -164,19 +164,22 @@ ev_transition_animation_class_init (EvTransitionAnimationClass *klass)
"Effect",
"Transition effect description",
EV_TYPE_TRANSITION_EFFECT,
- G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_ORIGIN_SURFACE,
g_param_spec_pointer ("origin-surface",
"Origin surface",
"Cairo surface from which the animation will happen",
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_DEST_SURFACE,
g_param_spec_pointer ("dest-surface",
"Destination surface",
"Cairo surface to which the animation will happen",
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS));
g_type_class_add_private (klass, sizeof (EvTransitionAnimationPriv));
}
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index 6efeeb6..42ffb00 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -1431,7 +1431,8 @@ ev_view_presentation_class_init (EvViewPresentationClass *klass)
"Document",
EV_TYPE_DOCUMENT,
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class,
PROP_CURRENT_PAGE,
g_param_spec_uint ("current_page",
@@ -1439,7 +1440,8 @@ ev_view_presentation_class_init (EvViewPresentationClass *klass)
"The current page",
0, G_MAXUINT, 0,
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class,
PROP_ROTATION,
g_param_spec_uint ("rotation",
@@ -1447,7 +1449,8 @@ ev_view_presentation_class_init (EvViewPresentationClass *klass)
"Current rotation angle",
0, 360, 0,
G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT));
+ G_PARAM_CONSTRUCT |
+ G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class,
PROP_INVERTED_COLORS,
g_param_spec_boolean ("inverted_colors",
@@ -1455,7 +1458,8 @@ ev_view_presentation_class_init (EvViewPresentationClass *klass)
"Whether presentation is displayed with inverted colors",
FALSE,
G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
signals[CHANGE_PAGE] =
g_signal_new ("change_page",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]