1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00
- Kill unused vars in wrlib
- Add missing initializers to defaults.c:staticOptionList
- Re-format it slightly
- Kill some dead code
- Kill stupid "if (const op var)"
This commit is contained in:
Tamas TEVESZ
2010-04-03 18:13:13 +02:00
committed by Carlos R. Mafra
parent 79e1bb53d3
commit 241e66ff0a
10 changed files with 211 additions and 232 deletions

View File

@@ -310,365 +310,352 @@ static WOptionEnumeration seWorkspaceBorder[] = {
WDefaultEntry staticOptionList[] = { WDefaultEntry staticOptionList[] = {
{"ColormapSize", "4", NULL, {"ColormapSize", "4", NULL,
&wPreferences.cmap_size, getInt, NULL}, &wPreferences.cmap_size, getInt, NULL, NULL, NULL},
{"DisableDithering", "NO", NULL, {"DisableDithering", "NO", NULL,
&wPreferences.no_dithering, getBool, NULL}, &wPreferences.no_dithering, getBool, NULL, NULL, NULL},
/* static by laziness */
{"IconSize", "64", NULL, {"IconSize", "64", NULL,
&wPreferences.icon_size, getInt, NULL}, &wPreferences.icon_size, getInt, NULL, NULL, NULL},
{"ModifierKey", "Mod1", NULL, {"ModifierKey", "Mod1", NULL,
&wPreferences.modifier_mask, getModMask, NULL}, &wPreferences.modifier_mask, getModMask, NULL, NULL, NULL},
{"DisableWSMouseActions", "NO", NULL, {"DisableWSMouseActions", "NO", NULL,
&wPreferences.disable_root_mouse, getBool, NULL}, &wPreferences.disable_root_mouse, getBool, NULL, NULL, NULL},
{"FocusMode", "manual", seFocusModes, {"FocusMode", "manual", seFocusModes, /* have a problem when switching from */
&wPreferences.focus_mode, getEnum, NULL}, /* have a problem when switching from manual to sloppy without restart */ &wPreferences.focus_mode, getEnum, NULL, NULL, NULL}, /* manual to sloppy without restart */
{"NewStyle", "NO", NULL, {"NewStyle", "NO", NULL,
&wPreferences.new_style, getBool, NULL}, &wPreferences.new_style, getBool, NULL, NULL, NULL},
{"DisableDock", "NO", (void *)WM_DOCK, {"DisableDock", "NO", (void *)WM_DOCK,
NULL, getBool, setIfDockPresent}, NULL, getBool, setIfDockPresent, NULL, NULL},
{"DisableClip", "NO", (void *)WM_CLIP, {"DisableClip", "NO", (void *)WM_CLIP,
NULL, getBool, setIfDockPresent}, NULL, getBool, setIfDockPresent, NULL, NULL},
{"DisableMiniwindows", "NO", NULL, {"DisableMiniwindows", "NO", NULL,
&wPreferences.disable_miniwindows, getBool, NULL} &wPreferences.disable_miniwindows, getBool, NULL, NULL, NULL}
}; };
WDefaultEntry optionList[] = { WDefaultEntry optionList[] = {
/* dynamic options */ /* dynamic options */
{"IconPosition", "blh", seIconPositions, {"IconPosition", "blh", seIconPositions,
&wPreferences.icon_yard, getEnum, setIconPosition}, &wPreferences.icon_yard, getEnum, setIconPosition, NULL, NULL},
{"IconificationStyle", "Zoom", seIconificationStyles, {"IconificationStyle", "Zoom", seIconificationStyles,
&wPreferences.iconification_style, getEnum, NULL}, &wPreferences.iconification_style, getEnum, NULL, NULL, NULL},
{"MouseLeftButtonAction", "SelectWindows", seMouseButtonActions, {"MouseLeftButtonAction", "SelectWindows", seMouseButtonActions,
&wPreferences.mouse_button1, getEnum, NULL}, &wPreferences.mouse_button1, getEnum, NULL, NULL, NULL},
{"MouseMiddleButtonAction", "OpenWindowListMenu", seMouseButtonActions, {"MouseMiddleButtonAction", "OpenWindowListMenu", seMouseButtonActions,
&wPreferences.mouse_button2, getEnum, NULL}, &wPreferences.mouse_button2, getEnum, NULL, NULL, NULL},
{"MouseRightButtonAction", "OpenApplicationsMenu", seMouseButtonActions, {"MouseRightButtonAction", "OpenApplicationsMenu", seMouseButtonActions,
&wPreferences.mouse_button3, getEnum, NULL}, &wPreferences.mouse_button3, getEnum, NULL, NULL, NULL},
{"MouseWheelAction", "None", seMouseWheelActions, {"MouseWheelAction", "None", seMouseWheelActions,
&wPreferences.mouse_wheel, getEnum, NULL}, &wPreferences.mouse_wheel, getEnum, NULL, NULL, NULL},
{"PixmapPath", DEF_PIXMAP_PATHS, NULL, {"PixmapPath", DEF_PIXMAP_PATHS, NULL,
&wPreferences.pixmap_path, getPathList, NULL}, &wPreferences.pixmap_path, getPathList, NULL, NULL, NULL},
{"IconPath", DEF_ICON_PATHS, NULL, {"IconPath", DEF_ICON_PATHS, NULL,
&wPreferences.icon_path, getPathList, NULL}, &wPreferences.icon_path, getPathList, NULL, NULL, NULL},
{"ColormapMode", "auto", seColormapModes, {"ColormapMode", "auto", seColormapModes,
&wPreferences.colormap_mode, getEnum, NULL}, &wPreferences.colormap_mode, getEnum, NULL, NULL, NULL},
{"AutoFocus", "NO", NULL, {"AutoFocus", "NO", NULL,
&wPreferences.auto_focus, getBool, NULL}, &wPreferences.auto_focus, getBool, NULL, NULL, NULL},
{"RaiseDelay", "0", NULL, {"RaiseDelay", "0", NULL,
&wPreferences.raise_delay, getInt, NULL}, &wPreferences.raise_delay, getInt, NULL, NULL, NULL},
{"CirculateRaise", "NO", NULL, {"CirculateRaise", "NO", NULL,
&wPreferences.circ_raise, getBool, NULL}, &wPreferences.circ_raise, getBool, NULL, NULL, NULL},
{"Superfluous", "NO", NULL, {"Superfluous", "NO", NULL,
&wPreferences.superfluous, getBool, NULL}, &wPreferences.superfluous, getBool, NULL, NULL, NULL},
{"AdvanceToNewWorkspace", "NO", NULL, {"AdvanceToNewWorkspace", "NO", NULL,
&wPreferences.ws_advance, getBool, NULL}, &wPreferences.ws_advance, getBool, NULL, NULL, NULL},
{"CycleWorkspaces", "NO", NULL, {"CycleWorkspaces", "NO", NULL,
&wPreferences.ws_cycle, getBool, NULL}, &wPreferences.ws_cycle, getBool, NULL, NULL, NULL},
{"WorkspaceNameDisplayPosition", "center", seDisplayPositions, {"WorkspaceNameDisplayPosition", "center", seDisplayPositions,
&wPreferences.workspace_name_display_position, getEnum, NULL}, &wPreferences.workspace_name_display_position, getEnum, NULL, NULL, NULL},
{"WorkspaceBorder", "None", seWorkspaceBorder, {"WorkspaceBorder", "None", seWorkspaceBorder,
&wPreferences.workspace_border_position, getEnum, updateUsableArea}, &wPreferences.workspace_border_position, getEnum, updateUsableArea, NULL, NULL},
{"WorkspaceBorderSize", "0", NULL, {"WorkspaceBorderSize", "0", NULL,
&wPreferences.workspace_border_size, getInt, updateUsableArea}, &wPreferences.workspace_border_size, getInt, updateUsableArea, NULL, NULL},
{"StickyIcons", "NO", NULL, {"StickyIcons", "NO", NULL,
&wPreferences.sticky_icons, getBool, setStickyIcons}, &wPreferences.sticky_icons, getBool, setStickyIcons, NULL, NULL},
{"SaveSessionOnExit", "NO", NULL, {"SaveSessionOnExit", "NO", NULL,
&wPreferences.save_session_on_exit, getBool, NULL}, &wPreferences.save_session_on_exit, getBool, NULL, NULL, NULL},
{"WrapMenus", "NO", NULL, {"WrapMenus", "NO", NULL,
&wPreferences.wrap_menus, getBool, NULL}, &wPreferences.wrap_menus, getBool, NULL, NULL, NULL},
{"ScrollableMenus", "NO", NULL, {"ScrollableMenus", "NO", NULL,
&wPreferences.scrollable_menus, getBool, NULL}, &wPreferences.scrollable_menus, getBool, NULL, NULL, NULL},
{"MenuScrollSpeed", "medium", seSpeeds, {"MenuScrollSpeed", "medium", seSpeeds,
&wPreferences.menu_scroll_speed, getEnum, NULL}, &wPreferences.menu_scroll_speed, getEnum, NULL, NULL, NULL},
{"IconSlideSpeed", "medium", seSpeeds, {"IconSlideSpeed", "medium", seSpeeds,
&wPreferences.icon_slide_speed, getEnum, NULL}, &wPreferences.icon_slide_speed, getEnum, NULL, NULL, NULL},
{"ShadeSpeed", "medium", seSpeeds, {"ShadeSpeed", "medium", seSpeeds,
&wPreferences.shade_speed, getEnum, NULL}, &wPreferences.shade_speed, getEnum, NULL, NULL, NULL},
{"DoubleClickTime", "250", (void *)&wPreferences.dblclick_time, {"DoubleClickTime", "250", (void *)&wPreferences.dblclick_time,
&wPreferences.dblclick_time, getInt, setDoubleClick, &wPreferences.dblclick_time, getInt, setDoubleClick, NULL, NULL},
},
{"AlignSubmenus", "NO", NULL, {"AlignSubmenus", "NO", NULL,
&wPreferences.align_menus, getBool, NULL}, &wPreferences.align_menus, getBool, NULL, NULL, NULL},
{"OpenTransientOnOwnerWorkspace", "NO", NULL, {"OpenTransientOnOwnerWorkspace", "NO", NULL,
&wPreferences.open_transients_with_parent, getBool, NULL}, &wPreferences.open_transients_with_parent, getBool, NULL, NULL, NULL},
{"WindowPlacement", "auto", sePlacements, {"WindowPlacement", "auto", sePlacements,
&wPreferences.window_placement, getEnum, NULL}, &wPreferences.window_placement, getEnum, NULL, NULL, NULL},
{"IgnoreFocusClick", "NO", NULL, {"IgnoreFocusClick", "NO", NULL,
&wPreferences.ignore_focus_click, getBool, NULL}, &wPreferences.ignore_focus_click, getBool, NULL, NULL, NULL},
{"UseSaveUnders", "NO", NULL, {"UseSaveUnders", "NO", NULL,
&wPreferences.use_saveunders, getBool, NULL}, &wPreferences.use_saveunders, getBool, NULL, NULL, NULL},
{"OpaqueMove", "NO", NULL, {"OpaqueMove", "NO", NULL,
&wPreferences.opaque_move, getBool, NULL}, &wPreferences.opaque_move, getBool, NULL, NULL, NULL},
{"DisableAnimations", "NO", NULL, {"DisableAnimations", "NO", NULL,
&wPreferences.no_animations, getBool, NULL}, &wPreferences.no_animations, getBool, NULL, NULL, NULL},
{"DontLinkWorkspaces", "NO", NULL, {"DontLinkWorkspaces", "NO", NULL,
&wPreferences.no_autowrap, getBool, NULL}, &wPreferences.no_autowrap, getBool, NULL, NULL, NULL},
{"AutoArrangeIcons", "NO", NULL, {"AutoArrangeIcons", "NO", NULL,
&wPreferences.auto_arrange_icons, getBool, NULL}, &wPreferences.auto_arrange_icons, getBool, NULL, NULL, NULL},
{"NoWindowOverDock", "NO", NULL, {"NoWindowOverDock", "NO", NULL,
&wPreferences.no_window_over_dock, getBool, updateUsableArea}, &wPreferences.no_window_over_dock, getBool, updateUsableArea, NULL, NULL},
{"NoWindowOverIcons", "NO", NULL, {"NoWindowOverIcons", "NO", NULL,
&wPreferences.no_window_over_icons, getBool, updateUsableArea}, &wPreferences.no_window_over_icons, getBool, updateUsableArea, NULL, NULL},
{"WindowPlaceOrigin", "(0, 0)", NULL, {"WindowPlaceOrigin", "(0, 0)", NULL,
&wPreferences.window_place_origin, getCoord, NULL}, &wPreferences.window_place_origin, getCoord, NULL, NULL, NULL},
{"ResizeDisplay", "corner", seGeomDisplays, {"ResizeDisplay", "corner", seGeomDisplays,
&wPreferences.size_display, getEnum, NULL}, &wPreferences.size_display, getEnum, NULL, NULL, NULL},
{"MoveDisplay", "corner", seGeomDisplays, {"MoveDisplay", "corner", seGeomDisplays,
&wPreferences.move_display, getEnum, NULL}, &wPreferences.move_display, getEnum, NULL, NULL, NULL},
{"DontConfirmKill", "NO", NULL, {"DontConfirmKill", "NO", NULL,
&wPreferences.dont_confirm_kill, getBool, NULL}, &wPreferences.dont_confirm_kill, getBool, NULL, NULL, NULL},
{"WindowTitleBalloons", "NO", NULL, {"WindowTitleBalloons", "NO", NULL,
&wPreferences.window_balloon, getBool, NULL}, &wPreferences.window_balloon, getBool, NULL, NULL, NULL},
{"MiniwindowTitleBalloons", "NO", NULL, {"MiniwindowTitleBalloons", "NO", NULL,
&wPreferences.miniwin_balloon, getBool, NULL}, &wPreferences.miniwin_balloon, getBool, NULL, NULL, NULL},
{"AppIconBalloons", "NO", NULL, {"AppIconBalloons", "NO", NULL,
&wPreferences.appicon_balloon, getBool, NULL}, &wPreferences.appicon_balloon, getBool, NULL, NULL, NULL},
{"HelpBalloons", "NO", NULL, {"HelpBalloons", "NO", NULL,
&wPreferences.help_balloon, getBool, NULL}, &wPreferences.help_balloon, getBool, NULL, NULL, NULL},
{"EdgeResistance", "30", NULL, {"EdgeResistance", "30", NULL,
&wPreferences.edge_resistance, getInt, NULL}, &wPreferences.edge_resistance, getInt, NULL, NULL, NULL},
{"ResizeIncrement", "32", NULL, {"ResizeIncrement", "32", NULL,
&wPreferences.resize_increment, getInt, NULL}, &wPreferences.resize_increment, getInt, NULL, NULL, NULL},
{"Attraction", "NO", NULL, {"Attraction", "NO", NULL,
&wPreferences.attract, getBool, NULL}, &wPreferences.attract, getBool, NULL, NULL, NULL},
{"DisableBlinking", "NO", NULL, {"DisableBlinking", "NO", NULL,
&wPreferences.dont_blink, getBool, NULL}, &wPreferences.dont_blink, getBool, NULL, NULL, NULL},
{"SingleClickLaunch", "NO", NULL, {"SingleClickLaunch", "NO", NULL,
&wPreferences.single_click, getBool, NULL}, &wPreferences.single_click, getBool, NULL, NULL, NULL},
/* style options */ /* style options */
{"MenuStyle", "normal", seMenuStyles, {"MenuStyle", "normal", seMenuStyles,
&wPreferences.menu_style, getEnum, setMenuStyle}, &wPreferences.menu_style, getEnum, setMenuStyle, NULL, NULL},
{"WidgetColor", "(solid, gray)", NULL, {"WidgetColor", "(solid, gray)", NULL,
NULL, getTexture, setWidgetColor, NULL, getTexture, setWidgetColor, NULL, NULL},
},
{"WorkspaceSpecificBack", "()", NULL, {"WorkspaceSpecificBack", "()", NULL,
NULL, getWSSpecificBackground, setWorkspaceSpecificBack}, NULL, getWSSpecificBackground, setWorkspaceSpecificBack, NULL, NULL},
/* WorkspaceBack must come after WorkspaceSpecificBack or /* WorkspaceBack must come after WorkspaceSpecificBack or
* WorkspaceBack wont know WorkspaceSpecificBack was also * WorkspaceBack wont know WorkspaceSpecificBack was also
* specified and 2 copies of wmsetbg will be launched */ * specified and 2 copies of wmsetbg will be launched */
{"WorkspaceBack", "(solid, black)", NULL, {"WorkspaceBack", "(solid, black)", NULL,
NULL, getWSBackground, setWorkspaceBack}, NULL, getWSBackground, setWorkspaceBack, NULL, NULL},
{"SmoothWorkspaceBack", "NO", NULL, {"SmoothWorkspaceBack", "NO", NULL,
NULL, getBool, NULL}, NULL, getBool, NULL, NULL, NULL},
{"IconBack", "(solid, gray)", NULL, {"IconBack", "(solid, gray)", NULL,
NULL, getTexture, setIconTile}, NULL, getTexture, setIconTile, NULL, NULL},
{"TitleJustify", "center", seJustifications, {"TitleJustify", "center", seJustifications,
&wPreferences.title_justification, getEnum, setJustify}, &wPreferences.title_justification, getEnum, setJustify, NULL, NULL},
{"WindowTitleFont", DEF_TITLE_FONT, NULL, {"WindowTitleFont", DEF_TITLE_FONT, NULL,
NULL, getFont, setWinTitleFont, NULL, getFont, setWinTitleFont, NULL, NULL},
},
{"WindowTitleExtendSpace", DEF_WINDOW_TITLE_EXTEND_SPACE, NULL, {"WindowTitleExtendSpace", DEF_WINDOW_TITLE_EXTEND_SPACE, NULL,
&wPreferences.window_title_clearance, getInt, setClearance}, &wPreferences.window_title_clearance, getInt, setClearance, NULL, NULL},
{"MenuTitleExtendSpace", DEF_MENU_TITLE_EXTEND_SPACE, NULL, {"MenuTitleExtendSpace", DEF_MENU_TITLE_EXTEND_SPACE, NULL,
&wPreferences.menu_title_clearance, getInt, setClearance}, &wPreferences.menu_title_clearance, getInt, setClearance, NULL, NULL},
{"MenuTextExtendSpace", DEF_MENU_TEXT_EXTEND_SPACE, NULL, {"MenuTextExtendSpace", DEF_MENU_TEXT_EXTEND_SPACE, NULL,
&wPreferences.menu_text_clearance, getInt, setClearance}, &wPreferences.menu_text_clearance, getInt, setClearance, NULL, NULL},
{"MenuTitleFont", DEF_MENU_TITLE_FONT, NULL, {"MenuTitleFont", DEF_MENU_TITLE_FONT, NULL,
NULL, getFont, setMenuTitleFont}, NULL, getFont, setMenuTitleFont, NULL, NULL},
{"MenuTextFont", DEF_MENU_ENTRY_FONT, NULL, {"MenuTextFont", DEF_MENU_ENTRY_FONT, NULL,
NULL, getFont, setMenuTextFont}, NULL, getFont, setMenuTextFont, NULL, NULL},
{"IconTitleFont", DEF_ICON_TITLE_FONT, NULL, {"IconTitleFont", DEF_ICON_TITLE_FONT, NULL,
NULL, getFont, setIconTitleFont}, NULL, getFont, setIconTitleFont, NULL, NULL},
{"ClipTitleFont", DEF_CLIP_TITLE_FONT, NULL, {"ClipTitleFont", DEF_CLIP_TITLE_FONT, NULL,
NULL, getFont, setClipTitleFont}, NULL, getFont, setClipTitleFont, NULL, NULL},
{"LargeDisplayFont", DEF_WORKSPACE_NAME_FONT, NULL, {"LargeDisplayFont", DEF_WORKSPACE_NAME_FONT, NULL,
NULL, getFont, setLargeDisplayFont}, NULL, getFont, setLargeDisplayFont, NULL, NULL},
{"HighlightColor", "white", NULL, {"HighlightColor", "white", NULL,
NULL, getColor, setHightlight}, NULL, getColor, setHightlight, NULL, NULL},
{"HighlightTextColor", "black", NULL, {"HighlightTextColor", "black", NULL,
NULL, getColor, setHightlightText}, NULL, getColor, setHightlightText, NULL, NULL},
{"ClipTitleColor", "black", (void *)CLIP_NORMAL, {"ClipTitleColor", "black", (void *)CLIP_NORMAL,
NULL, getColor, setClipTitleColor}, NULL, getColor, setClipTitleColor, NULL, NULL},
{"CClipTitleColor", "\"#454045\"", (void *)CLIP_COLLAPSED, {"CClipTitleColor", "\"#454045\"", (void *)CLIP_COLLAPSED,
NULL, getColor, setClipTitleColor}, NULL, getColor, setClipTitleColor, NULL, NULL},
{"FTitleColor", "white", (void *)WS_FOCUSED, {"FTitleColor", "white", (void *)WS_FOCUSED,
NULL, getColor, setWTitleColor}, NULL, getColor, setWTitleColor, NULL, NULL},
{"PTitleColor", "white", (void *)WS_PFOCUSED, {"PTitleColor", "white", (void *)WS_PFOCUSED,
NULL, getColor, setWTitleColor}, NULL, getColor, setWTitleColor, NULL, NULL},
{"UTitleColor", "black", (void *)WS_UNFOCUSED, {"UTitleColor", "black", (void *)WS_UNFOCUSED,
NULL, getColor, setWTitleColor}, NULL, getColor, setWTitleColor, NULL, NULL},
{"FTitleBack", "(solid, black)", NULL, {"FTitleBack", "(solid, black)", NULL,
NULL, getTexture, setFTitleBack}, NULL, getTexture, setFTitleBack, NULL, NULL},
{"PTitleBack", "(solid, \"#616161\")", NULL, {"PTitleBack", "(solid, \"#616161\")", NULL,
NULL, getTexture, setPTitleBack}, NULL, getTexture, setPTitleBack, NULL, NULL},
{"UTitleBack", "(solid, gray)", NULL, {"UTitleBack", "(solid, gray)", NULL,
NULL, getTexture, setUTitleBack}, NULL, getTexture, setUTitleBack, NULL, NULL},
{"ResizebarBack", "(solid, gray)", NULL, {"ResizebarBack", "(solid, gray)", NULL,
NULL, getTexture, setResizebarBack}, NULL, getTexture, setResizebarBack, NULL, NULL},
{"MenuTitleColor", "white", NULL, {"MenuTitleColor", "white", NULL,
NULL, getColor, setMenuTitleColor}, NULL, getColor, setMenuTitleColor, NULL, NULL},
{"MenuTextColor", "black", NULL, {"MenuTextColor", "black", NULL,
NULL, getColor, setMenuTextColor}, NULL, getColor, setMenuTextColor, NULL, NULL},
{"MenuDisabledColor", "\"#616161\"", NULL, {"MenuDisabledColor", "\"#616161\"", NULL,
NULL, getColor, setMenuDisabledColor}, NULL, getColor, setMenuDisabledColor, NULL, NULL},
{"MenuTitleBack", "(solid, black)", NULL, {"MenuTitleBack", "(solid, black)", NULL,
NULL, getTexture, setMenuTitleBack}, NULL, getTexture, setMenuTitleBack, NULL, NULL},
{"MenuTextBack", "(solid, gray)", NULL, {"MenuTextBack", "(solid, gray)", NULL,
NULL, getTexture, setMenuTextBack}, NULL, getTexture, setMenuTextBack, NULL, NULL},
{"IconTitleColor", "white", NULL, {"IconTitleColor", "white", NULL,
NULL, getColor, setIconTitleColor}, NULL, getColor, setIconTitleColor, NULL, NULL},
{"IconTitleBack", "black", NULL, {"IconTitleBack", "black", NULL,
NULL, getColor, setIconTitleBack}, NULL, getColor, setIconTitleBack, NULL, NULL},
{"SwitchPanelImages", "(swtile.png, swback.png, 30, 40)", &wPreferences, {"SwitchPanelImages", "(swtile.png, swback.png, 30, 40)", &wPreferences,
NULL, getPropList, setSwPOptions}, NULL, getPropList, setSwPOptions, NULL, NULL},
/* keybindings */ /* keybindings */
{"RootMenuKey", "None", (void *)WKBD_ROOTMENU, {"RootMenuKey", "None", (void *)WKBD_ROOTMENU,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"WindowListKey", "None", (void *)WKBD_WINDOWLIST, {"WindowListKey", "None", (void *)WKBD_WINDOWLIST,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"WindowMenuKey", "None", (void *)WKBD_WINDOWMENU, {"WindowMenuKey", "None", (void *)WKBD_WINDOWMENU,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"DockRaiseLowerKey", "None", (void*)WKBD_DOCKRAISELOWER, {"DockRaiseLowerKey", "None", (void*)WKBD_DOCKRAISELOWER,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"ClipRaiseLowerKey", "None", (void *)WKBD_CLIPRAISELOWER, {"ClipRaiseLowerKey", "None", (void *)WKBD_CLIPRAISELOWER,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"MiniaturizeKey", "None", (void *)WKBD_MINIATURIZE, {"MiniaturizeKey", "None", (void *)WKBD_MINIATURIZE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"HideKey", "None", (void *)WKBD_HIDE, {"HideKey", "None", (void *)WKBD_HIDE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"HideOthersKey", "None", (void *)WKBD_HIDE_OTHERS, {"HideOthersKey", "None", (void *)WKBD_HIDE_OTHERS,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"MoveResizeKey", "None", (void *)WKBD_MOVERESIZE, {"MoveResizeKey", "None", (void *)WKBD_MOVERESIZE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"CloseKey", "None", (void *)WKBD_CLOSE, {"CloseKey", "None", (void *)WKBD_CLOSE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"MaximizeKey", "None", (void *)WKBD_MAXIMIZE, {"MaximizeKey", "None", (void *)WKBD_MAXIMIZE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"VMaximizeKey", "None", (void *)WKBD_VMAXIMIZE, {"VMaximizeKey", "None", (void *)WKBD_VMAXIMIZE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"HMaximizeKey", "None", (void *)WKBD_HMAXIMIZE, {"HMaximizeKey", "None", (void *)WKBD_HMAXIMIZE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"LHMaximizeKey", "None", (void*)WKBD_LHMAXIMIZE, {"LHMaximizeKey", "None", (void*)WKBD_LHMAXIMIZE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"RHMaximizeKey", "None", (void*)WKBD_RHMAXIMIZE, {"RHMaximizeKey", "None", (void*)WKBD_RHMAXIMIZE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"MaximusKey", "None", (void*)WKBD_MAXIMUS, {"MaximusKey", "None", (void*)WKBD_MAXIMUS,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"RaiseKey", "\"Meta+Up\"", (void *)WKBD_RAISE, {"RaiseKey", "\"Meta+Up\"", (void *)WKBD_RAISE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"LowerKey", "\"Meta+Down\"", (void *)WKBD_LOWER, {"LowerKey", "\"Meta+Down\"", (void *)WKBD_LOWER,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"RaiseLowerKey", "None", (void *)WKBD_RAISELOWER, {"RaiseLowerKey", "None", (void *)WKBD_RAISELOWER,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"ShadeKey", "None", (void *)WKBD_SHADE, {"ShadeKey", "None", (void *)WKBD_SHADE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"SelectKey", "None", (void *)WKBD_SELECT, {"SelectKey", "None", (void *)WKBD_SELECT,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"FocusNextKey", "None", (void *)WKBD_FOCUSNEXT, {"FocusNextKey", "None", (void *)WKBD_FOCUSNEXT,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"FocusPrevKey", "None", (void *)WKBD_FOCUSPREV, {"FocusPrevKey", "None", (void *)WKBD_FOCUSPREV,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"GroupNextKey", "None", (void *)WKBD_GROUPNEXT, {"GroupNextKey", "None", (void *)WKBD_GROUPNEXT,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"GroupPrevKey", "None", (void *)WKBD_GROUPPREV, {"GroupPrevKey", "None", (void *)WKBD_GROUPPREV,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"NextWorkspaceKey", "None", (void *)WKBD_NEXTWORKSPACE, {"NextWorkspaceKey", "None", (void *)WKBD_NEXTWORKSPACE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"PrevWorkspaceKey", "None", (void *)WKBD_PREVWORKSPACE, {"PrevWorkspaceKey", "None", (void *)WKBD_PREVWORKSPACE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"NextWorkspaceLayerKey", "None", (void *)WKBD_NEXTWSLAYER, {"NextWorkspaceLayerKey", "None", (void *)WKBD_NEXTWSLAYER,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"PrevWorkspaceLayerKey", "None", (void *)WKBD_PREVWSLAYER, {"PrevWorkspaceLayerKey", "None", (void *)WKBD_PREVWSLAYER,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"Workspace1Key", "None", (void *)WKBD_WORKSPACE1, {"Workspace1Key", "None", (void *)WKBD_WORKSPACE1,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"Workspace2Key", "None", (void *)WKBD_WORKSPACE2, {"Workspace2Key", "None", (void *)WKBD_WORKSPACE2,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"Workspace3Key", "None", (void *)WKBD_WORKSPACE3, {"Workspace3Key", "None", (void *)WKBD_WORKSPACE3,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"Workspace4Key", "None", (void *)WKBD_WORKSPACE4, {"Workspace4Key", "None", (void *)WKBD_WORKSPACE4,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"Workspace5Key", "None", (void *)WKBD_WORKSPACE5, {"Workspace5Key", "None", (void *)WKBD_WORKSPACE5,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"Workspace6Key", "None", (void *)WKBD_WORKSPACE6, {"Workspace6Key", "None", (void *)WKBD_WORKSPACE6,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"Workspace7Key", "None", (void *)WKBD_WORKSPACE7, {"Workspace7Key", "None", (void *)WKBD_WORKSPACE7,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"Workspace8Key", "None", (void *)WKBD_WORKSPACE8, {"Workspace8Key", "None", (void *)WKBD_WORKSPACE8,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"Workspace9Key", "None", (void *)WKBD_WORKSPACE9, {"Workspace9Key", "None", (void *)WKBD_WORKSPACE9,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"Workspace10Key", "None", (void *)WKBD_WORKSPACE10, {"Workspace10Key", "None", (void *)WKBD_WORKSPACE10,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"WindowShortcut1Key", "None", (void *)WKBD_WINDOW1, {"WindowShortcut1Key", "None", (void *)WKBD_WINDOW1,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"WindowShortcut2Key", "None", (void *)WKBD_WINDOW2, {"WindowShortcut2Key", "None", (void *)WKBD_WINDOW2,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"WindowShortcut3Key", "None", (void *)WKBD_WINDOW3, {"WindowShortcut3Key", "None", (void *)WKBD_WINDOW3,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"WindowShortcut4Key", "None", (void *)WKBD_WINDOW4, {"WindowShortcut4Key", "None", (void *)WKBD_WINDOW4,
NULL, getKeybind, setKeyGrab} NULL, getKeybind, setKeyGrab, NULL, NULL},
, {"WindowShortcut5Key", "None", (void *)WKBD_WINDOW5, {"WindowShortcut5Key", "None", (void *)WKBD_WINDOW5,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"WindowShortcut6Key", "None", (void *)WKBD_WINDOW6, {"WindowShortcut6Key", "None", (void *)WKBD_WINDOW6,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"WindowShortcut7Key", "None", (void *)WKBD_WINDOW7, {"WindowShortcut7Key", "None", (void *)WKBD_WINDOW7,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"WindowShortcut8Key", "None", (void *)WKBD_WINDOW8, {"WindowShortcut8Key", "None", (void *)WKBD_WINDOW8,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"WindowShortcut9Key", "None", (void *)WKBD_WINDOW9, {"WindowShortcut9Key", "None", (void *)WKBD_WINDOW9,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"WindowShortcut10Key", "None", (void *)WKBD_WINDOW10, {"WindowShortcut10Key", "None", (void *)WKBD_WINDOW10,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"ScreenSwitchKey", "None", (void *)WKBD_SWITCH_SCREEN, {"ScreenSwitchKey", "None", (void *)WKBD_SWITCH_SCREEN,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
#ifdef KEEP_XKB_LOCK_STATUS #ifdef KEEP_XKB_LOCK_STATUS
{"ToggleKbdModeKey", "None", (void *)WKBD_TOGGLE, {"ToggleKbdModeKey", "None", (void *)WKBD_TOGGLE,
NULL, getKeybind, setKeyGrab}, NULL, getKeybind, setKeyGrab, NULL, NULL},
{"KbdModeLock", "NO", NULL, {"KbdModeLock", "NO", NULL,
&wPreferences.modelock, getBool, NULL}, &wPreferences.modelock, getBool, NULL, NULL, NULL},
#endif /* KEEP_XKB_LOCK_STATUS */ #endif /* KEEP_XKB_LOCK_STATUS */
{"NormalCursor", "(builtin, left_ptr)", (void *)WCUR_ROOT, {"NormalCursor", "(builtin, left_ptr)", (void *)WCUR_ROOT,
NULL, getCursor, setCursor}, NULL, getCursor, setCursor, NULL, NULL},
{"ArrowCursor", "(builtin, top_left_arrow)", (void *)WCUR_ARROW, {"ArrowCursor", "(builtin, top_left_arrow)", (void *)WCUR_ARROW,
NULL, getCursor, setCursor}, NULL, getCursor, setCursor, NULL, NULL},
{"MoveCursor", "(builtin, fleur)", (void *)WCUR_MOVE, {"MoveCursor", "(builtin, fleur)", (void *)WCUR_MOVE,
NULL, getCursor, setCursor}, NULL, getCursor, setCursor, NULL, NULL},
{"ResizeCursor", "(builtin, sizing)", (void *)WCUR_RESIZE, {"ResizeCursor", "(builtin, sizing)", (void *)WCUR_RESIZE,
NULL, getCursor, setCursor}, NULL, getCursor, setCursor, NULL, NULL},
{"TopLeftResizeCursor", "(builtin, top_left_corner)", {"TopLeftResizeCursor", "(builtin, top_left_corner)", (void *)WCUR_TOPLEFTRESIZE,
(void *)WCUR_TOPLEFTRESIZE, NULL, getCursor, setCursor, NULL, NULL},
NULL, getCursor, setCursor}, {"TopRightResizeCursor", "(builtin, top_right_corner)", (void *)WCUR_TOPRIGHTRESIZE,
{"TopRightResizeCursor", "(builtin, top_right_corner)", NULL, getCursor, setCursor, NULL, NULL},
(void *)WCUR_TOPRIGHTRESIZE, {"BottomLeftResizeCursor", "(builtin, bottom_left_corner)", (void *)WCUR_BOTTOMLEFTRESIZE,
NULL, getCursor, setCursor}, NULL, getCursor, setCursor, NULL, NULL},
{"BottomLeftResizeCursor", "(builtin, bottom_left_corner)", {"BottomRightResizeCursor", "(builtin, bottom_right_corner)", (void *)WCUR_BOTTOMRIGHTRESIZE,
(void *)WCUR_BOTTOMLEFTRESIZE, NULL, getCursor, setCursor, NULL, NULL},
NULL, getCursor, setCursor}, {"VerticalResizeCursor", "(builtin, sb_v_double_arrow)", (void *)WCUR_VERTICALRESIZE,
{"BottomRightResizeCursor", "(builtin, bottom_right_corner)", NULL, getCursor, setCursor, NULL, NULL},
(void *)WCUR_BOTTOMRIGHTRESIZE, {"HorizontalResizeCursor", "(builtin, sb_h_double_arrow)", (void *)WCUR_HORIZONRESIZE,
NULL, getCursor, setCursor}, NULL, getCursor, setCursor, NULL, NULL},
{"VerticalResizeCursor", "(builtin, sb_v_double_arrow)",
(void *)WCUR_VERTICALRESIZE,
NULL, getCursor, setCursor},
{"HorizontalResizeCursor", "(builtin, sb_h_double_arrow)",
(void *)WCUR_HORIZONRESIZE,
NULL, getCursor, setCursor},
{"WaitCursor", "(builtin, watch)", (void *)WCUR_WAIT, {"WaitCursor", "(builtin, watch)", (void *)WCUR_WAIT,
NULL, getCursor, setCursor}, NULL, getCursor, setCursor, NULL, NULL},
{"QuestionCursor", "(builtin, question_arrow)", (void *)WCUR_QUESTION, {"QuestionCursor", "(builtin, question_arrow)", (void *)WCUR_QUESTION,
NULL, getCursor, setCursor}, NULL, getCursor, setCursor, NULL, NULL},
{"TextCursor", "(builtin, xterm)", (void *)WCUR_TEXT, {"TextCursor", "(builtin, xterm)", (void *)WCUR_TEXT,
NULL, getCursor, setCursor}, NULL, getCursor, setCursor, NULL, NULL},
{"SelectCursor", "(builtin, cross)", (void *)WCUR_SELECT, {"SelectCursor", "(builtin, cross)", (void *)WCUR_SELECT,
NULL, getCursor, setCursor}, NULL, getCursor, setCursor, NULL, NULL},
{"DialogHistoryLines", "500", NULL, {"DialogHistoryLines", "500", NULL,
&wPreferences.history_lines, getInt, NULL}, &wPreferences.history_lines, getInt, NULL, NULL, NULL},
{"CycleActiveHeadOnly", "NO", NULL, {"CycleActiveHeadOnly", "NO", NULL,
&wPreferences.cycle_active_head_only, getBool, NULL} &wPreferences.cycle_active_head_only, getBool, NULL, NULL, NULL}
}; };
#if 0
static void rereadDefaults(void)
{
/* must defer the update because accessing X data from a
* signal handler can mess up Xlib */
}
#endif
static void initDefaults() static void initDefaults()
{ {
unsigned int i; unsigned int i;
@@ -695,14 +682,6 @@ static void initDefaults()
else else
entry->plvalue = NULL; entry->plvalue = NULL;
} }
/*
wDomainName = WMCreatePLString(WMDOMAIN_NAME);
wAttributeDomainName = WMCreatePLString(WMATTRIBUTE_DOMAIN_NAME);
PLRegister(wDomainName, rereadDefaults);
PLRegister(wAttributeDomainName, rereadDefaults);
*/
} }
static WMPropList *readGlobalDomain(char *domainName, Bool requireDictionary) static WMPropList *readGlobalDomain(char *domainName, Bool requireDictionary)
@@ -2226,14 +2205,14 @@ static int parse_cursor(WScreen * scr, WMPropList * pl, Cursor * cursor)
} }
val = WMGetFromPLString(elem); val = WMGetFromPLString(elem);
if (0 == strcasecmp(val, "none")) { if (strcasecmp(val, "none") == 0) {
status = 1; status = 1;
*cursor = None; *cursor = None;
} else if (0 == strcasecmp(val, "builtin")) { } else if (strcasecmp(val, "builtin") == 0) {
int i; int i;
int cursor_id = CURSOR_ID_NONE; int cursor_id = CURSOR_ID_NONE;
if (2 != nelem) { if (nelem != 2) {
wwarning(_("bad number of arguments in cursor specification")); wwarning(_("bad number of arguments in cursor specification"));
return (status); return (status);
} }
@@ -2243,8 +2222,8 @@ static int parse_cursor(WScreen * scr, WMPropList * pl, Cursor * cursor)
} }
val = WMGetFromPLString(elem); val = WMGetFromPLString(elem);
for (i = 0; NULL != cursor_table[i].name; i++) { for (i = 0; cursor_table[i].name != NULL; i++) {
if (0 == strcasecmp(val, cursor_table[i].name)) { if (strcasecmp(val, cursor_table[i].name) == 0) {
cursor_id = cursor_table[i].id; cursor_id = cursor_table[i].id;
break; break;
} }
@@ -2255,7 +2234,7 @@ static int parse_cursor(WScreen * scr, WMPropList * pl, Cursor * cursor)
*cursor = XCreateFontCursor(dpy, cursor_id); *cursor = XCreateFontCursor(dpy, cursor_id);
status = 1; status = 1;
} }
} else if (0 == strcasecmp(val, "bitmap")) { } else if (strcasecmp(val, "bitmap") == 0) {
char *bitmap_name; char *bitmap_name;
char *mask_name; char *mask_name;
int bitmap_status; int bitmap_status;
@@ -2266,7 +2245,7 @@ static int parse_cursor(WScreen * scr, WMPropList * pl, Cursor * cursor)
int x, y; int x, y;
XColor fg, bg; XColor fg, bg;
if (3 != nelem) { if (nelem != 3) {
wwarning(_("bad number of arguments in cursor specification")); wwarning(_("bad number of arguments in cursor specification"));
return (status); return (status);
} }

View File

@@ -37,7 +37,7 @@ static int InterlacedJumps[] = { 8, 8, 4, 2 };
/* /*
* Partially based on code in gif2rgb from giflib, by Gershon Elber. * Partially based on code in gif2rgb from giflib, by Gershon Elber.
*/ */
RImage *RLoadGIF(RContext * context, char *file, int index) RImage *RLoadGIF(char *file, int index)
{ {
RImage *image = NULL; RImage *image = NULL;
unsigned char *cptr; unsigned char *cptr;

View File

@@ -89,7 +89,7 @@ static void my_error_exit(j_common_ptr cinfo)
longjmp(myerr->setjmp_buffer, 1); longjmp(myerr->setjmp_buffer, 1);
} }
RImage *RLoadJPEG(RContext * context, char *file_name, int index) RImage *RLoadJPEG(RContext * context, char *file_name)
{ {
RImage *image = NULL; RImage *image = NULL;
struct jpeg_decompress_struct cinfo; struct jpeg_decompress_struct cinfo;

View File

@@ -79,21 +79,21 @@ static RCachedImage *RImageCache;
static int identFile(char *path); static int identFile(char *path);
extern RImage *RLoadPPM(RContext * context, char *file_name, int index); extern RImage *RLoadPPM(char *file_name);
extern RImage *RLoadXPM(RContext * context, char *file, int index); extern RImage *RLoadXPM(RContext * context, char *file);
#ifdef USE_TIFF #ifdef USE_TIFF
extern RImage *RLoadTIFF(RContext * context, char *file, int index); extern RImage *RLoadTIFF(char *file, int index);
#endif #endif
#ifdef USE_PNG #ifdef USE_PNG
extern RImage *RLoadPNG(RContext * context, char *file, int index); extern RImage *RLoadPNG(RContext * context, char *file);
#endif #endif
#ifdef USE_JPEG #ifdef USE_JPEG
extern RImage *RLoadJPEG(RContext * context, char *file_name, int index); extern RImage *RLoadJPEG(RContext * context, char *file_name);
#endif #endif
#ifdef USE_GIF #ifdef USE_GIF
extern RImage *RLoadGIF(RContext * context, char *file_name, int index); extern RImage *RLoadGIF(char *file_name, int index);
#endif #endif
char **RSupportedFileFormats(void) char **RSupportedFileFormats(void)
@@ -188,35 +188,35 @@ RImage *RLoadImage(RContext * context, char *file, int index)
return NULL; return NULL;
case IM_XPM: case IM_XPM:
image = RLoadXPM(context, file, index); image = RLoadXPM(context, file);
break; break;
#ifdef USE_TIFF #ifdef USE_TIFF
case IM_TIFF: case IM_TIFF:
image = RLoadTIFF(context, file, index); image = RLoadTIFF(file, index);
break; break;
#endif /* USE_TIFF */ #endif /* USE_TIFF */
#ifdef USE_PNG #ifdef USE_PNG
case IM_PNG: case IM_PNG:
image = RLoadPNG(context, file, index); image = RLoadPNG(context, file);
break; break;
#endif /* USE_PNG */ #endif /* USE_PNG */
#ifdef USE_JPEG #ifdef USE_JPEG
case IM_JPEG: case IM_JPEG:
image = RLoadJPEG(context, file, index); image = RLoadJPEG(context, file);
break; break;
#endif /* USE_JPEG */ #endif /* USE_JPEG */
#ifdef USE_GIF #ifdef USE_GIF
case IM_GIF: case IM_GIF:
image = RLoadGIF(context, file, index); image = RLoadGIF(file, index);
break; break;
#endif /* USE_GIF */ #endif /* USE_GIF */
case IM_PPM: case IM_PPM:
image = RLoadPPM(context, file, index); image = RLoadPPM(file);
break; break;
default: default:

View File

@@ -226,7 +226,7 @@ RImage *RGetImageFromXPMData(RContext * context, char **data)
return NULL; return NULL;
} }
RImage *RLoadXPM(RContext * context, char *file, int index) RImage *RLoadXPM(RContext * context, char *file)
{ {
RImage *image = NULL; RImage *image = NULL;
char line[LINEWIDTH + 1]; char line[LINEWIDTH + 1];

View File

@@ -31,7 +31,7 @@
#include "wraster.h" #include "wraster.h"
RImage *RLoadPNG(RContext * context, char *file, int index) RImage *RLoadPNG(RContext * context, char *file)
{ {
char *tmp; char *tmp;
RImage *image = NULL; RImage *image = NULL;

View File

@@ -28,7 +28,7 @@
#include "wraster.h" #include "wraster.h"
static RImage *load_graymap(char *file_name, FILE * file, int w, int h, int max, int raw) static RImage *load_graymap(FILE * file, int w, int h, int max, int raw)
{ {
RImage *image; RImage *image;
@@ -74,7 +74,7 @@ static RImage *load_graymap(char *file_name, FILE * file, int w, int h, int max,
return NULL; return NULL;
} }
static RImage *load_pixmap(char *file_name, FILE * file, int w, int h, int max, int raw) static RImage *load_pixmap(FILE * file, int w, int h, int max, int raw)
{ {
RImage *image; RImage *image;
int i; int i;
@@ -111,7 +111,7 @@ static RImage *load_pixmap(char *file_name, FILE * file, int w, int h, int max,
return NULL; return NULL;
} }
RImage *RLoadPPM(RContext * context, char *file_name, int index) RImage *RLoadPPM(char *file_name)
{ {
FILE *file; FILE *file;
RImage *image = NULL; RImage *image = NULL;
@@ -156,9 +156,9 @@ RImage *RLoadPPM(RContext * context, char *file_name, int index)
goto bad_file; goto bad_file;
if (type == '5') if (type == '5')
image = load_graymap(file_name, file, w, h, m, type == '5'); image = load_graymap(file, w, h, m, type == '5');
else if (type == '6') else if (type == '6')
image = load_pixmap(file_name, file, w, h, m, type == '6'); image = load_pixmap(file, w, h, m, type == '6');
fclose(file); fclose(file);
return image; return image;

View File

@@ -292,7 +292,7 @@ void RCombineImagesWithOpaqueness(RImage * image, RImage * src, int opaqueness)
} }
int int
calculateCombineArea(RImage * des, RImage * src, int *sx, int *sy, calculateCombineArea(RImage * des, int *sx, int *sy,
unsigned int *swidth, unsigned int *sheight, int *dx, int *dy) unsigned int *swidth, unsigned int *sheight, int *dx, int *dy)
{ {
int width = (int)*swidth, height = (int)*sheight; int width = (int)*swidth, height = (int)*sheight;
@@ -333,7 +333,7 @@ void RCombineArea(RImage * image, RImage * src, int sx, int sy, unsigned width,
unsigned char *s; unsigned char *s;
int alpha, calpha; int alpha, calpha;
if (!calculateCombineArea(image, src, &sx, &sy, &width, &height, &dx, &dy)) if (!calculateCombineArea(image, &sx, &sy, &width, &height, &dx, &dy))
return; return;
if (!HAS_ALPHA(src)) { if (!HAS_ALPHA(src)) {
@@ -409,7 +409,7 @@ void RCopyArea(RImage * image, RImage * src, int sx, int sy, unsigned width, uns
unsigned char *d; unsigned char *d;
unsigned char *s; unsigned char *s;
if (!calculateCombineArea(image, src, &sx, &sy, &width, &height, &dx, &dy)) if (!calculateCombineArea(image, &sx, &sy, &width, &height, &dx, &dy))
return; return;
if (!HAS_ALPHA(src)) { if (!HAS_ALPHA(src)) {
@@ -487,7 +487,7 @@ RCombineAreaWithOpaqueness(RImage * image, RImage * src, int sx, int sy,
int dalpha = HAS_ALPHA(image); int dalpha = HAS_ALPHA(image);
int dch = (dalpha ? 4 : 3); int dch = (dalpha ? 4 : 3);
if (!calculateCombineArea(image, src, &sx, &sy, &width, &height, &dx, &dy)) if (!calculateCombineArea(image, &sx, &sy, &width, &height, &dx, &dy))
return; return;
d = image->data + (dy * image->width + dx) * dch; d = image->data + (dy * image->width + dx) * dch;

View File

@@ -32,7 +32,7 @@
#include "wraster.h" #include "wraster.h"
RImage *RLoadTIFF(RContext * context, char *file, int index) RImage *RLoadTIFF(char *file, int index)
{ {
RImage *image = NULL; RImage *image = NULL;
TIFF *tif; TIFF *tif;

View File

@@ -151,7 +151,7 @@ RImage *RGetImageFromXPMData(RContext * context, char **xpmData)
return image; return image;
} }
RImage *RLoadXPM(RContext * context, char *file, int index) RImage *RLoadXPM(RContext * context, char *file)
{ {
Display *dpy = context->dpy; Display *dpy = context->dpy;
Colormap cmap = context->cmap; Colormap cmap = context->cmap;