other-licenses/7zstub/src/Windows/Control/ProgressBar.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 // Windows/Control/ProgressBar.h
     3 #ifndef __WINDOWS_CONTROL_PROGRESSBAR_H
     4 #define __WINDOWS_CONTROL_PROGRESSBAR_H
     6 #include "Windows/Window.h"
     7 #include "Windows/Defs.h"
     9 namespace NWindows {
    10 namespace NControl {
    12 class CProgressBar: public CWindow
    13 {
    14 public:
    15   LRESULT SetPos(int pos)
    16     { return SendMessage(PBM_SETPOS, pos, 0); }
    17   LRESULT DeltaPos(int increment)
    18     { return SendMessage(PBM_DELTAPOS, increment, 0); }
    19   UINT GetPos()
    20     { return SendMessage(PBM_GETPOS, 0, 0); }
    21   LRESULT SetRange(unsigned short minValue, unsigned short maxValue)
    22     { return SendMessage(PBM_SETRANGE, 0, MAKELPARAM(minValue, maxValue)); }
    23   DWORD SetRange32(int minValue, int maxValue)
    24     { return SendMessage(PBM_SETRANGE32, minValue, maxValue); }
    25   int SetStep(int aStep)
    26     { return SendMessage(PBM_SETSTEP, aStep, 0); }
    27   int StepIt()
    28     { return SendMessage(PBM_STEPIT, 0, 0); }
    30   int GetRange(bool minValue, PPBRANGE range)
    31     { return SendMessage(PBM_GETRANGE, BoolToBOOL(minValue), (LPARAM)range); }
    33   COLORREF SetBarColor(COLORREF color)
    34     { return SendMessage(PBM_SETBARCOLOR, 0, color); }
    35   COLORREF SetBackgroundColor(COLORREF color)
    36     { return SendMessage(PBM_SETBKCOLOR, 0, color); }
    37 };
    39 }}
    41 #endif

mercurial