adamdunkels | a2f3c42 | 2004-09-12 20:24:53 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2004, Adam Dunkels. |
| 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 copyright |
| 11 | * notice, this list of conditions and the following disclaimer in the |
| 12 | * documentation and/or other materials provided with the distribution. |
| 13 | * 3. Neither the name of the Institute nor the names of its contributors |
| 14 | * may be used to endorse or promote products derived from this software |
| 15 | * without specific prior written permission. |
| 16 | * |
| 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND |
| 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE |
| 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 27 | * SUCH DAMAGE. |
| 28 | * |
| 29 | * This file is part of the Contiki operating system. |
| 30 | * |
| 31 | * Author: Adam Dunkels <adam@sics.se> |
| 32 | * |
oliverschmidt | adf27db | 2005-03-15 15:51:17 +0000 | [diff] [blame] | 33 | * $Id: ctk-draw-service.h,v 1.4 2005/03/15 15:51:17 oliverschmidt Exp $ |
adamdunkels | a2f3c42 | 2004-09-12 20:24:53 +0000 | [diff] [blame] | 34 | */ |
adamdunkels | 074dd97 | 2004-07-04 11:39:43 +0000 | [diff] [blame] | 35 | #ifndef __CTK_DRAW_SERVICE_H__ |
| 36 | #define __CTK_DRAW_SERVICE_H__ |
| 37 | |
| 38 | #include "ek-service.h" |
| 39 | |
| 40 | #include "ctk.h" |
| 41 | |
adamdunkels | 8fd59e1 | 2004-08-09 20:22:00 +0000 | [diff] [blame] | 42 | #define CTK_DRAW_SERVICE_NAME "CTK driver" |
adamdunkels | 074dd97 | 2004-07-04 11:39:43 +0000 | [diff] [blame] | 43 | #define CTK_DRAW_SERVICE_VERSION 0x0001 |
| 44 | struct ctk_draw_service_interface { |
| 45 | unsigned char version; |
| 46 | unsigned char windowborder_width, |
| 47 | windowborder_height, |
| 48 | windowtitle_height; |
| 49 | |
| 50 | void (* draw_init)(void); |
| 51 | void (* draw_clear)(unsigned char clipy1, unsigned char clipy2); |
| 52 | void (* draw_clear_window)(struct ctk_window *window, |
| 53 | unsigned char focus, |
| 54 | unsigned char clipy1, |
| 55 | unsigned char clipy2); |
| 56 | void (* draw_window)(struct ctk_window *window, |
| 57 | unsigned char focus, |
| 58 | unsigned char clipy1, |
oliverschmidt | adf27db | 2005-03-15 15:51:17 +0000 | [diff] [blame] | 59 | unsigned char clipy2, |
| 60 | unsigned char draw_borders); |
adamdunkels | 074dd97 | 2004-07-04 11:39:43 +0000 | [diff] [blame] | 61 | void (* draw_dialog)(struct ctk_window *dialog); |
| 62 | void (* draw_widget)(struct ctk_widget *widget, |
| 63 | unsigned char focus, |
| 64 | unsigned char clipy1, |
| 65 | unsigned char clipy2); |
| 66 | void (* draw_menus)(struct ctk_menus *menus); |
| 67 | |
| 68 | unsigned char (* width)(void); |
| 69 | unsigned char (* height)(void); |
| 70 | |
| 71 | unsigned short (* mouse_xtoc)(unsigned short); |
| 72 | unsigned short (* mouse_ytoc)(unsigned short); |
| 73 | }; |
| 74 | |
| 75 | #endif /* __CTK_DRAW_SERVICE_H__ */ |