#define CHAMPLAIN_API __attribute__((visibility("default")))
#define CHAMPLAIN_OBSOLETE_API CHAMPLAIN_API __attribute__((deprecated))
+typedef struct _ChamplainWidget ChamplainWidget;
+typedef struct _ChamplainWidgetClass ChamplainWidgetClass;
+
#endif
static guint champlain_widget_signals[LAST_SIGNAL] = { 0, };
+#define WEBKIT_WEB_FRAME_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_FRAME, WebKitWebFramePrivate))
+
+struct _ChamplainWidgetPrivate {
+ gboolean temp;
+};
+
G_DEFINE_TYPE(ChamplainWidget, champlain_widget, GTK_TYPE_CONTAINER)
static void
champlain_widget_class_init(ChamplainWidgetClass* champlainWidgetClass)
{
+/*
+ GtkWidgetClass* widgetClass = GTK_WIDGET_CLASS(champlainWidget);
+ widgetClass->realize = champlain_widget_realize;
+ widgetClass->expose_event = champlain_widget_expose_event;
+ widgetClass->key_press_event = champlain_widget_key_press_event;
+ widgetClass->key_release_event = champlain_widget_key_release_event;
+ widgetClass->button_press_event = champlain_widget_button_press_event;
+ widgetClass->button_release_event = champlain_widget_button_release_event;
+ widgetClass->motion_notify_event = champlain_widget_motion_event;
+ widgetClass->scroll_event = champlain_widget_scroll_event;
+ widgetClass->size_allocate = champlain_widget_size_allocate;
+ widgetClass->popup_menu = champlain_widget_popup_menu_handler;
+ widgetClass->focus_in_event = champlain_widget_focus_in_event;
+ widgetClass->focus_out_event = champlain_widget_focus_out_event;
+ widgetClass->get_accessible = champlain_widget_get_accessible;
+
+ GtkContainerClass* containerClass = GTK_CONTAINER_CLASS(champlainWidget);
+ containerClass->add = champlain_widget_container_add;
+ containerClass->remove = champlain_widget_container_remove;
+ containerClass->forall = champlain_widget_container_forall;
+*/
+ g_type_class_add_private(champlainWidgetClass, sizeof(ChamplainWidgetPrivate));
+
}
static void champlain_widget_init(ChamplainWidget* champlainWidget)
{
+}
+
+GtkWidget* champlain_widget_new()
+{
+ ChamplainWidget* widget = CHAMPLAIN_WIDGET(g_object_new(CHAMPLAIN_TYPE_WIDGET, NULL));
+ return GTK_WIDGET(widget);
}
G_BEGIN_DECLS
#define CHAMPLAIN_TYPE_WIDGET (champlain_widget_get_type())
-#define CHAMPLAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), CHAMPLAIN_TYPE_WIDGET, ChamplainWidget))
+#define CHAMPLAIN_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), CHAMPLAIN_TYPE_WIDGET, ChamplainWidget))
#define CHAMPLAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), CHAMPLAIN_TYPE_WIDGET, ChamplainWidgetClass))
#define CHAMPLAIN_IS_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), CHAMPLAIN_TYPE_WIDGET))
#define CHAMPLAIN_IS_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), CHAMPLAIN_TYPE_WIDGET))
#define CHAMPLAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), CHAMPLAIN_TYPE_WIDGET, ChamplainWidgetClass))
typedef struct _ChamplainWidgetPrivate ChamplainWidgetPrivate;
-typedef struct _ChamplainWidget ChamplainWidget;
-typedef struct _ChamplainWidgetClass ChamplainWidgetClass;
struct _ChamplainWidget {
GtkContainer parent_instance;
CHAMPLAIN_API GType
champlain_widget_get_type (void);
-CHAMPLAIN_API ChamplainWidget *
+CHAMPLAIN_API GtkWidget *
champlain_widget_new (void);
#endif
* Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include <config.h>
-int main(int argc, char* argv[])
+#include <gtk/gtk.h>
+
+#include <champlain.h>
+
+/*
+ * Terminate the main loop.
+ */
+static void
+on_destroy (GtkWidget * widget, gpointer data)
{
- printf("Hello, world!\n");
+ gtk_main_quit ();
+}
+
+int
+main (int argc, char *argv[])
+{
+ GtkWidget *window;
+ GtkWidget *widget;
+
+ gtk_init (&argc, &argv);
+
+ /* create the main, top level, window */
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+ /* give the window a 20px wide border */
+ gtk_container_set_border_width (GTK_CONTAINER (window), 10);
+
+ /* give it the title */
+ gtk_window_set_title (GTK_WINDOW (window), PACKAGE " " VERSION);
+
+ /* open it a bit wider so that both the label and title show up */
+ gtk_window_set_default_size (GTK_WINDOW (window), 200, 50);
+
+
+ /* Connect the destroy event of the window with our on_destroy function
+ * When the window is about to be destroyed we get a notificaiton and
+ * stop the main GTK loop
+ */
+ g_signal_connect (G_OBJECT (window), "destroy",
+ G_CALLBACK (on_destroy), NULL);
+
+ /* Create the "Hello, World" label */
+ widget = champlain_widget_new ();
+
+ /* and insert it into the main window */
+ gtk_container_add (GTK_CONTAINER (window), widget);
+
+ /* make sure that everything, window and label, are visible */
+ gtk_widget_show_all (window);
+
+ /* start the main loop */
+ gtk_main ();
- return 0;
+ return 0;
}