Exemplo n.º 1
0
static void
unrealize (GtkWidget *widget,
	   gpointer   data)
{
  g_object_unref (G_OBJECT (ft2_context));
  pango_ft2_shutdown_display ();
}
Exemplo n.º 2
0
GLboolean
glgdGraphFini(glgdGraph *graph)
{
    if (graph != NULL)
    {
        if (graph->nodeHead)
        {
            glgdNodeDestroy(graph->nodeHead);
        }
        glgdStrokeFini(&graph->stroke);
        glgdBitfieldFini(&graph->attributes);
        g_timer_destroy(graph->timer);

#ifdef HAVE_GLGD_PANGO
        glgdTextureFini(&graph->textTexture);
        if (graph->pangoFT2Context != NULL)
        {
            g_object_unref(G_OBJECT(graph->pangoFT2Context));
            pango_ft2_shutdown_display();
            graph->pangoFT2Context = NULL;
        }
        if (graph->layout != NULL) {
            g_object_unref(G_OBJECT(graph->layout));
            graph->layout = NULL;
        }
#endif  /* HAVE_GLGD_PANGO */

        graph->flags = GLGDGRAPH_FLAG_INITIALIZED;
        graph->nodeCount = 0;
        graph->linkCount = 0;
        graph->frameTime = 1.0 / 30.0;
        graph->margin = GLGDGRAPH_NODEMARGIN_DEFAULT;
        graph->dim[0] = GLGDGRAPH_NODEWIDTH_DEFAULT;
        graph->dim[1] = GLGDGRAPH_NODEHEIGHT_DEFAULT;
        graph->extents[0] = +_MAXFLT;
        graph->extents[1] = +_MAXFLT;
        graph->extents[2] = -_MAXFLT;
        graph->extents[3] = -_MAXFLT;
        glgdGraphLineColorSet(graph, s_lineColor);
        glgdCamInit(&graph->ctrlCam);
        glgdStrokeInit(&graph->stroke);
        graph->stroke.flags |= GLGDSTROKE_FLAG_INVERT;
        glgdStrokeColorSet(&graph->stroke, s_strokeColor);
        glgdStrokePointSizeSet(&graph->stroke, s_strokePointSize);
        glgdBitfieldInit(&graph->attributes);
        graph->nodeHead = NULL;
        graph->linkListHead = NULL;
        graph->hoverNode = NULL;
        graph->hoverLink = NULL;
        graph->timer = g_timer_new();
        graph->gtkWindow = NULL;
        graph->gtkGLDrawArea = NULL;
    }
    
    return GL_FALSE;
}