mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
Random coding style cleanup in winspector.c
This commit is contained in:
@@ -162,11 +162,11 @@ static WMPropList *Yes, *No;
|
|||||||
#define PHEIGHT 360
|
#define PHEIGHT 360
|
||||||
|
|
||||||
static char *spec_text;
|
static char *spec_text;
|
||||||
static void applySettings(WMButton * button, InspectorPanel * panel);
|
static void applySettings(WMButton *button, InspectorPanel *panel);
|
||||||
|
|
||||||
#define UNDEFINED_POS 0xffffff
|
#define UNDEFINED_POS 0xffffff
|
||||||
|
|
||||||
static InspectorPanel *createInspectorForWindow(WWindow * wwin, int xpos, int ypos, Bool showSelectPanel);
|
static InspectorPanel *createInspectorForWindow(WWindow *wwin, int xpos, int ypos, Bool showSelectPanel);
|
||||||
|
|
||||||
static void make_keys(void)
|
static void make_keys(void)
|
||||||
{
|
{
|
||||||
@@ -212,20 +212,19 @@ static void make_keys(void)
|
|||||||
No = WMCreatePLString("No");
|
No = WMCreatePLString("No");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void freeInspector(InspectorPanel * panel)
|
static void freeInspector(InspectorPanel *panel)
|
||||||
{
|
{
|
||||||
panel->destroyed = 1;
|
panel->destroyed = 1;
|
||||||
|
|
||||||
if (panel->choosingIcon)
|
if (panel->choosingIcon)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WMDestroyWidget(panel->win);
|
WMDestroyWidget(panel->win);
|
||||||
|
|
||||||
XDestroyWindow(dpy, panel->parent);
|
XDestroyWindow(dpy, panel->parent);
|
||||||
|
|
||||||
wfree(panel);
|
wfree(panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void destroyInspector(WCoreWindow * foo, void *data, XEvent * event)
|
static void destroyInspector(WCoreWindow *foo, void *data, XEvent *event)
|
||||||
{
|
{
|
||||||
InspectorPanel *panel;
|
InspectorPanel *panel;
|
||||||
InspectorPanel *tmp;
|
InspectorPanel *tmp;
|
||||||
@@ -271,7 +270,7 @@ void wDestroyInspectorPanels(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void changePage(WMPopUpButton * bPtr, InspectorPanel * panel)
|
static void changePage(WMPopUpButton *bPtr, InspectorPanel *panel)
|
||||||
{
|
{
|
||||||
int page;
|
int page;
|
||||||
|
|
||||||
@@ -311,7 +310,7 @@ static void changePage(WMPopUpButton * bPtr, InspectorPanel * panel)
|
|||||||
#define UPDATE_TEXT_FIELD 2
|
#define UPDATE_TEXT_FIELD 2
|
||||||
#define REVERT_TO_DEFAULT 4
|
#define REVERT_TO_DEFAULT 4
|
||||||
|
|
||||||
static int showIconFor(WMScreen * scrPtr, InspectorPanel * panel, char *wm_instance, char *wm_class, int flags)
|
static int showIconFor(WMScreen *scrPtr, InspectorPanel *panel, char *wm_instance, char *wm_class, int flags)
|
||||||
{
|
{
|
||||||
WMPixmap *pixmap = (WMPixmap *) NULL;
|
WMPixmap *pixmap = (WMPixmap *) NULL;
|
||||||
char *file = NULL, *path = NULL;
|
char *file = NULL, *path = NULL;
|
||||||
@@ -385,7 +384,7 @@ static void updateIcon(WMButton * button, InspectorPanel * panel)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int getBool(WMPropList * value)
|
static int getBool(WMPropList *value)
|
||||||
{
|
{
|
||||||
char *val;
|
char *val;
|
||||||
|
|
||||||
@@ -424,7 +423,7 @@ static int getBool(WMPropList * value)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
insertAttribute(WMPropList * dict, WMPropList * window, WMPropList * attr, WMPropList * value, int flags)
|
insertAttribute(WMPropList *dict, WMPropList *window, WMPropList *attr, WMPropList *value, int flags)
|
||||||
{
|
{
|
||||||
WMPropList *def_win, *def_value = NULL;
|
WMPropList *def_win, *def_value = NULL;
|
||||||
int update = 0;
|
int update = 0;
|
||||||
@@ -456,7 +455,7 @@ insertAttribute(WMPropList * dict, WMPropList * window, WMPropList * attr, WMPro
|
|||||||
return modified;
|
return modified;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void saveSettings(WMButton * button, InspectorPanel * panel)
|
static void saveSettings(WMButton *button, InspectorPanel *panel)
|
||||||
{
|
{
|
||||||
WWindow *wwin = panel->inspected;
|
WWindow *wwin = panel->inspected;
|
||||||
WDDomain *db = WDWindowAttributes;
|
WDDomain *db = WDWindowAttributes;
|
||||||
@@ -673,7 +672,7 @@ static void saveSettings(WMButton * button, InspectorPanel * panel)
|
|||||||
WMPLSetCaseSensitive(False);
|
WMPLSetCaseSensitive(False);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void applySettings(WMButton * button, InspectorPanel * panel)
|
static void applySettings(WMButton *button, InspectorPanel *panel)
|
||||||
{
|
{
|
||||||
WWindow *wwin = panel->inspected;
|
WWindow *wwin = panel->inspected;
|
||||||
WApplication *wapp = wApplicationOf(wwin->main_window);
|
WApplication *wapp = wApplicationOf(wwin->main_window);
|
||||||
@@ -795,7 +794,7 @@ static void applySettings(WMButton * button, InspectorPanel * panel)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void revertSettings(WMButton * button, InspectorPanel * panel)
|
static void revertSettings(WMButton *button, InspectorPanel *panel)
|
||||||
{
|
{
|
||||||
WWindow *wwin = panel->inspected;
|
WWindow *wwin = panel->inspected;
|
||||||
WApplication *wapp = wApplicationOf(wwin->main_window);
|
WApplication *wapp = wApplicationOf(wwin->main_window);
|
||||||
@@ -904,7 +903,7 @@ static void revertSettings(WMButton * button, InspectorPanel * panel)
|
|||||||
WMSetButtonSelected(panel->moreChk[i], flag);
|
WMSetButtonSelected(panel->moreChk[i], flag);
|
||||||
}
|
}
|
||||||
if (panel->appFrm && wapp) {
|
if (panel->appFrm && wapp) {
|
||||||
for (i = 0; i < (sizeof(panel->appChk) / sizeof(panel->appChk[0])); i++) {
|
for (i = 0; i < (sizeof(panel->appChk) / sizeof(panel->appChk[0])); i++) {
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
|
|
||||||
switch (i) {
|
switch (i) {
|
||||||
@@ -939,7 +938,7 @@ static void revertSettings(WMButton * button, InspectorPanel * panel)
|
|||||||
applySettings(panel->applyBtn, panel);
|
applySettings(panel->applyBtn, panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void chooseIconCallback(WMWidget * self, void *clientData)
|
static void chooseIconCallback(WMWidget *self, void *clientData)
|
||||||
{
|
{
|
||||||
char *file;
|
char *file;
|
||||||
InspectorPanel *panel = (InspectorPanel *) clientData;
|
InspectorPanel *panel = (InspectorPanel *) clientData;
|
||||||
@@ -966,7 +965,7 @@ static void chooseIconCallback(WMWidget * self, void *clientData)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void textEditedObserver(void *observerData, WMNotification * notification)
|
static void textEditedObserver(void *observerData, WMNotification *notification)
|
||||||
{
|
{
|
||||||
InspectorPanel *panel = (InspectorPanel *) observerData;
|
InspectorPanel *panel = (InspectorPanel *) observerData;
|
||||||
|
|
||||||
@@ -979,7 +978,7 @@ static void textEditedObserver(void *observerData, WMNotification * notification
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
static void selectSpecification(WMWidget * bPtr, void *data)
|
static void selectSpecification(WMWidget *bPtr, void *data)
|
||||||
{
|
{
|
||||||
InspectorPanel *panel = (InspectorPanel *) data;
|
InspectorPanel *panel = (InspectorPanel *) data;
|
||||||
char *str;
|
char *str;
|
||||||
@@ -1004,7 +1003,7 @@ static void selectSpecification(WMWidget * bPtr, void *data)
|
|||||||
wfree(str);
|
wfree(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void selectWindow(WMWidget * bPtr, void *data)
|
static void selectWindow(WMWidget *bPtr, void *data)
|
||||||
{
|
{
|
||||||
InspectorPanel *panel = (InspectorPanel *) data;
|
InspectorPanel *panel = (InspectorPanel *) data;
|
||||||
WWindow *wwin = panel->inspected;
|
WWindow *wwin = panel->inspected;
|
||||||
@@ -1038,7 +1037,7 @@ static void selectWindow(WMWidget * bPtr, void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static InspectorPanel *createInspectorForWindow(WWindow * wwin, int xpos, int ypos, Bool showSelectPanel)
|
static InspectorPanel *createInspectorForWindow(WWindow *wwin, int xpos, int ypos, Bool showSelectPanel)
|
||||||
{
|
{
|
||||||
WScreen *scr = wwin->screen_ptr;
|
WScreen *scr = wwin->screen_ptr;
|
||||||
InspectorPanel *panel;
|
InspectorPanel *panel;
|
||||||
@@ -1180,7 +1179,7 @@ static InspectorPanel *createInspectorForWindow(WWindow * wwin, int xpos, int yp
|
|||||||
|
|
||||||
WMSetLabelTextAlignment(panel->specLbl, WALeft);
|
WMSetLabelTextAlignment(panel->specLbl, WALeft);
|
||||||
|
|
||||||
/**** attributes ****/
|
/**** attributes ****/
|
||||||
panel->attrFrm = WMCreateFrame(panel->win);
|
panel->attrFrm = WMCreateFrame(panel->win);
|
||||||
WMSetFrameTitle(panel->attrFrm, _("Attributes"));
|
WMSetFrameTitle(panel->attrFrm, _("Attributes"));
|
||||||
WMMoveWidget(panel->attrFrm, 15, 45);
|
WMMoveWidget(panel->attrFrm, 15, 45);
|
||||||
@@ -1262,7 +1261,7 @@ static InspectorPanel *createInspectorForWindow(WWindow * wwin, int xpos, int yp
|
|||||||
WMSetBalloonTextForView(descr, WMWidgetView(panel->attrChk[i]));
|
WMSetBalloonTextForView(descr, WMWidgetView(panel->attrChk[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**** more attributes ****/
|
/**** more attributes ****/
|
||||||
panel->moreFrm = WMCreateFrame(panel->win);
|
panel->moreFrm = WMCreateFrame(panel->win);
|
||||||
WMSetFrameTitle(panel->moreFrm, _("Advanced"));
|
WMSetFrameTitle(panel->moreFrm, _("Advanced"));
|
||||||
WMMoveWidget(panel->moreFrm, 15, 45);
|
WMMoveWidget(panel->moreFrm, 15, 45);
|
||||||
@@ -1414,16 +1413,15 @@ static InspectorPanel *createInspectorForWindow(WWindow * wwin, int xpos, int yp
|
|||||||
WMMoveWidget(panel->wsP, 20, 30);
|
WMMoveWidget(panel->wsP, 20, 30);
|
||||||
WMResizeWidget(panel->wsP, PWIDTH - (2 * 15) - (2 * 20), 20);
|
WMResizeWidget(panel->wsP, PWIDTH - (2 * 15) - (2 * 20), 20);
|
||||||
WMAddPopUpButtonItem(panel->wsP, _("Nowhere in particular"));
|
WMAddPopUpButtonItem(panel->wsP, _("Nowhere in particular"));
|
||||||
for (i = 0; i < wwin->screen_ptr->workspace_count; i++) {
|
|
||||||
|
for (i = 0; i < wwin->screen_ptr->workspace_count; i++)
|
||||||
WMAddPopUpButtonItem(panel->wsP, scr->workspaces[i]->name);
|
WMAddPopUpButtonItem(panel->wsP, scr->workspaces[i]->name);
|
||||||
}
|
|
||||||
|
|
||||||
i = wDefaultGetStartWorkspace(wwin->screen_ptr, wwin->wm_instance, wwin->wm_class);
|
i = wDefaultGetStartWorkspace(wwin->screen_ptr, wwin->wm_instance, wwin->wm_class);
|
||||||
if (i >= 0 && i <= wwin->screen_ptr->workspace_count) {
|
if (i >= 0 && i <= wwin->screen_ptr->workspace_count)
|
||||||
WMSetPopUpButtonSelectedItem(panel->wsP, i + 1);
|
WMSetPopUpButtonSelectedItem(panel->wsP, i + 1);
|
||||||
} else {
|
else
|
||||||
WMSetPopUpButtonSelectedItem(panel->wsP, 0);
|
WMSetPopUpButtonSelectedItem(panel->wsP, 0);
|
||||||
}
|
|
||||||
|
|
||||||
/* application wide attributes */
|
/* application wide attributes */
|
||||||
if (wwin->main_window != None) {
|
if (wwin->main_window != None) {
|
||||||
@@ -1465,7 +1463,6 @@ static InspectorPanel *createInspectorForWindow(WWindow * wwin, int xpos, int yp
|
|||||||
WMResizeWidget(panel->appChk[i], 205, 20);
|
WMResizeWidget(panel->appChk[i], 205, 20);
|
||||||
WMSetButtonSelected(panel->appChk[i], flag);
|
WMSetButtonSelected(panel->appChk[i], flag);
|
||||||
WMSetButtonText(panel->appChk[i], caption);
|
WMSetButtonText(panel->appChk[i], caption);
|
||||||
|
|
||||||
WMSetBalloonTextForView(descr, WMWidgetView(panel->appChk[i]));
|
WMSetBalloonTextForView(descr, WMWidgetView(panel->appChk[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1566,7 +1563,7 @@ static InspectorPanel *createInspectorForWindow(WWindow * wwin, int xpos, int yp
|
|||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wShowInspectorForWindow(WWindow * wwin)
|
void wShowInspectorForWindow(WWindow *wwin)
|
||||||
{
|
{
|
||||||
if (wwin->flags.inspector_open)
|
if (wwin->flags.inspector_open)
|
||||||
return;
|
return;
|
||||||
@@ -1578,7 +1575,7 @@ void wShowInspectorForWindow(WWindow * wwin)
|
|||||||
wwin->inspector = createInspectorForWindow(wwin, UNDEFINED_POS, UNDEFINED_POS, False);
|
wwin->inspector = createInspectorForWindow(wwin, UNDEFINED_POS, UNDEFINED_POS, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wHideInspectorForWindow(WWindow * wwin)
|
void wHideInspectorForWindow(WWindow *wwin)
|
||||||
{
|
{
|
||||||
WWindow *pwin = wwin->inspector->frame;
|
WWindow *pwin = wwin->inspector->frame;
|
||||||
|
|
||||||
@@ -1588,7 +1585,7 @@ void wHideInspectorForWindow(WWindow * wwin)
|
|||||||
wClientSetState(pwin, IconicState, None);
|
wClientSetState(pwin, IconicState, None);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wUnhideInspectorForWindow(WWindow * wwin)
|
void wUnhideInspectorForWindow(WWindow *wwin)
|
||||||
{
|
{
|
||||||
WWindow *pwin = wwin->inspector->frame;
|
WWindow *pwin = wwin->inspector->frame;
|
||||||
|
|
||||||
@@ -1599,7 +1596,7 @@ void wUnhideInspectorForWindow(WWindow * wwin)
|
|||||||
wClientSetState(pwin, NormalState, None);
|
wClientSetState(pwin, NormalState, None);
|
||||||
}
|
}
|
||||||
|
|
||||||
WWindow *wGetWindowOfInspectorForWindow(WWindow * wwin)
|
WWindow *wGetWindowOfInspectorForWindow(WWindow *wwin)
|
||||||
{
|
{
|
||||||
if (wwin->inspector) {
|
if (wwin->inspector) {
|
||||||
assert(wwin->flags.inspector_open != 0);
|
assert(wwin->flags.inspector_open != 0);
|
||||||
@@ -1609,7 +1606,7 @@ WWindow *wGetWindowOfInspectorForWindow(WWindow * wwin)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wCloseInspectorForWindow(WWindow * wwin)
|
void wCloseInspectorForWindow(WWindow *wwin)
|
||||||
{
|
{
|
||||||
WWindow *pwin = wwin->inspector->frame; /* the inspector window */
|
WWindow *pwin = wwin->inspector->frame; /* the inspector window */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user