<commit_before>/* 
 * jcom.ui
 * External for Jamoma: provide standard user interface component for modules
 * By <NAME>, Copyright © 2007
 * 
 * License: This code is licensed under the terms of the "New BSD License"
 * http://creativecommons.org/licenses/BSD/
 */

#include "jcom.ui.h"

// TODO: This file, lamely, duplicates a lot of what is in jcom.hub.internals.cpp.
//			Should create a more DRY way of doing this.




void ui_color_contentBackground(t_ui *obj, t_symbol *msg, long argc, t_atom *argv);
void ui_color_toolbarBackground(t_ui *obj, t_symbol *msg, long argc, t_atom *argv);
void ui_color_toolbarText(t_ui *obj, t_symbol *msg, long argc, t_atom *argv);
void ui_color_border(t_ui *obj, t_symbol *msg, long argc, t_atom *argv);
void ui_color_highlight(t_ui *obj, t_symbol *msg, long argc, t_atom *argv);



void ui_internals_createColors(t_ui* obj)
{
	uiInternalObject	*anObject;
	t_atom				a[2];
	float				range[2];
	range[0] = 0.0;
	range[1] = 1.0;
	
	anObject = new uiInternalObject("jcom.message", "view/color/contentBackground", obj->box.b_patcher, "array", "none", "The background color of the module in the format RGBA where values range.", "both", range, NULL, NULL, NULL);
	anObject->setAction((method)ui_color_contentBackground, (t_object*)obj);
	hashtab_store(obj->hash_internals, gensym("view/color/contentBackground"), (t_object*)anObject);
	
	anObject = new uiInternalObject("jcom.message", "view/color/toolbarBackground", obj->box.b_patcher, "array", "none", "The background color of the module's toolbar in the format RGBA where values range.", "both", range, NULL, NULL, NULL);
	anObject->setAction((method)ui_color_toolbarBackground, (t_object*)obj);
	hashtab_store(obj->hash_internals, gensym("view/color/toolbarBackground"), (t_object*)anObject);
	
	anObject = new uiInternalObject("jcom.message", "view/color/toolbarText", obj->box.b_patcher, "array", "none", "The color of the module's toolbar text in the format RGBA where values range.", "both", range, NULL, NULL, NULL);
	anObject->setAction((method)ui_color_toolbarText, (t_object*)obj);
	hashtab_store(obj->hash_internals, gensym("view/color/toolbarText"), (t_object*)anObject);
	
	anObject = new uiInternalObject("jcom.message", "view/color/border", obj->box.b_patcher, "array", "none", "The border color of the module in the format RGBA where values range.", "both", range, NULL, NULL, NULL);
	anObject->setAction((method)ui_color_border, (t_object*)obj);
	hashtab_store(obj->hash_internals, gensym("view/color/border"), (t_object*)anObject);
	
	anObject = new uiInternalObject("jcom.parameter", "view/highlight", obj->box.b_patcher, "string", "none", "Highlight the module with a color tint such as red, green, or similar.", NULL, NULL, NULL, NULL, "none");
	anObject->setAction((method)ui_color_highlight, (t_object*)obj);
	hashtab_store(obj->hash_internals, gensym("view/highlight"), (t_object*)anObject);	
	
	anObject = new uiInternalObject("jcom.message", "view/size", obj->box.b_patcher, "generic", "none", "The size of the module's UI: [Width Height]", NULL, NULL, NULL, NULL, NULL);
	//anObject->setAction((method)ui_color_border, (t_object*)obj);
	anObject->setReadonly(true);
	atom_setlong(a+0, obj->box.b_patching_rect.width);<commit_msg>Updating jcom.ui to internally use @type decimalArray<commit_after>/* 
 * jcom.ui
 * External for Jamoma: provide standard user interface component for modules
 * By <NAME>, Copyright © 2007
 * 
 * License: This code is licensed under the terms of the "New BSD License"
 * http://creativecommons.org/licenses/BSD/
 */

#include "jcom.ui.h"

// TODO: This file, lamely, duplicates a lot of what is in jcom.hub.internals.cpp.
//			Should create a more DRY way of doing this.




void ui_color_contentBackground(t_ui *obj, t_symbol *msg, long argc, t_atom *argv);
void ui_color_toolbarBackground(t_ui *obj, t_symbol *msg, long argc, t_atom *argv);
void ui_color_toolbarText(t_ui *obj, t_symbol *msg, long argc, t_atom *argv);
void ui_color_border(t_ui *obj, t_symbol *msg, long argc, t_atom *argv);
void ui_color_highlight(t_ui *obj, t_symbol *msg, long argc, t_atom *argv);



void ui_internals_createColors(t_ui* obj)
{
	uiInternalObject	*anObject;
	t_atom				a[2];
	float				range[2];
	range[0] = 0.0;
	range[1] = 1.0;
	
	anObject = new uiInternalObject("jcom.message", "view/color/contentBackground", obj->box.b_patcher, "decimalArray", "none", "The background color of the module in the format RGBA where values range.", "both", range, NULL, NULL, NULL);
	anObject->setAction((method)ui_color_contentBackground, (t_object*)obj);
	hashtab_store(obj->hash_internals, gensym("view/color/contentBackground"), (t_object*)anObject);
	
	anObject = new uiInternalObject("jcom.message", "view/color/toolbarBackground", obj->box.b_patcher, "decimalArray", "none", "The background color of the module's toolbar in the format RGBA where values range.", "both", range, NULL, NULL, NULL);
	anObject->setAction((method)ui_color_toolbarBackground, (t_object*)obj);
	hashtab_store(obj->hash_internals, gensym("view/color/toolbarBackground"), (t_object*)anObject);
	
	anObject = new uiInternalObject("jcom.message", "view/color/toolbarText", obj->box.b_patcher, "decimalArray", "none", "The color of the module's toolbar text in the format RGBA where values range.", "both", range, NULL, NULL, NULL);
	anObject->setAction((method)ui_color_toolbarText, (t_object*)obj);
	hashtab_store(obj->hash_internals, gensym("view/color/toolbarText"), (t_object*)anObject);
	
	anObject = new uiInternalObject("jcom.message", "view/color/border", obj->box.b_patcher, "decimalArray", "none", "The border color of the module in the format RGBA where values range.", "both", range, NULL, NULL, NULL);
	anObject->setAction((method)ui_color_border, (t_object*)obj);
	hashtab_store(obj->hash_internals, gensym("view/color/border"), (t_object*)anObject);
	
	anObject = new uiInternalObject("jcom.parameter", "view/highlight", obj->box.b_patcher, "string", "none", "Highlight the module with a color tint such as red, green, or similar.", NULL, NULL, NULL, NULL, "none");
	anObject->setAction((method)ui_color_highlight, (t_object*)obj);
	hashtab_store(obj->hash_internals, gensym("view/highlight"), (t_object*)anObject);	
	
	anObject = new uiInternalObject("jcom.message", "view/size", obj->box.b_patcher, "generic", "none", "The size of the module's UI: [Width Height]", NULL, NULL, NULL, NULL, NULL);
	//anObject->setAction((method)ui_color_border, (t_object*)obj);
	anObject->setReadonly(true);
	atom_setlong(a+0, obj->box.b_patching_rect.width);
{'fraction_non_alphanumeric': 0.1452104942037828, 'fraction_numerical': 0.003965832824893227, 'mean_word_length': 6.22136563876652, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5758859', 'n_tokens_mistral': 2278, 'n_tokens_neox': 2166, 'n_words': 583}