Example #1
0
/**
 * Gets called by the policy framework if an important
 * event arrives: Incoming calls etc.
 */
void maemo_tell_rockbox_to_stop_audio(void)
{
    sim_enter_irq_handler();
    queue_broadcast(SYS_CALL_INCOMING, 0);
    sim_exit_irq_handler();

    osso_system_note_infoprint(maemo_osso_ctx, "Stopping rockbox playback", NULL);
}
void switcher_button_block_keyboard(SwitcherButton *self, gboolean block)
{
    if (self->priv->locked == block)
        return;

    self->priv->locked = block;

    if (self->priv->model == N800 || self->priv->model == N810)
    {
        gconf_client_set_bool(self->priv->gconfClient, GCONF_LOCK_ENTRY, self->priv->locked, 0);
    }

    if (self->priv->model == N770)
    {
        /*
        switch (self->priv->locked)
        {
            case 0:
                g_spawn_command_line_async(CMD_BLOCK_2006_1, 0);
                break;

            case 1:
                g_spawn_command_line_async(CMD_BLOCK_2006_2, 0);
                break;

            case 2:
                g_spawn_command_line_async(CMD_BLOCK_2006_3, 0);
                break;

        }
        */
        if (self->priv->locked)
            g_spawn_command_line_async(CMD_BLOCK_2006_2, 0);
        else
            g_spawn_command_line_async(CMD_BLOCK_2006_1, 0);
    }


    if (self->priv->locked)
        osso_system_note_infoprint(self->priv->osso, "Keyboard blocked", 0);
    else
        osso_system_note_infoprint(self->priv->osso, "Keyboard released", 0);
}
void switcher_button_on_selection_requested(GtkClipboard *selection, const gchar* text, gpointer userData)
{
    GtkClipboard *clipboard = gtk_clipboard_get(gdk_atom_intern("CLIPBOARD", FALSE));
    if (text != NULL)
    {
        gtk_clipboard_set_text(clipboard, text, -1);

        SwitcherButton* self = SWITCHER_BUTTON(userData);
        osso_system_note_infoprint(self->priv->osso, "Copied", 0);
    }
}
Example #4
0
/* callback for the dbus calls */
static gint 
dbus_req_handler(const gchar *interface, const gchar *method,
		 GArray *arguments, gpointer data,
		 osso_rpc_t *retval)
{
	osso_context_t *ctx;
	int i;
	ctx = (osso_context_t *)data;
	
	LOG_INFO("We got D-BUS message %s\n", method);
	
	if (!strcmp(method, "top_application")) {
		/* ui_open_frontpage */
		ui_open_frontpage();
	} else if (!strcmp(method, "mime_open")) {
		/* import .. */
		for (i = 0; i < arguments->len; i++) {
			osso_rpc_t val = g_array_index(arguments, osso_rpc_t, i);
			if (val.type == DBUS_TYPE_STRING && val.value.s != NULL) {
				LOG_INFO("\tparam %s\n", val.value.s);
				
				/* the file might be as an url or just the path */
				if (strstr(val.value.s, "file://") == val.value.s) {
					ident_import_file((char*)(val.value.s + strlen("file://")), 1);
				} else {
					ident_import_file((char*)(val.value.s), 1);
				}
				
				/* we should save the idents stuff now .. */
			}
		}
	} else {
		osso_system_note_infoprint(ctx, method, retval);
	}
	osso_rpc_free_val(retval);
	
	return OSSO_OK;
}