source: svn/branches/kctv/newcon3bcm2_21bu/dta/src/sim/gtk_app_remote.c

Last change on this file was 2, checked in by phkim, 11 years ago

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 2.4 KB
Line 
1#include <gtk/gtk.h>
2
3typedef struct button_info_t
4{
5        double x1;
6        double y1;
7        double x2;
8        double y2;
9        char *name;
10        unsigned int id;
11}button_info_t;
12
13static const button_info_t g_button_info[] =
14{
15        { 18.000000,37.000000,34.000000,46.000000,"MUTE",0x0F},
16        { 86.000000,31.000000,108.000000,44.000000,"POWER",0x0A},
17        { 18.000000,62.000000,38.000000,74.000000,"1",0x01},
18        { 50.000000,60.000000,72.000000,69.000000,"2",0x02},
19        { 85.000000,60.000000,103.000000,70.000000,"3",0x03},
20        { 17.000000,83.000000,39.000000,95.000000,"4",0x04},
21        { 52.000000,81.000000,72.000000,93.000000,"5",0x05},
22        { 85.000000,82.000000,105.000000,96.000000,"6",0x06},
23        { 19.000000,106.000000,36.000000,120.000000,"7",0x07},
24        { 49.000000,105.000000,69.000000,119.000000,"8",0x08},
25        { 82.000000,107.000000,102.000000,116.000000,"9",0x09},
26        { 21.000000,131.000000,36.000000,142.000000,"-",0x13},
27        { 51.000000,130.000000,71.000000,140.000000,"0",0x00},
28        { 80.000000,131.000000,102.000000,143.000000,"PRE-CH",0x38},
29        { 19.000000,156.000000,36.000000,166.000000,"VOL+",0x0D},
30        { 49.000000,152.000000,68.000000,164.000000,"INFO",0x33},
31        { 80.000000,153.000000,102.000000,166.000000,"CH+",0x0B},
32        { 18.000000,181.000000,33.000000,189.000000,"VOL-",0x0E},
33        { 48.000000,185.000000,69.000000,200.000000,"UP",0x34},
34        { 84.000000,179.000000,100.000000,190.000000,"CH-",0x0C},
35        { 20.000000,210.000000,42.000000,226.000000,"LEFT",0x36},
36        { 52.000000,213.000000,69.000000,224.000000,"OK",0x11},
37        { 79.000000,211.000000,102.000000,226.000000,"RIGHT",0x37},
38        { 47.000000,238.000000,71.000000,252.000000,"DOWN",0x35},
39        { 21.000000,251.000000,37.000000,263.000000,"EPG",0x30},
40        { 83.000000,251.000000,99.000000,260.000000,"MENU",0x19},
41};
42
43int g_button_into_num = sizeof(g_button_info)/sizeof(g_button_info[0]);
44extern pc_post_user_io_event(char* name,unsigned int id);
45void gtk_remote_clicked(GtkWidget      *widget,
46                                        GdkEventButton *event,
47                                        gpointer        user_data)
48{
49#if 0
50        static gboolean odd = FALSE;
51        if (odd)
52                g_print(",%f,%f,\"OK\"},\n",event->x,event->y);
53        else
54                g_print("       { %f,%f",event->x,event->y);
55        odd = !odd;
56#else
57        int i;
58        for (i = 0; i < g_button_into_num; ++i)
59        {
60                if ((event->x > g_button_info[i].x1) && (event->x < g_button_info[i].x2) &&
61                        (event->y > g_button_info[i].y1) && (event->y < g_button_info[i].y2))
62                {
63                        g_print("%s\n",g_button_info[i].name);
64                        pc_post_user_io_event(g_button_info[i].name,g_button_info[i].id);
65                        break;
66                }
67        }
68#endif
69}
Note: See TracBrowser for help on using the repository browser.