|
CTWM
|
#include "ctwm.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <strings.h>#include "add_window.h"#include "colormaps.h"#include "drawing.h"#include "events.h"#include "functions.h"#include "functions_defs.h"#include "gram.tab.h"#include "iconmgr.h"#include "icons_builtin.h"#include "icons.h"#include "image.h"#include "list.h"#include "occupation.h"#include "otp.h"#include "screen.h"#include "util.h"#include "vscreen.h"#include "win_iconify.h"#include "win_resize.h"#include "win_utils.h"#include "workspace_manager.h"Go to the source code of this file.
Macros | |
| #define | SHADOWWIDTH 5 /* in pixels */ |
| #define | ENTRY_SPACING 4 |
| #define | SETDEF(btn, ctx, func) |
| #define | UNUSED_PIXEL ((unsigned long) (~0)) /* more than 24 bits */ |
| #define | MSLEN (2 + 2 + 5 * 3 + 5 * 3) |
| #define | DO(mask, str) |
| #define | Over1Mask (1<<30) |
| #define | OverAllMask (1<<31) |
Functions | |
| static void | Paint3DEntry (MenuRoot *mr, MenuItem *mi, bool exposure) |
| static void | PaintNormalEntry (MenuRoot *mr, MenuItem *mi, bool exposure) |
| static void | DestroyMenu (MenuRoot *menu) |
| bool | AddFuncKey (char *name, int cont, int nmods, int func, MenuRoot *menu, char *win_name, char *action) |
| void | AddFuncButton (int num, int cont, int nmods, int func, MenuRoot *menu, MenuItem *item) |
| void | AddDefaultFuncButtons (void) |
| void | PaintEntry (MenuRoot *mr, MenuItem *mi, bool exposure) |
| void | PaintMenu (MenuRoot *mr, XEvent *e) |
| void | MakeWorkspacesMenu (void) |
| bool | cur_fromMenu (void) |
| void | UpdateMenu (void) |
| MenuRoot * | NewMenuRoot (char *name) |
| MenuItem * | AddToMenu (MenuRoot *menu, char *item, char *action, MenuRoot *sub, int func, char *fore, char *back) |
| void | MakeMenus (void) |
| void | MakeMenu (MenuRoot *mr) |
| bool | PopUpMenu (MenuRoot *menu, int x, int y, bool center) |
| void | PopDownMenu (void) |
| void | HideMenu (MenuRoot *menu) |
| MenuRoot * | FindMenuRoot (char *name) |
| void | MoveMenu (XEvent *eventp) |
| void | WarpCursorToDefaultEntry (MenuRoot *menu) |
| char * | mk_twmkeys_entry (const FuncKey *key) |
| Generate up a string representation of a keybinding->action. | |
Variables | |
| MenuRoot * | ActiveMenu = NULL |
| MenuItem * | ActiveItem = NULL |
| bool | menuFromFrameOrWindowOrTitlebar = false |
| char * | CurrentSelectedWorkspace |
| int | AlternateKeymap |
| bool | AlternateContext |
| int | MenuDepth = 0 |
| struct { | |
| int x | |
| int y | |
| } | MenuOrigins [10/*max number of nested menus */] |
| static bool | addingdefaults = false |
| static bool | fromMenu |
| #define DO | ( | mask, | |
| str ) |
Referenced by mk_twmkeys_entry().
| #define ENTRY_SPACING 4 |
Definition at line 82 of file menus.c.
Referenced by MakeMenu(), and Paint3DEntry().
| #define MSLEN (2 + 2 + 5 * 3 + 5 * 3) |
Referenced by mk_twmkeys_entry().
| #define Over1Mask (1<<30) |
| #define OverAllMask (1<<31) |
| #define SETDEF | ( | btn, | |
| ctx, | |||
| func ) |
Referenced by AddDefaultFuncButtons().
| #define SHADOWWIDTH 5 /* in pixels */ |
Definition at line 81 of file menus.c.
Referenced by PopUpMenu().
| #define UNUSED_PIXEL ((unsigned long) (~0)) /* more than 24 bits */ |
Referenced by MakeMenu(), NewMenuRoot(), and PopUpMenu().
| void AddDefaultFuncButtons | ( | void | ) |
Definition at line 223 of file menus.c.
References addingdefaults, C_ICON, C_ICONMGR, C_TITLE, and SETDEF.
Referenced by InitTitlebarButtons().
Definition at line 171 of file menus.c.
References addingdefaults, cont, FuncButton::cont, FuncButton::func, FuncButton::item, FuncButton::menu, FuncButton::mods, FuncButton::next, FuncButton::num, and Scr.
Referenced by GotButton().
| bool AddFuncKey | ( | char * | name, |
| int | cont, | ||
| int | nmods, | ||
| int | func, | ||
| MenuRoot * | menu, | ||
| char * | win_name, | ||
| char * | action ) |
Definition at line 102 of file menus.c.
References FuncKey::action, cont, FuncKey::cont, dpy, FuncKey::func, FuncKey::keycode, FuncKey::keysym, FuncKey::menu, FuncKey::mods, FuncKey::name, FuncKey::next, Scr, and FuncKey::win_name.
Referenced by GotKey().
| MenuItem * AddToMenu | ( | MenuRoot * | menu, |
| char * | item, | ||
| char * | action, | ||
| MenuRoot * | sub, | ||
| int | func, | ||
| char * | fore, | ||
| char * | back ) |
Definition at line 732 of file menus.c.
References MenuItem::action, ColorPair::back, CreateFonts(), MenuRoot::defaultitem, dpy, MenuRoot::first, ColorPair::fore, MenuItem::func, GetColor(), GetShadeColors(), MenuItem::item, MenuItem::item_num, MenuRoot::items, MenuRoot::last, MenuItem::next, MenuItem::normal, MenuItem::prev, MenuRoot::pull, MenuItem::root, Scr, MenuItem::separated, MenuItem::state, MenuItem::strlen, MenuItem::sub, MenuItem::user_colors, and MenuRoot::width.
Referenced by GotButton(), MakeWorkspacesMenu(), and PopUpMenu().
| bool cur_fromMenu | ( | void | ) |
|
static |
Definition at line 1517 of file menus.c.
References dpy, MenuRoot::first, MenuContext, MenuItem::next, Scr, ScreenContext, MenuRoot::shadow, and MenuRoot::w.
Referenced by PopUpMenu().
| MenuRoot * FindMenuRoot | ( | char * | name | ) |
Definition at line 1503 of file menus.c.
References MenuRoot::name, MenuRoot::next, and Scr.
| void HideMenu | ( | MenuRoot * | menu | ) |
Definition at line 1476 of file menus.c.
References dpy, MenuRoot::mapped, MRM_UNMAPPED, Scr, MenuRoot::shadow, and MenuRoot::w.
Referenced by HandleEnterNotify(), and PopDownMenu().
| void MakeMenu | ( | MenuRoot * | mr | ) |
Definition at line 851 of file menus.c.
References ColorPair::back, dpy, ENTRY_SPACING, MenuRoot::first, ColorPair::fore, MenuItem::func, GetColor(), GetShadeColors(), MenuRoot::height, MenuItem::highlight, MenuRoot::highlight, MenuItem::item_num, MenuRoot::items, MenuRoot::mapped, MAX, MenuContext, MRM_NEVER, MRM_UNMAPPED, MenuItem::next, MenuItem::normal, MenuRoot::pinned, MenuRoot::pmenu, MenuRoot::pull, Scr, ScreenContext, MenuRoot::shadow, UNUSED_PIXEL, MenuItem::user_colors, MenuRoot::w, and MenuRoot::width.
Referenced by f_pin_impl(), MakeMenus(), MakeWorkspacesMenu(), and PopUpMenu().
| void MakeMenus | ( | void | ) |
Definition at line 836 of file menus.c.
References MakeMenu(), MenuRoot::next, MenuRoot::pinned, MenuRoot::real_menu, and Scr.
Referenced by ctwm_main().
| void MakeWorkspacesMenu | ( | void | ) |
Definition at line 442 of file menus.c.
References AddToMenu(), MakeMenu(), WorkSpace::name, WorkSpace::next, and Scr.
Referenced by ctwm_main().
| char * mk_twmkeys_entry | ( | const FuncKey * | key | ) |
Generate up a string representation of a keybinding->action.
Internally used in generating TwmKeys menu.
Definition at line 1657 of file menus.c.
References FuncKey::action, DO, MSLEN, and FuncKey::name.
Referenced by PopUpMenu().
| void MoveMenu | ( | XEvent * | eventp | ) |
Definition at line 1538 of file menus.c.
References ActiveMenu, ButtonPressed, ConstrainByBorders1(), cont, DispatchEvent(), dpy, Event, MenuDepth, MenuOrigins, and Scr.
Referenced by HandleButtonPress().
| MenuRoot * NewMenuRoot | ( | char * | name | ) |
Definition at line 637 of file menus.c.
References ColorPair::back, MenuRoot::defaultitem, MenuRoot::first, ColorPair::fore, MenuRoot::highlight, MenuRoot::items, MenuRoot::last, MenuRoot::mapped, MRM_NEVER, MenuRoot::name, NewMenuRoot(), MenuRoot::prev, MenuRoot::pull, MenuRoot::real_menu, Scr, MenuRoot::shadow, TWM_ALLICONS, TWM_ALLWINDOWS, TWM_ICONS, TWM_KEYS, TWM_VISIBLE, TWM_WINDOWS, TWM_WORKSPACES, UNUSED_PIXEL, MenuRoot::w, and MenuRoot::width.
Referenced by GetRoot(), and NewMenuRoot().
Definition at line 256 of file menus.c.
References ColorPair::back, Create3DMenuIcon(), dpy, Draw3DBorder(), ENTRY_SPACING, FB, ColorPair::fore, MenuItem::func, MenuItem::highlight, MenuItem::item, MenuItem::item_num, MenuItem::normal, off, Scr, MenuItem::separated, MenuItem::state, MenuItem::strlen, MenuItem::user_colors, MenuRoot::w, MenuRoot::width, MenuItem::x, x, and y.
Referenced by PaintEntry().
Definition at line 242 of file menus.c.
References MenuRoot::lastactive, Paint3DEntry(), PaintNormalEntry(), Scr, and MenuItem::state.
Referenced by HandleEnterNotify(), HandleKeyPress(), PaintMenu(), PopDownMenu(), and UpdateMenu().
| void PaintMenu | ( | MenuRoot * | mr, |
| XEvent * | e ) |
Definition at line 419 of file menus.c.
References dpy, Draw3DBorder(), MenuRoot::first, MenuRoot::height, MenuItem::item_num, MenuItem::next, off, PaintEntry(), Scr, MenuRoot::w, and MenuRoot::width.
Referenced by HandleExpose().
Definition at line 334 of file menus.c.
References ColorPair::back, CreateMenuIcon(), dpy, FB, ColorPair::fore, MenuItem::func, MenuItem::highlight, MenuItem::item, MenuItem::item_num, MenuItem::normal, Scr, MenuItem::separated, MenuItem::state, MenuItem::strlen, MenuItem::user_colors, MenuRoot::w, MenuRoot::width, MenuItem::x, x, and y.
Referenced by PaintEntry().
| void PopDownMenu | ( | void | ) |
Definition at line 1442 of file menus.c.
References ActiveItem, ActiveMenu, C_FRAME, C_ICON, C_TITLE, C_WINDOW, Context, dpy, HideMenu(), MenuDepth, menuFromFrameOrWindowOrTitlebar, PaintEntry(), MenuRoot::pinned, MenuRoot::prev, and UninstallRootColormap().
Referenced by f_exec_impl(), f_movetitlebar_impl(), f_pin_impl(), f_resize_impl(), HandleButtonPress(), HandleButtonRelease(), HandleKeyPress(), HandleLeaveNotify(), and movewindow().
| bool PopUpMenu | ( | MenuRoot * | menu, |
| int | x, | ||
| int | y, | ||
| bool | center ) |
Definition at line 1130 of file menus.c.
References ActiveMenu, AddToMenu(), ColorPair::back, TwmWindow::class, ConstrainByLayout(), CurrentSelectedWorkspace, DestroyMenu(), dpy, MenuRoot::entered, MenuRoot::first, ColorPair::fore, MenuRoot::height, MenuRoot::highlight, InstallRootColormap(), TwmWindow::isicon, TwmWindow::isiconmgr, TwmWindow::iswspmgr, MenuRoot::items, MenuRoot::last, LookInList(), MakeMenu(), MenuRoot::mapped, MenuDepth, MenuOrigins, mk_twmkeys_entry(), MRM_MAPPED, MRM_NEVER, TwmWindow::name, WorkSpace::name, TwmWindow::next, WorkSpace::next, OCCUPY, MenuRoot::pinned, MenuRoot::prev, Scr, MenuRoot::shadow, SHADOWWIDTH, UNUSED_PIXEL, MenuRoot::w, MenuRoot::width, MenuRoot::x, x, MenuRoot::y, and y.
Referenced by do_key_menu(), do_menu(), HandleEnterNotify(), and UpdateMenu().
| void UpdateMenu | ( | void | ) |
Definition at line 487 of file menus.c.
References ActiveItem, ActiveMenu, Cancel, CurrentSelectedWorkspace, DispatchEvent(), dpy, Event, fromMenu, JunkChild, JunkMask, JunkRoot, MAXMENUDEPTH, MenuDepth, menuFromFrameOrWindowOrTitlebar, MenuOrigins, MenuItem::next, PaintEntry(), PopUpMenu(), Scr, ScreenContext, x, and y.
Referenced by do_key_menu(), do_menu(), and HandleEnterNotify().
| void WarpCursorToDefaultEntry | ( | MenuRoot * | menu | ) |
Definition at line 1626 of file menus.c.
References MenuRoot::defaultitem, dpy, Event, MenuRoot::first, MenuRoot::height, MenuRoot::last, MenuItem::next, root, Scr, MenuRoot::w, MenuRoot::width, x, and y.
Referenced by HandleButtonRelease().
| MenuItem* ActiveItem = NULL |
Definition at line 59 of file menus.c.
Referenced by f_menu_impl(), HandleButtonPress(), HandleButtonRelease(), HandleEnterNotify(), HandleKeyPress(), PopDownMenu(), and UpdateMenu().
| MenuRoot* ActiveMenu = NULL |
Definition at line 58 of file menus.c.
Referenced by AutoLowerWindow(), AutoRaiseWindow(), f_pin_impl(), HandleButtonPress(), HandleButtonRelease(), HandleEnterNotify(), HandleKeyPress(), HandleLeaveNotify(), MoveMenu(), PopDownMenu(), PopUpMenu(), and UpdateMenu().
|
static |
Definition at line 72 of file menus.c.
Referenced by AddDefaultFuncButtons(), and AddFuncButton().
| bool AlternateContext |
Definition at line 65 of file menus.c.
Referenced by f_altcontext_impl(), HandleButtonPress(), HandleButtonRelease(), and HandleKeyPress().
| int AlternateKeymap |
Definition at line 64 of file menus.c.
Referenced by f_altkeymap_impl(), HandleButtonPress(), HandleButtonRelease(), and HandleKeyPress().
| char* CurrentSelectedWorkspace |
Definition at line 61 of file menus.c.
Referenced by HandleKeyPress(), PopUpMenu(), and UpdateMenu().
|
static |
Definition at line 480 of file menus.c.
Referenced by cur_fromMenu(), and UpdateMenu().
| int MenuDepth = 0 |
Definition at line 67 of file menus.c.
Referenced by HandleEnterNotify(), HandleKeyPress(), MoveMenu(), PopDownMenu(), PopUpMenu(), and UpdateMenu().
| bool menuFromFrameOrWindowOrTitlebar = false |
Definition at line 60 of file menus.c.
Referenced by DispatchEvent2(), f_movetitlebar_impl(), HandleButtonPress(), movewindow(), PopDownMenu(), and UpdateMenu().
| struct { ... } MenuOrigins[ 10 /* max number of nested menus */ ] |
Referenced by MoveMenu(), PopUpMenu(), and UpdateMenu().
| int x |
Definition at line 69 of file menus.c.
Referenced by add_layout_override_entry(), AddStartResize(), AddWindow(), AnimateIcons(), ConfigureCaptiveRootWindow(), ConstrainedToWinBox(), convert_for_16(), convert_for_16(), convert_for_32(), convert_for_32(), CreateIconWindow(), createWindowBoxes(), CreateWindowTitlebarButtons(), CreateWorkSpaceManagerWindow(), DisplayPosition(), do_auto_clamp(), do_key_menu(), do_menu(), Draw3DBorder(), Draw3DCorner(), EwmhHandle_NET_WM_ICONNotify(), ExtractIcon(), f_initsize_impl(), f_moveresize_impl(), fittocontent(), GetGravityOffsets(), GetWindowConfig(), HandleButtonPress(), HandleConfigureRequest(), HandleEnterNotify(), HandlePropertyNotify(), IconUp(), Identify(), InitVirtualScreens(), LoadJpegImage(), LoadXwdImage(), MaskScreen(), MenuStartResize(), MoveIconManager(), MoveOutline(), MoveResizeSizeWindow(), Occupy(), packwindow(), Paint3DEntry(), PaintIcon(), PaintNormalEntry(), PopUpMenu(), RAreaContainsXY(), RAreaListBigArea(), RAreaNew(), RAreaNewStatic(), RedoIconName(), ReparentWindow(), RescueWindows(), ReshapeIcon(), ResizeOccupyWindow(), restoregeometry(), RLayoutGetAreaAtXY(), RLayoutXParseGeometry(), SetBorderCursor(), SetupFrame(), SetupWindow(), SweepWindow(), TryToGrid(), TryToPack(), TryToPush(), TryToPush_be(), UpdateMenu(), Vanish(), WarpCursorToDefaultEntry(), WarpToScreen(), WarpToWindow(), WMapRedrawWindow(), WMapSetupWindow(), WMgrHandleButtonEvent(), XrandrNewLayout(), and Zoom().
| int y |
Definition at line 70 of file menus.c.
Referenced by add_layout_override_entry(), AddStartResize(), AddWindow(), ConfigureCaptiveRootWindow(), ConstrainedToWinBox(), convert_for_16(), convert_for_16(), convert_for_32(), convert_for_32(), CreateHighlightWindows(), CreateLowlightWindows(), createWindowBoxes(), CreateWindowTitlebarButtons(), CreateWorkSpaceManagerWindow(), DisplayPosition(), do_auto_clamp(), do_key_menu(), do_menu(), Draw3DBorder(), Draw3DCorner(), ExtractIcon(), f_initsize_impl(), f_moveresize_impl(), fittocontent(), GetGravityOffsets(), GetWindowConfig(), HandleButtonPress(), HandleConfigureRequest(), HandleEnterNotify(), IconUp(), Identify(), InitVirtualScreens(), LoadJpegImage(), LoadXwdImage(), MaskScreen(), MenuStartResize(), MoveOutline(), MoveResizeSizeWindow(), Occupy(), packwindow(), Paint3DEntry(), PaintNormalEntry(), PopUpMenu(), RAreaContainsXY(), RAreaListBigArea(), RAreaNew(), RAreaNewStatic(), ReparentWindow(), RescueWindows(), ResizeOccupyWindow(), restoregeometry(), RLayoutGetAreaAtXY(), RLayoutXParseGeometry(), SetBorderCursor(), SetupFrame(), SetupWindow(), SweepWindow(), TryToGrid(), TryToPack(), TryToPush(), TryToPush_be(), UpdateMenu(), Vanish(), WarpCursorToDefaultEntry(), WarpToScreen(), WarpToWindow(), WMapRedrawWindow(), WMapSetupWindow(), WMgrHandleButtonEvent(), XrandrNewLayout(), and Zoom().