123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #ifndef GLOBAL_STATE_H_GUARD_
- #define GLOBAL_STATE_H_GUARD_
- #include "stringutils.h"
- #include "vec.h"
- #include <stdbool.h>
- #include <stdint.h>
- #include <inttypes.h>
- #define HASH64BIT uint_fast64_t
- enum StagesProcessing
- {
- STAGE_PROC_NONE,
- STAGE_PROC_SCANNING,
- STAGE_PROC_VALIDATING,
- STAGE_PROC_HASHD64,
- STAGE_PROC_COMPARED64,
- STAGE_PROC_DECOUPLING,
- STAGE_PROC_HASHD256,
- STAGE_PROC_COMPARED256,
- STAGE_PROC_FINISHED
- };
- enum StagesMeta
- {
- STAGE_NONE,
- STAGE_READY,
- STAGE_PROCESSING,
- STAGE_SORTING
- };
- typedef struct UIState
- {
- /* Stages */
- int stage;
- int processingStage;
- /* Window controls */
- bool helpScreen;
- bool buttonApplyOptions;
- bool buttonNext;
- bool buttonDelLeft;
- bool buttonDelRight;
- bool buttonDelBoth;
- bool buttonLaunch;
- bool buttonReset;
- bool buttonStopSorting;
- /* Options */
- bool recursive;
- bool extraPassD256;
- float threshSlider;
- bool biggerIsBetter;
- int resolution;
- char * windowName;
- string * statusline;
- string * threshString;
- string * directoryPaths;
- string * dirPathCount;
- float progress;
- string * imgLeftPath;
- string * imgRightPath;
- string * imgLeftResolution;
- string * imgRightResolution;
- string * groupCount;
- string * groupSize;
- string * totalDupes;
- string * fullPaths;
- string * processingExplained;
- } UIState;
- typedef struct ProcessingOptions
- {
- bool recursive;
- bool extraPassD256;
- float threshold;
- } ProcessingOptions;
- typedef struct Imagefile
- {
- string * path;
- HASH64BIT * hash;
- bool hashed;
- bool disposed;
- struct ImageGroup * group;
- } Imagefile;
- typedef vec_t(Imagefile *) imagefile_vec_t;
- typedef struct ImageGroup
- {
- size_t hashlen;
- HASH64BIT * hash;
- imagefile_vec_t images;
- } ImageGroup;
- typedef vec_t(ImageGroup *) imagegroup_vec_t;
- typedef vec_t(string *) string_vec_t;
- typedef struct FilesState
- {
- unsigned long hashedfiles;
- unsigned long failedfiles;
- unsigned long dupenum;
- int compareiter;
- string_vec_t dirs;
- imagegroup_vec_t groups;
- imagefile_vec_t images;
- } FilesState;
- void PUGS_Init ( void );
- #endif
|