|
Lines 40-47
main(int argc, char **argv)
Link Here
|
| 40 |
|
40 |
|
| 41 |
if (!opt.output_file) |
41 |
if (!opt.output_file) |
| 42 |
{ |
42 |
{ |
| 43 |
opt.output_file = estrdup("%Y-%m-%d-%H%M%S_$wx$h_scrot.png"); |
43 |
opt.output_file = gib_estrdup("%Y-%m-%d-%H%M%S_$wx$h_scrot.png"); |
| 44 |
opt.thumb_file = estrdup("%Y-%m-%d-%H%M%S_$wx$h_scrot-thumb.png"); |
44 |
opt.thumb_file = gib_estrdup("%Y-%m-%d-%H%M%S_$wx$h_scrot-thumb.png"); |
| 45 |
} |
45 |
} |
| 46 |
|
46 |
|
| 47 |
|
47 |
|
|
Lines 61-67
main(int argc, char **argv)
Link Here
|
| 61 |
} |
61 |
} |
| 62 |
|
62 |
|
| 63 |
if (!image) |
63 |
if (!image) |
| 64 |
eprintf("no image grabbed"); |
64 |
gib_eprintf("no image grabbed"); |
| 65 |
|
65 |
|
| 66 |
imlib_context_set_image(image); |
66 |
imlib_context_set_image(image); |
| 67 |
imlib_image_attach_data_value("quality", NULL, opt.quality, NULL); |
67 |
imlib_image_attach_data_value("quality", NULL, opt.quality, NULL); |
|
Lines 69-75
main(int argc, char **argv)
Link Here
|
| 69 |
filename = im_printf(opt.output_file, NULL, image); |
69 |
filename = im_printf(opt.output_file, NULL, image); |
| 70 |
gib_imlib_save_image_with_error_return(image, filename, &err); |
70 |
gib_imlib_save_image_with_error_return(image, filename, &err); |
| 71 |
if (err) |
71 |
if (err) |
| 72 |
eprintf("Saving to file %s failed\n", filename); |
72 |
gib_eprintf("Saving to file %s failed\n", filename); |
| 73 |
if (opt.thumb) |
73 |
if (opt.thumb) |
| 74 |
{ |
74 |
{ |
| 75 |
int cwidth, cheight; |
75 |
int cwidth, cheight; |
|
Lines 80-92
main(int argc, char **argv)
Link Here
|
| 80 |
cwidth * opt.thumb / 100, |
80 |
cwidth * opt.thumb / 100, |
| 81 |
cheight * opt.thumb / 100,1); |
81 |
cheight * opt.thumb / 100,1); |
| 82 |
if (thumbnail == NULL) |
82 |
if (thumbnail == NULL) |
| 83 |
eprintf("Unable to create scaled Image\n"); |
83 |
gib_eprintf("Unable to create scaled Image\n"); |
| 84 |
else |
84 |
else |
| 85 |
{ |
85 |
{ |
| 86 |
filename = im_printf(opt.thumb_file, NULL, thumbnail); |
86 |
filename = im_printf(opt.thumb_file, NULL, thumbnail); |
| 87 |
gib_imlib_save_image_with_error_return(thumbnail, filename, &err); |
87 |
gib_imlib_save_image_with_error_return(thumbnail, filename, &err); |
| 88 |
if (err) |
88 |
if (err) |
| 89 |
eprintf("Saving thumbnail %s failed\n", filename); |
89 |
gib_eprintf("Saving thumbnail %s failed\n", filename); |
| 90 |
} |
90 |
} |
| 91 |
} |
91 |
} |
| 92 |
if (opt.exec) |
92 |
if (opt.exec) |
|
Lines 181-193
Imlib_Image scrot_sel_and_grab_image(voi
Link Here
|
| 181 |
ButtonMotionMask | ButtonPressMask | ButtonReleaseMask, |
181 |
ButtonMotionMask | ButtonPressMask | ButtonReleaseMask, |
| 182 |
GrabModeAsync, GrabModeAsync, root, cursor, |
182 |
GrabModeAsync, GrabModeAsync, root, cursor, |
| 183 |
CurrentTime) != GrabSuccess)) |
183 |
CurrentTime) != GrabSuccess)) |
| 184 |
eprintf("couldn't grab pointer:"); |
184 |
gib_eprintf("couldn't grab pointer:"); |
| 185 |
|
185 |
|
| 186 |
if ( |
186 |
if ( |
| 187 |
(XGrabKeyboard |
187 |
(XGrabKeyboard |
| 188 |
(disp, root, False, GrabModeAsync, GrabModeAsync, |
188 |
(disp, root, False, GrabModeAsync, GrabModeAsync, |
| 189 |
CurrentTime) != GrabSuccess)) |
189 |
CurrentTime) != GrabSuccess)) |
| 190 |
eprintf("couldn't grab keyboard:"); |
190 |
gib_eprintf("couldn't grab keyboard:"); |
| 191 |
|
191 |
|
| 192 |
|
192 |
|
| 193 |
while (1) |
193 |
while (1) |
|
Lines 263-269
Imlib_Image scrot_sel_and_grab_image(voi
Link Here
|
| 263 |
count = select(fdsize, &fdset, NULL, NULL, NULL); |
263 |
count = select(fdsize, &fdset, NULL, NULL, NULL); |
| 264 |
if ((count < 0) |
264 |
if ((count < 0) |
| 265 |
&& ((errno == ENOMEM) || (errno == EINVAL) || (errno == EBADF))) |
265 |
&& ((errno == ENOMEM) || (errno == EINVAL) || (errno == EBADF))) |
| 266 |
eprintf("Connection to X display lost"); |
266 |
gib_eprintf("Connection to X display lost"); |
| 267 |
} |
267 |
} |
| 268 |
if (rect_w) |
268 |
if (rect_w) |
| 269 |
{ |
269 |
{ |
|
Lines 491-497
im_printf(char *str, char *filename, Iml
Link Here
|
| 491 |
else |
491 |
else |
| 492 |
strncat(ret, c, 1); |
492 |
strncat(ret, c, 1); |
| 493 |
} |
493 |
} |
| 494 |
return estrdup(ret); |
494 |
return gib_estrdup(ret); |
| 495 |
} |
495 |
} |
| 496 |
|
496 |
|
| 497 |
Window scrot_get_client_window(Display * display, Window target) |
497 |
Window scrot_get_client_window(Display * display, Window target) |
|
Lines 567-573
scrot_grab_shot_multi(void)
Link Here
|
| 567 |
|
567 |
|
| 568 |
dispstr = DisplayString(disp); |
568 |
dispstr = DisplayString(disp); |
| 569 |
|
569 |
|
| 570 |
subdisp = estrdup(DisplayString(disp)); |
570 |
subdisp = gib_estrdup(DisplayString(disp)); |
| 571 |
|
571 |
|
| 572 |
for (i = 0; i <screens; i++) |
572 |
for (i = 0; i <screens; i++) |
| 573 |
{ |
573 |
{ |