mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-21 12:03:55 -08:00
(x_bitmap_icon): New function.
(x_make_frame_visible, x_iconify_frame): Invoke x_bitmap_icon.
This commit is contained in:
parent
eb7576cefd
commit
7f5d1df85e
1 changed files with 63 additions and 0 deletions
|
|
@ -4213,6 +4213,58 @@ x_display_cursor (f, on)
|
|||
|
||||
UNBLOCK_INPUT;
|
||||
}
|
||||
|
||||
/* Icons. */
|
||||
|
||||
int
|
||||
x_bitmap_icon (f, icon)
|
||||
struct frame *f;
|
||||
Lisp_Object icon;
|
||||
{
|
||||
int mask, bitmap_id;
|
||||
Window icon_window;
|
||||
HANDLE hicon;
|
||||
|
||||
if (FRAME_W32_WINDOW (f) == 0)
|
||||
return 1;
|
||||
|
||||
if (NILP (icon))
|
||||
hicon = LoadIcon (hinst, EMACS_CLASS);
|
||||
else if (STRINGP (icon))
|
||||
hicon = LoadImage (NULL, (LPCTSTR) XSTRING (icon)->data, IMAGE_ICON, 0, 0,
|
||||
LR_DEFAULTSIZE | LR_LOADFROMFILE);
|
||||
else if (SYMBOLP (icon))
|
||||
{
|
||||
LPCTSTR name;
|
||||
|
||||
if (EQ (icon, intern ("application")))
|
||||
name = (LPCTSTR) IDI_APPLICATION;
|
||||
else if (EQ (icon, intern ("hand")))
|
||||
name = (LPCTSTR) IDI_HAND;
|
||||
else if (EQ (icon, intern ("question")))
|
||||
name = (LPCTSTR) IDI_QUESTION;
|
||||
else if (EQ (icon, intern ("exclamation")))
|
||||
name = (LPCTSTR) IDI_EXCLAMATION;
|
||||
else if (EQ (icon, intern ("asterisk")))
|
||||
name = (LPCTSTR) IDI_ASTERISK;
|
||||
else if (EQ (icon, intern ("winlogo")))
|
||||
name = (LPCTSTR) IDI_WINLOGO;
|
||||
else
|
||||
return 1;
|
||||
|
||||
hicon = LoadIcon (NULL, name);
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
|
||||
if (hicon == NULL)
|
||||
return 1;
|
||||
|
||||
PostMessage (FRAME_W32_WINDOW (f), WM_SETICON, (WPARAM) ICON_BIG, (LPARAM) hicon);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Changing the font of the frame. */
|
||||
|
||||
|
|
@ -4659,8 +4711,14 @@ w32_frame_raise_lower (f, raise)
|
|||
x_make_frame_visible (f)
|
||||
struct frame *f;
|
||||
{
|
||||
Lisp_Object type;
|
||||
|
||||
BLOCK_INPUT;
|
||||
|
||||
type = x_icon_type (f);
|
||||
if (!NILP (type))
|
||||
x_bitmap_icon (f, type);
|
||||
|
||||
if (! FRAME_VISIBLE_P (f))
|
||||
{
|
||||
/* We test FRAME_GARBAGED_P here to make sure we don't
|
||||
|
|
@ -4759,6 +4817,7 @@ x_iconify_frame (f)
|
|||
struct frame *f;
|
||||
{
|
||||
int result;
|
||||
Lisp_Object type;
|
||||
|
||||
/* Don't keep the highlight on an invisible frame. */
|
||||
if (FRAME_W32_DISPLAY_INFO (f)->w32_highlight_frame == f)
|
||||
|
|
@ -4769,6 +4828,10 @@ x_iconify_frame (f)
|
|||
|
||||
BLOCK_INPUT;
|
||||
|
||||
type = x_icon_type (f);
|
||||
if (!NILP (type))
|
||||
x_bitmap_icon (f, type);
|
||||
|
||||
/* Simulate the user minimizing the frame. */
|
||||
SendMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, SC_MINIMIZE, 0);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue