ml_history.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef ML_HISTORY_MAIN_H
  2. #define ML_HISTORY_MAIN_H
  3. #include "main.h"
  4. #include <windows.h>
  5. #include <commctrl.h>
  6. #include "..\..\General\gen_ml/gaystring.h"
  7. #include "..\..\General\gen_ml/config.h"
  8. #include "../nde/nde_c.h"
  9. #define HISTORYVIEW_COL_LASTPLAYED 0
  10. #define HISTORYVIEW_COL_PLAYCOUNT 1
  11. #define HISTORYVIEW_COL_TITLE 2
  12. #define HISTORYVIEW_COL_LENGTH 3
  13. #define HISTORYVIEW_COL_FILENAME 4
  14. #define HISTORYVIEW_COL_OFFSET 5
  15. #define UPDATE_QUERY_TIMER_ID 505
  16. extern int ml_history_tree;
  17. HWND onTreeViewSelectChange(HWND hwnd);
  18. int history_init();
  19. void history_quit();
  20. int openDb();
  21. void closeDb(bool clear_dirty=true);
  22. extern wchar_t g_tableDir[];
  23. extern C_Config *g_config;
  24. extern CRITICAL_SECTION g_db_cs;
  25. extern nde_database_t g_db;
  26. extern nde_table_t g_table;
  27. extern int g_table_dirty;
  28. inline BOOL WINAPI IsCharSpaceW(wchar_t c) { return (c == L' ' || c == L'\t'); }
  29. inline bool IsTheW(const wchar_t *str) { if (str && (str[0] == L't' || str[0] == L'T') && (str[1] == L'h' || str[1] == L'H') && (str[2] == L'e' || str[2] == L'E') && (str[3] == L' ')) return true; else return false; }
  30. #define SKIP_THE_AND_WHITESPACE(x) { wchar_t *save##x=(wchar_t*)x; while (IsCharSpaceW(*x) && *x) x++; if (IsTheW(x)) x+=4; while (IsCharSpaceW(*x)) x++; if (!*x) x=save##x; }
  31. void history_bgQuery_Stop();
  32. void history_onFile(const wchar_t *fn, int offset);
  33. int retrieve_offset(const wchar_t *fn);
  34. BOOL CALLBACK view_historyDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  35. BOOL CALLBACK view_errorinfoDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  36. void db_setFieldInt(nde_scanner_t s, unsigned char id, int data);
  37. void db_setFieldString(nde_scanner_t s, unsigned char id, const wchar_t *data);
  38. void makeFilename2(const wchar_t *filename, wchar_t *filename2, int filename2_len);
  39. void queryStrEscape(const char *p, GayString &str);
  40. INT_PTR pluginHandleIpcMessage(int msg, INT_PTR param);
  41. //prefs.cpp
  42. BOOL CALLBACK PrefsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
  43. #include "history.h"
  44. void allocRecentRecordList(historyRecordList *obj, int newsize, int granularity=512);
  45. void emptyRecentRecordList(historyRecordList *obj);
  46. void recentScannerRefToObjCacheNFN(nde_scanner_t s, historyRecordList *obj);
  47. void sortResults(historyRecordList *obj, int column, int dir);
  48. void freeRecentRecordList(historyRecordList *obj);
  49. void saveQueryToList(nde_scanner_t s, historyRecordList *obj);
  50. #endif ML_HISTORY_MAIN_H