-#include "stdafx.h"
+#include "stdafx.h"
#include "exception.h"
#include <objbase.h>
#include <wtypes.h>
{
error_ = it->second;
} else {
- error_ = (boost::wformat(L"0x%x \95s\96¾\82ÈCOM\83G\83\89\81[") % hr).str();
+ error_ = (boost::wformat(L"0x%x 不明なCOMエラー") % hr).str();
}
}
-#include "stdafx.h"
+#include "stdafx.h"
#include "message_loop.h"
namespace sf {
-#pragma once
+#pragma once
/*
==============================================================================
-/*
+/*
==============================================================================
This file is part of the S.F.Tracker
-#pragma once
+#pragma once
namespace sf {
// policy class
struct heap_memory_free_policy
-#include "stdafx.h"
+#include "stdafx.h"
#define BOOST_ASSIGN_MAX_PARAMS 7
#include <boost/assign.hpp>
#include <boost/assign/ptr_list_of.hpp>
void base_window::create_device_independent_resources()
{
- // Direct2DFactory \82Ì\90¶\90¬
+ // Direct2DFactory の生成
if(!factory_){
#if defined(DEBUG) || defined(_DEBUG)
wnd_class_.reset(new sf::window_class_ex(menu_name,name_,HINST_THISCOMPONENT,thunk_proc_,style,cbClsExtra,hIcon,hCursor,hbrBackground,hIconSm));
}
- /** \83f\83t\83H\83\8b\83g\90Ý\92è */
+ /** デフォルト設定 */
void base_window::register_class()
{
wnd_class_.reset(new sf::window_class_ex(0,name_,HINST_THISCOMPONENT,thunk_proc_));
//factory_->GetDesktopDpi(&dpiX, &dpiY);
- // Window\82ð\8dì\90¬\82·\82é
+ // Windowを作成する
CreateWindow(
name_.c_str(),
title_.c_str(),
HRESULT hr = S_OK;
- //\83E\83B\83\93\83h\83E\82Ì\8c»\8dÝ\82Ì\95\9d\81A\8d\82\82³\82ð\8b\81\82ß\82é
+ //ウィンドウの現在の幅、高さを求める
RECT rc;
GetClientRect( hwnd_, &rc );
boost::uint32_t width = rc.right - rc.left;
{
paint_struct begin_paint(hwnd);
- // \95`\89æ\83R\81[\83h\82Ì\8cÄ\82Ñ\8fo\82µ
+ // 描画コードの呼び出し
render();
}
return FALSE;
if(message == WM_CLOSE)
{
- // \8cã\8en\96\96
+ // 後始末
discard_device();
- // \83\8c\83\93\83_\81[\83^\81[\83Q\83b\83g\82Ì\83\8a\83\8a\81[\83X
+ // レンダーターゲットのリリース
safe_release(render_target_);
- // Window\82Ì\94j\8aü
+ // Windowの破棄
BOOL ret(::DestroyWindow(hwnd));
BOOST_ASSERT(ret != 0);
}
D2D1_RECT_F layoutRect = D2D1::RectF(50.f, 50.f, 600.f, 200.f);
IDWriteTextFormatPtr write_text_format;
- // Text Format\82Ì\8dì\90¬
+ // Text Formatの作成
THROW_IF_ERR(write_factory_->CreateTextFormat(
- L"\83\81\83C\83\8a\83I", // Font family name.
+ L"メイリオ", // Font family name.
NULL, // Font collection (NULL sets it to use the system font collection).
DWRITE_FONT_WEIGHT_REGULAR,
DWRITE_FONT_STYLE_NORMAL,
&write_text_format
));
// Actually draw the text at the origin.
- std::wstring m(L"\82±\82ñ\82É\82¿\82Í\81A64Bit\82Ì\90¢\8aE\81IBy S.F.");
+ std::wstring m(L"こんにちは、64Bitの世界!By S.F.");
render_target_->DrawTextW(
m.c_str(),
m.size(),
-#pragma once
+#pragma once
/*
*/
// Windows Header Files:
#include "exception.h"
#define XBYAK64
#include "xbyak.h"
-// DLL\82Ì\83\8a\83\93\83N
+// DLLのリンク
#pragma comment(lib,"d2d1.lib")
#pragma comment(lib,"winmm.lib")
#pragma comment(lib,"dwrite.lib")
boost::uint32_t destination_height = 0
);
- /** WNDCLASSEX\83\89\83b\83p\83N\83\89\83X */
+ /** WNDCLASSEXラッパクラス */
struct window_class_ex
{
window_class_ex(
bool left_button_,middle_button_,right_button_;
};
- /** window \83x\81[\83X\83N\83\89\83X */
+ /** window ベースクラス */
struct base_window
{
typedef boost::signals2::signal<LRESULT (HWND,boost::uint32_t,WPARAM, LPARAM) > on_message_type;
HICON hIconSm = NULL
);
- /** \83f\83t\83H\83\8b\83g\90Ý\92è */
+ /** デフォルト設定 */
void register_class();
void create_window();
void update();
return ptr->window_proc(hwnd,message,wParam,lParam);
};
- // this\82Æhwnd\82ð\82Â\82È\82®thunk\83N\83\89\83X
+ // thisとhwndをつなぐthunkクラス
struct hwnd_this_thunk : public Xbyak::CodeGenerator {
hwnd_this_thunk(base_window* impl,WNDPROC proc)
{
- // rcx\82Éhwnd\82ª\8ai\94[\82³\82ê\82Ä\82¢\82é\82Ì\82Å\81A\82»\82ê\82ðimpl->hwnd\82É\95Û\91¶
+ // rcxにhwndが格納されているので、それをimpl->hwndに保存
mov(qword[&(impl->hwnd_)],rcx);
- // \91ã\82í\82è\82Éthis\82Ì\83A\83h\83\8c\83X\82ðrcx\82É\8ai\94[
+ // 代わりにthisのアドレスをrcxに格納
mov(rcx,(LONG_PTR)impl);
- // r10\82Éproc(Window \83v\83\8d\83V\81[\83W\83\83)\82Ö\82Ì\83A\83h\83\8c\83X\82ð\8ai\94[
+ // r10にproc(Window プロシージャ)へのアドレスを格納
mov(r10,(LONG_PTR)proc);
- // Window \83v\83\8d\83V\81[\83W\83\83\82Ö\82Ö\83W\83\83\83\93\83v
+ // Window プロシージャへへジャンプ
jmp(r10);
}
};
struct toplevel_window;
typedef boost::shared_ptr<toplevel_window> toplevel_window_ptr;
- /** toplevel_window \82ð\90¶\90¬\82·\82é\8aÖ\90\94 */
+ /** toplevel_window を生成する関数 */
toplevel_window_ptr create_toplevel_window (
const std::wstring& menu_name,
const std::wstring& name,
- /** toplevel \83E\83B\83\93\83h\83E\83N\83\89\83X */
- /* \82±\82Ì\83N\83\89\83X\82Í\81Acreate_toplevel_window \8aÖ\90\94\82©\82ç\82Ì\82Ý\90¶\90¬\89Â\94\ */
+ /** toplevel ウィンドウクラス */
+ /* このクラスは、create_toplevel_window 関数からのみ生成可能 */
struct toplevel_window : public base_window
{
friend toplevel_window_ptr create_toplevel_window
-#pragma once
+#pragma once
/*
==============================================================================
-// stdafx.cpp : \95W\8f\80\83C\83\93\83N\83\8b\81[\83h\82Ì\82Ý\82ð\8aÜ\82Þ\83\\81[\83X \83t\83@\83C\83\8b\82Å\82·\81B
-// STed2.pch \82Í\81A\83v\83\8a\83R\83\93\83p\83C\83\8b\8dÏ\82Ý\83w\83b\83_\81[\82É\82È\82è\82Ü\82·\81B
-// stdafx.obj \82É\82Í\83v\83\8a\83R\83\93\83p\83C\83\8b\8c^\8fî\95ñ\82ª\8aÜ\82Ü\82ê\82Ü\82·\81B
+// stdafx.cpp : 標準インクルードのみを含むソース ファイルです。
+// STed2.pch は、プリコンパイル済みヘッダーになります。
+// stdafx.obj にはプリコンパイル型情報が含まれます。
#include "stdafx.h"
-// TODO: \82±\82Ì\83t\83@\83C\83\8b\82Å\82Í\82È\82\81ASTDAFX.H \82Å\95K\97v\82È
-// \92Ç\89Á\83w\83b\83_\81[\82ð\8eQ\8fÆ\82µ\82Ä\82\82¾\82³\82¢\81B
+// TODO: このファイルではなく、STDAFX.H で必要な
+// 追加ヘッダーを参照してください。
-// stdafx.h : \95W\8f\80\82Ì\83V\83X\83e\83\80 \83C\83\93\83N\83\8b\81[\83h \83t\83@\83C\83\8b\82Ì\83C\83\93\83N\83\8b\81[\83h \83t\83@\83C\83\8b\81A\82Ü\82½\82Í
-// \8eQ\8fÆ\89ñ\90\94\82ª\91½\82\81A\82©\82Â\82 \82Ü\82è\95Ï\8dX\82³\82ê\82È\82¢\81A\83v\83\8d\83W\83F\83N\83g\90ê\97p\82Ì\83C\83\93\83N\83\8b\81[\83h \83t\83@\83C\83\8b
-// \82ð\8bL\8fq\82µ\82Ü\82·\81B
+// stdafx.h : 標準のシステム インクルード ファイルのインクルード ファイル、または
+// 参照回数が多く、かつあまり変更されない、プロジェクト専用のインクルード ファイル
+// を記述します。
//
+
#pragma once
#include <SDKDDKVer.h>
//#include "logger.h"
-// TODO: \83v\83\8d\83O\83\89\83\80\82É\95K\97v\82È\92Ç\89Á\83w\83b\83_\81[\82ð\82±\82±\82Å\8eQ\8fÆ\82µ\82Ä\82\82¾\82³\82¢\81B
+// TODO: プログラムに必要な追加ヘッダーをここで参照してください。
-#pragma once
+#pragma once
/** @file
* @brief undo redo command class
* @author S.F. (Satoshi Fujiwara)
*/
-
#include <stack>
namespace sf {
namespace model {
-#include "stdafx.h"
+#include "stdafx.h"
#include "sf_windows.h"
#include "message_loop.h"
#include "sf_com.h"
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
- // COM\82Ì\8f\89\8aú\89»
+ // COMの初期化
sf::com_initialize init();
- // \83E\83B\83\93\83h\83E\82Ì\8dì\90¬
+ // ウィンドウの作成
sf::toplevel_window_ptr
window(sf::create_toplevel_window(std::wstring(L"Test Window"),std::wstring(L"Test Window")));
- // \83\81\83b\83Z\81[\83W\83\8b\81[\83v\82Ì\8eÀ\8ds
+ // メッセージループの実行
return sf::run_message_loop()();
+
}
\ No newline at end of file