diff options
Diffstat (limited to 'libraries/ecore/src/lib/ecore_win32')
4 files changed, 53 insertions, 153 deletions
diff --git a/libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h b/libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h index 95e3749..5df3346 100644 --- a/libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h +++ b/libraries/ecore/src/lib/ecore_win32/Ecore_Win32.h | |||
@@ -460,7 +460,9 @@ EAPI void ecore_win32_window_lower(Ecore_Win32_Window *window); | |||
460 | EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window, | 460 | EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window, |
461 | const char *title); | 461 | const char *title); |
462 | 462 | ||
463 | EAPI void ecore_win32_window_focus_set(Ecore_Win32_Window *window); | 463 | EAPI void ecore_win32_window_focus(Ecore_Win32_Window *window); |
464 | |||
465 | EAPI void *ecore_win32_window_focus_get(void); | ||
464 | 466 | ||
465 | EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window, | 467 | EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window, |
466 | Eina_Bool on); | 468 | Eina_Bool on); |
@@ -471,11 +473,6 @@ EAPI void ecore_win32_window_borderless_set(Ecore_Win32_Window *window, | |||
471 | EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window, | 473 | EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window, |
472 | Eina_Bool on); | 474 | Eina_Bool on); |
473 | 475 | ||
474 | EINA_DEPRECATED EAPI void ecore_win32_window_shape_set(Ecore_Win32_Window *window, | ||
475 | unsigned short width, | ||
476 | unsigned short height, | ||
477 | unsigned char *mask); | ||
478 | |||
479 | EAPI void ecore_win32_window_cursor_set(Ecore_Win32_Window *window, | 476 | EAPI void ecore_win32_window_cursor_set(Ecore_Win32_Window *window, |
480 | Ecore_Win32_Cursor *cursor); | 477 | Ecore_Win32_Cursor *cursor); |
481 | 478 | ||
diff --git a/libraries/ecore/src/lib/ecore_win32/Makefile.in b/libraries/ecore/src/lib/ecore_win32/Makefile.in index 9994ee7..b512021 100644 --- a/libraries/ecore/src/lib/ecore_win32/Makefile.in +++ b/libraries/ecore/src/lib/ecore_win32/Makefile.in | |||
@@ -50,16 +50,15 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \ | |||
50 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ | 50 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ |
51 | $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \ | 51 | $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \ |
52 | $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ | 52 | $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ |
53 | $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ | 53 | $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ |
54 | $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ | 54 | $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ |
55 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | 55 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ |
56 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | 56 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ |
57 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ | 57 | $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ |
58 | $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ | 58 | $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/configure.ac |
59 | $(top_srcdir)/configure.ac | ||
60 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | 59 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
61 | $(ACLOCAL_M4) | 60 | $(ACLOCAL_M4) |
62 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs | 61 | mkinstalldirs = $(install_sh) -d |
63 | CONFIG_HEADER = $(top_builddir)/config.h | 62 | CONFIG_HEADER = $(top_builddir)/config.h |
64 | CONFIG_CLEAN_FILES = | 63 | CONFIG_CLEAN_FILES = |
65 | CONFIG_CLEAN_VPATH_FILES = | 64 | CONFIG_CLEAN_VPATH_FILES = |
@@ -213,6 +212,8 @@ EVAS_LIBS = @EVAS_LIBS@ | |||
213 | EVIL_CFLAGS = @EVIL_CFLAGS@ | 212 | EVIL_CFLAGS = @EVIL_CFLAGS@ |
214 | EVIL_LIBS = @EVIL_LIBS@ | 213 | EVIL_LIBS = @EVIL_LIBS@ |
215 | EXEEXT = @EXEEXT@ | 214 | EXEEXT = @EXEEXT@ |
215 | EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ | ||
216 | EXOTIC_LIBS = @EXOTIC_LIBS@ | ||
216 | FGREP = @FGREP@ | 217 | FGREP = @FGREP@ |
217 | GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ | 218 | GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ |
218 | GLIB_CFLAGS = @GLIB_CFLAGS@ | 219 | GLIB_CFLAGS = @GLIB_CFLAGS@ |
@@ -268,6 +269,8 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
268 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 269 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
269 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 270 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
270 | PKG_CONFIG = @PKG_CONFIG@ | 271 | PKG_CONFIG = @PKG_CONFIG@ |
272 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
273 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
271 | POSUB = @POSUB@ | 274 | POSUB = @POSUB@ |
272 | RANLIB = @RANLIB@ | 275 | RANLIB = @RANLIB@ |
273 | SCIM_CFLAGS = @SCIM_CFLAGS@ | 276 | SCIM_CFLAGS = @SCIM_CFLAGS@ |
@@ -278,6 +281,7 @@ SDL_LIBS = @SDL_LIBS@ | |||
278 | SED = @SED@ | 281 | SED = @SED@ |
279 | SET_MAKE = @SET_MAKE@ | 282 | SET_MAKE = @SET_MAKE@ |
280 | SHELL = @SHELL@ | 283 | SHELL = @SHELL@ |
284 | SHM_OPEN_LIBS = @SHM_OPEN_LIBS@ | ||
281 | SSL_CFLAGS = @SSL_CFLAGS@ | 285 | SSL_CFLAGS = @SSL_CFLAGS@ |
282 | SSL_LIBS = @SSL_LIBS@ | 286 | SSL_LIBS = @SSL_LIBS@ |
283 | STRIP = @STRIP@ | 287 | STRIP = @STRIP@ |
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h b/libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h index ab54763..e3e4426 100644 --- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h +++ b/libraries/ecore/src/lib/ecore_win32/ecore_win32_private.h | |||
@@ -71,8 +71,8 @@ struct _Ecore_Win32_Window | |||
71 | unsigned int min_height; | 71 | unsigned int min_height; |
72 | unsigned int max_width; | 72 | unsigned int max_width; |
73 | unsigned int max_height; | 73 | unsigned int max_height; |
74 | unsigned int base_width; | 74 | int base_width; |
75 | unsigned int base_height; | 75 | int base_height; |
76 | unsigned int step_width; | 76 | unsigned int step_width; |
77 | unsigned int step_height; | 77 | unsigned int step_height; |
78 | 78 | ||
diff --git a/libraries/ecore/src/lib/ecore_win32/ecore_win32_window.c b/libraries/ecore/src/lib/ecore_win32/ecore_win32_window.c index 459f051..058aef0 100644 --- a/libraries/ecore/src/lib/ecore_win32/ecore_win32_window.c +++ b/libraries/ecore/src/lib/ecore_win32/ecore_win32_window.c | |||
@@ -107,8 +107,8 @@ ecore_win32_window_internal_new(Ecore_Win32_Window *parent, | |||
107 | w->min_height = 0; | 107 | w->min_height = 0; |
108 | w->max_width = 32767; | 108 | w->max_width = 32767; |
109 | w->max_height = 32767; | 109 | w->max_height = 32767; |
110 | w->base_width = 0; | 110 | w->base_width = -1; |
111 | w->base_height = 0; | 111 | w->base_height = -1; |
112 | w->step_width = 1; | 112 | w->step_width = 1; |
113 | w->step_height = 1; | 113 | w->step_height = 1; |
114 | 114 | ||
@@ -249,6 +249,8 @@ ecore_win32_window_free(Ecore_Win32_Window *window) | |||
249 | * | 249 | * |
250 | * This function returns the window HANDLE associated to @p window. If | 250 | * This function returns the window HANDLE associated to @p window. If |
251 | * @p window is @c NULL, this function returns @c NULL. | 251 | * @p window is @c NULL, this function returns @c NULL. |
252 | * | ||
253 | * @note The returned value is of type HWND. | ||
252 | */ | 254 | */ |
253 | EAPI void * | 255 | EAPI void * |
254 | ecore_win32_window_hwnd_get(Ecore_Win32_Window *window) | 256 | ecore_win32_window_hwnd_get(Ecore_Win32_Window *window) |
@@ -755,140 +757,6 @@ ecore_win32_window_size_step_get(Ecore_Win32_Window *window, | |||
755 | if (step_height) *step_height = window->step_height; | 757 | if (step_height) *step_height = window->step_height; |
756 | } | 758 | } |
757 | 759 | ||
758 | EAPI void | ||
759 | ecore_win32_window_shape_set(Ecore_Win32_Window *window, | ||
760 | unsigned short width, | ||
761 | unsigned short height, | ||
762 | unsigned char *mask) | ||
763 | { | ||
764 | HRGN rgn; | ||
765 | int x; | ||
766 | int y; | ||
767 | OSVERSIONINFO version_info; | ||
768 | |||
769 | if (!window) | ||
770 | return; | ||
771 | |||
772 | if (!mask) | ||
773 | { | ||
774 | window->shape.enabled = 0; | ||
775 | if (window->shape.layered != 0) | ||
776 | { | ||
777 | window->shape.layered = 0; | ||
778 | #if defined(WS_EX_LAYERED) | ||
779 | SetLastError(0); | ||
780 | if (!SetWindowLongPtr(window->window, GWL_EXSTYLE, | ||
781 | GetWindowLong(window->window, GWL_EXSTYLE) & (~WS_EX_LAYERED)) && | ||
782 | (GetLastError() != 0)) | ||
783 | { | ||
784 | ERR("SetWindowLongPtr() failed"); | ||
785 | return; | ||
786 | } | ||
787 | if (!RedrawWindow(window->window, NULL, NULL, | ||
788 | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN)) | ||
789 | { | ||
790 | ERR("RedrawWindow() failed"); | ||
791 | return; | ||
792 | } | ||
793 | #endif | ||
794 | } | ||
795 | else | ||
796 | if (!SetWindowRgn(window->window, NULL, TRUE)) | ||
797 | { | ||
798 | ERR("SetWindowRgn() failed"); | ||
799 | } | ||
800 | return; | ||
801 | } | ||
802 | |||
803 | if (width == 0 || height == 0) | ||
804 | return; | ||
805 | |||
806 | window->shape.enabled = 1; | ||
807 | |||
808 | if (width != window->shape.width || height != window->shape.height) | ||
809 | { | ||
810 | window->shape.width = width; | ||
811 | window->shape.height = height; | ||
812 | if (window->shape.mask) | ||
813 | { | ||
814 | free(window->shape.mask); | ||
815 | window->shape.mask = NULL; | ||
816 | } | ||
817 | window->shape.mask = malloc(width * height); | ||
818 | } | ||
819 | memcpy(window->shape.mask, mask, width * height); | ||
820 | |||
821 | window->shape.layered = 0; | ||
822 | |||
823 | #if defined(WS_EX_LAYERED) | ||
824 | version_info.dwOSVersionInfoSize = sizeof(version_info); | ||
825 | if (GetVersionEx(&version_info) == TRUE && version_info.dwMajorVersion == 5) | ||
826 | { | ||
827 | SetLastError(0); | ||
828 | if (!SetWindowLongPtr(window->window, GWL_EXSTYLE, | ||
829 | GetWindowLong(window->window, GWL_EXSTYLE) | WS_EX_LAYERED) && | ||
830 | (GetLastError() != 0)) | ||
831 | { | ||
832 | ERR("SetWindowLongPtr() failed"); | ||
833 | return; | ||
834 | } | ||
835 | window->shape.layered = 1; | ||
836 | return; | ||
837 | } | ||
838 | #endif | ||
839 | |||
840 | if (!(rgn = CreateRectRgn(0, 0, 0, 0))) | ||
841 | { | ||
842 | ERR("CreateRectRgn() failed"); | ||
843 | return; | ||
844 | } | ||
845 | for (y = 0; y < height; y++) | ||
846 | { | ||
847 | HRGN rgnLine; | ||
848 | |||
849 | if (!(rgnLine = CreateRectRgn(0, 0, 0, 0))) | ||
850 | { | ||
851 | ERR("CreateRectRgn() failed"); | ||
852 | return; | ||
853 | } | ||
854 | for (x = 0; x < width; x++) | ||
855 | { | ||
856 | if (mask[y * width + x] > 0) | ||
857 | { | ||
858 | HRGN rgnDot; | ||
859 | |||
860 | if (!(rgnDot = CreateRectRgn(x, y, x + 1, y + 1))) | ||
861 | { | ||
862 | ERR("CreateRectRgn() failed"); | ||
863 | return; | ||
864 | } | ||
865 | if (CombineRgn(rgnLine, rgnLine, rgnDot, RGN_OR) == ERROR) | ||
866 | { | ||
867 | ERR("CombineRgn() has not created a new region"); | ||
868 | } | ||
869 | if (!DeleteObject(rgnDot)) | ||
870 | { | ||
871 | ERR("DeleteObject() failed"); | ||
872 | return; | ||
873 | } | ||
874 | } | ||
875 | } | ||
876 | if (CombineRgn(rgn, rgn, rgnLine, RGN_OR) == ERROR) | ||
877 | { | ||
878 | ERR("CombineRgn() has not created a new region"); | ||
879 | } | ||
880 | if (!DeleteObject(rgnLine)) | ||
881 | { | ||
882 | ERR("DeleteObject() failed"); | ||
883 | return; | ||
884 | } | ||
885 | } | ||
886 | if (!SetWindowRgn(window->window, rgn, TRUE)) | ||
887 | { | ||
888 | ERR("SetWindowRgn() failed"); | ||
889 | } | ||
890 | } | ||
891 | |||
892 | /** | 760 | /** |
893 | * @brief Show the given window. | 761 | * @brief Show the given window. |
894 | * | 762 | * |
@@ -1011,7 +879,7 @@ ecore_win32_window_title_set(Ecore_Win32_Window *window, | |||
1011 | * @c NULL, this function does nothing. | 879 | * @c NULL, this function does nothing. |
1012 | */ | 880 | */ |
1013 | EAPI void | 881 | EAPI void |
1014 | ecore_win32_window_focus_set(Ecore_Win32_Window *window) | 882 | ecore_win32_window_focus(Ecore_Win32_Window *window) |
1015 | { | 883 | { |
1016 | if (!window) return; | 884 | if (!window) return; |
1017 | 885 | ||
@@ -1024,6 +892,37 @@ ecore_win32_window_focus_set(Ecore_Win32_Window *window) | |||
1024 | } | 892 | } |
1025 | 893 | ||
1026 | /** | 894 | /** |
895 | * @brief Get the current focused window. | ||
896 | * | ||
897 | * @return The window that has focus. | ||
898 | * | ||
899 | * This function returns the window that has focus. If the calling | ||
900 | * thread's message queue does not have an associated window with the | ||
901 | * keyboard focus, the return value is @c NULL. | ||
902 | * | ||
903 | * @note Even if the returned value is @c NULL, another thread's queue | ||
904 | * may be associated with a window that has the keyboard focus. | ||
905 | * | ||
906 | * @note The returned value is of type HWND. | ||
907 | */ | ||
908 | EAPI void * | ||
909 | ecore_win32_window_focus_get(void) | ||
910 | { | ||
911 | HWND focused; | ||
912 | |||
913 | INF("getting focused window"); | ||
914 | |||
915 | focused = GetFocus(); | ||
916 | if (!focused) | ||
917 | { | ||
918 | ERR("GetFocus() failed"); | ||
919 | return NULL; | ||
920 | } | ||
921 | |||
922 | return focused; | ||
923 | } | ||
924 | |||
925 | /** | ||
1027 | * @brief Iconify or restore the given window. | 926 | * @brief Iconify or restore the given window. |
1028 | * | 927 | * |
1029 | * @param window The window. | 928 | * @param window The window. |