/* -*- Mode: C; c-basic-offset: 4 -*- */
%%
headers
#include <Python.h>
#include <pygtk/pygtk.h>
#include <gtkosxapplication.h>

%%
modulename gtk_osxapplication
%%
import gobject.GObject as PyGObject_Type
import gtk.gdk.Pixbuf as PyGdkPixbuf_Type
import gtk.MenuShell as PyGtkMenuShell_Type
import gtk.MenuItem as PyGtkMenuItem_Type
import gtk.Window as PyGtkWindow_Type
import gtk.Widget as PyGtkWidget_Type
%%
ignore-glob
  *_get_type
%%
override gtk_osxapplication_add_app_menu_group noargs
static PyObject*
_wrap_gtk_osxapplication_add_app_menu_group (PyGObject *self)
{
    GtkOSXApplicationMenuGroup *group;
    PyObject *ret;

    group = gtk_osxapplication_add_app_menu_group (GTK_OSX_APPLICATION(self->obj));

    ret = PyCObject_FromVoidPtr ((void *) group, NULL);

    return ret;
}
%%
override gtk_osxapplication_add_app_menu_item kwargs
static PyObject*
_wrap_gtk_osxapplication_add_app_menu_item (PyGObject *self, PyObject *args, PyObject *kwargs)
{
    static char *kwlist[] = { "group", "item", NULL };
    PyObject *pygroup;
    PyObject *pyitem;
    GtkOSXApplicationMenuGroup *group;
    GtkMenuItem *item;
   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO!:add_app_menu_item", 
				     kwlist,
                                     &pygroup, 
                                     &PyGtkMenuItem_Type,
				     &pyitem))
        return NULL;

    Py_INCREF (Py_None);
    group = PyCObject_AsVoidPtr (pygroup);
    item = GTK_MENU_ITEM (pygobject_get (pyitem));
    g_return_val_if_fail(group != NULL, Py_None);
    gtk_osxapplication_add_app_menu_item (GTK_OSX_APPLICATION(self->obj), group, item);
    return Py_None;
}
%%
override gtk_osxapplication_insert_app_menu_item kwargs
static PyObject*
_wrap_gtk_osxapplication_insert_app_menu_item (PyGObject *self, PyObject *args, PyObject *kwargs)
{
    static char *kwlist[] = { "item", "index", NULL };
    PyObject *pyitem;
    GtkWidget *item;
    gint index;
   if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!i:insert_app_menu_item",
				    kwlist,
				    &PyGtkWidget_Type,
				    &pyitem, &index))
        return NULL;

    Py_INCREF (Py_None);
    item = GTK_WIDGET (pygobject_get (pyitem));
    gtk_osxapplication_insert_app_menu_item (GTK_OSX_APPLICATION(self->obj), item, index);
    return Py_None;
}
%%
override quartz_application_get_bundle_info kwargs
static PyObject*
_wrap_quartz_application_get_bundle_info (PyObject *args, PyObject *kwargs)
{
    static char *kwlist[] = { "key", NULL };
    char *key;
    gpointer item;
    PyObject *ret;

    item = quartz_application_get_bundle_info (key);

    ret = PyCObject_FromVoidPtr (item, NULL);

    return ret;
}
