1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944
|
/*
SPDX-License-Identifier: GPL-2.0-or-later AND LGPL-2.0-or-later AND MIT
SPDX-FileCopyrightText: 2007-2010 Johan Dahlin
SPDX-FileCopyrightText: 2008-2010 Colin Walters <walters@verbum.org>
SPDX-FileCopyrightText: 2008 Jürg Billeter
SPDX-FileCopyrightText: 2008 Philip Van Hoof
SPDX-FileCopyrightText: 2009, 2011-2012 Dan Winship
SPDX-FileCopyrightText: 2010 Collabora, Ltd.
SPDX-FileCopyrightText: 2010 litl, LLC
SPDX-FileCopyrightText: 2010 Sugar Labs
SPDX-FileCopyrightText: 2011 Owen Taylor
SPDX-FileCopyrightText: 2011 Red Hat, Inc.
SPDX-FileCopyrightText: 2011 Torsten Schönfeld
SPDX-FileCopyrightText: 2018 Christoph Reiter
SPDX-FileCopyrightText: 2020 Centricular
SPDX-FileCopyrightText: 2024 Simon McVittie
SPDX-FileCopyrightText: 2024 Philip Chimento <philip.chimento@gmail.com>
*/
#include <time.h>
#include "foo.h"
/**
* SECTION:standalone_section
*
* This documentation section isn't associated with an object
* in particular, but it should be serialized in the gir nevertheless.
*/
/* A hidden type not exposed publicly, similar to GUPNP's XML wrapper
object */
typedef struct _RegressFooHidden RegressFooHidden;
void regress_foo_private_function (RegressFooObject *regress_foo);
void regress_foo_do_regress_foo (RegressFooInterface *self, int x);
RegressFooHidden *regress_foo_hidden_copy (const RegressFooHidden *boxed);
void regress_foo_hidden_free (RegressFooHidden *boxed);
GType regress_foo_hidden_get_type (void);
RegressFooBoxed *regress_foo_boxed_copy (const RegressFooBoxed *boxed);
void regress_foo_boxed_free (RegressFooBoxed *boxed);
void regress_foo_dbus_data_free (RegressFooDBusData *boxed);
RegressFooDBusData *regress_foo_dbus_data_copy (const RegressFooDBusData *boxed);
typedef struct
{
int i;
} PrivateStruct;
void
regress_foo_private_function (RegressFooObject *regress_foo G_GNUC_UNUSED)
{
}
GType
regress_foo_interface_get_type (void)
{
static GType object_type = 0;
if (!object_type)
{
object_type = g_type_register_static_simple (G_TYPE_INTERFACE,
"RegressFooInterface",
sizeof (RegressFooInterfaceIface),
NULL, 0, NULL, 0);
g_type_interface_add_prerequisite (object_type, G_TYPE_OBJECT);
}
return object_type;
}
void
regress_foo_interface_do_regress_foo (RegressFooInterface *self, int x)
{
REGRESS_FOO_INTERFACE_GET_INTERFACE (self)->do_regress_foo (self, x);
}
void
regress_foo_interface_static_method (int x G_GNUC_UNUSED)
{
}
enum
{
PROP_0,
PROP_STRING,
PROP_HIDDEN
};
enum
{
SIGNAL,
LAST_SIGNAL
};
static guint regress_foo_object_signals[LAST_SIGNAL] = { 0 };
static void
regress_foo_regress_foo_interface_init (gpointer g_iface,
gpointer iface_data G_GNUC_UNUSED)
{
RegressFooInterfaceIface *iface = (RegressFooInterfaceIface *) g_iface;
iface->do_regress_foo = regress_foo_do_regress_foo;
}
enum
{
SUBIFACE_DESTROY_EVENT,
SUBIFACE_LAST_SIGNAL
};
static void
regress_foo_sub_interface_class_init (gpointer g_class, gpointer class_data);
static guint regress_foo_subiface_signals[SUBIFACE_LAST_SIGNAL] = { 0 };
GType
regress_foo_sub_interface_get_type (void)
{
static GType object_type = 0;
if (!object_type)
{
object_type = g_type_register_static_simple (G_TYPE_INTERFACE,
"RegressFooSubInterface",
sizeof (RegressFooSubInterfaceIface),
regress_foo_sub_interface_class_init, 0, NULL, 0);
g_type_interface_add_prerequisite (object_type, REGRESS_FOO_TYPE_INTERFACE);
}
return object_type;
}
static void
regress_foo_sub_interface_class_init (gpointer g_class G_GNUC_UNUSED,
gpointer class_data G_GNUC_UNUSED)
{
regress_foo_subiface_signals[SUBIFACE_DESTROY_EVENT] =
g_signal_new ("destroy-event", REGRESS_FOO_TYPE_SUBINTERFACE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (RegressFooSubInterfaceIface, destroy_event),
NULL, NULL, NULL,
G_TYPE_NONE,
0,
G_TYPE_NONE);
}
void
regress_foo_sub_interface_do_bar (RegressFooSubInterface *self)
{
REGRESS_FOO_SUBINTERFACE_GET_INTERFACE (self)->do_bar (self);
}
/**
* regress_foo_sub_interface_do_baz:
* @self:
* @callback: (scope call):
* @user_data:
*/
void
regress_foo_sub_interface_do_baz (RegressFooSubInterface *self, GCallback callback, gpointer user_data)
{
REGRESS_FOO_SUBINTERFACE_GET_INTERFACE (self)->do_baz (self, callback, user_data);
}
G_DEFINE_TYPE_EXTENDED (RegressFooObject, regress_foo_object, G_TYPE_OBJECT, 0, G_IMPLEMENT_INTERFACE (REGRESS_FOO_TYPE_INTERFACE, regress_foo_regress_foo_interface_init));
static void
regress_foo_object_set_property (GObject *object,
guint prop_id,
const GValue *value G_GNUC_UNUSED,
GParamSpec *pspec)
{
switch (prop_id)
{
case PROP_STRING:
break;
case PROP_HIDDEN:
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
regress_foo_object_get_property (GObject *object,
guint prop_id,
GValue *value G_GNUC_UNUSED,
GParamSpec *pspec)
{
switch (prop_id)
{
case PROP_STRING:
break;
case PROP_HIDDEN:
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
regress_foo_object_class_init (RegressFooObjectClass *klass)
{
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->set_property = regress_foo_object_set_property;
gobject_class->get_property = regress_foo_object_get_property;
g_object_class_install_property (gobject_class,
PROP_STRING,
g_param_spec_string ("string",
"String nick",
"The String Property Blurb",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
g_object_class_install_property (gobject_class,
PROP_HIDDEN,
g_param_spec_boxed ("hidden",
"hidden property",
"should not be exposed",
regress_foo_hidden_get_type (),
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
regress_foo_object_signals[SIGNAL] =
g_signal_new ("signal",
G_OBJECT_CLASS_TYPE (gobject_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
(GSignalCMarshaller) g_cclosure_marshal_STRING__OBJECT_POINTER,
G_TYPE_STRING, 2, G_TYPE_OBJECT, G_TYPE_POINTER);
}
static void
regress_foo_object_init (RegressFooObject *object G_GNUC_UNUSED)
{
}
RegressFooObject *
regress_foo_object_new (void)
{
return g_object_new (REGRESS_FOO_TYPE_OBJECT, NULL);
}
GObject *
regress_foo_object_new_as_super (void)
{
return g_object_new (REGRESS_FOO_TYPE_OBJECT, NULL);
}
/**
* regress_foo_object_external_type:
* @object: a #RegressFooObject
*
* Returns: (transfer none): %NULL always
*/
UtilityObject *
regress_foo_object_external_type (RegressFooObject *object G_GNUC_UNUSED)
{
return NULL;
}
void
regress_foo_object_various (RegressFooObject *object G_GNUC_UNUSED,
void *data G_GNUC_UNUSED,
GType some_type G_GNUC_UNUSED)
{
}
void
regress_foo_object_take_all (RegressFooObject *object G_GNUC_UNUSED,
int x G_GNUC_UNUSED,
...)
{
}
void
regress_foo_do_regress_foo (RegressFooInterface *self G_GNUC_UNUSED,
int x G_GNUC_UNUSED)
{
}
void
regress_foo_object_is_it_time_yet (RegressFooObject *object G_GNUC_UNUSED,
time_t time G_GNUC_UNUSED)
{
}
void
regress_foo_object_seek (RegressFooObject *object G_GNUC_UNUSED, off_t offset G_GNUC_UNUSED)
{
}
/**
* regress_foo_object_new_cookie: (skip)
* @object:
* @target:
*
* Not sure why this test is here...
*/
RegressFooObjectCookie
regress_foo_object_new_cookie (RegressFooObject *object G_GNUC_UNUSED,
const char *target G_GNUC_UNUSED)
{
return NULL;
}
const char *
regress_foo_object_get_name (RegressFooObject *object G_GNUC_UNUSED)
{
return "regress_foo";
}
char *
regress_foo_object_dup_name (RegressFooObject *object G_GNUC_UNUSED)
{
return g_strdup ("regress_foo");
}
void
regress_foo_object_handle_glyph (RegressFooObject *object G_GNUC_UNUSED, UtilityGlyph glyph G_GNUC_UNUSED)
{
}
gboolean
regress_foo_object_virtual_method (RegressFooObject *object, int first_param)
{
RegressFooObjectClass *klass = REGRESS_FOO_OBJECT_GET_CLASS (object);
if (!klass->virtual_method)
return FALSE;
return klass->virtual_method (object, first_param);
}
/**
* regress_foo_object_read: (virtual read_fn)
* @object: obj
* @offset: offset
* @length: length
*
* Read some stuff.
*/
void
regress_foo_object_read (RegressFooObject *object G_GNUC_UNUSED,
int offset G_GNUC_UNUSED,
int length G_GNUC_UNUSED)
{
}
/**
* regress_foo_object_static_meth:
*
* Returns:
*/
int
regress_foo_object_static_meth (void)
{
return 77;
}
/**
* regress_foo_object_skipped_method: (skip)
* @object: obj
*
* This is only useful from C.
*/
void
regress_foo_object_skipped_method (RegressFooObject *object G_GNUC_UNUSED)
{
}
G_DEFINE_ABSTRACT_TYPE (RegressFooSubobject, regress_foo_subobject, REGRESS_FOO_TYPE_OBJECT);
static void
regress_foo_subobject_class_init (RegressFooSubobjectClass *klass G_GNUC_UNUSED)
{
}
static void
regress_foo_subobject_init (RegressFooSubobject *object G_GNUC_UNUSED)
{
}
/**
* regress_foo_object_get_default:
*
* This function is intended to match clutter_stage_get_default which
* uses a C sugar return type.
*
* Return value: (type RegressFooSubobject) (transfer none): The global #RegressFooSubobject
*/
RegressFooObject *
regress_foo_object_get_default (void)
{
return NULL;
}
int
regress_foo_init (void)
{
return REGRESS_FOO_SUCCESS_INT;
}
/**
* regress_foo_init_argv:
* @argc:
* @argv: (array length=argc) (allow-none):
*/
int
regress_foo_init_argv (int argc G_GNUC_UNUSED,
char **argv G_GNUC_UNUSED)
{
return REGRESS_FOO_SUCCESS_INT;
}
/**
* regress_foo_init_argv_address:
* @argc: (inout):
* @argv: (array length=argc) (inout) (allow-none):
*/
int
regress_foo_init_argv_address (int *argc G_GNUC_UNUSED,
char ***argv G_GNUC_UNUSED)
{
return REGRESS_FOO_SUCCESS_INT;
}
GType
regress_foo_enum_type_get_type (void)
{
static GType etype = 0;
if (G_UNLIKELY (etype == 0))
{
static const GEnumValue values[] = {
{ REGRESS_FOO_ENUM_ALPHA, "REGRESS_FOO_ENUM_ALPHA", "alpha" },
{ REGRESS_FOO_ENUM_BETA, "REGRESS_FOO_ENUM_BETA", "beta" },
{ REGRESS_FOO_ENUM_DELTA, "REGRESS_FOO_ENUM_DELTA", "delta" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static (g_intern_static_string ("RegressFooEnumType"), values);
}
return etype;
}
int
regress_foo_enum_method (RegressFooEnumType regress_foo_enum G_GNUC_UNUSED)
{
return 0;
}
int
regress_foo_enum_type_method (RegressFooEnumType regress_foo_enum)
{
return (regress_foo_enum + 1) % 3;
}
RegressFooEnumType
regress_foo_enum_type_returnv (int x)
{
return (x + 1) % 3;
}
GType
regress_foo_flags_type_get_type (void)
{
static GType etype = 0;
if (G_UNLIKELY (etype == 0))
{
static const GFlagsValue values[] = {
{ REGRESS_FOO_FLAGS_FIRST, "REGRESS_FOO_FLAGS_FIRST", "first" },
{ REGRESS_FOO_FLAGS_SECOND, "REGRESS_FOO_FLAGS_SECOND", "second" },
{ REGRESS_FOO_FLAGS_THIRD, "REGRESS_FOO_FLAGS_THIRD", "third" },
{ 0, NULL, NULL }
};
etype = g_flags_register_static (g_intern_static_string ("RegressFooFlagsType"), values);
}
return etype;
}
struct _RegressFooBoxed
{
int private;
};
RegressFooBoxed *
regress_foo_boxed_copy (const RegressFooBoxed *boxed)
{
#if GLIB_CHECK_VERSION(2, 67, 5)
return (RegressFooBoxed *) g_memdup2 (boxed, sizeof (RegressFooBoxed));
#else
return (RegressFooBoxed *) g_memdup (boxed, sizeof (RegressFooBoxed));
#endif
}
void
regress_foo_boxed_free (RegressFooBoxed *boxed)
{
g_slice_free (RegressFooBoxed, boxed);
}
GType
regress_foo_boxed_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("RegressFooBoxed",
(GBoxedCopyFunc) regress_foo_boxed_copy,
(GBoxedFreeFunc) regress_foo_boxed_free);
return our_type;
}
RegressFooBoxed *
regress_foo_boxed_new (void)
{
return g_slice_new0 (RegressFooBoxed);
}
void
regress_foo_boxed_method (RegressFooBoxed *boxed G_GNUC_UNUSED)
{
}
/* RegressFooDbus */
struct _RegressFooDBusData
{
double private;
};
RegressFooDBusData *
regress_foo_dbus_data_copy (const RegressFooDBusData *boxed)
{
#if GLIB_CHECK_VERSION(2, 67, 5)
return (RegressFooDBusData *) g_memdup2 (boxed, sizeof (RegressFooDBusData));
#else
return (RegressFooDBusData *) g_memdup (boxed, sizeof (RegressFooDBusData));
#endif
}
void
regress_foo_dbus_data_free (RegressFooDBusData *boxed)
{
g_slice_free (RegressFooDBusData, boxed);
}
GType
regress_foo_dbus_data_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("RegressFooDBusData",
(GBoxedCopyFunc) regress_foo_dbus_data_copy,
(GBoxedFreeFunc) regress_foo_dbus_data_free);
return our_type;
}
static RegressFooBRect *
regress_foo_brect_copy (const RegressFooBRect *boxed)
{
#if GLIB_CHECK_VERSION(2, 67, 5)
return (RegressFooBRect *) g_memdup2 (boxed, sizeof (RegressFooBRect));
#else
return (RegressFooBRect *) g_memdup (boxed, sizeof (RegressFooBRect));
#endif
}
GType
regress_foo_brect_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("RegressFooBRect",
(GBoxedCopyFunc) regress_foo_brect_copy,
(GBoxedFreeFunc) g_free);
return our_type;
}
RegressFooBRect *
regress_foo_brect_new (double x, double y)
{
RegressFooBRect *retval = g_new(RegressFooBRect, 1);
retval->x = x;
retval->y = y;
return retval;
}
void
regress_foo_brect_add (RegressFooBRect *b1 G_GNUC_UNUSED, RegressFooBRect *b2 G_GNUC_UNUSED)
{
}
static RegressFooBUnion *
regress_foo_bunion_copy (const RegressFooBUnion *boxed)
{
#if GLIB_CHECK_VERSION(2, 67, 5)
return (RegressFooBUnion *) g_memdup2 (boxed, sizeof (RegressFooBUnion));
#else
return (RegressFooBUnion *) g_memdup (boxed, sizeof (RegressFooBUnion));
#endif
}
GType
regress_foo_bunion_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("RegressFooBUnion",
(GBoxedCopyFunc) regress_foo_bunion_copy,
(GBoxedFreeFunc) g_free);
return our_type;
}
RegressFooBUnion *
regress_foo_bunion_new (void)
{
return g_new0(RegressFooBUnion, 1);
}
void
regress_foo_test_unsigned (unsigned int uint G_GNUC_UNUSED)
{
}
/**
* regress_foo_test_string_array:
* @array: (array zero-terminated=1):
*/
void
regress_foo_test_string_array (char **array G_GNUC_UNUSED)
{
}
/**
* regress_foo_test_string_array_with_g:
* @array: (array zero-terminated=1):
*/
void
regress_foo_test_string_array_with_g (gchar **array G_GNUC_UNUSED)
{
}
/**
* regress_foo_test_array:
*
* Returns: (element-type utf8) (transfer container):
*/
GArray *
regress_foo_test_array (void)
{
return NULL;
}
/**
* regress_foo_rectangle_new: (skip)
*
* This is a C convenience constructor; we have to (skip)
* it because it's not a boxed type.
*/
RegressFooRectangle *
regress_foo_rectangle_new (int x, int y, int width, int height)
{
RegressFooRectangle *r = g_slice_new (RegressFooRectangle);
r->x = x;
r->y = y;
r->width = width;
r->height = height;
return r;
}
/**
* regress_foo_rectangle_add:
* @r1: add to this rect
* @r2: source rectangle
*/
void
regress_foo_rectangle_add (RegressFooRectangle *r1 G_GNUC_UNUSED,
const RegressFooRectangle *r2 G_GNUC_UNUSED)
{
}
void
regress_foo_method_external_references (UtilityObject *object G_GNUC_UNUSED,
UtilityEnumType e G_GNUC_UNUSED,
UtilityFlagType f G_GNUC_UNUSED,
UtilityStruct s G_GNUC_UNUSED)
{
}
/* RegressFooHidden */
struct _RegressFooHidden
{
char *frob;
};
RegressFooHidden *
regress_foo_hidden_copy (const RegressFooHidden *boxed)
{
#if GLIB_CHECK_VERSION(2, 67, 5)
return (RegressFooHidden *) g_memdup2 (boxed, sizeof (RegressFooHidden));
#else
return (RegressFooHidden *) g_memdup (boxed, sizeof (RegressFooHidden));
#endif
}
void
regress_foo_hidden_free (RegressFooHidden *boxed)
{
g_slice_free (RegressFooHidden, boxed);
}
GType
regress_foo_hidden_get_type (void)
{
static GType our_type = 0;
if (our_type == 0)
our_type = g_boxed_type_register_static ("RegressFooHidden",
(GBoxedCopyFunc) regress_foo_hidden_copy,
(GBoxedFreeFunc) regress_foo_hidden_free);
return our_type;
}
GType
regress_foo_error_get_type (void)
{
static GType etype = 0;
if (G_UNLIKELY (etype == 0))
{
static const GEnumValue values[] = {
{ REGRESS_FOO_ERROR_GOOD, "REGRESS_FOO_ERROR_GOOD", "good" },
{ REGRESS_FOO_ERROR_BAD, "REGRESS_FOO_ERROR_BAD", "bad" },
{ REGRESS_FOO_ERROR_UGLY, "REGRESS_FOO_ERROR_UGLY", "ugly" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static (g_intern_static_string ("RegressFooError"), values);
}
return etype;
}
GQuark
regress_foo_error_quark (void)
{
return g_quark_from_static_string ("regress_foo-error-quark");
}
void
regress_foo_some_variant (guint x G_GNUC_UNUSED,
va_list args G_GNUC_UNUSED)
{
}
GType regress_foo_tile_handler_get_type (void);
/* This setup of a totally hidden parent class matches
* http://bugzilla.gnome.org/show_bug.cgi?id=561360
*/
#define REGRESS_FOO_TYPE_TILE_HANDLER (regress_foo_tile_handler_get_type ())
#define REGRESS_FOO_TILE_HANDLER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_FOO_TYPE_TILE_HANDLER, RegressFooTileHandler))
#define REGRESS_FOO_IS_TILE_HANDLER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), REGRESS_FOO_TYPE_TILE_HANDLER))
struct _RegressFooTileHandler
{
RegressFooObject parent_instance;
};
struct _RegressFooTileHandlerClass
{
RegressFooObjectClass parent_class;
};
typedef struct _RegressFooTileHandler RegressFooTileHandler;
typedef struct _RegressFooTileHandlerClass RegressFooTileHandlerClass;
G_DEFINE_TYPE (RegressFooTileHandler, regress_foo_tile_handler, REGRESS_FOO_TYPE_OBJECT);
static void
regress_foo_tile_handler_class_init (RegressFooTileHandlerClass *klass G_GNUC_UNUSED)
{
}
static void
regress_foo_tile_handler_init (RegressFooTileHandler *object G_GNUC_UNUSED)
{
}
struct _RegressFooBuffer
{
RegressFooTileHandler parent_instance;
};
struct _RegressFooBufferClass
{
RegressFooTileHandlerClass parent_class;
};
G_DEFINE_TYPE (RegressFooBuffer, regress_foo_buffer, REGRESS_FOO_TYPE_TILE_HANDLER);
static void
regress_foo_buffer_class_init (RegressFooBufferClass *klass G_GNUC_UNUSED)
{
}
static void
regress_foo_buffer_init (RegressFooBuffer *object G_GNUC_UNUSED)
{
}
void
regress_foo_buffer_some_method (RegressFooBuffer *buffer G_GNUC_UNUSED)
{
}
struct _RegressFooOtherObject
{
GObject parent_instance;
};
struct _RegressFooOtherObjectClass
{
GObjectClass parent_class;
};
G_DEFINE_TYPE (RegressFooOtherObject, regress_foo_other_object, G_TYPE_OBJECT);
static void
regress_foo_other_object_class_init (RegressFooOtherObjectClass *klass G_GNUC_UNUSED)
{
}
static void
regress_foo_other_object_init (RegressFooOtherObject *object G_GNUC_UNUSED)
{
}
#define REGRESS_FOO_DEFINE_SHOULD_NOT_BE_EXPOSED "should not be exposed"
/**
* regress_foo_skip_me: (skip)
* @fs: a #RegressFooSkippable
*
* Does something that's only interesting from C and should not be
* exposed to language bindings.
*/
void
regress_foo_skip_me (RegressFooSkippable fs G_GNUC_UNUSED)
{
}
/**
* RegressFooForeignStruct: (foreign)
*
*/
RegressFooForeignStruct *
regress_foo_foreign_struct_new (void)
{
return g_slice_new0 (RegressFooForeignStruct);
}
RegressFooForeignStruct *
regress_foo_foreign_struct_copy (RegressFooForeignStruct *original)
{
RegressFooForeignStruct *copy;
copy = regress_foo_foreign_struct_new ();
copy->regress_foo = original->regress_foo;
return copy;
}
/**
* regress_foo_test_varargs_callback: (skip)
*
*/
void
regress_foo_test_varargs_callback (gint i G_GNUC_UNUSED,
RegressFooVarargsCallback callback G_GNUC_UNUSED)
{
}
/**
* regress_foo_test_varargs_callback2: (skip)
*
*/
void
regress_foo_test_varargs_callback2 (RegressFooVarargsCallback callback G_GNUC_UNUSED)
{
}
/**
* regress_foo_test_varargs_callback3: (skip)
*
*/
void
regress_foo_test_varargs_callback3 (RegressFooVarargsCallback callback G_GNUC_UNUSED,
RegressFooVarargsCallback callback2 G_GNUC_UNUSED)
{
}
/**
* regress_foo_object_a_global_method:
* @obj: a #UtilityObject
*
* This shouldn't be scanned as a method of UtilityObject.
*/
void
regress_foo_object_a_global_method (UtilityObject *obj G_GNUC_UNUSED)
{
}
/**
* regress_foo_object_append_new_stack_layer:
*
* This shouldn't be scanned as a constructor.
*
* Returns: (transfer none):
*/
RegressFooOtherObject *
regress_foo_object_append_new_stack_layer (RegressFooObject *obj G_GNUC_UNUSED,
int x G_GNUC_UNUSED)
{
return NULL;
}
/**
* regress_foo_not_a_constructor_new:
*
* This should be scanned as a top-level function, and shouldn't cause
* a "Can't find matching type for constructor" warning.
*
* Returns: (transfer none):
*/
RegressFooObject *
regress_foo_not_a_constructor_new (void)
{
return NULL;
}
|