#include "BenchmarkDialogRes.h"
#include "../../GuiCommon.rc"

#define xc 332
#define yc 228

#undef g0xs
#undef g1x
#undef g1xs
#undef g2xs
#undef g3x
#undef g3xs
#undef g4x

#define gs 160
#define gSpace 24

#define g0xs 90
#define g1xs 44
#define g1x  (m + g0xs)
#define gc2x  (g1x + g1xs + m)
#define gc2xs 80

#define g4x (m + m)

#define sRating 60
#define sSpeed 60
#define sUsage 60
#define sRpu 60

#define xRating (xs - m - m - sRating)
#define xRpu (xRating - sRpu)
#define xUsage (xRpu - sUsage)
#define xSpeed (xUsage - sSpeed)

#define sLabel (xUsage - g4x)
#define sTotalRating (sUsage + sRpu + sRating + m + m)
#define xTotalRating (xs - m - sTotalRating)

#define g2xs 58
#define g3xs 36
#define g3x (m + g2xs)


IDD_DIALOG_BENCHMARK DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE | WS_MINIMIZEBOX
CAPTION "Benchmark"
MY_FONT
BEGIN
  PUSHBUTTON  "&Restart", IDC_BUTTON_RESTART, bx1, m, bxs, bys
  PUSHBUTTON  "&Stop",    IDC_BUTTON_STOP,    bx1, m + bys + 6, bxs, bys
  
  PUSHBUTTON  "&Help",    IDHELP,             bx2, by, bxs, bys
  PUSHBUTTON  "Cancel",   IDCANCEL,           bx1, by, bxs, bys
  
  LTEXT     "&Dictionary size:", IDC_BENCHMARK_DICTIONARY, m, m + 1, g0xs, 8
  COMBOBOX  IDC_BENCHMARK_COMBO_DICTIONARY, g1x, m, g1xs, 140, MY_COMBO
  LTEXT     "Memory usage:", IDC_BENCHMARK_MEMORY, gc2x, m + 1, gc2xs, 8
  LTEXT     "0 MB", IDC_BENCHMARK_MEMORY_VALUE, gc2x + gc2xs, m + 1, 40, 8

  LTEXT     "&Number of CPU threads:", IDC_BENCHMARK_NUM_THREADS, m, 28, g0xs, 8
  COMBOBOX  IDC_BENCHMARK_COMBO_NUM_THREADS, g1x, 27, g1xs, 140, MY_COMBO
  LTEXT     "1", IDC_BENCHMARK_HARDWARE_THREADS, gc2x, 28, 40, 8

  RTEXT     "CPU Usage", IDC_BENCHMARK_USAGE_LABEL,           xUsage,  54, sUsage,  8
  RTEXT     "Speed", IDC_BENCHMARK_SPEED_LABEL,               xSpeed,  54, sSpeed,  8
  RTEXT     "Rating / Usage", IDC_BENCHMARK_RPU_LABEL,          xRpu,  54, sRpu,    8
  RTEXT     "Rating", IDC_BENCHMARK_RATING_LABEL,            xRating,  54, sRating, 8
  
  GROUPBOX  "Compressing", IDC_BENCHMARK_COMPRESSING,              m,  64, xc, 40
 
  LTEXT     "Current", IDC_BENCHMARK_CURRENT,                    g4x,  76, sLabel,  8
  RTEXT     "100%", IDC_BENCHMARK_COMPRESSING_USAGE,          xUsage,  76, sUsage,  8
  RTEXT     "100 KB/s", IDC_BENCHMARK_COMPRESSING_SPEED,      xSpeed,  76, sSpeed,  8
  RTEXT     "0", IDC_BENCHMARK_COMPRESSING_RPU,                 xRpu,  76, sRpu,    8
  RTEXT     "0", IDC_BENCHMARK_COMPRESSING_RATING,           xRating,  76, sRating, 8
  
  LTEXT     "Resulting", IDC_BENCHMARK_RESULTING,                g4x,  89, sLabel,  8
  RTEXT     "100%", IDC_BENCHMARK_COMPRESSING_USAGE2,         xUsage,  89, sUsage,  8
  RTEXT     "100 KB/s", IDC_BENCHMARK_COMPRESSING_SPEED2,     xSpeed,  89, sSpeed,  8
  RTEXT     "0", IDC_BENCHMARK_COMPRESSING_RPU2,                xRpu,  89, sRpu,    8
  RTEXT     "0", IDC_BENCHMARK_COMPRESSING_RATING2,          xRating,  89, sRating, 8
  
  GROUPBOX  "Decompressing", IDC_BENCHMARK_DECOMPRESSING,          m, 111, xc, 40

  LTEXT     "Current", IDC_BENCHMARK_CURRENT2,                   g4x, 123,  sLabel, 8
  RTEXT     "100%", IDC_BENCHMARK_DECOMPRESSING_USAGE,        xUsage, 123,  sUsage, 8
  RTEXT     "100 KB/s", IDC_BENCHMARK_DECOMPRESSING_SPEED,    xSpeed, 123,  sSpeed, 8
  RTEXT     "0", IDC_BENCHMARK_DECOMPRESSING_RPU,               xRpu, 123,    sRpu, 8
  RTEXT     "0", IDC_BENCHMARK_DECOMPRESSING_RATING,         xRating, 123, sRating, 8
  
  LTEXT     "Resulting", IDC_BENCHMARK_RESULTING2,               g4x, 136,  sLabel, 8
  RTEXT     "100%", IDC_BENCHMARK_DECOMPRESSING_USAGE2,       xUsage, 136,  sUsage, 8
  RTEXT     "100 KB/s", IDC_BENCHMARK_DECOMPRESSING_SPEED2,   xSpeed, 136,  sSpeed, 8
  RTEXT     "0", IDC_BENCHMARK_DECOMPRESSING_RPU2,              xRpu, 136,    sRpu, 8
  RTEXT     "0", IDC_BENCHMARK_DECOMPRESSING_RATING2,        xRating, 136, sRating, 8
  
  GROUPBOX  "Total Rating", IDC_BENCHMARK_TOTAL_RATING, xTotalRating, 163, sTotalRating, 38
  RTEXT     "0", IDC_BENCHMARK_TOTAL_USAGE_VALUE,             xUsage, 181,  sUsage, 8
  RTEXT     "0", IDC_BENCHMARK_TOTAL_RPU_VALUE,                 xRpu, 181,    sRpu, 8
  RTEXT     "0", IDC_BENCHMARK_TOTAL_RATING_VALUE,           xRating, 181, sRating, 8
  
  LTEXT     "Elapsed time:", IDC_BENCHMARK_ELAPSED,    m, 163, g2xs, 8
  LTEXT     "Size:", IDC_BENCHMARK_SIZE,               m, 176, g2xs, 8
  LTEXT     "Passes:", IDC_BENCHMARK_PASSES,           m, 189, g2xs, 8
  RTEXT     "00:00:00", IDC_BENCHMARK_ELAPSED_VALUE, g3x, 163, g3xs, 8
  RTEXT     "0", IDC_BENCHMARK_SIZE_VALUE,           g3x, 176, g3xs, 8
  RTEXT     "0", IDC_BENCHMARK_PASSES_VALUE,         g3x, 189, g3xs, 8
