diff options
| author | Geoff Voelker | 1999-08-10 17:33:38 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1999-08-10 17:33:38 +0000 |
| commit | 7f5d1df85e8914cea03348a651c359d0551ddd29 (patch) | |
| tree | e86b30c88c09185534e0e025ae21b84b7fa7ed4a /src/w32term.c | |
| parent | eb7576cefd89e92d5e7b507184f335f6d41c82f6 (diff) | |
| download | emacs-7f5d1df85e8914cea03348a651c359d0551ddd29.tar.gz emacs-7f5d1df85e8914cea03348a651c359d0551ddd29.zip | |
(x_bitmap_icon): New function.
(x_make_frame_visible, x_iconify_frame): Invoke x_bitmap_icon.
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/w32term.c b/src/w32term.c index 9723b5b2a27..8b426aeb2b6 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -4214,6 +4214,58 @@ x_display_cursor (f, on) | |||
| 4214 | UNBLOCK_INPUT; | 4214 | UNBLOCK_INPUT; |
| 4215 | } | 4215 | } |
| 4216 | 4216 | ||
| 4217 | /* Icons. */ | ||
| 4218 | |||
| 4219 | int | ||
| 4220 | x_bitmap_icon (f, icon) | ||
| 4221 | struct frame *f; | ||
| 4222 | Lisp_Object icon; | ||
| 4223 | { | ||
| 4224 | int mask, bitmap_id; | ||
| 4225 | Window icon_window; | ||
| 4226 | HANDLE hicon; | ||
| 4227 | |||
| 4228 | if (FRAME_W32_WINDOW (f) == 0) | ||
| 4229 | return 1; | ||
| 4230 | |||
| 4231 | if (NILP (icon)) | ||
| 4232 | hicon = LoadIcon (hinst, EMACS_CLASS); | ||
| 4233 | else if (STRINGP (icon)) | ||
| 4234 | hicon = LoadImage (NULL, (LPCTSTR) XSTRING (icon)->data, IMAGE_ICON, 0, 0, | ||
| 4235 | LR_DEFAULTSIZE | LR_LOADFROMFILE); | ||
| 4236 | else if (SYMBOLP (icon)) | ||
| 4237 | { | ||
| 4238 | LPCTSTR name; | ||
| 4239 | |||
| 4240 | if (EQ (icon, intern ("application"))) | ||
| 4241 | name = (LPCTSTR) IDI_APPLICATION; | ||
| 4242 | else if (EQ (icon, intern ("hand"))) | ||
| 4243 | name = (LPCTSTR) IDI_HAND; | ||
| 4244 | else if (EQ (icon, intern ("question"))) | ||
| 4245 | name = (LPCTSTR) IDI_QUESTION; | ||
| 4246 | else if (EQ (icon, intern ("exclamation"))) | ||
| 4247 | name = (LPCTSTR) IDI_EXCLAMATION; | ||
| 4248 | else if (EQ (icon, intern ("asterisk"))) | ||
| 4249 | name = (LPCTSTR) IDI_ASTERISK; | ||
| 4250 | else if (EQ (icon, intern ("winlogo"))) | ||
| 4251 | name = (LPCTSTR) IDI_WINLOGO; | ||
| 4252 | else | ||
| 4253 | return 1; | ||
| 4254 | |||
| 4255 | hicon = LoadIcon (NULL, name); | ||
| 4256 | } | ||
| 4257 | else | ||
| 4258 | return 1; | ||
| 4259 | |||
| 4260 | if (hicon == NULL) | ||
| 4261 | return 1; | ||
| 4262 | |||
| 4263 | PostMessage (FRAME_W32_WINDOW (f), WM_SETICON, (WPARAM) ICON_BIG, (LPARAM) hicon); | ||
| 4264 | |||
| 4265 | return 0; | ||
| 4266 | } | ||
| 4267 | |||
| 4268 | |||
| 4217 | /* Changing the font of the frame. */ | 4269 | /* Changing the font of the frame. */ |
| 4218 | 4270 | ||
| 4219 | /* Give frame F the font named FONTNAME as its default font, and | 4271 | /* Give frame F the font named FONTNAME as its default font, and |
| @@ -4659,8 +4711,14 @@ w32_frame_raise_lower (f, raise) | |||
| 4659 | x_make_frame_visible (f) | 4711 | x_make_frame_visible (f) |
| 4660 | struct frame *f; | 4712 | struct frame *f; |
| 4661 | { | 4713 | { |
| 4714 | Lisp_Object type; | ||
| 4715 | |||
| 4662 | BLOCK_INPUT; | 4716 | BLOCK_INPUT; |
| 4663 | 4717 | ||
| 4718 | type = x_icon_type (f); | ||
| 4719 | if (!NILP (type)) | ||
| 4720 | x_bitmap_icon (f, type); | ||
| 4721 | |||
| 4664 | if (! FRAME_VISIBLE_P (f)) | 4722 | if (! FRAME_VISIBLE_P (f)) |
| 4665 | { | 4723 | { |
| 4666 | /* We test FRAME_GARBAGED_P here to make sure we don't | 4724 | /* We test FRAME_GARBAGED_P here to make sure we don't |
| @@ -4759,6 +4817,7 @@ x_iconify_frame (f) | |||
| 4759 | struct frame *f; | 4817 | struct frame *f; |
| 4760 | { | 4818 | { |
| 4761 | int result; | 4819 | int result; |
| 4820 | Lisp_Object type; | ||
| 4762 | 4821 | ||
| 4763 | /* Don't keep the highlight on an invisible frame. */ | 4822 | /* Don't keep the highlight on an invisible frame. */ |
| 4764 | if (FRAME_W32_DISPLAY_INFO (f)->w32_highlight_frame == f) | 4823 | if (FRAME_W32_DISPLAY_INFO (f)->w32_highlight_frame == f) |
| @@ -4769,6 +4828,10 @@ x_iconify_frame (f) | |||
| 4769 | 4828 | ||
| 4770 | BLOCK_INPUT; | 4829 | BLOCK_INPUT; |
| 4771 | 4830 | ||
| 4831 | type = x_icon_type (f); | ||
| 4832 | if (!NILP (type)) | ||
| 4833 | x_bitmap_icon (f, type); | ||
| 4834 | |||
| 4772 | /* Simulate the user minimizing the frame. */ | 4835 | /* Simulate the user minimizing the frame. */ |
| 4773 | SendMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MINIMIZE, 0); | 4836 | SendMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MINIMIZE, 0); |
| 4774 | 4837 | ||