/*
 *  Window Maker window manager
 *
 *  Copyright (c) 1997-2003 Alfredo K. Kojima
 *
 *  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.
 */


#ifndef WMAPPLICATION_H_
#define WMAPPLICATION_H_

/* for tracking single application instances */
// This is now defined in application.rs.
typedef struct WApplication WApplication;

/******** Accessors/mutators ********/
Window wApplicationGetMainWindow(WApplication *wapp);

struct WWindow *wApplicationGetMainWindowDesc(WApplication *wapp);

WMenu *wApplicationGetMenu(WApplication *wapp);
void wApplicationSetMenu(WApplication *wapp, WMenu *menu);

struct WAppIcon *wApplicationGetAppIcon(WApplication *wapp);
void wApplicationSetAppIcon(WApplication *wapp, struct WAppIcon *icon);

int wApplicationGetLastWorkspace(WApplication *wapp);
void wApplicationSetLastWorkspace(WApplication *wapp, int workspace);

struct WWindow *wApplicationGetLastFocused(WApplication *wapp);
void wApplicationSetLastFocused(WApplication *wapp, struct WWindow *win);

WMHandlerID *wApplicationGetUrgentBounceTimer(WApplication *wapp);
int wApplicationHasUrgentBounceTimer(WApplication *wapp);
void wApplicationClearUrgentBounceTimer(WApplication *wapp);
void wApplicationSetUrgentBounceTimer(WApplication *wapp, WMHandlerID *timer);

int wApplicationGetSkipNextAnimation(WApplication *wapp);
void wApplicationSetSkipNextAnimation(WApplication *wapp, int skip);

int wApplicationIsHidden(WApplication *wapp);
void wApplicationSetHidden(WApplication *wapp, int hidden);

int wApplicationIsEmulated(WApplication *wapp);
void wApplicationSetEmulated(WApplication *wapp, int emulated);

int wApplicationIsBouncing(WApplication *wapp);
void wApplicationSetBouncing(WApplication *wapp, int bouncing);

/******** Lifecycle/resource management ********/
WApplication *wApplicationCreate(struct WWindow *wwin);
WApplication *wApplicationOf(Window window);
void wApplicationDestroy(WApplication *wapp);

void wApplicationIncrementRefcount(WApplication *wapp);
int wApplicationHasLiveRefcount(WApplication *wapp);
void wApplicationClearRefcount(WApplication *wapp);

void wAppBounce(WApplication *);
void wAppBounceWhileUrgent(WApplication *);
void wApplicationActivate(WApplication *);
void wApplicationDeactivate(WApplication *);
#endif
