summaryrefslogtreecommitdiff
path: root/plugins/!Deprecated/ExternalAPI/m_MagneticWindows.h
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2014-06-12 17:49:53 +0000
committerKirill Volinsky <mataes2007@gmail.com>2014-06-12 17:49:53 +0000
commit7de38a08b97e0554e318b8c25806cef5d47259e6 (patch)
tree2400708e16b437245da88623046e96fb833e23b9 /plugins/!Deprecated/ExternalAPI/m_MagneticWindows.h
parent1b88f240b94fc04aa11ef352b720fda741c0ebc6 (diff)
headers of not adopted plugins moved to !Deprecated
git-svn-id: http://svn.miranda-ng.org/main/trunk@9438 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/!Deprecated/ExternalAPI/m_MagneticWindows.h')
-rw-r--r--plugins/!Deprecated/ExternalAPI/m_MagneticWindows.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/plugins/!Deprecated/ExternalAPI/m_MagneticWindows.h b/plugins/!Deprecated/ExternalAPI/m_MagneticWindows.h
new file mode 100644
index 0000000000..e011c773fd
--- /dev/null
+++ b/plugins/!Deprecated/ExternalAPI/m_MagneticWindows.h
@@ -0,0 +1,86 @@
+#ifndef __M_MAGNETICWINDOWS_H__
+#define __M_MAGNETICWINDOWS_H__
+
+//#include "../include/newpluginapi.h"
+
+// For other Plugins to start snapping for their windows
+// wparam: hwnd of window
+// lparam: 0
+// return: 0 on success, 1 on error
+#define MS_MW_ADDWINDOW "Utils/MagneticWindows/Add"
+
+// For other Plugins to stop snapping for their windows
+// wparam: hwnd of window
+// lparam: 0
+// return: 0 on success, 1 on error
+#define MS_MW_REMWINDOW "Utils/MagneticWindows/Rem"
+
+//decide where to align on the list:
+#define MS_MW_STL_List_Left 0x00000001 //Snaps the window to the left border of the list
+#define MS_MW_STL_List_Top 0x00000002 //Snaps the window to the top border of the list
+#define MS_MW_STL_List_Right 0x00000004 //Snaps the window to the right border of the list
+#define MS_MW_STL_List_Bottom 0x00000008 //Snaps the window to the bottom border of the list
+//decide with what side (of the window you want to snap) to snap to the list
+#define MS_MW_STL_Wnd_Left 0x00000010 //Snaps the window with the left border to the left/right side of the list
+#define MS_MW_STL_Wnd_Top 0x00000020 //Snaps the window with the top border to the top/bottom side of the list
+#define MS_MW_STL_Wnd_Right 0x00000040 //Snaps the window with the right border to the left/right side of the list
+#define MS_MW_STL_Wnd_Bottom 0x00000080 //Snaps the window with the bottom border to the top/bottom side of the list
+
+#define MS_MW_STL_Wnd_FullWidth (MS_MW_STL_Wnd_Left | MS_MW_STL_Wnd_Right)
+ //Snaps to the top/bottom of the list and spans over the full width
+
+#define MS_MW_STL_Wnd_FullHeight (MS_MW_STL_Wnd_Top | MS_MW_STL_Wnd_Bottom)
+ //Snaps to the left/right of the list and spans over the full height
+
+// to place the window in the list combine f.e. MS_MW_STL_List_Left | MS_MW_STL_Wnd_Right | *vetical alignment*
+
+//For other Plugins to snap a window to the list for other Plugins
+// wparam: hwnd of window
+// lparam: combination of the above constants MS_MW_STL_*
+// return: 0 on success, 1 on error
+#define MS_MW_SNAPTOLIST "Utils/MagneticWindows/SnapToList"
+
+// Helper functions
+#ifndef _MW_NO_HELPPER_FUNCTIONS
+
+
+static inline int MagneticWindows_AddWindow(HWND hWnd)
+{
+ if (ServiceExists(MS_MW_ADDWINDOW))
+ {
+ return CallService(MS_MW_ADDWINDOW, (WPARAM) hWnd, 0);
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+static inline int MagneticWindows_RemoveWindow(HWND hWnd)
+{
+ if (ServiceExists(MS_MW_REMWINDOW))
+ {
+ return CallService(MS_MW_REMWINDOW, (WPARAM) hWnd, 0);
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+static inline int MagneticWindows_SnapWindowToList(HWND hWnd, int MS_MW_STL_Options)
+{
+ if (ServiceExists(MS_MW_SNAPTOLIST))
+ {
+ return CallService(MS_MW_SNAPTOLIST, (WPARAM) hWnd, (LPARAM) MS_MW_STL_Options);
+ }
+ else
+ {
+ return -1;
+ }
+}
+
+#endif
+
+
+#endif // __M_MAGNETICWINDOWS_H__