/* -*- Mode: C; c-basic-offset: 4 -*- */
%%
headers
#include <Python.h>
#include <pygtk/pygtk.h>
#include <gtk-mac-menu.h>
#include <gtk-mac-dock.h>
#include <gtk-mac-bundle.h>
%%
modulename gtkmacintegration
%%
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
%%
ignore-glob
  *_get_type
%%
override gtk_mac_menu_add_app_menu_group noargs
static PyObject*
_wrap_gtk_mac_menu_add_app_menu_group (PyGObject *self)
{
    GtkMacMenuGroup *group;
    PyObject *ret;

    group = gtk_mac_menu_add_app_menu_group ();

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

    return ret;
}
%%
override gtk_mac_menu_add_app_menu_item kwargs
static PyObject*
_wrap_gtk_mac_menu_add_app_menu_item (PyGObject *self, PyObject *args, PyObject *kwargs)
{
    static char *kwlist[] = { "group", "item", "label", NULL };
    PyObject *pygroup;
    PyObject *pyitem;
    char *label = NULL;
    GtkMacMenuGroup *group;
    GtkMenuItem *item;

    if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO!z:add_app_menu_item", kwlist,
                                     &pygroup,
                                     &PyGtkMenuItem_Type, &pyitem,
                                     &label))
        return NULL;

    group = PyCObject_AsVoidPtr (pygroup);
    item = GTK_MENU_ITEM (pygobject_get (pyitem));

    gtk_mac_menu_add_app_menu_item (group, item, label);

    Py_INCREF (Py_None);
    return Py_None;
}
