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>
|
|
|
|
|
|
|
|
#include "tm_tagmanager.h"
|
|
|
|
|
2006-01-06 18:37:24 +00:00
|
|
|
|
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-09-27 12:50:29 +00:00
|
|
|
#define GEANY_CODENAME "Kintaro"
|
2005-11-22 12:26:26 +00:00
|
|
|
#define GEANY_HOMEPAGE "http://geany.uvena.de/"
|
2006-10-24 23:50:50 +00:00
|
|
|
#define GEANY_USE_WIN32_DIALOG 0
|
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
|
2006-08-13 15:04:30 +00:00
|
|
|
#define GEANY_MAX_AUTOCOMPLETE_HEIGHT 10
|
2005-11-22 12:26:26 +00:00
|
|
|
#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"
|
2006-09-22 12:05:18 +00:00
|
|
|
#ifdef G_OS_WIN32
|
|
|
|
#define GEANY_DEFAULT_TOOLS_TERMINAL "cmd.exe"
|
|
|
|
#else
|
2006-07-01 15:04:41 +00:00
|
|
|
#define GEANY_DEFAULT_TOOLS_TERMINAL "xterm"
|
2006-09-22 12:05:18 +00:00
|
|
|
#endif
|
2006-07-01 15:04:41 +00:00
|
|
|
#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-08-08 13:01:50 +00:00
|
|
|
#define GEANY_DEFAULT_MRU_LENGTH 10
|
2006-07-24 17:27:30 +00:00
|
|
|
#define GEANY_DEFAULT_FONT_SYMBOL_LIST "Sans 9"
|
|
|
|
#define GEANY_DEFAULT_FONT_MSG_WINDOW "Sans 9"
|
|
|
|
#define GEANY_DEFAULT_FONT_EDITOR "Monospace 10"
|
2005-11-22 12:26:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* 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;
|
2006-07-21 11:41:33 +00:00
|
|
|
gboolean ignore_callback;
|
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-08-08 13:01:50 +00:00
|
|
|
guint mru_length;
|
2006-08-13 15:04:30 +00:00
|
|
|
gint autocompletion_max_height;
|
2006-06-30 14:28:32 +00:00
|
|
|
gint long_line_type;
|
2005-12-11 02:16:02 +00:00
|
|
|
gint long_line_column;
|
|
|
|
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;
|
2006-07-26 17:02:16 +00:00
|
|
|
gchar *datadir;
|
|
|
|
gchar *docdir;
|
2006-08-19 12:56:30 +00:00
|
|
|
gchar *custom_date_format;
|
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];
|
2006-08-01 10:35:32 +00:00
|
|
|
GtkWidget *popup_items[5];
|
|
|
|
GtkWidget *menu_copy_items[5];
|
2006-07-11 14:15:56 +00:00
|
|
|
GtkWidget *redo_items[3];
|
|
|
|
GtkWidget *undo_items[3];
|
2006-08-26 16:44:08 +00:00
|
|
|
GtkWidget *save_buttons[4];
|
2006-08-19 12:56:30 +00:00
|
|
|
GtkWidget *sensitive_buttons[37];
|
2005-11-22 12:26:26 +00:00
|
|
|
GtkWidget *open_colorsel;
|
|
|
|
GtkWidget *open_fontsel;
|
|
|
|
GtkWidget *open_filesel;
|
|
|
|
GtkWidget *save_filesel;
|
|
|
|
GtkWidget *prefs_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)
|
|
|
|
};
|
|
|
|
|
2006-10-18 20:48:54 +00:00
|
|
|
enum
|
|
|
|
{
|
2006-10-19 13:19:58 +00:00
|
|
|
MSG_STATUS = 0, // force it to start at 0 to keep in sync with the notebook page numbers
|
2006-10-18 20:48:54 +00:00
|
|
|
MSG_COMPILER,
|
|
|
|
MSG_MESSAGE,
|
|
|
|
MSG_SCRATCH,
|
|
|
|
MSG_VTE,
|
|
|
|
TREEVIEW_SYMBOL,
|
|
|
|
TREEVIEW_OPENFILES
|
|
|
|
};
|
|
|
|
|
2006-04-27 18:06:35 +00:00
|
|
|
|
2006-10-21 11:16:54 +00:00
|
|
|
// implementation in main.c; prototype is here so that all files can use it.
|
|
|
|
void geany_debug(gchar const *format, ...) G_GNUC_PRINTF (1, 2);
|
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
#endif
|