-
-
Notifications
You must be signed in to change notification settings - Fork 2
Getting gtkmm and cariomm from GTK and Cairo
marksvc edited this page Jun 17, 2021
·
1 revision
Note: This page contains old documentation from 2006, but may still be helpful. And it would still be okay to update, correct, and add to this page.
COM requires c-style objects, but I want to store C++ (mm) objects. GTK will want to use a Gdk Window (as the surface is liable to change). Printing will need a Cairo (possibly a context or a surface).
typedef Glib::RefPtr<Gdk::Window> WindowPtr; typedef Cairo::RefPtr<Cairo::Context> ContextPtr; typedef Cairo::RefPtr<Cairo::Surface> SurfacePtr;
WindowPtr m_window_ptr; ContextPtr m_ctxt_ptr;
m_window_ptr = wrap(win); m_ctxt_ptr = m_window_ptr->get_cairo_thingy();
m_ctxt_ptr = ContextPtr(new Cairo::Context(the_cairo_t));
m_surface_ptr = SurfacePtr(new Cairo::Surface(the_cairo_surface_t));
It may be best to write a create()
or wrap()
method similar to the 'standard' ones.