mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 21:08:08 +01:00
WindowMaker: appicon.h clean code
Changes to appicon.h: - Spaces replaced by tabs in the struct - Removed unused variables: - client_machine, never assigned - gnustep_app, never used - Functions sort by return type Then, in dock.c, the block with client_machine is never true, then can be removed. The host variable then is never used.
This commit is contained in:
committed by
Carlos R. Mafra
parent
b3afad67ff
commit
afe2e5d9d6
@@ -29,44 +29,33 @@
|
|||||||
#include "icon.h"
|
#include "icon.h"
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
|
|
||||||
|
|
||||||
typedef struct WAppIcon {
|
typedef struct WAppIcon {
|
||||||
short xindex;
|
short xindex;
|
||||||
short yindex;
|
short yindex;
|
||||||
struct WAppIcon *next;
|
struct WAppIcon *next;
|
||||||
struct WAppIcon *prev;
|
struct WAppIcon *prev;
|
||||||
WIcon *icon;
|
WIcon *icon;
|
||||||
|
|
||||||
char *client_machine;
|
|
||||||
|
|
||||||
int x_pos, y_pos; /* absolute screen coordinate */
|
int x_pos, y_pos; /* absolute screen coordinate */
|
||||||
|
|
||||||
char *command; /* command used to launch app */
|
char *command; /* command used to launch app */
|
||||||
|
|
||||||
#ifdef XDND
|
#ifdef XDND
|
||||||
char *dnd_command; /* command to use when something is */
|
char *dnd_command; /* command to use when something is */
|
||||||
/* dropped on us */
|
/* dropped on us */
|
||||||
#endif
|
#endif
|
||||||
|
char *paste_command; /* command to run when
|
||||||
char *paste_command; /* command to run when something is pasted */
|
* something is pasted */
|
||||||
|
|
||||||
char *wm_class;
|
char *wm_class;
|
||||||
char *wm_instance;
|
char *wm_instance;
|
||||||
pid_t pid; /* for apps launched from the dock */
|
pid_t pid; /* for apps launched from the dock */
|
||||||
Window main_window;
|
Window main_window;
|
||||||
|
|
||||||
struct WDock *dock; /* In which dock is docked. */
|
struct WDock *dock; /* In which dock is docked. */
|
||||||
|
|
||||||
struct _AppSettingsPanel *panel; /* Settings Panel */
|
struct _AppSettingsPanel *panel; /* Settings Panel */
|
||||||
|
|
||||||
unsigned int gnustep_app:1; /* if this is a GNUstep application */
|
|
||||||
unsigned int docked:1;
|
unsigned int docked:1;
|
||||||
unsigned int omnipresent:1; /* If omnipresent when docked in clip */
|
unsigned int omnipresent:1; /* If omnipresent when
|
||||||
|
* docked in clip */
|
||||||
unsigned int attracted:1; /* If it was attracted by the clip */
|
unsigned int attracted:1; /* If it was attracted by the clip */
|
||||||
unsigned int launching:1;
|
unsigned int launching:1;
|
||||||
unsigned int running:1; /* application is already running */
|
unsigned int running:1; /* application is already running */
|
||||||
unsigned int relaunching:1; /* launching 2nd instance */
|
unsigned int relaunching:1; /* launching 2nd instance */
|
||||||
|
|
||||||
unsigned int forced_dock:1;
|
unsigned int forced_dock:1;
|
||||||
unsigned int auto_launch:1; /* launch app on startup */
|
unsigned int auto_launch:1; /* launch app on startup */
|
||||||
unsigned int remote_start:1;
|
unsigned int remote_start:1;
|
||||||
@@ -77,25 +66,16 @@ typedef struct WAppIcon {
|
|||||||
unsigned int destroyed:1; /* appicon was destroyed */
|
unsigned int destroyed:1; /* appicon was destroyed */
|
||||||
unsigned int buggy_app:1; /* do not make dock rely on hints
|
unsigned int buggy_app:1; /* do not make dock rely on hints
|
||||||
* set by app */
|
* set by app */
|
||||||
|
|
||||||
unsigned int lock:1; /* do not allow to be destroyed */
|
unsigned int lock:1; /* do not allow to be destroyed */
|
||||||
|
|
||||||
} WAppIcon;
|
} WAppIcon;
|
||||||
|
|
||||||
|
|
||||||
WAppIcon *wAppIconCreate(WWindow *leader_win);
|
WAppIcon *wAppIconCreate(WWindow *leader_win);
|
||||||
WAppIcon * wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance,
|
WAppIcon * wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance,
|
||||||
char *wm_class, int tile);
|
char *wm_class, int tile);
|
||||||
|
|
||||||
void wAppIconDestroy(WAppIcon *aicon);
|
void wAppIconDestroy(WAppIcon *aicon);
|
||||||
|
|
||||||
void wAppIconPaint(WAppIcon *aicon);
|
void wAppIconPaint(WAppIcon *aicon);
|
||||||
|
|
||||||
Bool wAppIconChangeImage(WAppIcon *icon, char *file);
|
|
||||||
|
|
||||||
void wAppIconMove(WAppIcon *aicon, int x, int y);
|
void wAppIconMove(WAppIcon *aicon, int x, int y);
|
||||||
|
Bool wAppIconChangeImage(WAppIcon *icon, char *file);
|
||||||
Bool wAppIconSave(WAppIcon *aicon);
|
Bool wAppIconSave(WAppIcon *aicon);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1183,7 +1183,7 @@ static void dockIconPaint(WAppIcon *btn)
|
|||||||
static WMPropList *make_icon_state(WAppIcon *btn)
|
static WMPropList *make_icon_state(WAppIcon *btn)
|
||||||
{
|
{
|
||||||
WMPropList *node = NULL;
|
WMPropList *node = NULL;
|
||||||
WMPropList *command, *autolaunch, *lock, *name, *forced, *host;
|
WMPropList *command, *autolaunch, *lock, *name, *forced;
|
||||||
WMPropList *position, *buggy, *omnipresent;
|
WMPropList *position, *buggy, *omnipresent;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
char buffer[64];
|
char buffer[64];
|
||||||
@@ -1240,12 +1240,6 @@ static WMPropList *make_icon_state(WAppIcon *btn)
|
|||||||
WMPutInPLDictionary(node, dPasteCommand, command);
|
WMPutInPLDictionary(node, dPasteCommand, command);
|
||||||
WMReleasePropList(command);
|
WMReleasePropList(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (btn->client_machine && btn->remote_start) {
|
|
||||||
host = WMCreatePLString(btn->client_machine);
|
|
||||||
WMPutInPLDictionary(node, dHost, host);
|
|
||||||
WMReleasePropList(host);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
|
|||||||
Reference in New Issue
Block a user