2006-05-21 16:11:05 -07:00
|
|
|
/*
|
2005-09-11 10:51:34 -07:00
|
|
|
* moocmdview.h
|
|
|
|
*
|
2007-06-24 10:56:20 -07:00
|
|
|
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
2005-09-11 10:51:34 -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
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2005-09-11 10:51:34 -07:00
|
|
|
*
|
|
|
|
* See COPYING file that comes with this distribution.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __MOO_CMD_VIEW__
|
|
|
|
#define __MOO_CMD_VIEW__
|
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
#include <mooedit/moolineview.h>
|
2006-09-01 10:37:47 -07:00
|
|
|
#include <mooedit/moooutputfilter.h>
|
2005-09-11 10:51:34 -07:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
|
|
|
#define MOO_TYPE_CMD_VIEW (moo_cmd_view_get_type ())
|
|
|
|
#define MOO_CMD_VIEW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_CMD_VIEW, MooCmdView))
|
|
|
|
#define MOO_CMD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_CMD_VIEW, MooCmdViewClass))
|
|
|
|
#define MOO_IS_CMD_VIEW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_CMD_VIEW))
|
|
|
|
#define MOO_IS_CMD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_CMD_VIEW))
|
|
|
|
#define MOO_CMD_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_CMD_VIEW, MooCmdViewClass))
|
|
|
|
|
2006-09-02 00:27:07 -07:00
|
|
|
#define MOO_CMD_VIEW_MESSAGE "message"
|
|
|
|
#define MOO_CMD_VIEW_ERROR "error"
|
|
|
|
#define MOO_CMD_VIEW_STDOUT "stdout"
|
|
|
|
#define MOO_CMD_VIEW_STDERR "stderr"
|
2005-09-11 10:51:34 -07:00
|
|
|
|
|
|
|
typedef struct _MooCmdView MooCmdView;
|
|
|
|
typedef struct _MooCmdViewPrivate MooCmdViewPrivate;
|
|
|
|
typedef struct _MooCmdViewClass MooCmdViewClass;
|
|
|
|
|
|
|
|
struct _MooCmdView
|
|
|
|
{
|
2005-10-13 07:08:18 -07:00
|
|
|
MooLineView parent;
|
2005-09-11 10:51:34 -07:00
|
|
|
MooCmdViewPrivate *priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _MooCmdViewClass
|
|
|
|
{
|
2005-10-13 07:08:18 -07:00
|
|
|
MooLineViewClass parent_class;
|
2005-09-11 10:51:34 -07:00
|
|
|
|
2005-11-18 05:02:42 -08:00
|
|
|
void (*job_started) (MooCmdView *view,
|
|
|
|
const char *job_name);
|
|
|
|
void (*job_finished)(MooCmdView *view);
|
|
|
|
|
2005-09-11 10:51:34 -07:00
|
|
|
/* action signal */
|
|
|
|
gboolean (*abort) (MooCmdView *view);
|
|
|
|
|
|
|
|
gboolean (*cmd_exit) (MooCmdView *view,
|
|
|
|
int status);
|
|
|
|
gboolean (*stdout_line) (MooCmdView *view,
|
|
|
|
const char *line);
|
|
|
|
gboolean (*stderr_line) (MooCmdView *view,
|
|
|
|
const char *line);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-11-18 05:02:42 -08:00
|
|
|
GType moo_cmd_view_get_type (void) G_GNUC_CONST;
|
2005-09-11 10:51:34 -07:00
|
|
|
|
2005-11-18 05:02:42 -08:00
|
|
|
GtkWidget *moo_cmd_view_new (void);
|
2005-09-11 10:51:34 -07:00
|
|
|
|
2006-09-01 10:37:47 -07:00
|
|
|
void moo_cmd_view_set_filter (MooCmdView *view,
|
|
|
|
MooOutputFilter *filter);
|
|
|
|
|
|
|
|
gboolean moo_cmd_view_run_command (MooCmdView *view,
|
|
|
|
const char *cmd,
|
|
|
|
const char *working_dir,
|
|
|
|
const char *job_name);
|
|
|
|
gboolean moo_cmd_view_run_command_full (MooCmdView *view,
|
|
|
|
const char *cmd,
|
|
|
|
const char *display_cmd,
|
|
|
|
const char *working_dir,
|
|
|
|
char **envp,
|
|
|
|
const char *job_name);
|
|
|
|
|
|
|
|
void moo_cmd_view_abort (MooCmdView *view);
|
|
|
|
gboolean moo_cmd_view_running (MooCmdView *view);
|
2005-09-11 10:51:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __MOO_CMD_VIEW__ */
|