File: test-texture-frame.c

package info (click to toggle)
nbtk 1.2.3-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,044 kB
  • ctags: 2,334
  • sloc: ansic: 20,971; makefile: 435; sh: 147
file content (55 lines) | stat: -rw-r--r-- 1,541 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * Copyright 2009 Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU Lesser General Public License,
 * version 2.1, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
 * more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
 * Boston, MA 02111-1307, USA.
 *
 */
#include <stdio.h>
#include <stdlib.h>

#include <clutter/clutter.h>
#include <nbtk/nbtk.h>

int
main (int argc, char *argv[])
{
  ClutterActor *stage, *texture, *frame;
  GError *err = NULL;
  
  clutter_init (&argc, &argv);

  stage = clutter_stage_get_default ();
  clutter_actor_set_size (stage, 500, 300);

  texture = clutter_texture_new_from_file ("rounded-corner.png", &err);

  if (err)
    {
      g_critical ("%s", err->message);
      return 1;
    }

  frame = nbtk_texture_frame_new (CLUTTER_TEXTURE (texture), 25, 25, 25, 25);
  clutter_actor_set_position (frame, 50, 50);
  clutter_actor_set_size (frame, 400, 200);

  clutter_container_add (CLUTTER_CONTAINER (stage), frame, NULL);

  clutter_actor_show (stage);

  clutter_main ();

  return EXIT_SUCCESS;
}