Thu Apr 27 03:16:59 GMT 2000

(gilbertt)

Okay, an ImlibProgressFunction now return int, not void. The idea of this is
so that a progressive load may be aborted midway, simply by returning 0 from
the progress callback. There are a number of reasons for wanting this.

This is a slight breakage to people currently using progressive loading -
you'll have to change your definition to int, and return 1 to get normal
behaviour again. As far as I know, only feh and imlib2_view uses progressive
loading, and I'll sort those two out. To anyone else, sorry, but it's not
released yet, what did you expect? ;-)

Notice. I haven't changed the loaders yet, so returning 0 won't do squat
until tomorrow, when I change them all. What they will do is clean up and
return what they've got so far. If anyone who wrote a loader wants to do
their own, cool, it'll save me learning the api of every damn image lib ;-)
It's just a case of swapping
progress(params, ...);
with
if(!progress(params, ...)
  cleanup_some_stuff_and_return_what_there_is();
Otherwise, I'll do it myself tomorrow.

Can anyone tell I've got time off work? ;-)


SVN revision: 2544
This commit is contained in:
Tom Gilbert 2000-04-27 02:14:59 +00:00
parent ef67431a5b
commit ed923261d4
4 changed files with 31 additions and 4 deletions

View File

@ -2851,3 +2851,29 @@ themselves. This is so I can change them all at once tomorrow.
_______________________________________________
Thu Apr 27 03:16:59 GMT 2000
(gilbertt)
Okay, an ImlibProgressFunction now return int, not void. The idea of this is
so that a progressive load may be aborted midway, simply by returning 0 from
the progress callback. There are a number of reasons for wanting this.
This is a slight breakage to people currently using progressive loading -
you'll have to change your definition to int, and return 1 to get normal
behaviour again. As far as I know, only feh and imlib2_view uses progressive
loading, and I'll sort those two out. To anyone else, sorry, but it's not
released yet, what did you expect? ;-)
Notice. I haven't changed the loaders yet, so returning 0 won't do squat
until tomorrow, when I change them all. What they will do is clean up and
return what they've got so far. If anyone who wrote a loader wants to do
their own, cool, it'll save me learning the api of every damn image lib ;-)
It's just a case of swapping
progress(params, ...);
with
if(!progress(params, ...)
cleanup_some_stuff_and_return_what_there_is();
Otherwise, I'll do it myself tomorrow.
_______________________________________________

View File

@ -22,11 +22,11 @@ int depth;
int image_width = 0, image_height = 0;
Imlib_Image bg_im = NULL;
static void
static int
progress(Imlib_Image im, char percent, int update_x, int update_y,
int update_w, int update_h);
static void
static int
progress(Imlib_Image im, char percent, int update_x, int update_y,
int update_w, int update_h)
{
@ -91,6 +91,7 @@ progress(Imlib_Image im, char percent, int update_x, int update_y,
XSetWindowBackgroundPixmap(disp, win, pm);
XClearArea(disp, win, update_x, update_y, update_w, update_h, False);
XFlush(disp);
return 1;
}
int

View File

@ -73,7 +73,7 @@ struct _imlib_rectangle
int x, y, width, height;
};
typedef void (*Imlib_Progress_Function)(Imlib_Image im, char percent,
typedef int (*Imlib_Progress_Function)(Imlib_Image im, char percent,
int update_x, int update_y,
int update_w, int update_h);
typedef void (*Imlib_Data_Destructor_Function)(Imlib_Image im, void *data);

View File

@ -9,7 +9,7 @@ typedef struct _imlibborder ImlibBorder;
typedef struct _imlibloader ImlibLoader;
typedef struct _imlibimagetag ImlibImageTag;
typedef void (*ImlibProgressFunction)(ImlibImage *im, char percent,
typedef int (*ImlibProgressFunction)(ImlibImage *im, char percent,
int update_x, int update_y,
int update_w, int update_h);
typedef void (*ImlibDataDestructorFunction)(ImlibImage *im, void *data);