2005-06-22 11:20:32 -07:00
|
|
|
/*
|
2005-10-13 07:08:18 -07:00
|
|
|
* mooappinput.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-10-13 07:08:18 -07:00
|
|
|
#ifndef __MOO_APP_INPUT__
|
|
|
|
#define __MOO_APP_INPUT__
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
#include <glib.h>
|
2005-06-22 11:20:32 -07:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
2005-10-31 13:41:20 -08:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
MOO_APP_CMD_ZERO = 0,
|
|
|
|
MOO_APP_CMD_PYTHON_STRING,
|
|
|
|
MOO_APP_CMD_PYTHON_FILE,
|
2006-05-10 14:33:26 -07:00
|
|
|
MOO_APP_CMD_SCRIPT,
|
2005-10-31 13:41:20 -08:00
|
|
|
MOO_APP_CMD_OPEN_FILE,
|
|
|
|
MOO_APP_CMD_QUIT,
|
|
|
|
MOO_APP_CMD_DIE,
|
|
|
|
MOO_APP_CMD_PRESENT,
|
|
|
|
MOO_APP_CMD_LAST
|
|
|
|
} MooAppCmdCode;
|
|
|
|
|
|
|
|
|
2005-11-01 18:32:07 -08:00
|
|
|
#if defined(WANT_MOO_APP_CMD_STRINGS) || defined(WANT_MOO_APP_CMD_CHARS)
|
2005-10-31 13:41:20 -08:00
|
|
|
|
2006-05-14 16:43:39 -07:00
|
|
|
/* 'g' is taken by ggap */
|
2005-10-31 13:41:20 -08:00
|
|
|
#define CMD_ZERO "\0"
|
2006-05-10 14:33:26 -07:00
|
|
|
#define CMD_PYTHON_STRING "p"
|
|
|
|
#define CMD_PYTHON_FILE "P"
|
|
|
|
#define CMD_SCRIPT "s"
|
2005-10-31 13:41:20 -08:00
|
|
|
#define CMD_OPEN_FILE "f"
|
|
|
|
#define CMD_QUIT "q"
|
|
|
|
#define CMD_DIE "d"
|
|
|
|
#define CMD_PRESENT "r"
|
|
|
|
|
2005-11-01 18:32:07 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WANT_MOO_APP_CMD_CHARS
|
|
|
|
|
2005-10-31 13:41:20 -08:00
|
|
|
static const char *moo_app_cmd_chars =
|
|
|
|
CMD_ZERO
|
|
|
|
CMD_PYTHON_STRING
|
|
|
|
CMD_PYTHON_FILE
|
2006-05-10 14:33:26 -07:00
|
|
|
CMD_SCRIPT
|
2005-10-31 13:41:20 -08:00
|
|
|
CMD_OPEN_FILE
|
|
|
|
CMD_QUIT
|
|
|
|
CMD_DIE
|
|
|
|
CMD_PRESENT
|
|
|
|
;
|
|
|
|
|
|
|
|
#endif /* WANT_MOO_APP_CMD_CHARS */
|
2005-10-13 07:08:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct _MooAppInput MooAppInput;
|
2005-06-22 11:20:32 -07:00
|
|
|
|
|
|
|
|
2006-06-03 00:26:18 -07:00
|
|
|
MooAppInput *_moo_app_input_new (const char *pipe_basename);
|
2005-11-01 18:32:07 -08:00
|
|
|
|
2006-06-03 00:26:18 -07:00
|
|
|
MooAppInput *_moo_app_input_ref (MooAppInput *ch);
|
|
|
|
void _moo_app_input_unref (MooAppInput *ch);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2006-06-03 00:26:18 -07:00
|
|
|
gboolean _moo_app_input_start (MooAppInput *ch);
|
|
|
|
void _moo_app_input_shutdown (MooAppInput *ch);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2006-06-03 00:26:18 -07:00
|
|
|
const char *_moo_app_input_get_name (MooAppInput *ch);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
2005-11-01 18:32:07 -08:00
|
|
|
gboolean _moo_app_input_send_msg (const char *pipe_basename,
|
|
|
|
const char *data,
|
2006-04-30 11:53:04 -07:00
|
|
|
gssize len);
|
2005-06-22 11:20:32 -07:00
|
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2005-10-13 07:08:18 -07:00
|
|
|
#endif /* __MOO_APP_INPUT__ */
|