diff -burN bbdate-0.2.1-orig/LinkedList.hh bbdate-0.2.1/LinkedList.hh --- bbdate-0.2.1-orig/LinkedList.hh Mon May 3 16:24:53 1999 +++ bbdate-0.2.1/LinkedList.hh Mon Jan 21 13:13:18 2002 @@ -63,7 +63,7 @@ int elements; __llist_node *_first, *_last; - friend __llist_iterator; + friend class __llist_iterator; protected: diff -burN bbdate-0.2.1-orig/bbdate.cc bbdate-0.2.1/bbdate.cc --- bbdate-0.2.1-orig/bbdate.cc Mon May 3 16:24:53 1999 +++ bbdate-0.2.1/bbdate.cc Mon Jan 21 13:15:38 2002 @@ -70,9 +70,15 @@ unsigned long create_mask = CWBackPixmap| CWOverrideRedirect |CWCursor|CWEventMask; - frame.width=XTextWidth(resource->label.font," mm/dd/yy ", + if (resource->report.strftimeFormat) + frame.width=XTextWidth(resource->label.font, resource->report.strftimeFormat, + strlen(resource->report.strftimeFormat)) + + resource->frame.bevelWidth*4; + else + frame.width=XTextWidth(resource->label.font, " mm/dd/yy ", strlen(" mm/dd/yy ")) + resource->frame.bevelWidth*4; + label.width=frame.width-2*resource->frame.bevelWidth; frame.height=resource->label.font->ascent+ resource->label.font->descent+4*resource->frame.bevelWidth; @@ -200,12 +206,23 @@ void ToolWindow::Redraw() { - char date[12]; + time_t tmp; + struct tm *tt; + + char date[1024]; + if ((tmp = time(NULL)) != -1) + { + tt = localtime(&tmp); + if (! ((resource->report.strftimeFormat) && + (strftime(date, 1024, resource->report.strftimeFormat, tt)))) + { if (resource->report.euStyle) sprintf(date, " %02d/%02d/%02d ", day, month, year); else sprintf(date, " %02d/%02d/%02d ", month, day, year); + } + } XClearWindow(dpy, labelwin); XDrawString(dpy, labelwin, frameGC, resource->frame.bevelWidth, diff -burN bbdate-0.2.1-orig/resource.cc bbdate-0.2.1/resource.cc --- bbdate-0.2.1-orig/resource.cc Sat May 8 06:55:26 1999 +++ bbdate-0.2.1/resource.cc Mon Jan 21 13:13:18 2002 @@ -22,6 +22,7 @@ #include "resource.hh" #include "blackboxstyle.hh" + Resource::Resource(ToolWindow *toolwindow): BaseResource(toolwindow) { @@ -307,5 +308,16 @@ else report.euStyle = False; + if (XrmGetResource(resource_db, "bbdate.strftimeFormat", + "Bbdate.strftimeFormat", &value_type, &value)) + { + report.euStyle = False; + report.strftimeFormat = (char *) malloc((value.size + 1) * sizeof(char)); + memset(report.strftimeFormat, '\0', value.size + 1); + strncpy(report.strftimeFormat, value.addr, value.size); + } + else + report.strftimeFormat = NULL; + /* what to show.resources */ } diff -burN bbdate-0.2.1-orig/resource.hh bbdate-0.2.1/resource.hh --- bbdate-0.2.1-orig/resource.hh Mon May 3 16:24:53 1999 +++ bbdate-0.2.1/resource.hh Mon Jan 21 13:13:18 2002 @@ -69,6 +69,7 @@ bool auto_raise; unsigned int check_delay; bool euStyle; + char *strftimeFormat; };