1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * deepzoomimagetilesource.h
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2007-2008 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
14 #ifndef __DEEPZOOMIMAGETILESOURCE_H__
15 #define __DEEPZOOMIMAGETILESOURCE_H__
17 #include "multiscalesubimage.h"
18 #include "multiscaleimage.h"
19 #include "tilesource.h"
20 #include "downloader.h"
23 typedef void (*parsed_cb
) (void *userdata
);
25 /* @Version=2,Namespace=System.Windows.Media */
26 class DeepZoomImageTileSource
: public MultiScaleTileSource
{
29 Downloader
* downloader
;
31 parsed_cb parsed_callback
;
32 parsed_cb failed_callback
;
35 static void downloader_complete (EventObject
*sender
, EventArgs
*calldata
, gpointer closure
);
36 static void downloader_failed (EventObject
*sender
, EventArgs
*calldata
, gpointer closure
);
37 void DownloaderComplete ();
38 void download_uri (const char* url
);
47 void Parse (const char* filename
);
53 virtual ~DeepZoomImageTileSource ();
57 bool IsCollection () { return isCollection
;}
58 int GetMaxLevel () { return maxLevel
;}
60 /* @GenerateCBinding,GeneratePInvoke */
61 DeepZoomImageTileSource ();
63 DeepZoomImageTileSource (Uri
*uri
, bool nested
= false);
65 bool GetTileLayer (int level
, int x
, int y
, Uri
*uri
);
66 bool IsDownloaded () {return downloaded
; }
67 bool IsParsed () {return parsed
; }
69 virtual void OnPropertyChanged (PropertyChangedEventArgs
*args
, MoonError
*error
);
70 void set_parsed_cb (parsed_cb callback
, parsed_cb f_callback
, void *userdata
)
72 parsed_callback
= callback
;
73 failed_callback
= f_callback
;
74 cb_userdata
= userdata
;
81 /* @PropertyType=Uri,GenerateAccessors */
82 const static int UriSourceProperty
;
84 void SetUriSource (Uri
* value
);
87 void EndElement (void *info
, const char* el
);
91 #endif /* __DEEPZOOMIMAGETILESOURCE_H__ */