Re: gtkaboutdialog overrides
| From: | Steph Fox | Date: | Mon, 31 Oct 2005 13:41:43 +0000 |
| Subject: | Re: gtkaboutdialog overrides | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-2023@lists.php.net to get a copy of this message | ||
Hi Simon,
Will do.
(I've some bits from Tom to check and probably commit too, poor man's been
waiting a fortnight.)
- Steph
----- Original Message -----
From: "Simon" <simon@firepages.com.au>
To: <php-gtk-dev@lists.php.net>
Sent: Monday, October 31, 2005 1:20 PM
Subject: [PHP-GTK-DEV] gtkaboutdialog overrides
> Hi , amateur hour begins ;)
>
> These overrides work (*nix) but not sure if they are safe (especially
> get_... on win32)
>
> can someone check & if ok apply ?
>
> GtkAboutDialog::set_documenters/artists/authors &&
> get_documenters/artists/authors are all same-same documenters example
below
>
> Gonna start my docc'ing efforts with these so I hope they work ~.
>
> .....................................................................
>
>
> %% {{{ GtkAboutDialog
> %%
> override gtk_about_dialog_get_documenters
> PHP_METHOD
> {
> gchar **list;
> int i =0;
>
> NOT_STATIC_METHOD();
>
> if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "")){
> return;
> }
> list =
>
gtk_about_dialog_get_documenters(GTK_ABOUT_DIALOG(PHPG_GOBJECT(this_ptr)));
> array_init(return_value);
> while ( list[i] ) {
> add_next_index_string(return_value, (char *)list[i], 1);
> i++ ;
> }
> }
>
> %%
> add-arginfo GtkAboutDialog set_documenters
> static
> ZEND_BEGIN_ARG_INFO(ARGINFO_NAME, 0)
> ZEND_ARG_INFO(0, documenters)
> ZEND_END_ARG_INFO();
>
> %%
> override gtk_about_dialog_set_documenters
> PHP_METHOD
> {
> int i=0;
> zval *documenters, **item = NULL;
> const gchar **list;
> zend_bool free_list;
> HashTable *args_hash;
> TSRMLS_FETCH();
>
> NOT_STATIC_METHOD();
>
> if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/",
> &documenters) == FAILURE ) {
> return;
> }
>
> args_hash = HASH_OF(documenters);
> list = g_new( const gchar *, ((int
> *)zend_hash_num_elements(args_hash)) + 1);
> zend_hash_internal_pointer_reset(Z_ARRVAL_P(documenters));
> while (zend_hash_get_current_data(Z_ARRVAL_P(documenters), (void
> **)&item) == SUCCESS) {
> convert_to_string_ex(item);
> list[i++] = Z_STRVAL_PP(item);
> zend_hash_move_forward(Z_ARRVAL_P(documenters));
> }
> list[i++] = NULL;
> gtk_about_dialog_set_documenters(
> GTK_ABOUT_DIALOG(PHPG_GOBJECT(this_ptr)), list );
> if(free_list) g_free(list);
> }
>
> %% }}}
>
> --
> PHP-GTK Development Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>