SF.net SVN: geany:[2821] branches/custom-tab-width
ntrel at users.sourceforge.net
ntrel at xxxxx
Fri Jul 25 15:05:28 UTC 2008
Revision: 2821
http://geany.svn.sourceforge.net/geany/?rev=2821&view=rev
Author: ntrel
Date: 2008-07-25 15:05:27 +0000 (Fri, 25 Jul 2008)
Log Message:
-----------
Note: this breaks the plugin API for indentation editor_prefs.
Add GeanyIndentPrefs struct from some GeanyEditorPrefs fields (maybe
this struct will get used elsewhere too).
Add editor_init().
Modified Paths:
--------------
branches/custom-tab-width/ChangeLog
branches/custom-tab-width/src/editor.c
branches/custom-tab-width/src/editor.h
branches/custom-tab-width/src/main.c
branches/custom-tab-width/src/plugindata.h
Modified: branches/custom-tab-width/ChangeLog
===================================================================
--- branches/custom-tab-width/ChangeLog 2008-07-25 14:59:16 UTC (rev 2820)
+++ branches/custom-tab-width/ChangeLog 2008-07-25 15:05:27 UTC (rev 2821)
@@ -1,5 +1,14 @@
2008-07-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+ * src/plugindata.h, src/main.c, src/editor.c, src/editor.h:
+ Note: this breaks the plugin API for indentation editor_prefs.
+ Add GeanyIndentPrefs struct from some GeanyEditorPrefs fields (maybe
+ this struct will get used elsewhere too).
+ Add editor_init().
+
+
+2008-07-25 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
* src/interface.c, src/ui_utils.c, geany.glade:
Revert editor popup menu Current Word submenu changes. See
http://lists.uvena.de/geany-devel/2008-July/000101.html.
Modified: branches/custom-tab-width/src/editor.c
===================================================================
--- branches/custom-tab-width/src/editor.c 2008-07-25 14:59:16 UTC (rev 2820)
+++ branches/custom-tab-width/src/editor.c 2008-07-25 15:05:27 UTC (rev 2821)
@@ -3662,3 +3662,13 @@
return editor;
}
+
+void editor_init(void)
+{
+ static GeanyIndentPrefs indent_prefs;
+
+ memset(&editor_prefs, 0, sizeof(GeanyEditorPrefs));
+ memset(&indent_prefs, 0, sizeof GeanyIndentPrefs);
+ editor_prefs->indentation = &indent_prefs;
+}
+
Modified: branches/custom-tab-width/src/editor.h
===================================================================
--- branches/custom-tab-width/src/editor.h 2008-07-25 14:59:16 UTC (rev 2820)
+++ branches/custom-tab-width/src/editor.h 2008-07-25 15:05:27 UTC (rev 2821)
@@ -51,14 +51,25 @@
INDENT_BASIC,
INDENT_CURRENTCHARS,
INDENT_MATCHBRACES
-} IndentMode;
+} GeanyIndentMode;
-/* These are the default prefs when creating a new editor window.
- * Some of these can be overridden per document.
- * Remember to increment abi_version in plugindata.h when changing items. */
+typedef struct GeanyIndentPrefs
+{
+ gint width; /**< Indent width. */
+ gint tab_width; /**< Width of a tab, if @c custom_tab_width is set. */
+ gboolean custom_tab_width; /**< Whether a tab is a different size from an indent. */
+ gboolean use_tabs; /**< Whether to (mainly) use tabs or spaces to indent. */
+ gboolean use_tab_to_indent; /* hidden pref */
+ GeanyIndentMode mode;
+}
+GeanyIndentPrefs;
+
+
+/** Default prefs when creating a new editor window.
+ * Some of these can be overridden per document. */
typedef struct GeanyEditorPrefs
{
- /* display */
+ GeanyIndentPrefs *indentation; /**< Indentation prefs. */
gboolean show_white_space;
gboolean show_indent_guide;
gboolean show_line_endings;
@@ -69,16 +80,10 @@
gboolean show_linenumber_margin; /* view menu */
gboolean show_scrollbars; /* hidden pref */
gboolean scroll_stop_at_last_line; /* hidden pref */
-
- /* behaviour */
gboolean line_wrapping;
gboolean use_indicators;
gboolean folding;
gboolean unfold_all_children;
- gint tab_width;
- gboolean use_tabs;
- gboolean use_tab_to_indent; /* hidden pref */
- IndentMode indent_mode;
gboolean disable_dnd;
gboolean smart_home_key;
gboolean newline_strip;
@@ -125,6 +130,8 @@
+void editor_init(void);
+
GeanyEditor *editor_create(GeanyDocument *doc);
void on_editor_notification(GtkWidget* editor, gint scn, gpointer lscn, gpointer user_data);
Modified: branches/custom-tab-width/src/main.c
===================================================================
--- branches/custom-tab-width/src/main.c 2008-07-25 14:59:16 UTC (rev 2820)
+++ branches/custom-tab-width/src/main.c 2008-07-25 15:05:27 UTC (rev 2821)
@@ -740,7 +740,6 @@
memset(&prefs, 0, sizeof(GeanyPrefs));
memset(&interface_prefs, 0, sizeof(GeanyInterfacePrefs));
memset(&toolbar_prefs, 0, sizeof(GeanyToolbarPrefs));
- memset(&editor_prefs, 0, sizeof(GeanyEditorPrefs));
memset(&file_prefs, 0, sizeof(GeanyFilePrefs));
memset(&search_prefs, 0, sizeof(GeanySearchPrefs));
memset(&tool_prefs, 0, sizeof(GeanyToolPrefs));
@@ -800,6 +799,7 @@
load_settings();
msgwin_init();
+ editor_init();
build_init();
search_init();
ui_create_insert_menu_items();
Modified: branches/custom-tab-width/src/plugindata.h
===================================================================
--- branches/custom-tab-width/src/plugindata.h 2008-07-25 14:59:16 UTC (rev 2820)
+++ branches/custom-tab-width/src/plugindata.h 2008-07-25 15:05:27 UTC (rev 2821)
@@ -36,12 +36,12 @@
/* The API version should be incremented whenever any plugin data types below are
* modified or appended to. */
-static const gint api_version = 82;
+static const gint api_version = 83;
/* The ABI version should be incremented whenever existing fields in the plugin
* data types below have to be changed or reordered. It should stay the same if fields
* are only appended, as this doesn't affect existing fields. */
-static const gint abi_version = 43;
+static const gint abi_version = 44;
/** Check the plugin can be loaded by Geany.
* This performs runtime checks that try to ensure:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list