From 442e457d7b3acabe5824842dd7f8149f933527d1 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sun, 5 Apr 2015 18:05:08 +1000 Subject: [PATCH] ShowImage: Added toolbar buttons for browsing multipage documents --- src/apps/showimage/ShowImageWindow.cpp | 5 +++ src/apps/showimage/ToolBarIcons.cpp | 52 +++++++++++++++++++++++++- src/apps/showimage/ToolBarIcons.h | 4 +- 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/src/apps/showimage/ShowImageWindow.cpp b/src/apps/showimage/ShowImageWindow.cpp index 306782878e..f8fd3d4757 100644 --- a/src/apps/showimage/ShowImageWindow.cpp +++ b/src/apps/showimage/ShowImageWindow.cpp @@ -199,6 +199,11 @@ ShowImageWindow::ShowImageWindow(BRect frame, const entry_ref& ref, B_TRANSLATE("Zoom in"), false); fToolBar->AddAction(MSG_ZOOM_OUT, this, tool_bar_icon(kIconZoomOut), B_TRANSLATE("Zoom out"), false); + fToolBar->AddSeparator(); + fToolBar->AddAction(MSG_PAGE_PREV, this, tool_bar_icon(kIconPagePrevious), + B_TRANSLATE("Previous page"), false); + fToolBar->AddAction(MSG_PAGE_NEXT, this, tool_bar_icon(kIconPageNext), + B_TRANSLATE("Next page"), false); fToolBar->AddGlue(); fToolBar->AddAction(MSG_FULL_SCREEN, this, tool_bar_icon(kIconViewWindowed), B_TRANSLATE("Leave full screen"), diff --git a/src/apps/showimage/ToolBarIcons.cpp b/src/apps/showimage/ToolBarIcons.cpp index 305d2ae864..475f5bd0aa 100644 --- a/src/apps/showimage/ToolBarIcons.cpp +++ b/src/apps/showimage/ToolBarIcons.cpp @@ -537,6 +537,54 @@ static const uint8 kZoomOut[] = { }; +static const uint8 kPagePrevious[] = { + 0x6e, 0x63, 0x69, 0x66, 0x07, 0x04, 0x00, 0x66, 0x05, 0x01, 0x03, 0x00, + 0x00, 0x80, 0x02, 0x00, 0x06, 0x02, 0x00, 0x00, 0x00, 0x3c, 0x60, 0x00, + 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x48, 0x9f, 0xff, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xd9, 0xd9, 0xff, 0x04, 0x00, 0x66, 0x03, + 0x28, 0x1b, 0x01, 0x02, 0x00, 0x06, 0x02, 0x00, 0x00, 0x00, 0x3c, 0x60, + 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x48, 0xa0, + 0x00, 0x00, 0xff, 0xa8, 0x00, 0xff, 0x92, 0x61, 0x03, 0x03, 0x0a, 0x04, + 0x2a, 0xb3, 0xcb, 0x48, 0xb3, 0xcb, 0x48, 0x48, 0x2a, 0x48, 0x0a, 0x07, + 0x40, 0x2e, 0x2c, 0x2e, 0x2c, 0x28, 0x22, 0x32, 0x2c, 0x3c, 0x2c, 0x36, + 0x40, 0x36, 0x0a, 0x07, 0x22, 0x35, 0x36, 0x22, 0x36, 0x2c, 0x48, 0x2c, + 0x48, 0x3e, 0x36, 0x3e, 0x36, 0x48, 0x06, 0x0a, 0x00, 0x01, 0x00, 0x30, + 0x1e, 0x22, 0x01, 0x17, 0x83, 0x22, 0x04, 0x0a, 0x02, 0x01, 0x00, 0x30, + 0x1c, 0x20, 0x01, 0x17, 0x83, 0x22, 0x04, 0x0a, 0x03, 0x01, 0x00, 0x20, + 0x1c, 0x20, 0x0a, 0x04, 0x01, 0x02, 0x12, 0x3d, 0xfe, 0x4e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3e, 0x16, 0x93, 0x46, 0xc2, 0x38, 0x46, 0xc3, + 0xc7, 0x01, 0x17, 0x83, 0x22, 0x04, 0x0a, 0x05, 0x01, 0x02, 0x12, 0x3d, + 0xfe, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x16, 0x93, 0x46, + 0x82, 0x54, 0x46, 0x80, 0xf5, 0x01, 0x17, 0x83, 0x22, 0x04, 0x0a, 0x06, + 0x01, 0x02, 0x02, 0x3d, 0xfe, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x16, 0x93, 0x46, 0x82, 0x54, 0x46, 0x80, 0xf5 +}; + + +static const uint8 kPageNext[] = { + 0x6e, 0x63, 0x69, 0x66, 0x07, 0x04, 0x00, 0x66, 0x05, 0x01, 0x03, 0x00, + 0x00, 0x80, 0x02, 0x00, 0x06, 0x02, 0x00, 0x00, 0x00, 0x3c, 0x60, 0x00, + 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x48, 0x9f, 0xff, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xd9, 0xd9, 0xff, 0x04, 0x00, 0x66, 0x03, + 0x26, 0x19, 0x01, 0x02, 0x00, 0x06, 0x02, 0x00, 0x00, 0x00, 0x3c, 0x60, + 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x48, 0xa0, + 0x00, 0x00, 0xff, 0xaa, 0x06, 0xff, 0x8d, 0x5e, 0x03, 0x03, 0x0a, 0x04, + 0x2a, 0xb3, 0xcb, 0x48, 0xb3, 0xcb, 0x48, 0x48, 0x2a, 0x48, 0x0a, 0x07, + 0x22, 0x36, 0x36, 0x36, 0x36, 0x3c, 0x40, 0x32, 0x36, 0x28, 0x36, 0x2e, + 0x22, 0x2e, 0x0a, 0x07, 0x48, 0x35, 0x34, 0x48, 0x34, 0x3e, 0x22, 0x3e, + 0x22, 0x2c, 0x34, 0x2c, 0x34, 0x22, 0x06, 0x0a, 0x00, 0x01, 0x00, 0x30, + 0x1e, 0x22, 0x01, 0x17, 0x83, 0x22, 0x04, 0x0a, 0x02, 0x01, 0x00, 0x30, + 0x1c, 0x20, 0x01, 0x17, 0x83, 0x22, 0x04, 0x0a, 0x03, 0x01, 0x00, 0x20, + 0x1c, 0x20, 0x0a, 0x04, 0x01, 0x02, 0x12, 0x3d, 0xfe, 0x4e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3e, 0x16, 0x93, 0x46, 0xbf, 0xe4, 0x46, 0xc3, + 0xc7, 0x01, 0x17, 0x83, 0x22, 0x04, 0x0a, 0x05, 0x01, 0x02, 0x12, 0x3d, + 0xfe, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x16, 0x93, 0x46, + 0x80, 0x00, 0x46, 0x80, 0xf5, 0x01, 0x17, 0x83, 0x22, 0x04, 0x0a, 0x06, + 0x01, 0x02, 0x02, 0x3d, 0xfe, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x16, 0x93, 0x46, 0x80, 0x00, 0x46, 0x80, 0xf5 +}; + + struct IconData { const uint8* data; size_t size; @@ -565,7 +613,9 @@ static IconData kIcons[] = { { kZoomFitViewBest, sizeof(kZoomFitViewBest), NULL }, { kZoomIn, sizeof(kZoomIn), NULL }, { kZoomOriginal, sizeof(kZoomOriginal), NULL }, - { kZoomOut, sizeof(kZoomOut), NULL } + { kZoomOut, sizeof(kZoomOut), NULL }, + { kPagePrevious, sizeof(kPagePrevious), NULL }, + { kPageNext, sizeof(kPageNext), NULL } }; diff --git a/src/apps/showimage/ToolBarIcons.h b/src/apps/showimage/ToolBarIcons.h index 9517b6c77c..57a68be73b 100644 --- a/src/apps/showimage/ToolBarIcons.h +++ b/src/apps/showimage/ToolBarIcons.h @@ -32,7 +32,9 @@ enum { kIconZoomFitViewBest, kIconZoomIn, kIconZoomOriginal, - kIconZoomOut + kIconZoomOut, + kIconPagePrevious, + kIconPageNext };