Kaydet (Commit) 002503de authored tarafından Enrico Tröger's avatar Enrico Tröger

several bugfixes and improvements


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@281 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst c80b8a57
This diff is collapsed.
...@@ -26,34 +26,18 @@ ...@@ -26,34 +26,18 @@
#include "geany.h" #include "geany.h"
GPid build_make_c_file(gint idx, gboolean cust_target); GPid build_make_file(gint idx, gboolean cust_target);
GPid build_compile_c_file(gint idx); GPid build_compile_file(gint idx);
GPid build_link_file(gint idx);
GPid build_compile_tex_file(gint idx, gint mode); GPid build_compile_tex_file(gint idx, gint mode);
GPid build_view_tex_file(gint idx, gint mode); GPid build_view_tex_file(gint idx, gint mode);
GPid build_link_c_file(gint idx);
GPid build_compile_cpp_file(gint idx);
GPid build_link_cpp_file(gint idx);
GPid build_compile_java_file(gint idx);
GPid build_compile_pascal_file(gint idx);
GPid build_spawn_cmd(gint idx, gchar **cmd);
GPid build_run_cmd(gint idx); GPid build_run_cmd(gint idx);
void build_exit_cb (GPid child_pid, gint status, gpointer user_data); void build_exit_cb (GPid child_pid, gint status, gpointer user_data);
GIOChannel *build_set_up_io_channel (gint fd, GIOCondition cond, GIOFunc func, gpointer data);
gboolean build_iofunc(GIOChannel *ioc, GIOCondition cond, gpointer data);
gboolean build_create_shellscript(const gint idx, const gchar *fname, const gchar *exec, const gchar *args);
#endif #endif
This diff is collapsed.
...@@ -564,3 +564,7 @@ on_entry_goto_line_activate (GtkEntry *entry, ...@@ -564,3 +564,7 @@ on_entry_goto_line_activate (GtkEntry *entry,
void void
on_toolbutton_goto_clicked (GtkToolButton *toolbutton, on_toolbutton_goto_clicked (GtkToolButton *toolbutton,
gpointer user_data); gpointer user_data);
void
on_run_button_clicked (GtkToolButton *toolbutton,
gpointer user_data);
This diff is collapsed.
...@@ -26,29 +26,13 @@ ...@@ -26,29 +26,13 @@
#ifndef GEANY_DIALOGS_H #ifndef GEANY_DIALOGS_H
#define GEANY_DIALOGS_H 1 #define GEANY_DIALOGS_H 1
typedef struct
{
GtkWidget *menu;
GtkWidget *item_compile;
GtkWidget *item_link;
GtkWidget *item_exec;
} build_menus_items;
build_menus_items dialogs_build_menus_items;
typedef struct
{
build_menus_items menu_c;
build_menus_items menu_tex;
build_menus_items menu_misc;
} build_menus;
build_menus dialogs_build_menus;
/* This shows the file selection dialog to open a file. */ /* This shows the file selection dialog to open a file. */
void dialogs_show_open_file (void); void dialogs_show_open_file(void);
/* This shows the file selection dialog to save a file. */ /* This shows the file selection dialog to save a file. */
void dialogs_show_save_as (); void dialogs_show_save_as();
void dialogs_show_file_open_error(void); void dialogs_show_file_open_error(void);
...@@ -60,10 +44,6 @@ void dialogs_show_error(const gchar *text, ...); ...@@ -60,10 +44,6 @@ void dialogs_show_error(const gchar *text, ...);
gboolean dialogs_show_fifo_error(const gchar *text, ...); gboolean dialogs_show_fifo_error(const gchar *text, ...);
gboolean dialogs_show_reload_warning(const gchar *text);
gboolean dialogs_show_confirm_exit(void);
gboolean dialogs_show_unsaved_file(gint idx); gboolean dialogs_show_unsaved_file(gint idx);
/* This shows the font selection dialog to choose a font. */ /* This shows the font selection dialog to choose a font. */
...@@ -75,9 +55,9 @@ void dialogs_show_word_count(void); ...@@ -75,9 +55,9 @@ void dialogs_show_word_count(void);
void dialogs_show_color(void); void dialogs_show_color(void);
GtkWidget *dialogs_create_build_menu_gen(gboolean link, gboolean execute, build_menus_items *type); GtkWidget *dialogs_create_build_menu_gen(gint idx);
GtkWidget *dialogs_create_build_menu_tex(build_menus_items *type); GtkWidget *dialogs_create_build_menu_tex(gint idx);
void dialogs_show_make_target(void); void dialogs_show_make_target(void);
...@@ -87,7 +67,7 @@ void dialogs_show_replace(void); ...@@ -87,7 +67,7 @@ void dialogs_show_replace(void);
void dialogs_show_goto_line(void); void dialogs_show_goto_line(void);
void dialogs_show_includes_arguments_gen(gboolean link); void dialogs_show_includes_arguments_gen(void);
void dialogs_show_includes_arguments_tex(void); void dialogs_show_includes_arguments_tex(void);
...@@ -99,4 +79,8 @@ gboolean dialogs_show_mkcfgdir_error(gint error_nr); ...@@ -99,4 +79,8 @@ gboolean dialogs_show_mkcfgdir_error(gint error_nr);
void dialogs_show_file_properties(gint idx); void dialogs_show_file_properties(gint idx);
void dialogs_show_prefs_dialog(void);
gboolean dialogs_show_question(const gchar *text, ...);
#endif #endif
...@@ -95,7 +95,7 @@ gint document_find_by_sci(ScintillaObject *sci) ...@@ -95,7 +95,7 @@ gint document_find_by_sci(ScintillaObject *sci)
/* returns the index of the given notebook page in the document list */ /* returns the index of the given notebook page in the document list */
gint document_get_n_idx(guint page_num) gint document_get_n_idx(guint page_num)
{ {
if (page_num < 0 || page_num >= GEANY_MAX_OPEN_FILES) return -1; if (page_num >= GEANY_MAX_OPEN_FILES) return -1;
ScintillaObject *sci = (ScintillaObject*)gtk_notebook_get_nth_page( ScintillaObject *sci = (ScintillaObject*)gtk_notebook_get_nth_page(
GTK_NOTEBOOK(app->notebook), page_num); GTK_NOTEBOOK(app->notebook), page_num);
...@@ -193,6 +193,7 @@ gint document_create_new_sci(const gchar *filename) ...@@ -193,6 +193,7 @@ gint document_create_new_sci(const gchar *filename)
{ {
ScintillaObject *sci; ScintillaObject *sci;
GtkWidget *hbox, *but; GtkWidget *hbox, *but;
GtkWidget *align;
PangoFontDescription *pfd; PangoFontDescription *pfd;
gchar *title, *fname; gchar *title, *fname;
document this; document this;
...@@ -209,9 +210,12 @@ gint document_create_new_sci(const gchar *filename) ...@@ -209,9 +210,12 @@ gint document_create_new_sci(const gchar *filename)
gtk_container_set_border_width(GTK_CONTAINER(but), 0); gtk_container_set_border_width(GTK_CONTAINER(but), 0);
gtk_widget_set_size_request(but, 17, 15); gtk_widget_set_size_request(but, 17, 15);
align = gtk_alignment_new(1.0, 0.0, 0.0, 0.0);
gtk_container_add(GTK_CONTAINER(align), but);
gtk_button_set_relief(GTK_BUTTON(but), GTK_RELIEF_NONE); gtk_button_set_relief(GTK_BUTTON(but), GTK_RELIEF_NONE);
gtk_box_pack_start(GTK_BOX(hbox), this.tab_label, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), this.tab_label, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), but, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), align, TRUE, TRUE, 0);
gtk_widget_show_all(hbox); gtk_widget_show_all(hbox);
/* SCI - Code */ /* SCI - Code */
...@@ -244,8 +248,19 @@ gint document_create_new_sci(const gchar *filename) ...@@ -244,8 +248,19 @@ gint document_create_new_sci(const gchar *filename)
gtk_widget_show(GTK_WIDGET(sci)); gtk_widget_show(GTK_WIDGET(sci));
this.tabmenu_label = gtk_label_new(title); this.tabmenu_label = gtk_label_new(title);
gtk_notebook_insert_page_menu(GTK_NOTEBOOK(app->notebook), GTK_WIDGET(sci), hbox, this.tabmenu_label, 0); if (app->tab_order_ltr)
{
gint npage;
npage = gtk_notebook_append_page_menu(GTK_NOTEBOOK(app->notebook), GTK_WIDGET(sci),
hbox, this.tabmenu_label);
gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), npage);
}
else
{
gtk_notebook_insert_page_menu(GTK_NOTEBOOK(app->notebook), GTK_WIDGET(sci), hbox,
this.tabmenu_label, 0);
gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), 0); gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), 0);
}
iter = treeviews_openfiles_add(new_idx, title); iter = treeviews_openfiles_add(new_idx, title);
g_free(title); g_free(title);
...@@ -253,11 +268,14 @@ gint document_create_new_sci(const gchar *filename) ...@@ -253,11 +268,14 @@ gint document_create_new_sci(const gchar *filename)
this.tag_tree = NULL; this.tag_tree = NULL;
// "the" SCI signal // "the" SCI signal
g_signal_connect((GtkWidget*) sci, "sci-notify", G_CALLBACK(on_editor_notification), GINT_TO_POINTER(new_idx)); g_signal_connect((GtkWidget*) sci, "sci-notify",
G_CALLBACK(on_editor_notification), GINT_TO_POINTER(new_idx));
// signal for insert-key(works without too, but to update the right status bar) // signal for insert-key(works without too, but to update the right status bar)
g_signal_connect((GtkWidget*) sci, "key-press-event", G_CALLBACK(on_editor_key_press_event), GINT_TO_POINTER(new_idx)); g_signal_connect((GtkWidget*) sci, "key-press-event",
G_CALLBACK(on_editor_key_press_event), GINT_TO_POINTER(new_idx));
// signal for the popup menu // signal for the popup menu
g_signal_connect((GtkWidget*) sci, "button-press-event", G_CALLBACK(on_editor_button_press_event), GINT_TO_POINTER(new_idx)); g_signal_connect((GtkWidget*) sci, "button-press-event",
G_CALLBACK(on_editor_button_press_event), GINT_TO_POINTER(new_idx));
// signal for clicking the tab-close button // signal for clicking the tab-close button
g_signal_connect(G_OBJECT(but), "clicked", G_CALLBACK(on_tab_close_clicked), sci); g_signal_connect(G_OBJECT(but), "clicked", G_CALLBACK(on_tab_close_clicked), sci);
...@@ -312,6 +330,7 @@ gboolean document_remove(guint page_num) ...@@ -312,6 +330,7 @@ gboolean document_remove(guint page_num)
doc_list[idx].sci = NULL; doc_list[idx].sci = NULL;
doc_list[idx].file_name = NULL; doc_list[idx].file_name = NULL;
doc_list[idx].file_type = NULL; doc_list[idx].file_type = NULL;
doc_list[idx].encoding = NULL;
doc_list[idx].tm_file = NULL; doc_list[idx].tm_file = NULL;
if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) == 0) if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) == 0)
{ {
...@@ -341,6 +360,7 @@ void document_new_file(filetype *ft) ...@@ -341,6 +360,7 @@ void document_new_file(filetype *ft)
sci_set_text(doc_list[idx].sci, template); sci_set_text(doc_list[idx].sci, template);
g_free(template); g_free(template);
doc_list[idx].encoding = g_strdup("UTF-8");
document_set_filetype(idx, (ft) ? ft : filetypes[GEANY_FILETYPES_ALL]); document_set_filetype(idx, (ft) ? ft : filetypes[GEANY_FILETYPES_ALL]);
utils_set_window_title(idx); utils_set_window_title(idx);
utils_build_show_hide(idx); utils_build_show_hide(idx);
...@@ -378,9 +398,9 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read ...@@ -378,9 +398,9 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read
GError *err = NULL; GError *err = NULL;
#if defined(HAVE_MMAP) && defined(HAVE_MUNMAP) && defined(HAVE_FCNTL_H) #if defined(HAVE_MMAP) && defined(HAVE_MUNMAP) && defined(HAVE_FCNTL_H)
gint fd; gint fd;
void *map; void *map = NULL;
#else #else
gchar *map; gchar *map = NULL;
#endif #endif
//struct timeval tv, tv1; //struct timeval tv, tv1;
//struct timezone tz; //struct timezone tz;
...@@ -393,13 +413,22 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read ...@@ -393,13 +413,22 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read
} }
else else
{ {
// filename must not be NULL when it is a new file
if (filename == NULL)
{
msgwin_status_add(_("Invalid filename"));
return;
}
// try to get the UTF-8 equivalent for the filename, fallback to filename if error // try to get the UTF-8 equivalent for the filename, fallback to filename if error
locale_filename = g_strdup(filename); locale_filename = g_strdup(filename);
utf8_filename = g_locale_to_utf8(locale_filename, -1, NULL, NULL, &err); utf8_filename = g_locale_to_utf8(locale_filename, -1, NULL, NULL, &err);
if (utf8_filename == NULL) if (utf8_filename == NULL)
{ {
msgwin_status_add("Invalid filename (%s)", err->message); if (err != NULL) msgwin_status_add("%s (%s)", _("Invalid filename"), err->message);
else msgwin_status_add(_("Invalid filename"));
utf8_filename = g_strdup(locale_filename); utf8_filename = g_strdup(locale_filename);
g_error_free(err);
err = NULL; // set to NULL for further usage err = NULL; // set to NULL for further usage
} }
...@@ -431,7 +460,8 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read ...@@ -431,7 +460,8 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read
g_free(locale_filename); g_free(locale_filename);
return; return;
} }
if ((map = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) /// EXPERIMENTAL map is NULL if size is 0, I hope this works in all cases
if ((st.st_size > 0) && ((map = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED))
{ {
msgwin_status_add(_("Could not open file %s (%s)"), utf8_filename, g_strerror(errno)); msgwin_status_add(_("Could not open file %s (%s)"), utf8_filename, g_strerror(errno));
g_free(utf8_filename); g_free(utf8_filename);
...@@ -444,6 +474,7 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read ...@@ -444,6 +474,7 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read
if (! g_file_get_contents(utf8_filename, &map, NULL, &err)) if (! g_file_get_contents(utf8_filename, &map, NULL, &err))
{ {
msgwin_status_add(_("Could not open file %s (%s)"), utf8_filename, err->message); msgwin_status_add(_("Could not open file %s (%s)"), utf8_filename, err->message);
g_error_free(err);
g_free(utf8_filename); g_free(utf8_filename);
g_free(locale_filename); g_free(locale_filename);
return; return;
...@@ -478,11 +509,15 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read ...@@ -478,11 +509,15 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read
} }
else else
{ {
map = converted_text; map = (void*)converted_text;
size = strlen(converted_text); size = strlen(converted_text);
} }
} }
} }
else
{
enc = g_strdup("UTF-8");
}
if (! reload) idx = document_create_new_sci(utf8_filename); if (! reload) idx = document_create_new_sci(utf8_filename);
...@@ -507,6 +542,7 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read ...@@ -507,6 +542,7 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read
else else
{ {
filetype *use_ft = (ft != NULL) ? ft : filetypes_get_from_filename(utf8_filename); filetype *use_ft = (ft != NULL) ? ft : filetypes_get_from_filename(utf8_filename);
sci_goto_pos(doc_list[idx].sci, pos, TRUE); sci_goto_pos(doc_list[idx].sci, pos, TRUE);
//if (app->main_window_realized) // avoids warnings, but doesn't scroll, so accept warning //if (app->main_window_realized) // avoids warnings, but doesn't scroll, so accept warning
sci_scroll_to_line(doc_list[idx].sci, sci_get_line_from_position(doc_list[idx].sci, pos) - 10); sci_scroll_to_line(doc_list[idx].sci, sci_get_line_from_position(doc_list[idx].sci, pos) - 10);
...@@ -519,7 +555,8 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read ...@@ -519,7 +555,8 @@ void document_open_file(gint idx, const gchar *filename, gint pos, gboolean read
utf8_filename, gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)), utf8_filename, gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)),
(readonly) ? _(", read-only") : ""); (readonly) ? _(", read-only") : "");
} }
utils_update_tag_list(idx, TRUE); //utils_update_tag_list(idx, TRUE);
document_update_tag_list(idx);
document_set_text_changed(idx); document_set_text_changed(idx);
#if defined(HAVE_MMAP) && defined(HAVE_MUNMAP) && defined(HAVE_FCNTL_H) #if defined(HAVE_MMAP) && defined(HAVE_MUNMAP) && defined(HAVE_FCNTL_H)
...@@ -622,7 +659,7 @@ void document_save_file(gint idx) ...@@ -622,7 +659,7 @@ void document_save_file(gint idx)
gtk_label_set_text(GTK_LABEL(doc_list[idx].tabmenu_label), basename); gtk_label_set_text(GTK_LABEL(doc_list[idx].tabmenu_label), basename);
treeviews_openfiles_update(doc_list[idx].iter, doc_list[idx].file_name); treeviews_openfiles_update(doc_list[idx].iter, doc_list[idx].file_name);
msgwin_status_add(_("File %s saved."), doc_list[idx].file_name); msgwin_status_add(_("File %s saved."), doc_list[idx].file_name);
utils_update_statusbar(idx); utils_update_statusbar(idx, -1);
treeviews_openfiles_update(doc_list[idx].iter, basename); treeviews_openfiles_update(doc_list[idx].iter, basename);
g_free(basename); g_free(basename);
} }
...@@ -875,24 +912,19 @@ void document_update_tag_list(gint idx) ...@@ -875,24 +912,19 @@ void document_update_tag_list(gint idx)
/* sets the filetype of the the document (sets syntax highlighting and tagging) */ /* sets the filetype of the the document (sets syntax highlighting and tagging) */
void document_set_filetype(gint idx, filetype *type) void document_set_filetype(gint idx, filetype *type)
{ {
gint i;
if (! type || idx < 0) return; if (! type || idx < 0) return;
if (type->id > GEANY_MAX_FILE_TYPES) return;
for(i = 0; i < GEANY_MAX_FILE_TYPES; i++) doc_list[idx].file_type = type;
{
if (filetypes[i] && type == filetypes[i])
{
doc_list[idx].file_type = filetypes[i];
document_update_tag_list(idx); document_update_tag_list(idx);
filetypes[i]->style_func_ptr(doc_list[idx].sci); type->style_func_ptr(doc_list[idx].sci);
/* For C/C++/Java files, get list of typedefs for colorizing */ // For C/C++/Java files, get list of typedefs for colourising
if (sci_get_lexer(doc_list[idx].sci) == SCLEX_CPP) if (sci_get_lexer(doc_list[idx].sci) == SCLEX_CPP)
{ {
guint j, n; guint j, n;
/* assign project keywords */ // assign project keywords
if ((app->tm_workspace) && (app->tm_workspace->work_object.tags_array)) if ((app->tm_workspace) && (app->tm_workspace->work_object.tags_array))
{ {
GPtrArray *typedefs = tm_tags_extract(app->tm_workspace->work_object.tags_array, GPtrArray *typedefs = tm_tags_extract(app->tm_workspace->work_object.tags_array,
...@@ -927,12 +959,8 @@ void document_set_filetype(gint idx, filetype *type) ...@@ -927,12 +959,8 @@ void document_set_filetype(gint idx, filetype *type)
} }
sci_colourise(doc_list[idx].sci, 0, -1); sci_colourise(doc_list[idx].sci, 0, -1);
utils_build_show_hide(idx); utils_build_show_hide(idx);
geany_debug("%s : %s (%s)", geany_debug("%s : %s (%s)", (doc_list[idx].file_name) ? doc_list[idx].file_name : "(null)",
(doc_list[idx].file_name) ? doc_list[idx].file_name : "(null)", type->name, doc_list[idx].encoding);
filetypes[i]->name, doc_list[idx].encoding);
break;
}
}
} }
......
This diff is collapsed.
...@@ -27,28 +27,46 @@ ...@@ -27,28 +27,46 @@
enum enum
{ {
GEANY_FILETYPES_C = 0, GEANY_FILETYPES_C = 0, // 0
GEANY_FILETYPES_CPP, GEANY_FILETYPES_CPP, // 1
GEANY_FILETYPES_JAVA, GEANY_FILETYPES_JAVA, // 2
GEANY_FILETYPES_PERL, GEANY_FILETYPES_PERL, // 3
GEANY_FILETYPES_PHP, GEANY_FILETYPES_PHP, // 4
GEANY_FILETYPES_XML, GEANY_FILETYPES_XML, // 5
GEANY_FILETYPES_DOCBOOK, GEANY_FILETYPES_DOCBOOK, // 6
GEANY_FILETYPES_PYTHON, GEANY_FILETYPES_PYTHON, // 7
GEANY_FILETYPES_TEX, GEANY_FILETYPES_LATEX, // 8
GEANY_FILETYPES_PASCAL, GEANY_FILETYPES_PASCAL, // 9
GEANY_FILETYPES_SH, GEANY_FILETYPES_SH, // 10
GEANY_FILETYPES_MAKE, GEANY_FILETYPES_MAKE, // 11
GEANY_FILETYPES_CSS, GEANY_FILETYPES_CSS, // 12
GEANY_FILETYPES_CONF, GEANY_FILETYPES_CONF, // 13
GEANY_FILETYPES_ASM, GEANY_FILETYPES_ASM, // 14
GEANY_FILETYPES_SQL, GEANY_FILETYPES_SQL, // 15
GEANY_FILETYPES_CAML, GEANY_FILETYPES_CAML, // 16
GEANY_FILETYPES_OMS, GEANY_FILETYPES_OMS, // 17
GEANY_FILETYPES_ALL, GEANY_FILETYPES_ALL, // 18
GEANY_MAX_FILE_TYPES GEANY_MAX_FILE_TYPES // 19
}; };
struct build_menu_items
{
GtkWidget *menu;
GtkWidget *item_compile;
GtkWidget *item_link;
GtkWidget *item_exec;
gboolean can_compile;
gboolean can_link;
gboolean can_exec;
};
struct build_programs
{
gchar *compiler;
gchar *linker;
gchar *run_cmd;
gchar *run_cmd2;
};
typedef struct filetype typedef struct filetype
{ {
...@@ -58,6 +76,11 @@ typedef struct filetype ...@@ -58,6 +76,11 @@ typedef struct filetype
gchar *title; // will be shown in the file open dialog gchar *title; // will be shown in the file open dialog
gchar *extension; gchar *extension;
gchar **pattern; gchar **pattern;
gchar *comment_open;
gchar *comment_close;
gboolean comment_use_indent;
struct build_programs *programs;
struct build_menu_items *menu_items;
void (*style_func_ptr) (ScintillaObject*); void (*style_func_ptr) (ScintillaObject*);
} filetype; } filetype;
...@@ -72,15 +95,11 @@ void filetypes_init_types(void); ...@@ -72,15 +95,11 @@ void filetypes_init_types(void);
/* simple filetype selection based on the filename extension */ /* simple filetype selection based on the filename extension */
filetype *filetypes_get_from_filename(const gchar *filename); filetype *filetypes_get_from_filename(const gchar *filename);
void filetypes_create_menu_item(GtkWidget *menu, gchar *label, filetype *ftype);
void filetypes_create_newmenu_item(GtkWidget *menu, gchar *label, filetype *ftype);
/* frees the array and all related pointers */ /* frees the array and all related pointers */
void filetypes_free_types(void); void filetypes_free_types(void);
gchar *filetypes_get_template(filetype *ft); gchar *filetypes_get_template(filetype *ft);
void filetypes_get_config(GKeyFile *config, gint ft);
#endif #endif
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
#define GEANY_CODENAME "Nivers" #define GEANY_CODENAME "Nivers"
#define GEANY_HOMEPAGE "http://geany.uvena.de/" #define GEANY_HOMEPAGE "http://geany.uvena.de/"
#define GEANY_MAX_OPEN_FILES 25 #define GEANY_MAX_OPEN_FILES 25
#define GEANY_SESSION_FILES 15 #define GEANY_SESSION_FILES 25
#define GEANY_MAX_TAGS_COUNT 1000 #define GEANY_MAX_TAGS_COUNT 1000
#define GEANY_CHECK_FILE_DELAY 30 #define GEANY_CHECK_FILE_DELAY 30
#define GEANY_WORDCHARS "_#&abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" #define GEANY_WORDCHARS "_#&abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
...@@ -129,8 +129,10 @@ typedef struct MyApp ...@@ -129,8 +129,10 @@ typedef struct MyApp
gboolean fullscreen; gboolean fullscreen;
gboolean beep_on_errors; gboolean beep_on_errors;
gboolean switch_msgwin_pages; gboolean switch_msgwin_pages;
gboolean tab_order_ltr;
gboolean show_markers_margin; gboolean show_markers_margin;
gboolean show_linenumber_margin; gboolean show_linenumber_margin;
gboolean brace_match_ltgt;
gboolean main_window_realized; gboolean main_window_realized;
// I know, it is a bit confusing, but this line breaking is globally, // I know, it is a bit confusing, but this line breaking is globally,
// to change the default value at startup, I think // to change the default value at startup, I think
...@@ -151,7 +153,7 @@ typedef struct MyApp ...@@ -151,7 +153,7 @@ typedef struct MyApp
gboolean pref_main_confirm_exit; gboolean pref_main_confirm_exit;
gboolean pref_main_show_search; gboolean pref_main_show_search;
gboolean pref_main_show_goto; gboolean pref_main_show_goto;
gint cur_idx; // currently only used by he build system (build_spawn_cmd) gint cur_idx; // currently only used by the build system (build_spawn_cmd)
gint mru_length; gint mru_length;
gint long_line_column; gint long_line_column;
#ifdef HAVE_FIFO #ifdef HAVE_FIFO
...@@ -172,27 +174,14 @@ typedef struct MyApp ...@@ -172,27 +174,14 @@ typedef struct MyApp
gchar *configdir; gchar *configdir;
gchar *search_text; gchar *search_text;
gchar *terminal_settings; gchar *terminal_settings;
gchar *build_args_inc;
gchar *build_args_libs;
gchar *build_args_prog;
gchar build_make_custopt[256]; gchar build_make_custopt[256];
gchar *build_browser_cmd; gchar *build_browser_cmd;
gchar *build_c_cmd;
gchar *build_cpp_cmd;
/* I called it fpc (www.freepascal.org) to demonstrate I mean a pascal compiler,
* but feel free to use the GNU one as well */
gchar *build_fpc_cmd;
gchar *build_tex_dvi_cmd;
gchar *build_tex_pdf_cmd;
gchar *build_tex_view_dvi_cmd;
gchar *build_tex_view_pdf_cmd;
gchar *build_java_cmd;
gchar *build_javac_cmd;
gchar *build_make_cmd; gchar *build_make_cmd;
gchar *build_term_cmd; gchar *build_term_cmd;
gchar **recent_files; gchar **recent_files;
GtkIconSize toolbar_icon_size; GtkIconSize toolbar_icon_size;
GtkWidget *toolbar; GtkWidget *toolbar;
GtkWidget *run_button;
GtkWidget *compile_button; GtkWidget *compile_button;
GtkWidget *compile_button_image; GtkWidget *compile_button_image;
GtkWidget *tagbar; GtkWidget *tagbar;
...@@ -219,16 +208,13 @@ typedef struct MyApp ...@@ -219,16 +208,13 @@ typedef struct MyApp
GtkWidget *find_dialog; GtkWidget *find_dialog;
GtkWidget *replace_dialog; GtkWidget *replace_dialog;
GtkWidget *default_tag_tree; GtkWidget *default_tag_tree;
//GtkTreeStore *default_tag_store;
const TMWorkspace *tm_workspace; const TMWorkspace *tm_workspace;
GQueue *recent_queue; GQueue *recent_queue;
} MyApp; } MyApp;
MyApp *app; MyApp *app;
gint this_year;
gint this_month;
gint this_day;
// small struct to track tag name and type together // small struct to track tag name and type together
...@@ -275,4 +261,5 @@ extern langType getNamedLanguage(const char *const name); ...@@ -275,4 +261,5 @@ extern langType getNamedLanguage(const char *const name);
// implementation in main.c // implementation in main.c
void geany_debug(gchar const *format, ...); void geany_debug(gchar const *format, ...);
#endif #endif
This diff is collapsed.
...@@ -29,6 +29,7 @@ typedef struct ...@@ -29,6 +29,7 @@ typedef struct
{ {
gint styling[55][4]; gint styling[55][4];
gchar **keywords; gchar **keywords;
gchar *wordchars;
} style_set; } style_set;
...@@ -38,9 +39,11 @@ void styleset_common(ScintillaObject *sci, gint style_bits); ...@@ -38,9 +39,11 @@ void styleset_common(ScintillaObject *sci, gint style_bits);
void styleset_c(ScintillaObject *sci); void styleset_c(ScintillaObject *sci);
void styleset_cpp(ScintillaObject *sci);
void styleset_makefile(ScintillaObject *sci); void styleset_makefile(ScintillaObject *sci);
void styleset_tex(ScintillaObject *sci); void styleset_latex(ScintillaObject *sci);
void styleset_php(ScintillaObject *sci); void styleset_php(ScintillaObject *sci);
......
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