This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project wmaker-crm.git.
The branch, next has been updated discards 83d8ad6607b47e1c69baf113c7cbca2a66389fae (commit) via c2aca1ac9408f279efccaf38bce0446de2360e51 (commit) via d0e05b4c1739f19b9bd689e0e7c80bdd848dff56 (commit) This update added new revisions after undoing existing revisions. That is to say, the old revision is not a strict subset of the new revision. This situation occurs when you --force push a change and generate a repository containing something like this: * -- * -- B -- O -- O -- O (83d8ad6607b47e1c69baf113c7cbca2a66389fae) N -- N -- N (c2aca1ac9408f279efccaf38bce0446de2360e51) When this happens we assume that you've already had alert emails for all of the O revisions, and so we here report only the revisions in the N branch from the common base, B. Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://repo.or.cz/w/wmaker-crm.git/commit/c2aca1ac9408f279efccaf38bce0446de2360e51 commit c2aca1ac9408f279efccaf38bce0446de2360e51 Author: Doug Torrance <dtorra...@monmouthcollege.edu> Date: Sun May 11 23:05:43 2014 -0500 WPrefs: Set workspace background This patch enables users to set the workspace background (WorkspaceBack) in the Appearance Preferences section of WPrefs. It appears as a new item in the popup menu in the Texture tab, in the list of textures below, and a preview appears in the background of the preview panel on the left. diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c index ec71ee44..12ee13c8 100644 --- a/WPrefs.app/Appearance.c +++ b/WPrefs.app/Appearance.c @@ -108,6 +108,7 @@ typedef struct _Panel { Pixmap preview; Pixmap previewNoText; + Pixmap previewBack; char *fprefix; } _Panel; @@ -303,7 +304,8 @@ static const struct { { "ResizebarBack", "(solid, gray)", N_("[Resizebar]") }, { "MenuTitleBack", "(solid, black)", N_("[Menu Title]") }, { "MenuTextBack", "(solid, gray)", N_("[Menu Item]") }, - { "IconBack", "(solid, gray)", N_("[Icon]") } + { "IconBack", "(solid, gray)", N_("[Icon]") }, + { "WorkspaceBack", "(solid, black)", N_("[Background]") } }; #define RESIZEBAR_BEVEL -1 @@ -364,6 +366,7 @@ static WMRect previewPositions[] = { {{155, 130}, {64, 64}} }; +#define PBACKGROUND 7 #define EVERYTHING 0xff static WMRect previewColorPositions[] = { @@ -755,21 +758,32 @@ static void updatePreviewBox(_Panel * panel, int elements) gc = XCreateGC(dpy, WMWidgetXID(panel->parent), 0, NULL); if (panel->preview == None) { - WMColor *color; WMPixmap *p; panel->previewNoText = XCreatePixmap(dpy, WMWidgetXID(panel->parent), 240 - 4, 215 - 4, WMScreenDepth(scr)); + panel->previewBack = XCreatePixmap(dpy, WMWidgetXID(panel->parent), + 240 - 4, 215 - 4, WMScreenDepth(scr)); p = WMCreatePixmap(scr, 240 - 4, 215 - 4, WMScreenDepth(scr), False); panel->preview = WMGetPixmapXID(p); WMSetLabelImage(panel->prevL, p); WMReleasePixmap(p); + } + if (elements & (1 << PBACKGROUND)) { + Pixmap tmp; + TextureListItem *titem; + WMListItem *item; + + item = WMGetListItem(panel->texLs, + panel->textureIndex[PBACKGROUND]); + titem = (TextureListItem *) item->clientData; + tmp = renderTexture(scr, titem->prop, 240 - 4, 215 - 4, NULL, 0); - color = WMCreateRGBColor(scr, 0x5100, 0x5100, 0x7100, True); - XFillRectangle(dpy, panel->preview, WMColorGC(color), 0, 0, 240 - 4, 215 - 4); - XFillRectangle(dpy, panel->previewNoText, WMColorGC(color), 0, 0, 240 - 4, 215 - 4); - WMReleaseColor(color); + XCopyArea(dpy, tmp, panel->preview, gc, 0, 0, 240 - 4, 215 -4 , 0, 0); + XCopyArea(dpy, tmp, panel->previewNoText, gc, 0, 0, 240 - 4, 215 -4 , 0, 0); + XCopyArea(dpy, tmp, panel->previewBack, gc, 0, 0, 240 - 4, 215 -4 , 0, 0); + XFreePixmap(dpy, tmp); } if (elements & (1 << PFOCUSED)) { @@ -966,8 +980,12 @@ static void okEditTexture(void *data) WMRedisplayWidget(panel->texLs); - if (titem->selectedFor) - updatePreviewBox(panel, titem->selectedFor); + if (titem->selectedFor) { + if (titem->selectedFor & (1 << PBACKGROUND)) + updatePreviewBox(panel, EVERYTHING); + else + updatePreviewBox(panel, titem->selectedFor); + } changePage(panel->secP, panel); } @@ -1097,12 +1115,14 @@ static void changePage(WMWidget * w, void *data) WMSetListPosition(panel->texLs, panel->textureIndex[section] - 2); } { - WMColor *color; - - color = WMCreateRGBColor(scr, 0x5100, 0x5100, 0x7100, True); - XFillRectangle(rc->dpy, panel->preview, WMColorGC(color), - positions[panel->oldsection].x, positions[panel->oldsection].y, 22, 22); - WMReleaseColor(color); + GC gc; + + gc = XCreateGC(rc->dpy, WMWidgetXID(panel->parent), 0, NULL); + XCopyArea(rc->dpy, panel->previewBack, panel->preview, gc, + positions[panel->oldsection].x, + positions[panel->oldsection].y, 22, 22 , + positions[panel->oldsection].x, + positions[panel->oldsection].y); } if (w) { panel->oldsection = section; @@ -1206,7 +1226,10 @@ static void textureDoubleClick(WMWidget * w, void *data) WMRedisplayWidget(panel->texLs); - updatePreviewBox(panel, 1 << section); + if (section == PBACKGROUND) + updatePreviewBox(panel, EVERYTHING); + else + updatePreviewBox(panel, 1 << section); } static void paintListItem(WMList * lPtr, int index, Drawable d, char *text, int state, WMRect * rect) @@ -1380,12 +1403,14 @@ static void changeColorPage(WMWidget * w, void *data) }; if (panel->preview) { - WMColor *color; - - color = WMCreateRGBColor(scr, 0x5100, 0x5100, 0x7100, True); - XFillRectangle(rc->dpy, panel->preview, WMColorGC(color), - positions[panel->oldcsection].x, positions[panel->oldcsection].y, 22, 22); - WMReleaseColor(color); + GC gc; + + gc = XCreateGC(rc->dpy, WMWidgetXID(panel->parent), 0, NULL); + XCopyArea(rc->dpy, panel->previewBack, panel->preview, gc, + positions[panel->oldcsection].x, + positions[panel->oldcsection].y, 22, 22 , + positions[panel->oldcsection].x, + positions[panel->oldcsection].y); } if (w) { section = WMGetPopUpButtonSelectedItem(panel->colP); @@ -1668,8 +1693,8 @@ static void createPanel(Panel * p) WMAddPopUpButtonItem(panel->secP, _("Titlebar of Menus")); WMAddPopUpButtonItem(panel->secP, _("Menu Items")); WMAddPopUpButtonItem(panel->secP, _("Icon Background")); - /* WMAddPopUpButtonItem(panel->secP, _("Workspace Backgrounds")); - */ + WMAddPopUpButtonItem(panel->secP, _("Workspace Background")); + WMSetPopUpButtonSelectedItem(panel->secP, 0); WMSetPopUpButtonAction(panel->secP, changePage, panel); @@ -2044,7 +2069,7 @@ static void prepareForClose(_Panel * panel) textureList = WMCreatePLArray(NULL, NULL); /* store list of textures */ - for (i = 7; i < WMGetListNumberOfRows(panel->texLs); i++) { + for (i = 8; i < WMGetListNumberOfRows(panel->texLs); i++) { item = WMGetListItem(panel->texLs, i); titem = (TextureListItem *) item->clientData; http://repo.or.cz/w/wmaker-crm.git/commit/d0e05b4c1739f19b9bd689e0e7c80bdd848dff56 commit d0e05b4c1739f19b9bd689e0e7c80bdd848dff56 Author: Doug Torrance <dtorra...@monmouthcollege.edu> Date: Sun May 11 03:34:34 2014 -0500 WINGs: Option for decimal or hexadecimal RGB colors The RGB panel of the WINGs color panel lists the red, green, and blue values as base 10 numbers. However, hexadecimal numbers are very common when dealing with RGB colors. This patch adds two radio buttons at the bottom of the RGB panel to allow users to choose their preferred number system. For version 2 of the patch: Based on Cristophe's suggestions regarding the new decimal/hexadecimal RGB color feature introduced in commit 83d8ad6, this patch changes rgbState from an int to an enum, converts some if statements to switches, and changes from atoi to strtol for the base 10 string conversion. In addition, the "hexadecimal" text was too wide for the default size of its radio button for some fonts, so both radio buttons are now resized to fit the width of the panel. diff --git a/WINGs/wcolorpanel.c b/WINGs/wcolorpanel.c index 29777027..63892c46 100644 --- a/WINGs/wcolorpanel.c +++ b/WINGs/wcolorpanel.c @@ -161,6 +161,8 @@ typedef struct W_ColorPanel { WMButton *grayPresetBtn[7]; /* RGB Panel */ + WMButton *rgbDecB; + WMButton *rgbHexB; WMFrame *rgbFrm; WMLabel *rgbMinL; WMLabel *rgbMaxL; @@ -170,6 +172,10 @@ typedef struct W_ColorPanel { WMTextField *rgbRedT; WMTextField *rgbGreenT; WMTextField *rgbBlueT; + enum { + RGBdec, + RGBhex + } rgbState; /* CMYK Panel */ WMFrame *cmykFrm; @@ -313,6 +319,7 @@ static void grayBrightnessTextFieldCallback(void *observerData, WMNotification * static void rgbSliderCallback(WMWidget * w, void *data); static void rgbTextFieldCallback(void *observerData, WMNotification * notification); +static void rgbDecToHex(WMWidget *w, void *data); static void cmykSliderCallback(WMWidget * w, void *data); static void cmykTextFieldCallback(void *observerData, WMNotification * notification); @@ -703,6 +710,23 @@ static WMColorPanel *makeColorPanel(WMScreen * scrPtr, const char *name) WMMoveWidget(panel->rgbBlueT, 146, 57); WMSetTextFieldAlignment(panel->rgbBlueT, WALeft); WMAddNotificationObserver(rgbTextFieldCallback, panel, WMTextDidEndEditingNotification, panel->rgbBlueT); + + panel->rgbDecB = WMCreateButton(panel->rgbFrm, WBTRadio); + WMSetButtonText(panel->rgbDecB, "Decimal"); + WMSetButtonSelected(panel->rgbDecB, 1); + panel->rgbState = RGBdec; + WMSetButtonAction(panel->rgbDecB, rgbDecToHex, panel); + WMResizeWidget(panel->rgbDecB, PWIDTH - 8, 23); + WMMoveWidget(panel->rgbDecB, 2, 81); + + panel->rgbHexB = WMCreateButton(panel->rgbFrm, WBTRadio); + WMSetButtonText(panel->rgbHexB, "Hexadecimal"); + WMSetButtonAction(panel->rgbHexB, rgbDecToHex, panel); + WMResizeWidget(panel->rgbHexB, PWIDTH - 8, 23); + WMMoveWidget(panel->rgbHexB, 2, 104); + + WMGroupButtons(panel->rgbDecB, panel->rgbHexB); + /* End of RGB Panel */ /* Widgets for CMYK Panel */ @@ -2348,11 +2372,53 @@ static void grayBrightnessTextFieldCallback(void *observerData, WMNotification * /******************* RGB Panel Functions *****************/ +void rgbIntToChar(W_ColorPanel *panel, int *value) +{ + char tmp[4]; + const char *format; + + switch (panel->rgbState) { + case RGBdec: + format = "%d"; + break; + case RGBhex: + format = "%0X"; + break; + } + + sprintf(tmp, format, value[0]); + WMSetTextFieldText(panel->rgbRedT, tmp); + sprintf(tmp, format, value[1]); + WMSetTextFieldText(panel->rgbGreenT, tmp); + sprintf(tmp, format, value[2]); + WMSetTextFieldText(panel->rgbBlueT, tmp); +} + +int *rgbCharToInt(W_ColorPanel *panel) +{ + int base = 0; + static int value[3]; + + switch (panel->rgbState) { + case RGBdec: + base = 10; + break; + case RGBhex: + base = 16; + break; + } + + value[0] = strtol(WMGetTextFieldText(panel->rgbRedT), NULL, base); + value[1] = strtol(WMGetTextFieldText(panel->rgbGreenT), NULL, base); + value[2] = strtol(WMGetTextFieldText(panel->rgbBlueT), NULL, base); + + return value; +} + static void rgbSliderCallback(WMWidget * w, void *data) { CPColor cpColor; int value[3]; - char tmp[4]; W_ColorPanel *panel = (W_ColorPanel *) data; /* Parameter not used, but tell the compiler that it is ok */ @@ -2362,12 +2428,7 @@ static void rgbSliderCallback(WMWidget * w, void *data) value[1] = WMGetSliderValue(panel->rgbGreenS); value[2] = WMGetSliderValue(panel->rgbBlueS); - sprintf(tmp, "%d", value[0]); - WMSetTextFieldText(panel->rgbRedT, tmp); - sprintf(tmp, "%d", value[1]); - WMSetTextFieldText(panel->rgbGreenT, tmp); - sprintf(tmp, "%d", value[2]); - WMSetTextFieldText(panel->rgbBlueT, tmp); + rgbIntToChar(panel, value); cpColor.rgb.red = value[0]; cpColor.rgb.green = value[1]; @@ -2381,17 +2442,14 @@ static void rgbSliderCallback(WMWidget * w, void *data) static void rgbTextFieldCallback(void *observerData, WMNotification * notification) { CPColor cpColor; - int value[3]; - char tmp[4]; + int *value; int n; W_ColorPanel *panel = (W_ColorPanel *) observerData; /* Parameter not used, but tell the compiler that it is ok */ (void) notification; - value[0] = atoi(WMGetTextFieldText(panel->rgbRedT)); - value[1] = atoi(WMGetTextFieldText(panel->rgbGreenT)); - value[2] = atoi(WMGetTextFieldText(panel->rgbBlueT)); + value = rgbCharToInt(panel); for (n = 0; n < 3; n++) { if (value[n] > 255) @@ -2400,12 +2458,7 @@ static void rgbTextFieldCallback(void *observerData, WMNotification * notificati value[n] = 0; } - sprintf(tmp, "%d", value[0]); - WMSetTextFieldText(panel->rgbRedT, tmp); - sprintf(tmp, "%d", value[1]); - WMSetTextFieldText(panel->rgbGreenT, tmp); - sprintf(tmp, "%d", value[2]); - WMSetTextFieldText(panel->rgbBlueT, tmp); + rgbIntToChar(panel, value); WMSetSliderValue(panel->rgbRedS, value[0]); WMSetSliderValue(panel->rgbGreenS, value[1]); @@ -2420,6 +2473,29 @@ static void rgbTextFieldCallback(void *observerData, WMNotification * notificati panel->lastChanged = WMRGBModeColorPanel; } +static void rgbDecToHex(WMWidget *w, void *data) +{ + W_ColorPanel *panel = (W_ColorPanel *) data; + int *value; + + (void) w; + + if (WMGetButtonSelected(panel->rgbDecB) && panel->rgbState == RGBhex) { + WMSetLabelText(panel->rgbMaxL, "255"); + WMRedisplayWidget(panel->rgbMaxL); + value = rgbCharToInt(panel); + panel->rgbState = RGBdec; + rgbIntToChar(panel, value); + } + if (WMGetButtonSelected(panel->rgbHexB) && panel->rgbState == RGBdec) { + WMSetLabelText(panel->rgbMaxL, "FF"); + WMRedisplayWidget(panel->rgbMaxL); + value = rgbCharToInt(panel); + panel->rgbState = RGBhex; + rgbIntToChar(panel, value); + } +} + /******************* CMYK Panel Functions *****************/ static void cmykSliderCallback(WMWidget * w, void *data) ----------------------------------------------------------------------- Summary of changes: WINGs/wcolorpanel.c | 47 ++++++++++++++++++------------ WPrefs.app/Appearance.c | 73 +++++++++++++++++++++++++++++++--------------- 2 files changed, 77 insertions(+), 43 deletions(-) repo.or.cz automatic notification. Contact project admin crma...@gmail.com if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive no reply. -- wmaker-crm.git ("The Window Maker window manager") -- To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.