SF.net SVN: geany: [2594] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Fri May 16 14:17:56 UTC 2008


Revision: 2594
          http://geany.svn.sourceforge.net/geany/?rev=2594&view=rev
Author:   eht16
Date:     2008-05-16 07:17:54 -0700 (Fri, 16 May 2008)

Log Message:
-----------
Rename document struct to GeanyDocument.
Rename filetype struct to GeanyFiletype.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/plugins/pluginmacros.h
    trunk/plugins/vcdiff.c
    trunk/src/build.c
    trunk/src/callbacks.c
    trunk/src/dialogs.c
    trunk/src/document.c
    trunk/src/document.h
    trunk/src/editor.c
    trunk/src/filetypes.c
    trunk/src/filetypes.h
    trunk/src/geany.h
    trunk/src/keybindings.c
    trunk/src/keyfile.c
    trunk/src/msgwindow.c
    trunk/src/notebook.c
    trunk/src/plugindata.h
    trunk/src/printing.c
    trunk/src/symbols.c
    trunk/src/templates.c
    trunk/src/templates.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/ChangeLog	2008-05-16 14:17:54 UTC (rev 2594)
@@ -1,3 +1,15 @@
+2008-05-16  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * plugins/pluginmacros.h, plugins/vcdiff.c, src/build.c,
+   src/callbacks.c, src/dialogs.c, src/document.c, src/document.h,
+   src/editor.c, src/filetypes.c, src/filetypes.h, src/geany.h,
+   src/keybindings.c, src/keyfile.c, src/main.c, src/msgwindow.c,
+   src/notebook.c, src/plugindata.h, src/printing.c, src/symbols.c,
+   src/templates.c, src/templates.h:
+   Rename document struct to GeanyDocument.
+   Rename filetype struct to GeanyFiletype.
+
+
 2008-05-16  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/templates.c, src/build.c, src/utils.c, src/ui_utils.h,

Modified: trunk/plugins/pluginmacros.h
===================================================================
--- trunk/plugins/pluginmacros.h	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/plugins/pluginmacros.h	2008-05-16 14:17:54 UTC (rev 2594)
@@ -90,6 +90,9 @@
 #define ui				geany_data->ui
 #define utils			geany_data->utils
 
+typedef struct _GeanyDocument document;
+typedef struct _GeanyFiletype filetype;
+
 #endif
 
 #endif

Modified: trunk/plugins/vcdiff.c
===================================================================
--- trunk/plugins/vcdiff.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/plugins/vcdiff.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -286,7 +286,7 @@
 		idx = find_by_filename(filename);
 		if ( idx == -1)
 		{
-			filetype *ft = p_filetypes->lookup_by_name("Diff");
+			GeanyFiletype *ft = p_filetypes->lookup_by_name("Diff");
 			idx = p_document->new_file(filename, ft, text);
 		}
 		else
