- Notifications
You must be signed in to change notification settings - Fork2.7k
/
Copy pathui.h
108 lines (95 loc) · 4.27 KB
/
ui.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*
* Rufus: The Reliable USB Formatting Utility
* UI-related function calls
* Copyright © 2018 Pete Batard <pete@akeo.ie>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include<windows.h>
#include<stdint.h>
#include"resource.h"
#include"localization.h"
#pragma once
// Progress bar colors
#definePROGRESS_BAR_NORMAL_TEXT_COLORRGB(0x00, 0x00, 0x00)
#definePROGRESS_BAR_INVERTED_TEXT_COLORRGB(0xFF, 0xFF, 0xFF)
#definePROGRESS_BAR_BACKGROUND_COLORRGB(0xE6, 0xE6, 0xE6)
#definePROGRESS_BAR_BOX_COLORRGB(0xBC, 0xBC, 0xBC)
#definePROGRESS_BAR_NORMAL_COLORRGB(0x06, 0xB0, 0x25)
#definePROGRESS_BAR_PAUSED_COLORRGB(0xDA, 0xCB, 0x26)
#definePROGRESS_BAR_ERROR_COLORRGB(0xDA, 0x26, 0x26)
// Toolbar icons main color
#defineTOOLBAR_ICON_COLORRGB(0x29, 0x80, 0xB9)
// Toolbar default style
#defineTOOLBAR_STYLE( WS_CHILD | WS_TABSTOP | WS_VISIBLE | \
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | \
CCS_NOPARENTALIGN | CCS_NODIVIDER | \
TBSTYLE_FLAT | TBSTYLE_BUTTON | \
TBSTYLE_AUTOSIZE | TBSTYLE_LIST | \
TBSTYLE_TOOLTIPS )
// Types of update progress we report
enumupdate_progress_type {
UPT_PERCENT=0,
UPT_SPEED,
UPT_ETA,
UPT_MAX
};
// Size of the download speed history ring.
#defineSPEED_HISTORY_SIZE 20
// The minimum time length of a history sample. By default, each sample is at least 150ms long,
// which means that, over the course of 20 samples, "current" download speed spans at least 3s
// into the past.
#defineSPEED_SAMPLE_MIN 150
// The time after which the download starts to be considered "stalled", i.e. the current
// bandwidth is not printed and the recent download speeds are scratched.
#defineSTALL_START_TIME 5000
// Time between screen refreshes will not be shorter than this.
// NB: In Rufus' case, "screen" means the text overlaid on the progress bar.
#defineSCREEN_REFRESH_INTERVAL 200
// Don't refresh the ETA too often to avoid jerkiness in predictions.
// This allows ETA to change approximately once per second.
#defineETA_REFRESH_INTERVAL 990
externHWNDhMultiToolbar,hSaveToolbar,hHashToolbar,hAdvancedDeviceToolbar,hAdvancedFormatToolbar;
externHFONThInfoFont;
externUINT_PTRUM_LANGUAGE_MENU_MAX;
externBOOLadvanced_mode_device,advanced_mode_format,force_large_fat32,app_changed_size;
externloc_cmd*selected_locale;
externuint64_tpersistence_size;
externconstchar*sfd_name,*flash_type[BADLOCKS_PATTERN_TYPES];
externchar*short_image_path,image_option_txt[128];
externintadvanced_device_section_height,advanced_format_section_height,persistence_unit_selection;
externintselection_default,cbw,ddw,ddbh,bh,update_progress_type;
externvoidSetAccessibleName(HWNDhCtrl,constchar*name);
externvoidSetComboEntry(HWNDhDlg,intdata);
externvoidGetBasicControlsWidth(HWNDhDlg);
externvoidGetMainButtonsWidth(HWNDhDlg);
externvoidGetHalfDropwdownWidth(HWNDhDlg);
externvoidGetFullWidth(HWNDhDlg);
externvoidPositionMainControls(HWNDhDlg);
externvoidAdjustForLowDPI(HWNDhDlg);
externvoidSetSectionHeaders(HWNDhDlg);
externvoidSetPersistencePos(uint64_tpos);
externvoidSetPersistenceSize(void);
externvoidTogglePersistenceControls(BOOLdisplay);
externvoidToggleAdvancedDeviceOptions(BOOLenable);
externvoidToggleAdvancedFormatOptions(BOOLenable);
externvoidToggleImageOptions(void);
externvoidCreateSmallButtons(HWNDhDlg);
externvoidCreateAdditionalControls(HWNDhDlg);
externvoidEnableControls(BOOLenable,BOOLremove_checkboxes);
externvoidInitProgress(BOOLbOnlyFormat);
externvoidShowLanguageMenu(RECTrcExclude);
externvoidSetPassesTooltip(void);
externvoidSetBootTypeDropdownWidth(void);
externvoidOnPaint(HDChdc);