rpms/xpaint/devel xpaint-2.8.19-ewmh-minor-fixes.patch, NONE, 1.1 xpaint-2.8.19-minor_fixes.patch, NONE, 1.1 xpaint-2.8.19-small-improvements.patch, NONE, 1.1 .cvsignore, 1.5, 1.6 import.log, 1.8, 1.9 sources, 1.5, 1.6 xpaint.spec, 1.8, 1.9 xpaint-2.8.15-text-ctrlH-segfault.patch, 1.1, NONE
Paulo Roma Cavalcanti
roma at fedoraproject.org
Wed Apr 21 15:51:46 UTC 2010
Author: roma
Update of /cvs/pkgs/rpms/xpaint/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv18319/devel
Modified Files:
.cvsignore import.log sources xpaint.spec
Added Files:
xpaint-2.8.19-ewmh-minor-fixes.patch
xpaint-2.8.19-minor_fixes.patch
xpaint-2.8.19-small-improvements.patch
Removed Files:
xpaint-2.8.15-text-ctrlH-segfault.patch
Log Message:
update to 2.8.19
xpaint-2.8.19-ewmh-minor-fixes.patch:
ChangeLog | 16 ++++++++++++++++
brushOp.c | 2 !!
chroma.c | 2 !!
fatBitsEdit.c | 4 !!!!
fontSelect.c | 2 !!
graphic.c | 14 ++++!!!!!!!!!!
help.c | 2 !!
main.c | 2 !!
misc.c | 18 ++++++++++++++++++
misc.h | 1 +
operation.c | 4 !!!!
pattern.c | 4 !!!!
print.c | 4 !!!!
protocol.c | 6 !!!!!!
14 files changed, 39 insertions(+), 42 modifications(!)
--- NEW FILE xpaint-2.8.19-ewmh-minor-fixes.patch ---
diff -rc xpaint-2.8.19/brushOp.c xpaint-2.8.19.1/brushOp.c
*** xpaint-2.8.19/brushOp.c 2010-03-06 20:55:25.000000000 +0100
--- xpaint-2.8.19.1/brushOp.c 2010-04-17 13:04:17.003999838 +0200
***************
*** 1246,1252 ****
BrushSelect(Widget w)
{
XtPopup(Global.brushpopup, XtGrabNone);
! XMapRaised(XtDisplay(Global.brushpopup), XtWindow(Global.brushpopup));
}
void setBrushIconOnWidget(Widget w)
--- 1246,1252 ----
BrushSelect(Widget w)
{
XtPopup(Global.brushpopup, XtGrabNone);
! RaiseWindow(XtDisplay(Global.brushpopup), XtWindow(Global.brushpopup));
}
void setBrushIconOnWidget(Widget w)
diff -rc xpaint-2.8.19/ChangeLog xpaint-2.8.19.1/ChangeLog
*** xpaint-2.8.19/ChangeLog 2010-04-05 21:50:40.000000000 +0200
--- xpaint-2.8.19.1/ChangeLog 2010-04-17 13:26:56.167998538 +0200
***************
*** 1,3 ****
--- 1,19 ----
+ 2010-04-17 J.-P. Demailly <demailly at fourier.ujf-grenoble.fr>
+
+ * Version 2.8.19.1 (mostly cosmetic changes)
+
+ * fileBrowser.c : added "ongoing" mode in File Browser (widget no
+ longer closes when opening an image, allowing to browse files
+ continuously). Performed a substantial code clean-up as well.
+
+ * operation.c, graphic.c : menu improvements; one can now open an image
+ from any canvas window.
+
+ * misc.c : added RaiseWindow() routine to comply better with ewmh
+ specifications. XMapRaised() replaced by RaiseWindow() throughout.
+
+ * "snapshot" replaced by "screenshot" throughout.
+
2010-04-05 J.-P. Demailly <demailly at fourier.ujf-grenoble.fr>
* Version 2.8.19
diff -rc xpaint-2.8.19/chroma.c xpaint-2.8.19.1/chroma.c
*** xpaint-2.8.19/chroma.c 2010-02-17 18:19:30.000000000 +0100
--- xpaint-2.8.19.1/chroma.c 2010-04-17 13:10:06.565999447 +0200
***************
*** 304,310 ****
XtVaSetValues(l->shell, XtNcolormap, map->cmap, NULL);
}
XtPopup(l->shell, XtGrabNone);
! XMapRaised(XtDisplay(l->shell), XtWindow(l->shell));
return;
}
#endif
--- 304,310 ----
XtVaSetValues(l->shell, XtNcolormap, map->cmap, NULL);
}
XtPopup(l->shell, XtGrabNone);
! RaiseWindow(XtDisplay(l->shell), XtWindow(l->shell));
return;
}
#endif
diff -rc xpaint-2.8.19/fatBitsEdit.c xpaint-2.8.19.1/fatBitsEdit.c
*** xpaint-2.8.19/fatBitsEdit.c 2010-04-05 16:43:00.000000000 +0200
--- xpaint-2.8.19.1/fatBitsEdit.c 2010-04-17 13:11:13.311999977 +0200
***************
*** 586,592 ****
XtVaGetValues(w, XtNx, &x, XtNy, &y, NULL);
if (abs(event->time-prev_time) < 300)
! XMapRaised(XtDisplay(l->shell), XtWindow(l->shell));
prev_time = event->time;
l->offX = event->x;
--- 586,592 ----
XtVaGetValues(w, XtNx, &x, XtNy, &y, NULL);
if (abs(event->time-prev_time) < 300)
! RaiseWindow(XtDisplay(l->shell), XtWindow(l->shell));
prev_time = event->time;
l->offX = event->x;
***************
*** 826,832 ****
for (l = head; l != NULL && l->paint != paint; l = l->next);
if (l != NULL) {
! XMapRaised(XtDisplay(l->shell), XtWindow(l->shell));
return;
}
/* Construct a new fatbits popup */
--- 826,832 ----
for (l = head; l != NULL && l->paint != paint; l = l->next);
if (l != NULL) {
! RaiseWindow(XtDisplay(l->shell), XtWindow(l->shell));
return;
}
/* Construct a new fatbits popup */
diff -rc xpaint-2.8.19/fontSelect.c xpaint-2.8.19.1/fontSelect.c
*** xpaint-2.8.19/fontSelect.c 2010-04-17 13:59:56.832000354 +0200
--- xpaint-2.8.19.1/fontSelect.c 2010-04-17 13:02:57.434256246 +0200
***************
*** 1091,1097 ****
if (shell != None) {
XtPopup(shell, XtGrabNone);
! XMapRaised(XtDisplay(shell), XtWindow(shell));
XtSetMinSizeHints(shell, 360, 480);
return;
}
--- 1091,1097 ----
if (shell != None) {
XtPopup(shell, XtGrabNone);
! RaiseWindow(XtDisplay(shell), XtWindow(shell));
XtSetMinSizeHints(shell, 360, 480);
return;
}
diff -rc xpaint-2.8.19/graphic.c xpaint-2.8.19.1/graphic.c
*** xpaint-2.8.19/graphic.c 2010-04-17 13:59:56.835003566 +0200
--- xpaint-2.8.19.1/graphic.c 2010-04-17 13:50:03.439249821 +0200
***************
*** 4512,4520 ****
static void
ToolSelectCallback(Widget w, XtPointer shell, XtPointer junk2)
{
Global.canvas = (Widget) shell;
! XtVaSetValues(Global.back, XtNsensitive, True, NULL);
! XMapRaised(XtDisplay(Global.toplevel), XtWindow(Global.toplevel));
}
static void
--- 4512,4521 ----
static void
ToolSelectCallback(Widget w, XtPointer shell, XtPointer junk2)
{
+ Display *dpy = XtDisplay(Global.toplevel);
Global.canvas = (Widget) shell;
! XtVaSetValues(Global.back, XtNsensitive, True, NULL);
! RaiseWindow(dpy, XtWindow(Global.toplevel));
}
static void
***************
*** 4524,4529 ****
--- 4525,4533 ----
PatternEdit(info->paint,
info->pixels, info->patterns, (void *)info->rcInfo->brushes,
info->npixels, info->npatterns, info->rcInfo->nbrushes);
+ if (Global.patternshell)
+ RaiseWindow(XtDisplay(Global.patternshell),
+ XtWindow(Global.patternshell));
}
#if 0
***************
*** 4711,4718 ****
wlist[W_LINE_WIDTHS+i] = popupLineMenu[j+1].widget;
wlist[W_TOPMENU+W_LINE_WIDTHS+i] = lineMenu[j].widget;
}
! for (i=0; i<=10; i++) {
! j = i+(i==10);
wlist[W_FONT_DESCR+i] = popupTextMenu[j+1].widget;
wlist[W_TOPMENU+W_FONT_DESCR+i] = textMenu[j].widget;
}
--- 4715,4722 ----
wlist[W_LINE_WIDTHS+i] = popupLineMenu[j+1].widget;
wlist[W_TOPMENU+W_LINE_WIDTHS+i] = lineMenu[j].widget;
}
! for (i=0; i<=NUMBER_PREDEF_FONTS; i++) {
! j = i+(i==NUMBER_PREDEF_FONTS);
wlist[W_FONT_DESCR+i] = popupTextMenu[j+1].widget;
wlist[W_TOPMENU+W_FONT_DESCR+i] = textMenu[j].widget;
}
***************
*** 4738,4744 ****
XtVaGetValues(head->paint, XtNlineWidth, &i, NULL);
for (j=0; j<=5; j++)
if (IsItemChecked(wlist[W_LINE_WIDTHS+j])) break;
! for (k=0; k<=NUMBER_PREDEF_FONTS; k++)
if (IsItemChecked(wlist[W_FONT_DESCR+k])) break;
l = IsItemChecked(wlist[W_SELECTOR_GRID]);
m = IsItemChecked(wlist[W_SELECTOR_SNAP]);
--- 4742,4748 ----
XtVaGetValues(head->paint, XtNlineWidth, &i, NULL);
for (j=0; j<=5; j++)
if (IsItemChecked(wlist[W_LINE_WIDTHS+j])) break;
! for (k=0; k<NUMBER_PREDEF_FONTS; k++)
if (IsItemChecked(wlist[W_FONT_DESCR+k])) break;
l = IsItemChecked(wlist[W_SELECTOR_GRID]);
m = IsItemChecked(wlist[W_SELECTOR_SNAP]);
diff -rc xpaint-2.8.19/help.c xpaint-2.8.19.1/help.c
*** xpaint-2.8.19/help.c 2010-04-05 16:45:45.000000000 +0200
--- xpaint-2.8.19.1/help.c 2010-04-17 13:11:29.952250062 +0200
***************
*** 532,538 ****
StoreName(l->shell, str);
display(l, cur);
! XMapRaised(XtDisplay(l->shell), XtWindow(l->shell));
XtSetMinSizeHints(l->shell, 466, 160);
}
--- 532,538 ----
StoreName(l->shell, str);
display(l, cur);
! RaiseWindow(XtDisplay(l->shell), XtWindow(l->shell));
XtSetMinSizeHints(l->shell, 466, 160);
}
diff -rc xpaint-2.8.19/main.c xpaint-2.8.19.1/main.c
*** xpaint-2.8.19/main.c 2010-04-17 13:59:56.835998119 +0200
--- xpaint-2.8.19.1/main.c 2010-04-17 13:12:37.073999936 +0200
***************
*** 1101,1107 ****
XtDispatchEvent(&event);
if (appInfo.magnifier && argc==1 && magnifier_closing_down) {
XtVaSetValues(toplevel, XtNmappedWhenManaged, True, NULL);
! XMapRaised(dpy, XtWindow(toplevel));
appInfo.magnifier = 0;
}
}
--- 1101,1107 ----
XtDispatchEvent(&event);
if (appInfo.magnifier && argc==1 && magnifier_closing_down) {
XtVaSetValues(toplevel, XtNmappedWhenManaged, True, NULL);
! RaiseWindow(dpy, XtWindow(toplevel));
appInfo.magnifier = 0;
}
}
diff -rc xpaint-2.8.19/misc.c xpaint-2.8.19.1/misc.c
*** xpaint-2.8.19/misc.c 2010-02-18 18:32:20.000000000 +0100
--- xpaint-2.8.19.1/misc.c 2010-04-17 13:07:17.453250051 +0200
***************
*** 137,142 ****
--- 137,160 ----
return w;
}
+ RaiseWindow(Display *dpy, Window win)
+ {
+ XEvent event;
+ int j;
+ long mask = SubstructureRedirectMask | SubstructureNotifyMask;
+ char *msg = "_NET_ACTIVE_WINDOW";
+
+ event.xclient.type = ClientMessage;
+ event.xclient.serial = 0;
+ event.xclient.send_event = True;
+ event.xclient.message_type = XInternAtom(dpy, msg, False);
+ event.xclient.window = win;
+ event.xclient.format = 32;
+ for (j=0; j<=4; j++) event.xclient.data.l[j] = 0;
+ XSendEvent(dpy, DefaultRootWindow(dpy), False, mask, &event);
+ XMapRaised(dpy, win);
+ }
+
void
SetIBeamCursor(Widget w)
{
diff -rc xpaint-2.8.19/misc.h xpaint-2.8.19.1/misc.h
*** xpaint-2.8.19/misc.h 2010-04-17 13:59:56.835998119 +0200
--- xpaint-2.8.19.1/misc.h 2010-04-17 13:08:05.244249870 +0200
***************
*** 147,152 ****
--- 147,153 ----
extern int privateXErrorHandler(Display *dpy, XErrorEvent *myerr);
extern Widget GetToplevel(Widget w);
extern Widget GetShell(Widget w);
+ extern void RaiseWindow(Display *dpy, Window win);
extern void SetIBeamCursor(Widget w);
extern void SetCrossHairCursor(Widget w);
extern void SetPencilCursor(Widget w);
diff -rc xpaint-2.8.19/operation.c xpaint-2.8.19.1/operation.c
*** xpaint-2.8.19/operation.c 2010-04-17 13:59:56.836998049 +0200
--- xpaint-2.8.19.1/operation.c 2010-04-17 13:08:37.805249865 +0200
***************
*** 1387,1394 ****
static void
switchtoCanvasCallback(Widget w, XtPointer junk, XEvent * event, Boolean * flg)
{
! if (Global.canvas && event->type == ButtonRelease)
! XMapRaised(XtDisplay(Global.canvas), XtWindow(Global.canvas));
}
void
--- 1387,1394 ----
static void
switchtoCanvasCallback(Widget w, XtPointer junk, XEvent * event, Boolean * flg)
{
! if (Global.canvas && event->type == ButtonRelease)
! RaiseWindow(XtDisplay(Global.canvas), XtWindow(Global.canvas));
}
void
diff -rc xpaint-2.8.19/pattern.c xpaint-2.8.19.1/pattern.c
*** xpaint-2.8.19/pattern.c 2010-04-17 13:59:56.837997839 +0200
--- xpaint-2.8.19.1/pattern.c 2010-04-17 13:10:43.887000137 +0200
***************
*** 1222,1228 ****
if (event->type != ButtonRelease);
if (w == l->icon) {
if (l->paint)
! XMapRaised(XtDisplay(l->paint), XtWindow(GetShell(l->paint)));
return;
}
l->active = w;
--- 1222,1228 ----
if (event->type != ButtonRelease);
if (w == l->icon) {
if (l->paint)
! RaiseWindow(XtDisplay(l->paint), XtWindow(GetShell(l->paint)));
return;
}
l->active = w;
***************
*** 1682,1688 ****
initViews(info);
XMapWindow(dpy, XtWindow(info->r_arrow));
XUnmapWindow(dpy, XtWindow(info->g_arrow));
! XMapRaised(dpy, XtWindow(Global.patternshell));
return;
}
StateSetBusyWatch(True);
--- 1682,1688 ----
initViews(info);
XMapWindow(dpy, XtWindow(info->r_arrow));
XUnmapWindow(dpy, XtWindow(info->g_arrow));
! RaiseWindow(dpy, XtWindow(Global.patternshell));
return;
}
StateSetBusyWatch(True);
diff -rc xpaint-2.8.19/print.c xpaint-2.8.19.1/print.c
*** xpaint-2.8.19/print.c 2010-03-31 05:53:58.000000000 +0200
--- xpaint-2.8.19.1/print.c 2010-04-17 13:11:56.257249698 +0200
***************
*** 1054,1060 ****
if (printinfo->shell) {
if (printinfo->paintwidget == (PaintWidget)paintArg) {
! XMapRaised(dpy, XtWindow(printinfo->shell));
return;
} else
XtDestroyWidget(printinfo->shell);
--- 1054,1060 ----
if (printinfo->shell) {
if (printinfo->paintwidget == (PaintWidget)paintArg) {
! RaiseWindow(dpy, XtWindow(printinfo->shell));
return;
} else
XtDestroyWidget(printinfo->shell);
***************
*** 1841,1847 ****
}
if (externinfo->shell) {
if (externinfo->paintwidget == (PaintWidget)paintArg) {
! XMapRaised(dpy, XtWindow(externinfo->shell));
return;
} else
XtDestroyWidget(externinfo->shell);
--- 1841,1847 ----
}
if (externinfo->shell) {
if (externinfo->paintwidget == (PaintWidget)paintArg) {
! RaiseWindow(dpy, XtWindow(externinfo->shell));
return;
} else
XtDestroyWidget(externinfo->shell);
diff -rc xpaint-2.8.19/protocol.c xpaint-2.8.19.1/protocol.c
*** xpaint-2.8.19/protocol.c 2009-10-01 16:21:52.000000000 +0200
--- xpaint-2.8.19.1/protocol.c 2010-04-17 13:09:14.781000149 +0200
***************
*** 217,223 ****
CopyFromParent, valuemask, &attributes);
if (DO_MAP(l))
! XMapRaised(l->dpy, l->win);
}
--- 217,223 ----
CopyFromParent, valuemask, &attributes);
if (DO_MAP(l))
! RaiseWindow(l->dpy, l->win);
}
***************
*** 301,313 ****
}
if (cur->watchCount == 1) {
if (isWatch) {
! XMapRaised(cur->dpy, cur->win);
XDefineCursor(cur->dpy, cur->win, watchCursor);
doFlush = True;
}
} else if (cur->computingCount == 1) {
if (!isWatch) {
! XMapRaised(cur->dpy, cur->win);
XDefineCursor(cur->dpy, cur->win, cursorInfo[currentCursor].cursor);
doFlush = True;
}
--- 301,313 ----
}
if (cur->watchCount == 1) {
if (isWatch) {
! RaiseWindow(cur->dpy, cur->win);
XDefineCursor(cur->dpy, cur->win, watchCursor);
doFlush = True;
}
} else if (cur->computingCount == 1) {
if (!isWatch) {
! RaiseWindow(cur->dpy, cur->win);
XDefineCursor(cur->dpy, cur->win, cursorInfo[currentCursor].cursor);
doFlush = True;
}
xpaint-2.8.19-minor_fixes.patch:
Filelist | 2
Imakefile | 6
app-defaults/XPaint.ad.in | 7
app-defaults/XPaint_es.ad.in | 7
app-defaults/XPaint_fr.ad.in | 7
fileBrowser.c | 44 ++!!
graphic.c | 17 !
main.c | 14 !
misc.h | 4
operation.c | 6
region.h | 4
screenshot.c | 430 +++++++++++++++++++++++++++++++++++++++++++
share/help/Help | 6
share/help/Help_es | 4
share/help/Help_fr | 4
xpaint.man | 6
xpaint.man.in | 6
17 files changed, 454 insertions(+), 120 modifications(!)
--- NEW FILE xpaint-2.8.19-minor_fixes.patch ---
diff -rc xpaint-2.8.19/app-defaults/XPaint.ad.in xpaint-2.8.19.1/app-defaults/XPaint.ad.in
*** xpaint-2.8.19/app-defaults/XPaint.ad.in 2010-04-03 09:31:28.000000000 +0200
--- xpaint-2.8.19.1/app-defaults/XPaint.ad.in 2010-04-07 09:09:24.000000000 +0200
***************
*** 242,247 ****
--- 242,248 ----
*close.label: Close
*apply.label: Apply
*hidden.label: Hidden Files
+ *ongoing.label: Ongoing
*alert.title: Alert
Canvas*fatbits.title: XPaint / Fat Bits
***************
*** 354,360 ****
xpaint*toolbox*canvas*open.label: Open Image...
xpaint*toolbox*canvas*loaded.label: Loaded files...
xpaint*toolbox*canvas*magnifier.label: Magnifier...
! xpaint*toolbox*canvas*snapshot.label: Take Snapshot...
xpaint*toolbox*canvas*about.label: About...
xpaint*toolbox*canvas*quit.label: Quit XPaint
xpaint*toolbox*other.label: Brush
--- 355,361 ----
xpaint*toolbox*canvas*open.label: Open Image...
xpaint*toolbox*canvas*loaded.label: Loaded files...
xpaint*toolbox*canvas*magnifier.label: Magnifier...
! xpaint*toolbox*canvas*screenshot.label: Take Screenshot...
xpaint*toolbox*canvas*about.label: About...
xpaint*toolbox*canvas*quit.label: Quit XPaint
xpaint*toolbox*other.label: Brush
***************
*** 593,599 ****
Canvas*menu*edit*alphaset.label: Save as alpha channel
Canvas*menu*edit*alphadel.label: Delete alpha channel
Canvas*menu*edit*alphaedit.label: Edit alpha channel
! Canvas*menu*edit*snapshot.label: Snapshot
Canvas*menu*line.label: Line
Canvas*menu*line*linestyle.label: Line Style...
--- 594,600 ----
Canvas*menu*edit*alphaset.label: Save as alpha channel
Canvas*menu*edit*alphadel.label: Delete alpha channel
Canvas*menu*edit*alphaedit.label: Edit alpha channel
! Canvas*menu*edit*screenshot.label: Screenshot
Canvas*menu*line.label: Line
Canvas*menu*line*linestyle.label: Line Style...
***************
*** 723,729 ****
*paintBox*popup-menu.Edit-right.alphaset.label: Save as alpha channel
*paintBox*popup-menu.Edit-right.alphadel.label: Delete alpha channel
*paintBox*popup-menu.Edit-right.alphaedit.label: Edit alpha channel
! *paintBox*popup-menu.Edit-right*snapshot.label: Snapshot
! popup Line Menu
*paintBox*popup-menu.Line.label: Line
--- 724,730 ----
*paintBox*popup-menu.Edit-right.alphaset.label: Save as alpha channel
*paintBox*popup-menu.Edit-right.alphadel.label: Delete alpha channel
*paintBox*popup-menu.Edit-right.alphaedit.label: Edit alpha channel
! *paintBox*popup-menu.Edit-right*screenshot.label: Screenshot
! popup Line Menu
*paintBox*popup-menu.Line.label: Line
diff -rc xpaint-2.8.19/app-defaults/XPaint_es.ad.in xpaint-2.8.19.1/app-defaults/XPaint_es.ad.in
*** xpaint-2.8.19/app-defaults/XPaint_es.ad.in 2010-04-03 09:35:36.000000000 +0200
--- xpaint-2.8.19.1/app-defaults/XPaint_es.ad.in 2010-04-07 09:10:58.000000000 +0200
***************
*** 243,248 ****
--- 243,249 ----
*close.label: Cerrar
*apply.label: Aplicar
*hidden.label: Archivos Escondidos
+ *ongoing.label: Continuo
*alert.title: Atención
Canvas*fatbits.title: XPaint / Editor de Detalles
***************
*** 356,362 ****
xpaint*toolbox*canvas*open.label: Abrir Imagen...
xpaint*toolbox*canvas*loaded.label: Archivos Cargados...
xpaint*toolbox*canvas*magnifier.label: Lupa...
! xpaint*toolbox*canvas*snapshot.label: Captura de Pantalla...
xpaint*toolbox*canvas*about.label: Respecto a...
xpaint*toolbox*canvas*quit.label: Cerrar XPaint
xpaint*toolbox*other.label: Pincel
--- 357,363 ----
xpaint*toolbox*canvas*open.label: Abrir Imagen...
xpaint*toolbox*canvas*loaded.label: Archivos Cargados...
xpaint*toolbox*canvas*magnifier.label: Lupa...
! xpaint*toolbox*canvas*screenshot.label: Captura de Pantalla...
xpaint*toolbox*canvas*about.label: Respecto a...
xpaint*toolbox*canvas*quit.label: Cerrar XPaint
xpaint*toolbox*other.label: Pincel
***************
*** 592,598 ****
Canvas*menu*edit*alphaset.label: Guardar como canal alpha
Canvas*menu*edit*alphadel.label: Suprimir canal alpha
Canvas*menu*edit*alphaedit.label: Editar canal alpha
! Canvas*menu*edit*snapshot.label: Capturar...
Canvas*menu*line.label: Trazo
Canvas*menu*line*linestyle.label: Tipos de Líneas...
--- 593,599 ----
Canvas*menu*edit*alphaset.label: Guardar como canal alpha
Canvas*menu*edit*alphadel.label: Suprimir canal alpha
Canvas*menu*edit*alphaedit.label: Editar canal alpha
! Canvas*menu*edit*screenshot.label: Capturar...
Canvas*menu*line.label: Trazo
Canvas*menu*line*linestyle.label: Tipos de Líneas...
***************
*** 718,724 ****
*paintBox*popup-menu.Edit-right.alphaset.label: Guardar como canal alpha
*paintBox*popup-menu.Edit-right.alphadel.label: Suprimir canal alpha
*paintBox*popup-menu.Edit-right.alphaedit.label: Editar canal alpha
! *paintBox*popup-menu.Edit-right.snapshot.label: Capturar...
! popup Line Menu
*paintBox*popup-menu.Line.label: Trazo
--- 719,725 ----
*paintBox*popup-menu.Edit-right.alphaset.label: Guardar como canal alpha
*paintBox*popup-menu.Edit-right.alphadel.label: Suprimir canal alpha
*paintBox*popup-menu.Edit-right.alphaedit.label: Editar canal alpha
! *paintBox*popup-menu.Edit-right.screenshot.label: Capturar...
! popup Line Menu
*paintBox*popup-menu.Line.label: Trazo
diff -rc xpaint-2.8.19/app-defaults/XPaint_fr.ad.in xpaint-2.8.19.1/app-defaults/XPaint_fr.ad.in
*** xpaint-2.8.19/app-defaults/XPaint_fr.ad.in 2010-04-03 09:34:22.000000000 +0200
--- xpaint-2.8.19.1/app-defaults/XPaint_fr.ad.in 2010-04-07 09:09:39.000000000 +0200
***************
*** 245,250 ****
--- 245,251 ----
*close.label: Fermer
*apply.label: Appliquer
*hidden.label: Fichiers cachés
+ *ongoing.label: Continu
*alert.title: Attention
Canvas*fatbits.title: XPaint / Editeur de Détails
***************
*** 354,360 ****
xpaint*toolbox*canvas*open.label: Ouvrir Image...
xpaint*toolbox*canvas*loaded.label: Fichiers chargés...
xpaint*toolbox*canvas*magnifier.label: Loupe...
! xpaint*toolbox*canvas*snapshot.label: Capture d'Ecran...
xpaint*toolbox*canvas*about.label: A Propos...
xpaint*toolbox*canvas*quit.label: Quitter XPaint
xpaint*toolbox*other.label: Pinceau
--- 355,361 ----
xpaint*toolbox*canvas*open.label: Ouvrir Image...
xpaint*toolbox*canvas*loaded.label: Fichiers chargés...
xpaint*toolbox*canvas*magnifier.label: Loupe...
! xpaint*toolbox*canvas*screenshot.label: Capture d'Ecran...
xpaint*toolbox*canvas*about.label: A Propos...
xpaint*toolbox*canvas*quit.label: Quitter XPaint
xpaint*toolbox*other.label: Pinceau
***************
*** 589,595 ****
Canvas*menu*edit*alphaset.label: Copier vers canal alpha
Canvas*menu*edit*alphadel.label: Supprimer canal alpha
Canvas*menu*edit*alphaedit.label: Editer canal alpha
! Canvas*menu*edit*snapshot.label: Capturer...
Canvas*menu*line.label: Trait
Canvas*menu*line*linestyle.label: Style de Ligne...
--- 590,596 ----
Canvas*menu*edit*alphaset.label: Copier vers canal alpha
Canvas*menu*edit*alphadel.label: Supprimer canal alpha
Canvas*menu*edit*alphaedit.label: Editer canal alpha
! Canvas*menu*edit*screenshot.label: Capturer...
Canvas*menu*line.label: Trait
Canvas*menu*line*linestyle.label: Style de Ligne...
***************
*** 715,721 ****
*paintBox*popup-menu.Edit-right.alphaset.label: Copier vers canal alpha
*paintBox*popup-menu.Edit-right.alphadel.label: Supprimer canal alpha
*paintBox*popup-menu.Edit-right.alphaedit.label: Editer canal alpha
! *paintBox*popup-menu.Edit-right.snapshot.label: Capturer...
! popup Line Menu
*paintBox*popup-menu.Line.label: Trait
*paintBox*popup-menu.Line-right.label: Trait
--- 716,722 ----
*paintBox*popup-menu.Edit-right.alphaset.label: Copier vers canal alpha
*paintBox*popup-menu.Edit-right.alphadel.label: Supprimer canal alpha
*paintBox*popup-menu.Edit-right.alphaedit.label: Editer canal alpha
! *paintBox*popup-menu.Edit-right.screenshot.label: Capturer...
! popup Line Menu
*paintBox*popup-menu.Line.label: Trait
*paintBox*popup-menu.Line-right.label: Trait
diff -rc xpaint-2.8.19/fileBrowser.c xpaint-2.8.19.1/fileBrowser.c
*** xpaint-2.8.19/fileBrowser.c 2010-04-05 17:24:35.000000000 +0200
--- xpaint-2.8.19.1/fileBrowser.c 2010-04-07 09:08:18.000000000 +0200
***************
*** 288,294 ****
char dirname[MAX_PATH];
Widget shell, list, browser, parent,
form, title_w, name, vport,
! home, root, dot, hidden, cwd_w, info, ok, cancel,
refresh, delete, edit, create,
dpilabel, dpi, zoomlabel, zoom,
alphalabel, alphaleft, alpha, alpharight,
--- 288,294 ----
char dirname[MAX_PATH];
Widget shell, list, browser, parent,
form, title_w, name, vport,
! home, root, dot, hidden, ongoing, cwd_w, info, ok, cancel,
refresh, delete, edit, create,
dpilabel, dpi, zoomlabel, zoom,
alphalabel, alphaleft, alpha, alpharight,
***************
*** 394,399 ****
--- 394,403 ----
XtMoveWidget(l->root, 30, height-84);
XtMoveWidget(l->dot, 55, height-84);
XtMoveWidget(l->hidden, 80, height-84);
+ if (l->ongoing) {
+ XtVaGetValues(l->hidden, XtNwidth, &width1, NULL);
+ XtMoveWidget(l->ongoing, 80+width1+3, height-84);
+ }
XtMoveWidget(l->cwd_w, x, height-52);
XtMoveWidget(l->info, x, height-30);
return;
***************
*** 682,690 ****
--- 686,699 ----
char *cp;
char *nm;
int zoom = Global.default_zoom, zoom_prev = Global.default_zoom;
+ Boolean ongoing;
static char buf[20];
static int np = 0;
+ ongoing = False;
+ if (arg->ongoing)
+ XtVaGetValues(arg->ongoing, XtNstate, &ongoing, NULL);
+
XtVaGetValues(arg->name, XtNstring, &str, NULL);
if (str == NULL || *str == '\0') {
XawListReturnStruct *lr = XawListShowCurrent(arg->list);
***************
*** 708,714 ****
}
if ((cp = strrchr(file, '/')) != NULL) {
*cp = '\0';
! if (stat(file, &statbuf) >= 0 && (statbuf.st_mode & S_IFDIR) != 0) {
if (arg->browserType != LOADED || arg->isToRefresh)
setCWD(arg, file);
if (arg->browserType != LOADED)
--- 717,724 ----
}
if ((cp = strrchr(file, '/')) != NULL) {
*cp = '\0';
! if (stat(file, &statbuf) >= 0 && (statbuf.st_mode & S_IFDIR) != 0 &&
! !ongoing) {
if (arg->browserType != LOADED || arg->isToRefresh)
setCWD(arg, file);
if (arg->browserType != LOADED)
***************
*** 721,727 ****
arg->oldwidth = 0;
if (arg->browserType == LOADED) {
! char *dpistr, *pagestr, *zoomstr, *alphastr, *bboxstr;
Widget paint = GetNonDirtyCanvas();
XtVaGetValues(arg->dpi, XtNstring, &dpistr, NULL);
XtVaGetValues(arg->page, XtNstring, &pagestr, NULL);
--- 731,737 ----
arg->oldwidth = 0;
if (arg->browserType == LOADED) {
! char *dpistr, *pagestr, *zoomstr, *alphastr, *bboxstr;
Widget paint = GetNonDirtyCanvas();
XtVaGetValues(arg->dpi, XtNstring, &dpistr, NULL);
XtVaGetValues(arg->page, XtNstring, &pagestr, NULL);
***************
*** 751,758 ****
return;
} else
XtVaSetValues(arg->zoom, XtNstring, ZoomToStr(zoom), NULL);
! } else
! XtPopdown(GetShell(w));
if (arg->isSimple) {
if (arg->okFunc != NULL)
--- 761,781 ----
return;
} else
XtVaSetValues(arg->zoom, XtNstring, ZoomToStr(zoom), NULL);
! } else {
! if (ongoing) {
! Widget paint = GetNonDirtyCanvas();
! int oldzoom = Global.default_zoom;
! if (paint) {
! XtVaGetValues(paint, XtNzoom, &zoom, NULL);
! Global.default_zoom = zoom;
! loadPrescribedFile(paint, file);
! setZoomButtonLabel(paint, zoom);
! Global.default_zoom = oldzoom;
! return;
! }
! } else
! XtPopdown(GetShell(w));
! }
if (arg->isSimple) {
if (arg->okFunc != NULL)
***************
*** 1180,1185 ****
--- 1203,1219 ----
XtNvertDistance, 0,
XtNheight, 20,
NULL);
+ if (arg->browserType)
+ arg->ongoing = None;
+ else
+ arg->ongoing = XtVaCreateManagedWidget("ongoing",
+ toggleWidgetClass, form,
+ XtNfromVert, vport,
+ XtNfromHoriz, arg->hidden,
+ XtNhorizDistance, 4,
+ XtNvertDistance, 0,
+ XtNheight, 20,
+ NULL);
}
cwd = XtVaCreateManagedWidget("cwd",
diff -rc xpaint-2.8.19/Filelist xpaint-2.8.19.1/Filelist
*** xpaint-2.8.19/Filelist 2010-03-12 08:28:13.000000000 +0100
--- xpaint-2.8.19.1/Filelist 2010-04-07 07:41:44.000000000 +0200
***************
*** 36,42 ****
./protocol.c
./readRC.c
./size.c
! ./snapshot.c
./text.c
./texture.c
./typeConvert.c
--- 36,42 ----
./protocol.c
./readRC.c
./size.c
! ./screenshot.c
./text.c
./texture.c
./typeConvert.c
diff -rc xpaint-2.8.19/graphic.c xpaint-2.8.19.1/graphic.c
*** xpaint-2.8.19/graphic.c 2010-04-05 16:45:18.000000000 +0200
--- xpaint-2.8.19.1/graphic.c 2010-04-07 08:44:36.000000000 +0200
***************
*** 291,297 ****
MI_SIMPLE("alphaedit"),
MI_SEPARATOR(), /* 23 */
#define EDIT_SNAPSHOT 24
! MI_SIMPLE("snapshot"),
};
static PaintMenuItem lineMenu[] =
--- 291,297 ----
MI_SIMPLE("alphaedit"),
MI_SEPARATOR(), /* 23 */
#define EDIT_SNAPSHOT 24
! MI_SIMPLE("screenshot"),
};
static PaintMenuItem lineMenu[] =
***************
*** 583,589 ****
MI_SIMPLE("alphaedit"),
MI_SEPARATOR(), /* 24 */
#define P_EDIT_SNAPSHOT 25
! MI_SIMPLE("snapshot"),
};
static PaintMenuItem popupLineMenu[] =
--- 583,589 ----
MI_SIMPLE("alphaedit"),
MI_SEPARATOR(), /* 24 */
#define P_EDIT_SNAPSHOT 25
! MI_SIMPLE("screenshot"),
};
static PaintMenuItem popupLineMenu[] =
***************
*** 5259,5265 ****
ADDCALLBACK(editMenu, EDIT_ERASE_ALL, paint, StdEraseAllCallback);
ADDCALLBACK(editMenu, EDIT_CLONE_CANVAS, paint, StdCloneCanvasCallback);
ADDCALLBACK(editMenu, EDIT_CLONE_CANVAS1, paint, StdCloneCanvasCallback);
! ADDCALLBACK(editMenu, EDIT_SNAPSHOT, info, StdSnapshotCallback);
ADDCALLBACK(editMenu, EDIT_ALPHASET, paint, setAlpha);
ADDCALLBACK(editMenu, EDIT_ALPHADEL, paint, deleteAlpha);
ADDCALLBACK(editMenu, EDIT_ALPHAEDIT, paint, editAlpha);
--- 5259,5265 ----
ADDCALLBACK(editMenu, EDIT_ERASE_ALL, paint, StdEraseAllCallback);
ADDCALLBACK(editMenu, EDIT_CLONE_CANVAS, paint, StdCloneCanvasCallback);
ADDCALLBACK(editMenu, EDIT_CLONE_CANVAS1, paint, StdCloneCanvasCallback);
! ADDCALLBACK(editMenu, EDIT_SNAPSHOT, info, StdScreenshotCallback);
ADDCALLBACK(editMenu, EDIT_ALPHASET, paint, setAlpha);
ADDCALLBACK(editMenu, EDIT_ALPHADEL, paint, deleteAlpha);
ADDCALLBACK(editMenu, EDIT_ALPHAEDIT, paint, editAlpha);
***************
*** 5568,5573 ****
--- 5568,5574 ----
strcpy(cp, file);
paint->paint.filename = cp;
EnableRevert((Widget) paint);
+ XtVaSetValues((Widget)paint, XtNdirty, False, NULL);
if (file_isSpecialImage) {
GetFileName(Global.toplevel, 4, NULL, NULL, NULL);
SetEditable((Widget)paint,
***************
*** 6187,6193 ****
}
void
! StdSnapshotCallback(Widget w, XtPointer paintArg, XtPointer junk)
{
LocalInfo * info = (LocalInfo *) paintArg;
Widget paint;
--- 6188,6194 ----
}
void
! StdScreenshotCallback(Widget w, XtPointer paintArg, XtPointer junk)
{
LocalInfo * info = (LocalInfo *) paintArg;
Widget paint;
***************
*** 6201,6207 ****
Pixel pixel;
#endif
! /* Disable snapshot from FatBits !! */
if (!info) return;
paint = info->paint;
--- 6202,6208 ----
Pixel pixel;
#endif
! /* Disable screenshot from FatBits !! */
if (!info) return;
paint = info->paint;
***************
*** 6258,6265 ****
selection = selectionOwner;
selectionOwner = True;
! /* Now, really start snapshot ! */
! SnapshotImage(paint, pw, 1);
selectionOwner = selection;
}
--- 6259,6266 ----
selection = selectionOwner;
selectionOwner = True;
! /* Now, really start screenshot ! */
! ScreenshotImage(paint, pw, 1);
selectionOwner = selection;
}
***************
*** 7201,7207 ****
ADDCALLBACK(popupEditMenu, P_EDIT_ALPHASET, paint, setAlpha);
ADDCALLBACK(popupEditMenu, P_EDIT_ALPHADEL, paint, deleteAlpha);
ADDCALLBACK(popupEditMenu, P_EDIT_ALPHAEDIT, paint, editAlpha);
! ADDCALLBACK(popupEditMenu, P_EDIT_SNAPSHOT, info, StdSnapshotCallback);
ADDCALLBACK(popupTextMenu, P_FONT_SELECT, info, StdFontSet);
ADDCALLBACK(popupTextMenu, P_FONT_WRITE, info, StdWriteText);
--- 7202,7208 ----
ADDCALLBACK(popupEditMenu, P_EDIT_ALPHASET, paint, setAlpha);
ADDCALLBACK(popupEditMenu, P_EDIT_ALPHADEL, paint, deleteAlpha);
ADDCALLBACK(popupEditMenu, P_EDIT_ALPHAEDIT, paint, editAlpha);
! ADDCALLBACK(popupEditMenu, P_EDIT_SNAPSHOT, info, StdScreenshotCallback);
ADDCALLBACK(popupTextMenu, P_FONT_SELECT, info, StdFontSet);
ADDCALLBACK(popupTextMenu, P_FONT_WRITE, info, StdWriteText);
diff -rc xpaint-2.8.19/Imakefile xpaint-2.8.19.1/Imakefile
*** xpaint-2.8.19/Imakefile 2010-03-13 08:46:00.000000000 +0100
--- xpaint-2.8.19.1/Imakefile 2010-04-07 07:37:45.000000000 +0200
***************
*** 30,42 ****
fileBrowser.c fontSelect.c grab.c graphic.c hash.c help.c \
image.c imageComp.c iprocess.c magnifier.c main.c menu.c misc.c \
operation.c palette.c pattern.c print.c protocol.c readRC.c \
! snapshot.c text.c texture.c typeConvert.c
XPOBJ = chroma.o color.o colorEdit.o dialog.o fatBitsEdit.o \
fileBrowser.o fontSelect.o grab.o graphic.o hash.o help.o \
image.o imageComp.o iprocess.o magnifier.o main.o menu.o misc.o \
operation.o palette.o pattern.o print.o protocol.o readRC.o \
! snapshot.o text.o texture.o typeConvert.o
OPSRC = arcOp.c freehandOp.c boxOp.c brushOp.c circleOp.c fillOp.c \
fontOp.c lineOp.c pencilOp.c polygonOp.c splineOp.c selectOp.c \
--- 30,42 ----
fileBrowser.c fontSelect.c grab.c graphic.c hash.c help.c \
image.c imageComp.c iprocess.c magnifier.c main.c menu.c misc.c \
operation.c palette.c pattern.c print.c protocol.c readRC.c \
! screenshot.c text.c texture.c typeConvert.c
XPOBJ = chroma.o color.o colorEdit.o dialog.o fatBitsEdit.o \
fileBrowser.o fontSelect.o grab.o graphic.o hash.o help.o \
image.o imageComp.o iprocess.o magnifier.o main.o menu.o misc.o \
operation.o palette.o pattern.o print.o protocol.o readRC.o \
! screenshot.o text.o texture.o typeConvert.o
OPSRC = arcOp.c freehandOp.c boxOp.c brushOp.c circleOp.c fillOp.c \
fontOp.c lineOp.c pencilOp.c polygonOp.c splineOp.c selectOp.c \
***************
*** 297,303 ****
$(XBMDIR)/wait3.xbm $(XBMDIR)/wait4.xbm
readRC.o: image.h rc.h misc.h DefaultRC.txt.h
size.o: Paint.h messages.h misc.h text.h
! snapshot.o: Paint.h image.h messages.h
text.o: misc.h protocol.h text.h
typeConvert.o: palette.h misc.h
fontOp.o: xpaint.h Paint.h graphic.h misc.h ops.h
--- 297,303 ----
$(XBMDIR)/wait3.xbm $(XBMDIR)/wait4.xbm
readRC.o: image.h rc.h misc.h DefaultRC.txt.h
size.o: Paint.h messages.h misc.h text.h
! screenshot.o: Paint.h image.h messages.h
text.o: misc.h protocol.h text.h
typeConvert.o: palette.h misc.h
fontOp.o: xpaint.h Paint.h graphic.h misc.h ops.h
diff -rc xpaint-2.8.19/main.c xpaint-2.8.19.1/main.c
*** xpaint-2.8.19/main.c 2010-04-05 15:39:44.000000000 +0200
--- xpaint-2.8.19.1/main.c 2010-04-07 07:38:41.000000000 +0200
***************
*** 105,111 ****
Boolean fullmenu;
Boolean menubar;
Boolean canvas;
! Boolean snapshot;
Boolean magnifier;
Boolean horizontal;
Boolean nowarn;
--- 105,111 ----
Boolean fullmenu;
Boolean menubar;
Boolean canvas;
! Boolean screenshot;
Boolean magnifier;
Boolean horizontal;
Boolean nowarn;
***************
*** 164,171 ****
XtOffset(AppInfo *, menubar), XtRImmediate, (XtPointer) True},
{"canvas", "Canvas", XtRBoolean, sizeof(Boolean),
XtOffset(AppInfo *, canvas), XtRImmediate, (XtPointer) False},
! {"snapshot", "Snapshot", XtRBoolean, sizeof(Boolean),
! XtOffset(AppInfo *, snapshot), XtRImmediate, (XtPointer) False},
{"magnifier", "Magnifier", XtRBoolean, sizeof(Boolean),
XtOffset(AppInfo *, magnifier), XtRImmediate, (XtPointer) False},
{"horizontal", "Horizontal", XtRBoolean, sizeof(Boolean),
--- 164,171 ----
XtOffset(AppInfo *, menubar), XtRImmediate, (XtPointer) True},
{"canvas", "Canvas", XtRBoolean, sizeof(Boolean),
XtOffset(AppInfo *, canvas), XtRImmediate, (XtPointer) False},
! {"screenshot", "Screenshot", XtRBoolean, sizeof(Boolean),
! XtOffset(AppInfo *, screenshot), XtRImmediate, (XtPointer) False},
{"magnifier", "Magnifier", XtRBoolean, sizeof(Boolean),
XtOffset(AppInfo *, magnifier), XtRImmediate, (XtPointer) False},
{"horizontal", "Horizontal", XtRBoolean, sizeof(Boolean),
***************
*** 203,209 ****
{"-menubar", ".menubar", XrmoptionNoArg, (XtPointer) "True"},
{"-nomenubar", ".menubar", XrmoptionNoArg, (XtPointer) "False"},
{"-canvas", ".canvas", XrmoptionNoArg, (XtPointer) "True"},
! {"-snapshot", ".snapshot", XrmoptionNoArg, (XtPointer) "True"},
{"-magnifier", ".magnifier", XrmoptionNoArg, (XtPointer) "True"},
{"-horizontal", ".horizontal", XrmoptionNoArg, (XtPointer) "True"},
{"-nowarn", ".nowarn", XrmoptionNoArg, (XtPointer) "True"},
--- 203,209 ----
{"-menubar", ".menubar", XrmoptionNoArg, (XtPointer) "True"},
{"-nomenubar", ".menubar", XrmoptionNoArg, (XtPointer) "False"},
{"-canvas", ".canvas", XrmoptionNoArg, (XtPointer) "True"},
! {"-screenshot", ".screenshot", XrmoptionNoArg, (XtPointer) "True"},
{"-magnifier", ".magnifier", XrmoptionNoArg, (XtPointer) "True"},
{"-horizontal", ".horizontal", XrmoptionNoArg, (XtPointer) "True"},
{"-nowarn", ".nowarn", XrmoptionNoArg, (XtPointer) "True"},
***************
*** 924,930 ****
/*
** GRR 960525: check depth and warn user (use AlertBox() instead?)
*/
! if (!appInfo.nowarn && !appInfo.snapshot) {
int depth = Global.vis.depth;
/* XtVaGetValues(toplevel, XtNdepth, &depth, NULL); */
--- 924,930 ----
/*
** GRR 960525: check depth and warn user (use AlertBox() instead?)
*/
! if (!appInfo.nowarn && !appInfo.screenshot) {
int depth = Global.vis.depth;
/* XtVaGetValues(toplevel, XtNdepth, &depth, NULL); */
***************
*** 1004,1011 ****
&Global.default_width, &Global.default_height);
Global.default_zoom = GetInitZoom();
! if (appInfo.snapshot) {
! SnapshotImage(toplevel, NULL, 0);
}
if (appInfo.magnifier) {
--- 1004,1011 ----
&Global.default_width, &Global.default_height);
Global.default_zoom = GetInitZoom();
! if (appInfo.screenshot) {
! ScreenshotImage(toplevel, NULL, 0);
}
if (appInfo.magnifier) {
diff -rc xpaint-2.8.19/misc.h xpaint-2.8.19.1/misc.h
*** xpaint-2.8.19/misc.h 2010-04-05 16:42:12.000000000 +0200
--- xpaint-2.8.19.1/misc.h 2010-04-07 07:42:56.000000000 +0200
***************
*** 212,224 ****
extern void InitTypeConverters(void);
/* operation.c */
! extern void takeSnapshot(Widget w, XtPointer junk, XtPointer junk2);
extern void exitPaint(Widget w, XtPointer junk, XtPointer junk2);
extern void setToolIconOnWidget(Widget w);
extern void OperationSet(String names[], int num);
/* snapshot.c */
! extern void SnapshotImage(Widget w, XtPointer paintArg, int flag);
/* brushOp.c */
--- 212,224 ----
extern void InitTypeConverters(void);
/* operation.c */
! extern void takeScreenshot(Widget w, XtPointer junk, XtPointer junk2);
extern void exitPaint(Widget w, XtPointer junk, XtPointer junk2);
extern void setToolIconOnWidget(Widget w);
extern void OperationSet(String names[], int num);
/* snapshot.c */
! extern void ScreenshotImage(Widget w, XtPointer paintArg, int flag);
/* brushOp.c */
diff -rc xpaint-2.8.19/operation.c xpaint-2.8.19.1/operation.c
*** xpaint-2.8.19/operation.c 2010-03-11 14:31:38.000000000 +0100
--- xpaint-2.8.19.1/operation.c 2010-04-07 07:44:03.000000000 +0200
***************
*** 588,594 ****
**
*/
void
! takeSnapshot(Widget w, XtPointer junk, XtPointer junk2)
{
if (XtParent(w)) w = GetToplevel(XtParent(w));
if (w) {
--- 588,594 ----
**
*/
void
! takeScreenshot(Widget w, XtPointer junk, XtPointer junk2)
{
if (XtParent(w)) w = GetToplevel(XtParent(w));
if (w) {
***************
*** 596,602 ****
XUnmapWindow(XtDisplay(Global.toplevel), XtWindow(Global.toplevel));
XFlush(XtDisplay(Global.toplevel));
usleep(200000);
! SnapshotImage(w, junk, 0);
XMapWindow(XtDisplay(Global.toplevel), XtWindow(Global.toplevel));
}
}
--- 596,602 ----
XUnmapWindow(XtDisplay(Global.toplevel), XtWindow(Global.toplevel));
XFlush(XtDisplay(Global.toplevel));
usleep(200000);
! ScreenshotImage(w, junk, 0);
XMapWindow(XtDisplay(Global.toplevel), XtWindow(Global.toplevel));
}
}
***************
*** 1321,1327 ****
MI_SIMPLECB("open", GraphicCreate, 2),
MI_SIMPLECB("loaded", GraphicCreate, 3),
MI_SIMPLECB("magnifier", GraphicCreate, 4),
! MI_SIMPLECB("snapshot", takeSnapshot, NULL),
MI_SEPARATOR(),
MI_SIMPLECB("quit", exitPaint, NULL),
};
--- 1321,1327 ----
MI_SIMPLECB("open", GraphicCreate, 2),
MI_SIMPLECB("loaded", GraphicCreate, 3),
MI_SIMPLECB("magnifier", GraphicCreate, 4),
! MI_SIMPLECB("screenshot", takeScreenshot, NULL),
MI_SEPARATOR(),
MI_SIMPLECB("quit", exitPaint, NULL),
};
diff -rc xpaint-2.8.19/region.h xpaint-2.8.19.1/region.h
*** xpaint-2.8.19/region.h 2010-01-31 11:13:07.000000000 +0100
--- xpaint-2.8.19.1/region.h 2010-04-07 07:43:06.000000000 +0200
***************
*** 3,9 ****
/* cutCopyPaste.c */
void StdCopyCallback(Widget w, XtPointer paintArg, String * nm, XEvent * event);
void StdPasteCallback(Widget w, XtPointer paintArg, XtPointer junk);
! void StdSnapshotCallback(Widget w, XtPointer paintArg, XtPointer junk);
void StdMemorySetCallback(Widget w, XtPointer paintArg, XtPointer junk);
void StdMemoryRecallCallback(Widget w, XtPointer paintArg, XtPointer junk);
void StdMemoryRemoveCallback(Widget w, XtPointer paintArg, XtPointer junk);
--- 3,9 ----
/* cutCopyPaste.c */
void StdCopyCallback(Widget w, XtPointer paintArg, String * nm, XEvent * event);
void StdPasteCallback(Widget w, XtPointer paintArg, XtPointer junk);
! void StdScreenshotCallback(Widget w, XtPointer paintArg, XtPointer junk);
void StdMemorySetCallback(Widget w, XtPointer paintArg, XtPointer junk);
void StdMemoryRecallCallback(Widget w, XtPointer paintArg, XtPointer junk);
void StdMemoryRemoveCallback(Widget w, XtPointer paintArg, XtPointer junk);
***************
*** 60,66 ****
void ccpAddCopy(Widget w, Widget paint);
void ccpAddPaste(Widget w, Widget paint);
void ccpAddClear(Widget w, Widget paint);
! void ccpAddSnapshot(Widget w, Widget paint);
void ccpAddDuplicate(Widget w, Widget paint);
void ccpAddSelectAll(Widget w, Widget paint);
void ccpAddEraseAll(Widget w, Widget paint);
--- 60,66 ----
void ccpAddCopy(Widget w, Widget paint);
void ccpAddPaste(Widget w, Widget paint);
void ccpAddClear(Widget w, Widget paint);
! void ccpAddScreenshot(Widget w, Widget paint);
void ccpAddDuplicate(Widget w, Widget paint);
void ccpAddSelectAll(Widget w, Widget paint);
void ccpAddEraseAll(Widget w, Widget paint);
diff -rc xpaint-2.8.19/screenshot.c xpaint-2.8.19.1/screenshot.c
*** xpaint-2.8.19/screenshot.c 2010-04-07 09:51:56.803500287 +0200
--- xpaint-2.8.19.1/screenshot.c 2010-04-07 07:37:15.000000000 +0200
***************
*** 0 ****
--- 1,430 ----
+ /*
+ * code taken from xsnap.c by:
+ *
+ * Copyright 1989 Clauss Strauch
+ * cbs at cad.cs.cmu.edu
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted.
+ * This software is provided "as is", without express or implied warranty.
+ *
+ */
+
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <sys/stat.h>
+ #include <X11/Xlib.h>
+ #include <X11/Xos.h>
+ #include <X11/Xutil.h>
+ #include <X11/cursorfont.h>
+ #include <X11/Intrinsic.h>
+ #include "Paint.h"
+ #include "image.h"
+ #include "graphic.h"
+ #include "messages.h"
+ #include "misc.h"
+ #include "region.h"
+
+ /* extern procedures */
+ extern Image * outputImage;
+ extern char *routine;
+
+ /* Leave arguments as globals, since there are so many of them.
+ * They'll only be referenced in process_args and main.
+ */
+ static Colormap private_cmap = 0;
+
+ /*
+ * createEventWindow returns the ID of a InputOnly window that covers
+ * the given window.
+ */
+
+ Window createEventWindow(Display *dpy, Window win, int init_cursor)
+ {
+ XSetWindowAttributes xswa;
+ unsigned long xswvaluemask;
+ Window root_win;
+ Window event_window;
+ unsigned int win_width, win_height;
+ unsigned int win_border_width, win_depth;
+ int win_x, win_y;
+
+ /* get the geometry of the window */
+
+ XGetGeometry(dpy, win, &root_win, &win_x, &win_y,
+ &win_width, &win_height, &win_border_width, &win_depth);
+
+ /* make an input only window to get events from */
+
+ xswa.cursor = init_cursor;
+ xswa.override_redirect = True;
+ xswa.event_mask = ButtonPressMask | ButtonReleaseMask | Button1MotionMask;
+ xswvaluemask = CWCursor | CWOverrideRedirect | CWEventMask;
+ event_window = XCreateWindow(dpy, win, win_x, win_y, win_width,
+ win_height, 0, 0, InputOnly, CopyFromParent,
+ xswvaluemask, &xswa);
+ return(event_window);
+ }
+
+ /*
+ * draw_box draws a box on the given window, with the given GC
+ *
+ */
+
+ void draw_box(Display *dpy, Window win, GC gc, int x1, int y1, int x2, int y2)
+ {
+ XSegment segments[4];
+ segments[0].x1 = (short)x1;
+ segments[0].y1 = (short)y1;
+ segments[0].x2 = (short)x1;
+ segments[0].y2 = (short)y2;
+
+ segments[1].x1 = (short)x1;
+ segments[1].y1 = (short)y1;
+ segments[1].x2 = (short)x2;
+ segments[1].y2 = (short)y1;
+
+ segments[2].x1 = (short)x2;
+ segments[2].y1 = (short)y2;
+ segments[2].x2 = (short)x1;
+ segments[2].y2 = (short)y2;
+
+ segments[3].x1 = (short)x2;
+ segments[3].y1 = (short)y2;
+ segments[3].x2 = (short)x2;
+ segments[3].y2 = (short)y1;
+
+ XDrawSegments(dpy, win, gc, segments, 4);
+ }
+
+ /*
+ * get_region
+ * takes as input:
+ * dpy
+ * win to get region from
+ * pointers to x1, y1, width, height
+ *
+ * returns: the position and width and height of a
+ * user selected region via the given pointers.
+ *
+ */
+
+ void
+ find_window(Display *dpy, int flag, int x, int y,
+ int *u, int *v, int *width, int *height)
+ {
+ XWindowAttributes wa;
+ Window findW = DefaultRootWindow(dpy), stopW = 0, childW, initW;
+
+ XTranslateCoordinates(dpy, findW, findW, x, y, &x, &y, &stopW);
+
+ if (stopW)
+ initW = stopW;
+ else
+ initW = findW;
+
+ while (stopW) {
+ XTranslateCoordinates(dpy, findW, stopW, x, y, &x, &y, &childW);
+ findW = stopW;
+ if (childW &&
+ XGetWindowAttributes(dpy, childW, &wa) &&
+ (wa.class != InputOutput))
+ break;
+ stopW = childW;
+ }
+
+ if (!flag)
+ findW = initW;
+
+ XGetWindowAttributes(dpy, findW, &wa);
+ *width = wa.width;
+ *height = wa.height;
+ private_cmap = wa.colormap;
+
+ XTranslateCoordinates(dpy, findW, DefaultRootWindow(dpy),
+ 0, 0, u, v, &stopW);
+ }
+
+ void get_region(Display *dpy, Window win,
+ int *x, int *y, unsigned *width, unsigned *height)
+ {
+ Window event_window;
+ Cursor up_right_curs, up_left_curs;
+ Cursor low_right_curs, low_left_curs;
+ Cursor current_cursor = None;
+ int done;
+ int init_x=0, init_y=0;
+ int last_x, last_y;
+ XEvent event;
+ GC xor_gc;
+ XGCValues xor_gc_values; /* for creating xor_gc */
+ unsigned long xor_gc_valuemask; /* valuemask for creating xor_gc */
+
+ /* make the GC and cursors we'll need */
+
+ up_right_curs = XCreateFontCursor(dpy, XC_ur_angle);
+
+ up_left_curs = XCreateFontCursor(dpy, XC_ul_angle);
+
+ low_right_curs = XCreateFontCursor(dpy, XC_lr_angle);
+
+ low_left_curs = XCreateFontCursor(dpy, XC_ll_angle);
+
+ xor_gc_valuemask = GCFunction | GCSubwindowMode | GCForeground;
+ xor_gc_values.function = GXxor;
+ xor_gc_values.foreground = 0xfd;
+ xor_gc_values.subwindow_mode = IncludeInferiors;
+ xor_gc = XCreateGC(dpy, win, xor_gc_valuemask, &xor_gc_values);
+
+ event_window = createEventWindow(dpy, win, up_left_curs);
+ XMapRaised(dpy, event_window);
+
+ if (XGrabPointer(dpy, event_window, True,
+ ButtonPressMask,
+ GrabModeAsync, GrabModeAsync, None, up_left_curs,
+ CurrentTime) != 0) {
+ fprintf(stderr, "%s", msgText[CANNOT_GRAB_POINTER]);
+ return;
+ }
+
+ /* get the initial button press */
+ done = 0;
+ while (done == 0) {
+ XNextEvent(dpy, &event);
+ switch(event.type) {
+ case MappingNotify:
+ XRefreshKeyboardMapping((XMappingEvent *)&event);
+ break;
+ case ButtonPress:
+ if (event.xbutton.button == 1) {
+ init_x = event.xbutton.x;
+ init_y = event.xbutton.y;
+ done = 1;
+ break;
+ }
+ if (event.xbutton.button == 2) {
+ init_x = event.xbutton.x;
+ init_y = event.xbutton.y;
+ done = 2;
+ break;
+ }
+ if (event.xbutton.button == 3) {
+ *width = 0;
+ *height = 0;
+ done = -1;
+ break;
+ }
+ }
+ }
+
+ /* now we have the location of one corner of the box. change the cursor,
+ * and have the user drag out the area.
+ */
+ last_x = init_x;
+ last_y = init_y;
+ if (done == 1) {
+ current_cursor = low_right_curs;
+ XChangeActivePointerGrab(dpy, ButtonReleaseMask | Button1MotionMask,
+ current_cursor, CurrentTime);
+ done = 0;
+ draw_box(dpy, win, xor_gc, init_x, init_y, last_x, last_y);
+ }
+ while (!done) {
+ XNextEvent(dpy, &event);
+ switch(event.type) {
+ case MappingNotify:
+ XRefreshKeyboardMapping((XMappingEvent *)&event);
+ break;
+ case MotionNotify:
+ draw_box(dpy, win, xor_gc,
+ init_x, init_y, last_x, last_y); /* erase old */
+ last_x = event.xmotion.x;
+ last_y = event.xmotion.y;
+ draw_box(dpy, win, xor_gc,
+ init_x, init_y, last_x, last_y); /* draw new */
+ /* Change cursor to correspond to position of pointer */
+ if ((init_x < last_x) && (init_y < last_y)
+ && (current_cursor != low_right_curs)) {
+ current_cursor = low_right_curs;
+ XChangeActivePointerGrab(dpy,
+ ButtonReleaseMask | Button1MotionMask,
+ low_right_curs, CurrentTime);
+ }
+ else if ((last_x < init_x) && (last_y < init_y)
+ && (current_cursor != up_left_curs)) {
+ current_cursor = up_left_curs;
+ XChangeActivePointerGrab(dpy,
+ ButtonReleaseMask | Button1MotionMask,
+ up_left_curs, CurrentTime);
+ }
+ else if ((init_x < last_x) && (last_y < init_y)
+ && (current_cursor != up_right_curs)) {
+ current_cursor = up_right_curs;
+ XChangeActivePointerGrab(dpy,
+ ButtonReleaseMask | Button1MotionMask,
+ up_right_curs, CurrentTime);
+ }
+ else if ((last_x < init_x) && (init_y < last_y)
+ && (current_cursor != low_left_curs)) {
+ current_cursor = low_left_curs;
+ XChangeActivePointerGrab(dpy,
+ ButtonReleaseMask | Button1MotionMask,
+ low_left_curs, CurrentTime);
+ }
+ break;
+ case ButtonRelease:
+ if (event.xbutton.button == 1) {
+ done = True;
+ draw_box(dpy, win, xor_gc,
+ init_x, init_y, last_x, last_y); /* erase last box drawn */
+ }
+ break;
+ }
+ }
+ XFlush(dpy); /* gets rid of last box on screen */
+ if (init_x < last_x)
+ *x = init_x;
+ else
+ *x = last_x;
+ if (init_y < last_y)
+ *y = init_y;
+ else
+ *y = last_y;
+ *width = (unsigned int)abs(last_x - init_x);
+ *height = (unsigned int)abs(last_y - init_y);
+
+ /* clean up after ourself: */
+
+ XDestroyWindow(dpy, event_window);
+ XFreeGC(dpy, xor_gc);
+
+ /* we'll let the caller ungrab the pointer */
+
+ if (done == 1) {
+ int u;
+ if (*width==0 && *height==0)
+ find_window(dpy, 0, init_x, init_y, x, y, (int*) width, (int*) height);
+ else
+ find_window(dpy, 0, init_x, init_y, &u, &u, &u, &u);
+ }
+
+ if (done == 2)
+ find_window(dpy, 1, init_x,init_y, x, y, (int*) width, (int*) height);
+ }
+
+ /*
+ * get_pixmap_region
+ *
+ * input :
+ * a dpy, a window, x, y, width, height, interactive.
+ * if interactive, the user is prompted for a region,
+ * other wise the given region is copied to a pixmap.
+ * returns : a pixmap containing a copy of a user-specified area
+ * of the given window;
+ *
+ */
+
+ Pixmap get_pixmap_region(Display *dpy, int screen, Window win, GC gc,
+ int *x, int *y,
+ unsigned *width, unsigned *height, unsigned *depth)
+ {
+ int reg_x, reg_y;
+ unsigned int reg_width, reg_height;
+ Pixmap pixmap_returned;
+ int junk_left, junk_top, junk_width, junk_height, junk_border_width;
+ Window junk_root;
+
+ get_region(dpy, win, ®_x, ®_y, ®_width, ®_height);
+ *x = reg_x;
+ *y = reg_y;
+ *width = reg_width;
+ *height = reg_height;
+
+ if (*width==0 || *height==0) return None;
+
+ /* Use the depth of `win' for the depth of the pixmap */
+
+ XGetGeometry (dpy, win, &junk_root, &junk_left, &junk_top,
+ (unsigned int*) &junk_width, (unsigned int*) &junk_height,
+ (unsigned int*) &junk_border_width, depth);
+
+ pixmap_returned = XCreatePixmap(dpy,
+ DefaultRootWindow(dpy),
+ *width, *height, *depth);
+
+ /* now copy the area we specified */
+
+ XCopyArea(dpy, win, pixmap_returned, gc, *x, *y,
+ *width, *height, 0, 0);
+ XUngrabPointer(dpy, CurrentTime);
+ return pixmap_returned;
+ }
+
+ void
+ ScreenshotImage(Widget w, XtPointer paintArg, int flag)
+ {
+ Display *dpy;
+ int screen;
+ GC copy_gc;
+ unsigned long copy_gc_valuemask;
+ XGCValues copy_gc_values;
+ Widget ww;
+ Window window_to_snap;
+ Pixmap snap_pixmap;
+ int reg_x, reg_y;
+ unsigned int reg_width, reg_height, reg_depth;
+ Image *image;
+
+ routine = "snapshot";
+ dpy = XtDisplayOfObject(w);
+ screen = DefaultScreen(dpy);
+ XSetErrorHandler(privateXErrorHandler);
+
+ /* start with root window for now */
+ window_to_snap = XRootWindow(dpy, screen);
+
+ /* make copy GC */
+
+ copy_gc_valuemask = GCSubwindowMode;
+ copy_gc_values.subwindow_mode = IncludeInferiors;
+ copy_gc = XCreateGC(dpy, window_to_snap, copy_gc_valuemask, ©_gc_values);
+
+ XFlush(dpy);
+ XGrabServer(dpy);
+
+ snap_pixmap = get_pixmap_region(dpy, screen,
+ window_to_snap, copy_gc,
+ ®_x, ®_y,
+ ®_width, ®_height,
+ ®_depth);
+
+ /* ungrab the server and free GC */
+ XUngrabServer(dpy);
+ XFreeGC(dpy, copy_gc);
+
+ if (!snap_pixmap || reg_width==0 || reg_height==0)
+ return;
+
+ if (paintArg) ww = (Widget)paintArg; else ww = w;
+ image = PixmapToImage(ww, snap_pixmap, private_cmap);
+ if (snap_pixmap) XFreePixmap(dpy, snap_pixmap);
+
+ if (!image) return;
+
+ if (flag) {
+ ClipboardSetImage(ww, image);
+ StdPasteCallback(ww, paintArg, (XtPointer) NULL);
+ XtVaSetValues(ww, XtNdirty, True, NULL);
+ }
+ else {
+ Widget paint;
+ snap_pixmap = None;
+ ImageToPixmap(image, w, &snap_pixmap, &private_cmap, 0);
+ paint = (Widget) graphicCreate(makeGraphicShell(w),
+ reg_width, reg_height, -1,
+ snap_pixmap, private_cmap, NULL);
+ if (snap_pixmap) XFreePixmap(dpy, snap_pixmap);
+ XtVaSetValues(paint, XtNdirty, True, NULL);
+ }
+ }
diff -rc xpaint-2.8.19/share/help/Help xpaint-2.8.19.1/share/help/Help
*** xpaint-2.8.19/share/help/Help 2010-03-06 23:13:52.000000000 +0100
--- xpaint-2.8.19.1/share/help/Help 2010-04-07 07:40:23.000000000 +0200
***************
*** 48,54 ****
image (embedded comments, time stamp, copyright, etc.) will always be lost.
#BEGIN command "2. Command Line Options"
! xpaint [-canvas] [-snapshot] [-magnifier] [-nowarn]
#NL
[-menubar] [-nomenubar] [-fullmenu] [-simplemenu]
#NL
--- 48,54 ----
image (embedded comments, time stamp, copyright, etc.) will always be lost.
#BEGIN command "2. Command Line Options"
! xpaint [-canvas] [-screenshot] [-magnifier] [-nowarn]
#NL
[-menubar] [-nomenubar] [-fullmenu] [-simplemenu]
#NL
***************
*** 102,108 ****
#NL
-canvas pop up an empty canvas on startup
#NL
! -snapshot open xpaint without any GUI, and take snapshot
#NL
-magnifier open xpaint in magnifier glass mode
#NL
--- 102,108 ----
#NL
-canvas pop up an empty canvas on startup
#NL
! -screenshot open xpaint without any GUI, and take screenshot
#NL
-magnifier open xpaint in magnifier glass mode
#NL
***************
*** 183,189 ****
#NL
in an error message.
! Take Snapshot...
#NL
Grab a rectangle from the root window and load
#NL
--- 183,189 ----
#NL
in an error message.
! Take Screenshot...
#NL
Grab a rectangle from the root window and load
#NL
diff -rc xpaint-2.8.19/share/help/Help_es xpaint-2.8.19.1/share/help/Help_es
*** xpaint-2.8.19/share/help/Help_es 2010-03-06 23:15:31.000000000 +0100
--- xpaint-2.8.19.1/share/help/Help_es 2010-04-07 07:40:55.000000000 +0200
***************
*** 21,27 ****
#BEGIN command "2. Opciones de la línea de comandos"
! xpaint [-canvas] [-snapshot] [-magnifier] [-nowarn]
#NL
[-menubar] [-nomenubar] [-fullmenu] [-simplemenu]
#NL
--- 21,27 ----
#BEGIN command "2. Opciones de la línea de comandos"
! xpaint [-canvas] [-screenshot] [-magnifier] [-nowarn]
#NL
[-menubar] [-nomenubar] [-fullmenu] [-simplemenu]
#NL
***************
*** 77,83 ****
#NL
-canvas abrir un lienzo blanco al inicio
#NL
! -snapshot abrir xpaint sin interfaz, en modo captura de pantalla
#NL
-magnifier abrir xpaint sin interfaz, en modo lupa
#NL
--- 77,83 ----
#NL
-canvas abrir un lienzo blanco al inicio
#NL
! -screenshot abrir xpaint sin interfaz, en modo captura de pantalla
#NL
-magnifier abrir xpaint sin interfaz, en modo lupa
#NL
diff -rc xpaint-2.8.19/share/help/Help_fr xpaint-2.8.19.1/share/help/Help_fr
*** xpaint-2.8.19/share/help/Help_fr 2010-03-06 23:13:02.000000000 +0100
--- xpaint-2.8.19.1/share/help/Help_fr 2010-04-07 07:40:40.000000000 +0200
***************
*** 68,74 ****
etc...) seront ignorés et donc perdus au moment de la sauvegarde.
#BEGIN command "2. Options de la ligne de commande"
! xpaint [-canvas] [-snapshot] [-magnifier] [-nowarn]
#NL
[-menubar] [-nomenubar] [-fullmenu] [-simplemenu]
#NL
--- 68,74 ----
etc...) seront ignorés et donc perdus au moment de la sauvegarde.
#BEGIN command "2. Options de la ligne de commande"
! xpaint [-canvas] [-screenshot] [-magnifier] [-nowarn]
#NL
[-menubar] [-nomenubar] [-fullmenu] [-simplemenu]
#NL
***************
*** 124,130 ****
#NL
-canvas ouvrir un canevas vierge au démarrage
#NL
! -snapshot ouvrir xpaint sans interface, en mode capture d'écran
#NL
-magnifier ouvrir xpaint en mode loupe grossissante
#NL
--- 124,130 ----
#NL
-canvas ouvrir un canevas vierge au démarrage
#NL
! -screenshot ouvrir xpaint sans interface, en mode capture d'écran
#NL
-magnifier ouvrir xpaint en mode loupe grossissante
#NL
diff -rc xpaint-2.8.19/xpaint.man xpaint-2.8.19.1/xpaint.man
*** xpaint-2.8.19/xpaint.man 2010-04-05 18:30:09.000000000 +0200
--- xpaint-2.8.19.1/xpaint.man 2010-04-07 07:43:29.000000000 +0200
***************
*** 18,24 ****
.br
[\ \-canvas\ ] [\ \-fullpopup\ ] [\ \-simplepopup\ ] [\ \-nomenubar\ ]
.br
! [\ \-snapshot\ ] [\ \-nowarn\ ] [\ \-astext\ ] [
.RI \-undosize " VALUE"
]
.br
--- 18,24 ----
.br
[\ \-canvas\ ] [\ \-fullpopup\ ] [\ \-simplepopup\ ] [\ \-nomenubar\ ]
.br
! [\ \-screenshot\ ] [\ \-nowarn\ ] [\ \-astext\ ] [
.RI \-undosize " VALUE"
]
.br
***************
*** 207,214 ****
.B \-nomenubar
Do not show menu bar on top of canvas windows.
.TP 1i
! .B \-snapshot
! Operate xpaint in snapshot mode from start-up.
.TP 1i
.B \-operation " NUMBER"
Start with operation <NUMBER> set in tool panel.
--- 207,214 ----
.B \-nomenubar
Do not show menu bar on top of canvas windows.
.TP 1i
! .B \-screenshot
! Operate xpaint in screenshot mode from start-up.
.TP 1i
.B \-operation " NUMBER"
Start with operation <NUMBER> set in tool panel.
diff -rc xpaint-2.8.19/xpaint.man.in xpaint-2.8.19.1/xpaint.man.in
*** xpaint-2.8.19/xpaint.man.in 2010-04-05 18:29:09.000000000 +0200
--- xpaint-2.8.19.1/xpaint.man.in 2010-04-07 07:38:06.000000000 +0200
***************
*** 18,24 ****
.br
[\ \-canvas\ ] [\ \-fullpopup\ ] [\ \-simplepopup\ ] [\ \-nomenubar\ ]
.br
! [\ \-snapshot\ ] [\ \-nowarn\ ] [\ \-astext\ ] [
.RI \-undosize " VALUE"
]
.br
--- 18,24 ----
.br
[\ \-canvas\ ] [\ \-fullpopup\ ] [\ \-simplepopup\ ] [\ \-nomenubar\ ]
.br
! [\ \-screenshot\ ] [\ \-nowarn\ ] [\ \-astext\ ] [
.RI \-undosize " VALUE"
]
.br
***************
*** 207,214 ****
.B \-nomenubar
Do not show menu bar on top of canvas windows.
.TP 1i
! .B \-snapshot
! Operate xpaint in snapshot mode from start-up.
.TP 1i
.B \-operation " NUMBER"
Start with operation <NUMBER> set in tool panel.
--- 207,214 ----
.B \-nomenubar
Do not show menu bar on top of canvas windows.
.TP 1i
! .B \-screenshot
! Operate xpaint in screenshot mode from start-up.
.TP 1i
.B \-operation " NUMBER"
Start with operation <NUMBER> set in tool panel.
xpaint-2.8.19-small-improvements.patch:
Doc/Operator.doc | 3 !
Doc/TextFormat.doc | 2
app-defaults/XPaint.ad.in | 6 !!
app-defaults/XPaint_es.ad.in | 4 !
app-defaults/XPaint_fr.ad.in | 6 !!
fileBrowser.c | 102 ++---!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
fontSelect.c | 6 !!
graphic.c | 116 +++-----------------!!!!!!!!!!!!!!!!!!!!!!
iprocess.c | 8 !!
main.c | 9 !!!
misc.h | 3 !
operation.c | 59 ---------------------
pattern.c | 6 !!
rw/readWritePS.c | 10 ++!
rw/rwTable.c | 2
xpaint.h | 3 +
16 files changed, 37 insertions(+), 113 deletions(-), 195 modifications(!)
--- NEW FILE xpaint-2.8.19-small-improvements.patch ---
diff -rc xpaint-2.8.19/app-defaults/XPaint.ad.in xpaint-2.8.19.2/app-defaults/XPaint.ad.in
*** xpaint-2.8.19/app-defaults/XPaint.ad.in 2010-04-09 17:00:05.642875433 +0200
--- xpaint-2.8.19.2/app-defaults/XPaint.ad.in 2010-04-08 15:51:21.000000000 +0200
***************
*** 352,359 ****
xpaint*toolbox*canvas.label: Canvas
xpaint*toolbox*canvas*new.label: New Canvas
xpaint*toolbox*canvas*new-size.label: New With Size...
! xpaint*toolbox*canvas*open.label: Open Image...
! xpaint*toolbox*canvas*loaded.label: Loaded files...
xpaint*toolbox*canvas*magnifier.label: Magnifier...
xpaint*toolbox*canvas*screenshot.label: Take Screenshot...
xpaint*toolbox*canvas*about.label: About...
--- 352,359 ----
xpaint*toolbox*canvas.label: Canvas
xpaint*toolbox*canvas*new.label: New Canvas
xpaint*toolbox*canvas*new-size.label: New With Size...
! xpaint*toolbox*canvas*open.label: File Browser...
! xpaint*toolbox*canvas*loaded.label: List of Loaded Files...
xpaint*toolbox*canvas*magnifier.label: Magnifier...
xpaint*toolbox*canvas*screenshot.label: Take Screenshot...
xpaint*toolbox*canvas*about.label: About...
***************
*** 492,497 ****
--- 492,498 ----
! Canvas area menu pulldowns
!
Canvas*menu*file.label: File
+ Canvas*menu*file*open.label: Open Image
Canvas*menu*file*save.label: Save
Canvas*menu*file*saveas.label: Save As...
Canvas*menu*file*saveregion.label: Save Region...
***************
*** 693,698 ****
--- 694,700 ----
!Popup File Menu
*paintBox*popup-menu.File.label: File
*paintBox*popup-menu.File-right.label: File
+ *paintBox*popup-menu.File-right*open.label: Open Image...
*paintBox*popup-menu.File-right*save.label: Save
*paintBox*popup-menu.File-right*saveas.label: Save As...
*paintBox*popup-menu.File-right*saveregion.label: Save Region...
diff -rc xpaint-2.8.19/app-defaults/XPaint_es.ad.in xpaint-2.8.19.2/app-defaults/XPaint_es.ad.in
*** xpaint-2.8.19/app-defaults/XPaint_es.ad.in 2010-04-09 17:00:05.642875433 +0200
--- xpaint-2.8.19.2/app-defaults/XPaint_es.ad.in 2010-04-08 15:56:31.000000000 +0200
***************
*** 354,360 ****
xpaint*toolbox*canvas.label: Lienzos
xpaint*toolbox*canvas*new.label: Nuevo Lienzo
xpaint*toolbox*canvas*new-size.label: Lienzo de dimensiones específicas...
! xpaint*toolbox*canvas*open.label: Abrir Imagen...
xpaint*toolbox*canvas*loaded.label: Archivos Cargados...
xpaint*toolbox*canvas*magnifier.label: Lupa...
xpaint*toolbox*canvas*screenshot.label: Captura de Pantalla...
--- 354,360 ----
xpaint*toolbox*canvas.label: Lienzos
xpaint*toolbox*canvas*new.label: Nuevo Lienzo
xpaint*toolbox*canvas*new-size.label: Lienzo de dimensiones específicas...
! xpaint*toolbox*canvas*open.label: Selector de Archivos...
xpaint*toolbox*canvas*loaded.label: Archivos Cargados...
xpaint*toolbox*canvas*magnifier.label: Lupa...
xpaint*toolbox*canvas*screenshot.label: Captura de Pantalla...
***************
*** 491,496 ****
--- 491,497 ----
! Canvas area menu pulldowns
!
Canvas*menu*file.label: Archivo
+ Canvas*menu*file*open.label: Abrir Imagen
Canvas*menu*file*save.label: Guardar
Canvas*menu*file*saveas.label: Guardar como...
Canvas*menu*file*saveregion.label: Guardar Región...
***************
*** 690,695 ****
--- 691,697 ----
!Popup File Menu
*paintBox*popup-menu.File.label: Archivo
*paintBox*popup-menu.File-right.label: Archivo
+ *paintBox*popup-menu.File-right.open.label: Abrir Imagen...
*paintBox*popup-menu.File-right.save.label: Guardar
*paintBox*popup-menu.File-right.saveas.label: Guardar como...
*paintBox*popup-menu.File-right.saveregion.label: Guardar Región...
diff -rc xpaint-2.8.19/app-defaults/XPaint_fr.ad.in xpaint-2.8.19.2/app-defaults/XPaint_fr.ad.in
*** xpaint-2.8.19/app-defaults/XPaint_fr.ad.in 2010-04-09 17:00:05.642875433 +0200
--- xpaint-2.8.19.2/app-defaults/XPaint_fr.ad.in 2010-04-08 23:23:46.000000000 +0200
***************
*** 352,359 ****
xpaint*toolbox*canvas.label: Canevas
xpaint*toolbox*canvas*new.label: Nouveau Canevas
xpaint*toolbox*canvas*new-size.label: Canevas de taille spécifiée...
! xpaint*toolbox*canvas*open.label: Ouvrir Image...
! xpaint*toolbox*canvas*loaded.label: Fichiers chargés...
xpaint*toolbox*canvas*magnifier.label: Loupe...
xpaint*toolbox*canvas*screenshot.label: Capture d'Ecran...
xpaint*toolbox*canvas*about.label: A Propos...
--- 352,359 ----
xpaint*toolbox*canvas.label: Canevas
xpaint*toolbox*canvas*new.label: Nouveau Canevas
xpaint*toolbox*canvas*new-size.label: Canevas de taille spécifiée...
! xpaint*toolbox*canvas*open.label: Sélecteur de Fichiers...
! xpaint*toolbox*canvas*loaded.label: Fichiers déjà chargés...
xpaint*toolbox*canvas*magnifier.label: Loupe...
xpaint*toolbox*canvas*screenshot.label: Capture d'Ecran...
xpaint*toolbox*canvas*about.label: A Propos...
***************
*** 492,497 ****
--- 492,498 ----
! Canvas area menu pulldowns
!
Canvas*menu*file.label: Fichier
+ Canvas*menu*file*open.label: Ouvrir Image...
Canvas*menu*file*save.label: Sauvegarder
Canvas*menu*file*saveas.label: Sauvegarder sous...
Canvas*menu*file*saveregion.label: Sauvegarder Région...
***************
*** 687,692 ****
--- 688,694 ----
!Popup File Menu
*paintBox*popup-menu.File.label: Fichier
*paintBox*popup-menu.File-right.label: Fichier
+ *paintBox*popup-menu.File-right.open.label: Ouvrir Image...
*paintBox*popup-menu.File-right.save.label: Sauvegarder
*paintBox*popup-menu.File-right.saveas.label: Sauvegarder sous...
*paintBox*popup-menu.File-right.saveregion.label: Sauvegarder Région...
diff -rc xpaint-2.8.19/Doc/Operator.doc xpaint-2.8.19.2/Doc/Operator.doc
*** xpaint-2.8.19/Doc/Operator.doc 2005-04-10 10:02:48.000000000 +0200
--- xpaint-2.8.19.2/Doc/Operator.doc 2010-04-09 08:09:36.000000000 +0200
***************
*** 1,6 ****
This is a "rough" document, but hopefully if you are interested in
adding a new paint operator to xpaint, it should make a good
! staring point.
The interface to add new functions is as follows, all operations have
two functions named (where OP == Function name, ## == concatination):
--- 1,7 ----
+ \*text:900 2250*\\
This is a "rough" document, but hopefully if you are interested in
adding a new paint operator to xpaint, it should make a good
! starting point.
The interface to add new functions is as follows, all operations have
two functions named (where OP == Function name, ## == concatination):
diff -rc xpaint-2.8.19/Doc/TextFormat.doc xpaint-2.8.19.2/Doc/TextFormat.doc
*** xpaint-2.8.19/Doc/TextFormat.doc 2010-04-05 10:58:35.000000000 +0200
--- xpaint-2.8.19.2/Doc/TextFormat.doc 2010-04-09 07:46:38.000000000 +0200
***************
*** 1,4 ****
! \*text:1500 2121*\\
\*font:Liberation-24:style=Bold*\\*color:red*\\
Use of enriched text files as input of Xpaint
\*font:Liberation-18*\\*color:black*\\
--- 1,4 ----
! \*text:1500 2121*\\*zoom:-2*\\
\*font:Liberation-24:style=Bold*\\*color:red*\\
Use of enriched text files as input of Xpaint
\*font:Liberation-18*\\*color:black*\\
diff -rc xpaint-2.8.19/fileBrowser.c xpaint-2.8.19.2/fileBrowser.c
*** xpaint-2.8.19/fileBrowser.c 2010-04-09 17:00:05.642875433 +0200
--- xpaint-2.8.19.2/fileBrowser.c 2010-04-09 07:45:10.000000000 +0200
***************
*** 71,78 ****
#endif
#endif /* _Xconst */
- #define LOADED 4
-
typedef struct {
Widget shell, pane, name, program, cclog;
int mode;
--- 71,76 ----
***************
*** 86,91 ****
--- 84,90 ----
extern int file_numpages;
extern int file_force;
extern int file_bbox;
+ extern int file_specified_zoom;
void *
GetFileNameGetLastId()
***************
*** 207,213 ****
Widget paint = (Widget) paintArg;
if (PwRegionGet(paint, NULL, NULL))
! GetFileName(paint, 1, NULL, saveRegionFileCallback, NULL);
else
Notice(paint, msgText[NO_REGION_SELECTED_PRESENTLY]);
}
--- 206,212 ----
Widget paint = (Widget) paintArg;
if (PwRegionGet(paint, NULL, NULL))
! GetFileName(paint, BROWSER_SAVE, NULL, saveRegionFileCallback, NULL);
else
Notice(paint, msgText[NO_REGION_SELECTED_PRESENTLY]);
}
***************
*** 228,234 ****
if (strcmp(name, msgText[DEFAULT_TITLE]) == 0 || strcmp(nm, name) == 0)
name = NULL;
! GetFileName(paint, 1, name, saveFileCallback, NULL);
}
void
--- 227,233 ----
if (strcmp(name, msgText[DEFAULT_TITLE]) == 0 || strcmp(nm, name) == 0)
name = NULL;
! GetFileName(paint, BROWSER_SAVE, name, saveFileCallback, NULL);
}
void
***************
*** 262,268 ****
return;
}
}
! GetFileName(paint, 1, name, saveFileCallback, NULL);
}
/*
--- 261,267 ----
return;
}
}
! GetFileName(paint, BROWSER_SAVE, name, saveFileCallback, NULL);
}
/*
***************
*** 391,402 ****
XtVaGetValues(l->cwd_w, XtNx, &x, NULL);
if (l->home) {
XtMoveWidget(l->home, 5, height-84);
! XtMoveWidget(l->root, 30, height-84);
! XtMoveWidget(l->dot, 55, height-84);
! XtMoveWidget(l->hidden, 80, height-84);
if (l->ongoing) {
XtVaGetValues(l->hidden, XtNwidth, &width1, NULL);
! XtMoveWidget(l->ongoing, 80+width1+3, height-84);
}
XtMoveWidget(l->cwd_w, x, height-52);
XtMoveWidget(l->info, x, height-30);
--- 390,401 ----
XtVaGetValues(l->cwd_w, XtNx, &x, NULL);
if (l->home) {
XtMoveWidget(l->home, 5, height-84);
! XtMoveWidget(l->root, 29, height-84);
! XtMoveWidget(l->dot, 53, height-84);
! XtMoveWidget(l->hidden, 77, height-84);
if (l->ongoing) {
XtVaGetValues(l->hidden, XtNwidth, &width1, NULL);
! XtMoveWidget(l->ongoing, 80+width1, height-84);
}
XtMoveWidget(l->cwd_w, x, height-52);
XtMoveWidget(l->info, x, height-30);
***************
*** 537,543 ****
Widget sb;
Boolean state;
! if (arg->browserType == LOADED) {
emptyList(arg);
fileCount = Global.numfiles;
list = (String *) XtCalloc(sizeof(String *), fileCount+2);
--- 536,542 ----
Widget sb;
Boolean state;
! if (arg->browserType == BROWSER_LOADED) {
emptyList(arg);
fileCount = Global.numfiles;
list = (String *) XtCalloc(sizeof(String *), fileCount+2);
***************
*** 648,654 ****
XawListChange(arg->list, list, i, 0, True);
XtVaSetValues(arg->info, XtNlabel, infoStr, NULL);
! if (arg->browserType != LOADED || arg->isToRefresh) {
XtVaSetValues(arg->name, XtNstring, "", NULL);
if ((sb = XtNameToWidget(arg->vport, "vertical")) != None) {
float top = 0.0;
--- 647,653 ----
XawListChange(arg->list, list, i, 0, True);
XtVaSetValues(arg->info, XtNlabel, infoStr, NULL);
! if (arg->browserType != BROWSER_LOADED || arg->isToRefresh) {
XtVaSetValues(arg->name, XtNstring, "", NULL);
if ((sb = XtNameToWidget(arg->vport, "vertical")) != None) {
float top = 0.0;
***************
*** 719,727 ****
*cp = '\0';
if (stat(file, &statbuf) >= 0 && (statbuf.st_mode & S_IFDIR) != 0 &&
!ongoing) {
! if (arg->browserType != LOADED || arg->isToRefresh)
setCWD(arg, file);
! if (arg->browserType != LOADED)
browserResized(arg->parent, arg, NULL, False);
}
*cp = '/';
--- 718,726 ----
*cp = '\0';
if (stat(file, &statbuf) >= 0 && (statbuf.st_mode & S_IFDIR) != 0 &&
!ongoing) {
! if (arg->browserType != BROWSER_LOADED || arg->isToRefresh)
setCWD(arg, file);
! if (arg->browserType != BROWSER_LOADED)
browserResized(arg->parent, arg, NULL, False);
}
*cp = '/';
***************
*** 730,736 ****
arg->isToRefresh = False;
arg->oldwidth = 0;
! if (arg->browserType == LOADED) {
char *dpistr, *pagestr, *zoomstr, *alphastr, *bboxstr;
Widget paint = GetNonDirtyCanvas();
XtVaGetValues(arg->dpi, XtNstring, &dpistr, NULL);
--- 729,735 ----
arg->isToRefresh = False;
arg->oldwidth = 0;
! if (arg->browserType == BROWSER_LOADED) {
char *dpistr, *pagestr, *zoomstr, *alphastr, *bboxstr;
Widget paint = GetNonDirtyCanvas();
XtVaGetValues(arg->dpi, XtNstring, &dpistr, NULL);
***************
*** 764,776 ****
} else {
if (ongoing) {
Widget paint = GetNonDirtyCanvas();
- int oldzoom = Global.default_zoom;
if (paint) {
! XtVaGetValues(paint, XtNzoom, &zoom, NULL);
Global.default_zoom = zoom;
loadPrescribedFile(paint, file);
setZoomButtonLabel(paint, zoom);
! Global.default_zoom = oldzoom;
return;
}
} else
--- 763,778 ----
} else {
if (ongoing) {
Widget paint = GetNonDirtyCanvas();
if (paint) {
! if (file_specified_zoom)
! zoom = file_specified_zoom;
! else
! XtVaGetValues(paint, XtNzoom, &zoom, NULL);
Global.default_zoom = zoom;
loadPrescribedFile(paint, file);
+ AddFileToGlobalList(file);
setZoomButtonLabel(paint, zoom);
! Global.default_zoom = zoom_prev;
return;
}
} else
***************
*** 803,808 ****
--- 805,812 ----
AddFileToGlobalList(file);
} else {
Image *image = f(file);
+ if (file_specified_zoom)
+ Global.default_zoom = file_specified_zoom;
if (image == NULL)
Notice(w, msgText[UNABLE_TO_OPEN_INPUT_FILE], file,
RWGetMsg());
***************
*** 1047,1053 ****
*ptr = '\0';
++ptr;
if (strcmp(ptr, "image.c")) return;
! GetFileName(w, 2, NULL, createLXPCallback, arg);
free(dir);
}
--- 1051,1057 ----
*ptr = '\0';
++ptr;
if (strcmp(ptr, "image.c")) return;
! GetFileName(w, BROWSER_SIMPLESAVE, NULL, createLXPCallback, arg);
free(dir);
}
***************
*** 1071,1077 ****
arg->okFunc = GraphicOpenFile;
okCallback(bar, argArg, NULL);
} else {
! if (arg->browserType == LOADED) {
static char value[2];
Global.numpage = 1;
*value = '1'; value[1] = '\0';
--- 1075,1081 ----
arg->okFunc = GraphicOpenFile;
okCallback(bar, argArg, NULL);
} else {
! if (arg->browserType == BROWSER_LOADED) {
static char value[2];
Global.numpage = 1;
*value = '1'; value[1] = '\0';
***************
*** 1165,1171 ****
NULL);
arg->list = list;
! if (arg->browserType != LOADED) {
arg->home = XtVaCreateManagedWidget("home",
commandWidgetClass, form,
XtNlabel, "~",
--- 1169,1175 ----
NULL);
arg->list = list;
! if (arg->browserType != BROWSER_LOADED) {
arg->home = XtVaCreateManagedWidget("home",
commandWidgetClass, form,
XtNlabel, "~",
***************
*** 1180,1186 ****
XtNlabel, "/",
XtNfromVert, vport,
XtNfromHoriz, arg->home,
! XtNhorizDistance, 4,
XtNvertDistance, 0,
XtNwidth, 20,
XtNheight, 20,
--- 1184,1190 ----
XtNlabel, "/",
XtNfromVert, vport,
XtNfromHoriz, arg->home,
! XtNhorizDistance, 3,
XtNvertDistance, 0,
XtNwidth, 20,
XtNheight, 20,
***************
*** 1190,1196 ****
XtNlabel, ".",
XtNfromVert, vport,
XtNfromHoriz, arg->root,
! XtNhorizDistance, 4,
XtNvertDistance, 0,
XtNwidth, 20,
XtNheight, 20,
--- 1194,1200 ----
XtNlabel, ".",
XtNfromVert, vport,
XtNfromHoriz, arg->root,
! XtNhorizDistance, 3,
XtNvertDistance, 0,
XtNwidth, 20,
XtNheight, 20,
***************
*** 1199,1219 ****
toggleWidgetClass, form,
XtNfromVert, vport,
XtNfromHoriz, arg->dot,
! XtNhorizDistance, 4,
XtNvertDistance, 0,
XtNheight, 20,
NULL);
! if (arg->browserType)
! arg->ongoing = None;
! else
arg->ongoing = XtVaCreateManagedWidget("ongoing",
toggleWidgetClass, form,
XtNfromVert, vport,
XtNfromHoriz, arg->hidden,
! XtNhorizDistance, 4,
XtNvertDistance, 0,
XtNheight, 20,
NULL);
}
cwd = XtVaCreateManagedWidget("cwd",
--- 1203,1224 ----
toggleWidgetClass, form,
XtNfromVert, vport,
XtNfromHoriz, arg->dot,
! XtNhorizDistance, 3,
XtNvertDistance, 0,
XtNheight, 20,
NULL);
! if (arg->browserType <= BROWSER_MULTIREAD)
arg->ongoing = XtVaCreateManagedWidget("ongoing",
toggleWidgetClass, form,
XtNfromVert, vport,
XtNfromHoriz, arg->hidden,
! XtNhorizDistance, 3,
XtNvertDistance, 0,
XtNheight, 20,
+ XtNstate, (arg->browserType==BROWSER_MULTIREAD),
NULL);
+ else
+ arg->ongoing = None;
}
cwd = XtVaCreateManagedWidget("cwd",
***************
*** 1255,1261 ****
arg->first = True;
! if (arg->browserType != LOADED) XtSetKeyboardFocus(form, arg->name);
setCWD(arg, doDirname(arg, NULL));
return form;
--- 1260,1266 ----
arg->first = True;
! if (arg->browserType != BROWSER_LOADED) XtSetKeyboardFocus(form, arg->name);
setCWD(arg, doDirname(arg, NULL));
return form;
***************
*** 1277,1283 ****
shell = XtVisCreatePopupShell("filebrowser",
! ((mode==LOADED)?
topLevelShellWidgetClass:
transientShellWidgetClass),
GetToplevel(w),
--- 1282,1288 ----
shell = XtVisCreatePopupShell("filebrowser",
! ((mode==BROWSER_LOADED)?
topLevelShellWidgetClass:
transientShellWidgetClass),
GetToplevel(w),
***************
*** 1364,1370 ****
arg->isRead = True;
arg->numformat = k;
! if (arg->browserType == LOADED) {
arg->refresh = XtVaCreateManagedWidget("refresh",
commandWidgetClass, browser,
XtNborderWidth, 0,
--- 1369,1375 ----
arg->isRead = True;
arg->numformat = k;
! if (arg->browserType == BROWSER_LOADED) {
arg->refresh = XtVaCreateManagedWidget("refresh",
commandWidgetClass, browser,
XtNborderWidth, 0,
***************
*** 1653,1659 ****
AddDestroyCallback(shell,
(DestroyCallbackFunc) cancelCallback, (XtPointer) arg);
! if (arg->browserType != LOADED)
XtSetKeyboardFocus(form, arg->name);
XtInstallAccelerators(arg->name, okButton);
--- 1658,1664 ----
AddDestroyCallback(shell,
(DestroyCallbackFunc) cancelCallback, (XtPointer) arg);
! if (arg->browserType != BROWSER_LOADED)
XtSetKeyboardFocus(form, arg->name);
XtInstallAccelerators(arg->name, okButton);
***************
*** 1864,1871 ****
for (cur = argList; cur != NULL; cur = cur->next)
if (cur->parent == w &&
! (cur->browserType == 0 ||
! cur->browserType == 1))
break;
if (cur == NULL)
--- 1869,1876 ----
for (cur = argList; cur != NULL; cur = cur->next)
if (cur->parent == w &&
! (cur->browserType >= BROWSER_READ &&
! cur->browserType <= BROWSER_SAVE))
break;
if (cur == NULL)
***************
*** 1890,1916 ****
memset(cur, 0, sizeof(arg_t));
cur->parent = p;
cur->browserType = type;
- /*
- cur->isLoaded = False;
- cur->isToRefresh = False;
- */
switch (type) {
! case 0:
! shell = buildOpenBrowser(w, cur, 250, 380, 0);
break;
! case 1:
shell = buildSaveBrowser(w, cur);
break;
! case 2:
! shell = buildSimpleBrowser(w, cur, True);
! break;
! case 3:
shell = buildSimpleBrowser(w, cur, False);
break;
! case LOADED:
! shell = buildOpenBrowser(w, cur, 300, 300, LOADED);
! break;
}
cur->next = argList; /* Add cur to front of list */
--- 1895,1920 ----
memset(cur, 0, sizeof(arg_t));
cur->parent = p;
cur->browserType = type;
switch (type) {
! case BROWSER_READ:
! shell = buildOpenBrowser(w, cur, 250, 380, BROWSER_READ);
break;
! case BROWSER_MULTIREAD:
! shell = buildOpenBrowser(w, cur, 250, 380, BROWSER_MULTIREAD);
! break;
! case BROWSER_LOADED:
! shell = buildOpenBrowser(w, cur, 300, 300, BROWSER_LOADED);
! break;
! case BROWSER_SAVE:
shell = buildSaveBrowser(w, cur);
break;
! case BROWSER_SIMPLEREAD:
shell = buildSimpleBrowser(w, cur, False);
break;
! case BROWSER_SIMPLESAVE:
! shell = buildSimpleBrowser(w, cur, True);
! break;
}
cur->next = argList; /* Add cur to front of list */
***************
*** 1933,1943 ****
Widget shell, *widget;
int i, j, im;
! if (type == LOADED) {
/* if (!Global.numfiles) return; */
/* Check whether "loaded files" browser is already popped up */
for (arg = argList; arg != NULL; arg = arg->next)
! if (arg->browserType == LOADED) {
XWindowAttributes win_attributes;
XGetWindowAttributes(XtDisplay(arg->bbox),
XtWindow(arg->bbox), &win_attributes);
--- 1937,1947 ----
Widget shell, *widget;
int i, j, im;
! if (type == BROWSER_LOADED) {
/* if (!Global.numfiles) return; */
/* Check whether "loaded files" browser is already popped up */
for (arg = argList; arg != NULL; arg = arg->next)
! if (arg->browserType == BROWSER_LOADED) {
XWindowAttributes win_attributes;
XGetWindowAttributes(XtDisplay(arg->bbox),
XtWindow(arg->bbox), &win_attributes);
diff -rc xpaint-2.8.19/fontSelect.c xpaint-2.8.19.2/fontSelect.c
*** xpaint-2.8.19/fontSelect.c 2010-04-05 16:43:17.000000000 +0200
--- xpaint-2.8.19.2/fontSelect.c 2010-04-09 07:30:06.000000000 +0200
***************
*** 834,840 ****
char buf[256];
*buf = '\0';
if (getcwd(buf, 256)) strcat(buf, "/");
! GetFileName(GetShell(w), 3,
buf, (XtCallbackProc) loadFileCallbackOK, argArg);
}
--- 834,840 ----
char buf[256];
*buf = '\0';
if (getcwd(buf, 256)) strcat(buf, "/");
! GetFileName(GetShell(w), BROWSER_SIMPLEREAD,
buf, (XtCallbackProc) loadFileCallbackOK, argArg);
}
***************
*** 873,879 ****
char buf[256];
*buf = '\0';
if (getcwd(buf, 256)) strcat(buf, "/");
! GetFileName(GetShell(w), 2,
buf, (XtCallbackProc) saveFileCallbackOK, argArg);
}
--- 873,879 ----
char buf[256];
*buf = '\0';
if (getcwd(buf, 256)) strcat(buf, "/");
! GetFileName(GetShell(w), BROWSER_SIMPLESAVE,
buf, (XtCallbackProc) saveFileCallbackOK, argArg);
}
***************
*** 967,973 ****
char buf[256];
*buf = '\0';
if (getcwd(buf, 256)) strcat(buf, "/");
! GetFileName(GetShell(w), 2,
buf, (XtCallbackProc) saveFileCallbackOK, argArg);
}
--- 967,973 ----
char buf[256];
*buf = '\0';
if (getcwd(buf, 256)) strcat(buf, "/");
! GetFileName(GetShell(w), BROWSER_SIMPLESAVE,
buf, (XtCallbackProc) saveFileCallbackOK, argArg);
}
diff -rc xpaint-2.8.19/graphic.c xpaint-2.8.19.2/graphic.c
*** xpaint-2.8.19/graphic.c 2010-04-09 17:00:05.642875433 +0200
--- xpaint-2.8.19.2/graphic.c 2010-04-08 23:20:25.000000000 +0200
***************
*** 227,249 ****
static PaintMenuItem fileMenu[] =
{
! #define FILE_SAVE 0
MI_SIMPLE("save"),
! #define FILE_SAVEAS 1
MI_SIMPLE("saveas"),
! #define FILE_SAVE_REGION 2
MI_SIMPLE("saveregion"),
! #define FILE_LOAD_MEMORY 3
MI_SIMPLE("load-mem"),
! #define FILE_REVERT 4
MI_SIMPLE("revert"),
! #define FILE_LOADED 5
MI_SIMPLE("loaded"),
! #define FILE_PRINT 6
MI_SIMPLE("print"),
! #define FILE_EXTERN 7
MI_SIMPLE("extern"),
! #define FILE_CLOSE 8
MI_SIMPLE("close"),
};
--- 227,251 ----
static PaintMenuItem fileMenu[] =
{
! #define FILE_OPEN 0
! MI_SIMPLE("open"),
! #define FILE_SAVE 1
MI_SIMPLE("save"),
! #define FILE_SAVEAS 2
MI_SIMPLE("saveas"),
! #define FILE_SAVE_REGION 3
MI_SIMPLE("saveregion"),
! #define FILE_LOAD_MEMORY 4
MI_SIMPLE("load-mem"),
! #define FILE_REVERT 5
MI_SIMPLE("revert"),
! #define FILE_LOADED 6
MI_SIMPLE("loaded"),
! #define FILE_PRINT 7
MI_SIMPLE("print"),
! #define FILE_EXTERN 8
MI_SIMPLE("extern"),
! #define FILE_CLOSE 9
MI_SIMPLE("close"),
};
***************
*** 518,540 ****
static PaintMenuItem popupFileMenu[] =
{
MI_SEPARATOR(),
! #define P_FILE_SAVE 1
MI_SIMPLE("save"),
! #define P_FILE_SAVEAS 2
MI_SIMPLE("saveas"),
! #define P_FILE_SAVE_REGION 3
MI_SIMPLE("saveregion"),
! #define P_FILE_LOAD_MEMORY 4
MI_SIMPLE("load-mem"),
! #define P_FILE_REVERT 5
MI_SIMPLE("revert"),
! #define P_FILE_LOADED 6
MI_SIMPLE("loaded"),
! #define P_FILE_PRINT 7
MI_SIMPLE("print"),
! #define P_FILE_EXTERN 8
MI_SIMPLE("extern"),
! #define P_FILE_CLOSE 9
MI_SIMPLE("close"),
};
--- 520,544 ----
static PaintMenuItem popupFileMenu[] =
{
MI_SEPARATOR(),
! #define P_FILE_OPEN 1
! MI_SIMPLE("open"),
! #define P_FILE_SAVE 2
MI_SIMPLE("save"),
! #define P_FILE_SAVEAS 3
MI_SIMPLE("saveas"),
! #define P_FILE_SAVE_REGION 4
MI_SIMPLE("saveregion"),
! #define P_FILE_LOAD_MEMORY 5
MI_SIMPLE("load-mem"),
! #define P_FILE_REVERT 6
MI_SIMPLE("revert"),
! #define P_FILE_LOADED 7
MI_SIMPLE("loaded"),
! #define P_FILE_PRINT 8
MI_SIMPLE("print"),
! #define P_FILE_EXTERN 9
MI_SIMPLE("extern"),
! #define P_FILE_CLOSE 10
MI_SIMPLE("close"),
};
***************
*** 1049,1055 ****
static void
loadedCallback(Widget w, XtPointer paintArg, XtPointer junk2)
{
! GetFileName(Global.toplevel, 4, NULL, GraphicOpenFile, NULL);
}
static void
--- 1053,1059 ----
static void
loadedCallback(Widget w, XtPointer paintArg, XtPointer junk2)
{
! GetFileName(Global.toplevel, BROWSER_LOADED, NULL, GraphicOpenFile, NULL);
}
static void
***************
*** 2176,2226 ****
StateSetBusy(False);
Notice(Global.toplevel, msgText[UNABLE_TO_OPEN_INPUT_FILE], file, RWGetMsg());
}
-
- #if 0 /* old way : close canvas - and reopen a new one - quite clumsy ! */
- void *v;
- char *file;
- Image * image;
- RWreadFunc f;
- Widget paint, top;
- int zoom, snap_x, snap_y;
- Boolean snapon;
- Pixel background;
- WidgetList wlist;
-
- XtVaGetValues(w,
- XtNzoom, &zoom,
- XtNsnapX, &snap_x, XtNsnapY, &snap_y, XtNsnapOn, &snapon,
- XtNbackground, &background, XtNmenuwidgets, &wlist,
- XtNfilename, &file,
- NULL);
- if ((file == NULL) || (*file == 0))
- return;
-
- StateSetBusy(True);
-
- top = GetToplevel(w);
- workProcDone = 0;
- workProcId = XtAppAddWorkProc(Global.appContext, workProc, (XtPointer) w);
-
- if ((v = ReadMagic(file)) != NULL)
- paint = GraphicOpenFileZoom(top, file, v, zoom);
- else {
- StateSetBusy(False);
- Notice(top, msgText[UNABLE_TO_OPEN_INPUT_FILE], file, RWGetMsg());
- return;
- }
-
- XtVaSetValues(paint,
- XtNsnapOn, snapon, XtNsnapX, snap_x, XtNsnapY, snap_y,
- XtNbackground, background, XtNdirty, False, NULL);
-
- StateSetBusy(False);
- XtVaGetValues(paint, XtNmenuwidgets, &wlist, NULL);
- if (!wlist) return;
- MenuCheckItem(wlist[W_SELECTOR_SNAP], snapon);
- MenuCheckItem(wlist[W_TOPMENU+W_SELECTOR_SNAP], snapon);
- #endif
}
static int xorig = 0;
--- 2180,2185 ----
***************
*** 4528,4534 ****
void
loadMemory(Widget w, XtPointer junk, XtPointer junk2)
{
! GetFileName(GetShell(w), 0, NULL,
(XtCallbackProc) loadMemoryCallback, NULL);
}
--- 4487,4493 ----
void
loadMemory(Widget w, XtPointer junk, XtPointer junk2)
{
! GetFileName(GetShell(w), BROWSER_READ, NULL,
(XtCallbackProc) loadMemoryCallback, NULL);
}
***************
*** 5233,5240 ****
XtManageChild(paintbox);
XtManageChild(viewport);
! ADDCALLBACK(fileMenu, FILE_SAVEAS, paint, StdSaveAsFile);
ADDCALLBACK(fileMenu, FILE_SAVE, paint, StdSaveFile);
ccpAddSaveRegion(fileMenu[FILE_SAVE_REGION].widget, paint);
ADDCALLBACK(fileMenu, FILE_LOAD_MEMORY, info, loadMemory);
ADDCALLBACK(fileMenu, FILE_REVERT, paint, revertCallback);
--- 5192,5200 ----
XtManageChild(paintbox);
XtManageChild(viewport);
! ADDCALLBACK(fileMenu, FILE_OPEN, paint, StdOpenFile);
ADDCALLBACK(fileMenu, FILE_SAVE, paint, StdSaveFile);
+ ADDCALLBACK(fileMenu, FILE_SAVEAS, paint, StdSaveAsFile);
ccpAddSaveRegion(fileMenu[FILE_SAVE_REGION].widget, paint);
ADDCALLBACK(fileMenu, FILE_LOAD_MEMORY, info, loadMemory);
ADDCALLBACK(fileMenu, FILE_REVERT, paint, revertCallback);
***************
*** 5570,5576 ****
EnableRevert((Widget) paint);
XtVaSetValues((Widget)paint, XtNdirty, False, NULL);
if (file_isSpecialImage) {
! GetFileName(Global.toplevel, 4, NULL, NULL, NULL);
SetEditable((Widget)paint,
!(alpha && Global.alpha_mode>=2),
(alpha!=NULL && Global.alpha_mode==0));
--- 5530,5536 ----
EnableRevert((Widget) paint);
XtVaSetValues((Widget)paint, XtNdirty, False, NULL);
if (file_isSpecialImage) {
! GetFileName(Global.toplevel, BROWSER_LOADED, NULL, NULL, NULL);
SetEditable((Widget)paint,
!(alpha && Global.alpha_mode>=2),
(alpha!=NULL && Global.alpha_mode==0));
***************
*** 5600,5624 ****
* 2: Create new (blank) canvas, querying for size
*/
void
! GraphicCreate(Widget wid, int value)
{
switch (value) {
case 0:
! graphicCreate(makeGraphicShell(wid),
Global.default_width, Global.default_height,
Global.default_zoom, None, None, NULL);
break;
case 1:
! WHZSizeSelect(wid, NULL, 1);
break;
case 2:
! GetFileName(GetToplevel(wid), 0, NULL, GraphicOpenFile, NULL);
break;
case 3:
! GetFileName(GetToplevel(wid), 4, NULL, GraphicOpenFile, NULL);
break;
case 4:
! StartMagnifier(wid);
break;
}
}
--- 5560,5586 ----
* 2: Create new (blank) canvas, querying for size
*/
void
! GraphicCreate(Widget w, int value)
{
switch (value) {
case 0:
! graphicCreate(makeGraphicShell(w),
Global.default_width, Global.default_height,
Global.default_zoom, None, None, NULL);
break;
case 1:
! WHZSizeSelect(w, NULL, 1);
break;
case 2:
! GetFileName(GetToplevel(w), BROWSER_MULTIREAD,
! NULL, GraphicOpenFile, NULL);
break;
case 3:
! GetFileName(GetToplevel(w), BROWSER_LOADED,
! NULL, GraphicOpenFile, NULL);
break;
case 4:
! StartMagnifier(w);
break;
}
}
***************
*** 6428,6433 ****
--- 6390,6402 ----
}
void
+ StdOpenFile(Widget w, XtPointer paintArg, XtPointer junk)
+ {
+ GetFileName(GetToplevel(w), BROWSER_READ,
+ NULL, GraphicOpenFile, NULL);
+ }
+
+ void
StdWriteText(Widget w, XtPointer infoArg, XtPointer junk)
{
LocalInfo * info = (LocalInfo *) infoArg;
***************
*** 7168,7173 ****
--- 7137,7143 ----
XtAddEventHandler(paint, KeyPressMask,
False, (XtEventHandler) selectKeyPress, NULL);
+ ADDCALLBACK(popupFileMenu, P_FILE_OPEN, paint, StdOpenFile);
ADDCALLBACK(popupFileMenu, P_FILE_SAVE, paint, StdSaveFile);
ADDCALLBACK(popupFileMenu, P_FILE_SAVEAS, paint, StdSaveAsFile);
ccpAddSaveRegion(popupFileMenu[P_FILE_SAVE_REGION].widget, paint);
diff -rc xpaint-2.8.19/iprocess.c xpaint-2.8.19.2/iprocess.c
*** xpaint-2.8.19/iprocess.c 2010-03-25 20:10:16.000000000 +0100
--- xpaint-2.8.19.2/iprocess.c 2010-04-07 23:04:18.000000000 +0200
***************
*** 1952,1958 ****
*buf = '\0';
if (getcwd(buf, 256)) strcat(buf, "/");
Global.explore = True;
! GetFileName(GetShell(w), 3,
buf, (XtCallbackProc) loadFileCallbackOK, wlArg);
Global.explore = False;
}
--- 1952,1958 ----
*buf = '\0';
if (getcwd(buf, 256)) strcat(buf, "/");
Global.explore = True;
! GetFileName(GetShell(w), BROWSER_SIMPLEREAD,
buf, (XtCallbackProc) loadFileCallbackOK, wlArg);
Global.explore = False;
}
***************
*** 1994,2000 ****
if (getcwd(buf, 256)) strcat(buf, "/");
Global.explore = True;
if (!info->scriptfile || !info->scriptfile[0])
! GetFileName(GetShell(w), 2,
buf, (XtCallbackProc) saveFileCallbackOK, wlArg);
else
saveFileCallbackOK(w, wlArg, info->scriptfile);
--- 1994,2000 ----
if (getcwd(buf, 256)) strcat(buf, "/");
Global.explore = True;
if (!info->scriptfile || !info->scriptfile[0])
! GetFileName(GetShell(w), BROWSER_SIMPLESAVE,
buf, (XtCallbackProc) saveFileCallbackOK, wlArg);
else
saveFileCallbackOK(w, wlArg, info->scriptfile);
***************
*** 2008,2014 ****
*buf = '\0';
if (getcwd(buf, 256)) strcat(buf, "/");
Global.explore = True;
! GetFileName(GetShell(w), 2,
buf, (XtCallbackProc) saveFileCallbackOK, wlArg);
Global.explore = False;
}
--- 2008,2014 ----
*buf = '\0';
if (getcwd(buf, 256)) strcat(buf, "/");
Global.explore = True;
! GetFileName(GetShell(w), BROWSER_SIMPLESAVE,
buf, (XtCallbackProc) saveFileCallbackOK, wlArg);
Global.explore = False;
}
***************
*** 2031,2037 ****
sprintf(directory, "%s/c_scripts/%s/", GetShareDir(),
predefMenu[info->mode].name);
! GetFileName(GetShell(w), 3, directory,
(XtCallbackProc) loadFileCallbackOK, wlArg);
Global.explore = False;
}
--- 2031,2037 ----
sprintf(directory, "%s/c_scripts/%s/", GetShareDir(),
predefMenu[info->mode].name);
! GetFileName(GetShell(w), BROWSER_SIMPLEREAD, directory,
(XtCallbackProc) loadFileCallbackOK, wlArg);
Global.explore = False;
}
diff -rc xpaint-2.8.19/main.c xpaint-2.8.19.2/main.c
*** xpaint-2.8.19/main.c 2010-04-09 17:00:05.642875433 +0200
--- xpaint-2.8.19.2/main.c 2010-04-09 08:12:35.000000000 +0200
***************
*** 61,66 ****
--- 61,67 ----
char *routine;
extern int magnifier_closing_down;
+ extern int file_specified_zoom;
extern char *fontNames[];
extern void BrushInit(Widget toplevel);
***************
*** 401,412 ****
processFile(char *file)
{
void *v;
StateSetBusy(True);
! if ((v = ReadMagic(file)) != NULL)
! GraphicOpenFile(Global.toplevel, file, v);
! else
Notice(Global.toplevel, msgText[UNABLE_TO_OPEN_INPUT_FILE],
file, RWGetMsg());
--- 402,415 ----
processFile(char *file)
{
void *v;
+ int zoom = Global.default_zoom;
StateSetBusy(True);
! if ((v = ReadMagic(file)) != NULL) {
! if (file_specified_zoom) zoom = file_specified_zoom;
! GraphicOpenFileZoom(Global.toplevel, file, v, zoom);
! } else
Notice(Global.toplevel, msgText[UNABLE_TO_OPEN_INPUT_FILE],
file, RWGetMsg());
diff -rc xpaint-2.8.19/misc.h xpaint-2.8.19.2/misc.h
*** xpaint-2.8.19/misc.h 2010-04-09 17:00:05.652875600 +0200
--- xpaint-2.8.19.2/misc.h 2010-04-07 23:18:20.000000000 +0200
***************
*** 78,84 ****
extern void FatbitsEditDestroy(Widget paint);
extern void FatbitsEdit(Widget paint);
! /* fileName.c */
extern void *GetFileNameGetLastId(void);
extern void StdSaveRegionFile(Widget w, XtPointer paintArg, XtPointer junk);
extern void StdSaveAsFile(Widget w, XtPointer paintArg, XtPointer junk);
--- 78,84 ----
extern void FatbitsEditDestroy(Widget paint);
extern void FatbitsEdit(Widget paint);
! /* fileBrowser.c */
extern void *GetFileNameGetLastId(void);
extern void StdSaveRegionFile(Widget w, XtPointer paintArg, XtPointer junk);
extern void StdSaveAsFile(Widget w, XtPointer paintArg, XtPointer junk);
***************
*** 191,196 ****
--- 191,197 ----
extern void RemoveFileFromGlobalList(char * file);
extern void setWriteTextSensitive(Widget w, Boolean bool);
extern void StdWriteText(Widget w, XtPointer infoArg, XtPointer junk);
+ extern void StdOpenFile(Widget w, XtPointer paintArg, XtPointer junk);
/* pattern.c */
extern void PatternEdit(Widget w, Pixel *pixels,
diff -rc xpaint-2.8.19/operation.c xpaint-2.8.19.2/operation.c
*** xpaint-2.8.19/operation.c 2010-04-09 17:00:05.652875600 +0200
--- xpaint-2.8.19.2/operation.c 2010-04-07 22:21:37.000000000 +0200
***************
*** 1255,1319 ****
}
}
- #if 0
- static PaintMenuItem lineMenu[] =
- {
- #if 0
- MI_FLAGCB("0", MF_CHECK | MF_GROUP1, lineWidth, NULL),
- #endif
- MI_FLAGCB("1", MF_CHECK | MF_GROUP1, lineWidth, NULL),
- MI_FLAGCB("2", MF_CHECK | MF_GROUP1, lineWidth, NULL),
- MI_FLAGCB("4", MF_CHECK | MF_GROUP1, lineWidth, NULL),
- MI_FLAGCB("6", MF_CHECK | MF_GROUP1, lineWidth, NULL),
- MI_FLAGCB("8", MF_CHECK | MF_GROUP1, lineWidth, NULL),
- #define LW_SELECT 5
- MI_FLAGCB("select", MF_CHECK | MF_GROUP1, lineWidth, NULL),
- };
-
- static PaintMenuItem fontMenu[] =
- {
- MI_FLAGCB("Times 8", MF_CHECK | MF_GROUP1,
- fontSet, "-*-times-medium-r-normal-*-*-80-*-*-p-*-*-*"),
- MI_FLAGCB("Times 12", MF_CHECK | MF_GROUP1,
- fontSet, "-*-times-medium-r-normal-*-*-120-*-*-p-*-*-*"),
- MI_FLAGCB("Times 18", MF_CHECK | MF_GROUP1,
- fontSet, "-*-times-medium-r-normal-*-*-180-*-*-p-*-*-*"),
- MI_FLAGCB("Times Bold 12", MF_CHECK | MF_GROUP1,
- fontSet, "-*-times-bold-r-normal-*-*-120-*-*-p-*-*-*"),
- MI_FLAGCB("Times Italic 12", MF_CHECK | MF_GROUP1,
- fontSet, "-*-times-bold-i-normal-*-*-120-*-*-p-*-*-*"),
- MI_FLAGCB("Lucida 12", MF_CHECK | MF_GROUP1,
- fontSet, "-*-lucida-medium-r-normal-*-*-120-*-*-p-*-*-*"),
- MI_FLAGCB("Helvetica 12", MF_CHECK | MF_GROUP1,
- fontSet, "-*-helvetica-medium-r-normal-*-*-120-*-*-p-*-*-*"),
- MI_FLAGCB("Helvetica Bold 12", MF_CHECK | MF_GROUP1,
- fontSet, "-*-helvetica-bold-r-normal-*-*-120-*-*-p-*-*-*"),
- #ifndef __NetBSD__
- MI_FLAGCB("Fixed 12", MF_CHECK | MF_GROUP1,
- fontSet, "-*-fixed-medium-r-normal-*-*-120-*-*-m-*-*-*"),
- #else
- MI_FLAGCB("Sony 16", MF_CHECK | MF_GROUP1,
- fontSet, "-*-fixed-medium-r-normal--16-120-100-100-c-80-iso8859-1"),
- MI_FLAGCB("Sony 24", MF_CHECK | MF_GROUP1,
- fontSet, "-*-fixed-medium-r-normal--24-170-100-100-c-120-iso8859-1");
- #endif
- MI_FLAGCB("Courier 12", MF_CHECK | MF_GROUP1,
- fontSet, "-*-courier-medium-r-normal-*-*-120-*-*-m-*-*-*"),
- MI_SEPARATOR(),
- #define FM_SELECT 11
- MI_FLAGCB("select", MF_CHECK | MF_GROUP1, fontSet, NULL),
- };
- #endif
-
- #if 0
- static PaintMenuItem otherMenu[] =
- {
- MI_SIMPLECB("brushSelect", BrushSelect, NULL),
- #define SP_SELECT 1
- MI_SIMPLECB("sprayEdit", sprayMenuCallback, NULL),
- };
- #endif
-
static PaintMenuItem canvasMenu[] =
{
MI_SIMPLECB("new", GraphicCreate, 0),
--- 1255,1260 ----
diff -rc xpaint-2.8.19/pattern.c xpaint-2.8.19.2/pattern.c
*** xpaint-2.8.19/pattern.c 2010-04-05 16:46:12.000000000 +0200
--- xpaint-2.8.19.2/pattern.c 2010-04-07 23:06:56.000000000 +0200
***************
*** 483,489 ****
void
saveConfigCallback(Widget w, LocalInfo * info, XtPointer junk)
{
! GetFileName(Global.patternshell, 2, ".XPaintrc",
(XtCallbackProc) saveConfigOkCallback, (XtPointer) info);
}
--- 483,489 ----
void
saveConfigCallback(Widget w, LocalInfo * info, XtPointer junk)
{
! GetFileName(Global.patternshell, BROWSER_SIMPLESAVE, ".XPaintrc",
(XtCallbackProc) saveConfigOkCallback, (XtPointer) info);
}
***************
*** 510,516 ****
void
loadConfigCallback(Widget w, LocalInfo * info, XtPointer junk)
{
! GetFileName(Global.patternshell, 3, ".XPaintrc",
(XtCallbackProc) loadConfigOkCallback, (XtPointer) info);
}
--- 510,516 ----
void
loadConfigCallback(Widget w, LocalInfo * info, XtPointer junk)
{
! GetFileName(Global.patternshell, BROWSER_SIMPLEREAD, ".XPaintrc",
(XtCallbackProc) loadConfigOkCallback, (XtPointer) info);
}
***************
*** 1400,1406 ****
static void
readCallback(Widget w, XtPointer paint, XtPointer junk)
{
! GetFileName((Widget) paint, 0, NULL, readFileCallback, NULL);
}
static void
--- 1400,1406 ----
static void
readCallback(Widget w, XtPointer paint, XtPointer junk)
{
! GetFileName((Widget) paint, BROWSER_READ, NULL, readFileCallback, NULL);
}
static void
diff -rc xpaint-2.8.19/rw/readWritePS.c xpaint-2.8.19.2/rw/readWritePS.c
*** xpaint-2.8.19/rw/readWritePS.c 2010-04-05 15:36:57.000000000 +0200
--- xpaint-2.8.19.2/rw/readWritePS.c 2010-04-09 07:48:44.000000000 +0200
***************
*** 61,66 ****
--- 61,67 ----
extern int file_numpages;
extern int file_force;
extern int file_bbox;
+ extern int file_specified_zoom;
extern int paper_sizes[15][2];
extern void * xmalloc(size_t n);
***************
*** 674,680 ****
static char * last_rad = NULL;
static int last_type = 0;
char buffer[2048];
! char *sc, *dc;
FILE *fp;
int wth, hth, type_doc;
int i, j;
--- 675,681 ----
static char * last_rad = NULL;
static int last_type = 0;
char buffer[2048];
! char *sc, *dc, *ptr;
FILE *fp;
int wth, hth, type_doc;
int i, j;
***************
*** 750,758 ****
hth = 2172;
if (!strncmp(buffer, "\\*text:", 7)) {
sscanf(buffer+7, "%d %d*", &wth, &hth);
}
- if (wth<=0) wth = 1536;
- if (hth<=0) hth = 2172;
/* initialize pixmap and data structures */
sprintf(buffer, "%d %d", wth, hth);
--- 751,762 ----
hth = 2172;
if (!strncmp(buffer, "\\*text:", 7)) {
sscanf(buffer+7, "%d %d*", &wth, &hth);
+ if (wth<=0) wth = 1536;
+ if (hth<=0) hth = 2172;
+ ptr = strstr(buffer, "\\*zoom:");
+ if (ptr)
+ file_specified_zoom=atoi(ptr+7);
}
/* initialize pixmap and data structures */
sprintf(buffer, "%d %d", wth, hth);
diff -rc xpaint-2.8.19/rw/rwTable.c xpaint-2.8.19.2/rw/rwTable.c
*** xpaint-2.8.19/rw/rwTable.c 2010-04-05 17:53:48.000000000 +0200
--- xpaint-2.8.19.2/rw/rwTable.c 2010-04-09 07:27:03.000000000 +0200
***************
*** 148,153 ****
--- 148,154 ----
int file_force = 1;
int file_bbox = 1;
int file_transparent = 0;
+ int file_specified_zoom = 0;
RWwriteFunc
RWtableGetWriterFromSuffix(char *suffix)
***************
*** 175,180 ****
--- 176,182 ----
file_isSpecialImage = 0;
file_transparent = 0;
file_numpages = 1;
+ file_specified_zoom = 0;
for (i = 0; i < FMT_NUMBER; i++) {
if (RWtable[i].read == NULL || RWtable[i].test == NULL)
diff -rc xpaint-2.8.19/xpaint.h xpaint-2.8.19.2/xpaint.h
*** xpaint-2.8.19/xpaint.h 2010-04-05 16:30:47.000000000 +0200
--- xpaint-2.8.19.2/xpaint.h 2010-04-07 23:12:33.000000000 +0200
***************
*** 45,50 ****
--- 45,53 ----
#define NULL 0
#endif /* AIXV3 */
+ enum {BROWSER_READ=0, BROWSER_MULTIREAD, BROWSER_LOADED,
+ BROWSER_SAVE, BROWSER_SIMPLEREAD, BROWSER_SIMPLESAVE};
+
extern char *routine;
typedef struct {
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/xpaint/devel/.cvsignore,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- .cvsignore 2 Feb 2010 13:42:51 -0000 1.5
+++ .cvsignore 21 Apr 2010 15:51:45 -0000 1.6
@@ -1 +1 @@
-xpaint-2.8.15.tar.bz2
+xpaint-2.8.19.tar.bz2
Index: import.log
===================================================================
RCS file: /cvs/pkgs/rpms/xpaint/devel/import.log,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- import.log 14 Feb 2010 01:53:36 -0000 1.8
+++ import.log 21 Apr 2010 15:51:46 -0000 1.9
@@ -6,3 +6,4 @@ xpaint-2_8_13_1-3_fc12:HEAD:xpaint-2.8.1
xpaint-2_8_15-1_fc12:HEAD:xpaint-2.8.15-1.fc12.src.rpm:1265118127
xpaint-2_8_15-2_fc12:HEAD:xpaint-2.8.15-2.fc12.src.rpm:1265451411
xpaint-2_8_15-3_fc12:HEAD:xpaint-2.8.15-3.fc12.src.rpm:1266112388
+xpaint-2_8_19-1_fc12:HEAD:xpaint-2.8.19-1.fc12.src.rpm:1271865064
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/xpaint/devel/sources,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- sources 2 Feb 2010 13:42:52 -0000 1.5
+++ sources 21 Apr 2010 15:51:46 -0000 1.6
@@ -1 +1 @@
-13e2965b2c2fb4f24a475a309effd8bd xpaint-2.8.15.tar.bz2
+fa50b57e29c2024f825bcc12ab84c29a xpaint-2.8.19.tar.bz2
Index: xpaint.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xpaint/devel/xpaint.spec,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- xpaint.spec 14 Feb 2010 01:53:36 -0000 1.8
+++ xpaint.spec 21 Apr 2010 15:51:46 -0000 1.9
@@ -1,15 +1,18 @@
-%bcond_without Xaw3d
+%bcond_without xaw3dxft
+%bcond_with Xaw3d
%bcond_with neXtaw
Summary: An X Window System image editing or paint program
Name: xpaint
-Version: 2.8.15
-Release: 3%{?dist}
+Version: 2.8.19
+Release: 1%{?dist}
License: GPLv3+
Group: Applications/Multimedia
URL: http://sourceforge.net/projects/sf-xpaint
Source0: http://downloads.sourceforge.net/sf-xpaint/%{name}-%{version}.tar.bz2
-Patch0: xpaint-2.8.15-text-ctrlH-segfault.patch
+Patch0: xpaint-2.8.19-minor_fixes.patch
+Patch1: xpaint-2.8.19-small-improvements.patch
+Patch2: xpaint-2.8.19-ewmh-minor-fixes.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: bison flex imake chrpath
@@ -22,7 +25,8 @@ BuildRequires: libXaw-devel
BuildRequires: libXdmcp-devel
BuildRequires: libXext-devel
BuildRequires: libXp-devel
-%{?with_Xaw3d:BuildRequires: Xaw3d-devel}
+BuildRequires: libXft-devel
+BuildRequires: Xaw3d-devel
%{?with_neXtaw:BuildRequires: neXtaw-devel}
Requires: cups, gv, netpbm, psutils
# The only way of compiling and linking plugins on the fly.
@@ -39,8 +43,12 @@ algorithms, scripting and batch jobs. XP
of multiple images simultaneously and supports a wide variety of
image formats, including: GIF, JPG, PNG, PPM, TIFF, XBM, XPM, etc.
-Xpaint supports the Xaw3d widget set for a nicer look,
-and offers optional editing features based on programmable filters
+xpaint is now fully UTF8 compliant, and is capable of using anti-aliased
+truetype fonts in its operations and in the menus (in particular,
+translating to oriental languages should now be quite easy - also
+the X core font protocol is no longer used anywhere.)
+
+xpaint also offers optional editing features based on programmable filters
and user defined procedures written as scripts in plain C.
The package includes a substantial list of examples and
some support for batch processing.
@@ -48,12 +56,12 @@ some support for batch processing.
%prep
%setup -q
%patch0 -p1
-sed -i -e 's|-lXpm|-lXpm -lX11 -lm -lXmu -lXt -lXext|g' Local.config
+%patch1 -p1
+%patch2 -p1
+sed -i -e 's|-lXext|-lXext -lfontconfig|g' Local.config
sed -i -e 's|/lib |/%{_lib} |g' Local.config
sed -i -e 's|@XPMDIR@|%{_prefix}|g' Local.config
sed -i -e 's|/usr/lib|%{_libdir}|g' configure
-sed -i -e 's|strip|#strip|g' Imakefile
-sed -i -e 's|install -c -s pdfconcat|install -c pdfconcat|g' Imakefile
sed -i -e 's|CFLAGS="-O3 -s -DNDEBUG=1"|CFLAGS=$RPM_OPT_FLAGS|g' pdfconcat.c
for f in ChangeLog README; do
iconv -f iso-8859-1 -t utf-8 $f > $f.utf8
@@ -66,9 +74,12 @@ sed -i -e "s/\(XCOMM CDEBUGFLAGS =\)/CDE
# this is for debugging, to save the temporary file Imakefile.c
touch fake
ln fake Imakefile.c
-%configure
+./configure
-make %{?_smp_mflags} \
+# make %{?_smp_mflags} \
+# avoids laygram.h not found
+make \
+ %{?with_xaw3dxft:xaw3dxft.so} \
%{?with_Xaw3d:xaw3dg} \
%{?with_neXtaw:nextaw}
@@ -91,6 +102,12 @@ desktop-file-install --delete-original
mkdir -p %{buildroot}%{_datadir}/pixmaps
cp -a $RPM_BUILD_DIR/%{name}-%{version}/icons/* %{buildroot}%{_datadir}/pixmaps
+# libs
+%if %{with xaw3dxft}
+mkdir -p %{buildroot}%{_libdir}
+cp -a $RPM_BUILD_DIR/%{name}-%{version}/xaw3dxft/libXaw3dxft.* %{buildroot}%{_libdir}
+%endif
+
# rpath
chrpath --delete %{buildroot}%{_bindir}/xpaint
@@ -106,7 +123,7 @@ rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
-%doc ChangeLog GPL-3.0.txt README README.old README.PNG TODO Doc/sample.Xdefaults
+%doc ChangeLog GPL-3.0.txt README README.old README.PNG TODO Doc/sample.Xdefaults Doc/Operator.doc
%{_bindir}/%{name}
%{_bindir}/imgmerge
%{_bindir}/pdfconcat
@@ -116,9 +133,22 @@ rm -rf %{buildroot}
%{_datadir}/%{name}
%{_datadir}/pixmaps/%{name}*
%{_mandir}/man1/%{name}.1x*
+%if %{with xaw3dxft}
+%{_libdir}/libXaw3dxft.*
+%endif
%changelog
+* Mon Mar 08 2010 Paulo Roma <roma at lcg.ufrj.br> 2.8.19-1
+- Update to 2.8.19
+- BRs: xaw/xaw3d are optional.
+- Added BR libXft-devel.
+
+* Sat Feb 14 2010 Paulo Roma <roma at lcg.ufrj.br> 2.8.16-1
+- Update to 2.8.16
+- Removed obsolete patch text-ctrlH-segfault.
+- Source is no longer stripped by default.
+
* Sat Feb 13 2010 Paulo Roma <roma at lcg.ufrj.br> 2.8.15-3
- Fixed the ImplicitDSOLinking.
--- xpaint-2.8.15-text-ctrlH-segfault.patch DELETED ---
More information about the scm-commits
mailing list