comparison plugins/tcl/tcl_gaim.h @ 13845:d0ff520f87da

[gaim-migrate @ 16301] This is tcl /cmd support. It doesn't currently let tcl plugins return error message (I couldn't ever get that to work). But other than that it works. Ethan please look over this when you get a chance. committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Wed, 21 Jun 2006 04:57:27 +0000
parents 3b8dc44ff25f
children 4d577b63299a
comparison
equal deleted inserted replaced
13844:597beb5c9de1 13845:d0ff520f87da
24 #define _GAIM_TCL_GAIM_H_ 24 #define _GAIM_TCL_GAIM_H_
25 25
26 #include <tcl.h> 26 #include <tcl.h>
27 27
28 #include "internal.h" 28 #include "internal.h"
29 #include "cmds.h"
29 #include "plugin.h" 30 #include "plugin.h"
30 #include "value.h" 31 #include "value.h"
31 #include "stringref.h" 32 #include "stringref.h"
32 33
33 struct tcl_signal_handler { 34 struct tcl_signal_handler {
41 Tcl_Obj *proc; 42 Tcl_Obj *proc;
42 43
43 GaimValue *returntype; 44 GaimValue *returntype;
44 int nargs; 45 int nargs;
45 GaimValue **argtypes; 46 GaimValue **argtypes;
47 };
48
49 struct tcl_cmd_handler {
50 int id;
51 Tcl_Obj *cmd;
52 Tcl_Interp *interp;
53
54 Tcl_Obj *namespace;
55 /* These are temporary during setup */
56 const char *args;
57 int priority;
58 int flags;
59 const char *prpl_id;
60 Tcl_Obj *proc;
61 const char *helpstr;
62
63 int nargs;
46 }; 64 };
47 65
48 extern GaimPlugin *_tcl_plugin; 66 extern GaimPlugin *_tcl_plugin;
49 67
50 /* Capitalized this way because these are "types" */ 68 /* Capitalized this way because these are "types" */
63 void tcl_signal_handler_free(struct tcl_signal_handler *handler); 81 void tcl_signal_handler_free(struct tcl_signal_handler *handler);
64 void tcl_signal_cleanup(Tcl_Interp *interp); 82 void tcl_signal_cleanup(Tcl_Interp *interp);
65 gboolean tcl_signal_connect(struct tcl_signal_handler *handler); 83 gboolean tcl_signal_connect(struct tcl_signal_handler *handler);
66 void tcl_signal_disconnect(void *instance, const char *signal, Tcl_Interp *interp); 84 void tcl_signal_disconnect(void *instance, const char *signal, Tcl_Interp *interp);
67 85
86 void tcl_cmd_init(void);
87 void tcl_cmd_handler_free(struct tcl_cmd_handler *handler);
88 void tcl_cmd_cleanup(Tcl_Interp *interp);
89 GaimCmdId tcl_cmd_register(struct tcl_cmd_handler *handler);
90 void tcl_cmd_unregister(GaimCmdId id, Tcl_Interp *interp);
91
68 void gaim_tcl_ref_init(void); 92 void gaim_tcl_ref_init(void);
69 void *gaim_tcl_ref_get(Tcl_Interp *interp, Tcl_Obj *obj, GaimStringref *type); 93 void *gaim_tcl_ref_get(Tcl_Interp *interp, Tcl_Obj *obj, GaimStringref *type);
70 Tcl_Obj *gaim_tcl_ref_new(GaimStringref *type, void *value); 94 Tcl_Obj *gaim_tcl_ref_new(GaimStringref *type, void *value);
71 95
72 Tcl_ObjCmdProc tcl_cmd_account; 96 Tcl_ObjCmdProc tcl_cmd_account;
73 Tcl_ObjCmdProc tcl_cmd_signal_connect; 97 Tcl_ObjCmdProc tcl_cmd_signal_connect;
74 Tcl_ObjCmdProc tcl_cmd_buddy; 98 Tcl_ObjCmdProc tcl_cmd_buddy;
99 Tcl_ObjCmdProc tcl_cmd_cmd;
75 Tcl_ObjCmdProc tcl_cmd_connection; 100 Tcl_ObjCmdProc tcl_cmd_connection;
76 Tcl_ObjCmdProc tcl_cmd_conversation; 101 Tcl_ObjCmdProc tcl_cmd_conversation;
77 Tcl_ObjCmdProc tcl_cmd_core; 102 Tcl_ObjCmdProc tcl_cmd_core;
78 Tcl_ObjCmdProc tcl_cmd_debug; 103 Tcl_ObjCmdProc tcl_cmd_debug;
79 Tcl_ObjCmdProc tcl_cmd_notify; 104 Tcl_ObjCmdProc tcl_cmd_notify;