Back to index

lightning-sunbird  0.9+nobinonly
gtkxtbin.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  * Intel Corporation.
00021  * Portions created by the Initial Developer are Copyright (C) 2000
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/gtkwidget.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 
00075 struct _GtkXtBin
00076 {
00077   GtkWidget      widget;
00078   GdkWindow     *parent_window;
00079   Display       *xtdisplay;        /* Xt Toolkit Display */
00080 
00081   Widget         xtwidget;         /* Xt Toolkit Widget */
00082 
00083   Window         xtwindow;         /* Xt Toolkit XWindow */
00084   gint           x, y;
00085   gint           width, height;
00086 };
00087   
00088 struct _GtkXtBinClass
00089 {
00090   GtkWidgetClass widget_class;
00091 };
00092 
00093 GTKXTBIN_API(GtkType)    gtk_xtbin_get_type (void);
00094 GTKXTBIN_API(GtkWidget *) gtk_xtbin_new (GdkWindow *parent_window, String *f);
00095 GTKXTBIN_API(void)       gtk_xtbin_set_position (GtkXtBin *xtbin,
00096                                                  gint       x,
00097                                                  gint       y);
00098 GTKXTBIN_API(void)       gtk_xtbin_resize (GtkWidget *widget,
00099                                            gint       width,
00100                                            gint       height);
00101 
00102 typedef struct _XtTMRec {
00103     XtTranslations  translations;       /* private to Translation Manager    */
00104     XtBoundActions  proc_table;         /* procedure bindings for actions    */
00105     struct _XtStateRec *current_state;  /* Translation Manager state ptr     */
00106     unsigned long   lastEventTime;
00107 } XtTMRec, *XtTM;   
00108 
00109 typedef struct _CorePart {
00110     Widget          self;               /* pointer to widget itself          */
00111     WidgetClass     widget_class;       /* pointer to Widget's ClassRec      */
00112     Widget          parent;             /* parent widget                     */
00113     XrmName         xrm_name;           /* widget resource name quarkified   */
00114     Boolean         being_destroyed;    /* marked for destroy                */
00115     XtCallbackList  destroy_callbacks;  /* who to call when widget destroyed */
00116     XtPointer       constraints;        /* constraint record                 */
00117     Position        x, y;               /* window position                   */
00118     Dimension       width, height;      /* window dimensions                 */
00119     Dimension       border_width;       /* window border width               */
00120     Boolean         managed;            /* is widget geometry managed?       */
00121     Boolean         sensitive;          /* is widget sensitive to user events*/
00122     Boolean         ancestor_sensitive; /* are all ancestors sensitive?      */
00123     XtEventTable    event_table;        /* private to event dispatcher       */
00124     XtTMRec         tm;                 /* translation management            */
00125     XtTranslations  accelerators;       /* accelerator translations          */
00126     Pixel           border_pixel;       /* window border pixel               */
00127     Pixmap          border_pixmap;      /* window border pixmap or NULL      */
00128     WidgetList      popup_list;         /* list of popups                    */
00129     Cardinal        num_popups;         /* how many popups                   */
00130     String          name;               /* widget resource name              */
00131     Screen          *screen;            /* window's screen                   */
00132     Colormap        colormap;           /* colormap                          */
00133     Window          window;             /* window ID                         */
00134     Cardinal        depth;              /* number of planes in window        */
00135     Pixel           background_pixel;   /* window background pixel           */
00136     Pixmap          background_pixmap;  /* window background pixmap or NULL  */
00137     Boolean         visible;            /* is window mapped and not occluded?*/
00138     Boolean         mapped_when_managed;/* map window if it's managed?       */
00139 } CorePart;
00140 
00141 typedef struct _WidgetRec {
00142     CorePart    core;
00143  } WidgetRec, CoreRec;   
00144 
00145 #ifdef __cplusplus
00146 }
00147 #endif /* __cplusplus */
00148 #endif /* __GTK_XTBIN_H__ */
00149