+2008-11-13 Jürg Billeter <j@bitron.ch>
+
+ * vala/valacodecontext.vala:
+ * gobject/valadbusclientmodule.vala:
+ * compiler/valacompiler.vala:
+
+ Add --disable-dbus-transformation command-line option to disable
+ case transformation of D-Bus member names in dynamic D-Bus client
+ support, this option will be removed again when Vala gains static
+ D-Bus client support
+
2008-11-13 Jürg Billeter <j@bitron.ch>
* gobject/valadbusclientmodule.vala:
static bool enable_checking;
static bool disable_non_null;
static bool non_null_experimental;
+ static bool disable_dbus_transformation;
static string cc_command;
[NoArrayLength]
static string[] cc_options;
{ "enable-checking", 0, 0, OptionArg.NONE, ref enable_checking, "Enable additional run-time checks", null },
{ "disable-non-null", 0, 0, OptionArg.NONE, ref disable_non_null, "Disable non-null types", null },
{ "enable-non-null-experimental", 0, 0, OptionArg.NONE, ref non_null_experimental, "Enable experimental enhancements for non-null types", null },
+ { "disable-dbus-transformation", 0, 0, OptionArg.NONE, ref disable_dbus_transformation, "Disable transformation of D-Bus member names", null },
{ "cc", 0, 0, OptionArg.STRING, ref cc_command, "Use COMMAND as C compiler command", "COMMAND" },
{ "Xcc", 'X', 0, OptionArg.STRING_ARRAY, ref cc_options, "Pass OPTION to the C compiler", "OPTION..." },
{ "save-temps", 0, 0, OptionArg.NONE, ref save_temps, "Keep temporary files", null },
context.checking = enable_checking;
context.non_null = !disable_non_null || non_null_experimental;
context.non_null_experimental = non_null_experimental;
+ context.dbus_transformation = !disable_dbus_transformation;
Report.set_verbose_errors (!quiet_mode);
context.ccode_only = ccode_only;
base (codegen, next);
}
+ string get_dynamic_dbus_name (string vala_name) {
+ // TODO switch default to no transformation as soon as we have static D-Bus client support
+ // keep transformation by default for static D-Bus client and server support
+ if (context.dbus_transformation) {
+ return Symbol.lower_case_to_camel_case (vala_name);
+ } else {
+ return vala_name;
+ }
+ }
+
public override void generate_dynamic_method_wrapper (DynamicMethod method) {
var dynamic_method = (DynamicMethod) method;
arg_index++;
}
- ccall.add_argument (new CCodeConstant ("\"%s\"".printf (Symbol.lower_case_to_camel_case (method.name))));
+ ccall.add_argument (new CCodeConstant ("\"%s\"".printf (get_dynamic_dbus_name (method.name))));
if (callback != null) {
var reply_method = (Method) callback.symbol_reference;
ccall.add_argument (get_iface);
ccall.add_argument (new CCodeIdentifier ("G_TYPE_STRING"));
- ccall.add_argument (new CCodeConstant ("\"%s\"".printf (Symbol.lower_case_to_camel_case (node.name))));
+ ccall.add_argument (new CCodeConstant ("\"%s\"".printf (get_dynamic_dbus_name (node.name))));
ccall.add_argument (new CCodeIdentifier ("G_TYPE_INVALID"));
ccall.add_argument (get_iface);
ccall.add_argument (new CCodeIdentifier ("G_TYPE_STRING"));
- ccall.add_argument (new CCodeConstant ("\"%s\"".printf (Symbol.lower_case_to_camel_case (node.name))));
+ ccall.add_argument (new CCodeConstant ("\"%s\"".printf (get_dynamic_dbus_name (node.name))));
ccall.add_argument (new CCodeIdentifier ("G_TYPE_VALUE"));
ccall.add_argument (val_ptr);
var add_call = new CCodeFunctionCall (new CCodeIdentifier ("dbus_g_proxy_add_signal"));
add_call.add_argument (new CCodeIdentifier ("obj"));
- add_call.add_argument (new CCodeConstant ("\"%s\"".printf (Symbol.lower_case_to_camel_case (sig.name))));
+ add_call.add_argument (new CCodeConstant ("\"%s\"".printf (get_dynamic_dbus_name (sig.name))));
bool first = true;
foreach (FormalParameter param in m.get_parameters ()) {
*/
public bool non_null_experimental { get; set; }
+ /**
+ * Enable transformation of D-Bus member names in dynamic client support.
+ */
+ public bool dbus_transformation { get; set; }
+
/**
* Output C code, don't compile to object code.
*/