chiark / gitweb /
Sorting for Disobedience track chooser. A rewrite: we now do a single
[disorder] / disobedience / disobedience.h
index 452526d9fd8f26ca818070dcc70e227db7d4bdd2..33cd9ad4ecd7d3930dc787ae6ce328748a52d370 100644 (file)
@@ -47,6 +47,8 @@
 #include "selection.h"
 #include "kvp.h"
 #include "eventdist.h"
+#include "split.h"
+#include "timeval.h"
 
 #include <glib.h>
 #include <gtk/gtk.h>
@@ -86,12 +88,17 @@ struct callbackdata {
  * have some callbacks to set them appropriately.
  */
 struct tabtype {
-  int (*properties_sensitive)(GtkWidget *tab);
-  int (*selectall_sensitive)(GtkWidget *tab);
-  int (*selectnone_sensitive)(GtkWidget *tab);
-  void (*properties_activate)(GtkWidget *tab);
-  void (*selectall_activate)(GtkWidget *tab);
-  void (*selectnone_activate)(GtkWidget *tab);
+  int (*properties_sensitive)(void *extra);
+  int (*selectall_sensitive)(void *extra);
+  int (*selectnone_sensitive)(void *extra);
+  void (*properties_activate)(GtkMenuItem *menuitem,
+                              gpointer user_data);
+  void (*selectall_activate)(GtkMenuItem *menuitem,
+                             gpointer user_data);
+  void (*selectnone_activate)(GtkMenuItem *menuitem,
+                              gpointer user_data);
+  void (*selected)(void);
+  void *extra;
 };
 
 /** @brief Button definitions */
@@ -111,6 +118,7 @@ extern GtkWidget *tabs;                 /* main tabs */
 extern disorder_eclient *client;        /* main client */
 
 extern unsigned long last_state;        /* last reported state */
+extern rights_type last_rights;         /* last reported rights bitmap */
 extern int playing;                     /* true if playing some track */
 extern int volume_l, volume_r;          /* current volume */
 extern double goesupto;                 /* volume upper bound */
@@ -134,8 +142,6 @@ void popup_protocol_error(int code,
 void properties(int ntracks, const char **tracks);
 /* Pop up a properties window for a list of tracks */
 
-void properties_reset(void);
-
 GtkWidget *scroll_widget(GtkWidget *child);
 /* Wrap a widget up for scrolling */
 
@@ -166,13 +172,7 @@ GtkWidget *create_buttons_box(struct button *buttons,
                               size_t nbuttons,
                               GtkWidget *box);
 
-/** @brief Type signature for a reset callback */
-typedef void reset_callback(void);
-
-void register_reset(reset_callback *callback);
-/* Register a reset callback */
-
-void reset(void);
+void logged_in(void);
 
 void all_update(void);
 /* Update everything */
@@ -181,10 +181,6 @@ void all_update(void);
 
 GtkWidget *menubar(GtkWidget *w);
 /* Create the menu bar */
-     
-void menu_update(int page);
-/* Called whenever the main menu might need to change.  PAGE is the current
- * page if known or -1 otherwise. */
 
 void users_set_sensitive(int sensitive);
 
@@ -213,6 +209,14 @@ void queue_properties(struct queuelike *ql);
 int queued(const char *track);
 /* Return nonzero iff TRACK is queued or playing */
 
+extern struct queue_entry *playing_track;
+
+/* Lookups */
+const char *namepart(const char *track,
+                     const char *context,
+                     const char *part);
+long namepart_length(const char *track);
+
 void namepart_update(const char *track,
                      const char *context,
                      const char *part);
@@ -268,35 +272,6 @@ void load_settings(void);
 void set_tool_colors(GtkWidget *w);
 void popup_settings(void);
 
-/* Widget leakage debugging rubbish ---------------------------------------- */
-
-#if MDEBUG
-#define NW(what) do {                                   \
-  if(++current##what % 100 > max##what) {               \
-    fprintf(stderr, "%s:%d: %d %s\n",                   \
-            __FILE__, __LINE__, current##what, #what);  \
-    max##what = current##what;                          \
-  }                                                     \
-} while(0)
-#define WT(what) static int current##what, max##what
-#define DW(what) (--current##what)
-#else
-#define NW(what) do { } while(0)
-#define DW(what) do { } while(0)
-#define WT(what) struct neverused
-#endif
-
-#if MTRACK
-extern const char *mtag;
-#define MTAG(x) do { mtag = x; } while(0)
-#define MTAG_PUSH(x) do { const char *save_mtag = mtag; mtag = x; (void)0
-#define MTAG_POP() mtag = save_mtag; } while(0)
-#else
-#define MTAG(x) do { } while(0)
-#define MTAG_PUSH(x) do {} while(0)
-#define MTAG_POP() do {} while(0)
-#endif
-
 #endif /* DISOBEDIENCE_H */
 
 /*