Skip to content

Instantly share code, notes, and snippets.

@veosotano
Created January 1, 2012 19:47
Show Gist options
  • Save veosotano/1548157 to your computer and use it in GitHub Desktop.
Save veosotano/1548157 to your computer and use it in GitHub Desktop.
vp's proposed architecture
After putting some effort into porting i came up with a thought maybe the current architecture is not that good for cross platform and cross target working. before i spend two hundred lines on explaining why i think so, i better use the time to write down my idea:
so we need two new classes
class AXR {
AXR::AXR(list<string> xml, cairo_t* cr);
void set_cr(cairo_t* cr);
void render(); //utilizing AXRRender
void dispatchEvent(void* event); //not sure which struct here
....
};
and
virtual class AXRWrapper {}
with derived
class WindowsWrapper : public AXRWrapper { //standalone
WindowsWrapper(){
//create window
//get drawing context
//setup event loop
//query file
//load it
new AXR(filebuffer, drawingcontext);
}
...
}
and (!)
class ChromeWrapper : public AXRWrapper { //plugin
ChromeWrapper(){
//get transfered http data brom browser
//get drawing context of page (even via canvas tag as fallback, everything possible)
//event listener and stuff
new AXR(serverrespond, browsercanvas);
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment