Logo Search packages:      
Sourcecode: latexila version File versions  Download package

main.h

/*
 * This file is part of LaTeXila.
 *
 * Copyright © 2009, 2010 Sébastien Wilmet
 *
 * LaTeXila 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 3 of the License, or
 * (at your option) any later version.
 *
 * LaTeXila 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 LaTeXila.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef MAIN_H
#define MAIN_H

#include <locale.h>
#include <libintl.h>
#include <gtksourceview/gtksourceview.h>
#include "config.h"

// if Native Language Support is enabled
#ifdef LATEXILA_NLS_ENABLED
#     define _(STRING) gettext(STRING)
#else
#     define _(STRING) (STRING)
#endif

#ifndef N_
#     define N_(STRING) (STRING)
#endif

// each document opened is represented by a document_t structure
typedef struct
{
      gchar             *path;
      gchar             *basename;
      gboolean          saved;
      gboolean          backup_made;
      GtkWidget         *source_view;
      GtkSourceBuffer   *source_buffer;
      GtkWidget         *title;
} document_t;

// symbols tables
typedef struct
{
      GtkWidget         *vbox;
      GtkListStore      *list_stores[7];
      GtkIconView       *icon_view;
} symbols_t;

// preferences, settings
typedef struct
{
      gboolean                      show_line_numbers;
      gboolean                      show_side_pane;
      gboolean                      show_edit_toolbar;
      gint                          window_width;
      gint                          window_height;
      gboolean                      window_maximised;
      gint                          main_hpaned_pos;
      gint                          vpaned_pos;
      gint                          log_hpaned_pos;
      gchar                         *font_str;
      PangoFontDescription    *font_desc;
      gint                          font_size;
      gchar                         *command_view;
      gchar                         *command_latex;
      gchar                         *command_pdflatex;
      gchar                         *command_dvipdf;
      gchar                         *command_dvips;
      gchar                         *command_web_browser;
      gchar                         *command_bibtex;
      gchar                         *command_makeindex;
      gboolean                      compile_show_all_output;
      gboolean                      compile_non_stop;
      gchar                         *file_chooser_dir;
      gchar                         *file_browser_dir;
      gboolean                      file_browser_show_all_files;
      gboolean                      file_browser_show_hidden_files;
      GPtrArray                     *list_opened_docs;
      gboolean                      reopen_files_on_startup;
      gboolean                      delete_aux_files;
      gchar                         *style_scheme_id;
      gint                          tab_width;
      gboolean                      spaces_instead_of_tabs;
      gboolean                      highlight_current_line;
      gboolean                      highlight_matching_brackets;
      gboolean                      toolbars_horizontal;
      gint                          side_pane_page;
      gboolean                      make_backup;
      gboolean                      auto_save;
      gint                          auto_save_interval;
} preferences_t;

// actions from the menu or the toolbars
// so we can change the sensitivity of these actions
typedef struct
{
      GtkAction *undo;
      GtkAction *redo;
      GtkAction *compile_latex;
      GtkAction *compile_pdflatex;
      GtkAction *dvi_to_pdf;
      GtkAction *dvi_to_ps;
      GtkAction *view_dvi;
      GtkAction *view_pdf;
      GtkAction *view_ps;
      GtkAction *bibtex;
      GtkAction *makeindex;
      GtkAction *stop_execution;
      GtkAction *go_previous_error;
      GtkAction *go_previous_warning;
      GtkAction *go_previous_badbox;
      GtkAction *go_next_error;
      GtkAction *go_next_warning;
      GtkAction *go_next_badbox;
} actions_t;

// Go to line, Find and Replace are under the source view
typedef struct
{
      GtkWidget   *go_to_line;
      GtkWidget   *go_to_line_entry;
      GtkWidget   *find;
      GtkWidget   *find_entry;
      GtkWidget   *find_match_case;
      GtkWidget   *replace;
      GtkWidget   *replace_entry_search;
      GtkWidget   *replace_entry_replace;
      GtkWidget   *replace_match_case;
      GtkWidget   *replace_button;
} under_source_view_t;

// main structure containing all the others
typedef struct
{
      GList                   *all_docs;
      document_t              *active_doc;
      symbols_t               symbols;
      preferences_t           prefs;
      actions_t               actions;
      under_source_view_t under_source_view;
      GtkWindow               *main_window;
      GtkNotebook             *notebook;
      GtkStatusbar            *statusbar;
      GtkStatusbar            *cursor_position;
      GtkPaned                *main_hpaned;
      GtkPaned                *vpaned;
      GtkPaned                *log_hpaned;
      GtkWidget               *edit_toolbar;
      GtkWidget               *side_pane;
      guint                   auto_save_timeout;
} latexila_t;

// a lot of things are accessible by the "latexila" variable everywhere in the
// sources (if this file is included)
extern latexila_t latexila;

#endif /* MAIN_H */

Generated by  Doxygen 1.6.0   Back to index