Back to index

lightning-sunbird  0.9+nobinonly
xlibxtbin.h
Go to the documentation of this file.
00001 /* widget -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002  * vim:ts=2:et:sw=2 */
00003 
00004 /* ***** BEGIN LICENSE BLOCK *****
00005  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00006  *
00007  * The contents of this file are subject to the Mozilla Public License Version
00008  * 1.1 (the "License"); you may not use this file except in compliance with
00009  * the License. You may obtain a copy of the License at
00010  * http://www.mozilla.org/MPL/
00011  *
00012  * Software distributed under the License is distributed on an "AS IS" basis,
00013  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00014  * for the specific language governing rights and limitations under the
00015  * License.
00016  *
00017  * The Original Code is mozilla.org code.
00018  *
00019  * The Initial Developer of the Original Code is 
00020  * Peter Hartshorn.
00021  * Portions created by the Initial Developer are Copyright (C) 2000
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *   Based on GtkXtBin by Rusty Lynch - 02/27/2000
00026  *
00027  * Alternatively, the contents of this file may be used under the terms of
00028  * either the GNU General Public License Version 2 or later (the "GPL"), or
00029  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00030  * in which case the provisions of the GPL or the LGPL are applicable instead
00031  * of those above. If you wish to allow use of your version of this file only
00032  * under the terms of either the GPL or the LGPL, and not to allow others to
00033  * use your version of this file under the terms of the MPL, indicate your
00034  * decision by deleting the provisions above and replace them with the notice
00035  * and other provisions required by the GPL or the LGPL. If you do not delete
00036  * the provisions above, a recipient may use your version of this file under
00037  * the terms of any one of the MPL, the GPL or the LGPL.
00038  *
00039  * ***** END LICENSE BLOCK ***** */
00040 
00041 #ifndef __XLIB_XTBIN_H__
00042 #define __XLIB_XTBIN_H__
00043 
00044 #include "xlibrgb.h"
00045 
00046 #include <X11/Intrinsic.h>
00047 #include <X11/Xutil.h>
00048 #include <X11/Xlib.h>
00049 #include <X11/X.h>
00050 
00051 #ifdef __cplusplus
00052 extern "C" {
00053 #endif /* __cplusplus */
00054 
00055 typedef struct _XtTMRec {
00056     XtTranslations  translations;       /* private to Translation Manager    */
00057     XtBoundActions  proc_table;         /* procedure bindings for actions    */
00058     struct _XtStateRec *current_state;  /* Translation Manager state ptr     */
00059     unsigned long   lastEventTime;
00060 } XtTMRec, *XtTM;   
00061 
00062 typedef struct _CorePart {
00063     Widget          self;               /* pointer to widget itself          */
00064     WidgetClass     widget_class;       /* pointer to Widget's ClassRec      */
00065     Widget          parent;             /* parent widget                     */
00066     XrmName         xrm_name;           /* widget resource name quarkified   */
00067     Boolean         being_destroyed;    /* marked for destroy                */
00068     XtCallbackList  destroy_callbacks;  /* who to call when widget destroyed */
00069     XtPointer       constraints;        /* constraint record                 */
00070     Position        x, y;               /* window position                   */
00071     Dimension       width, height;      /* window dimensions                 */
00072     Dimension       border_width;       /* window border width               */
00073     Boolean         managed;            /* is widget geometry managed?       */
00074     Boolean         sensitive;          /* is widget sensitive to user events*/
00075     Boolean         ancestor_sensitive; /* are all ancestors sensitive?      */
00076     XtEventTable    event_table;        /* private to event dispatcher       */
00077     XtTMRec         tm;                 /* translation management            */
00078     XtTranslations  accelerators;       /* accelerator translations          */
00079     Pixel           border_pixel;       /* window border pixel               */
00080     Pixmap          border_pixmap;      /* window border pixmap or NULL      */
00081     WidgetList      popup_list;         /* list of popups                    */
00082     Cardinal        num_popups;         /* how many popups                   */
00083     String          name;               /* widget resource name              */
00084     Screen          *screen;            /* window's screen                   */
00085     Colormap        colormap;           /* colormap                          */
00086     Window          window;             /* window ID                         */
00087     Cardinal        depth;              /* number of planes in window        */
00088     Pixel           background_pixel;   /* window background pixel           */
00089     Pixmap          background_pixmap;  /* window background pixmap or NULL  */
00090     Boolean         visible;            /* is window mapped and not occluded?*/
00091     Boolean         mapped_when_managed;/* map window if it's managed?       */
00092 } CorePart;
00093 
00094 typedef struct _WidgetRec {
00095     CorePart    core;
00096  } WidgetRec, CoreRec;   
00097 #ifdef __cplusplus
00098 }
00099 #endif /* __cplusplus */
00100 
00101 class xtbin {
00102 public:
00103   xtbin();
00104   ~xtbin();
00105 
00106   void xtbin_init();
00107   void xtbin_realize();
00108   void xtbin_new(Window aParent);
00109   void xtbin_destroy();
00110   void xtbin_resize(int aX, int aY, int aWidth, int aHeight);
00111   Window xtbin_xtwindow() { return xtwindow; }
00112   int xtbin_initialized();
00113   void sync();
00114   
00115 private: 
00116   int initialized;
00117   XlibRgbHandle *mXlibRgbHandle;
00118   Display *xtdisplay;
00119   Window xtwindow;
00120   XtAppContext app_context;
00121   Window parent_window;
00122   Widget xtwidget;
00123   Window window;
00124   Window oldwindow;
00125   int x, y, width, height;
00126 };
00127 
00128 
00129 #endif /* __XLIB_XTBIN_H__ */
00130