Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
270 additions
and
430 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,16 @@ | ||
/* ------------------------------------------------------------------------ | ||
* | ||
* Copyright 2006 | ||
* | ||
* MainWindow.h | ||
* | ||
* 2006.11.4 Jinwook Kim | ||
* | ||
* ------------------------------------------------------------------------ | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "../commonSrc/windowLib/ZWindow.h" | ||
|
||
void HandCursorProc(); | ||
|
||
|
||
class CMainWindow : public ZWindow | ||
{ | ||
class CMainWindow final : public ZWindow { | ||
public: | ||
CMainWindow(); | ||
~CMainWindow(); | ||
CMainWindow(); | ||
~CMainWindow(); | ||
|
||
virtual void SetWndProc(); | ||
|
||
virtual void SetWndProc(); | ||
HWND Create(HINSTANCE hInstance, HWND hParentHWND, int nCmdShow); | ||
static HMENU CreatePopupMenu(); | ||
|
||
HWND Create(HINSTANCE hInstance, HWND hParentHWND, int nCmdShow); | ||
static HMENU CreatePopupMenu(); | ||
protected: | ||
static void HandCursorProc(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,19 @@ | ||
/******************************************************************** | ||
* | ||
* Created by zelon(Kim, Jinwook - Korea) | ||
* | ||
* 2008. 6. 2 created | ||
* FileName : TaskBar.cpp | ||
* | ||
* http://zviewer.wimy.com | ||
*********************************************************************/ | ||
|
||
#include "stdafx.h" | ||
#include "stdafx.h" | ||
#include "TaskBar.h" | ||
|
||
/// 작업 표시줄을 보이게 해준다. | ||
void TaskBar::ShellTrayShow() | ||
{ | ||
/// 작업 표시줄을 보이게 해준다. | ||
HWND h = FindWindow(TEXT("Shell_TrayWnd"), TEXT("")); | ||
void TaskBar::Show() { | ||
const HWND handle = FindWindow(TEXT("Shell_TrayWnd"), TEXT("")); | ||
|
||
if ( h != INVALID_HANDLE_VALUE ) | ||
{ | ||
ShowWindow(h, SW_SHOW); | ||
} | ||
if ( handle != INVALID_HANDLE_VALUE ) { | ||
ShowWindow(handle, SW_SHOW); | ||
} | ||
} | ||
|
||
void TaskBar::ShellTrayHide() | ||
{ | ||
// 작업 표시줄을 보이게 해준다. | ||
HWND h = FindWindow(TEXT("Shell_TrayWnd"), TEXT("")); | ||
void TaskBar::Hide() { | ||
const HWND handle = FindWindow(TEXT("Shell_TrayWnd"), TEXT("")); | ||
|
||
if ( h != INVALID_HANDLE_VALUE ) | ||
{ | ||
ShowWindow(h, SW_HIDE); | ||
} | ||
if ( handle != INVALID_HANDLE_VALUE ) { | ||
ShowWindow(handle, SW_HIDE); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,7 @@ | ||
/******************************************************************** | ||
* | ||
* Created by zelon(Kim, Jinwook - Korea) | ||
* | ||
* 2008. 6. 2 created | ||
* FileName : TaskBar.h | ||
* | ||
* http://zviewer.wimy.com | ||
*********************************************************************/ | ||
#pragma once | ||
|
||
/// 작업 표시줄을 관리하는 클래스 | ||
class TaskBar | ||
{ | ||
class TaskBar final { | ||
public: | ||
/// 윈도우의 작업 표시줄을 보이게 해준다. | ||
static void ShellTrayShow(); | ||
|
||
/// 윈도우의 작업 표시줄을 숨긴다. | ||
static void ShellTrayHide(); | ||
|
||
static void Show(); | ||
static void Hide(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,126 +1,114 @@ | ||
#include "stdafx.h" | ||
#include "ZOption.h" | ||
|
||
ZOption & ZOption::GetInstance() | ||
{ | ||
static ZOption inst; | ||
return inst; | ||
ZOption & ZOption::GetInstance() { | ||
static ZOption inst; | ||
return inst; | ||
} | ||
|
||
|
||
ZOption::ZOption() | ||
{ | ||
/// 아래 값은 ZViewerAgent 에서만 true 이다 | ||
m_bDontSaveInstance = false; | ||
ZOption::ZOption() { | ||
/// 아래 값은 ZViewerAgent 에서만 true 이다 | ||
m_bDontSaveInstance = false; | ||
} | ||
|
||
void ZOption::LoadOption() | ||
{ | ||
TCHAR buffer[1024]; | ||
tstring ZOption::GetOptionFileFullPath() { | ||
TCHAR buffer[1024] = { 0, }; | ||
|
||
/// C:\Documents and Settings\USERID\Local Settings\Application Data 의 위치를 얻어온다. | ||
if ( S_OK != SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, buffer) ) | ||
{ | ||
m_strOptionFilename = GetProgramFolder(); | ||
} | ||
else | ||
{ | ||
m_strOptionFilename = buffer; | ||
} | ||
tstring file_path; | ||
|
||
/// C:\Documents and Settings\USERID\Local Settings\Application Data 의 위치를 얻어온다. | ||
if ( S_OK != SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, buffer) ) { | ||
file_path = GetProgramFolder(); | ||
} else { | ||
file_path = buffer; | ||
} | ||
|
||
file_path += TEXT("\\zviewer.ini"); | ||
|
||
return file_path; | ||
} | ||
|
||
m_strOptionFilename += TEXT("\\zviewer.ini"); | ||
m_bOptionChanged = false; | ||
void ZOption::LoadOption() { | ||
m_strOptionFilename = GetOptionFileFullPath(); | ||
|
||
/// 기본적인 옵션은 설정해둔다. | ||
SetDefaultOption(); | ||
/// 기본적인 옵션은 설정해둔다. | ||
SetDefaultOption(); | ||
|
||
/// Make the table that indicate which key-value is mapped to which variable | ||
InitializeOptionMappingTable(); | ||
/// Make the table that indicate which key-value is mapped to which variable | ||
InitializeOptionMappingTable(); | ||
|
||
/// 기본적인 옵션에서 파일에서 불러온 설정을 덮어씌운다. | ||
LoadFromFile(); | ||
/// 기본적인 옵션에서 파일에서 불러온 설정을 덮어씌운다. | ||
LoadFromFile(); | ||
} | ||
|
||
/// Make the table that indicate which key-value is mapped to which variable | ||
void ZOption::InitializeOptionMappingTable() | ||
{ | ||
_InsertSaveOptionSetting(L"maximumcachememoryMB", &m_iMaximumCacheMemoryMB); | ||
_InsertSaveOptionSetting(L"maximumcachefilenum", &m_iMaxCacheImageNum); | ||
_InsertSaveOptionSetting(L"maximumcachememoryMB", &m_iMaximumCacheMemoryMB); | ||
_InsertSaveOptionSetting(L"maximumcachefilenum", &m_iMaxCacheImageNum); | ||
|
||
_InsertSaveOptionSetting(L"loop_view", &m_bLoopImages); | ||
_InsertSaveOptionSetting(L"loop_view", &m_bLoopImages); | ||
|
||
_InsertSaveOptionSetting(L"stretch_small_to_big", &m_bSmallToBigStretchImage); | ||
_InsertSaveOptionSetting(L"stretch_big_to_small", &m_bBigToSmallStretchImage); | ||
_InsertSaveOptionSetting(L"stretch_small_to_big", &m_bSmallToBigStretchImage); | ||
_InsertSaveOptionSetting(L"stretch_big_to_small", &m_bBigToSmallStretchImage); | ||
|
||
_InsertSaveOptionSetting(L"use_open_cmd_shell", &m_bUseOpenCMDInShell); | ||
_InsertSaveOptionSetting(L"use_preview_shell", &m_bUsePreviewInShell); | ||
_InsertSaveOptionSetting(L"use_open_cmd_shell", &m_bUseOpenCMDInShell); | ||
_InsertSaveOptionSetting(L"use_preview_shell", &m_bUsePreviewInShell); | ||
|
||
_InsertSaveOptionSetting(L"use_debug", &m_bUseDebug); | ||
_InsertSaveOptionSetting(L"use_debug", &m_bUseDebug); | ||
|
||
_InsertSaveOptionSetting(L"use_auto_rotation", &m_bUseAutoRotation); | ||
_InsertSaveOptionSetting(L"use_auto_rotation", &m_bUseAutoRotation); | ||
|
||
_InsertSaveOptionSetting(L"last_copy_directory", &m_strLastCopyDirectory); | ||
_InsertSaveOptionSetting(L"last_move_directory", &m_strLastMoveDirectory); | ||
_InsertSaveOptionSetting(L"last_copy_directory", &m_strLastCopyDirectory); | ||
_InsertSaveOptionSetting(L"last_move_directory", &m_strLastMoveDirectory); | ||
} | ||
|
||
/// 기본적인 옵션을 설정해둔다. 설치 후 처음 실행되었을 때 이 값을 기준으로 zviewer.ini 파일이 만들어진다. | ||
void ZOption::SetDefaultOption() | ||
{ | ||
m_bUsePreviewInShell = true; | ||
m_bUseOpenCMDInShell = false; | ||
is_always_on_top_window_ = false; | ||
is_slide_mode = false; | ||
m_iSlideModePeriodMiliSeconds = 5000; ///< Default slide mode period is 5 seconds | ||
m_bLoopImages = false; | ||
m_bUseAutoRotation = true; | ||
is_fullscreen_mode_ = false; | ||
m_bUseDebug = true; | ||
m_bBigToSmallStretchImage = false; | ||
m_bSmallToBigStretchImage = false; | ||
m_iMaximumCacheMemoryMB = 500; | ||
|
||
m_iMaxCacheImageNum = 20; | ||
void ZOption::SetDefaultOption() { | ||
m_bUsePreviewInShell = true; | ||
m_bUseOpenCMDInShell = false; | ||
is_always_on_top_window_ = false; | ||
is_slide_mode = false; | ||
m_iSlideModePeriodMiliSeconds = 5000; ///< Default slide mode period is 5 seconds | ||
m_bLoopImages = false; | ||
m_bUseAutoRotation = true; | ||
is_fullscreen_mode_ = false; | ||
m_bUseDebug = true; | ||
m_bBigToSmallStretchImage = false; | ||
m_bSmallToBigStretchImage = false; | ||
m_iMaximumCacheMemoryMB = 500; | ||
|
||
m_iMaxCacheImageNum = 10; | ||
|
||
#ifdef _DEBUG | ||
m_iMaxCacheImageNum = 10; | ||
m_iSlideModePeriodMiliSeconds = 1000; | ||
m_bUseOpenCMDInShell = true; | ||
m_bUseOpenCMDInShell = true; | ||
#endif | ||
} | ||
|
||
void ZOption::LoadFromFile() | ||
{ | ||
iniMap data; | ||
|
||
/// 파일로부터 설정 불러오기가 성공했을 때만 설정을 한다. | ||
if ( COptionFile::LoadFromFile(m_strOptionFilename, data) ) | ||
{ | ||
for ( size_t i=0; i<m_saveOptions.size(); ++i ) | ||
{ | ||
if ( data.count(m_saveOptions[i].getString()) > 0) | ||
{ | ||
m_saveOptions[i].InsertMapToValue(data); | ||
} | ||
} | ||
} | ||
void ZOption::LoadFromFile() { | ||
iniMap data; | ||
|
||
/// 파일로부터 설정 불러오기가 성공했을 때만 설정을 한다. | ||
if ( COptionFile::LoadFromFile(m_strOptionFilename, data) ) { | ||
for ( size_t i=0; i<m_saveOptions.size(); ++i ) { | ||
if ( data.count(m_saveOptions[i].getString()) > 0) { | ||
m_saveOptions[i].InsertMapToValue(data); | ||
} | ||
} | ||
} | ||
} | ||
|
||
void ZOption::SaveToFile() { | ||
/// To prevent from saving at ZViewerAgent | ||
if (m_bDontSaveInstance) { | ||
return; | ||
} | ||
|
||
iniMap data; | ||
|
||
for ( size_t i=0; i<m_saveOptions.size(); ++i ) { | ||
m_saveOptions[i].InsertValueToMap(data); | ||
} | ||
COptionFile::SaveToFile(m_strOptionFilename, data); | ||
} | ||
|
||
void ZOption::SaveToFile() | ||
{ | ||
/// ZViewerAgent 에서 마칠 때는 저장을 하지 않기 위해 | ||
if ( m_bDontSaveInstance ) return; | ||
|
||
iniMap data; | ||
|
||
m_bOptionChanged = true; | ||
|
||
// 저장해야하는 옵션 중 변경된 것이 있으면 | ||
if ( m_bOptionChanged ) | ||
{ | ||
for ( size_t i=0; i<m_saveOptions.size(); ++i ) | ||
{ | ||
m_saveOptions[i].InsertValueToMap(data); | ||
} | ||
COptionFile::SaveToFile(m_strOptionFilename, data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.