~oem-solutions-group/unity-2d/clutter-1.0

« back to all changes in this revision

Viewing changes to tests/interactive/test-paint-wrapper.c

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2010-03-21 13:27:56 UTC
  • mto: (2.1.3 experimental)
  • 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:
 
1
#ifdef HAVE_CONFIG_H
 
2
#include "config.h"
 
3
#endif
 
4
 
1
5
#include <gmodule.h>
2
6
#include <clutter/clutter.h>
3
7
 
10
14
#include <stdlib.h>
11
15
#include <glib.h>
12
16
 
 
17
#ifdef HAVE_CLUTTER_GLX
 
18
#include "clutter/x11/clutter-x11.h"
 
19
#endif
 
20
 
13
21
#define NHANDS  6
14
22
 
15
23
typedef struct SuperOH
31
39
} SuperOH;
32
40
 
33
41
static gint n_hands = NHANDS;
 
42
static gint use_alpha = 255;
34
43
 
35
44
static GOptionEntry super_oh_entries[] = {
36
45
  {
39
48
    G_OPTION_ARG_INT, &n_hands,
40
49
    "Number of hands", "HANDS"
41
50
  },
 
51
  {
 
52
    "use-alpha", 'a',
 
53
    0,
 
54
    G_OPTION_ARG_INT, &use_alpha,
 
55
    "Stage opacity", "VALUE"
 
56
  },
42
57
  { NULL }
43
58
};
44
59
 
188
203
 
189
204
  error = NULL;
190
205
 
 
206
#ifdef HAVE_CLUTTER_GLX
 
207
  clutter_x11_set_use_argb_visual (TRUE);
 
208
#endif
 
209
 
191
210
  clutter_init_with_args (&argc, &argv,
192
211
                          NULL,
193
212
                          super_oh_entries,
205
224
  stage = clutter_stage_get_default ();
206
225
  clutter_actor_set_size (stage, 800, 600);
207
226
 
 
227
  if (use_alpha != 255)
 
228
    {
 
229
      clutter_stage_set_use_alpha (CLUTTER_STAGE (stage), TRUE);
 
230
      clutter_actor_set_opacity (stage, use_alpha);
 
231
    }
 
232
 
208
233
  clutter_stage_set_title (CLUTTER_STAGE (stage), "Paint Test");
209
234
  clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
210
235
 
224
249
  oh->scaler_1 = clutter_behaviour_scale_new (alpha, 0.5, 0.5, 1.0, 1.0);
225
250
  oh->scaler_2 = clutter_behaviour_scale_new (alpha, 1.0, 1.0, 0.5, 0.5);
226
251
 
227
 
  real_hand = clutter_texture_new_from_file ("redhand.png", &error);
 
252
  real_hand = clutter_texture_new_from_file (TESTS_DATADIR 
 
253
                                             G_DIR_SEPARATOR_S
 
254
                                             "redhand.png",
 
255
                                             &error);
228
256
  if (real_hand == NULL)
229
257
    {
230
258
      g_error ("image load failed: %s", error->message);