/* Graphical user interface functions for the Microsoft W32 API.
- Copyright (C) 1989, 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 01, 04
- Free Software Foundation, Inc.
+ Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+ 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
/* Added by Kevin Gallo */
over text or in the modeline. */
Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape;
-Lisp_Object Vx_hourglass_pointer_shape, Vx_window_horizontal_drag_shape, Vx_hand_shape;
+Lisp_Object Vx_hourglass_pointer_shape, Vx_window_horizontal_drag_shape;
/* The shape when over mouse-sensitive text. */
CHECK_LIVE_FRAME (frame);
f = XFRAME (frame);
if (! FRAME_W32_P (f))
- error ("non-w32 frame used");
+ error ("Non-W32 frame used");
return f;
}
CHECK_LIVE_FRAME (frame);
f = XFRAME (frame);
if (! FRAME_W32_P (f))
- error ("non-w32 frame used");
+ error ("Non-W32 frame used");
return FRAME_W32_DISPLAY_INFO (f);
}
}
}
\f
-BOOL my_show_window P_ ((struct frame *, HWND, int));
-void my_set_window_pos P_ ((HWND, HWND, int, int, int, int, UINT));
static Lisp_Object unwind_create_frame P_ ((Lisp_Object));
static Lisp_Object unwind_create_tip_frame P_ ((Lisp_Object));
+static void my_create_window P_ ((struct frame *));
+static void my_create_tip_window P_ ((struct frame *));
/* TODO: Native Input Method support; see x_create_im. */
void x_set_foreground_color P_ ((struct frame *, Lisp_Object, Lisp_Object));
return 0;
}
-void
+static void
my_create_window (f)
struct frame * f;
{
indirectly via the Window thread, as we do not need to process Window
messages for the tooltip. Creating tooltips indirectly also creates
deadlocks when tooltips are created for menu items. */
-void
+static void
my_create_tip_window (f)
struct frame *f;
{
strcpy (height_pixels, "*");
strcpy (height_dpi, "*");
}
+
+#if 0 /* Never put the width in the xfld. It fails on fonts with
+ double-width characters. */
if (lplogfont->lfWidth)
sprintf (width_pixels, "%u", lplogfont->lfWidth * 10);
else
+#endif
strcpy (width_pixels, "*");
_snprintf (lpxstr, len - 1,
if (INTEGERP (top))
*root_y = XINT (top);
- else if (*root_y + XINT (dy) - height < 0)
- *root_y -= XINT (dy);
- else
- {
- *root_y -= height;
+ else if (*root_y + XINT (dy) <= 0)
+ *root_y = 0; /* Can happen for negative dy */
+ else if (*root_y + XINT (dy) + height <= FRAME_W32_DISPLAY_INFO (f)->height)
+ /* It fits below the pointer */
*root_y += XINT (dy);
- }
+ else if (height + XINT (dy) <= *root_y)
+ /* It fits above the pointer. */
+ *root_y -= height + XINT (dy);
+ else
+ /* Put it on the top. */
+ *root_y = 0;
if (INTEGERP (left))
*root_x = XINT (left);
+ else if (*root_x + XINT (dx) <= 0)
+ *root_x = 0; /* Can happen for negative dx */
else if (*root_x + XINT (dx) + width <= FRAME_W32_DISPLAY_INFO (f)->width)
/* It fits to the right of the pointer. */
*root_x += XINT (dx);
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
- try_window (FRAME_ROOT_WINDOW (f), pos);
+ try_window (FRAME_ROOT_WINDOW (f), pos, 0);
/* Compute width and height of the tooltip. */
width = height = 0;
DWORD FlagsEx;
} NEWOPENFILENAME;
-
+
DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0,
doc: /* Read file name, prompting with PROMPT in directory DIR.
Use a file selection dialog.
NEWOPENFILENAME new_file_details;
BOOL file_opened = FALSE;
OPENFILENAME * file_details = &new_file_details.real_details;
-
+
/* Prevent redisplay. */
specbind (Qinhibit_redisplay, Qt);
BLOCK_INPUT;
staticpro (&Qw32_charset_ansi);
Qw32_charset_ansi = intern ("w32-charset-ansi");
staticpro (&Qw32_charset_symbol);
+ Qw32_charset_default = intern ("w32-charset-default");
+ staticpro (&Qw32_charset_default);
Qw32_charset_symbol = intern ("w32-charset-symbol");
staticpro (&Qw32_charset_shiftjis);
Qw32_charset_shiftjis = intern ("w32-charset-shiftjis");
button = MessageBox (NULL,
"A fatal error has occurred!\n\n"
"Would you like to attach a debugger?\n\n"
- "Select YES to debug, NO to abort Emacs",
- "Emacs Abort Dialog",
+ "Select YES to debug, NO to abort Emacs"
+#if __GNUC__
+ "\n\n(type \"gdb -p <emacs-PID>\" and\n"
+ "\"continue\" inside GDB before clicking YES.)"
+#endif
+ , "Emacs Abort Dialog",
MB_ICONEXCLAMATION | MB_TASKMODAL
| MB_SETFOREGROUND | MB_YESNO);
switch (button)