/* vim: set ft=cpp: */ %% headers #include "gtkcombobutton.h" #include "ext/gtk+/php_gtk+.h" #define GTK_COMBO_BUTTON GTK_COMBOBUTTON %% constants %% ignore-glob *_get_type %% override gtk_combobutton_new PHP_FUNCTION(gtk_combobutton_new) { zval *arg = NULL; GtkObject *wrapped_obj; zend_bool changing = 0; NOT_STATIC_METHOD(); if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "|Vb", &arg, &changing)) { php_gtk_invalidate(this_ptr); return; } if (arg) { if (Z_TYPE_P(arg) == IS_STRING) { wrapped_obj = (GtkObject *)gtk_combobutton_new_with_label(estrdup(Z_STRVAL_P(arg))); } else if (Z_TYPE_P(arg) == IS_OBJECT && php_gtk_check_class(arg, gtk_menu_ce)) { wrapped_obj = (GtkObject *)gtk_combobutton_new_with_menu(GTK_WIDGET(PHP_GTK_GET(arg)), changing); } else { php_error(E_WARNING, "%s(): expecting argument 1 to be string or GtkMenu object", get_active_function_name(TSRMLS_C)); php_gtk_invalidate(this_ptr); return; } } else { wrapped_obj = (GtkObject *)gtk_combobutton_new(); } if (!wrapped_obj) { php_error(E_WARNING, "%s(): could not create GtkComboButton object", get_active_function_name(TSRMLS_C)); php_gtk_invalidate(this_ptr); return; } php_gtk_object_init(wrapped_obj, this_ptr); }