~ubuntu-branches/ubuntu/precise/clutter-1.0/precise

« back to all changes in this revision

Viewing changes to tests/interactive/test-text.c

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2010-03-21 13:27:56 UTC
  • mto: (2.1.3 experimental) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20100321132756-nf8yd30yxo3zzwcm
Tags: upstream-1.2.2
Import upstream version 1.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#include <gmodule.h>
4
4
#include <clutter/clutter.h>
5
5
 
6
 
#define FONT "Mono Bold 22px"
 
6
#define FONT "Mono Bold 24px"
7
7
 
8
 
static gchar *runes =
 
8
static const gchar *runes =
9
9
"ᚠᛇᚻ᛫ᛒᛦᚦ᛫ᚠᚱᚩᚠᚢᚱ᛫ᚠᛁᚱᚪ᛫ᚷᛖᚻᚹᛦᛚᚳᚢᛗ\n"
10
10
"ᛋᚳᛖᚪᛚ᛫ᚦᛖᚪᚻ᛫ᛗᚪᚾᚾᚪ᛫ᚷᛖᚻᚹᛦᛚᚳ᛫ᛗᛁᚳᛚᚢᚾ᛫ᚻᛦᛏ᛫ᛞᚫᛚᚪᚾ\n"
11
11
"ᚷᛁᚠ᛫ᚻᛖ᛫ᚹᛁᛚᛖ᛫ᚠᚩᚱ᛫ᛞᚱᛁᚻᛏᚾᛖ᛫ᛞᚩᛗᛖᛋ᛫ᚻᛚᛇᛏᚪᚾ᛬\n";
12
12
 
13
 
 
14
 
static void
15
 
cursor_event (ClutterText        *text,
16
 
              ClutterGeometry *geometry)
17
 
{
18
 
  gint y;
19
 
 
20
 
  y = clutter_actor_get_y (CLUTTER_ACTOR (text));
21
 
 
22
 
  if (y + geometry->y < 50)
23
 
    {
24
 
      clutter_actor_set_y (CLUTTER_ACTOR (text), y + 100);
25
 
    }
26
 
  else if (y + geometry->y > 720)
27
 
    {
28
 
      clutter_actor_set_y (CLUTTER_ACTOR (text), y - 100);
29
 
    }
30
 
 
31
 
}
32
 
 
33
13
G_MODULE_EXPORT gint
34
14
test_text_main (gint    argc,
35
15
                gchar **argv)
78
58
  else
79
59
    clutter_text_set_text (CLUTTER_TEXT (text), runes);
80
60
 
81
 
  g_signal_connect (text, "cursor-event", G_CALLBACK (cursor_event), NULL);
82
 
 
83
61
  clutter_actor_set_size (stage, 1024, 768);
84
62
  clutter_actor_show (stage);
85
63