コード例 #1
0
ファイル: xkeybinder.cpp プロジェクト: UIKit0/gnote
 void XKeybinder::unbind_all()
 {
   for(BindingMap::const_iterator iter = m_bindings.begin();
       iter != m_bindings.end(); ++iter) {
     tomboy_keybinder_unbind (iter->first.c_str(), &XKeybinder::keybinding_pressed);
   }
   m_bindings.clear();
 }
コード例 #2
0
ファイル: xkeybinder.cpp プロジェクト: UIKit0/gnote
 void XKeybinder::unbind(const std::string & keystring)
 {
   BindingMap::iterator iter = m_bindings.find(keystring);
   if(iter != m_bindings.end()) {
     tomboy_keybinder_unbind(keystring.c_str(), &XKeybinder::keybinding_pressed);
     m_bindings.erase(iter);
   }
 }
コード例 #3
0
static gboolean
gtk_hotkey_x11_listener_real_unbind_hotkey (GtkHotkeyListener   *base,
												GtkHotkeyInfo		*hotkey,
												GError				**error)
{
	GtkHotkeyX11Listener	*self;
	GtkHotkeyInfo			*saved_hk;
	const gchar				*signature;
	
	g_return_val_if_fail (GTK_HOTKEY_IS_X11_LISTENER (base), FALSE);
	g_return_val_if_fail (GTK_HOTKEY_IS_INFO (hotkey), FALSE);
	
	self = GTK_HOTKEY_X11_LISTENER (base);
	signature = gtk_hotkey_info_get_signature (hotkey);
	saved_hk = find_hotkey_from_key_id (self, gtk_hotkey_info_get_key_id(hotkey));
	
	if (!saved_hk) {
		g_set_error (error, GTK_HOTKEY_LISTENER_ERROR,
					 GTK_HOTKEY_LISTENER_ERROR_UNBIND,
					 "Failed to unregister hotkey '%s' with signature '%s'. "
					 "No hotkey with that signature is known",
					 gtk_hotkey_info_get_key_id (hotkey),
					 signature);
		return FALSE;
	}
	
	/* Remove actual keybinding */
	tomboy_keybinder_unbind (signature, hotkey_activated_cb);
	
	/* Clean up refs */
	self->priv->hotkeys = g_list_remove (self->priv->hotkeys, saved_hk);
	g_object_unref (saved_hk);
	
	/* Clean up signal handler */
	gulong handler = g_signal_handler_find (self,
											G_SIGNAL_MATCH_DATA | G_SIGNAL_MATCH_FUNC,
											0, 0, NULL, gtk_hotkey_info_activated,
											hotkey);
	if (handler == 0) {
		g_warning ("Failed to disconnect signal handler for hotkey '%s'",
				   gtk_hotkey_info_get_key_id (hotkey));
	} else {
		g_signal_handler_disconnect (self, handler);
	}
	
	return TRUE;
											
}
コード例 #4
0
ファイル: key_grabber.c プロジェクト: eaglexmw/tilda
void tilda_keygrabber_unbind (const gchar *keystr)
{
    tomboy_keybinder_unbind (keystr, (TomboyBindkeyHandler)onKeybindingPull);
}