[easytag] Refactor cddb.h to only include prototypes



commit 36d0a48ea067bc2bf49d9090e3dcde3dbce4dc9a
Author: David King <amigadave amigadave com>
Date:   Mon Oct 7 22:02:43 2013 +0100

    Refactor cddb.h to only include prototypes
    
    Move declarations from cddb.h to cddb.h and make them static.

 src/cddb.c |   87 +++++++++++++++++++++++++++++++++++++++++++++++
 src/cddb.h |  109 +++--------------------------------------------------------
 2 files changed, 93 insertions(+), 103 deletions(-)
---
diff --git a/src/cddb.c b/src/cddb.c
index cd5a9dd..599b715 100644
--- a/src/cddb.c
+++ b/src/cddb.c
@@ -52,6 +52,53 @@
 #include "setting.h"
 #include "charset.h"
 
+/*
+ * Structure used for each item of the album list. Aslo attached to each row of
+ * the album list
+ */
+typedef struct
+{
+    gchar *server_name; /* Remote access: server name. Local access : NULL */
+    guint server_port; /* Remote access: server port. Local access: 0 */
+    gchar *server_cgi_path; /* Remote access: server CGI path.
+                             * Local access: discid file path */
+
+    GdkPixbuf *bitmap; /* Pixmap logo for the server. */
+
+    gchar *artist_album; /* CDDB artist+album (allocated) */
+    gchar *category; /* CDDB genre (allocated) */
+    gchar *id; /* example : 8d0de30c (allocated) */
+    GList *track_list; /* List of CddbTrackAlbum items. */
+    gboolean other_version; /* TRUE if this album is another version of the
+                             * previous one. */
+
+    /* Filled when loading the track list. */
+    gchar *artist; /* (allocated) */
+    gchar *album; /* (allocated) */
+    gchar *genre; /* (allocated) */
+    gchar *year; /* (allocated) */
+    guint duration;
+} CddbAlbum;
+
+
+/*
+ * Structure used for each item of the track_list of the CddbAlbum structure.
+ */
+typedef struct
+{
+    guint track_number;
+    gchar *track_name; /* (allocated) */
+    guint duration;
+    CddbAlbum *cddbalbum; /* Pointer to the parent CddbAlbum structure (to
+                           * quickly access album properties). */
+} CddbTrackAlbum;
+
+
+typedef struct
+{
+    gulong offset;
+} CddbTrackFrameOffset;
+
 enum
 {
     CDDB_ALBUM_LIST_PIXBUF,
@@ -107,6 +154,9 @@ static const guint BOX_SPACING = 6;
 /****************
  * Declarations *
  ****************/
+static GtkWidget *CddbWindow;
+static GtkWidget *CddbWindowHPaned;
+
 static GtkWidget *CddbNoteBook;
 static GList *CddbAlbumList = NULL;
 
@@ -135,6 +185,43 @@ static GtkWidget *CddbSelectAllInResultButton;
 static GtkWidget *CddbUnselectAllInResultButton;
 static GtkWidget *CddbInvertSelectionInResultButton;
 
+static GtkWidget *CddbShowCategoriesButton;
+
+static GtkWidget *CddbSeparatorH;
+static GtkWidget *CddbSeparatorV;
+
+static GtkWidget *CddbSearchInAllFields;
+static GtkWidget *CddbSearchInArtistField;
+static GtkWidget *CddbSearchInTitleField;
+static GtkWidget *CddbSearchInTrackNameField;
+static GtkWidget *CddbSearchInOtherField;
+
+static GtkWidget *CddbSetToAllFields;
+static GtkWidget *CddbSetToTitle;
+static GtkWidget *CddbSetToArtist;
+static GtkWidget *CddbSetToAlbum;
+static GtkWidget *CddbSetToYear;
+static GtkWidget *CddbSetToTrack;
+static GtkWidget *CddbSetToTrackTotal;
+static GtkWidget *CddbSetToGenre;
+static GtkWidget *CddbSetToFileName;
+
+static GtkWidget *CddbRunScanner;
+static GtkWidget *CddbUseDLM2; /* '2' as also used in prefs.c */
+static GtkWidget *CddbUseLocalAccess;
+
+static GtkWidget *CddbSearchInAllCategories;
+static GtkWidget *CddbSearchInBluesCategory;
+static GtkWidget *CddbSearchInClassicalCategory;
+static GtkWidget *CddbSearchInCountryCategory;
+static GtkWidget *CddbSearchInFolkCategory;
+static GtkWidget *CddbSearchInJazzCategory;
+static GtkWidget *CddbSearchInMiscCategory;
+static GtkWidget *CddbSearchInNewageCategory;
+static GtkWidget *CddbSearchInReggaeCategory;
+static GtkWidget *CddbSearchInRockCategory;
+static GtkWidget *CddbSearchInSoundtrackCategory;
+
 static gboolean CddbStopSearch = FALSE;
 
 
diff --git a/src/cddb.h b/src/cddb.h
index eb529ef..0cc502b 100644
--- a/src/cddb.h
+++ b/src/cddb.h
@@ -18,113 +18,16 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
+#ifndef ET_CDDB_H_
+#define ET_CDDB_H_
 
-#ifndef __CDDB_H__
-#define __CDDB_H__
+G_BEGIN_DECLS
 
-
-/****************
- * Declarations *
- ****************/
-
-GtkWidget *CddbWindow;
-GtkWidget *CddbWindowHPaned;
-
-GtkWidget *CddbSearchInAllFields;
-GtkWidget *CddbSearchInArtistField;
-GtkWidget *CddbSearchInTitleField;
-GtkWidget *CddbSearchInTrackNameField;
-GtkWidget *CddbSearchInOtherField;
-
-GtkWidget *CddbSeparatorH;
-GtkWidget *CddbSeparatorV;
-GtkWidget *CddbShowCategoriesButton;
-
-GtkWidget *CddbSearchInAllCategories;
-GtkWidget *CddbSearchInBluesCategory;
-GtkWidget *CddbSearchInClassicalCategory;
-GtkWidget *CddbSearchInCountryCategory;
-GtkWidget *CddbSearchInFolkCategory;
-GtkWidget *CddbSearchInJazzCategory;
-GtkWidget *CddbSearchInMiscCategory;
-GtkWidget *CddbSearchInNewageCategory;
-GtkWidget *CddbSearchInReggaeCategory;
-GtkWidget *CddbSearchInRockCategory;
-GtkWidget *CddbSearchInSoundtrackCategory;
-
-GtkWidget *CddbSetToAllFields;
-GtkWidget *CddbSetToTitle;
-GtkWidget *CddbSetToArtist;
-GtkWidget *CddbSetToAlbum;
-GtkWidget *CddbSetToYear;
-GtkWidget *CddbSetToTrack;
-GtkWidget *CddbSetToTrackTotal;
-GtkWidget *CddbSetToGenre;
-GtkWidget *CddbSetToFileName;
-
-GtkWidget *CddbRunScanner;
-GtkWidget *CddbUseDLM2; // '2' as also used in the prefs.c
-GtkWidget *CddbUseLocalAccess;
-
-
-
-/*
- * Structure used for each item of the album list. Aslo attached to each row of the album list
- */
-typedef struct _CddbAlbum CddbAlbum;
-struct _CddbAlbum
-{
-    gchar *server_name;     /* Remote access : Param of server name used for the connection     - Local 
access : NULL */
-    gint   server_port;     /* Remote access : Param of server port used for the connection     - Local 
access : 0 */
-    gchar *server_cgi_path; /* Remote access : Param of server cgi path used for the connection - Local 
access : discid file path */
-
-    GdkPixbuf *bitmap;      /* Pixmap corresponding to the server  */
-
-    gchar *artist_album;    /* CDDB artist+album (allocated) */
-    gchar *category;        /* CDDB genre (allocated) */
-    gchar *id;              /* example : 8d0de30c (allocated) */
-    GList *track_list;      /* List of tracks name of the album (list of CddbTrackAlbum items) */
-    gboolean other_version; /* To TRUE if this album is an other version of the previous one */
-
-    // We fill these data when loading the track list
-    gchar *artist;    /* (allocated) */
-    gchar *album;     /* (allocated) */
-    gchar *genre;     /* (allocated) */
-    gchar *year;      /* (allocated) */
-    guint  duration;
-};
-
-
-/*
- * Structure used for each item of the track_list of the CddbAlbum structure.
- */
-typedef struct _CddbTrackAlbum CddbTrackAlbum;
-struct _CddbTrackAlbum
-{
-    guint  track_number;
-    gchar *track_name;    /* (allocated) */
-    guint  duration;
-    CddbAlbum *cddbalbum; /* Pointer to the parent CddbAlbum structure (to access quickly to album 
properties) */
-};
-
-
-typedef struct _CddbTrackFrameOffset CddbTrackFrameOffset;
-struct _CddbTrackFrameOffset
-{
-    gulong  offset;
-};
-
-
-
-/**************
- * Prototypes *
- **************/
-
-void Init_CddbWindow  (void);
+void Init_CddbWindow (void);
 void Open_Cddb_Window (void);
 void Cddb_Popup_Menu_Search_Selected_File (void);
 void Cddb_Window_Apply_Changes (void);
 
+G_END_DECLS
 
-
-#endif /* __CDDB_H__ */
+#endif /* ET_CDDB_H_ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]