public static void Main() { BusG.Init (); Application.Init (); btn = new Button ("Click me"); btn.Clicked += OnClick; VBox vb = new VBox (false, 2); vb.PackStart (btn, false, true, 0); Window win = new Window ("D-Bus#"); win.SetDefaultSize (640, 480); win.Add (vb); win.Destroyed += delegate {Application.Quit ();}; win.ShowAll (); bus = Bus.Session; string bus_name = "org.ndesk.gtest"; ObjectPath path = new ObjectPath ("/org/ndesk/btn"); if (bus.RequestName (bus_name) == RequestNameReply.PrimaryOwner) { bus.Register (path, btn); rbtn = btn; } else { rbtn = bus.GetObject<Button> (bus_name, path); } //run the main loop Application.Run (); }
public static void Main() { BusG.Init (); Application.Init (); Button btn = new Button ("Click me"); btn.Clicked += OnClick; VBox vb = new VBox (false, 2); vb.PackStart (btn, false, true, 0); Window win = new Window ("D-Bus#"); win.SetDefaultSize (640, 480); win.Add (vb); win.Destroyed += delegate {Application.Quit ();}; win.ShowAll (); bus = Bus.Session; string bus_name = "org.ndesk.gtest"; ObjectPath path = new ObjectPath ("/org/ndesk/test"); if (bus.RequestName (bus_name) == RequestNameReply.PrimaryOwner) { //create a new instance of the object to be exported demo = new DemoObject (); bus.Register (path, demo); } else { //import a remote to a local proxy demo = bus.GetObject<DemoObject> (bus_name, path); } //run the main loop Application.Run (); }
public static void Main() { BusG.Init (); Application.Init (); Window win = new Window ("D-Bus#"); win.SetDefaultSize (640, 480); win.Destroyed += delegate {Application.Quit ();}; win.ShowAll (); bus = Bus.Session; sysBus = Bus.System.GetObject<IBus> ("org.freedesktop.DBus", new ObjectPath ("/org/freedesktop/DBus")); string bus_name = "org.ndesk.gtest"; ObjectPath path = new ObjectPath ("/org/ndesk/test"); if (bus.RequestName (bus_name) == RequestNameReply.PrimaryOwner) { //create a new instance of the object to be exported demo = new DemoObject (); sysBus.NameOwnerChanged += demo.FireChange; bus.Register (path, demo); } else { //import a remote to a local proxy demo = bus.GetObject<DemoObject> (bus_name, path); } //run the main loop Application.Run (); }
bool InitializePrivateBus (Bus bus) { if (bus.RequestName (BusName) != RequestNameReply.PrimaryOwner) { Log<DBusManager>.Error ("Bus Name '{0}' is already owned", BusName); return false; } docky = new DockyDBus (); docky.QuitCalled += HandleQuitCalled; docky.SettingsCalled += HandleSettingsCalled; docky.AboutCalled += HandleAboutCalled; ObjectPath dockyPath = new ObjectPath (DockyPath); bus.Register (dockyPath, docky); Log<DBusManager>.Debug ("DBus Registered: {0}", BusName); return true; }
void InitializeSharedBus (Bus bus) { if (bus.RequestName (DockManagerBusName) != RequestNameReply.PrimaryOwner) { Log<DBusManager>.Warn ("Bus Name '{0}' is already owned", DockManagerBusName); return; } item_dict = new Dictionary<AbstractDockItem, DockManagerDBusItem> (); dock_manager = new DockManagerDBus (); ObjectPath dockPath = new ObjectPath (DockManagerPath); bus.Register (dockPath, dock_manager); Log<DBusManager>.Debug ("DBus Registered: {0}", DockManagerBusName); }