Back to index

lightning-sunbird  0.9+nobinonly
gtk2xtbin.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002  * vim:expandtab:shiftwidth=2:tabstop=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 the Gtk2XtBin Widget Implementation.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Sun Microsystems, Inc.
00021  * Portions created by the Initial Developer are Copyright (C) 2002
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */   
00039 
00040 #ifndef __GTK_XTBIN_H__
00041 #define __GTK_XTBIN_H__
00042 
00043 #include <gtk/gtksocket.h>
00044 #include <X11/Intrinsic.h>
00045 #include <X11/Xutil.h>
00046 #include <X11/Xlib.h>
00047 #ifdef MOZILLA_CLIENT
00048 #include "nscore.h"
00049 #ifdef _IMPL_GTKXTBIN_API
00050 #define GTKXTBIN_API(type) NS_EXPORT_(type)
00051 #else
00052 #define GTKXTBIN_API(type) NS_IMPORT_(type)
00053 #endif
00054 #else
00055 #define GTKXTBIN_API(type) type
00056 #endif
00057 
00058 #ifdef __cplusplus
00059 extern "C" {
00060 #endif /* __cplusplus */
00061 
00062 typedef struct _GtkXtBin GtkXtBin;
00063 typedef struct _GtkXtBinClass GtkXtBinClass;
00064 
00065 #define GTK_TYPE_XTBIN                  (gtk_xtbin_get_type ())
00066 #define GTK_XTBIN(obj)                  (GTK_CHECK_CAST ((obj), \
00067                                          GTK_TYPE_XTBIN, GtkXtBin))
00068 #define GTK_XTBIN_CLASS(klass)          (GTK_CHECK_CLASS_CAST ((klass), \
00069                                          GTK_TYPE_XTBIN, GtkXtBinClass))
00070 #define GTK_IS_XTBIN(obj)               (GTK_CHECK_TYPE ((obj), \
00071                                          GTK_TYPE_XTBIN))
00072 #define GTK_IS_XTBIN_CLASS(klass)       (GTK_CHECK_CLASS_TYPE ((klass), \
00073                                          GTK_TYPE_XTBIN))
00074 typedef struct _XtClient XtClient;
00075 
00076 struct _XtClient {
00077   Display     *xtdisplay;
00078   Widget      top_widget;    /* The toplevel widget */
00079   Widget      child_widget;  /* The embedded widget */
00080   Visual      *xtvisual;
00081   int         xtdepth;
00082   Colormap    xtcolormap;
00083   Window      oldwindow;
00084 };
00085 
00086 struct _GtkXtBin
00087 {
00088   GtkSocket      gsocket;
00089   GdkWindow     *parent_window;
00090   Display       *xtdisplay;        /* Xt Toolkit Display */
00091 
00092   Window         xtwindow;         /* Xt Toolkit XWindow */
00093   gint           x, y;
00094   gint           width, height;
00095   XtClient     xtclient;         /* Xt Client for XEmbed */
00096 };
00097   
00098 struct _GtkXtBinClass
00099 {
00100   GtkSocketClass widget_class;
00101 };
00102 
00103 GTKXTBIN_API(GtkType)     gtk_xtbin_get_type (void);
00104 GTKXTBIN_API(GtkWidget *) gtk_xtbin_new (GdkWindow *parent_window, String *f);
00105 GTKXTBIN_API(void)        gtk_xtbin_set_position (GtkXtBin *xtbin,
00106                                                   gint       x,
00107                                                   gint       y);
00108 GTKXTBIN_API(void)       gtk_xtbin_resize (GtkWidget *widget,
00109                                            gint       width,
00110                                            gint       height);
00111 
00112 typedef struct _XtTMRec {
00113     XtTranslations  translations;       /* private to Translation Manager    */
00114     XtBoundActions  proc_table;         /* procedure bindings for actions    */
00115     struct _XtStateRec *current_state;  /* Translation Manager state ptr     */
00116     unsigned long   lastEventTime;
00117 } XtTMRec, *XtTM;   
00118 
00119 typedef struct _CorePart {
00120     Widget          self;               /* pointer to widget itself          */
00121     WidgetClass     widget_class;       /* pointer to Widget's ClassRec      */
00122     Widget          parent;             /* parent widget                     */
00123     XrmName         xrm_name;           /* widget resource name quarkified   */
00124     Boolean         being_destroyed;    /* marked for destroy                */
00125     XtCallbackList  destroy_callbacks;  /* who to call when widget destroyed */
00126     XtPointer       constraints;        /* constraint record                 */
00127     Position        x, y;               /* window position                   */
00128     Dimension       width, height;      /* window dimensions                 */
00129     Dimension       border_width;       /* window border width               */
00130     Boolean         managed;            /* is widget geometry managed?       */
00131     Boolean         sensitive;          /* is widget sensitive to user events*/
00132     Boolean         ancestor_sensitive; /* are all ancestors sensitive?      */
00133     XtEventTable    event_table;        /* private to event dispatcher       */
00134     XtTMRec         tm;                 /* translation management            */
00135     XtTranslations  accelerators;       /* accelerator translations          */
00136     Pixel           border_pixel;       /* window border pixel               */
00137     Pixmap          border_pixmap;      /* window border pixmap or NULL      */
00138     WidgetList      popup_list;         /* list of popups                    */
00139     Cardinal        num_popups;         /* how many popups                   */
00140     String          name;               /* widget resource name              */
00141     Screen          *screen;            /* window's screen                   */
00142     Colormap        colormap;           /* colormap                          */
00143     Window          window;             /* window ID                         */
00144     Cardinal        depth;              /* number of planes in window        */
00145     Pixel           background_pixel;   /* window background pixel           */
00146     Pixmap          background_pixmap;  /* window background pixmap or NULL  */
00147     Boolean         visible;            /* is window mapped and not occluded?*/
00148     Boolean         mapped_when_managed;/* map window if it's managed?       */
00149 } CorePart;
00150 
00151 typedef struct _WidgetRec {
00152     CorePart    core;
00153  } WidgetRec, CoreRec;   
00154 
00155 #ifdef __cplusplus
00156 }
00157 #endif /* __cplusplus */
00158 #endif /* __GTK_XTBIN_H__ */
00159