<commit_before>#include "champlain-perl.h"


MODULE = Champlain::SelectionLayer  PACKAGE = Champlain::SelectionLayer  PREFIX = champlain_selection_layer_


ChamplainLayer*
champlain_selection_layer_new (class)
	C_ARGS: /* No args */


ChamplainBaseMarker*
champlain_selection_layer_get_selected (ChamplainSelectionLayer *layer)


void
champlain_selection_layer_get_selected_markers (ChamplainSelectionLayer *layer)
	PREINIT:
		const GList *item = NULL;
	
	PPCODE:
		item = champlain_selection_layer_get_selected_markers(layer);

		if (!item) {
			XSRETURN_EMPTY;
		}

		for (; item != NULL; item = item->next) {
			ChamplainBaseMarker *marker = CHAMPLAIN_BASE_MARKER(item->data);
			XPUSHs(sv_2mortal(newSVChamplainBaseMarker(marker)));
		}
		
		/* The doc says that the list shouldn't be freed! */


guint
champlain_selection_layer_count_selected_markers (ChamplainSelectionLayer *layer)


void
champlain_selection_layer_select (ChamplainSelectionLayer *layer, ChamplainBaseMarker *marker)


void
champlain_selection_layer_unselect (ChamplainSelectionLayer *layer, ChamplainBaseMarker *marker)


gboolean
champlain_selection_layer_marker_is_selected (ChamplainSelectionLayer *layer, ChamplainBaseMarker *marker)


#void
#champlain_selection_layer_select_all (ChamplainSelectionLayer *layer)<commit_msg>get_selected_markers() returns the proper count when empty in scalar context<commit_after>#include "champlain-perl.h"


MODULE = Champlain::SelectionLayer  PACKAGE = Champlain::SelectionLayer  PREFIX = champlain_selection_layer_


ChamplainLayer*
champlain_selection_layer_new (class)
	C_ARGS: /* No args */


ChamplainBaseMarker*
champlain_selection_layer_get_selected (ChamplainSelectionLayer *layer)


void
champlain_selection_layer_get_selected_markers (ChamplainSelectionLayer *layer)
	PREINIT:
		const GList *item = NULL;
	
	PPCODE:
		item = champlain_selection_layer_get_selected_markers(layer);

		if (!item) {
			if (GIMME == G_SCALAR) {
				XPUSHs(sv_2mortal(newSViv(0)));
				return;
			}
			XSRETURN_EMPTY;
		}

		for (; item != NULL; item = item->next) {
			ChamplainBaseMarker *marker = CHAMPLAIN_BASE_MARKER(item->data);
			XPUSHs(sv_2mortal(newSVChamplainBaseMarker(marker)));
		}
		
		/* The doc says that the list shouldn't be freed! */


guint
champlain_selection_layer_count_selected_markers (ChamplainSelectionLayer *layer)


void
champlain_selection_layer_select (ChamplainSelectionLayer *layer, ChamplainBaseMarker *marker)


void
champlain_selection_layer_unselect (ChamplainSelectionLayer *layer, ChamplainBaseMarker *marker)


gboolean
champlain_selection_layer_marker_is_selected (ChamplainSelectionLayer *layer, ChamplainBaseMarker *marker)


#void
#champlain_selection_layer_select_all (ChamplainSelectionLayer *layer)
{'fraction_non_alphanumeric': 0.07781818181818181, 'fraction_numerical': 0.0014545454545454545, 'mean_word_length': 7.091176470588235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4735421', 'n_tokens_mistral': 990, 'n_tokens_neox': 898, 'n_words': 168}