From 84527d3b733052108f0e6c49eae091d0b98712cf Mon Sep 17 00:00:00 2001 From: waker Date: Sat, 8 Aug 2009 21:25:28 +0200 Subject: started refactoring of gtkplaylist to share code between playlist and search windows --- gtkplaylist.h | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'gtkplaylist.h') diff --git a/gtkplaylist.h b/gtkplaylist.h index fabc03b7..feab283f 100644 --- a/gtkplaylist.h +++ b/gtkplaylist.h @@ -27,8 +27,32 @@ enum { TARGET_SAMEWIDGET, }; -void -gtkps_nextsong (void); +#define ps_ncolumns 5 +#define ps_colname_max 100 + +// structure of this kind must be set as user data for playlist, header and scrollbar widgets +// pointer to this structure must be passed too all functions that +// implement playlist functionality (like this pointer) +typedef struct { + // cached gtk/gdk object pointers + GtkWidget *playlist; + GtkWidget *header; + GtkWidget *scrollbar; + GdkPixmap *backbuf; + // parameters + playItem_t **phead; // pointer to head of list to display + int update_statusbar; // whether it needs to update status bar in certain cases + int has_dragndrop; // whether it has drag and drop capability + // current state + int scrollpos; + int row; + double clicktime; // for doubleclick detection + int nvisiblerows; + int16_t *fmtcache; // cached text formatting + int header_fitted[ps_ncolumns]; + char colnames_fitted[ps_ncolumns][ps_colname_max]; // cached formatted names of columns + int colwidths[ps_ncolumns]; // current column widths +} gtkplaylist_t; void redraw_ps_row (GtkWidget *widget, int row); -- cgit v1.2.3