示例#1
0
static void
st_im_text_commit_cb (GtkIMContext *context,
                      const gchar  *str,
                      StIMText     *imtext)
{
  ClutterText *clutter_text = CLUTTER_TEXT (imtext);

  if (clutter_text_get_editable (clutter_text))
    {
      clutter_text_delete_selection (clutter_text);
      clutter_text_insert_text (clutter_text, str,
                                clutter_text_get_cursor_position (clutter_text));
    }
}
示例#2
0
static void
st_entry_clipboard_callback (StClipboard *clipboard,
                             const gchar *text,
                             gpointer     data)
{
  ClutterText *ctext = (ClutterText*)((StEntry *) data)->priv->entry;
  gint cursor_pos;

  if (!text)
    return;

  /* delete the current selection before pasting */
  clutter_text_delete_selection (ctext);

  /* "paste" the clipboard text into the entry */
  cursor_pos = clutter_text_get_cursor_position (ctext);
  clutter_text_insert_text (ctext, text, cursor_pos);
}
示例#3
0
文件: foofone.c 项目: UIKit0/toys
void
button_activate (App *app, Button *b)
{
  // Wait for the previous animation to end
  if (clutter_actor_get_animation (b->actor))
    return;

  clutter_text_insert_text (CLUTTER_TEXT(app->dpy_entry), b->face, -1);

  clutter_actor_set_opacity (b->actor, 0xff);
  clutter_actor_set_scale (b->actor, 1.0, 1.0);
  clutter_actor_animate (b->actor, CLUTTER_LINEAR, 50,
                         "opacity", 0x00,
                         "scale-x", 1.5,
                         "scale-y", 1.5,
                         "signal-after::completed", on_button_effect_complete, b->actor,
                         NULL);
}