2005-11-22 12:26:26 +00:00
|
|
|
/*
|
|
|
|
* geany.h - this file is part of Geany, a fast and lightweight IDE
|
|
|
|
*
|
2006-01-06 18:37:24 +00:00
|
|
|
* Copyright 2006 Enrico Troeger <enrico.troeger@uvena.de>
|
2005-11-22 12:26:26 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2006-05-22 00:25:19 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2005-11-22 12:26:26 +00:00
|
|
|
*
|
2005-11-27 20:54:28 +00:00
|
|
|
* $Id$
|
2005-11-22 12:26:26 +00:00
|
|
|
*/
|
|
|
|
|
2006-07-20 21:17:17 +00:00
|
|
|
#ifndef GEANY_H
|
|
|
|
#define GEANY_H
|
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#ifndef PLAT_GTK
|
|
|
|
# define PLAT_GTK 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "Scintilla.h"
|
|
|
|
#include "ScintillaWidget.h"
|
|
|
|
|
|
|
|
#include "tm_tagmanager.h"
|
|
|
|
|
|
|
|
#include "filetypes.h"
|
|
|
|
|
|
|
|
#define SSM(s, m, w, l) scintilla_send_message(s, m, w, l)
|
|
|
|
|
2006-01-06 18:37:24 +00:00
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
# include <windows.h>
|
|
|
|
# include <commdlg.h>
|
|
|
|
# define GEANY_WIN32
|
|
|
|
# define GEANY_DATA_DIR PACKAGE_DATA_DIR
|
|
|
|
#else
|
|
|
|
# define GEANY_DATA_DIR PACKAGE_DATA_DIR "/" PACKAGE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2006-03-15 23:19:45 +00:00
|
|
|
// for detailed description look in the documentation, things are not
|
|
|
|
// listed in the documentation should not be changed ;-)
|
2005-11-22 12:26:26 +00:00
|
|
|
#define GEANY_HOME_DIR g_get_home_dir()
|
2006-05-19 17:18:06 +00:00
|
|
|
#define GEANY_FILEDEFS_SUBDIR "filedefs"
|
2006-02-10 21:03:42 +00:00
|
|
|
#define GEANY_FIFO_NAME "geany_fifo.0"
|
2006-06-11 19:03:39 +00:00
|
|
|
#define GEANY_CODENAME "Kadir"
|
2005-11-22 12:26:26 +00:00
|
|
|
#define GEANY_HOMEPAGE "http://geany.uvena.de/"
|
|
|
|
#define GEANY_MAX_OPEN_FILES 25
|
2006-04-27 18:06:35 +00:00
|
|
|
#define GEANY_SESSION_FILES 25
|
2005-11-22 12:26:26 +00:00
|
|
|
#define GEANY_MAX_TAGS_COUNT 1000
|
2006-03-10 00:48:37 +00:00
|
|
|
#define GEANY_CHECK_FILE_DELAY 30
|
2006-06-24 14:36:35 +00:00
|
|
|
#define GEANY_WORDCHARS "_#&abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\\"
|
2006-06-18 20:21:19 +00:00
|
|
|
#define GEANY_MAX_WORD_LENGTH 192
|
2005-11-22 12:26:26 +00:00
|
|
|
#define GEANY_MAX_AUTOCOMPLETE_WORDS 30
|
|
|
|
#define GEANY_STRING_UNTITLED _("untitled")
|
2006-03-15 23:19:45 +00:00
|
|
|
#define GEANY_MSGWIN_HEIGHT 208
|
|
|
|
#define GEANY_WINDOW_MINIMAL_WIDTH 620
|
|
|
|
#define GEANY_WINDOW_MINIMAL_HEIGHT 440
|
|
|
|
#define GEANY_WINDOW_DEFAULT_WIDTH 900
|
|
|
|
#define GEANY_WINDOW_DEFAULT_HEIGHT 600
|
2006-07-01 15:04:41 +00:00
|
|
|
// some default settings which are used at the very first start of Geany to fill configuration file
|
|
|
|
#define GEANY_DEFAULT_TOOLS_MAKE "make"
|
|
|
|
#define GEANY_DEFAULT_TOOLS_TERMINAL "xterm"
|
|
|
|
#define GEANY_DEFAULT_TOOLS_BROWSER "mozilla"
|
|
|
|
#define GEANY_DEFAULT_TOOLS_PRINTCMD "lpr"
|
2006-07-13 14:30:44 +00:00
|
|
|
#define GEANY_DEFAULT_TOOLS_GREP "grep"
|
2006-07-01 15:04:41 +00:00
|
|
|
#define GEANY_DEFAULT_MRU_LENGHTH 10
|
|
|
|
#define GEANY_DEFAULT_FONT_SYMBOL_LIST "Cursor 8"
|
|
|
|
#define GEANY_DEFAULT_FONT_MSG_WINDOW "Cursor 8"
|
|
|
|
#define GEANY_DEFAULT_FONT_EDITOR "Courier New 9"
|
2005-11-22 12:26:26 +00:00
|
|
|
|
|
|
|
#ifndef DOCDIR
|
2005-12-18 22:38:57 +00:00
|
|
|
# define DOCDIR PACKAGE_DATA_DIR"/doc/"PACKAGE"/html/"
|
2005-11-22 12:26:26 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* structure for representing an open tab with all its related stuff. */
|
|
|
|
typedef struct document
|
|
|
|
{
|
2006-01-09 17:58:04 +00:00
|
|
|
gboolean is_valid;
|
2006-01-14 22:38:56 +00:00
|
|
|
gboolean has_tags;
|
2006-01-23 17:05:29 +00:00
|
|
|
// the filename is encoded in UTF-8, but every GLibC function expect the locale representation
|
2005-11-22 12:26:26 +00:00
|
|
|
gchar *file_name;
|
|
|
|
gchar *encoding;
|
|
|
|
filetype *file_type;
|
|
|
|
TMWorkObject *tm_file;
|
|
|
|
ScintillaObject *sci;
|
|
|
|
GtkWidget *tab_label;
|
|
|
|
GtkWidget *tabmenu_label;
|
2005-12-18 22:08:42 +00:00
|
|
|
GtkWidget *tag_tree;
|
|
|
|
GtkTreeStore *tag_store;
|
2005-11-22 12:26:26 +00:00
|
|
|
GtkTreeIter iter;
|
|
|
|
gboolean readonly;
|
|
|
|
gboolean changed;
|
|
|
|
gboolean do_overwrite;
|
|
|
|
gboolean line_breaking;
|
2006-02-14 22:07:55 +00:00
|
|
|
gboolean use_auto_indention;
|
2005-11-22 12:26:26 +00:00
|
|
|
time_t last_check; // to remember the last disk check
|
|
|
|
time_t mtime;
|
|
|
|
} document;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* array of document elements to hold all information of the notebook tabs */
|
|
|
|
document doc_list[GEANY_MAX_OPEN_FILES];
|
|
|
|
|
|
|
|
|
|
|
|
/* store some pointers and variables for frequently used widgets */
|
|
|
|
typedef struct MyApp
|
|
|
|
{
|
|
|
|
gint toolbar_icon_style;
|
2006-01-09 17:58:04 +00:00
|
|
|
// 0:x, 1:y, 2:width, 3:height
|
2005-11-22 12:26:26 +00:00
|
|
|
gint geometry[4];
|
|
|
|
gboolean debug_mode;
|
2005-12-18 22:08:42 +00:00
|
|
|
// represents the state at startup while opening session files
|
|
|
|
gboolean opening_session_files;
|
2006-01-11 18:44:52 +00:00
|
|
|
// represents the state when Geany is quitting completely
|
|
|
|
gboolean quitting;
|
2005-11-22 12:26:26 +00:00
|
|
|
gboolean ignore_global_tags;
|
|
|
|
gboolean toolbar_visible;
|
2006-07-07 14:34:43 +00:00
|
|
|
gboolean sidebar_symbol_visible;
|
|
|
|
gboolean sidebar_openfiles_visible;
|
|
|
|
gboolean sidebar_visible;
|
2005-11-22 12:26:26 +00:00
|
|
|
gboolean msgwindow_visible;
|
|
|
|
gboolean fullscreen;
|
2006-01-03 12:39:25 +00:00
|
|
|
gboolean beep_on_errors;
|
2005-11-24 22:28:45 +00:00
|
|
|
gboolean switch_msgwin_pages;
|
2006-04-27 18:06:35 +00:00
|
|
|
gboolean tab_order_ltr;
|
2006-02-14 22:07:55 +00:00
|
|
|
gboolean show_markers_margin;
|
|
|
|
gboolean show_linenumber_margin;
|
2006-04-27 18:06:35 +00:00
|
|
|
gboolean brace_match_ltgt;
|
2005-11-22 12:26:26 +00:00
|
|
|
gboolean main_window_realized;
|
2006-02-14 22:07:55 +00:00
|
|
|
// I know, it is a bit confusing, but this line breaking is globally,
|
|
|
|
// to change the default value at startup, I think
|
|
|
|
gboolean pref_editor_line_breaking;
|
|
|
|
gboolean pref_editor_use_auto_indention;
|
2006-06-13 19:37:21 +00:00
|
|
|
gboolean pref_editor_use_indicators;
|
2006-02-14 22:07:55 +00:00
|
|
|
gboolean pref_editor_show_white_space;
|
|
|
|
gboolean pref_editor_show_indent_guide;
|
|
|
|
gboolean pref_editor_show_line_endings;
|
|
|
|
gboolean pref_editor_auto_close_xml_tags;
|
|
|
|
gboolean pref_editor_auto_complete_constructs;
|
2006-02-26 18:19:28 +00:00
|
|
|
gboolean pref_editor_folding;
|
2005-11-22 12:26:26 +00:00
|
|
|
gint pref_editor_tab_width;
|
2006-06-21 18:54:07 +00:00
|
|
|
gint pref_editor_default_encoding;
|
2005-11-22 12:26:26 +00:00
|
|
|
gboolean pref_editor_new_line;
|
2006-06-21 18:54:07 +00:00
|
|
|
gboolean pref_editor_replace_tabs;
|
2005-11-22 12:26:26 +00:00
|
|
|
gboolean pref_editor_trail_space;
|
|
|
|
gboolean pref_main_load_session;
|
|
|
|
gboolean pref_main_save_winpos;
|
|
|
|
gboolean pref_main_confirm_exit;
|
2006-07-11 14:15:56 +00:00
|
|
|
gboolean pref_toolbar_show_search;
|
|
|
|
gboolean pref_toolbar_show_goto;
|
|
|
|
gboolean pref_toolbar_show_undo;
|
|
|
|
gboolean pref_toolbar_show_compile;
|
|
|
|
gboolean pref_toolbar_show_zoom;
|
|
|
|
gboolean pref_toolbar_show_colour;
|
2006-07-15 18:15:30 +00:00
|
|
|
gboolean pref_toolbar_show_fileops;
|
2006-07-02 16:21:35 +00:00
|
|
|
gint tab_pos_editor;
|
|
|
|
gint tab_pos_msgwin;
|
|
|
|
gint tab_pos_sidebar;
|
2006-04-27 18:06:35 +00:00
|
|
|
gint cur_idx; // currently only used by the build system (build_spawn_cmd)
|
2005-12-12 02:23:51 +00:00
|
|
|
gint mru_length;
|
2006-06-30 14:28:32 +00:00
|
|
|
gint long_line_type;
|
2005-12-11 02:16:02 +00:00
|
|
|
gint long_line_column;
|
2006-02-14 22:07:55 +00:00
|
|
|
#ifdef HAVE_FIFO
|
|
|
|
gboolean ignore_fifo;
|
2006-06-11 19:03:39 +00:00
|
|
|
GIOChannel *fifo_ioc;
|
2006-02-14 22:07:55 +00:00
|
|
|
#endif
|
2006-01-06 18:37:24 +00:00
|
|
|
#ifdef HAVE_VTE
|
2006-05-22 00:25:19 +00:00
|
|
|
gboolean load_vte;
|
|
|
|
gboolean have_vte;
|
2006-01-06 18:37:24 +00:00
|
|
|
gchar *lib_vte;
|
2006-07-02 18:34:03 +00:00
|
|
|
gchar *terminal_settings;
|
2006-01-06 18:37:24 +00:00
|
|
|
#endif
|
2005-12-11 02:16:02 +00:00
|
|
|
gchar *long_line_color;
|
2005-11-22 12:26:26 +00:00
|
|
|
gchar *pref_template_developer;
|
|
|
|
gchar *pref_template_company;
|
|
|
|
gchar *pref_template_mail;
|
|
|
|
gchar *pref_template_initial;
|
|
|
|
gchar *pref_template_version;
|
|
|
|
gchar *editor_font;
|
|
|
|
gchar *tagbar_font;
|
|
|
|
gchar *msgwin_font;
|
|
|
|
gchar *configdir;
|
|
|
|
gchar *search_text;
|
|
|
|
gchar build_make_custopt[256];
|
2006-06-29 14:00:09 +00:00
|
|
|
gchar *tools_browser_cmd;
|
|
|
|
gchar *tools_make_cmd;
|
|
|
|
gchar *tools_term_cmd;
|
|
|
|
gchar *tools_print_cmd;
|
2006-07-13 14:30:44 +00:00
|
|
|
gchar *tools_grep_cmd;
|
2005-11-22 12:26:26 +00:00
|
|
|
GtkIconSize toolbar_icon_size;
|
|
|
|
GtkWidget *toolbar;
|
2006-04-27 18:06:35 +00:00
|
|
|
GtkWidget *run_button;
|
2005-11-22 12:26:26 +00:00
|
|
|
GtkWidget *compile_button;
|
|
|
|
GtkWidget *compile_button_image;
|
|
|
|
GtkWidget *tagbar;
|
|
|
|
GtkWidget *treeview_notebook;
|
|
|
|
GtkWidget *notebook;
|
|
|
|
GtkWidget *statusbar;
|
|
|
|
GtkWidget *window;
|
|
|
|
GtkWidget *popup_menu;
|
|
|
|
GtkWidget *toolbar_menu;
|
|
|
|
GtkWidget *new_file_menu;
|
|
|
|
GtkWidget *menu_insert_include_item[2];
|
|
|
|
GtkWidget *popup_goto_items[3];
|
|
|
|
GtkWidget *popup_items[4];
|
|
|
|
GtkWidget *menu_copy_items[4];
|
2006-07-11 14:15:56 +00:00
|
|
|
GtkWidget *redo_items[3];
|
|
|
|
GtkWidget *undo_items[3];
|
2005-11-22 12:26:26 +00:00
|
|
|
GtkWidget *save_buttons[2];
|
2006-06-29 17:14:52 +00:00
|
|
|
GtkWidget *sensitive_buttons[33];
|
2005-11-22 12:26:26 +00:00
|
|
|
GtkWidget *open_colorsel;
|
|
|
|
GtkWidget *open_fontsel;
|
|
|
|
GtkWidget *open_filesel;
|
|
|
|
GtkWidget *save_filesel;
|
|
|
|
GtkWidget *prefs_dialog;
|
|
|
|
GtkWidget *find_dialog;
|
|
|
|
GtkWidget *replace_dialog;
|
2006-07-13 14:30:44 +00:00
|
|
|
GtkWidget *find_in_files_dialog;
|
2005-12-18 22:08:42 +00:00
|
|
|
GtkWidget *default_tag_tree;
|
2005-11-22 12:26:26 +00:00
|
|
|
const TMWorkspace *tm_workspace;
|
|
|
|
GQueue *recent_queue;
|
|
|
|
} MyApp;
|
|
|
|
|
|
|
|
MyApp *app;
|
|
|
|
|
2006-05-19 17:18:06 +00:00
|
|
|
|
2005-12-11 02:16:02 +00:00
|
|
|
// small struct to track tag name and type together
|
|
|
|
typedef struct GeanySymbol
|
|
|
|
{
|
|
|
|
gchar *str;
|
|
|
|
gint type;
|
2006-05-15 19:44:09 +00:00
|
|
|
gint line;
|
2005-12-11 02:16:02 +00:00
|
|
|
} GeanySymbol;
|
|
|
|
|
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
GEANY_IMAGE_SMALL_CROSS,
|
|
|
|
GEANY_IMAGE_LOGO,
|
|
|
|
GEANY_IMAGE_COMPILE,
|
|
|
|
GEANY_IMAGE_SAVE_ALL,
|
|
|
|
GEANY_IMAGE_NEW_ARROW
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
UP,
|
|
|
|
DOWN,
|
|
|
|
LEFT,
|
|
|
|
RIGHT
|
|
|
|
};
|
|
|
|
|
2006-02-22 13:40:26 +00:00
|
|
|
enum {
|
|
|
|
KILOBYTE = 1024,
|
|
|
|
MEGABYTE = (KILOBYTE*1024),
|
|
|
|
GIGABYTE = (MEGABYTE*1024)
|
|
|
|
};
|
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
// implementation in main.c
|
|
|
|
void geany_debug(gchar const *format, ...);
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
#endif
|