mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 04:20:27 +01:00
Fixed some bugs, and compilation warnings.
This commit is contained in:
@@ -20,17 +20,17 @@
|
|||||||
|
|
||||||
|
|
||||||
typedef struct W_Array {
|
typedef struct W_Array {
|
||||||
void **items; /* the array data */
|
void **items; /* the array data */
|
||||||
int itemCount; /* # of items in array */
|
int itemCount; /* # of items in array */
|
||||||
int allocSize; /* allocated size of array */
|
int allocSize; /* allocated size of array */
|
||||||
void (*destructor)(void *item); /* the destructor to free elements */
|
WMFreeDataProc *destructor; /* the destructor to free elements */
|
||||||
} W_Array;
|
} W_Array;
|
||||||
|
|
||||||
|
|
||||||
WMArray*
|
WMArray*
|
||||||
WMCreateArray(int initialSize)
|
WMCreateArray(int initialSize)
|
||||||
{
|
{
|
||||||
WMCreateArrayWithDestructor(initialSize, NULL);
|
return WMCreateArrayWithDestructor(initialSize, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ WMCreateTreeBag(void)
|
|||||||
|
|
||||||
|
|
||||||
WMBag*
|
WMBag*
|
||||||
WMCreateTreeBagWithDestructor(void (*destructor)(void*))
|
WMCreateTreeBagWithDestructor(WMFreeDataProc *destructor)
|
||||||
{
|
{
|
||||||
WMBag *bag;
|
WMBag *bag;
|
||||||
|
|
||||||
@@ -752,7 +752,7 @@ WMMapBag(WMBag *self, void (*function)(void*, void*), void *data)
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
findInTree(W_Bag *tree, W_Node *node, int (*function)(void*,void*), void *cdata)
|
findInTree(W_Bag *tree, W_Node *node, WMMatchDataProc *function, void *cdata)
|
||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
@@ -772,7 +772,7 @@ findInTree(W_Bag *tree, W_Node *node, int (*function)(void*,void*), void *cdata)
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
WMFindInBag(WMBag *self, int (*match)(void*,void*), void *cdata)
|
WMFindInBag(WMBag *self, WMMatchDataProc *match, void *cdata)
|
||||||
{
|
{
|
||||||
return findInTree(self, self->root, match, cdata);
|
return findInTree(self, self->root, match, cdata);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,11 +32,9 @@ changeFontProp(char *fname, char *newprop, int which)
|
|||||||
WMFont *
|
WMFont *
|
||||||
WMGetFontPlain(WMScreen *scrPtr, WMFont *font)
|
WMGetFontPlain(WMScreen *scrPtr, WMFont *font)
|
||||||
{
|
{
|
||||||
WMFont *nfont=NULL;
|
if(!scrPtr || !font)
|
||||||
if(!scrPtr|| !font)
|
return NULL;
|
||||||
return NULL;
|
return font;
|
||||||
return font;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WMFont *
|
WMFont *
|
||||||
@@ -72,10 +70,9 @@ WMGetFontItalic(WMScreen *scrPtr, WMFont *font)
|
|||||||
WMFont *
|
WMFont *
|
||||||
WMGetFontOfSize(WMScreen *scrPtr, WMFont *font, int size)
|
WMGetFontOfSize(WMScreen *scrPtr, WMFont *font, int size)
|
||||||
{
|
{
|
||||||
WMFont *nfont=NULL;
|
if(!scrPtr || !font || size<1)
|
||||||
if(!scrPtr || !font || size<1)
|
return NULL;
|
||||||
return NULL;
|
return font;
|
||||||
return font;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2158,7 +2158,7 @@ wheelRender(W_ColorPanel *panel)
|
|||||||
unsigned char *ptr;
|
unsigned char *ptr;
|
||||||
RColor gray;
|
RColor gray;
|
||||||
unsigned long ofs = 0;
|
unsigned long ofs = 0;
|
||||||
unsigned char shift = getShift(sizeof(unsigned char));
|
/*unsigned char shift = getShift(sizeof(unsigned char));*/
|
||||||
|
|
||||||
image = RCreateImage(colorWheelSize+4, colorWheelSize+4, True);
|
image = RCreateImage(colorWheelSize+4, colorWheelSize+4, True);
|
||||||
if (!image) {
|
if (!image) {
|
||||||
|
|||||||
@@ -270,7 +270,6 @@ void
|
|||||||
WMClearList(WMList *lPtr)
|
WMClearList(WMList *lPtr)
|
||||||
{
|
{
|
||||||
int oldSelected = lPtr->selectedItem;
|
int oldSelected = lPtr->selectedItem;
|
||||||
int i;
|
|
||||||
|
|
||||||
WMEmptyArray(lPtr->items);
|
WMEmptyArray(lPtr->items);
|
||||||
|
|
||||||
|
|||||||
@@ -223,8 +223,6 @@ static void drawRulerOnPixmap(Ruler * rPtr)
|
|||||||
|
|
||||||
static void paintRuler(Ruler * rPtr)
|
static void paintRuler(Ruler * rPtr)
|
||||||
{
|
{
|
||||||
WMScreen *screen = rPtr->view->screen;
|
|
||||||
|
|
||||||
if (!rPtr->drawBuffer || !rPtr->view->flags.realized)
|
if (!rPtr->drawBuffer || !rPtr->view->flags.realized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -337,7 +335,6 @@ static void rulerDidResize(W_ViewDelegate * self, WMView * view)
|
|||||||
static void handleEvents(XEvent * event, void *data)
|
static void handleEvents(XEvent * event, void *data)
|
||||||
{
|
{
|
||||||
Ruler *rPtr = (Ruler *) data;
|
Ruler *rPtr = (Ruler *) data;
|
||||||
Display *dpy = event->xany.display;
|
|
||||||
|
|
||||||
switch (event->type) {
|
switch (event->type) {
|
||||||
case Expose:
|
case Expose:
|
||||||
@@ -487,6 +484,7 @@ void WMSetRulerMargins(WMRuler * rPtr, WMRulerMargins margins)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WMRulerMargins *
|
WMRulerMargins *
|
||||||
WMGetRulerMargins(WMRuler * rPtr)
|
WMGetRulerMargins(WMRuler * rPtr)
|
||||||
{
|
{
|
||||||
@@ -505,8 +503,10 @@ WMGetRulerMargins(WMRuler * rPtr)
|
|||||||
/*for */
|
/*for */
|
||||||
margins->tabs = rPtr->margins.tabs;
|
margins->tabs = rPtr->margins.tabs;
|
||||||
|
|
||||||
|
return margins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin)
|
WMIsMarginEqualToMargin(WMRulerMargins *aMargin, WMRulerMargins *anotherMargin)
|
||||||
{
|
{
|
||||||
@@ -541,7 +541,7 @@ void WMSetRulerOffset(WMRuler * rPtr, int pixels)
|
|||||||
int WMGetRulerOffset(WMRuler * rPtr)
|
int WMGetRulerOffset(WMRuler * rPtr)
|
||||||
{
|
{
|
||||||
if (!rPtr)
|
if (!rPtr)
|
||||||
return;
|
return 0; /* what value should return if no ruler? -1 or 0? */
|
||||||
return rPtr->offset;
|
return rPtr->offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1902,16 +1902,15 @@ handleTextKeyPress(Text *tPtr, XEvent *event)
|
|||||||
if (((XKeyEvent *) event)->state & ControlMask)
|
if (((XKeyEvent *) event)->state & ControlMask)
|
||||||
control_pressed = True;
|
control_pressed = True;
|
||||||
buffer[XLookupString(&event->xkey, buffer, 1, &ksym, NULL)] = 0;
|
buffer[XLookupString(&event->xkey, buffer, 1, &ksym, NULL)] = 0;
|
||||||
|
|
||||||
switch(ksym) {
|
switch(ksym) {
|
||||||
|
|
||||||
case XK_Right:
|
case XK_Right:
|
||||||
WMScrollText(tPtr, -14);
|
WMScrollText(tPtr, -14);
|
||||||
case XK_Left: {
|
case XK_Left: {
|
||||||
TextBlock *tb = tPtr->currentTextBlock;
|
//TextBlock *tb = tPtr->currentTextBlock;
|
||||||
int x = tPtr->cursor.x + tPtr->visible.x;
|
//int x = tPtr->cursor.x + tPtr->visible.x;
|
||||||
int y = tPtr->visible.y + tPtr->cursor.y + tPtr->cursor.h;
|
//int y = tPtr->visible.y + tPtr->cursor.y + tPtr->cursor.h;
|
||||||
int w, pos;
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if(!tb)
|
if(!tb)
|
||||||
@@ -1931,7 +1930,7 @@ WMScrollText(tPtr, -14);
|
|||||||
3 + tPtr->visible.y + tPtr->cursor.y
|
3 + tPtr->visible.y + tPtr->cursor.y
|
||||||
+ tPtr->cursor.h - tPtr->vpos);
|
+ tPtr->cursor.h - tPtr->vpos);
|
||||||
if(x == tPtr->cursor.x + tPtr->visible.x) {
|
if(x == tPtr->cursor.x + tPtr->visible.x) {
|
||||||
printf("same %d %d\n", x, tPtr->cursor.x + tPtr->visible.x);
|
printf("same %d %d\n", x, tPtr->cursor.x + tPtr->visible.x);
|
||||||
cursorToTextPosition(tPtr, tPtr->visible.x,
|
cursorToTextPosition(tPtr, tPtr->visible.x,
|
||||||
3 + tPtr->visible.y + tPtr->cursor.y + tPtr->cursor.h);
|
3 + tPtr->visible.y + tPtr->cursor.y + tPtr->cursor.h);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1798,7 +1798,7 @@ createPanel(Panel *p)
|
|||||||
WMSetButtonImagePosition(panel->newB, WIPAbove);
|
WMSetButtonImagePosition(panel->newB, WIPAbove);
|
||||||
WMSetButtonText(panel->newB, _("New"));
|
WMSetButtonText(panel->newB, _("New"));
|
||||||
WMSetButtonAction(panel->newB, newTexture, panel);
|
WMSetButtonAction(panel->newB, newTexture, panel);
|
||||||
SetButtonAlphaImage(scr, panel->newB, TNEW_FILE);
|
SetButtonAlphaImage(scr, panel->newB, TNEW_FILE, NULL, NULL);
|
||||||
|
|
||||||
WMSetBalloonTextForView(_("Create a new texture."),
|
WMSetBalloonTextForView(_("Create a new texture."),
|
||||||
WMWidgetView(panel->newB));
|
WMWidgetView(panel->newB));
|
||||||
@@ -1810,7 +1810,7 @@ createPanel(Panel *p)
|
|||||||
WMSetButtonImagePosition(panel->ripB, WIPAbove);
|
WMSetButtonImagePosition(panel->ripB, WIPAbove);
|
||||||
WMSetButtonText(panel->ripB, _("Extract..."));
|
WMSetButtonText(panel->ripB, _("Extract..."));
|
||||||
WMSetButtonAction(panel->ripB, extractTexture, panel);
|
WMSetButtonAction(panel->ripB, extractTexture, panel);
|
||||||
SetButtonAlphaImage(scr, panel->ripB, TEXTR_FILE);
|
SetButtonAlphaImage(scr, panel->ripB, TEXTR_FILE, NULL, NULL);
|
||||||
|
|
||||||
WMSetBalloonTextForView(_("Extract texture(s) from a theme or a style file."),
|
WMSetBalloonTextForView(_("Extract texture(s) from a theme or a style file."),
|
||||||
WMWidgetView(panel->ripB));
|
WMWidgetView(panel->ripB));
|
||||||
@@ -1823,7 +1823,7 @@ createPanel(Panel *p)
|
|||||||
WMSetButtonFont(panel->editB, font);
|
WMSetButtonFont(panel->editB, font);
|
||||||
WMSetButtonImagePosition(panel->editB, WIPAbove);
|
WMSetButtonImagePosition(panel->editB, WIPAbove);
|
||||||
WMSetButtonText(panel->editB, _("Edit"));
|
WMSetButtonText(panel->editB, _("Edit"));
|
||||||
SetButtonAlphaImage(scr, panel->editB, TEDIT_FILE);
|
SetButtonAlphaImage(scr, panel->editB, TEDIT_FILE, NULL, NULL);
|
||||||
WMSetButtonAction(panel->editB, editTexture, panel);
|
WMSetButtonAction(panel->editB, editTexture, panel);
|
||||||
WMSetBalloonTextForView(_("Edit the highlighted texture."),
|
WMSetBalloonTextForView(_("Edit the highlighted texture."),
|
||||||
WMWidgetView(panel->editB));
|
WMWidgetView(panel->editB));
|
||||||
@@ -1834,7 +1834,7 @@ createPanel(Panel *p)
|
|||||||
WMSetButtonFont(panel->delB, font);
|
WMSetButtonFont(panel->delB, font);
|
||||||
WMSetButtonImagePosition(panel->delB, WIPAbove);
|
WMSetButtonImagePosition(panel->delB, WIPAbove);
|
||||||
WMSetButtonText(panel->delB, _("Delete"));
|
WMSetButtonText(panel->delB, _("Delete"));
|
||||||
SetButtonAlphaImage(scr, panel->delB, TDEL_FILE);
|
SetButtonAlphaImage(scr, panel->delB, TDEL_FILE, NULL, NULL);
|
||||||
WMSetButtonEnabled(panel->delB, False);
|
WMSetButtonEnabled(panel->delB, False);
|
||||||
WMSetButtonAction(panel->delB, deleteTexture, panel);
|
WMSetButtonAction(panel->delB, deleteTexture, panel);
|
||||||
WMSetBalloonTextForView(_("Delete the highlighted texture."),
|
WMSetBalloonTextForView(_("Delete the highlighted texture."),
|
||||||
|
|||||||
@@ -335,11 +335,10 @@ error:
|
|||||||
static void
|
static void
|
||||||
changeLanguageAction(WMWidget *w, void *data)
|
changeLanguageAction(WMWidget *w, void *data)
|
||||||
{
|
{
|
||||||
Panel *panel = (Panel*)data;
|
/*Panel *panel = (Panel*)data;*/
|
||||||
WMMenuItem *mi;
|
WMMenuItem *mi;
|
||||||
proplist_t pl, font;
|
proplist_t pl;
|
||||||
char buffer[512];
|
|
||||||
|
|
||||||
mi = WMGetPopUpButtonMenuItem(w, WMGetPopUpButtonSelectedItem(w));
|
mi = WMGetPopUpButtonMenuItem(w, WMGetPopUpButtonSelectedItem(w));
|
||||||
pl = WMGetMenuItemRepresentedObject(mi);
|
pl = WMGetMenuItemRepresentedObject(mi);
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ void AddSection(Panel *panel, char *iconFile);
|
|||||||
|
|
||||||
char *LocateImage(char *name);
|
char *LocateImage(char *name);
|
||||||
|
|
||||||
|
void SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, char *file,
|
||||||
|
char *title1, char *title2);
|
||||||
|
|
||||||
WMWindow *GetWindow(Panel *panel);
|
WMWindow *GetWindow(Panel *panel);
|
||||||
|
|
||||||
/* manipulate the dictionary for the WindowMaker domain */
|
/* manipulate the dictionary for the WindowMaker domain */
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ void WEditMenuHide(WEditMenu *menu);
|
|||||||
|
|
||||||
void WEditMenuUnhide(WEditMenu *menu);
|
void WEditMenuUnhide(WEditMenu *menu);
|
||||||
|
|
||||||
void WEdirMenuShowAt(WEditMenu *menu, int x, int y);
|
void WEditMenuShowAt(WEditMenu *menu, int x, int y);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -144,33 +144,32 @@ Shutdown(WShutdownMode mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
restoreWindows(WMBag *bag, WMBagIterator iter)
|
||||||
static restoreWindows(WMBag *bag, WMBagIterator iter)
|
|
||||||
{
|
{
|
||||||
WCoreWindow *next;
|
WCoreWindow *next;
|
||||||
WCoreWindow *core;
|
WCoreWindow *core;
|
||||||
WWindow *wwin;
|
WWindow *wwin;
|
||||||
|
|
||||||
|
|
||||||
if (iter == NULL) {
|
if (iter == NULL) {
|
||||||
core = WMBagFirst(bag, &iter);
|
core = WMBagFirst(bag, &iter);
|
||||||
} else {
|
} else {
|
||||||
core = WMBagNext(bag, &iter);
|
core = WMBagNext(bag, &iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (core == NULL)
|
if (core == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
restoreWindows(bag, iter);
|
restoreWindows(bag, iter);
|
||||||
|
|
||||||
/* go to the end of the list */
|
/* go to the end of the list */
|
||||||
while (core->stacking->under)
|
while (core->stacking->under)
|
||||||
core = core->stacking->under;
|
core = core->stacking->under;
|
||||||
|
|
||||||
while (core) {
|
while (core) {
|
||||||
next = core->stacking->above;
|
next = core->stacking->above;
|
||||||
|
|
||||||
if (core->descriptor.parent_type==WCLASS_WINDOW) {
|
if (core->descriptor.parent_type==WCLASS_WINDOW) {
|
||||||
Window window;
|
Window window;
|
||||||
|
|
||||||
@@ -182,7 +181,7 @@ static restoreWindows(WMBag *bag, WMBagIterator iter)
|
|||||||
core = next;
|
core = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*----------------------------------------------------------------------
|
*----------------------------------------------------------------------
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
#if 1
|
#if 1
|
||||||
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "wraster.h"
|
#include "wraster.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include "tile.xpm"
|
#include "tile.xpm"
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
Window win;
|
Window win;
|
||||||
|
|||||||
Reference in New Issue
Block a user