Commit bac8610f authored by Steve Frécinaux's avatar Steve Frécinaux

Take profit of G_PARAM_STATIC_STRINGS

svn path=/trunk/; revision=6112
parent c25219f6
2008-01-23 Steve Frécinaux <code@istique.net>
* gedit/gedit-app.c:
* gedit/gedit-document-loader.c:
* gedit/gedit-document-saver.c:
* gedit/gedit-document.c:
* gedit/gedit-documents-panel.c:
* gedit/gedit-encodings-option-menu.c:
* gedit/gedit-history-entry.c:
* gedit/gedit-panel.c:
* gedit/gedit-print-job-preview.c:
* gedit/gedit-progress-message-area.c:
* gedit/gedit-python-module.c:
* gedit/gedit-tab.c:
* gedit/gedit-window.c:
* gedit/gtksourceprintjob.c:
Take profit of G_PARAM_STATIC_STRINGS.
2008-01-23 Steve Frécinaux <code@istique.net>
* gedit/gedit-document.[ch]:
......
......@@ -102,11 +102,12 @@ gedit_app_class_init (GeditAppClass *klass)
g_object_class_install_property (object_class,
PROP_LOCKDOWN,
g_param_spec_flags ("lockdown",
"Lockdown",
"The lockdown mask",
GEDIT_TYPE_LOCKDOWN_MASK,
0,
G_PARAM_READABLE));
"Lockdown",
"The lockdown mask",
GEDIT_TYPE_LOCKDOWN_MASK,
0,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private (object_class, sizeof(GeditAppPrivate));
}
......
......@@ -146,7 +146,8 @@ gedit_document_loader_class_init (GeditDocumentLoaderClass *klass)
"The GeditDocument this GeditDocumentLoader is associated with",
GEDIT_TYPE_DOCUMENT,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_URI,
......@@ -164,7 +165,8 @@ gedit_document_loader_class_init (GeditDocumentLoaderClass *klass)
"The encoding of the saved file",
GEDIT_TYPE_ENCODING,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
signals[LOADING] =
g_signal_new ("loading",
......
......@@ -155,7 +155,8 @@ gedit_document_saver_class_init (GeditDocumentSaverClass *klass)
"The GeditDocument this GeditDocumentSaver is associated with",
GEDIT_TYPE_DOCUMENT,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_URI,
......@@ -164,7 +165,8 @@ gedit_document_saver_class_init (GeditDocumentSaverClass *klass)
"The URI this GeditDocumentSaver saves the document to",
"",
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_ENCODING,
......@@ -173,7 +175,8 @@ gedit_document_saver_class_init (GeditDocumentSaverClass *klass)
"The encoding of the saved file",
GEDIT_TYPE_ENCODING,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_FLAGS,
......
......@@ -404,47 +404,59 @@ gedit_document_class_init (GeditDocumentClass *klass)
g_object_class_install_property (object_class, PROP_URI,
g_param_spec_string ("uri",
"URI",
"The document's URI",
NULL,
G_PARAM_READABLE));
"URI",
"The document's URI",
NULL,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_SHORTNAME,
g_param_spec_string ("shortname",
"Short Name",
"The document's short name",
NULL,
G_PARAM_READABLE));
"Short Name",
"The document's short name",
NULL,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_MIME_TYPE,
g_param_spec_string ("mime-type",
"MIME Type",
"The document's MIME Type",
"text/plain",
G_PARAM_READABLE));
"MIME Type",
"The document's MIME Type",
"text/plain",
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_READ_ONLY,
g_param_spec_boolean ("read-only",
"Read Only",
"Whether the document is read only or not",
FALSE,
G_PARAM_READABLE));
"Read Only",
"Whether the document is read only or not",
FALSE,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_ENCODING,
g_param_spec_boxed ("encoding",
"Encoding",
"The GeditEncoding used for the document",
GEDIT_TYPE_ENCODING,
G_PARAM_READABLE));
"Encoding",
"The GeditEncoding used for the document",
GEDIT_TYPE_ENCODING,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_CAN_SEARCH_AGAIN,
g_param_spec_boolean ("can-search-again",
"Can search again",
"Wheter it's possible to search again in the document",
FALSE,
G_PARAM_READABLE));
"Can search again",
"Wheter it's possible to search again in the document",
FALSE,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class, PROP_ENABLE_SEARCH_HIGHLIGHTING,
g_param_spec_boolean ("enable-search-highlighting",
"Enable Search Highlighting",
"Whether all the occurences of the searched string must be highlighted",
FALSE,
G_PARAM_READWRITE));
"Enable Search Highlighting",
"Whether all the occurences of the searched string must be highlighted",
FALSE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
/* This signal is used to update the cursor position is the statusbar,
* it's emitted either when the insert mark is moved explicitely or
......
......@@ -465,7 +465,8 @@ gedit_documents_panel_class_init (GeditDocumentsPanelClass *klass)
"The GeditWindow this GeditDocumentsPanel is associated with",
GEDIT_TYPE_WINDOW,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private (object_class, sizeof(GeditDocumentsPanelPrivate));
}
......
......@@ -122,12 +122,13 @@ gedit_encodings_option_menu_class_init (GeditEncodingsOptionMenuClass *klass)
g_object_class_install_property (object_class,
PROP_SAVE_MODE,
g_param_spec_boolean ("save_mode",
g_param_spec_boolean ("save-mode",
("Save Mode"),
("Save Mode"),
FALSE,
(G_PARAM_READWRITE |
G_PARAM_CONSTRUCT)));
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private (object_class, sizeof(GeditEncodingsOptionMenuPrivate));
}
......
......@@ -158,7 +158,8 @@ gedit_history_entry_class_init (GeditHistoryEntryClass *klass)
"History ID",
"History ID",
NULL,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_HISTORY_LENGTH,
......@@ -168,7 +169,8 @@ gedit_history_entry_class_init (GeditHistoryEntryClass *klass)
0,
G_MAXUINT,
GEDIT_HISTORY_ENTRY_HISTORY_LENGTH_DEFAULT,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
/* TODO: Add enable-completion property */
......
......@@ -199,7 +199,10 @@ gedit_panel_class_init (GeditPanelClass *klass)
"The panel's orientation",
GTK_TYPE_ORIENTATION,
GTK_ORIENTATION_VERTICAL,
G_PARAM_WRITABLE | G_PARAM_READABLE | G_PARAM_CONSTRUCT_ONLY));
G_PARAM_WRITABLE |
G_PARAM_READABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
widget_class->grab_focus = gedit_panel_grab_focus;
......
......@@ -1091,11 +1091,11 @@ gedit_print_job_preview_class_init (GeditPrintJobPreviewClass *klass)
g_object_class_install_property (gobject_class, PROP_NX,
g_param_spec_ulong ("nx", _("Number of pages horizontally"),
_("Number of pages horizontally"), 1, 0xffff, 1,
G_PARAM_READWRITE));
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_NY,
g_param_spec_ulong ("ny", _("Number of pages vertically"),
_("Number of pages vertically"), 1, 0xffff, 1,
G_PARAM_READWRITE));
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_type_class_add_private(klass, sizeof(GeditPrintJobPreviewPrivate));
}
......
......@@ -123,7 +123,9 @@ gedit_progress_message_area_class_init (GeditProgressMessageAreaClass *klass)
"Has Cancel Button",
"If the message area has a cancel button",
TRUE,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private (gobject_class, sizeof(GeditProgressMessageAreaPrivate));
}
......
......@@ -222,8 +222,10 @@ gedit_python_module_class_init (GeditPythonModuleClass *class)
"Module Name",
"The Python module to load for this plugin",
NULL,
G_PARAM_WRITABLE | G_PARAM_READABLE | G_PARAM_CONSTRUCT_ONLY));
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property
(object_class,
PROP_PATH,
......@@ -231,7 +233,9 @@ gedit_python_module_class_init (GeditPythonModuleClass *class)
"Path",
"The Python path to use when loading this module",
NULL,
G_PARAM_WRITABLE | G_PARAM_READABLE | G_PARAM_CONSTRUCT_ONLY));
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private (object_class, sizeof (GeditPythonModulePrivate));
......
......@@ -264,7 +264,9 @@ gedit_tab_class_init (GeditTabClass *klass)
"Name",
"The tab's name",
NULL,
G_PARAM_READABLE));
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_STATE,
g_param_spec_enum ("state",
......@@ -272,26 +274,29 @@ gedit_tab_class_init (GeditTabClass *klass)
"The tab's state",
GEDIT_TYPE_TAB_STATE,
GEDIT_TAB_STATE_NORMAL,
G_PARAM_READABLE));
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_AUTO_SAVE,
g_param_spec_boolean ("autosave",
"Autosave",
"Autosave feature",
TRUE,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_AUTO_SAVE_INTERVAL,
g_param_spec_int ("autosave_interval",
g_param_spec_int ("autosave-interval",
"AutosaveInterval",
"Time between two autosaves",
0,
G_MAXINT,
0,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private (object_class, sizeof (GeditTabPrivate));
}
......
......@@ -364,8 +364,9 @@ gedit_window_class_init (GeditWindowClass *klass)
"The window's state",
GEDIT_TYPE_WINDOW_STATE,
GEDIT_WINDOW_STATE_NORMAL,
G_PARAM_READABLE));
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
g_type_class_add_private (object_class, sizeof(GeditWindowPrivate));
}
......
......@@ -265,14 +265,18 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
_("Configuration options for "
"the print job"),
GNOME_TYPE_PRINT_CONFIG,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_BUFFER,
g_param_spec_object ("buffer",
_("Source Buffer"),
_("GtkSourceBuffer object to print"),
GTK_TYPE_SOURCE_BUFFER,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_TABS_WIDTH,
g_param_spec_uint ("tabs_width",
......@@ -280,7 +284,9 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
_("Width in equivalent space "
"characters of tabs"),
0, 100, 8,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_WRAP_MODE,
g_param_spec_enum ("wrap_mode",
......@@ -288,7 +294,9 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
_("Word wrapping mode"),
GTK_TYPE_WRAP_MODE,
GTK_WRAP_NONE,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_HIGHLIGHT,
g_param_spec_boolean ("highlight",
......@@ -297,7 +305,9 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
"document with highlighted "
"syntax"),
TRUE,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_FONT,
g_param_spec_string ("font",
......@@ -305,7 +315,9 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
_("GnomeFont name to use for the "
"document text (deprecated)"),
NULL,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_FONT_DESC,
g_param_spec_boxed ("font_desc",
......@@ -313,7 +325,9 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
_("Font to use for the document text "
"(e.g. \"Monospace 10\")"),
PANGO_TYPE_FONT_DESCRIPTION,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_NUMBERS_FONT,
g_param_spec_string ("numbers_font",
......@@ -321,7 +335,9 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
_("GnomeFont name to use for the "
"line numbers (deprecated)"),
NULL,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_NUMBERS_FONT_DESC,
g_param_spec_boxed ("numbers_font_desc",
......@@ -329,7 +345,9 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
_("Font description to use for the "
"line numbers"),
PANGO_TYPE_FONT_DESCRIPTION,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_PRINT_NUMBERS,
g_param_spec_uint ("print_numbers",
......@@ -337,7 +355,9 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
_("Interval of printed line numbers "
"(0 means no numbers)"),
0, 100, 1,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_PRINT_HEADER,
g_param_spec_boolean ("print_header",
......@@ -345,7 +365,9 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
_("Whether to print a header "
"in each page"),
FALSE,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_PRINT_FOOTER,
g_param_spec_boolean ("print_footer",
......@@ -353,7 +375,9 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
_("Whether to print a footer "
"in each page"),
FALSE,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_HEADER_FOOTER_FONT,
g_param_spec_string ("header_footer_font",
......@@ -361,7 +385,9 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
_("GnomeFont name to use for the header "
"and footer (deprecated)"),
NULL,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_HEADER_FOOTER_FONT_DESC,
g_param_spec_boxed ("header_footer_font_desc",
......@@ -369,8 +395,9 @@ gtk_source_print_job_class_init (GtkSourcePrintJobClass *klass)
_("Font to use for headers and footers "
"(e.g. \"Monospace 10\")"),
PANGO_TYPE_FONT_DESCRIPTION,
G_PARAM_READWRITE));
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS));
print_job_signals [BEGIN_PAGE] =
g_signal_new ("begin_page",
G_OBJECT_CLASS_TYPE (object_class),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment