pygtk r2979 - in trunk: . gtk
- From: gianmt svn gnome org
- To: svn-commits-list gnome org
- Subject: pygtk r2979 - in trunk: . gtk
- Date: Sun, 18 May 2008 18:57:54 +0000 (UTC)
Author: gianmt
Date: Sun May 18 18:57:54 2008
New Revision: 2979
URL: http://svn.gnome.org/viewvc/pygtk?rev=2979&view=rev
Log:
gtk.gdk.DragContext.set_icon_widget allow mask parameter to be NULL, fixes #497781
Modified:
trunk/ChangeLog
trunk/gtk/gdk-base.defs
trunk/gtk/gtk.override
trunk/gtk/gtktreeview.override
trunk/gtk/pygtk-private.h
trunk/gtk/pygtk.h
Modified: trunk/gtk/gdk-base.defs
==============================================================================
--- trunk/gtk/gdk-base.defs (original)
+++ trunk/gtk/gdk-base.defs Sun May 18 18:57:54 2008
@@ -5053,7 +5053,7 @@
(parameters
'("GdkColormap*" "colormap")
'("GdkPixmap*" "pixmap")
- '("GdkBitmap*" "mask")
+ '("GdkBitmap*" "mask" (null-ok))
'("gint" "hot_x")
'("gint" "hot_y")
)
Modified: trunk/gtk/gtk.override
==============================================================================
--- trunk/gtk/gtk.override (original)
+++ trunk/gtk/gtk.override Sun May 18 18:57:54 2008
@@ -5770,6 +5770,80 @@
return ret;
}
%%
+override gtk_show_about_dialog kwargs
+static PyObject *
+_wrap_gtk_show_about_dialog(PyGObject *self, PyObject *args, PyObject *kwargs)
+{
+ GtkWindow *parent;
+ PyGObject *py_window = NULL;
+ GtkWidget *dialog;
+ GObjectClass *klass;
+
+ if (!PyArg_ParseTuple (args, "O:Gtk.show_about_dialog", &py_window))
+ return NULL;
+
+ if (py_window == NULL || (PyObject*)py_window == Py_None)
+ parent = NULL;
+ else
+ parent = GTK_WINDOW (py_window->obj);
+
+ dialog = gtk_about_dialog_new ();
+
+ g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL);
+
+ if (kwargs) {
+ Py_ssize_t pos = 0;
+ PyObject *py_prop_name;
+ PyObject *py_prop_value;
+
+ while (PyDict_Next (kwargs, &pos, &py_prop_name, &py_prop_value)) {
+ GParamSpec *pspec;
+ const gchar *property_name;
+ GValue property_gvalue = { 0, };
+
+ property_name = PyString_AsString (py_prop_name);
+
+ klass = G_OBJECT_CLASS (GTK_ABOUT_DIALOG_GET_CLASS(dialog));
+
+ pspec = g_object_class_find_property (klass, property_name);
+ if (!pspec) {
+ PyErr_Format(PyExc_TypeError,
+ "Gtk.AboutDialog doesn't support property `%s'",
+ property_name);
+ goto arg_error;
+ }
+
+ g_value_init (&property_gvalue, G_PARAM_SPEC_VALUE_TYPE(pspec));
+ if (pyg_param_gvalue_from_pyobject(&property_gvalue, py_prop_value, pspec) < 0) {
+ PyErr_Format(PyExc_TypeError,
+ "could not convert value for property `%s'",
+ property_name);
+ g_value_unset (&property_gvalue);
+ goto arg_error;
+ }
+
+ g_object_set_property (G_OBJECT (dialog), property_name, &property_gvalue);
+ g_value_unset (&property_gvalue);
+ }
+ }
+
+ if (parent) {
+ gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
+ gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
+ }
+
+ gtk_window_present (GTK_WINDOW (dialog));
+
+ Py_INCREF(Py_None);
+ return Py_None;
+
+arg_error:
+ if (dialog)
+ gtk_widget_destroy (dialog);
+
+ return NULL;
+}
+%%
override gtk_selection_data_set_uris kwargs
static PyObject *
_wrap_gtk_selection_data_set_uris(PyGBoxed *self, PyObject *args,
Modified: trunk/gtk/gtktreeview.override
==============================================================================
--- trunk/gtk/gtktreeview.override (original)
+++ trunk/gtk/gtktreeview.override Sun May 18 18:57:54 2008
@@ -3446,3 +3446,39 @@
return Py_BuildValue("(ii)", tree_x, tree_y);
}
+%%
+override gtk_tree_view_get_tooltip_context kwargs
+static PyObject *
+_wrap_gtk_tree_view_get_tooltip_context(PyGObject *self,
+ PyObject *args,
+ PyObject *kwargs)
+{
+ static char *kwlist[] = { "x", "y", "keyboard_tip", NULL };
+
+ gboolean ret;
+ PyObject *py_ret = Py_None, *py_keyboard_tip = Py_True;
+ gint x, y;
+ GtkTreeModel *tree_model;
+ GtkTreePath *path;
+ GtkTreeIter iter;
+
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs,
+ "iiO:GtkTreeView.get_tooltip_context",
+ kwlist, &x, &x, &py_keyboard_tip))
+ return NULL;
+
+ ret = gtk_tree_view_get_tooltip_context(GTK_TREE_VIEW(self->obj), &x, &y,
+ PyObject_IsTrue(py_keyboard_tip),
+ &tree_model,
+ &path, &iter);
+ if (ret) {
+ py_ret = Py_BuildValue("(NNN)",
+ pygobject_new((GObject *)tree_model),
+ pygtk_tree_path_to_pyobject(path),
+ pyg_boxed_new(GTK_TYPE_TREE_ITER, &iter,
+ FALSE, FALSE));
+
+ gtk_tree_path_free(path);
+ }
+ return py_ret;
+}
Modified: trunk/gtk/pygtk-private.h
==============================================================================
--- trunk/gtk/pygtk-private.h (original)
+++ trunk/gtk/pygtk-private.h Sun May 18 18:57:54 2008
@@ -61,15 +61,6 @@
PyObject *items);
int _pygtk_tree_model_remove_row(GtkTreeModel *model, GtkTreeIter *iter);
-/* A boxed type for GdkRegion until one gets into gtk+ itself. */
-#ifdef GDK_TYPE_REGION
-#define PYGDK_TYPE_REGION GDK_TYPE_REGION
-#else
-GType pygdk_region_get_type (void) G_GNUC_CONST;
-
-#define PYGDK_TYPE_REGION (pygdk_region_get_type ())
-#endif /* GDK_TYPE_REGION */
-
void pygtk_boxed_unref_shared(PyObject *boxed);
#endif
Modified: trunk/gtk/pygtk.h
==============================================================================
--- trunk/gtk/pygtk.h (original)
+++ trunk/gtk/pygtk.h Sun May 18 18:57:54 2008
@@ -7,6 +7,15 @@
#include <Python.h>
#include <gtk/gtk.h>
+/* A boxed type for GdkRegion until one gets into gtk+ itself. */
+#ifdef GDK_TYPE_REGION
+#define PYGDK_TYPE_REGION GDK_TYPE_REGION
+#else
+GType pygdk_region_get_type (void) G_GNUC_CONST;
+
+#define PYGDK_TYPE_REGION (pygdk_region_get_type ())
+#endif /* GDK_TYPE_REGION */
+
struct _PyGtk_FunctionStruct {
char *pygtkVersion;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]