Convert menus.c to C++ menus.cc
This commit is contained in:
parent
86161c72c5
commit
893bdb5928
22
ChangeLog
22
ChangeLog
@ -1,3 +1,25 @@
|
|||||||
|
2021-01-31 Mike Small <smallm@sdf.org>
|
||||||
|
|
||||||
|
* src/util.h: move CreateMenuIcon prototype here
|
||||||
|
|
||||||
|
* src/add_window.h: C++ compatibility (extern "C")
|
||||||
|
|
||||||
|
* src/events.h: ditto
|
||||||
|
|
||||||
|
* src/resize.h: ditto
|
||||||
|
|
||||||
|
* src/twm.h: ditto and move or remove some functions
|
||||||
|
|
||||||
|
* src/twm.c (InitVariables): remove use of CaseSensitive variable
|
||||||
|
|
||||||
|
* src/screen.h (ScreenInfo): remove CaseSensitive variable
|
||||||
|
|
||||||
|
* src/menus.h: C++ compatibility (extern "C"), move GetWMState here
|
||||||
|
|
||||||
|
* src/menus.cc: convert to C++ (beginning, enough to build)
|
||||||
|
|
||||||
|
* src/Makefile.am (AM_CXXFLAGS): remove -Wno-logical-op-parenthesis
|
||||||
|
|
||||||
2019-10-21 Mike Small <smallm@sdf.org>
|
2019-10-21 Mike Small <smallm@sdf.org>
|
||||||
|
|
||||||
* src/icons.h: Remove IconUp and IconDown from icons interface
|
* src/icons.h: Remove IconUp and IconDown from icons interface
|
||||||
|
@ -346,6 +346,7 @@ pdfdir = @pdfdir@
|
|||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
program_transform_name = @program_transform_name@
|
program_transform_name = @program_transform_name@
|
||||||
psdir = @psdir@
|
psdir = @psdir@
|
||||||
|
runstatedir = @runstatedir@
|
||||||
sbindir = @sbindir@
|
sbindir = @sbindir@
|
||||||
sharedstatedir = @sharedstatedir@
|
sharedstatedir = @sharedstatedir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
|
@ -295,6 +295,7 @@ pdfdir = @pdfdir@
|
|||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
program_transform_name = @program_transform_name@
|
program_transform_name = @program_transform_name@
|
||||||
psdir = @psdir@
|
psdir = @psdir@
|
||||||
|
runstatedir = @runstatedir@
|
||||||
sbindir = @sbindir@
|
sbindir = @sbindir@
|
||||||
sharedstatedir = @sharedstatedir@
|
sharedstatedir = @sharedstatedir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
|
@ -32,10 +32,10 @@ AM_CPPFLAGS = \
|
|||||||
|
|
||||||
AM_CFLAGS = -Werror $(TWM_CFLAGS)
|
AM_CFLAGS = -Werror $(TWM_CFLAGS)
|
||||||
# TWM_CFLAGS has results of pkg-config --cflags x11
|
# TWM_CFLAGS has results of pkg-config --cflags x11
|
||||||
AM_CXXFLAGS = -Werror -Wno-logical-op-parenthesis $(TWM_CFLAGS) -std=c++11
|
AM_CXXFLAGS = -Werror $(TWM_CFLAGS) -std=c++11
|
||||||
twmruined_LDADD = $(TWM_LIBS)
|
twmruined_LDADD = $(TWM_LIBS)
|
||||||
|
|
||||||
twmruined_SOURCES = \
|
twmruined_SOURCES = \
|
||||||
add_window.c \
|
add_window.c \
|
||||||
add_window.h \
|
add_window.h \
|
||||||
cursor.c \
|
cursor.c \
|
||||||
@ -44,11 +44,11 @@ twmruined_SOURCES = \
|
|||||||
events.h \
|
events.h \
|
||||||
gc.c \
|
gc.c \
|
||||||
gc.h \
|
gc.h \
|
||||||
icons.cc \
|
icons.cc \
|
||||||
icons.h \
|
icons.h \
|
||||||
list.c \
|
list.c \
|
||||||
list.h \
|
list.h \
|
||||||
menus.c \
|
menus.cc \
|
||||||
menus.h \
|
menus.h \
|
||||||
parse.c \
|
parse.c \
|
||||||
parse.h \
|
parse.h \
|
||||||
|
@ -368,6 +368,7 @@ pdfdir = @pdfdir@
|
|||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
program_transform_name = @program_transform_name@
|
program_transform_name = @program_transform_name@
|
||||||
psdir = @psdir@
|
psdir = @psdir@
|
||||||
|
runstatedir = @runstatedir@
|
||||||
sbindir = @sbindir@
|
sbindir = @sbindir@
|
||||||
sharedstatedir = @sharedstatedir@
|
sharedstatedir = @sharedstatedir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
@ -384,7 +385,7 @@ AM_CPPFLAGS = \
|
|||||||
|
|
||||||
AM_CFLAGS = -Werror $(TWM_CFLAGS)
|
AM_CFLAGS = -Werror $(TWM_CFLAGS)
|
||||||
# TWM_CFLAGS has results of pkg-config --cflags x11
|
# TWM_CFLAGS has results of pkg-config --cflags x11
|
||||||
AM_CXXFLAGS = -Werror -Wno-logical-op-parenthesis $(TWM_CFLAGS) -std=c++11
|
AM_CXXFLAGS = -Werror $(TWM_CFLAGS) -std=c++11
|
||||||
twmruined_LDADD = $(TWM_LIBS)
|
twmruined_LDADD = $(TWM_LIBS)
|
||||||
twmruined_SOURCES = \
|
twmruined_SOURCES = \
|
||||||
add_window.c \
|
add_window.c \
|
||||||
@ -395,11 +396,11 @@ twmruined_SOURCES = \
|
|||||||
events.h \
|
events.h \
|
||||||
gc.c \
|
gc.c \
|
||||||
gc.h \
|
gc.h \
|
||||||
icons.cc \
|
icons.cc \
|
||||||
icons.h \
|
icons.h \
|
||||||
list.c \
|
list.c \
|
||||||
list.h \
|
list.h \
|
||||||
menus.c \
|
menus.cc \
|
||||||
menus.h \
|
menus.h \
|
||||||
parse.c \
|
parse.c \
|
||||||
parse.h \
|
parse.h \
|
||||||
|
@ -183,7 +183,7 @@ AddWindow(Window w)
|
|||||||
tmp_win->classh = NoClass;
|
tmp_win->classh = NoClass;
|
||||||
XGetClassHint(dpy, tmp_win->w, &tmp_win->classh);
|
XGetClassHint(dpy, tmp_win->w, &tmp_win->classh);
|
||||||
FetchWmProtocols (tmp_win);
|
FetchWmProtocols (tmp_win);
|
||||||
FetchWmColormapWindows (tmp_win);
|
FetchWmColormapWindows(tmp_win);
|
||||||
|
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
tmp_win->name = strdup(NoName);
|
tmp_win->name = strdup(NoName);
|
||||||
@ -638,7 +638,7 @@ static void do_add_binding (int button, int context, int modifier, int func)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AddDefaultBindings (void)
|
AddDefaultBindings(void)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* The bindings are stored in Scr->Mouse, indexed by
|
* The bindings are stored in Scr->Mouse, indexed by
|
||||||
@ -760,7 +760,7 @@ static Window CreateHighlightWindow (TwmWindow *tmp_win)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ComputeCommonTitleOffsets (void)
|
void ComputeCommonTitleOffsets(void)
|
||||||
{
|
{
|
||||||
int buttonwidth = (Scr->TBInfo.width + Scr->TBInfo.pad);
|
int buttonwidth = (Scr->TBInfo.width + Scr->TBInfo.pad);
|
||||||
|
|
||||||
@ -991,7 +991,7 @@ CreateColormapWindow(Window w, Bool creating_parent, Bool property_window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FetchWmColormapWindows (TwmWindow *tmp)
|
FetchWmColormapWindows(TwmWindow *tmp)
|
||||||
{
|
{
|
||||||
register int i, j;
|
register int i, j;
|
||||||
Window *cmap_windows = NULL;
|
Window *cmap_windows = NULL;
|
||||||
@ -1120,7 +1120,7 @@ FetchWmColormapWindows (TwmWindow *tmp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GetWindowSizeHints (TwmWindow *tmp)
|
void GetWindowSizeHints(TwmWindow *tmp)
|
||||||
{
|
{
|
||||||
long supplied = 0;
|
long supplied = 0;
|
||||||
|
|
||||||
|
@ -61,13 +61,20 @@ in this Software without prior written authorization from The Open Group.
|
|||||||
#ifndef _ADD_WINDOW_
|
#ifndef _ADD_WINDOW_
|
||||||
#define _ADD_WINDOW_
|
#define _ADD_WINDOW_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define EXTERN extern "C"
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
extern char NoName[];
|
extern char NoName[];
|
||||||
|
|
||||||
extern void AddDefaultBindings ( void );
|
EXTERN void AddDefaultBindings( void );
|
||||||
extern TwmWindow * AddWindow ( Window w );
|
extern TwmWindow* AddWindow( Window w );
|
||||||
|
EXTERN void ComputeCommonTitleOffsets( void );
|
||||||
extern ColormapWindow * CreateColormapWindow ( Window w, Bool creating_parent, Bool property_window );
|
extern ColormapWindow * CreateColormapWindow ( Window w, Bool creating_parent, Bool property_window );
|
||||||
extern TwmColormap * CreateTwmColormap ( Colormap c );
|
extern TwmColormap* CreateTwmColormap( Colormap c );
|
||||||
extern void FetchWmColormapWindows ( TwmWindow *tmp );
|
EXTERN void FetchWmColormapWindows( TwmWindow *tmp );
|
||||||
extern void FetchWmProtocols ( TwmWindow *tmp );
|
extern void FetchWmProtocols ( TwmWindow *tmp );
|
||||||
extern void GetGravityOffsets ( TwmWindow *tmp, int *xp, int *yp );
|
extern void GetGravityOffsets ( TwmWindow *tmp, int *xp, int *yp );
|
||||||
extern void GetWindowSizeHints ( TwmWindow *tmp );
|
extern void GetWindowSizeHints ( TwmWindow *tmp );
|
||||||
|
@ -922,7 +922,7 @@ HandlePropertyNotify(void)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
if (Event.xproperty.atom == _XA_WM_COLORMAP_WINDOWS) {
|
if (Event.xproperty.atom == _XA_WM_COLORMAP_WINDOWS) {
|
||||||
FetchWmColormapWindows (Tmp_win); /* frees old data */
|
FetchWmColormapWindows(Tmp_win); /* frees old data */
|
||||||
break;
|
break;
|
||||||
} else if (Event.xproperty.atom == _XA_WM_PROTOCOLS) {
|
} else if (Event.xproperty.atom == _XA_WM_PROTOCOLS) {
|
||||||
FetchWmProtocols (Tmp_win);
|
FetchWmProtocols (Tmp_win);
|
||||||
|
74
src/events.h
74
src/events.h
@ -64,45 +64,51 @@ in this Software without prior written authorization from The Open Group.
|
|||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
#include "twm.h"
|
#include "twm.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define EXTERN extern "C"
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void (*event_proc)(void);
|
typedef void (*event_proc)(void);
|
||||||
|
|
||||||
extern Time lastTimestamp;
|
extern Time lastTimestamp;
|
||||||
#define LastTimestamp() lastTimestamp
|
#define LastTimestamp() lastTimestamp
|
||||||
|
|
||||||
extern void AutoRaiseWindow ( TwmWindow *tmp );
|
EXTERN void AutoRaiseWindow( TwmWindow *tmp );
|
||||||
extern void SetRaiseWindow ( TwmWindow *tmp );
|
extern void SetRaiseWindow( TwmWindow *tmp );
|
||||||
extern void InitEvents ( void );
|
extern void InitEvents( void );
|
||||||
extern Bool StashEventTime ( XEvent *ev );
|
extern Bool StashEventTime( XEvent *ev );
|
||||||
extern Window WindowOfEvent ( XEvent *e );
|
extern Window WindowOfEvent( XEvent *e );
|
||||||
extern Bool DispatchEvent2 ( void );
|
EXTERN Bool DispatchEvent2( void );
|
||||||
extern Bool DispatchEvent ( void );
|
EXTERN Bool DispatchEvent( void );
|
||||||
extern void HandleEvents ( void );
|
extern void HandleEvents( void );
|
||||||
extern void HandleColormapNotify ( void );
|
extern void HandleColormapNotify( void );
|
||||||
extern void HandleVisibilityNotify ( void );
|
extern void HandleVisibilityNotify( void );
|
||||||
extern void HandleKeyPress ( void );
|
extern void HandleKeyPress( void );
|
||||||
extern void free_cwins ( TwmWindow *tmp );
|
extern void free_cwins( TwmWindow *tmp );
|
||||||
extern void HandlePropertyNotify ( void );
|
extern void HandlePropertyNotify( void );
|
||||||
extern void HandleClientMessage ( void );
|
extern void HandleClientMessage( void );
|
||||||
extern void HandleExpose ( void );
|
extern void HandleExpose( void );
|
||||||
extern void HandleDestroyNotify ( void );
|
extern void HandleDestroyNotify( void );
|
||||||
extern void HandleCreateNotify ( void );
|
extern void HandleCreateNotify( void );
|
||||||
extern void HandleMapRequest ( void );
|
extern void HandleMapRequest( void );
|
||||||
extern void SimulateMapRequest ( Window w );
|
extern void SimulateMapRequest( Window w );
|
||||||
extern void HandleMapNotify ( void );
|
extern void HandleMapNotify( void );
|
||||||
extern void HandleUnmapNotify ( void );
|
extern void HandleUnmapNotify( void );
|
||||||
extern void HandleMotionNotify ( void );
|
extern void HandleMotionNotify( void );
|
||||||
extern void HandleButtonRelease ( void );
|
extern void HandleButtonRelease( void );
|
||||||
extern void HandleButtonPress ( void );
|
extern void HandleButtonPress( void );
|
||||||
extern void HandleEnterNotify ( void );
|
extern void HandleEnterNotify( void );
|
||||||
extern void HandleLeaveNotify ( void );
|
extern void HandleLeaveNotify( void );
|
||||||
extern void HandleConfigureRequest ( void );
|
extern void HandleConfigureRequest( void );
|
||||||
extern void HandleShapeNotify ( void );
|
extern void HandleShapeNotify( void );
|
||||||
extern void HandleUnknown ( void );
|
EXTERN void HandleUnknown( void );
|
||||||
extern int Transient ( Window w, Window *propw );
|
extern int Transient( Window w, Window *propw );
|
||||||
extern ScreenInfo * FindScreenInfo ( Window w );
|
extern ScreenInfo* FindScreenInfo( Window w );
|
||||||
extern void InstallWindowColormaps ( int type, TwmWindow *tmp );
|
EXTERN void InstallWindowColormaps( int type, TwmWindow *tmp );
|
||||||
extern void InstallRootColormap ( void );
|
EXTERN void InstallRootColormap( void );
|
||||||
extern void UninstallRootColormap ( void );
|
EXTERN void UninstallRootColormap( void );
|
||||||
|
|
||||||
extern event_proc EventHandler[];
|
extern event_proc EventHandler[];
|
||||||
extern Window DragWindow;
|
extern Window DragWindow;
|
||||||
|
File diff suppressed because it is too large
Load Diff
55
src/menus.h
55
src/menus.h
@ -164,29 +164,36 @@ extern int MenuDepth;
|
|||||||
#define COLORMAP_PREV "prev"
|
#define COLORMAP_PREV "prev"
|
||||||
#define COLORMAP_DEFAULT "default"
|
#define COLORMAP_DEFAULT "default"
|
||||||
|
|
||||||
extern void InitMenus ( void );
|
#ifdef __cplusplus
|
||||||
extern Bool AddFuncKey ( char *name, int cont, int mods, int func, char *win_name, char *action );
|
#define EXTERN extern "C"
|
||||||
extern int CreateTitleButton ( const char *name, int func, const char *action, MenuRoot *menuroot, Bool rightside, Bool append );
|
#else
|
||||||
extern void InitTitlebarButtons ( void );
|
#define EXTERN extern
|
||||||
extern void PaintEntry ( MenuRoot *mr, MenuItem *mi, int exposure );
|
#endif
|
||||||
extern void PaintMenu ( MenuRoot *mr, XEvent *e );
|
|
||||||
extern void UpdateMenu ( void );
|
EXTERN void InitMenus( void );
|
||||||
extern MenuRoot * NewMenuRoot ( const char *name );
|
EXTERN Bool AddFuncKey( char *name, int cont, int mods, int func, char *win_name, char *action );
|
||||||
extern MenuItem * AddToMenu ( MenuRoot *menu, const char *item, const char *action, MenuRoot *sub, int func, const char *fore, const char *back );
|
EXTERN int CreateTitleButton( const char *name, int func, const char *action, MenuRoot *menuroot, Bool rightside, Bool append );
|
||||||
extern void MakeMenus ( void );
|
EXTERN void InitTitlebarButtons( void );
|
||||||
extern Bool PopUpMenu ( MenuRoot *menu, int x, int y, Bool center );
|
EXTERN void PaintEntry( MenuRoot *mr, MenuItem *mi, int exposure );
|
||||||
extern void PopDownMenu ( void );
|
EXTERN void PaintMenu( MenuRoot *mr, XEvent *e );
|
||||||
extern MenuRoot * FindMenuRoot ( const char *name );
|
EXTERN void UpdateMenu( void );
|
||||||
extern int ExecuteFunction ( int func, const char *action, Window w, TwmWindow *tmp_win, XEvent *eventp, int context, int pulldown );
|
EXTERN MenuRoot * NewMenuRoot( const char *name );
|
||||||
extern void ReGrab ( void );
|
EXTERN MenuItem * AddToMenu( MenuRoot *menu, const char *item, const char *action, MenuRoot *sub, int func, const char *fore, const char *back );
|
||||||
extern void FocusOnRoot ( void );
|
EXTERN void MakeMenus( void );
|
||||||
extern void DeIconify ( TwmWindow *tmp_win );
|
EXTERN Bool PopUpMenu( MenuRoot *menu, int x, int y, Bool center );
|
||||||
extern void Iconify ( TwmWindow *tmp_win, int def_x, int def_y );
|
EXTERN void PopDownMenu( void );
|
||||||
extern void SetMapStateProp ( TwmWindow *tmp_win, int state );
|
EXTERN MenuRoot * FindMenuRoot( const char *name );
|
||||||
extern void WarpToScreen ( int n, int inc );
|
EXTERN int ExecuteFunction( int func, const char *action, Window w, TwmWindow *tmp_win, XEvent *eventp, int context, int pulldown );
|
||||||
extern void SetBorder ( TwmWindow *tmp, Bool onoroff );
|
EXTERN void ReGrab( void );
|
||||||
extern void SendDeleteWindowMessage ( TwmWindow *tmp, Time timestamp );
|
EXTERN void FocusOnRoot( void );
|
||||||
extern void SendSaveYourselfMessage ( TwmWindow *tmp, Time timestamp );
|
EXTERN void DeIconify( TwmWindow *tmp_win );
|
||||||
extern void SendTakeFocusMessage ( TwmWindow *tmp, Time timestamp );
|
EXTERN void Iconify( TwmWindow *tmp_win, int def_x, int def_y );
|
||||||
|
EXTERN void SetMapStateProp( TwmWindow *tmp_win, int state );
|
||||||
|
EXTERN void WarpToScreen( int n, int inc );
|
||||||
|
EXTERN void SetBorder( TwmWindow *tmp, Bool onoroff );
|
||||||
|
EXTERN void SendDeleteWindowMessage( TwmWindow *tmp, Time timestamp );
|
||||||
|
EXTERN void SendSaveYourselfMessage( TwmWindow *tmp, Time timestamp );
|
||||||
|
EXTERN void SendTakeFocusMessage( TwmWindow *tmp, Time timestamp );
|
||||||
|
EXTERN Bool GetWMState( Window w, int *statep, Window *iwp );
|
||||||
|
|
||||||
#endif /* _MENUS_ */
|
#endif /* _MENUS_ */
|
||||||
|
32
src/resize.h
32
src/resize.h
@ -61,18 +61,24 @@ in this Software without prior written authorization from The Open Group.
|
|||||||
#ifndef _RESIZE_
|
#ifndef _RESIZE_
|
||||||
#define _RESIZE_
|
#define _RESIZE_
|
||||||
|
|
||||||
extern void AddEndResize ( TwmWindow *tmp_win );
|
#ifdef __cplusplus
|
||||||
extern void AddStartResize ( TwmWindow *tmp_win, int x, int y, int w, int h );
|
#define EXTERN extern "C"
|
||||||
extern void ConstrainSize ( TwmWindow *tmp_win, int *widthp, int *heightp );
|
#else
|
||||||
extern void DoResize ( int x_root, int y_root, TwmWindow *tmp_win );
|
#define EXTERN extern
|
||||||
extern void EndResize ( void );
|
#endif
|
||||||
extern void fullzoom ( TwmWindow *tmp_win, int flag );
|
|
||||||
extern void MenuDoResize ( int x_root, int y_root, TwmWindow *tmp_win );
|
extern void AddEndResize( TwmWindow *tmp_win );
|
||||||
extern void MenuEndResize ( TwmWindow *tmp_win );
|
extern void AddStartResize( TwmWindow *tmp_win, int x, int y, int w, int h );
|
||||||
extern void MenuStartResize ( TwmWindow *tmp_win, int x, int y, int w, int h );
|
extern void ConstrainSize( TwmWindow *tmp_win, int *widthp, int *heightp );
|
||||||
extern void SetFrameShape ( TwmWindow *tmp );
|
extern void DoResize( int x_root, int y_root, TwmWindow *tmp_win );
|
||||||
extern void SetupFrame ( TwmWindow *tmp_win, int x, int y, int w, int h, int bw, Bool sendEvent );
|
extern void EndResize( void );
|
||||||
extern void SetupWindow ( TwmWindow *tmp_win, int x, int y, int w, int h, int bw );
|
EXTERN void fullzoom( TwmWindow *tmp_win, int flag );
|
||||||
extern void StartResize ( XEvent *evp, TwmWindow *tmp_win, Bool fromtitlebar );
|
EXTERN void MenuDoResize( int x_root, int y_root, TwmWindow *tmp_win );
|
||||||
|
EXTERN void MenuEndResize( TwmWindow *tmp_win );
|
||||||
|
EXTERN void MenuStartResize( TwmWindow *tmp_win, int x, int y, int w, int h );
|
||||||
|
extern void SetFrameShape( TwmWindow *tmp );
|
||||||
|
extern void SetupFrame( TwmWindow *tmp_win, int x, int y, int w, int h, int bw, Bool sendEvent );
|
||||||
|
extern void SetupWindow( TwmWindow *tmp_win, int x, int y, int w, int h, int bw );
|
||||||
|
EXTERN void StartResize( XEvent *evp, TwmWindow *tmp_win, Bool fromtitlebar );
|
||||||
|
|
||||||
#endif /* _RESIZE_ */
|
#endif /* _RESIZE_ */
|
||||||
|
@ -87,7 +87,7 @@ typedef struct ScreenInfo
|
|||||||
int hilite_pm_width, hilite_pm_height; /* cache the size */
|
int hilite_pm_width, hilite_pm_height; /* cache the size */
|
||||||
|
|
||||||
MenuRoot *MenuList; /* head of the menu list */
|
MenuRoot *MenuList; /* head of the menu list */
|
||||||
MenuRoot *LastMenu; /* the last menu (mostly unused?) */
|
MenuRoot *LastMenu; /* the last menu (for adding to menu list) */
|
||||||
MenuRoot *Windows; /* the TwmWindows menu */
|
MenuRoot *Windows; /* the TwmWindows menu */
|
||||||
|
|
||||||
TwmWindow *Ring; /* one of the windows in window ring */
|
TwmWindow *Ring; /* one of the windows in window ring */
|
||||||
@ -212,7 +212,6 @@ typedef struct ScreenInfo
|
|||||||
short InterpolateMenuColors;/* make pretty menus */
|
short InterpolateMenuColors;/* make pretty menus */
|
||||||
short HaveFonts; /* set if fonts have been loaded */
|
short HaveFonts; /* set if fonts have been loaded */
|
||||||
short FirstTime; /* first time we've read .twmrc */
|
short FirstTime; /* first time we've read .twmrc */
|
||||||
short CaseSensitive; /* be case-sensitive when sorting names */
|
|
||||||
short WarpUnmapped; /* allow warping to unmapped windows */
|
short WarpUnmapped; /* allow warping to unmapped windows */
|
||||||
|
|
||||||
FuncKey FuncKeyRoot;
|
FuncKey FuncKeyRoot;
|
||||||
|
@ -722,7 +722,6 @@ InitVariables(void)
|
|||||||
Scr->InterpolateMenuColors = FALSE;
|
Scr->InterpolateMenuColors = FALSE;
|
||||||
Scr->FirstTime = TRUE;
|
Scr->FirstTime = TRUE;
|
||||||
Scr->HaveFonts = FALSE; /* i.e. not loaded yet */
|
Scr->HaveFonts = FALSE; /* i.e. not loaded yet */
|
||||||
Scr->CaseSensitive = TRUE;
|
|
||||||
Scr->WarpUnmapped = FALSE;
|
Scr->WarpUnmapped = FALSE;
|
||||||
|
|
||||||
/* setup default fonts; overridden by defaults from system.twmrc */
|
/* setup default fonts; overridden by defaults from system.twmrc */
|
||||||
@ -748,7 +747,7 @@ InitVariables(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CreateFonts (void)
|
CreateFonts(void)
|
||||||
{
|
{
|
||||||
GetFont(&Scr->TitleBarFont);
|
GetFont(&Scr->TitleBarFont);
|
||||||
GetFont(&Scr->MenuFont);
|
GetFont(&Scr->MenuFont);
|
||||||
@ -795,7 +794,7 @@ RestoreWithdrawnLocation (TwmWindow *tmp)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Reborder (Time time)
|
Reborder(Time time)
|
||||||
{
|
{
|
||||||
TwmWindow *tmp; /* temp twm window structure */
|
TwmWindow *tmp; /* temp twm window structure */
|
||||||
int scrnum;
|
int scrnum;
|
||||||
|
15
src/twm.h
15
src/twm.h
@ -74,6 +74,12 @@ from The Open Group.
|
|||||||
#include <X11/StringDefs.h>
|
#include <X11/StringDefs.h>
|
||||||
#include <X11/Intrinsic.h>
|
#include <X11/Intrinsic.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define EXTERN extern "C"
|
||||||
|
#else
|
||||||
|
#define EXTERN extern
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef WithdrawnState
|
#ifndef WithdrawnState
|
||||||
#define WithdrawnState 0
|
#define WithdrawnState 0
|
||||||
#endif
|
#endif
|
||||||
@ -327,11 +333,10 @@ typedef struct TWMWinConfigEntry
|
|||||||
|
|
||||||
#include <X11/Xosdefs.h>
|
#include <X11/Xosdefs.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
extern void CreateFonts ( void );
|
EXTERN void CreateFonts( void );
|
||||||
extern void RestoreWithdrawnLocation ( TwmWindow *tmp );
|
extern void RestoreWithdrawnLocation ( TwmWindow *tmp );
|
||||||
extern void Reborder( Time time);
|
EXTERN void Reborder( Time time);
|
||||||
extern void Done( XtPointer, XtSignalId * ) _X_NORETURN;
|
EXTERN void Done( XtPointer, XtSignalId * ) _X_NORETURN;
|
||||||
extern void ComputeCommonTitleOffsets ( void );
|
|
||||||
extern void ComputeTitleLocation ( TwmWindow *tmp );
|
extern void ComputeTitleLocation ( TwmWindow *tmp );
|
||||||
extern void ComputeWindowTitleOffsets ( TwmWindow *tmp_win, int width, Bool squeeze );
|
extern void ComputeWindowTitleOffsets ( TwmWindow *tmp_win, int width, Bool squeeze );
|
||||||
extern char *ProgramName;
|
extern char *ProgramName;
|
||||||
@ -373,7 +378,6 @@ extern int Argc;
|
|||||||
extern char **Argv;
|
extern char **Argv;
|
||||||
extern void NewFontCursor ( Cursor *cp, const char *str );
|
extern void NewFontCursor ( Cursor *cp, const char *str );
|
||||||
extern void NewBitmapCursor ( Cursor *cp, char *source, char *mask );
|
extern void NewBitmapCursor ( Cursor *cp, char *source, char *mask );
|
||||||
extern Pixmap CreateMenuIcon ( int height, unsigned int *widthp, unsigned int *heightp );
|
|
||||||
|
|
||||||
extern Bool ErrorOccurred;
|
extern Bool ErrorOccurred;
|
||||||
extern XErrorEvent LastErrorEvent;
|
extern XErrorEvent LastErrorEvent;
|
||||||
@ -381,7 +385,6 @@ extern XErrorEvent LastErrorEvent;
|
|||||||
#define ResetError() (ErrorOccurred = False)
|
#define ResetError() (ErrorOccurred = False)
|
||||||
|
|
||||||
extern Bool RestartPreviousState;
|
extern Bool RestartPreviousState;
|
||||||
extern Bool GetWMState ( Window w, int *statep, Window *iwp );
|
|
||||||
|
|
||||||
extern void twmrc_error_prefix ( void );
|
extern void twmrc_error_prefix ( void );
|
||||||
|
|
||||||
|
@ -919,14 +919,14 @@ CreateQuestionPixmap (unsigned *widthp, unsigned *heightp)
|
|||||||
|
|
||||||
|
|
||||||
static Pixmap
|
static Pixmap
|
||||||
CreateMenuPixmap (unsigned *widthp, unsigned *heightp)
|
CreateMenuPixmap(unsigned *widthp, unsigned *heightp)
|
||||||
{
|
{
|
||||||
return CreateMenuIcon (Scr->TBInfo.width - Scr->TBInfo.border * 2,
|
return CreateMenuIcon(Scr->TBInfo.width - Scr->TBInfo.border * 2,
|
||||||
widthp,heightp);
|
widthp, heightp);
|
||||||
}
|
}
|
||||||
|
|
||||||
Pixmap
|
Pixmap
|
||||||
CreateMenuIcon (int height, unsigned *widthp, unsigned *heightp)
|
CreateMenuIcon(int height, unsigned *widthp, unsigned *heightp)
|
||||||
{
|
{
|
||||||
int h, w;
|
int h, w;
|
||||||
int ih, iw;
|
int ih, iw;
|
||||||
|
@ -71,7 +71,8 @@ EXTERN void MoveOutline ( Window root, int x, int y, int width, int height,
|
|||||||
int bw, int th );
|
int bw, int th );
|
||||||
EXTERN void Zoom ( Window wf, Window wt );
|
EXTERN void Zoom ( Window wf, Window wt );
|
||||||
EXTERN const char * ExpandFilename ( const char *name );
|
EXTERN const char * ExpandFilename ( const char *name );
|
||||||
EXTERN void GetUnknownIcon ( const char *name );
|
EXTERN Pixmap CreateMenuIcon( int height, unsigned int *widthp, unsigned int *heightp );
|
||||||
|
EXTERN void GetUnknownIcon( const char *name );
|
||||||
EXTERN Pixmap FindBitmap ( const char *name, unsigned int *widthp,
|
EXTERN Pixmap FindBitmap ( const char *name, unsigned int *widthp,
|
||||||
unsigned int *heightp );
|
unsigned int *heightp );
|
||||||
EXTERN Pixmap GetBitmap ( const char *name );
|
EXTERN Pixmap GetBitmap ( const char *name );
|
||||||
|
Loading…
Reference in New Issue
Block a user