dpyinfo = x_display_info_for_name (object);
else
{
- FRAME_PTR f = decode_window_system_frame (object);
+ struct frame *f = decode_window_system_frame (object);
dpyinfo = FRAME_X_DISPLAY_INFO (f);
}
not Emacs's own window. */
void
-x_real_positions (FRAME_PTR f, int *xptr, int *yptr)
+x_real_positions (struct frame *f, int *xptr, int *yptr)
{
int win_x, win_y, outer_x IF_LINT (= 0), outer_y IF_LINT (= 0);
int real_x = 0, real_y = 0;
Signal an error if color can't be allocated. */
static int
-x_decode_color (FRAME_PTR f, Lisp_Object color_name, int mono_color)
+x_decode_color (struct frame *f, Lisp_Object color_name, int mono_color)
{
XColor cdef;
may be any format that GdkPixbuf knows about, i.e. not just bitmaps. */
int
-xg_set_icon (FRAME_PTR f, Lisp_Object file)
+xg_set_icon (struct frame *f, Lisp_Object file)
{
int result = 0;
Lisp_Object found;
}
int
-xg_set_icon_from_xpm_data (FRAME_PTR f, const char **data)
+xg_set_icon_from_xpm_data (struct frame *f, const char **data)
{
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (data);
x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
unsigned long fore_pixel, pixel;
- int fore_pixel_allocated_p = 0, pixel_allocated_p = 0;
+ bool fore_pixel_allocated_p = 0, pixel_allocated_p = 0;
struct x_output *x = f->output_data.x;
if (!NILP (Vx_cursor_fore_pixel))
static void
-x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
+x_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
set_frame_cursor_types (f, arg);
icon name to NAME. */
static void
-x_set_name_internal (FRAME_PTR f, Lisp_Object name)
+x_set_name_internal (struct frame *f, Lisp_Object name)
{
if (FRAME_X_WINDOW (f))
{
specified a name for the frame; the name will override any set by the
redisplay code. */
static void
-x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
+x_explicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
x_set_name (f, arg, 1);
}
name; names set this way will never override names set by the user's
lisp code. */
void
-x_implicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
+x_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
x_set_name (f, arg, 0);
}
for example, but Xt doesn't). */
static void
-hack_wm_protocols (FRAME_PTR f, Widget widget)
+hack_wm_protocols (struct frame *f, Widget widget)
{
Display *dpy = XtDisplay (widget);
Window w = XtWindow (widget);
xic_free_xfontset (struct frame *f)
{
Lisp_Object rest, frame;
- int shared_p = 0;
+ bool shared_p = 0;
if (!FRAME_XIC_FONTSET (f))
return;
/* The fontset is not used anymore. It is safe to free it. */
XFreeFontSet (FRAME_X_DISPLAY (f), FRAME_XIC_FONTSET (f));
- if (FRAME_XIC_BASE_FONTNAME (f))
- xfree (FRAME_XIC_BASE_FONTNAME (f));
- FRAME_XIC_BASE_FONTNAME (f) = NULL;
FRAME_XIC_FONTSET (f) = NULL;
}
for the window manager, so GC relocation won't bother it.
Elsewhere we specify the window name for the window manager. */
-
- {
- char *str = SSDATA (Vx_resource_name);
- f->namebuf = xmalloc (strlen (str) + 1);
- strcpy (f->namebuf, str);
- }
+ f->namebuf = xstrdup (SSDATA (Vx_resource_name));
ac = 0;
XtSetArg (al[ac], XtNallowShellResize, 1); ac++;
/* maybe_set_screen_title_format (shell_widget); */
pane_widget = lw_create_widget ("main", "pane", widget_id_tick++,
- (widget_value *) NULL,
- shell_widget, False,
- (lw_callback) NULL,
- (lw_callback) NULL,
- (lw_callback) NULL,
- (lw_callback) NULL);
+ NULL, shell_widget, False,
+ NULL, NULL, NULL, NULL);
ac = 0;
XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++;
*/
XChangeProperty (XtDisplay (frame_widget), XtWindow (frame_widget),
FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols,
- XA_ATOM, 32, PropModeAppend,
- (unsigned char*) NULL, 0);
+ XA_ATOM, 32, PropModeAppend, NULL, 0);
/* Make all the standard events reach the Emacs frame. */
attributes.event_mask = STANDARD_EVENT_SET;
#else /* not USE_X_TOOLKIT */
#ifdef USE_GTK
static void
-x_window (FRAME_PTR f)
+x_window (struct frame *f)
{
if (! xg_create_frame_widgets (f))
error ("Unable to create window");
| GCFillStyle | GCLineWidth),
&gc_values);
- /* Reliefs. */
- f->output_data.x->white_relief.gc = 0;
- f->output_data.x->black_relief.gc = 0;
-
/* Create the gray border tile used when the pointer is not in
the frame. Since this depends on the frame's pixel values,
this must be done on a per-frame basis. */
(Lisp_Object color, Lisp_Object frame)
{
XColor foo;
- FRAME_PTR f = decode_window_system_frame (frame);
+ struct frame *f = decode_window_system_frame (frame);
CHECK_STRING (color);
(Lisp_Object color, Lisp_Object frame)
{
XColor foo;
- FRAME_PTR f = decode_window_system_frame (frame);
+ struct frame *f = decode_window_system_frame (frame);
CHECK_STRING (color);
/ x_display_pixel_width (dpyinfo));
mm_height_per_pixel = ((double) HeightMMOfScreen (dpyinfo->screen)
/ x_display_pixel_height (dpyinfo));
- monitors = (struct MonitorInfo *) xzalloc (n_monitors * sizeof (*monitors));
+ monitors = xzalloc (n_monitors * sizeof *monitors);
for (i = 0; i < n_monitors; ++i)
{
struct MonitorInfo *mi = &monitors[i];
return Qnil;
}
n_monitors = resources->noutput;
- monitors = (struct MonitorInfo *) xzalloc (n_monitors * sizeof (*monitors));
+ monitors = xzalloc (n_monitors * sizeof *monitors);
#ifdef HAVE_XRRGETOUTPUTPRIMARY
pxid = XRRGetOutputPrimary (dpy, dpyinfo->root_window);
#endif
n_monitors = gdk_screen_get_n_monitors (gscreen);
monitor_frames = Fmake_vector (make_number (n_monitors), Qnil);
- monitors = (struct MonitorInfo *) xzalloc (n_monitors * sizeof (*monitors));
+ monitors = xzalloc (n_monitors * sizeof *monitors);
FOR_EACH_FRAME (rest, frame)
{
return attributes_list;
}
-\f
-int
-x_pixel_width (register struct frame *f)
-{
- return FRAME_PIXEL_WIDTH (f);
-}
-
-int
-x_pixel_height (register struct frame *f)
-{
- return FRAME_PIXEL_HEIGHT (f);
-}
-
/************************************************************************
X Displays
************************************************************************/
validate_x_resource_name ();
- dpyinfo = x_term_init (name, (char *)0,
- SSDATA (Vx_resource_name));
+ dpyinfo = x_term_init (name, 0, SSDATA (Vx_resource_name));
if (dpyinfo == 0)
error ("Cannot connect to X server %s", SDATA (name));
error ("Not using X Windows"); /* That doesn't stop us anymore. */
#endif
- if (! NILP (xrm_string))
- xrm_option = SSDATA (xrm_string);
- else
- xrm_option = (char *) 0;
+ xrm_option = NILP (xrm_string) ? 0 : SSDATA (xrm_string);
validate_x_resource_name ();
/* Wait for responses to all X commands issued so far for frame F. */
void
-x_sync (FRAME_PTR f)
+x_sync (struct frame *f)
{
block_input ();
XSync (FRAME_X_DISPLAY (f), False);
static void
file_dialog_cb (Widget widget, XtPointer client_data, XtPointer call_data)
{
- int *result = (int *) client_data;
- XmAnyCallbackStruct *cb = (XmAnyCallbackStruct *) call_data;
+ int *result = client_data;
+ XmAnyCallbackStruct *cb = call_data;
*result = cb->reason;
}
static void
file_dialog_unmap_cb (Widget widget, XtPointer client_data, XtPointer call_data)
{
- int *result = (int *) client_data;
+ int *result = client_data;
*result = XmCR_CANCEL;
}
This function is only defined on NS, MS Windows, and X Windows with the
Motif or Gtk toolkits. With the Motif toolkit, ONLY-DIR-P is ignored.
Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
- (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p)
+ (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename,
+ Lisp_Object mustmatch, Lisp_Object only_dir_p)
{
int result;
struct frame *f = SELECTED_FRAME ();
Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
(Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p)
{
- FRAME_PTR f = SELECTED_FRAME ();
+ struct frame *f = SELECTED_FRAME ();
char *fn;
Lisp_Object file = Qnil;
Lisp_Object decoded_file;
nil, it defaults to the selected frame. */)
(Lisp_Object frame, Lisp_Object ignored)
{
- FRAME_PTR f = decode_window_system_frame (frame);
+ struct frame *f = decode_window_system_frame (frame);
Lisp_Object font;
Lisp_Object font_param;
char *default_name = NULL;