ea5aed0d6a2937ad09f2803a6ff0a135040d2408
[projects/chimara/chimara.git] / libchimara / chimara-if.h
1 #ifndef __CHIMARA_IF_H__
2 #define __CHIMARA_IF_H__
3
4 #include <glib.h>
5 #include "chimara-glk.h"
6
7 G_BEGIN_DECLS
8
9 #define CHIMARA_TYPE_IF            (chimara_if_get_type())
10 #define CHIMARA_IF(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), CHIMARA_TYPE_IF, ChimaraIF))
11 #define CHIMARA_IF_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), CHIMARA_TYPE_IF, ChimaraIFClass))
12 #define CHIMARA_IS_IF(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), CHIMARA_TYPE_IF))
13 #define CHIMARA_IS_IF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), CHIMARA_TYPE_IF))
14 #define CHIMARA_IF_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), CHIMARA_TYPE_IF, ChimaraIFClass))
15
16 typedef enum _ChimaraIFFormat {
17         CHIMARA_IF_FORMAT_Z5,
18         CHIMARA_IF_FORMAT_Z6,
19         CHIMARA_IF_FORMAT_Z8,
20         CHIMARA_IF_FORMAT_GLULX,
21         CHIMARA_IF_NUM_FORMATS
22 } ChimaraIFFormat;
23
24 typedef enum _ChimaraIFInterpreter {
25         CHIMARA_IF_INTERPRETER_FROTZ,
26         CHIMARA_IF_INTERPRETER_NITFOL,
27         CHIMARA_IF_INTERPRETER_GLULXE,
28         CHIMARA_IF_INTERPRETER_GIT,
29         CHIMARA_IF_NUM_INTERPRETERS
30 } ChimaraIFInterpreter;
31
32 typedef struct _ChimaraIF {
33         ChimaraGlk parent_instance;
34 } ChimaraIF;
35
36 typedef struct _ChimaraIFClass {
37         ChimaraGlkClass parent_class;
38         /* Signals */
39         void(* command) (ChimaraIF *self, gchar *input, gchar *response);
40 } ChimaraIFClass;
41
42 GType chimara_if_get_type(void) G_GNUC_CONST;
43 GtkWidget *chimara_if_new(void);
44 void chimara_if_set_preferred_interpreter(ChimaraIF *self, ChimaraIFFormat format, ChimaraIFInterpreter interpreter);
45 ChimaraIFInterpreter chimara_if_get_preferred_interpreter(ChimaraIF *self, ChimaraIFFormat format);
46
47 G_END_DECLS
48
49 #endif /* __CHIMARA_IF_H__ */