Changeset c737503
- Timestamp:
- Sep 30, 2011, 8:06:57 AM (12 years ago)
- Branches:
- master, release-1.10, release-1.9
- Children:
- e89ec48
- Parents:
- eba02ec
- git-author:
- Jason Gross <jgross@mit.edu> (06/25/11 21:19:32)
- git-committer:
- Jason Gross <jgross@mit.edu> (09/30/11 08:06:57)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r6646fdb rc737503 272 272 } 273 273 274 void owl_function_start_edit_win(const char *line, void (*callback)(owl_editwin *), void *data, void (*cleanup)(void *))274 owl_editwin *owl_function_start_edit_win(const char *line) 275 275 { 276 276 owl_editwin *e; … … 286 286 g_free(s); 287 287 288 owl_editwin_set_cbdata(e, data, cleanup);289 owl_editwin_set_callback(e, callback);290 288 ctx = owl_editcontext_new(OWL_CTX_EDITMULTI, e, "editmulti", 291 289 owl_global_deactivate_editcontext, &g); 292 290 owl_global_push_context_obj(&g, ctx); 293 291 return e; 294 292 } 295 293 … … 309 307 void owl_function_zwrite_setup(owl_zwrite *z) 310 308 { 309 owl_editwin *e; 311 310 /* send a ping if necessary */ 312 311 if (owl_global_is_txping(&g)) { … … 316 315 317 316 owl_function_write_setup("zephyr"); 318 owl_function_start_edit_win(z->zwriteline,319 &owl_callback_zwrite,320 z, (void(*)(void*))owl_zwrite_delete);317 e = owl_function_start_edit_win(z->zwriteline); 318 owl_editwin_set_cbdata(e, z, (void (*)(void *))owl_zwrite_delete); 319 owl_editwin_set_callback(e, &owl_callback_zwrite); 321 320 } 322 321 323 322 void owl_function_aimwrite_setup(const char *to) 324 323 { 324 owl_editwin *e; 325 325 /* TODO: We probably actually want an owl_aimwrite object like 326 326 * owl_zwrite. */ 327 327 char *line = g_strdup_printf("aimwrite %s", to); 328 328 owl_function_write_setup("message"); 329 owl_function_start_edit_win(line, 330 &owl_callback_aimwrite, 331 g_strdup(to), 332 g_free); 329 e = owl_function_start_edit_win(line); 330 owl_editwin_set_cbdata(e, g_strdup(to), g_free); 331 owl_editwin_set_callback(e, &owl_callback_aimwrite); 333 332 g_free(line); 334 333 } … … 336 335 void owl_function_loopwrite_setup(void) 337 336 { 337 owl_editwin *e; 338 338 owl_function_write_setup("message"); 339 owl_function_start_edit_win("loopwrite", 340 &owl_callback_loopwrite, 341 NULL, NULL); 339 e = owl_function_start_edit_win("loopwrite"); 340 owl_editwin_set_callback(e, &owl_callback_loopwrite); 342 341 } 343 342 … … 1946 1945 } 1947 1946 1948 voidowl_function_start_command(const char *line)1947 owl_editwin *owl_function_start_command(const char *line) 1949 1948 { 1950 1949 owl_editwin *tw; … … 1961 1960 owl_global_push_context_obj(&g, ctx); 1962 1961 owl_editwin_set_callback(tw, owl_callback_command); 1963 } 1964 1965 CALLER_OWN owl_editwin *owl_function_start_question(const char *line) 1962 return tw; 1963 } 1964 1965 owl_editwin *owl_function_start_question(const char *line) 1966 1966 { 1967 1967 owl_editwin *tw; … … 1978 1978 } 1979 1979 1980 CALLER_OWNowl_editwin *owl_function_start_password(const char *line)1980 owl_editwin *owl_function_start_password(const char *line) 1981 1981 { 1982 1982 owl_editwin *tw; -
perlglue.xs
rf271129 rc737503 209 209 const char *line 210 210 SV *callback 211 PREINIT: 212 owl_editwin *e; 211 213 CODE: 212 214 { … … 214 216 croak("Callback must be a subref"); 215 217 216 owl_function_start_edit_win(line, 217 owl_perlconfig_edit_callback, 218 newSVsv(callback), 219 owl_perlconfig_dec_refcnt); 218 e = owl_function_start_edit_win(line); 219 owl_editwin_set_cbdata(e, 220 newSVsv(callback), 221 owl_perlconfig_dec_refcnt); 222 owl_editwin_set_callback(e, &owl_perlconfig_edit_callback); 220 223 } 221 224
Note: See TracChangeset
for help on using the changeset viewer.