convert cocoa frontend to bitmap operation table

This commit is contained in:
Vincent Sanders 2015-04-16 23:52:19 +01:00
parent 839f15fc72
commit 8dc2a8f0b2
3 changed files with 22 additions and 2 deletions

View File

@ -24,6 +24,7 @@
#import "cocoa/SearchWindowController.h"
#import "cocoa/selection.h"
#import "cocoa/fetch.h"
#import "cocoa/bitmap.h"
#import "utils/filename.h"
#import "utils/log.h"
@ -220,7 +221,8 @@ int main( int argc, char **argv )
.clipboard = cocoa_clipboard_table,
.download = cocoa_download_table,
.fetch = cocoa_fetch_table,
.search = cocoa_search_table,
.search = cocoa_search_table,
.bitmap = cocoa_bitmap_table,
};
cocoa_autorelease();

View File

@ -21,4 +21,6 @@
CGImageRef cocoa_get_cgimage( void *bitmap );
#endif
struct gui_bitmap_table *cocoa_bitmap_table;
#endif

View File

@ -215,3 +215,19 @@ static CGImageRef cocoa_prepare_bitmap( void *bitmap )
return result;
}
static struct gui_bitmap_table bitmap_table = {
.create = bitmap_create,
.destroy = bitmap_destroy,
.set_opaque = bitmap_set_opaque,
.get_opaque = bitmap_get_opaque,
.test_opaque = bitmap_test_opaque,
.get_buffer = bitmap_get_buffer,
.get_rowstride = bitmap_get_rowstride,
.get_width = bitmap_get_width,
.get_height = bitmap_get_height,
.get_bpp = bitmap_get_bpp,
.save = bitmap_save,
.modified = bitmap_modified,
};
struct gui_bitmap_table *cocoa_bitmap_table = &bitmap_table;