~ubuntu-branches/ubuntu/precise/latexila/precise

« back to all changes in this revision

Viewing changes to src/main.h

  • Committer: Bazaar Package Importer
  • Author(s): Tanguy Ortolo
  • Date: 2010-04-26 22:13:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100426221300-6pa79a1yk5tino7y
Tags: upstream-0.2.0
Import upstream version 0.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of LaTeXila.
 
3
 *
 
4
 * Copyright © 2009, 2010 Sébastien Wilmet
 
5
 *
 
6
 * LaTeXila is free software: you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation, either version 3 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * LaTeXila is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#ifndef MAIN_H
 
21
#define MAIN_H
 
22
 
 
23
#include <locale.h>
 
24
#include <libintl.h>
 
25
#include <gtksourceview/gtksourceview.h>
 
26
#include "config.h"
 
27
 
 
28
// if Native Language Support is enabled
 
29
#ifdef LATEXILA_NLS_ENABLED
 
30
#       define _(STRING) gettext(STRING)
 
31
#else
 
32
#       define _(STRING) (STRING)
 
33
#endif
 
34
 
 
35
#ifndef N_
 
36
#       define N_(STRING) (STRING)
 
37
#endif
 
38
 
 
39
// each document opened is represented by a document_t structure
 
40
typedef struct
 
41
{
 
42
        gchar                   *path;
 
43
        gchar                   *basename;
 
44
        gboolean                saved;
 
45
        gboolean                backup_made;
 
46
        GtkWidget               *source_view;
 
47
        GtkSourceBuffer *source_buffer;
 
48
        GtkWidget               *title;
 
49
} document_t;
 
50
 
 
51
// symbols tables
 
52
typedef struct
 
53
{
 
54
        GtkWidget               *vbox;
 
55
        GtkListStore    *list_stores[7];
 
56
        GtkIconView             *icon_view;
 
57
} symbols_t;
 
58
 
 
59
// preferences, settings
 
60
typedef struct
 
61
{
 
62
        gboolean                                show_line_numbers;
 
63
        gboolean                                show_side_pane;
 
64
        gboolean                                show_edit_toolbar;
 
65
        gint                                    window_width;
 
66
        gint                                    window_height;
 
67
        gboolean                                window_maximised;
 
68
        gint                                    main_hpaned_pos;
 
69
        gint                                    vpaned_pos;
 
70
        gint                                    log_hpaned_pos;
 
71
        gchar                                   *font_str;
 
72
        PangoFontDescription    *font_desc;
 
73
        gint                                    font_size;
 
74
        gchar                                   *command_view;
 
75
        gchar                                   *command_latex;
 
76
        gchar                                   *command_pdflatex;
 
77
        gchar                                   *command_dvipdf;
 
78
        gchar                                   *command_dvips;
 
79
        gchar                                   *command_web_browser;
 
80
        gchar                                   *command_bibtex;
 
81
        gchar                                   *command_makeindex;
 
82
        gboolean                                compile_show_all_output;
 
83
        gboolean                                compile_non_stop;
 
84
        gchar                                   *file_chooser_dir;
 
85
        gchar                                   *file_browser_dir;
 
86
        gboolean                                file_browser_show_all_files;
 
87
        gboolean                                file_browser_show_hidden_files;
 
88
        GPtrArray                               *list_opened_docs;
 
89
        gboolean                                reopen_files_on_startup;
 
90
        gboolean                                delete_aux_files;
 
91
        gchar                                   *style_scheme_id;
 
92
        gint                                    tab_width;
 
93
        gboolean                                spaces_instead_of_tabs;
 
94
        gboolean                                highlight_current_line;
 
95
        gboolean                                highlight_matching_brackets;
 
96
        gboolean                                toolbars_horizontal;
 
97
        gint                                    side_pane_page;
 
98
        gboolean                                make_backup;
 
99
        gboolean                                auto_save;
 
100
        gint                                    auto_save_interval;
 
101
} preferences_t;
 
102
 
 
103
// actions from the menu or the toolbars
 
104
// so we can change the sensitivity of these actions
 
105
typedef struct
 
106
{
 
107
        GtkAction *undo;
 
108
        GtkAction *redo;
 
109
        GtkAction *compile_latex;
 
110
        GtkAction *compile_pdflatex;
 
111
        GtkAction *dvi_to_pdf;
 
112
        GtkAction *dvi_to_ps;
 
113
        GtkAction *view_dvi;
 
114
        GtkAction *view_pdf;
 
115
        GtkAction *view_ps;
 
116
        GtkAction *bibtex;
 
117
        GtkAction *makeindex;
 
118
        GtkAction *stop_execution;
 
119
        GtkAction *go_previous_error;
 
120
        GtkAction *go_previous_warning;
 
121
        GtkAction *go_previous_badbox;
 
122
        GtkAction *go_next_error;
 
123
        GtkAction *go_next_warning;
 
124
        GtkAction *go_next_badbox;
 
125
} actions_t;
 
126
 
 
127
// Go to line, Find and Replace are under the source view
 
128
typedef struct
 
129
{
 
130
        GtkWidget       *go_to_line;
 
131
        GtkWidget       *go_to_line_entry;
 
132
        GtkWidget       *find;
 
133
        GtkWidget       *find_entry;
 
134
        GtkWidget       *find_match_case;
 
135
        GtkWidget       *replace;
 
136
        GtkWidget       *replace_entry_search;
 
137
        GtkWidget       *replace_entry_replace;
 
138
        GtkWidget       *replace_match_case;
 
139
        GtkWidget       *replace_button;
 
140
} under_source_view_t;
 
141
 
 
142
// main structure containing all the others
 
143
typedef struct
 
144
{
 
145
        GList                           *all_docs;
 
146
        document_t                      *active_doc;
 
147
        symbols_t                       symbols;
 
148
        preferences_t           prefs;
 
149
        actions_t                       actions;
 
150
        under_source_view_t under_source_view;
 
151
        GtkWindow                       *main_window;
 
152
        GtkNotebook                     *notebook;
 
153
        GtkStatusbar            *statusbar;
 
154
        GtkStatusbar            *cursor_position;
 
155
        GtkPaned                        *main_hpaned;
 
156
        GtkPaned                        *vpaned;
 
157
        GtkPaned                        *log_hpaned;
 
158
        GtkWidget                       *edit_toolbar;
 
159
        GtkWidget                       *side_pane;
 
160
        guint                           auto_save_timeout;
 
161
} latexila_t;
 
162
 
 
163
// a lot of things are accessible by the "latexila" variable everywhere in the
 
164
// sources (if this file is included)
 
165
extern latexila_t latexila;
 
166
 
 
167
#endif /* MAIN_H */