@@ -481,7 +481,7 @@
 
 static void update_menu_items(void)
 {
-	document	*doc;
+	GeanyDocument *doc;
 	gboolean	have_file;
 	gboolean    have_vc = FALSE;
 

Modified: trunk/src/build.c
===================================================================
--- trunk/src/build.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/build.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -591,7 +591,7 @@
 	gchar	*locale_filename = NULL;
 	gboolean have_project;
 	GeanyProject *project = app->project;
-	filetype *ft = doc_list[idx].file_type;
+	GeanyFiletype *ft = doc_list[idx].file_type;
 	gboolean check_exists;
 	gchar	*cmd = NULL;
 	gchar	*executable = NULL;
@@ -1276,7 +1276,7 @@
                                             gint response,
                                             gpointer user_data)
 {
-	filetype *ft = user_data;
+	GeanyFiletype *ft = user_data;
 	g_return_if_fail(ft != NULL);
 
 	if (response == GTK_RESPONSE_ACCEPT)
@@ -1325,7 +1325,7 @@
 	GtkWidget *dialog, *label, *entries[4], *vbox, *table;
 	gint idx = document_get_cur_idx();
 	gint response;
-	filetype *ft = NULL;
+	GeanyFiletype *ft = NULL;
 
 	if (DOC_IDX_VALID(idx)) ft = doc_list[idx].file_type;
 	g_return_if_fail(ft != NULL);
@@ -1441,7 +1441,7 @@
                                         gint response,
                                         gpointer user_data)
 {
-	filetype *ft = user_data;
+	GeanyFiletype *ft = user_data;
 
 	g_return_if_fail(ft != NULL);
 
@@ -1494,7 +1494,7 @@
 	gint row = 0;
 	gint idx = document_get_cur_idx();
 	gint response;
-	filetype *ft = NULL;
+	GeanyFiletype *ft = NULL;
 
 	if (DOC_IDX_VALID(idx)) ft = doc_list[idx].file_type;
 	g_return_if_fail(ft != NULL);
@@ -1612,7 +1612,7 @@
 on_build_arguments_activate            (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
-	if (user_data && FILETYPE_ID((filetype*) user_data) == GEANY_FILETYPES_LATEX)
+	if (user_data && FILETYPE_ID((GeanyFiletype*) user_data) == GEANY_FILETYPES_LATEX)
 		show_includes_arguments_tex();
 	else
 		show_includes_arguments_gen();
@@ -1635,7 +1635,7 @@
  * Uses current document (if there is one) when idx == -1 */
 void build_menu_update(gint idx)
 {
-	filetype *ft;
+	GeanyFiletype *ft;
 	gboolean have_path, can_build, can_make, can_run, can_stop, can_set_args, have_errors;
 	BuildMenuItems *menu_items;
 
@@ -1784,7 +1784,7 @@
 	if (filetype_idx == -1)
 	{
 		gint idx = document_get_cur_idx();
-		filetype *ft = NULL;
+		GeanyFiletype *ft = NULL;
 
 		if (DOC_IDX_VALID(idx))
 			ft = doc_list[idx].file_type;
@@ -1923,7 +1923,7 @@
 }
 
 
-static gboolean use_html_builtin(gint idx, filetype *ft)
+static gboolean use_html_builtin(gint idx, GeanyFiletype *ft)
 {
 	gboolean use_builtin = FALSE;
 	if (ft->id == GEANY_FILETYPES_HTML)
@@ -1957,7 +1957,7 @@
 {
 	gint idx = document_get_cur_idx();
 	filetype_id ft_id;
-	filetype *ft;
+	GeanyFiletype *ft;
 
 	if (! DOC_IDX_VALID(idx))
 		return;

Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/callbacks.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -1038,7 +1038,7 @@
 {
 	gboolean definition = (menuitem ==
 		GTK_MENU_ITEM(lookup_widget(app->popup_menu, "goto_tag_definition1")));
-	document *doc = document_get_current();
+	GeanyDocument *doc = document_get_current();
 
 	g_return_if_fail(doc);
 
@@ -1370,7 +1370,7 @@
 	gint idx = document_get_cur_idx();
 	gchar *text;
 	gchar *fname;
-	filetype *ft;
+	GeanyFiletype *ft;
 
 	g_return_if_fail(DOC_IDX_VALID(idx));
 
@@ -2111,7 +2111,7 @@
 on_line_breaking1_activate             (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
-	document *doc;
+	GeanyDocument *doc;
 
 	if (app->ignore_callback)
 		return;

Modified: trunk/src/dialogs.c
===================================================================
--- trunk/src/dialogs.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/dialogs.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -82,7 +82,7 @@
 						lookup_widget(GTK_WIDGET(dialog), "filetype_combo")));
 		gint encoding_idx = gtk_combo_box_get_active(GTK_COMBO_BOX(
 						lookup_widget(GTK_WIDGET(dialog), "encoding_combo")));
-		filetype *ft = NULL;
+		GeanyFiletype *ft = NULL;
 		gchar *charset = NULL;
 		gboolean ro = (response == GEANY_RESPONSE_VIEW);	/* View clicked */
 

Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/document.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -152,7 +152,7 @@
 
 	for (i = 0; i < doc_array->len; i++)
 	{
-		document *doc = &doc_list[i];
+		GeanyDocument *doc = &doc_list[i];
 		gchar *docname;
 
 		if (doc->file_name == NULL) continue;
@@ -245,7 +245,7 @@
  *
  *  @return A pointer to the current %document or @c NULL if there are no opened documents.
  **/
-document *document_get_current()
+GeanyDocument *document_get_current()
 {
 	gint idx = document_get_cur_idx();
 
@@ -255,7 +255,7 @@
 
 void document_init_doclist()
 {
-	doc_array = g_array_new(FALSE, FALSE, sizeof(document));
+	doc_array = g_array_new(FALSE, FALSE, sizeof(GeanyDocument));
 }
 
 
@@ -311,7 +311,7 @@
 
 /* Sets is_valid to FALSE and initializes some members to NULL, to mark it uninitialized.
  * The flag is_valid is set to TRUE in document_create(). */
-static void init_doc_struct(document *new_doc)
+static void init_doc_struct(GeanyDocument *new_doc)
 {
 	new_doc->is_valid = FALSE;
 	new_doc->has_tags = FALSE;
@@ -432,7 +432,7 @@
 	PangoFontDescription *pfd;
 	gchar *fname;
 	gint new_idx;
-	document *this;
+	GeanyDocument *this;
 	gint tabnum;
 	gint cur_pages = gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook));
 
@@ -446,7 +446,7 @@
 	new_idx = document_get_new_idx();
 	if (new_idx == -1)	/* expand the array, no free places */
 	{
-		document new_doc;
+		GeanyDocument new_doc;
 		new_idx = doc_array->len;
 		g_array_append_val(doc_array, new_doc);
 	}
@@ -573,7 +573,7 @@
  *
  *  @return The index of the new file in the @ref doc_list array.
  **/
-gint document_new_file(const gchar *filename, filetype *ft, const gchar *text)
+gint document_new_file(const gchar *filename, GeanyFiletype *ft, const gchar *text)
 {
 	gint idx = document_create(filename);
 
@@ -654,7 +654,7 @@
  *  @return The index of the opened file or -1 if an error occurred.
  **/
 gint document_open_file(const gchar *locale_filename, gboolean readonly,
-		filetype *ft, const gchar *forced_enc)
+		GeanyFiletype *ft, const gchar *forced_enc)
 {
 	/* This is a wrapper for document_open_file_full().
 	 * Do not use this when opening multiple files (unless using document_delay_colourise()). */
@@ -960,13 +960,13 @@
  * This avoids unnecessary recolourising, saving significant processing when a lot of files
  * are open of a filetype that supports user typenames, e.g. C. */
 gint document_open_file_full(gint idx, const gchar *filename, gint pos, gboolean readonly,
-		filetype *ft, const gchar *forced_enc)
+		GeanyFiletype *ft, const gchar *forced_enc)
 {
 	gint editor_mode;
 	gboolean reload = (idx == -1) ? FALSE : TRUE;
 	gchar *utf8_filename = NULL;
 	gchar *locale_filename = NULL;
-	filetype *use_ft;
+	GeanyFiletype *use_ft;
 	FileData filedata;
 
 	/*struct timeval tv, tv1;*/
@@ -1167,7 +1167,7 @@
  *
  *  @return The index of the opened file or -1 if an error occurred.
  **/
-void document_open_files(const GSList *filenames, gboolean readonly, filetype *ft,
+void document_open_files(const GSList *filenames, gboolean readonly, GeanyFiletype *ft,
 		const gchar *forced_enc)
 {
 	const GSList *item;
@@ -1270,7 +1270,7 @@
 	/* detect filetype */
 	if (FILETYPE_ID(doc_list[idx].file_type) == GEANY_FILETYPES_NONE)
 	{
-		filetype *ft = filetypes_detect_from_file(idx);
+		GeanyFiletype *ft = filetypes_detect_from_file(idx);
 
 		document_set_filetype(idx, ft);
 		if (document_get_cur_idx() == idx)
@@ -2062,7 +2062,7 @@
 
 
 /* sets the filetype of the document (sets syntax highlighting and tagging) */
-void document_set_filetype(gint idx, filetype *type)
+void document_set_filetype(gint idx, GeanyFiletype *type)
 {
 	gboolean colourise = FALSE;
 	gboolean ft_changed;
@@ -2388,7 +2388,7 @@
 
 /* useful debugging function (usually debug macros aren't enabled) */
 #ifdef GEANY_DEBUG
-document *doc(gint idx)
+GeanyDocument *doc(gint idx)
 {
 	return DOC_IDX_VALID(idx) ? &doc_list[idx] : NULL;
 }

Modified: trunk/src/document.h
===================================================================
--- trunk/src/document.h	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/document.h	2008-05-16 14:17:54 UTC (rev 2594)
@@ -71,7 +71,7 @@
 /**
  *  Structure for representing an open tab with all its properties.
  **/
-typedef struct document
+typedef struct _GeanyDocument
 {
 	/** General flag to represent this document is active and all properties are set correctly. */
 	gboolean		 is_valid;
@@ -89,7 +89,7 @@
 	gboolean		 has_bom;
 	/** The filetype for this %document, it's only a reference to one of the elements of the global
 	 *  filetypes array. */
-	filetype		*file_type;
+	GeanyFiletype	*file_type;
 	/** TMWorkObject object for this %document. */
 	TMWorkObject	*tm_file;
 	/** The Scintilla object for this %document. */
@@ -127,7 +127,7 @@
 	/** %Document-specific tab setting. */
 	gboolean		 use_tabs;
 	gboolean		 line_breaking;	/**< Whether to split long lines as you type. */
-} document;
+} GeanyDocument;
 
 
 /* Dynamic array of document elements to hold all information of the notebook tabs. */
@@ -137,7 +137,7 @@
  *  doc_list wraps doc_array so it can be used with C array syntax.
  *  Example: doc_list[0].sci = NULL;
  **/
-#define doc_list ((document *)doc_array->data)
+#define doc_list ((GeanyDocument *)doc_array->data)
 
 /**
  *  DOC_IDX_VALID checks whether the passed index points to a valid %document object by checking
@@ -166,7 +166,7 @@
 
 gint document_get_cur_idx(void);
 
-document *document_get_current(void);
+GeanyDocument *document_get_current(void);
 
 void document_init_doclist(void);
 
@@ -184,19 +184,19 @@
 
 gint document_new_file_if_non_open();
 
-gint document_new_file(const gchar *filename, filetype *ft, const gchar *text);
+gint document_new_file(const gchar *filename, GeanyFiletype *ft, const gchar *text);
 
 gint document_clone(gint old_idx, const gchar *utf8_filename);
 
 gint document_open_file(const gchar *locale_filename, gboolean readonly,
-		filetype *ft, const gchar *forced_enc);
+		GeanyFiletype *ft, const gchar *forced_enc);
 
 gint document_open_file_full(gint idx, const gchar *filename, gint pos, gboolean readonly,
-		filetype *ft, const gchar *forced_enc);
+		GeanyFiletype *ft, const gchar *forced_enc);
 
 void document_open_file_list(const gchar *data, gssize length);
 
-void document_open_files(const GSList *filenames, gboolean readonly, filetype *ft,
+void document_open_files(const GSList *filenames, gboolean readonly, GeanyFiletype *ft,
 		const gchar *forced_enc);
 
 gboolean document_reload_file(gint idx, const gchar *forced_enc);
@@ -222,7 +222,7 @@
 
 void document_update_tag_list(gint idx, gboolean update);
 
-void document_set_filetype(gint idx, filetype *type);
+void document_set_filetype(gint idx, GeanyFiletype *type);
 
 void document_set_encoding(gint idx, const gchar *new_encoding);
 

Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/editor.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -67,11 +67,11 @@
 
 static void on_new_line_added(gint idx);
 static gboolean handle_xml(gint idx, gchar ch);
-static void get_indent(document *doc, gint pos, gboolean use_this_line);
+static void get_indent(GeanyDocument *doc, gint pos, gboolean use_this_line);
 static void auto_multiline(gint idx, gint pos);
 static gboolean is_comment(gint lexer, gint prev_style, gint style);
 static void auto_close_bracket(ScintillaObject *sci, gint pos, gchar c);
-static void editor_auto_table(document *doc, gint pos);
+static void editor_auto_table(GeanyDocument *doc, gint pos);
 
 
 /* calls the edit popup menu in the editor */
@@ -211,7 +211,7 @@
 
 static void check_line_breaking(gint idx, gint pos, gchar c)
 {
-	document *doc = &doc_list[idx];
+	GeanyDocument *doc = &doc_list[idx];
 	ScintillaObject *sci = doc->sci;
 	gint line, lstart;
 
@@ -582,7 +582,7 @@
 
 static void check_python_indent(gint idx, gint pos)
 {
-	document *doc = &doc_list[idx];
+	GeanyDocument *doc = &doc_list[idx];
 	gint last_char = pos - editor_get_eol_char_len(idx) - 1;
 
 	/* add extra indentation for Python after colon */
@@ -674,7 +674,7 @@
 
 /* "use_this_line" to auto-indent only if it is a real new line
  * and ignore the case of editor_close_block */
-static void get_indent(document *doc, gint pos, gboolean use_this_line)
+static void get_indent(GeanyDocument *doc, gint pos, gboolean use_this_line)
 {
 	ScintillaObject *sci = doc->sci;
 	guint i, len, j = 0;
@@ -958,7 +958,7 @@
 }
 
 
-static gchar *find_calltip(const gchar *word, filetype *ft)
+static gchar *find_calltip(const gchar *word, GeanyFiletype *ft)
 {
 	const GPtrArray *tags;
 	const gint arg_types = tm_tag_function_t | tm_tag_prototype_t |
@@ -1163,7 +1163,7 @@
 	ScintillaObject *sci;
 	gboolean ret = FALSE;
 	gchar *wordchars;
-	filetype *ft;
+	GeanyFiletype *ft;
 
 	if ((! editor_prefs.auto_complete_symbols && ! force) ||
 		! DOC_IDX_VALID(idx) || doc_list[idx].file_type == NULL)
@@ -1578,7 +1578,7 @@
 }
 
 
-static void editor_auto_table(document *doc, gint pos)
+static void editor_auto_table(GeanyDocument *doc, gint pos)
 {
 	ScintillaObject *sci = doc->sci;
 	gchar *table;
@@ -1681,7 +1681,7 @@
 	gsize co_len;
 	gchar sel[256], *co, *cc;
 	gboolean break_loop = FALSE, single_line = FALSE;
-	filetype *ft;
+	GeanyFiletype *ft;
 
 	if (! DOC_IDX_VALID(idx) || doc_list[idx].file_type == NULL)
 		return 0;
@@ -1839,7 +1839,7 @@
 	gboolean first_line_was_comment = FALSE;
 	gsize co_len;
 	gsize tm_len = strlen(GEANY_TOGGLE_MARK);
-	filetype *ft;
+	GeanyFiletype *ft;
 
 	if (! DOC_IDX_VALID(idx) || doc_list[idx].file_type == NULL)
 		return;
@@ -2010,7 +2010,7 @@
 	gint sel_start, sel_end, co_len;
 	gchar sel[256], *co, *cc;
 	gboolean break_loop = FALSE, single_line = FALSE;
-	filetype *ft;
+	GeanyFiletype *ft;
 
 	if (! DOC_IDX_VALID(idx) || doc_list[idx].file_type == NULL) return;
 
@@ -3170,7 +3170,7 @@
 
 void editor_set_line_wrapping(gint idx, gboolean wrap)
 {
-	document *doc = &doc_list[idx];
+	GeanyDocument *doc = &doc_list[idx];
 
 	g_return_if_fail(DOC_IDX_VALID(idx));
 
@@ -3181,7 +3181,7 @@
 
 void editor_set_use_tabs(gint idx, gboolean use_tabs)
 {
-	document *doc = &doc_list[idx];
+	GeanyDocument *doc = &doc_list[idx];
 
 	g_return_if_fail(DOC_IDX_VALID(idx));
 

Modified: trunk/src/filetypes.c
===================================================================
--- trunk/src/filetypes.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/filetypes.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -43,10 +43,10 @@
 /* This type 'inherits' from filetype so FullFileType* can be cast to filetype*. */
 typedef struct FullFileType
 {
-	filetype	public;
+	GeanyFiletype	public;
 	/* Private fields */
-	GtkWidget	*menu_item;			/* holds a pointer to the menu item for this filetype */
-	gboolean	keyfile_loaded;
+	GtkWidget		*menu_item;			/* holds a pointer to the menu item for this filetype */
+	gboolean		keyfile_loaded;
 }
 FullFileType;
 
@@ -56,7 +56,7 @@
 GHashTable *filetypes_hash = NULL;	/* Hash of filetype pointers based on name keys */
 
 
-static void create_radio_menu_item(GtkWidget *menu, const gchar *label, filetype *ftype);
+static void create_radio_menu_item(GtkWidget *menu, const gchar *label, GeanyFiletype *ftype);
 
 
 static void init_builtin_filetypes(void)
@@ -381,10 +381,10 @@
 
 
 /* initialize fields. */
-static filetype *filetype_new(void)
+static GeanyFiletype *filetype_new(void)
 {
 	FullFileType *fft = g_new0(FullFileType, 1);
-	filetype *ft = (filetype*) fft;
+	GeanyFiletype *ft = (GeanyFiletype*) fft;
 
 	ft->lang = -2;	/* assume no tagmanager parser */
 	ft->programs = g_new0(struct build_programs, 1);
@@ -395,7 +395,7 @@
 
 /* Add a filetype pointer to the list of available filetypes,
  * and set the filetype::id field. */
-static void filetype_add(filetype *ft)
+static void filetype_add(GeanyFiletype *ft)
 {
 	g_return_if_fail(ft);
 	g_return_if_fail(ft->name);
@@ -456,7 +456,7 @@
 	/* Append all filetypes to the filetype menu */
 	for (ft_id = 0; ft_id < filetypes_array->len; ft_id++)
 	{
-		filetype *ft = filetypes[ft_id];
+		GeanyFiletype *ft = filetypes[ft_id];
 		const gchar *title = ft->title;
 
 		/* insert separators for different filetype groups */
@@ -502,17 +502,17 @@
 }
 
 
-typedef gboolean FileTypesPredicate(filetype *ft, gpointer user_data);
+typedef gboolean FileTypesPredicate(GeanyFiletype *ft, gpointer user_data);
 
 /* Find a filetype that predicate returns TRUE for, otherwise return NULL. */
-static filetype *filetypes_find(gboolean source_only,
+static GeanyFiletype *filetypes_find(gboolean source_only,
 		FileTypesPredicate predicate, gpointer user_data)
 {
 	guint i;
 
 	for (i = 0; i < filetypes_array->len; i++)
 	{
-		filetype *ft = filetypes[i];
+		GeanyFiletype *ft = filetypes[i];
 
 		if (source_only && i == GEANY_FILETYPES_NONE)
 			continue;	/* None is not for source files */
@@ -524,7 +524,7 @@
 }
 
 
-static gboolean match_basename(filetype *ft, gpointer user_data)
+static gboolean match_basename(GeanyFiletype *ft, gpointer user_data)
 {
 	const gchar *base_filename = user_data;
 	gint j;
@@ -548,10 +548,10 @@
 
 /* Detect filetype only based on the filename extension.
  * utf8_filename can include the full path. */
-filetype *filetypes_detect_from_extension(const gchar *utf8_filename)
+GeanyFiletype *filetypes_detect_from_extension(const gchar *utf8_filename)
 {
 	gchar *base_filename;
-	filetype *ft;
+	GeanyFiletype *ft;
 
 	/* to match against the basename of the file (because of Makefile*) */
 	base_filename = g_path_get_basename(utf8_filename);
@@ -569,9 +569,9 @@
 }
 
 
-static filetype *find_shebang(const gchar *utf8_filename, const gchar *line)
+static GeanyFiletype *find_shebang(const gchar *utf8_filename, const gchar *line)
 {
-	filetype *ft = NULL;
+	GeanyFiletype *ft = NULL;
 
 	if (strlen(line) > 2 && line[0] == '#' && line[1] == '!')
 	{
@@ -639,9 +639,10 @@
 
 
 /* Detect the filetype checking for a shebang, then filename extension. */
-static filetype *filetypes_detect_from_file_internal(const gchar *utf8_filename, const gchar *line)
+static GeanyFiletype *filetypes_detect_from_file_internal(const gchar *utf8_filename,
+														  const gchar *line)
 {
-	filetype *ft;
+	GeanyFiletype *ft;
 
 	/* try to find a shebang and if found use it prior to the filename extension
 	 * also checks for <?xml */
@@ -657,9 +658,9 @@
 
 
 /* Detect the filetype for document idx. */
-filetype *filetypes_detect_from_file(gint idx)
+GeanyFiletype *filetypes_detect_from_file(gint idx)
 {
-	filetype *ft;
+	GeanyFiletype *ft;
 	gchar *line;
 
 	if (! DOC_IDX_VALID(idx))
@@ -674,7 +675,7 @@
 
 /* Detect filetype based on the filename extension.
  * utf8_filename can include the full path. */
-filetype *filetypes_detect_from_filename(const gchar *utf8_filename)
+GeanyFiletype *filetypes_detect_from_filename(const gchar *utf8_filename)
 {
 	gchar line[1024];
 	FILE *f;
@@ -695,7 +696,7 @@
 }
 
 
-void filetypes_select_radio_item(const filetype *ft)
+void filetypes_select_radio_item(const GeanyFiletype *ft)
 {
 	FullFileType *fft;
 
@@ -717,11 +718,11 @@
 	gint idx = document_get_cur_idx();
 	if (app->ignore_callback || idx < 0 || ! doc_list[idx].is_valid) return;
 
-	document_set_filetype(idx, (filetype*)user_data);
+	document_set_filetype(idx, (GeanyFiletype*)user_data);
 }
 
 
-static void create_radio_menu_item(GtkWidget *menu, const gchar *label, filetype *ftype)
+static void create_radio_menu_item(GtkWidget *menu, const gchar *label, GeanyFiletype *ftype)
 {
 	static GSList *group = NULL;
 	GtkWidget *tmp;
@@ -738,7 +739,7 @@
 
 #if 0
 /* Remove a filetype pointer from the list of available filetypes. */
-static void filetype_remove(filetype *ft)
+static void filetype_remove(GeanyFiletype *ft)
 {
 	g_return_if_fail(ft);
 
@@ -752,7 +753,7 @@
 
 static void filetype_free(gpointer data, G_GNUC_UNUSED gpointer user_data)
 {
-	filetype *ft = data;
+	GeanyFiletype *ft = data;
 
 	g_return_if_fail(ft != NULL);
 
@@ -786,7 +787,7 @@
 }
 
 
-static void load_settings(gint ft, GKeyFile *config, GKeyFile *configh)
+static void load_settings(gint ft_id, GKeyFile *config, GKeyFile *configh)
 {
 	gchar *result;
 	GError *error = NULL;
@@ -797,7 +798,7 @@
 	if (result == NULL) result = g_key_file_get_string(config, "settings", "extension", NULL);
 	if (result != NULL)
 	{
-		setptr(filetypes[ft]->extension, result);
+		setptr(filetypes[ft_id]->extension, result);
 	}
 
 	/* read comment notes */
@@ -805,16 +806,16 @@
 	if (result == NULL) result = g_key_file_get_string(config, "settings", "comment_open", NULL);
 	if (result != NULL)
 	{
-		g_free(filetypes[ft]->comment_open);
-		filetypes[ft]->comment_open = result;
+		g_free(filetypes[ft_id]->comment_open);
+		filetypes[ft_id]->comment_open = result;
 	}
 
 	result = g_key_file_get_string(configh, "settings", "comment_close", NULL);
 	if (result == NULL) result = g_key_file_get_string(config, "settings", "comment_close", NULL);
 	if (result != NULL)
 	{
-		g_free(filetypes[ft]->comment_close);
-		filetypes[ft]->comment_close = result;
+		g_free(filetypes[ft_id]->comment_close);
+		filetypes[ft_id]->comment_close = result;
 	}
 
 	tmp = g_key_file_get_boolean(configh, "settings", "comment_use_indent", &error);
@@ -824,16 +825,16 @@
 		error = NULL;
 		tmp = g_key_file_get_boolean(config, "settings", "comment_use_indent", &error);
 		if (error) g_error_free(error);
-		else filetypes[ft]->comment_use_indent = tmp;
+		else filetypes[ft_id]->comment_use_indent = tmp;
 	}
-	else filetypes[ft]->comment_use_indent = tmp;
+	else filetypes[ft_id]->comment_use_indent = tmp;
 
 	/* read context action */
 	result = g_key_file_get_string(configh, "settings", "context_action_cmd", NULL);
 	if (result == NULL) result = g_key_file_get_string(config, "settings", "context_action_cmd", NULL);
 	if (result != NULL)
 	{
-		filetypes[ft]->context_action_cmd = result;
+		filetypes[ft_id]->context_action_cmd = result;
 	}
 
 	/* read build settings */
@@ -841,32 +842,32 @@
 	if (result == NULL) result = g_key_file_get_string(config, "build_settings", "compiler", NULL);
 	if (result != NULL)
 	{
-		filetypes[ft]->programs->compiler = result;
-		filetypes[ft]->actions->can_compile = TRUE;
+		filetypes[ft_id]->programs->compiler = result;
+		filetypes[ft_id]->actions->can_compile = TRUE;
 	}
 
 	result = g_key_file_get_string(configh, "build_settings", "linker", NULL);
 	if (result == NULL) result = g_key_file_get_string(config, "build_settings", "linker", NULL);
 	if (result != NULL)
 	{
-		filetypes[ft]->programs->linker = result;
-		filetypes[ft]->actions->can_link = TRUE;
+		filetypes[ft_id]->programs->linker = result;
+		filetypes[ft_id]->actions->can_link = TRUE;
 	}
 
 	result = g_key_file_get_string(configh, "build_settings", "run_cmd", NULL);
 	if (result == NULL) result = g_key_file_get_string(config, "build_settings", "run_cmd", NULL);
 	if (result != NULL)
 	{
-		filetypes[ft]->programs->run_cmd = result;
-		filetypes[ft]->actions->can_exec = TRUE;
+		filetypes[ft_id]->programs->run_cmd = result;
+		filetypes[ft_id]->actions->can_exec = TRUE;
 	}
 
 	result = g_key_file_get_string(configh, "build_settings", "run_cmd2", NULL);
 	if (result == NULL) result = g_key_file_get_string(config, "build_settings", "run_cmd2", NULL);
 	if (result != NULL)
 	{
-		filetypes[ft]->programs->run_cmd2 = result;
-		filetypes[ft]->actions->can_exec = TRUE;
+		filetypes[ft_id]->programs->run_cmd2 = result;
+		filetypes[ft_id]->actions->can_exec = TRUE;
 	}
 }
 
@@ -1006,7 +1007,7 @@
 }
 
 
-GtkFileFilter *filetypes_create_file_filter(filetype *ft)
+GtkFileFilter *filetypes_create_file_filter(const GeanyFiletype *ft)
 {
 	GtkFileFilter *new_filter;
 	gint i;
@@ -1026,7 +1027,7 @@
 
 
 /* Indicates whether there is a tag parser for the filetype or not. */
-gboolean filetype_has_tags(filetype *ft)
+gboolean filetype_has_tags(GeanyFiletype *ft)
 {
 	g_return_val_if_fail(ft != NULL, FALSE);
 
@@ -1035,9 +1036,9 @@
 
 
 /** Find a filetype pointer from its @c name field. */
-filetype *filetypes_lookup_by_name(const gchar *name)
+GeanyFiletype *filetypes_lookup_by_name(const gchar *name)
 {
-	filetype *ft;
+	GeanyFiletype *ft;
 
 	g_return_val_if_fail(NZV(name), NULL);
 

Modified: trunk/src/filetypes.h
===================================================================
--- trunk/src/filetypes.h	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/filetypes.h	2008-05-16 14:17:54 UTC (rev 2594)
@@ -102,7 +102,7 @@
 	gboolean modified;
 };
 
-struct filetype
+struct _GeanyFiletype
 {
 	filetype_id		  id;
 	langType 		  lang;				/* represents the langType of tagmanager(see the table */
@@ -123,10 +123,10 @@
 
 /* Wrap filetypes_array so it can be used with C array syntax.
  * Example: filetypes[GEANY_FILETYPES_C]->name = ...; */
-#define filetypes	((filetype **)filetypes_array->pdata)
+#define filetypes	((GeanyFiletype **)filetypes_array->pdata)
 
 
-filetype *filetypes_lookup_by_name(const gchar *name);
+GeanyFiletype *filetypes_lookup_by_name(const gchar *name);
 
 
 /* Calls filetypes_init_types() and creates the filetype menu. */
@@ -136,13 +136,13 @@
 void filetypes_init_types(void);
 
 /* Detect the filetype for document idx, checking for a shebang, then filename extension. */
-filetype *filetypes_detect_from_file(gint idx);
+GeanyFiletype *filetypes_detect_from_file(gint idx);
 
-filetype *filetypes_detect_from_extension(const gchar *utf8_filename);
+GeanyFiletype *filetypes_detect_from_extension(const gchar *utf8_filename);
 
 /* Detect filetype based on the filename extension.
  * utf8_filename can include the full path. */
-filetype *filetypes_detect_from_filename(const gchar *utf8_filename);
+GeanyFiletype *filetypes_detect_from_filename(const gchar *utf8_filename);
 
 /* frees the array and all related pointers */
 void filetypes_free_types(void);
@@ -151,14 +151,14 @@
 
 void filetypes_save_commands(void);
 
-void filetypes_select_radio_item(const filetype *ft);
+void filetypes_select_radio_item(const GeanyFiletype *ft);
 
-GtkFileFilter *filetypes_create_file_filter(filetype *ft);
+GtkFileFilter *filetypes_create_file_filter(const GeanyFiletype *ft);
 
 GtkFileFilter *filetypes_create_file_filter_all_source(void);
 
 gchar *filetypes_get_conf_extension(gint filetype_idx);
 
-gboolean filetype_has_tags(filetype *ft);
+gboolean filetype_has_tags(GeanyFiletype *ft);
 
 #endif

Modified: trunk/src/geany.h
===================================================================
--- trunk/src/geany.h	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/geany.h	2008-05-16 14:17:54 UTC (rev 2594)
@@ -55,7 +55,7 @@
 
 
 /* useful forward declarations */
-typedef struct filetype filetype;
+typedef struct _GeanyFiletype GeanyFiletype;
 typedef struct _GeanyProject GeanyProject;
 
 

Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/keybindings.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -1082,7 +1082,7 @@
 {
 	gint idx = document_get_cur_idx();
 	GtkWidget *item;
-	filetype *ft;
+	GeanyFiletype *ft;
 	BuildMenuItems *menu_items;
 
 	if (! DOC_IDX_VALID(idx)) return;

Modified: trunk/src/keyfile.c
===================================================================
--- trunk/src/keyfile.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/keyfile.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -119,7 +119,7 @@
 static gchar *get_session_file_string(gint idx)
 {
 	gchar *fname;
-	filetype *ft = doc_list[idx].file_type;
+	GeanyFiletype *ft = doc_list[idx].file_type;
 
 	if (ft == NULL)	/* can happen when saving a new file when quitting */
 		ft = filetypes[GEANY_FILETYPES_NONE];
@@ -839,7 +839,7 @@
 
 	if (g_file_test(locale_filename, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK))
 	{
-		filetype *ft = filetypes_lookup_by_name(ft_name);
+		GeanyFiletype *ft = filetypes_lookup_by_name(ft_name);
 		gint new_idx = document_open_file_full(
 			-1, locale_filename, pos, ro, ft,
 			(enc_idx >= 0 && enc_idx < GEANY_ENCODINGS_MAX) ?

Modified: trunk/src/msgwindow.c
===================================================================
--- trunk/src/msgwindow.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/msgwindow.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -594,7 +594,7 @@
 	if (data->file_idx == -1)
 	{
 		/* we have no filename in the error message, so take the current one and hope it's correct */
-		document *doc = document_get_current();
+		GeanyDocument *doc = document_get_current();
 		if (doc != NULL)
 			*filename = g_strdup(doc->file_name);
 		g_strfreev(fields);

Modified: trunk/src/notebook.c
===================================================================
--- trunk/src/notebook.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/notebook.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -319,7 +319,7 @@
 	GtkWidget *hbox, *ebox;
 	gint tabnum;
 	gchar *title;
-	document *this = &(doc_list[doc_idx]);
+	GeanyDocument *this = &(doc_list[doc_idx]);
 	GtkWidget *page;
 
 	g_return_val_if_fail(doc_idx >= 0 && this != NULL, -1);

Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/plugindata.h	2008-05-16 14:17:54 UTC (rev 2594)
@@ -194,21 +194,21 @@
 /* See document.h */
 typedef struct DocumentFuncs
 {
-	gint	(*new_file) (const gchar *filename, struct filetype *ft, const gchar *text);
+	gint	(*new_file) (const gchar *filename, struct _GeanyFiletype *ft, const gchar *text);
 	gint	(*get_cur_idx) (void);
 	gint	(*get_n_idx) (guint i);
 	gint	(*find_by_filename) (const gchar *filename, gboolean is_tm_filename);
-	struct document* (*get_current) (void);
+	struct _GeanyDocument* (*get_current) (void);
 	gboolean (*save_file) (gint idx, gboolean force);
 	gint	(*open_file) (const gchar *locale_filename, gboolean readonly,
-			struct filetype *ft, const gchar *forced_enc);
-	void	(*open_files) (const GSList *filenames, gboolean readonly, struct filetype *ft,
+			struct _GeanyFiletype *ft, const gchar *forced_enc);
+	void	(*open_files) (const GSList *filenames, gboolean readonly, struct _GeanyFiletype *ft,
 			const gchar *forced_enc);
 	gboolean (*remove) (guint page_num);
 	gboolean (*reload_file) (gint idx, const gchar *forced_enc);
 	void	(*set_encoding) (gint idx, const gchar *new_encoding);
 	void	(*set_text_changed) (gint idx);
-	void	(*set_filetype) (gint idx, filetype *type);
+	void	(*set_filetype) (gint idx, struct _GeanyFiletype *type);
 }
 DocumentFuncs;
 
@@ -378,8 +378,8 @@
 /* See filetypes.h */
 typedef struct FiletypeFuncs
 {
-	filetype*	(*detect_from_filename) (const gchar *utf8_filename);
-	filetype*	(*lookup_by_name) (const gchar *name);
+	GeanyFiletype*	(*detect_from_filename) (const gchar *utf8_filename);
+	GeanyFiletype*	(*lookup_by_name) (const gchar *name);
 }
 FiletypeFuncs;
 

Modified: trunk/src/printing.c
===================================================================
--- trunk/src/printing.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/printing.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -409,12 +409,24 @@
 {
 	DocInfo *dinfo = user_data;
 	PangoFontDescription *desc;
+	GtkPrintSettings *lsettings;
+	GtkPageRange range;
 	gint i;
 	gint style_max;
 
 	if (dinfo == NULL)
 		return;
 
+	/* printing a range of pages or only the current page is not yet supported, so force printing
+	 * of all pages */
+	lsettings = gtk_print_operation_get_print_settings(operation);
+	gtk_print_settings_set_print_pages(lsettings, GTK_PRINT_PAGES_ALL);
+	gtk_print_settings_set_page_set(lsettings, GTK_PAGE_SET_ALL);
+	range.start = 0;
+	range.end = dinfo->n_pages;
+	gtk_print_settings_set_page_ranges(lsettings, &range, 1);
+	gtk_print_operation_set_print_settings(operation, lsettings);
+
 	desc = pango_font_description_from_string(interface_prefs.editor_font);
 
 	/* init dinfo fields */

Modified: trunk/src/symbols.c
===================================================================
--- trunk/src/symbols.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/symbols.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -964,11 +964,11 @@
 
 /* Detects a global tags filetype from the *.lang.* language extension.
  * Returns NULL if there was no matching TM language. */
-static filetype *detect_global_tags_filetype(const gchar *utf8_filename)
+static GeanyFiletype *detect_global_tags_filetype(const gchar *utf8_filename)
 {
 	gchar *tags_ext;
 	gchar *shortname = g_strdup(utf8_filename);
-	filetype *ft = NULL;
+	GeanyFiletype *ft = NULL;
 
 	tags_ext = strstr(shortname, ".tags");
 	if (tags_ext)
@@ -1002,7 +1002,7 @@
 		char *command;
 		const char *tags_file = argv[1];
 		char *utf8_fname;
-		filetype *ft;
+		GeanyFiletype *ft;
 
 		utf8_fname = utils_get_utf8_from_locale(tags_file);
 		ft = detect_global_tags_filetype(utf8_fname);
@@ -1068,7 +1068,7 @@
 		{
 			gchar *fname = item->data;
 			gchar *utf8_fname;
-			filetype *ft;
+			GeanyFiletype *ft;
 
 			utf8_fname = utils_get_utf8_from_locale(fname);
 			ft = detect_global_tags_filetype(utf8_fname);
@@ -1098,7 +1098,7 @@
 		GList *fnames;
 		gchar *fname = node->data;
 		gchar *utf8_fname = utils_get_utf8_from_locale(fname);
-		filetype *ft = detect_global_tags_filetype(utf8_fname);
+		GeanyFiletype *ft = detect_global_tags_filetype(utf8_fname);
 
 		g_free(utf8_fname);
 
@@ -1142,7 +1142,7 @@
 	static GHashTable *lang_hash = NULL;
 	GList *fnames;
 	const GList *node;
-	const filetype *ft = filetypes[ft_id];
+	const GeanyFiletype *ft = filetypes[ft_id];
 
 	g_return_if_fail(ft_id < GEANY_FILETYPES_NONE);
 

Modified: trunk/src/templates.c
===================================================================
--- trunk/src/templates.c	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/templates.c	2008-05-16 14:17:54 UTC (rev 2594)
@@ -329,7 +329,7 @@
 on_new_with_template                   (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
-	filetype *ft = user_data;
+	GeanyFiletype *ft = user_data;
 	gchar *template = templates_get_template_new_file(ft);
 
 	document_new_file(NULL, ft, template);
@@ -345,7 +345,7 @@
 	for (ft_id = 0; ft_id < GEANY_MAX_BUILT_IN_FILETYPES; ft_id++)
 	{
 		GtkWidget *tmp_menu, *tmp_button;
-		filetype *ft = filetypes[ft_id];
+		GeanyFiletype *ft = filetypes[ft_id];
 		const gchar *label = ft->title;
 
 		if (ft_templates[ft_id] == NULL)
@@ -366,7 +366,7 @@
 }
 
 
-static gchar *get_template_from_file(const gchar *locale_fname, filetype *ft)
+static gchar *get_template_from_file(const gchar *locale_fname, GeanyFiletype *ft)
 {
 	GString template = {NULL, 0, 0};
 
@@ -390,7 +390,7 @@
 on_new_with_file_template(GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer user_data)
 {
 	gchar *fname = ui_menu_item_get_text(menuitem);
-	filetype *ft;
+	GeanyFiletype *ft;
 	gchar *template;
 
 	ft = filetypes_detect_from_extension(fname);
@@ -433,8 +433,8 @@
 
 static gint compare_filenames_by_filetype(gconstpointer a, gconstpointer b)
 {
-	filetype *ft_a = filetypes_detect_from_extension(a);
-	filetype *ft_b = filetypes_detect_from_extension(b);
+	GeanyFiletype *ft_a = filetypes_detect_from_extension(a);
+	GeanyFiletype *ft_b = filetypes_detect_from_extension(b);
 
 	/* sort by filetype name first */
 	if (ft_a != ft_b)
@@ -661,7 +661,7 @@
 	gchar *result;
 	gchar *date = utils_get_date_time(TEMPLATE_DATETIME_FORMAT, NULL);
 	filetype_id ft_id = filetype_idx;
-	filetype *ft = filetypes[ft_id];
+	GeanyFiletype *ft = filetypes[ft_id];
 
 	filetypes_load_config(ft_id);	/* load any user extension setting */
 
@@ -689,7 +689,7 @@
 }
 
 
-static gchar *get_file_template(filetype *ft)
+static gchar *get_file_template(GeanyFiletype *ft)
 {
 	filetype_id ft_id = FILETYPE_ID(ft);
 
@@ -697,7 +697,7 @@
 }
 
 
-gchar *templates_get_template_new_file(struct filetype *ft)
+gchar *templates_get_template_new_file(GeanyFiletype *ft)
 {
 	gchar *ft_template = NULL;
 	gchar *file_header = NULL;

Modified: trunk/src/templates.h
===================================================================
--- trunk/src/templates.h	2008-05-16 13:30:41 UTC (rev 2593)
+++ trunk/src/templates.h	2008-05-16 14:17:54 UTC (rev 2594)
@@ -54,7 +54,7 @@
 
 gchar *templates_get_template_fileheader(gint filetype_idx, const gchar *fname);
 
-gchar *templates_get_template_new_file(struct filetype *ft);
+gchar *templates_get_template_new_file(GeanyFiletype *ft);
 
 gchar *templates_get_template_changelog(void);
 


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