2005-06-22 11:20:32 -07:00
|
|
|
/*
|
2005-10-13 07:08:18 -07:00
|
|
|
* mooterm.h
|
2005-06-22 11:20:32 -07:00
|
|
|
*
|
2006-02-23 06:03:17 -08:00
|
|
|
* Copyright (C) 2004-2006 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
2005-06-22 11:20:32 -07: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.
|
|
|
|
*
|
|
|
|
* See COPYING file that comes with this distribution.
|
2005-07-23 21:58:57 -07:00
|
|
|
*/
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
#ifndef __MOO_TERM_H__
|
|
|
|
#define __MOO_TERM_H__
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-10-15 22:07:02 -07:00
|
|
|
#include <gtk/gtkwidget.h>
|
2005-06-22 11:20:32 -07:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
2005-11-06 22:56:33 -08:00
|
|
|
#define MOO_TYPE_TERM_COMMAND (moo_term_command_get_type ())
|
|
|
|
|
|
|
|
#define MOO_TYPE_TERM (moo_term_get_type ())
|
|
|
|
#define MOO_TERM(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_TERM, MooTerm))
|
|
|
|
#define MOO_TERM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_TERM, MooTermClass))
|
|
|
|
#define MOO_IS_TERM(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_TERM))
|
|
|
|
#define MOO_IS_TERM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_TERM))
|
|
|
|
#define MOO_TERM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_TERM, MooTermClass))
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-07-28 12:25:10 -07:00
|
|
|
typedef struct _MooTerm MooTerm;
|
|
|
|
typedef struct _MooTermPrivate MooTermPrivate;
|
|
|
|
typedef struct _MooTermClass MooTermClass;
|
2005-07-31 07:52:24 -07:00
|
|
|
typedef struct _MooTermCommand MooTermCommand;
|
2005-06-22 11:20:32 -07:00
|
|
|
|
|
|
|
|
|
|
|
struct _MooTerm
|
|
|
|
{
|
|
|
|
GtkWidget parent;
|
|
|
|
MooTermPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _MooTermClass
|
|
|
|
{
|
|
|
|
GtkWidgetClass parent_class;
|
|
|
|
|
|
|
|
void (* set_scroll_adjustments) (GtkWidget *widget,
|
|
|
|
GtkAdjustment *hadjustment,
|
|
|
|
GtkAdjustment *vadjustment);
|
2005-07-10 19:54:58 -07:00
|
|
|
|
|
|
|
void (*bell) (MooTerm *term);
|
|
|
|
void (*set_window_title) (MooTerm *term,
|
|
|
|
const char *title);
|
|
|
|
void (*set_icon_name) (MooTerm *term,
|
|
|
|
const char *icon);
|
2005-07-14 23:37:09 -07:00
|
|
|
void (*child_died) (MooTerm *term);
|
2005-07-15 02:50:18 -07:00
|
|
|
|
|
|
|
void (*populate_popup) (MooTerm *term,
|
2005-10-15 22:07:02 -07:00
|
|
|
GtkWidget *menu);
|
2005-07-23 21:58:57 -07:00
|
|
|
|
|
|
|
void (*apply_settings) (MooTerm *term);
|
2005-10-13 07:08:18 -07:00
|
|
|
|
2006-06-11 13:48:32 -07:00
|
|
|
void (*reset) (MooTerm *term);
|
2005-10-13 07:08:18 -07:00
|
|
|
void (*new_line) (MooTerm *term);
|
2005-06-22 11:20:32 -07:00
|
|
|
};
|
|
|
|
|
2006-05-31 20:58:15 -07:00
|
|
|
typedef enum {
|
|
|
|
MOO_TERM_ERROR_FAILED,
|
|
|
|
MOO_TERM_ERROR_INVAL
|
|
|
|
} MooTermError;
|
|
|
|
|
|
|
|
#define MOO_TERM_ERROR (moo_term_error_quark())
|
2005-07-31 07:52:24 -07:00
|
|
|
GQuark moo_term_error_quark (void) G_GNUC_CONST;
|
2005-07-14 23:37:09 -07:00
|
|
|
|
2005-07-26 04:12:40 -07:00
|
|
|
GType moo_term_get_type (void) G_GNUC_CONST;
|
2005-07-31 07:52:24 -07:00
|
|
|
GType moo_term_command_get_type (void) G_GNUC_CONST;
|
2005-07-26 04:12:40 -07:00
|
|
|
|
2005-07-14 23:37:09 -07:00
|
|
|
void moo_term_set_adjustment (MooTerm *term,
|
2005-06-22 11:20:32 -07:00
|
|
|
GtkAdjustment *vadj);
|
|
|
|
|
2005-07-14 23:37:09 -07:00
|
|
|
gboolean moo_term_fork_command (MooTerm *term,
|
2005-07-31 07:52:24 -07:00
|
|
|
const MooTermCommand *cmd,
|
|
|
|
GError **error);
|
|
|
|
gboolean moo_term_fork_command_line (MooTerm *term,
|
|
|
|
const char *cmd_line,
|
2005-06-22 15:13:12 -07:00
|
|
|
const char *working_dir,
|
2005-07-31 07:52:24 -07:00
|
|
|
char **envp,
|
|
|
|
GError **error);
|
2005-07-26 04:12:40 -07:00
|
|
|
gboolean moo_term_fork_argv (MooTerm *term,
|
|
|
|
char **argv,
|
|
|
|
const char *working_dir,
|
2005-07-31 07:52:24 -07:00
|
|
|
char **envp,
|
|
|
|
GError **error);
|
2005-07-28 12:25:10 -07:00
|
|
|
gboolean moo_term_child_alive (MooTerm *term);
|
2005-07-25 11:50:24 -07:00
|
|
|
void moo_term_kill_child (MooTerm *term);
|
2005-07-10 19:54:58 -07:00
|
|
|
|
2005-07-30 23:20:59 -07:00
|
|
|
/* makes sense only for win32 */
|
|
|
|
void moo_term_set_helper_directory (const char *dir);
|
|
|
|
|
2005-07-14 23:37:09 -07:00
|
|
|
void moo_term_feed (MooTerm *term,
|
2005-07-10 19:54:58 -07:00
|
|
|
const char *data,
|
|
|
|
int len);
|
2005-07-14 23:37:09 -07:00
|
|
|
void moo_term_feed_child (MooTerm *term,
|
2005-07-01 02:53:39 -07:00
|
|
|
const char *string,
|
2005-07-04 12:22:02 -07:00
|
|
|
int len);
|
2006-05-09 01:00:48 -07:00
|
|
|
void moo_term_send_intr (MooTerm *term);
|
|
|
|
void moo_term_ctrl_c (MooTerm *term);
|
2005-07-01 02:53:39 -07:00
|
|
|
|
2005-12-03 12:29:23 -08:00
|
|
|
void moo_term_get_screen_size (MooTerm *term,
|
|
|
|
guint *columns,
|
|
|
|
guint *rows);
|
|
|
|
|
2005-07-14 23:37:09 -07:00
|
|
|
void moo_term_scroll_to_top (MooTerm *term);
|
|
|
|
void moo_term_scroll_to_bottom (MooTerm *term);
|
|
|
|
void moo_term_scroll_lines (MooTerm *term,
|
2005-07-01 02:53:39 -07:00
|
|
|
int lines);
|
2005-07-14 23:37:09 -07:00
|
|
|
void moo_term_scroll_pages (MooTerm *term,
|
2005-07-01 02:53:39 -07:00
|
|
|
int pages);
|
|
|
|
|
2005-07-17 09:41:15 -07:00
|
|
|
void moo_term_copy_clipboard (MooTerm *term,
|
|
|
|
GdkAtom selection);
|
|
|
|
void moo_term_paste_clipboard (MooTerm *term,
|
|
|
|
GdkAtom selection);
|
2005-07-23 21:58:57 -07:00
|
|
|
void moo_term_select_all (MooTerm *term);
|
|
|
|
char *moo_term_get_selection (MooTerm *term);
|
|
|
|
char *moo_term_get_content (MooTerm *term);
|
2005-07-01 02:53:39 -07:00
|
|
|
|
2005-07-14 23:37:09 -07:00
|
|
|
void moo_term_set_pointer_visible (MooTerm *term,
|
|
|
|
gboolean visible);
|
2005-07-21 15:11:16 -07:00
|
|
|
void moo_term_set_font_from_string (MooTerm *term,
|
|
|
|
const char *font);
|
2005-07-23 21:58:57 -07:00
|
|
|
void moo_term_set_cursor_blink_time (MooTerm *term,
|
|
|
|
guint ms);
|
2005-06-22 15:13:12 -07:00
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
void moo_term_reset (MooTerm *term);
|
|
|
|
void moo_term_soft_reset (MooTerm *term);
|
|
|
|
|
2005-12-03 12:29:23 -08:00
|
|
|
guint moo_term_char_height (MooTerm *term);
|
|
|
|
guint moo_term_char_width (MooTerm *term);
|
|
|
|
|
2006-02-11 22:03:21 -08:00
|
|
|
gboolean moo_term_start_default_shell (MooTerm *term,
|
2005-07-31 07:52:24 -07:00
|
|
|
GError **error);
|
|
|
|
|
2006-07-31 22:54:24 -07:00
|
|
|
MooTermCommand *moo_term_command_new_argv (char **argv,
|
|
|
|
const char *working_dir,
|
|
|
|
char **envp);
|
|
|
|
MooTermCommand *moo_term_command_new_command_line (const char *cmd_line,
|
|
|
|
const char *working_dir,
|
|
|
|
char **envp);
|
2005-07-31 07:52:24 -07:00
|
|
|
MooTermCommand *moo_term_command_copy (const MooTermCommand *cmd);
|
|
|
|
void moo_term_command_free (MooTermCommand *cmd);
|
2005-07-28 12:25:10 -07:00
|
|
|
|
2006-03-09 16:28:03 -08:00
|
|
|
void moo_term_set_colors (MooTerm *term,
|
|
|
|
GdkColor *colors,
|
|
|
|
guint n_colors);
|
|
|
|
|
2005-07-28 12:25:10 -07:00
|
|
|
|
2005-06-22 11:20:32 -07:00
|
|
|
G_END_DECLS
|
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
#endif /* __MOO_TERM_H__ */
|