コード例 #1
0
ファイル: qhelpermanager.cpp プロジェクト: m8a/uim
void QUimHelperManager::checkHelperConnection()
{
    if ( im_uim_fd < 0 )
    {
        im_uim_fd = uim_helper_init_client_fd( QUimHelperManager::helper_disconnect_cb );

        if ( im_uim_fd >= 0 )
        {
            notifier = new QSocketNotifier( im_uim_fd, QSocketNotifier::Read );
            connect( notifier, SIGNAL( activated( int ) ),
                              this, SLOT( slotStdinActivated() ) );
        }
コード例 #2
0
ファイル: common-gtk.c プロジェクト: na4zagin3/uim
void
uim_toolbar_check_helper_connection(GtkWidget *widget)
{
    if (uim_fd < 0) {
        uim_fd = uim_helper_init_client_fd(helper_disconnect_cb);
        if (uim_fd > 0) {
            GIOChannel *channel;
            channel = g_io_channel_unix_new(uim_fd);
            read_tag = g_io_add_watch(channel, G_IO_IN | G_IO_HUP | G_IO_ERR,
                                      fd_read_cb, (gpointer)widget);
            g_io_channel_unref(channel);
        }
    }
}
コード例 #3
0
ファイル: common-uimstateindicator.cpp プロジェクト: m8a/uim
void UimStateIndicator::checkHelperConnection()
{
    if ( uim_fd < 0 )
    {
        uim_fd = uim_helper_init_client_fd( helper_disconnect_cb );
        if ( uim_fd > 0 )
        {
            if ( notifier )
                delete notifier;
            notifier = new QSocketNotifier( uim_fd, QSocketNotifier::Read );
            connect( notifier, SIGNAL( activated( int ) ),
                              this, SLOT( slotStdinActivated() ) );
        }
    }
コード例 #4
0
ファイル: qt4.cpp プロジェクト: TheSLinux-forks/uim
KUimCharDict::KUimCharDict( QWidget *parent )
        : QWidget( parent )
{
#ifdef Q_WS_X11
    // Don't give input focus to this window.
    XWMHints *wmhints = XGetWMHints( QX11Info::display(), winId() );
    if ( !wmhints )
        wmhints = XAllocWMHints();
    wmhints->flags = InputHint;
    wmhints->input = False;
    XSetWMHints( QX11Info::display(), winId(), wmhints );
    XFree( wmhints );
#endif

    setupWidgets();

    readConfig();

    uim_fd = uim_helper_init_client_fd( 0 );
}
コード例 #5
0
ファイル: uim.c プロジェクト: qsniyg/uim-led
void uimled_uim_connect(void)
{
  if (uimled_uim_fd >= 0)
    return;

  uimled_uim_fd = uim_helper_init_client_fd(uimled_uim_disconnect);

  if (uimled_uim_fd < 0)
    return;

  if (!uimled_uim_read_id)
    {
      if (pthread_create(&uimled_uim_read_id, NULL,
                         uimled_uim_read_thread,
                         &uimled_uim_fd) == -1)
        {
          perror("pthread_create");
          return;
        }
    }
}