Skip to content

Commit dfedb41

Browse files
committed
Wire up some more
1 parent ea9e209 commit dfedb41

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

frida/frida_bindgen/codegen.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from .model import (ClassObjectType, CustomTypeKind, Enumeration,
88
InterfaceObjectType, Method, Model, ObjectType, Parameter,
9-
Procedure, Property, Signal, Tuple, to_pascal_case)
9+
Procedure, Property, Signal, Tuple, to_pascal_case, to_snake_case)
1010

1111
ASSETS_DIR = Path(__file__).resolve().parent / "assets"
1212
CODEGEN_HELPERS_TS = (ASSETS_DIR / "codegen_helpers.ts").read_text(encoding="utf-8")
@@ -1563,7 +1563,8 @@ def generate_abstract_base_type_declarations(model: Model) -> str:
15631563
for itype in model.interface_types_with_abstract_base:
15641564
ctype = itype.abstract_base_c_type
15651565
cprefix = itype.abstract_base_c_symbol_prefix
1566-
module_upper, obj_name_upper = cprefix.upper().split("_", maxsplit=1)
1566+
module_upper = "PY"
1567+
obj_name_upper = "ABSTRACT_" + to_snake_case(itype.name).upper()
15671568
decls.append(
15681569
f"""G_DECLARE_FINAL_TYPE ({ctype}, {cprefix}, {module_upper}, {obj_name_upper}, GObject)
15691570

frida/frida_bindgen/model.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def prefixed_js_name(self) -> str:
146146

147147
@cached_property
148148
def abstract_base_c_type(self) -> str:
149-
return f"FdnAbstract{self.name}"
149+
return f"PyAbstract{self.name}"
150150

151151
@cached_property
152152
def parent(self) -> ObjectType:
@@ -184,11 +184,11 @@ def customizations(self) -> Optional[ObjectTypeCustomizations]:
184184

185185
@cached_property
186186
def c_symbol_prefix(self) -> str:
187-
return f"fdn_{to_snake_case(self.name)}"
187+
return f"Py{self.name}"
188188

189189
@cached_property
190190
def abstract_base_c_symbol_prefix(self) -> str:
191-
return f"fdn_abstract_{to_snake_case(self.name)}"
191+
return f"PyAbstract{self.name}"
192192

193193
@cached_property
194194
def c_cast_macro(self) -> str:
@@ -537,11 +537,11 @@ def customizations(self) -> Optional[MethodCustomizations]:
537537

538538
@cached_property
539539
def operation_type_name(self) -> str:
540-
return f"Fdn{self.object_type.name}{to_pascal_case(self.name)}Operation"
540+
return f"Py{self.object_type.name}{to_pascal_case(self.name)}Operation"
541541

542542
@cached_property
543543
def abstract_base_operation_type_name(self) -> str:
544-
return f"FdnAbstract{self.object_type.name}{to_pascal_case(self.name)}Operation"
544+
return f"PyAbstract{self.object_type.name}{to_pascal_case(self.name)}Operation"
545545

546546
@cached_property
547547
def is_select_method(self) -> bool:
@@ -801,7 +801,7 @@ def customizations(self) -> Optional[EnumerationCustomizations]:
801801

802802
@cached_property
803803
def c_symbol_prefix(self) -> str:
804-
return f"fdn_{to_snake_case(self.name)}"
804+
return f"Py{self.name}"
805805

806806

807807
@dataclass

0 commit comments

Comments
 (0)