Re: [Vala] Set C representation of namespace manually?
2014-02-24 0:05 GMT+01:00 Luca Bruno : > Yes you can, put some CCode on top of your namespace: > https://wiki.gnome.org/Projects/Vala/Manual/Attributes#CCode_Attribute > Make sure you put the same CCode on all the files for the same namespace. Ah, I didn't know that we have "lower_case_cprefix" - that was exactly what I needed! Thank you! ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] Set C representation of namespace manually?
Yes you can, put some CCode on top of your namespace: https://wiki.gnome.org/Projects/Vala/Manual/Attributes#CCode_Attribute Make sure you put the same CCode on all the files for the same namespace. On Sun, Feb 23, 2014 at 11:54 PM, Matthias Klumpp wrote: > Hi! > For a library project, I would like to have some control over the > namespace-C-naming (especially the automatic camel-case-to-underscore > conversion). For example if I have a namespace > namespace MyProject { > class Tree; > } > This translates to function names in form of > MyProjectTree *my_project_tree_new () > but I would like to have > MyProjectTree *myproject_tree (); > (note the missing underscore) > If I change the namespace name to Myproject, I get correct function > naming, but the objects are named "wrong". > Is it possible to change the namespace C naming, without adding a > CCode cname to every class in a namespace? > > Thanks for your help! > Matthias > > -- > Debian Developer | Freedesktop-Developer > I welcome VSRE emails. See http://vsre.info/ > ___ > vala-list mailing list > vala-list@gnome.org > https://mail.gnome.org/mailman/listinfo/vala-list > -- www.debian.org - The Universal Operating System ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
[Vala] Set C representation of namespace manually?
Hi! For a library project, I would like to have some control over the namespace-C-naming (especially the automatic camel-case-to-underscore conversion). For example if I have a namespace namespace MyProject { class Tree; } This translates to function names in form of MyProjectTree *my_project_tree_new () but I would like to have MyProjectTree *myproject_tree (); (note the missing underscore) If I change the namespace name to Myproject, I get correct function naming, but the objects are named "wrong". Is it possible to change the namespace C naming, without adding a CCode cname to every class in a namespace? Thanks for your help! Matthias -- Debian Developer | Freedesktop-Developer I welcome VSRE emails. See http://vsre.info/ ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] More problems with vala-dbus-binding-tool
Here it is. El 23/02/14 14:10, Luca Bruno escribió: Paste the generated vapi. On Sun, Feb 23, 2014 at 1:16 PM, rastersoft wrote: Hi again: I fixed the problem in the last message: I forgot to add --gdbus. Now I have a problem with the C code: when I extract the interfaces with for "org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager" (using org.freedesktop.DBus.Introspectable.Introspect), I compile it with Vala and receive this message: /home/raster/workspace/autovala/install/src/dbus_ generated/org.freedesktop.ConsoleKit/org/freedesktop/ ConsoleKit/Manager/org-freedesktop-consolekit.c: In function '_dbus_org_freedesktop_console_kit_manager_sync_open_session_with_parameters': /home/raster/workspace/autovala/install/src/dbus_ generated/org.freedesktop.ConsoleKit/org/freedesktop/ ConsoleKit/Manager/org-freedesktop-consolekit.c:3107:54: error: 'parameters' redeclared as different kind of symbol orgfreedesktopConsoleKitManagerSyncParameterStruct* parameters = NULL; /home/raster/workspace/autovala/install/src/dbus_ generated/org.freedesktop.ConsoleKit/org/freedesktop/ ConsoleKit/Manager/org-freedesktop-consolekit.c:3104:143: note: previous definition of 'parameters' was here static void _dbus_org_freedesktop_console_kit_manager_sync_open_session_with_parameters (orgfreedesktopConsoleKitManagerSync* self, GVariant* parameters, GDBusMethodInvocation* invocation) { Any idea? Thanks. -- Nos leemos RASTER(Linux user #228804) ras...@rastersoft.com http://www.rastersoft.com ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list -- Nos leemos RASTER(Linux user #228804) ras...@rastersoft.com http://www.rastersoft.com /* Generated by vala-dbus-binding-tool 0.4.0. Do not modify! */ /* Generated with: vala-dbus-binding-tool --gdbus --api-path=/tmp/dbus_data.xml --directory=/home/raster/workspace/autovala/src/dbus_generated/org.freedesktop.ConsoleKit/org/freedesktop/ConsoleKit/Manager */ using GLib; namespace org { namespace freedesktop { namespace ConsoleKit { [DBus (name = "org.freedesktop.ConsoleKit.Manager", timeout = 12)] public interface Manager : GLib.Object { [DBus (name = "GetSystemIdleSinceHint")] public abstract string get_system_idle_since_hint() throws DBusError, IOError; [DBus (name = "GetSystemIdleHint")] public abstract bool get_system_idle_hint() throws DBusError, IOError; [DBus (name = "GetSessionsForUser")] public abstract GLib.ObjectPath[] get_sessions_for_user(uint uid) throws DBusError, IOError; [DBus (name = "GetSessionsForUnixUser")] public abstract GLib.ObjectPath[] get_sessions_for_unix_user(uint uid) throws DBusError, IOError; [DBus (name = "GetCurrentSession")] public abstract GLib.ObjectPath get_current_session() throws DBusError, IOError; [DBus (name = "GetSessionForUnixProcess")] public abstract GLib.ObjectPath get_session_for_unix_process(uint pid) throws DBusError, IOError; [DBus (name = "GetSessionForCookie")] public abstract GLib.ObjectPath get_session_for_cookie(string cookie) throws DBusError, IOError; [DBus (name = "GetSessions")] public abstract GLib.ObjectPath[] get_sessions() throws DBusError, IOError; [DBus (name = "GetSeats")] public abstract GLib.ObjectPath[] get_seats() throws DBusError, IOError; [DBus (name = "CloseSession")] public abstract bool close_session(string cookie) throws DBusError, IOError; [DBus (name = "OpenSessionWithParameters")] public abstract string open_session_with_parameters(ManagerParameterStruct[] parameters) throws DBusError, IOError; [DBus (name = "OpenSession")] public abstract string open_session() throws DBusError, IOError; [DBus (name = "CanStop")] public abstract bool can_stop() throws DBusError, IOError; [DBus (name = "Stop")] public abstract void stop() throws DBusError, IOError; [DBus (name = "CanRestart")] public abstract bool can_restart() throws DBusError, IOError; [DBus (name = "Restart")] public abstract void restart() throws DBusError, IOError; [DBus (name = "SystemIdleHintChanged")] public signal void system_idle_hint_changed(bool param0); [DBus (name = "SeatRemoved")] public signal void seat_removed(GLib.ObjectPath param0); [DBus (name = "SeatAdded")] public signal void seat_added(GLib.ObjectPath param0); } public struct ManagerParameterStruct { public string attr1; public GLib.Variant attr2; } [DBus (name = "org.freedesktop.ConsoleKit.Manager", timeout = 12)] public interface ManagerSync : GLib.Object { [DBus (name = "GetSystemIdleSinceHint")] public abstract string get_system_idle_since_hint() throws DBusError, IOError; [DBus (name = "GetSystemIdleHint")] public abstract bool get_system_idle_hint() th
Re: [Vala] More problems with vala-dbus-binding-tool
Paste the generated vapi. On Sun, Feb 23, 2014 at 1:16 PM, rastersoft wrote: > Hi again: > > I fixed the problem in the last message: I forgot to add --gdbus. Now I > have a problem with the C code: when I extract the interfaces with for > "org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager" (using > org.freedesktop.DBus.Introspectable.Introspect), I compile it with Vala > and receive this message: > > /home/raster/workspace/autovala/install/src/dbus_ > generated/org.freedesktop.ConsoleKit/org/freedesktop/ > ConsoleKit/Manager/org-freedesktop-consolekit.c: > > In function > '_dbus_org_freedesktop_console_kit_manager_sync_open_session_with_parameters': > /home/raster/workspace/autovala/install/src/dbus_ > generated/org.freedesktop.ConsoleKit/org/freedesktop/ > ConsoleKit/Manager/org-freedesktop-consolekit.c:3107:54: > error: 'parameters' redeclared as different kind of symbol > orgfreedesktopConsoleKitManagerSyncParameterStruct* parameters = NULL; > > /home/raster/workspace/autovala/install/src/dbus_ > generated/org.freedesktop.ConsoleKit/org/freedesktop/ > ConsoleKit/Manager/org-freedesktop-consolekit.c:3104:143: note: previous > definition of 'parameters' was here > static void > _dbus_org_freedesktop_console_kit_manager_sync_open_session_with_parameters > (orgfreedesktopConsoleKitManagerSync* self, GVariant* parameters, > GDBusMethodInvocation* invocation) { > > Any idea? > > Thanks. > > -- > Nos leemos > RASTER(Linux user #228804) > ras...@rastersoft.com http://www.rastersoft.com > > ___ > vala-list mailing list > vala-list@gnome.org > https://mail.gnome.org/mailman/listinfo/vala-list > -- www.debian.org - The Universal Operating System ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list
[Vala] More problems with vala-dbus-binding-tool
Hi again: I fixed the problem in the last message: I forgot to add --gdbus. Now I have a problem with the C code: when I extract the interfaces with for "org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager" (using org.freedesktop.DBus.Introspectable.Introspect), I compile it with Vala and receive this message: /home/raster/workspace/autovala/install/src/dbus_generated/org.freedesktop.ConsoleKit/org/freedesktop/ConsoleKit/Manager/org-freedesktop-consolekit.c: In function '_dbus_org_freedesktop_console_kit_manager_sync_open_session_with_parameters': /home/raster/workspace/autovala/install/src/dbus_generated/org.freedesktop.ConsoleKit/org/freedesktop/ConsoleKit/Manager/org-freedesktop-consolekit.c:3107:54: error: 'parameters' redeclared as different kind of symbol orgfreedesktopConsoleKitManagerSyncParameterStruct* parameters = NULL; /home/raster/workspace/autovala/install/src/dbus_generated/org.freedesktop.ConsoleKit/org/freedesktop/ConsoleKit/Manager/org-freedesktop-consolekit.c:3104:143: note: previous definition of 'parameters' was here static void _dbus_org_freedesktop_console_kit_manager_sync_open_session_with_parameters (orgfreedesktopConsoleKitManagerSync* self, GVariant* parameters, GDBusMethodInvocation* invocation) { Any idea? Thanks. -- Nos leemos RASTER(Linux user #228804) ras...@rastersoft.com http://www.rastersoft.com ___ vala-list mailing list vala-list@gnome.org https://mail.gnome.org/mailman/listinfo/vala-list