#pragma once #include "json.h" #include "List.h" #include "Constants.h" #include "Search.h" struct EpisodePage; struct TvShows { List* lists; ListNode* selectedList; int scrollY; struct EpisodePage* episodePage; WINDOW* window; const char* baseUrl; void** activePage; struct Search search; }; struct TvShowList { char* name; List* lis; ListNode* selectedLi; }; struct TvShowLi { char* name; int watchedEpisodes; int downloadedEpisodes; int totalEpisodes; int y; }; struct DrawPair { int y; int* linesToUpdate; }; void TvShows_init(struct TvShows* this); void TvShows_destroyMembers(struct TvShows* this); DEFAULT_CREATE_DESTROY_H(TvShow) void TvShows_searchForward(struct TvShows* this); void TvShows_searchBackward(struct TvShows* this); void TvShows_recreateWindowForData(struct TvShows* this); int TvShows_printAll(struct TvShows* this, int* linesToUpdate); bool TvShows_handleInput(struct TvShows* this, int c); void TvShows_selectFirstOrLast(struct TvShows* this, bool direction); void TvShows_selectDelta(struct TvShows* this, int delta); void TvShows_playSelected(struct TvShows* this); struct TvShowLi* TvShows_selectedTvShow(struct TvShows* this); void TvShows_fetch(struct TvShows* this, const char* url); void TvShows_restore(struct TvShows* this, json_value* json); void TvShows_restoreList(struct TvShows* this, const char* name, json_value* json); void TvShowList_init(struct TvShowList* this); void TvShowList_destroyMembers(struct TvShowList* this); DEFAULT_CREATE_DESTROY_H(TvShowList) struct DrawPair TvShowList_draw(struct TvShowList* this, WINDOW* window, int scrollY, struct DrawPair info); int TvShowList_selectDelta(struct TvShowList* this, WINDOW* window, int delta); void TvShowLi_init(struct TvShowLi* this); void TvShowLi_destroyMembers(struct TvShowLi* this); DEFAULT_CREATE_DESTROY_H(TvShowLi) struct TvShowLi* TvShowLi_restore(json_value* json); void TvShowLi_draw(struct TvShowLi* li, WINDOW* window, bool selected, int y); int TvShowLi_compare(void* a, void* b);