X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/487eb32a2cdd2732716224f30cd71f1a0da72ddf..750e9f84216e473903d634360aa49148c8ba72ec:/disobedience/playlists.c diff --git a/disobedience/playlists.c b/disobedience/playlists.c index ce5d7d8..c10ef6f 100644 --- a/disobedience/playlists.c +++ b/disobedience/playlists.c @@ -40,8 +40,6 @@ #include "popup.h" #include "validity.h" -#if PLAYLISTS - static void playlist_list_received_playlists(void *v, const char *err, int nvec, char **vec); @@ -86,12 +84,36 @@ static gboolean playlist_window_keypress(GtkWidget *widget, GdkEventKey *event, gpointer user_data); static int playlistcmp(const void *ap, const void *bp); -static void playlist_remove_locked(void *v, const char *err); -void playlist_remove_retrieved(void *v, const char *err, +static void playlist_modify_locked(void *v, const char *err); +void playlist_modify_retrieved(void *v, const char *err, int nvec, char **vec); -static void playlist_remove_updated(void *v, const char *err); -static void playlist_remove_unlocked(void *v, const char *err); +static void playlist_modify_updated(void *v, const char *err); +static void playlist_modify_unlocked(void *v, const char *err); +static void playlist_drop(struct queuelike *ql, + int ntracks, + char **tracks, char **ids, + struct queue_entry *after_me); +struct playlist_modify_data; +static void playlist_drop_modify(struct playlist_modify_data *mod, + int nvec, char **vec); +static void playlist_remove_modify(struct playlist_modify_data *mod, + int nvec, char **vec); +static gboolean playlist_new_keypress(GtkWidget *widget, + GdkEventKey *event, + gpointer user_data); +static gboolean playlist_picker_keypress(GtkWidget *widget, + GdkEventKey *event, + gpointer user_data); +static void playlist_editor_button_toggled(GtkToggleButton *tb, + gpointer userdata); +static void playlist_editor_set_buttons(const char *event, + void *eventdata, + void *callbackdata); +static void playlist_editor_got_share(void *v, + const char *err, + const char *value); +static void playlist_editor_share_set(void *v, const char *err); /** @brief Playlist editing window */ static GtkWidget *playlist_window; @@ -101,7 +123,6 @@ static const struct queue_column playlist_columns[] = { { "Artist", column_namepart, "artist", COL_EXPAND|COL_ELLIPSIZE }, { "Album", column_namepart, "album", COL_EXPAND|COL_ELLIPSIZE }, { "Title", column_namepart, "title", COL_EXPAND|COL_ELLIPSIZE }, - { "Length", column_length, 0, COL_RIGHT } }; /** @brief Pop-up menu for playlist editor @@ -121,6 +142,22 @@ static struct menuitem playlist_menuitems[] = { { "Deselect all tracks", ql_selectnone_activate, ql_selectnone_sensitive, 0, 0 }, }; +static const GtkTargetEntry playlist_targets[] = { + { + PLAYLIST_TRACKS, /* drag type */ + GTK_TARGET_SAME_WIDGET, /* rearrangement within a widget */ + PLAYLIST_TRACKS_ID /* ID value */ + }, + { + PLAYABLE_TRACKS, /* drag type */ + GTK_TARGET_SAME_APP|GTK_TARGET_OTHER_WIDGET, /* copying between widgets */ + PLAYABLE_TRACKS_ID, /* ID value */ + }, + { + .target = NULL + } +}; + /** @brief Queuelike for editing a playlist */ static struct queuelike ql_playlist = { .name = "playlist", @@ -128,7 +165,11 @@ static struct queuelike ql_playlist = { .ncolumns = sizeof playlist_columns / sizeof *playlist_columns, .menuitems = playlist_menuitems, .nmenuitems = sizeof playlist_menuitems / sizeof *playlist_menuitems, - //.drop = playlist_drop //TODO + .drop = playlist_drop, + .drag_source_targets = playlist_targets, + .drag_source_actions = GDK_ACTION_MOVE|GDK_ACTION_COPY, + .drag_dest_targets = playlist_targets, + .drag_dest_actions = GDK_ACTION_MOVE|GDK_ACTION_COPY, }; /* Maintaining the list of playlists ---------------------------------------- */ @@ -350,15 +391,36 @@ static void playlist_new_playlist(void) { /* Set initial state of OK button */ playlist_new_changed(0,0,0); - /* TODO: return should = OK, escape should = cancel */ + g_signal_connect(playlist_new_window, "key-press-event", + G_CALLBACK(playlist_new_keypress), 0); /* Display the window */ gtk_widget_show_all(playlist_new_window); } +/** @brief Keypress handler */ +static gboolean playlist_new_keypress(GtkWidget attribute((unused)) *widget, + GdkEventKey *event, + gpointer attribute((unused)) user_data) { + if(event->state) + return FALSE; + switch(event->keyval) { + case GDK_Return: + playlist_new_ok(NULL, NULL); + return TRUE; + case GDK_Escape: + gtk_widget_destroy(playlist_new_window); + return TRUE; + default: + return FALSE; + } +} + /** @brief Called when 'ok' is clicked in new-playlist popup */ static void playlist_new_ok(GtkButton attribute((unused)) *button, gpointer attribute((unused)) userdata) { + if(playlist_new_valid()) + return; gboolean shared, public, private; char *name, *fullname; playlist_new_details(&name, &fullname, &shared, &public, &private); @@ -585,6 +647,8 @@ static void playlist_picker_selection_changed(GtkTreeSelection attribute((unused gtk_widget_set_sensitive(playlist_picker_delete_button, 1); else gtk_widget_set_sensitive(playlist_picker_delete_button, 0); + /* TODO delete should not be sensitive for public playlists owned by other + * users */ /* Eliminate no-change cases */ if(!selected && !playlist_picker_selected) return; @@ -596,7 +660,8 @@ static void playlist_picker_selection_changed(GtkTreeSelection attribute((unused playlist_picker_selected = selected; /* Re-initalize the queue */ ql_new_queue(&ql_playlist, NULL); - playlist_editor_fill(NULL, (void *)playlist_picker_selected, NULL); + /* Synthesize a playlist-modified to re-initialize the editor etc */ + event_raise("playlist-modified", (void *)playlist_picker_selected); } /** @brief Called when the 'add' button is pressed */ @@ -621,7 +686,7 @@ static void playlist_picker_delete(GtkButton attribute((unused)) *button, int res; if(!playlist_picker_selected) - return; /* shouldn't happen */ + return; yesno = gtk_message_dialog_new(GTK_WINDOW(playlist_window), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, @@ -690,16 +755,141 @@ static GtkWidget *playlist_picker_create(void) { gtk_box_pack_start(GTK_BOX(vbox), scroll_widget(tree), TRUE/*expand*/, TRUE/*fill*/, 0); gtk_box_pack_start(GTK_BOX(vbox), buttons, FALSE/*expand*/, FALSE, 0); + g_signal_connect(tree, "key-press-event", + G_CALLBACK(playlist_picker_keypress), 0); + return vbox; } +static gboolean playlist_picker_keypress(GtkWidget attribute((unused)) *widget, + GdkEventKey *event, + gpointer attribute((unused)) user_data) { + if(event->state) + return FALSE; + switch(event->keyval) { + case GDK_BackSpace: + case GDK_Delete: + playlist_picker_delete(NULL, NULL); + return TRUE; + default: + return FALSE; + } +} + +static void playlist_picker_destroy(void) { + playlist_picker_delete_button = NULL; + g_object_unref(playlist_picker_list); + playlist_picker_list = NULL; + playlist_picker_selection = NULL; + playlist_picker_selected = NULL; +} + /* Playlist editor ---------------------------------------------------------- */ +static GtkWidget *playlist_editor_shared; +static GtkWidget *playlist_editor_public; +static GtkWidget *playlist_editor_private; +static int playlist_editor_setting_buttons; + static GtkWidget *playlists_editor_create(void) { assert(ql_playlist.view == NULL); /* better not be set up already */ - GtkWidget *w = init_queuelike(&ql_playlist); - /* Initially empty */ - return w; + + GtkWidget *hbox = gtk_hbox_new(FALSE, 0); + playlist_editor_shared = gtk_radio_button_new_with_label(NULL, "shared"); + playlist_editor_public + = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(playlist_editor_shared), + "public"); + playlist_editor_private + = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(playlist_editor_shared), + "private"); + g_signal_connect(playlist_editor_public, "toggled", + G_CALLBACK(playlist_editor_button_toggled), + (void *)"public"); + g_signal_connect(playlist_editor_private, "toggled", + G_CALLBACK(playlist_editor_button_toggled), + (void *)"private"); + gtk_box_pack_start(GTK_BOX(hbox), playlist_editor_shared, + FALSE/*expand*/, FALSE/*fill*/, 0); + gtk_box_pack_start(GTK_BOX(hbox), playlist_editor_public, + FALSE/*expand*/, FALSE/*fill*/, 0); + gtk_box_pack_start(GTK_BOX(hbox), playlist_editor_private, + FALSE/*expand*/, FALSE/*fill*/, 0); + playlist_editor_set_buttons(0,0,0); + + GtkWidget *vbox = gtk_vbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(vbox), init_queuelike(&ql_playlist), + TRUE/*expand*/, TRUE/*fill*/, 0); + gtk_box_pack_start(GTK_BOX(vbox), hbox, + FALSE/*expand*/, FALSE/*fill*/, 0); + return vbox; +} + +/** @brief Called when the public/private buttons are set */ +static void playlist_editor_button_toggled(GtkToggleButton *tb, + gpointer userdata) { + const char *state = userdata; + if(!gtk_toggle_button_get_active(tb) + || !playlist_picker_selected + || playlist_editor_setting_buttons) + return; + disorder_eclient_playlist_set_share(client, playlist_editor_share_set, + playlist_picker_selected, state, NULL); +} + +static void playlist_editor_share_set(void attribute((unused)) *v, + const attribute((unused)) char *err) { + if(err) + popup_protocol_error(0, err); +} + +/** @brief Set the editor button state and sensitivity */ +static void playlist_editor_set_buttons(const char attribute((unused)) *event, + void *eventdata, + void attribute((unused)) *callbackdata) { + /* If this event is for a non-selected playlist do nothing */ + if(eventdata + && playlist_picker_selected + && strcmp(eventdata, playlist_picker_selected)) + return; + if(playlist_picker_selected) { + if(strchr(playlist_picker_selected, '.')) + disorder_eclient_playlist_get_share(client, + playlist_editor_got_share, + playlist_picker_selected, + (void *)playlist_picker_selected); + else + playlist_editor_got_share((void *)playlist_picker_selected, NULL, + "shared"); + } else + playlist_editor_got_share(NULL, NULL, NULL); +} + +/** @brief Called with playlist sharing details */ +static void playlist_editor_got_share(void *v, + const char *err, + const char *value) { + const char *playlist = v; + if(err) { + popup_protocol_error(0, err); + value = NULL; + } + /* Set the currently active button */ + ++playlist_editor_setting_buttons; + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(playlist_editor_shared), + value && !strcmp(value, "shared")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(playlist_editor_public), + value && !strcmp(value, "public")); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(playlist_editor_private), + value && !strcmp(value, "private")); + /* Set button sensitivity */ + gtk_widget_set_sensitive(playlist_editor_shared, FALSE); + int sensitive = (playlist + && strchr(playlist, '.') + && !strncmp(playlist, config->username, + strlen(config->username))); + gtk_widget_set_sensitive(playlist_editor_public, sensitive); + gtk_widget_set_sensitive(playlist_editor_private, sensitive); + --playlist_editor_setting_buttons; } /** @brief (Re-)populate the playlist tree model */ @@ -737,24 +927,236 @@ static void playlists_editor_received_tracks(void *v, /* No such playlist, presumably we'll get a deleted event shortly */ return; /* Translate the list of tracks into queue entries */ - struct queue_entry *newq, **qq = &newq; + struct queue_entry *newq, **qq = &newq, *qprev = NULL; hash *h = hash_new(sizeof(int)); for(int n = 0; n < nvec; ++n) { struct queue_entry *q = xmalloc(sizeof *q); + q->prev = qprev; q->track = vec[n]; /* Synthesize a unique ID so that the selection survives updates. Tracks * can appear more than once in the queue so we can't use raw track names, * so we add a serial number to the start. */ int *serialp = hash_find(h, vec[n]), serial = serialp ? *serialp : 0; byte_xasprintf((char **)&q->id, "%d-%s", serial++, vec[n]); - hash_add(h, vec[0], &serial, HASH_INSERT_OR_REPLACE); + hash_add(h, vec[n], &serial, HASH_INSERT_OR_REPLACE); *qq = q; qq = &q->next; + qprev = q; } *qq = NULL; ql_new_queue(&ql_playlist, newq); } +/* Playlist mutation -------------------------------------------------------- */ + +/** @brief State structure for guarded playlist modification + * + * To safely move, insert or delete rows we must: + * - take a lock + * - fetch the playlist + * - verify it's not changed + * - update the playlist contents + * - store the playlist + * - release the lock + * + * The playlist_modify_ functions do just that. + * + * To kick things off create one of these and disorder_eclient_playlist_lock() + * with playlist_modify_locked() as its callback. @c modify will be called; it + * should disorder_eclient_playlist_set() to set the new state with + * playlist_modify_updated() as its callback. + */ +struct playlist_modify_data { + /** @brief Affected playlist */ + const char *playlist; + /** @brief Modification function + * @param mod Pointer back to state structure + * @param ntracks Length of playlist + * @param tracks Tracks in playlist + */ + void (*modify)(struct playlist_modify_data *mod, + int ntracks, char **tracks); + + /** @brief Number of tracks dropped */ + int ntracks; + /** @brief Track names dropped */ + char **tracks; + /** @brief Track IDs dropped */ + char **ids; + /** @brief Drop after this point */ + struct queue_entry *after_me; +}; + +/** @brief Called with playlist locked + * + * This is the entry point for guarded modification ising @ref + * playlist_modify_data. + */ +static void playlist_modify_locked(void *v, const char *err) { + struct playlist_modify_data *mod = v; + if(err) { + popup_protocol_error(0, err); + return; + } + disorder_eclient_playlist_get(client, playlist_modify_retrieved, + mod->playlist, mod); +} + +/** @brief Called with current playlist contents + * Checks that the playlist is still current and has not changed. + */ +void playlist_modify_retrieved(void *v, const char *err, + int nvec, + char **vec) { + struct playlist_modify_data *mod = v; + if(err) { + popup_protocol_error(0, err); + disorder_eclient_playlist_unlock(client, playlist_modify_unlocked, NULL); + return; + } + if(nvec < 0 + || !playlist_picker_selected + || strcmp(mod->playlist, playlist_picker_selected)) { + disorder_eclient_playlist_unlock(client, playlist_modify_unlocked, NULL); + return; + } + /* We check that the contents haven't changed. If they have we just abandon + * the operation. The user will have to try again. */ + struct queue_entry *q; + int n; + for(n = 0, q = ql_playlist.q; q && n < nvec; ++n, q = q->next) + if(strcmp(q->track, vec[n])) + break; + if(n != nvec || q != NULL) { + disorder_eclient_playlist_unlock(client, playlist_modify_unlocked, NULL); + return; + } + mod->modify(mod, nvec, vec); +} + +/** @brief Called when the playlist has been updated */ +static void playlist_modify_updated(void attribute((unused)) *v, + const char *err) { + if(err) + popup_protocol_error(0, err); + disorder_eclient_playlist_unlock(client, playlist_modify_unlocked, NULL); +} + +/** @brief Called when the playlist has been unlocked */ +static void playlist_modify_unlocked(void attribute((unused)) *v, + const char *err) { + if(err) + popup_protocol_error(0, err); +} + +/* Drop tracks into a playlist ---------------------------------------------- */ + +static void playlist_drop(struct queuelike attribute((unused)) *ql, + int ntracks, + char **tracks, char **ids, + struct queue_entry *after_me) { + struct playlist_modify_data *mod = xmalloc(sizeof *mod); + + mod->playlist = playlist_picker_selected; + mod->modify = playlist_drop_modify; + mod->ntracks = ntracks; + mod->tracks = tracks; + mod->ids = ids; + mod->after_me = after_me; + disorder_eclient_playlist_lock(client, playlist_modify_locked, + mod->playlist, mod); +} + +/** @brief Return true if track @p i is in the moved set */ +static int playlist_drop_is_moved(struct playlist_modify_data *mod, + int i) { + struct queue_entry *q; + + /* Find the q corresponding to i, so we can get the ID */ + for(q = ql_playlist.q; i; q = q->next, --i) + ; + /* See if track i matches any of the moved set by ID */ + for(int n = 0; n < mod->ntracks; ++n) + if(!strcmp(q->id, mod->ids[n])) + return 1; + return 0; +} + +static void playlist_drop_modify(struct playlist_modify_data *mod, + int nvec, char **vec) { + char **newvec; + int nnewvec; + + //fprintf(stderr, "\nplaylist_drop_modify\n"); + /* after_me is the queue_entry to insert after, or NULL to insert at the + * beginning (including the case when the playlist is empty) */ + //fprintf(stderr, "after_me = %s\n", + // mod->after_me ? mod->after_me->track : "NULL"); + struct queue_entry *q = ql_playlist.q; + int ins = 0; + if(mod->after_me) { + ++ins; + while(q && q != mod->after_me) { + q = q->next; + ++ins; + } + } + /* Now ins is the index to insert at; equivalently, the row to insert before, + * and so equal to nvec to append. */ +#if 0 + fprintf(stderr, "ins = %d = %s\n", + ins, ins < nvec ? vec[ins] : "NULL"); + for(int n = 0; n < nvec; ++n) + fprintf(stderr, "%d: %s %s\n", n, n == ins ? "->" : " ", vec[n]); + fprintf(stderr, "nvec = %d\n", nvec); +#endif + if(mod->ids) { + /* This is a rearrangement */ + /* We have: + * - vec[], the current layout + * - ins, pointing into vec + * - mod->tracks[], a subset of vec[] which is to be moved + * + * ins is the insertion point BUT it is in terms of the whole + * array, i.e. before mod->tracks[] have been removed. The first + * step then is to remove everything in mod->tracks[] and adjust + * ins downwards as necessary. + */ + /* First zero out anything that's moved */ + int before_ins = 0; + for(int n = 0; n < nvec; ++n) { + if(playlist_drop_is_moved(mod, n)) { + vec[n] = NULL; + if(n < ins) + ++before_ins; + } + } + /* Now collapse down the array */ + int i = 0; + for(int n = 0; n < nvec; ++n) { + if(vec[n]) + vec[i++] = vec[n]; + } + assert(i + mod->ntracks == nvec); + nvec = i; + /* Adjust the insertion point to take account of things moved from before + * it */ + ins -= before_ins; + /* The effect is now the same as an insertion */ + } + /* This is (now) an insertion */ + nnewvec = nvec + mod->ntracks; + newvec = xcalloc(nnewvec, sizeof (char *)); + memcpy(newvec, vec, + ins * sizeof (char *)); + memcpy(newvec + ins, mod->tracks, + mod->ntracks * sizeof (char *)); + memcpy(newvec + ins + mod->ntracks, vec + ins, + (nvec - ins) * sizeof (char *)); + disorder_eclient_playlist_set(client, playlist_modify_updated, mod->playlist, + newvec, nnewvec, mod); +} + /* Playlist editor right-click menu ---------------------------------------- */ /** @brief Called to determine whether the playlist is playable */ @@ -791,71 +1193,25 @@ static int playlist_remove_sensitive(void attribute((unused)) *extra) { return TRUE; } -/** @brief Called to play the selected playlist */ +/** @brief Called to remove the selected playlist */ static void playlist_remove_activate(GtkMenuItem attribute((unused)) *menuitem, gpointer attribute((unused)) user_data) { if(!playlist_picker_selected) return; - /* To safely remove rows we must: - * - take a lock - * - fetch the playlist - * - verify it's not changed - * - delete the selected rows from the retrieved version - * - store the playlist - * - release the lock - * - * In addition we careful check that the selected playlist hasn't changed - * underfoot, and avoid leaving the playlist locked if we bail out at any - * point. - */ - disorder_eclient_playlist_lock(client, playlist_remove_locked, - playlist_picker_selected, - (void *)playlist_picker_selected); -} + struct playlist_modify_data *mod = xmalloc(sizeof *mod); -static void playlist_remove_locked(void *v, const char *err) { - char *playlist = v; - if(err) { - popup_protocol_error(0, err); - return; - } - if(!playlist_picker_selected || strcmp(playlist, playlist_picker_selected)) { - disorder_eclient_playlist_unlock(client, playlist_remove_unlocked, NULL); - return; - } - disorder_eclient_playlist_get(client, playlist_remove_retrieved, - playlist, playlist); + mod->playlist = playlist_picker_selected; + mod->modify = playlist_remove_modify; + disorder_eclient_playlist_lock(client, playlist_modify_locked, + mod->playlist, mod); } -void playlist_remove_retrieved(void *v, const char *err, - int nvec, - char **vec) { - char *playlist = v; - if(err) { - popup_protocol_error(0, err); - disorder_eclient_playlist_unlock(client, playlist_remove_unlocked, NULL); - return; - } - if(!playlist_picker_selected || strcmp(playlist, playlist_picker_selected)) { - disorder_eclient_playlist_unlock(client, playlist_remove_unlocked, NULL); - return; - } - /* We check that the contents haven't changed. If they have we just abandon - * the operation. The user will have to try again. */ - struct queue_entry *q; - int n, m; - for(n = 0, q = ql_playlist.q; q && n < nvec; ++n, q = q->next) - if(strcmp(q->track, vec[n])) - break; - if(n != nvec || q != NULL) { - disorder_eclient_playlist_unlock(client, playlist_remove_unlocked, NULL); - return; - } - /* Edit the selected items out */ +static void playlist_remove_modify(struct playlist_modify_data *mod, + int attribute((unused)) nvec, char **vec) { GtkTreeIter iter[1]; gboolean it = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(ql_playlist.store), iter); - n = m = 0; + int n = 0, m = 0; while(it) { if(!gtk_tree_selection_iter_is_selected(ql_playlist.selection, iter)) vec[m++] = vec[n++]; @@ -863,22 +1219,8 @@ void playlist_remove_retrieved(void *v, const char *err, n++; it = gtk_tree_model_iter_next(GTK_TREE_MODEL(ql_playlist.store), iter); } - /* Store the new value */ - disorder_eclient_playlist_set(client, playlist_remove_updated, playlist, - vec, m, playlist); -} - -static void playlist_remove_updated(void attribute((unused)) *v, - const char *err) { - if(err) - popup_protocol_error(0, err); - disorder_eclient_playlist_unlock(client, playlist_remove_unlocked, NULL); -} - -static void playlist_remove_unlocked(void attribute((unused)) *v, - const char *err) { - if(err) - popup_protocol_error(0, err); + disorder_eclient_playlist_set(client, playlist_modify_updated, mod->playlist, + vec, m, mod); } /* Playlists window --------------------------------------------------------- */ @@ -907,7 +1249,7 @@ void playlist_window_create(gpointer attribute((unused)) callback_data, g_signal_connect(playlist_window, "key-press-event", G_CALLBACK(playlist_window_keypress), 0); /* default size is too small */ - gtk_window_set_default_size(GTK_WINDOW(playlist_window), 512, 240); + gtk_window_set_default_size(GTK_WINDOW(playlist_window), 640, 320); GtkWidget *hbox = gtk_hbox_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), playlist_picker_create(), @@ -940,6 +1282,7 @@ static gboolean playlist_window_keypress(GtkWidget attribute((unused)) *widget, static void playlist_window_destroyed(GtkWidget attribute((unused)) *widget, GtkWidget **widget_pointer) { destroy_queuelike(&ql_playlist); + playlist_picker_destroy(); *widget_pointer = NULL; } @@ -963,10 +1306,10 @@ void playlists_init(void) { event_register("playlists-updated", playlist_picker_fill, 0); /* Update the displayed playlist when it is modified */ event_register("playlist-modified", playlist_editor_fill, 0); + /* Update the shared/public/etc buttons when a playlist is modified */ + event_register("playlist-modified", playlist_editor_set_buttons, 0); } -#endif - /* Local Variables: c-basic-offset:2