mirror of
https://github.com/vim/vim.git
synced 2025-10-18 07:54:29 -04:00
patch 8.1.2380: using old C style comments
Problem: Using old C style comments. Solution: Use // comments where appropriate.
This commit is contained in:
375
src/getchar.c
375
src/getchar.c
File diff suppressed because it is too large
Load Diff
@@ -43,11 +43,11 @@
|
||||
|
||||
#include "vim.h"
|
||||
|
||||
/* Only include this when using the file browser */
|
||||
// Only include this when using the file browser
|
||||
|
||||
#ifdef FEAT_BROWSE
|
||||
|
||||
/* Weird complication: for "make lint" Text.h doesn't combine with Xm.h */
|
||||
// Weird complication: for "make lint" Text.h doesn't combine with Xm.h
|
||||
#if defined(FEAT_GUI_MOTIF) && defined(FMT8BIT)
|
||||
# undef FMT8BIT
|
||||
#endif
|
||||
@@ -56,7 +56,7 @@
|
||||
# include "gui_at_sb.h"
|
||||
#endif
|
||||
|
||||
/***************** SFinternal.h */
|
||||
////////////////// SFinternal.h
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/StringDefs.h>
|
||||
@@ -170,7 +170,7 @@ static int (*SFfunc)();
|
||||
|
||||
static int SFstatus = SEL_FILE_NULL;
|
||||
|
||||
/***************** forward declare static functions */
|
||||
///////////////// forward declare static functions
|
||||
|
||||
static void SFsetText(char *path);
|
||||
static void SFtextChanged(void);
|
||||
@@ -184,7 +184,7 @@ static void SFvSliderMovedCallback(Widget w, int n, int nw);
|
||||
static Boolean SFworkProc(void);
|
||||
static int SFcompareEntries(const void *p, const void *q);
|
||||
|
||||
/***************** xstat.h */
|
||||
////////////////// xstat.h
|
||||
|
||||
#ifndef S_IXUSR
|
||||
# define S_IXUSR 0100
|
||||
@@ -198,7 +198,7 @@ static int SFcompareEntries(const void *p, const void *q);
|
||||
|
||||
#define S_ISXXX(m) ((m) & (S_IXUSR | S_IXGRP | S_IXOTH))
|
||||
|
||||
/***************** Path.c */
|
||||
////////////////// Path.c
|
||||
|
||||
#include <pwd.h>
|
||||
|
||||
@@ -515,7 +515,7 @@ SFgetHomeDirs(void)
|
||||
SFhomeDir.path = SFcurrentPath;
|
||||
SFhomeDir.entries = entries;
|
||||
SFhomeDir.nEntries = i;
|
||||
SFhomeDir.vOrigin = 0; /* :-) */
|
||||
SFhomeDir.vOrigin = 0; // :-)
|
||||
SFhomeDir.nChars = maxChars + 2;
|
||||
SFhomeDir.hOrigin = 0;
|
||||
SFhomeDir.changed = 1;
|
||||
@@ -969,7 +969,7 @@ SFdirModTimer(XtPointer cl UNUSED, XtIntervalId *id UNUSED)
|
||||
SFdirModTimer, (XtPointer) NULL);
|
||||
}
|
||||
|
||||
/* Return a single character describing what kind of file STATBUF is. */
|
||||
// Return a single character describing what kind of file STATBUF is.
|
||||
|
||||
static char
|
||||
SFstatChar(stat_T *statBuf)
|
||||
@@ -981,11 +981,11 @@ SFstatChar(stat_T *statBuf)
|
||||
#ifdef S_ISSOCK
|
||||
if (S_ISSOCK (statBuf->st_mode))
|
||||
return '=';
|
||||
#endif /* S_ISSOCK */
|
||||
#endif // S_ISSOCK
|
||||
return ' ';
|
||||
}
|
||||
|
||||
/***************** Draw.c */
|
||||
////////////////// Draw.c
|
||||
|
||||
#ifdef FEAT_GUI_NEXTAW
|
||||
# include <X11/neXtaw/Cardinals.h>
|
||||
@@ -1604,7 +1604,7 @@ SFenterList(Widget w UNUSED, int n, XEnterWindowEvent *event)
|
||||
{
|
||||
int nw;
|
||||
|
||||
/* sanity */
|
||||
// sanity
|
||||
if (SFcurrentInvert[n] != -1)
|
||||
{
|
||||
SFinvertEntry(n);
|
||||
@@ -1980,7 +1980,7 @@ SFworkProc(void)
|
||||
return True;
|
||||
}
|
||||
|
||||
/***************** Dir.c */
|
||||
////////////////// Dir.c
|
||||
|
||||
static int
|
||||
SFcompareEntries(const void *p, const void *q)
|
||||
@@ -2020,7 +2020,7 @@ SFgetDir(
|
||||
|
||||
while ((dp = readdir(dirp)))
|
||||
{
|
||||
/* Ignore "." and ".." */
|
||||
// Ignore "." and ".."
|
||||
if (strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0)
|
||||
continue;
|
||||
if (i >= Alloc)
|
||||
@@ -2051,7 +2051,7 @@ SFgetDir(
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***************** SFinternal.h */
|
||||
////////////////// SFinternal.h
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <X11/cursorfont.h>
|
||||
@@ -2202,7 +2202,7 @@ SFsetColors(
|
||||
XSetForeground(gui.dpy, SFtextGC, fg);
|
||||
XSetForeground(gui.dpy, SFlineGC, fg);
|
||||
|
||||
/* This is an xor GC, so combine the fg and background */
|
||||
// This is an xor GC, so combine the fg and background
|
||||
XSetBackground(gui.dpy, SFinvertGC, fg ^ bg);
|
||||
XSetForeground(gui.dpy, SFinvertGC, fg ^ bg);
|
||||
}
|
||||
@@ -2250,7 +2250,7 @@ SFcreateWidgets(
|
||||
XtNtitle, prompt,
|
||||
NULL);
|
||||
|
||||
/* Add WM_DELETE_WINDOW protocol */
|
||||
// Add WM_DELETE_WINDOW protocol
|
||||
XtAppAddActions(XtWidgetToApplicationContext(selFile),
|
||||
actions, XtNumber(actions));
|
||||
XtOverrideTranslations(selFile,
|
||||
@@ -2522,7 +2522,7 @@ SFcreateWidgets(
|
||||
XtSetMappedWhenManaged(selFile, False);
|
||||
XtRealizeWidget(selFile);
|
||||
|
||||
/* Add WM_DELETE_WINDOW protocol */
|
||||
// Add WM_DELETE_WINDOW protocol
|
||||
SFwmDeleteWindow = XInternAtom(SFdisplay, "WM_DELETE_WINDOW", False);
|
||||
XSetWMProtocols(SFdisplay, XtWindow(selFile), &SFwmDeleteWindow, 1);
|
||||
|
||||
@@ -2609,7 +2609,7 @@ SFgetText(void)
|
||||
XtNstring, &wcbuf,
|
||||
NULL);
|
||||
mbslength = wcstombs(NULL, wcbuf, 0);
|
||||
/* Hack: some broken wcstombs() returns zero, just get a large buffer */
|
||||
// Hack: some broken wcstombs() returns zero, just get a large buffer
|
||||
if (mbslength == 0 && wcbuf != NULL && wcbuf[0] != 0)
|
||||
mbslength = MAXPATHL;
|
||||
buf=(char *)XtMalloc(mbslength + 1);
|
||||
@@ -2645,7 +2645,7 @@ vim_SelFile(
|
||||
guicolor_T fg,
|
||||
guicolor_T bg,
|
||||
guicolor_T scroll_fg,
|
||||
guicolor_T scroll_bg) /* The "Scrollbar" group colors */
|
||||
guicolor_T scroll_bg) // The "Scrollbar" group colors
|
||||
{
|
||||
static int firstTime = 1;
|
||||
XEvent event;
|
||||
@@ -2731,4 +2731,4 @@ vim_SelFile(
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* FEAT_BROWSE */
|
||||
#endif // FEAT_BROWSE
|
||||
|
118
src/gui_at_sb.c
118
src/gui_at_sb.c
@@ -56,9 +56,9 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
/* ScrollBar.c */
|
||||
/* created by weissman, Mon Jul 7 13:20:03 1986 */
|
||||
/* converted by swick, Thu Aug 27 1987 */
|
||||
// ScrollBar.c
|
||||
// created by weissman, Mon Jul 7 13:20:03 1986
|
||||
// converted by swick, Thu Aug 27 1987
|
||||
|
||||
#include "vim.h"
|
||||
|
||||
@@ -70,7 +70,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
#include <X11/Xmu/Drawing.h>
|
||||
|
||||
/* Private definitions. */
|
||||
// Private definitions.
|
||||
|
||||
static char defaultTranslations[] =
|
||||
"<Btn1Down>: NotifyScroll()\n\
|
||||
@@ -164,7 +164,7 @@ static XtActionsRec actions[] =
|
||||
|
||||
ScrollbarClassRec vim_scrollbarClassRec =
|
||||
{
|
||||
{ /* core fields */
|
||||
{ // core fields
|
||||
/* superclass */ (WidgetClass) &simpleClassRec,
|
||||
/* class_name */ "Scrollbar",
|
||||
/* size */ sizeof(ScrollbarRec),
|
||||
@@ -198,13 +198,13 @@ ScrollbarClassRec vim_scrollbarClassRec =
|
||||
/* display_accelerator*/ XtInheritDisplayAccelerator,
|
||||
/* extension */ NULL
|
||||
},
|
||||
{ /* simple fields */
|
||||
{ // simple fields
|
||||
/* change_sensitive */ XtInheritChangeSensitive,
|
||||
#ifndef OLDXAW
|
||||
/* extension */ NULL
|
||||
#endif
|
||||
},
|
||||
{ /* scrollbar fields */
|
||||
{ // scrollbar fields
|
||||
/* empty */ 0
|
||||
}
|
||||
};
|
||||
@@ -240,7 +240,7 @@ FillArea(
|
||||
int fill,
|
||||
int draw_shadow)
|
||||
{
|
||||
int tlen = bottom - top; /* length of thumb in pixels */
|
||||
int tlen = bottom - top; // length of thumb in pixels
|
||||
int sw, margin, floor;
|
||||
int lx, ly, lw, lh;
|
||||
|
||||
@@ -273,24 +273,24 @@ FillArea(
|
||||
{
|
||||
if (!(sbw->scrollbar.orientation == XtorientHorizontal))
|
||||
{
|
||||
/* Top border */
|
||||
// Top border
|
||||
XDrawLine (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
|
||||
sbw->scrollbar.top_shadow_GC,
|
||||
lx, ly, lx + lw - 1, ly);
|
||||
|
||||
/* Bottom border */
|
||||
// Bottom border
|
||||
XDrawLine (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
|
||||
sbw->scrollbar.bot_shadow_GC,
|
||||
lx, ly + lh - 1, lx + lw - 1, ly + lh - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Left border */
|
||||
// Left border
|
||||
XDrawLine (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
|
||||
sbw->scrollbar.top_shadow_GC,
|
||||
lx, ly, lx, ly + lh - 1);
|
||||
|
||||
/* Right border */
|
||||
// Right border
|
||||
XDrawLine (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
|
||||
sbw->scrollbar.bot_shadow_GC,
|
||||
lx + lw - 1, ly, lx + lw - 1, ly + lh - 1);
|
||||
@@ -306,24 +306,24 @@ FillArea(
|
||||
|
||||
if (!(sbw->scrollbar.orientation == XtorientHorizontal))
|
||||
{
|
||||
/* Left border */
|
||||
// Left border
|
||||
XDrawLine(XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
|
||||
sbw->scrollbar.top_shadow_GC,
|
||||
lx, ly, lx, ly + lh - 1);
|
||||
|
||||
/* Right border */
|
||||
// Right border
|
||||
XDrawLine(XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
|
||||
sbw->scrollbar.bot_shadow_GC,
|
||||
lx + lw - 1, ly, lx + lw - 1, ly + lh - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Top border */
|
||||
// Top border
|
||||
XDrawLine(XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
|
||||
sbw->scrollbar.top_shadow_GC,
|
||||
lx, ly, lx + lw - 1, ly);
|
||||
|
||||
/* Bottom border */
|
||||
// Bottom border
|
||||
XDrawLine(XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
|
||||
sbw->scrollbar.bot_shadow_GC,
|
||||
lx, ly + lh - 1, lx + lw - 1, ly + lh - 1);
|
||||
@@ -336,11 +336,11 @@ FillArea(
|
||||
}
|
||||
}
|
||||
|
||||
/* Paint the thumb in the area specified by sbw->top and
|
||||
sbw->shown. The old area is erased. The painting and
|
||||
erasing is done cleverly so that no flickering will occur.
|
||||
/*
|
||||
* Paint the thumb in the area specified by sbw->top and
|
||||
* sbw->shown. The old area is erased. The painting and
|
||||
* erasing is done cleverly so that no flickering will occur.
|
||||
*/
|
||||
|
||||
static void
|
||||
PaintThumb(ScrollbarWidget sbw)
|
||||
{
|
||||
@@ -369,7 +369,7 @@ PaintThumb(ScrollbarWidget sbw)
|
||||
if (newbot > oldbot)
|
||||
FillArea(sbw, AT_MAX(newtop, oldbot-1), newbot, 1,0);
|
||||
|
||||
/* Only draw the missing shadows */
|
||||
// Only draw the missing shadows
|
||||
FillArea(sbw, newtop, newbot, 0, 1);
|
||||
}
|
||||
}
|
||||
@@ -408,7 +408,7 @@ PaintArrows(ScrollbarWidget sbw)
|
||||
point[5].x = thickness / 2;
|
||||
point[5].y = sbw->scrollbar.length - sbw->scrollbar.shadow_width - 1;
|
||||
|
||||
/* horizontal arrows require that x and y coordinates be swapped */
|
||||
// horizontal arrows require that x and y coordinates be swapped
|
||||
if (sbw->scrollbar.orientation == XtorientHorizontal)
|
||||
{
|
||||
int n;
|
||||
@@ -420,7 +420,7 @@ PaintArrows(ScrollbarWidget sbw)
|
||||
point[n].y = swap;
|
||||
}
|
||||
}
|
||||
/* draw the up/left arrow */
|
||||
// draw the up/left arrow
|
||||
XFillPolygon (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
|
||||
sbw->scrollbar.gc,
|
||||
point, 3,
|
||||
@@ -433,7 +433,7 @@ PaintArrows(ScrollbarWidget sbw)
|
||||
sbw->scrollbar.top_shadow_GC,
|
||||
point[0].x, point[0].y,
|
||||
point[2].x, point[2].y);
|
||||
/* draw the down/right arrow */
|
||||
// draw the down/right arrow
|
||||
XFillPolygon (XtDisplay ((Widget) sbw), XtWindow ((Widget) sbw),
|
||||
sbw->scrollbar.gc,
|
||||
point+3, 3,
|
||||
@@ -497,8 +497,8 @@ CreateGC(Widget w)
|
||||
gcValues.fill_style = FillSolid;
|
||||
mask |= GCFillStyle;
|
||||
}
|
||||
/* the creation should be non-caching, because */
|
||||
/* we now set and clear clip masks on the gc returned */
|
||||
// the creation should be non-caching, because
|
||||
// we now set and clear clip masks on the gc returned
|
||||
sbw->scrollbar.gc = XtGetGC (w, mask, &gcValues);
|
||||
}
|
||||
|
||||
@@ -519,8 +519,8 @@ SetDimensions(ScrollbarWidget sbw)
|
||||
|
||||
static void
|
||||
Initialize(
|
||||
Widget request UNUSED, /* what the client asked for */
|
||||
Widget new, /* what we're going to give him */
|
||||
Widget request UNUSED, // what the client asked for
|
||||
Widget new, // what we're going to give him
|
||||
ArgList args UNUSED,
|
||||
Cardinal *num_args UNUSED)
|
||||
{
|
||||
@@ -551,16 +551,16 @@ Realize(
|
||||
Mask *valueMask,
|
||||
XSetWindowAttributes *attributes)
|
||||
{
|
||||
/* The Simple widget actually stuffs the value in the valuemask. */
|
||||
// The Simple widget actually stuffs the value in the valuemask.
|
||||
(*vim_scrollbarWidgetClass->core_class.superclass->core_class.realize)
|
||||
(w, valueMask, attributes);
|
||||
}
|
||||
|
||||
static Boolean
|
||||
SetValues(
|
||||
Widget current, /* what I am */
|
||||
Widget request UNUSED, /* what he wants me to be */
|
||||
Widget desired, /* what I will become */
|
||||
Widget current, // what I am
|
||||
Widget request UNUSED, // what he wants me to be
|
||||
Widget desired, // what I will become
|
||||
ArgList args UNUSED,
|
||||
Cardinal *num_args UNUSED)
|
||||
{
|
||||
@@ -600,8 +600,8 @@ SetValues(
|
||||
static void
|
||||
Resize(Widget w)
|
||||
{
|
||||
/* ForgetGravity has taken care of background, but thumb may
|
||||
* have to move as a result of the new size. */
|
||||
// ForgetGravity has taken care of background, but thumb may
|
||||
// have to move as a result of the new size.
|
||||
SetDimensions ((ScrollbarWidget) w);
|
||||
Redisplay(w, (XEvent*) NULL, (Region)NULL);
|
||||
}
|
||||
@@ -633,11 +633,11 @@ Redisplay(Widget w, XEvent *event, Region region)
|
||||
if (region == NULL ||
|
||||
XRectInRegion (region, x, y, width, height) != RectangleOut)
|
||||
{
|
||||
/* Forces entire thumb to be painted. */
|
||||
// Forces entire thumb to be painted.
|
||||
sbw->scrollbar.topLoc = -(sbw->scrollbar.length + 1);
|
||||
PaintThumb (sbw);
|
||||
}
|
||||
/* we'd like to be region aware here!!!! */
|
||||
// we'd like to be region aware here!!!!
|
||||
PaintArrows(sbw);
|
||||
}
|
||||
|
||||
@@ -693,7 +693,7 @@ PeekNotifyEvent(Display *dpy, XEvent *event, char *args)
|
||||
{
|
||||
struct EventData *eventData = (struct EventData*)args;
|
||||
|
||||
return ((++eventData->count == QLength(dpy)) /* since PeekIf blocks */
|
||||
return ((++eventData->count == QLength(dpy)) // since PeekIf blocks
|
||||
|| CompareEvents(event, eventData->oldEvent));
|
||||
}
|
||||
|
||||
@@ -719,9 +719,9 @@ LookAhead(Widget w, XEvent *event)
|
||||
static void
|
||||
ExtractPosition(
|
||||
XEvent *event,
|
||||
Position *x, /* RETURN */
|
||||
Position *y, /* RETURN */
|
||||
unsigned int *state) /* RETURN */
|
||||
Position *x, // RETURN
|
||||
Position *y, // RETURN
|
||||
unsigned int *state) // RETURN
|
||||
{
|
||||
switch (event->type)
|
||||
{
|
||||
@@ -771,8 +771,8 @@ HandleThumb(
|
||||
|
||||
ExtractPosition(event, &x, &y, (unsigned int *)NULL);
|
||||
loc = PICKLENGTH(sbw, x, y);
|
||||
/* if the motion event puts the pointer in thumb, call Move and Notify */
|
||||
/* also call Move and Notify if we're already in continuous scroll mode */
|
||||
// if the motion event puts the pointer in thumb, call Move and Notify
|
||||
// also call Move and Notify if we're already in continuous scroll mode
|
||||
if (sbw->scrollbar.scroll_mode == SMODE_CONT ||
|
||||
(loc >= sbw->scrollbar.topLoc &&
|
||||
loc <= sbw->scrollbar.topLoc + (int)sbw->scrollbar.shownLength))
|
||||
@@ -876,7 +876,7 @@ ScrollSome(
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
|
||||
if (sbw->scrollbar.scroll_mode == SMODE_CONT) /* if scroll continuous */
|
||||
if (sbw->scrollbar.scroll_mode == SMODE_CONT) // if scroll continuous
|
||||
return;
|
||||
|
||||
if (LookAhead(w, event))
|
||||
@@ -900,7 +900,7 @@ NotifyScroll(
|
||||
int call_data = 0;
|
||||
unsigned int state;
|
||||
|
||||
if (sbw->scrollbar.scroll_mode == SMODE_CONT) /* if scroll continuous */
|
||||
if (sbw->scrollbar.scroll_mode == SMODE_CONT) // if scroll continuous
|
||||
return;
|
||||
|
||||
if (LookAhead (w, event))
|
||||
@@ -968,7 +968,7 @@ NotifyScroll(
|
||||
if (call_data)
|
||||
XtCallCallbacks(w, XtNscrollProc, (XtPointer)(long_u)call_data);
|
||||
|
||||
/* establish autoscroll */
|
||||
// establish autoscroll
|
||||
if (delay)
|
||||
sbw->scrollbar.timer_id =
|
||||
XtAppAddTimeOut(XtWidgetToApplicationContext(w),
|
||||
@@ -985,9 +985,9 @@ EndScroll(
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
|
||||
sbw->scrollbar.scroll_mode = SMODE_NONE;
|
||||
/* no need to remove any autoscroll timeout; it will no-op */
|
||||
/* because the scroll_mode is SMODE_NONE */
|
||||
/* but be sure to remove timeout in destroy proc */
|
||||
// no need to remove any autoscroll timeout; it will no-op
|
||||
// because the scroll_mode is SMODE_NONE
|
||||
// but be sure to remove timeout in destroy proc
|
||||
}
|
||||
|
||||
static float
|
||||
@@ -1016,7 +1016,7 @@ MoveThumb(
|
||||
float top;
|
||||
char old_mode = sbw->scrollbar.scroll_mode;
|
||||
|
||||
sbw->scrollbar.scroll_mode = SMODE_CONT; /* indicate continuous scroll */
|
||||
sbw->scrollbar.scroll_mode = SMODE_CONT; // indicate continuous scroll
|
||||
|
||||
if (LookAhead(w, event))
|
||||
return;
|
||||
@@ -1028,7 +1028,7 @@ MoveThumb(
|
||||
|
||||
top = FractionLoc(sbw, x, y);
|
||||
|
||||
if (old_mode != SMODE_CONT) /* start dragging: set offset */
|
||||
if (old_mode != SMODE_CONT) // start dragging: set offset
|
||||
{
|
||||
if (event->xbutton.button == Button2)
|
||||
sbw->scrollbar.scroll_off = sbw->scrollbar.shown / 2.;
|
||||
@@ -1045,7 +1045,7 @@ MoveThumb(
|
||||
|
||||
sbw->scrollbar.top = top;
|
||||
PaintThumb(sbw);
|
||||
XFlush(XtDisplay(w)); /* re-draw it before Notifying */
|
||||
XFlush(XtDisplay(w)); // re-draw it before Notifying
|
||||
}
|
||||
|
||||
|
||||
@@ -1057,8 +1057,8 @@ NotifyThumb(
|
||||
Cardinal *num_params UNUSED)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget)w;
|
||||
/* Use a union to avoid a warning for the weird conversion from float to
|
||||
* XtPointer. Comes from Xaw/Scrollbar.c. */
|
||||
// Use a union to avoid a warning for the weird conversion from float to
|
||||
// XtPointer. Comes from Xaw/Scrollbar.c.
|
||||
union {
|
||||
XtPointer xtp;
|
||||
float xtf;
|
||||
@@ -1067,9 +1067,9 @@ NotifyThumb(
|
||||
if (LookAhead(w, event))
|
||||
return;
|
||||
|
||||
/* thumbProc is not pretty, but is necessary for backwards
|
||||
compatibility on those architectures for which it work{s,ed};
|
||||
the intent is to pass a (truncated) float by value. */
|
||||
// thumbProc is not pretty, but is necessary for backwards
|
||||
// compatibility on those architectures for which it work{s,ed};
|
||||
// the intent is to pass a (truncated) float by value.
|
||||
xtpf.xtf = sbw->scrollbar.top;
|
||||
XtCallCallbacks(w, XtNthumbProc, xtpf.xtp);
|
||||
XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);
|
||||
@@ -1137,7 +1137,7 @@ _Xaw3dDrawShadows(
|
||||
bot = sbw->scrollbar.top_shadow_GC;
|
||||
}
|
||||
|
||||
/* top-left shadow */
|
||||
// top-left shadow
|
||||
if ((region == NULL) ||
|
||||
(XRectInRegion (region, 0, 0, w, s) != RectangleOut) ||
|
||||
(XRectInRegion (region, 0, 0, s, h) != RectangleOut))
|
||||
@@ -1151,7 +1151,7 @@ _Xaw3dDrawShadows(
|
||||
XFillPolygon (dpy, win, top, pt, 6, Complex, CoordModeOrigin);
|
||||
}
|
||||
|
||||
/* bottom-right shadow */
|
||||
// bottom-right shadow
|
||||
if ((region == NULL) ||
|
||||
(XRectInRegion (region, 0, hms, w, s) != RectangleOut) ||
|
||||
(XRectInRegion (region, wms, 0, s, h) != RectangleOut))
|
||||
@@ -1176,7 +1176,7 @@ vim_XawScrollbarSetThumb(Widget w, double top, double shown, double max)
|
||||
{
|
||||
ScrollbarWidget sbw = (ScrollbarWidget) w;
|
||||
|
||||
if (sbw->scrollbar.scroll_mode == SMODE_CONT) /* if still thumbing */
|
||||
if (sbw->scrollbar.scroll_mode == SMODE_CONT) // if still thumbing
|
||||
return;
|
||||
|
||||
sbw->scrollbar.max = (max > 1.0) ? 1.0 :
|
||||
|
351
src/gui_athena.c
351
src/gui_athena.c
@@ -34,7 +34,7 @@
|
||||
# include <X11/Xaw/Dialog.h>
|
||||
# include <X11/Xaw/Text.h>
|
||||
# include <X11/Xaw/AsciiText.h>
|
||||
#endif /* FEAT_GUI_NEXTAW */
|
||||
#endif // FEAT_GUI_NEXTAW
|
||||
|
||||
#ifndef FEAT_GUI_NEXTAW
|
||||
# include "gui_at_sb.h"
|
||||
@@ -46,9 +46,9 @@ static Widget vimForm = (Widget)0;
|
||||
Widget textArea = (Widget)0;
|
||||
#ifdef FEAT_MENU
|
||||
static Widget menuBar = (Widget)0;
|
||||
static XtIntervalId timer = 0; /* 0 = expired, otherwise active */
|
||||
static XtIntervalId timer = 0; // 0 = expired, otherwise active
|
||||
|
||||
/* Used to figure out menu ordering */
|
||||
// Used to figure out menu ordering
|
||||
static vimmenu_T *a_cur_menu = NULL;
|
||||
static Cardinal athena_calculate_ins_pos(Widget);
|
||||
|
||||
@@ -96,7 +96,7 @@ gui_athena_scroll_cb_jump(
|
||||
|
||||
if (sb == NULL)
|
||||
return;
|
||||
else if (sb->wp != NULL) /* Left or right scrollbar */
|
||||
else if (sb->wp != NULL) // Left or right scrollbar
|
||||
{
|
||||
/*
|
||||
* Careful: need to get scrollbar info out of first (left) scrollbar
|
||||
@@ -105,7 +105,7 @@ gui_athena_scroll_cb_jump(
|
||||
*/
|
||||
sb_info = &sb->wp->w_scrollbars[0];
|
||||
}
|
||||
else /* Bottom scrollbar */
|
||||
else // Bottom scrollbar
|
||||
sb_info = sb;
|
||||
|
||||
value = (long)(*((float *)call_data) * (float)(sb_info->max + 1) + 0.001);
|
||||
@@ -134,7 +134,7 @@ gui_athena_scroll_cb_scroll(
|
||||
|
||||
if (sb == NULL)
|
||||
return;
|
||||
if (sb->wp != NULL) /* Left or right scrollbar */
|
||||
if (sb->wp != NULL) // Left or right scrollbar
|
||||
{
|
||||
/*
|
||||
* Careful: need to get scrollbar info out of first (left) scrollbar
|
||||
@@ -144,7 +144,7 @@ gui_athena_scroll_cb_scroll(
|
||||
sb_info = &sb->wp->w_scrollbars[0];
|
||||
|
||||
if (sb_info->size > 5)
|
||||
page = sb_info->size - 2; /* use two lines of context */
|
||||
page = sb_info->size - 2; // use two lines of context
|
||||
else
|
||||
page = sb_info->size;
|
||||
#ifdef FEAT_GUI_NEXTAW
|
||||
@@ -177,7 +177,7 @@ gui_athena_scroll_cb_scroll(
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else /* Bottom scrollbar */
|
||||
else // Bottom scrollbar
|
||||
{
|
||||
sb_info = sb;
|
||||
#ifdef FEAT_GUI_NEXTAW
|
||||
@@ -194,14 +194,14 @@ gui_athena_scroll_cb_scroll(
|
||||
data = 1;
|
||||
}
|
||||
#endif
|
||||
if (data < -1) /* page-width left */
|
||||
if (data < -1) // page-width left
|
||||
{
|
||||
if (sb->size > 8)
|
||||
data = -(sb->size - 5);
|
||||
else
|
||||
data = -sb->size;
|
||||
}
|
||||
else if (data > 1) /* page-width right */
|
||||
else if (data > 1) // page-width right
|
||||
{
|
||||
if (sb->size > 8)
|
||||
data = (sb->size - 5);
|
||||
@@ -216,8 +216,8 @@ gui_athena_scroll_cb_scroll(
|
||||
else if (value < 0)
|
||||
value = 0;
|
||||
|
||||
/* Update the bottom scrollbar an extra time (why is this needed?? */
|
||||
if (sb->wp == NULL) /* Bottom scrollbar */
|
||||
// Update the bottom scrollbar an extra time (why is this needed??
|
||||
if (sb->wp == NULL) // Bottom scrollbar
|
||||
gui_mch_set_scrollbar_thumb(sb, value, sb->size, sb->max);
|
||||
|
||||
gui_drag_scrollbar(sb, value, FALSE);
|
||||
@@ -235,7 +235,7 @@ gui_x11_create_widgets(void)
|
||||
*/
|
||||
gui.border_offset = gui.border_width;
|
||||
|
||||
/* The form containing all the other widgets */
|
||||
// The form containing all the other widgets
|
||||
vimForm = XtVaCreateManagedWidget("vimForm",
|
||||
formWidgetClass, vimShell,
|
||||
XtNborderWidth, 0,
|
||||
@@ -243,7 +243,7 @@ gui_x11_create_widgets(void)
|
||||
gui_athena_scroll_colors(vimForm);
|
||||
|
||||
#ifdef FEAT_MENU
|
||||
/* The top menu bar */
|
||||
// The top menu bar
|
||||
menuBar = XtVaCreateManagedWidget("menuBar",
|
||||
boxWidgetClass, vimForm,
|
||||
XtNresizable, True,
|
||||
@@ -259,8 +259,8 @@ gui_x11_create_widgets(void)
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_TOOLBAR
|
||||
/* Don't create it Managed, it will be managed when creating the first
|
||||
* item. Otherwise an empty toolbar shows up. */
|
||||
// Don't create it Managed, it will be managed when creating the first
|
||||
// item. Otherwise an empty toolbar shows up.
|
||||
toolBar = XtVaCreateWidget("toolBar",
|
||||
boxWidgetClass, vimForm,
|
||||
XtNresizable, True,
|
||||
@@ -276,7 +276,7 @@ gui_x11_create_widgets(void)
|
||||
gui_athena_menu_colors(toolBar);
|
||||
#endif
|
||||
|
||||
/* The text area. */
|
||||
// The text area.
|
||||
textArea = XtVaCreateManagedWidget("textArea",
|
||||
coreWidgetClass, vimForm,
|
||||
XtNresizable, True,
|
||||
@@ -315,7 +315,7 @@ gui_x11_create_widgets(void)
|
||||
XtNumber(pullAction));
|
||||
#endif
|
||||
|
||||
/* Pretend we don't have input focus, we will get an event if we do. */
|
||||
// Pretend we don't have input focus, we will get an event if we do.
|
||||
gui.in_focus = FALSE;
|
||||
}
|
||||
|
||||
@@ -352,10 +352,9 @@ gui_athena_create_pullright_pixmap(Widget w)
|
||||
to.addr = (XtPointer)&font;
|
||||
to.size = sizeof(XFontStruct *);
|
||||
#endif
|
||||
/* Assumption: The menuBar children will use the same font as the
|
||||
* pulldown menu items AND they will all be of type
|
||||
* XtNfont.
|
||||
*/
|
||||
// Assumption: The menuBar children will use the same font as the
|
||||
// pulldown menu items AND they will all be of type
|
||||
// XtNfont.
|
||||
XtVaGetValues(menuBar, XtNchildren, &children,
|
||||
XtNnumChildren, &num_children,
|
||||
NULL);
|
||||
@@ -369,7 +368,7 @@ gui_athena_create_pullright_pixmap(Widget w)
|
||||
#endif
|
||||
) == False)
|
||||
return None;
|
||||
/* "font" should now contain data */
|
||||
// "font" should now contain data
|
||||
}
|
||||
else
|
||||
#ifdef FONTSET_ALWAYS
|
||||
@@ -449,18 +448,18 @@ static void createXpmImages(char_u *path, char **xpm, Pixmap *sen);
|
||||
static void
|
||||
get_toolbar_pixmap(vimmenu_T *menu, Pixmap *sen)
|
||||
{
|
||||
char_u buf[MAXPATHL]; /* buffer storing expanded pathname */
|
||||
char **xpm = NULL; /* xpm array */
|
||||
char_u buf[MAXPATHL]; // buffer storing expanded pathname
|
||||
char **xpm = NULL; // xpm array
|
||||
|
||||
buf[0] = NUL; /* start with NULL path */
|
||||
buf[0] = NUL; // start with NULL path
|
||||
|
||||
if (menu->iconfile != NULL)
|
||||
{
|
||||
/* Use the "icon=" argument. */
|
||||
// Use the "icon=" argument.
|
||||
gui_find_iconfile(menu->iconfile, buf, "xpm");
|
||||
createXpmImages(buf, NULL, sen);
|
||||
|
||||
/* If it failed, try using the menu name. */
|
||||
// If it failed, try using the menu name.
|
||||
if (*sen == (Pixmap)0 && gui_find_bitmap(menu->name, buf, "xpm") == OK)
|
||||
createXpmImages(buf, NULL, sen);
|
||||
if (*sen != (Pixmap)0)
|
||||
@@ -511,7 +510,7 @@ createXpmImages(char_u *path, char **xpm, Pixmap *sen)
|
||||
&color[TOP_SHADOW].pixel,
|
||||
&color[HIGHLIGHT].pixel);
|
||||
|
||||
/* Setup the color substitution table */
|
||||
// Setup the color substitution table
|
||||
attrs.valuemask = XpmColorSymbols;
|
||||
attrs.colorsymbols = color;
|
||||
attrs.numsymbols = 5;
|
||||
@@ -519,7 +518,7 @@ createXpmImages(char_u *path, char **xpm, Pixmap *sen)
|
||||
screenNum = DefaultScreen(gui.dpy);
|
||||
rootWindow = RootWindow(gui.dpy, screenNum);
|
||||
|
||||
/* Create the "sensitive" pixmap */
|
||||
// Create the "sensitive" pixmap
|
||||
if (xpm != NULL)
|
||||
status = XpmCreatePixmapFromData(gui.dpy, rootWindow, xpm,
|
||||
&map, &mask, &attrs);
|
||||
@@ -532,13 +531,13 @@ createXpmImages(char_u *path, char **xpm, Pixmap *sen)
|
||||
GC back_gc;
|
||||
GC mask_gc;
|
||||
|
||||
/* Need to create new Pixmaps with the mask applied. */
|
||||
// Need to create new Pixmaps with the mask applied.
|
||||
gcvalues.foreground = color[BACKGROUND].pixel;
|
||||
back_gc = XCreateGC(gui.dpy, map, GCForeground, &gcvalues);
|
||||
mask_gc = XCreateGC(gui.dpy, map, GCForeground, &gcvalues);
|
||||
XSetClipMask(gui.dpy, mask_gc, mask);
|
||||
|
||||
/* Create the "sensitive" pixmap. */
|
||||
// Create the "sensitive" pixmap.
|
||||
*sen = XCreatePixmap(gui.dpy, rootWindow,
|
||||
attrs.width, attrs.height,
|
||||
DefaultDepth(gui.dpy, screenNum));
|
||||
@@ -567,7 +566,7 @@ gui_mch_set_toolbar_pos(
|
||||
Dimension border;
|
||||
int height;
|
||||
|
||||
if (!XtIsManaged(toolBar)) /* nothing to do */
|
||||
if (!XtIsManaged(toolBar)) // nothing to do
|
||||
return;
|
||||
XtUnmanageChild(toolBar);
|
||||
XtVaGetValues(toolBar,
|
||||
@@ -602,7 +601,7 @@ gui_mch_set_text_area_pos(
|
||||
NULL);
|
||||
XtManageChild(textArea);
|
||||
#ifdef FEAT_TOOLBAR
|
||||
/* Give keyboard focus to the textArea instead of the toolbar. */
|
||||
// Give keyboard focus to the textArea instead of the toolbar.
|
||||
gui_mch_reset_focus();
|
||||
#endif
|
||||
}
|
||||
@@ -686,7 +685,7 @@ gui_mch_set_menu_pos(
|
||||
|
||||
XtUnmanageChild(menuBar);
|
||||
XtVaGetValues(menuBar, XtNborderWidth, &border, NULL);
|
||||
/* avoid trouble when there are no menu items, and h is 1 */
|
||||
// avoid trouble when there are no menu items, and h is 1
|
||||
height = h - 2 * border;
|
||||
if (height < 0)
|
||||
height = 1;
|
||||
@@ -709,19 +708,17 @@ gui_mch_set_menu_pos(
|
||||
static Cardinal
|
||||
athena_calculate_ins_pos(Widget widget)
|
||||
{
|
||||
/* Assume that if the parent of the vimmenu_T is NULL, then we can get
|
||||
* to this menu by traversing "next", starting at "root_menu".
|
||||
*
|
||||
* This holds true for popup menus, toolbar, and toplevel menu items.
|
||||
*/
|
||||
// Assume that if the parent of the vimmenu_T is NULL, then we can get
|
||||
// to this menu by traversing "next", starting at "root_menu".
|
||||
//
|
||||
// This holds true for popup menus, toolbar, and toplevel menu items.
|
||||
|
||||
/* Popup menus: "id" is NULL. Only submenu_id is valid */
|
||||
// Popup menus: "id" is NULL. Only submenu_id is valid
|
||||
|
||||
/* Menus that are not toplevel: "parent" will be non-NULL, "id" &
|
||||
* "submenu_id" will be non-NULL.
|
||||
*/
|
||||
// Menus that are not toplevel: "parent" will be non-NULL, "id" &
|
||||
// "submenu_id" will be non-NULL.
|
||||
|
||||
/* Toplevel menus: "parent" is NULL, id is the widget of the menu item */
|
||||
// Toplevel menus: "parent" is NULL, id is the widget of the menu item
|
||||
|
||||
WidgetList children;
|
||||
Cardinal num_children = 0;
|
||||
@@ -793,7 +790,7 @@ gui_mch_add_menu(vimmenu_T *menu, int idx UNUSED)
|
||||
gui_athena_menu_colors(menu->submenu_id);
|
||||
gui_athena_menu_font(menu->submenu_id);
|
||||
|
||||
/* Don't update the menu height when it was set at a fixed value */
|
||||
// Don't update the menu height when it was set at a fixed value
|
||||
if (!gui.menu_height_fixed)
|
||||
{
|
||||
/*
|
||||
@@ -827,9 +824,8 @@ gui_mch_add_menu(vimmenu_T *menu, int idx UNUSED)
|
||||
|
||||
XtVaSetValues(menu->id, XtNrightBitmap, pullerBitmap,
|
||||
NULL);
|
||||
/* If there are other menu items that are not pulldown menus,
|
||||
* we need to adjust the right margins of those, too.
|
||||
*/
|
||||
// If there are other menu items that are not pulldown menus,
|
||||
// we need to adjust the right margins of those, too.
|
||||
{
|
||||
WidgetList children;
|
||||
Cardinal num_children;
|
||||
@@ -865,11 +861,10 @@ gui_mch_add_menu(vimmenu_T *menu, int idx UNUSED)
|
||||
a_cur_menu = NULL;
|
||||
}
|
||||
|
||||
/* Used to determine whether a SimpleMenu has pulldown entries.
|
||||
*
|
||||
* "id" is the parent of the menu items.
|
||||
* Ignore widget "ignore" in the pane.
|
||||
*/
|
||||
// Used to determine whether a SimpleMenu has pulldown entries.
|
||||
//
|
||||
// "id" is the parent of the menu items.
|
||||
// Ignore widget "ignore" in the pane.
|
||||
static Boolean
|
||||
gui_athena_menu_has_submenus(Widget id, Widget ignore)
|
||||
{
|
||||
@@ -900,8 +895,8 @@ gui_athena_menu_font(Widget id)
|
||||
{
|
||||
XtUnmanageChild(id);
|
||||
XtVaSetValues(id, XtNfontSet, gui.menu_fontset, NULL);
|
||||
/* We should force the widget to recalculate its
|
||||
* geometry now. */
|
||||
// We should force the widget to recalculate its
|
||||
// geometry now.
|
||||
XtManageChild(id);
|
||||
}
|
||||
else
|
||||
@@ -929,7 +924,7 @@ gui_athena_menu_font(Widget id)
|
||||
if (has_submenu(id))
|
||||
XtVaSetValues(id, XtNrightBitmap, pullerBitmap, NULL);
|
||||
|
||||
/* Force the widget to recalculate its geometry now. */
|
||||
// Force the widget to recalculate its geometry now.
|
||||
if (managed)
|
||||
XtManageChild(id);
|
||||
}
|
||||
@@ -953,10 +948,9 @@ gui_mch_new_menu_font(void)
|
||||
gui_mch_submenu_change(root_menu, FALSE);
|
||||
|
||||
{
|
||||
/* Iterate through the menubar menu items and get the height of
|
||||
* each one. The menu bar height is set to the maximum of all
|
||||
* the heights.
|
||||
*/
|
||||
// Iterate through the menubar menu items and get the height of
|
||||
// each one. The menu bar height is set to the maximum of all
|
||||
// the heights.
|
||||
vimmenu_T *mp;
|
||||
int max_height = 9999;
|
||||
|
||||
@@ -975,7 +969,7 @@ gui_mch_new_menu_font(void)
|
||||
}
|
||||
if (max_height != 9999)
|
||||
{
|
||||
/* Don't update the menu height when it was set at a fixed value */
|
||||
// Don't update the menu height when it was set at a fixed value
|
||||
if (!gui.menu_height_fixed)
|
||||
{
|
||||
Dimension space, border;
|
||||
@@ -988,12 +982,11 @@ gui_mch_new_menu_font(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Now, to simulate the window being resized. Only, this
|
||||
* will resize the window to its current state.
|
||||
*
|
||||
* There has to be a better way, but I do not see one at this time.
|
||||
* (David Harrison)
|
||||
*/
|
||||
// Now, to simulate the window being resized. Only, this
|
||||
// will resize the window to its current state.
|
||||
//
|
||||
// There has to be a better way, but I do not see one at this time.
|
||||
// (David Harrison)
|
||||
{
|
||||
Position w, h;
|
||||
|
||||
@@ -1048,7 +1041,7 @@ gui_mch_new_tooltip_colors(void)
|
||||
static void
|
||||
gui_mch_submenu_change(
|
||||
vimmenu_T *menu,
|
||||
int colors) /* TRUE for colors, FALSE for font */
|
||||
int colors) // TRUE for colors, FALSE for font
|
||||
{
|
||||
vimmenu_T *mp;
|
||||
|
||||
@@ -1060,8 +1053,8 @@ gui_mch_submenu_change(
|
||||
{
|
||||
gui_athena_menu_colors(mp->id);
|
||||
#ifdef FEAT_TOOLBAR
|
||||
/* For a toolbar item: Free the pixmap and allocate a new one,
|
||||
* so that the background color is right. */
|
||||
// For a toolbar item: Free the pixmap and allocate a new one,
|
||||
// so that the background color is right.
|
||||
if (mp->image != (Pixmap)0)
|
||||
{
|
||||
XFreePixmap(gui.dpy, mp->image);
|
||||
@@ -1071,7 +1064,7 @@ gui_mch_submenu_change(
|
||||
}
|
||||
|
||||
# ifdef FEAT_BEVAL_GUI
|
||||
/* If we have a tooltip, then we need to change its colors */
|
||||
// If we have a tooltip, then we need to change its colors
|
||||
if (mp->tip != NULL)
|
||||
{
|
||||
Arg args[2];
|
||||
@@ -1089,9 +1082,8 @@ gui_mch_submenu_change(
|
||||
{
|
||||
gui_athena_menu_font(mp->id);
|
||||
#ifdef FEAT_BEVAL_GUI
|
||||
/* If we have a tooltip, then we need to change its font */
|
||||
/* Assume XtNinternational == True (in createBalloonEvalWindow)
|
||||
*/
|
||||
// If we have a tooltip, then we need to change its font
|
||||
// Assume XtNinternational == True (in createBalloonEvalWindow)
|
||||
if (mp->tip != NULL)
|
||||
{
|
||||
Arg args[1];
|
||||
@@ -1106,7 +1098,7 @@ gui_mch_submenu_change(
|
||||
|
||||
if (mp->children != NULL)
|
||||
{
|
||||
/* Set the colors/font for the tear off widget */
|
||||
// Set the colors/font for the tear off widget
|
||||
if (mp->submenu_id != (Widget)0)
|
||||
{
|
||||
if (colors)
|
||||
@@ -1114,7 +1106,7 @@ gui_mch_submenu_change(
|
||||
else
|
||||
gui_athena_menu_font(mp->submenu_id);
|
||||
}
|
||||
/* Set the colors for the children */
|
||||
// Set the colors for the children
|
||||
gui_mch_submenu_change(mp->children, colors);
|
||||
}
|
||||
}
|
||||
@@ -1171,18 +1163,15 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx UNUSED)
|
||||
}
|
||||
XtSetArg(args[n], XtNhighlightThickness, 0); n++;
|
||||
type = commandWidgetClass;
|
||||
/* TODO: figure out the position in the toolbar?
|
||||
* This currently works fine for the default toolbar, but
|
||||
* what if we add/remove items during later runtime?
|
||||
*/
|
||||
// TODO: figure out the position in the toolbar?
|
||||
// This currently works fine for the default toolbar, but
|
||||
// what if we add/remove items during later runtime?
|
||||
|
||||
/* NOTE: "idx" isn't used here. The position is calculated by
|
||||
* athena_calculate_ins_pos(). The position it calculates
|
||||
* should be equal to "idx".
|
||||
*/
|
||||
/* TODO: Could we just store "idx" and use that as the child
|
||||
* placement?
|
||||
*/
|
||||
// NOTE: "idx" isn't used here. The position is calculated by
|
||||
// athena_calculate_ins_pos(). The position it calculates
|
||||
// should be equal to "idx".
|
||||
// TODO: Could we just store "idx" and use that as the child
|
||||
// placement?
|
||||
|
||||
if (menu->id == NULL)
|
||||
{
|
||||
@@ -1206,10 +1195,10 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx UNUSED)
|
||||
gui_mch_show_toolbar(TRUE);
|
||||
gui.toolbar_height = gui_mch_compute_toolbar_height();
|
||||
return;
|
||||
} /* toolbar menu item */
|
||||
} // toolbar menu item
|
||||
# endif
|
||||
|
||||
/* Add menu separator */
|
||||
// Add menu separator
|
||||
if (menu_is_separator(menu->name))
|
||||
{
|
||||
menu->submenu_id = (Widget)0;
|
||||
@@ -1235,10 +1224,9 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx UNUSED)
|
||||
if (menu->id == (Widget)0)
|
||||
return;
|
||||
|
||||
/* If there are other "pulldown" items in this pane, then adjust
|
||||
* the right margin to accommodate the arrow pixmap, otherwise
|
||||
* the right margin will be the same as the left margin.
|
||||
*/
|
||||
// If there are other "pulldown" items in this pane, then adjust
|
||||
// the right margin to accommodate the arrow pixmap, otherwise
|
||||
// the right margin will be the same as the left margin.
|
||||
{
|
||||
Dimension left_margin;
|
||||
|
||||
@@ -1263,16 +1251,15 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx UNUSED)
|
||||
void
|
||||
gui_mch_show_toolbar(int showit)
|
||||
{
|
||||
Cardinal numChildren; /* how many children toolBar has */
|
||||
Cardinal numChildren; // how many children toolBar has
|
||||
|
||||
if (toolBar == (Widget)0)
|
||||
return;
|
||||
XtVaGetValues(toolBar, XtNnumChildren, &numChildren, NULL);
|
||||
if (showit && numChildren > 0)
|
||||
{
|
||||
/* Assume that we want to show the toolbar if p_toolbar contains valid
|
||||
* option settings, therefore p_toolbar must not be NULL.
|
||||
*/
|
||||
// Assume that we want to show the toolbar if p_toolbar contains valid
|
||||
// option settings, therefore p_toolbar must not be NULL.
|
||||
WidgetList children;
|
||||
|
||||
XtVaGetValues(toolBar, XtNchildren, &children, NULL);
|
||||
@@ -1296,12 +1283,11 @@ gui_mch_show_toolbar(int showit)
|
||||
for (toolbar = root_menu; toolbar; toolbar = toolbar->next)
|
||||
if (menu_is_toolbar(toolbar->dname))
|
||||
break;
|
||||
/* Assumption: toolbar is NULL if there is no toolbar,
|
||||
* otherwise it contains the toolbar menu structure.
|
||||
*
|
||||
* Assumption: "numChildren" == the number of items in the list
|
||||
* of items beginning with toolbar->children.
|
||||
*/
|
||||
// Assumption: toolbar is NULL if there is no toolbar,
|
||||
// otherwise it contains the toolbar menu structure.
|
||||
//
|
||||
// Assumption: "numChildren" == the number of items in the list
|
||||
// of items beginning with toolbar->children.
|
||||
if (toolbar)
|
||||
{
|
||||
for (cur = toolbar->children; cur; cur = cur->next)
|
||||
@@ -1309,9 +1295,8 @@ gui_mch_show_toolbar(int showit)
|
||||
Arg args[2];
|
||||
int n = 0;
|
||||
|
||||
/* Enable/Disable tooltip (OK to enable while currently
|
||||
* enabled)
|
||||
*/
|
||||
// Enable/Disable tooltip (OK to enable while currently
|
||||
// enabled)
|
||||
if (cur->tip != NULL)
|
||||
(*action)(cur->tip);
|
||||
if (text == 1)
|
||||
@@ -1387,12 +1372,12 @@ gui_mch_show_toolbar(int showit)
|
||||
int
|
||||
gui_mch_compute_toolbar_height(void)
|
||||
{
|
||||
Dimension height; /* total Toolbar height */
|
||||
Dimension whgt; /* height of each widget */
|
||||
Dimension marginHeight; /* XmNmarginHeight of toolBar */
|
||||
Dimension shadowThickness; /* thickness of Xtparent(toolBar) */
|
||||
WidgetList children; /* list of toolBar's children */
|
||||
Cardinal numChildren; /* how many children toolBar has */
|
||||
Dimension height; // total Toolbar height
|
||||
Dimension whgt; // height of each widget
|
||||
Dimension marginHeight; // XmNmarginHeight of toolBar
|
||||
Dimension shadowThickness; // thickness of Xtparent(toolBar)
|
||||
WidgetList children; // list of toolBar's children
|
||||
Cardinal numChildren; // how many children toolBar has
|
||||
int i;
|
||||
|
||||
height = 0;
|
||||
@@ -1438,7 +1423,7 @@ gui_mch_get_toolbar_colors(
|
||||
void
|
||||
gui_mch_toggle_tearoffs(int enable UNUSED)
|
||||
{
|
||||
/* no tearoff menus */
|
||||
// no tearoff menus
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1464,23 +1449,21 @@ gui_mch_destroy_menu(vimmenu_T *menu)
|
||||
{
|
||||
Widget parent;
|
||||
|
||||
/* There is no item for the toolbar. */
|
||||
// There is no item for the toolbar.
|
||||
if (menu->id == (Widget)0)
|
||||
return;
|
||||
|
||||
parent = XtParent(menu->id);
|
||||
|
||||
/* When removing the last "pulldown" menu item from a pane, adjust the
|
||||
* right margins of the remaining widgets.
|
||||
*/
|
||||
// When removing the last "pulldown" menu item from a pane, adjust the
|
||||
// right margins of the remaining widgets.
|
||||
if (menu->submenu_id != (Widget)0)
|
||||
{
|
||||
/* Go through the menu items in the parent of this item and
|
||||
* adjust their margins, if necessary.
|
||||
* This takes care of the case when we delete the last menu item in a
|
||||
* pane that has a submenu. In this case, there will be no arrow
|
||||
* pixmaps shown anymore.
|
||||
*/
|
||||
// Go through the menu items in the parent of this item and
|
||||
// adjust their margins, if necessary.
|
||||
// This takes care of the case when we delete the last menu item in a
|
||||
// pane that has a submenu. In this case, there will be no arrow
|
||||
// pixmaps shown anymore.
|
||||
{
|
||||
WidgetList children;
|
||||
Cardinal num_children;
|
||||
@@ -1515,11 +1498,10 @@ gui_mch_destroy_menu(vimmenu_T *menu)
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Please be sure to destroy the parent widget first (i.e. menu->id).
|
||||
*
|
||||
* This code should be basically identical to that in the file gui_motif.c
|
||||
* because they are both Xt based.
|
||||
*/
|
||||
// Please be sure to destroy the parent widget first (i.e. menu->id).
|
||||
//
|
||||
// This code should be basically identical to that in the file gui_motif.c
|
||||
// because they are both Xt based.
|
||||
if (menu->id != (Widget)0)
|
||||
{
|
||||
Cardinal num_children;
|
||||
@@ -1535,15 +1517,14 @@ gui_mch_destroy_menu(vimmenu_T *menu)
|
||||
#if defined(FEAT_TOOLBAR) && defined(FEAT_BEVAL_GUI)
|
||||
if (parent == toolBar && menu->tip != NULL)
|
||||
{
|
||||
/* We try to destroy this before the actual menu, because there are
|
||||
* callbacks, etc. that will be unregistered during the tooltip
|
||||
* destruction.
|
||||
*
|
||||
* If you call "gui_mch_destroy_beval_area()" after destroying
|
||||
* menu->id, then the tooltip's window will have already been
|
||||
* deallocated by Xt, and unknown behaviour will ensue (probably
|
||||
* a core dump).
|
||||
*/
|
||||
// We try to destroy this before the actual menu, because there are
|
||||
// callbacks, etc. that will be unregistered during the tooltip
|
||||
// destruction.
|
||||
//
|
||||
// If you call "gui_mch_destroy_beval_area()" after destroying
|
||||
// menu->id, then the tooltip's window will have already been
|
||||
// deallocated by Xt, and unknown behaviour will ensue (probably
|
||||
// a core dump).
|
||||
gui_mch_destroy_beval_area(menu->tip);
|
||||
menu->tip = NULL;
|
||||
}
|
||||
@@ -1555,15 +1536,14 @@ gui_mch_destroy_menu(vimmenu_T *menu)
|
||||
* will be deleted soon anyway, and it will delete its children like
|
||||
* all good widgets do.
|
||||
*/
|
||||
/* NOTE: The cause of the BadValue X Protocol Error is because when the
|
||||
* last child is destroyed, it is first unmanaged, thus causing a
|
||||
* geometry resize request from the parent Shell widget.
|
||||
* Since the Shell widget has no more children, it is resized to have
|
||||
* width/height of 0. XConfigureWindow() is then called with the
|
||||
* width/height of 0, which generates the BadValue.
|
||||
*
|
||||
* This happens in phase two of the widget destruction process.
|
||||
*/
|
||||
// NOTE: The cause of the BadValue X Protocol Error is because when the
|
||||
// last child is destroyed, it is first unmanaged, thus causing a
|
||||
// geometry resize request from the parent Shell widget.
|
||||
// Since the Shell widget has no more children, it is resized to have
|
||||
// width/height of 0. XConfigureWindow() is then called with the
|
||||
// width/height of 0, which generates the BadValue.
|
||||
//
|
||||
// This happens in phase two of the widget destruction process.
|
||||
{
|
||||
if (parent != menuBar
|
||||
#ifdef FEAT_TOOLBAR
|
||||
@@ -1588,7 +1568,7 @@ gui_mch_destroy_menu(vimmenu_T *menu)
|
||||
#ifdef FEAT_TOOLBAR
|
||||
else if (parent == toolBar)
|
||||
{
|
||||
/* When removing last toolbar item, don't display the toolbar. */
|
||||
// When removing last toolbar item, don't display the toolbar.
|
||||
XtVaGetValues(toolBar, XtNnumChildren, &num_children, NULL);
|
||||
if (num_children == 0)
|
||||
gui_mch_show_toolbar(FALSE);
|
||||
@@ -1620,7 +1600,7 @@ gui_athena_menu_timeout(
|
||||
XtVaGetValues(w, XtNrightBitmap, &p, NULL);
|
||||
if ((p != None) && (p != XtUnspecifiedPixmap))
|
||||
{
|
||||
/* We are dealing with an item that has a submenu */
|
||||
// We are dealing with an item that has a submenu
|
||||
popup = get_popup_entry(XtParent(w));
|
||||
if (popup == (Widget)0)
|
||||
return;
|
||||
@@ -1629,7 +1609,8 @@ gui_athena_menu_timeout(
|
||||
}
|
||||
}
|
||||
|
||||
/* This routine is used to calculate the position (in screen coordinates)
|
||||
/*
|
||||
* This routine is used to calculate the position (in screen coordinates)
|
||||
* where a submenu should appear relative to the menu entry that popped it
|
||||
* up. It should appear even with and just slightly to the left of the
|
||||
* rightmost end of the menu entry that caused the popup.
|
||||
@@ -1642,12 +1623,12 @@ gui_athena_popup_callback(
|
||||
XtPointer client_data,
|
||||
XtPointer call_data UNUSED)
|
||||
{
|
||||
/* Assumption: XtIsSubclass(XtParent(w),simpleMenuWidgetClass) */
|
||||
// Assumption: XtIsSubclass(XtParent(w),simpleMenuWidgetClass)
|
||||
vimmenu_T *menu = (vimmenu_T *)client_data;
|
||||
Dimension width;
|
||||
Position root_x, root_y;
|
||||
|
||||
/* First, popdown any siblings that may have menus popped up */
|
||||
// First, popdown any siblings that may have menus popped up
|
||||
{
|
||||
vimmenu_T *i;
|
||||
|
||||
@@ -1660,8 +1641,8 @@ gui_athena_popup_callback(
|
||||
XtVaGetValues(XtParent(w),
|
||||
XtNwidth, &width,
|
||||
NULL);
|
||||
/* Assumption: XawSimpleMenuGetActiveEntry(XtParent(w)) == menu->id */
|
||||
/* i.e. This IS the active entry */
|
||||
// Assumption: XawSimpleMenuGetActiveEntry(XtParent(w)) == menu->id
|
||||
// i.e. This IS the active entry
|
||||
XtTranslateCoords(menu->id,width - 5, 0, &root_x, &root_y);
|
||||
XtVaSetValues(w, XtNx, root_x,
|
||||
XtNy, root_y,
|
||||
@@ -1696,7 +1677,9 @@ gui_athena_popdown_submenus_action(
|
||||
}
|
||||
}
|
||||
|
||||
/* Used to determine if the given widget has a submenu that can be popped up. */
|
||||
/*
|
||||
* Used to determine if the given widget has a submenu that can be popped up.
|
||||
*/
|
||||
static Boolean
|
||||
has_submenu(Widget widget)
|
||||
{
|
||||
@@ -1740,7 +1723,7 @@ gui_athena_delayed_arm_action(
|
||||
{
|
||||
if (timer)
|
||||
{
|
||||
/* If the timeout hasn't been triggered, remove it */
|
||||
// If the timeout hasn't been triggered, remove it
|
||||
XtRemoveTimeOut(timer);
|
||||
}
|
||||
gui_athena_popdown_submenus_action(w,event,args,nargs);
|
||||
@@ -1760,22 +1743,22 @@ get_popup_entry(Widget w)
|
||||
{
|
||||
Widget menuw;
|
||||
|
||||
/* Get the active entry for the current menu */
|
||||
// Get the active entry for the current menu
|
||||
if ((menuw = XawSimpleMenuGetActiveEntry(w)) == (Widget)0)
|
||||
return NULL;
|
||||
|
||||
return submenu_widget(menuw);
|
||||
}
|
||||
|
||||
/* Given the widget that has been determined to have a submenu, return the submenu widget
|
||||
* that is to be popped up.
|
||||
/*
|
||||
* Given the widget that has been determined to have a submenu, return the
|
||||
* submenu widget that is to be popped up.
|
||||
*/
|
||||
static Widget
|
||||
submenu_widget(Widget widget)
|
||||
{
|
||||
/* Precondition: has_submenu(widget) == True
|
||||
* XtIsSubclass(XtParent(widget),simpleMenuWidgetClass) == True
|
||||
*/
|
||||
// Precondition: has_submenu(widget) == True
|
||||
// XtIsSubclass(XtParent(widget),simpleMenuWidgetClass) == True
|
||||
|
||||
char_u *pullright_name;
|
||||
Widget popup;
|
||||
@@ -1785,8 +1768,8 @@ submenu_widget(Widget widget)
|
||||
vim_free(pullright_name);
|
||||
|
||||
return popup;
|
||||
/* Postcondition: (popup != NULL) implies
|
||||
* (XtIsSubclass(popup,simpleMenuWidgetClass) == True) */
|
||||
// Postcondition: (popup != NULL) implies
|
||||
// (XtIsSubclass(popup,simpleMenuWidgetClass) == True)
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1799,7 +1782,7 @@ gui_mch_show_popupmenu(vimmenu_T *menu)
|
||||
if (menu->submenu_id == (Widget)0)
|
||||
return;
|
||||
|
||||
/* Position the popup menu at the pointer */
|
||||
// Position the popup menu at the pointer
|
||||
if (XQueryPointer(gui.dpy, XtWindow(vimShell), &root, &child,
|
||||
&rootx, &rooty, &winx, &winy, &mask))
|
||||
{
|
||||
@@ -1819,7 +1802,7 @@ gui_mch_show_popupmenu(vimmenu_T *menu)
|
||||
XtPopupSpringLoaded(menu->submenu_id);
|
||||
}
|
||||
|
||||
#endif /* FEAT_MENU */
|
||||
#endif // FEAT_MENU
|
||||
|
||||
/*
|
||||
* Set the menu and scrollbar colors to their default values.
|
||||
@@ -1866,7 +1849,7 @@ gui_mch_set_scrollbar_thumb(
|
||||
*/
|
||||
if (max == 0)
|
||||
{
|
||||
/* So you can't scroll it at all (normally it scrolls past end) */
|
||||
// So you can't scroll it at all (normally it scrolls past end)
|
||||
#ifdef FEAT_GUI_NEXTAW
|
||||
XawScrollbarSetThumb(sb->id, 0.0, 1.0);
|
||||
#else
|
||||
@@ -1921,7 +1904,7 @@ gui_mch_enable_scrollbar(scrollbar_T *sb, int flag)
|
||||
void
|
||||
gui_mch_create_scrollbar(
|
||||
scrollbar_T *sb,
|
||||
int orient) /* SBAR_VERT or SBAR_HORIZ */
|
||||
int orient) // SBAR_VERT or SBAR_HORIZ
|
||||
{
|
||||
sb->id = XtVaCreateWidget("scrollBar",
|
||||
#ifdef FEAT_GUI_NEXTAW
|
||||
@@ -1971,7 +1954,7 @@ gui_mch_set_scrollbar_colors(scrollbar_T *sb)
|
||||
XtNbackground, gui.scroll_bg_pixel,
|
||||
NULL);
|
||||
|
||||
/* This is needed for the rectangle below the vertical scrollbars. */
|
||||
// This is needed for the rectangle below the vertical scrollbars.
|
||||
if (sb == &gui.bottom_sbar && vimForm != (Widget)0)
|
||||
gui_athena_scroll_colors(vimForm);
|
||||
}
|
||||
@@ -1992,17 +1975,17 @@ gui_x11_get_wid(void)
|
||||
*/
|
||||
char_u *
|
||||
gui_mch_browse(
|
||||
int saving UNUSED, /* select file to write */
|
||||
char_u *title, /* title for the window */
|
||||
char_u *dflt, /* default name */
|
||||
char_u *ext UNUSED, /* extension added */
|
||||
char_u *initdir, /* initial directory, NULL for current dir */
|
||||
char_u *filter UNUSED) /* file name filter */
|
||||
int saving UNUSED, // select file to write
|
||||
char_u *title, // title for the window
|
||||
char_u *dflt, // default name
|
||||
char_u *ext UNUSED, // extension added
|
||||
char_u *initdir, // initial directory, NULL for current dir
|
||||
char_u *filter UNUSED) // file name filter
|
||||
{
|
||||
Position x, y;
|
||||
char_u dirbuf[MAXPATHL];
|
||||
|
||||
/* Concatenate "initdir" and "dflt". */
|
||||
// Concatenate "initdir" and "dflt".
|
||||
if (initdir == NULL || *initdir == NUL)
|
||||
mch_dirname(dirbuf, MAXPATHL);
|
||||
else if (STRLEN(initdir) + 2 < MAXPATHL)
|
||||
@@ -2016,7 +1999,7 @@ gui_mch_browse(
|
||||
STRCAT(dirbuf, dflt);
|
||||
}
|
||||
|
||||
/* Position the file selector just below the menubar */
|
||||
// Position the file selector just below the menubar
|
||||
XtTranslateCoords(vimShell, (Position)0, (Position)
|
||||
#ifdef FEAT_MENU
|
||||
gui.menu_height
|
||||
@@ -2111,13 +2094,13 @@ gui_mch_dialog(
|
||||
title = (char_u *)_("Vim dialog");
|
||||
dialogStatus = -1;
|
||||
|
||||
/* if our pointer is currently hidden, then we should show it. */
|
||||
// if our pointer is currently hidden, then we should show it.
|
||||
gui_mch_mousehide(FALSE);
|
||||
|
||||
/* Check 'v' flag in 'guioptions': vertical button placement. */
|
||||
// Check 'v' flag in 'guioptions': vertical button placement.
|
||||
vertical = (vim_strchr(p_go, GO_VERTICAL) != NULL);
|
||||
|
||||
/* The shell is created each time, to make sure it is resized properly */
|
||||
// The shell is created each time, to make sure it is resized properly
|
||||
dialogshell = XtVaCreatePopupShell("dialogShell",
|
||||
transientShellWidgetClass, vimShell,
|
||||
XtNtitle, title,
|
||||
@@ -2170,7 +2153,7 @@ gui_mch_dialog(
|
||||
XtSetKeyboardFocus(dialog, dialogtextfield);
|
||||
}
|
||||
|
||||
/* make a copy, so that we can insert NULs */
|
||||
// make a copy, so that we can insert NULs
|
||||
buts = vim_strsave(buttons);
|
||||
if (buts == NULL)
|
||||
return -1;
|
||||
@@ -2213,7 +2196,7 @@ gui_mch_dialog(
|
||||
|
||||
XtRealizeWidget(dialogshell);
|
||||
|
||||
/* Setup for catching the close-window event, don't let it close Vim! */
|
||||
// Setup for catching the close-window event, don't let it close Vim!
|
||||
dialogatom = XInternAtom(gui.dpy, "WM_DELETE_WINDOW", False);
|
||||
XSetWMProtocols(gui.dpy, XtWindow(dialogshell), &dialogatom, 1);
|
||||
XtAddEventHandler(dialogshell, NoEventMask, True, dialog_wm_handler, NULL);
|
||||
@@ -2236,8 +2219,8 @@ gui_mch_dialog(
|
||||
y = 0;
|
||||
XtVaSetValues(dialogshell, XtNx, x, XtNy, y, NULL);
|
||||
|
||||
/* Position the mouse pointer in the dialog, required for when focus
|
||||
* follows mouse. */
|
||||
// Position the mouse pointer in the dialog, required for when focus
|
||||
// follows mouse.
|
||||
XWarpPointer(gui.dpy, (Window)0, XtWindow(dialogshell), 0, 0, 0, 0, 20, 40);
|
||||
|
||||
|
||||
|
136
src/gui_beval.c
136
src/gui_beval.c
@@ -12,7 +12,7 @@
|
||||
|
||||
#if defined(FEAT_BEVAL_GUI) || defined(PROTO)
|
||||
|
||||
/* on Win32 only get_beval_info() is required */
|
||||
// on Win32 only get_beval_info() is required
|
||||
#if !defined(FEAT_GUI_MSWIN) || defined(PROTO)
|
||||
|
||||
#ifdef FEAT_GUI_GTK
|
||||
@@ -32,7 +32,7 @@
|
||||
# include <Xm/AtomMgr.h>
|
||||
# include <Xm/Protocols.h>
|
||||
# else
|
||||
/* Assume Athena */
|
||||
// Assume Athena
|
||||
# include <X11/Shell.h>
|
||||
# ifdef FEAT_GUI_NEXTAW
|
||||
# include <X11/neXtaw/Label.h>
|
||||
@@ -95,7 +95,7 @@ gui_mch_create_beval_area(
|
||||
void *clientData)
|
||||
{
|
||||
#ifndef FEAT_GUI_GTK
|
||||
char *display_name; /* get from gui.dpy */
|
||||
char *display_name; // get from gui.dpy
|
||||
int screen_num;
|
||||
char *p;
|
||||
#endif
|
||||
@@ -157,7 +157,7 @@ gui_mch_destroy_beval_area(BalloonEval *beval)
|
||||
{
|
||||
cancelBalloon(beval);
|
||||
removeEventHandler(beval);
|
||||
/* Children will automatically be destroyed */
|
||||
// Children will automatically be destroyed
|
||||
# ifdef FEAT_GUI_GTK
|
||||
gtk_widget_destroy(beval->balloonShell);
|
||||
# else
|
||||
@@ -198,7 +198,7 @@ gui_mch_currently_showing_beval(void)
|
||||
return current_beval;
|
||||
}
|
||||
#endif
|
||||
#endif /* !FEAT_GUI_MSWIN */
|
||||
#endif // !FEAT_GUI_MSWIN
|
||||
|
||||
#if defined(FEAT_NETBEANS_INTG) || defined(FEAT_EVAL) || defined(PROTO)
|
||||
# if !defined(FEAT_GUI_MSWIN) || defined(PROTO)
|
||||
@@ -216,8 +216,8 @@ gui_mch_post_balloon(BalloonEval *beval, char_u *mesg)
|
||||
else
|
||||
undrawBalloon(beval);
|
||||
}
|
||||
# endif /* !FEAT_GUI_MSWIN */
|
||||
#endif /* FEAT_NETBEANS_INTG || PROTO */
|
||||
# endif // !FEAT_GUI_MSWIN
|
||||
#endif // FEAT_NETBEANS_INTG || PROTO
|
||||
|
||||
#if !defined(FEAT_GUI_MSWIN) || defined(PROTO)
|
||||
#if defined(FEAT_BEVAL_TIP) || defined(PROTO)
|
||||
@@ -344,7 +344,7 @@ target_event_cb(GtkWidget *widget, GdkEvent *event, gpointer data)
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE; /* continue emission */
|
||||
return FALSE; // continue emission
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -364,7 +364,7 @@ mainwin_event_cb(GtkWidget *widget UNUSED, GdkEvent *event, gpointer data)
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE; /* continue emission */
|
||||
return FALSE; // continue emission
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -383,7 +383,7 @@ pointer_event(BalloonEval *beval, int x, int y, unsigned state)
|
||||
beval->state = state;
|
||||
cancelBalloon(beval);
|
||||
|
||||
/* Mouse buttons are pressed - no balloon now */
|
||||
// Mouse buttons are pressed - no balloon now
|
||||
if (!(state & ((int)GDK_BUTTON1_MASK | (int)GDK_BUTTON2_MASK
|
||||
| (int)GDK_BUTTON3_MASK)))
|
||||
{
|
||||
@@ -431,8 +431,8 @@ key_event(BalloonEval *beval, unsigned keyval, int is_keypress)
|
||||
? (int)GDK_CONTROL_MASK : 0);
|
||||
break;
|
||||
default:
|
||||
/* Don't do this for key release, we apparently get these with
|
||||
* focus changes in some GTK version. */
|
||||
// Don't do this for key release, we apparently get these with
|
||||
// focus changes in some GTK version.
|
||||
if (is_keypress)
|
||||
cancelBalloon(beval);
|
||||
break;
|
||||
@@ -455,7 +455,7 @@ timeout_cb(gpointer data)
|
||||
*/
|
||||
requestBalloon(beval);
|
||||
|
||||
return FALSE; /* don't call me again */
|
||||
return FALSE; // don't call me again
|
||||
}
|
||||
|
||||
# if GTK_CHECK_VERSION(3,0,0)
|
||||
@@ -499,11 +499,11 @@ balloon_expose_event_cb(GtkWidget *widget,
|
||||
&event->area, widget, "tooltip",
|
||||
0, 0, -1, -1);
|
||||
|
||||
return FALSE; /* continue emission */
|
||||
return FALSE; // continue emission
|
||||
}
|
||||
# endif /* !GTK_CHECK_VERSION(3,0,0) */
|
||||
# endif // !GTK_CHECK_VERSION(3,0,0)
|
||||
|
||||
#else /* !FEAT_GUI_GTK */
|
||||
#else // !FEAT_GUI_GTK
|
||||
|
||||
static void
|
||||
addEventHandler(Widget target, BalloonEval *beval)
|
||||
@@ -551,8 +551,8 @@ pointerEventEH(
|
||||
static void
|
||||
pointerEvent(BalloonEval *beval, XEvent *event)
|
||||
{
|
||||
Position distance; /* a measure of how much the pointer moved */
|
||||
Position delta; /* used to compute distance */
|
||||
Position distance; // a measure of how much the pointer moved
|
||||
Position delta; // used to compute distance
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
@@ -575,7 +575,7 @@ pointerEvent(BalloonEval *beval, XEvent *event)
|
||||
beval->state = event->xmotion.state;
|
||||
if (beval->state & (Button1Mask|Button2Mask|Button3Mask))
|
||||
{
|
||||
/* Mouse buttons are pressed - no balloon now */
|
||||
// Mouse buttons are pressed - no balloon now
|
||||
cancelBalloon(beval);
|
||||
}
|
||||
else if (beval->state & (Mod1Mask|Mod2Mask|Mod3Mask))
|
||||
@@ -663,9 +663,9 @@ pointerEvent(BalloonEval *beval, XEvent *event)
|
||||
break;
|
||||
|
||||
case LeaveNotify:
|
||||
/* Ignore LeaveNotify events that are not "normal".
|
||||
* Apparently we also get it when somebody else grabs focus.
|
||||
* Happens for me every two seconds (some clipboard tool?) */
|
||||
// Ignore LeaveNotify events that are not "normal".
|
||||
// Apparently we also get it when somebody else grabs focus.
|
||||
// Happens for me every two seconds (some clipboard tool?)
|
||||
if (event->xcrossing.mode == NotifyNormal)
|
||||
cancelBalloon(beval);
|
||||
break;
|
||||
@@ -694,14 +694,14 @@ timerRoutine(XtPointer dx, XtIntervalId *id UNUSED)
|
||||
requestBalloon(beval);
|
||||
}
|
||||
|
||||
#endif /* !FEAT_GUI_GTK */
|
||||
#endif // !FEAT_GUI_GTK
|
||||
|
||||
static void
|
||||
requestBalloon(BalloonEval *beval)
|
||||
{
|
||||
if (beval->showState != ShS_PENDING)
|
||||
{
|
||||
/* Determine the beval to display */
|
||||
// Determine the beval to display
|
||||
if (beval->msgCB != NULL)
|
||||
{
|
||||
beval->showState = ShS_PENDING;
|
||||
@@ -733,7 +733,7 @@ set_printable_label_text(GtkLabel *label, char_u *text)
|
||||
int uc;
|
||||
PangoAttrList *attr_list;
|
||||
|
||||
/* Convert to UTF-8 if it isn't already */
|
||||
// Convert to UTF-8 if it isn't already
|
||||
if (output_conv.vc_type != CONV_NONE)
|
||||
{
|
||||
convbuf = string_convert(&output_conv, text, NULL);
|
||||
@@ -741,14 +741,14 @@ set_printable_label_text(GtkLabel *label, char_u *text)
|
||||
text = convbuf;
|
||||
}
|
||||
|
||||
/* First let's see how much we need to allocate */
|
||||
// First let's see how much we need to allocate
|
||||
len = 0;
|
||||
for (p = text; *p != NUL; p += charlen)
|
||||
{
|
||||
if ((*p & 0x80) == 0) /* be quick for ASCII */
|
||||
if ((*p & 0x80) == 0) // be quick for ASCII
|
||||
{
|
||||
charlen = 1;
|
||||
len += IS_NONPRINTABLE(*p) ? 2 : 1; /* nonprintable: ^X */
|
||||
len += IS_NONPRINTABLE(*p) ? 2 : 1; // nonprintable: ^X
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -756,14 +756,14 @@ set_printable_label_text(GtkLabel *label, char_u *text)
|
||||
uc = utf_ptr2char(p);
|
||||
|
||||
if (charlen != utf_char2len(uc))
|
||||
charlen = 1; /* reject overlong sequences */
|
||||
charlen = 1; // reject overlong sequences
|
||||
|
||||
if (charlen == 1 || uc < 0xa0) /* illegal byte or */
|
||||
len += 4; /* control char: <xx> */
|
||||
if (charlen == 1 || uc < 0xa0) // illegal byte or
|
||||
len += 4; // control char: <xx>
|
||||
else if (!utf_printable(uc))
|
||||
/* Note: we assume here that utf_printable() doesn't
|
||||
* care about characters outside the BMP. */
|
||||
len += 6; /* nonprintable: <xxxx> */
|
||||
// Note: we assume here that utf_printable() doesn't
|
||||
// care about characters outside the BMP.
|
||||
len += 6; // nonprintable: <xxxx>
|
||||
else
|
||||
len += charlen;
|
||||
}
|
||||
@@ -772,7 +772,7 @@ set_printable_label_text(GtkLabel *label, char_u *text)
|
||||
attr_list = pango_attr_list_new();
|
||||
buf = alloc(len + 1);
|
||||
|
||||
/* Now go for the real work */
|
||||
// Now go for the real work
|
||||
if (buf != NULL)
|
||||
{
|
||||
attrentry_T *aep;
|
||||
@@ -787,7 +787,7 @@ set_printable_label_text(GtkLabel *label, char_u *text)
|
||||
GdkColor color = { 0, 0, 0, 0 };
|
||||
#endif
|
||||
|
||||
/* Look up the RGB values of the SpecialKey foreground color. */
|
||||
// Look up the RGB values of the SpecialKey foreground color.
|
||||
aep = syn_gui_attr2entry(HL_ATTR(HLF_8));
|
||||
pixel = (aep != NULL) ? aep->ae_u.gui.fg_color : INVALCOLOR;
|
||||
if (pixel != INVALCOLOR)
|
||||
@@ -807,7 +807,7 @@ set_printable_label_text(GtkLabel *label, char_u *text)
|
||||
p = text;
|
||||
while (*p != NUL)
|
||||
{
|
||||
/* Be quick for ASCII */
|
||||
// Be quick for ASCII
|
||||
if ((*p & 0x80) == 0 && !IS_NONPRINTABLE(*p))
|
||||
{
|
||||
*pdest++ = *p++;
|
||||
@@ -818,29 +818,29 @@ set_printable_label_text(GtkLabel *label, char_u *text)
|
||||
uc = utf_ptr2char(p);
|
||||
|
||||
if (charlen != utf_char2len(uc))
|
||||
charlen = 1; /* reject overlong sequences */
|
||||
charlen = 1; // reject overlong sequences
|
||||
|
||||
if (charlen == 1 || uc < 0xa0 || !utf_printable(uc))
|
||||
{
|
||||
int outlen;
|
||||
|
||||
/* Careful: we can't just use transchar_byte() here,
|
||||
* since 'encoding' is not necessarily set to "utf-8". */
|
||||
// Careful: we can't just use transchar_byte() here,
|
||||
// since 'encoding' is not necessarily set to "utf-8".
|
||||
if (*p & 0x80 && charlen == 1)
|
||||
{
|
||||
transchar_hex(pdest, *p); /* <xx> */
|
||||
transchar_hex(pdest, *p); // <xx>
|
||||
outlen = 4;
|
||||
}
|
||||
else if (uc >= 0x80)
|
||||
{
|
||||
/* Note: we assume here that utf_printable() doesn't
|
||||
* care about characters outside the BMP. */
|
||||
transchar_hex(pdest, uc); /* <xx> or <xxxx> */
|
||||
// Note: we assume here that utf_printable() doesn't
|
||||
// care about characters outside the BMP.
|
||||
transchar_hex(pdest, uc); // <xx> or <xxxx>
|
||||
outlen = (uc < 0x100) ? 4 : 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
transchar_nonprint(pdest, *p); /* ^X */
|
||||
transchar_nonprint(pdest, *p); // ^X
|
||||
outlen = 2;
|
||||
}
|
||||
if (pixel != INVALCOLOR)
|
||||
@@ -940,36 +940,36 @@ drawBalloon(BalloonEval *beval)
|
||||
pango_layout_set_wrap(layout, PANGO_WRAP_WORD);
|
||||
# endif
|
||||
pango_layout_set_width(layout,
|
||||
/* try to come up with some reasonable width */
|
||||
// try to come up with some reasonable width
|
||||
PANGO_SCALE * CLAMP(gui.num_cols * gui.char_width,
|
||||
screen_w / 2,
|
||||
MAX(20, screen_w - 20)));
|
||||
|
||||
/* Calculate the balloon's width and height. */
|
||||
// Calculate the balloon's width and height.
|
||||
# if GTK_CHECK_VERSION(3,0,0)
|
||||
gtk_widget_get_preferred_size(beval->balloonShell, &requisition, NULL);
|
||||
# else
|
||||
gtk_widget_size_request(beval->balloonShell, &requisition);
|
||||
# endif
|
||||
|
||||
/* Compute position of the balloon area */
|
||||
// Compute position of the balloon area
|
||||
gdk_window_get_origin(gtk_widget_get_window(beval->target), &x, &y);
|
||||
x += beval->x;
|
||||
y += beval->y;
|
||||
|
||||
/* Get out of the way of the mouse pointer */
|
||||
// Get out of the way of the mouse pointer
|
||||
if (x + x_offset + requisition.width > screen_x + screen_w)
|
||||
y_offset += 15;
|
||||
if (y + y_offset + requisition.height > screen_y + screen_h)
|
||||
y_offset = -requisition.height - EVAL_OFFSET_Y;
|
||||
|
||||
/* Sanitize values */
|
||||
// Sanitize values
|
||||
x = CLAMP(x + x_offset, 0,
|
||||
MAX(0, screen_x + screen_w - requisition.width));
|
||||
y = CLAMP(y + y_offset, 0,
|
||||
MAX(0, screen_y + screen_h - requisition.height));
|
||||
|
||||
/* Show the balloon */
|
||||
// Show the balloon
|
||||
# if GTK_CHECK_VERSION(3,0,0)
|
||||
gtk_window_move(GTK_WINDOW(beval->balloonShell), x, y);
|
||||
# else
|
||||
@@ -1048,7 +1048,7 @@ createBalloonEvalWindow(BalloonEval *beval)
|
||||
gtk_container_add(GTK_CONTAINER(beval->balloonShell), beval->balloonLabel);
|
||||
}
|
||||
|
||||
#else /* !FEAT_GUI_GTK */
|
||||
#else // !FEAT_GUI_GTK
|
||||
|
||||
/*
|
||||
* Draw a balloon.
|
||||
@@ -1063,15 +1063,15 @@ drawBalloon(BalloonEval *beval)
|
||||
|
||||
if (beval->msg != NULL)
|
||||
{
|
||||
/* Show the Balloon */
|
||||
// Show the Balloon
|
||||
|
||||
/* Calculate the label's width and height */
|
||||
// Calculate the label's width and height
|
||||
#ifdef FEAT_GUI_MOTIF
|
||||
XmString s;
|
||||
|
||||
/* For the callback function we parse NL characters to create a
|
||||
* multi-line label. This doesn't work for all languages, but
|
||||
* XmStringCreateLocalized() doesn't do multi-line labels... */
|
||||
// For the callback function we parse NL characters to create a
|
||||
// multi-line label. This doesn't work for all languages, but
|
||||
// XmStringCreateLocalized() doesn't do multi-line labels...
|
||||
if (beval->msgCB != NULL)
|
||||
s = XmStringCreateLtoR((char *)beval->msg, XmFONTLIST_DEFAULT_TAG);
|
||||
else
|
||||
@@ -1092,8 +1092,8 @@ drawBalloon(BalloonEval *beval)
|
||||
h += gui.border_offset << 1;
|
||||
XtVaSetValues(beval->balloonLabel, XmNlabelString, s, NULL);
|
||||
XmStringFree(s);
|
||||
#else /* Athena */
|
||||
/* Assume XtNinternational == True */
|
||||
#else // Athena
|
||||
// Assume XtNinternational == True
|
||||
XFontSet fset;
|
||||
XFontSetExtents *ext;
|
||||
|
||||
@@ -1108,7 +1108,7 @@ drawBalloon(BalloonEval *beval)
|
||||
XtVaSetValues(beval->balloonLabel, XtNlabel, beval->msg, NULL);
|
||||
#endif
|
||||
|
||||
/* Compute position of the balloon area */
|
||||
// Compute position of the balloon area
|
||||
tx = beval->x_root + EVAL_OFFSET_X;
|
||||
ty = beval->y_root + EVAL_OFFSET_Y;
|
||||
if ((tx + w) > beval->screen_width)
|
||||
@@ -1121,13 +1121,13 @@ drawBalloon(BalloonEval *beval)
|
||||
XmNy, ty,
|
||||
NULL);
|
||||
#else
|
||||
/* Athena */
|
||||
// Athena
|
||||
XtVaSetValues(beval->balloonShell,
|
||||
XtNx, tx,
|
||||
XtNy, ty,
|
||||
NULL);
|
||||
#endif
|
||||
/* Set tooltip colors */
|
||||
// Set tooltip colors
|
||||
{
|
||||
Arg args[2];
|
||||
|
||||
@@ -1136,7 +1136,7 @@ drawBalloon(BalloonEval *beval)
|
||||
args[0].value = gui.tooltip_bg_pixel;
|
||||
args[1].name = XmNforeground;
|
||||
args[1].value = gui.tooltip_fg_pixel;
|
||||
#else /* Athena */
|
||||
#else // Athena
|
||||
args[0].name = XtNbackground;
|
||||
args[0].value = gui.tooltip_bg_pixel;
|
||||
args[1].name = XtNforeground;
|
||||
@@ -1194,7 +1194,7 @@ createBalloonEvalWindow(BalloonEval *beval)
|
||||
beval->balloonShell = XtAppCreateShell("balloonEval", "BalloonEval",
|
||||
overrideShellWidgetClass, gui.dpy, args, n);
|
||||
#else
|
||||
/* Athena */
|
||||
// Athena
|
||||
XtSetArg(args[n], XtNallowShellResize, True); n++;
|
||||
beval->balloonShell = XtAppCreateShell("balloonEval", "BalloonEval",
|
||||
overrideShellWidgetClass, gui.dpy, args, n);
|
||||
@@ -1213,7 +1213,7 @@ createBalloonEvalWindow(BalloonEval *beval)
|
||||
beval->balloonLabel = XtCreateManagedWidget("balloonLabel",
|
||||
xmLabelWidgetClass, beval->balloonShell, args, n);
|
||||
}
|
||||
#else /* FEAT_GUI_ATHENA */
|
||||
#else // FEAT_GUI_ATHENA
|
||||
XtSetArg(args[n], XtNforeground, gui.tooltip_fg_pixel); n++;
|
||||
XtSetArg(args[n], XtNbackground, gui.tooltip_bg_pixel); n++;
|
||||
XtSetArg(args[n], XtNinternational, True); n++;
|
||||
@@ -1223,7 +1223,7 @@ createBalloonEvalWindow(BalloonEval *beval)
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* !FEAT_GUI_GTK */
|
||||
#endif /* !FEAT_GUI_MSWIN */
|
||||
#endif // !FEAT_GUI_GTK
|
||||
#endif // !FEAT_GUI_MSWIN
|
||||
|
||||
#endif /* FEAT_BEVAL_GUI */
|
||||
#endif // FEAT_BEVAL_GUI
|
||||
|
420
src/gui_gtk.c
420
src/gui_gtk.c
File diff suppressed because it is too large
Load Diff
@@ -26,8 +26,8 @@
|
||||
*/
|
||||
|
||||
#include "vim.h"
|
||||
#include <gtk/gtk.h> /* without this it compiles, but gives errors at
|
||||
runtime! */
|
||||
#include <gtk/gtk.h> // without this it compiles, but gives errors at
|
||||
// runtime!
|
||||
#include "gui_gtk_f.h"
|
||||
#if !GTK_CHECK_VERSION(3,0,0)
|
||||
# include <gtk/gtksignal.h>
|
||||
@@ -44,8 +44,8 @@ struct _GtkFormChild
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GdkWindow *window;
|
||||
gint x; /* relative subwidget x position */
|
||||
gint y; /* relative subwidget y position */
|
||||
gint x; // relative subwidget x position
|
||||
gint y; // relative subwidget y position
|
||||
gint mapped;
|
||||
};
|
||||
|
||||
@@ -101,8 +101,7 @@ static void gtk_form_child_unmap(GtkWidget *widget, gpointer user_data);
|
||||
static GtkWidgetClass *parent_class = NULL;
|
||||
#endif
|
||||
|
||||
/* Public interface
|
||||
*/
|
||||
// Public interface
|
||||
|
||||
GtkWidget *
|
||||
gtk_form_new(void)
|
||||
@@ -128,7 +127,7 @@ gtk_form_put(GtkForm *form,
|
||||
|
||||
g_return_if_fail(GTK_IS_FORM(form));
|
||||
|
||||
/* LINTED: avoid warning: conversion to 'unsigned long' */
|
||||
// LINTED: avoid warning: conversion to 'unsigned long'
|
||||
child = g_new(GtkFormChild, 1);
|
||||
if (child == NULL)
|
||||
return;
|
||||
@@ -147,11 +146,10 @@ gtk_form_put(GtkForm *form,
|
||||
|
||||
form->children = g_list_append(form->children, child);
|
||||
|
||||
/* child->window must be created and attached to the widget _before_
|
||||
* it has been realized, or else things will break with GTK2. Note
|
||||
* that gtk_widget_set_parent() realizes the widget if it's visible
|
||||
* and its parent is mapped.
|
||||
*/
|
||||
// child->window must be created and attached to the widget _before_
|
||||
// it has been realized, or else things will break with GTK2. Note
|
||||
// that gtk_widget_set_parent() realizes the widget if it's visible
|
||||
// and its parent is mapped.
|
||||
if (gtk_widget_get_realized(GTK_WIDGET(form)))
|
||||
gtk_form_attach_child_window(form, child);
|
||||
|
||||
@@ -212,8 +210,7 @@ gtk_form_thaw(GtkForm *form)
|
||||
}
|
||||
}
|
||||
|
||||
/* Basic Object handling procedures
|
||||
*/
|
||||
// Basic Object handling procedures
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
G_DEFINE_TYPE(GtkForm, gtk_form, GTK_TYPE_CONTAINER)
|
||||
#else
|
||||
@@ -237,7 +234,7 @@ gtk_form_get_type(void)
|
||||
}
|
||||
return form_type;
|
||||
}
|
||||
#endif /* !GTK_CHECK_VERSION(3,0,0) */
|
||||
#endif // !GTK_CHECK_VERSION(3,0,0)
|
||||
|
||||
static void
|
||||
gtk_form_class_init(GtkFormClass *klass)
|
||||
@@ -364,14 +361,13 @@ gtk_form_realize(GtkWidget *widget)
|
||||
}
|
||||
|
||||
|
||||
/* After reading the documentation at
|
||||
* http://developer.gnome.org/doc/API/2.0/gtk/gtk-changes-2-0.html
|
||||
* I think it should be possible to remove this function when compiling
|
||||
* against gtk-2.0. It doesn't seem to cause problems, though.
|
||||
*
|
||||
* Well, I reckon at least the gdk_window_show(form->bin_window)
|
||||
* is necessary. GtkForm is anything but a usual container widget.
|
||||
*/
|
||||
// After reading the documentation at
|
||||
// http://developer.gnome.org/doc/API/2.0/gtk/gtk-changes-2-0.html
|
||||
// I think it should be possible to remove this function when compiling
|
||||
// against gtk-2.0. It doesn't seem to cause problems, though.
|
||||
//
|
||||
// Well, I reckon at least the gdk_window_show(form->bin_window)
|
||||
// is necessary. GtkForm is anything but a usual container widget.
|
||||
static void
|
||||
gtk_form_map(GtkWidget *widget)
|
||||
{
|
||||
@@ -480,7 +476,7 @@ gtk_form_get_preferred_height(GtkWidget *widget,
|
||||
*minimal_height = requisition.height;
|
||||
*natural_height = requisition.height;
|
||||
}
|
||||
#endif /* GTK_CHECK_VERSION(3,0,0) */
|
||||
#endif // GTK_CHECK_VERSION(3,0,0)
|
||||
|
||||
static void
|
||||
gtk_form_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
|
||||
@@ -559,16 +555,16 @@ gtk_form_draw(GtkWidget *widget, cairo_t *cr)
|
||||
if (!gtk_widget_get_has_window(formchild->widget) &&
|
||||
gtk_cairo_should_draw_window(cr, formchild->window))
|
||||
{
|
||||
/* To get gtk_widget_draw() to work, it is required to call
|
||||
* gtk_widget_size_allocate() in advance with a well-posed
|
||||
* allocation for a given child widget in order to set a
|
||||
* certain private GtkWidget variable, called
|
||||
* widget->priv->alloc_need, to the proper value; otherwise,
|
||||
* gtk_widget_draw() fails and the relevant scrollbar won't
|
||||
* appear on the screen.
|
||||
*
|
||||
* Calling gtk_form_position_child() like this is one of ways
|
||||
* to make sure of that. */
|
||||
// To get gtk_widget_draw() to work, it is required to call
|
||||
// gtk_widget_size_allocate() in advance with a well-posed
|
||||
// allocation for a given child widget in order to set a
|
||||
// certain private GtkWidget variable, called
|
||||
// widget->priv->alloc_need, to the proper value; otherwise,
|
||||
// gtk_widget_draw() fails and the relevant scrollbar won't
|
||||
// appear on the screen.
|
||||
//
|
||||
// Calling gtk_form_position_child() like this is one of ways
|
||||
// to make sure of that.
|
||||
gtk_form_position_child(form, formchild, TRUE);
|
||||
|
||||
gtk_form_render_background(formchild->widget, cr);
|
||||
@@ -577,7 +573,7 @@ gtk_form_draw(GtkWidget *widget, cairo_t *cr)
|
||||
|
||||
return GTK_WIDGET_CLASS(gtk_form_parent_class)->draw(widget, cr);
|
||||
}
|
||||
#else /* !GTK_CHECK_VERSION(3,0,0) */
|
||||
#else // !GTK_CHECK_VERSION(3,0,0)
|
||||
static gint
|
||||
gtk_form_expose(GtkWidget *widget, GdkEventExpose *event)
|
||||
{
|
||||
@@ -598,16 +594,15 @@ gtk_form_expose(GtkWidget *widget, GdkEventExpose *event)
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#endif /* !GTK_CHECK_VERSION(3,0,0) */
|
||||
#endif // !GTK_CHECK_VERSION(3,0,0)
|
||||
|
||||
/* Container method
|
||||
*/
|
||||
// Container method
|
||||
static void
|
||||
gtk_form_remove(GtkContainer *container, GtkWidget *widget)
|
||||
{
|
||||
GList *tmp_list;
|
||||
GtkForm *form;
|
||||
GtkFormChild *child = NULL; /* init for gcc */
|
||||
GtkFormChild *child = NULL; // init for gcc
|
||||
|
||||
g_return_if_fail(GTK_IS_FORM(container));
|
||||
|
||||
@@ -634,9 +629,8 @@ gtk_form_remove(GtkContainer *container, GtkWidget *widget)
|
||||
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
|
||||
FUNC2GENERIC(>k_form_child_unmap), child);
|
||||
|
||||
/* FIXME: This will cause problems for reparenting NO_WINDOW
|
||||
* widgets out of a GtkForm
|
||||
*/
|
||||
// FIXME: This will cause problems for reparenting NO_WINDOW
|
||||
// widgets out of a GtkForm
|
||||
gdk_window_set_user_data(child->window, NULL);
|
||||
gdk_window_destroy(child->window);
|
||||
}
|
||||
@@ -676,14 +670,13 @@ gtk_form_forall(GtkContainer *container,
|
||||
}
|
||||
}
|
||||
|
||||
/* Operations on children
|
||||
*/
|
||||
// Operations on children
|
||||
|
||||
static void
|
||||
gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child)
|
||||
{
|
||||
if (child->window != NULL)
|
||||
return; /* been there, done that */
|
||||
return; // been there, done that
|
||||
|
||||
if (!gtk_widget_get_has_window(child->widget))
|
||||
{
|
||||
|
1166
src/gui_gtk_x11.c
1166
src/gui_gtk_x11.c
File diff suppressed because it is too large
Load Diff
@@ -742,6 +742,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2380,
|
||||
/**/
|
||||
2379,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user