END

#ifdef UNDER_CE

#undef m
#define m 4

#undef xc
#undef yc

#define xc 154
#define yc 160

#undef g0xs
#undef g1x
#undef g1xs
#undef g2xs
#undef g3x
#undef g3xs

#undef bxs
#undef bys

#define bxs 60
#define bys 14

#undef gs
#undef gSpace

#define gs 160
#define gSpace 24

#define g0xs (xc - bxs)
#define g1xs 44

#undef g4x
#define g4x (m)

#undef xRpu
#undef xUsage
#undef xRating
#undef xTotalRating

#undef sRpu
#undef sRating
#undef sUsage
#undef sLabel
#undef sTotalRating

#define sRating 40
#define sUsage 24
#define sRpu 40

#define xRating (xs - m - sRating)
#define xRpu (xRating - sRpu)
#define xUsage (xRpu - sUsage)

#define sLabel (xUsage - g4x)
#define sTotalRating (sRpu + sRating)
#define xTotalRating (xs - m - sTotalRating)

#define g3xs 32
#define g3x (xRpu - g3xs)
#define g2xs (g3x - m)


IDD_DIALOG_BENCHMARK_2 DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE | WS_MINIMIZEBOX
CAPTION "Benchmark"
MY_FONT
BEGIN
  PUSHBUTTON  "&Restart", IDC_BUTTON_RESTART, bx1, m, bxs, bys
  PUSHBUTTON  "&Stop",    IDC_BUTTON_STOP,    bx1, m + bys + m, bxs, bys
  PUSHBUTTON  "Cancel",   IDCANCEL,           bx1, m + bys + m + bys + m, bxs, bys
  
  LTEXT     "&Dictionary size:", IDC_BENCHMARK_DICTIONARY, m, m, g0xs, 8
  COMBOBOX  IDC_BENCHMARK_COMBO_DICTIONARY, m, m + 11, g1xs, 140, MY_COMBO

  LTEXT     "&Number of CPU threads:", IDC_BENCHMARK_NUM_THREADS, m, 31, g0xs, 8
  COMBOBOX  IDC_BENCHMARK_COMBO_NUM_THREADS, m, 42, g1xs, 140, MY_COMBO

  LTEXT     "0 MB", IDC_BENCHMARK_MEMORY_VALUE, m + g1xs + 8, m + 13, xc - bxs - g1xs - 8, 8
  LTEXT     "1", IDC_BENCHMARK_HARDWARE_THREADS, m + g1xs + 8, 44, xc - bxs - g1xs - 8, 8
  
  LTEXT     "Current", IDC_BENCHMARK_CURRENT,                    g4x,  70, sLabel,  8
  RTEXT     "100%", IDC_BENCHMARK_COMPRESSING_USAGE,          xUsage,  70, sUsage,  8
  RTEXT     "0", IDC_BENCHMARK_COMPRESSING_RPU,                 xRpu,  70, sRpu,    8
  RTEXT     "0", IDC_BENCHMARK_COMPRESSING_RATING,           xRating,  70, sRating, 8

  LTEXT     "Resulting", IDC_BENCHMARK_RESULTING,                g4x,  80, sLabel,  8
  RTEXT     "100%", IDC_BENCHMARK_COMPRESSING_USAGE2,         xUsage,  80, sUsage,  8
  RTEXT     "0", IDC_BENCHMARK_COMPRESSING_RPU2,                xRpu,  80, sRpu,    8
  RTEXT     "0", IDC_BENCHMARK_COMPRESSING_RATING2,          xRating,  80, sRating, 8

  LTEXT     "Compressing", IDC_BENCHMARK_COMPRESSING,              m,  60, xc - bxs, 8
  
  LTEXT     "Current", IDC_BENCHMARK_CURRENT2,                   g4x, 104,  sLabel, 8
  RTEXT     "100%", IDC_BENCHMARK_DECOMPRESSING_USAGE,        xUsage, 104,  sUsage, 8
  RTEXT     "0", IDC_BENCHMARK_DECOMPRESSING_RPU,               xRpu, 104,  sRpu, 8
  RTEXT     "0", IDC_BENCHMARK_DECOMPRESSING_RATING,         xRating, 104, sRating, 8
  
  LTEXT     "Resulting", IDC_BENCHMARK_RESULTING2,               g4x, 114,  sLabel, 8
  RTEXT     "100%", IDC_BENCHMARK_DECOMPRESSING_USAGE2,       xUsage, 114,  sUsage, 8
  RTEXT     "0", IDC_BENCHMARK_DECOMPRESSING_RPU2,              xRpu, 114,    sRpu, 8
  RTEXT     "0", IDC_BENCHMARK_DECOMPRESSING_RATING2,        xRating, 114, sRating, 8
  
  LTEXT  "Decompressing", IDC_BENCHMARK_DECOMPRESSING,          m, 94, xc, 8

  RTEXT     "0", IDC_BENCHMARK_TOTAL_RPU_VALUE,                 xRpu, 140,    sRpu, 8
  RTEXT     "0", IDC_BENCHMARK_TOTAL_RATING_VALUE,           xRating, 140, sRating, 8
  
  LTEXT     "Elapsed time:", IDC_BENCHMARK_ELAPSED,    m, 130, g2xs, 8
  LTEXT     "Size:", IDC_BENCHMARK_SIZE,               m, 140, g2xs, 8
  LTEXT     "Passes:", IDC_BENCHMARK_PASSES,           m, 150, g2xs, 8

  RTEXT     "00:00:00", IDC_BENCHMARK_ELAPSED_VALUE, g3x, 130, g3xs, 8
  RTEXT     "0", IDC_BENCHMARK_SIZE_VALUE,           g3x, 140, g3xs, 8
  RTEXT     "0", IDC_BENCHMARK_PASSES_VALUE,         g3x, 150, g3xs, 8
END

#endif
