Mercurial > pidgin
comparison src/gaim-remote.c @ 5859:022786c7ab53
[gaim-migrate @ 6290]
CUI is gone, long live gaim-remote! The old CUI functionality, which was
for remote-controlling gaim, is now a Core Plugin, so any future UI
(including the current, normal gaim gtk UI) can be remote-controlled.
Applications will soon be able to link against the library and header files
and provide their own remote-control of gaim, but why bother? :) If you
use gaim-remote, make sure to load the new plugin. It won't auto-load.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 14 Jun 2003 06:06:40 +0000 |
parents | 2e78141ec1b5 |
children | 059d95c67cda |
comparison
equal
deleted
inserted
replaced
5858:96e5b32e75ad | 5859:022786c7ab53 |
---|---|
24 #include "gaim.h" | 24 #include "gaim.h" |
25 #include <getopt.h> | 25 #include <getopt.h> |
26 #include <unistd.h> | 26 #include <unistd.h> |
27 #include <string.h> | 27 #include <string.h> |
28 #include <locale.h> | 28 #include <locale.h> |
29 #include "gaim-socket.h" | 29 |
30 #include <gaim-remote/remote.h> | |
30 | 31 |
31 void show_remote_usage(char *name) | 32 void show_remote_usage(char *name) |
32 { | 33 { |
33 printf(_("Usage: %s command [OPTIONS] [URI]\n\n" | 34 printf(_("Usage: %s command [OPTIONS] [URI]\n\n" |
34 | 35 |
128 } | 129 } |
129 | 130 |
130 | 131 |
131 int command_uri() { | 132 int command_uri() { |
132 int fd = 0; | 133 int fd = 0; |
133 struct gaim_cui_packet *p = NULL; | 134 GaimRemotePacket *p = NULL; |
134 fd = gaim_connect_to_session(0); | 135 fd = gaim_remote_session_connect(0); |
135 if (!fd) { | 136 if (!fd) { |
136 fprintf(stderr, _("Gaim not running (on session 0)\n")); | 137 fprintf(stderr, _("Gaim not running (on session 0)\n")); |
137 return 1; | 138 return 1; |
138 } | 139 } |
139 p = cui_packet_new(CUI_TYPE_REMOTE, CUI_REMOTE_URI); | 140 p = gaim_remote_packet_new(CUI_TYPE_REMOTE, CUI_REMOTE_URI); |
140 cui_packet_append_string(p, opts.uri); | 141 gaim_remote_packet_append_string(p, opts.uri); |
141 cui_send_packet (fd, p); | 142 gaim_remote_session_send_packet(fd, p); |
142 close(fd); | 143 close(fd); |
143 cui_packet_free(p); | 144 gaim_remote_packet_free(p); |
144 return 0; | 145 return 0; |
145 } | 146 } |
146 | 147 |
147 int command_quit() { | 148 int command_quit() { |
148 int fd = 0; | 149 int fd = 0; |
149 struct gaim_cui_packet *p = NULL; | 150 GaimRemotePacket *p = NULL; |
150 fd = gaim_connect_to_session(0); | 151 fd = gaim_remote_session_connect(0); |
151 if (!fd) { | 152 if (!fd) { |
152 fprintf(stderr, _("Gaim not running (on session 0)\n")); | 153 fprintf(stderr, _("Gaim not running (on session 0)\n")); |
153 return 1; | 154 return 1; |
154 } | 155 } |
155 p = cui_packet_new(CUI_TYPE_META, CUI_META_QUIT); | 156 p = gaim_remote_packet_new(CUI_TYPE_META, CUI_META_QUIT); |
156 cui_send_packet (fd, p); | 157 gaim_remote_session_send_packet(fd, p); |
157 close(fd); | 158 close(fd); |
158 cui_packet_free(p); | 159 gaim_remote_packet_free(p); |
159 return 0; | 160 return 0; |
160 } | 161 } |
161 | 162 |
162 void show_longhelp_uri( char *name, char *command){ | 163 void show_longhelp_uri( char *name, char *command){ |
163 if(!strcmp(command, "uri")) { | 164 if(!strcmp(command, "uri")) { |