Back to index

plt-scheme  4.2.1
xwMenuP.h
Go to the documentation of this file.
00001 /***********************************************************
00002 Copyright 2004-2009 PLT Scheme Inc.
00003 Copyright 1995 by Markus Holzem
00004 
00005                         All Rights Reserved
00006 
00007 Permission to use, copy, modify, and distribute this software and its 
00008 documentation for any purpose and without fee is hereby granted, 
00009 provided that the above copyright notice appear in all copies and that
00010 both that copyright notice and this permission notice appear in 
00011 supporting documentation, and that the names of Digital, MIT, or Kaleb
00012 Keithley not be used in advertising or publicity pertaining to distribution 
00013 of the software without specific, written prior permission.  
00014 
00015 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
00016 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
00017 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
00018 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
00019 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
00020 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
00021 SOFTWARE.
00022 
00023 ******************************************************************/
00024 
00025 #ifndef _MenuP_h
00026 #define _MenuP_h
00027 
00028 #include <X11/CoreP.h>
00029 #include <xwMenu.h>
00030 
00031 /* current and new state of windows */
00032 typedef struct _menu_state {
00033     menu_item          *menu;
00034     menu_item          *selected;
00035     Window           win;
00036     Position         x;
00037     Position         y;
00038     int                      delta, scrolled, can_go_down, arrow_start;
00039     struct _menu_item  *scroll_top;
00040     int                too_tall;
00041     long               timer;
00042     Dimension        w;
00043     Dimension        h;
00044     Dimension        wLeft;
00045     Dimension        wMiddle;
00046     struct _menu_state *prev;
00047 } menu_state;
00048 
00049 /* New fields for the Menu widget instance record */
00050 typedef struct _MenuPart {
00051     /* public resources */
00052     Dimension       shadow_width;   /* shadow data */
00053     Dimension       requested_width;
00054     Boolean         be_nice_to_cmap;
00055     Pixel           top_shadow_pixel;
00056     Pixmap          top_shadow_pxmap;
00057     int             top_shadow_contrast;
00058     Pixel           bot_shadow_pixel;
00059     Pixmap          bot_shadow_pxmap;
00060     int             bot_shadow_contrast;
00061     Pixel         foreground;          /* foreground drawing */
00062     XFontStruct     *font;
00063 #ifdef WX_USE_XFT
00064     XftFont         *xft_font;
00065 #endif
00066     Boolean         horizontal;
00067     Boolean         forChoice;      /* Means extra left and right space */
00068     Boolean         forPopup;
00069     Dimension     hmargin;      /* margins around menu items */
00070     Dimension     indicator_size; /* data for toggle, radio and cascade */
00071     Dimension       extra_left, extra_top, extra_right, extra_bottom;
00072     Pixel           indicator_pixel;
00073     Pixmap          indicator_pxmap;
00074     int             indicator_contrast;
00075     Pixel           highlight_pixel;
00076     Pixel           highlight_top_pixel;
00077     menu_item       *contents;         /* menu structure */
00078     XtCallbackList  on_new_item;    /* callback procedures */
00079     XtCallbackList  on_select;
00080     XtCallbackList  on_no_select;
00081     XtCallbackList  on_destroy;
00082     Boolean         refresh;
00083     /* private data */
00084     Cursor          cursor;
00085     GC              normal_GC;
00086     GC              inactive_GC;
00087     GC              erase_GC;
00088     GC              top_shadow_GC;
00089     GC              bot_shadow_GC;
00090     GC              indicator_GC;
00091     GC              highlight_GC;
00092     GC              highlight_top_GC;
00093     Pixmap          stipple_pxmap;
00094     Boolean         popped_up;
00095     /* menu state */
00096     menu_state      *state;
00097     Boolean         grabbed;
00098     Boolean         moused_out;
00099 } MenuPart;
00100 
00101 /* Full instance record declaration */
00102 typedef struct _MenuRec {
00103     CorePart  core;
00104     MenuPart  menu;
00105 } MenuRec;
00106 
00107 /* New fields for the Menu widget class record */
00108 typedef struct { int dummy; } MenuClassPart;
00109 
00110 /* Full class record declaration. */
00111 typedef struct _MenuClassRec {
00112     CoreClassPart    core_class;
00113     MenuClassPart    menu_class;
00114 } MenuClassRec;
00115 
00116 /* Class pointer. */
00117 extern MenuClassRec menuClassRec;
00118 
00119 #endif /* _MenuP_h */