OSDN Git Service

Fix build error when cloning from github.com/sdottaka/winmerge-v2
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sat, 5 Mar 2016 10:10:35 +0000 (19:10 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sat, 5 Mar 2016 10:10:35 +0000 (19:10 +0900)
Src/ImgMergeFrm.cpp
Src/ImgMergeFrm.h
Src/WinIMergeLib.h [new file with mode: 0644]

index d19cf38..69b9786 100644 (file)
@@ -41,7 +41,6 @@
 #include "FileOrFolderSelect.h"
 #include "UniFile.h"
 #include "SaveClosingDlg.h"
-#include "../Externals/winimerge/src/WinIMergeLib.h"
 #include <cmath>
 #include <cstdint>
 #include <Shlwapi.h>
index 069b3e9..6128398 100644 (file)
@@ -29,7 +29,7 @@
 #include "PathContext.h"
 #include "DiffFileInfo.h"
 #include "IMergeDoc.h"
-#include "../Externals/winimerge/src/WinIMergeLib.h"
+#include "WinIMergeLib.h"
 #include "LocationBar.h"
 
 class CDirDoc;
diff --git a/Src/WinIMergeLib.h b/Src/WinIMergeLib.h
new file mode 100644 (file)
index 0000000..9a2e2a4
--- /dev/null
@@ -0,0 +1,145 @@
+/////////////////////////////////////////////////////////////////////////////\r
+//    License (GPLv2+):\r
+//    This program is free software; you can redistribute it and/or modify\r
+//    it under the terms of the GNU General Public License as published by\r
+//    the Free Software Foundation; either version 2 of the License, or\r
+//    (at your option) any later version.\r
+//\r
+//    This program is distributed in the hope that it will be useful, but\r
+//    WITHOUT ANY WARRANTY; without even the implied warranty of\r
+//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+//    General Public License for more details.\r
+//\r
+//    You should have received a copy of the GNU General Public License\r
+//    along with this program; if not, write to the Free Software\r
+//    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+/////////////////////////////////////////////////////////////////////////////\r
+\r
+#pragma once\r
+\r
+#include <Windows.h>\r
+\r
+struct IImgMergeWindow\r
+{\r
+       enum OVERLAY_MODE {\r
+               OVERLAY_NONE = 0, OVERLAY_XOR, OVERLAY_ALPHABLEND\r
+       };\r
+       enum EVENT_TYPE {\r
+               LBUTTONDOWN = 0, LBUTTONUP, LBUTTONDBLCLK, \r
+               RBUTTONDOWN,     RBUTTONUP, RBUTTONDBLCLK,\r
+               MOUSEMOVE, MOUSEWHEEL, CONTEXTMENU,\r
+               KEYDOWN, KEYUP,\r
+               SIZE, HSCROLL, VSCROLL, SETFOCUS, KILLFOCUS,\r
+               REFRESH, SCROLLTODIFF, OPEN\r
+       };\r
+       struct Event\r
+       {\r
+               void *userdata;\r
+               int pane;\r
+               EVENT_TYPE eventType;\r
+               int x;\r
+               int y;\r
+               unsigned flags;\r
+               int delta;\r
+               int width;\r
+               int height;\r
+               int keycode;\r
+               int diffIndex;\r
+       };\r
+       typedef void (*EventListenerFunc)(const Event& evt);\r
+       virtual bool OpenImages(const wchar_t *filename1, const wchar_t *filename2) = 0;\r
+       virtual bool OpenImages(const wchar_t *filename1, const wchar_t *filename2, const wchar_t *filename3) = 0;\r
+       virtual bool ReloadImages() = 0;\r
+       virtual bool SaveImages() = 0;\r
+       virtual bool SaveImage(int pane) = 0;\r
+       virtual bool SaveImageAs(int pane, const wchar_t *filename) = 0;\r
+       virtual bool SaveDiffImageAs(int pane, const wchar_t *filename) = 0;\r
+       virtual const wchar_t *GetFileName(int pane) = 0;\r
+       virtual int  GetPaneCount() const = 0;\r
+       virtual RECT GetPaneWindowRect(int pane) const = 0;\r
+       virtual RECT GetWindowRect() const = 0;\r
+       virtual bool SetWindowRect(const RECT& rc) = 0;\r
+       virtual POINT GetCursorPos(int pane) const = 0;\r
+       virtual RGBQUAD GetPixelColor(int pane, int x, int y) const = 0;\r
+       virtual double GetColorDistance(int pane1, int pane2, int x, int y) const = 0;\r
+       virtual int  GetActivePane() const = 0;\r
+       virtual void SetActivePane(int pane) = 0;\r
+       virtual bool GetReadOnly(int pane) const = 0;\r
+       virtual void SetReadOnly(int pane, bool readOnly) = 0;\r
+       virtual bool GetHorizontalSplit() const = 0;\r
+       virtual void SetHorizontalSplit(bool horizontalSplit) = 0;\r
+       virtual int  GetCurrentPage(int pane) const = 0;\r
+       virtual void SetCurrentPage(int pane, int page) = 0;\r
+       virtual int  GetCurrentMaxPage() const = 0;\r
+       virtual void SetCurrentPageAll(int page) = 0;\r
+       virtual int  GetPageCount(int pane) const = 0;\r
+       virtual int  GetMaxPageCount() const = 0;\r
+       virtual COLORREF GetDiffColor() const = 0;\r
+       virtual void SetDiffColor(COLORREF clrDiffColor) = 0;\r
+       virtual COLORREF GetSelDiffColor() const = 0;\r
+       virtual void SetSelDiffColor(COLORREF clrSelDiffColor) = 0;\r
+       virtual double GetDiffColorAlpha() const = 0;\r
+       virtual void SetDiffColorAlpha(double diffColorAlpha) = 0;\r
+       virtual RGBQUAD GetBackColor() const = 0;\r
+       virtual void SetBackColor(RGBQUAD backColor) = 0;\r
+       virtual bool GetUseBackColor() const = 0;\r
+       virtual void SetUseBackColor(bool useBackColor) = 0;\r
+       virtual double GetZoom() const = 0;\r
+       virtual void SetZoom(double zoom) = 0;\r
+       virtual double GetColorDistanceThreshold() const = 0;\r
+       virtual void SetColorDistanceThreshold(double threshold) = 0;\r
+       virtual int  GetDiffBlockSize() const = 0;\r
+       virtual void SetDiffBlockSize(int blockSize) = 0;\r
+       virtual OVERLAY_MODE GetOverlayMode() const = 0;\r
+       virtual void SetOverlayMode(OVERLAY_MODE overlayMode) = 0;\r
+       virtual double GetOverlayAlpha() const = 0;\r
+       virtual void SetOverlayAlpha(double alpha) = 0;\r
+       virtual bool GetShowDifferences() const = 0;\r
+       virtual void SetShowDifferences(bool visible) = 0;\r
+       virtual int  GetDiffCount() const = 0;\r
+       virtual int  GetConflictCount() const = 0;\r
+       virtual int  GetCurrentDiffIndex() const = 0;\r
+       virtual bool FirstDiff() = 0;\r
+       virtual bool LastDiff() = 0;\r
+       virtual bool NextDiff() = 0;\r
+       virtual bool PrevDiff() = 0;\r
+       virtual bool FirstConflict() = 0;\r
+       virtual bool LastConflict() = 0;\r
+       virtual bool NextConflict() = 0;\r
+       virtual bool PrevConflict() = 0; \r
+       virtual bool SelectDiff(int diffIndex) = 0;\r
+       virtual int  GetNextDiffIndex() const = 0;\r
+       virtual int  GetPrevDiffIndex() const = 0;\r
+       virtual int  GetNextConflictIndex() const = 0;\r
+       virtual int  GetPrevConflictIndex() const = 0;\r
+       virtual void CopyDiff(int diffIndex, int srcPane, int dstPane) = 0;\r
+       virtual void CopyDiffAll(int srcPane, int dstPane) = 0;\r
+       virtual int  CopyDiff3Way(int dstPane) = 0;\r
+       virtual bool IsUndoable() const = 0;\r
+       virtual bool IsRedoable() const = 0;\r
+       virtual bool Undo() = 0;\r
+       virtual bool Redo() = 0;\r
+       virtual bool IsModified(int pane) const = 0;\r
+       virtual HWND GetHWND() const = 0;\r
+       virtual HWND GetPaneHWND(int pane) const = 0;\r
+       virtual int  GetImageWidth(int pane) const = 0;\r
+       virtual int  GetImageHeight(int pane) const = 0;\r
+       virtual int  GetImageBitsPerPixel(int pane) const = 0;\r
+       virtual void AddImageOffset(int pane, int dx, int dy) = 0;\r
+       virtual POINT GetImageOffset(int pane) const = 0;\r
+       virtual void AddEventListener(EventListenerFunc func, void *userdata) = 0;\r
+};\r
+\r
+struct IImgToolWindow\r
+{\r
+       virtual HWND GetHWND() const = 0;\r
+       virtual void Sync() = 0;\r
+};\r
+\r
+extern "C"\r
+{\r
+       IImgMergeWindow * WinIMerge_CreateWindow(HINSTANCE hInstance, HWND hWndParent, int nID = 0);\r
+       bool WinIMerge_DestroyWindow(IImgMergeWindow *pImgMergeWindow);\r
+       IImgToolWindow * WinIMerge_CreateToolWindow(HINSTANCE hInstance, HWND hWndParent, IImgMergeWindow *pImgMergeWindow);\r
+       bool WinIMerge_DestroyToolWindow(IImgToolWindow *pImgToolWindow);\r
+};\r