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 353b2c627a0a32b7888b5d45c57cec2bb38792dd
Author: [email protected] <[email protected]>
AuthorDate: Tue Mar 31 20:01:55 2026 -0600
feat(ego-gen): support bool return + struct out-param properties
Handle the pattern where a getter returns Eina_Bool success/fail
while the actual value is a struct out-param. C wrappers return
Eina_Bool, Go methods return (StructType, bool). Unblocks
cursor geometry, scene max size, access text extents. Coverage 94.1%.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
---
cmd/ego-gen/generator.go | 7 +++
cmd/ego-gen/indexed_property.go | 29 +++++++++---
cmd/ego-gen/main.go | 84 ++++++++++++++++++-----------------
cmd/ego-gen/templates/class.go.tmpl | 76 ++++++++++++++++++++++++++++++++
cmd/ego-stats/main.go | 8 ----
efl/access/text.go | 85 ++++++++++++++++++++++++++++++++++++
efl/canvas/scene.go | 48 ++++++++++++++++++++
efl/text_cursor/object.go | 21 +++++++++
efl/ui/textbox.go | 84 +++++++++++++++++++++++++++++++++++
efl/ui/win.go | 47 ++++++++++++++++++++
ego-stats | Bin 2792624 -> 2792456 bytes
11 files changed, 436 insertions(+), 53 deletions(-)
diff --git a/cmd/ego-gen/generator.go b/cmd/ego-gen/generator.go
index 8f065d5..4a563f0 100644
--- a/cmd/ego-gen/generator.go
+++ b/cmd/ego-gen/generator.go
@@ -118,6 +118,10 @@ type PropertyData struct {
StructCFieldTypes []string // e.g. ["int", "int"]
StructCMacro string // e.g. "EINA_RECT" or empty
StructCAccessPrefix string // e.g. ".rect" for Eina_Rect
+ // HasBoolReturn is true when the property getter declares "return: bool" and
+ // passes its actual struct value through a pointer out-param. The generated
+ // getter returns (GoType, bool) instead of GoType.
+ HasBoolReturn bool
// IsMultiValue is true when the property has more than one value parameter.
// The getter returns multiple Go values and the setter takes multiple params.
IsMultiValue bool
@@ -148,6 +152,9 @@ type IndexedPropertyData struct {
CType string
IsEo bool
IsStruct bool
+ // HasBoolReturn is true when the getter declares "return: bool" and passes
+ // the actual struct value through a pointer out-param.
+ HasBoolReturn bool
StructGoType string
StructCType string
StructGoFields []string
diff --git a/cmd/ego-gen/indexed_property.go b/cmd/ego-gen/indexed_property.go
index c073167..8786769 100644
--- a/cmd/ego-gen/indexed_property.go
+++ b/cmd/ego-gen/indexed_property.go
@@ -104,14 +104,30 @@ func buildIndexedPropertyData(f *Function, cPrefix string) (IndexedPropertyData,
// Single-value: determine type from getter return, getter value, or setter value.
var cType, goType string
- var isEo, isStruct bool
+ var isEo, isStruct, hasBoolReturn bool
if rt := f.ReturnType(FunctionPropGet); rt != nil && hasGet {
- cType = rt.CType()
- goType = CTypeToGo(cType)
- isEo = rt.IsClass()
- if IsKnownStruct(cType) {
- isStruct = true
+ retCType := rt.CType()
+ // Bool-return with struct value out-param: the getter returns Eina_Bool
+ // and passes the actual value through a pointer out-param.
+ if IsBoolType(retCType) && len(getVals) == 1 {
+ if pt := getVals[0].Type(); pt != nil {
+ ct := pt.CType()
+ if IsKnownStruct(ct) {
+ isStruct = true
+ hasBoolReturn = true
+ cType = ct
+ goType = CTypeToGo(ct)
+ }
+ }
+ }
+ if !hasBoolReturn {
+ cType = retCType
+ goType = CTypeToGo(cType)
+ isEo = rt.IsClass()
+ if IsKnownStruct(cType) {
+ isStruct = true
+ }
}
} else if len(getVals) == 1 {
if pt := getVals[0].Type(); pt != nil {
@@ -149,6 +165,7 @@ func buildIndexedPropertyData(f *Function, cPrefix string) (IndexedPropertyData,
ipd.CType = cType
ipd.IsEo = isEo
ipd.IsStruct = isStruct
+ ipd.HasBoolReturn = hasBoolReturn
ipd.HasGet = hasGet
ipd.HasSet = hasSet
diff --git a/cmd/ego-gen/main.go b/cmd/ego-gen/main.go
index 85e0efb..8b73db6 100644
--- a/cmd/ego-gen/main.go
+++ b/cmd/ego-gen/main.go
@@ -206,22 +206,6 @@ var methodBlocklist = map[string]bool{
"efl_event_global_freeze_count_get": true,
// efl.Ui.Widget — scrollable_content setter has no C declaration (getter is unblocked)
"efl_ui_widget_scrollable_content_did_group_calc_set": true,
- // efl.Access.Text — character_extents_get/range_extents_get have both a bool
- // return AND an Eina_Rect out-param (property "values" section). The indexed
- // property generator only handles the return type and ignores extra value
- // out-params, producing a call with too few arguments.
- "efl_access_text_character_extents_get": true,
- "efl_access_text_range_extents_get": true,
- // efl.Text_Cursor.Object — lower_cursor_geometry_get has a bool return AND an
- // Eina_Rect out-param (property "values" section). The property generator only
- // uses the return type, producing a call with too few arguments.
- "efl_text_cursor_object_lower_cursor_geometry_get": true,
- // efl.Canvas.Scene — image_max_size_get has a bool return AND an Eina_Size2D
- // out-param (property "values" section). Generator only uses the return type.
- "efl_canvas_scene_image_max_size_get": true,
- // efl.Canvas.Scene — pointer_position_get (indexed property) has a bool return
- // AND an Eina_Position2D out-param; same issue.
- "efl_canvas_scene_pointer_position_get": true,
// efl.Gfx.Buffer — managed_get returns Eina_Slice (struct by value). The
// generator maps Eina_Slice returns to unsafe.Pointer which cgo cannot convert
// from an aggregate type. Block until slice-return support is added.
@@ -1165,19 +1149,40 @@ func buildPropertyData(f *Function, cPrefix string) (PropertyData, error) {
var isEo bool
var isStruct bool
var isSlice bool
+ var hasBoolReturn bool
if rt := f.ReturnType(FunctionPropGet); rt != nil {
- cType = rt.CType()
- goType = CTypeToGo(cType)
- isEo = rt.IsClass()
- if si := GetStructInfo(cType); si != nil && !si.IsSlice {
- isStruct = true
- } else if si != nil && si.IsSlice {
- // Eina_Slice / Eina_Rw_Slice: the property getter returns a slice
- // struct whose fields include "const void *", which cannot be used
- // as a cgo variable type. Disable the getter; mark as slice setter.
- hasGet = false
- isSlice = true
- goType = si.GoType
+ retCType := rt.CType()
+ // Bool-return with struct value out-param: the getter returns Eina_Bool
+ // and passes the actual value through a pointer out-param. Detect this by
+ // checking whether the return type is bool and there is exactly one getter
+ // value parameter that is a known struct.
+ if IsBoolType(retCType) {
+ if getVals := f.PropertyValues(FunctionPropGet); len(getVals) == 1 {
+ if pt := getVals[0].Type(); pt != nil {
+ ct := pt.CType()
+ if si := GetStructInfo(ct); si != nil && !si.IsSlice {
+ isStruct = true
+ hasBoolReturn = true
+ cType = ct
+ goType = CTypeToGo(ct)
+ }
+ }
+ }
+ }
+ if !hasBoolReturn {
+ cType = retCType
+ goType = CTypeToGo(cType)
+ isEo = rt.IsClass()
+ if si := GetStructInfo(cType); si != nil && !si.IsSlice {
+ isStruct = true
+ } else if si != nil && si.IsSlice {
+ // Eina_Slice / Eina_Rw_Slice: the property getter returns a slice
+ // struct whose fields include "const void *", which cannot be used
+ // as a cgo variable type. Disable the getter; mark as slice setter.
+ hasGet = false
+ isSlice = true
+ goType = si.GoType
+ }
}
} else if getVals := f.PropertyValues(FunctionPropGet); len(getVals) == 1 {
// Single getter value parameter — the C getter returns this type
@@ -1236,17 +1241,18 @@ func buildPropertyData(f *Function, cPrefix string) (PropertyData, error) {
}
pd := PropertyData{
- GoGetter: goGetter,
- GoSetter: goSetter,
- CGetName: cGetName,
- CSetName: cSetName,
- GoType: goType,
- CType: cType,
- HasGet: hasGet,
- HasSet: hasSet,
- IsEo: isEo,
- IsStruct: isStruct,
- IsSlice: isSlice,
+ GoGetter: goGetter,
+ GoSetter: goSetter,
+ CGetName: cGetName,
+ CSetName: cSetName,
+ GoType: goType,
+ CType: cType,
+ HasGet: hasGet,
+ HasSet: hasSet,
+ IsEo: isEo,
+ IsStruct: isStruct,
+ IsSlice: isSlice,
+ HasBoolReturn: hasBoolReturn,
}
if isStruct || isSlice {
diff --git a/cmd/ego-gen/templates/class.go.tmpl b/cmd/ego-gen/templates/class.go.tmpl
index 0d55fbb..996e433 100644
--- a/cmd/ego-gen/templates/class.go.tmpl
+++ b/cmd/ego-gen/templates/class.go.tmpl
@@ -156,6 +156,18 @@ static void _ego_set_{{.CSetName}}(Eo *obj, void *val) {
{{- range $prop := .Properties}}
{{- if $prop.IsStruct}}
{{- if $prop.HasGet}}
+{{- if $prop.HasBoolReturn}}
+// _ego_get_struct_{{$prop.CGetName}} wraps the getter, decomposing the out-param struct
+// into individual pointer arguments and returning the Eina_Bool status.
+static Eina_Bool _ego_get_struct_{{$prop.CGetName}}(const Eo *obj{{range $i, $f := $prop.StructCFields}}, {{index $prop.StructCFieldTypes $i}} *out_{{$f}}{{end}}) {
+ {{$prop.StructCType}} _r = {0};
+ Eina_Bool _ok = {{$prop.CGetName}}(obj, &_r);
+{{- range $i, $f := $prop.StructCFields}}
+ *out_{{$f}} = _r{{$prop.StructCAccessPrefix}}.{{$f}};
+{{- end}}
+ return _ok;
+}
+{{- else}}
// _ego_get_struct_{{$prop.CGetName}} wraps the getter, decomposing the returned
// struct into individual out-params for safe cgo consumption.
static void _ego_get_struct_{{$prop.CGetName}}(const Eo *obj{{range $i, $f := $prop.StructCFields}}, {{index $prop.StructCFieldTypes $i}} *out_{{$f}}{{end}}) {
@@ -165,6 +177,7 @@ static void _ego_get_struct_{{$prop.CGetName}}(const Eo *obj{{range $i, $f := $p
{{- end}}
}
{{- end}}
+{{- end}}
{{- if $prop.HasSet}}
// _ego_set_struct_{{$prop.CSetName}} wraps the setter, constructing the struct
// from individual field parameters.
@@ -224,6 +237,18 @@ static void _ego_set_struct_ip_{{$ip.CSetName}}(Eo *obj{{range $ip.Keys}}, {{if
}
{{- end}}
{{- if and $ip.IsStruct $ip.HasGet}}
+{{- if $ip.HasBoolReturn}}
+// _ego_get_struct_ip_{{$ip.CGetName}} wraps the indexed property getter, decomposing
+// the out-param struct into individual pointer arguments and returning the Eina_Bool status.
+static Eina_Bool _ego_get_struct_ip_{{$ip.CGetName}}(const Eo *obj{{range $ip.Keys}}, {{if needsStringConversion .CType}}const char *{{else if isBoolType .CType}}Eina_Bool{{else if isEnumTypedefKey .CType}}{{cTypeToCgo .CType}}{{else if .IsEo}}const Eo *{{else if isPointerType .GoType}}void *{{else}}{{.CType}}{{end}} {{.GoName}}{{end}}{{range $i, $f := $ip.StructCFields}}, {{index $ip.StructCFieldTypes $i}} *out_{{$f}}{{end}}) {
+ {{$ip.StructCType}} _r = {0};
+ Eina_Bool _ok = {{$ip.CGetName}}(obj{{range $ip.Keys}}, {{.GoName}}{{end}}, &_r);
+{{- range $i, $f := $ip.StructCFields}}
+ *out_{{$f}} = _r{{$ip.StructCAccessPrefix}}.{{$f}};
+{{- end}}
+ return _ok;
+}
+{{- else}}
// _ego_get_struct_ip_{{$ip.CGetName}} wraps the indexed property getter, decomposing
// the returned struct into individual out-params, with key parameters passed through.
static void _ego_get_struct_ip_{{$ip.CGetName}}(const Eo *obj{{range $ip.Keys}}, {{if needsStringConversion .CType}}const char *{{else if isBoolType .CType}}Eina_Bool{{else if isEnumTypedefKey .CType}}{{cTypeToCgo .CType}}{{else if .IsEo}}const Eo *{{else if isPointerType .GoType}}void *{{else}}{{.CType}}{{end}} {{.GoName}}{{end}}{{range $i, $f := $ip.StructCFields}}, {{index $ip.StructCFieldTypes $i}} *out_{{$f}}{{end}}) {
@@ -234,11 +259,22 @@ static void _ego_get_struct_ip_{{$ip.CGetName}}(const Eo *obj{{range $ip.Keys}},
}
{{- end}}
{{- end}}
+{{- end}}
{{- range $m := .Methods}}
{{- range $op := $m.OutParams}}
{{- if $op.IsStruct}}
// _ego_outparam_{{$m.CName}} wraps the method, decomposing the out-param struct
// into individual pointer arguments for safe cgo consumption.
+{{- if isBoolType $m.ReturnCType}}
+static Eina_Bool _ego_outparam_{{$m.CName}}(const Eo *obj{{range $i, $p := $m.Params}}, {{if needsStringConversion $p.CType}}const char *{{else if isBoolType $p.CType}}Eina_Bool{{else if $p.IsEo}}Eo *{{else if isPointerType $p.GoType}}void *{{else}}{{$p.CType}}{{end}} {{$p.GoName}}{{end}}{{range $i, $f := $op.StructInfo.CFields}}, {{index $op.StructInfo.CFieldTypes $i}} *out_{{$f}}{{end}}) {
+ {{$op.CType}} _r = {0};
+ Eina_Bool _ok = {{$m.CName}}(obj{{range $m.Params}}, {{.GoName}}{{end}}, &_r);
+{{- range $i, $f := $op.StructInfo.CFields}}
+ *out_{{$f}} = _r{{$op.StructInfo.CAccessPrefix}}.{{$f}};
+{{- end}}
+ return _ok;
+}
+{{- else}}
static void _ego_outparam_{{$m.CName}}(Eo *obj{{range $i, $p := $m.Params}}, {{if needsStringConversion $p.CType}}const char *{{else if isBoolType $p.CType}}Eina_Bool{{else if $p.IsEo}}Eo *{{else if isPointerType $p.GoType}}void *{{else}}{{$p.CType}}{{end}} {{$p.GoName}}{{end}}{{range $i, $f := $op.StructInfo.CFields}}, {{index $op.StructInfo.CFieldTypes $i}} *out_{{$f}}{{end}}) {
{{- if $m.ReturnCType}} {{$op.CType}} _r = {{$m.CName}}(obj{{range $m.Params}}, {{.GoName}}{{end}});
{{- else}} {{$op.CType}} _r = {0};
@@ -249,6 +285,7 @@ static void _ego_outparam_{{$m.CName}}(Eo *obj{{range $i, $p := $m.Params}}, {{i
{{- end}}
}
{{- end}}
+{{- end}}
{{- if $op.IsSlice}}
// _ego_outparam_{{$m.CName}} wraps the method, decomposing the slice out-param
// into mem and len pointer arguments for safe cgo consumption.
@@ -430,17 +467,30 @@ func (o *{{$.GoName}}) {{$prop.GoGetter}}() ({{range $i, $v := $prop.MultiGetVal
}
{{- else}}
// {{$prop.GoGetter}} returns the {{$prop.GoGetter}} property of the {{$.GoName}}.
+{{- if and $prop.IsStruct $prop.HasBoolReturn}}
+func (o *{{$.GoName}}) {{$prop.GoGetter}}() ({{$prop.StructGoType}}, bool) {
+{{- else}}
func (o *{{$.GoName}}) {{$prop.GoGetter}}() {{$prop.GoType}} {
+{{- end}}
{{- if $prop.IsStruct}}
{{- range $i, $f := $prop.StructCFields}}
var c{{$f}} C.{{index $prop.StructCFieldTypes $i}}
{{- end}}
+{{- if $prop.HasBoolReturn}}
+ _ok := C._ego_get_struct_{{$prop.CGetName}}((*C.Eo)(o.Eo()){{range $prop.StructCFields}}, &c{{.}}{{end}})
+{{- if eq $prop.StructGoType "image.Rectangle"}}
+ return image.Rect(int(cx), int(cy), int(cx)+int(cw), int(cy)+int(ch)), _ok != 0
+{{- else}}
+ return {{$prop.StructGoType}}{ {{- range $i, $gf := $prop.StructGoFields}}{{if $i}}, {{end}}{{$gf}}: {{if eq (index $prop.StructCFieldTypes $i) "double"}}float64{{else}}int{{end}}(c{{index $prop.StructCFields $i}}){{end -}} }, _ok != 0
+{{- end}}
+{{- else}}
C._ego_get_struct_{{$prop.CGetName}}((*C.Eo)(o.Eo()){{range $prop.StructCFields}}, &c{{.}}{{end}})
{{- if eq $prop.StructGoType "image.Rectangle"}}
return image.Rect(int(cx), int(cy), int(cx)+int(cw), int(cy)+int(ch))
{{- else}}
return {{$prop.StructGoType}}{ {{- range $i, $gf := $prop.StructGoFields}}{{if $i}}, {{end}}{{$gf}}: {{if eq (index $prop.StructCFieldTypes $i) "double"}}float64{{else}}int{{end}}(c{{index $prop.StructCFields $i}}){{end -}} }
{{- end}}
+{{- end}}
{{- else if needsStringConversion $prop.CType}}
cResult := C.{{$prop.CGetName}}((*C.Eo)(o.Eo()))
return C.GoString(cResult)
@@ -624,7 +674,11 @@ func (o *{{$.GoName}}) {{$m.GoName}}({{range $i, $p := $m.Params}}{{if $i}}, {{e
{{- if $op.IsStruct}}
// {{$m.GoName}} calls the {{$m.CName}} method on {{$.GoName}}.
+{{- if isBoolType $m.ReturnCType}}
+func (o *{{$.GoName}}) {{$m.GoName}}({{range $i, $p := $m.Params}}{{if $i}}, {{end}}{{$p.GoName}} {{if $p.IsEo}}efl.Objecter{{else}}{{$p.GoType}}{{end}}{{end}}) ({{$op.GoType}}, bool) {
+{{- else}}
func (o *{{$.GoName}}) {{$m.GoName}}({{range $i, $p := $m.Params}}{{if $i}}, {{end}}{{$p.GoName}} {{if $p.IsEo}}efl.Objecter{{else}}{{$p.GoType}}{{end}}{{end}}) {{$op.GoType}} {
+{{- end}}
{{- range $m.Params}}
{{- if needsStringConversion .CType}}
c{{.GoName}} := C.CString({{.GoName}})
@@ -637,12 +691,21 @@ func (o *{{$.GoName}}) {{$m.GoName}}({{range $i, $p := $m.Params}}{{if $i}}, {{e
{{- range $i, $f := $op.StructInfo.CFields}}
var c{{$f}} C.{{index $op.StructInfo.CFieldTypes $i}}
{{- end}}
+{{- if isBoolType $m.ReturnCType}}
+ _ok := C._ego_outparam_{{$m.CName}}((*C.Eo)(o.Eo()){{range $m.Params}}, {{template "paramArg" .}}{{end}}{{range $op.StructInfo.CFields}}, &c{{.}}{{end}})
+{{- if eq $op.GoType "image.Rectangle"}}
+ return image.Rect(int(cx), int(cy), int(cx)+int(cw), int(cy)+int(ch)), _ok != 0
+{{- else}}
+ return {{$op.GoType}}{ {{- range $i, $gf := $op.StructInfo.GoFields}}{{if $i}}, {{end}}{{$gf}}: {{if eq (index $op.StructInfo.CFieldTypes $i) "double"}}float64{{else}}int{{end}}(c{{index $op.StructInfo.CFields $i}}){{end -}} }, _ok != 0
+{{- end}}
+{{- else}}
C._ego_outparam_{{$m.CName}}((*C.Eo)(o.Eo()){{range $m.Params}}, {{template "paramArg" .}}{{end}}{{range $op.StructInfo.CFields}}, &c{{.}}{{end}})
{{- if eq $op.GoType "image.Rectangle"}}
return image.Rect(int(cx), int(cy), int(cx)+int(cw), int(cy)+int(ch))
{{- else}}
return {{$op.GoType}}{ {{- range $i, $gf := $op.StructInfo.GoFields}}{{if $i}}, {{end}}{{$gf}}: {{if eq (index $op.StructInfo.CFieldTypes $i) "double"}}float64{{else}}int{{end}}(c{{index $op.StructInfo.CFields $i}}){{end -}} }
{{- end}}
+{{- end}}
}
{{- end}}
{{- if $op.IsSlice}}
@@ -760,7 +823,11 @@ func (p {{$ip.AccessorTypeName}}) Get() ({{range $i, $v := $ip.MultiGetValues}}{
}
{{- else}}
// Get returns the value for the captured key(s).
+{{- if and $ip.IsStruct $ip.HasBoolReturn}}
+func (p {{$ip.AccessorTypeName}}) Get() ({{$ip.StructGoType}}, bool) {
+{{- else}}
func (p {{$ip.AccessorTypeName}}) Get() {{if $ip.IsStruct}}{{$ip.StructGoType}}{{else if $ip.IsEo}}unsafe.Pointer{{else}}{{$ip.GoType}}{{end}} {
+{{- end}}
{{- range $ip.Keys}}
{{- if needsStringConversion .CType}}
c{{.GoName}} := C.CString(p.{{.GoName}})
@@ -771,12 +838,21 @@ func (p {{$ip.AccessorTypeName}}) Get() {{if $ip.IsStruct}}{{$ip.StructGoType}}{
{{- range $i, $f := $ip.StructCFields}}
var c{{$f}} C.{{index $ip.StructCFieldTypes $i}}
{{- end}}
+{{- if $ip.HasBoolReturn}}
+ _ok := C._ego_get_struct_ip_{{$ip.CGetName}}(p.obj{{range $ip.Keys}}, {{template "indexedKeyArg" .}}{{end}}{{range $ip.StructCFields}}, &c{{.}}{{end}})
+{{- if eq $ip.StructGoType "image.Rectangle"}}
+ return image.Rect(int(cx), int(cy), int(cx)+int(cw), int(cy)+int(ch)), _ok != 0
+{{- else}}
+ return {{$ip.StructGoType}}{ {{- range $i, $gf := $ip.StructGoFields}}{{if $i}}, {{end}}{{$gf}}: {{if eq (index $ip.StructCFieldTypes $i) "double"}}float64{{else}}int{{end}}(c{{index $ip.StructCFields $i}}){{end -}} }, _ok != 0
+{{- end}}
+{{- else}}
C._ego_get_struct_ip_{{$ip.CGetName}}(p.obj{{range $ip.Keys}}, {{template "indexedKeyArg" .}}{{end}}{{range $ip.StructCFields}}, &c{{.}}{{end}})
{{- if eq $ip.StructGoType "image.Rectangle"}}
return image.Rect(int(cx), int(cy), int(cx)+int(cw), int(cy)+int(ch))
{{- else}}
return {{$ip.StructGoType}}{ {{- range $i, $gf := $ip.StructGoFields}}{{if $i}}, {{end}}{{$gf}}: {{if eq (index $ip.StructCFieldTypes $i) "double"}}float64{{else}}int{{end}}(c{{index $ip.StructCFields $i}}){{end -}} }
{{- end}}
+{{- end}}
{{- else if needsStringConversion $ip.CType}}
cResult := C.{{$ip.CGetName}}(p.obj{{range $ip.Keys}}, {{template "indexedKeyArg" .}}{{end}})
return C.GoString(cResult)
diff --git a/cmd/ego-stats/main.go b/cmd/ego-stats/main.go
index aff8a07..2ff3b59 100644
--- a/cmd/ego-stats/main.go
+++ b/cmd/ego-stats/main.go
@@ -53,9 +53,6 @@ var methodBlocklistAnnotated = []blockedEntry{
{"efl_access_object_event_handler_add", ReasonNotInHeader},
{"efl_access_object_event_handler_del", ReasonNotInHeader},
{"efl_access_object_access_root_get", ReasonGlobalFunction},
- // efl.Access.Text — character_extents_get/range_extents_get take an extra Eina_Rect* out-param
- {"efl_access_text_character_extents_get", ReasonOutParamStruct},
- {"efl_access_text_range_extents_get", ReasonOutParamStruct},
// efl.Canvas.FilterInternal — state_prepare takes Efl_Canvas_Filter_State* extra out-param
// not reflected in Eolian; generator produces wrong argument count.
{"evas_filter_state_prepare", ReasonWrongArgCount},
@@ -65,9 +62,6 @@ var methodBlocklistAnnotated = []blockedEntry{
{"evas_filter_output_buffer_get", ReasonNotInHeader},
// efl.Canvas.GestureRecognizer — returns enum (not pointer) through pointer path
{"efl_gesture_recognizer_recognize", ReasonWrongArgCount},
- // efl.Canvas.Scene — out-param or struct issues
- {"efl_canvas_scene_image_max_size_get", ReasonOutParamStruct},
- {"efl_canvas_scene_pointer_position_get", ReasonOutParamStruct},
// efl.App — global
{"efl_app_main_get", ReasonGlobalFunction},
// efl.File — load returns Eina_Error; mmap setter takes opaque Eina_File; save takes struct param
@@ -159,8 +153,6 @@ var methodBlocklistAnnotated = []blockedEntry{
// efl.Ui.Widget — focus_state_apply takes struct by value; theme_apply returns Eina_Error
{"efl_ui_widget_focus_state_apply", ReasonStructByValue},
{"efl_ui_widget_theme_apply", ReasonEinaError},
- // efl.Text_Cursor.Object — lower_cursor_geometry_get has a bool return AND an Eina_Rect out-param
- {"efl_text_cursor_object_lower_cursor_geometry_get", ReasonOutParamStruct},
// efl.Ui.Widget.ScrollableContent — setter has no C declaration (getter is unblocked)
{"efl_ui_widget_scrollable_content_did_group_calc_set", ReasonProtectedAPI},
// efl.Ui.Win — global property
diff --git a/efl/access/text.go b/efl/access/text.go
index f9ab05c..bb79a4d 100644
--- a/efl/access/text.go
+++ b/efl/access/text.go
@@ -97,6 +97,28 @@ extern const Efl_Class *efl_access_text_interface_get(void);
static void *_ego_get_efl_access_text_default_attributes_get(const Eo *obj) {
return (void *)(uintptr_t)efl_access_text_default_attributes_get(obj);
}
+// _ego_get_struct_ip_efl_access_text_character_extents_get wraps the indexed property getter, decomposing
+// the out-param struct into individual pointer arguments and returning the Eina_Bool status.
+static Eina_Bool _ego_get_struct_ip_efl_access_text_character_extents_get(const Eo *obj, int offset, Eina_Bool screenCoords, int *out_x, int *out_y, int *out_w, int *out_h) {
+ Eina_Rect _r = {0};
+ Eina_Bool _ok = efl_access_text_character_extents_get(obj, offset, screenCoords, &_r);
+ *out_x = _r.rect.x;
+ *out_y = _r.rect.y;
+ *out_w = _r.rect.w;
+ *out_h = _r.rect.h;
+ return _ok;
+}
+// _ego_get_struct_ip_efl_access_text_range_extents_get wraps the indexed property getter, decomposing
+// the out-param struct into individual pointer arguments and returning the Eina_Bool status.
+static Eina_Bool _ego_get_struct_ip_efl_access_text_range_extents_get(const Eo *obj, Eina_Bool screenCoords, int startOffset, int endOffset, int *out_x, int *out_y, int *out_w, int *out_h) {
+ Eina_Rect _r = {0};
+ Eina_Bool _ok = efl_access_text_range_extents_get(obj, screenCoords, startOffset, endOffset, &_r);
+ *out_x = _r.rect.x;
+ *out_y = _r.rect.y;
+ *out_w = _r.rect.w;
+ *out_h = _r.rect.h;
+ return _ok;
+}
// _ego_ev_EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED returns the event description pointer using the EFL
// macro, avoiding a conflicting extern declaration for the symbol name.
static const Efl_Event_Description *_ego_ev_EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED(void) {
@@ -121,6 +143,7 @@ static const Efl_Event_Description *_ego_ev_EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_SE
import "C"
import (
+ "image"
"unsafe"
"git.enlightenment.org/cedric/ego/efl"
@@ -262,6 +285,36 @@ func (p textAttributeProperty) Get() (startOffset int, endOffset int, value stri
return int(cStartOffset), int(cEndOffset), C.GoString(cValue)
}
+type textCharacterExtentsProperty struct {
+ obj *C.Eo
+ offset int
+ screenCoords bool
+}
+
+// CharacterExtents returns an accessor for the CharacterExtents indexed property.
+func (o *Text) CharacterExtents(offset int, screenCoords bool) textCharacterExtentsProperty {
+ return textCharacterExtentsProperty{
+ obj: (*C.Eo)(o.Eo()),
+ offset: offset,
+ screenCoords: screenCoords,
+ }
+}
+
+// Get returns the value for the captured key(s).
+func (p textCharacterExtentsProperty) Get() (image.Rectangle, bool) {
+ var cx C.int
+ var cy C.int
+ var cw C.int
+ var ch C.int
+ _ok := C._ego_get_struct_ip_efl_access_text_character_extents_get(p.obj, C.int(p.offset), func() C.Eina_Bool {
+ if p.screenCoords {
+ return 1
+ }
+ return 0
+ }(), &cx, &cy, &cw, &ch)
+ return image.Rect(int(cx), int(cy), int(cx)+int(cw), int(cy)+int(ch)), _ok != 0
+}
+
type textOffsetAtPointProperty struct {
obj *C.Eo
screenCoords bool
@@ -289,6 +342,38 @@ func (p textOffsetAtPointProperty) Get() int {
}(), C.int(p.x), C.int(p.y)))
}
+type textRangeExtentsProperty struct {
+ obj *C.Eo
+ screenCoords bool
+ startOffset int
+ endOffset int
+}
+
+// RangeExtents returns an accessor for the RangeExtents indexed property.
+func (o *Text) RangeExtents(screenCoords bool, startOffset int, endOffset int) textRangeExtentsProperty {
+ return textRangeExtentsProperty{
+ obj: (*C.Eo)(o.Eo()),
+ screenCoords: screenCoords,
+ startOffset: startOffset,
+ endOffset: endOffset,
+ }
+}
+
+// Get returns the value for the captured key(s).
+func (p textRangeExtentsProperty) Get() (image.Rectangle, bool) {
+ var cx C.int
+ var cy C.int
+ var cw C.int
+ var ch C.int
+ _ok := C._ego_get_struct_ip_efl_access_text_range_extents_get(p.obj, func() C.Eina_Bool {
+ if p.screenCoords {
+ return 1
+ }
+ return 0
+ }(), C.int(p.startOffset), C.int(p.endOffset), &cx, &cy, &cw, &ch)
+ return image.Rect(int(cx), int(cy), int(cx)+int(cw), int(cy)+int(ch)), _ok != 0
+}
+
type textAccessSelectionProperty struct {
obj *C.Eo
selectionNumber int
diff --git a/efl/canvas/scene.go b/efl/canvas/scene.go
index 08cec42..5034755 100644
--- a/efl/canvas/scene.go
+++ b/efl/canvas/scene.go
@@ -105,6 +105,24 @@ static void _ego_iter_free(Eina_Iterator *iter) {
static void *_ego_get_efl_canvas_scene_seat_default_get(const Eo *obj) {
return (void *)(uintptr_t)efl_canvas_scene_seat_default_get(obj);
}
+// _ego_get_struct_efl_canvas_scene_image_max_size_get wraps the getter, decomposing the out-param struct
+// into individual pointer arguments and returning the Eina_Bool status.
+static Eina_Bool _ego_get_struct_efl_canvas_scene_image_max_size_get(const Eo *obj, int *out_w, int *out_h) {
+ Eina_Size2D _r = {0};
+ Eina_Bool _ok = efl_canvas_scene_image_max_size_get(obj, &_r);
+ *out_w = _r.w;
+ *out_h = _r.h;
+ return _ok;
+}
+// _ego_get_struct_ip_efl_canvas_scene_pointer_position_get wraps the indexed property getter, decomposing
+// the out-param struct into individual pointer arguments and returning the Eina_Bool status.
+static Eina_Bool _ego_get_struct_ip_efl_canvas_scene_pointer_position_get(const Eo *obj, const Eo * seat, int *out_x, int *out_y) {
+ Eina_Position2D _r = {0};
+ Eina_Bool _ok = efl_canvas_scene_pointer_position_get(obj, seat, &_r);
+ *out_x = _r.x;
+ *out_y = _r.y;
+ return _ok;
+}
// _ego_ev_EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_IN returns the event description pointer using the EFL
// macro, avoiding a conflicting extern declaration for the symbol name.
static const Efl_Event_Description *_ego_ev_EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_IN(void) {
@@ -154,6 +172,7 @@ static const Efl_Event_Description *_ego_ev_EFL_CANVAS_SCENE_EVENT_DEVICE_REMOVE
import "C"
import (
+ "image"
"iter"
"unsafe"
@@ -176,6 +195,14 @@ func wrapScene(ptr unsafe.Pointer) *Scene {
return o
}
+// ImageMaxSize returns the ImageMaxSize property of the Scene.
+func (o *Scene) ImageMaxSize() (efl.Size2D, bool) {
+ var cw C.int
+ var ch C.int
+ _ok := C._ego_get_struct_efl_canvas_scene_image_max_size_get((*C.Eo)(o.Eo()), &cw, &ch)
+ return efl.Size2D{W: int(cw), H: int(ch)}, _ok != 0
+}
+
// GroupObjectsCalculating returns the GroupObjectsCalculating property of the Scene.
func (o *Scene) GroupObjectsCalculating() bool {
return C.efl_canvas_scene_group_objects_calculating_get((*C.Eo)(o.Eo())) != 0
@@ -255,6 +282,27 @@ func (p sceneSeatProperty) Get() unsafe.Pointer {
return unsafe.Pointer(C.efl_canvas_scene_seat_get(p.obj, C.int(p.id)))
}
+type scenePointerPositionProperty struct {
+ obj *C.Eo
+ seat efl.Objecter
+}
+
+// PointerPosition returns an accessor for the PointerPosition indexed property.
+func (o *Scene) PointerPosition(seat efl.Objecter) scenePointerPositionProperty {
+ return scenePointerPositionProperty{
+ obj: (*C.Eo)(o.Eo()),
+ seat: seat,
+ }
+}
+
+// Get returns the value for the captured key(s).
+func (p scenePointerPositionProperty) Get() (image.Point, bool) {
+ var cx C.int
+ var cy C.int
+ _ok := C._ego_get_struct_ip_efl_canvas_scene_pointer_position_get(p.obj, (*C.Eo)(p.seat.Eo()), &cx, &cy)
+ return image.Point{X: int(cx), Y: int(cy)}, _ok != 0
+}
+
// OnSceneFocusIn registers fn as a callback for the EFL_CANVAS_SCENE_EVENT_SCENE_FOCUS_IN event on Scene.
func (o *Scene) OnSceneFocusIn(fn func()) efl.Handle {
return efl.RegisterCallback(o.Eo(),
diff --git a/efl/text_cursor/object.go b/efl/text_cursor/object.go
index 311b0a0..6f13d69 100644
--- a/efl/text_cursor/object.go
+++ b/efl/text_cursor/object.go
@@ -135,6 +135,17 @@ static void _ego_get_struct_efl_text_cursor_object_content_geometry_get(const Eo
*out_w = _r.rect.w;
*out_h = _r.rect.h;
}
+// _ego_get_struct_efl_text_cursor_object_lower_cursor_geometry_get wraps the getter, decomposing the out-param struct
+// into individual pointer arguments and returning the Eina_Bool status.
+static Eina_Bool _ego_get_struct_efl_text_cursor_object_lower_cursor_geometry_get(const Eo *obj, int *out_x, int *out_y, int *out_w, int *out_h) {
+ Eina_Rect _r = {0};
+ Eina_Bool _ok = efl_text_cursor_object_lower_cursor_geometry_get(obj, &_r);
+ *out_x = _r.rect.x;
+ *out_y = _r.rect.y;
+ *out_w = _r.rect.w;
+ *out_h = _r.rect.h;
+ return _ok;
+}
// _ego_get_struct_ip_efl_text_cursor_object_cursor_geometry_get wraps the indexed property getter, decomposing
// the returned struct into individual out-params, with key parameters passed through.
static void _ego_get_struct_ip_efl_text_cursor_object_cursor_geometry_get(const Eo *obj, Efl_Text_Cursor_Type ctype, int *out_x, int *out_y, int *out_w, int *out_h) {
@@ -212,6 +223,16 @@ func (o *Object) SetLineNumber(val int) {
C.efl_text_cursor_object_line_number_set((*C.Eo)(o.Eo()), C.int(val))
}
+// LowerCursorGeometry returns the LowerCursorGeometry property of the Object.
+func (o *Object) LowerCursorGeometry() (image.Rectangle, bool) {
+ var cx C.int
+ var cy C.int
+ var cw C.int
+ var ch C.int
+ _ok := C._ego_get_struct_efl_text_cursor_object_lower_cursor_geometry_get((*C.Eo)(o.Eo()), &cx, &cy, &cw, &ch)
+ return image.Rect(int(cx), int(cy), int(cx)+int(cw), int(cy)+int(ch)), _ok != 0
+}
+
// TextObject returns the TextObject property of the Object.
func (o *Object) TextObject() unsafe.Pointer {
return unsafe.Pointer(C._ego_get_efl_text_cursor_object_text_object_get((*C.Eo)(o.Eo())))
diff --git a/efl/ui/textbox.go b/efl/ui/textbox.go
index f9fdd4c..9ad3a26 100644
--- a/efl/ui/textbox.go
+++ b/efl/ui/textbox.go
@@ -454,6 +454,28 @@ static void _ego_set_struct_efl_ui_scrollable_step_size_set(Eo *obj, int x, int
static void _ego_set_struct_efl_input_text_input_panel_imdata_set(Eo *obj, const void * mem, size_t len) {
efl_input_text_input_panel_imdata_set(obj, (Eina_Slice){ .len = len, .mem = mem });
}
+// _ego_get_struct_ip_efl_access_text_character_extents_get wraps the indexed property getter, decomposing
+// the out-param struct into individual pointer arguments and returning the Eina_Bool status.
+static Eina_Bool _ego_get_struct_ip_efl_access_text_character_extents_get(const Eo *obj, int offset, Eina_Bool screenCoords, int *out_x, int *out_y, int *out_w, int *out_h) {
+ Eina_Rect _r = {0};
+ Eina_Bool _ok = efl_access_text_character_extents_get(obj, offset, screenCoords, &_r);
+ *out_x = _r.rect.x;
+ *out_y = _r.rect.y;
+ *out_w = _r.rect.w;
+ *out_h = _r.rect.h;
+ return _ok;
+}
+// _ego_get_struct_ip_efl_access_text_range_extents_get wraps the indexed property getter, decomposing
+// the out-param struct into individual pointer arguments and returning the Eina_Bool status.
+static Eina_Bool _ego_get_struct_ip_efl_access_text_range_extents_get(const Eo *obj, Eina_Bool screenCoords, int startOffset, int endOffset, int *out_x, int *out_y, int *out_w, int *out_h) {
+ Eina_Rect _r = {0};
+ Eina_Bool _ok = efl_access_text_range_extents_get(obj, screenCoords, startOffset, endOffset, &_r);
+ *out_x = _r.rect.x;
+ *out_y = _r.rect.y;
+ *out_w = _r.rect.w;
+ *out_h = _r.rect.h;
+ return _ok;
+}
// _ego_ev_EFL_UI_TEXTBOX_EVENT_SELECTION_PASTE returns the event description pointer using the EFL
// macro, avoiding a conflicting extern declaration for the symbol name.
static const Efl_Event_Description *_ego_ev_EFL_UI_TEXTBOX_EVENT_SELECTION_PASTE(void) {
@@ -1794,6 +1816,36 @@ func (p textboxAttributeProperty) Get() (startOffset int, endOffset int, value s
return int(cStartOffset), int(cEndOffset), C.GoString(cValue)
}
+type textboxCharacterExtentsProperty struct {
+ obj *C.Eo
+ offset int
+ screenCoords bool
+}
+
+// CharacterExtents returns an accessor for the CharacterExtents indexed property.
+func (o *Textbox) CharacterExtents(offset int, screenCoords bool) textboxCharacterExtentsProperty {
+ return textboxCharacterExtentsProperty{
+ obj: (*C.Eo)(o.Eo()),
+ offset: offset,
+ screenCoords: screenCoords,
+ }
+}
+
+// Get returns the value for the captured key(s).
+func (p textboxCharacterExtentsProperty) Get() (image.Rectangle, bool) {
+ var cx C.int
+ var cy C.int
+ var cw C.int
+ var ch C.int
+ _ok := C._ego_get_struct_ip_efl_access_text_character_extents_get(p.obj, C.int(p.offset), func() C.Eina_Bool {
+ if p.screenCoords {
+ return 1
+ }
+ return 0
+ }(), &cx, &cy, &cw, &ch)
+ return image.Rect(int(cx), int(cy), int(cx)+int(cw), int(cy)+int(ch)), _ok != 0
+}
+
type textboxOffsetAtPointProperty struct {
obj *C.Eo
screenCoords bool
@@ -1821,6 +1873,38 @@ func (p textboxOffsetAtPointProperty) Get() int {
}(), C.int(p.x), C.int(p.y)))
}
+type textboxRangeExtentsProperty struct {
+ obj *C.Eo
+ screenCoords bool
+ startOffset int
+ endOffset int
+}
+
+// RangeExtents returns an accessor for the RangeExtents indexed property.
+func (o *Textbox) RangeExtents(screenCoords bool, startOffset int, endOffset int) textboxRangeExtentsProperty {
+ return textboxRangeExtentsProperty{
+ obj: (*C.Eo)(o.Eo()),
+ screenCoords: screenCoords,
+ startOffset: startOffset,
+ endOffset: endOffset,
+ }
+}
+
+// Get returns the value for the captured key(s).
+func (p textboxRangeExtentsProperty) Get() (image.Rectangle, bool) {
+ var cx C.int
+ var cy C.int
+ var cw C.int
+ var ch C.int
+ _ok := C._ego_get_struct_ip_efl_access_text_range_extents_get(p.obj, func() C.Eina_Bool {
+ if p.screenCoords {
+ return 1
+ }
+ return 0
+ }(), C.int(p.startOffset), C.int(p.endOffset), &cx, &cy, &cw, &ch)
+ return image.Rect(int(cx), int(cy), int(cx)+int(cw), int(cy)+int(ch)), _ok != 0
+}
+
type textboxAccessSelectionProperty struct {
obj *C.Eo
selectionNumber int
diff --git a/efl/ui/win.go b/efl/ui/win.go
index 6e6ad8b..9d02f34 100644
--- a/efl/ui/win.go
+++ b/efl/ui/win.go
@@ -350,6 +350,15 @@ static void _ego_get_struct_efl_ui_win_hint_step_get(const Eo *obj, int *out_w,
static void _ego_set_struct_efl_ui_win_hint_step_set(Eo *obj, int w, int h) {
efl_ui_win_hint_step_set(obj, (Eina_Size2D){ .w = w, .h = h });
}
+// _ego_get_struct_efl_canvas_scene_image_max_size_get wraps the getter, decomposing the out-param struct
+// into individual pointer arguments and returning the Eina_Bool status.
+static Eina_Bool _ego_get_struct_efl_canvas_scene_image_max_size_get(const Eo *obj, int *out_w, int *out_h) {
+ Eina_Size2D _r = {0};
+ Eina_Bool _ok = efl_canvas_scene_image_max_size_get(obj, &_r);
+ *out_w = _r.w;
+ *out_h = _r.h;
+ return _ok;
+}
// _ego_get_struct_efl_screen_size_in_pixels_get wraps the getter, decomposing the returned
// struct into individual out-params for safe cgo consumption.
static void _ego_get_struct_efl_screen_size_in_pixels_get(const Eo *obj, int *out_w, int *out_h) {
@@ -405,6 +414,15 @@ static void _ego_set_struct_opt_efl_ui_win_hint_base_set(Eo *obj, int w, int h)
static void _ego_set_struct_opt_efl_ui_win_hint_step_set(Eo *obj, int w, int h) {
efl_ui_win_hint_step_set(obj, (Eina_Size2D){ .w = w, .h = h });
}
+// _ego_get_struct_ip_efl_canvas_scene_pointer_position_get wraps the indexed property getter, decomposing
+// the out-param struct into individual pointer arguments and returning the Eina_Bool status.
+static Eina_Bool _ego_get_struct_ip_efl_canvas_scene_pointer_position_get(const Eo *obj, const Eo * seat, int *out_x, int *out_y) {
+ Eina_Position2D _r = {0};
+ Eina_Bool _ok = efl_canvas_scene_pointer_position_get(obj, seat, &_r);
+ *out_x = _r.x;
+ *out_y = _r.y;
+ return _ok;
+}
// _ego_set_struct_ip_efl_access_component_extents_set wraps the indexed property setter, constructing
// the struct from individual field parameters, with key parameters passed through.
static void _ego_set_struct_ip_efl_access_component_extents_set(Eo *obj, Eina_Bool screenCoords, int x, int y, int w, int h) {
@@ -1189,6 +1207,14 @@ func (o *Win) SetFocusHighlightAnimate(val bool) {
C.efl_ui_win_focus_highlight_animate_set((*C.Eo)(o.Eo()), cVal)
}
+// ImageMaxSize returns the ImageMaxSize property of the Win.
+func (o *Win) ImageMaxSize() (efl.Size2D, bool) {
+ var cw C.int
+ var ch C.int
+ _ok := C._ego_get_struct_efl_canvas_scene_image_max_size_get((*C.Eo)(o.Eo()), &cw, &ch)
+ return efl.Size2D{W: int(cw), H: int(ch)}, _ok != 0
+}
+
// GroupObjectsCalculating returns the GroupObjectsCalculating property of the Win.
func (o *Win) GroupObjectsCalculating() bool {
return C.efl_canvas_scene_group_objects_calculating_get((*C.Eo)(o.Eo())) != 0
@@ -1611,6 +1637,27 @@ func (p winSeatProperty) Get() unsafe.Pointer {
return unsafe.Pointer(C.efl_canvas_scene_seat_get(p.obj, C.int(p.id)))
}
+type winPointerPositionProperty struct {
+ obj *C.Eo
+ seat efl.Objecter
+}
+
+// PointerPosition returns an accessor for the PointerPosition indexed property.
+func (o *Win) PointerPosition(seat efl.Objecter) winPointerPositionProperty {
+ return winPointerPositionProperty{
+ obj: (*C.Eo)(o.Eo()),
+ seat: seat,
+ }
+}
+
+// Get returns the value for the captured key(s).
+func (p winPointerPositionProperty) Get() (image.Point, bool) {
+ var cx C.int
+ var cy C.int
+ _ok := C._ego_get_struct_ip_efl_canvas_scene_pointer_position_get(p.obj, (*C.Eo)(p.seat.Eo()), &cx, &cy)
+ return image.Point{X: int(cx), Y: int(cy)}, _ok != 0
+}
+
type winExtentsProperty struct {
obj *C.Eo
screenCoords bool
diff --git a/ego-stats b/ego-stats
index 6af3515..2bd46fc 100755
Binary files a/ego-stats and b/ego-stats differ
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.