home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / XfeWidgets / Xfe / ToolBox.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  7.5 KB  |  201 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/ToolBox.h>                                            */
  21. /* Description:    XfeToolBox widget public header file.                    */
  22. /* Author:        Ramiro Estrugo <ramiro@netscape.com>                    */
  23. /*                                                                        */
  24. /*----------------------------------------------------------------------*/
  25.  
  26.  
  27. #ifndef _XfeToolBox_h_                            /* start ToolBox.h        */
  28. #define _XfeToolBox_h_
  29.  
  30. #include <Xfe/Manager.h>
  31.  
  32. #ifdef __cplusplus                                /* start C++            */
  33. extern "C" {
  34. #endif
  35.  
  36. /*----------------------------------------------------------------------*/
  37. /*                                                                        */
  38. /* Tool box callback structures                                            */
  39. /*                                                                        */
  40. /*----------------------------------------------------------------------*/
  41. typedef struct
  42. {
  43.     int            reason;                    /* Reason why CB was invoked    */
  44.     XEvent *    event;                    /* Event that triggered CB        */
  45.     Widget        item;                    /* target Item                    */
  46.     Widget        closed_tab;                /* Corresponding closed tab        */
  47.     Widget        opened_tab;                /* Corresponding opened tab        */
  48.     int            index;                    /* Index of item                */
  49. } XfeToolBoxCallbackStruct;
  50.  
  51. typedef struct
  52. {
  53.     int            reason;                    /* Reason why CB was invoked    */
  54.     XEvent *    event;                    /* Event that triggered CB        */
  55.     Widget        descendant;                /* Descendant requesting drag    */
  56.     Widget        item;                    /* Item to be dragged            */
  57.     Widget        tab;                    /* Corresponding tab            */
  58.     int            index;                    /* Index of item                */
  59.     Boolean        allow;                    /* Allow the drag ?                */
  60. } XfeToolBoxDragAllowCallbackStruct;
  61.  
  62. typedef struct
  63. {
  64.     int            reason;                    /* Reason why CB was invoked    */
  65.     XEvent *    event;                    /* Event that triggered CB        */
  66.     Widget        swapped;                /* Item swapped into position    */
  67.     Widget        displaced;                /* Displaced item                */
  68.     int            from_index;                /* Index of displaced item        */
  69.     int            to_index;                /* New index of swapped item    */
  70. } XfeToolBoxSwapCallbackStruct;
  71.  
  72. /*----------------------------------------------------------------------*/
  73. /*                                                                        */
  74. /* XfeBox class names                                                    */
  75. /*                                                                        */
  76. /*----------------------------------------------------------------------*/
  77. externalref WidgetClass xfeToolBoxWidgetClass;
  78.  
  79. typedef struct _XfeToolBoxClassRec *        XfeToolBoxWidgetClass;
  80. typedef struct _XfeToolBoxRec *                XfeToolBoxWidget;
  81.  
  82. /*----------------------------------------------------------------------*/
  83. /*                                                                        */
  84. /* XfeBox subclass test macro                                            */
  85. /*                                                                        */
  86. /*----------------------------------------------------------------------*/
  87. #define XfeIsToolBox(w)    XtIsSubclass(w,xfeToolBoxWidgetClass)
  88.  
  89. /*----------------------------------------------------------------------*/
  90. /*                                                                        */
  91. /* XfeToolBox Public Methods                                            */
  92. /*                                                                        */
  93. /*----------------------------------------------------------------------*/
  94. extern Widget
  95. XfeCreateToolBox                (Widget            parent,
  96.                                  String            name,
  97.                                  Arg *            args,
  98.                                  Cardinal        num_args);
  99. /*----------------------------------------------------------------------*/
  100.  
  101. /*----------------------------------------------------------------------*/
  102. /*                                                                        */
  103. /* XfeToolBox drag descendant                                            */
  104. /*                                                                        */
  105. /*----------------------------------------------------------------------*/
  106. extern void
  107. XfeToolBoxAddDragDescendant        (Widget            w,
  108.                                  Widget            descendant);
  109. /*----------------------------------------------------------------------*/
  110. extern void
  111. XfeToolBoxRemoveDragDescendant    (Widget            w,
  112.                                  Widget            descendant);
  113. /*----------------------------------------------------------------------*/
  114.  
  115. /*----------------------------------------------------------------------*/
  116. /*                                                                        */
  117. /* XfeToolBox index methods                                                */
  118. /*                                                                        */
  119. /*----------------------------------------------------------------------*/
  120. extern int
  121. XfeToolBoxItemGetIndex            (Widget            w,
  122.                                  Widget            item);
  123. /*----------------------------------------------------------------------*/
  124. #if 0
  125. extern int
  126. XfeToolBoxTabGetIndex            (Widget            w,
  127.                                  Widget            tab);
  128. /*----------------------------------------------------------------------*/
  129. #endif
  130. extern Widget
  131. XfeToolBoxItemGetByIndex        (Widget            w,
  132.                                  Cardinal        index);
  133. /*----------------------------------------------------------------------*/
  134. extern Widget
  135. XfeToolBoxItemGetTab            (Widget            w,
  136.                                  Widget            item,
  137.                                  Boolean        opened);
  138. /*----------------------------------------------------------------------*/
  139.  
  140. /*----------------------------------------------------------------------*/
  141. /*                                                                        */
  142. /* XfeToolBox position methods                                            */
  143. /*                                                                        */
  144. /*----------------------------------------------------------------------*/
  145. extern  void
  146. XfeToolBoxItemSetPosition        (Widget            w,
  147.                                  Widget            item,
  148.                                  int            position);
  149. /*----------------------------------------------------------------------*/
  150. extern int
  151. XfeToolBoxItemGetPosition        (Widget            w,
  152.                                  Widget            item);
  153. /*----------------------------------------------------------------------*/
  154.  
  155. /*----------------------------------------------------------------------*/
  156. /*                                                                        */
  157. /* XfeToolBox open methods                                                */
  158. /*                                                                        */
  159. /*----------------------------------------------------------------------*/
  160. extern  void
  161. XfeToolBoxItemSetOpen            (Widget            w,
  162.                                  Widget            item,
  163.                                  Boolean        open);
  164. /*----------------------------------------------------------------------*/
  165. extern Boolean
  166. XfeToolBoxItemGetOpen            (Widget            w,
  167.                                  Widget            item);
  168. /*----------------------------------------------------------------------*/
  169. extern  void
  170. XfeToolBoxItemToggleOpen        (Widget            w,
  171.                                  Widget            item);
  172. /*----------------------------------------------------------------------*/
  173.  
  174. /*----------------------------------------------------------------------*/
  175. /*                                                                        */
  176. /* XfeToolBoxIsNeeded()                                                    */
  177. /*                                                                        */
  178. /*----------------------------------------------------------------------*/
  179. extern Boolean 
  180. XfeToolBoxIsNeeded                (Widget            w);
  181. /*----------------------------------------------------------------------*/
  182.  
  183. /*----------------------------------------------------------------------*/
  184. /*                                                                        */
  185. /* Hackery crap which should go sway real soon                            */
  186. /*                                                                        */
  187. /*----------------------------------------------------------------------*/
  188. extern void
  189. XfeToolBoxAddLayoutSupport        (Widget            form,
  190.                                  Widget            tool_box);
  191. /*----------------------------------------------------------------------*/
  192. extern void
  193. XfeToolBoxFormDoLayout            (Widget            form);
  194. /*----------------------------------------------------------------------*/
  195.  
  196. #ifdef __cplusplus                                /* end C++                */
  197. }
  198. #endif
  199.  
  200. #endif                                            /* end ToolBox.h        */
  201.