Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 43618
Collapse All | Expand All

(-)scrot-0.6/src/imlib.c (-1 / +1 lines)
Lines 38-44 init_x_and_imlib(char *dispstr, int scre Link Here
38
{
38
{
39
   disp = XOpenDisplay(dispstr);
39
   disp = XOpenDisplay(dispstr);
40
   if (!disp)
40
   if (!disp)
41
      eprintf("Can't open X display. It *is* running, yeah?");
41
      gib_eprintf("Can't open X display. It *is* running, yeah?");
42
   if (screen_num)
42
   if (screen_num)
43
      scr = ScreenOfDisplay(disp, screen_num);
43
      scr = ScreenOfDisplay(disp, screen_num);
44
   else
44
   else
(-)scrot-0.6/src/main.c (-11 / +11 lines)
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
   {
(-)scrot-0.6/src/options.c (-3 / +3 lines)
Lines 84-90 scrot_parse_option_array(int argc, char Link Here
84
           opt.delay = atoi(optarg);
84
           opt.delay = atoi(optarg);
85
           break;
85
           break;
86
        case 'e':
86
        case 'e':
87
           opt.exec = estrdup(optarg);
87
           opt.exec = gib_estrdup(optarg);
88
           break;
88
           break;
89
        case 'm':
89
        case 'm':
90
           opt.multidisp = 1;
90
           opt.multidisp = 1;
Lines 127-133 scrot_parse_option_array(int argc, char Link Here
127
               opt.thumb_file = name_thumbnail(opt.output_file);
127
               opt.thumb_file = name_thumbnail(opt.output_file);
128
         }
128
         }
129
         else
129
         else
130
            weprintf("unrecognised option %s\n", argv[optind++]);
130
            gib_weprintf("unrecognised option %s\n", argv[optind++]);
131
      }
131
      }
132
   }
132
   }
133
133
Lines 144-150 name_thumbnail(char *name) Link Here
144
   size_t diff = 0;
144
   size_t diff = 0;
145
145
146
   length = strlen(name) + 7;
146
   length = strlen(name) + 7;
147
   new_title = emalloc(length);
147
   new_title = gib_emalloc(length);
148
148
149
   dot_pos = strrchr(name, '.');
149
   dot_pos = strrchr(name, '.');
150
   if (dot_pos)
150
   if (dot_pos)

Return to bug 43618