Files
wmaker/src/application.c
T
trurl 0e7f125494 Move WApplication definition and remaining methods into a separate file.
This should provide a more solid interface boundary for a WApplication
replacement written in Rust.
2025-09-03 20:55:12 -04:00

68 lines
1.9 KiB
C

/*
* Window Maker window manager
*
* Copyright (c) 1997-2003 Alfredo K. Kojima
* Copyright (c) 1998-2003 Dan Pascu
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "wconfig.h"
#include <X11/Xlib.h>
#include <string.h>
#include "WindowMaker.h"
#include "menu.h"
#include "window.h"
#ifdef USER_MENU
#include "usermenu.h"
#endif /* USER_MENU */
#include "appicon.h"
#include "application.h"
#include "appmenu.h"
#include "properties.h"
#include "workspace.h"
#include "dock.h"
#include "defaults.h"
/******** Local variables ********/
WApplication *wApplicationOf(Window window)
{
WApplication *wapp;
if (window == None)
return NULL;
if (XFindContext(dpy, window, w_global.context.app_win, (XPointer *) & wapp) != XCSUCCESS)
return NULL;
return wapp;
}
void wApplicationActivate(WApplication *wapp)
{
if (wApplicationGetAppIcon(wapp)) {
wIconSetHighlited(wAppIconGetIcon(wApplicationGetAppIcon(wapp)), True);
wAppIconPaint(wApplicationGetAppIcon(wapp));
}
}
void wApplicationDeactivate(WApplication *wapp)
{
if (wApplicationGetAppIcon(wapp)) {
wIconSetHighlited(wAppIconGetIcon(wApplicationGetAppIcon(wapp)), False);
wAppIconPaint(wApplicationGetAppIcon(wapp));
}
}