当前位置: 首页>>代码示例>>Golang>>正文


Golang dbus.InstallOnSession函数代码示例

本文整理汇总了Golang中pkg/linuxdeepin/com/lib/dbus.InstallOnSession函数的典型用法代码示例。如果您正苦于以下问题:Golang InstallOnSession函数的具体用法?Golang InstallOnSession怎么用?Golang InstallOnSession使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了InstallOnSession函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: mustGetEntry

func (m *EntryManager) mustGetEntry(nApp *NormalApp, rApp *RuntimeApp) *AppEntry {
	if rApp != nil {
		if e, ok := m.appEntries[rApp.Id]; ok {
			return e
		} else {
			e := NewAppEntryWithRuntimeApp(rApp)
			m.appEntries[rApp.Id] = e
			err := dbus.InstallOnSession(e)
			if err != nil {
				logger.Warning(err)
			}
			return e
		}
	} else if nApp != nil {
		if e, ok := m.appEntries[nApp.Id]; ok {
			return e
		} else {
			e := NewAppEntryWithNormalApp(nApp)
			m.appEntries[nApp.Id] = e
			err := dbus.InstallOnSession(e)
			if err != nil {
				logger.Warning(err)
			}
			return e
		}
	}
	panic("mustGetEntry: at least give one app")
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:28,代码来源:entry_manager.go

示例2: Start

func Start() {
	if _m != nil {
		return
	}

	var logger = log.NewLogger("com.deepin.daemon.InputDevices")
	logger.BeginTracing()

	if !initDeviceChangedWatcher() {
		logger.Error("Init device changed wacher failed")
		logger.EndTracing()
		return
	}

	_m := NewManager(logger)
	err := dbus.InstallOnSession(_m)
	if err != nil {
		logger.Error("Install Manager DBus Failed:", err)
		finalize()
		return
	}

	err = dbus.InstallOnSession(_m.mouse)
	if err != nil {
		logger.Error("Install Mouse DBus Failed:", err)
		finalize()
		return
	}

	err = dbus.InstallOnSession(_m.touchpad)
	if err != nil {
		logger.Error("Install Touchpad DBus Failed:", err)
		finalize()
		return
	}

	err = dbus.InstallOnSession(_m.kbd)
	if err != nil {
		logger.Error("Install Keyboard DBus Failed:", err)
		finalize()
		return
	}

	err = dbus.InstallOnSession(_m.wacom)
	if err != nil {
		logger.Error("Install Wacom DBus Failed:", err)
		finalize()
		return
	}
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:50,代码来源:main.go

示例3: Start

func Start() {
	if _manager != nil {
		return
	}

	logger.BeginTracing()

	var err error
	_manager, err = NewManager()
	if err != nil {
		logger.Error("Create Manager failed:", err)
		logger.EndTracing()
		return
	}

	err = dbus.InstallOnSession(_manager)
	if err != nil {
		logger.Error("Install DBus failed:", err)
		_manager.destroy()
		_manager = nil
		logger.EndTracing()
		return
	}
	_manager.handlePropChanged()
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:25,代码来源:timedate.go

示例4: initTrayManager

func initTrayManager() {
	composite.Init(TrayXU.Conn())
	composite.QueryVersion(TrayXU.Conn(), 0, 4)
	damage.Init(TrayXU.Conn())
	damage.QueryVersion(TrayXU.Conn(), 1, 1)
	xfixes.Init(TrayXU.Conn())
	xfixes.QueryVersion(TrayXU.Conn(), 5, 0)

	visualId := findRGBAVisualID()

	TRAYMANAGER = &TrayManager{
		owner:      0,
		visual:     visualId,
		nameInfo:   make(map[xproto.Window]string),
		notifyInfo: make(map[xproto.Window]bool),
		md5Info:    make(map[xproto.Window][]byte),
		dmageInfo:  make(map[xproto.Window]damage.Damage),
	}
	TRAYMANAGER.Manage()

	dbus.InstallOnSession(TRAYMANAGER)

	xfixes.SelectSelectionInput(
		TrayXU.Conn(),
		TrayXU.RootWin(),
		_NET_SYSTEM_TRAY_S0,
		xfixes.SelectionEventMaskSelectionClientClose,
	)
	go TRAYMANAGER.startListener()
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:30,代码来源:traymanager.go

示例5: main

func main() {
	if !lib.UniqueOnSession(DBUS_DEST) {
		logger.Warning("There is an Search running")
		return
	}

	logger.BeginTracing()
	defer logger.EndTracing()
	logger.SetRestartCommand("/usr/lib/deepin-daemon/search")

	if err := dbus.InstallOnSession(GetManager()); err != nil {
		logger.Fatal("Search Install DBus Failed:", err)
		return
	}
	dbus.DealWithUnhandledMessage()

	dbus.SetAutoDestroyHandler(time.Second*5, func() bool {
		if GetManager().writeStart {
			select {
			case <-GetManager().writeEnd:
				return true
			}
		}

		return true
	})

	if err := dbus.Wait(); err != nil {
		logger.Warning("Search lost dbus:", err)
		os.Exit(-1)
	} else {
		os.Exit(0)
	}
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:34,代码来源:main.go

示例6: rebuildThemes

func (m *Manager) rebuildThemes() {
	m.lock.Lock()
	defer m.lock.Unlock()
	m.destroyThemes()

	var curThemeValid bool
	for _, name := range m.ThemeList {
		info, err := m.dtheme.GetInfoByName(path.Base(name))
		if err != nil {
			continue
		}
		t := NewTheme(info, m.applyTheme)
		err = dbus.InstallOnSession(t)
		if err != nil {
			logger.Warning("Install dbus failed:", info, err)
			continue
		}

		m.themeObjMap[info.BaseName] = t
		if info.BaseName == m.CurrentTheme.Get() {
			curThemeValid = true
			m.applyTheme(info.BaseName)
		}
	}

	if !curThemeValid {
		m.applyTheme(defaultDThemeId)
	}
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:29,代码来源:manager.go

示例7: addSinkInput

func (a *Audio) addSinkInput(idx uint32) {
	for _, si := range a.SinkInputs {
		if si.index == idx {
			return
		}
	}

	core, err := a.core.GetSinkInput(idx)
	if err != nil {
		logger.Warning(err)
		return
	}
	if filterSinkInput(core) {
		return
	}

	si := NewSinkInput(core)
	err = dbus.InstallOnSession(si)
	if err != nil {
		logger.Error(err)
		return
	}

	a.SinkInputs = append(a.SinkInputs, si)
	dbus.NotifyChange(a, "SinkInputs")
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:26,代码来源:audio_stub.go

示例8: Start

func Start() {
	if power != nil {
		return
	}

	logger.BeginTracing()

	err := initializeLibs()
	if err != nil {
		logger.Error(err)
		logger.EndTracing()
		return
	}

	err = dbus.InstallOnSession(power)
	if err != nil {
		logger.Error("Failed InstallOnSession:", err)
		finalizeLibs()
		logger.EndTracing()
		return
	}

	workaround = newFullScreenWorkaround()
	go workaround.start()
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:25,代码来源:init.go

示例9: registerEntry

func (m *EntryProxyerManager) registerEntry(name string) {
	if !isEntryNameValid(name) {
		return
	}
	logger.Debugf("register entry: %s", name)
	entryId, ok := getEntryId(name)
	if !ok {
		return
	}
	logger.Debugf("register entry id: %s", entryId)
	entry, err := NewEntryProxyer(entryId)
	if err != nil {
		logger.Warningf("register entry failed: %v", err)
		return
	}
	err = dbus.InstallOnSession(entry)
	if err != nil {
		logger.Warningf("register entry failed: %v", err)
		return
	}
	m.Entries = append(m.Entries, entry)

	dbus.Emit(m, "Added", dbus.ObjectPath(entry.GetDBusInfo().ObjectPath))

	logger.Infof("register entry success: %s", name)
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:26,代码来源:manager.go

示例10: Start

func Start() {
	logger.BeginTracing()

	grub = NewGrub2()
	err := dbus.InstallOnSession(grub)
	if err != nil {
		logger.Errorf("register dbus interface failed: %v", err)
		return
	}
	err = dbus.InstallOnSession(grub.theme)
	if err != nil {
		logger.Errorf("register dbus interface failed: %v", err)
		return
	}

	// initialize grub2 after dbus service installed to ensure
	// property changing signal send successful
	grub.initGrub2()
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:19,代码来源:module.go

示例11: setPropSinkInputs

func (s *Audio) setPropSinkInputs(v []*SinkInput) {
	for _, o := range s.SinkInputs {
		dbus.UnInstallObject(o)
	}
	for _, o := range v {
		dbus.InstallOnSession(o)
	}
	s.SinkInputs = v
	dbus.NotifyChange(s, "SinkInputs")
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:10,代码来源:audio_stub.go

示例12: setPropSources

func (s *Audio) setPropSources(v []*Source) {
	for _, o := range s.Sources {
		dbus.UnInstallObject(o)
	}
	for _, o := range v {
		dbus.InstallOnSession(o)
	}
	s.Sources = v
	dbus.NotifyChange(s, "Sources")
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:10,代码来源:audio_stub.go

示例13: startMediaMount

func startMediaMount() error {
	_media = NewMediaMount()
	if _media == nil {
		return fmt.Errorf("Create MediaMount Failed")
	}
	err := dbus.InstallOnSession(_media)
	if err != nil {
		return err
	}

	return nil
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:12,代码来源:main.go

示例14: addConnectionSession

func (m *Manager) addConnectionSession(session *ConnectionSession) {
	m.connectionSessionsLock.Lock()
	defer m.connectionSessionsLock.Unlock()

	// install dbus session
	err := dbus.InstallOnSession(session)
	if err != nil {
		logger.Error(err)
		return
	}
	m.connectionSessions = append(m.connectionSessions, session)
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:12,代码来源:manager_connection.go

示例15: startDefaultApps

func startDefaultApps() error {
	_dapp = NewDefaultApps()
	if _dapp == nil {
		return fmt.Errorf("Create DefaultApps Failed")
	}

	err := dbus.InstallOnSession(_dapp)
	if err != nil {
		return err
	}

	return nil
}
开发者ID:felixonmars,项目名称:dde-daemon,代码行数:13,代码来源:main.go


注:本文中的pkg/linuxdeepin/com/lib/dbus.InstallOnSession函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。