Back to index

lightning-sunbird  0.9+nobinonly
gdksuperwin.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is mozilla.org Code.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Owen Taylor <otaylor@redhat.com> and Christopher Blizzard 
00020  * <blizzard@redhat.com>.
00021  * Portions created by the Initial Developer are Copyright (C) 1999
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 __GDK_SUPERWIN_H__
00041 #define __GDK_SUPERWIN_H__
00042 
00043 #include <gdk/gdk.h>
00044 #include <gdk/gdkx.h>
00045 #include <gtk/gtkobject.h>
00046 #ifdef MOZILLA_CLIENT
00047 #include "nscore.h"
00048 #ifdef _IMPL_GTKSUPERWIN_API
00049 #define GTKSUPERWIN_API(type) NS_EXPORT_(type)
00050 #else
00051 #define GTKSUPERWIN_API(type) NS_IMPORT_(type)
00052 #endif
00053 #else
00054 #define GTKSUPERWIN_API(type) type
00055 #endif
00056 
00057 #ifdef __cplusplus
00058 extern "C" {
00059 #endif /* __cplusplus */
00060 
00061 typedef struct _GdkSuperWin GdkSuperWin;
00062 typedef struct _GdkSuperWinClass GdkSuperWinClass;
00063 
00064 #define GDK_TYPE_SUPERWIN            (gdk_superwin_get_type())
00065 #define GDK_SUPERWIN(obj)            (GTK_CHECK_CAST((obj), GDK_TYPE_SUPERWIN, GdkSuperWin))
00066 #define GDK_SUPERWIN_CLASS(klass)    (GTK_CHECK_CLASS_CAST((klass), GDK_TYPE_SUPERWIN, GdkSuperWinClass))
00067 #define GDK_IS_SUPERWIN(obj)         (GTK_CHECK_TYPE((obj), GDK_TYPE_SUPERWIN))
00068 #define GDK_IS_SUPERWIN_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GDK_TYPE_SUPERWIN))
00069 
00070 typedef void (*GdkSuperWinFunc) (GdkSuperWin *super_win,
00071                                  XEvent      *event,
00072                                  gpointer     data);
00073 
00074 typedef void (*GdkSuperWinPaintFunc) (gint x, gint y,
00075                                       gint width, gint height,
00076                                       gpointer data);
00077 typedef void (*GdkSuperWinPaintFlushFunc) (gpointer data);
00078 
00079 typedef void (*GdkSuperWinKeyPressFunc) (XKeyEvent *event);
00080 typedef void (*GdkSuperWinKeyReleaseFunc) (XKeyEvent *event);
00081 
00082 struct _GdkSuperWin
00083 {
00084   GtkObject object;
00085   GdkWindow *shell_window;
00086   GdkWindow *bin_window;
00087 
00088   /* Private */
00089   GSList                    *translate_queue;
00090   GdkSuperWinFunc            shell_func;
00091   GdkSuperWinPaintFunc       paint_func;
00092   GdkSuperWinPaintFlushFunc  flush_func;
00093   GdkSuperWinKeyPressFunc    keyprs_func;
00094   GdkSuperWinKeyReleaseFunc  keyrel_func;
00095   gpointer                   func_data;
00096   GDestroyNotify             notify;
00097 
00098   GdkVisibilityState         visibility;
00099 };
00100 
00101 struct _GdkSuperWinClass
00102 {
00103   GtkObjectClass object_class;
00104 };
00105 
00106 GTKSUPERWIN_API(GtkType) gdk_superwin_get_type(void);
00107 
00108 GTKSUPERWIN_API(GdkSuperWin*) gdk_superwin_new (GdkWindow      *parent_window,
00109                                                 guint           x,
00110                                                 guint           y,
00111                                                 guint           width,
00112                                                 guint           height);
00113 
00114 GTKSUPERWIN_API(void)  gdk_superwin_reparent(GdkSuperWin *superwin,
00115                                              GdkWindow   *parent_window);
00116 
00117 GTKSUPERWIN_API(void)  
00118 gdk_superwin_set_event_funcs (GdkSuperWin               *superwin,
00119                               GdkSuperWinFunc            shell_func,
00120                               GdkSuperWinPaintFunc       paint_func,
00121                               GdkSuperWinPaintFlushFunc  flush_func,
00122                               GdkSuperWinKeyPressFunc    keyprs_func,
00123                               GdkSuperWinKeyReleaseFunc  keyrel_func,
00124                               gpointer                   func_data,
00125                               GDestroyNotify             notify);
00126 
00127 GTKSUPERWIN_API(void) gdk_superwin_scroll (GdkSuperWin *superwin,
00128                                            gint         dx,
00129                                            gint         dy);
00130 GTKSUPERWIN_API(void) gdk_superwin_resize (GdkSuperWin *superwin,
00131                                            gint         width,
00132                                            gint         height);
00133 
00134 #ifdef __cplusplus
00135 }
00136 #endif /* __cplusplus */
00137 
00138 #endif /* _GDK_SUPERWIN_H__ */
00139