SF.net SVN: geany:[2901] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Mon Aug 25 15:44:53 UTC 2008


Revision: 2901
          http://geany.svn.sourceforge.net/geany/?rev=2901&view=rev
Author:   ntrel
Date:     2008-08-25 15:44:51 +0000 (Mon, 25 Aug 2008)

Log Message:
-----------
Add editor_destroy() to dispose of a GeanyEditor struct (in future
we may want to do more than just free it).
Fix editor.h dox description to be more informative for the API
(and move dox from editor.h to editor.c).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/document.c
    trunk/src/editor.c
    trunk/src/editor.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-19 14:55:56 UTC (rev 2900)
+++ trunk/ChangeLog	2008-08-25 15:44:51 UTC (rev 2901)
@@ -1,3 +1,12 @@
+2008-08-25  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/document.c, src/editor.c, src/editor.h:
+   Add editor_destroy() to dispose of a GeanyEditor struct (in future
+   we may want to do more than just free it).
+   Fix editor.h dox description to be more informative for the API
+   (and move dox from editor.h to editor.c).
+
+
 2008-08-19  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/editor.c:

Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c	2008-08-19 14:55:56 UTC (rev 2900)
+++ trunk/src/document.c	2008-08-25 15:44:51 UTC (rev 2901)
@@ -495,7 +495,7 @@
 		g_free(doc->real_path);
 		tm_workspace_remove_object(doc->tm_file, TRUE, TRUE);
 
-		g_free(doc->editor);
+		editor_destroy(doc->editor);
 		doc->editor = NULL;
 
 		doc->is_valid = FALSE;

Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c	2008-08-19 14:55:56 UTC (rev 2900)
+++ trunk/src/editor.c	2008-08-25 15:44:51 UTC (rev 2901)
@@ -21,13 +21,20 @@
  * $Id$
  */
 
-/*
- * Callbacks for the Scintilla widget (ScintillaObject).
+/**
+ * @file editor.h
+ * Editor-related functions for @ref GeanyEditor.
+ * Geany uses the Scintilla editing widget, and this file is mostly built around
+ * Scintilla's functionality.
+ * @see sciwrappers.h.
+ */
+/* Callbacks for the Scintilla widget (ScintillaObject).
  * Most important is the sci-notify callback, handled in on_editor_notification().
  * This includes auto-indentation, comments, auto-completion, calltips, etc.
  * Also some general Scintilla-related functions.
  */
 
+
 #include <ctype.h>
 #include <string.h>
 
@@ -3805,6 +3812,13 @@
 }
 
 
+/* in case we need to free some fields in future */
+void editor_destroy(GeanyEditor *editor)
+{
+	g_free(editor);
+}
+
+
 void editor_init(void)
 {
 	static GeanyIndentPrefs indent_prefs;

Modified: trunk/src/editor.h
===================================================================
--- trunk/src/editor.h	2008-08-19 14:55:56 UTC (rev 2900)
+++ trunk/src/editor.h	2008-08-25 15:44:51 UTC (rev 2901)
@@ -21,15 +21,7 @@
  * $Id$
  */
 
-/**
- *  @file editor.h
- *  Callbacks for the Scintilla widget (ScintillaObject).
- *  Most important is the sci-notify callback, handled in on_editor_notification().
- *  This includes auto-indentation, comments, auto-completion, calltips, etc.
- *  Also some general Scintilla-related functions.
- **/
 
-
 #ifndef GEANY_SCI_CB_H
 #define GEANY_SCI_CB_H 1
 
@@ -149,6 +141,8 @@
 
 GeanyEditor *editor_create(GeanyDocument *doc);
 
+void editor_destroy(GeanyEditor *editor);
+
 void on_editor_notification(GtkWidget* editor, gint scn, gpointer lscn, gpointer user_data);
 
 gboolean editor_start_auto_complete(GeanyDocument *doc, gint pos, gboolean force);


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