home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / XfeWidgets / Xfe / ToolBoxP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  7.3 KB  |  200 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /*-----------------------------------------*/
  19. /*                                                                        */
  20. /* Name:        <Xfe/ToolBoxP.h>                                        */
  21. /* Description:    XfeToolBox widget private header file.                    */
  22. /* Author:        Ramiro Estrugo <ramiro@netscape.com>                    */
  23. /*                                                                        */
  24. /*----------------------------------------------------------------------*/
  25.  
  26.  
  27. #ifndef _XfeToolBoxP_h_                            /* start ToolBoxP.h        */
  28. #define _XfeToolBoxP_h_
  29.  
  30. #include <Xfe/ToolBox.h>
  31. #include <Xfe/ManagerP.h>
  32.  
  33. #ifdef __cplusplus                                /* start C++            */
  34. extern "C" {
  35. #endif
  36.    
  37. /*----------------------------------------------------------------------*/
  38. /*                                                                        */
  39. /* XfeToolBoxClassPart                                                    */
  40. /*                                                                        */
  41. /*----------------------------------------------------------------------*/
  42. typedef struct
  43. {
  44.     XtPointer        extension;                    /* Extension            */ 
  45. } XfeToolBoxClassPart;
  46.  
  47. /*----------------------------------------------------------------------*/
  48. /*                                                                        */
  49. /* XfeToolBoxClassRec                                                    */
  50. /*                                                                        */
  51. /*----------------------------------------------------------------------*/
  52. typedef struct _XfeToolBoxClassRec
  53. {
  54.     CoreClassPart                core_class;
  55.     CompositeClassPart            composite_class;
  56.     ConstraintClassPart            constraint_class;
  57.     XmManagerClassPart            manager_class;
  58.     XfeManagerClassPart            xfe_manager_class;
  59.     XfeToolBoxClassPart            xfe_tool_box_class;
  60. } XfeToolBoxClassRec;
  61.  
  62. externalref XfeToolBoxClassRec xfeToolBoxClassRec;
  63.  
  64. /*----------------------------------------------------------------------*/
  65. /*                                                                        */
  66. /* XfeToolBoxPart                                                        */
  67. /*                                                                        */
  68. /*----------------------------------------------------------------------*/
  69. typedef struct _XfeToolBoxPart
  70. {
  71.     /* Callbacks */
  72.     XtCallbackList        new_item_callback;        /* New item callback    */
  73.     XtCallbackList        swap_callback;            /* Swap callback        */
  74.     XtCallbackList        close_callback;            /* Close callback        */
  75.     XtCallbackList        drag_allow_callback;    /* Drag allow callback    */
  76.     XtCallbackList        drag_end_callback;        /* Drag end callback    */
  77.     XtCallbackList        drag_motion_callback;    /* Drag motion callback    */
  78.     XtCallbackList        drag_start_callback;    /* Drag start callback    */
  79.     XtCallbackList        open_callback;            /* Open callback        */
  80.     XtCallbackList        snap_callback;            /* Snap callback        */
  81.  
  82.     /* Item resources */
  83.     WidgetList            items;                    /* Items                */
  84.     Cardinal            item_count;                /* Item count            */
  85.  
  86.     /* Tab resources */
  87.     WidgetList            closed_tabs;            /* Closed tabs            */
  88.     WidgetList            opened_tabs;            /* Opened tabs            */
  89.     Dimension            tab_offset;                /* Tab offset            */
  90.  
  91.     /* Spacing resources */
  92.     Dimension            vertical_spacing;        /* Vertical spacing        */
  93.     Dimension            horizontal_spacing;        /* Horizontal spacing    */
  94.  
  95.     /* Drag resources */
  96.     Dimension            drag_threshold;            /* Drag threshold        */ 
  97.     Cursor                drag_cursor;            /* Drag cursor            */
  98.     int                    drag_button;            /* Drag button            */
  99.  
  100.     /* Swap resources */
  101.     Dimension            swap_threshold;            /* Swap threshold        */ 
  102.     
  103.     /* Pixmap resources */
  104.     Pixmap                bottom_pixmap;            /* Bottom pixmap        */
  105.     Pixmap                horizontal_pixmap;        /* Horizontal pixmap    */
  106.     Pixmap                left_pixmap;            /* Left pixmap            */
  107.     Pixmap                right_pixmap;            /* Right pixmap            */
  108.     Pixmap                top_pixmap;                /* Top pixmap            */
  109.     Pixmap                vertical_pixmap;        /* Vertical pixmap        */
  110.     Pixmap                bottom_raised_pixmap;    /* Bottom Raised pixmap    */
  111.     Pixmap                horizontal_raised_pixmap;/* Hor Raised pixmap    */
  112.     Pixmap                left_raised_pixmap;        /* Left Raised pixmap    */
  113.     Pixmap                right_raised_pixmap;    /* Right Raised pixmap    */
  114.     Pixmap                top_raised_pixmap;        /* Top Raised pixmap    */
  115.     Pixmap                vertical_raised_pixmap;    /* Ver Raised pixmap    */
  116.  
  117.     /* Private data -- Dont even look past this comment -- */
  118.     int                    last_y;                    /* Last y                */
  119.     int                    original_y;                /* Origian y            */
  120.     int                    last_drag_y;            /* Last drag y            */
  121.     int                    start_drag_y;            /* Start drag y            */
  122.  
  123.     Widget                last_moved_item;        /* Last moved item        */
  124.  
  125.     int drag_direction;
  126.  
  127.     Boolean                dragging;                /* Dragging ?            */
  128.     Boolean                dragging_tab;            /* Dragging Tab ?        */
  129.     Boolean                clicking_tab;            /* Clicking Tab ?        */
  130.  
  131. } XfeToolBoxPart;
  132.  
  133. /*----------------------------------------------------------------------*/
  134. /*                                                                        */
  135. /* XfeToolBoxRec                                                        */
  136. /*                                                                        */
  137. /*----------------------------------------------------------------------*/
  138. typedef struct _XfeToolBoxRec
  139. {
  140.    CorePart                core;
  141.    CompositePart        composite;
  142.    ConstraintPart        constraint;
  143.    XmManagerPart        manager;
  144.    XfeManagerPart        xfe_manager;
  145.    XfeToolBoxPart        xfe_tool_box;
  146. } XfeToolBoxRec;
  147.  
  148. /*----------------------------------------------------------------------*/
  149. /*                                                                        */
  150. /* XfeToolBoxConstraintPart                                                */
  151. /*                                                                        */
  152. /*----------------------------------------------------------------------*/
  153. typedef struct _XfeToolBoxConstraintPart
  154. {
  155.     Boolean         open;                /* open            */
  156. } XfeToolBoxConstraintPart;
  157.  
  158. /*----------------------------------------------------------------------*/
  159. /*                                                                        */
  160. /* XfeToolBoxConstraintRec                                                */
  161. /*                                                                        */
  162. /*----------------------------------------------------------------------*/
  163. typedef struct _XfeToolBoxConstraintRec
  164. {
  165.     XmManagerConstraintPart        manager;
  166.     XfeManagerConstraintPart    xfe_manager;
  167.     XfeToolBoxConstraintPart    xfe_tool_box;
  168. } XfeToolBoxConstraintRec;
  169.  
  170. /*----------------------------------------------------------------------*/
  171. /*                                                                        */
  172. /* XfeToolBoxPart Access Macro                                            */
  173. /*                                                                        */
  174. /*----------------------------------------------------------------------*/
  175. #define _XfeToolBoxPart(w) &(((XfeToolBoxWidget) w) -> xfe_tool_box)
  176.  
  177. /*----------------------------------------------------------------------*/
  178. /*                                                                        */
  179. /* XfeToolBoxPart child constraint part access macro                    */
  180. /*                                                                        */
  181. /*----------------------------------------------------------------------*/
  182. #define _XfeToolBoxConstraintPart(w) \
  183. (&(((XfeToolBoxConstraintRec *) _XfeConstraints(w)) -> xfe_tool_box))
  184.  
  185. /*----------------------------------------------------------------------*/
  186. /*                                                                        */
  187. /* XfeToolBoxPart child constraint open access macro                    */
  188. /*                                                                        */
  189. /*----------------------------------------------------------------------*/
  190. #define _XfeToolBoxChildOpen(child) \
  191. ((_XfeToolBoxConstraintPart(child)) -> open)
  192. /*----------------------------------------------------------------------*/
  193.  
  194. #ifdef __cplusplus                                /* end C++                */
  195. }
  196. #endif
  197.  
  198. #endif                                            /* end ToolBoxP.h    */
  199.  
  200.