medit/moo/mooedit/mooedit-private.h

172 lines
5.3 KiB
C
Raw Normal View History

2006-05-21 16:11:05 -07:00
/*
2005-09-06 09:21:05 -07:00
* mooedit-private.h
2005-06-22 11:20:32 -07:00
*
2007-06-24 10:56:20 -07:00
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
2005-06-22 11:20:32 -07:00
*
2007-06-24 10:56:20 -07:00
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
2007-09-23 09:47:28 -07:00
* License version 2.1 as published by the Free Software Foundation.
2005-06-22 11:20:32 -07:00
*
* See COPYING file that comes with this distribution.
2005-07-23 21:58:57 -07:00
*/
2005-06-22 11:20:32 -07:00
#ifndef MOOEDIT_COMPILATION
#error "Do not include this file"
#endif
#ifndef MOO_EDIT_PRIVATE_H
#define MOO_EDIT_PRIVATE_H
2005-06-22 11:20:32 -07:00
2006-11-25 13:03:17 -08:00
#include "mooedit/moolinemark.h"
2005-06-22 11:20:32 -07:00
#include "mooedit/mooeditor.h"
#include "mooedit/mootextview.h"
2006-12-22 00:16:50 -08:00
#include <sys/types.h>
2005-06-22 11:20:32 -07:00
G_BEGIN_DECLS
2006-06-29 22:58:35 -07:00
#define PROGRESS_TIMEOUT 100
#define PROGRESS_WIDTH 300
#define PROGRESS_HEIGHT 100
2006-04-20 01:57:05 -07:00
extern GSList *_moo_edit_instances;
void _moo_edit_add_class_actions (MooEdit *edit);
void _moo_edit_check_actions (MooEdit *edit);
void _moo_edit_class_init_actions (MooEditClass *klass);
void _moo_edit_do_popup (MooEdit *edit,
GdkEventButton *event);
2006-04-29 20:54:03 -07:00
gboolean _moo_edit_has_comments (MooEdit *edit,
gboolean *single_line,
gboolean *multi_line);
2006-11-25 13:03:17 -08:00
#define MOO_EDIT_GOTO_BOOKMARK_ACTION "GoToBookmark"
void _moo_edit_delete_bookmarks (MooEdit *edit,
gboolean in_destroy);
void _moo_edit_line_mark_moved (MooEdit *edit,
MooLineMark *mark);
void _moo_edit_line_mark_deleted (MooEdit *edit,
MooLineMark *mark);
gboolean _moo_edit_line_mark_clicked (MooTextView *view,
int line);
2006-04-20 01:57:05 -07:00
2005-06-22 11:20:32 -07:00
/***********************************************************************/
/* Preferences
2006-12-04 02:54:12 -08:00
*/
enum {
MOO_EDIT_SETTING_LANG,
MOO_EDIT_SETTING_INDENT,
MOO_EDIT_SETTING_STRIP,
MOO_EDIT_SETTING_WRAP_MODE,
MOO_EDIT_SETTING_SHOW_LINE_NUMBERS,
MOO_EDIT_SETTING_TAB_WIDTH,
MOO_EDIT_LAST_SETTING
};
extern guint *_moo_edit_settings;
void _moo_edit_update_global_config (void);
void _moo_edit_init_config (void);
void _moo_edit_update_lang_config (void);
void _moo_edit_apply_prefs (MooEdit *edit);
2005-06-22 11:20:32 -07:00
/***********************************************************************/
/* File operations
2006-12-04 02:54:12 -08:00
*/
2005-06-22 11:20:32 -07:00
2006-07-14 20:30:45 -07:00
void _moo_edit_set_filename (MooEdit *edit,
const char *file,
const char *encoding);
2005-06-22 11:20:32 -07:00
2006-07-14 20:30:45 -07:00
void _moo_edit_stop_file_watch (MooEdit *edit);
2005-06-22 11:20:32 -07:00
2006-07-14 20:30:45 -07:00
void _moo_edit_set_status (MooEdit *edit,
MooEditStatus status);
2005-06-22 11:20:32 -07:00
2006-06-29 22:58:35 -07:00
void _moo_edit_set_state (MooEdit *edit,
MooEditState state,
2006-07-14 20:30:45 -07:00
const char *text,
GDestroyNotify cancel,
gpointer data);
2006-06-29 22:58:35 -07:00
void _moo_edit_create_progress_dialog (MooEdit *edit);
void _moo_edit_set_progress_text (MooEdit *edit,
const char *text);
GdkPixbuf *_moo_edit_get_icon (MooEdit *edit,
GtkWidget *widget,
GtkIconSize size);
#define MOO_EDIT_IS_UNTITLED(edit) (!(edit)->priv->filename)
struct _MooEditFileInfo {
char *filename;
char *encoding;
};
2005-06-22 11:20:32 -07:00
typedef enum {
MOO_EDIT_LINE_END_NONE,
MOO_EDIT_LINE_END_UNIX,
MOO_EDIT_LINE_END_WIN32,
MOO_EDIT_LINE_END_MAC,
MOO_EDIT_LINE_END_MIX
2005-06-22 11:20:32 -07:00
} MooEditLineEndType;
struct _MooEditPrivate {
MooEditor *editor;
gulong modified_changed_handler_id;
2006-04-26 21:04:41 -07:00
guint apply_config_idle;
2005-06-22 11:20:32 -07:00
/***********************************************************************/
/* Document
2006-12-04 02:54:12 -08:00
*/
2005-06-22 11:20:32 -07:00
char *filename;
char *display_filename;
char *display_basename;
char *encoding;
MooEditLineEndType line_end_type;
2005-09-02 16:27:25 -07:00
MooEditStatus status;
2005-06-22 11:20:32 -07:00
guint file_monitor_id;
2005-06-22 11:20:32 -07:00
gulong focus_in_handler_id;
gboolean modified_on_disk;
gboolean deleted_from_disk;
2006-12-22 00:16:50 -08:00
mode_t mode;
guint mode_set : 1;
2006-06-29 22:58:35 -07:00
/***********************************************************************/
/* Progress dialog and stuff
2006-12-04 02:54:12 -08:00
*/
2006-06-29 22:58:35 -07:00
MooEditState state;
guint progress_timeout;
GtkWidget *progress;
GtkWidget *progressbar;
char *progress_text;
2006-07-14 20:30:45 -07:00
GDestroyNotify cancel_op;
gpointer cancel_data;
2006-06-29 22:58:35 -07:00
/***********************************************************************/
/* Bookmarks
2006-12-04 02:54:12 -08:00
*/
gboolean enable_bookmarks;
GSList *bookmarks; /* sorted by line number */
guint update_bookmarks_idle;
2006-04-20 01:57:05 -07:00
/***********************************************************************/
/* Actions
2006-12-04 02:54:12 -08:00
*/
MooActionCollection *actions;
};
2005-06-22 11:20:32 -07:00
G_END_DECLS
#endif /* MOO_EDIT_PRIVATE_H */