Skip to content

Commit

Permalink
More bug-fixing, refactoring, release
Browse files Browse the repository at this point in the history
  • Loading branch information
makuke1234 committed Jan 23, 2022
1 parent d35d46d commit 271f0ae
Show file tree
Hide file tree
Showing 15 changed files with 194 additions and 394 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,21 @@ The x86 (32-bit) Windows binaries can be downloaded [here](https://github.com/ma

# Changelog

* 0.4 (planned)
* 0.5 (planned)
* [ ] Add zooming capability

* 0.4
* Make about dialog always centered
* *About dialog button is also centered*
* Make window size less restricted
* More refactoring of codebase
* Optimise memory usage of file open dialogs
* Fix annoying bug with tab becoming active every time attempting to close it
* [ ] Add zooming capability
* Fix bug with scrolling multiple pages at once with some scrollwheels
* Prevent key spamming on tab closing
* Add status bar
* Update PDFium library
* Compress icon

* 0.3.0
* Develop about dialog
Expand Down
Binary file modified bin/pdfium.dll
Binary file not shown.
86 changes: 0 additions & 86 deletions pdfium/include/cpp/fpdf_deleters.h

This file was deleted.

67 changes: 0 additions & 67 deletions pdfium/include/cpp/fpdf_scopers.h

This file was deleted.

Binary file modified src/assets/appicon.ico
Binary file not shown.
12 changes: 6 additions & 6 deletions src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ namespace pdfv
nullptr,
nullptr
);
auto hfont{ MainWindow::mwnd.getDefFont() };
auto hfont{ window.getDefFont() };
w::setFont(button1, hfont, true);
w::setFont(button2, hfont, true);
w::setFont(messagebox, hfont, true);
Expand Down Expand Up @@ -302,7 +302,7 @@ namespace pdfv
{
DEBUGPRINT("pdfv::askInfo(%p, %p)\n", static_cast<const void *>(message.data()), static_cast<const void *>(title.data()));

WNDCLASSEXW wc{ MainWindow::mwnd.getWinClass() };
WNDCLASSEXW wc{ window.getWinClass() };
wc.lpfnWndProc = &pdfv::askProc;
wc.lpszClassName = L"AskInfoClass";
wc.lpszMenuName = nullptr;
Expand All @@ -311,7 +311,7 @@ namespace pdfv
{
return {};
}
MainWindow::mwnd.enable(false);
window.enable(false);
AskProc_finished = false;

wchar_t temp[2048]{};
Expand All @@ -324,14 +324,14 @@ namespace pdfv
CW_USEDEFAULT,
dip(330, dpi.x),
dip(142, dpi.y),
MainWindow::mwnd.getHwnd(),
window.getHandle(),
nullptr,
nullptr,
reinterpret_cast<LPVOID>(temp)
);
if (hwnd == nullptr) [[unlikely]]
{
MainWindow::mwnd.enable();
window.enable();
::UnregisterClassW(wc.lpszClassName, wc.hInstance);
return {};
}
Expand All @@ -354,7 +354,7 @@ namespace pdfv
}
::DestroyWindow(hwnd);

MainWindow::mwnd.enable();
window.enable();
::UnregisterClassW(wc.lpszClassName, wc.hInstance);
return temp;
}
Expand Down
2 changes: 1 addition & 1 deletion src/errors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void pdfv::error::report(pdfv::error::Errorcode errid, HWND hwnd) noexcept
}
void pdfv::error::report(pdfv::error::Errorcode errid) noexcept
{
pdfv::error::report(errid, MainWindow::mwnd.getHwnd());
pdfv::error::report(errid, pdfv::window.getHandle());
}

pdfv::error::Errorcode pdfv::error::lastErr = pdfv::error::Errorcode::success;
Expand Down
2 changes: 1 addition & 1 deletion src/lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ pdfv::error::Errorcode pdfv::Pdfium::pdfLoad(u8 * && data, std::size_t length, s
s_errorHappened = true;
if (auto err{ this->getLastError() }; err == error::pdf_password)
{
auto ans{ utf::conv(askInfo(L"Enter password:", MainWindow::mwnd.getTitle())) };
auto ans{ utf::conv(askInfo(L"Enter password:", window.getTitle())) };
this->m_fdoc = FPDF_LoadMemDocument(this->m_buf.get(), length, ans.c_str());
if (this->m_fdoc == nullptr) [[unlikely]]
{
Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE, LPWSTR cmdLine, int nCmdShow)
return pdfv::error::success;
}

if (!pdfv::MainWindow::mwnd.init(hInst, argc, argv.get())) [[unlikely]]
if (!pdfv::window.init(hInst, argc, argv.get())) [[unlikely]]
{
pdfv::error::report();
return pdfv::error::error;
}

if (!pdfv::MainWindow::mwnd.run(fname, nCmdShow)) [[unlikely]]
if (!pdfv::window.run(fname, nCmdShow)) [[unlikely]]
{
pdfv::error::report();
return pdfv::error::error;
}

return pdfv::MainWindow::mwnd.msgLoop();
return pdfv::window.msgLoop();
}
Loading

0 comments on commit 271f0ae

Please sign in to comment.