Revision: 2813
http://geany.svn.sourceforge.net/geany/?rev=2813&view=rev
Author: ntrel
Date: 2008-07-24 17:26:11 +0000 (Thu, 24 Jul 2008)
Log Message:
-----------
Change VTE restart command to not call vte_terminal_fork_command() -
this should prevent the hang reported in #1990323 with VTE 0.16.14.
Note that with VTE 0.16.14 the reset sometimes leaves a blank
terminal, but pressing enter makes it then behave as normal.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/vte.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-07-24 15:17:55 UTC (rev 2812)
+++ trunk/ChangeLog 2008-07-24 17:26:11 UTC (rev 2813)
@@ -17,6 +17,11 @@
Add more dox explaining how to use documents_array (moved from
document.h, to minimise rebuilding after adding dox).
Remove some mentions of document indexes in document.c comments.
+ * src/vte.c:
+ Change VTE restart command to not call vte_terminal_fork_command() -
+ this should prevent the hang reported in #1990323 with VTE 0.16.14.
+ Note that with VTE 0.16.14 the reset sometimes leaves a blank
+ terminal, but pressing enter makes it then behave as normal.
2008-07-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/vte.c
===================================================================
--- trunk/src/vte.c 2008-07-24 15:17:55 UTC (rev 2812)
+++ trunk/src/vte.c 2008-07-24 17:26:11 UTC (rev 2813)
@@ -393,7 +393,6 @@
pid = 0;
}
vf->vte_terminal_reset(VTE_TERMINAL(widget), TRUE, TRUE);
- vte_start(widget);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2812
http://geany.svn.sourceforge.net/geany/?rev=2812&view=rev
Author: ntrel
Date: 2008-07-24 15:17:55 +0000 (Thu, 24 Jul 2008)
Log Message:
-----------
Add more dox explaining how to use documents_array (moved from
document.h, to minimise rebuilding after adding dox).
Remove some mentions of document indexes in document.c comments.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/document.c
trunk/src/document.h
trunk/src/plugindata.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-07-24 14:37:36 UTC (rev 2811)
+++ trunk/ChangeLog 2008-07-24 15:17:55 UTC (rev 2812)
@@ -13,6 +13,10 @@
Add dox for GeanyApp, GeanyProject.
Move GeanyProject typedef to project.h, as it is rarely used without
including project.h.
+ * src/plugindata.h, src/document.c, src/document.h:
+ Add more dox explaining how to use documents_array (moved from
+ document.h, to minimise rebuilding after adding dox).
+ Remove some mentions of document indexes in document.c comments.
2008-07-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c 2008-07-24 14:37:36 UTC (rev 2811)
+++ trunk/src/document.c 2008-07-24 15:17:55 UTC (rev 2812)
@@ -74,6 +74,16 @@
GeanyFilePrefs file_prefs;
+/** Dynamic array of GeanyDocument pointers holding information about the notebook tabs.
+ * Once a pointer is added to this, it is never freed. This means you can keep a pointer
+ * to a document over time, but it might no longer represent a notebook tab. To check this,
+ * check @c doc_ptr->is_valid. Of course, the pointer may represent a different
+ * file by then.
+ *
+ * You also need to check @c GeanyDocument::is_valid when iterating over this array.
+ *
+ * Never assume that the order of document pointers is the same as the order of notebook tabs.
+ * Notebook tabs can be reordered. Use @c document_get_from_page(). */
GPtrArray *documents_array;
@@ -99,7 +109,7 @@
#endif
/**
- * Find and retrieve the index of the given filename in the %document list.
+ * Find and retrieve a document with the given filename from the document list.
*
* @param realname The filename to search, which should be identical to the
* string returned by @c tm_get_real_path().
@@ -142,7 +152,7 @@
/**
- * Find and retrieve the index of the given filename in the %document list.
+ * Find and retrieve a document with the given filename from the document list.
* This matches either an exact GeanyDocument::file_name string, or variant
* filenames with relative elements in the path (e.g. @c "/dir/..//name" will
* match @c "/name").
@@ -199,7 +209,7 @@
}
-/* returns the index of the notebook page from the document index */
+/* returns the index of the notebook page for the document. */
gint document_get_notebook_page(GeanyDocument *doc)
{
if (doc == NULL)
@@ -211,7 +221,7 @@
/**
- * Find and retrieve the index of the given notebook page @a page_num in the %document list.
+ * Find and retrieve the document for the given notebook page @a page_num.
*
* @param page_num The notebook page number to search.
*
@@ -381,7 +391,7 @@
/* Creates a new document and editor, adding a tab in the notebook.
- * @return The index of the created document */
+ * @return The created document */
static GeanyDocument *document_create(const gchar *utf8_filename)
{
GeanyDocument *this;
Modified: trunk/src/document.h
===================================================================
--- trunk/src/document.h 2008-07-24 14:37:36 UTC (rev 2811)
+++ trunk/src/document.h 2008-07-24 15:17:55 UTC (rev 2812)
@@ -107,10 +107,9 @@
gchar *real_path;
};
-
-/** Dynamic array of GeanyDocument pointers holding information about the notebook tabs. */
extern GPtrArray *documents_array;
+
/**
* This wraps documents_array so it can be used with C array syntax.
* Example: documents[0]->sci = NULL;
Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h 2008-07-24 14:37:36 UTC (rev 2811)
+++ trunk/src/plugindata.h 2008-07-24 15:17:55 UTC (rev 2812)
@@ -154,7 +154,7 @@
{
struct GeanyApp *app; /**< Geany application data fields */
struct GeanyMainWidgets *main_widgets; /**< Important widgets in the main window */
- GPtrArray *documents_array; /**< Dynamic array of GeanyDocument pointers */
+ GPtrArray *documents_array; /**< See document.h#documents_array. */
GPtrArray *filetypes_array; /**< Dynamic array of GeanyFiletype pointers */
struct GeanyPrefs *prefs; /**< General settings */
struct GeanyInterfacePrefs *interface_prefs; /**< Interface settings */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2811
http://geany.svn.sourceforge.net/geany/?rev=2811&view=rev
Author: ntrel
Date: 2008-07-24 14:37:36 +0000 (Thu, 24 Jul 2008)
Log Message:
-----------
Add dox for GeanyApp, GeanyProject.
Move GeanyProject typedef to project.h, as it is rarely used without
including project.h.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/geany.h
trunk/src/project.c
trunk/src/project.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-07-24 12:12:47 UTC (rev 2810)
+++ trunk/ChangeLog 2008-07-24 14:37:36 UTC (rev 2811)
@@ -9,6 +9,10 @@
Add dox for all UIUtilsFuncs.
* src/plugindata.h, src/document.c:
Rename document_new_file() argument to utf8_filename.
+ * src/project.c, src/project.h, src/geany.h:
+ Add dox for GeanyApp, GeanyProject.
+ Move GeanyProject typedef to project.h, as it is rarely used without
+ including project.h.
2008-07-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/geany.h
===================================================================
--- trunk/src/geany.h 2008-07-24 12:12:47 UTC (rev 2810)
+++ trunk/src/geany.h 2008-07-24 14:37:36 UTC (rev 2811)
@@ -54,21 +54,24 @@
#define GEANY_WINDOW_DEFAULT_HEIGHT 600
-/* useful forward declarations */
+/* Common forward declarations */
typedef struct GeanyDocument GeanyDocument;
typedef struct GeanyFiletype GeanyFiletype;
-typedef struct GeanyProject GeanyProject;
-/* Important commonly-used items. */
+/** Important application fields. */
typedef struct GeanyApp
{
- gboolean debug_mode;
+ gboolean debug_mode; /**< @c TRUE if debug messages should be printed. */
+ /** User configuration directory, usually @c ~/.geany.
+ * @note Plugin configuration files should be saved as:
+ * @code g_build_path(G_DIR_SEPARATOR_S, geany->app->configdir, "plugins", "pluginname",
+ * "file.conf"); @endcode */
gchar *configdir;
gchar *datadir;
gchar *docdir;
- const TMWorkspace *tm_workspace;
- GeanyProject *project; /* currently active project or NULL if none is open */
+ const TMWorkspace *tm_workspace; /**< TagManager workspace/session tags. */
+ struct GeanyProject *project; /**< Currently active project or @c NULL if none is open. */
}
GeanyApp;
Modified: trunk/src/project.c
===================================================================
--- trunk/src/project.c 2008-07-24 12:12:47 UTC (rev 2810)
+++ trunk/src/project.c 2008-07-24 14:37:36 UTC (rev 2811)
@@ -21,7 +21,7 @@
* $Id$
*/
-/*
+/** @file project.h
* Project Management.
*/
Modified: trunk/src/project.h
===================================================================
--- trunk/src/project.h 2008-07-24 12:12:47 UTC (rev 2810)
+++ trunk/src/project.h 2008-07-24 14:37:36 UTC (rev 2811)
@@ -28,27 +28,24 @@
#define GEANY_PROJECT_EXT "geany"
-/* structure for representing a project. */
-struct GeanyProject
+/** Structure for representing a project. */
+typedef struct GeanyProject
{
- gchar *name; /* the name of the project */
- gchar *description; /* short description of the project */
-
- gchar *file_name; /* where the project file is stored (in UTF-8) */
-
- gchar *base_path; /* base path of the project directory (in UTF-8, maybe relative) */
- gchar *run_cmd; /* project run command (in UTF-8) */
- /* ... */ /* fields for build process(run arguments and so on) should be added */
-
- gint type; /* identifier whether it is a pure Geany project or modified/extended */
- /* by a plugin */
-
- gchar **file_patterns; /* array of filename extension patterns */
-
+ gchar *name; /**< The name of the project. */
+ gchar *description; /**< Short description of the project. */
+ gchar *file_name; /**< Where the project file is stored (in UTF-8). */
+ gchar *base_path; /**< Base path of the project directory (in UTF-8, maybe relative). */
+ gchar *run_cmd; /**< Project run command (in UTF-8). */
+ /** Identifier whether it is a pure Geany project or modified/extended
+ * by a plugin. */
+ gint type;
+ gchar **file_patterns; /**< Array of filename extension patterns. */
gboolean make_in_base_path;
-};
+}
+GeanyProject;
-typedef struct
+
+typedef struct ProjectPrefs
{
gchar *session_file;
gboolean project_session;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2810
http://geany.svn.sourceforge.net/geany/?rev=2810&view=rev
Author: ntrel
Date: 2008-07-24 12:12:47 +0000 (Thu, 24 Jul 2008)
Log Message:
-----------
Rename document_new_file() argument to utf8_filename.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/document.c
trunk/src/plugindata.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-07-24 12:01:30 UTC (rev 2809)
+++ trunk/ChangeLog 2008-07-24 12:12:47 UTC (rev 2810)
@@ -7,6 +7,8 @@
the plugin API.
* src/ui_utils.c:
Add dox for all UIUtilsFuncs.
+ * src/plugindata.h, src/document.c:
+ Rename document_new_file() argument to utf8_filename.
2008-07-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c 2008-07-24 12:01:30 UTC (rev 2809)
+++ trunk/src/document.c 2008-07-24 12:12:47 UTC (rev 2810)
@@ -533,18 +533,19 @@
/**
- * Creates a new %document.
+ * Creates a new document.
* After all, the "document-new" signal is emitted for plugins.
*
- * @param filename The file name in UTF-8 encoding, or @c NULL to open a file as "untitled".
+ * @param utf8_filename The file name in UTF-8 encoding, or @c NULL to open a file as "untitled".
* @param ft The filetype to set or @c NULL to detect it from @a filename if not @c NULL.
* @param text The initial content of the file (in UTF-8 encoding), or @c NULL.
*
* @return The new document.
**/
-GeanyDocument *document_new_file(const gchar *filename, GeanyFiletype *ft, const gchar *text)
+GeanyDocument *document_new_file(const gchar *utf8_filename, GeanyFiletype *ft,
+ const gchar *text)
{
- GeanyDocument *doc = document_create(filename);
+ GeanyDocument *doc = document_create(utf8_filename);
g_assert(doc != NULL);
@@ -571,7 +572,7 @@
store_saved_encoding(doc);
/*document_set_filetype(idx, (ft == NULL) ? filetypes[GEANY_FILETYPES_NONE] : ft);*/
- if (ft == NULL && filename != NULL) /* guess the filetype from the filename if one is given */
+ if (ft == NULL && utf8_filename != NULL) /* guess the filetype from the filename if one is given */
ft = filetypes_detect_from_document(doc);
document_set_filetype(doc, ft); /* also clears taglist */
Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h 2008-07-24 12:01:30 UTC (rev 2809)
+++ trunk/src/plugindata.h 2008-07-24 12:12:47 UTC (rev 2810)
@@ -202,7 +202,7 @@
/* See document.h */
typedef struct DocumentFuncs
{
- struct GeanyDocument* (*new_file) (const gchar *filename, struct GeanyFiletype *ft,
+ struct GeanyDocument* (*new_file) (const gchar *utf8_filename, struct GeanyFiletype *ft,
const gchar *text);
struct GeanyDocument* (*get_current) (void);
struct GeanyDocument* (*get_from_page) (guint page_num);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2809
http://geany.svn.sourceforge.net/geany/?rev=2809&view=rev
Author: ntrel
Date: 2008-07-24 12:01:30 +0000 (Thu, 24 Jul 2008)
Log Message:
-----------
Add dox for all UIUtilsFuncs.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/ui_utils.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-07-24 11:23:12 UTC (rev 2808)
+++ trunk/ChangeLog 2008-07-24 12:01:30 UTC (rev 2809)
@@ -5,6 +5,8 @@
* src/plugindata.h:
Rename p_filetypes->detect_from_filename() to detect_from_file() in
the plugin API.
+ * src/ui_utils.c:
+ Add dox for all UIUtilsFuncs.
2008-07-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/ui_utils.c
===================================================================
--- trunk/src/ui_utils.c 2008-07-24 11:23:12 UTC (rev 2808)
+++ trunk/src/ui_utils.c 2008-07-24 12:01:30 UTC (rev 2809)
@@ -106,8 +106,9 @@
}
-/* Display text on the statusbar.
- * log is whether the message should be recorded in the Status window. */
+/** Display text on the statusbar.
+ * @param log Whether the message should be recorded in the Status window.
+ * @param format A @c printf -style string. */
void ui_set_statusbar(gboolean log, const gchar *format, ...)
{
gchar string[512];
@@ -1079,8 +1080,10 @@
}
-/* Creates a GNOME HIG style frame (with no border and indented child alignment).
- * Returns the frame widget, setting the alignment container for packing child widgets */
+/** Creates a GNOME HIG-style frame (with no border and indented child alignment).
+ * @param label_text The label text.
+ * @param alignment An address to store the alignment widget pointer.
+ * @return The frame widget, setting the alignment container for packing child widgets. */
GtkWidget *ui_frame_new_with_alignment(const gchar *label_text, GtkWidget **alignment)
{
GtkWidget *label, *align;
@@ -1106,10 +1109,10 @@
const gint BUTTON_BOX_BORDER = 5;
-/* Convenience function for getting a fixed border for dialogs that doesn't
+/** Convenience function for getting a fixed border for dialogs that doesn't
* increase the button box border.
- * dialog is the parent container for the vbox.
- * Returns: the vbox. */
+ * @param dialog The parent container for the @c GtkVBox.
+ * @return The packed @c GtkVBox. */
GtkWidget *ui_dialog_vbox_new(GtkDialog *dialog)
{
GtkWidget *vbox = gtk_vbox_new(FALSE, 12); /* need child vbox to set a separate border. */
@@ -1120,8 +1123,12 @@
}
-/* Create a GtkButton with custom text and a stock image, aligned like
- * gtk_button_new_from_stock */
+/** Create a @c GtkButton with custom text and a stock image, aligned like
+ * @c gtk_button_new_from_stock().
+ * @param stock_id A @c GTK_STOCK_NAME string.
+ * @param text Button label text, can include mnemonics.
+ * @return The new @c GtkButton.
+ */
GtkWidget *ui_button_new_with_image(const gchar *stock_id, const gchar *text)
{
GtkWidget *image, *label, *align, *hbox, *button;
@@ -1301,10 +1308,17 @@
}
-/* Creates a GtkHBox with entry packed into it and an open button which runs a
- * file chooser, replacing entry text if successful.
- * entry can be the child of an unparented widget, such as GtkComboBoxEntry.
- * See ui_setup_open_button_callback() for details. */
+/** Creates a @c GtkHBox with @a entry packed into it and an open button which runs a
+ * file chooser, replacing entry text (if successful) with the path returned from the
+ * @c GtkFileChooser.
+ * @note @a entry can be the child of an unparented widget, such as @c GtkComboBoxEntry.
+ * @param title The file chooser dialog title, or @c NULL.
+ * @param action The mode of the file chooser.
+ * @param entry Can be an unpacked @c GtkEntry, or the child of an unpacked widget,
+ * such as @c GtkComboBoxEntry.
+ * @return The @c GtkHBox.
+ */
+/* @see ui_setup_open_button_callback(). */
GtkWidget *ui_path_box_new(const gchar *title, GtkFileChooserAction action, GtkEntry *entry)
{
GtkWidget *vbox, *dirbtn, *openimg, *hbox, *path_entry;
@@ -1434,9 +1448,12 @@
}
-/* Pack all GtkWidgets passed after the row argument into a table, using
- * one widget per cell. The first widget is not expanded, as this is usually
- * a label. */
+/** Pack all @c GtkWidgets passed after the row argument into a table, using
+ * one widget per cell. The first widget is not expanded as the table grows,
+ * as this is usually a label.
+ * @param table
+ * @param row The row number of the table.
+ */
void ui_table_add_row(GtkTable *table, gint row, ...)
{
va_list args;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2808
http://geany.svn.sourceforge.net/geany/?rev=2808&view=rev
Author: ntrel
Date: 2008-07-24 11:23:12 +0000 (Thu, 24 Jul 2008)
Log Message:
-----------
Rename p_filetypes->detect_from_filename() to detect_from_file() in
the plugin API.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/plugindata.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-07-24 11:20:48 UTC (rev 2807)
+++ trunk/ChangeLog 2008-07-24 11:23:12 UTC (rev 2808)
@@ -2,6 +2,9 @@
* src/filetypes.c:
Only compile filetypes_detect_from_file() if HAVE_PLUGINS is defined.
+ * src/plugindata.h:
+ Rename p_filetypes->detect_from_filename() to detect_from_file() in
+ the plugin API.
2008-07-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h 2008-07-24 11:20:48 UTC (rev 2807)
+++ trunk/src/plugindata.h 2008-07-24 11:23:12 UTC (rev 2808)
@@ -36,7 +36,7 @@
/* The API version should be incremented whenever any plugin data types below are
* modified or appended to. */
-static const gint api_version = 81;
+static const gint api_version = 82;
/* 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
@@ -397,7 +397,7 @@
/* See filetypes.h */
typedef struct FiletypeFuncs
{
- GeanyFiletype* (*detect_from_filename) (const gchar *utf8_filename);
+ GeanyFiletype* (*detect_from_file) (const gchar *utf8_filename);
GeanyFiletype* (*lookup_by_name) (const gchar *name);
}
FiletypeFuncs;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2807
http://geany.svn.sourceforge.net/geany/?rev=2807&view=rev
Author: ntrel
Date: 2008-07-24 11:20:48 +0000 (Thu, 24 Jul 2008)
Log Message:
-----------
Only compile filetypes_detect_from_file() if HAVE_PLUGINS is defined.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/filetypes.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-07-23 14:52:19 UTC (rev 2806)
+++ trunk/ChangeLog 2008-07-24 11:20:48 UTC (rev 2807)
@@ -1,3 +1,9 @@
+2008-07-24 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/filetypes.c:
+ Only compile filetypes_detect_from_file() if HAVE_PLUGINS is defined.
+
+
2008-07-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/utils.c, src/utils.h, src/plugindata.h, src/callbacks.c,
Modified: trunk/src/filetypes.c
===================================================================
--- trunk/src/filetypes.c 2008-07-23 14:52:19 UTC (rev 2806)
+++ trunk/src/filetypes.c 2008-07-24 11:20:48 UTC (rev 2807)
@@ -683,8 +683,9 @@
}
+#ifdef HAVE_PLUGINS
+/* Currently only used by external plugins (e.g. geanyprj). */
/** Detect filetype based on a shebang line in the file, or the filename extension. */
-/* Currently only used by external plugins. */
GeanyFiletype *filetypes_detect_from_file(const gchar *utf8_filename)
{
gchar line[1024];
@@ -704,6 +705,7 @@
}
return filetypes_detect_from_extension(utf8_filename);
}
+#endif
void filetypes_select_radio_item(const GeanyFiletype *ft)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2806
http://geany.svn.sourceforge.net/geany/?rev=2806&view=rev
Author: ntrel
Date: 2008-07-23 14:52:19 +0000 (Wed, 23 Jul 2008)
Log Message:
-----------
Add dox for GeanyMainWidgets.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/ui_utils.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-07-23 14:44:27 UTC (rev 2805)
+++ trunk/ChangeLog 2008-07-23 14:52:19 UTC (rev 2806)
@@ -14,6 +14,8 @@
filetypes_detect_from_file() because it also detects shebang lines.
Remove function prototype comments for filetypes.h (see filetypes.c
or API dox instead).
+ * src/ui_utils.c:
+ Add dox for GeanyMainWidgets.
2008-07-22 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/ui_utils.c
===================================================================
--- trunk/src/ui_utils.c 2008-07-23 14:44:27 UTC (rev 2805)
+++ trunk/src/ui_utils.c 2008-07-23 14:52:19 UTC (rev 2806)
@@ -21,7 +21,7 @@
* $Id$
*/
-/*
+/** @file ui_utils.h
* User Interface general utility functions.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2805
http://geany.svn.sourceforge.net/geany/?rev=2805&view=rev
Author: ntrel
Date: 2008-07-23 14:44:27 +0000 (Wed, 23 Jul 2008)
Log Message:
-----------
Add dox for FiletypeFuncs and some of GeanyFiletype.
Rename filetypes_detect_from_file() to
filetypes_detect_from_document().
Rename filetypes_detect_from_filename() to
filetypes_detect_from_file() because it also detects shebang lines.
Remove function prototype comments for filetypes.h (see filetypes.c
or API dox instead).
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/document.c
trunk/src/filetypes.c
trunk/src/filetypes.h
trunk/src/plugindata.h
trunk/src/plugins.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-07-23 13:48:13 UTC (rev 2804)
+++ trunk/ChangeLog 2008-07-23 14:44:27 UTC (rev 2805)
@@ -5,6 +5,15 @@
Move utils_reload_configuration() to main.c.
* src/main.c:
Add doxygen file header for generating MainFuncs API documentation.
+ * src/plugindata.h, src/filetypes.c, src/filetypes.h, src/document.c,
+ src/plugins.c:
+ Add dox for FiletypeFuncs and some of GeanyFiletype.
+ Rename filetypes_detect_from_file() to
+ filetypes_detect_from_document().
+ Rename filetypes_detect_from_filename() to
+ filetypes_detect_from_file() because it also detects shebang lines.
+ Remove function prototype comments for filetypes.h (see filetypes.c
+ or API dox instead).
2008-07-22 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c 2008-07-23 13:48:13 UTC (rev 2804)
+++ trunk/src/document.c 2008-07-23 14:44:27 UTC (rev 2805)
@@ -572,7 +572,7 @@
/*document_set_filetype(idx, (ft == NULL) ? filetypes[GEANY_FILETYPES_NONE] : ft);*/
if (ft == NULL && filename != NULL) /* guess the filetype from the filename if one is given */
- ft = filetypes_detect_from_file(doc);
+ ft = filetypes_detect_from_document(doc);
document_set_filetype(doc, ft); /* also clears taglist */
if (ft == NULL)
@@ -1037,7 +1037,7 @@
/* "the" SCI signal (connect after initial setup(i.e. adding text)) */
g_signal_connect(doc->editor->sci, "sci-notify", G_CALLBACK(on_editor_notification), doc);
- use_ft = (ft != NULL) ? ft : filetypes_detect_from_file(doc);
+ use_ft = (ft != NULL) ? ft : filetypes_detect_from_document(doc);
}
else
{ /* reloading */
@@ -1260,7 +1260,7 @@
/* detect filetype */
if (FILETYPE_ID(doc->file_type) == GEANY_FILETYPES_NONE)
{
- GeanyFiletype *ft = filetypes_detect_from_file(doc);
+ GeanyFiletype *ft = filetypes_detect_from_document(doc);
document_set_filetype(doc, ft);
if (document_get_current() == doc)
Modified: trunk/src/filetypes.c
===================================================================
--- trunk/src/filetypes.c 2008-07-23 13:48:13 UTC (rev 2804)
+++ trunk/src/filetypes.c 2008-07-23 14:44:27 UTC (rev 2805)
@@ -21,7 +21,8 @@
* $Id$
*/
-/*
+/**
+ * @file filetypes.h
* Filetype detection, file extensions and filetype menu items.
*/
@@ -666,8 +667,8 @@
}
-/* Detect the filetype for document idx. */
-GeanyFiletype *filetypes_detect_from_file(GeanyDocument *doc)
+/* Detect the filetype for the document, checking for a shebang, then filename extension. */
+GeanyFiletype *filetypes_detect_from_document(GeanyDocument *doc)
{
GeanyFiletype *ft;
gchar *line;
@@ -682,9 +683,9 @@
}
-/* Detect filetype based on the filename extension.
- * utf8_filename can include the full path. */
-GeanyFiletype *filetypes_detect_from_filename(const gchar *utf8_filename)
+/** Detect filetype based on a shebang line in the file, or the filename extension. */
+/* Currently only used by external plugins. */
+GeanyFiletype *filetypes_detect_from_file(const gchar *utf8_filename)
{
gchar line[1024];
FILE *f;
Modified: trunk/src/filetypes.h
===================================================================
--- trunk/src/filetypes.h 2008-07-23 13:48:13 UTC (rev 2804)
+++ trunk/src/filetypes.h 2008-07-23 14:44:27 UTC (rev 2805)
@@ -29,7 +29,9 @@
#include "ScintillaWidget.h"
-/* each group should be alpha-sorted, based on filetype::name (not enum name) */
+/* Each group should be alpha-sorted, based on filetype::name (not enum name).
+ * Warning: remember to break the plugin ABI when adding items (this enum needs to be changed
+ * to work with an ABI-stable filetype::group_name field. */
typedef enum
{
/* normally compiled languages */
@@ -103,15 +105,17 @@
gboolean modified;
};
+/** Represents a filetype. */
struct GeanyFiletype
{
- filetype_id id;
- langType lang; /* represents the langType of tagmanager(see the table */
- /* in tagmanager/parsers.h), -1 represents all, -2 none */
- gchar *name; /* will be used as name for tagmanager */
- gchar *title; /* will be shown in the file open dialog */
- gchar *extension;
- gchar **pattern;
+ filetype_id id; /**< Index in @c filetypes_array. */
+ /** Represents the langType of tagmanager (see the table
+ * in tagmanager/parsers.h), -1 represents all, -2 none. */
+ langType lang;
+ gchar *name; /**< Used as name for tagmanager. E.g. "C". */
+ gchar *title; /**< Shown in the file open dialog. E.g. "C source file". */
+ gchar *extension; /**< Default file extension for new files. */
+ gchar **pattern; /**< Array of filename-matching wildcard strings. */
gchar *context_action_cmd;
gchar *comment_open;
gchar *comment_close;
@@ -130,22 +134,16 @@
GeanyFiletype *filetypes_lookup_by_name(const gchar *name);
-/* Calls filetypes_init_types() and creates the filetype menu. */
void filetypes_init(void);
-/* Create the filetype array and fill it with the known filetypes. */
void filetypes_init_types(void);
-/* Detect the filetype for document idx, checking for a shebang, then filename extension. */
-GeanyFiletype *filetypes_detect_from_file(GeanyDocument *doc);
+GeanyFiletype *filetypes_detect_from_document(GeanyDocument *doc);
GeanyFiletype *filetypes_detect_from_extension(const gchar *utf8_filename);
-/* Detect filetype based on the filename extension.
- * utf8_filename can include the full path. */
-GeanyFiletype *filetypes_detect_from_filename(const gchar *utf8_filename);
+GeanyFiletype *filetypes_detect_from_file(const gchar *utf8_filename);
-/* frees the array and all related pointers */
void filetypes_free_types(void);
void filetypes_load_config(gint ft_id, gboolean reload);
Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h 2008-07-23 13:48:13 UTC (rev 2804)
+++ trunk/src/plugindata.h 2008-07-23 14:44:27 UTC (rev 2805)
@@ -36,7 +36,7 @@
/* The API version should be incremented whenever any plugin data types below are
* modified or appended to. */
-static const gint api_version = 80;
+static const gint api_version = 81;
/* 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
Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c 2008-07-23 13:48:13 UTC (rev 2804)
+++ trunk/src/plugins.c 2008-07-23 14:44:27 UTC (rev 2805)
@@ -231,7 +231,7 @@
static FiletypeFuncs filetype_funcs = {
- &filetypes_detect_from_filename,
+ &filetypes_detect_from_file,
&filetypes_lookup_by_name
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.