예제 #1
0
static void save_a_color(FILE *Fp, color_info *default_color, color_info *current_color, const char *ext_name)
{
#if HAVE_EXTENSION_LANGUAGE
  if ((current_color->red != default_color->red) ||
      (current_color->green != default_color->green) ||
      (current_color->blue != default_color->blue))

#if HAVE_FORTH
    fprintf(Fp, "%.3f %.3f %.3f %s set-%s drop\n", 
	    RGB_TO_FLOAT(current_color->red),
	    RGB_TO_FLOAT(current_color->green),
	    RGB_TO_FLOAT(current_color->blue),
	    S_make_color,
	    ext_name); 
#else
#if HAVE_SCHEME
    fprintf(Fp, "(set! (%s) (%s %.3f %.3f %.3f))\n", 
#endif
#if HAVE_RUBY
    fprintf(Fp, "set_%s(%s(%.3f, %.3f, %.3f))\n", 
#endif
	    TO_PROC_NAME(ext_name), 
	    TO_PROC_NAME(S_make_color),
	    RGB_TO_FLOAT(current_color->red),
	    RGB_TO_FLOAT(current_color->green),
	    RGB_TO_FLOAT(current_color->blue));
#endif /* not forth */
#endif /* ext lang */

  free(default_color); /* macro has rgb_to_color which allocates */
}
예제 #2
0
void save_find_dialog_state(FILE *fd)
{
  if ((edit_find_dialog) && (XtIsManaged(edit_find_dialog)))
    {
      char *text = NULL;
      text = XmTextGetString(edit_find_text);
      if ((text) && (*text))
	{
#if HAVE_SCHEME
	  fprintf(fd, "(%s #t \"%s\")\n", S_find_dialog, text);
#endif
#if HAVE_RUBY
	  fprintf(fd, "%s(true, \"%s\")\n", TO_PROC_NAME(S_find_dialog), text);
#endif
#if HAVE_FORTH
	  fprintf(fd, "#t \"%s\" %s drop\n", text, S_find_dialog);
#endif
	  XtFree(text);
	}
      else 
	{
#if HAVE_SCHEME
	  if (ss->search_expr)
	    fprintf(fd, "(%s #t \"%s\")\n", S_find_dialog, ss->search_expr);
	  else fprintf(fd, "(%s #t)\n", S_find_dialog);
#endif
#if HAVE_RUBY
	  if (ss->search_expr)
	    fprintf(fd, "%s(true, \"%s\")\n", TO_PROC_NAME(S_find_dialog), ss->search_expr);
	  else fprintf(fd, "%s(true)\n", TO_PROC_NAME(S_find_dialog));
#endif
#if HAVE_FORTH
	  if (ss->search_expr)
	    fprintf(fd, "#t \"%s\" %s drop\n", ss->search_expr, S_find_dialog);
	  else fprintf(fd, "#t %s drop\n", S_find_dialog);
#endif
	}
    }
}
예제 #3
0
	Proc_Count
};

#define TO_PROC_NAME(symbol) (#symbol + PREFIX_LENGTH)
static const char* const gProcNames[Proc_Count] = {
	/*
	* The order of the entries in this array should be synced with enum Indices.
	*
	* If C99 Designated Initializers is supported that will be great.
	 * We can totally ignore the order of the entires define in this array.
	 *
	 * [Index_Of_ADL_Main_Control_Destroy] = TO_PROC_NAME(Index_Of_ADL_Main_Control_Destroy),
	 * [Index_Of_ADL_Main_Control_Create] = TO_PROC_NAME(Index_Of_ADL_Main_Control_Create),
	 */
	TO_PROC_NAME(Index_Of_ADL_Main_Control_Create), // will become "ADL_Main_Control_Create"
	TO_PROC_NAME(Index_Of_ADL_Main_Control_Refresh),
	TO_PROC_NAME(Index_Of_ADL_Main_Control_Destroy),
	TO_PROC_NAME(Index_Of_ADL_Graphics_Platform_Get),
	TO_PROC_NAME(Index_Of_ADL_Adapter_Active_Get),
	TO_PROC_NAME(Index_Of_ADL_Adapter_NumberOfAdapters_Get),
	TO_PROC_NAME(Index_Of_ADL_Adapter_AdapterInfo_Get),
	TO_PROC_NAME(Index_Of_ADL_Adapter_ASICFamilyType_Get),
	TO_PROC_NAME(Index_Of_ADL_Adapter_Speed_Caps),
	TO_PROC_NAME(Index_Of_ADL_Adapter_Speed_Get),
	TO_PROC_NAME(Index_Of_ADL_Adapter_Speed_Set),
	TO_PROC_NAME(Index_Of_ADL_Adapter_Accessibility_Get),
	TO_PROC_NAME(Index_Of_ADL_Adapter_VideoBiosInfo_Get),
	TO_PROC_NAME(Index_Of_ADL_Adapter_ID_Get),
	TO_PROC_NAME(Index_Of_ADL_Adapter_CrossdisplayAdapterRole_Caps),
	TO_PROC_NAME(Index_Of_ADL_Adapter_CrossdisplayInfo_Get),