]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/gtk/win_gtk.h
added WX_ASSERT_MESSAGE macro to simply using CPPUNIT_ASSERT_MESSAGE with wxString...
[wxWidgets.git] / include / wx / gtk / win_gtk.h
index 4f79acfb7f0f04c565d346b5f6a9f0db0a84c527..f98a775a3df2786371c097da7d201b15e924d0ac 100644 (file)
 /* ///////////////////////////////////////////////////////////////////////////
 // Name:        win_gtk.h
-// Purpose:     wxWidgets's GTK base widget = GtkPizza
+// Purpose:     native GTK+ widget for wxWindow
 // Author:      Robert Roebling
 // Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////// */
 
+#ifndef _WX_GTK_PIZZA_H_
+#define _WX_GTK_PIZZA_H_
 
-#ifndef __GTK_PIZZA_H__
-#define __GTK_PIZZA_H__
+#include <gtk/gtkfixed.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+#define WX_PIZZA(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, wxPizza::type(), wxPizza)
+#define WX_IS_PIZZA(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, wxPizza::type())
 
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtkcontainer.h>
-#include <gtk/gtkadjustment.h>
-#ifndef __WXGTK20__
-#include <gtk/gtkfeatures.h>
-#endif
-
-#define GTK_PIZZA(obj)          GTK_CHECK_CAST (obj, gtk_pizza_get_type (), GtkPizza)
-#define GTK_PIZZA_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_pizza_get_type (), GtkPizzaClass)
-#define GTK_IS_PIZZA(obj)       GTK_CHECK_TYPE (obj, gtk_pizza_get_type ())
-
-/* Shadow types */
-typedef enum
-{
-    GTK_MYSHADOW_NONE,
-    GTK_MYSHADOW_THIN,
-    GTK_MYSHADOW_IN,
-    GTK_MYSHADOW_OUT
-} GtkMyShadowType;
-
-typedef struct _GtkPizzaChild    GtkPizzaChild;
-typedef struct _GtkPizza        GtkPizza;
-typedef struct _GtkPizzaClass   GtkPizzaClass;
-
-struct _GtkPizzaChild
+struct WXDLLIMPEXP_CORE wxPizza
 {
-    GtkWidget *widget;
-    gint x;
-    gint y;
-    gint width;
-    gint height;
+    // borders styles which can be used with wxPizza
+    enum { BORDER_STYLES =
+        wxBORDER_SIMPLE | wxBORDER_RAISED | wxBORDER_SUNKEN | wxBORDER_THEME };
+
+    static GtkWidget* New(long windowStyle = 0);
+    static GType type();
+    void move(GtkWidget* widget, int x, int y);
+    void scroll(int dx, int dy);
+    void get_border_widths(int& x, int& y);
+
+    GtkFixed m_fixed;
+    GdkWindow* m_backing_window;
+    int m_scroll_x;
+    int m_scroll_y;
+    int m_border_style;
+    bool m_is_scrollable;
 };
 
-struct _GtkPizza
-{
-    GtkContainer container;
-    GList *children;
-    GtkMyShadowType shadow_type;
-
-    guint width;
-    guint height;
-
-    guint xoffset;
-    guint yoffset;
-
-    GdkWindow *bin_window;
-
-    GdkVisibilityState visibility;
-    gulong configure_serial;
-    gint scroll_x;
-    gint scroll_y;
-
-    gboolean clear_on_draw;
-    gboolean use_filter;
-    gboolean external_expose;
-};
-
-struct _GtkPizzaClass
-{
-  GtkContainerClass parent_class;
-
-  void  (*set_scroll_adjustments)   (GtkPizza     *pizza,
-                                     GtkAdjustment  *hadjustment,
-                                     GtkAdjustment  *vadjustment);
-};
-
-GtkType    gtk_pizza_get_type        (void);
-GtkWidget* gtk_pizza_new             (void);
-
-void       gtk_pizza_set_shadow_type (GtkPizza          *pizza,
-                                      GtkMyShadowType    type);
-
-void       gtk_pizza_set_clear       (GtkPizza          *pizza,
-                                      gboolean           clear);
-
-void       gtk_pizza_set_filter      (GtkPizza          *pizza,
-                                      gboolean           use);
-
-void       gtk_pizza_set_external    (GtkPizza          *pizza,
-                                      gboolean           expose);
-
-void       gtk_pizza_scroll          (GtkPizza          *pizza,
-                                      gint               dx,
-                                      gint               dy);
-
-gint       gtk_pizza_child_resized   (GtkPizza          *pizza,
-                                      GtkWidget         *widget);
-
-void       gtk_pizza_put             (GtkPizza          *pizza,
-                                      GtkWidget         *widget,
-                                      gint               x,
-                                      gint               y,
-                                      gint               width,
-                                      gint               height);
-
-void       gtk_pizza_move            (GtkPizza          *pizza,
-                                      GtkWidget         *widget,
-                                      gint               x,
-                                      gint               y );
-
-void       gtk_pizza_resize          (GtkPizza          *pizza,
-                                      GtkWidget         *widget,
-                                      gint               width,
-                                      gint               height );
-
-void       gtk_pizza_set_size        (GtkPizza          *pizza,
-                                      GtkWidget         *widget,
-                                      gint               x,
-                                      gint               y,
-                                      gint               width,
-                                      gint               height);
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-
-#endif /* __GTK_PIZZA_H__ */
+#endif // _WX_GTK_PIZZA_H_