1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set expandtab shiftwidth=2 tabstop=2: */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef __GTK_XTBIN_H__
9 #define __GTK_XTBIN_H__
12 #include <X11/Intrinsic.h>
13 #include <X11/Xutil.h>
17 #ifdef _IMPL_GTKXTBIN_API
18 #define GTKXTBIN_API(type) NS_EXPORT_(type)
20 #define GTKXTBIN_API(type) NS_IMPORT_(type)
23 #define GTKXTBIN_API(type) type
28 #endif /* __cplusplus */
30 typedef struct _XtClient XtClient
;
34 Widget top_widget
; /* The toplevel widget */
35 Widget child_widget
; /* The embedded widget */
42 #if (GTK_MAJOR_VERSION == 2)
43 typedef struct _GtkXtBin GtkXtBin
;
44 typedef struct _GtkXtBinClass GtkXtBinClass
;
46 #define GTK_TYPE_XTBIN (gtk_xtbin_get_type ())
47 #define GTK_XTBIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
48 GTK_TYPE_XTBIN, GtkXtBin))
49 #define GTK_XTBIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
50 GTK_TYPE_XTBIN, GtkXtBinClass))
51 #define GTK_IS_XTBIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
53 #define GTK_IS_XTBIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
59 GdkWindow
*parent_window
;
60 Display
*xtdisplay
; /* Xt Toolkit Display */
62 Window xtwindow
; /* Xt Toolkit XWindow */
63 XtClient xtclient
; /* Xt Client for XEmbed */
68 GtkSocketClass parent_class
;
71 GTKXTBIN_API(GType
) gtk_xtbin_get_type (void);
72 GTKXTBIN_API(GtkWidget
*) gtk_xtbin_new (GdkWindow
*parent_window
, String
*f
);
75 typedef struct _XtTMRec
{
76 XtTranslations translations
; /* private to Translation Manager */
77 XtBoundActions proc_table
; /* procedure bindings for actions */
78 struct _XtStateRec
*current_state
; /* Translation Manager state ptr */
79 unsigned long lastEventTime
;
82 typedef struct _CorePart
{
83 Widget self
; /* pointer to widget itself */
84 WidgetClass widget_class
; /* pointer to Widget's ClassRec */
85 Widget parent
; /* parent widget */
86 XrmName xrm_name
; /* widget resource name quarkified */
87 Boolean being_destroyed
; /* marked for destroy */
88 XtCallbackList destroy_callbacks
; /* who to call when widget destroyed */
89 XtPointer constraints
; /* constraint record */
90 Position x
, y
; /* window position */
91 Dimension width
, height
; /* window dimensions */
92 Dimension border_width
; /* window border width */
93 Boolean managed
; /* is widget geometry managed? */
94 Boolean sensitive
; /* is widget sensitive to user events*/
95 Boolean ancestor_sensitive
; /* are all ancestors sensitive? */
96 XtEventTable event_table
; /* private to event dispatcher */
97 XtTMRec tm
; /* translation management */
98 XtTranslations accelerators
; /* accelerator translations */
99 Pixel border_pixel
; /* window border pixel */
100 Pixmap border_pixmap
; /* window border pixmap or NULL */
101 WidgetList popup_list
; /* list of popups */
102 Cardinal num_popups
; /* how many popups */
103 String name
; /* widget resource name */
104 Screen
*screen
; /* window's screen */
105 Colormap colormap
; /* colormap */
106 Window window
; /* window ID */
107 Cardinal depth
; /* number of planes in window */
108 Pixel background_pixel
; /* window background pixel */
109 Pixmap background_pixmap
; /* window background pixmap or NULL */
110 Boolean visible
; /* is window mapped and not occluded?*/
111 Boolean mapped_when_managed
;/* map window if it's managed? */
114 typedef struct _WidgetRec
{
116 } WidgetRec
, CoreRec
;
118 /* Exported functions, used by Xt plugins */
119 void xt_client_create(XtClient
* xtclient
, Window embeder
, int height
, int width
);
120 void xt_client_unrealize(XtClient
* xtclient
);
121 void xt_client_destroy(XtClient
* xtclient
);
122 void xt_client_init(XtClient
* xtclient
, Visual
*xtvisual
, Colormap xtcolormap
, int xtdepth
);
123 void xt_client_xloop_create(void);
124 void xt_client_xloop_destroy(void);
125 Display
* xt_client_get_display(void);
129 #endif /* __cplusplus */
130 #endif /* __GTK_XTBIN_H__ */