|
|
1.1.1.2 ! root 1: /* $Id: gtk-display.h,v 1.6 2005/04/30 15:20:26 fredette Exp $ */ 1.1 root 2: 3: /* host/gtk/gtk-display.h - header file for GTK display support: */ 4: 5: /* 6: * Copyright (c) 2003 Matt Fredette 7: * All rights reserved. 8: * 9: * Redistribution and use in source and binary forms, with or without 10: * modification, are permitted provided that the following conditions 11: * are met: 12: * 1. Redistributions of source code must retain the above copyright 13: * notice, this list of conditions and the following disclaimer. 14: * 2. Redistributions in binary form must reproduce the above copyright 15: * notice, this list of conditions and the following disclaimer in the 16: * documentation and/or other materials provided with the distribution. 17: * 3. All advertising materials mentioning features or use of this software 18: * must display the following acknowledgement: 19: * This product includes software developed by Matt Fredette. 20: * 4. The name of the author may not be used to endorse or promote products 21: * derived from this software without specific prior written permission. 22: * 23: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 24: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26: * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 27: * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28: * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 29: * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 31: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 32: * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33: * POSSIBILITY OF SUCH DAMAGE. 34: */ 35: 36: #ifndef _HOST_GTK_GTK_DISPLAY_H 37: #define _HOST_GTK_GTK_DISPLAY_H 38: 39: #include <tme/common.h> 1.1.1.2 ! root 40: _TME_RCSID("$Id: gtk-display.h,v 1.6 2005/04/30 15:20:26 fredette Exp $"); 1.1 root 41: 42: /* includes: */ 43: #include <tme/generic/fb.h> 44: #include <tme/generic/keyboard.h> 45: #include <tme/generic/mouse.h> 46: #include <tme/threads.h> 47: #include <tme/hash.h> 1.1.1.2 ! root 48: #ifndef G_ENABLE_DEBUG ! 49: #define G_ENABLE_DEBUG (0) ! 50: #endif /* !G_ENABLE_DEBUG */ 1.1 root 51: #include <gtk/gtk.h> 52: 53: /* macros: */ 54: 55: /* the callout flags: */ 56: #define TME_GTK_DISPLAY_CALLOUT_CHECK (0) 57: #define TME_GTK_DISPLAY_CALLOUT_RUNNING TME_BIT(0) 58: #define TME_GTK_DISPLAY_CALLOUTS_MASK (-2) 59: #define TME_GTK_DISPLAY_CALLOUT_KEYBOARD_CTRL TME_BIT(1) 60: #define TME_GTK_DISPLAY_CALLOUT_MOUSE_CTRL TME_BIT(2) 61: 62: /* types: */ 63: 64: struct tme_gtk_display; 65: 66: /* a screen: */ 67: struct tme_gtk_screen { 68: 69: /* the next screen: */ 70: struct tme_gtk_screen *tme_gtk_screen_next; 71: 72: /* a backpointer to the display: */ 73: struct tme_gtk_display *tme_gtk_screen_display; 74: 75: /* the framebuffer connection. unlike many other elements, this is 76: *our* side of the framebuffer connection, not the peer's side: */ 77: struct tme_fb_connection *tme_gtk_screen_fb; 78: 79: /* the current scaling. if this is < 0, the user has not forced a 80: given scaling yet: */ 81: int tme_gtk_screen_fb_scale; 82: 83: /* the top-level window: */ 84: GtkWidget *tme_gtk_screen_window; 85: 86: /* the outer vertical packing box: */ 87: GtkWidget *tme_gtk_screen_vbox0; 88: 89: /* various menu item widgets: */ 90: GtkWidget *tme_gtk_screen_scale_default; 91: GtkWidget *tme_gtk_screen_scale_half; 92: 93: /* the GtkEventBox, GdkImage and GtkImage for the framebuffer: */ 94: GtkWidget *tme_gtk_screen_event_box; 95: GdkImage *tme_gtk_screen_gdkimage; 96: GtkWidget *tme_gtk_screen_gtkimage; 97: 98: /* the translation function: */ 99: int (*tme_gtk_screen_fb_xlat) _TME_P((struct tme_fb_connection *, 100: struct tme_fb_connection *)); 101: 102: /* the mouse on label: */ 103: GtkWidget *tme_gtk_screen_mouse_label; 104: 105: /* the status bar, and the context ID: */ 106: GtkWidget *tme_gtk_screen_mouse_statusbar; 107: guint tme_gtk_screen_mouse_statusbar_cid; 108: 109: /* if GDK_VoidSymbol, mouse mode is off. otherwise, 110: mouse mode is on, and this is the keyval that will 111: turn mouse mode off: */ 112: guint tme_gtk_screen_mouse_keyval; 113: 114: /* when mouse mode is on, this is the previous events mask 115: for the framebuffer event box: */ 116: GdkEventMask tme_gtk_screen_mouse_events_old; 117: 118: /* when mouse mode is on, this is the warp center: */ 119: guint tme_gtk_screen_mouse_warp_x; 120: guint tme_gtk_screen_mouse_warp_y; 121: 122: /* when mouse mode is on, the last tme buttons state: */ 123: unsigned int tme_gtk_screen_mouse_buttons_last; 124: }; 125: 126: /* a GTK bad keysym: */ 127: struct tme_gtk_keysym_bad { 128: 129: /* these are kept on a singly linked list: */ 130: struct tme_gtk_keysym_bad *tme_gtk_keysym_bad_next; 131: 132: /* the bad keysym string: */ 133: char *tme_gtk_keysym_bad_string; 134: 135: /* the flags and context used in the lookup: */ 136: unsigned int tme_keysym_bad_flags; 137: unsigned int tme_gtk_keysym_bad_context_length; 138: tme_uint8_t *tme_gtk_keysym_bad_context; 139: }; 140: 141: /* a display: */ 142: struct tme_gtk_display { 143: 144: /* backpointer to our element: */ 145: struct tme_element *tme_gtk_display_element; 146: 147: /* our mutex: */ 148: tme_mutex_t tme_gtk_display_mutex; 149: 150: /* our keyboard connection: */ 151: struct tme_keyboard_connection *tme_gtk_display_keyboard_connection; 152: 153: /* our keyboard buffer: */ 154: struct tme_keyboard_buffer *tme_gtk_display_keyboard_buffer; 155: 156: /* our keysyms hash: */ 157: tme_hash_t tme_gtk_display_keyboard_keysyms; 158: 159: /* the bad keysym records: */ 160: struct tme_gtk_keysym_bad *tme_gtk_display_keyboard_keysyms_bad; 161: 162: /* our keysym to keycode hash: */ 163: tme_hash_t tme_gtk_display_keyboard_keysym_to_keycode; 164: 165: /* our mouse connection: */ 166: struct tme_mouse_connection *tme_gtk_display_mouse_connection; 167: 168: /* our mouse buffer: */ 169: struct tme_mouse_buffer *tme_gtk_display_mouse_buffer; 170: 171: /* our mouse cursor: */ 172: GdkCursor *tme_gtk_display_mouse_cursor; 173: 174: /* our screens: */ 175: struct tme_gtk_screen *tme_gtk_display_screens; 176: 177: /* the callout flags: */ 178: unsigned int tme_gtk_display_callout_flags; 179: 180: /* the tooltips group: */ 181: GtkTooltips *tme_gtk_display_tooltips; 182: }; 183: 184: /* prototypes: */ 185: struct tme_gtk_screen *_tme_gtk_screen_new _TME_P((struct tme_gtk_display *)); 186: int _tme_gtk_screen_connections_new _TME_P((struct tme_gtk_display *, 187: struct tme_connection **)); 188: void _tme_gtk_keyboard_new _TME_P((struct tme_gtk_display *)); 189: void _tme_gtk_keyboard_attach _TME_P((struct tme_gtk_screen *)); 190: int _tme_gtk_keyboard_connections_new _TME_P((struct tme_gtk_display *, 191: struct tme_connection **)); 192: void _tme_gtk_mouse_new _TME_P((struct tme_gtk_display *)); 193: void _tme_gtk_mouse_mode_off _TME_P((struct tme_gtk_screen *, guint32)); 194: void _tme_gtk_mouse_attach _TME_P((struct tme_gtk_screen *)); 195: int _tme_gtk_mouse_connections_new _TME_P((struct tme_gtk_display *, 196: struct tme_connection **)); 197: void _tme_gtk_screen_th_update _TME_P((struct tme_gtk_display *)); 198: void _tme_gtk_display_callout _TME_P((struct tme_gtk_display *, 199: int)); 200: gint _tme_gtk_display_enter_focus _TME_P((GtkWidget *, GdkEvent *, gpointer)); 201: 202: #endif /* _HOST_GTK_GTK_DISPLAY_H */ 203:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.