Exemplo n.º 1
0
// FIXME: the pos of g_pSeg[].label is not correct
static gboolean
gcin_label_cand_show (char *pszWord, int nIdx)
{
    int nX, nY;
    int nFontWidth, nFontHeight;

    g_gcinModMainFuncs.mf_set_sele_text (nIdx,
                                         pszWord,
                                         -1);

    // find the position of the cand win
    g_gcinModMainFuncs.mf_get_widget_xy (g_pWinChewing,
                                         g_pSeg[g_nCurrentCursorPos].label,
                                         &nX, &nY);

    gtk_pango_font_pixel_size_get (&nFontWidth, &nFontHeight);
    nX += g_nCurrentCursorPos * nFontWidth;

    nY = g_gcinModMainFuncs.mf_gcin_edit_display_ap_only () ?
         *g_gcinModMainFuncs.mf_win_y :
         *g_gcinModMainFuncs.mf_win_y + *g_gcinModMainFuncs.mf_win_yl;

    g_gcinModMainFuncs.mf_disp_selections (nX, nY);

    return TRUE;
}
Exemplo n.º 2
0
static void disp_select()
{
//  puts("disp_select");
  gmf.mf_clear_sele();
  int endn = pageidx + gmf.mf_phkbm->selkeyN;
  if (endn >  seg[cursor].selN)
    endn = seg[cursor].selN;
  int i;
  for(i=pageidx; i<endn; i++) {
    char buf[256];
    anthy_get_segment(ac, cursor, i, buf, sizeof(buf));
//    printf("%d %s\n", i, buf);
    gmf.mf_set_sele_text(seg[cursor].selN, i - pageidx, buf, -1);
  }

  if (pageidx)
    gmf.mf_disp_arrow_up();
  if (i < seg[cursor].selN)
    gmf.mf_disp_arrow_down();

  int x,y;
  gmf.mf_get_widget_xy(win_anthy, seg[cursor].label, &x, &y);
//  printf("%x cusor %d %d\n", win_anthy, cursor, x);
  y = gmf.mf_gcin_edit_display_ap_only()?
    *gmf.mf_win_y:*gmf.mf_win_y+*gmf.mf_win_yl;
  gmf.mf_disp_selections(x, y);
}