X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fframe-x.c;h=9396eee194cb9b2210197baee9286ed81991bf3c;hb=2cbece6401b2279497293e6dc54cda607f49db2f;hp=906a6b10086da62f0fcf7fc4e2461d3ec2dcdb9d;hpb=ea1ea793fe6e244ef5555ed983423a204101af13;p=chise%2Fxemacs-chise.git- diff --git a/src/frame-x.c b/src/frame-x.c index 906a6b1..9396eee 100644 --- a/src/frame-x.c +++ b/src/frame-x.c @@ -50,6 +50,7 @@ Boston, MA 02111-1307, USA. */ #include "faces.h" #include "frame.h" #include "window.h" +#include "gutter.h" #ifdef HAVE_DRAGNDROP #include "dragdrop.h" @@ -113,7 +114,7 @@ x_any_window_to_frame (struct device *d, Window wdesc) /* We used to map over all frames here and then map over all widgets belonging to that frame. However it turns out that this was very fragile - as it requires our display stuctures to be in sync _and_ that the + as it requires our display stuctures to be in sync _and_ that the loop is told about every new widget somebody adds. Therefore we now let Xt find it for us (which does a bottom-up search which could even be faster) */ @@ -659,15 +660,17 @@ x_set_frame_text_value (struct frame *f, Bufbyte *value, for (ptr = value; *ptr; ptr++) if (!BYTE_ASCII_P (*ptr)) { - CONST char * tmp; + const char * tmp; encoding = DEVICE_XATOM_COMPOUND_TEXT (XDEVICE (FRAME_DEVICE (f))); - GET_C_CHARPTR_EXT_CTEXT_DATA_ALLOCA ((CONST char *) value, tmp); + TO_EXTERNAL_FORMAT (C_STRING, value, + C_STRING_ALLOCA, tmp, + Qctext); new_XtValue = (String) tmp; break; } #endif /* MULE */ - /* ### Caching is device-independent - belongs in update_frame_title. */ + /* #### Caching is device-independent - belongs in update_frame_title. */ Xt_GET_VALUE (FRAME_X_SHELL_WIDGET (f), Xt_resource_name, &old_XtValue); if (!old_XtValue || strcmp (new_XtValue, old_XtValue)) { @@ -758,18 +761,22 @@ x_set_frame_properties (struct frame *f, Lisp_Object plist) if (STRINGP (prop)) { - CONST char *extprop; + const char *extprop; if (XSTRING_LENGTH (prop) == 0) continue; - GET_C_STRING_CTEXT_DATA_ALLOCA (prop, extprop); + TO_EXTERNAL_FORMAT (LISP_STRING, prop, + C_STRING_ALLOCA, extprop, + Qctext); if (STRINGP (val)) { - CONST Extbyte *extval; + const Extbyte *extval; Extcount extvallen; - GET_STRING_CTEXT_DATA_ALLOCA (val, extval, extvallen); + TO_EXTERNAL_FORMAT (LISP_STRING, val, + ALLOCA, (extval, extvallen), + Qctext); XtVaSetValues (w, XtVaTypedArg, extprop, XtRString, extval, extvallen + 1, (XtArgVal) NULL); @@ -1103,7 +1110,7 @@ WARNING: can only handle plain/text and file: transfers! unsigned int modifier = 0, state = 0; char *Ctext; int numItems = 0, textlen = 0, pos = 0; - struct Lisp_Event *lisp_event = XEVENT(event); + Lisp_Event *lisp_event = XEVENT (event); Lisp_Object item = Qnil; struct gcpro gcpro1; @@ -1140,12 +1147,12 @@ WARNING: can only handle plain/text and file: transfers! x_event.xbutton.y_root = lisp_event->event.button.y; } modifier = lisp_event->event.button.modifiers; - if (modifier & MOD_SHIFT) state |= ShiftMask; - if (modifier & MOD_CONTROL) state |= ControlMask; - if (modifier & MOD_META) state |= xd->MetaMask; - if (modifier & MOD_SUPER) state |= xd->SuperMask; - if (modifier & MOD_HYPER) state |= xd->HyperMask; - if (modifier & MOD_ALT) state |= xd->AltMask; + if (modifier & XEMACS_MOD_SHIFT) state |= ShiftMask; + if (modifier & XEMACS_MOD_CONTROL) state |= ControlMask; + if (modifier & XEMACS_MOD_META) state |= xd->MetaMask; + if (modifier & XEMACS_MOD_SUPER) state |= xd->SuperMask; + if (modifier & XEMACS_MOD_HYPER) state |= xd->HyperMask; + if (modifier & XEMACS_MOD_ALT) state |= xd->AltMask; state |= Button1Mask << (lisp_event->event.button.button-1); x_event.xbutton.state = state; @@ -1185,7 +1192,7 @@ WARNING: can only handle plain/text and file: transfers! Ctext=NULL; break; } - strcpy (Ctext+pos, (CONST char *)XSTRING_DATA (XCAR (item))); + strcpy (Ctext+pos, (const char *)XSTRING_DATA (XCAR (item))); pos += XSTRING_LENGTH (XCAR (item)) + 1; item = XCDR (item); } @@ -1255,7 +1262,7 @@ x_cde_transfer_callback (Widget widget, XtPointer clientData, { filePath = transferInfo->dropData->data.files[ii]; hurl = dnd_url_hexify_string ((char *)filePath, "file:"); - /* ### Mule-izing required */ + /* #### Mule-izing required */ l_data = Fcons (make_string ((Bufbyte* )hurl, strlen (hurl)), l_data); @@ -1330,7 +1337,7 @@ The type defaults to DndText (4). char *dnd_data = NULL; unsigned long dnd_len = 0; int dnd_typ = DndText, dnd_dealloc = 0; - struct Lisp_Event *lisp_event = XEVENT(event); + Lisp_Event *lisp_event = XEVENT (event); /* only drag if this is really a press */ if (EVENT_TYPE(lisp_event) != button_press_event) @@ -1361,7 +1368,7 @@ The type defaults to DndText (4). } len = XSTRING_LENGTH (XCAR (run)) + 1; dnd_data = (char *) xrealloc (dnd_data, dnd_len + len); - strcpy (dnd_data + dnd_len - 1, (CONST char *)XSTRING_DATA (XCAR (run))); + strcpy (dnd_data + dnd_len - 1, (const char *)XSTRING_DATA (XCAR (run))); dnd_len += len; run = XCDR (run); } @@ -1406,12 +1413,12 @@ The type defaults to DndText (4). } modifier = lisp_event->event.button.modifiers; - if (modifier & MOD_SHIFT) state |= ShiftMask; - if (modifier & MOD_CONTROL) state |= ControlMask; - if (modifier & MOD_META) state |= xd->MetaMask; - if (modifier & MOD_SUPER) state |= xd->SuperMask; - if (modifier & MOD_HYPER) state |= xd->HyperMask; - if (modifier & MOD_ALT) state |= xd->AltMask; + if (modifier & XEMACS_MOD_SHIFT) state |= ShiftMask; + if (modifier & XEMACS_MOD_CONTROL) state |= ControlMask; + if (modifier & XEMACS_MOD_META) state |= xd->MetaMask; + if (modifier & XEMACS_MOD_SUPER) state |= xd->SuperMask; + if (modifier & XEMACS_MOD_HYPER) state |= xd->HyperMask; + if (modifier & XEMACS_MOD_ALT) state |= xd->AltMask; state |= Button1Mask << (lisp_event->event.button.button-1); x_event.xbutton.state = state; @@ -1544,13 +1551,16 @@ x_initialize_frame_size (struct frame *f) { struct window *win = XWINDOW (f->root_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f); - WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f); + WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) + + FRAME_LEFT_GUTTER_BOUNDS (f); + WINDOW_TOP (win) = FRAME_TOP_BORDER_END (f) + + FRAME_TOP_GUTTER_BOUNDS (f); if (!NILP (f->minibuffer_window)) { win = XWINDOW (f->minibuffer_window); - WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f); + WINDOW_LEFT (win) = FRAME_LEFT_BORDER_END (f) + + FRAME_LEFT_GUTTER_BOUNDS (f); } } @@ -1855,7 +1865,7 @@ x_create_widgets (struct frame *f, Lisp_Object lisp_window_id, #ifdef EXTERNAL_WIDGET Window window_id = 0; #endif - CONST char *name; + const char *name; Arg al [25]; int ac = 0; Widget text, container, shell; @@ -1866,7 +1876,9 @@ x_create_widgets (struct frame *f, Lisp_Object lisp_window_id, #endif if (STRINGP (f->name)) - GET_C_STRING_CTEXT_DATA_ALLOCA (f->name, name); + TO_EXTERNAL_FORMAT (LISP_STRING, f->name, + C_STRING_ALLOCA, name, + Qctext); else name = "emacs"; @@ -2664,7 +2676,7 @@ x_delete_frame (struct frame *f) #else XtDestroyWidget (FRAME_X_SHELL_WIDGET (f)); /* make sure the windows are really gone! */ - /* ### Is this REALLY necessary? */ + /* #### Is this REALLY necessary? */ XFlush (dpy); #endif /* EXTERNAL_WIDGET */