chiark / gitweb /
Add 'self' argument to queuelike callbacks. Not used yet - presumably
authorRichard Kettlewell <rjk@greenend.org.uk>
Sun, 8 Nov 2009 13:36:38 +0000 (13:36 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sun, 8 Nov 2009 13:36:38 +0000 (13:36 +0000)
playlist editors will need one though.

disobedience/added.c
disobedience/queue-generic.c
disobedience/queue-generic.h
disobedience/queue.c
disobedience/recent.c

index 32628ac93c16245907296bb7fdd55f5aa2a4387e..7f654ee48ac18400fd1744aaaf9fe73a32b24b3f 100644 (file)
@@ -66,7 +66,7 @@ static void added_changed(const char attribute((unused)) *event,
 }
 
 /** @brief Called at startup */
 }
 
 /** @brief Called at startup */
-static void added_init(void) {
+static void added_init(struct queuelike attribute((unused)) *ql) {
   event_register("rescan-complete", added_changed, 0);
 }
 
   event_register("rescan-complete", added_changed, 0);
 }
 
index f14f424bdaba959d64e34fd9a5669b8fea98518d..c64e5d0903c035866f6527a0806f4287f342a6d5 100644 (file)
@@ -508,7 +508,7 @@ static void ql_row_deleted(GtkTreeModel attribute((unused)) *treemodel,
       --srcrow;
 
     /* Tell the queue implementation */
       --srcrow;
 
     /* Tell the queue implementation */
-    ql->drop(srcrow, dstrow);
+    ql->drop(ql, srcrow, dstrow);
 
     /* Dispose of stashed data */
     gtk_tree_path_free(ql->drag_target);
 
     /* Dispose of stashed data */
     gtk_tree_path_free(ql->drag_target);
@@ -574,7 +574,7 @@ GtkWidget *init_queuelike(struct queuelike *ql) {
   
   /* TODO style? */
 
   
   /* TODO style? */
 
-  ql->init();
+  ql->init(ql);
 
   /* Update display text when lookups complete */
   event_register("lookups-completed", queue_lookups_completed, ql);
 
   /* Update display text when lookups complete */
   event_register("lookups-completed", queue_lookups_completed, ql);
index 8dd9fdb3dc81ecddcdbc70dcfc5eb35157892b3b..fdf37a9d049fec23e3dd915788ff42d4df3e5cba 100644 (file)
@@ -55,7 +55,7 @@ struct queuelike {
   const char *name;
   
   /** @brief Initialization function */
   const char *name;
   
   /** @brief Initialization function */
-  void (*init)(void);
+  void (*init)(struct queuelike *ql);
 
   /** @brief Columns */
   const struct queue_column *columns;
 
   /** @brief Columns */
   const struct queue_column *columns;
@@ -98,7 +98,7 @@ struct queuelike {
    * If the rearrangement is impossible then the displayed queue must be put
    * back.
    */
    * If the rearrangement is impossible then the displayed queue must be put
    * back.
    */
-  void (*drop)(int src, int dst);
+  void (*drop)(struct queuelike *ql, int src, int dst);
 
   /** @brief Stashed drag target row */
   GtkTreePath *drag_target;
 
   /** @brief Stashed drag target row */
   GtkTreePath *drag_target;
index a051090ad37d2543fe367c5c72e49c76fcf1a936..7421ef8d48945e313e0bf0eb0825a7b44085c2e1 100644 (file)
@@ -139,7 +139,7 @@ static gboolean playing_periodic(gpointer attribute((unused)) data) {
 }
 
 /** @brief Called at startup */
 }
 
 /** @brief Called at startup */
-static void queue_init(void) {
+static void queue_init(struct queuelike attribute((unused)) *ql) {
   /* Arrange a callback whenever the playing state changes */ 
   event_register("playing-changed", playing_changed, 0);
   /* We reget both playing track and queue at pause/resume so that start times
   /* Arrange a callback whenever the playing state changes */ 
   event_register("playing-changed", playing_changed, 0);
   /* We reget both playing track and queue at pause/resume so that start times
@@ -162,7 +162,8 @@ static void queue_move_completed(void attribute((unused)) *v,
 }
 
 /** @brief Called when drag+drop completes */
 }
 
 /** @brief Called when drag+drop completes */
-static void queue_drop(int src, int dst) {
+static void queue_drop(struct queuelike attribute((unused)) *ql,
+                       int src, int dst) {
   struct queue_entry *sq, *dq;
   int n;
 
   struct queue_entry *sq, *dq;
   int n;
 
index 0923a6d240ee852e224b9ce277ac87e8dffef234..f53e6313f654a7535e52104c3b9ac9da4e77cdb8 100644 (file)
@@ -61,7 +61,7 @@ static void recent_changed(const char attribute((unused)) *event,
 }
 
 /** @brief Called at startup */
 }
 
 /** @brief Called at startup */
-static void recent_init(void) {
+static void recent_init(struct queuelike attribute((unused)) *ql) {
   /* Whenever the recent list changes on the server, re-fetch it */
   event_register("recent-changed", recent_changed, 0);
 }
   /* Whenever the recent list changes on the server, re-fetch it */
   event_register("recent-changed", recent_changed, 0);
 }