Contiki 2.5
ctk-conio_arch.c
1 /*
2  * Copyright (c) 2007, Takahide Matsutsuka.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above
11  * copyright notice, this list of conditions and the following
12  * disclaimer in the documentation and/or other materials provided
13  * with the distribution.
14  * 3. The name of the author may not be used to endorse or promote
15  * products derived from this software without specific prior
16  * written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
19  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
22  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  * $Id: ctk-conio_arch.c,v 1.4 2009/12/16 06:47:18 matsutsuka Exp $
31  *
32  */
33 
34 /*
35  * \file
36  * This is architecture-depend contiki toolkit for PC-6001 family.
37  * \author
38  * Takahide Matsutsuka <markn@markn.org>
39  */
40 
41 
42 #include "ctk/ctk.h"
43 #include "ctk/ctk-draw.h"
44 #include "contiki-conf.h"
45 #include "ctk/ctk_arch.h"
46 #include <stddef.h>
47 
48 /*---------------------------------------------------------------------------*/
49 /*
50  * Offset constants for assembler
51  */
52 const u8_t off_widget_x = offsetof(struct ctk_widget, x);
53 const u8_t off_widget_y = offsetof(struct ctk_widget, y);
54 const u8_t off_widget_w = offsetof(struct ctk_widget, w);
55 const u8_t off_widget_h = offsetof(struct ctk_widget, h);
56 const u8_t off_widget_type = offsetof(struct ctk_widget, type);
57 const u8_t off_widget_window = offsetof(struct ctk_widget, window);
58 
59 const u8_t off_widget_label_text = offsetof(struct ctk_widget, widget) +
60  offsetof(struct ctk_widget_label, text);
61 const u8_t off_widget_button_text = offsetof(struct ctk_widget, widget) +
62  offsetof(struct ctk_widget_button, text);
63 const u8_t off_widget_textentry_text = offsetof(struct ctk_widget, widget) +
64  offsetof(struct ctk_widget_textentry, text);
65 const u8_t off_widget_textentry_xpos = offsetof(struct ctk_widget, widget) +
66  offsetof(struct ctk_widget_textentry, xpos);
67 const u8_t off_widget_textentry_ypos = offsetof(struct ctk_widget, widget) +
68  offsetof(struct ctk_widget_textentry, ypos);
69 const u8_t off_widget_textentry_state = offsetof(struct ctk_widget, widget) +
70  offsetof(struct ctk_widget_textentry, state);
71 #if CTK_CONF_HYPERLINK
72 const u8_t off_widget_hyperlink_text = offsetof(struct ctk_widget, widget) +
73  offsetof(struct ctk_widget_hyperlink, text);
74 #endif /* CTK_CONF_HYPERLINK */
75 
76 #if CTK_CONF_ICONS
77 const u8_t off_widget_icon_title = offsetof(struct ctk_widget, widget) +
78  offsetof(struct ctk_widget_icon, title);
79 const u8_t off_widget_icon_textmap = offsetof(struct ctk_widget, widget) +
80  offsetof(struct ctk_widget_icon, textmap);
81 #endif /* CTK_CONF_ICONS */
82 
83 const u8_t off_window_x = offsetof(struct ctk_window, x);
84 const u8_t off_window_y = offsetof(struct ctk_window, y);
85 const u8_t off_window_h = offsetof(struct ctk_window, h);
86 const u8_t off_window_w = offsetof(struct ctk_window, w);
87 const u8_t off_window_inactive = offsetof(struct ctk_window, inactive);
88 const u8_t off_window_active = offsetof(struct ctk_window, active);
89 const u8_t off_window_next = offsetof(struct ctk_window, next);
90 const u8_t off_window_focused = offsetof(struct ctk_window, focused);
91 
92 #if CTK_CONF_MENUS
93 const u8_t off_menu_title = offsetof(struct ctk_menu, title);
94 const u8_t off_menu_active = offsetof(struct ctk_menu, active);
95 const u8_t off_menu_nitems = offsetof(struct ctk_menu, nitems);
96 const u8_t off_menu_items = offsetof(struct ctk_menu, items);
97 const u8_t off_menu_next = offsetof(struct ctk_menu, next);
98 const u8_t off_menuitem_title = offsetof(struct ctk_menuitem, title);
99 const u8_t size_menuitem = sizeof(struct ctk_menuitem);
100 const u8_t off_menus_open = offsetof(struct ctk_menus, open);
101 const u8_t off_menus_menus = offsetof(struct ctk_menus, menus);
102 const u8_t off_menus_desktopmenu = offsetof(struct ctk_menus, desktopmenu);
103 #endif
104 
105 /*---------------------------------------------------------------------------*/