{"id":17800967,"url":"https://github.com/refi64/gpropz","last_synced_at":"2025-10-10T08:43:18.273Z","repository":{"id":69429202,"uuid":"195574949","full_name":"refi64/gpropz","owner":"refi64","description":"Low-boilerplate GObject property definitions","archived":false,"fork":false,"pushed_at":"2022-04-19T01:30:07.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T05:06:46.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gpropz.refi64.com","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/refi64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-06T19:15:05.000Z","updated_at":"2022-04-19T01:30:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"368063ef-8db0-4609-b246-431c0de2550b","html_url":"https://github.com/refi64/gpropz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fgpropz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fgpropz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fgpropz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refi64%2Fgpropz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refi64","download_url":"https://codeload.github.com/refi64/gpropz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246758278,"owners_count":20828919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-27T12:32:50.361Z","updated_at":"2025-10-10T08:43:18.197Z","avatar_url":"https://github.com/refi64.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gpropz\n\ngpropz allows you to create GObject properties with less boilerplate.\n\n## Highlights\n\n- No need to define `*_get_property` and `*_set_property` functions manually. (You still can for\n  more flexibility, however.)\n- Automatically \"bind\" the getter (and optionally setter) for a property to a variable on\n  your instance / private instance.\n- Support for \"filters\", which allows you to transform / reject properties manually.\n\n## Links\n\n- [Website/documentation.](https://gpropz.refi64.com/)\n- [Source.](https://github.com/refi64/gpropz)\n\n## Embedding\n\ngpropz is designed to be statically linked into your project. It generally follows the typical\nstyle of a [Meson subproject](https://mesonbuild.com/Subprojects.html#a-simple-example). Example:\n\n```python\ngpropz_proj = subproject('gpropz')\ngpropz_dep = gpropz_proj.get_variable('gpropz_dep')\n\n# Use gpropz_dep in your project later on.\n```\n\nIf you're not using Meson, then just compile gpropz.c, making sure glib-2.0 and gobject-2.0's\ncompiler flags / link options are given.\n\n## Examples\n\nSee the `demo` directory for full examples.\n\n### Registering new properties\n\n```c\n// In the *_class_init function:\n\nGObjectClass *object_class = G_OBJECT_CLASS (klass);\ngpropz_class_init_property_functions (object_class);\n// The above line is shorthand for:\nobject_class-\u003eget_property = gpropz_auto_get_property;\nobject_class-\u003eset_property = gpropz_auto_set_property;\n// It just assigns the get_property / set_property functions with the magic gpropz ones.\n\nproperties[PROP_NAME] =\n  g_param_spec_string (\"name\",\n                       \"A name\",\n                       \"This is some random name you probably don't care about\",\n                       NULL, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);\n\ngpropz_install_property (object_class, MyObject, name, PROP_NAME, properties[PROP_NAME],\n                         NULL);\n// The above line is shorthand for:\ngpropz_bind_property (MyObject, name, PROP_NAME, properties[PROP_NAME]);\ng_object_class_install_property (object_class, PROP_NAME, properties[PROP_NAME]);\n\n// gpropz_bind_property creates a binding for a given property (PROP_NAME) and attaches it\n// to a member of MyObject (MyObject.name).\n// If you want to attach to a member of a private instance, use\n// gpropz_bind_property_private/gpropz_install_property_private instead.\n```\n\n### Defining getters and setters\n\n```c\n// In the header file, they're declared as normal:\n\nconst char *myobject_get_name(MyObject *object);\n\nint  myobject_get_age(MyObject *object);\nvoid myobject_set_age(MyObject *object,\n                      int       age);\n\n// In the source file however, we don't have to define getters and setters manually,\n// instead we can use the gpropz magic macros:\n\nGPROPZ_DEFINE_RO (const char *, MyObject, my_object, name, properties[PROP_NAME])\nGPROPZ_DEFINE_RW (int, MyObject, my_object, aged, properties[PROP_AGE])\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefi64%2Fgpropz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefi64%2Fgpropz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefi64%2Fgpropz/lists"}