michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim: set expandtab shiftwidth=2 tabstop=2: */ michael@0: michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef __GTK_XTBIN_H__ michael@0: #define __GTK_XTBIN_H__ michael@0: michael@0: #include michael@0: #if (MOZ_WIDGET_GTK == 3) michael@0: #include michael@0: #endif michael@0: #include michael@0: #include michael@0: #include michael@0: #ifdef MOZILLA_CLIENT michael@0: #include "nscore.h" michael@0: #ifdef _IMPL_GTKXTBIN_API michael@0: #define GTKXTBIN_API(type) NS_EXPORT_(type) michael@0: #else michael@0: #define GTKXTBIN_API(type) NS_IMPORT_(type) michael@0: #endif michael@0: #else michael@0: #define GTKXTBIN_API(type) type michael@0: #endif michael@0: michael@0: #ifdef __cplusplus michael@0: extern "C" { michael@0: #endif /* __cplusplus */ michael@0: michael@0: typedef struct _GtkXtBin GtkXtBin; michael@0: typedef struct _GtkXtBinClass GtkXtBinClass; michael@0: michael@0: #define GTK_TYPE_XTBIN (gtk_xtbin_get_type ()) michael@0: #define GTK_XTBIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ michael@0: GTK_TYPE_XTBIN, GtkXtBin)) michael@0: #define GTK_XTBIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \ michael@0: GTK_TYPE_XTBIN, GtkXtBinClass)) michael@0: #define GTK_IS_XTBIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ michael@0: GTK_TYPE_XTBIN)) michael@0: #define GTK_IS_XTBIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ michael@0: GTK_TYPE_XTBIN)) michael@0: typedef struct _XtClient XtClient; michael@0: michael@0: struct _XtClient { michael@0: Display *xtdisplay; michael@0: Widget top_widget; /* The toplevel widget */ michael@0: Widget child_widget; /* The embedded widget */ michael@0: Visual *xtvisual; michael@0: int xtdepth; michael@0: Colormap xtcolormap; michael@0: Window oldwindow; michael@0: }; michael@0: michael@0: struct _GtkXtBin michael@0: { michael@0: GtkSocket gsocket; michael@0: GdkWindow *parent_window; michael@0: Display *xtdisplay; /* Xt Toolkit Display */ michael@0: michael@0: Window xtwindow; /* Xt Toolkit XWindow */ michael@0: XtClient xtclient; /* Xt Client for XEmbed */ michael@0: }; michael@0: michael@0: struct _GtkXtBinClass michael@0: { michael@0: GtkSocketClass parent_class; michael@0: }; michael@0: michael@0: GTKXTBIN_API(GType) gtk_xtbin_get_type (void); michael@0: GTKXTBIN_API(GtkWidget *) gtk_xtbin_new (GdkWindow *parent_window, String *f); michael@0: michael@0: typedef struct _XtTMRec { michael@0: XtTranslations translations; /* private to Translation Manager */ michael@0: XtBoundActions proc_table; /* procedure bindings for actions */ michael@0: struct _XtStateRec *current_state; /* Translation Manager state ptr */ michael@0: unsigned long lastEventTime; michael@0: } XtTMRec, *XtTM; michael@0: michael@0: typedef struct _CorePart { michael@0: Widget self; /* pointer to widget itself */ michael@0: WidgetClass widget_class; /* pointer to Widget's ClassRec */ michael@0: Widget parent; /* parent widget */ michael@0: XrmName xrm_name; /* widget resource name quarkified */ michael@0: Boolean being_destroyed; /* marked for destroy */ michael@0: XtCallbackList destroy_callbacks; /* who to call when widget destroyed */ michael@0: XtPointer constraints; /* constraint record */ michael@0: Position x, y; /* window position */ michael@0: Dimension width, height; /* window dimensions */ michael@0: Dimension border_width; /* window border width */ michael@0: Boolean managed; /* is widget geometry managed? */ michael@0: Boolean sensitive; /* is widget sensitive to user events*/ michael@0: Boolean ancestor_sensitive; /* are all ancestors sensitive? */ michael@0: XtEventTable event_table; /* private to event dispatcher */ michael@0: XtTMRec tm; /* translation management */ michael@0: XtTranslations accelerators; /* accelerator translations */ michael@0: Pixel border_pixel; /* window border pixel */ michael@0: Pixmap border_pixmap; /* window border pixmap or NULL */ michael@0: WidgetList popup_list; /* list of popups */ michael@0: Cardinal num_popups; /* how many popups */ michael@0: String name; /* widget resource name */ michael@0: Screen *screen; /* window's screen */ michael@0: Colormap colormap; /* colormap */ michael@0: Window window; /* window ID */ michael@0: Cardinal depth; /* number of planes in window */ michael@0: Pixel background_pixel; /* window background pixel */ michael@0: Pixmap background_pixmap; /* window background pixmap or NULL */ michael@0: Boolean visible; /* is window mapped and not occluded?*/ michael@0: Boolean mapped_when_managed;/* map window if it's managed? */ michael@0: } CorePart; michael@0: michael@0: typedef struct _WidgetRec { michael@0: CorePart core; michael@0: } WidgetRec, CoreRec; michael@0: michael@0: /* Exported functions, used by Xt plugins */ michael@0: void xt_client_create(XtClient * xtclient, Window embeder, int height, int width); michael@0: void xt_client_unrealize(XtClient* xtclient); michael@0: void xt_client_destroy(XtClient* xtclient); michael@0: void xt_client_init(XtClient * xtclient, Visual *xtvisual, Colormap xtcolormap, int xtdepth); michael@0: void xt_client_xloop_create(void); michael@0: void xt_client_xloop_destroy(void); michael@0: Display * xt_client_get_display(void); michael@0: michael@0: #ifdef __cplusplus michael@0: } michael@0: #endif /* __cplusplus */ michael@0: #endif /* __GTK_XTBIN_H__ */ michael@0: