Пример #1
0
PangoContext* wxApp::GetPangoContext()
{
    static PangoContext *s_pangoContext = NULL;
    if ( !s_pangoContext )
    {
        Display *dpy = wxGlobalDisplay();

#ifdef HAVE_PANGO_XFT
        int xscreen = DefaultScreen(dpy);
        static int use_xft = -1;
        if (use_xft == -1)
        {
            wxString val = wxGetenv( L"GDK_USE_XFT" );
            use_xft = val == L"1";
        }

        if (use_xft)
            s_pangoContext = pango_xft_get_context(dpy, xscreen);
        else
#endif // HAVE_PANGO_XFT
            s_pangoContext = pango_x_get_context(dpy);

        if (!PANGO_IS_CONTEXT(s_pangoContext))
        {
            wxLogError( wxT("No pango context.") );
        }
    }

    return s_pangoContext;
}
Пример #2
0
/**
 * gnome_print_pango_update_context:
 * @context: a #PangoContext from gnome_print_pango_create_context().
 * @gpc: a #GnomePrintContext
 * 
 * Update a context so that layout done with it reflects the
 * current state of @gpc. In general, every time you use a
 * #PangoContext with a different #GnomePrintContext, or
 * you change the transformation matrix of the #GnomePrintContext
 * (other than pure translations) you should call this function.
 * You also need to call pango_layout_context_changed() for any
 * #PangoLayout objects that exit for the #PangoContext.
 *
 * This function currently does nothing and that isn't expected
 * to change for gnome-print. The main benefit of calling it
 * is that your code will be properly prepared for conversion
 * to use with future rendering systems such as Cairo where
 * the corresponding operation will actually do something.
 */ 
void
gnome_print_pango_update_context (PangoContext      *context,
				  GnomePrintContext *gpc)
				  
{
	g_return_if_fail (PANGO_IS_CONTEXT (context));
	g_return_if_fail (is_gnome_print_object (G_OBJECT (context)));
	g_return_if_fail (GNOME_IS_PRINT_CONTEXT (gpc));
	
	/* nothing */
}
Пример #3
0
DivaCairoGraphics*              diva_cairo_graphics_new_limited_context (PangoContext *context)
{
        g_return_val_if_fail (PANGO_IS_CONTEXT (context), NULL);
                
        DivaCairoGraphics *this = g_new0 (DivaCairoGraphics, 1);
        
        this->Style = NULL;
        this->Context = context;
        this->Window = NULL;
        this->Cairo = NULL;
                
        g_object_ref (G_OBJECT (context));

        return this;
}
Пример #4
0
PangoContext* wxApp::GetPangoContext()
{
    static PangoContext *s_pangoContext = NULL;
    if ( !s_pangoContext )
    {
        Display *dpy = wxGlobalDisplay();
        int xscreen = DefaultScreen(dpy);

        s_pangoContext = pango_xft_get_context(dpy, xscreen);

        if (!PANGO_IS_CONTEXT(s_pangoContext))
        {
            wxLogError( wxT("No pango context.") );
        }
    }

    return s_pangoContext;
}
Пример #5
0
/* Create a new Cairo graphics */
DivaCairoGraphics*              diva_cairo_graphics_new (GdkWindow *window, GtkStyle *style,
                                                        PangoContext *context)
{
        g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
        g_return_val_if_fail (GTK_IS_STYLE (style), NULL);
        g_return_val_if_fail (PANGO_IS_CONTEXT (context), NULL);
        
        cairo_t *gr = gdk_cairo_create (window);
        g_return_val_if_fail (gr != NULL, NULL);
                
        DivaCairoGraphics *this = g_new0 (DivaCairoGraphics, 1);
        
        this->Style = style;
        this->Context = context;
        this->Window = window;
        this->Cairo = gr;
                
        g_object_ref (G_OBJECT (style));
        g_object_ref (G_OBJECT (window));
        g_object_ref (G_OBJECT (context));

        return this;
}