Remove Closure->drawGC
This commit is contained in:
committed by
Stéphane Lesimple
parent
5da5fa54dc
commit
ce64c57c49
@@ -683,9 +683,6 @@ void FreeClosure()
|
|||||||
if(Closure->rawEditorContext)
|
if(Closure->rawEditorContext)
|
||||||
GuiFreeRawEditorContext(Closure->rawEditorContext);
|
GuiFreeRawEditorContext(Closure->rawEditorContext);
|
||||||
|
|
||||||
if(Closure->drawGC)
|
|
||||||
g_object_unref(Closure->drawGC);
|
|
||||||
|
|
||||||
cond_free(Closure->background);
|
cond_free(Closure->background);
|
||||||
cond_free(Closure->foreground);
|
cond_free(Closure->foreground);
|
||||||
cond_free(Closure->grid);
|
cond_free(Closure->grid);
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ typedef struct _GlobalClosure
|
|||||||
|
|
||||||
/*** Common stuff for drawing curves and spirals */
|
/*** Common stuff for drawing curves and spirals */
|
||||||
|
|
||||||
GdkGC *drawGC;
|
gboolean colors_initialized;
|
||||||
GdkColor *background,*foreground,*grid;
|
GdkColor *background,*foreground,*grid;
|
||||||
GdkColor *redText;
|
GdkColor *redText;
|
||||||
char *redMarkup;
|
char *redMarkup;
|
||||||
|
|||||||
@@ -43,12 +43,10 @@ static void toggle_cb(GtkWidget *widget, gpointer data)
|
|||||||
static gboolean expose_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
static gboolean expose_cb(GtkWidget *widget, GdkEventExpose *event, gpointer data)
|
||||||
{ GtkWidget *box = (GtkWidget*)data;
|
{ GtkWidget *box = (GtkWidget*)data;
|
||||||
|
|
||||||
if(!Closure->drawGC)
|
if(!Closure->colors_initialized)
|
||||||
{ GdkColor *bg = &widget->style->bg[0];
|
{ GdkColor *bg = &widget->style->bg[0];
|
||||||
GdkColormap *cmap = gdk_colormap_get_system();
|
GdkColormap *cmap = gdk_colormap_get_system();
|
||||||
|
|
||||||
Closure->drawGC = gdk_gc_new(gtk_widget_get_window(widget));
|
|
||||||
|
|
||||||
memcpy(Closure->background, bg, sizeof(GdkColor));
|
memcpy(Closure->background, bg, sizeof(GdkColor));
|
||||||
|
|
||||||
gdk_colormap_alloc_color(cmap, Closure->foreground, FALSE, TRUE);
|
gdk_colormap_alloc_color(cmap, Closure->foreground, FALSE, TRUE);
|
||||||
@@ -72,6 +70,8 @@ static gboolean expose_cb(GtkWidget *widget, GdkEventExpose *event, gpointer dat
|
|||||||
gdk_colormap_alloc_color(cmap, Closure->whiteSector, FALSE, TRUE);
|
gdk_colormap_alloc_color(cmap, Closure->whiteSector, FALSE, TRUE);
|
||||||
gdk_colormap_alloc_color(cmap, Closure->darkSector, FALSE, TRUE);
|
gdk_colormap_alloc_color(cmap, Closure->darkSector, FALSE, TRUE);
|
||||||
|
|
||||||
|
Closure->colors_initialized = TRUE;
|
||||||
|
|
||||||
/* Dirty trick for indenting the list:
|
/* Dirty trick for indenting the list:
|
||||||
draw an invisible dash before each indented line */
|
draw an invisible dash before each indented line */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user