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
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*
|
2005-11-27 20:54:28 +00:00
|
|
|
* $Id$
|
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
|
|
|
|
|
|
|
|
#ifndef GEANY_H
|
|
|
|
#define GEANY_H
|
|
|
|
|
|
|
|
#include "Scintilla.h"
|
|
|
|
#include "SciLexer.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
|
|
|
#define INLINE inline
|
|
|
|
//#define INLINE
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
#define GEANY_HOME_DIR g_get_home_dir()
|
2006-01-09 17:58:04 +00:00
|
|
|
#define GEANY_CODENAME "Rebus"
|
2005-11-22 12:26:26 +00:00
|
|
|
#define GEANY_HOMEPAGE "http://geany.uvena.de/"
|
|
|
|
#define GEANY_MAX_OPEN_FILES 25
|
2005-12-12 02:23:51 +00:00
|
|
|
#define GEANY_SESSION_FILES 15
|
2005-11-22 12:26:26 +00:00
|
|
|
#define GEANY_MAX_TAGS_COUNT 1000
|
|
|
|
#define GEANY_WORDCHARS "_#&abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
|
|
|
#define GEANY_MAX_AUTOCOMPLETE_WORDS 30
|
2005-11-27 20:54:28 +00:00
|
|
|
#define GEANY_MSGWIN_HEIGHT 240
|
2005-11-22 12:26:26 +00:00
|
|
|
#define GEANY_STRING_UNTITLED _("untitled")
|
|
|
|
|
|
|
|
|
|
|
|
#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;
|
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;
|
|
|
|
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-27 20:54:28 +00:00
|
|
|
gboolean have_vte;
|
2005-11-22 12:26:26 +00:00
|
|
|
gboolean ignore_global_tags;
|
|
|
|
gboolean toolbar_visible;
|
2005-12-11 02:16:02 +00:00
|
|
|
gboolean treeview_symbol_visible;
|
|
|
|
gboolean treeview_openfiles_visible;
|
2005-11-22 12:26:26 +00:00
|
|
|
gboolean msgwindow_visible;
|
|
|
|
gboolean show_white_space;
|
|
|
|
gboolean use_auto_indention;
|
|
|
|
gboolean show_indent_guide;
|
|
|
|
//gboolean line_breaking;
|
|
|
|
gboolean show_line_endings;
|
|
|
|
gboolean show_markers_margin;
|
|
|
|
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;
|
2005-11-22 12:26:26 +00:00
|
|
|
gboolean auto_close_xml_tags;
|
|
|
|
gboolean auto_complete_constructs;
|
|
|
|
gboolean main_window_realized;
|
|
|
|
gint pref_editor_tab_width;
|
|
|
|
gboolean pref_editor_new_line;
|
|
|
|
gboolean pref_editor_trail_space;
|
|
|
|
gboolean pref_main_load_session;
|
|
|
|
gboolean pref_main_save_winpos;
|
|
|
|
gboolean pref_main_confirm_exit;
|
|
|
|
gboolean pref_main_show_search;
|
2005-12-12 02:23:51 +00:00
|
|
|
gint mru_length;
|
2005-12-11 02:16:02 +00:00
|
|
|
gint long_line_column;
|
2006-01-06 18:37:24 +00:00
|
|
|
#ifdef HAVE_VTE
|
|
|
|
gchar *lib_vte;
|
|
|
|
#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;
|
2005-11-24 22:28:45 +00:00
|
|
|
gchar *terminal_settings;
|
2005-11-22 12:26:26 +00:00
|
|
|
gchar *build_args_inc;
|
|
|
|
gchar *build_args_libs;
|
|
|
|
gchar *build_args_prog;
|
|
|
|
gchar build_make_custopt[256];
|
|
|
|
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;
|
2006-01-11 18:44:52 +00:00
|
|
|
gchar *build_tex_dvi_cmd;
|
|
|
|
gchar *build_tex_pdf_cmd;
|
|
|
|
gchar *build_tex_view_dvi_cmd;
|
|
|
|
gchar *build_tex_view_pdf_cmd;
|
2005-11-22 12:26:26 +00:00
|
|
|
gchar *build_java_cmd;
|
|
|
|
gchar *build_javac_cmd;
|
|
|
|
gchar *build_make_cmd;
|
|
|
|
gchar *build_term_cmd;
|
|
|
|
gchar **recent_files;
|
|
|
|
GtkIconSize toolbar_icon_size;
|
|
|
|
GtkWidget *toolbar;
|
|
|
|
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];
|
|
|
|
GtkWidget *redo_items[2];
|
|
|
|
GtkWidget *undo_items[2];
|
|
|
|
GtkWidget *save_buttons[2];
|
|
|
|
GtkWidget *sensitive_buttons[16];
|
|
|
|
GtkWidget *open_colorsel;
|
|
|
|
GtkWidget *open_fontsel;
|
|
|
|
GtkWidget *open_filesel;
|
|
|
|
GtkWidget *save_filesel;
|
|
|
|
GtkWidget *prefs_dialog;
|
|
|
|
GtkWidget *find_dialog;
|
|
|
|
GtkWidget *replace_dialog;
|
|
|
|
GtkWidget *build_menu_item_link;
|
2005-12-18 22:08:42 +00:00
|
|
|
GtkWidget *default_tag_tree;
|
|
|
|
//GtkTreeStore *default_tag_store;
|
2005-11-22 12:26:26 +00:00
|
|
|
const TMWorkspace *tm_workspace;
|
|
|
|
GQueue *recent_queue;
|
|
|
|
} MyApp;
|
|
|
|
|
|
|
|
MyApp *app;
|
|
|
|
|
|
|
|
gint this_year;
|
|
|
|
gint this_month;
|
|
|
|
gint this_day;
|
|
|
|
|
2005-12-11 02:16:02 +00:00
|
|
|
|
|
|
|
// small struct to track tag name and type together
|
|
|
|
typedef struct GeanySymbol
|
|
|
|
{
|
|
|
|
gchar *str;
|
|
|
|
gint type;
|
|
|
|
} 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 {
|
|
|
|
GEANY_RESPONSE_REPLACE = 1,
|
|
|
|
GEANY_RESPONSE_REPLACE_ALL = 2,
|
|
|
|
GEANY_RESPONSE_REPLACE_SEL = 3
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
UP,
|
|
|
|
DOWN,
|
|
|
|
LEFT,
|
|
|
|
RIGHT
|
|
|
|
};
|
|
|
|
|
|
|
|
// prototype from tagmanager/parse.h, used in document.c, ugly but it works
|
|
|
|
extern langType getNamedLanguage(const char *const name);
|
|
|
|
|
|
|
|
// implementation in main.c
|
|
|
|
void geany_debug(gchar const *format, ...);
|
|
|
|
|
|
|
|
#endif
|