gir-repository r141 - in trunk: . gir



Author: jobi
Date: Mon Oct 20 18:26:32 2008
New Revision: 141
URL: http://svn.gnome.org/viewvc/gir-repository?rev=141&view=rev

Log:
2008-10-20  Johan Bilien  <jobi via ecp fr>

	* git/Gtk-custom.[ch]: Add a few convenient additions to GTK



Added:
   trunk/gir/Gtk-custom.c
   trunk/gir/Gtk-custom.h
Modified:
   trunk/ChangeLog
   trunk/gir/Makefile.am

Added: trunk/gir/Gtk-custom.c
==============================================================================
--- (empty file)
+++ trunk/gir/Gtk-custom.c	Mon Oct 20 18:26:32 2008
@@ -0,0 +1,56 @@
+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
+/* Copyright 2008 litl, LLC. All Rights Reserved. */
+
+#include <config.h>
+
+#include "Gtk-custom.h"
+#include <gdk/gdkx.h>
+
+#include <string.h>
+
+guint32
+gtk_window_get_xid(GtkWindow *window)
+{
+    g_return_val_if_fail(GTK_WIDGET_REALIZED(window), 0);
+
+    return GDK_WINDOW_XID(GTK_WIDGET(window)->window);
+}
+
+GtkWidgetFlags
+gtk_widget_get_flags(GtkWidget *widget)
+{
+    g_return_val_if_fail(GTK_IS_WIDGET(widget), 0);
+    return GTK_WIDGET_FLAGS(widget);
+}
+
+GtkRequisition*
+gtk_requisition_new(void)
+{
+    GtkRequisition req = { 0, 0 };
+    /* using copy ensures we use the right allocator */
+    return gtk_requisition_copy(&req);
+}
+
+int
+gtk_requisition_get_width(const GtkRequisition *req)
+{
+    return req->width;
+}
+
+int
+gtk_requisition_get_height(const GtkRequisition *req)
+{
+    return req->height;
+}
+
+/**
+ * gtk_dialog_get_vbox:
+ * @dialog: A #GtkDialog
+ *
+ * Return value: (transfer none): the internal #GtkVBox
+ */
+GtkWidget *
+gtk_dialog_get_vbox(GtkDialog *dialog)
+{
+    return dialog->vbox;
+}

Added: trunk/gir/Gtk-custom.h
==============================================================================
--- (empty file)
+++ trunk/gir/Gtk-custom.h	Mon Oct 20 18:26:32 2008
@@ -0,0 +1,20 @@
+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
+/* Copyright 2008 litl, LLC. All Rights Reserved. */
+
+#ifndef __GI_REPO_GTK_CUSTOM_H__
+#define __GI_REPO_GTK_CUSTOM_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+guint32         gtk_window_get_xid                    (GtkWindow            *window);
+GtkWidgetFlags  gtk_widget_get_flags                  (GtkWidget            *widget);
+GtkRequisition* gtk_requisition_new                   (void);
+int             gtk_requisition_get_width             (const GtkRequisition *req);
+int             gtk_requisition_get_height            (const GtkRequisition *req);
+GtkWidget*      gtk_dialog_get_vbox                   (GtkDialog            *dialog);
+
+G_END_DECLS
+
+#endif  /* __GI_REPO_GTK_CUSTOM_H__ */

Modified: trunk/gir/Makefile.am
==============================================================================
--- trunk/gir/Makefile.am	(original)
+++ trunk/gir/Makefile.am	Mon Oct 20 18:26:32 2008
@@ -246,6 +246,20 @@
 BUILT_GIRSOURCES += Gdk-2.0.gir
 
 # gtk
+lib_LTLIBRARIES += libgirepo-Gtk-custom.la
+
+libgirepo_Gtk_custom_la_CPPFLAGS = \
+	$(GTK_CFLAGS)
+
+libgirepo_Gtk_custom_la_LIBADD = \
+	$(GTK_LIBS)
+
+libgirepo_Gtk_custom_la_LDFLAGS=$(COMMON_CUSTOM_LDFLAGS)
+
+libgirepo_Gtk_custom_la_SOURCES = \
+	Gtk-custom.c \
+	Gtk-custom.h
+
 GTK_INCLUDEDIR=`pkg-config --variable=includedir gtk+-2.0`/gtk-2.0
 GTK_LIBDIR=`pkg-config --variable=libdir gtk+-2.0`
 Gtk-2.0.gir: $(srcdir)/cairo-1.0.gir Pango-1.0.gir Atk-1.0.gir xlib-2.0.gir GdkPixbuf-2.0.gir Gdk-2.0.gir gtk-x11-2.0.c $(G_IR_SCANNER)
@@ -258,6 +272,7 @@
              --include=GdkPixbuf-2.0 \
              --include=Gdk-2.0 \
 	     --library=gtk-x11-2.0 \
+	     --library=girepo-Gtk-custom \
 	     $(NOCLOSURE) \
              --pkg gobject-2.0 \
              --pkg gio-2.0 \
@@ -272,6 +287,8 @@
              -D__GTK_TEXT_DISPLAY_H__ \
 	     -I$(GTK_INCLUDEDIR) \
 	     $(srcdir)/gtk-x11-2.0.c \
+	     $(srcdir)/Gtk-custom.h \
+	     $(srcdir)/Gtk-custom.c \
              $(GTK_INCLUDEDIR)/gtk/*.h
 BUILT_GIRSOURCES += Gtk-2.0.gir
 XPATH_TESTS += Gtk-2.0.xpath



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]