This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch main
in repository ego.

View the commit online.

commit 8a14674aa4b57328a8082341f5b8cf9460e270a1
Author: [email protected] <[email protected]>
AuthorDate: Wed Apr 1 19:19:49 2026 -0600

    feat(ego-gen): add Eolian Part introspection
    
    Add Part wrapper with Name(), Class(), IsBeta() and
    Class.Parts() to introspect widget sub-parts from Eolian.
---
 cmd/ego-gen/eolian.go      | 44 ++++++++++++++++++++++++++++++++++++++++++++
 cmd/ego-gen/eolian_test.go |  6 ++++++
 2 files changed, 50 insertions(+)

diff --git a/cmd/ego-gen/eolian.go b/cmd/ego-gen/eolian.go
index 3e9843c..f9d4db2 100644
--- a/cmd/ego-gen/eolian.go
+++ b/cmd/ego-gen/eolian.go
@@ -23,6 +23,16 @@ static void _ego_iter_free(Eina_Iterator *iter) {
 static void _ego_stringshare_del(Eina_Stringshare *s) {
     eina_stringshare_del(s);
 }
+
+// _ego_part_name_get wraps the static inline eolian_part_name_get for cgo.
+static const char *_ego_part_name_get(const Eolian_Part *part) {
+    return eolian_part_name_get(part);
+}
+
+// _ego_part_is_beta wraps the static inline eolian_part_is_beta for cgo.
+static Eina_Bool _ego_part_is_beta(const Eolian_Part *part) {
+    return eolian_part_is_beta(part);
+}
 */
 import "C"
 
@@ -215,6 +225,16 @@ func (c *Class) Events() []*Event {
 	})
 }
 
+// Parts returns the parts declared by this class (not inherited).
+func (c *Class) Parts() []*Part {
+	return iterCollect(
+		C.eolian_class_parts_get(c.ptr),
+		func(p unsafe.Pointer) *Part {
+			return &Part{ptr: (*C.Eolian_Part)(p)}
+		},
+	)
+}
+
 // Function wraps an Eolian_Function pointer.
 type Function struct {
 	ptr *C.Eolian_Function
@@ -379,6 +399,30 @@ func (td *Typedecl) Name() string {
 	return C.GoString(C.eolian_typedecl_short_name_get(td.ptr))
 }
 
+// Part wraps an Eolian_Part pointer.
+type Part struct {
+	ptr *C.Eolian_Part
+}
+
+// Name returns the part name (e.g., "icon", "text", "first").
+func (p *Part) Name() string {
+	return C.GoString(C._ego_part_name_get(p.ptr))
+}
+
+// Class returns the Eolian class of this part (e.g., Efl.Ui.Layout_Part_Content).
+func (p *Part) Class() *Class {
+	c := C.eolian_part_class_get(p.ptr)
+	if c == nil {
+		return nil
+	}
+	return &Class{ptr: c}
+}
+
+// IsBeta reports whether this part is marked @beta.
+func (p *Part) IsBeta() bool {
+	return C._ego_part_is_beta(p.ptr) != 0
+}
+
 // Constructor wraps an Eolian_Constructor pointer.
 type Constructor struct {
 	ptr *C.Eolian_Constructor
diff --git a/cmd/ego-gen/eolian_test.go b/cmd/ego-gen/eolian_test.go
index 3aba06f..e78d154 100644
--- a/cmd/ego-gen/eolian_test.go
+++ b/cmd/ego-gen/eolian_test.go
@@ -188,6 +188,12 @@ func TestTypedeclFunctionPointerConstants(t *testing.T) {
 	}
 }
 
+func TestEolianPartAPI(t *testing.T) {
+	// Verify the Part type and constants compile.
+	var p *Part
+	_ = p
+}
+
 // TestClassTypes verifies that every parsed class has a type value within the
 // known valid range (i.e. one of the four ClassType constants).
 func TestClassTypes(t *testing.T) {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to