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