comparison src/channel.c @ 9123:b430d4f2aa79 v7.4.1845

commit https://github.com/vim/vim/commit/f8df45d84f1d17dced23e185d4835fc23406d73d Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 25 21:48:13 2016 +0200 patch 7.4.1845 Problem: Mentioning NetBeans when reading from channel. (Ramel Eshed) Solution: Make the text more generic.
author Christian Brabandt <cb@256bit.org>
date Wed, 25 May 2016 22:00:06 +0200
parents 6bc0a492e8ba
children 3507fde33e6e
comparison
equal deleted inserted replaced
9122:1de11ad6391f 9123:b430d4f2aa79
503 503
504 channel = channel_fd2channel(fd, &part); 504 channel = channel_fd2channel(fd, &part);
505 if (channel == NULL) 505 if (channel == NULL)
506 ch_errorn(NULL, "Channel for fd %d not found", fd); 506 ch_errorn(NULL, "Channel for fd %d not found", fd);
507 else 507 else
508 channel_read(channel, part, "messageFromNetbeans"); 508 channel_read(channel, part, "channel_read_fd");
509 } 509 }
510 #endif 510 #endif
511 511
512 /* 512 /*
513 * Read a command from netbeans. 513 * Read a command from netbeans.
514 */ 514 */
515 #ifdef FEAT_GUI_X11 515 #ifdef FEAT_GUI_X11
516 static void 516 static void
517 messageFromNetbeans(XtPointer clientData, 517 messageFromServer(XtPointer clientData,
518 int *unused1 UNUSED, 518 int *unused1 UNUSED,
519 XtInputId *unused2 UNUSED) 519 XtInputId *unused2 UNUSED)
520 { 520 {
521 channel_read_fd((int)(long)clientData); 521 channel_read_fd((int)(long)clientData);
522 } 522 }
523 #endif 523 #endif
524 524
525 #ifdef FEAT_GUI_GTK 525 #ifdef FEAT_GUI_GTK
526 # if GTK_CHECK_VERSION(3,0,0) 526 # if GTK_CHECK_VERSION(3,0,0)
527 static gboolean 527 static gboolean
528 messageFromNetbeans(GIOChannel *unused1 UNUSED, 528 messageFromServer(GIOChannel *unused1 UNUSED,
529 GIOCondition unused2 UNUSED, 529 GIOCondition unused2 UNUSED,
530 gpointer clientData) 530 gpointer clientData)
531 { 531 {
532 channel_read_fd(GPOINTER_TO_INT(clientData)); 532 channel_read_fd(GPOINTER_TO_INT(clientData));
533 return TRUE; /* Return FALSE instead in case the event source is to 533 return TRUE; /* Return FALSE instead in case the event source is to
534 * be removed after this function returns. */ 534 * be removed after this function returns. */
535 } 535 }
536 # else 536 # else
537 static void 537 static void
538 messageFromNetbeans(gpointer clientData, 538 messageFromServer(gpointer clientData,
539 gint unused1 UNUSED, 539 gint unused1 UNUSED,
540 GdkInputCondition unused2 UNUSED) 540 GdkInputCondition unused2 UNUSED)
541 { 541 {
542 channel_read_fd((int)(long)clientData); 542 channel_read_fd((int)(long)clientData);
543 } 543 }
544 # endif 544 # endif
545 #endif 545 #endif
556 if (channel->ch_part[part].ch_inputHandler == (XtInputId)NULL) 556 if (channel->ch_part[part].ch_inputHandler == (XtInputId)NULL)
557 channel->ch_part[part].ch_inputHandler = XtAppAddInput( 557 channel->ch_part[part].ch_inputHandler = XtAppAddInput(
558 (XtAppContext)app_context, 558 (XtAppContext)app_context,
559 channel->ch_part[part].ch_fd, 559 channel->ch_part[part].ch_fd,
560 (XtPointer)(XtInputReadMask + XtInputExceptMask), 560 (XtPointer)(XtInputReadMask + XtInputExceptMask),
561 messageFromNetbeans, 561 messageFromServer,
562 (XtPointer)(long)channel->ch_part[part].ch_fd); 562 (XtPointer)(long)channel->ch_part[part].ch_fd);
563 # else 563 # else
564 # ifdef FEAT_GUI_GTK 564 # ifdef FEAT_GUI_GTK
565 /* Tell gdk we are interested in being called when there 565 /* Tell gdk we are interested in being called when there
566 * is input on the editor connection socket. */ 566 * is input on the editor connection socket. */
571 (gint)channel->ch_part[part].ch_fd); 571 (gint)channel->ch_part[part].ch_fd);
572 572
573 channel->ch_part[part].ch_inputHandler = g_io_add_watch( 573 channel->ch_part[part].ch_inputHandler = g_io_add_watch(
574 chnnl, 574 chnnl,
575 G_IO_IN|G_IO_HUP|G_IO_ERR|G_IO_PRI, 575 G_IO_IN|G_IO_HUP|G_IO_ERR|G_IO_PRI,
576 messageFromNetbeans, 576 messageFromServer,
577 GINT_TO_POINTER(channel->ch_part[part].ch_fd)); 577 GINT_TO_POINTER(channel->ch_part[part].ch_fd));
578 578
579 g_io_channel_unref(chnnl); 579 g_io_channel_unref(chnnl);
580 } 580 }
581 # else 581 # else
582 channel->ch_part[part].ch_inputHandler = gdk_input_add( 582 channel->ch_part[part].ch_inputHandler = gdk_input_add(
583 (gint)channel->ch_part[part].ch_fd, 583 (gint)channel->ch_part[part].ch_fd,
584 (GdkInputCondition) 584 (GdkInputCondition)
585 ((int)GDK_INPUT_READ + (int)GDK_INPUT_EXCEPTION), 585 ((int)GDK_INPUT_READ + (int)GDK_INPUT_EXCEPTION),
586 messageFromNetbeans, 586 messageFromServer,
587 (gpointer)(long)channel->ch_part[part].ch_fd); 587 (gpointer)(long)channel->ch_part[part].ch_fd);
588 # endif 588 # endif
589 # endif 589 # endif
590 # endif 590 # endif
591 } 591 }