Ejemplo n.º 1
0
static void
gimp_colorize_tool_init (GimpColorizeTool *col_tool)
{
  GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (col_tool);

  col_tool->colorize = g_slice_new0 (Colorize);

  colorize_init (col_tool->colorize);

  im_tool->apply_func = (GimpImageMapApplyFunc) colorize;
  im_tool->apply_data = col_tool->colorize;
}
Ejemplo n.º 2
0
void
diagnostic_color_init (diagnostic_context *context, int value /*= -1 */)
{
  /* value == -1 is the default value.  */
  if (value < 0)
    {
      /* If DIAGNOSTICS_COLOR_DEFAULT is -1, default to
	 -fdiagnostics-color=auto if GCC_COLORS is in the environment,
	 otherwise default to -fdiagnostics-color=never, for other
	 values default to that
	 -fdiagnostics-color={never,auto,always}.  */
      if (DIAGNOSTICS_COLOR_DEFAULT == -1)
	{
	  if (!getenv ("GCC_COLORS"))
	    return;
	  value = DIAGNOSTICS_COLOR_AUTO;
	}
      else
	value = DIAGNOSTICS_COLOR_DEFAULT;
    }
  pp_show_color (context->printer)
    = colorize_init ((diagnostic_color_rule_t) value);
}