repo_name
stringlengths 7
79
| path
stringlengths 8
206
| copies
stringclasses 36
values | size
stringlengths 2
6
| content
stringlengths 55
523k
| license
stringclasses 15
values | hash
stringlengths 32
32
| line_mean
float64 7.18
99.5
| line_max
int64 16
979
| alpha_frac
float64 0.3
0.87
| ratio
float64 2.01
8.07
| autogenerated
bool 1
class | config_or_test
bool 2
classes | has_no_keywords
bool 2
classes | has_few_assignments
bool 1
class |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
GlimpseFramework/glimpse-framework | api/src/main/kotlin/glimpse/cameras/TargetedCameraViewBuilder.kt | 1 | 985 | package glimpse.cameras
import glimpse.Point
import glimpse.Vector
/**
* Builder of a [TargetedCameraView].
*/
class TargetedCameraViewBuilder() {
private var position: () -> Point = { Vector.X_UNIT.toPoint() }
private var target: () -> Point = { Point.ORIGIN }
private var up: () -> Vector = { Vector.Z_UNIT }
/**
* Sets camera position lambda.
*/
fun position(position: () -> Point) {
this.position = position
}
/**
* Sets camera target lambda.
*/
fun target(target: () -> Point) {
this.target = target
}
/**
* Sets camera up vector lambda.
*/
fun up(up: () -> Vector) {
this.up = up
}
internal fun build(): TargetedCameraView = TargetedCameraView(position, target, up)
}
/**
* Builds targeted camera view initialized with an [init] function.
*/
fun CameraBuilder.targeted(init: TargetedCameraViewBuilder.() -> Unit) {
val cameraViewBuilder = TargetedCameraViewBuilder()
cameraViewBuilder.init()
cameraView = cameraViewBuilder.build()
}
| apache-2.0 | 5404ea919f2a031714c8d68999f8803d | 20.413043 | 84 | 0.675127 | 3.444056 | false | false | false | false |
joan-domingo/Podcasts-RAC1-Android | app/src/main/java/cat/xojan/random1/feature/mediaplayback/PlaybackManager.kt | 1 | 5844 | package cat.xojan.random1.feature.mediaplayback
import android.content.Context
import android.media.AudioManager
import android.os.Bundle
import android.os.SystemClock
import android.support.v4.media.session.MediaSessionCompat
import android.support.v4.media.session.PlaybackStateCompat
import android.util.Log
import cat.xojan.random1.domain.model.CrashReporter
import cat.xojan.random1.domain.model.EventLogger
class PlaybackManager(appContext: Context,
val queueManager: QueueManager,
private val listener: PlaybackStateListener,
audioManager: AudioManager,
eventLogger: EventLogger,
crashReporter: CrashReporter) : PlayerListener {
companion object {
const val SET_SLEEP_TIMER = "set_sleep_timer"
const val SLEEP_TIMER_MILLISECONDS = "sleep_timer_milliseconds"
const val SLEEP_TIMER_LABEL = "sleep_timer_label"
}
private val TAG = PlaybackManager::class.simpleName
val player = Player(
appContext,
this,
audioManager,
eventLogger,
crashReporter)
val mediaSessionCallback = object : MediaSessionCompat.Callback() {
override fun onPlay() {
Log.d(TAG, "onPlay")
handlePlayRequest()
}
override fun onSkipToNext() {
val nextMediaId = queueManager.getNextMediaId()
Log.d(TAG, "skipToNext: $nextMediaId")
nextMediaId?.let {
handlePlayRequest(nextMediaId)
queueManager.updateMetadata(nextMediaId)
}
}
override fun onSkipToPrevious() {
val previousMediaId = queueManager.getPreviousMediaId()
Log.d(TAG, "skipToPrevious: $previousMediaId")
previousMediaId?.let {
handlePlayRequest(previousMediaId)
queueManager.updateMetadata(previousMediaId)
}
}
override fun onPause() {
Log.d(TAG, "onPause")
handlePauseRequest()
}
override fun onPlayFromMediaId(mediaId: String?, extras: Bundle?) {
Log.d(TAG, "onPlayFromMediaId: $mediaId")
queueManager.setQueue(mediaId)
handlePlayRequest(mediaId)
}
override fun onSeekTo(pos: Long) {
Log.d(TAG, "onSeekTo: $pos")
player.seekTo(pos)
}
override fun onRewind() {
Log.d(TAG, "onRewind")
player.rewind()
}
override fun onFastForward() {
Log.d(TAG, "onFastForward")
player.forward()
}
override fun onCustomAction(action: String?, extras: Bundle?) {
Log.d(TAG, "onCustomAction: $action")
when (action) {
SET_SLEEP_TIMER -> player.setSleepTimer(
extras?.getLong(SLEEP_TIMER_MILLISECONDS),
extras?.getString(SLEEP_TIMER_LABEL))
}
}
}
override fun onCompletion() {
val nextMediaId = queueManager.getNextMediaId()
if (nextMediaId != null) {
handlePlayRequest(nextMediaId)
queueManager.updateMetadata(nextMediaId)
} else {
val stateBuilder: PlaybackStateCompat.Builder = PlaybackStateCompat.Builder()
.setState(PlaybackStateCompat.STATE_STOPPED,
player.getCurrentPosition(),
1.0f)
listener.updatePlaybackState(stateBuilder.build())
}
}
override fun onPlaybackStatusChanged(state: Int) {
if (state != PlaybackStateCompat.STATE_STOPPED) {
val position: Long = player.getCurrentPosition()
val stateBuilder: PlaybackStateCompat.Builder = PlaybackStateCompat.Builder()
.setActions(getAvailableActions())
// Set the activeQueueItemId if the current index is valid.
val currentMediaId = queueManager.getCurrentMediaId()
if (currentMediaId != -1L) {
stateBuilder.setActiveQueueItemId(currentMediaId)
}
// Set the sleep time if exists
val bundle = Bundle()
bundle.putLong(SLEEP_TIMER_MILLISECONDS, player.getTimerMilliseconds())
bundle.putString(SLEEP_TIMER_LABEL, player.getTimerLabel())
stateBuilder.setExtras(bundle)
stateBuilder.setState(state, position, 1.0f, SystemClock.elapsedRealtime())
listener.updatePlaybackState(stateBuilder.build())
}
if (state == PlaybackStateCompat.STATE_PLAYING ||
state == PlaybackStateCompat.STATE_PAUSED) {
listener.onNotificationRequired()
}
}
private fun getAvailableActions(): Long {
var actions = PlaybackStateCompat.ACTION_PLAY_PAUSE or
PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID or
PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS or
PlaybackStateCompat.ACTION_SKIP_TO_NEXT
actions = if (player.isPlaying()) {
actions or PlaybackStateCompat.ACTION_PAUSE
} else {
actions or PlaybackStateCompat.ACTION_PLAY
}
return actions
}
fun handlePlayRequest(mediaId: String? = null) {
Log.d(TAG, "handlePlayRequest: mediaId= $mediaId")
val currentMedia = queueManager.getMediaItem(mediaId)
listener.onPlaybackStart()
player.play(currentMedia)
}
fun handlePauseRequest() {
Log.d(TAG, "handlePauseRequest")
player.pause()
listener.onPlaybackStop()
}
fun handleStopRequest() {
Log.d(TAG, "handleStopRequest")
player.release()
listener.onPlaybackStop()
}
} | mit | 1acd49e1f8e3f2b18c9b614684ca0adb | 33.585799 | 89 | 0.602327 | 5.050994 | false | false | false | false |
mehulsbhatt/emv-bertlv | src/test/java/io/github/binaryfoo/decoders/apdu/GetProcessingOptionsCommandAPDUDecoderTest.kt | 1 | 2040 | package io.github.binaryfoo.decoders.apdu
import io.github.binaryfoo.DecodedData
import io.github.binaryfoo.EmvTags
import io.github.binaryfoo.QVsdcTags
import io.github.binaryfoo.decoders.DecodeSession
import org.junit.Test
import org.hamcrest.Matchers.hasItem
import org.hamcrest.core.Is.`is`
import org.junit.Assert.assertThat
import io.github.binaryfoo.AmexTags
import io.github.binaryfoo.tlv.Tag
import io.github.binaryfoo.decoders.annotator
import io.github.binaryfoo.decoders.annotator.backgroundOf
public class GetProcessingOptionsCommandAPDUDecoderTest {
Test
public fun testDecodeVisaWithPDOL() {
val session = DecodeSession()
session.tagMetaData = QVsdcTags.METADATA
session.put(EmvTags.PDOL, "9F66049F02069F03069F1A0295055F2A029A039C019F3704")
val input = "80A8000023832136000000000000001000000000000000003600000000000036120315000008E4C800"
val decoded = GetProcessingOptionsCommandAPDUDecoder().decode(input, 0, session)
assertThat(decoded.rawData, `is`("C-APDU: GPO"))
val children = decoded.children
val expectedDecodedTTQ = QVsdcTags.METADATA.get(QVsdcTags.TERMINAL_TX_QUALIFIERS).decoder.decode("36000000", 7, DecodeSession())
assertThat(children.first, `is`(DecodedData(Tag.fromHex("9F66"), "9F66 (TTQ - Terminal transaction qualifiers)", "36000000", 7, 11, expectedDecodedTTQ)))
assertThat(children.last, `is`(DecodedData(EmvTags.UNPREDICTABLE_NUMBER, "9F37 (unpredictable number)", "0008E4C8", 36, 40, backgroundReading = backgroundOf("A nonce generated by the terminal for replay attack prevention"))))
}
Test
public fun testDecodeMastercardWithoutPDOL() {
val session = DecodeSession()
val input = "80A8000002830000"
val decoded = GetProcessingOptionsCommandAPDUDecoder().decode(input, 0, session)
assertThat(decoded.rawData, `is`("C-APDU: GPO"))
assertThat(decoded.getDecodedData(), `is`("No PDOL included"))
assertThat(decoded.isComposite(), `is`(false))
}
}
| mit | af4be6b017eb20840f3af672458bb1ec | 47.571429 | 233 | 0.753431 | 3.870968 | false | true | false | false |
sksamuel/elasticsearch-river-neo4j | streamops-session/streamops-session-pulsar/src/main/kotlin/com/octaldata/session/pulsar/PulsarBookiesOps.kt | 1 | 868 | package com.octaldata.session.pulsar
import com.octaldata.domain.DeploymentConnectionConfig
import com.octaldata.session.Bookie
import com.octaldata.session.BookiesOps
import kotlinx.coroutines.future.await
import org.apache.pulsar.client.admin.PulsarAdmin
class PulsarBookiesOps(config: DeploymentConnectionConfig.Pulsar) : BookiesOps {
private val client = PulsarAdmin.builder()
.serviceHttpUrl(config.adminServiceUrl)
.build()
override suspend fun bookies(): Result<List<Bookie>> = runCatching {
val racks = client.bookies().bookiesRackInfoAsync.await()
client.bookies().bookiesAsync.await().bookies.map { bookie ->
val rack = racks.getBookie(bookie.bookieId).orElseGet { null }
Bookie(
id = bookie.bookieId,
rack = rack?.rack,
host = rack?.hostname,
)
}
}
}
| apache-2.0 | b7d15fabf6552d3af05bd68036400f8c | 32.384615 | 80 | 0.702765 | 3.790393 | false | true | false | false |
cdietze/brewcontrol | src/main/kotlin/brewcontrol/PidController.kt | 1 | 887 | package brewcontrol
import react.ValueView
import react.Values
/**
* Takes a input and goal value and returns a view of the error
*
* This is not really a PID controller but only a P controller.
*
* @see [Wikipedia][http://en.wikipedia.org/wiki/PID_controller#PID_controller_theory]
*/
fun pidController(input: ValueView<Double?>, target: ValueView<Double?>): ValueView<Double> {
fun calcOutput(input: Double?, target: Double?): Double {
if (input == null || target == null) return 0.0
val Kp = 1.0
val error = target - input
val output = Kp * error
log.trace("PID calculation: input=$input, target=$target, output=$output")
return output
}
// Do note that map is called for old and new value. Thus, calcOutput gets called twice on every update
return Values.join(input, target).map { j -> calcOutput(j.a, j.b) }
}
| apache-2.0 | 601a8f6ea1f93c6c86190c7174dafc78 | 35.958333 | 107 | 0.6708 | 3.726891 | false | false | false | false |
RoverPlatform/rover-android | core/src/main/kotlin/io/rover/sdk/core/data/sync/SyncClient.kt | 1 | 3846 | package io.rover.sdk.core.data.sync
import android.net.Uri
import io.rover.sdk.core.data.AuthenticationContext
import io.rover.sdk.core.data.domain.Attributes
import io.rover.sdk.core.data.graphql.operations.data.encodeJson
import io.rover.sdk.core.data.http.HttpClientResponse
import io.rover.sdk.core.data.http.HttpRequest
import io.rover.sdk.core.data.http.HttpVerb
import io.rover.sdk.core.data.http.NetworkClient
import io.rover.sdk.core.logging.log
import io.rover.sdk.core.platform.DateFormattingInterface
import org.json.JSONArray
import org.reactivestreams.Publisher
import java.net.URL
import java.util.Locale
class SyncClient(
private val endpoint: URL,
private val authenticationContext: AuthenticationContext,
private val dateFormatting: DateFormattingInterface,
private val networkClient: NetworkClient
) : SyncClientInterface {
override fun executeSyncRequests(requests: List<SyncRequest>): Publisher<HttpClientResponse> {
return networkClient.request(
queryItems(requests).apply {
log.v("SYNC HTTP REQUEST: $this")
},
null
)
}
private fun queryItems(requests: List<SyncRequest>): HttpRequest {
val signatures = requests.mapNotNull { it.query.signature }
val expression: String = if (signatures.isEmpty()) {
""
} else {
signatures.joinToString(", ")
}.let { "($it)" }
val body: String = requests.joinToString("\n") { it.query.definition }
val query = """
query Sync$expression {
$body
}
""".trimIndent()
val fragments: List<String>? = requests.flatMap { it.query.fragments }
val initial = hashMapOf<String, Any>()
val variables: Attributes = requests.fold(initial) { result, request ->
request.variables.entries.fold(result) { nextResult, element ->
nextResult["${request.query.name}${element.key.capitalize()}"] = element.value
nextResult
}
}
// remove any graphql whitespace.
val condensedQuery = query.split("\n", " ", "\t").filter { it.isNotEmpty() }.joinToString(" ")
log.v("Condensed sync query: $condensedQuery")
val uri = Uri.parse(endpoint.toString())
val builder = uri.buildUpon()
builder.appendQueryParameter("query", condensedQuery)
val variablesJson = variables.encodeJson()
builder.appendQueryParameter(
"variables",
variablesJson.toString()
)
if (fragments != null) {
builder.appendQueryParameter("fragments", JSONArray(fragments).toString())
}
return HttpRequest(
URL(builder.build().toString()),
hashMapOf<String, String>().apply {
when {
authenticationContext.sdkToken != null -> this["x-rover-account-token"] = authenticationContext.sdkToken!!
authenticationContext.bearerToken != null -> this["authorization"] = "Bearer ${authenticationContext.bearerToken}"
}
},
HttpVerb.GET
)
}
}
val SyncQuery.signature: String?
get() {
if (arguments.isEmpty()) {
return null
}
return arguments.joinToString(", ") {
"\$$name${it.name.capitalize(Locale.ROOT)}:${it.type}"
}
}
val SyncQuery.definition: String
get() {
if (arguments.isEmpty()) {
return ""
}
val signature = arguments.joinToString(", ") {
"${it.name}:\$$name${it.name.capitalize()}"
}
val expression = "($signature)"
return """
$name$expression {
$body
}
""".trimIndent()
}
| apache-2.0 | ab650dbe86e6e71c950b9594a98b95d5 | 30.016129 | 134 | 0.602704 | 4.656174 | false | false | false | false |
cempo/SimpleTodoList | app/src/main/java/com/makeevapps/simpletodolist/ui/dialog/DateTimePickerDialog.kt | 1 | 4494 | package com.makeevapps.simpletodolist.ui.dialog
import android.app.Dialog
import android.arch.lifecycle.ViewModelProviders
import android.content.DialogInterface
import android.databinding.DataBindingUtil
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.makeevapps.simpletodolist.Keys.KEY_ALL_DAY
import com.makeevapps.simpletodolist.Keys.KEY_DUE_DATE_IN_MILLIS
import com.makeevapps.simpletodolist.R
import com.makeevapps.simpletodolist.databinding.ViewDatePickerTimeButtonBinding
import com.makeevapps.simpletodolist.utils.DateUtils
import com.makeevapps.simpletodolist.utils.ToastUtils
import com.makeevapps.simpletodolist.viewmodel.DateTimePickerViewModel
import com.wdullaer.materialdatetimepicker.date.DatePickerDialog
import java.util.*
class DateTimePickerDialog : DatePickerDialog(), DatePickerDialog.OnDateSetListener {
lateinit var binding: ViewDatePickerTimeButtonBinding
lateinit var onDateSelected: (date: Date, allDay: Boolean) -> Unit
lateinit var onCanceled: () -> Unit
companion object {
val TAG: String = DateTimePickerDialog::class.java.simpleName
fun newInstance(oldDate: Date?, allDay: Boolean,
onDateSelected: (date: Date, allDay: Boolean) -> Unit,
onCanceled: () -> Unit): DateTimePickerDialog {
val fragment = DateTimePickerDialog()
fragment.setListeners(onDateSelected, onCanceled)
val args = Bundle()
oldDate?.let { args.putLong(KEY_DUE_DATE_IN_MILLIS, it.time) }
args.putBoolean(KEY_ALL_DAY, allDay)
fragment.arguments = args
return fragment
}
}
val model: DateTimePickerViewModel by lazy {
ViewModelProviders.of(this).get(DateTimePickerViewModel::class.java)
}
init {
setOnDateSetListener(this)
setVersion(Version.VERSION_1)
minDate = Calendar.getInstance()
//setCancelText(R.string.clear)
}
fun setListeners(onDateSelected: (date: Date, allDay: Boolean) -> Unit, onCanceled: () -> Unit) {
this.onDateSelected = onDateSelected
this.onCanceled = onCanceled
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
if (savedInstanceState == null) {
model.initData(arguments!!)
val calendar = model.calendar.value
initialize(this, calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),
calendar.get(Calendar.DAY_OF_MONTH))
}
val timePickerDialog = fragmentManager?.findFragmentByTag(TimePickerCustomDialog.TAG)
if (timePickerDialog != null) {
(timePickerDialog as TimePickerCustomDialog).setListener(onTimeSelected)
}
return super.onCreateDialog(savedInstanceState)
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, state: Bundle?): View? {
val view = super.onCreateView(inflater, container, state)
val buttonContainer = view!!.findViewById<LinearLayout>(com.wdullaer.materialdatetimepicker.R.id.mdtp_done_background)
binding = DataBindingUtil.inflate(inflater, R.layout.view_date_picker_time_button, buttonContainer, false)
binding.model = model
binding.controller = this
buttonContainer.addView(binding.root, 0)
return view
}
fun setTime() {
val allDay = model.allDay.get()
val selectedDate = model.calendar.value.time
val startDate = if (allDay) DateUtils.setCurrentTime(selectedDate) else selectedDate
TimePickerCustomDialog.newInstance(startDate, onTimeSelected).show(fragmentManager, TimePickerCustomDialog.TAG)
}
private var onTimeSelected: (date: Date?) -> Unit = { date ->
model.setTimeToCalendar(date)
}
override fun onDateSet(view: DatePickerDialog?, year: Int, monthOfYear: Int, dayOfMonth: Int) {
model.setDateToCalendar(year, monthOfYear, dayOfMonth)
val selectedDate = model.calendar.value.time
if (selectedDate.after(DateUtils.currentTime())) {
onDateSelected(selectedDate, model.allDay.get())
} else {
ToastUtils.showSimpleToast(context!!, R.string.date_in_the_past)
}
}
override fun onCancel(dialog: DialogInterface?) {
onCanceled()
super.onCancel(dialog)
}
}
| mit | 8f9808343aa7b4726e879261a31297fe | 38.078261 | 126 | 0.698709 | 4.847896 | false | false | false | false |
GDG-Nantes/devfest-android | app/src/main/kotlin/com/gdgnantes/devfest/android/viewmodel/Filter.kt | 1 | 1249 | package com.gdgnantes.devfest.android.viewmodel
import android.content.Context
import com.gdgnantes.devfest.android.BookmarkManager
import com.gdgnantes.devfest.android.model.Session
interface Filter {
fun accept(context: Context, session: Session): Boolean
}
class TrackFilter private constructor(val track: Session.Track) : Filter {
companion object {
private val filters: MutableMap<Session.Track, TrackFilter> = HashMap()
fun get(track: Session.Track): TrackFilter {
synchronized(filters) {
var filter = filters[track]
if (filter == null) {
filter = TrackFilter(track)
filters.put(track, filter)
}
return filter
}
}
}
override fun accept(context: Context, session: Session): Boolean {
return track == session.track
}
override fun toString(): String {
return "TrackFilter($track)"
}
}
object BookmarkFilter : Filter {
override fun accept(context: Context, session: Session): Boolean {
return BookmarkManager.from(context).isBookmarked(session.id)
}
override fun toString(): String {
return "BookmarkFilter"
}
} | apache-2.0 | f273f8d1816cf1a9b0a40017d865b9e8 | 27.409091 | 79 | 0.632506 | 4.731061 | false | false | false | false |
Finnerale/FileBase | src/main/kotlin/de/leopoldluley/filebase/view/EditorView.kt | 1 | 3697 | package de.leopoldluley.filebase.view
import de.leopoldluley.filebase.Extensions.internalAlert
import de.leopoldluley.filebase.Utils
import de.leopoldluley.filebase.components.TagField.Companion.tagField
import de.leopoldluley.filebase.controller.DataCtrl
import de.leopoldluley.filebase.models.Entry
import de.leopoldluley.filebase.models.EntryModel
import de.leopoldluley.filebase.models.FileType
import javafx.beans.property.SimpleBooleanProperty
import javafx.scene.paint.Color
import tornadofx.*
class EditorView : View() {
private val dataCtrl: DataCtrl by inject()
private val model = EntryModel(Entry(0))
private val finishing = SimpleBooleanProperty(false)
override val root = stackpane {
title = "FileBase - " + messages["editEntry"]
form {
fieldset {
field(messages["name"]) {
textfield(model.name) {
validator {
if (it.isNullOrBlank()) error(messages["errorNameRequired"])
else if (!dataCtrl.checkFileName(it!!, unique = false)) error(messages["errorIllegalName"])
else null
}
}
}
field(messages["tags"]) {
tagField(model.tags, dataCtrl.tags) {
validator {
if (it!!.trim().split(" ").size < 2) return@validator warning(messages["warnFewTags"])
Utils.splitTags(it).forEach {
if (!dataCtrl.checkTagName(it)) return@validator error(messages["errorIllegalTag"].replace("#name", it))
}
return@validator null
}
}
}
field(messages["note"]) {
textarea(model.note)
}
field("Type") {
choicebox(model.type, FileType.Values)
}
field(forceLabelIndent = true) {
button(messages["cancel"]) {
isCancelButton = true
setOnAction {
goBack()
}
}
button(messages["save"]) {
setOnAction {
finish()
}
}
}
}
}
stackpane {
visibleWhen(finishing)
style {
backgroundColor += Color.color(0.3, 0.3, 0.3, 0.5)
}
progressindicator {
maxWidth = 200.0
maxHeight = 200.0
}
}
}
fun setModel(entry: Entry) {
model.rebind { this.entry = entry }
}
private fun finish() {
model.commit {
finishing.value = true
runAsync {
dataCtrl.updateEntry(model.entry)
} ui {
finishing.value = false
if (it) {
goBack()
} else {
openInternalBuilderWindow(messages["finishCreationErrorTitle"]) {
internalAlert(messages["finishCreationErrorTitle"], messages["finishCreationErrorText"]) {
[email protected]()
}
}
}
}
}
}
private fun goBack() {
replaceWith(MainView::class, ViewTransition.Slide(300.millis, ViewTransition.Direction.RIGHT))
}
}
| mit | a6ffdb51342f5c440ece80bf5eff8cb6 | 34.209524 | 136 | 0.476873 | 5.452802 | false | false | false | false |
Ray-Eldath/Avalon | src/main/kotlin/avalon/tool/ServiceChecker.kt | 1 | 855 | package avalon.tool
import avalon.group.Hitokoto
import avalon.tool.pool.Constants.Basic.CURRENT_SERVLET
import org.slf4j.LoggerFactory
object ServiceChecker {
private val logger = LoggerFactory.getLogger(this.javaClass)
private val services = listOf(CURRENT_SERVLET, Hitokoto.Hitokotor)
fun check(): Boolean {
logger.info("Now checking usability of services...")
var inaccessible = false
for (service in services) {
val name = service.javaClass.simpleName
if (service.available())
logger.info(" $name: Accessible")
else {
logger.error(" $name: Inaccessible")
inaccessible = true
}
}
if (inaccessible)
logger.error("Some services are inaccessible! Please make sure you have open the backend, then reopen Avalon a few seconds later.")
else
logger.info("Services all checked.")
return !inaccessible
}
} | agpl-3.0 | a5e0c5525c4a7be62e2d4aeace54ecc7 | 28.517241 | 134 | 0.735673 | 3.592437 | false | false | false | false |
hartwigmedical/hmftools | teal/src/main/kotlin/com/hartwig/hmftools/teal/TealApplication.kt | 1 | 13027 | package com.hartwig.hmftools.teal
import com.beust.jcommander.*
import com.hartwig.hmftools.common.genome.gc.GCMedianReadCountFile
import com.hartwig.hmftools.common.genome.gc.ImmutableGCBucket
import com.hartwig.hmftools.common.metrics.WGSMetricsFile
import com.hartwig.hmftools.common.purple.PurityContextFile
import com.hartwig.hmftools.common.utils.FileWriterUtils
import com.hartwig.hmftools.common.utils.config.LoggingOptions
import com.hartwig.hmftools.common.utils.config.DeclaredOrderParameterComparator
import com.hartwig.hmftools.common.utils.version.VersionInfo
import com.hartwig.hmftools.teal.breakend.BreakEndApp
import com.hartwig.hmftools.teal.telbam.TelbamApp
import com.hartwig.hmftools.teal.tellength.SampleType
import com.hartwig.hmftools.teal.tellength.TelLengthApp
import org.apache.logging.log4j.LogManager
import java.time.Duration
import java.time.Instant
import kotlin.system.exitProcess
class TealApplication
{
class StandaloneMode
{
@ParametersDelegate
var params = TealParams()
@ParametersDelegate
val loggingOptions = LoggingOptions()
fun run(): Int
{
params.validate()
loggingOptions.setLogLevel()
if (!FileWriterUtils.checkCreateOutputDir(params.commonParams.outputDir))
{
logger.error("failed to create output directory({})", params.commonParams.outputDir)
return 1
}
val versionInfo = VersionInfo("teal.version")
logger.info("Teal version: {}", versionInfo.version())
logger.info("starting telomeric analysis")
logger.info("{}", params)
val start = Instant.now()
val tumorOnly = params.commonParams.tumorOnly()
val germlineOnly = params.commonParams.referenceOnly()
try
{
logger.info("creating telbam files")
// first we generate the telbam files
// we pass the params to the telbam app
if (!tumorOnly)
{
val germlineTelbamApp = TelbamApp()
germlineTelbamApp.params.bamFile = params.commonParams.referenceBamFile!!
germlineTelbamApp.params.refGenomeFile = params.commonParams.refGenomeFile
germlineTelbamApp.params.telbamFile = germlineTelbamPath()
germlineTelbamApp.params.tsvFile = germlineTelReadTsvPath()
germlineTelbamApp.params.threadCount = params.commonParams.threadCount
germlineTelbamApp.processBam()
}
if (!germlineOnly)
{
val tumorTelbamApp = TelbamApp()
tumorTelbamApp.params.bamFile = params.commonParams.tumorBamFile!!
tumorTelbamApp.params.refGenomeFile = params.commonParams.refGenomeFile
tumorTelbamApp.params.telbamFile = tumorTelbamPath()
tumorTelbamApp.params.tsvFile = tumorTelReadTsvPath()
tumorTelbamApp.params.threadCount = params.commonParams.threadCount
tumorTelbamApp.processBam()
}
var germlineTelomereLength: Double? = null
if (!tumorOnly)
{
// next we do the telomere length calculations from these files
val germlineTelLengthApp = TelLengthApp()
germlineTelLengthApp.params.sampleId = params.commonParams.referenceSampleId
germlineTelLengthApp.params.sampleType = SampleType.ref
germlineTelLengthApp.params.outputFile = germlineTelLegnthTsvPath()
germlineTelLengthApp.params.telbamFile = germlineTelbamPath()
germlineTelLengthApp.params.duplicatePercent = params.germlineDuplicateProportion
germlineTelLengthApp.params.meanReadsPerKb = params.germlineMeanReadsPerKb!!
germlineTelLengthApp.params.gc50ReadsPerKb = params.germlineGc50ReadsPerKb
germlineTelomereLength = germlineTelLengthApp.calcTelomereLength()
}
if (!germlineOnly)
{
val tumorTelLengthApp = TelLengthApp()
tumorTelLengthApp.params.sampleId = params.commonParams.tumorSampleId
tumorTelLengthApp.params.sampleType = SampleType.tumor
tumorTelLengthApp.params.outputFile = tumorTelLengthTsvPath()
tumorTelLengthApp.params.telbamFile = tumorTelbamPath()
tumorTelLengthApp.params.germlineTelomereLength = germlineTelomereLength
tumorTelLengthApp.params.purity = params.tumorPurity
tumorTelLengthApp.params.ploidy = params.tumorPloidy
tumorTelLengthApp.params.duplicatePercent = params.tumorDuplicateProportion
tumorTelLengthApp.params.meanReadsPerKb = params.tumorMeanReadsPerKb!!
tumorTelLengthApp.params.gc50ReadsPerKb = params.tumorGc50ReadsPerKb
tumorTelLengthApp.calcTelomereLength()
}
// lastly we do the telomeric break ends
if (!germlineOnly && !tumorOnly)
{
val breakEndApp = BreakEndApp()
breakEndApp.params.sampleId = params.commonParams.tumorSampleId!!
breakEndApp.params.tumorTelbamFile = tumorTelbamPath()
breakEndApp.params.germlineTelbamFile = germlineTelbamPath()
breakEndApp.params.outputFile = breakEndTsvPath()
breakEndApp.params.refGenomeVersionStr = params.commonParams.getRefGenomeVersionStr()
breakEndApp.findBreakEnds()
}
}
catch (e: InterruptedException)
{
logger.warn("Teal run interrupted, exiting")
return 1
}
catch (e: IllegalStateException)
{
logger.error(e)
return 1
}
val finish = Instant.now()
val seconds = Duration.between(start, finish).seconds
logger.info("Teal run complete, time taken: {}m {}s", seconds / 60, seconds % 60)
return 0
}
fun germlineTelbamPath() : String
{
return "${params.commonParams.outputDir}/${params.commonParams.referenceSampleId}.teal.telbam.bam"
}
fun tumorTelbamPath() : String
{
return "${params.commonParams.outputDir}/${params.commonParams.tumorSampleId}.teal.telbam.bam"
}
fun germlineTelLegnthTsvPath() : String
{
return "${params.commonParams.outputDir}/${params.commonParams.referenceSampleId}.teal.tellength.tsv"
}
fun tumorTelLengthTsvPath() : String
{
return "${params.commonParams.outputDir}/${params.commonParams.tumorSampleId}.teal.tellength.tsv"
}
fun germlineTelReadTsvPath() : String
{
return "${params.commonParams.outputDir}/${params.commonParams.referenceSampleId}.teal.telread.tsv.gz"
}
fun tumorTelReadTsvPath() : String
{
return "${params.commonParams.outputDir}/${params.commonParams.tumorSampleId}.teal.telread.tsv.gz"
}
fun breakEndTsvPath() : String
{
return "${params.commonParams.outputDir}/${params.commonParams.tumorSampleId}.teal.breakend.tsv.gz"
}
}
class PipelineMode
{
@ParametersDelegate
val pipelineParams = TealPipelineParams()
@ParametersDelegate
val loggingOptions = LoggingOptions()
fun run(): Int
{
pipelineParams.validate()
loggingOptions.setLogLevel()
val standaloneMode = StandaloneMode()
standaloneMode.params = readPipelineFiles()
return standaloneMode.run()
}
// from the pipeline locations
private fun readPipelineFiles(): TealParams
{
val tealParams = TealParams(commonParams = pipelineParams.commonParams)
if (pipelineParams.purple != null && pipelineParams.commonParams.tumorSampleId != null)
{
val purityContext = PurityContextFile.read(pipelineParams.purple!!, pipelineParams.commonParams.tumorSampleId!!)
tealParams.tumorPurity = purityContext.bestFit().purity()
tealParams.tumorPloidy = purityContext.bestFit().ploidy()
}
if (pipelineParams.cobalt != null)
{
if (pipelineParams.commonParams.tumorSampleId != null)
{
val tumorGCMedianFilename =
GCMedianReadCountFile.generateFilename(pipelineParams.cobalt!!, pipelineParams.commonParams.tumorSampleId!!)
val tumorGCMedianReadCount = GCMedianReadCountFile.read(true, tumorGCMedianFilename)
tealParams.tumorMeanReadsPerKb = tumorGCMedianReadCount.meanReadCount()
tealParams.tumorGc50ReadsPerKb = tumorGCMedianReadCount.medianReadCount(ImmutableGCBucket(50))
}
if (pipelineParams.commonParams.referenceSampleId != null)
{
val referenceGCMedianFilename =
GCMedianReadCountFile.generateFilename(pipelineParams.cobalt!!, pipelineParams.commonParams.referenceSampleId!!)
val referenceGCMedianReadCount = GCMedianReadCountFile.read(true, referenceGCMedianFilename)
tealParams.germlineMeanReadsPerKb = referenceGCMedianReadCount.meanReadCount()
tealParams.germlineGc50ReadsPerKb = referenceGCMedianReadCount.medianReadCount(ImmutableGCBucket(50))
}
}
if (pipelineParams.tumorWgsMetrics != null)
{
// we need to try to guess the file name
val metrics = WGSMetricsFile.read(pipelineParams.tumorWgsMetrics!!)
logger.info("Loaded tumor WGS metrics from {}", pipelineParams.tumorWgsMetrics)
tealParams.tumorDuplicateProportion = metrics.pctExcDupe()
}
if (pipelineParams.referenceWgsMetrics != null)
{
// we need to try to guess the file name
val metrics = WGSMetricsFile.read(pipelineParams.referenceWgsMetrics!!)
logger.info("Loaded reference WGS metrics from {}", pipelineParams.referenceWgsMetrics)
tealParams.germlineDuplicateProportion = metrics.pctExcDupe()
}
logger.info("loaded teal params {} from pipeline files", tealParams)
return tealParams
}
}
companion object
{
private val logger = LogManager.getLogger(TealApplication::class.java)
@JvmStatic
fun main(args: Array<String>)
{
// here we have some voodoo to work out if we are being used in pipeline mode or the standalone mode
val tealApp = StandaloneMode()
val commanderStandalone = JCommander.newBuilder()
.addObject(tealApp)
.build()
// use unix style formatter
commanderStandalone.usageFormatter = UnixStyleUsageFormatter(commanderStandalone)
commanderStandalone.parameterDescriptionComparator = DeclaredOrderParameterComparator(tealApp.javaClass)
try
{
commanderStandalone.parse(*args)
exitProcess(tealApp.run())
}
catch (standaloneParamException: ParameterException)
{
val tealPipelineApp = PipelineMode()
val commanderPipeline = JCommander.newBuilder()
.addObject(tealPipelineApp)
.build()
// use unix style formatter
commanderPipeline.usageFormatter = UnixStyleUsageFormatter(commanderPipeline)
commanderPipeline.parameterDescriptionComparator = DeclaredOrderParameterComparator(tealPipelineApp.javaClass)
try
{
commanderPipeline.parse(*args)
exitProcess(tealPipelineApp.run())
}
catch (pipelineParamException: ParameterException)
{
println("Standalone mode:")
println("${standaloneParamException.message}")
commanderStandalone.usage()
println("Pipeline mode:")
println("${pipelineParamException.message}")
commanderPipeline.usage()
exitProcess(1)
}
}
}
}
} | gpl-3.0 | 58e143f0ad4a4cd990e6c9cf950271f2 | 41.9967 | 136 | 0.611115 | 4.650839 | false | false | false | false |
SpineEventEngine/core-java | buildSrc/src/main/kotlin/io/spine/internal/gradle/report/license/LicenseReporter.kt | 2 | 5702 | /*
* Copyright 2022, TeamDev. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
* disclaimer.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package io.spine.internal.gradle.report.license
import com.github.jk1.license.LicenseReportExtension
import com.github.jk1.license.LicenseReportExtension.ALL
import com.github.jk1.license.LicenseReportPlugin
import io.spine.internal.gradle.applyPlugin
import io.spine.internal.gradle.findTask
import java.io.File
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.kotlin.dsl.the
/**
* Generates the license report for all Java dependencies used in a single Gradle project
* and in a repository.
*
* Transitive dependencies are included.
*
* The output file is placed to the root folder of the root Gradle project.
*
* Usage:
*
* ```
* // ...
* subprojects {
*
* LicenseReporter.generateReportIn(project)
* }
*
* // ...
*
* LicenseReporter.mergeAllReports(project)
*
* ```
*/
object LicenseReporter {
/**
* The name of the Gradle task which generates the reports for a specific Gradle project.
*/
private const val projectTaskName = "generateLicenseReport"
/**
* The name of the Gradle task merging the license reports across all Gradle projects
* in the repository into a single report file.
*/
private const val mergeTaskName = "mergeAllLicenseReports"
/**
* Enables the generation of the license report for a single Gradle project.
*
* Registers `generateLicenseReport` task, which is later picked up
* by the [merge task][mergeAllReports].
*/
fun generateReportIn(project: Project) {
project.applyPlugin(LicenseReportPlugin::class.java)
val reportOutputDir = project.buildDir.resolve(Paths.relativePath)
with(project.the<LicenseReportExtension>()) {
outputDir = reportOutputDir.absolutePath
excludeGroups = arrayOf("io.spine", "io.spine.tools", "io.spine.gcloud")
configurations = ALL
renderers = arrayOf(MarkdownReportRenderer(Paths.outputFilename))
}
}
/**
* Tells to merge all per-project reports which were previously [generated][generateReportIn]
* for each of the subprojects of the root Gradle project.
*
* The merge result is placed according to [Paths].
*
* Registers a `mergeAllLicenseReports` which is specified to be executed after `build`.
*/
fun mergeAllReports(project: Project) {
val rootProject = project.rootProject
val mergeTask = rootProject.tasks.register(mergeTaskName) {
val consolidationTask = this
val assembleTask = project.findTask<Task>("assemble")
val sourceProjects: Iterable<Project> = sourceProjects(rootProject)
sourceProjects.forEach {
val perProjectTask = it.findTask<Task>(projectTaskName)
consolidationTask.dependsOn(perProjectTask)
perProjectTask.dependsOn(assembleTask)
}
doLast {
mergeReports(sourceProjects, rootProject)
}
dependsOn(assembleTask)
}
project.findTask<Task>("build")
.finalizedBy(mergeTask)
}
/**
* Determines the source projects for which the resulting report will be produced.
*/
private fun Task.sourceProjects(rootProject: Project): Iterable<Project> {
val targetProjects: Iterable<Project> = if (rootProject.subprojects.isEmpty()) {
rootProject.logger.debug(
"The license report will be produced for a single root project."
)
listOf(this.project)
} else {
rootProject.logger.debug(
"The license report will be produced for all subprojects of a root project."
)
rootProject.subprojects
}
return targetProjects
}
/**
* Merges the license reports from all [sourceProjects] into a single file under
* the [rootProject]'s root directory.
*/
private fun mergeReports(
sourceProjects: Iterable<Project>,
rootProject: Project
) {
val paths = sourceProjects.map {
"${it.buildDir}/${Paths.relativePath}/${Paths.outputFilename}"
}
println("Merging the license reports from the all projects.")
val mergedContent = paths.joinToString("\n\n\n") { (File(it)).readText() }
val output = File("${rootProject.rootDir}/${Paths.outputFilename}")
output.writeText(mergedContent)
}
}
| apache-2.0 | d10c7143c60eca4fa80c834c7d00f82b | 35.551282 | 97 | 0.678183 | 4.583601 | false | false | false | false |
cwoolner/flex-poker | src/main/kotlin/com/flexpoker/signup/repository/RedisSignUpRepository.kt | 1 | 5907 | package com.flexpoker.signup.repository
import com.flexpoker.config.ProfileNames
import com.flexpoker.exception.FlexPokerException
import com.flexpoker.signup.SignUpUser
import org.springframework.context.annotation.Profile
import org.springframework.data.redis.core.RedisCallback
import org.springframework.data.redis.core.RedisOperations
import org.springframework.data.redis.core.RedisTemplate
import org.springframework.data.redis.core.ScanOptions
import org.springframework.data.redis.core.SessionCallback
import org.springframework.stereotype.Repository
import java.io.IOException
import java.util.UUID
import java.util.concurrent.TimeUnit
import javax.annotation.PostConstruct
import javax.inject.Inject
@Profile(ProfileNames.REDIS, ProfileNames.SIGNUP_REDIS)
@Repository
class RedisSignUpRepository @Inject constructor(private val redisTemplate: RedisTemplate<String, String>) :
SignUpRepository {
companion object {
private const val EXPIRATION_IN_MINUTES = 10
private const val SIGN_UP_NAMESPACE = "signup:"
private const val EXISTING_USERNAME_KEY = (SIGN_UP_NAMESPACE + "existingusernames")
private const val SIGN_UP_CODE_NAMESPACE = (SIGN_UP_NAMESPACE + "signupcode:")
private const val SIGN_UP_USER_NAMESPACE = (SIGN_UP_NAMESPACE + "signupuser:")
}
override fun usernameExists(username: String): Boolean {
return redisTemplate.opsForSet().isMember(EXISTING_USERNAME_KEY, username)!!
}
override fun signUpCodeExists(signUpCode: UUID): Boolean {
val signUpCodeKey = SIGN_UP_CODE_NAMESPACE + signUpCode.toString()
return redisTemplate.opsForHash<Any, Any>().hasKey(signUpCodeKey, "username")
}
override fun findAggregateIdByUsernameAndSignUpCode(username: String, signUpCode: UUID): UUID? {
val signUpCodeKey = SIGN_UP_CODE_NAMESPACE + signUpCode.toString()
val objectFromQuery = redisTemplate.opsForHash<Any, Any>()[signUpCodeKey, "username"] ?: return null
val usernameFromQuery = objectFromQuery as String
return if (usernameFromQuery == username) {
UUID.fromString(
redisTemplate.opsForHash<Any, Any>()[signUpCodeKey, "aggregateid"] as String
)
} else null
}
override fun storeSignUpInformation(aggregateId: UUID, username: String, signUpCode: UUID) {
val signUpCodeKey = SIGN_UP_CODE_NAMESPACE + signUpCode.toString()
redisTemplate.execute(object : SessionCallback<List<Any>> {
override fun <K : Any?, V : Any?> execute(operations: RedisOperations<K, V>): List<Any>? {
operations.multi()
operations.opsForHash<String, String>().put(signUpCodeKey as K, "username", username)
operations.opsForHash<String, String>().put(signUpCodeKey, "aggregateid", aggregateId.toString())
operations.expire(signUpCodeKey, EXPIRATION_IN_MINUTES.toLong(), TimeUnit.MINUTES)
return redisTemplate.exec()
}
})
}
override fun storeNewlyConfirmedUsername(username: String) {
redisTemplate.opsForSet().add(EXISTING_USERNAME_KEY, username)
}
override fun findSignUpCodeByUsername(username: String): UUID {
val foundSignUpCodeKey = redisTemplate.execute(RedisCallback { connection ->
try {
connection.scan(ScanOptions.scanOptions().match("signup:signupcode*").build()).use { cursor ->
while (cursor.hasNext()) {
val key = String(cursor.next(), charset("UTF-8"))
val usernameFromRedis = redisTemplate.opsForHash<Any, Any>()[key, "username"] as String
if (username == usernameFromRedis) {
return@RedisCallback key
}
}
}
} catch (e: IOException) {
throw FlexPokerException("error in Redis")
}
throw FlexPokerException("could not find username in Redis")
})
return UUID.fromString(foundSignUpCodeKey.split(":").toTypedArray()[2])
}
@PostConstruct
private fun addDefaultSignUps() {
storeNewlyConfirmedUsername("player1")
storeNewlyConfirmedUsername("player2")
storeNewlyConfirmedUsername("player3")
storeNewlyConfirmedUsername("player4")
}
override fun fetchSignUpUser(signUpUserId: UUID): SignUpUser? {
val signUpCodeKey = SIGN_UP_USER_NAMESPACE + signUpUserId
val signUpUserObject = redisTemplate.opsForHash<Any, Any>().entries(signUpCodeKey) ?: return null
return SignUpUser(
UUID.fromString(signUpUserObject["aggregateId"].toString()),
UUID.fromString(signUpUserObject["signUpCode"].toString()),
signUpUserObject["email"].toString(),
signUpUserObject["username"].toString(),
signUpUserObject["encryptedPassword"].toString()
)
}
override fun saveSignUpUser(signUpUser: SignUpUser) {
val signUpUserKey = SIGN_UP_USER_NAMESPACE + signUpUser.aggregateId
val signUpUserMap = mapOf(
"username" to signUpUser.username,
"email" to signUpUser.email,
"aggregateId" to signUpUser.aggregateId.toString(),
"signUpCode" to signUpUser.signUpCode.toString(),
"confirmed" to java.lang.String.valueOf(signUpUser.isConfirmed),
"encryptedPassword" to signUpUser.encryptedPassword
)
redisTemplate.execute(object : SessionCallback<List<Any>> {
override fun <K : Any?, V : Any?> execute(operations: RedisOperations<K, V>): List<Any>? {
operations.multi()
operations.opsForHash<String, Any>().putAll(signUpUserKey as K, signUpUserMap)
return redisTemplate.exec()
}
})
}
} | gpl-2.0 | a974dfe9fb3582909f4c3c6d9ba670bc | 45.15625 | 113 | 0.667513 | 4.604053 | false | false | false | false |
rcgroot/open-gpstracker-ng | studio/features/src/main/java/nl/sogeti/android/gpstracker/ng/features/summary/SummaryManager.kt | 1 | 4585 | /*------------------------------------------------------------------------------
** Ident: Sogeti Smart Mobile Solutions
** Author: rene
** Copyright: (c) 2016 Sogeti Nederland B.V. All Rights Reserved.
**------------------------------------------------------------------------------
** Sogeti Nederland B.V. | No part of this file may be reproduced
** Distributed Software Engineering | or transmitted in any form or by any
** Lange Dreef 17 | means, electronic or mechanical, for the
** 4131 NJ Vianen | purpose, without the express written
** The Netherlands | permission of the copyright holder.
*------------------------------------------------------------------------------
*
* This file is part of OpenGPSTracker.
*
* OpenGPSTracker is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenGPSTracker is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenGPSTracker. If not, see <http://www.gnu.org/licenses/>.
*
*/
package nl.sogeti.android.gpstracker.ng.features.summary
import android.content.Context
import android.net.Uri
import nl.sogeti.android.gpstracker.ng.features.FeatureConfiguration
import nl.sogeti.android.gpstracker.service.integration.ContentConstants.Waypoints.WAYPOINTS
import nl.sogeti.android.gpstracker.utils.concurrent.BackgroundThreadFactory
import nl.sogeti.android.gpstracker.utils.contentprovider.append
import nl.sogeti.android.gpstracker.utils.contentprovider.count
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import javax.inject.Inject
/**
* Helps in the retrieval, create and keeping up to date of summary data
*/
class SummaryManager {
var executor: ExecutorService? = null
private val summaryCache = ConcurrentHashMap<Uri, Summary>()
private var activeCount = 0
@Inject
lateinit var calculator: SummaryCalculator
@Inject
lateinit var context: Context
init {
FeatureConfiguration.featureComponent.inject(this)
}
fun start() {
synchronized(this) {
activeCount++
if (executor == null) {
executor = Executors.newFixedThreadPool(numberOfThreads(), BackgroundThreadFactory("SummaryManager"))
}
}
}
fun stop() {
synchronized(this) {
activeCount--
if (!isRunning()) {
executor?.shutdown()
executor = null
}
if (activeCount < 0) {
activeCount++
throw IllegalStateException("Received more stops then starts")
}
}
}
fun isRunning(): Boolean = synchronized(this) { activeCount > 0 }
/**
* Collects summary data from the meta table.
*/
fun collectSummaryInfo(trackUri: Uri,
callbackSummary: (Summary) -> Unit) {
val executor = executor ?: return
executor.submit {
val cacheHit = summaryCache[trackUri]
if (cacheHit != null) {
val trackWaypointsUri = trackUri.append(WAYPOINTS)
val trackCount = trackWaypointsUri.count(context.contentResolver)
val cacheCount = cacheHit.count
if (trackCount == cacheCount) {
callbackSummary(cacheHit)
} else {
executeTrackCalculation(trackUri, callbackSummary)
}
} else {
executeTrackCalculation(trackUri, callbackSummary)
}
}
}
fun executeTrackCalculation(trackUri: Uri, callbackSummary: (Summary) -> Unit) {
if (isRunning()) {
val summary = calculator.calculateSummary(trackUri)
if (isRunning()) {
summaryCache[trackUri] = summary
callbackSummary(summary)
}
}
}
fun numberOfThreads() = Runtime.getRuntime().availableProcessors()
fun removeFromCache(trackUri: Uri) {
summaryCache.remove(trackUri)
}
}
| gpl-3.0 | ea16784a55e8f06ff1d2eea805a8b892 | 36.276423 | 117 | 0.606325 | 5.094444 | false | false | false | false |
SpectraLogic/ds3_autogen | ds3-autogen-parser/src/main/kotlin/com/spectralogic/ds3autogen/typemap/SdkTypeMapper.kt | 2 | 2599 | /*
* ******************************************************************************
* Copyright 2014-2017 Spectra Logic Corporation. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use
* this file except in compliance with the License. A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file.
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
* ****************************************************************************
*/
package com.spectralogic.ds3autogen.typemap
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.datatype.guava.GuavaModule
import com.spectralogic.ds3autogen.models.xml.typemap.TypeMap
import com.spectralogic.ds3autogen.utils.ConverterUtil.isEmpty
private const val DEFAULT_TYPE_MAP_FILE = "/typeMap.json"
/**
* Used to map contract types into sdk types. This is used when the
* provided contract type is to be overridden with a manually determined type.
*/
class SdkTypeMapper(private val typeMapFileName: String) {
constructor() : this(DEFAULT_TYPE_MAP_FILE)
/** map of contract names to be changed (keys), into sdk types (values) */
private lateinit var typeMapper: Map<String, String>
/**
* Initialize the type mapper via parsing the json file containing the type re-mapping
*/
fun init() {
val stream = SdkTypeMapper::class.java.getResourceAsStream(typeMapFileName)
val objectMapper = ObjectMapper()
objectMapper.registerModule(GuavaModule())
typeMapper = objectMapper.readValue<TypeMap>(stream, TypeMap::class.java).toMap()
}
/**
* Returns the sdk type to be generated from the contract type. If there is no type
* mapping, then the original string is returned.
*/
fun toType(contractType: String): String {
val curType = contractType.substringAfterLast('.')
return if (typeMapper.containsKey(curType)) typeMapper[curType]!! else contractType
}
fun toNullableType(contractType: String?): String? {
if (isEmpty(contractType)) {
return contractType
}
return toType(contractType!!)
}
/**
* Retrieves the underlying map used in the re-typing process. This is used for testing.
*/
fun getMap(): Map<String, String> = typeMapper
} | apache-2.0 | 24a2ea6331e8d2b3a88f185aa27f9678 | 39 | 92 | 0.666795 | 4.616341 | false | false | false | false |
wiltonlazary/kotlin-native | shared/src/main/kotlin/org/jetbrains/kotlin/konan/target/ClangArgs.kt | 1 | 18991 | /*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed -> in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.konan.target
import org.jetbrains.kotlin.konan.file.File
internal object Android {
const val API = "21"
private val architectureMap = mapOf(
KonanTarget.ANDROID_X86 to "x86",
KonanTarget.ANDROID_X64 to "x86_64",
KonanTarget.ANDROID_ARM32 to "arm",
KonanTarget.ANDROID_ARM64 to "arm64"
)
fun architectureDirForTarget(target: KonanTarget) =
"android-${API}/arch-${architectureMap.getValue(target)}"
}
class ClangArgs(private val configurables: Configurables) : Configurables by configurables {
val targetArg = if (configurables is TargetableConfigurables)
configurables.targetArg
else null
private val osVersionMin: String
get() {
require(configurables is AppleConfigurables)
return configurables.osVersionMin
}
val specificClangArgs: List<String>
get() {
val result = when (target) {
KonanTarget.LINUX_X64 ->
listOf("--sysroot=$absoluteTargetSysRoot") +
if (target != host) listOf("-target", targetArg!!) else emptyList()
KonanTarget.LINUX_ARM32_HFP ->
listOf("-target", targetArg!!,
"-mfpu=vfp", "-mfloat-abi=hard",
"--sysroot=$absoluteTargetSysRoot",
// TODO: those two are hacks.
"-I$absoluteTargetSysRoot/usr/include/c++/4.8.3",
"-I$absoluteTargetSysRoot/usr/include/c++/4.8.3/arm-linux-gnueabihf")
KonanTarget.LINUX_ARM64 ->
listOf("-target", targetArg!!,
"--sysroot=$absoluteTargetSysRoot",
"-I$absoluteTargetSysRoot/usr/include/c++/7",
"-I$absoluteTargetSysRoot/usr/include/c++/7/aarch64-linux-gnu")
KonanTarget.LINUX_MIPS32 ->
listOf("-target", targetArg!!,
"--sysroot=$absoluteTargetSysRoot",
"-I$absoluteTargetSysRoot/usr/include/c++/4.9.4",
"-I$absoluteTargetSysRoot/usr/include/c++/4.9.4/mips-unknown-linux-gnu")
KonanTarget.LINUX_MIPSEL32 ->
listOf("-target", targetArg!!,
"--sysroot=$absoluteTargetSysRoot",
"-I$absoluteTargetSysRoot/usr/include/c++/4.9.4",
"-I$absoluteTargetSysRoot/usr/include/c++/4.9.4/mipsel-unknown-linux-gnu")
KonanTarget.MINGW_X64, KonanTarget.MINGW_X86 ->
listOf("-target", targetArg!!, "--sysroot=$absoluteTargetSysRoot", "-Xclang", "-flto-visibility-public-std")
KonanTarget.MACOS_X64 ->
listOf("--sysroot=$absoluteTargetSysRoot", "-mmacosx-version-min=$osVersionMin")
KonanTarget.IOS_ARM32 ->
listOf("-stdlib=libc++", "-arch", "armv7", "-isysroot", absoluteTargetSysRoot, "-miphoneos-version-min=$osVersionMin")
KonanTarget.IOS_ARM64 ->
listOf("-stdlib=libc++", "-arch", "arm64", "-isysroot", absoluteTargetSysRoot, "-miphoneos-version-min=$osVersionMin")
KonanTarget.IOS_X64 ->
listOf("-stdlib=libc++", "-isysroot", absoluteTargetSysRoot, "-miphoneos-version-min=$osVersionMin")
KonanTarget.TVOS_ARM64 ->
listOf("-stdlib=libc++", "-arch", "arm64", "-isysroot", absoluteTargetSysRoot, "-mtvos-version-min=$osVersionMin")
KonanTarget.TVOS_X64 ->
listOf("-stdlib=libc++", "-isysroot", absoluteTargetSysRoot, "-mtvos-simulator-version-min=$osVersionMin")
KonanTarget.WATCHOS_ARM64,
KonanTarget.WATCHOS_ARM32 ->
listOf("-stdlib=libc++", "-arch", "armv7k", "-isysroot", absoluteTargetSysRoot, "-mwatchos-version-min=$osVersionMin")
KonanTarget.WATCHOS_X86 ->
listOf("-stdlib=libc++", "-arch", "i386", "-isysroot", absoluteTargetSysRoot, "-mwatchos-simulator-version-min=$osVersionMin")
KonanTarget.WATCHOS_X64 -> TODO("implement me")
KonanTarget.ANDROID_ARM32, KonanTarget.ANDROID_ARM64,
KonanTarget.ANDROID_X86, KonanTarget.ANDROID_X64 -> {
val clangTarget = targetArg!!
val architectureDir = Android.architectureDirForTarget(target)
val toolchainSysroot = "$absoluteTargetToolchain/sysroot"
listOf("-target", clangTarget,
"-D__ANDROID_API__=${Android.API}",
"--sysroot=$absoluteTargetSysRoot/$architectureDir",
"-I$toolchainSysroot/usr/include/c++/v1",
"-I$toolchainSysroot/usr/include",
"-I$toolchainSysroot/usr/include/$clangTarget")
}
// By default WASM target forces `hidden` visibility which causes linkage problems.
KonanTarget.WASM32 ->
listOf("-target", targetArg!!,
"-fno-rtti",
"-fno-exceptions",
"-fvisibility=default",
"-D_LIBCPP_ABI_VERSION=2",
"-D_LIBCPP_NO_EXCEPTIONS=1",
"-nostdinc",
"-Xclang", "-nobuiltininc",
"-Xclang", "-nostdsysteminc",
"-Xclang", "-isystem$absoluteTargetSysRoot/include/libcxx",
"-Xclang", "-isystem$absoluteTargetSysRoot/lib/libcxxabi/include",
"-Xclang", "-isystem$absoluteTargetSysRoot/include/compat",
"-Xclang", "-isystem$absoluteTargetSysRoot/include/libc")
is KonanTarget.ZEPHYR ->
listOf("-target", targetArg!!,
"-fno-rtti",
"-fno-exceptions",
"-fno-asynchronous-unwind-tables",
"-fno-pie",
"-fno-pic",
"-fshort-enums",
"-nostdinc",
// TODO: make it a libGcc property?
// We need to get rid of wasm sysroot first.
"-isystem $targetToolchain/../lib/gcc/arm-none-eabi/7.2.1/include",
"-isystem $targetToolchain/../lib/gcc/arm-none-eabi/7.2.1/include-fixed",
"-isystem$absoluteTargetSysRoot/include/libcxx",
"-isystem$absoluteTargetSysRoot/include/libc"
) +
(configurables as ZephyrConfigurables).constructClangArgs()
}
return result
}
val clangArgsSpecificForKonanSources
get() = when (target) {
KonanTarget.LINUX_X64 ->
listOf("-DUSE_GCC_UNWIND=1",
"-DKONAN_LINUX=1",
"-DKONAN_X64=1",
"-DUSE_ELF_SYMBOLS=1",
"-DELFSIZE=64",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1")
KonanTarget.LINUX_ARM32_HFP ->
listOf("-DUSE_GCC_UNWIND=1",
"-DKONAN_LINUX=1",
"-DKONAN_ARM32=1",
"-DUSE_ELF_SYMBOLS=1",
"-DELFSIZE=32",
"-DKONAN_NO_UNALIGNED_ACCESS=1")
KonanTarget.LINUX_ARM64 ->
listOf("-DUSE_GCC_UNWIND=1",
"-DKONAN_LINUX=1",
"-DKONAN_ARM64=1",
"-DUSE_ELF_SYMBOLS=1",
"-DELFSIZE=64")
KonanTarget.LINUX_MIPS32 ->
listOf("-DUSE_GCC_UNWIND=1",
"-DKONAN_LINUX=1",
"-DKONAN_MIPS32=1",
"-DUSE_ELF_SYMBOLS=1",
"-DELFSIZE=32",
// TODO: reconsider, once target MIPS can do proper 64-bit load/store/CAS.
"-DKONAN_NO_64BIT_ATOMIC=1",
"-DKONAN_NO_UNALIGNED_ACCESS=1")
KonanTarget.LINUX_MIPSEL32 ->
listOf("-DUSE_GCC_UNWIND=1",
"-DKONAN_LINUX=1",
"-DKONAN_MIPSEL32=1",
"-DUSE_ELF_SYMBOLS=1",
"-DELFSIZE=32",
// TODO: reconsider, once target MIPS can do proper 64-bit load/store/CAS.
"-DKONAN_NO_64BIT_ATOMIC=1",
"-DKONAN_NO_UNALIGNED_ACCESS=1")
KonanTarget.MINGW_X64, KonanTarget.MINGW_X86 ->
listOf("-DUSE_GCC_UNWIND=1",
"-DUSE_PE_COFF_SYMBOLS=1",
"-DKONAN_WINDOWS=1",
"-DUNICODE",
if (target == KonanTarget.MINGW_X64) "-DKONAN_X64=1" else "-DKONAN_X86=1",
"-DKONAN_NO_MEMMEM=1",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1")
KonanTarget.MACOS_X64 ->
listOf("-DKONAN_OSX=1",
"-DKONAN_MACOSX=1",
"-DKONAN_X64=1",
"-DKONAN_OBJC_INTEROP=1",
"-DKONAN_CORE_SYMBOLICATION=1",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1")
KonanTarget.IOS_ARM32 ->
listOf("-DKONAN_OBJC_INTEROP=1",
"-DKONAN_IOS",
"-DKONAN_ARM32=1",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1",
"-DKONAN_REPORT_BACKTRACE_TO_IOS_CRASH_LOG=1",
"-DMACHSIZE=32",
// While not 100% correct here, using atomic ops on iOS armv7 requires 8 byte alignment,
// and general ABI requires 4-byte alignment on 64-bit long fields as mentioned in
// https://developer.apple.com/library/archive/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARMv6FunctionCallingConventions.html#//apple_ref/doc/uid/TP40009021-SW1
// See https://github.com/ktorio/ktor/issues/941 for the context.
"-DKONAN_NO_64BIT_ATOMIC=1",
"-DKONAN_NO_UNALIGNED_ACCESS=1")
KonanTarget.IOS_ARM64 ->
listOf("-DKONAN_OBJC_INTEROP=1",
"-DKONAN_IOS=1",
"-DKONAN_ARM64=1",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1",
"-DKONAN_REPORT_BACKTRACE_TO_IOS_CRASH_LOG=1",
"-DMACHSIZE=64")
KonanTarget.IOS_X64 ->
listOf("-DKONAN_OBJC_INTEROP=1",
"-DKONAN_IOS=1",
"-DKONAN_X64=1",
"-DKONAN_CORE_SYMBOLICATION=1",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1")
KonanTarget.TVOS_ARM64 ->
listOf("-DKONAN_OBJC_INTEROP=1",
"-DKONAN_TVOS=1",
"-DKONAN_ARM64=1",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1",
"-DKONAN_REPORT_BACKTRACE_TO_IOS_CRASH_LOG=1",
"-DMACHSIZE=64")
KonanTarget.TVOS_X64 ->
listOf("-DKONAN_OBJC_INTEROP=1",
"-DKONAN_TVOS=1",
"-DKONAN_X64=1",
"-DKONAN_CORE_SYMBOLICATION=1",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1")
KonanTarget.WATCHOS_ARM64,
KonanTarget.WATCHOS_ARM32 ->
listOf("-DKONAN_OBJC_INTEROP=1",
"-DKONAN_WATCHOS",
"-DKONAN_ARM32=1",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1",
"-DKONAN_REPORT_BACKTRACE_TO_IOS_CRASH_LOG=1",
"-DMACHSIZE=32",
// See explanation for ios_arm32 above.
"-DKONAN_NO_64BIT_ATOMIC=1",
"-DKONAN_NO_UNALIGNED_ACCESS=1")
KonanTarget.WATCHOS_X86 ->
listOf("-DKONAN_OBJC_INTEROP=1",
"-DKONAN_WATCHOS=1",
"-DKONAN_NO_64BIT_ATOMIC=1",
"-DKONAN_X86=1",
"-DKONAN_CORE_SYMBOLICATION=1",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1")
KonanTarget.WATCHOS_X64 -> TODO("implement me")
KonanTarget.ANDROID_ARM32 ->
listOf("-D__ANDROID__",
"-DUSE_GCC_UNWIND=1",
"-DUSE_ELF_SYMBOLS=1",
"-DELFSIZE=32",
"-DKONAN_ANDROID=1",
"-DKONAN_ARM32=1",
"-DKONAN_NO_UNALIGNED_ACCESS=1")
KonanTarget.ANDROID_ARM64 ->
listOf("-D__ANDROID__",
"-DUSE_GCC_UNWIND=1",
"-DUSE_ELF_SYMBOLS=1",
"-DELFSIZE=64",
"-DKONAN_ANDROID=1",
"-DKONAN_ARM64=1",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1")
KonanTarget.ANDROID_X86 ->
listOf("-D__ANDROID__",
"-DUSE_GCC_UNWIND=1",
"-DUSE_ELF_SYMBOLS=1",
"-DELFSIZE=32",
"-DKONAN_ANDROID=1",
"-DKONAN_X86=1",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1")
KonanTarget.ANDROID_X64 ->
listOf("-D__ANDROID__",
"-DUSE_GCC_UNWIND=1",
"-DUSE_ELF_SYMBOLS=1",
"-DELFSIZE=64",
"-DKONAN_ANDROID=1",
"-DKONAN_X64=1",
"-DKONAN_HAS_CXX11_EXCEPTION_FUNCTIONS=1")
KonanTarget.WASM32 ->
listOf("-DKONAN_WASM=1",
"-DKONAN_NO_FFI=1",
"-DKONAN_NO_THREADS=1",
"-DKONAN_NO_EXCEPTIONS=1",
"-DKONAN_INTERNAL_DLMALLOC=1",
"-DKONAN_INTERNAL_SNPRINTF=1",
"-DKONAN_INTERNAL_NOW=1",
"-DKONAN_NO_MEMMEM",
"-DKONAN_NO_CTORS_SECTION=1")
is KonanTarget.ZEPHYR ->
listOf( "-DKONAN_ZEPHYR=1",
"-DKONAN_NO_FFI=1",
"-DKONAN_NO_THREADS=1",
"-DKONAN_NO_EXCEPTIONS=1",
"-DKONAN_NO_MATH=1",
"-DKONAN_INTERNAL_SNPRINTF=1",
"-DKONAN_INTERNAL_NOW=1",
"-DKONAN_NO_MEMMEM=1",
"-DKONAN_NO_CTORS_SECTION=1",
"-DKONAN_NO_UNALIGNED_ACCESS=1")
}
private val host = HostManager.host
private val binDir = when (host) {
KonanTarget.LINUX_X64 -> "$absoluteTargetToolchain/bin"
KonanTarget.MINGW_X64 -> "$absoluteTargetToolchain/bin"
KonanTarget.MACOS_X64 -> "$absoluteTargetToolchain/usr/bin"
else -> throw TargetSupportException("Unexpected host platform")
}
private val extraHostClangArgs =
if (configurables is GccConfigurables) {
listOf("--gcc-toolchain=${configurables.absoluteGccToolchain}")
} else {
emptyList()
}
val commonClangArgs = listOf("-B$binDir", "-fno-stack-protector") + extraHostClangArgs
val clangPaths = listOf("$absoluteLlvmHome/bin", binDir)
private val jdkDir by lazy {
val home = File.javaHome.absoluteFile
if (home.child("include").exists)
home.absolutePath
else
home.parentFile.absolutePath
}
val hostCompilerArgsForJni = listOf("", HostManager.jniHostPlatformIncludeDir).map { "-I$jdkDir/include/$it" }.toTypedArray()
val clangArgs = (commonClangArgs + specificClangArgs).toTypedArray()
val clangArgsForKonanSources =
clangArgs + clangArgsSpecificForKonanSources
val targetLibclangArgs: List<String> =
// libclang works not exactly the same way as the clang binary and
// (in particular) uses different default header search path.
// See e.g. http://lists.llvm.org/pipermail/cfe-dev/2013-November/033680.html
// We workaround the problem with -isystem flag below.
listOf("-isystem", "$absoluteLlvmHome/lib/clang/$llvmVersion/include", *clangArgs)
val targetClangCmd
= listOf("${absoluteLlvmHome}/bin/clang") + clangArgs
val targetClangXXCmd
= listOf("${absoluteLlvmHome}/bin/clang++") + clangArgs
fun clangC(vararg userArgs: String) = targetClangCmd + userArgs.asList()
fun clangCXX(vararg userArgs: String) = targetClangXXCmd + userArgs.asList()
companion object {
@JvmStatic
fun filterGradleNativeSoftwareFlags(args: MutableList<String>) {
args.remove("/usr/include") // HACK: over gradle-4.4.
args.remove("-nostdinc") // HACK: over gradle-5.1.
when (HostManager.host) {
KonanTarget.LINUX_X64 -> args.remove("/usr/include/x86_64-linux-gnu") // HACK: over gradle-4.4.
KonanTarget.MACOS_X64 -> {
val indexToRemove = args.indexOf(args.find { it.contains("MacOSX.platform")}) // HACK: over gradle-4.7.
if (indexToRemove != -1) {
args.removeAt(indexToRemove - 1) // drop -I.
args.removeAt(indexToRemove - 1) // drop /Application/Xcode.app/...
}
}
}
}
}
}
| apache-2.0 | 09ab21436626a2bb1061a34e570b7b78 | 44.541966 | 203 | 0.492023 | 4.578351 | false | false | false | false |
DankBots/Mega-Gnar | src/main/kotlin/gg/octave/bot/commands/music/dj/BassBoost.kt | 1 | 1093 | package gg.octave.bot.commands.music.dj
import gg.octave.bot.entities.framework.CheckVoiceState
import gg.octave.bot.entities.framework.DJ
import gg.octave.bot.entities.framework.MusicCog
import gg.octave.bot.music.settings.BoostSetting
import gg.octave.bot.utils.extensions.manager
import me.devoxin.flight.api.Context
import me.devoxin.flight.api.annotations.Command
class BassBoost : MusicCog {
override fun sameChannel() = true
override fun requirePlayingTrack() = true
override fun requirePlayer() = true
@DJ
@CheckVoiceState
@Command(aliases = ["bb", "bass", "boost"], description = "Applies bass boost to the music.")
fun bassboost(ctx: Context, strength: BoostSetting) {
val manager = ctx.manager
if (strength == null) {
return ctx.send("`${ctx.trigger}bassboost <${BoostSetting.values().joinToString("/")}>`")
}
manager.dspFilter.bassBoost = strength
ctx.send {
setTitle("Bass Boost")
setDescription("Bass Boost strength is now set to `${strength.name}`")
}
}
}
| mit | 6427fbbf24e3ee1ac31a19153ab7dc85 | 32.121212 | 101 | 0.6871 | 3.945848 | false | false | false | false |
goodwinnk/intellij-community | platform/platform-impl/src/com/intellij/ui/layout/Cell.kt | 1 | 4999 | // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ui.layout
import com.intellij.BundleBase
import com.intellij.icons.AllIcons
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.actionSystem.DefaultActionGroup
import com.intellij.openapi.actionSystem.PlatformDataKeys
import com.intellij.openapi.fileChooser.FileChooserDescriptor
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.popup.JBPopupFactory
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.ui.ClickListener
import com.intellij.ui.TextFieldWithHistoryWithBrowseButton
import com.intellij.ui.components.JBScrollPane
import com.intellij.ui.components.Link
import com.intellij.ui.components.Panel
import com.intellij.ui.components.textFieldWithHistoryWithBrowseButton
import com.intellij.util.ui.UIUtil
import java.awt.Component
import java.awt.event.ActionEvent
import java.awt.event.ActionListener
import java.awt.event.MouseEvent
import javax.swing.JButton
import javax.swing.JCheckBox
import javax.swing.JComponent
import javax.swing.JLabel
@DslMarker
annotation class CellMarker
// separate class to avoid row related methods in the `cell { } `
@CellMarker
abstract class Cell {
/**
* Sets how keen the component should be to grow in relation to other component **in the same cell**. Use `push` in addition if need.
* If this constraint is not set the grow weight is set to 0 and the component will not grow (unless some automatic rule is not applied (see [com.intellij.ui.layout.panel])).
* Grow weight will only be compared against the weights for the same cell.
*/
val growX: CCFlags = CCFlags.growX
@Suppress("unused")
val growY: CCFlags = CCFlags.growY
val grow: CCFlags = CCFlags.grow
/**
* Makes the column that the component is residing in grow with `weight`.
*/
val pushX: CCFlags = CCFlags.pushX
/**
* Makes the row that the component is residing in grow with `weight`.
*/
@Suppress("unused")
val pushY: CCFlags = CCFlags.pushY
val push: CCFlags = CCFlags.push
fun link(text: String, style: UIUtil.ComponentStyle? = null, action: () -> Unit) {
val result = Link(text, action = action)
style?.let { UIUtil.applyStyle(it, result) }
result()
}
fun button(text: String, vararg constraints: CCFlags, actionListener: (event: ActionEvent) -> Unit) {
val button = JButton(BundleBase.replaceMnemonicAmpersand(text))
button.addActionListener(actionListener)
button(*constraints)
}
fun checkBox(text: String, isSelected: Boolean = false, comment: String? = null, vararg constraints: CCFlags, actionListener: ((event: ActionEvent, component: JCheckBox) -> Unit)? = null): JCheckBox {
val component = JCheckBox(text)
component.isSelected = isSelected
if (actionListener != null) {
component.addActionListener(ActionListener { actionListener(it, component) })
}
component(*constraints, comment = comment)
return component
}
fun textFieldWithBrowseButton(browseDialogTitle: String,
value: String? = null,
project: Project? = null,
fileChooserDescriptor: FileChooserDescriptor = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(),
historyProvider: (() -> List<String>)? = null,
fileChosen: ((chosenFile: VirtualFile) -> String)? = null): TextFieldWithHistoryWithBrowseButton {
val component = textFieldWithHistoryWithBrowseButton(project, browseDialogTitle, fileChooserDescriptor, historyProvider, fileChosen)
value?.let { component.text = it }
component()
return component
}
fun gearButton(vararg actions: AnAction) {
val label = JLabel()
label.icon = AllIcons.General.GearPlain
object : ClickListener() {
override fun onClick(e: MouseEvent, clickCount: Int): Boolean {
JBPopupFactory.getInstance()
.createActionGroupPopup(null, DefaultActionGroup(*actions), DataContext { dataId ->
when (dataId) {
PlatformDataKeys.CONTEXT_COMPONENT.name -> label
else -> null
}
}, true, null, 10)
.showUnderneathOf(label)
return true
}
}.installOn(label)
label()
}
fun panel(title: String, wrappedComponent: Component, vararg constraints: CCFlags) {
val panel = Panel(title)
panel.add(wrappedComponent)
panel(*constraints)
}
fun scrollPane(component: Component, vararg constraints: CCFlags) {
JBScrollPane(component)(*constraints)
}
abstract operator fun JComponent.invoke(vararg constraints: CCFlags, gapLeft: Int = 0, growPolicy: GrowPolicy? = null, comment: String? = null)
} | apache-2.0 | c442a33261274e9ac62d2974c84aaf3e | 39 | 202 | 0.720944 | 4.729423 | false | false | false | false |
hewking/HUILibrary | app/src/main/java/com/hewking/custom/util/DrawHelper.kt | 1 | 3369 | package com.hewking.custom.util
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.Rect
/**
* 项目名称:FlowChat
* 类的描述:
* 创建人员:hewking
* 创建时间:2019/1/7 0007
* 修改人员:hewking
* 修改时间:2019/1/7 0007
* 修改备注:
* Version: 1.0.0
*/
object DrawHelper {
/**
* 在宽高为 w,h 的平面内,绘制坐标系,原点居中
*/
fun drawCoordinate(canvas: Canvas, w: Int, h: Int) {
canvas.save()
canvas.translate(w.div(2f), h.div(2f))
val paint = Paint().apply {
isAntiAlias = true
style = Paint.Style.STROKE
color = Color.parseColor("#666666")
textSize = 12f
}
// 绘制x,y 坐标轴
canvas.drawLine(-w.div(2f), 0f, w.div(2f), 0f, paint)
canvas.drawLine(0f, -h.div(2f), 0f, h.div(2f), paint)
val step = 20
val scaleHeight = 5f
// 绘制x,y坐标轴上的刻度
for (posX in 0..w.div(2) step step) {
if (posX == 0) {
continue
}
canvas.drawLine(posX.toFloat(), 0f, posX.toFloat(), -scaleHeight, paint)
canvas.drawLine(-posX.toFloat(), 0f, -posX.toFloat(), -scaleHeight, paint)
canvas.drawText(posX.div(step).toString()
, posX - paint.textWidth(posX.div(step).toString()).div(2f)
, scaleHeight + paint.textHeight() - paint.descent()
, paint)
canvas.drawText((-posX.div(step)).toString()
, -posX - paint.textWidth((-posX.div(step)).toString()).div(2f)
, scaleHeight + paint.textHeight() - paint.descent()
, paint)
}
for (posY in 0..h.div(2) step step) {
if (posY == 0) {
continue
}
canvas.drawLine(0f, posY.toFloat(), scaleHeight, posY.toFloat(), paint)
canvas.drawLine(0f, -posY.toFloat(), scaleHeight, -posY.toFloat(), paint)
canvas.drawText(posY.div(step).toString()
, -scaleHeight - paint.textWidth(posY.div(step).toString())
, posY + (paint.textHeight()).div(2f) - paint.descent(), paint)
canvas.drawText((-posY.div(step)).toString()
, -scaleHeight - paint.textWidth((-posY.div(step)).toString())
, -posY + (paint.textHeight()).div(2f) - paint.descent(), paint)
}
// 绘制方向箭头
val angle = 30 * Math.PI / 180
canvas.drawLine(w.div(2f), 0f, w.div(2f) - step * Math.cos(angle).toFloat(), step * Math.sin(angle).toFloat(), paint)
canvas.drawLine(w.div(2f), 0f, w.div(2f) - step * Math.cos(angle).toFloat(), -step * Math.sin(angle).toFloat(), paint)
canvas.drawLine(0f, h.div(2f), -step * Math.sin(angle).toFloat(), h.div(2f) - step * Math.cos(angle).toFloat(), paint)
canvas.drawLine(0f, h.div(2f), step * Math.sin(angle).toFloat(), h.div(2f) - step * Math.cos(angle).toFloat(), paint)
canvas.restore()
}
fun drawCoordinate(canvas: Canvas, rect: Rect) {
drawCoordinate(canvas, rect.width(), rect.height())
}
} | mit | da2d4823f35b6b8b129e15701438f7a1 | 34.625 | 126 | 0.533375 | 3.598883 | false | false | false | false |
peterLaurence/TrekAdvisor | app/src/main/java/com/peterlaurence/trekme/core/TrekMeContext.kt | 1 | 7343 | package com.peterlaurence.trekme.core
import android.content.Context
import android.os.Build.VERSION_CODES.Q
import android.os.Environment
import android.util.Log
import java.io.File
import java.io.IOException
/**
* General context attributes of the application.
* Here are defined :
*
* * The default root folder of the application on the external storage
* * Where maps are searched
* * Where maps can be downloaded
* * The default folder in which new maps downloaded from the internet are imported
* * The folder where credentials are stored
* * The folder where recordings are saved
* * The file in which app settings are saved (it's a private folder)
*
* @author peterLaurence on 07/10/17 -- converted to Kotlin on 20/11/18
*/
object TrekMeContext {
private const val appFolderName = "trekme"
private const val appFolderNameLegacy = "trekadvisor"
var defaultAppDir: File? = null
val defaultMapsDownloadDir: File? by lazy {
defaultAppDir?.let {
File(it, "downloaded")
}
}
/* Where zip archives are extracted */
val importedDir: File? by lazy {
defaultAppDir?.let {
File(it, "imported")
}
}
val recordingsDir: File? by lazy {
defaultAppDir?.let {
File(it, "recordings")
}
}
/* Where maps are searched */
var mapsDirList: List<File>? = null
/* Where maps can be downloaded */
val downloadDirList: List<File>? by lazy {
mapsDirList?.map {
File(it, "downloaded")
}
}
private var settingsFile: File? = null
private const val TAG = "TrekMeContext"
val credentialsDir: File by lazy {
File(defaultAppDir, "credentials")
}
/**
* Check whether the app root dir is in read-only state or not. This is usually used only if the
* [checkAppDir] call returned `false`
*/
val isAppDirReadOnly: Boolean
get() = Environment.getExternalStorageState(defaultAppDir) == Environment.MEDIA_MOUNTED_READ_ONLY
/**
* Create necessary folders and files, and identify folder in which the maps will be searched
* into.
*/
fun init(context: Context) {
val applicationContext = context.applicationContext
try {
resolveDirs(applicationContext)
createAppDirs()
createNomediaFile()
createSettingsFile(applicationContext)
} catch (e: SecurityException) {
Log.e(TAG, "We don't have right access to create application folder")
} catch (e: IOException) {
Log.e(TAG, "We don't have right access to create application folder")
}
}
/**
* Get the settings [File], or null if for some reason it could not be created or this method
* is called before its creation.
*/
fun getSettingsFile(): File? {
return if (settingsFile?.exists() != null) {
settingsFile
} else {
null
}
}
/**
* We distinguish two cases:
* * Android < 10: We use the "trekme" folder in the internal memory as the default app dir.
* Using [Context.getExternalFilesDirs], we indirectly the directory of the SD card (if there
* is one). The first [File] returned returned by that last api is a folder on the internal
* memory whose files are removed when the app is uninstalled. This isn't the original behavior
* if TrekMe so we don't use it on Android 9 and below.
* * Android >= 10: We no longer use the "trekme" folder. Scoped storage imposes that the [File]
* api can only be used within files returned by [Context.getExternalFilesDirs] - files that are
* private to the app, either on the internal memory or on a SD card. So on Android 10 and above,
* maps are deleted upon app uninstall. To circle around this issue, the map save & restore
* features have been redesigned so that the user has more control on where maps are saved and
* from where to restore.
*/
private fun resolveDirs(applicationContext: Context) {
val dirs: List<File> = applicationContext.getExternalFilesDirs(null).filterNotNull()
if (android.os.Build.VERSION.SDK_INT >= Q) {
defaultAppDir = dirs.firstOrNull()
mapsDirList = dirs
} else {
defaultAppDir = File(Environment.getExternalStorageDirectory(), appFolderName)
val otherDirs = dirs.drop(1)
mapsDirList = listOf(defaultAppDir!!) + otherDirs
}
}
/**
* The settings file is stored in a private folder of the app, and this folder will be deleted
* if the app is uninstalled. This is intended, not to persist those settings.
*/
private fun createSettingsFile(applicationContext: Context) {
settingsFile = File(applicationContext.filesDir, "settings.json")
settingsFile?.also {
if (!it.exists()) {
it.createNewFile()
}
}
}
/**
* To function properly, the app needs to have read + write access to its root directory
*/
fun checkAppDir(): Boolean {
return Environment.getExternalStorageState(defaultAppDir) == Environment.MEDIA_MOUNTED
}
@Throws(SecurityException::class)
private fun createAppDirs() {
/* Root: try to import legacy first */
renameLegacyDir()
createDir(defaultAppDir, "application")
/* Credentials */
createDir(credentialsDir, "credentials")
/* Downloads */
createDir(defaultMapsDownloadDir, "downloads")
/* Recordings */
createDir(recordingsDir, "recordings")
}
/**
* If we detect the existence of the legacy dir, rename it.
* Only do this for Android version under 10, since the former default app dir was obtained with
* a now deprecated call. People with Android 10 or new are very unlikely to have installed
* TrekAdvisor anyway.
*/
private fun renameLegacyDir() {
if (android.os.Build.VERSION.SDK_INT < Q) {
val legacyAppDir = File(Environment.getExternalStorageDirectory(),
appFolderNameLegacy)
if (legacyAppDir.exists()) {
val defaultAppDir = defaultAppDir
if (defaultAppDir != null) {
legacyAppDir.renameTo(defaultAppDir)
}
}
}
}
private fun createDir(dir: File?, label: String) {
if (dir != null && !dir.exists()) {
val created = dir.mkdir()
if (!created) {
Log.e(TAG, "Could not create $label folder")
}
}
}
/**
* We have to create an empty ".nomedia" file at the root of each folder where TrekMe can
* download maps. This way, other apps don't index this content for media files.
*/
@Throws(SecurityException::class, IOException::class)
private fun createNomediaFile() {
mapsDirList?.forEach {
if (it.exists()) {
val noMedia = File(defaultAppDir, ".nomedia")
val created = noMedia.createNewFile()
if (!created) {
Log.e(TAG, "Could not create .nomedia file")
}
}
}
}
}
const val appName = "TrekMe"
| gpl-3.0 | 27536064a4a81d5dc6638a76fe0c39c2 | 33.313084 | 105 | 0.621953 | 4.569384 | false | false | false | false |
AndroidX/androidx | credentials/credentials-play-services-auth/src/main/java/androidx/credentials/playservices/CredentialProviderPlayServicesImpl.kt | 3 | 5448 | /*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package androidx.credentials.playservices
import android.annotation.SuppressLint
import android.app.Activity
import android.os.CancellationSignal
import android.util.Log
import androidx.credentials.CreateCredentialRequest
import androidx.credentials.CreateCredentialResponse
import androidx.credentials.CreatePasswordRequest
import androidx.credentials.CreatePublicKeyCredentialRequest
import androidx.credentials.CredentialManagerCallback
import androidx.credentials.CredentialProvider
import androidx.credentials.GetCredentialRequest
import androidx.credentials.GetCredentialResponse
import androidx.credentials.exceptions.CreateCredentialException
import androidx.credentials.exceptions.CreateCredentialUnknownException
import androidx.credentials.exceptions.GetCredentialException
import androidx.credentials.exceptions.GetCredentialUnknownException
import androidx.credentials.playservices.controllers.BeginSignIn.CredentialProviderBeginSignInController
import androidx.credentials.playservices.controllers.CreatePassword.CredentialProviderCreatePasswordController
import androidx.credentials.playservices.controllers.CreatePublicKeyCredential.CredentialProviderCreatePublicKeyCredentialController
import java.util.concurrent.Executor
/**
* Entry point of all credential manager requests to the play-services-auth
* module.
*
* @hide
*/
@Suppress("deprecation")
class CredentialProviderPlayServicesImpl : CredentialProvider {
override fun onGetCredential(
request: GetCredentialRequest,
activity: Activity?,
cancellationSignal: CancellationSignal?,
executor: Executor,
callback: CredentialManagerCallback<GetCredentialResponse, GetCredentialException>
) {
if (activity == null) {
executor.execute { callback.onError(
GetCredentialUnknownException("activity should" +
"not be null")
) }
return
}
val fragmentManager: android.app.FragmentManager = activity.fragmentManager
if (cancellationReviewer(fragmentManager, cancellationSignal)) {
return
}
// TODO("Manage Fragment Lifecycle and Fragment Manager Properly")
CredentialProviderBeginSignInController.getInstance(fragmentManager).invokePlayServices(
request, callback, executor
)
}
@SuppressWarnings("deprecated")
override fun onCreateCredential(
request: CreateCredentialRequest,
activity: Activity?,
cancellationSignal: CancellationSignal?,
executor: Executor,
callback: CredentialManagerCallback<CreateCredentialResponse, CreateCredentialException>
) {
if (activity == null) {
executor.execute { callback.onError(CreateCredentialUnknownException("activity should" +
"not be null")) }
return
}
val fragmentManager: android.app.FragmentManager = activity.fragmentManager
if (cancellationReviewer(fragmentManager, cancellationSignal)) {
return
}
// TODO("Manage Fragment Lifecycle and Fragment Manager Properly")
if (request is CreatePasswordRequest) {
CredentialProviderCreatePasswordController.getInstance(
fragmentManager).invokePlayServices(
request,
callback,
executor)
} else if (request is CreatePublicKeyCredentialRequest) {
CredentialProviderCreatePublicKeyCredentialController.getInstance(
fragmentManager).invokePlayServices(
request,
callback,
executor)
} else {
throw UnsupportedOperationException(
"Unsupported request; not password or publickeycredential")
}
}
override fun isAvailableOnDevice(): Boolean {
TODO("Not yet implemented")
}
@SuppressLint("ClassVerificationFailure", "NewApi")
private fun cancellationReviewer(
fragmentManager: android.app.FragmentManager,
cancellationSignal: CancellationSignal?
): Boolean {
if (cancellationSignal != null) {
if (cancellationSignal.isCanceled) {
Log.i(TAG, "Create credential already canceled before activity UI")
return true
}
cancellationSignal.setOnCancelListener {
// When this callback is notified, fragment manager may have fragments
fragmentManager.fragments.forEach { f ->
fragmentManager.beginTransaction().remove(f)
?.commitAllowingStateLoss()
}
}
}
return false
}
companion object {
private val TAG = CredentialProviderPlayServicesImpl::class.java.name
}
} | apache-2.0 | 9cb30b30878097ff589c5e714f2359c9 | 39.362963 | 132 | 0.706681 | 5.808102 | false | false | false | false |
erickok/borefts2015 | android/app/src/main/java/nl/brouwerijdemolen/borefts2013/gui/ModelExtensions.kt | 1 | 2617 | package nl.brouwerijdemolen.borefts2013.gui
import nl.brouwerijdemolen.borefts2013.R
import nl.brouwerijdemolen.borefts2013.api.Beer
import nl.brouwerijdemolen.borefts2013.api.Brewer
import nl.brouwerijdemolen.borefts2013.api.Style
import nl.brouwerijdemolen.borefts2013.ext.orZero
import nl.brouwerijdemolen.borefts2013.gui.components.ResourceProvider
import kotlin.math.roundToInt
fun Brewer.location(res: ResourceProvider): String? {
return res.getString(R.string.info_origin, city, country)
}
fun Style.getColorResource(res: ResourceProvider): Int {
return when (color) {
1 -> res.getColor(R.color.style_1)
2 -> res.getColor(R.color.style_2)
3 -> res.getColor(R.color.style_3)
4 -> res.getColor(R.color.style_4)
5 -> res.getColor(R.color.style_5)
else -> res.getColor(R.color.style_unknown)
}
}
val Brewer.sortFilter: String
get() = if (id == 32) "" else sortName
val Beer.fullName: CharSequence
get() = if (festivalBeer) "$name (Borefts Special)" else name
fun Beer.abvText(res: ResourceProvider): String? {
return if (hasAbv) res.getString(R.string.info_abvperc, abv) else null
}
val Beer.hasAbv: Boolean
get() = abv >= 0
val Beer.abvIndication: Int
get() = if (hasAbv) {
(abv / 2.5).roundToInt().coerceIn(1, 5)
} else style?.abv.orZero()
val Beer.hasFlavourIndication: Boolean
get() = bitter > 0 && sweet > 0 && sour > 0
val Beer.bitternessIndication: Int
get() = if (bitter > 0) {
bitter
} else style?.bitterness.orZero()
val Beer.sweetnessIndication: Int
get() = if (sweet > 0) {
sweet
} else style?.sweetness.orZero()
val Beer.acidityIndication: Int
get() = if (sour > 0) {
sour
} else style?.acidity.orZero()
val Beer.colorInt: Int
get() = try {
color?.toInt().orZero()
} catch (e: NumberFormatException) {
0
}
fun Beer.colorIndicationResource(res: ResourceProvider): Int {
val bc = colorInt
val c = if (bc > 0) bc else style?.color.orZero()
return when (c) {
1 -> res.getColor(R.color.style_1)
2 -> res.getColor(R.color.style_2)
3 -> res.getColor(R.color.style_3)
4 -> res.getColor(R.color.style_4)
5 -> res.getColor(R.color.style_5)
else -> res.getColor(R.color.style_unknown)
}
}
fun Beer.servingText(res: ResourceProvider): String {
return when (serving) {
"CASK" -> res.getString(R.string.info_serving_cask)
"BOTTLE" -> res.getString(R.string.info_serving_bottle)
else -> res.getString(R.string.info_serving_keg)
}
}
| gpl-3.0 | 88fe1097d9cf503f411c23f1670ae382 | 28.404494 | 74 | 0.656859 | 3.321066 | false | false | false | false |
rejasupotaro/octodroid | app/src/main/kotlin/com/example/octodroid/views/adapters/SearchResultAdapter.kt | 1 | 3575 | package com.example.octodroid.views.adapters
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.view.View
import android.view.ViewGroup
import com.example.octodroid.data.GitHub
import com.example.octodroid.views.components.LinearLayoutLoadMoreListener
import com.example.octodroid.views.helpers.ToastHelper
import com.example.octodroid.views.holders.ProgressViewHolder
import com.example.octodroid.views.holders.RepositoryItemViewHolder
import com.jakewharton.rxbinding.view.RxView
import com.rejasupotaro.octodroid.http.Response
import com.rejasupotaro.octodroid.models.Repository
import com.rejasupotaro.octodroid.models.SearchResult
import rx.Observable
import rx.subjects.BehaviorSubject
import java.util.*
class SearchResultAdapter(private val recyclerView: RecyclerView) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private object ViewType {
val ITEM = 1
val FOOTER = 2
}
private val repositories = ArrayList<Repository>()
private var responseSubject: BehaviorSubject<Observable<Response<SearchResult<Repository>>>>? = null
private var pagedResponse: Observable<Response<SearchResult<Repository>>>? = null
init {
recyclerView.visibility = View.GONE
val layoutManager = LinearLayoutManager(recyclerView.context)
recyclerView.setHasFixedSize(false)
recyclerView.layoutManager = layoutManager
recyclerView.addOnScrollListener(object : LinearLayoutLoadMoreListener(layoutManager) {
override fun onLoadMore() {
if (pagedResponse != null) {
responseSubject!!.onNext(pagedResponse)
}
}
})
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if (viewType == ViewType.FOOTER) {
return ProgressViewHolder.create(parent)
} else {
return RepositoryItemViewHolder.create(parent)
}
}
override fun onBindViewHolder(viewHolder: RecyclerView.ViewHolder, position: Int) {
when (getItemViewType(position)) {
ViewType.FOOTER -> {
}
else -> {
val repository = repositories[position]
(viewHolder as RepositoryItemViewHolder).bind(repository)
}
}
}
override fun getItemViewType(position: Int): Int {
if (repositories.size == 0 || position == repositories.size) {
return ViewType.FOOTER
} else {
return ViewType.ITEM
}
}
override fun getItemCount(): Int {
return repositories.size + 1
}
fun clear() {
repositories.clear()
notifyDataSetChanged()
}
fun submit(query: String) {
clear()
recyclerView.visibility = View.VISIBLE
responseSubject = BehaviorSubject.create(GitHub.client().searchRepositories(query))
responseSubject!!.takeUntil(RxView.detaches(recyclerView))
.flatMap({ r -> r })
.subscribe({ r ->
if (r.isSuccessful) {
ToastHelper.showError(recyclerView.context)
return@subscribe;
}
val items = r.entity().items
val startPosition = repositories.size
repositories.addAll(items)
notifyItemRangeInserted(startPosition, items.size)
pagedResponse = r.next()
})
}
} | mit | e89ece3b89a31d71b26a72b33074a4d5 | 34.058824 | 117 | 0.64979 | 5.151297 | false | false | false | false |
androidx/androidx | compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/autofill/Autofill.kt | 3 | 3894 | /*
* Copyright 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package androidx.compose.ui.autofill
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.platform.synchronized
/**
* Autofill API.
*
* This interface is available to all composables via a CompositionLocal. The composable can then
* request or cancel autofill as required. For instance, the [TextField] can call
* [requestAutofillForNode] when it gains focus, and [cancelAutofillForNode] when it loses focus.
*/
@ExperimentalComposeUiApi
interface Autofill {
/**
* Request autofill for the specified node.
*
* @param autofillNode The node that needs to be autofilled.
*
* This function is usually called when an autofillable component gains focus.
*/
fun requestAutofillForNode(autofillNode: AutofillNode)
/**
* Cancel a previously supplied autofill request.
*
* @param autofillNode The node that needs to be autofilled.
*
* This function is usually called when an autofillable component loses focus.
*/
fun cancelAutofillForNode(autofillNode: AutofillNode)
}
/**
* Every autofillable composable will have an [AutofillNode]. (An autofill node will be created
* for every semantics node that adds autofill properties). This node is used to request/cancel
* autofill, and it holds the [onFill] lambda which is called by the autofill framework.
*
* @property autofillTypes A list of autofill types for this node. These types are conveyed to the
* autofill framework and it is used to call [onFill] with the appropriate value. If you don't set
* this property, the autofill framework will use heuristics to guess the type. This property is a
* list because some fields can have multiple types. For instance, userid in a login form can
* either be a username or an email address. TODO(b/138731416): Check with the autofill service
* team if the order matters, and how duplicate types are handled.
*
* @property boundingBox The screen coordinates of the composable being autofilled.
* This data is used by the autofill framework to decide where to show the autofill popup.
*
* @property onFill The callback that is called by the autofill framework to perform autofill.
*
* @property id A virtual id that is automatically generated for each node.
*/
@ExperimentalComposeUiApi
class AutofillNode(
val autofillTypes: List<AutofillType> = listOf(),
var boundingBox: Rect? = null,
val onFill: ((String) -> Unit)?
) {
internal companion object {
/*@GuardedBy("this")*/
private var previousId = 0
private fun generateId() =
synchronized(this) { ++previousId }
}
val id: Int = generateId()
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is AutofillNode) return false
if (autofillTypes != other.autofillTypes) return false
if (boundingBox != other.boundingBox) return false
if (onFill != other.onFill) return false
return true
}
override fun hashCode(): Int {
var result = autofillTypes.hashCode()
result = 31 * result + (boundingBox?.hashCode() ?: 0)
result = 31 * result + (onFill?.hashCode() ?: 0)
return result
}
} | apache-2.0 | d639194c5d6ceb38933f3834c9c6ee30 | 36.451923 | 98 | 0.713919 | 4.43508 | false | false | false | false |
nrizzio/Signal-Android | app/src/main/java/org/thoughtcrime/securesms/badges/gifts/flow/GiftFlowState.kt | 2 | 708 | package org.thoughtcrime.securesms.badges.gifts.flow
import org.signal.core.util.money.FiatMoney
import org.thoughtcrime.securesms.badges.models.Badge
import org.thoughtcrime.securesms.recipients.Recipient
import java.util.Currency
/**
* State maintained by the GiftFlowViewModel
*/
data class GiftFlowState(
val currency: Currency,
val giftLevel: Long? = null,
val giftBadge: Badge? = null,
val giftPrices: Map<Currency, FiatMoney> = emptyMap(),
val stage: Stage = Stage.INIT,
val recipient: Recipient? = null,
val additionalMessage: CharSequence? = null
) {
enum class Stage {
INIT,
READY,
RECIPIENT_VERIFICATION,
TOKEN_REQUEST,
PAYMENT_PIPELINE,
FAILURE;
}
}
| gpl-3.0 | 298ffbb9b38a4c220ed51a80acae7ad1 | 24.285714 | 56 | 0.737288 | 3.786096 | false | false | false | false |
MoonlightOwl/Yui | src/main/kotlin/totoro/yui/actions/PirateAction.kt | 1 | 792 | package totoro.yui.actions
import totoro.yui.client.Command
import totoro.yui.client.IRCClient
import totoro.yui.util.Dict
private val appeals = Dict.of(
"arrr!", "yo-ho-ho!", "yo-ho-ho, and a bottle of rum!",
"new and russian", "ahoy!", "where's my parrot?",
"fire in the hole!", "release the kraken!"
)
class PirateAction : SensitivityAction("pirate") {
override fun handle(client: IRCClient, command: Command): Boolean {
// try to piratify nickname
val name = command.args.firstOrNull()
val text = if (name?.contains('r') == true)
// search for 'r'
name.replace("r", "rrr") + "!"
else
// or just be a pirate
appeals()
client.send(command.chan, text)
return true
}
}
| mit | a291af26cd158534e8099f03e42ac792 | 29.461538 | 71 | 0.597222 | 3.52 | false | false | false | false |
scenerygraphics/SciView | src/main/kotlin/sc/iview/commands/demo/advanced/LoadCremiDatasetAndNeurons.kt | 1 | 9889 | /*-
* #%L
* sciview 3D visualization tool.
* %%
* Copyright (C) 2016 - 2021 SciView developers.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
package sc.iview.commands.demo.advanced
import bdv.util.DefaultInterpolators
import bdv.viewer.Interpolation
import ch.systemsx.cisd.hdf5.HDF5Factory
import graphics.scenery.Origin
import graphics.scenery.utils.extensions.xyz
import graphics.scenery.volumes.Colormap
import graphics.scenery.volumes.TransferFunction
import graphics.scenery.volumes.Volume
import net.imagej.lut.LUTService
import net.imagej.mesh.Mesh
import net.imagej.mesh.Meshes
import net.imagej.ops.OpService
import net.imglib2.RandomAccessibleInterval
import net.imglib2.img.array.ArrayImgs
import net.imglib2.roi.labeling.ImgLabeling
import net.imglib2.roi.labeling.LabelRegions
import net.imglib2.type.numeric.ARGBType
import net.imglib2.type.numeric.integer.UnsignedByteType
import net.imglib2.type.numeric.integer.UnsignedLongType
import net.imglib2.view.Views
import org.janelia.saalfeldlab.n5.hdf5.N5HDF5Reader
import org.janelia.saalfeldlab.n5.imglib2.N5Utils
import org.joml.Vector3f
import org.joml.Vector4f
import org.scijava.command.Command
import org.scijava.log.LogService
import org.scijava.plugin.Menu
import org.scijava.plugin.Parameter
import org.scijava.plugin.Plugin
import org.scijava.ui.UIService
import org.scijava.widget.FileWidget
import sc.iview.SciView
import sc.iview.commands.MenuWeights
import sc.iview.process.MeshConverter
import java.io.FileFilter
import java.io.IOException
typealias NeuronsAndImage = Triple<HashMap<Long, Long>, RandomAccessibleInterval<UnsignedLongType>, RandomAccessibleInterval<UnsignedByteType>>
@Plugin(type = Command::class,
label = "Cremi Dataset rendering demo",
menuRoot = "SciView",
menu = [Menu(label = "Demo", weight = MenuWeights.DEMO),
Menu(label = "Advanced", weight = MenuWeights.DEMO_ADVANCED),
Menu(label = "Load Cremi dataset and neuron labels", weight = MenuWeights.DEMO_ADVANCED_CREMI)])
class LoadCremiDatasetAndNeurons: Command {
@Parameter
private lateinit var ui: UIService
@Parameter
private lateinit var log: LogService
@Parameter
private lateinit var ops: OpService
@Parameter
private lateinit var sciview: SciView
@Parameter
private lateinit var lut: LUTService
internal class DefaultLabelIterator : MutableIterator<Long> {
private var i = 0L
override fun hasNext(): Boolean {
return i < Long.MAX_VALUE
}
override fun next(): Long {
return i++
}
override fun remove() {
throw UnsupportedOperationException()
}
}
/**
* When an object implementing interface `Runnable` is used
* to create a thread, starting the thread causes the object's
* `run` method to be called in that separately executing
* thread.
*
*
* The general contract of the method `run` is that it may
* take any action whatsoever.
*
* @see Thread.run
*/
override fun run() {
val task = sciview.taskManager.newTask("Cremi", "Loading dataset")
val filter = FileFilter { file ->
val extension = file.name.substringAfterLast(".").toLowerCase()
extension == "hdf5" || extension == "hdf"
}
val files = ui.chooseFiles(null, emptyList(), filter, FileWidget.OPEN_STYLE)
val nai = readCremiHDF5(files.first().canonicalPath, 1.0)
if(nai == null) {
log.error("Could not get neuron IDs")
return
}
val raiVolume = nai.third
val cursor = Views.iterable(raiVolume).localizingCursor()
while(cursor.hasNext() && cursor.getIntPosition(2) < 50) {
cursor.fwd()
cursor.get().set(0)
}
val colormapVolume = lut.loadLUT(lut.findLUTs().get("Grays.lut"))
val colormapNeurons = lut.loadLUT(lut.findLUTs().get("Fire.lut"))
sciview.addVolume(nai.third, files.first().name) {
origin = Origin.FrontBottomLeft
this.spatialOrNull()?.scale = Vector3f(0.08f, 0.08f, 5.0f)
transferFunction = TransferFunction.ramp(0.3f, 0.1f, 0.1f)
// min 20, max 180, color map fire
transferFunction.addControlPoint(0.3f, 0.5f)
transferFunction.addControlPoint(0.8f, 0.01f)
converterSetups.get(0).setDisplayRange(20.0, 220.0)
colormap = Colormap.fromColorTable(colormapVolume)
}
task.status = "Creating labeling"
task.completion = 10.0f
val rai = nai.second
log.info("Got ${nai.first.size} labels")
// let's extract some neurons here
log.info("Creating labeling ...")
val labels = (0 .. (nai.first.keys.maxOrNull()?.toInt() ?: 1)).toList()
val labeling = ImgLabeling.fromImageAndLabels(rai, labels)
log.info("Creating regions...")
val regions = LabelRegions(labeling)
log.info("Created ${regions.count()} regions")
val largestNeuronLabels = nai.first.entries.sortedByDescending { p -> p.value }.take(50).shuffled().take(10).map { kv -> kv.key }
log.info("Largest neuron labels are ${largestNeuronLabels.joinToString(",")}")
regions.filter { largestNeuronLabels.contains(it.label.toLong() + 1L) }.forEachIndexed { i, region ->
log.info("Meshing neuron ${i + 1}/${largestNeuronLabels.size} with label ${region.label}...")
task.status = "Meshing neuron ${i+1}/${largestNeuronLabels.size}"
// ui.show(region)
// Generate the mesh with imagej-ops
val m: Mesh = Meshes.marchingCubes(region);
log.info("Converting neuron ${i + 1}/${largestNeuronLabels.size} to scenery format...")
// Convert the mesh into a scenery mesh for visualization
val mesh = MeshConverter.toScenery(m, false, flipWindingOrder = true)
sciview.addNode(mesh) {
spatial().scale = Vector3f(0.01f, 0.01f, 0.06f)
ifMaterial {
diffuse =
colormapNeurons.lookupARGB(0.0, 255.0, kotlin.random.Random.nextDouble(0.0, 255.0)).toRGBColor()
.xyz()
roughness = 0.0f
}
name = "Neuron $i"
}
val completion = 10.0f + ((i+1)/largestNeuronLabels.size.toFloat())*90.0f
task.completion = completion
}
task.completion = 100.0f
}
fun readCremiHDF5(path: String, scale: Double = 1.0): NeuronsAndImage? {
log.info("Reading cremi HDF5 from $path")
val hdf5Reader = HDF5Factory.openForReading(path)
val n5Reader: N5HDF5Reader
try {
n5Reader = N5HDF5Reader(hdf5Reader, *intArrayOf(128, 128, 128))
val neuronIds: RandomAccessibleInterval<UnsignedLongType> = N5Utils.open(n5Reader,
"/volumes/labels/neuron_ids",
UnsignedLongType())
val volume: RandomAccessibleInterval<UnsignedByteType> = N5Utils.open(n5Reader,
"/volumes/raw",
UnsignedByteType())
val img = ArrayImgs.unsignedLongs(*neuronIds.dimensionsAsLongArray())
val cursor = Views.iterable(neuronIds).localizingCursor()
val dest = img.randomAccess();
val neurons = HashMap<Long, Long>()
while( cursor.hasNext() ) {
cursor.fwd();
dest.setPosition(cursor);
val value = cursor.get()
dest.get().set(value);
neurons[value.get()] = (neurons[value.get()] ?: 0) + 1
}
log.info("Got RAI from HDF5, dimensions ${img.dimensionsAsLongArray().joinToString(",")}")
return if(scale != 1.0) {
Triple(neurons, ops.transform().scaleView(img, doubleArrayOf(scale, scale, scale), DefaultInterpolators<UnsignedLongType>().get(Interpolation.NEARESTNEIGHBOR)), volume)
} else {
Triple(neurons, img, volume)
}
} catch (e: IOException) {
log.error("Could not read Cremi HDF5 file from $path")
e.printStackTrace()
}
return null
}
private fun Int.toRGBColor(): Vector4f {
val a = ARGBType.alpha(this)/255.0f
val r = ARGBType.red(this)/255.0f
val g = ARGBType.green(this)/255.0f
val b = ARGBType.blue(this)/255.0f
return Vector4f(r, g, b, a)
}
}
| bsd-2-clause | def3b5b4a31fd60baf75f4d38f6a1fce | 38.714859 | 184 | 0.650319 | 3.963527 | false | false | false | false |
klazuka/intellij-elm | src/main/kotlin/org/elm/ide/inspections/ElmUnusedImportInspection.kt | 1 | 5323 | package org.elm.ide.inspections
import com.intellij.codeInsight.actions.OptimizeImportsProcessor
import com.intellij.codeInspection.LocalInspectionTool
import com.intellij.codeInspection.LocalInspectionToolSession
import com.intellij.codeInspection.ProblemHighlightType
import com.intellij.codeInspection.ProblemsHolder
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Key
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiElementVisitor
import org.elm.lang.core.psi.ElmExposedItemTag
import org.elm.lang.core.psi.ElmFile
import org.elm.lang.core.psi.elements.ElmAsClause
import org.elm.lang.core.psi.elements.ElmImportClause
import org.elm.lang.core.psi.parentOfType
import org.elm.lang.core.resolve.ElmReferenceElement
import org.elm.lang.core.resolve.reference.LexicalValueReference
import org.elm.lang.core.resolve.reference.QualifiedReference
import org.elm.lang.core.resolve.scope.ModuleScope
import java.util.concurrent.ConcurrentHashMap
/**
* Find unused imports
*/
class ElmUnusedImportInspection : LocalInspectionTool() {
private val visitorKey = Key.create<ImportVisitor>("")
override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean, session: LocalInspectionToolSession): PsiElementVisitor {
val file = session.file as? ElmFile
?: return super.buildVisitor(holder, isOnTheFly, session)
val visitor = ImportVisitor(ModuleScope.getImportDecls(file))
session.putUserData(visitorKey, visitor)
return visitor
}
override fun inspectionFinished(session: LocalInspectionToolSession, problemsHolder: ProblemsHolder) {
val visitor = session.getUserData(visitorKey) ?: return
for (import in visitor.unusedImports) {
problemsHolder.markUnused(import, "Unused import")
}
for (item in visitor.unusedExposedItems) {
problemsHolder.markUnused(item, "'${item.text}' is exposed but unused")
}
for (alias in visitor.unusedModuleAliases) {
problemsHolder.markUnused(alias, "Unused alias")
}
}
}
private fun ProblemsHolder.markUnused(elem: PsiElement, message: String) {
registerProblem(elem, message, ProblemHighlightType.LIKE_UNUSED_SYMBOL, OptimizeImportsFix())
}
private class OptimizeImportsFix : NamedQuickFix("Optimize imports") {
override fun applyFix(element: PsiElement, project: Project) {
val file = element.containingFile as? ElmFile ?: return
OptimizeImportsProcessor(project, file).run()
}
}
class ImportVisitor(initialImports: List<ElmImportClause>) : PsiElementVisitor() {
// IMPORTANT! IntelliJ's LocalInspectionTool requires that visitor implementations be thread-safe.
private val imports = initialImports.associateByTo(ConcurrentHashMap()) { it.moduleQID.text }
private val exposing = initialImports.mapNotNull { it.exposingList }
.flatMap { it.exposedValueList }
.associateByTo(ConcurrentHashMap()) { it.text }
private val moduleAliases = initialImports.mapNotNull { it.asClause }
.associateByTo(ConcurrentHashMap()) { it.upperCaseIdentifier.text }
/** Returns the list of unused imports. IMPORTANT: only valid *after* the visitor completes its traversal. */
val unusedImports: List<ElmImportClause>
get() = imports.values.filter { !it.safeToIgnore }
/** Returns the list of unused exposed items. IMPORTANT: only valid *after* the visitor completes its traversal. */
val unusedExposedItems: List<ElmExposedItemTag>
get() = exposing.values.filter { notChildOfAlreadyReportedStatement(it) }
/** Returns the list of unused module aliases. IMPORTANT: only valid *after* the visitor completes its traversal. */
val unusedModuleAliases: List<ElmAsClause>
get() = moduleAliases.values.filter { notChildOfAlreadyReportedStatement(it) }
private fun notChildOfAlreadyReportedStatement(it: PsiElement) : Boolean {
val import = it.parentOfType<ElmImportClause>() ?: return false
return import !in unusedImports && !import.safeToIgnore
}
override fun visitElement(element: PsiElement) {
super.visitElement(element)
if (element is ElmReferenceElement && element !is ElmImportClause && element !is ElmExposedItemTag) {
val reference = element.reference
val resolved = reference.resolve() ?: return
val resolvedModule = resolved.elmFile.getModuleDecl() ?: return
val resolvedModuleName = resolvedModule.name
imports.remove(resolvedModuleName)
// For now we are just going to mark exposed values/functions which are unused
// TODO expand this to types, union variant constructors, and operators
if (reference is LexicalValueReference) {
exposing.remove(element.referenceName)
}
if (reference is QualifiedReference) {
moduleAliases.remove(reference.qualifierPrefix)
}
}
}
}
// Elm's Kernel modules are defined in JS, and our PsiReference system does not (currently)
// cross the boundary from Elm to JS. So we must ignore any warnings for "kernel" imports.
private val ElmImportClause.safeToIgnore: Boolean
get() = moduleQID.isKernelModule
| mit | 44507cfcb2fdb6ff3168f23fd8c02e8f | 43.358333 | 132 | 0.731354 | 4.786871 | false | false | false | false |
dropbox/Store | store-rx3/src/main/kotlin/com/dropbox/store/rx3/RxStore.kt | 1 | 2095 | package com.dropbox.store.rx3
import com.dropbox.android.external.store4.ExperimentalStoreApi
import com.dropbox.android.external.store4.Store
import com.dropbox.android.external.store4.StoreBuilder
import com.dropbox.android.external.store4.StoreRequest
import com.dropbox.android.external.store4.StoreResponse
import com.dropbox.android.external.store4.fresh
import com.dropbox.android.external.store4.get
import io.reactivex.rxjava3.core.Completable
import io.reactivex.rxjava3.core.Flowable
import kotlinx.coroutines.rx3.asFlowable
import kotlinx.coroutines.rx3.rxCompletable
import kotlinx.coroutines.rx3.rxSingle
/**
* Return a [Flowable] for the given key
* @param request - see [StoreRequest] for configurations
*/
fun <Key : Any, Output : Any> Store<Key, Output>.observe(request: StoreRequest<Key>): Flowable<StoreResponse<Output>> =
stream(request).asFlowable()
/**
* Purge a particular entry from memory and disk cache.
* Persistent storage will only be cleared if a delete function was passed to
* [StoreBuilder.persister] or [StoreBuilder.nonFlowingPersister] when creating the [Store].
*/
fun <Key : Any, Output : Any> Store<Key, Output>.observeClear(key: Key): Completable =
rxCompletable { clear(key) }
/**
* Purge all entries from memory and disk cache.
* Persistent storage will only be cleared if a deleteAll function was passed to
* [StoreBuilder.persister] or [StoreBuilder.nonFlowingPersister] when creating the [Store].
*/
@ExperimentalStoreApi
fun <Key : Any, Output : Any> Store<Key, Output>.observeClearAll(): Completable =
rxCompletable { clearAll() }
/**
* Helper factory that will return data as a [Single] for [key] if it is cached otherwise will return fresh/network data (updating your caches)
*/
fun <Key : Any, Output : Any> Store<Key, Output>.getSingle(key: Key) =
rxSingle { [email protected](key) }
/**
* Helper factory that will return fresh data as a [Single] for [key] while updating your caches
*/
fun <Key : Any, Output : Any> Store<Key, Output>.freshSingle(key: Key) =
rxSingle { [email protected](key) }
| apache-2.0 | d217c08d7805b766f9d7f7615585dd80 | 40.9 | 143 | 0.762291 | 3.79529 | false | false | false | false |
gigaSproule/swagger-gradle-plugin | sample/kotlin-spring-boot-mvc/src/main/kotlin/com/benjaminsproule/sample/kotlin/SampleController.kt | 1 | 678 | package com.benjaminsproule.sample.kotlin
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestMethod
import org.springframework.web.bind.annotation.RestController
@RestController
@Api(value = "/sample", description = "Sample REST for Integration Testing")
class SampleController {
@RequestMapping(method = [RequestMethod.GET], path = ["/sample"], produces = ["application/json"])
@ApiOperation(value = "Return hello message", response = String::class)
fun home(): String {
return "{\"Hello\": \"World!\"}"
}
}
| apache-2.0 | b2e585ce4012b72435aa2febe252a2f4 | 36.666667 | 102 | 0.753687 | 4.318471 | false | true | false | false |
InfiniteSoul/ProxerAndroid | src/main/kotlin/me/proxer/app/notification/NotificationWorker.kt | 1 | 5584 | package me.proxer.app.notification
import android.content.Context
import androidx.work.Constraints
import androidx.work.ExistingPeriodicWorkPolicy
import androidx.work.NetworkType
import androidx.work.PeriodicWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.Worker
import androidx.work.WorkerParameters
import com.rubengees.rxbus.RxBus
import me.proxer.app.news.NewsNotificationEvent
import me.proxer.app.news.NewsNotifications
import me.proxer.app.util.WorkerUtils
import me.proxer.app.util.data.PreferenceHelper
import me.proxer.app.util.data.StorageHelper
import me.proxer.app.util.extension.safeInject
import me.proxer.app.util.extension.toInstantBP
import me.proxer.library.ProxerApi
import me.proxer.library.ProxerCall
import me.proxer.library.entity.notifications.NotificationInfo
import me.proxer.library.enums.NotificationFilter
import org.koin.core.KoinComponent
import timber.log.Timber
import java.util.concurrent.TimeUnit
/**
* @author Ruben Gees
*/
class NotificationWorker(
context: Context,
workerParams: WorkerParameters
) : Worker(context, workerParams), KoinComponent {
companion object : KoinComponent {
private const val NAME = "NotificationWorker"
private val bus by safeInject<RxBus>()
private val workManager by safeInject<WorkManager>()
private val preferenceHelper by safeInject<PreferenceHelper>()
fun enqueueIfPossible(delay: Boolean = false) {
val areNotificationsEnabled = preferenceHelper.areNewsNotificationsEnabled ||
preferenceHelper.areAccountNotificationsEnabled
if (areNotificationsEnabled) {
enqueue(delay)
} else {
cancel()
}
}
fun cancel() {
workManager.cancelUniqueWork(NAME)
}
private fun enqueue(delay: Boolean) {
val interval = preferenceHelper.notificationsInterval * 1_000 * 60
val workRequest = PeriodicWorkRequestBuilder<NotificationWorker>(interval, TimeUnit.MILLISECONDS)
.apply { if (delay) setInitialDelay(interval, TimeUnit.MILLISECONDS) }
.setConstraints(
Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED)
.build()
)
.build()
workManager.enqueueUniquePeriodicWork(NAME, ExistingPeriodicWorkPolicy.REPLACE, workRequest)
}
}
private val api by safeInject<ProxerApi>()
private val storageHelper by safeInject<StorageHelper>()
private var currentCall: ProxerCall<*>? = null
override fun onStopped() {
currentCall?.cancel()
}
override fun doWork() = try {
val notificationInfo = when (storageHelper.isLoggedIn) {
true -> api.notifications.notificationInfo()
.build()
.also { currentCall = it }
.execute()
false -> null
}
val areNewsNotificationsEnabled = preferenceHelper.areNewsNotificationsEnabled
val areAccountNotificationsEnabled = preferenceHelper.areAccountNotificationsEnabled
if (!isStopped && areNewsNotificationsEnabled) {
fetchNews(applicationContext, notificationInfo)
}
if (!isStopped && areAccountNotificationsEnabled && notificationInfo != null) {
fetchAccountNotifications(applicationContext, notificationInfo)
}
Result.success()
} catch (error: Throwable) {
Timber.e(error)
if (WorkerUtils.shouldRetryForError(error)) {
Result.retry()
} else {
Result.failure()
}
}
private fun fetchNews(context: Context, notificationInfo: NotificationInfo?) {
val lastNewsDate = preferenceHelper.lastNewsDate
val newNews = when (notificationInfo?.newsAmount) {
0 -> emptyList()
else -> api.notifications.news()
.page(0)
.limit(notificationInfo?.newsAmount ?: 100)
.build()
.also { currentCall = it }
.safeExecute()
.asSequence()
.filter { it.date.toInstantBP().isAfter(lastNewsDate) }
.sortedByDescending { it.date }
.toList()
}
newNews.firstOrNull()?.date?.toInstantBP()?.let {
if (!isStopped && it != lastNewsDate && !bus.post(NewsNotificationEvent())) {
NewsNotifications.showOrUpdate(context, newNews)
preferenceHelper.lastNewsDate = it
}
}
}
private fun fetchAccountNotifications(context: Context, notificationInfo: NotificationInfo) {
val lastNotificationsDate = storageHelper.lastNotificationsDate
val newNotifications = when (notificationInfo.notificationAmount) {
0 -> emptyList()
else -> api.notifications.notifications()
.page(0)
.limit(notificationInfo.notificationAmount)
.filter(NotificationFilter.UNREAD)
.build()
.also { currentCall = it }
.safeExecute()
}
newNotifications.firstOrNull()?.date?.toInstantBP()?.let {
if (!isStopped && it != lastNotificationsDate && !bus.post(AccountNotificationEvent())) {
AccountNotifications.showOrUpdate(context, newNotifications)
storageHelper.lastNotificationsDate = it
}
}
}
}
| gpl-3.0 | ba1381ee9479dd5d83ce0474baa55e27 | 34.341772 | 109 | 0.64058 | 5.405615 | false | false | false | false |
kenrube/Fantlab-client | app/src/main/kotlin/ru/fantlab/android/ui/adapter/SmileAdapter.kt | 2 | 1660 | package ru.fantlab.android.ui.adapter
import android.view.ViewGroup
import android.widget.Filter
import android.widget.Filterable
import ru.fantlab.android.data.dao.model.Smile
import ru.fantlab.android.ui.adapter.viewholder.SmileViewHolder
import ru.fantlab.android.ui.widgets.recyclerview.BaseRecyclerAdapter
import ru.fantlab.android.ui.widgets.recyclerview.BaseViewHolder
class SmileAdapter(listener: BaseViewHolder.OnItemClickListener<Smile>)
: BaseRecyclerAdapter<Smile, SmileViewHolder>(listener = listener), Filterable {
var copiedList = mutableListOf<Smile>()
override fun viewHolder(parent: ViewGroup, viewType: Int): SmileViewHolder {
return SmileViewHolder.newInstance(parent, this)
}
override fun onBindView(holder: SmileViewHolder, position: Int) {
holder.bind(data[position])
}
override fun getFilter(): Filter {
return object : Filter() {
override fun performFiltering(constraint: CharSequence): Filter.FilterResults {
if (copiedList.isEmpty()) {
copiedList.addAll(data)
}
val text = constraint.toString().toLowerCase()
val filteredResults: List<Smile> = if (text.isNotBlank()) {
val data = data.filter {
text in it.description || it.description.contains(text)
}
if (data.isNotEmpty()) data
else copiedList
} else {
copiedList
}
val results = FilterResults()
results.values = filteredResults
results.count = filteredResults.size
return results
}
@Suppress("UNCHECKED_CAST")
override fun publishResults(var1: CharSequence, results: Filter.FilterResults) {
results.values?.let {
insertItems(it as List<Smile>)
}
}
}
}
} | gpl-3.0 | ece74bccf1e7b1ef0d56a1ec7d27c9ae | 29.759259 | 83 | 0.738554 | 3.933649 | false | false | false | false |
pbauerochse/youtrack-worklog-viewer | application/src/main/java/de/pbauerochse/worklogviewer/excel/columns/IssueTimeSpentExcelColumn.kt | 1 | 2209 | package de.pbauerochse.worklogviewer.excel.columns
import de.pbauerochse.worklogviewer.excel.ExcelColumnRenderer
import de.pbauerochse.worklogviewer.excel.POIRow
import de.pbauerochse.worklogviewer.excel.POIWorkbook
import de.pbauerochse.worklogviewer.excel.setTimeSpent
import de.pbauerochse.worklogviewer.timereport.view.ReportRow
import de.pbauerochse.worklogviewer.util.FormattingUtil.formatDate
import org.apache.poi.ss.usermodel.Cell
import java.time.LocalDate
/**
* Renders the time spent for the given
* date. Depending on the settings as
* YouTrack timestamp (1d 4h 20m) or as
* hours in decimal format (12,3)
*/
class IssueTimeSpentExcelColumn(private val date: LocalDate) : ExcelColumnRenderer {
override val headline: String = formatDate(date)
override fun write(excelRow: POIRow, columnIndex: Int, reportRow: ReportRow) {
val cell = excelRow.createCell(columnIndex)
val workbook = excelRow.sheet.workbook
when {
reportRow.isGrouping -> renderGroupBySummary(workbook, cell, reportRow)
reportRow.isIssue -> renderIssueSummary(workbook, cell, reportRow)
reportRow.isSummary -> renderSummary(workbook, cell, reportRow)
}
}
private fun renderGroupBySummary(workbook: POIWorkbook, cell: Cell, value: ReportRow) {
val totalTimeSpentInMinutes = value.getDurationInMinutes(date)
if (totalTimeSpentInMinutes > 0) {
cell.setTimeSpent(totalTimeSpentInMinutes)
cell.cellStyle = workbook.groupByTimeSpentStyle
}
}
private fun renderIssueSummary(workbook: POIWorkbook, cell: Cell, value: ReportRow) {
val timeSpentInMinutes = value.getDurationInMinutes(date)
if (timeSpentInMinutes > 0) {
cell.setTimeSpent(timeSpentInMinutes)
cell.cellStyle = workbook.issueTimeSpentStyle
}
}
private fun renderSummary(workbook: POIWorkbook, cell: Cell, value: ReportRow) {
val totalTimeSpentInMinutes = value.getDurationInMinutes(date)
if (totalTimeSpentInMinutes > 0) {
cell.setTimeSpent(totalTimeSpentInMinutes)
cell.cellStyle = workbook.issueSummaryStyle
}
}
}
| mit | 27de6a66b52ee4b044492be070d2ce96 | 37.754386 | 91 | 0.725215 | 4.281008 | false | false | false | false |
ohmae/DmsExplorer | mobile/src/main/java/net/mm2d/dmsexplorer/viewmodel/RendererItemModel.kt | 1 | 2195 | /*
* Copyright (c) 2017 大前良介 (OHMAE Ryosuke)
*
* This software is released under the MIT License.
* http://opensource.org/licenses/MIT
*/
package net.mm2d.dmsexplorer.viewmodel
import android.content.Context
import android.graphics.Bitmap
import android.graphics.BitmapFactory
import android.graphics.drawable.Drawable
import androidx.core.graphics.drawable.DrawableCompat
import net.mm2d.android.upnp.avt.MediaRenderer
import net.mm2d.android.util.DrawableUtils
import net.mm2d.android.util.toDisplayableString
import net.mm2d.dmsexplorer.R
import net.mm2d.dmsexplorer.settings.Settings
/**
* @author [大前良介 (OHMAE Ryosuke)](mailto:[email protected])
*/
class RendererItemModel(
context: Context,
renderer: MediaRenderer
) {
var accentBackground: Drawable?
var accentText: String?
var accentIcon: Bitmap?
val title: String
val description: String
init {
val name = renderer.friendlyName
title = name
description = makeDescription(renderer)
val binary = renderer.getIcon()?.binary
if (binary == null) {
accentIcon = null
accentText = if (name.isEmpty()) "" else name.substring(0, 1).toDisplayableString()
val generator = Settings.get()
.themeParams
.themeColorGenerator
accentBackground = DrawableUtils.get(context, R.drawable.ic_circle)?.also {
it.mutate()
DrawableCompat.setTint(it, generator.getIconColor(name))
}
} else {
accentIcon = BitmapFactory.decodeByteArray(binary, 0, binary.size)
accentText = null
accentBackground = null
}
}
private fun makeDescription(renderer: MediaRenderer): String {
val sb = StringBuilder()
val manufacture = renderer.manufacture
if (!manufacture.isNullOrEmpty()) {
sb.append(manufacture).append('\n')
}
sb.append("IP: ").append(renderer.ipAddress)
val serial = renderer.serialNumber
if (!serial.isNullOrEmpty()) {
sb.append(" Serial: ").append(serial)
}
return sb.toString()
}
}
| mit | 1a5753cbb7a4034e6d2735ec13e481d6 | 30.57971 | 95 | 0.650298 | 4.306324 | false | false | false | false |
VKCOM/vk-android-sdk | api/src/main/java/com/vk/sdk/api/messages/dto/MessagesChatSettingsPermissions.kt | 1 | 4455 | /**
* The MIT License (MIT)
*
* Copyright (c) 2019 vk.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// *********************************************************************
// THIS FILE IS AUTO GENERATED!
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING.
// *********************************************************************
package com.vk.sdk.api.messages.dto
import com.google.gson.annotations.SerializedName
import kotlin.String
/**
* @param invite - Who can invite users to chat
* @param changeInfo - Who can change chat info
* @param changePin - Who can change pinned message
* @param useMassMentions - Who can use mass mentions
* @param seeInviteLink - Who can see invite link
* @param call - Who can make calls
* @param changeAdmins - Who can change admins
*/
data class MessagesChatSettingsPermissions(
@SerializedName("invite")
val invite: MessagesChatSettingsPermissions.Invite? = null,
@SerializedName("change_info")
val changeInfo: MessagesChatSettingsPermissions.ChangeInfo? = null,
@SerializedName("change_pin")
val changePin: MessagesChatSettingsPermissions.ChangePin? = null,
@SerializedName("use_mass_mentions")
val useMassMentions: MessagesChatSettingsPermissions.UseMassMentions? = null,
@SerializedName("see_invite_link")
val seeInviteLink: MessagesChatSettingsPermissions.SeeInviteLink? = null,
@SerializedName("call")
val call: MessagesChatSettingsPermissions.Call? = null,
@SerializedName("change_admins")
val changeAdmins: MessagesChatSettingsPermissions.ChangeAdmins? = null
) {
enum class Invite(
val value: String
) {
@SerializedName("owner")
OWNER("owner"),
@SerializedName("owner_and_admins")
OWNER_AND_ADMINS("owner_and_admins"),
@SerializedName("all")
ALL("all");
}
enum class ChangeInfo(
val value: String
) {
@SerializedName("owner")
OWNER("owner"),
@SerializedName("owner_and_admins")
OWNER_AND_ADMINS("owner_and_admins"),
@SerializedName("all")
ALL("all");
}
enum class ChangePin(
val value: String
) {
@SerializedName("owner")
OWNER("owner"),
@SerializedName("owner_and_admins")
OWNER_AND_ADMINS("owner_and_admins"),
@SerializedName("all")
ALL("all");
}
enum class UseMassMentions(
val value: String
) {
@SerializedName("owner")
OWNER("owner"),
@SerializedName("owner_and_admins")
OWNER_AND_ADMINS("owner_and_admins"),
@SerializedName("all")
ALL("all");
}
enum class SeeInviteLink(
val value: String
) {
@SerializedName("owner")
OWNER("owner"),
@SerializedName("owner_and_admins")
OWNER_AND_ADMINS("owner_and_admins"),
@SerializedName("all")
ALL("all");
}
enum class Call(
val value: String
) {
@SerializedName("owner")
OWNER("owner"),
@SerializedName("owner_and_admins")
OWNER_AND_ADMINS("owner_and_admins"),
@SerializedName("all")
ALL("all");
}
enum class ChangeAdmins(
val value: String
) {
@SerializedName("owner")
OWNER("owner"),
@SerializedName("owner_and_admins")
OWNER_AND_ADMINS("owner_and_admins");
}
}
| mit | 7221545f9b3c0250da7ea1da26686cf1 | 29.724138 | 81 | 0.638608 | 4.455 | false | false | false | false |
Instagram/ig-json-parser | processor/src/test/java/com/instagram/common/json/annotation/processor/KotlinStrictSupportTest.kt | 1 | 1786 | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.instagram.common.json.annotation.processor
import org.junit.Assert.assertEquals
import org.junit.Test
/**
* Testing whether the [JsonAnnotationProcessor] generates valid Java code when reading annotations
* of strict classes.
*/
class KotlinStrictSupportTest {
private val model = KotlinImmutableObject("my data", 1)
private val json = """{"data3":"bar","data1":"my data","data2":1}"""
init {
model.data3 = "bar"
}
@Test
fun handlesKotlinImmutableClassToJson() {
val actual = KotlinImmutableObject__JsonHelper.serializeToJson(model)
assertEquals(json, actual)
}
@Test
fun handlesKotlinImmutableClassFromJson() {
val actual = KotlinImmutableObject__JsonHelper.parseFromJson(json)
assertEquals(model.data1, actual.data1)
assertEquals(model.data2, actual.data2)
assertEquals(model.data3, actual.data3)
}
@Test
fun serializeThenParseBackIsSymmetric() {
val actualJson = KotlinImmutableObject__JsonHelper.serializeToJson(model)
val actual = KotlinImmutableObject__JsonHelper.parseFromJson(actualJson)
assertEquals(model.data1, actual.data1)
assertEquals(model.data2, actual.data2)
assertEquals(model.data3, actual.data3)
}
@Test
fun serializeThenParseBackWithNullIsSymmetric() {
model.data3 = null
val actualJson = KotlinImmutableObject__JsonHelper.serializeToJson(model)
val actual = KotlinImmutableObject__JsonHelper.parseFromJson(actualJson)
assertEquals(model.data1, actual.data1)
assertEquals(model.data2, actual.data2)
assertEquals(model.data3, actual.data3)
}
}
| mit | 2e9251e1a083dbe5ecd94aa7e5b26273 | 27.806452 | 99 | 0.74692 | 3.977728 | false | true | false | false |
TCA-Team/TumCampusApp | app/src/main/java/de/tum/in/tumcampusapp/component/tumui/roomfinder/WeekViewFragment.kt | 1 | 3203 | package de.tum.`in`.tumcampusapp.component.tumui.roomfinder
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.alamkanak.weekview.WeekView
import com.alamkanak.weekview.WeekViewDisplayable
import de.tum.`in`.tumcampusapp.R
import de.tum.`in`.tumcampusapp.api.app.TUMCabeClient
import de.tum.`in`.tumcampusapp.component.tumui.calendar.WidgetCalendarItem
import de.tum.`in`.tumcampusapp.utils.Const
import de.tum.`in`.tumcampusapp.utils.Utils
import org.joda.time.DateTime
import org.joda.time.format.DateTimeFormat
import java.util.*
class WeekViewFragment : Fragment() {
private var roomApiCode: String? = null
private lateinit var weekView: WeekView<WidgetCalendarItem>
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
roomApiCode = arguments?.getString(Const.ROOM_ID)
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? =
inflater.inflate(R.layout.fragment_day_view, container, false)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
weekView = view.findViewById(R.id.weekView)
weekView.goToHour(8)
}
private fun loadEventsInBackground(start: Calendar, end: Calendar) {
// Populate the week view with the events of the month to display
Thread {
val format = DateTimeFormat.forPattern("yyyyMMdd").withLocale(Locale.getDefault())
val formattedStartTime = format.print(DateTime(start))
val formattedEndTime = format.print(DateTime(end))
// Convert to the proper type
val events = fetchEventList(roomApiCode, formattedStartTime, formattedEndTime)
requireActivity().runOnUiThread {
weekView.submit(events)
weekView.notifyDataSetChanged()
}
}.start()
}
private fun fetchEventList(roomId: String?, startDate: String, endDate: String): List<WeekViewDisplayable<WidgetCalendarItem>> {
try {
val schedules = TUMCabeClient
.getInstance(requireActivity())
.fetchSchedule(roomId, startDate, endDate) ?: return emptyList()
// Convert to the proper type
val events = ArrayList<WeekViewDisplayable<WidgetCalendarItem>>()
for (schedule in schedules) {
val calendarItem = WidgetCalendarItem.create(schedule)
calendarItem.color = ContextCompat.getColor(requireContext(), R.color.event_lecture)
events.add(calendarItem)
}
return events
} catch (e: Exception) {
Utils.log(e)
}
return emptyList()
}
companion object {
fun newInstance(roomApiCode: String): WeekViewFragment {
val fragment = WeekViewFragment()
fragment.arguments = Bundle().apply { putString(Const.ROOM_ID, roomApiCode) }
return fragment
}
}
} | gpl-3.0 | 8b83df818fd05e949a9b25a12ad6071c | 34.6 | 132 | 0.67187 | 4.745185 | false | false | false | false |
HabitRPG/habitica-android | Habitica/src/main/java/com/habitrpg/android/habitica/ui/fragments/social/TavernFragment.kt | 1 | 4215 | package com.habitrpg.android.habitica.ui.fragments.social
import android.os.Bundle
import android.view.LayoutInflater
import android.view.Menu
import android.view.MenuInflater
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.google.android.material.tabs.TabLayoutMediator
import com.habitrpg.android.habitica.R
import com.habitrpg.android.habitica.components.UserComponent
import com.habitrpg.android.habitica.data.SocialRepository
import com.habitrpg.android.habitica.databinding.FragmentViewpagerBinding
import com.habitrpg.android.habitica.models.social.Group
import com.habitrpg.android.habitica.ui.fragments.BaseMainFragment
import com.habitrpg.android.habitica.ui.viewmodels.GroupViewModel
import com.habitrpg.android.habitica.ui.viewmodels.GroupViewType
import javax.inject.Inject
class TavernFragment : BaseMainFragment<FragmentViewpagerBinding>() {
@Inject
lateinit var socialRepository: SocialRepository
override var binding: FragmentViewpagerBinding? = null
override fun createBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentViewpagerBinding {
return FragmentViewpagerBinding.inflate(inflater, container, false)
}
internal val viewModel: GroupViewModel by viewModels()
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
this.usesTabLayout = true
this.hidesToolbar = true
this.tutorialStepIdentifier = "tavern"
this.tutorialTexts = listOf(getString(R.string.tutorial_tavern))
return super.onCreateView(inflater, container, savedInstanceState)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
viewModel.groupViewType = GroupViewType.GUILD
viewModel.setGroupID(Group.TAVERN_ID)
setViewPagerAdapter()
binding?.viewPager?.currentItem = 0
}
override fun onDestroy() {
socialRepository.close()
super.onDestroy()
}
override fun injectFragment(component: UserComponent) {
component.inject(this)
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
inflater.inflate(R.menu.menu_tavern, menu)
super.onCreateOptionsMenu(menu, inflater)
}
@Suppress("ReturnCount")
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.menu_guild_refresh -> {
viewModel.retrieveGroup { }
return true
}
}
return super.onOptionsItemSelected(item)
}
private fun setViewPagerAdapter() {
val fragmentManager = childFragmentManager
binding?.viewPager?.adapter = object : FragmentStateAdapter(fragmentManager, lifecycle) {
override fun createFragment(position: Int): Fragment {
return when (position) {
0 -> {
TavernDetailFragment()
}
1 -> {
ChatFragment(viewModel)
}
else -> Fragment()
}
}
override fun getItemCount(): Int {
return if (viewModel.getGroupData().value?.quest?.active == true) {
3
} else 2
}
}
tabLayout?.let {
binding?.viewPager?.let { it1 ->
TabLayoutMediator(it, it1) { tab, position ->
tab.text = when (position) {
0 -> context?.getString(R.string.inn)
1 -> context?.getString(R.string.chat)
2 -> context?.getString(R.string.world_quest)
else -> ""
}
}.attach()
}
}
}
}
| gpl-3.0 | ad7fd9e94886a5e2c08868163f507e9f | 33.420168 | 107 | 0.62325 | 5.190887 | false | false | false | false |
westnordost/StreetComplete | app/src/main/java/de/westnordost/streetcomplete/quests/handrail/AddHandrail.kt | 1 | 1597 | package de.westnordost.streetcomplete.quests.handrail
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.meta.updateWithCheckDate
import de.westnordost.streetcomplete.data.osm.osmquest.OsmFilterQuestType
import de.westnordost.streetcomplete.data.osm.changes.StringMapChangesBuilder
import de.westnordost.streetcomplete.ktx.toYesNo
import de.westnordost.streetcomplete.quests.YesNoQuestAnswerFragment
class AddHandrail : OsmFilterQuestType<Boolean>() {
override val elementFilter = """
ways with highway = steps
and (!indoor or indoor = no)
and access !~ private|no
and (!conveying or conveying = no)
and (
!handrail and !handrail:center and !handrail:left and !handrail:right
or handrail = no and handrail older today -4 years
or handrail older today -8 years
or older today -8 years
)
"""
override val commitMessage = "Add whether steps have a handrail"
override val wikiLink = "Key:handrail"
override val icon = R.drawable.ic_quest_steps_handrail
override fun getTitle(tags: Map<String, String>) = R.string.quest_handrail_title
override fun createForm() = YesNoQuestAnswerFragment()
override fun applyAnswerTo(answer: Boolean, changes: StringMapChangesBuilder) {
changes.updateWithCheckDate("handrail", answer.toYesNo())
if (!answer) {
changes.deleteIfExists("handrail:left")
changes.deleteIfExists("handrail:right")
changes.deleteIfExists("handrail:center")
}
}
}
| gpl-3.0 | 83e320192a2b04867db1bdd0aaf2490c | 37.95122 | 84 | 0.708203 | 4.697059 | false | false | false | false |
InsertKoinIO/koin | android/koin-android-compat/src/main/java/org/koin/android/compat/SharedViewModelCompat.kt | 1 | 2951 | /*
* Copyright 2017-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.koin.android.compat
import androidx.annotation.MainThread
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewmodel.CreationExtras
import org.koin.core.annotation.KoinInternalApi
import org.koin.core.context.GlobalContext
import org.koin.core.parameter.ParametersDefinition
import org.koin.core.qualifier.Qualifier
/**
* Functions to help shared view models in Java
*
* @author Jeziel Lago
*/
object SharedViewModelCompat {
/**
* Lazy getByClass a viewModel instance shared with Activity
*
* @param fragment - Fragment
* @param qualifier - Koin BeanDefinition qualifier (if have several ViewModel beanDefinition of the same type)
* @param from - ViewModelStoreOwner that will store the viewModel instance. Examples: "parentFragment", "activity". Default: "activity"
* @param parameters - parameters to pass to the BeanDefinition
* @param clazz
*/
@JvmOverloads
@JvmStatic
@MainThread
fun <T : ViewModel> sharedViewModel(
fragment: Fragment,
clazz: Class<T>,
qualifier: Qualifier? = null,
parameters: ParametersDefinition? = null,
): Lazy<T> = lazy(LazyThreadSafetyMode.NONE) { getSharedViewModel(fragment, clazz, qualifier, parameters) }
/**
* Get a shared viewModel instance from underlying Activity
*
* @param fragment - Fragment
* @param qualifier - Koin BeanDefinition qualifier (if have several ViewModel beanDefinition of the same type)
* @param from - ViewModelStoreOwner that will store the viewModel instance. Examples: ("parentFragment", "activity"). Default: "activity"
* @param parameters - parameters to pass to the BeanDefinition
* @param clazz
*/
@OptIn(KoinInternalApi::class)
@JvmOverloads
@MainThread
fun <T : ViewModel> getSharedViewModel(
fragment: Fragment,
clazz: Class<T>,
qualifier: Qualifier? = null,
parameters: ParametersDefinition? = null,
): T {
return resolveViewModelCompat(
clazz,
fragment.viewModelStore,
extras = CreationExtras.Empty,
qualifier = qualifier,
parameters = parameters,
scope = GlobalContext.get().scopeRegistry.rootScope
)
}
} | apache-2.0 | 2561fd6a8434279b3a2d931ae1850a6c | 35.9 | 142 | 0.702135 | 4.767367 | false | false | false | false |
StepicOrg/stepic-android | app/src/main/java/org/stepik/android/domain/course/analytic/CoursePreviewScreenOpenedAnalyticEvent.kt | 2 | 870 | package org.stepik.android.domain.course.analytic
import org.stepik.android.domain.base.analytic.AnalyticEvent
import org.stepik.android.model.Course
class CoursePreviewScreenOpenedAnalyticEvent(
course: Course,
source: CourseViewSource
) : AnalyticEvent {
companion object {
private const val PARAM_COURSE = "course"
private const val PARAM_TITLE = "title"
private const val PARAM_IS_PAID = "is_paid"
private const val PARAM_SOURCE = "source"
}
override val name: String =
"Course preview screen opened"
override val params: Map<String, Any> =
mapOf(
PARAM_COURSE to course.id,
PARAM_TITLE to course.title.toString(),
PARAM_IS_PAID to course.isPaid,
PARAM_SOURCE to source.name
) + source.params.mapKeys { "${PARAM_SOURCE}_${it.key}" }
} | apache-2.0 | 8ea0d11370498f81fac6216dbcdb0727 | 31.259259 | 65 | 0.66092 | 4.243902 | false | false | false | false |
Cognifide/APM | app/aem/core/src/main/kotlin/com/cognifide/apm/core/grammar/argument/ArgumentResolverException.kt | 1 | 955 | /*
* ========================LICENSE_START=================================
* AEM Permission Management
* %%
* Copyright (C) 2013 Wunderman Thompson Technology
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =========================LICENSE_END==================================
*/
package com.cognifide.apm.core.grammar.argument
class ArgumentResolverException(message: String) : RuntimeException(message)
| apache-2.0 | 2f585c49604972fd1659ecfff8e662f6 | 39.521739 | 76 | 0.637696 | 4.798995 | false | false | false | false |
sirixdb/sirix | bundles/sirix-kotlin-cli/src/main/kotlin/org/sirix/cli/commands/RevisionsHelper.kt | 1 | 3516 | package org.sirix.cli.commands
import org.sirix.api.NodeCursor
import org.sirix.api.NodeReadOnlyTrx
import org.sirix.api.NodeTrx
import org.sirix.api.ResourceSession
import java.time.LocalDateTime
import java.time.ZoneId
class RevisionsHelper {
companion object {
fun <R, W> getRevisionsToSerialize(
startRevision: Int?, endRevision: Int?, startRevisionTimestamp: LocalDateTime?,
endRevisionTimestamp: LocalDateTime?, manager: ResourceSession<R, W>, revision: Int?,
revisionTimestamp: LocalDateTime?
): Array<Int>
where R : NodeReadOnlyTrx,
R : NodeCursor,
W : NodeTrx,
W : NodeCursor {
return when {
startRevision != null && endRevision != null -> (startRevision..endRevision).toSet().toTypedArray()
startRevisionTimestamp != null && endRevisionTimestamp != null -> {
val tspRevisions = Pair(startRevisionTimestamp, endRevisionTimestamp)
getRevisionNumbers(
manager,
tspRevisions
).toList().toTypedArray()
}
else -> getRevisionNumber(
revision,
revisionTimestamp,
manager
)
}
}
fun <R, W> getRevisionNumber(
rev: Int?,
revTimestamp: LocalDateTime?,
manager: ResourceSession<R, W>
): Array<Int>
where R : NodeReadOnlyTrx,
R : NodeCursor,
W : NodeTrx,
W : NodeCursor {
return if (rev != null) {
arrayOf(rev.toInt())
} else if (revTimestamp != null) {
var revision = getRevisionNumber(
manager,
revTimestamp
)
if (revision == 0)
arrayOf(++revision)
else
arrayOf(revision)
} else {
arrayOf(manager.mostRecentRevisionNumber)
}
}
private fun <R, W> getRevisionNumber(manager: ResourceSession<R, W>, revision: LocalDateTime): Int
where R : NodeReadOnlyTrx,
R : NodeCursor,
W : NodeTrx,
W : NodeCursor {
val zdt = revision.atZone(ZoneId.systemDefault())
return manager.getRevisionNumber(zdt.toInstant())
}
private fun <R, W> getRevisionNumbers(
manager: ResourceSession<R, W>,
revisions: Pair<LocalDateTime, LocalDateTime>
): Array<Int>
where R : NodeReadOnlyTrx,
R : NodeCursor,
W : NodeTrx,
W : NodeCursor {
val zdtFirstRevision = revisions.first.atZone(ZoneId.systemDefault())
val zdtLastRevision = revisions.second.atZone(ZoneId.systemDefault())
var firstRevisionNumber = manager.getRevisionNumber(zdtFirstRevision.toInstant())
var lastRevisionNumber = manager.getRevisionNumber(zdtLastRevision.toInstant())
if (firstRevisionNumber == 0) ++firstRevisionNumber
if (lastRevisionNumber == 0) ++lastRevisionNumber
return (firstRevisionNumber..lastRevisionNumber).toSet().toTypedArray()
}
}
}
| bsd-3-clause | 9ffd5f74e9c8406fe57a07d6d7d23de2 | 37.637363 | 115 | 0.527304 | 5.49375 | false | false | false | false |
DanilaFe/abacus | core/src/main/kotlin/org/nwapw/abacus/number/promotion/PromotionManager.kt | 1 | 3308 | package org.nwapw.abacus.number.promotion
import org.nwapw.abacus.Abacus
import org.nwapw.abacus.exception.PromotionException
import org.nwapw.abacus.number.NumberInterface
import org.nwapw.abacus.plugin.NumberImplementation
import org.nwapw.abacus.plugin.PluginListener
import org.nwapw.abacus.plugin.PluginManager
/**
* A class that handles promotions based on priority and the
* transition paths each implementation provides.
*
* @property abacus the Abacus instance to use to access other components.
*/
class PromotionManager(val abacus: Abacus) : PluginListener {
/**
* The already computed paths
*/
val computePaths = mutableMapOf<Pair<NumberImplementation, NumberImplementation>, PromotionPath?>()
/**
* Computes a path between a starting and an ending implementation.
*
* @param from the implementation to start from.
* @param to the implementation to get to.
* @return the resulting promotion path, or null if it is not found
*/
fun computePathBetween(from: NumberImplementation, to: NumberImplementation): PromotionPath? {
val fromName = abacus.pluginManager.interfaceImplementationNameFor(from.implementation)
val toName = abacus.pluginManager.interfaceImplementationNameFor(to.implementation)
if(fromName == toName) return listOf(object : PromotionFunction {
override fun promote(number: NumberInterface): NumberInterface {
return number
}
})
if(from.promotionPaths.containsKey(toName))
return listOf(from.promotionPaths[toName] ?: return null)
return null
}
/**
* Promote all the numbers in the list to the same number implementation, to ensure
* they can be used with each other. Finds the highest priority implementation
* in the list, and promotes all other numbers to it.
*
* @param numbers the numbers to promote.
* @return the resulting promotion result.
*/
fun promote(vararg numbers: NumberInterface): PromotionResult {
val pluginManager = abacus.pluginManager
val implementations = numbers.map { pluginManager.interfaceImplementationFor(it.javaClass) }
val highestPriority = implementations.sortedBy { it.priority }.last()
return PromotionResult(items = numbers.map {
if (it.javaClass == highestPriority.implementation) it
else computePaths[pluginManager.interfaceImplementationFor(it.javaClass) to highestPriority]
?.promote(it) ?: throw PromotionException()
}.toTypedArray(), promotedTo = highestPriority)
}
override fun onLoad(manager: PluginManager) {
val implementations = manager.allNumberImplementations.map { manager.numberImplementationFor(it) }
for(first in implementations) {
for(second in implementations) {
val promoteFrom = if(second.priority > first.priority) first else second
val promoteTo = if(second.priority > first.priority) second else first
val path = computePathBetween(promoteFrom, promoteTo)
computePaths[promoteFrom to promoteTo] = path
}
}
}
override fun onUnload(manager: PluginManager) {
computePaths.clear()
}
} | mit | 0810db272d76d72daeaaac242ad84dcf | 39.851852 | 106 | 0.696796 | 4.678925 | false | false | false | false |
wordpress-mobile/WordPress-Android | WordPress/src/main/java/org/wordpress/android/ui/activitylog/detail/ActivityLogDetailFragment.kt | 1 | 11661 | package org.wordpress.android.ui.activitylog.detail
import android.content.Intent
import android.os.Bundle
import android.text.SpannableString
import android.text.method.LinkMovementMethod
import android.view.View
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.viewModels
import dagger.hilt.android.AndroidEntryPoint
import org.wordpress.android.R
import org.wordpress.android.WordPress
import org.wordpress.android.databinding.ActivityLogItemDetailBinding
import org.wordpress.android.fluxc.model.SiteModel
import org.wordpress.android.ui.ActivityLauncher
import org.wordpress.android.ui.ActivityLauncher.SOURCE_TRACK_EVENT_PROPERTY_KEY
import org.wordpress.android.ui.RequestCodes
import org.wordpress.android.ui.activitylog.detail.ActivityLogDetailNavigationEvents.ShowBackupDownload
import org.wordpress.android.ui.activitylog.detail.ActivityLogDetailNavigationEvents.ShowDocumentationPage
import org.wordpress.android.ui.activitylog.detail.ActivityLogDetailNavigationEvents.ShowRestore
import org.wordpress.android.ui.mysite.jetpackbadge.JetpackPoweredBottomSheetFragment
import org.wordpress.android.ui.notifications.blocks.NoteBlockClickableSpan
import org.wordpress.android.ui.notifications.utils.FormattableContentClickHandler
import org.wordpress.android.ui.notifications.utils.NotificationsUtilsWrapper
import org.wordpress.android.ui.reader.tracker.ReaderTracker
import org.wordpress.android.ui.utils.UiHelpers
import org.wordpress.android.util.JetpackBrandingUtils
import org.wordpress.android.util.JetpackBrandingUtils.Screen.ACTIVITY_LOG_DETAIL
import org.wordpress.android.util.image.ImageManager
import org.wordpress.android.util.image.ImageType.AVATAR_WITH_BACKGROUND
import org.wordpress.android.viewmodel.activitylog.ACTIVITY_LOG_ARE_BUTTONS_VISIBLE_KEY
import org.wordpress.android.viewmodel.activitylog.ACTIVITY_LOG_ID_KEY
import org.wordpress.android.viewmodel.activitylog.ACTIVITY_LOG_IS_RESTORE_HIDDEN_KEY
import org.wordpress.android.viewmodel.activitylog.ActivityLogDetailViewModel
import org.wordpress.android.viewmodel.observeEvent
import javax.inject.Inject
private const val DETAIL_TRACKING_SOURCE = "detail"
private const val FORWARD_SLASH = "/"
@AndroidEntryPoint
class ActivityLogDetailFragment : Fragment(R.layout.activity_log_item_detail) {
@Inject lateinit var imageManager: ImageManager
@Inject lateinit var notificationsUtilsWrapper: NotificationsUtilsWrapper
@Inject lateinit var formattableContentClickHandler: FormattableContentClickHandler
@Inject lateinit var uiHelpers: UiHelpers
@Inject lateinit var jetpackBrandingUtils: JetpackBrandingUtils
private val viewModel: ActivityLogDetailViewModel by viewModels()
companion object {
fun newInstance(): ActivityLogDetailFragment {
return ActivityLogDetailFragment()
}
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
with(ActivityLogItemDetailBinding.bind(view)) {
setupViews(savedInstanceState)
setupObservers()
}
}
private fun ActivityLogItemDetailBinding.setupViews(savedInstanceState: Bundle?) {
activity?.let { activity ->
val (site, activityLogId) = sideAndActivityId(savedInstanceState, activity.intent)
val areButtonsVisible = areButtonsVisible(savedInstanceState, activity.intent)
val isRestoreHidden = isRestoreHidden(savedInstanceState, activity.intent)
viewModel.start(site, activityLogId, areButtonsVisible, isRestoreHidden)
}
if (jetpackBrandingUtils.shouldShowJetpackBranding()) {
jetpackBadge.root.isVisible = true
if (jetpackBrandingUtils.shouldShowJetpackPoweredBottomSheet()) {
jetpackBadge.jetpackPoweredBadge.setOnClickListener {
jetpackBrandingUtils.trackBadgeTapped(ACTIVITY_LOG_DETAIL)
viewModel.showJetpackPoweredBottomSheet()
}
}
}
}
private fun ActivityLogItemDetailBinding.setupObservers() {
viewModel.activityLogItem.observe(viewLifecycleOwner, { activityLogModel ->
loadLogItem(activityLogModel, requireActivity())
})
viewModel.restoreVisible.observe(viewLifecycleOwner, { available ->
activityRestoreButton.visibility = if (available == true) View.VISIBLE else View.GONE
})
viewModel.downloadBackupVisible.observe(viewLifecycleOwner, { available ->
activityDownloadBackupButton.visibility = if (available == true) View.VISIBLE else View.GONE
})
viewModel.multisiteVisible.observe(viewLifecycleOwner, { available ->
checkAndShowMultisiteMessage(available)
})
viewModel.navigationEvents.observeEvent(viewLifecycleOwner, {
when (it) {
is ShowBackupDownload -> ActivityLauncher.showBackupDownloadForResult(
requireActivity(),
viewModel.site,
it.model.activityID,
RequestCodes.BACKUP_DOWNLOAD,
buildTrackingSource()
)
is ShowRestore -> ActivityLauncher.showRestoreForResult(
requireActivity(),
viewModel.site,
it.model.activityID,
RequestCodes.RESTORE,
buildTrackingSource()
)
is ShowDocumentationPage -> ActivityLauncher.openUrlExternal(requireContext(), it.url)
}
})
viewModel.handleFormattableRangeClick.observe(viewLifecycleOwner, { range ->
if (range != null) {
formattableContentClickHandler.onClick(
requireActivity(),
range,
ReaderTracker.SOURCE_ACTIVITY_LOG_DETAIL
)
}
})
viewModel.showJetpackPoweredBottomSheet.observeEvent(viewLifecycleOwner) {
JetpackPoweredBottomSheetFragment
.newInstance()
.show(childFragmentManager, JetpackPoweredBottomSheetFragment.TAG)
}
}
private fun ActivityLogItemDetailBinding.checkAndShowMultisiteMessage(available: Pair<Boolean, SpannableString?>) {
if (available.first) {
with(multisiteMessage) {
linksClickable = true
isClickable = true
movementMethod = LinkMovementMethod.getInstance()
text = available.second
visibility = View.VISIBLE
}
} else {
multisiteMessage.visibility = View.GONE
}
}
private fun ActivityLogItemDetailBinding.loadLogItem(
activityLogModel: ActivityLogDetailModel?,
activity: FragmentActivity
) {
setActorIcon(activityLogModel?.actorIconUrl, activityLogModel?.showJetpackIcon)
uiHelpers.setTextOrHide(activityActorName, activityLogModel?.actorName)
uiHelpers.setTextOrHide(activityActorRole, activityLogModel?.actorRole)
val spannable = activityLogModel?.content?.let {
notificationsUtilsWrapper.getSpannableContentForRanges(
it,
activityMessage,
{ range ->
viewModel.onRangeClicked(range)
},
false
)
}
val noteBlockSpans = spannable?.getSpans(
0,
spannable.length,
NoteBlockClickableSpan::class.java
)
noteBlockSpans?.forEach {
it.enableColors(activity)
}
uiHelpers.setTextOrHide(activityMessage, spannable)
uiHelpers.setTextOrHide(activityType, activityLogModel?.summary)
activityCreatedDate.text = activityLogModel?.createdDate
activityCreatedTime.text = activityLogModel?.createdTime
if (activityLogModel != null) {
activityRestoreButton.setOnClickListener {
viewModel.onRestoreClicked(activityLogModel)
}
activityDownloadBackupButton.setOnClickListener {
viewModel.onDownloadBackupClicked(activityLogModel)
}
}
}
private fun sideAndActivityId(savedInstanceState: Bundle?, intent: Intent?) = when {
savedInstanceState != null -> {
val site = savedInstanceState.getSerializable(WordPress.SITE) as SiteModel
val activityLogId = requireNotNull(
savedInstanceState.getString(
ACTIVITY_LOG_ID_KEY
)
)
site to activityLogId
}
intent != null -> {
val site = intent.getSerializableExtra(WordPress.SITE) as SiteModel
val activityLogId = intent.getStringExtra(ACTIVITY_LOG_ID_KEY) as String
site to activityLogId
}
else -> throw Throwable("Couldn't initialize Activity Log view model")
}
private fun areButtonsVisible(savedInstanceState: Bundle?, intent: Intent?) = when {
savedInstanceState != null ->
requireNotNull(savedInstanceState.getBoolean(ACTIVITY_LOG_ARE_BUTTONS_VISIBLE_KEY, true))
intent != null ->
intent.getBooleanExtra(ACTIVITY_LOG_ARE_BUTTONS_VISIBLE_KEY, true)
else -> throw Throwable("Couldn't initialize Activity Log view model")
}
private fun isRestoreHidden(savedInstanceState: Bundle?, intent: Intent?) = when {
savedInstanceState != null ->
requireNotNull(savedInstanceState.getBoolean(ACTIVITY_LOG_IS_RESTORE_HIDDEN_KEY, false))
intent != null ->
intent.getBooleanExtra(ACTIVITY_LOG_IS_RESTORE_HIDDEN_KEY, false)
else -> throw Throwable("Couldn't initialize Activity Log view model")
}
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
outState.putSerializable(WordPress.SITE, viewModel.site)
outState.putString(ACTIVITY_LOG_ID_KEY, viewModel.activityLogId)
outState.putBoolean(ACTIVITY_LOG_ARE_BUTTONS_VISIBLE_KEY, viewModel.areButtonsVisible)
outState.putBoolean(ACTIVITY_LOG_IS_RESTORE_HIDDEN_KEY, viewModel.isRestoreHidden)
}
private fun ActivityLogItemDetailBinding.setActorIcon(actorIcon: String?, showJetpackIcon: Boolean?) {
when {
actorIcon != null && actorIcon != "" -> {
imageManager.loadIntoCircle(activityActorIcon, AVATAR_WITH_BACKGROUND, actorIcon)
activityActorIcon.visibility = View.VISIBLE
activityJetpackActorIcon.visibility = View.GONE
}
showJetpackIcon == true -> {
activityJetpackActorIcon.visibility = View.VISIBLE
activityActorIcon.visibility = View.GONE
}
else -> {
imageManager.cancelRequestAndClearImageView(activityActorIcon)
activityActorIcon.visibility = View.GONE
activityJetpackActorIcon.visibility = View.GONE
}
}
}
private fun buildTrackingSource() = requireActivity().intent?.extras?.let {
val source = it.getString(SOURCE_TRACK_EVENT_PROPERTY_KEY)
when {
source != null -> source + FORWARD_SLASH + DETAIL_TRACKING_SOURCE
else -> DETAIL_TRACKING_SOURCE
}
}
}
| gpl-2.0 | 3977e082f46ac5f806dc0202d69dc4e6 | 42.838346 | 119 | 0.6767 | 5.487529 | false | false | false | false |
benjamin-bader/thrifty | thrifty-schema/src/main/kotlin/com/microsoft/thrifty/schema/Program.kt | 1 | 7059 | /*
* Thrifty
*
* Copyright (c) Microsoft Corporation
*
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
* WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE,
* FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT.
*
* See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.
*/
package com.microsoft.thrifty.schema
import com.microsoft.thrifty.schema.parser.ThriftFileElement
/**
* A Program is the set of elements declared in a Thrift file. It
* contains all types, namespaces, constants, and inclusions defined therein.
*/
class Program internal constructor(element: ThriftFileElement) {
/**
* All namespaces defined for this [Program].
*/
val namespaces: Map<NamespaceScope, String> = element.namespaces
.map { it.scope to it.namespace }
.toMap()
/**
* All `cpp_include` statements in this [Program].
*/
val cppIncludes: List<String> = element.includes
.filter { it.isCpp }
.map { it.path }
private val thriftIncludes: List<String> = element.includes
.filter { !it.isCpp }
.map { it.path }
/**
* All [constants][Constant] contained within this [Program]
*/
val constants: List<Constant> = element.constants.map { Constant(it, namespaces) }
/**
* All [enums][EnumType] contained within this [Program].
*/
val enums: List<EnumType> = element.enums.map { EnumType(it, namespaces) }
/**
* All [structs][StructType] contained within this [Program].
*/
val structs: List<StructType> = element.structs.map { StructType(it, namespaces) }
/**
* All [unions][StructType] contained within this [Program].
*/
val unions: List<StructType> = element.unions.map { StructType(it, namespaces) }
/**
* All [exceptions][StructType] contained within this [Program].
*/
val exceptions: List<StructType> = element.exceptions.map { StructType(it, namespaces) }
/**
* All [typedefs][TypedefType] contained within this [Program].
*/
val typedefs: List<TypedefType> = element.typedefs.map { TypedefType(it, namespaces) }
/**
* All [services][ServiceType] contained within this [Program].
*/
val services: List<ServiceType> = element.services.map { ServiceType(it, namespaces) }
/**
* The location of this [Program], possibly relative (if it was loaded from the search path).
*/
val location: Location = element.location
private var includedPrograms: List<Program>? = null
private var constSymbols: Map<String, Constant>? = null
/**
* All other [programs][Program] included by this [Program].
*/
val includes: List<Program>
get() = includedPrograms ?: emptyList()
/**
* A map of constants in this program indexed by name.
*/
val constantMap: Map<String, Constant>
get() = constSymbols ?: emptyMap()
/**
* Get all named types declared in this Program.
*
* Note that this does not include [constants], which are
* not types.
*
* @return all user-defined types contained in this Program.
*/
fun allUserTypes(): Iterable<UserType> {
return listOf(enums, structs, unions, exceptions, services, typedefs)
.flatMapTo(mutableListOf()) { it }
}
/**
* Loads this program's symbol table and list of included Programs.
* @param loader
* @param visited A [MutableMap] used to track a parent [Program], if it was visited from one.
* @param parent The parent [Program] that is including this [Program],
* `null` if this [Program] is not being loaded from another [Program].
*/
internal fun loadIncludedPrograms(loader: Loader, visited: MutableMap<Program, Program?>, parent: Program?) {
if (visited.containsKey(this)) {
if (includedPrograms == null) {
val includeChain = StringBuilder(this.location.programName);
var current: Program? = parent
while (current != null) {
includeChain.append(" -> ")
includeChain.append(current.location.programName)
if (current == this) {
break
}
current = visited[current]
}
loader.errorReporter().error(location, "Circular include; file includes itself transitively $includeChain")
throw IllegalStateException("Circular include: " + location.path
+ " includes itself transitively " + includeChain)
}
return
}
visited[this] = parent
check(this.includedPrograms == null) { "Included programs already resolved" }
val includes = mutableListOf<Program>()
for (thriftImport in thriftIncludes) {
val included = loader.resolveIncludedProgram(location, thriftImport)
included.loadIncludedPrograms(loader, visited, this)
includes.add(included)
}
this.includedPrograms = includes
val symbolMap = mutableMapOf<String, UserType>()
for (userType in allUserTypes()) {
val oldValue = symbolMap.put(userType.name, userType)
if (oldValue != null) {
reportDuplicateSymbol(loader.errorReporter(), oldValue, userType)
}
}
val constSymbolMap = mutableMapOf<String, Constant>()
for (constant in constants) {
val oldValue = constSymbolMap.put(constant.name, constant)
if (oldValue != null) {
reportDuplicateSymbol(loader.errorReporter(), oldValue, constant)
}
}
this.constSymbols = constSymbolMap
}
private fun reportDuplicateSymbol(
reporter: ErrorReporter,
oldValue: UserElement,
newValue: UserElement) {
val message = "Duplicate symbols: ${oldValue.name} defined at ${oldValue.location} and at ${newValue.location}"
reporter.error(newValue.location, message)
}
/** @inheritdoc */
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is Program) return false
// Programs are considered equal if they are derived from the same file.
return location.base == other.location.base && location.path == other.location.path
}
/** @inheritdoc */
override fun hashCode(): Int {
var result = location.base.hashCode()
result = 31 * result + location.path.hashCode()
return result
}
}
| apache-2.0 | 9019dec8db65789b53e2154932bb091c | 34.651515 | 123 | 0.624734 | 4.586745 | false | false | false | false |
mdaniel/intellij-community | platform/workspaceModel/storage/src/com/intellij/workspaceModel/storage/bridgeEntities/api/artifact.kt | 1 | 24384 | // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.workspaceModel.storage.bridgeEntities.api
import com.intellij.workspaceModel.storage.*
import com.intellij.workspaceModel.storage.url.VirtualFileUrl
import org.jetbrains.deft.ObjBuilder
import org.jetbrains.deft.Type
import org.jetbrains.deft.annotations.Abstract
import org.jetbrains.deft.annotations.Child
import com.intellij.workspaceModel.storage.EntitySource
import com.intellij.workspaceModel.storage.GeneratedCodeApiVersion
import com.intellij.workspaceModel.storage.ModifiableWorkspaceEntity
import com.intellij.workspaceModel.storage.MutableEntityStorage
interface ArtifactEntity : WorkspaceEntityWithPersistentId {
val name: String
val artifactType: String
val includeInProjectBuild: Boolean
val outputUrl: VirtualFileUrl?
@Child val rootElement: CompositePackagingElementEntity
val customProperties: List<@Child ArtifactPropertiesEntity>
@Child val artifactOutputPackagingElement: ArtifactOutputPackagingElementEntity?
override val persistentId: ArtifactId
get() = ArtifactId(name)
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: ArtifactEntity, ModifiableWorkspaceEntity<ArtifactEntity>, ObjBuilder<ArtifactEntity> {
override var name: String
override var entitySource: EntitySource
override var artifactType: String
override var includeInProjectBuild: Boolean
override var outputUrl: VirtualFileUrl?
override var rootElement: CompositePackagingElementEntity
override var customProperties: List<ArtifactPropertiesEntity>
override var artifactOutputPackagingElement: ArtifactOutputPackagingElementEntity?
}
companion object: Type<ArtifactEntity, Builder>() {
operator fun invoke(name: String, artifactType: String, includeInProjectBuild: Boolean, entitySource: EntitySource, init: (Builder.() -> Unit)? = null): ArtifactEntity {
val builder = builder()
builder.name = name
builder.entitySource = entitySource
builder.artifactType = artifactType
builder.includeInProjectBuild = includeInProjectBuild
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: ArtifactEntity, modification: ArtifactEntity.Builder.() -> Unit) = modifyEntity(ArtifactEntity.Builder::class.java, entity, modification)
var ArtifactEntity.Builder.artifactExternalSystemIdEntity: @Child ArtifactExternalSystemIdEntity?
by WorkspaceEntity.extension()
//endregion
interface ArtifactPropertiesEntity : WorkspaceEntity {
val artifact: ArtifactEntity
val providerType: String
val propertiesXmlTag: String?
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: ArtifactPropertiesEntity, ModifiableWorkspaceEntity<ArtifactPropertiesEntity>, ObjBuilder<ArtifactPropertiesEntity> {
override var artifact: ArtifactEntity
override var entitySource: EntitySource
override var providerType: String
override var propertiesXmlTag: String?
}
companion object: Type<ArtifactPropertiesEntity, Builder>() {
operator fun invoke(providerType: String, entitySource: EntitySource, init: (Builder.() -> Unit)? = null): ArtifactPropertiesEntity {
val builder = builder()
builder.entitySource = entitySource
builder.providerType = providerType
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: ArtifactPropertiesEntity, modification: ArtifactPropertiesEntity.Builder.() -> Unit) = modifyEntity(ArtifactPropertiesEntity.Builder::class.java, entity, modification)
//endregion
@Abstract interface PackagingElementEntity : WorkspaceEntity {
val parentEntity: CompositePackagingElementEntity?
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder<T: PackagingElementEntity>: PackagingElementEntity, ModifiableWorkspaceEntity<T>, ObjBuilder<T> {
override var parentEntity: CompositePackagingElementEntity?
override var entitySource: EntitySource
}
companion object: Type<PackagingElementEntity, Builder<PackagingElementEntity>>() {
operator fun invoke(entitySource: EntitySource, init: (Builder<PackagingElementEntity>.() -> Unit)? = null): PackagingElementEntity {
val builder = builder()
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
@Abstract interface CompositePackagingElementEntity : PackagingElementEntity {
val artifact: ArtifactEntity?
val children: List<@Child PackagingElementEntity>
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder<T: CompositePackagingElementEntity>: CompositePackagingElementEntity, PackagingElementEntity.Builder<T>, ModifiableWorkspaceEntity<T>, ObjBuilder<T> {
override var parentEntity: CompositePackagingElementEntity?
override var artifact: ArtifactEntity?
override var entitySource: EntitySource
override var children: List<PackagingElementEntity>
}
companion object: Type<CompositePackagingElementEntity, Builder<CompositePackagingElementEntity>>(PackagingElementEntity) {
operator fun invoke(entitySource: EntitySource, init: (Builder<CompositePackagingElementEntity>.() -> Unit)? = null): CompositePackagingElementEntity {
val builder = builder()
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
interface DirectoryPackagingElementEntity: CompositePackagingElementEntity {
val directoryName: String
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: DirectoryPackagingElementEntity, CompositePackagingElementEntity.Builder<DirectoryPackagingElementEntity>, ModifiableWorkspaceEntity<DirectoryPackagingElementEntity>, ObjBuilder<DirectoryPackagingElementEntity> {
override var parentEntity: CompositePackagingElementEntity?
override var artifact: ArtifactEntity?
override var children: List<PackagingElementEntity>
override var directoryName: String
override var entitySource: EntitySource
}
companion object: Type<DirectoryPackagingElementEntity, Builder>(CompositePackagingElementEntity) {
operator fun invoke(directoryName: String, entitySource: EntitySource, init: (Builder.() -> Unit)? = null): DirectoryPackagingElementEntity {
val builder = builder()
builder.directoryName = directoryName
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: DirectoryPackagingElementEntity, modification: DirectoryPackagingElementEntity.Builder.() -> Unit) = modifyEntity(DirectoryPackagingElementEntity.Builder::class.java, entity, modification)
//endregion
interface ArchivePackagingElementEntity: CompositePackagingElementEntity {
val fileName: String
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: ArchivePackagingElementEntity, CompositePackagingElementEntity.Builder<ArchivePackagingElementEntity>, ModifiableWorkspaceEntity<ArchivePackagingElementEntity>, ObjBuilder<ArchivePackagingElementEntity> {
override var parentEntity: CompositePackagingElementEntity?
override var artifact: ArtifactEntity?
override var children: List<PackagingElementEntity>
override var fileName: String
override var entitySource: EntitySource
}
companion object: Type<ArchivePackagingElementEntity, Builder>(CompositePackagingElementEntity) {
operator fun invoke(fileName: String, entitySource: EntitySource, init: (Builder.() -> Unit)? = null): ArchivePackagingElementEntity {
val builder = builder()
builder.fileName = fileName
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: ArchivePackagingElementEntity, modification: ArchivePackagingElementEntity.Builder.() -> Unit) = modifyEntity(ArchivePackagingElementEntity.Builder::class.java, entity, modification)
//endregion
interface ArtifactRootElementEntity: CompositePackagingElementEntity {
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: ArtifactRootElementEntity, CompositePackagingElementEntity.Builder<ArtifactRootElementEntity>, ModifiableWorkspaceEntity<ArtifactRootElementEntity>, ObjBuilder<ArtifactRootElementEntity> {
override var parentEntity: CompositePackagingElementEntity?
override var artifact: ArtifactEntity?
override var entitySource: EntitySource
override var children: List<PackagingElementEntity>
}
companion object: Type<ArtifactRootElementEntity, Builder>(CompositePackagingElementEntity) {
operator fun invoke(entitySource: EntitySource, init: (Builder.() -> Unit)? = null): ArtifactRootElementEntity {
val builder = builder()
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: ArtifactRootElementEntity, modification: ArtifactRootElementEntity.Builder.() -> Unit) = modifyEntity(ArtifactRootElementEntity.Builder::class.java, entity, modification)
//endregion
interface ArtifactOutputPackagingElementEntity: PackagingElementEntity {
val artifact: ArtifactId?
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: ArtifactOutputPackagingElementEntity, PackagingElementEntity.Builder<ArtifactOutputPackagingElementEntity>, ModifiableWorkspaceEntity<ArtifactOutputPackagingElementEntity>, ObjBuilder<ArtifactOutputPackagingElementEntity> {
override var parentEntity: CompositePackagingElementEntity?
override var artifact: ArtifactId?
override var entitySource: EntitySource
}
companion object: Type<ArtifactOutputPackagingElementEntity, Builder>(PackagingElementEntity) {
operator fun invoke(entitySource: EntitySource, init: (Builder.() -> Unit)? = null): ArtifactOutputPackagingElementEntity {
val builder = builder()
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: ArtifactOutputPackagingElementEntity, modification: ArtifactOutputPackagingElementEntity.Builder.() -> Unit) = modifyEntity(ArtifactOutputPackagingElementEntity.Builder::class.java, entity, modification)
var ArtifactOutputPackagingElementEntity.Builder.artifactEntity: ArtifactEntity
by WorkspaceEntity.extension()
//endregion
val ArtifactOutputPackagingElementEntity.artifactEntity: ArtifactEntity
by WorkspaceEntity.extension()
interface ModuleOutputPackagingElementEntity : PackagingElementEntity {
val module: ModuleId?
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: ModuleOutputPackagingElementEntity, PackagingElementEntity.Builder<ModuleOutputPackagingElementEntity>, ModifiableWorkspaceEntity<ModuleOutputPackagingElementEntity>, ObjBuilder<ModuleOutputPackagingElementEntity> {
override var parentEntity: CompositePackagingElementEntity?
override var module: ModuleId?
override var entitySource: EntitySource
}
companion object: Type<ModuleOutputPackagingElementEntity, Builder>(PackagingElementEntity) {
operator fun invoke(entitySource: EntitySource, init: (Builder.() -> Unit)? = null): ModuleOutputPackagingElementEntity {
val builder = builder()
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: ModuleOutputPackagingElementEntity, modification: ModuleOutputPackagingElementEntity.Builder.() -> Unit) = modifyEntity(ModuleOutputPackagingElementEntity.Builder::class.java, entity, modification)
//endregion
interface LibraryFilesPackagingElementEntity : PackagingElementEntity {
val library: LibraryId?
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: LibraryFilesPackagingElementEntity, PackagingElementEntity.Builder<LibraryFilesPackagingElementEntity>, ModifiableWorkspaceEntity<LibraryFilesPackagingElementEntity>, ObjBuilder<LibraryFilesPackagingElementEntity> {
override var parentEntity: CompositePackagingElementEntity?
override var library: LibraryId?
override var entitySource: EntitySource
}
companion object: Type<LibraryFilesPackagingElementEntity, Builder>(PackagingElementEntity) {
operator fun invoke(entitySource: EntitySource, init: (Builder.() -> Unit)? = null): LibraryFilesPackagingElementEntity {
val builder = builder()
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: LibraryFilesPackagingElementEntity, modification: LibraryFilesPackagingElementEntity.Builder.() -> Unit) = modifyEntity(LibraryFilesPackagingElementEntity.Builder::class.java, entity, modification)
var LibraryFilesPackagingElementEntity.Builder.libraryEntity: LibraryEntity
by WorkspaceEntity.extension()
//endregion
val LibraryFilesPackagingElementEntity.libraryEntity: LibraryEntity
by WorkspaceEntity.extension()
interface ModuleSourcePackagingElementEntity : PackagingElementEntity {
val module: ModuleId?
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: ModuleSourcePackagingElementEntity, PackagingElementEntity.Builder<ModuleSourcePackagingElementEntity>, ModifiableWorkspaceEntity<ModuleSourcePackagingElementEntity>, ObjBuilder<ModuleSourcePackagingElementEntity> {
override var parentEntity: CompositePackagingElementEntity?
override var module: ModuleId?
override var entitySource: EntitySource
}
companion object: Type<ModuleSourcePackagingElementEntity, Builder>(PackagingElementEntity) {
operator fun invoke(entitySource: EntitySource, init: (Builder.() -> Unit)? = null): ModuleSourcePackagingElementEntity {
val builder = builder()
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: ModuleSourcePackagingElementEntity, modification: ModuleSourcePackagingElementEntity.Builder.() -> Unit) = modifyEntity(ModuleSourcePackagingElementEntity.Builder::class.java, entity, modification)
//endregion
interface ModuleTestOutputPackagingElementEntity : PackagingElementEntity {
val module: ModuleId?
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: ModuleTestOutputPackagingElementEntity, PackagingElementEntity.Builder<ModuleTestOutputPackagingElementEntity>, ModifiableWorkspaceEntity<ModuleTestOutputPackagingElementEntity>, ObjBuilder<ModuleTestOutputPackagingElementEntity> {
override var parentEntity: CompositePackagingElementEntity?
override var module: ModuleId?
override var entitySource: EntitySource
}
companion object: Type<ModuleTestOutputPackagingElementEntity, Builder>(PackagingElementEntity) {
operator fun invoke(entitySource: EntitySource, init: (Builder.() -> Unit)? = null): ModuleTestOutputPackagingElementEntity {
val builder = builder()
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: ModuleTestOutputPackagingElementEntity, modification: ModuleTestOutputPackagingElementEntity.Builder.() -> Unit) = modifyEntity(ModuleTestOutputPackagingElementEntity.Builder::class.java, entity, modification)
//endregion
@Abstract interface FileOrDirectoryPackagingElementEntity : PackagingElementEntity {
val filePath: VirtualFileUrl
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder<T: FileOrDirectoryPackagingElementEntity>: FileOrDirectoryPackagingElementEntity, PackagingElementEntity.Builder<T>, ModifiableWorkspaceEntity<T>, ObjBuilder<T> {
override var parentEntity: CompositePackagingElementEntity?
override var filePath: VirtualFileUrl
override var entitySource: EntitySource
}
companion object: Type<FileOrDirectoryPackagingElementEntity, Builder<FileOrDirectoryPackagingElementEntity>>(PackagingElementEntity) {
operator fun invoke(filePath: VirtualFileUrl, entitySource: EntitySource, init: (Builder<FileOrDirectoryPackagingElementEntity>.() -> Unit)? = null): FileOrDirectoryPackagingElementEntity {
val builder = builder()
builder.filePath = filePath
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
interface DirectoryCopyPackagingElementEntity : FileOrDirectoryPackagingElementEntity {
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: DirectoryCopyPackagingElementEntity, FileOrDirectoryPackagingElementEntity.Builder<DirectoryCopyPackagingElementEntity>, ModifiableWorkspaceEntity<DirectoryCopyPackagingElementEntity>, ObjBuilder<DirectoryCopyPackagingElementEntity> {
override var parentEntity: CompositePackagingElementEntity?
override var filePath: VirtualFileUrl
override var entitySource: EntitySource
}
companion object: Type<DirectoryCopyPackagingElementEntity, Builder>(FileOrDirectoryPackagingElementEntity) {
operator fun invoke(filePath: VirtualFileUrl, entitySource: EntitySource, init: (Builder.() -> Unit)? = null): DirectoryCopyPackagingElementEntity {
val builder = builder()
builder.filePath = filePath
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: DirectoryCopyPackagingElementEntity, modification: DirectoryCopyPackagingElementEntity.Builder.() -> Unit) = modifyEntity(DirectoryCopyPackagingElementEntity.Builder::class.java, entity, modification)
//endregion
interface ExtractedDirectoryPackagingElementEntity: FileOrDirectoryPackagingElementEntity {
val pathInArchive: String
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: ExtractedDirectoryPackagingElementEntity, FileOrDirectoryPackagingElementEntity.Builder<ExtractedDirectoryPackagingElementEntity>, ModifiableWorkspaceEntity<ExtractedDirectoryPackagingElementEntity>, ObjBuilder<ExtractedDirectoryPackagingElementEntity> {
override var parentEntity: CompositePackagingElementEntity?
override var filePath: VirtualFileUrl
override var pathInArchive: String
override var entitySource: EntitySource
}
companion object: Type<ExtractedDirectoryPackagingElementEntity, Builder>(FileOrDirectoryPackagingElementEntity) {
operator fun invoke(filePath: VirtualFileUrl, pathInArchive: String, entitySource: EntitySource, init: (Builder.() -> Unit)? = null): ExtractedDirectoryPackagingElementEntity {
val builder = builder()
builder.filePath = filePath
builder.pathInArchive = pathInArchive
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: ExtractedDirectoryPackagingElementEntity, modification: ExtractedDirectoryPackagingElementEntity.Builder.() -> Unit) = modifyEntity(ExtractedDirectoryPackagingElementEntity.Builder::class.java, entity, modification)
//endregion
interface FileCopyPackagingElementEntity : FileOrDirectoryPackagingElementEntity {
val renamedOutputFileName: String?
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: FileCopyPackagingElementEntity, FileOrDirectoryPackagingElementEntity.Builder<FileCopyPackagingElementEntity>, ModifiableWorkspaceEntity<FileCopyPackagingElementEntity>, ObjBuilder<FileCopyPackagingElementEntity> {
override var parentEntity: CompositePackagingElementEntity?
override var filePath: VirtualFileUrl
override var renamedOutputFileName: String?
override var entitySource: EntitySource
}
companion object: Type<FileCopyPackagingElementEntity, Builder>(FileOrDirectoryPackagingElementEntity) {
operator fun invoke(filePath: VirtualFileUrl, entitySource: EntitySource, init: (Builder.() -> Unit)? = null): FileCopyPackagingElementEntity {
val builder = builder()
builder.filePath = filePath
builder.entitySource = entitySource
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: FileCopyPackagingElementEntity, modification: FileCopyPackagingElementEntity.Builder.() -> Unit) = modifyEntity(FileCopyPackagingElementEntity.Builder::class.java, entity, modification)
//endregion
interface CustomPackagingElementEntity : CompositePackagingElementEntity {
val typeId: String
val propertiesXmlTag: String
//region generated code
//@formatter:off
@GeneratedCodeApiVersion(1)
interface Builder: CustomPackagingElementEntity, CompositePackagingElementEntity.Builder<CustomPackagingElementEntity>, ModifiableWorkspaceEntity<CustomPackagingElementEntity>, ObjBuilder<CustomPackagingElementEntity> {
override var parentEntity: CompositePackagingElementEntity?
override var artifact: ArtifactEntity?
override var children: List<PackagingElementEntity>
override var typeId: String
override var entitySource: EntitySource
override var propertiesXmlTag: String
}
companion object: Type<CustomPackagingElementEntity, Builder>(CompositePackagingElementEntity) {
operator fun invoke(typeId: String, propertiesXmlTag: String, entitySource: EntitySource, init: (Builder.() -> Unit)? = null): CustomPackagingElementEntity {
val builder = builder()
builder.typeId = typeId
builder.entitySource = entitySource
builder.propertiesXmlTag = propertiesXmlTag
init?.invoke(builder)
return builder
}
}
//@formatter:on
//endregion
}
//region generated code
fun MutableEntityStorage.modifyEntity(entity: CustomPackagingElementEntity, modification: CustomPackagingElementEntity.Builder.() -> Unit) = modifyEntity(CustomPackagingElementEntity.Builder::class.java, entity, modification)
//endregion | apache-2.0 | efe85308e48f70b97af623fee041e07b | 42.936937 | 277 | 0.754306 | 6.813076 | false | false | false | false |
ingokegel/intellij-community | platform/platform-impl/src/com/intellij/toolWindow/InternalDecoratorImpl.kt | 1 | 26946 | // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.toolWindow
import com.intellij.ide.IdeBundle
import com.intellij.openapi.actionSystem.ActionGroup
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.DataProvider
import com.intellij.openapi.actionSystem.PlatformDataKeys
import com.intellij.openapi.actionSystem.impl.ActionButton
import com.intellij.openapi.ui.Queryable
import com.intellij.openapi.ui.Splitter
import com.intellij.openapi.util.CheckedDisposable
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.SystemInfoRt
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.wm.IdeGlassPane
import com.intellij.openapi.wm.ToolWindowAnchor
import com.intellij.openapi.wm.ToolWindowType
import com.intellij.openapi.wm.WindowInfo
import com.intellij.openapi.wm.impl.FloatingDecorator
import com.intellij.openapi.wm.impl.InternalDecorator
import com.intellij.openapi.wm.impl.ToolWindowImpl
import com.intellij.openapi.wm.impl.content.ToolWindowContentUi
import com.intellij.ui.*
import com.intellij.ui.components.panels.Wrapper
import com.intellij.ui.content.Content
import com.intellij.ui.content.ContentManagerEvent
import com.intellij.ui.content.ContentManagerListener
import com.intellij.ui.content.impl.ContentImpl
import com.intellij.ui.content.impl.ContentManagerImpl
import com.intellij.ui.hover.HoverStateListener
import com.intellij.ui.paint.LinePainter2D
import com.intellij.util.MathUtil
import com.intellij.util.animation.AlphaAnimated
import com.intellij.util.ui.JBInsets
import com.intellij.util.ui.JBUI
import org.intellij.lang.annotations.MagicConstant
import org.jetbrains.annotations.ApiStatus
import org.jetbrains.annotations.NonNls
import java.awt.*
import java.awt.event.MouseAdapter
import java.awt.event.MouseEvent
import javax.accessibility.AccessibleContext
import javax.swing.*
import javax.swing.border.Border
@ApiStatus.Internal
class InternalDecoratorImpl internal constructor(
@JvmField internal val toolWindow: ToolWindowImpl,
private val contentUi: ToolWindowContentUi,
private val myDecoratorChild: JComponent
) : InternalDecorator(), Queryable, DataProvider, ComponentWithMnemonics {
companion object {
val SHARED_ACCESS_KEY = Key.create<Boolean>("sharedAccess")
internal val HIDE_COMMON_TOOLWINDOW_BUTTONS = Key.create<Boolean>("HideCommonToolWindowButtons")
internal val INACTIVE_LOOK = Key.create<Boolean>("InactiveLook")
/**
* Catches all event from tool window and modifies decorator's appearance.
*/
internal const val HIDE_ACTIVE_WINDOW_ACTION_ID = "HideActiveWindow"
private fun moveContent(content: Content, source: InternalDecoratorImpl, target: InternalDecoratorImpl) {
val targetContentManager = target.contentManager
if (content.manager == targetContentManager) {
return
}
val initialState = content.getUserData(Content.TEMPORARY_REMOVED_KEY)
try {
source.setSplitUnsplitInProgress(true)
content.putUserData(Content.TEMPORARY_REMOVED_KEY, java.lang.Boolean.TRUE)
content.manager?.removeContent(content, false)
(content as ContentImpl).manager = targetContentManager
targetContentManager.addContent(content)
}
finally {
content.putUserData(Content.TEMPORARY_REMOVED_KEY, initialState)
source.setSplitUnsplitInProgress(false)
}
}
/**
* Installs a focus traversal policy for the tool window.
* If the policy cannot handle a keystroke, it delegates the handling to
* the nearest ancestors focus traversal policy. For instance,
* this policy does not handle KeyEvent.VK_ESCAPE, so it can delegate the handling
* to a ThreeComponentSplitter instance.
*/
fun installFocusTraversalPolicy(container: Container, policy: FocusTraversalPolicy) {
container.isFocusCycleRoot = true
container.isFocusTraversalPolicyProvider = true
container.focusTraversalPolicy = policy
installDefaultFocusTraversalKeys(container, KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS)
installDefaultFocusTraversalKeys(container, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS)
}
@JvmStatic
fun findTopLevelDecorator(component: Component?): InternalDecoratorImpl? {
var parent: Component? = component?.parent
var candidate: InternalDecoratorImpl? = null
while (parent != null) {
if (parent is InternalDecoratorImpl) {
candidate = parent
}
parent = parent.parent
}
return candidate
}
@JvmStatic
fun findNearestDecorator(component: Component?): InternalDecoratorImpl? {
return ComponentUtil.findParentByCondition(component?.parent) { it is InternalDecoratorImpl } as InternalDecoratorImpl?
}
private fun installDefaultFocusTraversalKeys(container: Container, id: Int) {
container.setFocusTraversalKeys(id, KeyboardFocusManager.getCurrentKeyboardFocusManager().getDefaultFocusTraversalKeys(id))
}
private val HOVER_STATE_LISTENER: HoverStateListener = object : HoverStateListener() {
override fun hoverChanged(component: Component, hovered: Boolean) {
if (component is InternalDecoratorImpl) {
val decorator = component
decorator.isWindowHovered = hovered
decorator.updateActiveAndHoverState()
}
}
}
}
enum class Mode {
SINGLE, VERTICAL_SPLIT, HORIZONTAL_SPLIT, CELL;
val isSplit: Boolean
get() = this == VERTICAL_SPLIT || this == HORIZONTAL_SPLIT
}
var mode: Mode? = null
private var isSplitUnsplitInProgress = false
private var isWindowHovered = false
private var divider: JPanel? = null
private val dividerAndHeader = JPanel(BorderLayout())
private var disposable: CheckedDisposable? = null
val header: ToolWindowHeader
private val notificationHeader = Wrapper()
private var firstDecorator: InternalDecoratorImpl? = null
private var secondDecorator: InternalDecoratorImpl? = null
private var splitter: Splitter? = null
init {
isFocusable = false
focusTraversalPolicy = LayoutFocusTraversalPolicy()
updateMode(Mode.SINGLE)
header = object : ToolWindowHeader(toolWindow, contentUi, gearProducer = { toolWindow.createPopupGroup(true) }) {
override val isActive: Boolean
get() {
return toolWindow.isActive && !toolWindow.toolWindowManager.isNewUi &&
ClientProperty.get(this@InternalDecoratorImpl, INACTIVE_LOOK) != true
}
override fun hideToolWindow() {
toolWindow.toolWindowManager.hideToolWindow(id = toolWindow.id, source = ToolWindowEventSource.HideButton)
}
}
enableEvents(AWTEvent.COMPONENT_EVENT_MASK)
installFocusTraversalPolicy(this, LayoutFocusTraversalPolicy())
dividerAndHeader.isOpaque = false
dividerAndHeader.add(JBUI.Panels.simplePanel(header).addToBottom(notificationHeader), BorderLayout.SOUTH)
if (SystemInfoRt.isMac) {
background = JBColor(Gray._200, Gray._90)
}
if (toolWindow.toolWindowManager.isNewUi) {
background = JBUI.CurrentTheme.ToolWindow.background()
}
contentManager.addContentManagerListener(object : ContentManagerListener {
override fun contentRemoved(event: ContentManagerEvent) {
val parentDecorator = findNearestDecorator(this@InternalDecoratorImpl) ?: return
if (!parentDecorator.isSplitUnsplitInProgress() && !isSplitUnsplitInProgress() && contentManager.isEmpty) {
parentDecorator.unsplit(null)
}
}
})
}
fun updateMode(mode: Mode) {
if (mode == this.mode) {
return
}
this.mode = mode
removeAll()
border = null
when (mode) {
Mode.SINGLE, Mode.CELL -> {
layout = BorderLayout()
add(dividerAndHeader, BorderLayout.NORTH)
add(myDecoratorChild, BorderLayout.CENTER)
border = InnerPanelBorder(toolWindow)
firstDecorator?.let {
Disposer.dispose(it.contentManager)
}
secondDecorator?.let {
Disposer.dispose(it.contentManager)
}
return
}
Mode.VERTICAL_SPLIT, Mode.HORIZONTAL_SPLIT -> {
val splitter = OnePixelSplitter(mode == Mode.VERTICAL_SPLIT)
splitter.setFirstComponent(firstDecorator)
splitter.setSecondComponent(secondDecorator)
this.splitter = splitter
layout = BorderLayout()
add(splitter, BorderLayout.CENTER)
}
}
}
fun splitWithContent(content: Content,
@MagicConstant(
intValues = [SwingConstants.CENTER.toLong(), SwingConstants.TOP.toLong(), SwingConstants.LEFT.toLong(), SwingConstants.BOTTOM.toLong(), SwingConstants.RIGHT.toLong(), -1]) dropSide: Int,
dropIndex: Int) {
if (dropSide == -1 || dropSide == SwingConstants.CENTER || dropIndex >= 0) {
contentManager.addContent(content, dropIndex)
return
}
firstDecorator = toolWindow.createCellDecorator()
attach(firstDecorator)
secondDecorator = toolWindow.createCellDecorator()
attach(secondDecorator)
val contents = contentManager.contents.toMutableList()
if (!contents.contains(content)) {
contents.add(content)
}
for (c in contents) {
moveContent(c, this,
(if ((c !== content) xor (dropSide == SwingConstants.LEFT || dropSide == SwingConstants.TOP)) firstDecorator else secondDecorator)!!)
}
firstDecorator!!.updateMode(Mode.CELL)
secondDecorator!!.updateMode(Mode.CELL)
updateMode(if (dropSide == SwingConstants.TOP || dropSide == SwingConstants.BOTTOM) Mode.VERTICAL_SPLIT else Mode.HORIZONTAL_SPLIT)
}
private fun raise(raiseFirst: Boolean) {
val source = if (raiseFirst) firstDecorator!! else secondDecorator!!
val first = source.firstDecorator
val second = source.secondDecorator
val mode = source.mode
source.detach(first)
source.detach(second)
source.firstDecorator = null
source.secondDecorator = null
val toRemove1 = firstDecorator
val toRemove2 = secondDecorator
toRemove1!!.updateMode(Mode.CELL)
toRemove2!!.updateMode(Mode.CELL)
first!!.setSplitUnsplitInProgress(true)
second!!.setSplitUnsplitInProgress(true)
try {
firstDecorator = first
secondDecorator = second
this.mode = mode //Previous mode is split too
splitter!!.orientation = mode == Mode.VERTICAL_SPLIT
splitter!!.firstComponent = firstDecorator
splitter!!.secondComponent = secondDecorator
attach(first)
attach(second)
}
finally {
first.setSplitUnsplitInProgress(false)
second.setSplitUnsplitInProgress(false)
Disposer.dispose(toRemove1.contentManager)
Disposer.dispose(toRemove2.contentManager)
}
}
private fun detach(decorator: InternalDecoratorImpl?) {
val parentManager = contentManager
val childManager = decorator!!.contentManager
if (parentManager is ContentManagerImpl && childManager is ContentManagerImpl) {
parentManager.removeNestedManager((childManager as ContentManagerImpl?)!!)
}
}
private fun attach(decorator: InternalDecoratorImpl?) {
val parentManager = contentManager
val childManager = decorator!!.contentManager
if (parentManager is ContentManagerImpl && childManager is ContentManagerImpl) {
parentManager.addNestedManager(childManager)
}
}
fun canUnsplit(): Boolean {
if (mode != Mode.CELL) return false
val parent = findNearestDecorator(this)
if (parent != null) {
if (parent.firstDecorator == this) {
return parent.secondDecorator != null && parent.secondDecorator!!.mode == Mode.CELL
}
if (parent.secondDecorator == this) {
return parent.firstDecorator != null && parent.firstDecorator!!.mode == Mode.CELL
}
}
return false
}
fun unsplit(toSelect: Content?) {
if (!mode!!.isSplit) {
findNearestDecorator(this)?.unsplit(toSelect)
return
}
if (isSplitUnsplitInProgress()) {
return
}
setSplitUnsplitInProgress(true)
try {
when {
firstDecorator == null || secondDecorator == null -> {
return
}
firstDecorator!!.mode!!.isSplit -> {
raise(true)
return
}
secondDecorator!!.mode!!.isSplit -> {
raise(false)
return
}
else -> {
for (c in firstDecorator!!.contentManager.contents) {
moveContent(c, firstDecorator!!, this)
}
for (c in secondDecorator!!.contentManager.contents) {
moveContent(c, secondDecorator!!, this)
}
updateMode(if (findNearestDecorator(this) != null) Mode.CELL else Mode.SINGLE)
toSelect?.manager?.setSelectedContent(toSelect)
firstDecorator = null
secondDecorator = null
splitter = null
}
}
}
finally {
setSplitUnsplitInProgress(false)
}
}
fun setSplitUnsplitInProgress(inProgress: Boolean) {
isSplitUnsplitInProgress = inProgress
}
override fun isSplitUnsplitInProgress(): Boolean = isSplitUnsplitInProgress
override fun getContentManager() = contentUi.contentManager
override fun getHeaderToolbar() = header.getToolbar()
val headerToolbarActions: ActionGroup
get() = header.getToolbarActions()
val headerToolbarWestActions: ActionGroup
get() = header.getToolbarWestActions()
override fun toString(): String {
return toolWindow.id + ": " + StringUtil.trimMiddle(contentManager.contents.joinToString { it.displayName ?: "null" }, 40) +
" #" + System.identityHashCode(this)
}
private fun initDivider(): JComponent {
divider?.let {
return it
}
divider = object : JPanel() {
override fun getCursor(): Cursor {
val info = toolWindow.windowInfo
val isVerticalCursor = if (info.type == ToolWindowType.DOCKED) info.anchor.isSplitVertically else info.anchor.isHorizontal
return if (isVerticalCursor) Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR)
else Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR)
}
}
return divider!!
}
override fun doLayout() {
super.doLayout()
initDivider().bounds = when (toolWindow.anchor) {
ToolWindowAnchor.TOP -> Rectangle(0, height - 1, width, 0)
ToolWindowAnchor.LEFT -> Rectangle(width - 1, 0, 0, height)
ToolWindowAnchor.BOTTOM -> Rectangle(0, 0, width, 0)
ToolWindowAnchor.RIGHT -> Rectangle(0, 0, 0, height)
else -> Rectangle(0, 0, 0, 0)
}
}
fun applyWindowInfo(info: WindowInfo) {
if (info.type == ToolWindowType.SLIDING) {
val anchor = info.anchor
val divider = initDivider()
divider.invalidate()
when (anchor) {
ToolWindowAnchor.TOP -> add(divider, BorderLayout.SOUTH)
ToolWindowAnchor.LEFT -> add(divider, BorderLayout.EAST)
ToolWindowAnchor.BOTTOM -> dividerAndHeader.add(divider, BorderLayout.NORTH)
ToolWindowAnchor.RIGHT -> add(divider, BorderLayout.WEST)
}
divider.preferredSize = Dimension(0, 0)
}
else if (divider != null) {
// docked and floating windows don't have divider
divider!!.parent?.remove(divider)
divider = null
}
// push "apply" request forward
if (info.type == ToolWindowType.FLOATING) {
(SwingUtilities.getAncestorOfClass(FloatingDecorator::class.java, this) as FloatingDecorator?)?.apply(info)
}
}
override fun getData(dataId: @NonNls String): Any? {
return if (PlatformDataKeys.TOOL_WINDOW.`is`(dataId)) toolWindow else null
}
fun setTitleActions(actions: List<AnAction>) {
header.setAdditionalTitleActions(actions)
}
fun setTabActions(actions: List<AnAction>) {
header.setTabActions(actions)
}
private class InnerPanelBorder(private val window: ToolWindowImpl) : Border {
override fun paintBorder(c: Component, g: Graphics, x: Int, y: Int, width: Int, height: Int) {
g.color = JBColor.border()
doPaintBorder(c, g, x, y, width, height)
}
private fun doPaintBorder(c: Component, g: Graphics, x: Int, y: Int, width: Int, height: Int) {
val insets = getBorderInsets(c)
val graphics2D = g as Graphics2D
if (insets.top > 0) {
LinePainter2D.paint(graphics2D, x.toDouble(), (y + insets.top - 1).toDouble(), (x + width - 1).toDouble(),
(y + insets.top - 1).toDouble())
LinePainter2D.paint(graphics2D, x.toDouble(), (y + insets.top).toDouble(), (x + width - 1).toDouble(), (y + insets.top).toDouble())
}
if (insets.left > 0) {
LinePainter2D.paint(graphics2D, (x - 1).toDouble(), y.toDouble(), (x - 1).toDouble(), (y + height).toDouble())
LinePainter2D.paint(graphics2D, x.toDouble(), y.toDouble(), x.toDouble(), (y + height).toDouble())
}
if (insets.right > 0) {
LinePainter2D.paint(graphics2D, (x + width - 1).toDouble(), (y + insets.top).toDouble(), (x + width - 1).toDouble(),
(y + height).toDouble())
LinePainter2D.paint(graphics2D, (x + width).toDouble(), (y + insets.top).toDouble(), (x + width).toDouble(),
(y + height).toDouble())
}
if (insets.bottom > 0) {
LinePainter2D.paint(graphics2D, x.toDouble(), (y + height - 1).toDouble(), (x + width).toDouble(), (y + height - 1).toDouble())
LinePainter2D.paint(graphics2D, x.toDouble(), (y + height).toDouble(), (x + width).toDouble(), (y + height).toDouble())
}
}
override fun getBorderInsets(c: Component): Insets {
val toolWindowManager = window.toolWindowManager
val windowInfo = window.windowInfo
if (toolWindowManager.project.isDisposed ||
!toolWindowManager.isToolWindowRegistered(window.id) ||
window.isDisposed || windowInfo.type == ToolWindowType.FLOATING || windowInfo.type == ToolWindowType.WINDOWED) {
return JBInsets.emptyInsets()
}
val anchor = windowInfo.anchor
var component: Component = window.component
var parent = component.parent
var isSplitter = false
var isFirstInSplitter = false
var isVerticalSplitter = false
while (parent != null) {
if (parent is Splitter) {
val splitter = parent
isSplitter = true
isFirstInSplitter = splitter.firstComponent === component
isVerticalSplitter = splitter.isVertical
break
}
component = parent
parent = component.getParent()
}
val top = if (isSplitter && (anchor == ToolWindowAnchor.RIGHT || anchor == ToolWindowAnchor.LEFT) && windowInfo.isSplit && isVerticalSplitter) -1 else 0
val left = if (anchor == ToolWindowAnchor.RIGHT && (!isSplitter || isVerticalSplitter || isFirstInSplitter)) 1 else 0
val bottom = 0
val right = if (anchor == ToolWindowAnchor.LEFT && (!isSplitter || isVerticalSplitter || !isFirstInSplitter)) 1 else 0
return Insets(top, left, bottom, right)
}
override fun isBorderOpaque(): Boolean {
return false
}
}
override fun getHeaderHeight(): Int {
return header.preferredSize.height
}
override fun setHeaderVisible(value: Boolean) {
header.isVisible = value
}
override fun isHeaderVisible(): Boolean {
return header.isVisible
}
val isActive: Boolean
get() = toolWindow.isActive
fun updateActiveAndHoverState() {
val narrow = this.toolWindow.decorator?.width?.let { it < JBUI.scale(120) } ?: false
val toolbar = headerToolbar
if (toolbar is AlphaAnimated) {
val alpha = toolbar as AlphaAnimated
alpha.alphaAnimator.setVisible(narrow
|| !toolWindow.toolWindowManager.isNewUi
|| isWindowHovered
|| header.isPopupShowing
|| toolWindow.isActive)
}
}
fun activate(source: ToolWindowEventSource?) {
toolWindow.fireActivated(source!!)
}
val toolWindowId: String
get() = toolWindow.id
var headerComponent: JComponent?
get() {
val component = notificationHeader.targetComponent
return if (component !== notificationHeader) component else null
}
set(notification) {
notificationHeader.setContent(notification)
}
val headerScreenBounds: Rectangle?
get() {
if (!header.isShowing) {
return null
}
val bounds = header.bounds
bounds.location = header.locationOnScreen
return bounds
}
override fun addNotify() {
super.addNotify()
if (isSplitUnsplitInProgress()) {
return
}
disposable?.let {
Disposer.dispose(it)
}
val divider = divider
disposable = Disposer.newCheckedDisposable()
HOVER_STATE_LISTENER.addTo(this, disposable!!)
updateActiveAndHoverState()
if (divider != null) {
val glassPane = rootPane.glassPane as IdeGlassPane
val listener = ResizeOrMoveDocketToolWindowMouseListener(divider, glassPane, this)
glassPane.addMouseMotionPreprocessor(listener, disposable!!)
glassPane.addMousePreprocessor(listener, disposable!!)
}
contentUi.update()
}
override fun removeNotify() {
super.removeNotify()
if (isSplitUnsplitInProgress()) {
return
}
val disposable = disposable
if (disposable != null && !disposable.isDisposed) {
this.disposable = null
Disposer.dispose(disposable)
}
}
override fun reshape(x: Int, y: Int, w: Int, h: Int) {
val rectangle = bounds
super.reshape(x, y, w, h)
val topLevelDecorator = findTopLevelDecorator(this)
if (topLevelDecorator == null || !topLevelDecorator.isShowing) {
putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, null)
putClientProperty(HIDE_COMMON_TOOLWINDOW_BUTTONS, null)
putClientProperty(INACTIVE_LOOK, null)
}
else {
val hideLabel: Any? = if (SwingUtilities.convertPoint(this, x, y, topLevelDecorator) == Point()) null else "true"
putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, hideLabel)
val topScreenLocation = topLevelDecorator.locationOnScreen
topScreenLocation.x += topLevelDecorator.width
val screenLocation = locationOnScreen
screenLocation.x += w
val hideButtons = if (topScreenLocation == screenLocation) null else java.lang.Boolean.TRUE
val hideActivity = if (topScreenLocation.y == screenLocation.y) null else java.lang.Boolean.TRUE
putClientProperty(HIDE_COMMON_TOOLWINDOW_BUTTONS, hideButtons)
putClientProperty(INACTIVE_LOOK, hideActivity)
}
if (!rectangle.equals(bounds)) {
contentUi.update()
}
}
fun setDropInfoIndex(index: Int, width: Int) {
contentUi.setDropInfoIndex(index, width)
}
fun updateBounds(dragEvent: MouseEvent) {
//"Undock" mode only, for "Dock" mode processing see com.intellij.openapi.wm.impl.content.ToolWindowContentUi.initMouseListeners
val anchor = toolWindow.anchor
val windowPane = parent
val lastPoint = SwingUtilities.convertPoint(dragEvent.component, dragEvent.point, windowPane)
lastPoint.x = MathUtil.clamp(lastPoint.x, 0, windowPane.width)
lastPoint.y = MathUtil.clamp(lastPoint.y, 0, windowPane.height)
val bounds = bounds
if (anchor == ToolWindowAnchor.TOP) {
setBounds(0, 0, bounds.width, lastPoint.y)
}
else if (anchor == ToolWindowAnchor.LEFT) {
setBounds(0, 0, lastPoint.x, bounds.height)
}
else if (anchor == ToolWindowAnchor.BOTTOM) {
setBounds(0, lastPoint.y, bounds.width, windowPane.height - lastPoint.y)
}
else if (anchor == ToolWindowAnchor.RIGHT) {
setBounds(lastPoint.x, 0, windowPane.width - lastPoint.x, bounds.height)
}
validate()
}
private class ResizeOrMoveDocketToolWindowMouseListener(private val divider: JComponent,
private val glassPane: IdeGlassPane,
private val decorator: InternalDecoratorImpl) : MouseAdapter() {
private var isDragging = false
private fun isInDragZone(e: MouseEvent): Boolean {
if (!divider.isShowing
|| (divider.width == 0 && divider.height == 0)
|| e.id == MouseEvent.MOUSE_DRAGGED) return false
val point = SwingUtilities.convertPoint(e.component, e.point, divider)
val isTopBottom = decorator.toolWindow.windowInfo.anchor.isHorizontal
val activeArea = Rectangle(divider.size)
var resizeArea = ToolWindowPane.headerResizeArea
val target = SwingUtilities.getDeepestComponentAt(e.component, e.point.x, e.point.y)
if (target is JScrollBar || target is ActionButton) {
resizeArea /= 3
}
if (isTopBottom) {
activeArea.y -= resizeArea
activeArea.height += 2 * resizeArea
}
else {
activeArea.x -= resizeArea
activeArea.width += 2 * resizeArea
}
return activeArea.contains(point)
}
private fun updateCursor(event: MouseEvent, isInDragZone: Boolean) {
if (isInDragZone) {
glassPane.setCursor(divider.cursor, divider)
event.consume()
}
}
override fun mousePressed(e: MouseEvent) {
isDragging = isInDragZone(e)
updateCursor(e, isDragging)
}
override fun mouseClicked(e: MouseEvent) {
updateCursor(e, isInDragZone(e))
}
override fun mouseReleased(e: MouseEvent) {
updateCursor(e, isInDragZone(e))
isDragging = false
}
override fun mouseMoved(e: MouseEvent) {
updateCursor(e, isDragging || isInDragZone(e))
}
override fun mouseDragged(e: MouseEvent) {
if (!isDragging) {
return
}
decorator.updateBounds(e)
e.consume()
}
}
override fun putInfo(info: MutableMap<in String, in String>) {
info["toolWindowTitle"] = toolWindow.title!!
val selection = toolWindow.contentManager.selectedContent
if (selection != null) {
info["toolWindowTab"] = selection.tabName
}
}
override fun getAccessibleContext(): AccessibleContext {
if (accessibleContext == null) {
accessibleContext = AccessibleInternalDecorator()
}
return accessibleContext
}
private inner class AccessibleInternalDecorator : AccessibleJPanel() {
override fun getAccessibleName(): String {
return super.getAccessibleName()
?: (
((toolWindow.title?.takeIf(String::isNotEmpty) ?: toolWindow.stripeTitle).takeIf(String::isNotEmpty) ?: toolWindow.id)
+ " " + IdeBundle.message("internal.decorator.accessible.postfix")
)
}
}
} | apache-2.0 | afbe4ca9bdcefe43d7f6023af2b20be4 | 35.812842 | 211 | 0.681771 | 4.589678 | false | false | false | false |
mdaniel/intellij-community | plugins/gradle/java/testSources/execution/test/GradleJavaTestEventsIntegrationTest.kt | 1 | 12240 | // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.plugins.gradle.execution.test
import com.intellij.openapi.externalSystem.model.task.*
import com.intellij.openapi.externalSystem.model.task.event.ExternalSystemTaskExecutionEvent
import com.intellij.openapi.externalSystem.model.task.event.TestOperationDescriptor
import com.intellij.openapi.util.Pair
import com.intellij.openapi.util.registry.Registry
import com.intellij.testFramework.common.runAll
import org.assertj.core.api.Assertions.assertThat
import org.assertj.core.api.Assertions.assertThatThrownBy
import org.assertj.core.api.Condition
import org.jetbrains.plugins.gradle.GradleManager
import org.jetbrains.plugins.gradle.importing.GradleImportingTestCase
import org.jetbrains.plugins.gradle.service.task.GradleTaskManager
import org.jetbrains.plugins.gradle.settings.GradleExecutionSettings
import org.jetbrains.plugins.gradle.testFramework.util.buildscript
import org.jetbrains.plugins.gradle.tooling.annotation.TargetVersions
import org.jetbrains.plugins.gradle.tooling.util.GradleVersionComparator
import org.jetbrains.plugins.gradle.util.GradleConstants
import org.junit.Test
open class GradleJavaTestEventsIntegrationTest: GradleImportingTestCase() {
override fun setUp() {
super.setUp()
if (testLauncherAPISupported()) {
Registry.get("gradle.testLauncherAPI.enabled").setValue(true, testRootDisposable)
}
}
@Test
@TargetVersions("!6.9")
fun test() {
val gradleSupportsJunitPlatform = isGradleNewerOrSameAs("4.6")
createProjectSubFile("src/main/java/my/pack/AClass.java",
"package my.pack;\n" +
"public class AClass {\n" +
" public int method() { return 42; }" +
"}")
createProjectSubFile("src/test/java/my/pack/AClassTest.java",
"package my.pack;\n" +
"import org.junit.Test;\n" +
"import static org.junit.Assert.*;\n" +
"public class AClassTest {\n" +
" @Test\n" +
" public void testSuccess() {\n" +
" assertEquals(42, new AClass().method());\n" +
" }\n" +
" @Test\n" +
" public void testFail() {\n" +
" fail(\"failure message\");\n" +
" }\n" +
"}")
createProjectSubFile("src/test/java/my/otherpack/AClassTest.java",
"package my.otherpack;\n" +
"import my.pack.AClass;\n" +
"import org.junit.Test;\n" +
"import static org.junit.Assert.*;\n" +
"public class AClassTest {\n" +
" @Test\n" +
" public void testSuccess() {\n" +
" assertEquals(42, new AClass().method());\n" +
" }\n" +
"}")
createProjectSubFile("src/junit5test/java/my/otherpack/ADisplayNamedTest.java",
"""
package my.otherpack;
import org.junit.jupiter.api.DisplayNameGeneration;
import org.junit.jupiter.api.DisplayNameGenerator;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
@DisplayNameGeneration(DisplayNameGenerator.ReplaceUnderscores.class)
public class ADisplayNamedTest {
@Test
void successful_test() {
assertTrue(true);
}
}
""".trimIndent())
importProject(buildscript {
withJavaPlugin()
withJUnit4()
if (gradleSupportsJunitPlatform) {
addPostfix("""
sourceSets {
junit5test
}
dependencies {
junit5testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
junit5testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
}
task junit5test(type: Test) {
useJUnitPlatform()
testClassesDirs = sourceSets.junit5test.output.classesDirs
classpath = sourceSets.junit5test.runtimeClasspath
}
""".trimIndent())
}
addPostfix("test { filter { includeTestsMatching 'my.pack.*' } }")
addPostfix("""
import java.util.concurrent.atomic.AtomicBoolean;
def resolutionAllowed = new AtomicBoolean(false)
if (configurations.findByName("testRuntimeClasspath") != null) {
configurations.testRuntimeClasspath.incoming.beforeResolve {
if (!resolutionAllowed.get() && !System.properties["idea.sync.active"]) {
logger.warn("Attempt to resolve configuration too early")
}
}
}
gradle.taskGraph.beforeTask { Task task ->
if (task.path == ":test" ) {
println("Greenlight to resolving the configuration!")
resolutionAllowed.set(true)
}
}
""".trimIndent())
})
runAll(
{ `call test task produces test events`() },
{ `call build task does not produce test events`() },
{ `call task for specific test overrides existing filters`() },
{ if (gradleSupportsJunitPlatform) `test events use display name`() }
)
}
private fun testLauncherAPISupported(): Boolean = isGradleNewerOrSameAs("6.1")
private fun extractTestClassesAndMethods(testListener: LoggingESStatusChangeListener) =
testListener.eventLog
.filterIsInstance<ExternalSystemTaskExecutionEvent>()
.map { it.progressEvent.descriptor }
.filterIsInstance<TestOperationDescriptor>()
.map { it.run { className to methodName } }
private fun `call test task produces test events`() {
val testEventListener = LoggingESStatusChangeListener()
val testListener = LoggingESOutputListener(testEventListener)
val settings = createSettings { putUserData(GradleConstants.RUN_TASK_AS_TEST, true) }
assertThatThrownBy {
GradleTaskManager().executeTasks(createId(),
listOf(":test"),
projectPath,
settings,
null,
testListener)
}
.`is`(Condition({
val message = it.message ?: return@Condition false
message.contains("Test failed.") || message.contains("There were failing tests")
},
"Contain failed tests message"))
if (testLauncherAPISupported()) {
val testOperationDescriptors = extractTestClassesAndMethods(testEventListener)
assertThat(testOperationDescriptors)
.contains("my.pack.AClassTest" to "testSuccess",
"my.pack.AClassTest" to "testFail",
"my.otherpack.AClassTest" to "testSuccess")
}
else {
assertThat(testListener.eventLog)
.contains(
"<descriptor name='testFail' displayName='testFail' className='my.pack.AClassTest' />",
"<descriptor name='testSuccess' displayName='testSuccess' className='my.pack.AClassTest' />")
.doesNotContain(
"<descriptor name='testSuccess' displayName='testSuccess' className='my.otherpack.AClassTest' />")
.doesNotContain(
"Attempt to resolve configuration too early")
}
}
private fun `call build task does not produce test events`() {
val testListener = LoggingESOutputListener()
val settings = createSettings()
assertThatThrownBy {
GradleTaskManager().executeTasks(createId(),
listOf("clean", "build"),
projectPath,
settings,
null,
testListener)
}
.hasMessageContaining("There were failing tests")
assertThat(testListener.eventLog).noneMatch { it.contains("<ijLogEol/>") }
}
private fun `call task for specific test overrides existing filters`() {
val testListener = LoggingESOutputListener()
val settings = createSettings {
putUserData(GradleConstants.RUN_TASK_AS_TEST, true)
withArguments("--tests","my.otherpack.*")
}
GradleTaskManager().executeTasks(createId(),
listOf(":cleanTest", ":test"),
projectPath,
settings,
null,
testListener)
assertThat(testListener.eventLog)
.contains("<descriptor name='testSuccess' displayName='testSuccess' className='my.otherpack.AClassTest' />")
.doesNotContain("<descriptor name='testFail' displayName='testFail' className='my.pack.AClassTest' />",
"<descriptor name='testSuccess' displayName='testSuccess' className='my.pack.AClassTest' />")
}
private fun `test events use display name`() {
val testEventListener = LoggingESStatusChangeListener()
val testListener = LoggingESOutputListener(testEventListener)
val settings = createSettings { putUserData(GradleConstants.RUN_TASK_AS_TEST, true) }
GradleTaskManager().executeTasks(createId(),
listOf(":junit5test"),
projectPath,
settings,
null,
testListener)
if (testLauncherAPISupported()) {
val testOperationDescriptors = testEventListener.eventLog
.filterIsInstance<ExternalSystemTaskExecutionEvent>()
.map { it.progressEvent.descriptor }
.filterIsInstance<TestOperationDescriptor>()
.map { it.run { "$className$$methodName" to displayName } }
assertThat(testOperationDescriptors)
.contains("my.otherpack.ADisplayNamedTest\$successful_test()" to "successful test")
}
else {
if (GradleVersionComparator(currentGradleVersion).isOrGreaterThan("4.10.3")) {
assertThat(testListener.eventLog)
.contains("<descriptor name='successful_test()' displayName='successful test' className='my.otherpack.ADisplayNamedTest' />")
} else {
assertThat(testListener.eventLog)
.contains("<descriptor name='successful test' displayName='successful test' className='my.otherpack.ADisplayNamedTest' />")
}
}
}
private fun createSettings(config: GradleExecutionSettings.() -> Unit = {}) = GradleManager()
.executionSettingsProvider
.`fun`(Pair.create(myProject, projectPath))
.apply { config() }
private fun createId() = ExternalSystemTaskId.create(GradleConstants.SYSTEM_ID, ExternalSystemTaskType.EXECUTE_TASK, myProject)
class LoggingESOutputListener(delegate: ExternalSystemTaskNotificationListener? = null) : ExternalSystemTaskNotificationListenerAdapter(
delegate) {
val eventLog = mutableListOf<String>()
override fun onTaskOutput(id: ExternalSystemTaskId, text: String, stdOut: Boolean) {
addEventLogLines(text, eventLog)
}
private fun addEventLogLines(text: String, eventLog: MutableList<String>) {
text.split("<ijLogEol/>").mapTo(eventLog) { it.trim('\r', '\n', ' ') }
}
}
class LoggingESStatusChangeListener : ExternalSystemTaskNotificationListenerAdapter() {
val eventLog = mutableListOf<ExternalSystemTaskNotificationEvent>()
override fun onStatusChange(event: ExternalSystemTaskNotificationEvent) {
eventLog.add(event)
}
}
}
| apache-2.0 | 7e03e367a5ddc601bc8dcff0e0d3cbbb | 41.797203 | 138 | 0.592729 | 5.19966 | false | true | false | false |
Anizoptera/BacKT_WebServer | src/test/kotlin/azadev/backt/webserver/test/AServerTest.kt | 1 | 1679 | package azadev.backt.webserver.test
import azadev.backt.webserver.WebServer
import azadev.backt.webserver.callref.CallReferences
import okhttp3.*
import org.junit.*
abstract class AServerTest
{
val port = 33377
lateinit var server: WebServer
@Suppress("unused")
@Before fun startServer() {
print("Starting server")
server = WebServer(
port = port,
exceptionHandler = { ex, _ -> println(ex) }
)
server.start()
println(" OK")
}
@Suppress("unused")
@After fun resetServer() {
print("Stopping server")
server.stop()
println(" OK")
}
private fun makeRequest(path: String, method: String, sendData: String? = null, expectedCases: Any? = null): Response {
val request = Request.Builder()
.url("http://127.0.0.1:$port$path")
if (method == POST && sendData != null)
request.post(RequestBody.create(MediaType.parse("application/x-www-form-urlencoded; charset=utf-8"), sendData))
val response = OkHttpClient().newCall(request.build()).execute()
if (expectedCases != null)
Assert.assertEquals("Expected case IDs: $expectedCases", expectedCases.toString(), response.body().string())
return response
}
fun get(path: String, expectedCases: Any? = null) = makeRequest(path, GET, expectedCases = expectedCases)
fun post(path: String, sendData: String, expectedCases: Any? = null) = makeRequest(path, POST, sendData = sendData, expectedCases = expectedCases)
fun CallReferences.caseComplete(caseId: Int): Boolean {
val dataToSend = response.dataToSend?.toString()
response.dataToSend = if (dataToSend == null) caseId.toString() else "$dataToSend $caseId"
return true
}
}
const val GET = "GET"
const val POST = "POST"
| mit | 27379c4ba435ccb70a257d508ed68db0 | 26.52459 | 147 | 0.711733 | 3.469008 | false | false | false | false |
GunoH/intellij-community | platform/platform-impl/src/com/intellij/ide/actions/HideToolWindowAction.kt | 5 | 2174 | // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ide.actions
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.wm.IdeFocusManager
import com.intellij.openapi.wm.ToolWindow
import com.intellij.openapi.wm.ToolWindowManager
import com.intellij.openapi.wm.ToolWindowType
import com.intellij.openapi.wm.impl.ToolWindowManagerImpl
import com.intellij.toolWindow.ToolWindowEventSource
import com.intellij.util.ui.UIUtil
internal class HideToolWindowAction : AnAction(), DumbAware {
companion object {
internal fun shouldBeHiddenByShortCut(window: ToolWindow): Boolean {
return window.isVisible && window.type != ToolWindowType.WINDOWED && window.type != ToolWindowType.FLOATING
}
}
override fun actionPerformed(e: AnActionEvent) {
val toolWindowManager = ToolWindowManager.getInstance(e.project ?: return) as ToolWindowManagerImpl
val id = toolWindowManager.activeToolWindowId ?: toolWindowManager.lastActiveToolWindowId ?: return
toolWindowManager.hideToolWindow(id = id, source = ToolWindowEventSource.HideToolWindowAction)
}
override fun update(event: AnActionEvent) {
val presentation = event.presentation
val project = event.project
if (project == null) {
presentation.isEnabled = false
return
}
val toolWindowManager = ToolWindowManager.getInstance(project)
val window = (toolWindowManager.activeToolWindowId ?: toolWindowManager.lastActiveToolWindowId)?.let(toolWindowManager::getToolWindow)
if (window == null) {
presentation.isEnabled = false
}
else if (window.isVisible && UIUtil.isDescendingFrom(IdeFocusManager.getGlobalInstance().focusOwner, window.component)) {
presentation.isEnabled = true
}
else {
presentation.isEnabled = shouldBeHiddenByShortCut(window)
}
}
override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}
} | apache-2.0 | 7628a6a0e351dc71c90c30678d6de8fa | 40.037736 | 138 | 0.780129 | 5.020785 | false | false | false | false |
ManojMadanmohan/dlt | app/src/main/java/com/manoj/dlt/ui/ConfirmShortcutDialog.kt | 1 | 2404 | package com.manoj.dlt.ui
import android.os.Bundle
import android.support.v4.app.DialogFragment
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.EditText
import android.widget.Toast
import com.manoj.dlt.R
import com.manoj.dlt.utils.Utilities
class ConfirmShortcutDialog : DialogFragment() {
private var _deepLink: String? = null
private var _defaultLabel: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
setStyle(DialogFragment.STYLE_NO_TITLE, 0)
super.onCreate(savedInstanceState)
}
override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
extractData()
val view = inflater!!.inflate(R.layout.confirm_shortcut_dialog, container, false)
initView(view)
return view
}
private fun extractData() {
_deepLink = arguments.getString(KEY_DEEP_LINK)
_defaultLabel = arguments.getString(KEY_LABEL, "")
}
private fun initView(view: View) {
val labelEditText = view.findViewById(R.id.shortcut_label) as EditText
if (!TextUtils.isEmpty(_defaultLabel)) {
labelEditText.setText(_defaultLabel)
labelEditText.setSelection(_defaultLabel!!.length)
}
view.findViewById(R.id.confirm_shortcut_negative).setOnClickListener { dismiss() }
view.findViewById(R.id.confirm_shortcut_positive).setOnClickListener {
val shortcutAdded = Utilities.addShortcut(_deepLink!!, activity, labelEditText.text.toString())
if (shortcutAdded) {
Toast.makeText(activity, "shortcut added", Toast.LENGTH_LONG).show()
} else {
Toast.makeText(activity, "could not add shortcut", Toast.LENGTH_LONG).show()
}
dismiss()
}
}
companion object {
private val KEY_DEEP_LINK = "key_deep_link"
private val KEY_LABEL = "key_label"
fun newInstance(deepLinkUri: String?, defaultLabel: String?): ConfirmShortcutDialog {
val dialog = ConfirmShortcutDialog()
val args = Bundle()
args.putString(KEY_DEEP_LINK, deepLinkUri)
args.putString(KEY_LABEL, defaultLabel)
dialog.arguments = args
return dialog
}
}
}
| mit | 7548e272d8adbe3afc3e9ca8ec154b5e | 32.859155 | 117 | 0.662646 | 4.460111 | false | false | false | false |
ktorio/ktor | ktor-utils/common/src/io/ktor/util/Crypto.kt | 1 | 2692 | /*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
@file:kotlin.jvm.JvmMultifileClass
@file:kotlin.jvm.JvmName("CryptoKt")
package io.ktor.util
import io.ktor.utils.io.charsets.*
import io.ktor.utils.io.core.*
import kotlin.native.concurrent.*
private val digits = "0123456789abcdef".toCharArray()
internal const val NONCE_SIZE_IN_BYTES = 16
/**
* Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
*/
public fun hex(bytes: ByteArray): String {
val result = CharArray(bytes.size * 2)
var resultIndex = 0
val digits = digits
for (index in 0 until bytes.size) {
val b = bytes[index].toInt() and 0xff
result[resultIndex++] = digits[b shr 4]
result[resultIndex++] = digits[b and 0x0f]
}
return result.concatToString()
}
/**
* Decode bytes from HEX string. It should be no spaces and `0x` prefixes.
*/
public fun hex(s: String): ByteArray {
val result = ByteArray(s.length / 2)
for (idx in 0 until result.size) {
val srcIdx = idx * 2
val high = s[srcIdx].toString().toInt(16) shl 4
val low = s[srcIdx + 1].toString().toInt(16)
result[idx] = (high or low).toByte()
}
return result
}
/**
* Generates a nonce string. Could block if the system's entropy source is empty
*/
public expect fun generateNonce(): String
/**
* Generates a nonce bytes of [size]. Could block if the system's entropy source is empty
*/
public fun generateNonce(size: Int): ByteArray = buildPacket {
while (this.size < size) {
writeText(generateNonce())
}
}.readBytes(size)
/**
* Compute SHA-1 hash for the specified [bytes]
*/
public expect fun sha1(bytes: ByteArray): ByteArray
/**
* Create [Digest] from specified hash [name].
*/
@Suppress("FunctionName")
public expect fun Digest(name: String): Digest
/**
* Stateful digest class specified to calculate digest.
*/
public interface Digest {
/**
* Add [bytes] to digest value.
*/
public operator fun plusAssign(bytes: ByteArray)
/**
* Reset [Digest] state.
*/
public fun reset()
/**
* Calculate digest bytes.
*/
public suspend fun build(): ByteArray
}
/**
* Calculate digest from current state and specified [bytes].
*/
@InternalAPI
public suspend fun Digest.build(bytes: ByteArray): ByteArray {
this += bytes
return build()
}
/**
* Calculate digest from current state and specified [string].
*/
@InternalAPI
public suspend fun Digest.build(string: String, charset: Charset = Charsets.UTF_8): ByteArray {
this += string.toByteArray(charset)
return build()
}
| apache-2.0 | 040cf59a1a376d7946da62bdd9d56bf4 | 23.252252 | 118 | 0.665676 | 3.770308 | false | false | false | false |
ktorio/ktor | ktor-client/ktor-client-core/common/src/io/ktor/client/request/forms/formDsl.kt | 1 | 6891 | /*
* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
package io.ktor.client.request.forms
import io.ktor.http.*
import io.ktor.http.content.*
import io.ktor.util.*
import io.ktor.utils.io.*
import io.ktor.utils.io.core.*
import kotlin.contracts.*
/**
* A multipart form item. Use it to build a form in client.
*
* @param key multipart name
* @param value content, could be [String], [Number], [ByteArray], [ByteReadPacket] or [InputProvider]
* @param headers part headers, note that some servers may fail if an unknown header provided
*/
public data class FormPart<T : Any>(val key: String, val value: T, val headers: Headers = Headers.Empty)
/**
* Builds a multipart form from [values].
*
* Example: [Upload a file](https://ktor.io/docs/request.html#upload_file).
*/
public fun formData(vararg values: FormPart<*>): List<PartData> {
val result = mutableListOf<PartData>()
values.forEach { (key, value, headers) ->
val partHeaders = HeadersBuilder().apply {
append(HttpHeaders.ContentDisposition, "form-data; name=${key.escapeIfNeeded()}")
appendAll(headers)
}
val part = when (value) {
is String -> PartData.FormItem(value, {}, partHeaders.build())
is Number -> PartData.FormItem(value.toString(), {}, partHeaders.build())
is ByteArray -> {
partHeaders.append(HttpHeaders.ContentLength, value.size.toString())
PartData.BinaryItem({ ByteReadPacket(value) }, {}, partHeaders.build())
}
is ByteReadPacket -> {
partHeaders.append(HttpHeaders.ContentLength, value.remaining.toString())
PartData.BinaryItem({ value.copy() }, { value.close() }, partHeaders.build())
}
is InputProvider -> {
val size = value.size
if (size != null) {
partHeaders.append(HttpHeaders.ContentLength, size.toString())
}
PartData.BinaryItem(value.block, {}, partHeaders.build())
}
is ChannelProvider -> {
val size = value.size
if (size != null) {
partHeaders.append(HttpHeaders.ContentLength, size.toString())
}
PartData.BinaryChannelItem(value.block, partHeaders.build())
}
is Input -> error("Can't use [Input] as part of form: $value. Consider using [InputProvider] instead.")
else -> error("Unknown form content type: $value")
}
result += part
}
return result
}
/**
* Build multipart form using [block] function.
*/
public fun formData(block: FormBuilder.() -> Unit): List<PartData> =
formData(*FormBuilder().apply(block).build().toTypedArray())
/**
* A form builder type used in the [formData] builder function.
*/
public class FormBuilder internal constructor() {
private val parts = mutableListOf<FormPart<*>>()
/**
* Appends a pair [key]:[value] with optional [headers].
*/
@InternalAPI
public fun <T : Any> append(key: String, value: T, headers: Headers = Headers.Empty) {
parts += FormPart(key, value, headers)
}
/**
* Appends a pair [key]:[value] with optional [headers].
*/
public fun append(key: String, value: String, headers: Headers = Headers.Empty) {
parts += FormPart(key, value, headers)
}
/**
* Appends a pair [key]:[value] with optional [headers].
*/
public fun append(key: String, value: Number, headers: Headers = Headers.Empty) {
parts += FormPart(key, value, headers)
}
/**
* Appends a pair [key]:[value] with optional [headers].
*/
public fun append(key: String, value: ByteArray, headers: Headers = Headers.Empty) {
parts += FormPart(key, value, headers)
}
/**
* Appends a pair [key]:[value] with optional [headers].
*/
public fun append(key: String, value: InputProvider, headers: Headers = Headers.Empty) {
parts += FormPart(key, value, headers)
}
/**
* Appends a pair [key]:[InputProvider(block)] with optional [headers].
*/
public fun appendInput(key: String, headers: Headers = Headers.Empty, size: Long? = null, block: () -> Input) {
parts += FormPart(key, InputProvider(size, block), headers)
}
/**
* Appends a pair [key]:[value] with optional [headers].
*/
public fun append(key: String, value: ByteReadPacket, headers: Headers = Headers.Empty) {
parts += FormPart(key, value, headers)
}
/**
* Appends a pair [key]:[ChannelProvider] with optional [headers].
*/
public fun append(key: String, value: ChannelProvider, headers: Headers = Headers.Empty) {
parts += FormPart(key, value, headers)
}
/**
* Appends a form [part].
*/
public fun <T : Any> append(part: FormPart<T>) {
parts += part
}
internal fun build(): List<FormPart<*>> = parts
}
/**
* Appends a form part with the specified [key] using [bodyBuilder] for its body.
*/
@OptIn(ExperimentalContracts::class)
public inline fun FormBuilder.append(
key: String,
headers: Headers = Headers.Empty,
size: Long? = null,
crossinline bodyBuilder: BytePacketBuilder.() -> Unit
) {
contract {
callsInPlace(bodyBuilder, InvocationKind.EXACTLY_ONCE)
}
append(FormPart(key, InputProvider(size) { buildPacket { bodyBuilder() } }, headers))
}
/**
* A reusable [Input] form entry.
*
* @property size estimate for data produced by the block or `null` if no size estimation known
* @param block: content generator
*/
public class InputProvider(public val size: Long? = null, public val block: () -> Input)
/**
* Supplies a new [ByteReadChannel].
* @property size is total amount of bytes that can be read from [ByteReadChannel] or `null` if [size] is unknown
* @param block returns a new [ByteReadChannel]
*/
public class ChannelProvider(public val size: Long? = null, public val block: () -> ByteReadChannel)
/**
* Appends a form part with the specified [key], [filename], and optional [contentType] using [bodyBuilder] for its body.
*/
@OptIn(ExperimentalContracts::class)
public fun FormBuilder.append(
key: String,
filename: String,
contentType: ContentType? = null,
size: Long? = null,
bodyBuilder: BytePacketBuilder.() -> Unit
) {
contract {
callsInPlace(bodyBuilder, InvocationKind.EXACTLY_ONCE)
}
val headersBuilder = HeadersBuilder()
headersBuilder[HttpHeaders.ContentDisposition] = "filename=${filename.escapeIfNeeded()}"
contentType?.run { headersBuilder[HttpHeaders.ContentType] = this.toString() }
val headers = headersBuilder.build()
append(key, headers, size, bodyBuilder)
}
| apache-2.0 | 5739e3ee9a848ec12fc5b5c7cb6831a8 | 32.945813 | 121 | 0.631258 | 4.183971 | false | false | false | false |
ledboot/Toffee | app/src/main/java/com/ledboot/toffee/widget/refreshLoadView/LoadMoreView.kt | 1 | 2184 | package com.ledboot.toffee.widget.refreshLoadView
import android.annotation.SuppressLint
import androidx.annotation.LayoutRes
/**
* Created by Gwynn on 17/10/16.
*/
abstract class LoadMoreView {
var loadMoreStatus = STATUS_DEFAULT
var mLoadMoreEndGone = false
companion object {
val STATUS_DEFAULT: Int = 1
val STATUS_LOADING: Int = 2
val STATUS_FAIL: Int = 3
val STATUS_END: Int = 4
}
fun convert(holder: BaseViewHolder<*>) {
when (loadMoreStatus) {
STATUS_DEFAULT -> {
visibleLoading(holder, false)
visibleLoadFail(holder, false)
visibleLoadEnd(holder, false)
}
STATUS_LOADING -> {
visibleLoading(holder, true)
visibleLoadFail(holder, false)
visibleLoadEnd(holder, false)
}
STATUS_FAIL -> {
visibleLoading(holder, false)
visibleLoadFail(holder, true)
visibleLoadEnd(holder, false)
}
STATUS_END -> {
visibleLoading(holder, false)
visibleLoadFail(holder, false)
visibleLoadEnd(holder, true)
}
}
}
@SuppressLint("ResourceType")
private fun visibleLoading(holder: BaseViewHolder<*>, visible: Boolean) {
holder.setVisible(loadingViewId, visible)
}
@SuppressLint("ResourceType")
private fun visibleLoadFail(holder: BaseViewHolder<*>, visible: Boolean) {
holder.setVisible(loadingFailViewId, visible)
}
@SuppressLint("ResourceType")
private fun visibleLoadEnd(holder: BaseViewHolder<*>, visible: Boolean) {
if (loadingEndViewId != 0) {
holder.setVisible(loadingEndViewId, visible)
}
}
fun isLoadEndMoreGone(): Boolean {
if (loadingEndViewId == 0) return true
return mLoadMoreEndGone
}
@get:LayoutRes
abstract val layoutId: Int
@get:LayoutRes
abstract val loadingViewId: Int
@get:LayoutRes
abstract val loadingFailViewId: Int
@get:LayoutRes
abstract val loadingEndViewId: Int
} | apache-2.0 | 57ced5c617680981a7ec1577c1c4f3b4 | 25.975309 | 78 | 0.600733 | 4.737527 | false | false | false | false |
inorichi/mangafeed | app/src/main/java/eu/kanade/tachiyomi/widget/MinMaxNumberPicker.kt | 3 | 1393 | package eu.kanade.tachiyomi.widget
import android.content.Context
import android.text.InputType
import android.util.AttributeSet
import android.widget.EditText
import android.widget.NumberPicker
import androidx.core.view.doOnLayout
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.view.findDescendant
class MinMaxNumberPicker @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) :
NumberPicker(context, attrs) {
override fun setDisplayedValues(displayedValues: Array<out String>?) {
super.setDisplayedValues(displayedValues)
// Disable keyboard input when a value that can't be auto-filled with number exists
val notNumberValue = displayedValues?.find { it.getOrNull(0)?.digitToIntOrNull() == null }
if (notNumberValue != null) {
descendantFocusability = FOCUS_BLOCK_DESCENDANTS
}
}
init {
if (attrs != null) {
val ta = context.obtainStyledAttributes(attrs, R.styleable.MinMaxNumberPicker, 0, 0)
try {
minValue = ta.getInt(R.styleable.MinMaxNumberPicker_min, 0)
maxValue = ta.getInt(R.styleable.MinMaxNumberPicker_max, 0)
} finally {
ta.recycle()
}
}
doOnLayout {
findDescendant<EditText>()?.setRawInputType(InputType.TYPE_CLASS_NUMBER)
}
}
}
| apache-2.0 | 2ebed516190c624153b544d979832aa3 | 33.825 | 99 | 0.674085 | 4.522727 | false | false | false | false |
onnerby/musikcube | src/musikdroid/app/src/main/java/io/casey/musikcube/remote/service/websocket/SocketMessage.kt | 1 | 7756 | package io.casey.musikcube.remote.service.websocket
import android.util.Log
import io.casey.musikcube.remote.Application
import org.json.JSONArray
import org.json.JSONException
import org.json.JSONObject
import java.util.*
import java.util.concurrent.atomic.AtomicInteger
class SocketMessage private constructor(val name: String, val id: String, val type: SocketMessage.Type, options: JSONObject?) {
enum class Type constructor(val rawType: String) {
Request("request"),
Response("response"),
Broadcast("broadcast");
companion object {
fun fromString(str: String): Type =
when (str) {
Request.rawType -> Request
Response.rawType -> Response
Broadcast.rawType -> Broadcast
else -> throw IllegalArgumentException("str")
}
}
}
private val options: JSONObject
init {
if (name.isEmpty() || id.isEmpty()) {
throw IllegalArgumentException()
}
this.options = options ?: JSONObject()
}
@Suppress("UNCHECKED_CAST", "unused")
fun <T> getOption(key: String): T? {
if (options.has(key)) {
try {
return options.get(key) as T
}
catch (ex: JSONException) {
/* swallow */
}
}
return null
}
@JvmOverloads fun getStringOption(key: String, defaultValue: String = ""): String {
if (options.has(key)) {
try {
return options.getString(key)
}
catch (ex: JSONException) {
/* swallow */
}
}
return defaultValue
}
@JvmOverloads fun getIntOption(key: String, defaultValue: Int = 0): Int {
if (options.has(key)) {
try {
return options.getInt(key)
}
catch (ex: JSONException) {
/* swallow */
}
}
return defaultValue
}
@JvmOverloads fun getLongOption(key: String, defaultValue: Long = 0): Long {
if (options.has(key)) {
try {
return options.getLong(key)
}
catch (ex: JSONException) {
/* swallow */
}
}
return defaultValue
}
@JvmOverloads fun getDoubleOption(key: String, defaultValue: Double = 0.0): Double {
if (options.has(key)) {
try {
return options.getDouble(key)
}
catch (ex: JSONException) {
/* swallow */
}
}
return defaultValue
}
@JvmOverloads fun getBooleanOption(key: String, defaultValue: Boolean = false): Boolean {
if (options.has(key)) {
try {
return options.getBoolean(key)
}
catch (ex: JSONException) {
/* swallow */
}
}
return defaultValue
}
fun getJsonObject(): JSONObject {
return JSONObject(options.toString())
}
@JvmOverloads fun getJsonObjectOption(key: String, defaultValue: JSONObject? = null): JSONObject? {
if (options.has(key)) {
try {
return options.getJSONObject(key)
}
catch (ex: JSONException) {
/* swallow */
}
}
return defaultValue
}
@JvmOverloads fun getJsonArrayOption(key: String, defaultValue: JSONArray? = null): JSONArray? {
if (options.has(key)) {
try {
return options.getJSONArray(key)
}
catch (ex: JSONException) {
/* swallow */
}
}
return defaultValue
}
override fun toString(): String {
try {
val json = JSONObject()
json.put("name", name)
json.put("id", id)
json.put("device_id", Application.deviceId)
json.put("type", type.rawType)
json.put("options", options)
return json.toString()
}
catch (ex: JSONException) {
throw RuntimeException("unable to generate output JSON!")
}
}
@Suppress("unused")
fun buildUpon(): Builder {
try {
val builder = Builder()
builder.internalName = name
builder.internalType = type
builder.internalId = id
builder.internalOptions = JSONObject(options.toString())
return builder
}
catch (ex: JSONException) {
throw RuntimeException(ex)
}
}
class Builder internal constructor() {
internal var internalName: String? = null
internal var internalType: Type? = null
internal var internalId: String? = null
internal var internalOptions = JSONObject()
fun withOptions(options: JSONObject?): Builder {
internalOptions = options ?: JSONObject()
return this
}
fun addOption(key: String, value: Any?): Builder {
try {
internalOptions.put(key, value)
}
catch (ex: JSONException) {
throw RuntimeException("addOption failed??")
}
return this
}
@Suppress("unused")
fun removeOption(key: String): Builder {
internalOptions.remove(key)
return this
}
fun build(): SocketMessage {
return SocketMessage(internalName!!, internalId!!, internalType!!, internalOptions)
}
companion object {
private val nextId = AtomicInteger()
private fun newId(): String {
return String.format(Locale.ENGLISH, "musikcube-android-client-%d", nextId.incrementAndGet())
}
@Suppress("unused")
fun broadcast(name: String): Builder {
val builder = Builder()
builder.internalName = name
builder.internalId = newId()
builder.internalType = Type.Response
return builder
}
fun respondTo(message: SocketMessage): Builder {
val builder = Builder()
builder.internalName = message.name
builder.internalId = message.id
builder.internalType = Type.Response
return builder
}
fun request(name: String): Builder {
val builder = Builder()
builder.internalName = name
builder.internalId = newId()
builder.internalType = Type.Request
return builder
}
fun request(name: Messages.Request): Builder {
val builder = Builder()
builder.internalName = name.toString()
builder.internalId = newId()
builder.internalType = Type.Request
return builder
}
}
}
companion object {
private val TAG = SocketMessage::class.java.canonicalName
fun create(string: String): SocketMessage? =
try {
val `object` = JSONObject(string)
val name = `object`.getString("name")
val type = Type.fromString(`object`.getString("type"))
val id = `object`.getString("id")
val options = `object`.optJSONObject("options")
SocketMessage(name, id, type, options)
}
catch (ex: Exception) {
Log.e(TAG, ex.toString())
null
}
}
}
| bsd-3-clause | ac440a59bd0ec3e53ef3359fa9af212f | 29.062016 | 127 | 0.514569 | 5.323267 | false | false | false | false |
Philip-Trettner/GlmKt | GlmKtGen/src/code/Argument.kt | 1 | 509 | package code
import types.AbstractType
import types.FixedType
data class Argument(val name: String, val type: AbstractType, val default: String = "") {
override fun toString() = when (default) {
"" -> "$name: ${type.typeName}"
else -> "$name: ${type.typeName} = $default"
}
}
fun argOf(name: String, type: AbstractType, default: String = "") = listOf(Argument(name, type, default))
fun argOf(name: String, type: String, default: String = "") = argOf(name, FixedType(type), default)
| mit | 59f175d756c86e2979f8d475302a6fa4 | 35.357143 | 105 | 0.664047 | 3.559441 | false | false | false | false |
inorichi/mangafeed | app/src/main/java/eu/kanade/tachiyomi/data/download/model/Download.kt | 2 | 1406 | package eu.kanade.tachiyomi.data.download.model
import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.online.HttpSource
import rx.subjects.PublishSubject
class Download(val source: HttpSource, val manga: Manga, val chapter: Chapter) {
var pages: List<Page>? = null
@Volatile
@Transient
var totalProgress: Int = 0
@Volatile
@Transient
var downloadedImages: Int = 0
@Volatile
@Transient
var status: State = State.NOT_DOWNLOADED
set(status) {
field = status
statusSubject?.onNext(this)
statusCallback?.invoke(this)
}
@Transient
private var statusSubject: PublishSubject<Download>? = null
@Transient
private var statusCallback: ((Download) -> Unit)? = null
val progress: Int
get() {
val pages = pages ?: return 0
return pages.map(Page::progress).average().toInt()
}
fun setStatusSubject(subject: PublishSubject<Download>?) {
statusSubject = subject
}
fun setStatusCallback(f: ((Download) -> Unit)?) {
statusCallback = f
}
enum class State(val value: Int) {
NOT_DOWNLOADED(0),
QUEUE(1),
DOWNLOADING(2),
DOWNLOADED(3),
ERROR(4),
}
}
| apache-2.0 | 3c265e058e6edaec634608aa0f485b32 | 23.666667 | 80 | 0.636558 | 4.36646 | false | false | false | false |
isapp/chips | app/src/main/java/com/isapp/chips/ChipsActivity.kt | 1 | 1679 | package com.isapp.chips
import android.os.Bundle
import android.support.design.widget.FloatingActionButton
import android.support.design.widget.Snackbar
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.Toolbar
import android.widget.ImageView
import java.util.*
class ChipsActivity : AppCompatActivity() {
private lateinit var chips: ChipsView
private lateinit var fab: FloatingActionButton
private var freeForm = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_chips)
val toolbar = findViewById(R.id.toolbar) as Toolbar
setSupportActionBar(toolbar)
chips = findViewById(R.id.chips_view) as ChipsView
chips.chipsListener = object : ChipsListener {
override fun onLoadIcon(chip: Chip, imageView: ImageView) {
imageView.setImageResource(R.mipmap.ic_launcher)
}
override fun onChipClicked(chip: Chip) {
Snackbar.make(fab, "${chip.text} clicked", Snackbar.LENGTH_SHORT).show()
}
override fun onChipDeleted(chip: Chip) {
chips.removeChip(chip)
}
}
fab = findViewById(R.id.fab) as FloatingActionButton
fab.setOnClickListener({ view ->
chips.addChip(Chip(UUID.randomUUID().toString().take(Random().nextInt(32 - 2 + 1) + 2), deletable = randomBool(), icon = randomBool()))
})
fab.setOnLongClickListener {
if(freeForm) {
chips.orientation = ChipsView.HORIZONTAL
}
else {
chips.orientation = ChipsView.VERTICAL
}
freeForm = !freeForm
true
}
}
}
private fun randomBool() = Math.random() >= .5
| mit | d814258e17fec02c16d1f7c5676fd435 | 28.45614 | 141 | 0.702204 | 4.187032 | false | false | false | false |
toonine/BalaFM | app/src/main/java/com/nice/balafm/LiveMessageAdapter.kt | 1 | 2870 | package com.nice.balafm
import android.content.Context
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.RelativeLayout
import android.widget.TextView
import com.bumptech.glide.Glide
import com.nice.balafm.bean.LiveMessage
import com.nice.balafm.bean.Type
import de.hdodenhof.circleimageview.CircleImageView
class LiveMessageAdapter(private val messageList: List<LiveMessage>) : RecyclerView.Adapter<LiveMessageAdapter.ViewHolder>() {
private var mContext: Context? = null
class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val meMessageLayout = view.findViewById<RelativeLayout>(R.id.me_message_layout)!!
val otherMessageLayout = view.findViewById<RelativeLayout>(R.id.other_message_layout)!!
val meMessageTextView = view.findViewById<TextView>(R.id.me_message_text_view)!!
val otherMessageTextView = view.findViewById<TextView>(R.id.other_message_text_view)!!
val meNickNameTextView = view.findViewById<TextView>(R.id.me_nick_name)!!
val otherNickName = view.findViewById<TextView>(R.id.other_nick_name)!!
val meHeadPicImage = view.findViewById<CircleImageView>(R.id.me_head_pic)!!
val otherHeadPicImage = view.findViewById<CircleImageView>(R.id.other_head_pic)!!
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
if (mContext == null) {
mContext = parent.context
}
val view = LayoutInflater.from(mContext).inflate(R.layout.live_message_item, parent, false)
return ViewHolder(view)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val liveMessage = messageList[position]
when (liveMessage.type) {
Type.SENT -> {
holder.meMessageLayout.visibility = View.VISIBLE
holder.otherMessageLayout.visibility = View.GONE
Glide.with(mContext).load(liveMessage.heedPic).placeholder(R.drawable.ic_user_default_head).error(R.drawable.ic_user_default_head).into(holder.meHeadPicImage)
holder.meNickNameTextView.text = liveMessage.nickName
holder.meMessageTextView.text = liveMessage.content
}
Type.RECEIVED -> {
holder.otherMessageLayout.visibility = View.VISIBLE
holder.meMessageLayout.visibility = View.GONE
Glide.with(mContext).load(liveMessage.heedPic).placeholder(R.drawable.ic_user_default_head).error(R.drawable.ic_user_default_head).into(holder.otherHeadPicImage)
holder.otherNickName.text = liveMessage.nickName
holder.otherMessageTextView.text = liveMessage.content
}
}
}
override fun getItemCount() = messageList.size
}
| apache-2.0 | 5e4425d48add3a4ad3778b0de81df98e | 46.04918 | 177 | 0.70662 | 4.226804 | false | false | false | false |
awsdocs/aws-doc-sdk-examples | kotlin/services/sagemaker/src/main/kotlin/com/kotlin/sage/DescribeTrainingJob.kt | 1 | 1759 | // snippet-sourcedescription:[DescribeTrainingJob.kt demonstrates how to obtain information about a training job.]
// snippet-keyword:[AWS SDK for Kotlin]
// snippet-keyword:[Amazon SageMaker]
/*
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package com.kotlin.sage
// snippet-start:[sagemaker.kotlin.describe_train_job.import]
import aws.sdk.kotlin.services.sagemaker.SageMakerClient
import aws.sdk.kotlin.services.sagemaker.model.DescribeTrainingJobRequest
import kotlin.system.exitProcess
// snippet-end:[sagemaker.kotlin.describe_train_job.import]
/**
Before running this Kotlin code example, set up your development environment,
including your credentials.
For more information, see the following documentation topic:
https://docs.aws.amazon.com/sdk-for-kotlin/latest/developer-guide/setup.html
*/
suspend fun main(args: Array<String>) {
val usage = """
Usage:
<trainingJobName>
Where:
trainingJobName - The name of the training job.
"""
if (args.size != 1) {
println(usage)
exitProcess(1)
}
val trainingJobName = args[0]
describeTrainJob(trainingJobName)
}
// snippet-start:[sagemaker.kotlin.describe_train_job.main]
suspend fun describeTrainJob(trainingJobNameVal: String?) {
val request = DescribeTrainingJobRequest {
trainingJobName = trainingJobNameVal
}
SageMakerClient { region = "us-west-2" }.use { sageMakerClient ->
val jobResponse = sageMakerClient.describeTrainingJob(request)
println("The job status is ${jobResponse.trainingJobStatus}")
}
}
// snippet-end:[sagemaker.kotlin.describe_train_job.main]
| apache-2.0 | ce3de350c3472ae3b95ae0271ab025c9 | 28.859649 | 114 | 0.710063 | 3.952809 | false | false | false | false |
securityfirst/Umbrella_android | app/src/main/java/org/secfirst/umbrella/feature/segment/view/SegmentCard.kt | 1 | 2237 | package org.secfirst.umbrella.feature.segment.view
import android.view.View
import androidx.core.content.ContextCompat
import com.google.android.flexbox.FlexboxLayoutManager
import com.xwray.groupie.kotlinandroidextensions.Item
import com.xwray.groupie.kotlinandroidextensions.ViewHolder
import kotlinx.android.synthetic.main.segment_item.*
import org.jetbrains.anko.backgroundColor
import org.secfirst.umbrella.R
import org.secfirst.umbrella.data.database.segment.Markdown
import org.secfirst.umbrella.misc.appContext
open class SegmentCard(private val onClickSegment: (Int) -> Unit,
private val onSegmentShareClick: (Markdown) -> Unit,
private val onSegmentFavoriteClick: (Markdown) -> Unit,
private val markdown: Markdown?) : Item() {
private lateinit var viewHolder: ViewHolder
override fun bind(viewHolder: ViewHolder, position: Int) {
val colours = intArrayOf(R.color.umbrella_purple,
R.color.umbrella_green,
R.color.umbrella_yellow)
this.viewHolder = viewHolder
markdown?.let { safeMarkdown ->
viewHolder.segmentFavorite.isChecked = safeMarkdown.favorite
viewHolder.segmentFavorite.setOnClickListener {
markdown.favorite = viewHolder.segmentFavorite.isChecked
onSegmentFavoriteClick(safeMarkdown)
}
viewHolder.segmentLayout.setOnClickListener { onClickSegment(position) }
viewHolder.segmentShare.setOnClickListener { onSegmentShareClick(safeMarkdown) }
with(markdown) {
val index = position + 1
viewHolder.segmentIndex.text = index.toString()
viewHolder.segmentDescription.text = title
viewHolder.segmentLayout.backgroundColor = ContextCompat.getColor(appContext(), colours[position % 3])
}
}
val lp = viewHolder.segmentCardItemView.layoutParams
if (lp is FlexboxLayoutManager.LayoutParams)
lp.flexGrow = 1f
if (markdown == null)
viewHolder.segmentCardItemView.visibility = View.INVISIBLE
}
override fun getLayout() = R.layout.segment_item
} | gpl-3.0 | 96d8d192c1baeeec976145a60ad4ab44 | 38.964286 | 118 | 0.685293 | 5.107306 | false | false | false | false |
apache/isis | incubator/clients/kroviz/src/main/kotlin/org/apache/causeway/client/kroviz/core/event/RoXmlHttpRequest.kt | 2 | 5678 | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.causeway.client.kroviz.core.event
import org.apache.causeway.client.kroviz.core.aggregator.AggregatorWithLayout
import org.apache.causeway.client.kroviz.core.aggregator.BaseAggregator
import org.apache.causeway.client.kroviz.handler.ResponseHandler
import org.apache.causeway.client.kroviz.to.Link
import org.apache.causeway.client.kroviz.to.Method
import org.apache.causeway.client.kroviz.to.TObject
import org.apache.causeway.client.kroviz.ui.core.Constants
import org.apache.causeway.client.kroviz.ui.core.SessionManager
import org.apache.causeway.client.kroviz.utils.StringUtils
import org.apache.causeway.client.kroviz.utils.UrlUtils
import org.w3c.xhr.BLOB
import org.w3c.xhr.TEXT
import org.w3c.xhr.XMLHttpRequest
import org.w3c.xhr.XMLHttpRequestResponseType
/**
* The name is somewhat misleading, see: https://en.wikipedia.org/wiki/XMLHttpRequest
*/
class RoXmlHttpRequest(val aggregator: BaseAggregator?) {
private val xhr = XMLHttpRequest()
private val CONTENT_TYPE = "Content-Type"
private val ACCEPT = "Accept"
internal fun process(link: Link, subType: String) {
val method = link.method
var url = link.href
if (method != Method.POST.operation) {
url += StringUtils.argumentsAsUrlParameter(link)
}
val credentials: String = SessionManager.getCredentials()!!
xhr.open(method, url, true)
xhr.setRequestHeader("Authorization", "Basic $credentials")
xhr.setRequestHeader(CONTENT_TYPE, "application/$subType;charset=UTF-8")
xhr.setRequestHeader(ACCEPT, "application/$subType, ${Constants.pngMimeType}")
if (UrlUtils.isIcon(url)) {
xhr.responseType = XMLHttpRequestResponseType.BLOB
}
val body = buildBody(link)
val rs = buildResourceSpecificationAndSetupHandler(url, subType, body)
when {
body.isEmpty() -> xhr.send()
else -> xhr.send(body)
}
SessionManager.getEventStore().start(rs, method, body, aggregator)
}
private fun buildBody(link: Link): String {
return when {
link.hasArguments() -> StringUtils.argumentsAsBody(link)
link.method == Method.PUT.operation -> {
val logEntry = SessionManager.getEventStore().findBy(aggregator!!)
when (val obj = logEntry?.obj) {
is TObject -> StringUtils.propertiesAsBody(obj)
else -> ""
}
}
else -> ""
}
}
internal fun processNonREST(link: Link, subType: String) {
val method = link.method
val url = link.href
xhr.open(method, url, true)
xhr.setRequestHeader(CONTENT_TYPE, Constants.stdMimeType)
xhr.setRequestHeader(ACCEPT, Constants.svgMimeType)
val body = StringUtils.argumentsAsList(link)
xhr.send(body)
val rs = buildResourceSpecificationAndSetupHandler(url, subType, body)
SessionManager.getEventStore().start(rs, method, body, aggregator)
}
internal fun invokeKroki(pumlCode: String) {
val method = Method.POST.operation
val url = Constants.krokiUrl + "plantuml"
xhr.open(method, url, true)
xhr.setRequestHeader(CONTENT_TYPE, Constants.stdMimeType)
xhr.setRequestHeader(ACCEPT, Constants.svgMimeType)
val rs = buildResourceSpecificationAndSetupHandler(url, Constants.subTypeJson, pumlCode)
xhr.send(pumlCode)
SessionManager.getEventStore().start(rs, method, pumlCode, aggregator)
}
private fun buildResourceSpecificationAndSetupHandler(
url: String,
subType: String,
body: String
): ResourceSpecification {
val rs = ResourceSpecification(url, subType)
xhr.onload = { _ -> handleResult(rs, body) }
xhr.onerror = { _ -> handleError(rs) }
xhr.ontimeout = { _ -> handleError(rs) }
return rs
}
private fun handleResult(rs: ResourceSpecification, body: String) {
val response: Any? = xhr.response
val le: LogEntry? = SessionManager.getEventStore().end(rs, body, response)
if (le != null) {
when {
aggregator == null -> ResponseHandler.handle(le)
le.obj == null -> ResponseHandler.handle(le)
aggregator is AggregatorWithLayout -> aggregator.update(le, le.subType)
else -> ResponseHandler.handle(le)
}
}
}
private fun handleError(rs: ResourceSpecification) {
val error = when (xhr.responseType) {
XMLHttpRequestResponseType.BLOB -> "blob error"
XMLHttpRequestResponseType.TEXT -> xhr.responseText
else -> "neither text nor blob"
}
SessionManager.getEventStore().fault(rs, error)
}
}
| apache-2.0 | 6df5f60d5f310ebafe884c89e336f7cf | 37.107383 | 96 | 0.667136 | 4.334351 | false | false | false | false |
JetBrains/intellij-community | plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/quickfix/RemoveNameFromFunctionExpressionFix.kt | 1 | 2282 | // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.kotlin.idea.quickfix
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import org.jetbrains.kotlin.diagnostics.Diagnostic
import org.jetbrains.kotlin.idea.base.resources.KotlinBundle
import org.jetbrains.kotlin.idea.caches.resolve.analyze
import org.jetbrains.kotlin.idea.codeinsight.api.classic.quickfixes.CleanupFix
import org.jetbrains.kotlin.idea.codeinsight.api.classic.quickfixes.KotlinQuickFixAction
import org.jetbrains.kotlin.idea.util.createIntentionForFirstParentOfType
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.forEachDescendantOfType
import org.jetbrains.kotlin.resolve.BindingContext
class RemoveNameFromFunctionExpressionFix(element: KtNamedFunction) : KotlinQuickFixAction<KtNamedFunction>(element), CleanupFix {
override fun getText(): String = KotlinBundle.message("remove.identifier.from.anonymous.function")
override fun getFamilyName(): String = text
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
removeNameFromFunction(element ?: return)
}
companion object : KotlinSingleIntentionActionFactory() {
override fun createAction(diagnostic: Diagnostic) =
diagnostic.createIntentionForFirstParentOfType(::RemoveNameFromFunctionExpressionFix)
private fun removeNameFromFunction(function: KtNamedFunction) {
var wereAutoLabelUsages = false
val name = function.nameAsName ?: return
function.forEachDescendantOfType<KtReturnExpression> {
if (!wereAutoLabelUsages && it.getLabelNameAsName() == name) {
wereAutoLabelUsages = it.analyze().get(BindingContext.LABEL_TARGET, it.getTargetLabel()) == function
}
}
function.nameIdentifier?.delete()
if (wereAutoLabelUsages) {
val psiFactory = KtPsiFactory(function.project)
val newFunction = psiFactory.createExpressionByPattern("$0@ $1", name, function)
function.replace(newFunction)
}
}
}
}
| apache-2.0 | fb9c9ffa3c1088ba5e21009893e00629 | 45.571429 | 158 | 0.734882 | 5.015385 | false | false | false | false |
JetBrains/intellij-community | platform/testFramework/src/com/intellij/testFramework/utils/codeVision/CodeVisionTestCase.kt | 1 | 2663 | // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.testFramework.utils.codeVision
import com.intellij.codeInsight.codeVision.CodeVisionHost
import com.intellij.codeInsight.codeVision.CodeVisionInitializer
import com.intellij.codeInsight.codeVision.settings.CodeVisionSettings
import com.intellij.codeInsight.codeVision.ui.model.CodeVisionListData
import com.intellij.codeInsight.codeVision.ui.renderers.CodeVisionRenderer
import com.intellij.openapi.util.registry.Registry
import com.intellij.testFramework.TestModeFlags
import com.intellij.testFramework.utils.inlays.InlayHintsProviderTestCase
import com.intellij.testFramework.utils.inlays.InlayTestUtil
abstract class CodeVisionTestCase : InlayHintsProviderTestCase() {
protected open val onlyCodeVisionHintsAllowed: Boolean
get() = false
override fun setUp() {
Registry.get("editor.codeVision.new").setValue(true, testRootDisposable)
TestModeFlags.set(CodeVisionHost.isCodeVisionTestKey, true, testRootDisposable)
CodeVisionHost.isCodeVisionTestKey
super.setUp()
}
protected fun testProviders(expectedText: String, fileName: String, vararg enabledProviderIds: String) {
// set enabled providers
val settings = CodeVisionSettings.instance()
val codeVisionHost = CodeVisionInitializer.getInstance(project).getCodeVisionHost()
codeVisionHost.providers.forEach {
settings.setProviderEnabled(it.id, enabledProviderIds.contains(it.id))
}
val sourceText = InlayTestUtil.inlayPattern.matcher(expectedText).replaceAll("")
myFixture.configureByText(fileName, sourceText)
val editor = myFixture.editor
project.putUserData(CodeVisionHost.isCodeVisionTestKey, true)
codeVisionHost.providers.forEach {
if (it.id == "vcs.code.vision" && enabledProviderIds.contains(it.id)) {
it.preparePreview(myFixture.editor, myFixture.file)
}
}
myFixture.doHighlighting()
codeVisionHost.calculateCodeVisionSync(editor, testRootDisposable)
val actualText = dumpCodeVisionHints(sourceText)
assertEquals(expectedText, actualText)
}
private fun dumpCodeVisionHints(sourceText: String): String {
return InlayTestUtil.dumpHintsInternal(sourceText, myFixture, {
val rendererSupported = it.renderer is CodeVisionRenderer
if (onlyCodeVisionHintsAllowed && !rendererSupported) error("renderer not supported")
rendererSupported
}) { _, inlay ->
inlay.getUserData(CodeVisionListData.KEY)!!.visibleLens.joinToString(prefix = "[", postfix = "]", separator = " ") { it.longPresentation }
}
}
} | apache-2.0 | b514ee65f624d8d32c7be44da9c11e4b | 41.967742 | 146 | 0.781449 | 4.780969 | false | true | false | false |
chrislo27/RhythmHeavenRemixEditor2 | core/src/main/kotlin/io/github/chrislo27/rhre3/entity/model/ModelEntity.kt | 2 | 9086 | package io.github.chrislo27.rhre3.entity.model
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.badlogic.gdx.math.MathUtils
import com.badlogic.gdx.utils.Align
import com.fasterxml.jackson.databind.node.ObjectNode
import io.github.chrislo27.rhre3.editor.Editor
import io.github.chrislo27.rhre3.editor.Tool
import io.github.chrislo27.rhre3.entity.Entity
import io.github.chrislo27.rhre3.modding.ModdingUtils
import io.github.chrislo27.rhre3.sfxdb.SFXDatabase
import io.github.chrislo27.rhre3.sfxdb.datamodel.Datamodel
import io.github.chrislo27.rhre3.theme.Theme
import io.github.chrislo27.rhre3.track.Remix
import io.github.chrislo27.rhre3.util.Semitones
import io.github.chrislo27.rhre3.util.scaleFont
import io.github.chrislo27.rhre3.util.unscaleFont
import io.github.chrislo27.toolboks.registry.AssetRegistry
import io.github.chrislo27.toolboks.util.MathHelper
import io.github.chrislo27.toolboks.util.gdxutils.*
import kotlin.math.min
abstract class ModelEntity<out M : Datamodel>(remix: Remix, val datamodel: M)
: Entity(remix) {
companion object {
const val BORDER: Float = 4f
const val JSON_DATAMODEL = "datamodel"
private val TMP_COLOR = Color(1f, 1f, 1f, 1f)
var attemptTextOnScreen: Boolean = true
}
final override val jsonType: String = "model"
open val renderText: String
get() = datamodel.newlinedName
val isSpecialEntity: Boolean get() = datamodel.isSpecial
open var needsNameTooltip: Boolean = false
protected set
open val glassEffect: Boolean = true
init {
bounds.height = 1f
bounds.width = datamodel.duration
}
override fun saveData(objectNode: ObjectNode) {
super.saveData(objectNode)
objectNode.put(JSON_DATAMODEL, datamodel.id)
if (datamodel.game.isCustom) {
objectNode.put("isCustom", true)
}
}
override fun readData(objectNode: ObjectNode) {
super.readData(objectNode)
}
abstract fun getRenderColor(editor: Editor, theme: Theme): Color
protected open fun renderBeforeText(editor: Editor, batch: SpriteBatch) {
}
open fun getTextForSemitone(semitone: Int): String {
return Semitones.getSemitoneName(semitone)
}
private fun Color.rotateColour(glow: Boolean): Color {
val tmp = TMP_COLOR
val coeff = if (!glow) 1f else MathUtils.lerp(0.5f, 1.25f, MathHelper.getTriangleWave(1f))
tmp.a = a
tmp.r = b * coeff
tmp.g = r * coeff
tmp.b = g * coeff
return tmp
}
open fun renderWithGlass(editor: Editor, batch: SpriteBatch, glass: Boolean) {
val game = datamodel.game
val textColor = editor.theme.entities.nameColor
val text = renderText + (if (ModdingUtils.moddingToolsEnabled && editor.currentTool == Tool.RULER) {
SFXDatabase.moddingMetadata.currentData.joinToStringFromData(datamodel, this, keyColor = "#$textColor").takeIf { it.isNotEmpty() }?.let { "\n$it" } ?: ""
} else "")
val font = remix.main.defaultFont
val color = getRenderColor(editor, editor.theme)
val oldColor = batch.packedColor
val oldFontSizeX = font.data.scaleX
val oldFontSizeY = font.data.scaleY
val selectionTint = editor.theme.entities.selectionTint
val showSelection = isSelected
val x = bounds.x + lerpDifference.x
val y = bounds.y + lerpDifference.y
val height = bounds.height + lerpDifference.height
val width = bounds.width + lerpDifference.width
// filled rect + border
batch.setColorWithTintIfNecessary(selectionTint, color.r, color.g, color.b, color.a * (if (glass) 0.5f else 1f), necessary = showSelection)
batch.fillRect(x, y,
width, height)
batch.setColorWithTintIfNecessary(selectionTint, (color.r - 0.25f).coerceIn(0f, 1f),
(color.g - 0.25f).coerceIn(0f, 1f),
(color.b - 0.25f).coerceIn(0f, 1f),
color.a, necessary = showSelection)
if (this is IStretchable && this.isStretchable) {
val oldColor = batch.packedColor
val arrowWidth: Float = min(width / 2f, Editor.ENTITY_HEIGHT / Editor.ENTITY_WIDTH)
val y = y + height / 2 - 0.5f
val arrowTex = AssetRegistry.get<Texture>("entity_stretchable_arrow")
batch.setColorWithTintIfNecessary(selectionTint, (color.r - 0.25f).coerceIn(0f, 1f),
(color.g - 0.25f).coerceIn(0f, 1f),
(color.b - 0.25f).coerceIn(0f, 1f),
color.a * 0.5f, necessary = showSelection)
batch.draw(arrowTex, x + arrowWidth, y, width - arrowWidth * 2, 1f,
arrowTex.width / 2, 0, arrowTex.width / 2,
arrowTex.height, false, false)
batch.draw(arrowTex, x, y, arrowWidth, 1f,
0, 0, arrowTex.width / 2, arrowTex.height, false, false)
batch.draw(arrowTex, x + width, y, -arrowWidth, 1f,
0, 0, arrowTex.width / 2, arrowTex.height, false, false)
batch.packedColor = oldColor
}
batch.drawRect(x, y,
width, height,
editor.toScaleX(BORDER), editor.toScaleY(BORDER))
renderBeforeText(editor, batch)
batch.setColor(1f, 1f, 1f, 0.5f)
val iconSizeY = 1f - 4 * (editor.toScaleY(BORDER))
val iconSizeX = editor.toScaleX(iconSizeY * Editor.ENTITY_HEIGHT)
batch.draw(game.icon,
x + 2 * (editor.toScaleX(BORDER)),
y + 2 * editor.toScaleY(BORDER) + ((height - 4 * editor.toScaleY(
BORDER)) - iconSizeY) / 2,
iconSizeX, iconSizeY)
batch.packedColor = oldColor
val oldFontColor = font.color
val fontScale = 0.6f
font.color = textColor
font.data.setScale(oldFontSizeX * fontScale, oldFontSizeY * fontScale)
// width - iconSizeX - 6 * (editor.toScaleX(BORDER))
val allottedWidth = width - 2 * (editor.toScaleX(BORDER))
val allottedHeight = height - 4 * (editor.toScaleY(BORDER))
val textHeight = font.getTextHeight(text, allottedWidth, true)
val textX = x + 1 * (editor.toScaleX(BORDER))
val textY = y + height / 2
if (textHeight > allottedHeight) {
val ratio = min(allottedWidth / (font.getTextWidth(text, allottedWidth, false)), allottedHeight / textHeight)
font.data.setScale(ratio * font.data.scaleX, ratio * font.data.scaleY)
}
needsNameTooltip = textHeight > allottedHeight
var newTextWidth = allottedWidth
if (attemptTextOnScreen) {
val camera = editor.camera
val outerBound = camera.position.x + camera.viewportWidth / 2 * camera.zoom
if (textX + newTextWidth > outerBound) {
newTextWidth = (outerBound) - textX
}
newTextWidth = newTextWidth.coerceAtLeast(font.getTextWidth(text)).coerceAtMost(allottedWidth)
}
font.draw(batch, text, textX, textY + font.getTextHeight(text, newTextWidth, true) / 2, newTextWidth, Align.right, true)
when (editor.scrollMode) {
Editor.ScrollMode.PITCH -> {
if (this is IRepitchable && (this.canBeRepitched || this.semitone != 0)) {
drawCornerText(editor, batch, getTextForSemitone(semitone), !this.canBeRepitched, x, y)
}
}
Editor.ScrollMode.VOLUME -> {
if (this is IVolumetric && (this.isVolumetric || this.volumePercent != IVolumetric.DEFAULT_VOLUME)) {
drawCornerText(editor, batch, IVolumetric.getVolumeText(this.volumePercent), !this.isVolumetric, x, y)
}
}
}
font.color = oldFontColor
font.data.setScale(oldFontSizeX, oldFontSizeY)
}
final override fun render(editor: Editor, batch: SpriteBatch) {
renderWithGlass(editor, batch, false)
}
private fun drawCornerText(editor: Editor, batch: SpriteBatch, text: String, useNegativeColor: Boolean, x: Float, y: Float) {
val borderedFont = remix.main.defaultBorderedFont
editor.apply {
borderedFont.scaleFont(editor.camera)
}
borderedFont.scaleMul(0.75f)
if (useNegativeColor) {
borderedFont.setColor(1f, 0.8f, 0.8f, 1f)
} else {
borderedFont.setColor(1f, 1f, 1f, 1f)
}
borderedFont.draw(batch, text,
x + 2 * editor.toScaleX(BORDER),
y + 2 * editor.toScaleY(BORDER) + borderedFont.capHeight)
editor.apply {
borderedFont.unscaleFont()
}
}
} | gpl-3.0 | decd2b2b570784e77c31c5c18efd0319 | 41.265116 | 165 | 0.616993 | 3.965954 | false | false | false | false |
mikepenz/Android-Iconics | community-material-typeface-library/src/main/java/com/mikepenz/iconics/typeface/library/community/material/CommunityMaterial.kt | 1 | 281640 | /*
* Copyright 2020 Mike Penz
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.mikepenz.iconics.typeface.library.community.material
import com.mikepenz.iconics.typeface.IIcon
import com.mikepenz.iconics.typeface.ITypeface
import com.mikepenz.iconics.typeface.library.community.R
import java.util.LinkedList
@Suppress("EnumEntryName")
object CommunityMaterial : ITypeface {
override val fontRes: Int
get() = R.font.community_material_design_icons_font_v7_0_96
override val characters: Map<String, Char> by lazy {
mutableMapOf<String, Char>().apply {
Icon.values().associateTo(this) { it.name to it.character }
Icon2.values().associateTo(this) { it.name to it.character }
Icon3.values().associateTo(this) { it.name to it.character }
}
}
override val mappingPrefix: String
get() = "cmd"
override val fontName: String
get() = "Community Material Design"
override val version: String
get() = "7.0.96.0"
override val iconCount: Int
get() = characters.size
override val icons: List<String>
get() = characters.keys.toCollection(LinkedList())
override val author: String
get() = "Templarian / Community / Google"
override val url: String
get() = "http://materialdesignicons.com/"
override val description: String
get() = "7000+ Material Design Icons from the Community"
override val license: String
get() = "Pictogrammers Free License"
override val licenseUrl: String
get() = "https://github.com/Templarian/MaterialDesign/blob/master/LICENSE"
override fun getIcon(key: String): IIcon {
try {
return Icon.valueOf(key)
} catch (ex: Exception) {
// ignore error, if not in 1st set, it has to be in the second
}
try {
return Icon2.valueOf(key)
} catch (ex: Exception) {
// ignore error, if not in 1st set, it has to be in the second
}
return Icon3.valueOf(key)
}
enum class Icon constructor(override val character: Char) : IIcon {
cmd_ab_testing('\ua001'),
cmd_abacus('\ua002'),
cmd_abjad_arabic('\ua003'),
cmd_abjad_hebrew('\ua004'),
cmd_abugida_devanagari('\ua005'),
cmd_abugida_thai('\ua006'),
cmd_access_point('\ua00e'),
cmd_access_point_check('\ua007'),
cmd_access_point_minus('\ua008'),
cmd_access_point_network('\ua00a'),
cmd_access_point_network_off('\ua009'),
cmd_access_point_off('\ua00b'),
cmd_access_point_plus('\ua00c'),
cmd_access_point_remove('\ua00d'),
cmd_account('\ua086'),
cmd_account_alert('\ua010'),
cmd_account_alert_outline('\ua00f'),
cmd_account_arrow_down('\ua012'),
cmd_account_arrow_down_outline('\ua011'),
cmd_account_arrow_left('\ua014'),
cmd_account_arrow_left_outline('\ua013'),
cmd_account_arrow_right('\ua016'),
cmd_account_arrow_right_outline('\ua015'),
cmd_account_arrow_up('\ua018'),
cmd_account_arrow_up_outline('\ua017'),
cmd_account_badge('\ua01a'),
cmd_account_badge_outline('\ua019'),
cmd_account_box('\ua01e'),
cmd_account_box_multiple('\ua01c'),
cmd_account_box_multiple_outline('\ua01b'),
cmd_account_box_outline('\ua01d'),
cmd_account_cancel('\ua020'),
cmd_account_cancel_outline('\ua01f'),
cmd_account_card('\ua022'),
cmd_account_card_outline('\ua021'),
cmd_account_cash('\ua024'),
cmd_account_cash_outline('\ua023'),
cmd_account_check('\ua026'),
cmd_account_check_outline('\ua025'),
cmd_account_child('\ua029'),
cmd_account_child_circle('\ua027'),
cmd_account_child_outline('\ua028'),
cmd_account_circle('\ua02b'),
cmd_account_circle_outline('\ua02a'),
cmd_account_clock('\ua02d'),
cmd_account_clock_outline('\ua02c'),
cmd_account_cog('\ua02f'),
cmd_account_cog_outline('\ua02e'),
cmd_account_convert('\ua031'),
cmd_account_convert_outline('\ua030'),
cmd_account_cowboy_hat('\ua033'),
cmd_account_cowboy_hat_outline('\ua032'),
cmd_account_credit_card('\ua035'),
cmd_account_credit_card_outline('\ua034'),
cmd_account_details('\ua037'),
cmd_account_details_outline('\ua036'),
cmd_account_edit('\ua039'),
cmd_account_edit_outline('\ua038'),
cmd_account_eye('\ua03b'),
cmd_account_eye_outline('\ua03a'),
cmd_account_filter('\ua03d'),
cmd_account_filter_outline('\ua03c'),
cmd_account_group('\ua03f'),
cmd_account_group_outline('\ua03e'),
cmd_account_hard_hat('\ua041'),
cmd_account_hard_hat_outline('\ua040'),
cmd_account_heart('\ua043'),
cmd_account_heart_outline('\ua042'),
cmd_account_injury('\ua045'),
cmd_account_injury_outline('\ua044'),
cmd_account_key('\ua047'),
cmd_account_key_outline('\ua046'),
cmd_account_lock('\ua04b'),
cmd_account_lock_open('\ua049'),
cmd_account_lock_open_outline('\ua048'),
cmd_account_lock_outline('\ua04a'),
cmd_account_minus('\ua04d'),
cmd_account_minus_outline('\ua04c'),
cmd_account_multiple('\ua057'),
cmd_account_multiple_check('\ua04f'),
cmd_account_multiple_check_outline('\ua04e'),
cmd_account_multiple_minus('\ua051'),
cmd_account_multiple_minus_outline('\ua050'),
cmd_account_multiple_outline('\ua052'),
cmd_account_multiple_plus('\ua054'),
cmd_account_multiple_plus_outline('\ua053'),
cmd_account_multiple_remove('\ua056'),
cmd_account_multiple_remove_outline('\ua055'),
cmd_account_music('\ua059'),
cmd_account_music_outline('\ua058'),
cmd_account_network('\ua05d'),
cmd_account_network_off('\ua05b'),
cmd_account_network_off_outline('\ua05a'),
cmd_account_network_outline('\ua05c'),
cmd_account_off('\ua05f'),
cmd_account_off_outline('\ua05e'),
cmd_account_outline('\ua060'),
cmd_account_plus('\ua062'),
cmd_account_plus_outline('\ua061'),
cmd_account_question('\ua064'),
cmd_account_question_outline('\ua063'),
cmd_account_reactivate('\ua066'),
cmd_account_reactivate_outline('\ua065'),
cmd_account_remove('\ua068'),
cmd_account_remove_outline('\ua067'),
cmd_account_school('\ua06a'),
cmd_account_school_outline('\ua069'),
cmd_account_search('\ua06c'),
cmd_account_search_outline('\ua06b'),
cmd_account_settings('\ua06e'),
cmd_account_settings_outline('\ua06d'),
cmd_account_star('\ua070'),
cmd_account_star_outline('\ua06f'),
cmd_account_supervisor('\ua074'),
cmd_account_supervisor_circle('\ua072'),
cmd_account_supervisor_circle_outline('\ua071'),
cmd_account_supervisor_outline('\ua073'),
cmd_account_switch('\ua076'),
cmd_account_switch_outline('\ua075'),
cmd_account_sync('\ua078'),
cmd_account_sync_outline('\ua077'),
cmd_account_tie('\ua081'),
cmd_account_tie_hat('\ua07a'),
cmd_account_tie_hat_outline('\ua079'),
cmd_account_tie_outline('\ua07b'),
cmd_account_tie_voice('\ua07f'),
cmd_account_tie_voice_off('\ua07d'),
cmd_account_tie_voice_off_outline('\ua07c'),
cmd_account_tie_voice_outline('\ua07e'),
cmd_account_tie_woman('\ua080'),
cmd_account_voice('\ua083'),
cmd_account_voice_off('\ua082'),
cmd_account_wrench('\ua085'),
cmd_account_wrench_outline('\ua084'),
cmd_adjust('\ua087'),
cmd_advertisements('\ua089'),
cmd_advertisements_off('\ua088'),
cmd_air_conditioner('\ua08a'),
cmd_air_filter('\ua08b'),
cmd_air_horn('\ua08c'),
cmd_air_humidifier('\ua08e'),
cmd_air_humidifier_off('\ua08d'),
cmd_air_purifier('\ua090'),
cmd_air_purifier_off('\ua08f'),
cmd_airbag('\ua091'),
cmd_airballoon('\ua093'),
cmd_airballoon_outline('\ua092'),
cmd_airplane('\ua0a2'),
cmd_airplane_alert('\ua094'),
cmd_airplane_check('\ua095'),
cmd_airplane_clock('\ua096'),
cmd_airplane_cog('\ua097'),
cmd_airplane_edit('\ua098'),
cmd_airplane_landing('\ua099'),
cmd_airplane_marker('\ua09a'),
cmd_airplane_minus('\ua09b'),
cmd_airplane_off('\ua09c'),
cmd_airplane_plus('\ua09d'),
cmd_airplane_remove('\ua09e'),
cmd_airplane_search('\ua09f'),
cmd_airplane_settings('\ua0a0'),
cmd_airplane_takeoff('\ua0a1'),
cmd_airport('\ua0a3'),
cmd_alarm('\ua0b2'),
cmd_alarm_bell('\ua0a4'),
cmd_alarm_check('\ua0a5'),
cmd_alarm_light('\ua0a9'),
cmd_alarm_light_off('\ua0a7'),
cmd_alarm_light_off_outline('\ua0a6'),
cmd_alarm_light_outline('\ua0a8'),
cmd_alarm_multiple('\ua0aa'),
cmd_alarm_note('\ua0ac'),
cmd_alarm_note_off('\ua0ab'),
cmd_alarm_off('\ua0ad'),
cmd_alarm_panel('\ua0af'),
cmd_alarm_panel_outline('\ua0ae'),
cmd_alarm_plus('\ua0b0'),
cmd_alarm_snooze('\ua0b1'),
cmd_album('\ua0b3'),
cmd_alert('\ua0c9'),
cmd_alert_box('\ua0b5'),
cmd_alert_box_outline('\ua0b4'),
cmd_alert_circle('\ua0b9'),
cmd_alert_circle_check('\ua0b7'),
cmd_alert_circle_check_outline('\ua0b6'),
cmd_alert_circle_outline('\ua0b8'),
cmd_alert_decagram('\ua0bb'),
cmd_alert_decagram_outline('\ua0ba'),
cmd_alert_minus('\ua0bd'),
cmd_alert_minus_outline('\ua0bc'),
cmd_alert_octagon('\ua0bf'),
cmd_alert_octagon_outline('\ua0be'),
cmd_alert_octagram('\ua0c1'),
cmd_alert_octagram_outline('\ua0c0'),
cmd_alert_outline('\ua0c2'),
cmd_alert_plus('\ua0c4'),
cmd_alert_plus_outline('\ua0c3'),
cmd_alert_remove('\ua0c6'),
cmd_alert_remove_outline('\ua0c5'),
cmd_alert_rhombus('\ua0c8'),
cmd_alert_rhombus_outline('\ua0c7'),
cmd_alien('\ua0cb'),
cmd_alien_outline('\ua0ca'),
cmd_align_horizontal_center('\ua0cc'),
cmd_align_horizontal_distribute('\ua0cd'),
cmd_align_horizontal_left('\ua0ce'),
cmd_align_horizontal_right('\ua0cf'),
cmd_align_vertical_bottom('\ua0d0'),
cmd_align_vertical_center('\ua0d1'),
cmd_align_vertical_distribute('\ua0d2'),
cmd_align_vertical_top('\ua0d3'),
cmd_all_inclusive('\ua0d6'),
cmd_all_inclusive_box('\ua0d5'),
cmd_all_inclusive_box_outline('\ua0d4'),
cmd_allergy('\ua0d7'),
cmd_alpha('\ua15a'),
cmd_alpha_a('\ua0dc'),
cmd_alpha_a_box('\ua0d9'),
cmd_alpha_a_box_outline('\ua0d8'),
cmd_alpha_a_circle('\ua0db'),
cmd_alpha_a_circle_outline('\ua0da'),
cmd_alpha_b('\ua0e1'),
cmd_alpha_b_box('\ua0de'),
cmd_alpha_b_box_outline('\ua0dd'),
cmd_alpha_b_circle('\ua0e0'),
cmd_alpha_b_circle_outline('\ua0df'),
cmd_alpha_c('\ua0e6'),
cmd_alpha_c_box('\ua0e3'),
cmd_alpha_c_box_outline('\ua0e2'),
cmd_alpha_c_circle('\ua0e5'),
cmd_alpha_c_circle_outline('\ua0e4'),
cmd_alpha_d('\ua0eb'),
cmd_alpha_d_box('\ua0e8'),
cmd_alpha_d_box_outline('\ua0e7'),
cmd_alpha_d_circle('\ua0ea'),
cmd_alpha_d_circle_outline('\ua0e9'),
cmd_alpha_e('\ua0f0'),
cmd_alpha_e_box('\ua0ed'),
cmd_alpha_e_box_outline('\ua0ec'),
cmd_alpha_e_circle('\ua0ef'),
cmd_alpha_e_circle_outline('\ua0ee'),
cmd_alpha_f('\ua0f5'),
cmd_alpha_f_box('\ua0f2'),
cmd_alpha_f_box_outline('\ua0f1'),
cmd_alpha_f_circle('\ua0f4'),
cmd_alpha_f_circle_outline('\ua0f3'),
cmd_alpha_g('\ua0fa'),
cmd_alpha_g_box('\ua0f7'),
cmd_alpha_g_box_outline('\ua0f6'),
cmd_alpha_g_circle('\ua0f9'),
cmd_alpha_g_circle_outline('\ua0f8'),
cmd_alpha_h('\ua0ff'),
cmd_alpha_h_box('\ua0fc'),
cmd_alpha_h_box_outline('\ua0fb'),
cmd_alpha_h_circle('\ua0fe'),
cmd_alpha_h_circle_outline('\ua0fd'),
cmd_alpha_i('\ua104'),
cmd_alpha_i_box('\ua101'),
cmd_alpha_i_box_outline('\ua100'),
cmd_alpha_i_circle('\ua103'),
cmd_alpha_i_circle_outline('\ua102'),
cmd_alpha_j('\ua109'),
cmd_alpha_j_box('\ua106'),
cmd_alpha_j_box_outline('\ua105'),
cmd_alpha_j_circle('\ua108'),
cmd_alpha_j_circle_outline('\ua107'),
cmd_alpha_k('\ua10e'),
cmd_alpha_k_box('\ua10b'),
cmd_alpha_k_box_outline('\ua10a'),
cmd_alpha_k_circle('\ua10d'),
cmd_alpha_k_circle_outline('\ua10c'),
cmd_alpha_l('\ua113'),
cmd_alpha_l_box('\ua110'),
cmd_alpha_l_box_outline('\ua10f'),
cmd_alpha_l_circle('\ua112'),
cmd_alpha_l_circle_outline('\ua111'),
cmd_alpha_m('\ua118'),
cmd_alpha_m_box('\ua115'),
cmd_alpha_m_box_outline('\ua114'),
cmd_alpha_m_circle('\ua117'),
cmd_alpha_m_circle_outline('\ua116'),
cmd_alpha_n('\ua11d'),
cmd_alpha_n_box('\ua11a'),
cmd_alpha_n_box_outline('\ua119'),
cmd_alpha_n_circle('\ua11c'),
cmd_alpha_n_circle_outline('\ua11b'),
cmd_alpha_o('\ua122'),
cmd_alpha_o_box('\ua11f'),
cmd_alpha_o_box_outline('\ua11e'),
cmd_alpha_o_circle('\ua121'),
cmd_alpha_o_circle_outline('\ua120'),
cmd_alpha_p('\ua127'),
cmd_alpha_p_box('\ua124'),
cmd_alpha_p_box_outline('\ua123'),
cmd_alpha_p_circle('\ua126'),
cmd_alpha_p_circle_outline('\ua125'),
cmd_alpha_q('\ua12c'),
cmd_alpha_q_box('\ua129'),
cmd_alpha_q_box_outline('\ua128'),
cmd_alpha_q_circle('\ua12b'),
cmd_alpha_q_circle_outline('\ua12a'),
cmd_alpha_r('\ua131'),
cmd_alpha_r_box('\ua12e'),
cmd_alpha_r_box_outline('\ua12d'),
cmd_alpha_r_circle('\ua130'),
cmd_alpha_r_circle_outline('\ua12f'),
cmd_alpha_s('\ua136'),
cmd_alpha_s_box('\ua133'),
cmd_alpha_s_box_outline('\ua132'),
cmd_alpha_s_circle('\ua135'),
cmd_alpha_s_circle_outline('\ua134'),
cmd_alpha_t('\ua13b'),
cmd_alpha_t_box('\ua138'),
cmd_alpha_t_box_outline('\ua137'),
cmd_alpha_t_circle('\ua13a'),
cmd_alpha_t_circle_outline('\ua139'),
cmd_alpha_u('\ua140'),
cmd_alpha_u_box('\ua13d'),
cmd_alpha_u_box_outline('\ua13c'),
cmd_alpha_u_circle('\ua13f'),
cmd_alpha_u_circle_outline('\ua13e'),
cmd_alpha_v('\ua145'),
cmd_alpha_v_box('\ua142'),
cmd_alpha_v_box_outline('\ua141'),
cmd_alpha_v_circle('\ua144'),
cmd_alpha_v_circle_outline('\ua143'),
cmd_alpha_w('\ua14a'),
cmd_alpha_w_box('\ua147'),
cmd_alpha_w_box_outline('\ua146'),
cmd_alpha_w_circle('\ua149'),
cmd_alpha_w_circle_outline('\ua148'),
cmd_alpha_x('\ua14f'),
cmd_alpha_x_box('\ua14c'),
cmd_alpha_x_box_outline('\ua14b'),
cmd_alpha_x_circle('\ua14e'),
cmd_alpha_x_circle_outline('\ua14d'),
cmd_alpha_y('\ua154'),
cmd_alpha_y_box('\ua151'),
cmd_alpha_y_box_outline('\ua150'),
cmd_alpha_y_circle('\ua153'),
cmd_alpha_y_circle_outline('\ua152'),
cmd_alpha_z('\ua159'),
cmd_alpha_z_box('\ua156'),
cmd_alpha_z_box_outline('\ua155'),
cmd_alpha_z_circle('\ua158'),
cmd_alpha_z_circle_outline('\ua157'),
cmd_alphabet_aurebesh('\ua15b'),
cmd_alphabet_cyrillic('\ua15c'),
cmd_alphabet_greek('\ua15d'),
cmd_alphabet_latin('\ua15e'),
cmd_alphabet_piqad('\ua15f'),
cmd_alphabet_tengwar('\ua160'),
cmd_alphabetical('\ua164'),
cmd_alphabetical_off('\ua161'),
cmd_alphabetical_variant('\ua163'),
cmd_alphabetical_variant_off('\ua162'),
cmd_altimeter('\ua165'),
cmd_ambulance('\ua166'),
cmd_ammunition('\ua167'),
cmd_ampersand('\ua168'),
cmd_amplifier('\ua16a'),
cmd_amplifier_off('\ua169'),
cmd_anchor('\ua16b'),
cmd_android('\ua16d'),
cmd_android_studio('\ua16c'),
cmd_angle_acute('\ua16e'),
cmd_angle_obtuse('\ua16f'),
cmd_angle_right('\ua170'),
cmd_angular('\ua171'),
cmd_angularjs('\ua172'),
cmd_animation('\ua176'),
cmd_animation_outline('\ua173'),
cmd_animation_play('\ua175'),
cmd_animation_play_outline('\ua174'),
cmd_ansible('\ua177'),
cmd_antenna('\ua178'),
cmd_anvil('\ua179'),
cmd_apache_kafka('\ua17a'),
cmd_api('\ua17c'),
cmd_api_off('\ua17b'),
cmd_apple('\ua186'),
cmd_apple_finder('\ua17d'),
cmd_apple_icloud('\ua17e'),
cmd_apple_ios('\ua17f'),
cmd_apple_keyboard_caps('\ua180'),
cmd_apple_keyboard_command('\ua181'),
cmd_apple_keyboard_control('\ua182'),
cmd_apple_keyboard_option('\ua183'),
cmd_apple_keyboard_shift('\ua184'),
cmd_apple_safari('\ua185'),
cmd_application('\ua19a'),
cmd_application_array('\ua188'),
cmd_application_array_outline('\ua187'),
cmd_application_braces('\ua18a'),
cmd_application_braces_outline('\ua189'),
cmd_application_brackets('\ua18c'),
cmd_application_brackets_outline('\ua18b'),
cmd_application_cog('\ua18e'),
cmd_application_cog_outline('\ua18d'),
cmd_application_edit('\ua190'),
cmd_application_edit_outline('\ua18f'),
cmd_application_export('\ua191'),
cmd_application_import('\ua192'),
cmd_application_outline('\ua193'),
cmd_application_parentheses('\ua195'),
cmd_application_parentheses_outline('\ua194'),
cmd_application_settings('\ua197'),
cmd_application_settings_outline('\ua196'),
cmd_application_variable('\ua199'),
cmd_application_variable_outline('\ua198'),
cmd_approximately_equal('\ua19c'),
cmd_approximately_equal_box('\ua19b'),
cmd_apps('\ua19e'),
cmd_apps_box('\ua19d'),
cmd_arch('\ua19f'),
cmd_archive('\ua1cd'),
cmd_archive_alert('\ua1a1'),
cmd_archive_alert_outline('\ua1a0'),
cmd_archive_arrow_down('\ua1a3'),
cmd_archive_arrow_down_outline('\ua1a2'),
cmd_archive_arrow_up('\ua1a5'),
cmd_archive_arrow_up_outline('\ua1a4'),
cmd_archive_cancel('\ua1a7'),
cmd_archive_cancel_outline('\ua1a6'),
cmd_archive_check('\ua1a9'),
cmd_archive_check_outline('\ua1a8'),
cmd_archive_clock('\ua1ab'),
cmd_archive_clock_outline('\ua1aa'),
cmd_archive_cog('\ua1ad'),
cmd_archive_cog_outline('\ua1ac'),
cmd_archive_edit('\ua1af'),
cmd_archive_edit_outline('\ua1ae'),
cmd_archive_eye('\ua1b1'),
cmd_archive_eye_outline('\ua1b0'),
cmd_archive_lock('\ua1b5'),
cmd_archive_lock_open('\ua1b3'),
cmd_archive_lock_open_outline('\ua1b2'),
cmd_archive_lock_outline('\ua1b4'),
cmd_archive_marker('\ua1b7'),
cmd_archive_marker_outline('\ua1b6'),
cmd_archive_minus('\ua1b9'),
cmd_archive_minus_outline('\ua1b8'),
cmd_archive_music('\ua1bb'),
cmd_archive_music_outline('\ua1ba'),
cmd_archive_off('\ua1bd'),
cmd_archive_off_outline('\ua1bc'),
cmd_archive_outline('\ua1be'),
cmd_archive_plus('\ua1c0'),
cmd_archive_plus_outline('\ua1bf'),
cmd_archive_refresh('\ua1c2'),
cmd_archive_refresh_outline('\ua1c1'),
cmd_archive_remove('\ua1c4'),
cmd_archive_remove_outline('\ua1c3'),
cmd_archive_search('\ua1c6'),
cmd_archive_search_outline('\ua1c5'),
cmd_archive_settings('\ua1c8'),
cmd_archive_settings_outline('\ua1c7'),
cmd_archive_star('\ua1ca'),
cmd_archive_star_outline('\ua1c9'),
cmd_archive_sync('\ua1cc'),
cmd_archive_sync_outline('\ua1cb'),
cmd_arm_flex('\ua1cf'),
cmd_arm_flex_outline('\ua1ce'),
cmd_arrange_bring_forward('\ua1d0'),
cmd_arrange_bring_to_front('\ua1d1'),
cmd_arrange_send_backward('\ua1d2'),
cmd_arrange_send_to_back('\ua1d3'),
cmd_arrow_all('\ua1d4'),
cmd_arrow_bottom_left('\ua1db'),
cmd_arrow_bottom_left_bold_box('\ua1d6'),
cmd_arrow_bottom_left_bold_box_outline('\ua1d5'),
cmd_arrow_bottom_left_bold_outline('\ua1d7'),
cmd_arrow_bottom_left_thick('\ua1d8'),
cmd_arrow_bottom_left_thin('\ua1da'),
cmd_arrow_bottom_left_thin_circle_outline('\ua1d9'),
cmd_arrow_bottom_right('\ua1e2'),
cmd_arrow_bottom_right_bold_box('\ua1dd'),
cmd_arrow_bottom_right_bold_box_outline('\ua1dc'),
cmd_arrow_bottom_right_bold_outline('\ua1de'),
cmd_arrow_bottom_right_thick('\ua1df'),
cmd_arrow_bottom_right_thin('\ua1e1'),
cmd_arrow_bottom_right_thin_circle_outline('\ua1e0'),
cmd_arrow_collapse('\ua1ea'),
cmd_arrow_collapse_all('\ua1e3'),
cmd_arrow_collapse_down('\ua1e4'),
cmd_arrow_collapse_horizontal('\ua1e5'),
cmd_arrow_collapse_left('\ua1e6'),
cmd_arrow_collapse_right('\ua1e7'),
cmd_arrow_collapse_up('\ua1e8'),
cmd_arrow_collapse_vertical('\ua1e9'),
cmd_arrow_decision('\ua1ee'),
cmd_arrow_decision_auto('\ua1ec'),
cmd_arrow_decision_auto_outline('\ua1eb'),
cmd_arrow_decision_outline('\ua1ed'),
cmd_arrow_down('\ua202'),
cmd_arrow_down_bold('\ua1f5'),
cmd_arrow_down_bold_box('\ua1f0'),
cmd_arrow_down_bold_box_outline('\ua1ef'),
cmd_arrow_down_bold_circle('\ua1f2'),
cmd_arrow_down_bold_circle_outline('\ua1f1'),
cmd_arrow_down_bold_hexagon_outline('\ua1f3'),
cmd_arrow_down_bold_outline('\ua1f4'),
cmd_arrow_down_box('\ua1f6'),
cmd_arrow_down_circle('\ua1f8'),
cmd_arrow_down_circle_outline('\ua1f7'),
cmd_arrow_down_drop_circle('\ua1fa'),
cmd_arrow_down_drop_circle_outline('\ua1f9'),
cmd_arrow_down_left('\ua1fc'),
cmd_arrow_down_left_bold('\ua1fb'),
cmd_arrow_down_right('\ua1fe'),
cmd_arrow_down_right_bold('\ua1fd'),
cmd_arrow_down_thick('\ua1ff'),
cmd_arrow_down_thin('\ua201'),
cmd_arrow_down_thin_circle_outline('\ua200'),
cmd_arrow_expand('\ua20a'),
cmd_arrow_expand_all('\ua203'),
cmd_arrow_expand_down('\ua204'),
cmd_arrow_expand_horizontal('\ua205'),
cmd_arrow_expand_left('\ua206'),
cmd_arrow_expand_right('\ua207'),
cmd_arrow_expand_up('\ua208'),
cmd_arrow_expand_vertical('\ua209'),
cmd_arrow_horizontal_lock('\ua20b'),
cmd_arrow_left('\ua222'),
cmd_arrow_left_bold('\ua212'),
cmd_arrow_left_bold_box('\ua20d'),
cmd_arrow_left_bold_box_outline('\ua20c'),
cmd_arrow_left_bold_circle('\ua20f'),
cmd_arrow_left_bold_circle_outline('\ua20e'),
cmd_arrow_left_bold_hexagon_outline('\ua210'),
cmd_arrow_left_bold_outline('\ua211'),
cmd_arrow_left_bottom('\ua214'),
cmd_arrow_left_bottom_bold('\ua213'),
cmd_arrow_left_box('\ua215'),
cmd_arrow_left_circle('\ua217'),
cmd_arrow_left_circle_outline('\ua216'),
cmd_arrow_left_drop_circle('\ua219'),
cmd_arrow_left_drop_circle_outline('\ua218'),
cmd_arrow_left_right('\ua21c'),
cmd_arrow_left_right_bold('\ua21b'),
cmd_arrow_left_right_bold_outline('\ua21a'),
cmd_arrow_left_thick('\ua21d'),
cmd_arrow_left_thin('\ua21f'),
cmd_arrow_left_thin_circle_outline('\ua21e'),
cmd_arrow_left_top('\ua221'),
cmd_arrow_left_top_bold('\ua220'),
cmd_arrow_projectile('\ua224'),
cmd_arrow_projectile_multiple('\ua223'),
cmd_arrow_right('\ua238'),
cmd_arrow_right_bold('\ua22b'),
cmd_arrow_right_bold_box('\ua226'),
cmd_arrow_right_bold_box_outline('\ua225'),
cmd_arrow_right_bold_circle('\ua228'),
cmd_arrow_right_bold_circle_outline('\ua227'),
cmd_arrow_right_bold_hexagon_outline('\ua229'),
cmd_arrow_right_bold_outline('\ua22a'),
cmd_arrow_right_bottom('\ua22d'),
cmd_arrow_right_bottom_bold('\ua22c'),
cmd_arrow_right_box('\ua22e'),
cmd_arrow_right_circle('\ua230'),
cmd_arrow_right_circle_outline('\ua22f'),
cmd_arrow_right_drop_circle('\ua232'),
cmd_arrow_right_drop_circle_outline('\ua231'),
cmd_arrow_right_thick('\ua233'),
cmd_arrow_right_thin('\ua235'),
cmd_arrow_right_thin_circle_outline('\ua234'),
cmd_arrow_right_top('\ua237'),
cmd_arrow_right_top_bold('\ua236'),
cmd_arrow_split_horizontal('\ua239'),
cmd_arrow_split_vertical('\ua23a'),
cmd_arrow_top_left('\ua243'),
cmd_arrow_top_left_bold_box('\ua23c'),
cmd_arrow_top_left_bold_box_outline('\ua23b'),
cmd_arrow_top_left_bold_outline('\ua23d'),
cmd_arrow_top_left_bottom_right('\ua23f'),
cmd_arrow_top_left_bottom_right_bold('\ua23e'),
cmd_arrow_top_left_thick('\ua240'),
cmd_arrow_top_left_thin('\ua242'),
cmd_arrow_top_left_thin_circle_outline('\ua241'),
cmd_arrow_top_right('\ua24c'),
cmd_arrow_top_right_bold_box('\ua245'),
cmd_arrow_top_right_bold_box_outline('\ua244'),
cmd_arrow_top_right_bold_outline('\ua246'),
cmd_arrow_top_right_bottom_left('\ua248'),
cmd_arrow_top_right_bottom_left_bold('\ua247'),
cmd_arrow_top_right_thick('\ua249'),
cmd_arrow_top_right_thin('\ua24b'),
cmd_arrow_top_right_thin_circle_outline('\ua24a'),
cmd_arrow_u_down_left('\ua24e'),
cmd_arrow_u_down_left_bold('\ua24d'),
cmd_arrow_u_down_right('\ua250'),
cmd_arrow_u_down_right_bold('\ua24f'),
cmd_arrow_u_left_bottom('\ua252'),
cmd_arrow_u_left_bottom_bold('\ua251'),
cmd_arrow_u_left_top('\ua254'),
cmd_arrow_u_left_top_bold('\ua253'),
cmd_arrow_u_right_bottom('\ua256'),
cmd_arrow_u_right_bottom_bold('\ua255'),
cmd_arrow_u_right_top('\ua258'),
cmd_arrow_u_right_top_bold('\ua257'),
cmd_arrow_u_up_left('\ua25a'),
cmd_arrow_u_up_left_bold('\ua259'),
cmd_arrow_u_up_right('\ua25c'),
cmd_arrow_u_up_right_bold('\ua25b'),
cmd_arrow_up('\ua273'),
cmd_arrow_up_bold('\ua263'),
cmd_arrow_up_bold_box('\ua25e'),
cmd_arrow_up_bold_box_outline('\ua25d'),
cmd_arrow_up_bold_circle('\ua260'),
cmd_arrow_up_bold_circle_outline('\ua25f'),
cmd_arrow_up_bold_hexagon_outline('\ua261'),
cmd_arrow_up_bold_outline('\ua262'),
cmd_arrow_up_box('\ua264'),
cmd_arrow_up_circle('\ua266'),
cmd_arrow_up_circle_outline('\ua265'),
cmd_arrow_up_down('\ua269'),
cmd_arrow_up_down_bold('\ua268'),
cmd_arrow_up_down_bold_outline('\ua267'),
cmd_arrow_up_drop_circle('\ua26b'),
cmd_arrow_up_drop_circle_outline('\ua26a'),
cmd_arrow_up_left('\ua26d'),
cmd_arrow_up_left_bold('\ua26c'),
cmd_arrow_up_right('\ua26f'),
cmd_arrow_up_right_bold('\ua26e'),
cmd_arrow_up_thick('\ua270'),
cmd_arrow_up_thin('\ua272'),
cmd_arrow_up_thin_circle_outline('\ua271'),
cmd_arrow_vertical_lock('\ua274'),
cmd_artboard('\ua275'),
cmd_artstation('\ua276'),
cmd_aspect_ratio('\ua277'),
cmd_assistant('\ua278'),
cmd_asterisk('\ua27a'),
cmd_asterisk_circle_outline('\ua279'),
cmd_at('\ua27b'),
cmd_atlassian('\ua27c'),
cmd_atm('\ua27d'),
cmd_atom('\ua27f'),
cmd_atom_variant('\ua27e'),
cmd_attachment('\ua286'),
cmd_attachment_check('\ua280'),
cmd_attachment_lock('\ua281'),
cmd_attachment_minus('\ua282'),
cmd_attachment_off('\ua283'),
cmd_attachment_plus('\ua284'),
cmd_attachment_remove('\ua285'),
cmd_atv('\ua287'),
cmd_audio_input_rca('\ua288'),
cmd_audio_input_stereo_minijack('\ua289'),
cmd_audio_input_xlr('\ua28a'),
cmd_audio_video('\ua28c'),
cmd_audio_video_off('\ua28b'),
cmd_augmented_reality('\ua28d'),
cmd_aurora('\ua28e'),
cmd_auto_download('\ua28f'),
cmd_auto_fix('\ua290'),
cmd_auto_upload('\ua291'),
cmd_autorenew('\ua293'),
cmd_autorenew_off('\ua292'),
cmd_av_timer('\ua294'),
cmd_awning('\ua296'),
cmd_awning_outline('\ua295'),
cmd_aws('\ua297'),
cmd_axe('\ua299'),
cmd_axe_battle('\ua298'),
cmd_axis('\ua2ab'),
cmd_axis_arrow('\ua29c'),
cmd_axis_arrow_info('\ua29a'),
cmd_axis_arrow_lock('\ua29b'),
cmd_axis_lock('\ua29d'),
cmd_axis_x_arrow('\ua29f'),
cmd_axis_x_arrow_lock('\ua29e'),
cmd_axis_x_rotate_clockwise('\ua2a0'),
cmd_axis_x_rotate_counterclockwise('\ua2a1'),
cmd_axis_x_y_arrow_lock('\ua2a2'),
cmd_axis_y_arrow('\ua2a4'),
cmd_axis_y_arrow_lock('\ua2a3'),
cmd_axis_y_rotate_clockwise('\ua2a5'),
cmd_axis_y_rotate_counterclockwise('\ua2a6'),
cmd_axis_z_arrow('\ua2a8'),
cmd_axis_z_arrow_lock('\ua2a7'),
cmd_axis_z_rotate_clockwise('\ua2a9'),
cmd_axis_z_rotate_counterclockwise('\ua2aa'),
cmd_babel('\ua2ac'),
cmd_baby('\ua2b5'),
cmd_baby_bottle('\ua2ae'),
cmd_baby_bottle_outline('\ua2ad'),
cmd_baby_buggy('\ua2b0'),
cmd_baby_buggy_off('\ua2af'),
cmd_baby_carriage('\ua2b2'),
cmd_baby_carriage_off('\ua2b1'),
cmd_baby_face('\ua2b4'),
cmd_baby_face_outline('\ua2b3'),
cmd_backburger('\ua2b6'),
cmd_backspace('\ua2ba'),
cmd_backspace_outline('\ua2b7'),
cmd_backspace_reverse('\ua2b9'),
cmd_backspace_reverse_outline('\ua2b8'),
cmd_backup_restore('\ua2bb'),
cmd_bacteria('\ua2bd'),
cmd_bacteria_outline('\ua2bc'),
cmd_badge_account('\ua2c3'),
cmd_badge_account_alert('\ua2bf'),
cmd_badge_account_alert_outline('\ua2be'),
cmd_badge_account_horizontal('\ua2c1'),
cmd_badge_account_horizontal_outline('\ua2c0'),
cmd_badge_account_outline('\ua2c2'),
cmd_badminton('\ua2c4'),
cmd_bag_carry_on('\ua2c7'),
cmd_bag_carry_on_check('\ua2c5'),
cmd_bag_carry_on_off('\ua2c6'),
cmd_bag_checked('\ua2c8'),
cmd_bag_personal('\ua2ce'),
cmd_bag_personal_off('\ua2ca'),
cmd_bag_personal_off_outline('\ua2c9'),
cmd_bag_personal_outline('\ua2cb'),
cmd_bag_personal_tag('\ua2cd'),
cmd_bag_personal_tag_outline('\ua2cc'),
cmd_bag_suitcase('\ua2d2'),
cmd_bag_suitcase_off('\ua2d0'),
cmd_bag_suitcase_off_outline('\ua2cf'),
cmd_bag_suitcase_outline('\ua2d1'),
cmd_baguette('\ua2d3'),
cmd_balcony('\ua2d4'),
cmd_balloon('\ua2d5'),
cmd_ballot('\ua2d9'),
cmd_ballot_outline('\ua2d6'),
cmd_ballot_recount('\ua2d8'),
cmd_ballot_recount_outline('\ua2d7'),
cmd_bandage('\ua2da'),
cmd_bank('\ua2e5'),
cmd_bank_check('\ua2db'),
cmd_bank_minus('\ua2dc'),
cmd_bank_off('\ua2de'),
cmd_bank_off_outline('\ua2dd'),
cmd_bank_outline('\ua2df'),
cmd_bank_plus('\ua2e0'),
cmd_bank_remove('\ua2e1'),
cmd_bank_transfer('\ua2e4'),
cmd_bank_transfer_in('\ua2e2'),
cmd_bank_transfer_out('\ua2e3'),
cmd_barcode('\ua2e8'),
cmd_barcode_off('\ua2e6'),
cmd_barcode_scan('\ua2e7'),
cmd_barley('\ua2ea'),
cmd_barley_off('\ua2e9'),
cmd_barn('\ua2eb'),
cmd_barrel('\ua2ed'),
cmd_barrel_outline('\ua2ec'),
cmd_baseball('\ua2f1'),
cmd_baseball_bat('\ua2ee'),
cmd_baseball_diamond('\ua2f0'),
cmd_baseball_diamond_outline('\ua2ef'),
cmd_bash('\ua2f2'),
cmd_basket('\ua300'),
cmd_basket_check('\ua2f4'),
cmd_basket_check_outline('\ua2f3'),
cmd_basket_fill('\ua2f5'),
cmd_basket_minus('\ua2f7'),
cmd_basket_minus_outline('\ua2f6'),
cmd_basket_off('\ua2f9'),
cmd_basket_off_outline('\ua2f8'),
cmd_basket_outline('\ua2fa'),
cmd_basket_plus('\ua2fc'),
cmd_basket_plus_outline('\ua2fb'),
cmd_basket_remove('\ua2fe'),
cmd_basket_remove_outline('\ua2fd'),
cmd_basket_unfill('\ua2ff'),
cmd_basketball('\ua303'),
cmd_basketball_hoop('\ua302'),
cmd_basketball_hoop_outline('\ua301'),
cmd_bat('\ua304'),
cmd_bathtub('\ua306'),
cmd_bathtub_outline('\ua305'),
cmd_battery('\ua35b'),
cmd_battery_10('\ua308'),
cmd_battery_10_bluetooth('\ua307'),
cmd_battery_20('\ua30a'),
cmd_battery_20_bluetooth('\ua309'),
cmd_battery_30('\ua30c'),
cmd_battery_30_bluetooth('\ua30b'),
cmd_battery_40('\ua30e'),
cmd_battery_40_bluetooth('\ua30d'),
cmd_battery_50('\ua310'),
cmd_battery_50_bluetooth('\ua30f'),
cmd_battery_60('\ua312'),
cmd_battery_60_bluetooth('\ua311'),
cmd_battery_70('\ua314'),
cmd_battery_70_bluetooth('\ua313'),
cmd_battery_80('\ua316'),
cmd_battery_80_bluetooth('\ua315'),
cmd_battery_90('\ua318'),
cmd_battery_90_bluetooth('\ua317'),
cmd_battery_alert('\ua31c'),
cmd_battery_alert_bluetooth('\ua319'),
cmd_battery_alert_variant('\ua31b'),
cmd_battery_alert_variant_outline('\ua31a'),
cmd_battery_arrow_down('\ua31e'),
cmd_battery_arrow_down_outline('\ua31d'),
cmd_battery_arrow_up('\ua320'),
cmd_battery_arrow_up_outline('\ua31f'),
cmd_battery_bluetooth('\ua322'),
cmd_battery_bluetooth_variant('\ua321'),
cmd_battery_charging('\ua33d'),
cmd_battery_charging_10('\ua323'),
cmd_battery_charging_100('\ua32c'),
cmd_battery_charging_20('\ua324'),
cmd_battery_charging_30('\ua325'),
cmd_battery_charging_40('\ua326'),
cmd_battery_charging_50('\ua327'),
cmd_battery_charging_60('\ua328'),
cmd_battery_charging_70('\ua329'),
cmd_battery_charging_80('\ua32a'),
cmd_battery_charging_90('\ua32b'),
cmd_battery_charging_high('\ua32d'),
cmd_battery_charging_low('\ua32e'),
cmd_battery_charging_medium('\ua32f'),
cmd_battery_charging_outline('\ua330'),
cmd_battery_charging_wireless('\ua33c'),
cmd_battery_charging_wireless_10('\ua331'),
cmd_battery_charging_wireless_20('\ua332'),
cmd_battery_charging_wireless_30('\ua333'),
cmd_battery_charging_wireless_40('\ua334'),
cmd_battery_charging_wireless_50('\ua335'),
cmd_battery_charging_wireless_60('\ua336'),
cmd_battery_charging_wireless_70('\ua337'),
cmd_battery_charging_wireless_80('\ua338'),
cmd_battery_charging_wireless_90('\ua339'),
cmd_battery_charging_wireless_alert('\ua33a'),
cmd_battery_charging_wireless_outline('\ua33b'),
cmd_battery_check('\ua33f'),
cmd_battery_check_outline('\ua33e'),
cmd_battery_clock('\ua341'),
cmd_battery_clock_outline('\ua340'),
cmd_battery_heart('\ua344'),
cmd_battery_heart_outline('\ua342'),
cmd_battery_heart_variant('\ua343'),
cmd_battery_high('\ua345'),
cmd_battery_lock('\ua347'),
cmd_battery_lock_open('\ua346'),
cmd_battery_low('\ua348'),
cmd_battery_medium('\ua349'),
cmd_battery_minus('\ua34c'),
cmd_battery_minus_outline('\ua34a'),
cmd_battery_minus_variant('\ua34b'),
cmd_battery_negative('\ua34d'),
cmd_battery_off('\ua34f'),
cmd_battery_off_outline('\ua34e'),
cmd_battery_outline('\ua350'),
cmd_battery_plus('\ua353'),
cmd_battery_plus_outline('\ua351'),
cmd_battery_plus_variant('\ua352'),
cmd_battery_positive('\ua354'),
cmd_battery_remove('\ua356'),
cmd_battery_remove_outline('\ua355'),
cmd_battery_sync('\ua358'),
cmd_battery_sync_outline('\ua357'),
cmd_battery_unknown('\ua35a'),
cmd_battery_unknown_bluetooth('\ua359'),
cmd_beach('\ua35c'),
cmd_beaker('\ua36a'),
cmd_beaker_alert('\ua35e'),
cmd_beaker_alert_outline('\ua35d'),
cmd_beaker_check('\ua360'),
cmd_beaker_check_outline('\ua35f'),
cmd_beaker_minus('\ua362'),
cmd_beaker_minus_outline('\ua361'),
cmd_beaker_outline('\ua363'),
cmd_beaker_plus('\ua365'),
cmd_beaker_plus_outline('\ua364'),
cmd_beaker_question('\ua367'),
cmd_beaker_question_outline('\ua366'),
cmd_beaker_remove('\ua369'),
cmd_beaker_remove_outline('\ua368'),
cmd_bed('\ua376'),
cmd_bed_clock('\ua36b'),
cmd_bed_double('\ua36d'),
cmd_bed_double_outline('\ua36c'),
cmd_bed_empty('\ua36e'),
cmd_bed_king('\ua370'),
cmd_bed_king_outline('\ua36f'),
cmd_bed_outline('\ua371'),
cmd_bed_queen('\ua373'),
cmd_bed_queen_outline('\ua372'),
cmd_bed_single('\ua375'),
cmd_bed_single_outline('\ua374'),
cmd_bee('\ua378'),
cmd_bee_flower('\ua377'),
cmd_beehive_off_outline('\ua379'),
cmd_beehive_outline('\ua37a'),
cmd_beekeeper('\ua37b'),
cmd_beer('\ua37d'),
cmd_beer_outline('\ua37c'),
cmd_bell('\ua397'),
cmd_bell_alert('\ua37f'),
cmd_bell_alert_outline('\ua37e'),
cmd_bell_badge('\ua381'),
cmd_bell_badge_outline('\ua380'),
cmd_bell_cancel('\ua383'),
cmd_bell_cancel_outline('\ua382'),
cmd_bell_check('\ua385'),
cmd_bell_check_outline('\ua384'),
cmd_bell_circle('\ua387'),
cmd_bell_circle_outline('\ua386'),
cmd_bell_cog('\ua389'),
cmd_bell_cog_outline('\ua388'),
cmd_bell_minus('\ua38b'),
cmd_bell_minus_outline('\ua38a'),
cmd_bell_off('\ua38d'),
cmd_bell_off_outline('\ua38c'),
cmd_bell_outline('\ua38e'),
cmd_bell_plus('\ua390'),
cmd_bell_plus_outline('\ua38f'),
cmd_bell_remove('\ua392'),
cmd_bell_remove_outline('\ua391'),
cmd_bell_ring('\ua394'),
cmd_bell_ring_outline('\ua393'),
cmd_bell_sleep('\ua396'),
cmd_bell_sleep_outline('\ua395'),
cmd_beta('\ua398'),
cmd_betamax('\ua399'),
cmd_biathlon('\ua39a'),
cmd_bicycle('\ua39f'),
cmd_bicycle_basket('\ua39b'),
cmd_bicycle_cargo('\ua39c'),
cmd_bicycle_electric('\ua39d'),
cmd_bicycle_penny_farthing('\ua39e'),
cmd_bike('\ua3a1'),
cmd_bike_fast('\ua3a0'),
cmd_billboard('\ua3a2'),
cmd_billiards('\ua3a4'),
cmd_billiards_rack('\ua3a3'),
cmd_binoculars('\ua3a5'),
cmd_bio('\ua3a6'),
cmd_biohazard('\ua3a7'),
cmd_bird('\ua3a8'),
cmd_bitbucket('\ua3a9'),
cmd_bitcoin('\ua3aa'),
cmd_black_mesa('\ua3ab'),
cmd_blender('\ua3ae'),
cmd_blender_outline('\ua3ac'),
cmd_blender_software('\ua3ad'),
cmd_blinds('\ua3b4'),
cmd_blinds_horizontal('\ua3b0'),
cmd_blinds_horizontal_closed('\ua3af'),
cmd_blinds_open('\ua3b1'),
cmd_blinds_vertical('\ua3b3'),
cmd_blinds_vertical_closed('\ua3b2'),
cmd_block_helper('\ua3b5'),
cmd_blood_bag('\ua3b6'),
cmd_bluetooth('\ua3bc'),
cmd_bluetooth_audio('\ua3b7'),
cmd_bluetooth_connect('\ua3b8'),
cmd_bluetooth_off('\ua3b9'),
cmd_bluetooth_settings('\ua3ba'),
cmd_bluetooth_transfer('\ua3bb'),
cmd_blur('\ua3c0'),
cmd_blur_linear('\ua3bd'),
cmd_blur_off('\ua3be'),
cmd_blur_radial('\ua3bf'),
cmd_bolt('\ua3c1'),
cmd_bomb('\ua3c3'),
cmd_bomb_off('\ua3c2'),
cmd_bone('\ua3c5'),
cmd_bone_off('\ua3c4'),
cmd_book('\ua40d'),
cmd_book_account('\ua3c7'),
cmd_book_account_outline('\ua3c6'),
cmd_book_alert('\ua3c9'),
cmd_book_alert_outline('\ua3c8'),
cmd_book_alphabet('\ua3ca'),
cmd_book_arrow_down('\ua3cc'),
cmd_book_arrow_down_outline('\ua3cb'),
cmd_book_arrow_left('\ua3ce'),
cmd_book_arrow_left_outline('\ua3cd'),
cmd_book_arrow_right('\ua3d0'),
cmd_book_arrow_right_outline('\ua3cf'),
cmd_book_arrow_up('\ua3d2'),
cmd_book_arrow_up_outline('\ua3d1'),
cmd_book_cancel('\ua3d4'),
cmd_book_cancel_outline('\ua3d3'),
cmd_book_check('\ua3d6'),
cmd_book_check_outline('\ua3d5'),
cmd_book_clock('\ua3d8'),
cmd_book_clock_outline('\ua3d7'),
cmd_book_cog('\ua3da'),
cmd_book_cog_outline('\ua3d9'),
cmd_book_cross('\ua3db'),
cmd_book_edit('\ua3dd'),
cmd_book_edit_outline('\ua3dc'),
cmd_book_education('\ua3df'),
cmd_book_education_outline('\ua3de'),
cmd_book_heart('\ua3e1'),
cmd_book_heart_outline('\ua3e0'),
cmd_book_information_variant('\ua3e2'),
cmd_book_lock('\ua3e6'),
cmd_book_lock_open('\ua3e4'),
cmd_book_lock_open_outline('\ua3e3'),
cmd_book_lock_outline('\ua3e5'),
cmd_book_marker('\ua3e8'),
cmd_book_marker_outline('\ua3e7'),
cmd_book_minus('\ua3ec'),
cmd_book_minus_multiple('\ua3ea'),
cmd_book_minus_multiple_outline('\ua3e9'),
cmd_book_minus_outline('\ua3eb'),
cmd_book_multiple('\ua3ee'),
cmd_book_multiple_outline('\ua3ed'),
cmd_book_music('\ua3f0'),
cmd_book_music_outline('\ua3ef'),
cmd_book_off('\ua3f2'),
cmd_book_off_outline('\ua3f1'),
cmd_book_open('\ua3f8'),
cmd_book_open_blank_variant('\ua3f3'),
cmd_book_open_outline('\ua3f4'),
cmd_book_open_page_variant('\ua3f6'),
cmd_book_open_page_variant_outline('\ua3f5'),
cmd_book_open_variant('\ua3f7'),
cmd_book_outline('\ua3f9'),
cmd_book_play('\ua3fb'),
cmd_book_play_outline('\ua3fa'),
cmd_book_plus('\ua3ff'),
cmd_book_plus_multiple('\ua3fd'),
cmd_book_plus_multiple_outline('\ua3fc'),
cmd_book_plus_outline('\ua3fe'),
cmd_book_refresh('\ua401'),
cmd_book_refresh_outline('\ua400'),
cmd_book_remove('\ua405'),
cmd_book_remove_multiple('\ua403'),
cmd_book_remove_multiple_outline('\ua402'),
cmd_book_remove_outline('\ua404'),
cmd_book_search('\ua407'),
cmd_book_search_outline('\ua406'),
cmd_book_settings('\ua409'),
cmd_book_settings_outline('\ua408'),
cmd_book_sync('\ua40b'),
cmd_book_sync_outline('\ua40a'),
cmd_book_variant('\ua40c'),
cmd_bookmark('\ua421'),
cmd_bookmark_box('\ua411'),
cmd_bookmark_box_multiple('\ua40f'),
cmd_bookmark_box_multiple_outline('\ua40e'),
cmd_bookmark_box_outline('\ua410'),
cmd_bookmark_check('\ua413'),
cmd_bookmark_check_outline('\ua412'),
cmd_bookmark_minus('\ua415'),
cmd_bookmark_minus_outline('\ua414'),
cmd_bookmark_multiple('\ua417'),
cmd_bookmark_multiple_outline('\ua416'),
cmd_bookmark_music('\ua419'),
cmd_bookmark_music_outline('\ua418'),
cmd_bookmark_off('\ua41b'),
cmd_bookmark_off_outline('\ua41a'),
cmd_bookmark_outline('\ua41c'),
cmd_bookmark_plus('\ua41e'),
cmd_bookmark_plus_outline('\ua41d'),
cmd_bookmark_remove('\ua420'),
cmd_bookmark_remove_outline('\ua41f'),
cmd_bookshelf('\ua422'),
cmd_boom_gate('\ua42c'),
cmd_boom_gate_alert('\ua424'),
cmd_boom_gate_alert_outline('\ua423'),
cmd_boom_gate_arrow_down('\ua426'),
cmd_boom_gate_arrow_down_outline('\ua425'),
cmd_boom_gate_arrow_up('\ua428'),
cmd_boom_gate_arrow_up_outline('\ua427'),
cmd_boom_gate_outline('\ua429'),
cmd_boom_gate_up('\ua42b'),
cmd_boom_gate_up_outline('\ua42a'),
cmd_boombox('\ua42d'),
cmd_boomerang('\ua42e'),
cmd_bootstrap('\ua42f'),
cmd_border_all('\ua431'),
cmd_border_all_variant('\ua430'),
cmd_border_bottom('\ua433'),
cmd_border_bottom_variant('\ua432'),
cmd_border_color('\ua434'),
cmd_border_horizontal('\ua435'),
cmd_border_inside('\ua436'),
cmd_border_left('\ua438'),
cmd_border_left_variant('\ua437'),
cmd_border_none('\ua43a'),
cmd_border_none_variant('\ua439'),
cmd_border_outside('\ua43b'),
cmd_border_radius('\ua43c'),
cmd_border_right('\ua43e'),
cmd_border_right_variant('\ua43d'),
cmd_border_style('\ua43f'),
cmd_border_top('\ua441'),
cmd_border_top_variant('\ua440'),
cmd_border_vertical('\ua442'),
cmd_bottle_soda('\ua446'),
cmd_bottle_soda_classic('\ua444'),
cmd_bottle_soda_classic_outline('\ua443'),
cmd_bottle_soda_outline('\ua445'),
cmd_bottle_tonic('\ua44c'),
cmd_bottle_tonic_outline('\ua447'),
cmd_bottle_tonic_plus('\ua449'),
cmd_bottle_tonic_plus_outline('\ua448'),
cmd_bottle_tonic_skull('\ua44b'),
cmd_bottle_tonic_skull_outline('\ua44a'),
cmd_bottle_wine('\ua44e'),
cmd_bottle_wine_outline('\ua44d'),
cmd_bow_arrow('\ua44f'),
cmd_bow_tie('\ua450'),
cmd_bowl('\ua454'),
cmd_bowl_mix('\ua452'),
cmd_bowl_mix_outline('\ua451'),
cmd_bowl_outline('\ua453'),
cmd_bowling('\ua455'),
cmd_box('\ua459'),
cmd_box_cutter('\ua457'),
cmd_box_cutter_off('\ua456'),
cmd_box_shadow('\ua458'),
cmd_boxing_glove('\ua45a'),
cmd_braille('\ua45b'),
cmd_brain('\ua45c'),
cmd_bread_slice('\ua45e'),
cmd_bread_slice_outline('\ua45d'),
cmd_bridge('\ua45f'),
cmd_briefcase('\ua481'),
cmd_briefcase_account('\ua461'),
cmd_briefcase_account_outline('\ua460'),
cmd_briefcase_arrow_left_right('\ua463'),
cmd_briefcase_arrow_left_right_outline('\ua462'),
cmd_briefcase_arrow_up_down('\ua465'),
cmd_briefcase_arrow_up_down_outline('\ua464'),
cmd_briefcase_check('\ua467'),
cmd_briefcase_check_outline('\ua466'),
cmd_briefcase_clock('\ua469'),
cmd_briefcase_clock_outline('\ua468'),
cmd_briefcase_download('\ua46b'),
cmd_briefcase_download_outline('\ua46a'),
cmd_briefcase_edit('\ua46d'),
cmd_briefcase_edit_outline('\ua46c'),
cmd_briefcase_eye('\ua46f'),
cmd_briefcase_eye_outline('\ua46e'),
cmd_briefcase_minus('\ua471'),
cmd_briefcase_minus_outline('\ua470'),
cmd_briefcase_off('\ua473'),
cmd_briefcase_off_outline('\ua472'),
cmd_briefcase_outline('\ua474'),
cmd_briefcase_plus('\ua476'),
cmd_briefcase_plus_outline('\ua475'),
cmd_briefcase_remove('\ua478'),
cmd_briefcase_remove_outline('\ua477'),
cmd_briefcase_search('\ua47a'),
cmd_briefcase_search_outline('\ua479'),
cmd_briefcase_upload('\ua47c'),
cmd_briefcase_upload_outline('\ua47b'),
cmd_briefcase_variant('\ua480'),
cmd_briefcase_variant_off('\ua47e'),
cmd_briefcase_variant_off_outline('\ua47d'),
cmd_briefcase_variant_outline('\ua47f'),
cmd_brightness_1('\ua482'),
cmd_brightness_2('\ua483'),
cmd_brightness_3('\ua484'),
cmd_brightness_4('\ua485'),
cmd_brightness_5('\ua486'),
cmd_brightness_6('\ua487'),
cmd_brightness_7('\ua488'),
cmd_brightness_auto('\ua489'),
cmd_brightness_percent('\ua48a'),
cmd_broadcast('\ua48c'),
cmd_broadcast_off('\ua48b'),
cmd_broom('\ua48d'),
cmd_brush('\ua491'),
cmd_brush_off('\ua48e'),
cmd_brush_outline('\ua48f'),
cmd_brush_variant('\ua490'),
cmd_bucket('\ua493'),
cmd_bucket_outline('\ua492'),
cmd_buffet('\ua494'),
cmd_bug('\ua49e'),
cmd_bug_check('\ua496'),
cmd_bug_check_outline('\ua495'),
cmd_bug_outline('\ua497'),
cmd_bug_pause('\ua499'),
cmd_bug_pause_outline('\ua498'),
cmd_bug_play('\ua49b'),
cmd_bug_play_outline('\ua49a'),
cmd_bug_stop('\ua49d'),
cmd_bug_stop_outline('\ua49c'),
cmd_bugle('\ua49f'),
cmd_bulkhead_light('\ua4a0'),
cmd_bulldozer('\ua4a1'),
cmd_bullet('\ua4a2'),
cmd_bulletin_board('\ua4a3'),
cmd_bullhorn('\ua4a7'),
cmd_bullhorn_outline('\ua4a4'),
cmd_bullhorn_variant('\ua4a6'),
cmd_bullhorn_variant_outline('\ua4a5'),
cmd_bullseye('\ua4a9'),
cmd_bullseye_arrow('\ua4a8'),
cmd_bulma('\ua4aa'),
cmd_bunk_bed('\ua4ac'),
cmd_bunk_bed_outline('\ua4ab'),
cmd_bus('\ua4ba'),
cmd_bus_alert('\ua4ad'),
cmd_bus_articulated_end('\ua4ae'),
cmd_bus_articulated_front('\ua4af'),
cmd_bus_clock('\ua4b0'),
cmd_bus_double_decker('\ua4b1'),
cmd_bus_electric('\ua4b2'),
cmd_bus_marker('\ua4b3'),
cmd_bus_multiple('\ua4b4'),
cmd_bus_school('\ua4b5'),
cmd_bus_side('\ua4b6'),
cmd_bus_stop('\ua4b9'),
cmd_bus_stop_covered('\ua4b7'),
cmd_bus_stop_uncovered('\ua4b8'),
cmd_butterfly('\ua4bc'),
cmd_butterfly_outline('\ua4bb'),
cmd_button_cursor('\ua4bd'),
cmd_button_pointer('\ua4be'),
cmd_cabin_a_frame('\ua4bf'),
cmd_cable_data('\ua4c0'),
cmd_cached('\ua4c1'),
cmd_cactus('\ua4c2'),
cmd_cake('\ua4c6'),
cmd_cake_layered('\ua4c3'),
cmd_cake_variant('\ua4c5'),
cmd_cake_variant_outline('\ua4c4'),
cmd_calculator('\ua4c9'),
cmd_calculator_variant('\ua4c8'),
cmd_calculator_variant_outline('\ua4c7'),
cmd_calendar('\ua514'),
cmd_calendar_account('\ua4cb'),
cmd_calendar_account_outline('\ua4ca'),
cmd_calendar_alert('\ua4cd'),
cmd_calendar_alert_outline('\ua4cc'),
cmd_calendar_arrow_left('\ua4ce'),
cmd_calendar_arrow_right('\ua4cf'),
cmd_calendar_badge('\ua4d1'),
cmd_calendar_badge_outline('\ua4d0'),
cmd_calendar_blank('\ua4d4'),
cmd_calendar_blank_multiple('\ua4d2'),
cmd_calendar_blank_outline('\ua4d3'),
cmd_calendar_check('\ua4d6'),
cmd_calendar_check_outline('\ua4d5'),
cmd_calendar_clock('\ua4d8'),
cmd_calendar_clock_outline('\ua4d7'),
cmd_calendar_collapse_horizontal('\ua4da'),
cmd_calendar_collapse_horizontal_outline('\ua4d9'),
cmd_calendar_cursor('\ua4dc'),
cmd_calendar_cursor_outline('\ua4db'),
cmd_calendar_edit('\ua4de'),
cmd_calendar_edit_outline('\ua4dd'),
cmd_calendar_end('\ua4e0'),
cmd_calendar_end_outline('\ua4df'),
cmd_calendar_expand_horizontal('\ua4e2'),
cmd_calendar_expand_horizontal_outline('\ua4e1'),
cmd_calendar_export('\ua4e4'),
cmd_calendar_export_outline('\ua4e3'),
cmd_calendar_filter('\ua4e6'),
cmd_calendar_filter_outline('\ua4e5'),
cmd_calendar_heart('\ua4e8'),
cmd_calendar_heart_outline('\ua4e7'),
cmd_calendar_import('\ua4ea'),
cmd_calendar_import_outline('\ua4e9'),
cmd_calendar_lock('\ua4ee'),
cmd_calendar_lock_open('\ua4ec'),
cmd_calendar_lock_open_outline('\ua4eb'),
cmd_calendar_lock_outline('\ua4ed'),
cmd_calendar_minus('\ua4f0'),
cmd_calendar_minus_outline('\ua4ef'),
cmd_calendar_month('\ua4f2'),
cmd_calendar_month_outline('\ua4f1'),
cmd_calendar_multiple('\ua4f4'),
cmd_calendar_multiple_check('\ua4f3'),
cmd_calendar_multiselect('\ua4f6'),
cmd_calendar_multiselect_outline('\ua4f5'),
cmd_calendar_outline('\ua4f7'),
cmd_calendar_plus('\ua4f9'),
cmd_calendar_plus_outline('\ua4f8'),
cmd_calendar_question('\ua4fb'),
cmd_calendar_question_outline('\ua4fa'),
cmd_calendar_range('\ua4fd'),
cmd_calendar_range_outline('\ua4fc'),
cmd_calendar_refresh('\ua4ff'),
cmd_calendar_refresh_outline('\ua4fe'),
cmd_calendar_remove('\ua501'),
cmd_calendar_remove_outline('\ua500'),
cmd_calendar_search('\ua503'),
cmd_calendar_search_outline('\ua502'),
cmd_calendar_star('\ua505'),
cmd_calendar_star_outline('\ua504'),
cmd_calendar_start('\ua507'),
cmd_calendar_start_outline('\ua506'),
cmd_calendar_sync('\ua509'),
cmd_calendar_sync_outline('\ua508'),
cmd_calendar_text('\ua50b'),
cmd_calendar_text_outline('\ua50a'),
cmd_calendar_today('\ua50d'),
cmd_calendar_today_outline('\ua50c'),
cmd_calendar_week('\ua511'),
cmd_calendar_week_begin('\ua50f'),
cmd_calendar_week_begin_outline('\ua50e'),
cmd_calendar_week_outline('\ua510'),
cmd_calendar_weekend('\ua513'),
cmd_calendar_weekend_outline('\ua512'),
cmd_call_made('\ua515'),
cmd_call_merge('\ua516'),
cmd_call_missed('\ua517'),
cmd_call_received('\ua518'),
cmd_call_split('\ua519'),
cmd_camcorder('\ua51b'),
cmd_camcorder_off('\ua51a'),
cmd_camera('\ua541'),
cmd_camera_account('\ua51c'),
cmd_camera_burst('\ua51d'),
cmd_camera_control('\ua51e'),
cmd_camera_document('\ua520'),
cmd_camera_document_off('\ua51f'),
cmd_camera_enhance('\ua522'),
cmd_camera_enhance_outline('\ua521'),
cmd_camera_flip('\ua524'),
cmd_camera_flip_outline('\ua523'),
cmd_camera_front('\ua526'),
cmd_camera_front_variant('\ua525'),
cmd_camera_gopro('\ua527'),
cmd_camera_image('\ua528'),
cmd_camera_iris('\ua529'),
cmd_camera_lock('\ua52b'),
cmd_camera_lock_outline('\ua52a'),
cmd_camera_marker('\ua52d'),
cmd_camera_marker_outline('\ua52c'),
cmd_camera_metering_center('\ua52e'),
cmd_camera_metering_matrix('\ua52f'),
cmd_camera_metering_partial('\ua530'),
cmd_camera_metering_spot('\ua531'),
cmd_camera_off('\ua533'),
cmd_camera_off_outline('\ua532'),
cmd_camera_outline('\ua534'),
cmd_camera_party_mode('\ua535'),
cmd_camera_plus('\ua537'),
cmd_camera_plus_outline('\ua536'),
cmd_camera_rear('\ua539'),
cmd_camera_rear_variant('\ua538'),
cmd_camera_retake('\ua53b'),
cmd_camera_retake_outline('\ua53a'),
cmd_camera_switch('\ua53d'),
cmd_camera_switch_outline('\ua53c'),
cmd_camera_timer('\ua53e'),
cmd_camera_wireless('\ua540'),
cmd_camera_wireless_outline('\ua53f'),
cmd_campfire('\ua542'),
cmd_cancel('\ua543'),
cmd_candelabra('\ua545'),
cmd_candelabra_fire('\ua544'),
cmd_candle('\ua546'),
cmd_candy('\ua54a'),
cmd_candy_off('\ua548'),
cmd_candy_off_outline('\ua547'),
cmd_candy_outline('\ua549'),
cmd_candycane('\ua54b'),
cmd_cannabis('\ua54d'),
cmd_cannabis_off('\ua54c'),
cmd_caps_lock('\ua54e'),
cmd_car('\ua590'),
cmd_car_2_plus('\ua54f'),
cmd_car_3_plus('\ua550'),
cmd_car_arrow_left('\ua551'),
cmd_car_arrow_right('\ua552'),
cmd_car_back('\ua553'),
cmd_car_battery('\ua554'),
cmd_car_brake_abs('\ua555'),
cmd_car_brake_alert('\ua556'),
cmd_car_brake_fluid_level('\ua557'),
cmd_car_brake_hold('\ua558'),
cmd_car_brake_low_pressure('\ua559'),
cmd_car_brake_parking('\ua55a'),
cmd_car_brake_retarder('\ua55b'),
cmd_car_brake_temperature('\ua55c'),
cmd_car_brake_worn_linings('\ua55d'),
cmd_car_child_seat('\ua55e'),
cmd_car_clock('\ua55f'),
cmd_car_clutch('\ua560'),
cmd_car_cog('\ua561'),
cmd_car_connected('\ua562'),
cmd_car_convertible('\ua563'),
cmd_car_coolant_level('\ua564'),
cmd_car_cruise_control('\ua565'),
cmd_car_defrost_front('\ua566'),
cmd_car_defrost_rear('\ua567'),
cmd_car_door('\ua569'),
cmd_car_door_lock('\ua568'),
cmd_car_electric('\ua56b'),
cmd_car_electric_outline('\ua56a'),
cmd_car_emergency('\ua56c'),
cmd_car_esp('\ua56d'),
cmd_car_estate('\ua56e'),
cmd_car_hatchback('\ua56f'),
cmd_car_info('\ua570'),
cmd_car_key('\ua571'),
cmd_car_lifted_pickup('\ua572'),
cmd_car_light_alert('\ua573'),
cmd_car_light_dimmed('\ua574'),
cmd_car_light_fog('\ua575'),
cmd_car_light_high('\ua576'),
cmd_car_limousine('\ua577'),
cmd_car_multiple('\ua578'),
cmd_car_off('\ua579'),
cmd_car_outline('\ua57a'),
cmd_car_parking_lights('\ua57b'),
cmd_car_pickup('\ua57c'),
cmd_car_search('\ua57e'),
cmd_car_search_outline('\ua57d'),
cmd_car_seat('\ua581'),
cmd_car_seat_cooler('\ua57f'),
cmd_car_seat_heater('\ua580'),
cmd_car_select('\ua582'),
cmd_car_settings('\ua583'),
cmd_car_shift_pattern('\ua584'),
cmd_car_side('\ua585'),
cmd_car_speed_limiter('\ua586'),
cmd_car_sports('\ua587'),
cmd_car_tire_alert('\ua588'),
cmd_car_traction_control('\ua589'),
cmd_car_turbocharger('\ua58a'),
cmd_car_wash('\ua58b'),
cmd_car_windshield('\ua58d'),
cmd_car_windshield_outline('\ua58c'),
cmd_car_wireless('\ua58e'),
cmd_car_wrench('\ua58f'),
cmd_carabiner('\ua591'),
cmd_caravan('\ua592'),
cmd_card('\ua5b0'),
cmd_card_account_details('\ua596'),
cmd_card_account_details_outline('\ua593'),
cmd_card_account_details_star('\ua595'),
cmd_card_account_details_star_outline('\ua594'),
cmd_card_account_mail('\ua598'),
cmd_card_account_mail_outline('\ua597'),
cmd_card_account_phone('\ua59a'),
cmd_card_account_phone_outline('\ua599'),
cmd_card_bulleted('\ua5a0'),
cmd_card_bulleted_off('\ua59c'),
cmd_card_bulleted_off_outline('\ua59b'),
cmd_card_bulleted_outline('\ua59d'),
cmd_card_bulleted_settings('\ua59f'),
cmd_card_bulleted_settings_outline('\ua59e'),
cmd_card_minus('\ua5a2'),
cmd_card_minus_outline('\ua5a1'),
cmd_card_multiple('\ua5a4'),
cmd_card_multiple_outline('\ua5a3'),
cmd_card_off('\ua5a6'),
cmd_card_off_outline('\ua5a5'),
cmd_card_outline('\ua5a7'),
cmd_card_plus('\ua5a9'),
cmd_card_plus_outline('\ua5a8'),
cmd_card_remove('\ua5ab'),
cmd_card_remove_outline('\ua5aa'),
cmd_card_search('\ua5ad'),
cmd_card_search_outline('\ua5ac'),
cmd_card_text('\ua5af'),
cmd_card_text_outline('\ua5ae'),
cmd_cards('\ua5cd'),
cmd_cards_club('\ua5b2'),
cmd_cards_club_outline('\ua5b1'),
cmd_cards_diamond('\ua5b4'),
cmd_cards_diamond_outline('\ua5b3'),
cmd_cards_heart('\ua5b6'),
cmd_cards_heart_outline('\ua5b5'),
cmd_cards_outline('\ua5b7'),
cmd_cards_playing('\ua5c9'),
cmd_cards_playing_club('\ua5bb'),
cmd_cards_playing_club_multiple('\ua5b9'),
cmd_cards_playing_club_multiple_outline('\ua5b8'),
cmd_cards_playing_club_outline('\ua5ba'),
cmd_cards_playing_diamond('\ua5bf'),
cmd_cards_playing_diamond_multiple('\ua5bd'),
cmd_cards_playing_diamond_multiple_outline('\ua5bc'),
cmd_cards_playing_diamond_outline('\ua5be'),
cmd_cards_playing_heart('\ua5c3'),
cmd_cards_playing_heart_multiple('\ua5c1'),
cmd_cards_playing_heart_multiple_outline('\ua5c0'),
cmd_cards_playing_heart_outline('\ua5c2'),
cmd_cards_playing_outline('\ua5c4'),
cmd_cards_playing_spade('\ua5c8'),
cmd_cards_playing_spade_multiple('\ua5c6'),
cmd_cards_playing_spade_multiple_outline('\ua5c5'),
cmd_cards_playing_spade_outline('\ua5c7'),
cmd_cards_spade('\ua5cb'),
cmd_cards_spade_outline('\ua5ca'),
cmd_cards_variant('\ua5cc'),
cmd_carrot('\ua5ce'),
cmd_cart('\ua5db'),
cmd_cart_arrow_down('\ua5cf'),
cmd_cart_arrow_right('\ua5d0'),
cmd_cart_arrow_up('\ua5d1'),
cmd_cart_check('\ua5d2'),
cmd_cart_heart('\ua5d3'),
cmd_cart_minus('\ua5d4'),
cmd_cart_off('\ua5d5'),
cmd_cart_outline('\ua5d6'),
cmd_cart_percent('\ua5d7'),
cmd_cart_plus('\ua5d8'),
cmd_cart_remove('\ua5d9'),
cmd_cart_variant('\ua5da'),
cmd_case_sensitive_alt('\ua5dc'),
cmd_cash('\ua5eb'),
cmd_cash_100('\ua5dd'),
cmd_cash_check('\ua5de'),
cmd_cash_clock('\ua5df'),
cmd_cash_fast('\ua5e0'),
cmd_cash_lock('\ua5e2'),
cmd_cash_lock_open('\ua5e1'),
cmd_cash_marker('\ua5e3'),
cmd_cash_minus('\ua5e4'),
cmd_cash_multiple('\ua5e5'),
cmd_cash_plus('\ua5e6'),
cmd_cash_refund('\ua5e7'),
cmd_cash_register('\ua5e8'),
cmd_cash_remove('\ua5e9'),
cmd_cash_sync('\ua5ea'),
cmd_cassette('\ua5ec'),
cmd_cast('\ua5f3'),
cmd_cast_audio('\ua5ee'),
cmd_cast_audio_variant('\ua5ed'),
cmd_cast_connected('\ua5ef'),
cmd_cast_education('\ua5f0'),
cmd_cast_off('\ua5f1'),
cmd_cast_variant('\ua5f2'),
cmd_castle('\ua5f4'),
cmd_cat('\ua5f5'),
cmd_cctv('\ua5f7'),
cmd_cctv_off('\ua5f6'),
cmd_ceiling_fan('\ua5f9'),
cmd_ceiling_fan_light('\ua5f8'),
cmd_ceiling_light('\ua5fd'),
cmd_ceiling_light_multiple('\ua5fb'),
cmd_ceiling_light_multiple_outline('\ua5fa'),
cmd_ceiling_light_outline('\ua5fc'),
cmd_cellphone('\ua617'),
cmd_cellphone_arrow_down('\ua5ff'),
cmd_cellphone_arrow_down_variant('\ua5fe'),
cmd_cellphone_basic('\ua600'),
cmd_cellphone_charging('\ua601'),
cmd_cellphone_check('\ua602'),
cmd_cellphone_cog('\ua603'),
cmd_cellphone_dock('\ua604'),
cmd_cellphone_information('\ua605'),
cmd_cellphone_key('\ua606'),
cmd_cellphone_link('\ua608'),
cmd_cellphone_link_off('\ua607'),
cmd_cellphone_lock('\ua609'),
cmd_cellphone_marker('\ua60a'),
cmd_cellphone_message('\ua60c'),
cmd_cellphone_message_off('\ua60b'),
cmd_cellphone_nfc('\ua60e'),
cmd_cellphone_nfc_off('\ua60d'),
cmd_cellphone_off('\ua60f'),
cmd_cellphone_play('\ua610'),
cmd_cellphone_remove('\ua611'),
cmd_cellphone_screenshot('\ua612'),
cmd_cellphone_settings('\ua613'),
cmd_cellphone_sound('\ua614'),
cmd_cellphone_text('\ua615'),
cmd_cellphone_wireless('\ua616'),
cmd_centos('\ua618'),
cmd_certificate('\ua61a'),
cmd_certificate_outline('\ua619'),
cmd_chair_rolling('\ua61b'),
cmd_chair_school('\ua61c'),
cmd_chandelier('\ua61d'),
cmd_charity('\ua61e'),
cmd_chart_arc('\ua61f'),
cmd_chart_areaspline('\ua621'),
cmd_chart_areaspline_variant('\ua620'),
cmd_chart_bar('\ua623'),
cmd_chart_bar_stacked('\ua622'),
cmd_chart_bell_curve('\ua625'),
cmd_chart_bell_curve_cumulative('\ua624'),
cmd_chart_box('\ua628'),
cmd_chart_box_outline('\ua626'),
cmd_chart_box_plus_outline('\ua627'),
cmd_chart_bubble('\ua629'),
cmd_chart_donut('\ua62b'),
cmd_chart_donut_variant('\ua62a'),
cmd_chart_gantt('\ua62c'),
cmd_chart_histogram('\ua62d'),
cmd_chart_line('\ua630'),
cmd_chart_line_stacked('\ua62e'),
cmd_chart_line_variant('\ua62f'),
cmd_chart_multiline('\ua631'),
cmd_chart_multiple('\ua632'),
cmd_chart_pie('\ua633'),
cmd_chart_ppf('\ua634'),
cmd_chart_sankey('\ua636'),
cmd_chart_sankey_variant('\ua635'),
cmd_chart_scatter_plot('\ua638'),
cmd_chart_scatter_plot_hexbin('\ua637'),
cmd_chart_timeline('\ua63b'),
cmd_chart_timeline_variant('\ua63a'),
cmd_chart_timeline_variant_shimmer('\ua639'),
cmd_chart_tree('\ua63c'),
cmd_chart_waterfall('\ua63d'),
cmd_chat('\ua64d'),
cmd_chat_alert('\ua63f'),
cmd_chat_alert_outline('\ua63e'),
cmd_chat_minus('\ua641'),
cmd_chat_minus_outline('\ua640'),
cmd_chat_outline('\ua642'),
cmd_chat_plus('\ua644'),
cmd_chat_plus_outline('\ua643'),
cmd_chat_processing('\ua646'),
cmd_chat_processing_outline('\ua645'),
cmd_chat_question('\ua648'),
cmd_chat_question_outline('\ua647'),
cmd_chat_remove('\ua64a'),
cmd_chat_remove_outline('\ua649'),
cmd_chat_sleep('\ua64c'),
cmd_chat_sleep_outline('\ua64b'),
cmd_check('\ua65a'),
cmd_check_all('\ua64e'),
cmd_check_bold('\ua64f'),
cmd_check_circle('\ua651'),
cmd_check_circle_outline('\ua650'),
cmd_check_decagram('\ua653'),
cmd_check_decagram_outline('\ua652'),
cmd_check_network('\ua655'),
cmd_check_network_outline('\ua654'),
cmd_check_outline('\ua656'),
cmd_check_underline('\ua659'),
cmd_check_underline_circle('\ua658'),
cmd_check_underline_circle_outline('\ua657'),
cmd_checkbook('\ua65b'),
cmd_checkbox_blank('\ua663'),
cmd_checkbox_blank_badge('\ua65d'),
cmd_checkbox_blank_badge_outline('\ua65c'),
cmd_checkbox_blank_circle('\ua65f'),
cmd_checkbox_blank_circle_outline('\ua65e'),
cmd_checkbox_blank_off('\ua661'),
cmd_checkbox_blank_off_outline('\ua660'),
cmd_checkbox_blank_outline('\ua662'),
cmd_checkbox_intermediate('\ua665'),
cmd_checkbox_intermediate_variant('\ua664'),
cmd_checkbox_marked('\ua66a'),
cmd_checkbox_marked_circle('\ua668'),
cmd_checkbox_marked_circle_outline('\ua666'),
cmd_checkbox_marked_circle_plus_outline('\ua667'),
cmd_checkbox_marked_outline('\ua669'),
cmd_checkbox_multiple_blank('\ua66e'),
cmd_checkbox_multiple_blank_circle('\ua66c'),
cmd_checkbox_multiple_blank_circle_outline('\ua66b'),
cmd_checkbox_multiple_blank_outline('\ua66d'),
cmd_checkbox_multiple_marked('\ua672'),
cmd_checkbox_multiple_marked_circle('\ua670'),
cmd_checkbox_multiple_marked_circle_outline('\ua66f'),
cmd_checkbox_multiple_marked_outline('\ua671'),
cmd_checkbox_multiple_outline('\ua673'),
cmd_checkbox_outline('\ua674'),
cmd_checkerboard('\ua678'),
cmd_checkerboard_minus('\ua675'),
cmd_checkerboard_plus('\ua676'),
cmd_checkerboard_remove('\ua677'),
cmd_cheese('\ua67a'),
cmd_cheese_off('\ua679'),
cmd_chef_hat('\ua67b'),
cmd_chemical_weapon('\ua67c'),
cmd_chess_bishop('\ua67d'),
cmd_chess_king('\ua67e'),
cmd_chess_knight('\ua67f'),
cmd_chess_pawn('\ua680'),
cmd_chess_queen('\ua681'),
cmd_chess_rook('\ua682'),
cmd_chevron_double_down('\ua683'),
cmd_chevron_double_left('\ua684'),
cmd_chevron_double_right('\ua685'),
cmd_chevron_double_up('\ua686'),
cmd_chevron_down('\ua68b'),
cmd_chevron_down_box('\ua688'),
cmd_chevron_down_box_outline('\ua687'),
cmd_chevron_down_circle('\ua68a'),
cmd_chevron_down_circle_outline('\ua689'),
cmd_chevron_left('\ua690'),
cmd_chevron_left_box('\ua68d'),
cmd_chevron_left_box_outline('\ua68c'),
cmd_chevron_left_circle('\ua68f'),
cmd_chevron_left_circle_outline('\ua68e'),
cmd_chevron_right('\ua695'),
cmd_chevron_right_box('\ua692'),
cmd_chevron_right_box_outline('\ua691'),
cmd_chevron_right_circle('\ua694'),
cmd_chevron_right_circle_outline('\ua693'),
cmd_chevron_triple_down('\ua696'),
cmd_chevron_triple_left('\ua697'),
cmd_chevron_triple_right('\ua698'),
cmd_chevron_triple_up('\ua699'),
cmd_chevron_up('\ua69e'),
cmd_chevron_up_box('\ua69b'),
cmd_chevron_up_box_outline('\ua69a'),
cmd_chevron_up_circle('\ua69d'),
cmd_chevron_up_circle_outline('\ua69c'),
cmd_chili_alert('\ua6a0'),
cmd_chili_alert_outline('\ua69f'),
cmd_chili_hot('\ua6a2'),
cmd_chili_hot_outline('\ua6a1'),
cmd_chili_medium('\ua6a4'),
cmd_chili_medium_outline('\ua6a3'),
cmd_chili_mild('\ua6a6'),
cmd_chili_mild_outline('\ua6a5'),
cmd_chili_off('\ua6a8'),
cmd_chili_off_outline('\ua6a7'),
cmd_chip('\ua6a9'),
cmd_church('\ua6ab'),
cmd_church_outline('\ua6aa'),
cmd_cigar('\ua6ad'),
cmd_cigar_off('\ua6ac'),
cmd_circle('\ua6c4'),
cmd_circle_box('\ua6af'),
cmd_circle_box_outline('\ua6ae'),
cmd_circle_double('\ua6b0'),
cmd_circle_edit_outline('\ua6b1'),
cmd_circle_expand('\ua6b2'),
cmd_circle_half('\ua6b4'),
cmd_circle_half_full('\ua6b3'),
cmd_circle_medium('\ua6b5'),
cmd_circle_multiple('\ua6b7'),
cmd_circle_multiple_outline('\ua6b6'),
cmd_circle_off_outline('\ua6b8'),
cmd_circle_opacity('\ua6b9'),
cmd_circle_outline('\ua6ba'),
cmd_circle_slice_1('\ua6bb'),
cmd_circle_slice_2('\ua6bc'),
cmd_circle_slice_3('\ua6bd'),
cmd_circle_slice_4('\ua6be'),
cmd_circle_slice_5('\ua6bf'),
cmd_circle_slice_6('\ua6c0'),
cmd_circle_slice_7('\ua6c1'),
cmd_circle_slice_8('\ua6c2'),
cmd_circle_small('\ua6c3'),
cmd_circular_saw('\ua6c5'),
cmd_city('\ua6c8'),
cmd_city_variant('\ua6c7'),
cmd_city_variant_outline('\ua6c6'),
cmd_clipboard('\ua702'),
cmd_clipboard_account('\ua6ca'),
cmd_clipboard_account_outline('\ua6c9'),
cmd_clipboard_alert('\ua6cc'),
cmd_clipboard_alert_outline('\ua6cb'),
cmd_clipboard_arrow_down('\ua6ce'),
cmd_clipboard_arrow_down_outline('\ua6cd'),
cmd_clipboard_arrow_left('\ua6d0'),
cmd_clipboard_arrow_left_outline('\ua6cf'),
cmd_clipboard_arrow_right('\ua6d2'),
cmd_clipboard_arrow_right_outline('\ua6d1'),
cmd_clipboard_arrow_up('\ua6d4'),
cmd_clipboard_arrow_up_outline('\ua6d3'),
cmd_clipboard_check('\ua6d8'),
cmd_clipboard_check_multiple('\ua6d6'),
cmd_clipboard_check_multiple_outline('\ua6d5'),
cmd_clipboard_check_outline('\ua6d7'),
cmd_clipboard_clock('\ua6da'),
cmd_clipboard_clock_outline('\ua6d9'),
cmd_clipboard_edit('\ua6dc'),
cmd_clipboard_edit_outline('\ua6db'),
cmd_clipboard_file('\ua6de'),
cmd_clipboard_file_outline('\ua6dd'),
cmd_clipboard_flow('\ua6e0'),
cmd_clipboard_flow_outline('\ua6df'),
cmd_clipboard_list('\ua6e2'),
cmd_clipboard_list_outline('\ua6e1'),
cmd_clipboard_minus('\ua6e4'),
cmd_clipboard_minus_outline('\ua6e3'),
cmd_clipboard_multiple('\ua6e6'),
cmd_clipboard_multiple_outline('\ua6e5'),
cmd_clipboard_off('\ua6e8'),
cmd_clipboard_off_outline('\ua6e7'),
cmd_clipboard_outline('\ua6e9'),
cmd_clipboard_play('\ua6ed'),
cmd_clipboard_play_multiple('\ua6eb'),
cmd_clipboard_play_multiple_outline('\ua6ea'),
cmd_clipboard_play_outline('\ua6ec'),
cmd_clipboard_plus('\ua6ef'),
cmd_clipboard_plus_outline('\ua6ee'),
cmd_clipboard_pulse('\ua6f1'),
cmd_clipboard_pulse_outline('\ua6f0'),
cmd_clipboard_remove('\ua6f3'),
cmd_clipboard_remove_outline('\ua6f2'),
cmd_clipboard_search('\ua6f5'),
cmd_clipboard_search_outline('\ua6f4'),
cmd_clipboard_text('\ua701'),
cmd_clipboard_text_clock('\ua6f7'),
cmd_clipboard_text_clock_outline('\ua6f6'),
cmd_clipboard_text_multiple('\ua6f9'),
cmd_clipboard_text_multiple_outline('\ua6f8'),
cmd_clipboard_text_off('\ua6fb'),
cmd_clipboard_text_off_outline('\ua6fa'),
cmd_clipboard_text_outline('\ua6fc'),
cmd_clipboard_text_play('\ua6fe'),
cmd_clipboard_text_play_outline('\ua6fd'),
cmd_clipboard_text_search('\ua700'),
cmd_clipboard_text_search_outline('\ua6ff'),
cmd_clippy('\ua703'),
cmd_clock('\ua72f'),
cmd_clock_alert('\ua705'),
cmd_clock_alert_outline('\ua704'),
cmd_clock_check('\ua707'),
cmd_clock_check_outline('\ua706'),
cmd_clock_digital('\ua708'),
cmd_clock_edit('\ua70a'),
cmd_clock_edit_outline('\ua709'),
cmd_clock_end('\ua70b'),
cmd_clock_fast('\ua70c'),
cmd_clock_in('\ua70d'),
cmd_clock_minus('\ua70f'),
cmd_clock_minus_outline('\ua70e'),
cmd_clock_out('\ua710'),
cmd_clock_outline('\ua711'),
cmd_clock_plus('\ua713'),
cmd_clock_plus_outline('\ua712'),
cmd_clock_remove('\ua715'),
cmd_clock_remove_outline('\ua714'),
cmd_clock_start('\ua716'),
cmd_clock_time_eight('\ua718'),
cmd_clock_time_eight_outline('\ua717'),
cmd_clock_time_eleven('\ua71a'),
cmd_clock_time_eleven_outline('\ua719'),
cmd_clock_time_five('\ua71c'),
cmd_clock_time_five_outline('\ua71b'),
cmd_clock_time_four('\ua71e'),
cmd_clock_time_four_outline('\ua71d'),
cmd_clock_time_nine('\ua720'),
cmd_clock_time_nine_outline('\ua71f'),
cmd_clock_time_one('\ua722'),
cmd_clock_time_one_outline('\ua721'),
cmd_clock_time_seven('\ua724'),
cmd_clock_time_seven_outline('\ua723'),
cmd_clock_time_six('\ua726'),
cmd_clock_time_six_outline('\ua725'),
cmd_clock_time_ten('\ua728'),
cmd_clock_time_ten_outline('\ua727'),
cmd_clock_time_three('\ua72a'),
cmd_clock_time_three_outline('\ua729'),
cmd_clock_time_twelve('\ua72c'),
cmd_clock_time_twelve_outline('\ua72b'),
cmd_clock_time_two('\ua72e'),
cmd_clock_time_two_outline('\ua72d'),
cmd_close('\ua73e'),
cmd_close_box('\ua733'),
cmd_close_box_multiple('\ua731'),
cmd_close_box_multiple_outline('\ua730'),
cmd_close_box_outline('\ua732'),
cmd_close_circle('\ua737'),
cmd_close_circle_multiple('\ua735'),
cmd_close_circle_multiple_outline('\ua734'),
cmd_close_circle_outline('\ua736'),
cmd_close_network('\ua739'),
cmd_close_network_outline('\ua738'),
cmd_close_octagon('\ua73b'),
cmd_close_octagon_outline('\ua73a'),
cmd_close_outline('\ua73c'),
cmd_close_thick('\ua73d'),
cmd_closed_caption('\ua740'),
cmd_closed_caption_outline('\ua73f'),
cmd_cloud('\ua759'),
cmd_cloud_alert('\ua741'),
cmd_cloud_braces('\ua742'),
cmd_cloud_check('\ua744'),
cmd_cloud_check_outline('\ua743'),
cmd_cloud_circle('\ua745'),
cmd_cloud_download('\ua747'),
cmd_cloud_download_outline('\ua746'),
cmd_cloud_lock('\ua749'),
cmd_cloud_lock_outline('\ua748'),
cmd_cloud_off_outline('\ua74a'),
cmd_cloud_outline('\ua74b'),
cmd_cloud_percent('\ua74d'),
cmd_cloud_percent_outline('\ua74c'),
cmd_cloud_print('\ua74f'),
cmd_cloud_print_outline('\ua74e'),
cmd_cloud_question('\ua750'),
cmd_cloud_refresh('\ua751'),
cmd_cloud_search('\ua753'),
cmd_cloud_search_outline('\ua752'),
cmd_cloud_sync('\ua755'),
cmd_cloud_sync_outline('\ua754'),
cmd_cloud_tags('\ua756'),
cmd_cloud_upload('\ua758'),
cmd_cloud_upload_outline('\ua757'),
cmd_clouds('\ua75a'),
cmd_clover('\ua75b'),
cmd_coach_lamp('\ua75d'),
cmd_coach_lamp_variant('\ua75c'),
cmd_coat_rack('\ua75e'),
cmd_code_array('\ua75f'),
cmd_code_braces('\ua761'),
cmd_code_braces_box('\ua760'),
cmd_code_brackets('\ua762'),
cmd_code_equal('\ua763'),
cmd_code_greater_than('\ua765'),
cmd_code_greater_than_or_equal('\ua764'),
cmd_code_json('\ua766'),
cmd_code_less_than('\ua768'),
cmd_code_less_than_or_equal('\ua767'),
cmd_code_not_equal('\ua76a'),
cmd_code_not_equal_variant('\ua769'),
cmd_code_parentheses('\ua76c'),
cmd_code_parentheses_box('\ua76b'),
cmd_code_string('\ua76d'),
cmd_code_tags('\ua76f'),
cmd_code_tags_check('\ua76e'),
cmd_codepen('\ua770'),
cmd_coffee('\ua77a'),
cmd_coffee_maker('\ua774'),
cmd_coffee_maker_check('\ua772'),
cmd_coffee_maker_check_outline('\ua771'),
cmd_coffee_maker_outline('\ua773'),
cmd_coffee_off('\ua776'),
cmd_coffee_off_outline('\ua775'),
cmd_coffee_outline('\ua777'),
cmd_coffee_to_go('\ua779'),
cmd_coffee_to_go_outline('\ua778'),
cmd_coffin('\ua77b'),
cmd_cog('\ua78e'),
cmd_cog_box('\ua77c'),
cmd_cog_clockwise('\ua77d'),
cmd_cog_counterclockwise('\ua77e'),
cmd_cog_off('\ua780'),
cmd_cog_off_outline('\ua77f'),
cmd_cog_outline('\ua781'),
cmd_cog_pause('\ua783'),
cmd_cog_pause_outline('\ua782'),
cmd_cog_play('\ua785'),
cmd_cog_play_outline('\ua784'),
cmd_cog_refresh('\ua787'),
cmd_cog_refresh_outline('\ua786'),
cmd_cog_stop('\ua789'),
cmd_cog_stop_outline('\ua788'),
cmd_cog_sync('\ua78b'),
cmd_cog_sync_outline('\ua78a'),
cmd_cog_transfer('\ua78d'),
cmd_cog_transfer_outline('\ua78c'),
cmd_cogs('\ua78f'),
cmd_collage('\ua790'),
cmd_collapse_all('\ua792'),
cmd_collapse_all_outline('\ua791'),
cmd_color_helper('\ua793'),
cmd_comma('\ua798'),
cmd_comma_box('\ua795'),
cmd_comma_box_outline('\ua794'),
cmd_comma_circle('\ua797'),
cmd_comma_circle_outline('\ua796'),
cmd_comment('\ua7c2'),
cmd_comment_account('\ua79a'),
cmd_comment_account_outline('\ua799'),
cmd_comment_alert('\ua79c'),
cmd_comment_alert_outline('\ua79b'),
cmd_comment_arrow_left('\ua79e'),
cmd_comment_arrow_left_outline('\ua79d'),
cmd_comment_arrow_right('\ua7a0'),
cmd_comment_arrow_right_outline('\ua79f'),
cmd_comment_bookmark('\ua7a2'),
cmd_comment_bookmark_outline('\ua7a1'),
cmd_comment_check('\ua7a4'),
cmd_comment_check_outline('\ua7a3'),
cmd_comment_edit('\ua7a6'),
cmd_comment_edit_outline('\ua7a5'),
cmd_comment_eye('\ua7a8'),
cmd_comment_eye_outline('\ua7a7'),
cmd_comment_flash('\ua7aa'),
cmd_comment_flash_outline('\ua7a9'),
cmd_comment_minus('\ua7ac'),
cmd_comment_minus_outline('\ua7ab'),
cmd_comment_multiple('\ua7ae'),
cmd_comment_multiple_outline('\ua7ad'),
cmd_comment_off('\ua7b0'),
cmd_comment_off_outline('\ua7af'),
cmd_comment_outline('\ua7b1'),
cmd_comment_plus('\ua7b3'),
cmd_comment_plus_outline('\ua7b2'),
cmd_comment_processing('\ua7b5'),
cmd_comment_processing_outline('\ua7b4'),
cmd_comment_question('\ua7b7'),
cmd_comment_question_outline('\ua7b6'),
cmd_comment_quote('\ua7b9'),
cmd_comment_quote_outline('\ua7b8'),
cmd_comment_remove('\ua7bb'),
cmd_comment_remove_outline('\ua7ba'),
cmd_comment_search('\ua7bd'),
cmd_comment_search_outline('\ua7bc'),
cmd_comment_text('\ua7c1'),
cmd_comment_text_multiple('\ua7bf'),
cmd_comment_text_multiple_outline('\ua7be'),
cmd_comment_text_outline('\ua7c0'),
cmd_compare('\ua7c6'),
cmd_compare_horizontal('\ua7c3'),
cmd_compare_remove('\ua7c4'),
cmd_compare_vertical('\ua7c5'),
cmd_compass('\ua7cb'),
cmd_compass_off('\ua7c8'),
cmd_compass_off_outline('\ua7c7'),
cmd_compass_outline('\ua7c9'),
cmd_compass_rose('\ua7ca'),
cmd_compost('\ua7cc'),
cmd_cone('\ua7ce'),
cmd_cone_off('\ua7cd'),
cmd_connection('\ua7cf'),
cmd_console('\ua7d3'),
cmd_console_line('\ua7d0'),
cmd_console_network('\ua7d2'),
cmd_console_network_outline('\ua7d1'),
cmd_consolidate('\ua7d4'),
cmd_contactless_payment('\ua7d7'),
cmd_contactless_payment_circle('\ua7d6'),
cmd_contactless_payment_circle_outline('\ua7d5'),
cmd_contacts('\ua7d9'),
cmd_contacts_outline('\ua7d8'),
cmd_contain('\ua7dc'),
cmd_contain_end('\ua7da'),
cmd_contain_start('\ua7db'),
cmd_content_copy('\ua7dd'),
cmd_content_cut('\ua7de'),
cmd_content_duplicate('\ua7df'),
cmd_content_paste('\ua7e0'),
cmd_content_save('\ua7f6'),
cmd_content_save_alert('\ua7e2'),
cmd_content_save_alert_outline('\ua7e1'),
cmd_content_save_all('\ua7e4'),
cmd_content_save_all_outline('\ua7e3'),
cmd_content_save_check('\ua7e6'),
cmd_content_save_check_outline('\ua7e5'),
cmd_content_save_cog('\ua7e8'),
cmd_content_save_cog_outline('\ua7e7'),
cmd_content_save_edit('\ua7ea'),
cmd_content_save_edit_outline('\ua7e9'),
cmd_content_save_minus('\ua7ec'),
cmd_content_save_minus_outline('\ua7eb'),
cmd_content_save_move('\ua7ee'),
cmd_content_save_move_outline('\ua7ed'),
cmd_content_save_off('\ua7f0'),
cmd_content_save_off_outline('\ua7ef'),
cmd_content_save_outline('\ua7f1'),
cmd_content_save_plus('\ua7f3'),
cmd_content_save_plus_outline('\ua7f2'),
cmd_content_save_settings('\ua7f5'),
cmd_content_save_settings_outline('\ua7f4'),
cmd_contrast('\ua7f9'),
cmd_contrast_box('\ua7f7'),
cmd_contrast_circle('\ua7f8'),
cmd_controller('\ua7fd'),
cmd_controller_classic('\ua7fb'),
cmd_controller_classic_outline('\ua7fa'),
cmd_controller_off('\ua7fc'),
cmd_cookie('\ua817'),
cmd_cookie_alert('\ua7ff'),
cmd_cookie_alert_outline('\ua7fe'),
cmd_cookie_check('\ua801'),
cmd_cookie_check_outline('\ua800'),
cmd_cookie_clock('\ua803'),
cmd_cookie_clock_outline('\ua802'),
cmd_cookie_cog('\ua805'),
cmd_cookie_cog_outline('\ua804'),
cmd_cookie_edit('\ua807'),
cmd_cookie_edit_outline('\ua806'),
cmd_cookie_lock('\ua809'),
cmd_cookie_lock_outline('\ua808'),
cmd_cookie_minus('\ua80b'),
cmd_cookie_minus_outline('\ua80a'),
cmd_cookie_off('\ua80d'),
cmd_cookie_off_outline('\ua80c'),
cmd_cookie_outline('\ua80e'),
cmd_cookie_plus('\ua810'),
cmd_cookie_plus_outline('\ua80f'),
cmd_cookie_refresh('\ua812'),
cmd_cookie_refresh_outline('\ua811'),
cmd_cookie_remove('\ua814'),
cmd_cookie_remove_outline('\ua813'),
cmd_cookie_settings('\ua816'),
cmd_cookie_settings_outline('\ua815'),
cmd_coolant_temperature('\ua818'),
cmd_copyleft('\ua819'),
cmd_copyright('\ua81a'),
cmd_cordova('\ua81b'),
cmd_corn('\ua81d'),
cmd_corn_off('\ua81c'),
cmd_cosine_wave('\ua81e'),
cmd_counter('\ua81f'),
cmd_countertop('\ua821'),
cmd_countertop_outline('\ua820'),
cmd_cow('\ua823'),
cmd_cow_off('\ua822'),
cmd_cpu_32_bit('\ua824'),
cmd_cpu_64_bit('\ua825'),
cmd_cradle('\ua827'),
cmd_cradle_outline('\ua826'),
cmd_crane('\ua828'),
cmd_creation('\ua829'),
cmd_creative_commons('\ua82a'),
cmd_credit_card('\ua854'),
cmd_credit_card_check('\ua82c'),
cmd_credit_card_check_outline('\ua82b'),
cmd_credit_card_chip('\ua82e'),
cmd_credit_card_chip_outline('\ua82d'),
cmd_credit_card_clock('\ua830'),
cmd_credit_card_clock_outline('\ua82f'),
cmd_credit_card_edit('\ua832'),
cmd_credit_card_edit_outline('\ua831'),
cmd_credit_card_fast('\ua834'),
cmd_credit_card_fast_outline('\ua833'),
cmd_credit_card_lock('\ua836'),
cmd_credit_card_lock_outline('\ua835'),
cmd_credit_card_marker('\ua838'),
cmd_credit_card_marker_outline('\ua837'),
cmd_credit_card_minus('\ua83a'),
cmd_credit_card_minus_outline('\ua839'),
cmd_credit_card_multiple('\ua83c'),
cmd_credit_card_multiple_outline('\ua83b'),
cmd_credit_card_off('\ua83e'),
cmd_credit_card_off_outline('\ua83d'),
cmd_credit_card_outline('\ua83f'),
cmd_credit_card_plus('\ua841'),
cmd_credit_card_plus_outline('\ua840'),
cmd_credit_card_refresh('\ua843'),
cmd_credit_card_refresh_outline('\ua842'),
cmd_credit_card_refund('\ua845'),
cmd_credit_card_refund_outline('\ua844'),
cmd_credit_card_remove('\ua847'),
cmd_credit_card_remove_outline('\ua846'),
cmd_credit_card_scan('\ua849'),
cmd_credit_card_scan_outline('\ua848'),
cmd_credit_card_search('\ua84b'),
cmd_credit_card_search_outline('\ua84a'),
cmd_credit_card_settings('\ua84d'),
cmd_credit_card_settings_outline('\ua84c'),
cmd_credit_card_sync('\ua84f'),
cmd_credit_card_sync_outline('\ua84e'),
cmd_credit_card_wireless('\ua853'),
cmd_credit_card_wireless_off('\ua851'),
cmd_credit_card_wireless_off_outline('\ua850'),
cmd_credit_card_wireless_outline('\ua852'),
cmd_cricket('\ua855'),
cmd_crop('\ua85b'),
cmd_crop_free('\ua856'),
cmd_crop_landscape('\ua857'),
cmd_crop_portrait('\ua858'),
cmd_crop_rotate('\ua859'),
cmd_crop_square('\ua85a'),
cmd_cross('\ua85f'),
cmd_cross_bolnisi('\ua85c'),
cmd_cross_celtic('\ua85d'),
cmd_cross_outline('\ua85e'),
cmd_crosshairs('\ua863'),
cmd_crosshairs_gps('\ua860'),
cmd_crosshairs_off('\ua861'),
cmd_crosshairs_question('\ua862'),
cmd_crowd('\ua864'),
cmd_crown('\ua868'),
cmd_crown_circle('\ua866'),
cmd_crown_circle_outline('\ua865'),
cmd_crown_outline('\ua867'),
cmd_cryengine('\ua869'),
cmd_crystal_ball('\ua86a'),
cmd_cube('\ua871'),
cmd_cube_off('\ua86c'),
cmd_cube_off_outline('\ua86b'),
cmd_cube_outline('\ua86d'),
cmd_cube_scan('\ua86e'),
cmd_cube_send('\ua86f'),
cmd_cube_unfolded('\ua870'),
cmd_cup('\ua876'),
cmd_cup_off('\ua873'),
cmd_cup_off_outline('\ua872'),
cmd_cup_outline('\ua874'),
cmd_cup_water('\ua875'),
cmd_cupboard('\ua878'),
cmd_cupboard_outline('\ua877'),
cmd_cupcake('\ua879'),
cmd_curling('\ua87a'),
cmd_currency_bdt('\ua87b'),
cmd_currency_brl('\ua87c'),
cmd_currency_btc('\ua87d'),
cmd_currency_cny('\ua87e'),
cmd_currency_eth('\ua87f'),
cmd_currency_eur('\ua881'),
cmd_currency_eur_off('\ua880'),
cmd_currency_fra('\ua882'),
cmd_currency_gbp('\ua883'),
cmd_currency_ils('\ua884'),
cmd_currency_inr('\ua885'),
cmd_currency_jpy('\ua886'),
cmd_currency_krw('\ua887'),
cmd_currency_kzt('\ua888'),
cmd_currency_mnt('\ua889'),
cmd_currency_ngn('\ua88a'),
cmd_currency_php('\ua88b'),
cmd_currency_rial('\ua88c'),
cmd_currency_rub('\ua88d'),
cmd_currency_rupee('\ua88e'),
cmd_currency_sign('\ua88f'),
cmd_currency_try('\ua890'),
cmd_currency_twd('\ua891'),
cmd_currency_uah('\ua892'),
cmd_currency_usd('\ua894'),
cmd_currency_usd_off('\ua893'),
cmd_current_ac('\ua895'),
cmd_current_dc('\ua896'),
cmd_cursor_default('\ua89c'),
cmd_cursor_default_click('\ua898'),
cmd_cursor_default_click_outline('\ua897'),
cmd_cursor_default_gesture('\ua89a'),
cmd_cursor_default_gesture_outline('\ua899'),
cmd_cursor_default_outline('\ua89b'),
cmd_cursor_move('\ua89d'),
cmd_cursor_pointer('\ua89e'),
cmd_cursor_text('\ua89f'),
cmd_curtains('\ua8a1'),
cmd_curtains_closed('\ua8a0'),
cmd_cylinder('\ua8a3'),
cmd_cylinder_off('\ua8a2'),
cmd_dance_ballroom('\ua8a4'),
cmd_dance_pole('\ua8a5'),
cmd_data_matrix('\ua8ab'),
cmd_data_matrix_edit('\ua8a6'),
cmd_data_matrix_minus('\ua8a7'),
cmd_data_matrix_plus('\ua8a8'),
cmd_data_matrix_remove('\ua8a9'),
cmd_data_matrix_scan('\ua8aa'),
cmd_database('\ua8db'),
cmd_database_alert('\ua8ad'),
cmd_database_alert_outline('\ua8ac'),
cmd_database_arrow_down('\ua8af'),
cmd_database_arrow_down_outline('\ua8ae'),
cmd_database_arrow_left('\ua8b1'),
cmd_database_arrow_left_outline('\ua8b0'),
cmd_database_arrow_right('\ua8b3'),
cmd_database_arrow_right_outline('\ua8b2'),
cmd_database_arrow_up('\ua8b5'),
cmd_database_arrow_up_outline('\ua8b4'),
cmd_database_check('\ua8b7'),
cmd_database_check_outline('\ua8b6'),
cmd_database_clock('\ua8b9'),
cmd_database_clock_outline('\ua8b8'),
cmd_database_cog('\ua8bb'),
cmd_database_cog_outline('\ua8ba'),
cmd_database_edit('\ua8bd'),
cmd_database_edit_outline('\ua8bc'),
cmd_database_export('\ua8bf'),
cmd_database_export_outline('\ua8be'),
cmd_database_eye('\ua8c3'),
cmd_database_eye_off('\ua8c1'),
cmd_database_eye_off_outline('\ua8c0'),
cmd_database_eye_outline('\ua8c2'),
cmd_database_import('\ua8c5'),
cmd_database_import_outline('\ua8c4'),
cmd_database_lock('\ua8c7'),
cmd_database_lock_outline('\ua8c6'),
cmd_database_marker('\ua8c9'),
cmd_database_marker_outline('\ua8c8'),
cmd_database_minus('\ua8cb'),
cmd_database_minus_outline('\ua8ca'),
cmd_database_off('\ua8cd'),
cmd_database_off_outline('\ua8cc'),
cmd_database_outline('\ua8ce'),
cmd_database_plus('\ua8d0'),
cmd_database_plus_outline('\ua8cf'),
cmd_database_refresh('\ua8d2'),
cmd_database_refresh_outline('\ua8d1'),
cmd_database_remove('\ua8d4'),
cmd_database_remove_outline('\ua8d3'),
cmd_database_search('\ua8d6'),
cmd_database_search_outline('\ua8d5'),
cmd_database_settings('\ua8d8'),
cmd_database_settings_outline('\ua8d7'),
cmd_database_sync('\ua8da'),
cmd_database_sync_outline('\ua8d9'),
cmd_death_star('\ua8dd'),
cmd_death_star_variant('\ua8dc'),
cmd_deathly_hallows('\ua8de'),
cmd_debian('\ua8df'),
cmd_debug_step_into('\ua8e0'),
cmd_debug_step_out('\ua8e1'),
cmd_debug_step_over('\ua8e2'),
cmd_decagram('\ua8e4'),
cmd_decagram_outline('\ua8e3'),
cmd_decimal('\ua8ea'),
cmd_decimal_comma('\ua8e7'),
cmd_decimal_comma_decrease('\ua8e5'),
cmd_decimal_comma_increase('\ua8e6'),
cmd_decimal_decrease('\ua8e8'),
cmd_decimal_increase('\ua8e9'),
cmd_delete('\ua8fc'),
cmd_delete_alert('\ua8ec'),
cmd_delete_alert_outline('\ua8eb'),
cmd_delete_circle('\ua8ee'),
cmd_delete_circle_outline('\ua8ed'),
cmd_delete_clock('\ua8f0'),
cmd_delete_clock_outline('\ua8ef'),
cmd_delete_empty('\ua8f2'),
cmd_delete_empty_outline('\ua8f1'),
cmd_delete_forever('\ua8f4'),
cmd_delete_forever_outline('\ua8f3'),
cmd_delete_off('\ua8f6'),
cmd_delete_off_outline('\ua8f5'),
cmd_delete_outline('\ua8f7'),
cmd_delete_restore('\ua8f8'),
cmd_delete_sweep('\ua8fa'),
cmd_delete_sweep_outline('\ua8f9'),
cmd_delete_variant('\ua8fb'),
cmd_delta('\ua8fd'),
cmd_desk('\ua901'),
cmd_desk_lamp('\ua900'),
cmd_desk_lamp_off('\ua8fe'),
cmd_desk_lamp_on('\ua8ff'),
cmd_deskphone('\ua902'),
cmd_desktop_classic('\ua903'),
cmd_desktop_tower('\ua905'),
cmd_desktop_tower_monitor('\ua904'),
cmd_details('\ua906'),
cmd_dev_to('\ua907'),
cmd_developer_board('\ua908'),
cmd_deviantart('\ua909'),
cmd_devices('\ua90a'),
cmd_dharmachakra('\ua90b'),
cmd_diabetes('\ua90c'),
cmd_dialpad('\ua90d'),
cmd_diameter('\ua910'),
cmd_diameter_outline('\ua90e'),
cmd_diameter_variant('\ua90f'),
cmd_diamond('\ua913'),
cmd_diamond_outline('\ua911'),
cmd_diamond_stone('\ua912'),
cmd_dice_1('\ua915'),
cmd_dice_1_outline('\ua914'),
cmd_dice_2('\ua917'),
cmd_dice_2_outline('\ua916'),
cmd_dice_3('\ua919'),
cmd_dice_3_outline('\ua918'),
cmd_dice_4('\ua91b'),
cmd_dice_4_outline('\ua91a'),
cmd_dice_5('\ua91d'),
cmd_dice_5_outline('\ua91c'),
cmd_dice_6('\ua91f'),
cmd_dice_6_outline('\ua91e'),
cmd_dice_d10('\ua927'),
cmd_dice_d10_outline('\ua926'),
cmd_dice_d12('\ua929'),
cmd_dice_d12_outline('\ua928'),
cmd_dice_d20('\ua92b'),
cmd_dice_d20_outline('\ua92a'),
cmd_dice_d4('\ua921'),
cmd_dice_d4_outline('\ua920'),
cmd_dice_d6('\ua923'),
cmd_dice_d6_outline('\ua922'),
cmd_dice_d8('\ua925'),
cmd_dice_d8_outline('\ua924'),
cmd_dice_multiple('\ua92d'),
cmd_dice_multiple_outline('\ua92c'),
cmd_digital_ocean('\ua92e'),
cmd_dip_switch('\ua92f'),
cmd_directions('\ua931'),
cmd_directions_fork('\ua930'),
cmd_disc('\ua934'),
cmd_disc_alert('\ua932'),
cmd_disc_player('\ua933'),
cmd_dishwasher('\ua937'),
cmd_dishwasher_alert('\ua935'),
cmd_dishwasher_off('\ua936'),
cmd_disqus('\ua938'),
cmd_distribute_horizontal_center('\ua939'),
cmd_distribute_horizontal_left('\ua93a'),
cmd_distribute_horizontal_right('\ua93b'),
cmd_distribute_vertical_bottom('\ua93c'),
cmd_distribute_vertical_center('\ua93d'),
cmd_distribute_vertical_top('\ua93e'),
cmd_diversify('\ua93f'),
cmd_diving('\ua948'),
cmd_diving_flippers('\ua940'),
cmd_diving_helmet('\ua941'),
cmd_diving_scuba('\ua946'),
cmd_diving_scuba_flag('\ua942'),
cmd_diving_scuba_mask('\ua943'),
cmd_diving_scuba_tank('\ua945'),
cmd_diving_scuba_tank_multiple('\ua944'),
cmd_diving_snorkel('\ua947'),
cmd_division('\ua94a'),
cmd_division_box('\ua949'),
cmd_dlna('\ua94b'),
cmd_dna('\ua94c'),
cmd_dns('\ua94e'),
cmd_dns_outline('\ua94d'),
cmd_dock_bottom('\ua94f'),
cmd_dock_left('\ua950'),
cmd_dock_right('\ua951'),
cmd_dock_top('\ua952'),
cmd_dock_window('\ua953'),
cmd_docker('\ua954'),
cmd_doctor('\ua955'),
cmd_dog('\ua959'),
cmd_dog_service('\ua956'),
cmd_dog_side('\ua958'),
cmd_dog_side_off('\ua957'),
cmd_dolby('\ua95a'),
cmd_dolly('\ua95b'),
cmd_dolphin('\ua95c'),
cmd_domain('\ua960'),
cmd_domain_off('\ua95d'),
cmd_domain_plus('\ua95e'),
cmd_domain_remove('\ua95f'),
cmd_dome_light('\ua961'),
cmd_domino_mask('\ua962'),
cmd_donkey('\ua963'),
cmd_door('\ua96a'),
cmd_door_closed('\ua965'),
cmd_door_closed_lock('\ua964'),
cmd_door_open('\ua966'),
cmd_door_sliding('\ua969'),
cmd_door_sliding_lock('\ua967'),
cmd_door_sliding_open('\ua968'),
cmd_doorbell('\ua96c'),
cmd_doorbell_video('\ua96b'),
cmd_dot_net('\ua96d'),
cmd_dots_circle('\ua96e'),
cmd_dots_grid('\ua96f'),
cmd_dots_hexagon('\ua970'),
cmd_dots_horizontal('\ua973'),
cmd_dots_horizontal_circle('\ua972'),
cmd_dots_horizontal_circle_outline('\ua971'),
cmd_dots_square('\ua974'),
cmd_dots_triangle('\ua975'),
cmd_dots_vertical('\ua978'),
cmd_dots_vertical_circle('\ua977'),
cmd_dots_vertical_circle_outline('\ua976'),
cmd_download('\ua985'),
cmd_download_box('\ua97a'),
cmd_download_box_outline('\ua979'),
cmd_download_circle('\ua97c'),
cmd_download_circle_outline('\ua97b'),
cmd_download_lock('\ua97e'),
cmd_download_lock_outline('\ua97d'),
cmd_download_multiple('\ua97f'),
cmd_download_network('\ua981'),
cmd_download_network_outline('\ua980'),
cmd_download_off('\ua983'),
cmd_download_off_outline('\ua982'),
cmd_download_outline('\ua984'),
cmd_drag('\ua98b'),
cmd_drag_horizontal('\ua987'),
cmd_drag_horizontal_variant('\ua986'),
cmd_drag_variant('\ua988'),
cmd_drag_vertical('\ua98a'),
cmd_drag_vertical_variant('\ua989'),
cmd_drama_masks('\ua98c'),
cmd_draw('\ua98e'),
cmd_draw_pen('\ua98d'),
cmd_drawing('\ua990'),
cmd_drawing_box('\ua98f'),
cmd_dresser('\ua992'),
cmd_dresser_outline('\ua991'),
cmd_drone('\ua993'),
cmd_dropbox('\ua994'),
cmd_drupal('\ua995'),
cmd_duck('\ua996'),
cmd_dumbbell('\ua997'),
cmd_dump_truck('\ua998'),
cmd_ear_hearing('\ua99b'),
cmd_ear_hearing_loop('\ua999'),
cmd_ear_hearing_off('\ua99a'),
cmd_earbuds('\ua99f'),
cmd_earbuds_off('\ua99d'),
cmd_earbuds_off_outline('\ua99c'),
cmd_earbuds_outline('\ua99e'),
cmd_earth('\ua9aa'),
cmd_earth_arrow_right('\ua9a0'),
cmd_earth_box('\ua9a5'),
cmd_earth_box_minus('\ua9a1'),
cmd_earth_box_off('\ua9a2'),
cmd_earth_box_plus('\ua9a3'),
cmd_earth_box_remove('\ua9a4'),
cmd_earth_minus('\ua9a6'),
cmd_earth_off('\ua9a7'),
cmd_earth_plus('\ua9a8'),
cmd_earth_remove('\ua9a9'),
cmd_egg('\ua9b0'),
cmd_egg_easter('\ua9ab'),
cmd_egg_fried('\ua9ac'),
cmd_egg_off('\ua9ae'),
cmd_egg_off_outline('\ua9ad'),
cmd_egg_outline('\ua9af'),
cmd_eiffel_tower('\ua9b1'),
cmd_eight_track('\ua9b2'),
cmd_eject('\ua9b6'),
cmd_eject_circle('\ua9b4'),
cmd_eject_circle_outline('\ua9b3'),
cmd_eject_outline('\ua9b5'),
cmd_electric_switch('\ua9b8'),
cmd_electric_switch_closed('\ua9b7'),
cmd_electron_framework('\ua9b9'),
cmd_elephant('\ua9ba'),
cmd_elevation_decline('\ua9bb'),
cmd_elevation_rise('\ua9bc'),
cmd_elevator('\ua9c3'),
cmd_elevator_down('\ua9bd'),
cmd_elevator_passenger('\ua9c1'),
cmd_elevator_passenger_off('\ua9bf'),
cmd_elevator_passenger_off_outline('\ua9be'),
cmd_elevator_passenger_outline('\ua9c0'),
cmd_elevator_up('\ua9c2'),
cmd_ellipse('\ua9c5'),
cmd_ellipse_outline('\ua9c4'),
cmd_email('\ua9ed'),
cmd_email_alert('\ua9c7'),
cmd_email_alert_outline('\ua9c6'),
cmd_email_arrow_left('\ua9c9'),
cmd_email_arrow_left_outline('\ua9c8'),
cmd_email_arrow_right('\ua9cb'),
cmd_email_arrow_right_outline('\ua9ca'),
cmd_email_box('\ua9cc'),
cmd_email_check('\ua9ce'),
cmd_email_check_outline('\ua9cd'),
cmd_email_edit('\ua9d0'),
cmd_email_edit_outline('\ua9cf'),
cmd_email_fast('\ua9d2'),
cmd_email_fast_outline('\ua9d1'),
cmd_email_lock('\ua9d4'),
cmd_email_lock_outline('\ua9d3'),
cmd_email_mark_as_unread('\ua9d5'),
cmd_email_minus('\ua9d7'),
cmd_email_minus_outline('\ua9d6'),
cmd_email_multiple('\ua9d9'),
cmd_email_multiple_outline('\ua9d8'),
cmd_email_newsletter('\ua9da'),
cmd_email_off('\ua9dc'),
cmd_email_off_outline('\ua9db'),
cmd_email_open('\ua9e0'),
cmd_email_open_multiple('\ua9de'),
cmd_email_open_multiple_outline('\ua9dd'),
cmd_email_open_outline('\ua9df'),
cmd_email_outline('\ua9e1'),
cmd_email_plus('\ua9e3'),
cmd_email_plus_outline('\ua9e2'),
cmd_email_remove('\ua9e5'),
cmd_email_remove_outline('\ua9e4'),
cmd_email_seal('\ua9e7'),
cmd_email_seal_outline('\ua9e6'),
cmd_email_search('\ua9e9'),
cmd_email_search_outline('\ua9e8'),
cmd_email_sync('\ua9eb'),
cmd_email_sync_outline('\ua9ea'),
cmd_email_variant('\ua9ec'),
cmd_ember('\ua9ee'),
cmd_emby('\ua9ef'),
cmd_emoticon('\uaa13'),
cmd_emoticon_angry('\ua9f1'),
cmd_emoticon_angry_outline('\ua9f0'),
cmd_emoticon_confused('\ua9f3'),
cmd_emoticon_confused_outline('\ua9f2'),
cmd_emoticon_cool('\ua9f5'),
cmd_emoticon_cool_outline('\ua9f4'),
cmd_emoticon_cry('\ua9f7'),
cmd_emoticon_cry_outline('\ua9f6'),
cmd_emoticon_dead('\ua9f9'),
cmd_emoticon_dead_outline('\ua9f8'),
cmd_emoticon_devil('\ua9fb'),
cmd_emoticon_devil_outline('\ua9fa'),
cmd_emoticon_excited('\ua9fd'),
cmd_emoticon_excited_outline('\ua9fc'),
cmd_emoticon_frown('\ua9ff'),
cmd_emoticon_frown_outline('\ua9fe'),
cmd_emoticon_happy('\uaa01'),
cmd_emoticon_happy_outline('\uaa00'),
cmd_emoticon_kiss('\uaa03'),
cmd_emoticon_kiss_outline('\uaa02'),
cmd_emoticon_lol('\uaa05'),
cmd_emoticon_lol_outline('\uaa04'),
cmd_emoticon_neutral('\uaa07'),
cmd_emoticon_neutral_outline('\uaa06'),
cmd_emoticon_outline('\uaa08'),
cmd_emoticon_poop('\uaa0a'),
cmd_emoticon_poop_outline('\uaa09'),
cmd_emoticon_sad('\uaa0c'),
cmd_emoticon_sad_outline('\uaa0b'),
cmd_emoticon_sick('\uaa0e'),
cmd_emoticon_sick_outline('\uaa0d'),
cmd_emoticon_tongue('\uaa10'),
cmd_emoticon_tongue_outline('\uaa0f'),
cmd_emoticon_wink('\uaa12'),
cmd_emoticon_wink_outline('\uaa11'),
cmd_engine('\uaa17'),
cmd_engine_off('\uaa15'),
cmd_engine_off_outline('\uaa14'),
cmd_engine_outline('\uaa16'),
cmd_epsilon('\uaa18'),
cmd_equal('\uaa1a'),
cmd_equal_box('\uaa19'),
cmd_equalizer('\uaa1c'),
cmd_equalizer_outline('\uaa1b'),
cmd_eraser('\uaa1e'),
cmd_eraser_variant('\uaa1d'),
cmd_escalator('\uaa22'),
cmd_escalator_box('\uaa1f'),
cmd_escalator_down('\uaa20'),
cmd_escalator_up('\uaa21'),
cmd_eslint('\uaa23'),
cmd_et('\uaa24'),
cmd_ethereum('\uaa25'),
cmd_ethernet('\uaa28'),
cmd_ethernet_cable('\uaa27'),
cmd_ethernet_cable_off('\uaa26'),
cmd_ev_plug_ccs1('\uaa29'),
cmd_ev_plug_ccs2('\uaa2a'),
cmd_ev_plug_chademo('\uaa2b'),
cmd_ev_plug_tesla('\uaa2c'),
cmd_ev_plug_type1('\uaa2d'),
cmd_ev_plug_type2('\uaa2e'),
cmd_ev_station('\uaa2f'),
cmd_evernote('\uaa30'),
cmd_excavator('\uaa31'),
cmd_exclamation('\uaa33'),
cmd_exclamation_thick('\uaa32'),
cmd_exit_run('\uaa34'),
cmd_exit_to_app('\uaa35'),
cmd_expand_all('\uaa37'),
cmd_expand_all_outline('\uaa36'),
cmd_expansion_card('\uaa39'),
cmd_expansion_card_variant('\uaa38'),
cmd_exponent('\uaa3b'),
cmd_exponent_box('\uaa3a'),
cmd_export('\uaa3d'),
cmd_export_variant('\uaa3c'),
cmd_eye('\uaa53'),
cmd_eye_arrow_left('\uaa3f'),
cmd_eye_arrow_left_outline('\uaa3e'),
cmd_eye_arrow_right('\uaa41'),
cmd_eye_arrow_right_outline('\uaa40'),
cmd_eye_check('\uaa43'),
cmd_eye_check_outline('\uaa42'),
cmd_eye_circle('\uaa45'),
cmd_eye_circle_outline('\uaa44'),
cmd_eye_minus('\uaa47'),
cmd_eye_minus_outline('\uaa46'),
cmd_eye_off('\uaa49'),
cmd_eye_off_outline('\uaa48'),
cmd_eye_outline('\uaa4a'),
cmd_eye_plus('\uaa4c'),
cmd_eye_plus_outline('\uaa4b'),
cmd_eye_refresh('\uaa4e'),
cmd_eye_refresh_outline('\uaa4d'),
cmd_eye_remove('\uaa50'),
cmd_eye_remove_outline('\uaa4f'),
cmd_eye_settings('\uaa52'),
cmd_eye_settings_outline('\uaa51'),
cmd_eyedropper('\uaa59'),
cmd_eyedropper_minus('\uaa54'),
cmd_eyedropper_off('\uaa55'),
cmd_eyedropper_plus('\uaa56'),
cmd_eyedropper_remove('\uaa57'),
cmd_eyedropper_variant('\uaa58');
override val typeface: ITypeface by lazy { CommunityMaterial }
}
enum class Icon2 constructor(override val character: Char) : IIcon {
cmd_face_agent('\uaa5a'),
cmd_face_man('\uaa5f'),
cmd_face_man_outline('\uaa5b'),
cmd_face_man_profile('\uaa5c'),
cmd_face_man_shimmer('\uaa5e'),
cmd_face_man_shimmer_outline('\uaa5d'),
cmd_face_mask('\uaa61'),
cmd_face_mask_outline('\uaa60'),
cmd_face_recognition('\uaa62'),
cmd_face_woman('\uaa67'),
cmd_face_woman_outline('\uaa63'),
cmd_face_woman_profile('\uaa64'),
cmd_face_woman_shimmer('\uaa66'),
cmd_face_woman_shimmer_outline('\uaa65'),
cmd_facebook('\uaa6b'),
cmd_facebook_gaming('\uaa68'),
cmd_facebook_messenger('\uaa69'),
cmd_facebook_workplace('\uaa6a'),
cmd_factory('\uaa6c'),
cmd_family_tree('\uaa6d'),
cmd_fan('\uaa7a'),
cmd_fan_alert('\uaa6e'),
cmd_fan_auto('\uaa6f'),
cmd_fan_chevron_down('\uaa70'),
cmd_fan_chevron_up('\uaa71'),
cmd_fan_clock('\uaa72'),
cmd_fan_minus('\uaa73'),
cmd_fan_off('\uaa74'),
cmd_fan_plus('\uaa75'),
cmd_fan_remove('\uaa76'),
cmd_fan_speed_1('\uaa77'),
cmd_fan_speed_2('\uaa78'),
cmd_fan_speed_3('\uaa79'),
cmd_fast_forward('\uaa82'),
cmd_fast_forward_10('\uaa7c'),
cmd_fast_forward_15('\uaa7d'),
cmd_fast_forward_30('\uaa7e'),
cmd_fast_forward_45('\uaa7f'),
cmd_fast_forward_5('\uaa7b'),
cmd_fast_forward_60('\uaa80'),
cmd_fast_forward_outline('\uaa81'),
cmd_faucet('\uaa84'),
cmd_faucet_variant('\uaa83'),
cmd_fax('\uaa85'),
cmd_feather('\uaa86'),
cmd_feature_search('\uaa88'),
cmd_feature_search_outline('\uaa87'),
cmd_fedora('\uaa89'),
cmd_fence('\uaa8b'),
cmd_fence_electric('\uaa8a'),
cmd_fencing('\uaa8c'),
cmd_ferris_wheel('\uaa8d'),
cmd_ferry('\uaa8e'),
cmd_file('\uab2a'),
cmd_file_account('\uaa90'),
cmd_file_account_outline('\uaa8f'),
cmd_file_alert('\uaa92'),
cmd_file_alert_outline('\uaa91'),
cmd_file_arrow_left_right('\uaa94'),
cmd_file_arrow_left_right_outline('\uaa93'),
cmd_file_arrow_up_down('\uaa96'),
cmd_file_arrow_up_down_outline('\uaa95'),
cmd_file_cabinet('\uaa97'),
cmd_file_cad('\uaa99'),
cmd_file_cad_box('\uaa98'),
cmd_file_cancel('\uaa9b'),
cmd_file_cancel_outline('\uaa9a'),
cmd_file_certificate('\uaa9d'),
cmd_file_certificate_outline('\uaa9c'),
cmd_file_chart('\uaaa1'),
cmd_file_chart_check('\uaa9f'),
cmd_file_chart_check_outline('\uaa9e'),
cmd_file_chart_outline('\uaaa0'),
cmd_file_check('\uaaa3'),
cmd_file_check_outline('\uaaa2'),
cmd_file_clock('\uaaa5'),
cmd_file_clock_outline('\uaaa4'),
cmd_file_cloud('\uaaa7'),
cmd_file_cloud_outline('\uaaa6'),
cmd_file_code('\uaaa9'),
cmd_file_code_outline('\uaaa8'),
cmd_file_cog('\uaaab'),
cmd_file_cog_outline('\uaaaa'),
cmd_file_compare('\uaaac'),
cmd_file_delimited('\uaaae'),
cmd_file_delimited_outline('\uaaad'),
cmd_file_document('\uaabe'),
cmd_file_document_alert('\uaab0'),
cmd_file_document_alert_outline('\uaaaf'),
cmd_file_document_check('\uaab2'),
cmd_file_document_check_outline('\uaab1'),
cmd_file_document_edit('\uaab4'),
cmd_file_document_edit_outline('\uaab3'),
cmd_file_document_minus('\uaab6'),
cmd_file_document_minus_outline('\uaab5'),
cmd_file_document_multiple('\uaab8'),
cmd_file_document_multiple_outline('\uaab7'),
cmd_file_document_outline('\uaab9'),
cmd_file_document_plus('\uaabb'),
cmd_file_document_plus_outline('\uaaba'),
cmd_file_document_remove('\uaabd'),
cmd_file_document_remove_outline('\uaabc'),
cmd_file_download('\uaac0'),
cmd_file_download_outline('\uaabf'),
cmd_file_edit('\uaac2'),
cmd_file_edit_outline('\uaac1'),
cmd_file_excel('\uaac6'),
cmd_file_excel_box('\uaac4'),
cmd_file_excel_box_outline('\uaac3'),
cmd_file_excel_outline('\uaac5'),
cmd_file_export('\uaac8'),
cmd_file_export_outline('\uaac7'),
cmd_file_eye('\uaaca'),
cmd_file_eye_outline('\uaac9'),
cmd_file_find('\uaacc'),
cmd_file_find_outline('\uaacb'),
cmd_file_gif_box('\uaacd'),
cmd_file_hidden('\uaace'),
cmd_file_image('\uaad8'),
cmd_file_image_marker('\uaad0'),
cmd_file_image_marker_outline('\uaacf'),
cmd_file_image_minus('\uaad2'),
cmd_file_image_minus_outline('\uaad1'),
cmd_file_image_outline('\uaad3'),
cmd_file_image_plus('\uaad5'),
cmd_file_image_plus_outline('\uaad4'),
cmd_file_image_remove('\uaad7'),
cmd_file_image_remove_outline('\uaad6'),
cmd_file_import('\uaada'),
cmd_file_import_outline('\uaad9'),
cmd_file_jpg_box('\uaadb'),
cmd_file_key('\uaadd'),
cmd_file_key_outline('\uaadc'),
cmd_file_link('\uaadf'),
cmd_file_link_outline('\uaade'),
cmd_file_lock('\uaae3'),
cmd_file_lock_open('\uaae1'),
cmd_file_lock_open_outline('\uaae0'),
cmd_file_lock_outline('\uaae2'),
cmd_file_marker('\uaae5'),
cmd_file_marker_outline('\uaae4'),
cmd_file_minus('\uaae7'),
cmd_file_minus_outline('\uaae6'),
cmd_file_move('\uaae9'),
cmd_file_move_outline('\uaae8'),
cmd_file_multiple('\uaaeb'),
cmd_file_multiple_outline('\uaaea'),
cmd_file_music('\uaaed'),
cmd_file_music_outline('\uaaec'),
cmd_file_outline('\uaaee'),
cmd_file_pdf_box('\uaaef'),
cmd_file_percent('\uaaf1'),
cmd_file_percent_outline('\uaaf0'),
cmd_file_phone('\uaaf3'),
cmd_file_phone_outline('\uaaf2'),
cmd_file_plus('\uaaf5'),
cmd_file_plus_outline('\uaaf4'),
cmd_file_png_box('\uaaf6'),
cmd_file_powerpoint('\uaafa'),
cmd_file_powerpoint_box('\uaaf8'),
cmd_file_powerpoint_box_outline('\uaaf7'),
cmd_file_powerpoint_outline('\uaaf9'),
cmd_file_presentation_box('\uaafb'),
cmd_file_question('\uaafd'),
cmd_file_question_outline('\uaafc'),
cmd_file_refresh('\uaaff'),
cmd_file_refresh_outline('\uaafe'),
cmd_file_remove('\uab01'),
cmd_file_remove_outline('\uab00'),
cmd_file_replace('\uab03'),
cmd_file_replace_outline('\uab02'),
cmd_file_restore('\uab05'),
cmd_file_restore_outline('\uab04'),
cmd_file_rotate_left('\uab07'),
cmd_file_rotate_left_outline('\uab06'),
cmd_file_rotate_right('\uab09'),
cmd_file_rotate_right_outline('\uab08'),
cmd_file_search('\uab0b'),
cmd_file_search_outline('\uab0a'),
cmd_file_send('\uab0d'),
cmd_file_send_outline('\uab0c'),
cmd_file_settings('\uab0f'),
cmd_file_settings_outline('\uab0e'),
cmd_file_sign('\uab10'),
cmd_file_star('\uab12'),
cmd_file_star_outline('\uab11'),
cmd_file_swap('\uab14'),
cmd_file_swap_outline('\uab13'),
cmd_file_sync('\uab16'),
cmd_file_sync_outline('\uab15'),
cmd_file_table('\uab1c'),
cmd_file_table_box('\uab1a'),
cmd_file_table_box_multiple('\uab18'),
cmd_file_table_box_multiple_outline('\uab17'),
cmd_file_table_box_outline('\uab19'),
cmd_file_table_outline('\uab1b'),
cmd_file_tree('\uab1e'),
cmd_file_tree_outline('\uab1d'),
cmd_file_undo('\uab20'),
cmd_file_undo_outline('\uab1f'),
cmd_file_upload('\uab22'),
cmd_file_upload_outline('\uab21'),
cmd_file_video('\uab24'),
cmd_file_video_outline('\uab23'),
cmd_file_word('\uab28'),
cmd_file_word_box('\uab26'),
cmd_file_word_box_outline('\uab25'),
cmd_file_word_outline('\uab27'),
cmd_file_xml_box('\uab29'),
cmd_film('\uab2b'),
cmd_filmstrip('\uab2f'),
cmd_filmstrip_box('\uab2d'),
cmd_filmstrip_box_multiple('\uab2c'),
cmd_filmstrip_off('\uab2e'),
cmd_filter('\uab47'),
cmd_filter_check('\uab31'),
cmd_filter_check_outline('\uab30'),
cmd_filter_cog('\uab33'),
cmd_filter_cog_outline('\uab32'),
cmd_filter_menu('\uab35'),
cmd_filter_menu_outline('\uab34'),
cmd_filter_minus('\uab37'),
cmd_filter_minus_outline('\uab36'),
cmd_filter_multiple('\uab39'),
cmd_filter_multiple_outline('\uab38'),
cmd_filter_off('\uab3b'),
cmd_filter_off_outline('\uab3a'),
cmd_filter_outline('\uab3c'),
cmd_filter_plus('\uab3e'),
cmd_filter_plus_outline('\uab3d'),
cmd_filter_remove('\uab40'),
cmd_filter_remove_outline('\uab3f'),
cmd_filter_settings('\uab42'),
cmd_filter_settings_outline('\uab41'),
cmd_filter_variant('\uab46'),
cmd_filter_variant_minus('\uab43'),
cmd_filter_variant_plus('\uab44'),
cmd_filter_variant_remove('\uab45'),
cmd_finance('\uab48'),
cmd_find_replace('\uab49'),
cmd_fingerprint('\uab4b'),
cmd_fingerprint_off('\uab4a'),
cmd_fire('\uab54'),
cmd_fire_alert('\uab4c'),
cmd_fire_circle('\uab4d'),
cmd_fire_extinguisher('\uab4e'),
cmd_fire_hydrant('\uab51'),
cmd_fire_hydrant_alert('\uab4f'),
cmd_fire_hydrant_off('\uab50'),
cmd_fire_off('\uab52'),
cmd_fire_truck('\uab53'),
cmd_firebase('\uab55'),
cmd_firefox('\uab56'),
cmd_fireplace('\uab58'),
cmd_fireplace_off('\uab57'),
cmd_firewire('\uab59'),
cmd_firework('\uab5b'),
cmd_firework_off('\uab5a'),
cmd_fish('\uab5d'),
cmd_fish_off('\uab5c'),
cmd_fishbowl('\uab5f'),
cmd_fishbowl_outline('\uab5e'),
cmd_fit_to_page('\uab61'),
cmd_fit_to_page_outline('\uab60'),
cmd_fit_to_screen('\uab63'),
cmd_fit_to_screen_outline('\uab62'),
cmd_flag('\uab79'),
cmd_flag_checkered('\uab64'),
cmd_flag_minus('\uab66'),
cmd_flag_minus_outline('\uab65'),
cmd_flag_off('\uab68'),
cmd_flag_off_outline('\uab67'),
cmd_flag_outline('\uab69'),
cmd_flag_plus('\uab6b'),
cmd_flag_plus_outline('\uab6a'),
cmd_flag_remove('\uab6d'),
cmd_flag_remove_outline('\uab6c'),
cmd_flag_triangle('\uab6e'),
cmd_flag_variant('\uab78'),
cmd_flag_variant_minus('\uab70'),
cmd_flag_variant_minus_outline('\uab6f'),
cmd_flag_variant_off('\uab72'),
cmd_flag_variant_off_outline('\uab71'),
cmd_flag_variant_outline('\uab73'),
cmd_flag_variant_plus('\uab75'),
cmd_flag_variant_plus_outline('\uab74'),
cmd_flag_variant_remove('\uab77'),
cmd_flag_variant_remove_outline('\uab76'),
cmd_flare('\uab7a'),
cmd_flash('\uab84'),
cmd_flash_alert('\uab7c'),
cmd_flash_alert_outline('\uab7b'),
cmd_flash_auto('\uab7d'),
cmd_flash_off('\uab7f'),
cmd_flash_off_outline('\uab7e'),
cmd_flash_outline('\uab80'),
cmd_flash_red_eye('\uab81'),
cmd_flash_triangle('\uab83'),
cmd_flash_triangle_outline('\uab82'),
cmd_flashlight('\uab86'),
cmd_flashlight_off('\uab85'),
cmd_flask('\uab9e'),
cmd_flask_empty('\uab90'),
cmd_flask_empty_minus('\uab88'),
cmd_flask_empty_minus_outline('\uab87'),
cmd_flask_empty_off('\uab8a'),
cmd_flask_empty_off_outline('\uab89'),
cmd_flask_empty_outline('\uab8b'),
cmd_flask_empty_plus('\uab8d'),
cmd_flask_empty_plus_outline('\uab8c'),
cmd_flask_empty_remove('\uab8f'),
cmd_flask_empty_remove_outline('\uab8e'),
cmd_flask_minus('\uab92'),
cmd_flask_minus_outline('\uab91'),
cmd_flask_off('\uab94'),
cmd_flask_off_outline('\uab93'),
cmd_flask_outline('\uab95'),
cmd_flask_plus('\uab97'),
cmd_flask_plus_outline('\uab96'),
cmd_flask_remove('\uab99'),
cmd_flask_remove_outline('\uab98'),
cmd_flask_round_bottom('\uab9d'),
cmd_flask_round_bottom_empty('\uab9b'),
cmd_flask_round_bottom_empty_outline('\uab9a'),
cmd_flask_round_bottom_outline('\uab9c'),
cmd_fleur_de_lis('\uab9f'),
cmd_flip_horizontal('\uaba0'),
cmd_flip_to_back('\uaba1'),
cmd_flip_to_front('\uaba2'),
cmd_flip_vertical('\uaba3'),
cmd_floor_lamp('\uabab'),
cmd_floor_lamp_dual('\uaba5'),
cmd_floor_lamp_dual_outline('\uaba4'),
cmd_floor_lamp_outline('\uaba6'),
cmd_floor_lamp_torchiere('\uabaa'),
cmd_floor_lamp_torchiere_outline('\uaba7'),
cmd_floor_lamp_torchiere_variant('\uaba9'),
cmd_floor_lamp_torchiere_variant_outline('\uaba8'),
cmd_floor_plan('\uabac'),
cmd_floppy('\uabae'),
cmd_floppy_variant('\uabad'),
cmd_flower('\uabb5'),
cmd_flower_outline('\uabaf'),
cmd_flower_pollen('\uabb1'),
cmd_flower_pollen_outline('\uabb0'),
cmd_flower_poppy('\uabb2'),
cmd_flower_tulip('\uabb4'),
cmd_flower_tulip_outline('\uabb3'),
cmd_focus_auto('\uabb6'),
cmd_focus_field('\uabb9'),
cmd_focus_field_horizontal('\uabb7'),
cmd_focus_field_vertical('\uabb8'),
cmd_folder('\uac21'),
cmd_folder_account('\uabbb'),
cmd_folder_account_outline('\uabba'),
cmd_folder_alert('\uabbd'),
cmd_folder_alert_outline('\uabbc'),
cmd_folder_arrow_down('\uabbf'),
cmd_folder_arrow_down_outline('\uabbe'),
cmd_folder_arrow_left('\uabc3'),
cmd_folder_arrow_left_outline('\uabc0'),
cmd_folder_arrow_left_right('\uabc2'),
cmd_folder_arrow_left_right_outline('\uabc1'),
cmd_folder_arrow_right('\uabc5'),
cmd_folder_arrow_right_outline('\uabc4'),
cmd_folder_arrow_up('\uabc9'),
cmd_folder_arrow_up_down('\uabc7'),
cmd_folder_arrow_up_down_outline('\uabc6'),
cmd_folder_arrow_up_outline('\uabc8'),
cmd_folder_cancel('\uabcb'),
cmd_folder_cancel_outline('\uabca'),
cmd_folder_check('\uabcd'),
cmd_folder_check_outline('\uabcc'),
cmd_folder_clock('\uabcf'),
cmd_folder_clock_outline('\uabce'),
cmd_folder_cog('\uabd1'),
cmd_folder_cog_outline('\uabd0'),
cmd_folder_download('\uabd3'),
cmd_folder_download_outline('\uabd2'),
cmd_folder_edit('\uabd5'),
cmd_folder_edit_outline('\uabd4'),
cmd_folder_eye('\uabd7'),
cmd_folder_eye_outline('\uabd6'),
cmd_folder_file('\uabd9'),
cmd_folder_file_outline('\uabd8'),
cmd_folder_google_drive('\uabda'),
cmd_folder_heart('\uabdc'),
cmd_folder_heart_outline('\uabdb'),
cmd_folder_hidden('\uabdd'),
cmd_folder_home('\uabdf'),
cmd_folder_home_outline('\uabde'),
cmd_folder_image('\uabe0'),
cmd_folder_information('\uabe2'),
cmd_folder_information_outline('\uabe1'),
cmd_folder_key('\uabe6'),
cmd_folder_key_network('\uabe4'),
cmd_folder_key_network_outline('\uabe3'),
cmd_folder_key_outline('\uabe5'),
cmd_folder_lock('\uabea'),
cmd_folder_lock_open('\uabe8'),
cmd_folder_lock_open_outline('\uabe7'),
cmd_folder_lock_outline('\uabe9'),
cmd_folder_marker('\uabec'),
cmd_folder_marker_outline('\uabeb'),
cmd_folder_minus('\uabee'),
cmd_folder_minus_outline('\uabed'),
cmd_folder_move('\uabf0'),
cmd_folder_move_outline('\uabef'),
cmd_folder_multiple('\uabf5'),
cmd_folder_multiple_image('\uabf1'),
cmd_folder_multiple_outline('\uabf2'),
cmd_folder_multiple_plus('\uabf4'),
cmd_folder_multiple_plus_outline('\uabf3'),
cmd_folder_music('\uabf7'),
cmd_folder_music_outline('\uabf6'),
cmd_folder_network('\uabf9'),
cmd_folder_network_outline('\uabf8'),
cmd_folder_off('\uabfb'),
cmd_folder_off_outline('\uabfa'),
cmd_folder_open('\uabfd'),
cmd_folder_open_outline('\uabfc'),
cmd_folder_outline('\uabfe'),
cmd_folder_play('\uac00'),
cmd_folder_play_outline('\uabff'),
cmd_folder_plus('\uac02'),
cmd_folder_plus_outline('\uac01'),
cmd_folder_pound('\uac04'),
cmd_folder_pound_outline('\uac03'),
cmd_folder_question('\uac06'),
cmd_folder_question_outline('\uac05'),
cmd_folder_refresh('\uac08'),
cmd_folder_refresh_outline('\uac07'),
cmd_folder_remove('\uac0a'),
cmd_folder_remove_outline('\uac09'),
cmd_folder_search('\uac0c'),
cmd_folder_search_outline('\uac0b'),
cmd_folder_settings('\uac0e'),
cmd_folder_settings_outline('\uac0d'),
cmd_folder_star('\uac12'),
cmd_folder_star_multiple('\uac10'),
cmd_folder_star_multiple_outline('\uac0f'),
cmd_folder_star_outline('\uac11'),
cmd_folder_swap('\uac14'),
cmd_folder_swap_outline('\uac13'),
cmd_folder_sync('\uac16'),
cmd_folder_sync_outline('\uac15'),
cmd_folder_table('\uac18'),
cmd_folder_table_outline('\uac17'),
cmd_folder_text('\uac1a'),
cmd_folder_text_outline('\uac19'),
cmd_folder_upload('\uac1c'),
cmd_folder_upload_outline('\uac1b'),
cmd_folder_wrench('\uac1e'),
cmd_folder_wrench_outline('\uac1d'),
cmd_folder_zip('\uac20'),
cmd_folder_zip_outline('\uac1f'),
cmd_font_awesome('\uac22'),
cmd_food('\uac38'),
cmd_food_apple('\uac24'),
cmd_food_apple_outline('\uac23'),
cmd_food_croissant('\uac25'),
cmd_food_drumstick('\uac29'),
cmd_food_drumstick_off('\uac27'),
cmd_food_drumstick_off_outline('\uac26'),
cmd_food_drumstick_outline('\uac28'),
cmd_food_fork_drink('\uac2a'),
cmd_food_halal('\uac2b'),
cmd_food_hot_dog('\uac2c'),
cmd_food_kosher('\uac2d'),
cmd_food_off('\uac2f'),
cmd_food_off_outline('\uac2e'),
cmd_food_outline('\uac30'),
cmd_food_steak('\uac32'),
cmd_food_steak_off('\uac31'),
cmd_food_takeout_box('\uac34'),
cmd_food_takeout_box_outline('\uac33'),
cmd_food_turkey('\uac35'),
cmd_food_variant('\uac37'),
cmd_food_variant_off('\uac36'),
cmd_foot_print('\uac39'),
cmd_football('\uac3c'),
cmd_football_australian('\uac3a'),
cmd_football_helmet('\uac3b'),
cmd_forest('\uac3d'),
cmd_forklift('\uac3e'),
cmd_form_dropdown('\uac3f'),
cmd_form_select('\uac40'),
cmd_form_textarea('\uac41'),
cmd_form_textbox('\uac44'),
cmd_form_textbox_lock('\uac42'),
cmd_form_textbox_password('\uac43'),
cmd_format_align_bottom('\uac45'),
cmd_format_align_center('\uac46'),
cmd_format_align_justify('\uac47'),
cmd_format_align_left('\uac48'),
cmd_format_align_middle('\uac49'),
cmd_format_align_right('\uac4a'),
cmd_format_align_top('\uac4b'),
cmd_format_annotation_minus('\uac4c'),
cmd_format_annotation_plus('\uac4d'),
cmd_format_bold('\uac4e'),
cmd_format_clear('\uac4f'),
cmd_format_color_fill('\uac50'),
cmd_format_color_highlight('\uac51'),
cmd_format_color_marker_cancel('\uac52'),
cmd_format_color_text('\uac53'),
cmd_format_columns('\uac54'),
cmd_format_float_center('\uac55'),
cmd_format_float_left('\uac56'),
cmd_format_float_none('\uac57'),
cmd_format_float_right('\uac58'),
cmd_format_font('\uac5b'),
cmd_format_font_size_decrease('\uac59'),
cmd_format_font_size_increase('\uac5a'),
cmd_format_header_1('\uac5c'),
cmd_format_header_2('\uac5d'),
cmd_format_header_3('\uac5e'),
cmd_format_header_4('\uac5f'),
cmd_format_header_5('\uac60'),
cmd_format_header_6('\uac61'),
cmd_format_header_decrease('\uac62'),
cmd_format_header_equal('\uac63'),
cmd_format_header_increase('\uac64'),
cmd_format_header_pound('\uac65'),
cmd_format_horizontal_align_center('\uac66'),
cmd_format_horizontal_align_left('\uac67'),
cmd_format_horizontal_align_right('\uac68'),
cmd_format_indent_decrease('\uac69'),
cmd_format_indent_increase('\uac6a'),
cmd_format_italic('\uac6b'),
cmd_format_letter_case('\uac6e'),
cmd_format_letter_case_lower('\uac6c'),
cmd_format_letter_case_upper('\uac6d'),
cmd_format_letter_ends_with('\uac6f'),
cmd_format_letter_matches('\uac70'),
cmd_format_letter_spacing('\uac72'),
cmd_format_letter_spacing_variant('\uac71'),
cmd_format_letter_starts_with('\uac73'),
cmd_format_line_height('\uac74'),
cmd_format_line_spacing('\uac75'),
cmd_format_line_style('\uac76'),
cmd_format_line_weight('\uac77'),
cmd_format_list_bulleted('\uac7b'),
cmd_format_list_bulleted_square('\uac78'),
cmd_format_list_bulleted_triangle('\uac79'),
cmd_format_list_bulleted_type('\uac7a'),
cmd_format_list_checkbox('\uac7c'),
cmd_format_list_checks('\uac7d'),
cmd_format_list_group('\uac7f'),
cmd_format_list_group_plus('\uac7e'),
cmd_format_list_numbered('\uac81'),
cmd_format_list_numbered_rtl('\uac80'),
cmd_format_list_text('\uac82'),
cmd_format_overline('\uac83'),
cmd_format_page_break('\uac84'),
cmd_format_page_split('\uac85'),
cmd_format_paint('\uac86'),
cmd_format_paragraph('\uac88'),
cmd_format_paragraph_spacing('\uac87'),
cmd_format_pilcrow('\uac8b'),
cmd_format_pilcrow_arrow_left('\uac89'),
cmd_format_pilcrow_arrow_right('\uac8a'),
cmd_format_quote_close('\uac8d'),
cmd_format_quote_close_outline('\uac8c'),
cmd_format_quote_open('\uac8f'),
cmd_format_quote_open_outline('\uac8e'),
cmd_format_rotate_90('\uac90'),
cmd_format_section('\uac91'),
cmd_format_size('\uac92'),
cmd_format_strikethrough('\uac94'),
cmd_format_strikethrough_variant('\uac93'),
cmd_format_subscript('\uac95'),
cmd_format_superscript('\uac96'),
cmd_format_text('\uaca3'),
cmd_format_text_rotation_angle_down('\uac97'),
cmd_format_text_rotation_angle_up('\uac98'),
cmd_format_text_rotation_down('\uac9a'),
cmd_format_text_rotation_down_vertical('\uac99'),
cmd_format_text_rotation_none('\uac9b'),
cmd_format_text_rotation_up('\uac9c'),
cmd_format_text_rotation_vertical('\uac9d'),
cmd_format_text_variant('\uac9f'),
cmd_format_text_variant_outline('\uac9e'),
cmd_format_text_wrapping_clip('\uaca0'),
cmd_format_text_wrapping_overflow('\uaca1'),
cmd_format_text_wrapping_wrap('\uaca2'),
cmd_format_textbox('\uaca4'),
cmd_format_title('\uaca5'),
cmd_format_underline('\uaca7'),
cmd_format_underline_wavy('\uaca6'),
cmd_format_vertical_align_bottom('\uaca8'),
cmd_format_vertical_align_center('\uaca9'),
cmd_format_vertical_align_top('\uacaa'),
cmd_format_wrap_inline('\uacab'),
cmd_format_wrap_square('\uacac'),
cmd_format_wrap_tight('\uacad'),
cmd_format_wrap_top_bottom('\uacae'),
cmd_forum('\uacb6'),
cmd_forum_minus('\uacb0'),
cmd_forum_minus_outline('\uacaf'),
cmd_forum_outline('\uacb1'),
cmd_forum_plus('\uacb3'),
cmd_forum_plus_outline('\uacb2'),
cmd_forum_remove('\uacb5'),
cmd_forum_remove_outline('\uacb4'),
cmd_forward('\uacb7'),
cmd_forwardburger('\uacb8'),
cmd_fountain('\uacbb'),
cmd_fountain_pen('\uacba'),
cmd_fountain_pen_tip('\uacb9'),
cmd_fraction_one_half('\uacbc'),
cmd_freebsd('\uacbd'),
cmd_french_fries('\uacbe'),
cmd_frequently_asked_questions('\uacbf'),
cmd_fridge('\uacd3'),
cmd_fridge_alert('\uacc1'),
cmd_fridge_alert_outline('\uacc0'),
cmd_fridge_bottom('\uacc2'),
cmd_fridge_industrial('\uacc8'),
cmd_fridge_industrial_alert('\uacc4'),
cmd_fridge_industrial_alert_outline('\uacc3'),
cmd_fridge_industrial_off('\uacc6'),
cmd_fridge_industrial_off_outline('\uacc5'),
cmd_fridge_industrial_outline('\uacc7'),
cmd_fridge_off('\uacca'),
cmd_fridge_off_outline('\uacc9'),
cmd_fridge_outline('\uaccb'),
cmd_fridge_top('\uaccc'),
cmd_fridge_variant('\uacd2'),
cmd_fridge_variant_alert('\uacce'),
cmd_fridge_variant_alert_outline('\uaccd'),
cmd_fridge_variant_off('\uacd0'),
cmd_fridge_variant_off_outline('\uaccf'),
cmd_fridge_variant_outline('\uacd1'),
cmd_fruit_cherries('\uacd5'),
cmd_fruit_cherries_off('\uacd4'),
cmd_fruit_citrus('\uacd7'),
cmd_fruit_citrus_off('\uacd6'),
cmd_fruit_grapes('\uacd9'),
cmd_fruit_grapes_outline('\uacd8'),
cmd_fruit_pear('\uacda'),
cmd_fruit_pineapple('\uacdb'),
cmd_fruit_watermelon('\uacdc'),
cmd_fuel('\uacde'),
cmd_fuel_cell('\uacdd'),
cmd_fullscreen('\uace0'),
cmd_fullscreen_exit('\uacdf'),
cmd_function('\uace2'),
cmd_function_variant('\uace1'),
cmd_furigana_horizontal('\uace3'),
cmd_furigana_vertical('\uace4'),
cmd_fuse('\uace8'),
cmd_fuse_alert('\uace5'),
cmd_fuse_blade('\uace6'),
cmd_fuse_off('\uace7'),
cmd_gamepad('\uacfe'),
cmd_gamepad_circle('\uacee'),
cmd_gamepad_circle_down('\uace9'),
cmd_gamepad_circle_left('\uacea'),
cmd_gamepad_circle_outline('\uaceb'),
cmd_gamepad_circle_right('\uacec'),
cmd_gamepad_circle_up('\uaced'),
cmd_gamepad_down('\uacef'),
cmd_gamepad_left('\uacf0'),
cmd_gamepad_outline('\uacf1'),
cmd_gamepad_right('\uacf2'),
cmd_gamepad_round('\uacf8'),
cmd_gamepad_round_down('\uacf3'),
cmd_gamepad_round_left('\uacf4'),
cmd_gamepad_round_outline('\uacf5'),
cmd_gamepad_round_right('\uacf6'),
cmd_gamepad_round_up('\uacf7'),
cmd_gamepad_square('\uacfa'),
cmd_gamepad_square_outline('\uacf9'),
cmd_gamepad_up('\uacfb'),
cmd_gamepad_variant('\uacfd'),
cmd_gamepad_variant_outline('\uacfc'),
cmd_gamma('\uacff'),
cmd_gantry_crane('\uad00'),
cmd_garage('\uad08'),
cmd_garage_alert('\uad02'),
cmd_garage_alert_variant('\uad01'),
cmd_garage_lock('\uad03'),
cmd_garage_open('\uad05'),
cmd_garage_open_variant('\uad04'),
cmd_garage_variant('\uad07'),
cmd_garage_variant_lock('\uad06'),
cmd_gas_burner('\uad09'),
cmd_gas_cylinder('\uad0a'),
cmd_gas_station('\uad0e'),
cmd_gas_station_off('\uad0c'),
cmd_gas_station_off_outline('\uad0b'),
cmd_gas_station_outline('\uad0d'),
cmd_gate('\uad1b'),
cmd_gate_alert('\uad0f'),
cmd_gate_and('\uad10'),
cmd_gate_arrow_left('\uad11'),
cmd_gate_arrow_right('\uad12'),
cmd_gate_buffer('\uad13'),
cmd_gate_nand('\uad14'),
cmd_gate_nor('\uad15'),
cmd_gate_not('\uad16'),
cmd_gate_open('\uad17'),
cmd_gate_or('\uad18'),
cmd_gate_xnor('\uad19'),
cmd_gate_xor('\uad1a'),
cmd_gatsby('\uad1c'),
cmd_gauge('\uad20'),
cmd_gauge_empty('\uad1d'),
cmd_gauge_full('\uad1e'),
cmd_gauge_low('\uad1f'),
cmd_gavel('\uad21'),
cmd_gender_female('\uad22'),
cmd_gender_male('\uad25'),
cmd_gender_male_female('\uad24'),
cmd_gender_male_female_variant('\uad23'),
cmd_gender_non_binary('\uad26'),
cmd_gender_transgender('\uad27'),
cmd_gentoo('\uad28'),
cmd_gesture('\uad39'),
cmd_gesture_double_tap('\uad29'),
cmd_gesture_pinch('\uad2a'),
cmd_gesture_spread('\uad2b'),
cmd_gesture_swipe('\uad32'),
cmd_gesture_swipe_down('\uad2c'),
cmd_gesture_swipe_horizontal('\uad2d'),
cmd_gesture_swipe_left('\uad2e'),
cmd_gesture_swipe_right('\uad2f'),
cmd_gesture_swipe_up('\uad30'),
cmd_gesture_swipe_vertical('\uad31'),
cmd_gesture_tap('\uad36'),
cmd_gesture_tap_box('\uad33'),
cmd_gesture_tap_button('\uad34'),
cmd_gesture_tap_hold('\uad35'),
cmd_gesture_two_double_tap('\uad37'),
cmd_gesture_two_tap('\uad38'),
cmd_ghost('\uad3d'),
cmd_ghost_off('\uad3b'),
cmd_ghost_off_outline('\uad3a'),
cmd_ghost_outline('\uad3c'),
cmd_gift('\uad43'),
cmd_gift_off('\uad3f'),
cmd_gift_off_outline('\uad3e'),
cmd_gift_open('\uad41'),
cmd_gift_open_outline('\uad40'),
cmd_gift_outline('\uad42'),
cmd_git('\uad44'),
cmd_github('\uad45'),
cmd_gitlab('\uad46'),
cmd_glass_cocktail('\uad48'),
cmd_glass_cocktail_off('\uad47'),
cmd_glass_flute('\uad49'),
cmd_glass_fragile('\uad4a'),
cmd_glass_mug('\uad4e'),
cmd_glass_mug_off('\uad4b'),
cmd_glass_mug_variant('\uad4d'),
cmd_glass_mug_variant_off('\uad4c'),
cmd_glass_pint_outline('\uad4f'),
cmd_glass_stange('\uad50'),
cmd_glass_tulip('\uad51'),
cmd_glass_wine('\uad52'),
cmd_glasses('\uad53'),
cmd_globe_light('\uad55'),
cmd_globe_light_outline('\uad54'),
cmd_globe_model('\uad56'),
cmd_gmail('\uad57'),
cmd_gnome('\uad58'),
cmd_go_kart('\uad5a'),
cmd_go_kart_track('\uad59'),
cmd_gog('\uad5b'),
cmd_gold('\uad5c'),
cmd_golf('\uad5f'),
cmd_golf_cart('\uad5d'),
cmd_golf_tee('\uad5e'),
cmd_gondola('\uad60'),
cmd_goodreads('\uad61'),
cmd_google('\uad7e'),
cmd_google_ads('\uad62'),
cmd_google_analytics('\uad63'),
cmd_google_assistant('\uad64'),
cmd_google_cardboard('\uad65'),
cmd_google_chrome('\uad66'),
cmd_google_circles('\uad6a'),
cmd_google_circles_communities('\uad67'),
cmd_google_circles_extended('\uad68'),
cmd_google_circles_group('\uad69'),
cmd_google_classroom('\uad6b'),
cmd_google_cloud('\uad6c'),
cmd_google_downasaur('\uad6d'),
cmd_google_drive('\uad6e'),
cmd_google_earth('\uad6f'),
cmd_google_fit('\uad70'),
cmd_google_glass('\uad71'),
cmd_google_hangouts('\uad72'),
cmd_google_keep('\uad73'),
cmd_google_lens('\uad74'),
cmd_google_maps('\uad75'),
cmd_google_my_business('\uad76'),
cmd_google_nearby('\uad77'),
cmd_google_play('\uad78'),
cmd_google_plus('\uad79'),
cmd_google_podcast('\uad7a'),
cmd_google_spreadsheet('\uad7b'),
cmd_google_street_view('\uad7c'),
cmd_google_translate('\uad7d'),
cmd_gradient_horizontal('\uad7f'),
cmd_gradient_vertical('\uad80'),
cmd_grain('\uad81'),
cmd_graph('\uad83'),
cmd_graph_outline('\uad82'),
cmd_graphql('\uad84'),
cmd_grass('\uad85'),
cmd_grave_stone('\uad86'),
cmd_grease_pencil('\uad87'),
cmd_greater_than('\uad89'),
cmd_greater_than_or_equal('\uad88'),
cmd_greenhouse('\uad8a'),
cmd_grid('\uad8d'),
cmd_grid_large('\uad8b'),
cmd_grid_off('\uad8c'),
cmd_grill('\uad8f'),
cmd_grill_outline('\uad8e'),
cmd_group('\uad90'),
cmd_guitar_acoustic('\uad91'),
cmd_guitar_electric('\uad92'),
cmd_guitar_pick('\uad94'),
cmd_guitar_pick_outline('\uad93'),
cmd_guy_fawkes_mask('\uad95'),
cmd_gymnastics('\uad96'),
cmd_hail('\uad97'),
cmd_hair_dryer('\uad99'),
cmd_hair_dryer_outline('\uad98'),
cmd_halloween('\uad9a'),
cmd_hamburger('\uada0'),
cmd_hamburger_check('\uad9b'),
cmd_hamburger_minus('\uad9c'),
cmd_hamburger_off('\uad9d'),
cmd_hamburger_plus('\uad9e'),
cmd_hamburger_remove('\uad9f'),
cmd_hammer('\uada4'),
cmd_hammer_screwdriver('\uada1'),
cmd_hammer_sickle('\uada2'),
cmd_hammer_wrench('\uada3'),
cmd_hand_back_left('\uada8'),
cmd_hand_back_left_off('\uada6'),
cmd_hand_back_left_off_outline('\uada5'),
cmd_hand_back_left_outline('\uada7'),
cmd_hand_back_right('\uadac'),
cmd_hand_back_right_off('\uadaa'),
cmd_hand_back_right_off_outline('\uada9'),
cmd_hand_back_right_outline('\uadab'),
cmd_hand_clap('\uadae'),
cmd_hand_clap_off('\uadad'),
cmd_hand_coin('\uadb0'),
cmd_hand_coin_outline('\uadaf'),
cmd_hand_cycle('\uadb1'),
cmd_hand_extended('\uadb3'),
cmd_hand_extended_outline('\uadb2'),
cmd_hand_front_left('\uadb5'),
cmd_hand_front_left_outline('\uadb4'),
cmd_hand_front_right('\uadb7'),
cmd_hand_front_right_outline('\uadb6'),
cmd_hand_heart('\uadb9'),
cmd_hand_heart_outline('\uadb8'),
cmd_hand_okay('\uadba'),
cmd_hand_peace('\uadbc'),
cmd_hand_peace_variant('\uadbb'),
cmd_hand_pointing_down('\uadbd'),
cmd_hand_pointing_left('\uadbe'),
cmd_hand_pointing_right('\uadbf'),
cmd_hand_pointing_up('\uadc0'),
cmd_hand_saw('\uadc1'),
cmd_hand_wash('\uadc3'),
cmd_hand_wash_outline('\uadc2'),
cmd_hand_water('\uadc4'),
cmd_hand_wave('\uadc6'),
cmd_hand_wave_outline('\uadc5'),
cmd_handball('\uadc7'),
cmd_handcuffs('\uadc8'),
cmd_hands_pray('\uadc9'),
cmd_handshake('\uadcb'),
cmd_handshake_outline('\uadca'),
cmd_hanger('\uadcc'),
cmd_hard_hat('\uadcd'),
cmd_harddisk('\uadd0'),
cmd_harddisk_plus('\uadce'),
cmd_harddisk_remove('\uadcf'),
cmd_hat_fedora('\uadd1'),
cmd_hazard_lights('\uadd2'),
cmd_hdmi_port('\uadd3'),
cmd_hdr('\uadd5'),
cmd_hdr_off('\uadd4'),
cmd_head('\uadf1'),
cmd_head_alert('\uadd7'),
cmd_head_alert_outline('\uadd6'),
cmd_head_check('\uadd9'),
cmd_head_check_outline('\uadd8'),
cmd_head_cog('\uaddb'),
cmd_head_cog_outline('\uadda'),
cmd_head_dots_horizontal('\uaddd'),
cmd_head_dots_horizontal_outline('\uaddc'),
cmd_head_flash('\uaddf'),
cmd_head_flash_outline('\uadde'),
cmd_head_heart('\uade1'),
cmd_head_heart_outline('\uade0'),
cmd_head_lightbulb('\uade3'),
cmd_head_lightbulb_outline('\uade2'),
cmd_head_minus('\uade5'),
cmd_head_minus_outline('\uade4'),
cmd_head_outline('\uade6'),
cmd_head_plus('\uade8'),
cmd_head_plus_outline('\uade7'),
cmd_head_question('\uadea'),
cmd_head_question_outline('\uade9'),
cmd_head_remove('\uadec'),
cmd_head_remove_outline('\uadeb'),
cmd_head_snowflake('\uadee'),
cmd_head_snowflake_outline('\uaded'),
cmd_head_sync('\uadf0'),
cmd_head_sync_outline('\uadef'),
cmd_headphones('\uadf6'),
cmd_headphones_bluetooth('\uadf2'),
cmd_headphones_box('\uadf3'),
cmd_headphones_off('\uadf4'),
cmd_headphones_settings('\uadf5'),
cmd_headset('\uadf9'),
cmd_headset_dock('\uadf7'),
cmd_headset_off('\uadf8'),
cmd_heart('\uae14'),
cmd_heart_box('\uadfb'),
cmd_heart_box_outline('\uadfa'),
cmd_heart_broken('\uadfd'),
cmd_heart_broken_outline('\uadfc'),
cmd_heart_circle('\uadff'),
cmd_heart_circle_outline('\uadfe'),
cmd_heart_cog('\uae01'),
cmd_heart_cog_outline('\uae00'),
cmd_heart_flash('\uae02'),
cmd_heart_half('\uae05'),
cmd_heart_half_full('\uae03'),
cmd_heart_half_outline('\uae04'),
cmd_heart_minus('\uae07'),
cmd_heart_minus_outline('\uae06'),
cmd_heart_multiple('\uae09'),
cmd_heart_multiple_outline('\uae08'),
cmd_heart_off('\uae0b'),
cmd_heart_off_outline('\uae0a'),
cmd_heart_outline('\uae0c'),
cmd_heart_plus('\uae0e'),
cmd_heart_plus_outline('\uae0d'),
cmd_heart_pulse('\uae0f'),
cmd_heart_remove('\uae11'),
cmd_heart_remove_outline('\uae10'),
cmd_heart_settings('\uae13'),
cmd_heart_settings_outline('\uae12'),
cmd_heat_pump('\uae16'),
cmd_heat_pump_outline('\uae15'),
cmd_heat_wave('\uae17'),
cmd_heating_coil('\uae18'),
cmd_helicopter('\uae19'),
cmd_help('\uae21'),
cmd_help_box('\uae1a'),
cmd_help_circle('\uae1c'),
cmd_help_circle_outline('\uae1b'),
cmd_help_network('\uae1e'),
cmd_help_network_outline('\uae1d'),
cmd_help_rhombus('\uae20'),
cmd_help_rhombus_outline('\uae1f'),
cmd_hexadecimal('\uae22'),
cmd_hexagon('\uae2c'),
cmd_hexagon_multiple('\uae24'),
cmd_hexagon_multiple_outline('\uae23'),
cmd_hexagon_outline('\uae25'),
cmd_hexagon_slice_1('\uae26'),
cmd_hexagon_slice_2('\uae27'),
cmd_hexagon_slice_3('\uae28'),
cmd_hexagon_slice_4('\uae29'),
cmd_hexagon_slice_5('\uae2a'),
cmd_hexagon_slice_6('\uae2b'),
cmd_hexagram('\uae2e'),
cmd_hexagram_outline('\uae2d'),
cmd_high_definition('\uae30'),
cmd_high_definition_box('\uae2f'),
cmd_highway('\uae31'),
cmd_hiking('\uae32'),
cmd_history('\uae33'),
cmd_hockey_puck('\uae34'),
cmd_hockey_sticks('\uae35'),
cmd_hololens('\uae36'),
cmd_home('\uae74'),
cmd_home_account('\uae37'),
cmd_home_alert('\uae39'),
cmd_home_alert_outline('\uae38'),
cmd_home_analytics('\uae3a'),
cmd_home_assistant('\uae3b'),
cmd_home_automation('\uae3c'),
cmd_home_battery('\uae3e'),
cmd_home_battery_outline('\uae3d'),
cmd_home_circle('\uae40'),
cmd_home_circle_outline('\uae3f'),
cmd_home_city('\uae42'),
cmd_home_city_outline('\uae41'),
cmd_home_clock('\uae44'),
cmd_home_clock_outline('\uae43'),
cmd_home_edit('\uae46'),
cmd_home_edit_outline('\uae45'),
cmd_home_export_outline('\uae47'),
cmd_home_flood('\uae48'),
cmd_home_floor_0('\uae49'),
cmd_home_floor_1('\uae4a'),
cmd_home_floor_2('\uae4b'),
cmd_home_floor_3('\uae4c'),
cmd_home_floor_a('\uae4d'),
cmd_home_floor_b('\uae4e'),
cmd_home_floor_g('\uae4f'),
cmd_home_floor_l('\uae50'),
cmd_home_floor_negative_1('\uae51'),
cmd_home_group('\uae55'),
cmd_home_group_minus('\uae52'),
cmd_home_group_plus('\uae53'),
cmd_home_group_remove('\uae54'),
cmd_home_heart('\uae56'),
cmd_home_import_outline('\uae57'),
cmd_home_lightbulb('\uae59'),
cmd_home_lightbulb_outline('\uae58'),
cmd_home_lightning_bolt('\uae5b'),
cmd_home_lightning_bolt_outline('\uae5a'),
cmd_home_lock('\uae5d'),
cmd_home_lock_open('\uae5c'),
cmd_home_map_marker('\uae5e'),
cmd_home_minus('\uae60'),
cmd_home_minus_outline('\uae5f'),
cmd_home_modern('\uae61'),
cmd_home_off('\uae63'),
cmd_home_off_outline('\uae62'),
cmd_home_outline('\uae64'),
cmd_home_plus('\uae66'),
cmd_home_plus_outline('\uae65'),
cmd_home_remove('\uae68'),
cmd_home_remove_outline('\uae67'),
cmd_home_roof('\uae69'),
cmd_home_search('\uae6b'),
cmd_home_search_outline('\uae6a'),
cmd_home_silo('\uae6d'),
cmd_home_silo_outline('\uae6c'),
cmd_home_switch('\uae6f'),
cmd_home_switch_outline('\uae6e'),
cmd_home_thermometer('\uae71'),
cmd_home_thermometer_outline('\uae70'),
cmd_home_variant('\uae73'),
cmd_home_variant_outline('\uae72'),
cmd_hook('\uae76'),
cmd_hook_off('\uae75'),
cmd_hoop_house('\uae77'),
cmd_hops('\uae78'),
cmd_horizontal_rotate_clockwise('\uae79'),
cmd_horizontal_rotate_counterclockwise('\uae7a'),
cmd_horse('\uae7e'),
cmd_horse_human('\uae7b'),
cmd_horse_variant('\uae7d'),
cmd_horse_variant_fast('\uae7c'),
cmd_horseshoe('\uae7f'),
cmd_hospital('\uae84'),
cmd_hospital_box('\uae81'),
cmd_hospital_box_outline('\uae80'),
cmd_hospital_building('\uae82'),
cmd_hospital_marker('\uae83'),
cmd_hot_tub('\uae85'),
cmd_hours_24('\uae86'),
cmd_hubspot('\uae87'),
cmd_hulu('\uae88'),
cmd_human('\uaeac'),
cmd_human_baby_changing_table('\uae89'),
cmd_human_cane('\uae8a'),
cmd_human_capacity_decrease('\uae8b'),
cmd_human_capacity_increase('\uae8c'),
cmd_human_child('\uae8d'),
cmd_human_dolly('\uae8e'),
cmd_human_edit('\uae8f'),
cmd_human_female('\uae94'),
cmd_human_female_boy('\uae90'),
cmd_human_female_dance('\uae91'),
cmd_human_female_female('\uae92'),
cmd_human_female_girl('\uae93'),
cmd_human_greeting('\uae97'),
cmd_human_greeting_proximity('\uae95'),
cmd_human_greeting_variant('\uae96'),
cmd_human_handsdown('\uae98'),
cmd_human_handsup('\uae99'),
cmd_human_male('\uaea4'),
cmd_human_male_board('\uae9b'),
cmd_human_male_board_poll('\uae9a'),
cmd_human_male_boy('\uae9c'),
cmd_human_male_child('\uae9d'),
cmd_human_male_female('\uae9f'),
cmd_human_male_female_child('\uae9e'),
cmd_human_male_girl('\uaea0'),
cmd_human_male_height('\uaea2'),
cmd_human_male_height_variant('\uaea1'),
cmd_human_male_male('\uaea3'),
cmd_human_non_binary('\uaea5'),
cmd_human_pregnant('\uaea6'),
cmd_human_queue('\uaea7'),
cmd_human_scooter('\uaea8'),
cmd_human_walker('\uaea9'),
cmd_human_wheelchair('\uaeaa'),
cmd_human_white_cane('\uaeab'),
cmd_humble_bundle('\uaead'),
cmd_hvac('\uaeaf'),
cmd_hvac_off('\uaeae'),
cmd_hydraulic_oil_level('\uaeb0'),
cmd_hydraulic_oil_temperature('\uaeb1'),
cmd_hydro_power('\uaeb2'),
cmd_hydrogen_station('\uaeb3'),
cmd_ice_cream('\uaeb5'),
cmd_ice_cream_off('\uaeb4'),
cmd_ice_pop('\uaeb6'),
cmd_id_card('\uaeb7'),
cmd_identifier('\uaeb8'),
cmd_ideogram_cjk('\uaeba'),
cmd_ideogram_cjk_variant('\uaeb9'),
cmd_image('\uaeeb'),
cmd_image_album('\uaebb'),
cmd_image_area('\uaebd'),
cmd_image_area_close('\uaebc'),
cmd_image_auto_adjust('\uaebe'),
cmd_image_broken('\uaec0'),
cmd_image_broken_variant('\uaebf'),
cmd_image_check('\uaec2'),
cmd_image_check_outline('\uaec1'),
cmd_image_edit('\uaec4'),
cmd_image_edit_outline('\uaec3'),
cmd_image_filter_black_white('\uaec5'),
cmd_image_filter_center_focus('\uaec9'),
cmd_image_filter_center_focus_strong('\uaec7'),
cmd_image_filter_center_focus_strong_outline('\uaec6'),
cmd_image_filter_center_focus_weak('\uaec8'),
cmd_image_filter_drama('\uaeca'),
cmd_image_filter_frames('\uaecb'),
cmd_image_filter_hdr('\uaecc'),
cmd_image_filter_none('\uaecd'),
cmd_image_filter_tilt_shift('\uaece'),
cmd_image_filter_vintage('\uaecf'),
cmd_image_frame('\uaed0'),
cmd_image_lock('\uaed2'),
cmd_image_lock_outline('\uaed1'),
cmd_image_marker('\uaed4'),
cmd_image_marker_outline('\uaed3'),
cmd_image_minus('\uaed6'),
cmd_image_minus_outline('\uaed5'),
cmd_image_move('\uaed7'),
cmd_image_multiple('\uaed9'),
cmd_image_multiple_outline('\uaed8'),
cmd_image_off('\uaedb'),
cmd_image_off_outline('\uaeda'),
cmd_image_outline('\uaedc'),
cmd_image_plus('\uaede'),
cmd_image_plus_outline('\uaedd'),
cmd_image_refresh('\uaee0'),
cmd_image_refresh_outline('\uaedf'),
cmd_image_remove('\uaee2'),
cmd_image_remove_outline('\uaee1'),
cmd_image_search('\uaee4'),
cmd_image_search_outline('\uaee3'),
cmd_image_size_select_actual('\uaee5'),
cmd_image_size_select_large('\uaee6'),
cmd_image_size_select_small('\uaee7'),
cmd_image_sync('\uaee9'),
cmd_image_sync_outline('\uaee8'),
cmd_image_text('\uaeea'),
cmd_import('\uaeec'),
cmd_inbox('\uaef8'),
cmd_inbox_arrow_down('\uaeee'),
cmd_inbox_arrow_down_outline('\uaeed'),
cmd_inbox_arrow_up('\uaef0'),
cmd_inbox_arrow_up_outline('\uaeef'),
cmd_inbox_full('\uaef2'),
cmd_inbox_full_outline('\uaef1'),
cmd_inbox_multiple('\uaef4'),
cmd_inbox_multiple_outline('\uaef3'),
cmd_inbox_outline('\uaef5'),
cmd_inbox_remove('\uaef7'),
cmd_inbox_remove_outline('\uaef6'),
cmd_incognito('\uaefc'),
cmd_incognito_circle('\uaefa'),
cmd_incognito_circle_off('\uaef9'),
cmd_incognito_off('\uaefb'),
cmd_induction('\uaefd'),
cmd_infinity('\uaefe'),
cmd_information('\uaf03'),
cmd_information_off('\uaf00'),
cmd_information_off_outline('\uaeff'),
cmd_information_outline('\uaf01'),
cmd_information_variant('\uaf02'),
cmd_instagram('\uaf04'),
cmd_instrument_triangle('\uaf05'),
cmd_integrated_circuit_chip('\uaf06'),
cmd_invert_colors('\uaf08'),
cmd_invert_colors_off('\uaf07'),
cmd_iobroker('\uaf09'),
cmd_ip('\uaf0d'),
cmd_ip_network('\uaf0b'),
cmd_ip_network_outline('\uaf0a'),
cmd_ip_outline('\uaf0c'),
cmd_ipod('\uaf0e'),
cmd_iron('\uaf11'),
cmd_iron_board('\uaf0f'),
cmd_iron_outline('\uaf10'),
cmd_island('\uaf12'),
cmd_iv_bag('\uaf13'),
cmd_jabber('\uaf14'),
cmd_jeepney('\uaf15'),
cmd_jellyfish('\uaf17'),
cmd_jellyfish_outline('\uaf16'),
cmd_jira('\uaf18'),
cmd_jquery('\uaf19'),
cmd_jsfiddle('\uaf1a'),
cmd_jump_rope('\uaf1b'),
cmd_kabaddi('\uaf1c'),
cmd_kangaroo('\uaf1d'),
cmd_karate('\uaf1e'),
cmd_kayaking('\uaf1f'),
cmd_keg('\uaf20'),
cmd_kettle('\uaf29'),
cmd_kettle_alert('\uaf22'),
cmd_kettle_alert_outline('\uaf21'),
cmd_kettle_off('\uaf24'),
cmd_kettle_off_outline('\uaf23'),
cmd_kettle_outline('\uaf25'),
cmd_kettle_pour_over('\uaf26'),
cmd_kettle_steam('\uaf28'),
cmd_kettle_steam_outline('\uaf27'),
cmd_kettlebell('\uaf2a'),
cmd_key('\uaf39'),
cmd_key_alert('\uaf2c'),
cmd_key_alert_outline('\uaf2b'),
cmd_key_arrow_right('\uaf2d'),
cmd_key_chain('\uaf2f'),
cmd_key_chain_variant('\uaf2e'),
cmd_key_change('\uaf30'),
cmd_key_link('\uaf31'),
cmd_key_minus('\uaf32'),
cmd_key_outline('\uaf33'),
cmd_key_plus('\uaf34'),
cmd_key_remove('\uaf35'),
cmd_key_star('\uaf36'),
cmd_key_variant('\uaf37'),
cmd_key_wireless('\uaf38'),
cmd_keyboard('\uaf54'),
cmd_keyboard_backspace('\uaf3a'),
cmd_keyboard_caps('\uaf3b'),
cmd_keyboard_close('\uaf3c'),
cmd_keyboard_esc('\uaf3d'),
cmd_keyboard_f1('\uaf3e'),
cmd_keyboard_f10('\uaf47'),
cmd_keyboard_f11('\uaf48'),
cmd_keyboard_f12('\uaf49'),
cmd_keyboard_f2('\uaf3f'),
cmd_keyboard_f3('\uaf40'),
cmd_keyboard_f4('\uaf41'),
cmd_keyboard_f5('\uaf42'),
cmd_keyboard_f6('\uaf43'),
cmd_keyboard_f7('\uaf44'),
cmd_keyboard_f8('\uaf45'),
cmd_keyboard_f9('\uaf46'),
cmd_keyboard_off('\uaf4b'),
cmd_keyboard_off_outline('\uaf4a'),
cmd_keyboard_outline('\uaf4c'),
cmd_keyboard_return('\uaf4d'),
cmd_keyboard_settings('\uaf4f'),
cmd_keyboard_settings_outline('\uaf4e'),
cmd_keyboard_space('\uaf50'),
cmd_keyboard_tab('\uaf52'),
cmd_keyboard_tab_reverse('\uaf51'),
cmd_keyboard_variant('\uaf53'),
cmd_khanda('\uaf55'),
cmd_kickstarter('\uaf56'),
cmd_kite('\uaf58'),
cmd_kite_outline('\uaf57'),
cmd_kitesurfing('\uaf59'),
cmd_klingon('\uaf5a'),
cmd_knife('\uaf5c'),
cmd_knife_military('\uaf5b'),
cmd_knob('\uaf5d'),
cmd_koala('\uaf5e'),
cmd_kodi('\uaf5f'),
cmd_kubernetes('\uaf60'),
cmd_label('\uaf6a'),
cmd_label_multiple('\uaf62'),
cmd_label_multiple_outline('\uaf61'),
cmd_label_off('\uaf64'),
cmd_label_off_outline('\uaf63'),
cmd_label_outline('\uaf65'),
cmd_label_percent('\uaf67'),
cmd_label_percent_outline('\uaf66'),
cmd_label_variant('\uaf69'),
cmd_label_variant_outline('\uaf68'),
cmd_ladder('\uaf6b'),
cmd_ladybug('\uaf6c'),
cmd_lambda('\uaf6d'),
cmd_lamp('\uaf6f'),
cmd_lamp_outline('\uaf6e'),
cmd_lamps('\uaf71'),
cmd_lamps_outline('\uaf70'),
cmd_lan('\uaf76'),
cmd_lan_check('\uaf72'),
cmd_lan_connect('\uaf73'),
cmd_lan_disconnect('\uaf74'),
cmd_lan_pending('\uaf75'),
cmd_land_fields('\uaf77'),
cmd_land_plots('\uaf7a'),
cmd_land_plots_circle('\uaf79'),
cmd_land_plots_circle_variant('\uaf78'),
cmd_land_rows_horizontal('\uaf7b'),
cmd_land_rows_vertical('\uaf7c'),
cmd_landslide('\uaf7e'),
cmd_landslide_outline('\uaf7d'),
cmd_language_c('\uaf7f'),
cmd_language_cpp('\uaf80'),
cmd_language_csharp('\uaf81'),
cmd_language_css3('\uaf82'),
cmd_language_fortran('\uaf83'),
cmd_language_go('\uaf84'),
cmd_language_haskell('\uaf85'),
cmd_language_html5('\uaf86'),
cmd_language_java('\uaf87'),
cmd_language_javascript('\uaf88'),
cmd_language_kotlin('\uaf89'),
cmd_language_lua('\uaf8a'),
cmd_language_markdown('\uaf8c'),
cmd_language_markdown_outline('\uaf8b'),
cmd_language_php('\uaf8d'),
cmd_language_python('\uaf8e'),
cmd_language_r('\uaf8f'),
cmd_language_ruby('\uaf91'),
cmd_language_ruby_on_rails('\uaf90'),
cmd_language_rust('\uaf92'),
cmd_language_swift('\uaf93'),
cmd_language_typescript('\uaf94'),
cmd_language_xaml('\uaf95'),
cmd_laptop('\uaf98'),
cmd_laptop_account('\uaf96'),
cmd_laptop_off('\uaf97'),
cmd_laravel('\uaf99'),
cmd_laser_pointer('\uaf9a'),
cmd_lasso('\uaf9b'),
cmd_lastpass('\uaf9c'),
cmd_latitude('\uaf9d'),
cmd_launch('\uaf9e'),
cmd_lava_lamp('\uaf9f'),
cmd_layers('\uafab'),
cmd_layers_edit('\uafa0'),
cmd_layers_minus('\uafa1'),
cmd_layers_off('\uafa3'),
cmd_layers_off_outline('\uafa2'),
cmd_layers_outline('\uafa4'),
cmd_layers_plus('\uafa5'),
cmd_layers_remove('\uafa6'),
cmd_layers_search('\uafa8'),
cmd_layers_search_outline('\uafa7'),
cmd_layers_triple('\uafaa'),
cmd_layers_triple_outline('\uafa9'),
cmd_lead_pencil('\uafac'),
cmd_leaf('\uafb2'),
cmd_leaf_circle('\uafae'),
cmd_leaf_circle_outline('\uafad'),
cmd_leaf_maple('\uafb0'),
cmd_leaf_maple_off('\uafaf'),
cmd_leaf_off('\uafb1'),
cmd_leak('\uafb4'),
cmd_leak_off('\uafb3'),
cmd_lectern('\uafb5'),
cmd_led_off('\uafb6'),
cmd_led_on('\uafb7'),
cmd_led_outline('\uafb8'),
cmd_led_strip('\uafbb'),
cmd_led_strip_variant('\uafba'),
cmd_led_strip_variant_off('\uafb9'),
cmd_led_variant_off('\uafbc'),
cmd_led_variant_on('\uafbd'),
cmd_led_variant_outline('\uafbe'),
cmd_leek('\uafbf'),
cmd_less_than('\uafc1'),
cmd_less_than_or_equal('\uafc0'),
cmd_library('\uafc4'),
cmd_library_outline('\uafc2'),
cmd_library_shelves('\uafc3'),
cmd_license('\uafc5'),
cmd_lifebuoy('\uafc6'),
cmd_light_flood_down('\uafc7'),
cmd_light_flood_up('\uafc8'),
cmd_light_recessed('\uafc9'),
cmd_light_switch('\uafcb'),
cmd_light_switch_off('\uafca'),
cmd_lightbulb('\uaff4'),
cmd_lightbulb_alert('\uafcd'),
cmd_lightbulb_alert_outline('\uafcc'),
cmd_lightbulb_auto('\uafcf'),
cmd_lightbulb_auto_outline('\uafce'),
cmd_lightbulb_cfl('\uafd3'),
cmd_lightbulb_cfl_off('\uafd0'),
cmd_lightbulb_cfl_spiral('\uafd2'),
cmd_lightbulb_cfl_spiral_off('\uafd1'),
cmd_lightbulb_fluorescent_tube('\uafd5'),
cmd_lightbulb_fluorescent_tube_outline('\uafd4'),
cmd_lightbulb_group('\uafd9'),
cmd_lightbulb_group_off('\uafd7'),
cmd_lightbulb_group_off_outline('\uafd6'),
cmd_lightbulb_group_outline('\uafd8'),
cmd_lightbulb_multiple('\uafdd'),
cmd_lightbulb_multiple_off('\uafdb'),
cmd_lightbulb_multiple_off_outline('\uafda'),
cmd_lightbulb_multiple_outline('\uafdc'),
cmd_lightbulb_night('\uafdf'),
cmd_lightbulb_night_outline('\uafde'),
cmd_lightbulb_off('\uafe1'),
cmd_lightbulb_off_outline('\uafe0'),
cmd_lightbulb_on('\uafec'),
cmd_lightbulb_on_10('\uafe2'),
cmd_lightbulb_on_20('\uafe3'),
cmd_lightbulb_on_30('\uafe4'),
cmd_lightbulb_on_40('\uafe5'),
cmd_lightbulb_on_50('\uafe6'),
cmd_lightbulb_on_60('\uafe7'),
cmd_lightbulb_on_70('\uafe8'),
cmd_lightbulb_on_80('\uafe9'),
cmd_lightbulb_on_90('\uafea'),
cmd_lightbulb_on_outline('\uafeb'),
cmd_lightbulb_outline('\uafed'),
cmd_lightbulb_question('\uafef'),
cmd_lightbulb_question_outline('\uafee'),
cmd_lightbulb_spot('\uaff1'),
cmd_lightbulb_spot_off('\uaff0'),
cmd_lightbulb_variant('\uaff3'),
cmd_lightbulb_variant_outline('\uaff2'),
cmd_lighthouse('\uaff6'),
cmd_lighthouse_on('\uaff5'),
cmd_lightning_bolt('\uaff9'),
cmd_lightning_bolt_circle('\uaff7'),
cmd_lightning_bolt_outline('\uaff8'),
cmd_line_scan('\uaffa'),
cmd_lingerie('\uaffb'),
cmd_link('\ub008'),
cmd_link_box('\uafff'),
cmd_link_box_outline('\uaffc'),
cmd_link_box_variant('\uaffe'),
cmd_link_box_variant_outline('\uaffd'),
cmd_link_lock('\ub000'),
cmd_link_off('\ub001'),
cmd_link_plus('\ub002'),
cmd_link_variant('\ub007'),
cmd_link_variant_minus('\ub003'),
cmd_link_variant_off('\ub004'),
cmd_link_variant_plus('\ub005'),
cmd_link_variant_remove('\ub006'),
cmd_linkedin('\ub009'),
cmd_linux('\ub00b'),
cmd_linux_mint('\ub00a'),
cmd_lipstick('\ub00c'),
cmd_liquid_spot('\ub00d'),
cmd_liquor('\ub00e'),
cmd_list_box('\ub010'),
cmd_list_box_outline('\ub00f'),
cmd_list_status('\ub011'),
cmd_litecoin('\ub012'),
cmd_loading('\ub013'),
cmd_location_enter('\ub014'),
cmd_location_exit('\ub015'),
cmd_lock('\ub036'),
cmd_lock_alert('\ub017'),
cmd_lock_alert_outline('\ub016'),
cmd_lock_check('\ub019'),
cmd_lock_check_outline('\ub018'),
cmd_lock_clock('\ub01a'),
cmd_lock_minus('\ub01c'),
cmd_lock_minus_outline('\ub01b'),
cmd_lock_off('\ub01e'),
cmd_lock_off_outline('\ub01d'),
cmd_lock_open('\ub02c'),
cmd_lock_open_alert('\ub020'),
cmd_lock_open_alert_outline('\ub01f'),
cmd_lock_open_check('\ub022'),
cmd_lock_open_check_outline('\ub021'),
cmd_lock_open_minus('\ub024'),
cmd_lock_open_minus_outline('\ub023'),
cmd_lock_open_outline('\ub025'),
cmd_lock_open_plus('\ub027'),
cmd_lock_open_plus_outline('\ub026'),
cmd_lock_open_remove('\ub029'),
cmd_lock_open_remove_outline('\ub028'),
cmd_lock_open_variant('\ub02b'),
cmd_lock_open_variant_outline('\ub02a'),
cmd_lock_outline('\ub02d'),
cmd_lock_pattern('\ub02e'),
cmd_lock_plus('\ub030'),
cmd_lock_plus_outline('\ub02f'),
cmd_lock_question('\ub031'),
cmd_lock_remove('\ub033'),
cmd_lock_remove_outline('\ub032'),
cmd_lock_reset('\ub034'),
cmd_lock_smart('\ub035'),
cmd_locker('\ub038'),
cmd_locker_multiple('\ub037'),
cmd_login('\ub03a'),
cmd_login_variant('\ub039'),
cmd_logout('\ub03c'),
cmd_logout_variant('\ub03b'),
cmd_longitude('\ub03d'),
cmd_looks('\ub03e'),
cmd_lotion('\ub042'),
cmd_lotion_outline('\ub03f'),
cmd_lotion_plus('\ub041'),
cmd_lotion_plus_outline('\ub040'),
cmd_loupe('\ub043'),
cmd_lumx('\ub044'),
cmd_lungs('\ub045');
override val typeface: ITypeface by lazy { CommunityMaterial }
}
enum class Icon3 constructor(override val character: Char) : IIcon {
cmd_mace('\ub046'),
cmd_magazine_pistol('\ub047'),
cmd_magazine_rifle('\ub048'),
cmd_magic_staff('\ub049'),
cmd_magnet('\ub04b'),
cmd_magnet_on('\ub04a'),
cmd_magnify('\ub057'),
cmd_magnify_close('\ub04c'),
cmd_magnify_expand('\ub04d'),
cmd_magnify_minus('\ub050'),
cmd_magnify_minus_cursor('\ub04e'),
cmd_magnify_minus_outline('\ub04f'),
cmd_magnify_plus('\ub053'),
cmd_magnify_plus_cursor('\ub051'),
cmd_magnify_plus_outline('\ub052'),
cmd_magnify_remove_cursor('\ub054'),
cmd_magnify_remove_outline('\ub055'),
cmd_magnify_scan('\ub056'),
cmd_mail('\ub058'),
cmd_mailbox('\ub060'),
cmd_mailbox_open('\ub05c'),
cmd_mailbox_open_outline('\ub059'),
cmd_mailbox_open_up('\ub05b'),
cmd_mailbox_open_up_outline('\ub05a'),
cmd_mailbox_outline('\ub05d'),
cmd_mailbox_up('\ub05f'),
cmd_mailbox_up_outline('\ub05e'),
cmd_manjaro('\ub061'),
cmd_map('\ub08e'),
cmd_map_check('\ub063'),
cmd_map_check_outline('\ub062'),
cmd_map_clock('\ub065'),
cmd_map_clock_outline('\ub064'),
cmd_map_legend('\ub066'),
cmd_map_marker('\ub088'),
cmd_map_marker_account('\ub068'),
cmd_map_marker_account_outline('\ub067'),
cmd_map_marker_alert('\ub06a'),
cmd_map_marker_alert_outline('\ub069'),
cmd_map_marker_check('\ub06c'),
cmd_map_marker_check_outline('\ub06b'),
cmd_map_marker_circle('\ub06d'),
cmd_map_marker_distance('\ub06e'),
cmd_map_marker_down('\ub06f'),
cmd_map_marker_left('\ub071'),
cmd_map_marker_left_outline('\ub070'),
cmd_map_marker_minus('\ub073'),
cmd_map_marker_minus_outline('\ub072'),
cmd_map_marker_multiple('\ub075'),
cmd_map_marker_multiple_outline('\ub074'),
cmd_map_marker_off('\ub077'),
cmd_map_marker_off_outline('\ub076'),
cmd_map_marker_outline('\ub078'),
cmd_map_marker_path('\ub079'),
cmd_map_marker_plus('\ub07b'),
cmd_map_marker_plus_outline('\ub07a'),
cmd_map_marker_question('\ub07d'),
cmd_map_marker_question_outline('\ub07c'),
cmd_map_marker_radius('\ub07f'),
cmd_map_marker_radius_outline('\ub07e'),
cmd_map_marker_remove('\ub082'),
cmd_map_marker_remove_outline('\ub080'),
cmd_map_marker_remove_variant('\ub081'),
cmd_map_marker_right('\ub084'),
cmd_map_marker_right_outline('\ub083'),
cmd_map_marker_star('\ub086'),
cmd_map_marker_star_outline('\ub085'),
cmd_map_marker_up('\ub087'),
cmd_map_minus('\ub089'),
cmd_map_outline('\ub08a'),
cmd_map_plus('\ub08b'),
cmd_map_search('\ub08d'),
cmd_map_search_outline('\ub08c'),
cmd_mapbox('\ub08f'),
cmd_margin('\ub090'),
cmd_marker('\ub093'),
cmd_marker_cancel('\ub091'),
cmd_marker_check('\ub092'),
cmd_mastodon('\ub094'),
cmd_material_design('\ub095'),
cmd_material_ui('\ub096'),
cmd_math_compass('\ub097'),
cmd_math_cos('\ub098'),
cmd_math_integral('\ub09a'),
cmd_math_integral_box('\ub099'),
cmd_math_log('\ub09b'),
cmd_math_norm('\ub09d'),
cmd_math_norm_box('\ub09c'),
cmd_math_sin('\ub09e'),
cmd_math_tan('\ub09f'),
cmd_matrix('\ub0a0'),
cmd_medal('\ub0a2'),
cmd_medal_outline('\ub0a1'),
cmd_medical_bag('\ub0a3'),
cmd_medical_cotton_swab('\ub0a4'),
cmd_medication('\ub0a6'),
cmd_medication_outline('\ub0a5'),
cmd_meditation('\ub0a7'),
cmd_memory('\ub0a8'),
cmd_menorah('\ub0aa'),
cmd_menorah_fire('\ub0a9'),
cmd_menu('\ub0b6'),
cmd_menu_down('\ub0ac'),
cmd_menu_down_outline('\ub0ab'),
cmd_menu_left('\ub0ae'),
cmd_menu_left_outline('\ub0ad'),
cmd_menu_open('\ub0af'),
cmd_menu_right('\ub0b1'),
cmd_menu_right_outline('\ub0b0'),
cmd_menu_swap('\ub0b3'),
cmd_menu_swap_outline('\ub0b2'),
cmd_menu_up('\ub0b5'),
cmd_menu_up_outline('\ub0b4'),
cmd_merge('\ub0b7'),
cmd_message('\ub0ed'),
cmd_message_alert('\ub0b9'),
cmd_message_alert_outline('\ub0b8'),
cmd_message_arrow_left('\ub0bb'),
cmd_message_arrow_left_outline('\ub0ba'),
cmd_message_arrow_right('\ub0bd'),
cmd_message_arrow_right_outline('\ub0bc'),
cmd_message_badge('\ub0bf'),
cmd_message_badge_outline('\ub0be'),
cmd_message_bookmark('\ub0c1'),
cmd_message_bookmark_outline('\ub0c0'),
cmd_message_bulleted('\ub0c3'),
cmd_message_bulleted_off('\ub0c2'),
cmd_message_check('\ub0c5'),
cmd_message_check_outline('\ub0c4'),
cmd_message_cog('\ub0c7'),
cmd_message_cog_outline('\ub0c6'),
cmd_message_draw('\ub0c8'),
cmd_message_fast('\ub0ca'),
cmd_message_fast_outline('\ub0c9'),
cmd_message_flash('\ub0cc'),
cmd_message_flash_outline('\ub0cb'),
cmd_message_image('\ub0ce'),
cmd_message_image_outline('\ub0cd'),
cmd_message_lock('\ub0d0'),
cmd_message_lock_outline('\ub0cf'),
cmd_message_minus('\ub0d2'),
cmd_message_minus_outline('\ub0d1'),
cmd_message_off('\ub0d4'),
cmd_message_off_outline('\ub0d3'),
cmd_message_outline('\ub0d5'),
cmd_message_plus('\ub0d7'),
cmd_message_plus_outline('\ub0d6'),
cmd_message_processing('\ub0d9'),
cmd_message_processing_outline('\ub0d8'),
cmd_message_question('\ub0db'),
cmd_message_question_outline('\ub0da'),
cmd_message_reply('\ub0df'),
cmd_message_reply_outline('\ub0dc'),
cmd_message_reply_text('\ub0de'),
cmd_message_reply_text_outline('\ub0dd'),
cmd_message_settings('\ub0e1'),
cmd_message_settings_outline('\ub0e0'),
cmd_message_star('\ub0e3'),
cmd_message_star_outline('\ub0e2'),
cmd_message_text('\ub0eb'),
cmd_message_text_clock('\ub0e5'),
cmd_message_text_clock_outline('\ub0e4'),
cmd_message_text_fast('\ub0e7'),
cmd_message_text_fast_outline('\ub0e6'),
cmd_message_text_lock('\ub0e9'),
cmd_message_text_lock_outline('\ub0e8'),
cmd_message_text_outline('\ub0ea'),
cmd_message_video('\ub0ec'),
cmd_meteor('\ub0ee'),
cmd_meter_electric('\ub0f0'),
cmd_meter_electric_outline('\ub0ef'),
cmd_meter_gas('\ub0f2'),
cmd_meter_gas_outline('\ub0f1'),
cmd_metronome('\ub0f4'),
cmd_metronome_tick('\ub0f3'),
cmd_micro_sd('\ub0f5'),
cmd_microphone('\ub101'),
cmd_microphone_message('\ub0f7'),
cmd_microphone_message_off('\ub0f6'),
cmd_microphone_minus('\ub0f8'),
cmd_microphone_off('\ub0f9'),
cmd_microphone_outline('\ub0fa'),
cmd_microphone_plus('\ub0fb'),
cmd_microphone_question('\ub0fd'),
cmd_microphone_question_outline('\ub0fc'),
cmd_microphone_settings('\ub0fe'),
cmd_microphone_variant('\ub100'),
cmd_microphone_variant_off('\ub0ff'),
cmd_microscope('\ub102'),
cmd_microsoft('\ub123'),
cmd_microsoft_access('\ub103'),
cmd_microsoft_azure('\ub105'),
cmd_microsoft_azure_devops('\ub104'),
cmd_microsoft_bing('\ub106'),
cmd_microsoft_dynamics_365('\ub107'),
cmd_microsoft_edge('\ub108'),
cmd_microsoft_excel('\ub109'),
cmd_microsoft_internet_explorer('\ub10a'),
cmd_microsoft_office('\ub10b'),
cmd_microsoft_onedrive('\ub10c'),
cmd_microsoft_onenote('\ub10d'),
cmd_microsoft_outlook('\ub10e'),
cmd_microsoft_powerpoint('\ub10f'),
cmd_microsoft_sharepoint('\ub110'),
cmd_microsoft_teams('\ub111'),
cmd_microsoft_visual_studio('\ub113'),
cmd_microsoft_visual_studio_code('\ub112'),
cmd_microsoft_windows('\ub115'),
cmd_microsoft_windows_classic('\ub114'),
cmd_microsoft_word('\ub116'),
cmd_microsoft_xbox('\ub122'),
cmd_microsoft_xbox_controller('\ub121'),
cmd_microsoft_xbox_controller_battery_alert('\ub117'),
cmd_microsoft_xbox_controller_battery_charging('\ub118'),
cmd_microsoft_xbox_controller_battery_empty('\ub119'),
cmd_microsoft_xbox_controller_battery_full('\ub11a'),
cmd_microsoft_xbox_controller_battery_low('\ub11b'),
cmd_microsoft_xbox_controller_battery_medium('\ub11c'),
cmd_microsoft_xbox_controller_battery_unknown('\ub11d'),
cmd_microsoft_xbox_controller_menu('\ub11e'),
cmd_microsoft_xbox_controller_off('\ub11f'),
cmd_microsoft_xbox_controller_view('\ub120'),
cmd_microwave('\ub125'),
cmd_microwave_off('\ub124'),
cmd_middleware('\ub127'),
cmd_middleware_outline('\ub126'),
cmd_midi('\ub129'),
cmd_midi_port('\ub128'),
cmd_mine('\ub12a'),
cmd_minecraft('\ub12b'),
cmd_mini_sd('\ub12c'),
cmd_minidisc('\ub12d'),
cmd_minus('\ub13b'),
cmd_minus_box('\ub131'),
cmd_minus_box_multiple('\ub12f'),
cmd_minus_box_multiple_outline('\ub12e'),
cmd_minus_box_outline('\ub130'),
cmd_minus_circle('\ub137'),
cmd_minus_circle_multiple('\ub133'),
cmd_minus_circle_multiple_outline('\ub132'),
cmd_minus_circle_off('\ub135'),
cmd_minus_circle_off_outline('\ub134'),
cmd_minus_circle_outline('\ub136'),
cmd_minus_network('\ub139'),
cmd_minus_network_outline('\ub138'),
cmd_minus_thick('\ub13a'),
cmd_mirror('\ub13e'),
cmd_mirror_rectangle('\ub13c'),
cmd_mirror_variant('\ub13d'),
cmd_mixed_martial_arts('\ub13f'),
cmd_mixed_reality('\ub140'),
cmd_molecule('\ub143'),
cmd_molecule_co('\ub141'),
cmd_molecule_co2('\ub142'),
cmd_monitor('\ub156'),
cmd_monitor_account('\ub144'),
cmd_monitor_arrow_down('\ub146'),
cmd_monitor_arrow_down_variant('\ub145'),
cmd_monitor_cellphone('\ub148'),
cmd_monitor_cellphone_star('\ub147'),
cmd_monitor_dashboard('\ub149'),
cmd_monitor_edit('\ub14a'),
cmd_monitor_eye('\ub14b'),
cmd_monitor_lock('\ub14c'),
cmd_monitor_multiple('\ub14d'),
cmd_monitor_off('\ub14e'),
cmd_monitor_screenshot('\ub14f'),
cmd_monitor_share('\ub150'),
cmd_monitor_shimmer('\ub151'),
cmd_monitor_small('\ub152'),
cmd_monitor_speaker('\ub154'),
cmd_monitor_speaker_off('\ub153'),
cmd_monitor_star('\ub155'),
cmd_moon_first_quarter('\ub157'),
cmd_moon_full('\ub158'),
cmd_moon_last_quarter('\ub159'),
cmd_moon_new('\ub15a'),
cmd_moon_waning_crescent('\ub15b'),
cmd_moon_waning_gibbous('\ub15c'),
cmd_moon_waxing_crescent('\ub15d'),
cmd_moon_waxing_gibbous('\ub15e'),
cmd_moped('\ub162'),
cmd_moped_electric('\ub160'),
cmd_moped_electric_outline('\ub15f'),
cmd_moped_outline('\ub161'),
cmd_more('\ub163'),
cmd_mortar_pestle('\ub165'),
cmd_mortar_pestle_plus('\ub164'),
cmd_mosque('\ub167'),
cmd_mosque_outline('\ub166'),
cmd_mother_heart('\ub168'),
cmd_mother_nurse('\ub169'),
cmd_motion('\ub171'),
cmd_motion_outline('\ub16a'),
cmd_motion_pause('\ub16c'),
cmd_motion_pause_outline('\ub16b'),
cmd_motion_play('\ub16e'),
cmd_motion_play_outline('\ub16d'),
cmd_motion_sensor('\ub170'),
cmd_motion_sensor_off('\ub16f'),
cmd_motorbike('\ub174'),
cmd_motorbike_electric('\ub172'),
cmd_motorbike_off('\ub173'),
cmd_mouse('\ub17c'),
cmd_mouse_bluetooth('\ub175'),
cmd_mouse_move_down('\ub176'),
cmd_mouse_move_up('\ub177'),
cmd_mouse_move_vertical('\ub178'),
cmd_mouse_off('\ub179'),
cmd_mouse_variant('\ub17b'),
cmd_mouse_variant_off('\ub17a'),
cmd_move_resize('\ub17e'),
cmd_move_resize_variant('\ub17d'),
cmd_movie('\ub1af'),
cmd_movie_check('\ub180'),
cmd_movie_check_outline('\ub17f'),
cmd_movie_cog('\ub182'),
cmd_movie_cog_outline('\ub181'),
cmd_movie_edit('\ub184'),
cmd_movie_edit_outline('\ub183'),
cmd_movie_filter('\ub186'),
cmd_movie_filter_outline('\ub185'),
cmd_movie_minus('\ub188'),
cmd_movie_minus_outline('\ub187'),
cmd_movie_off('\ub18a'),
cmd_movie_off_outline('\ub189'),
cmd_movie_open('\ub1a0'),
cmd_movie_open_check('\ub18c'),
cmd_movie_open_check_outline('\ub18b'),
cmd_movie_open_cog('\ub18e'),
cmd_movie_open_cog_outline('\ub18d'),
cmd_movie_open_edit('\ub190'),
cmd_movie_open_edit_outline('\ub18f'),
cmd_movie_open_minus('\ub192'),
cmd_movie_open_minus_outline('\ub191'),
cmd_movie_open_off('\ub194'),
cmd_movie_open_off_outline('\ub193'),
cmd_movie_open_outline('\ub195'),
cmd_movie_open_play('\ub197'),
cmd_movie_open_play_outline('\ub196'),
cmd_movie_open_plus('\ub199'),
cmd_movie_open_plus_outline('\ub198'),
cmd_movie_open_remove('\ub19b'),
cmd_movie_open_remove_outline('\ub19a'),
cmd_movie_open_settings('\ub19d'),
cmd_movie_open_settings_outline('\ub19c'),
cmd_movie_open_star('\ub19f'),
cmd_movie_open_star_outline('\ub19e'),
cmd_movie_outline('\ub1a1'),
cmd_movie_play('\ub1a3'),
cmd_movie_play_outline('\ub1a2'),
cmd_movie_plus('\ub1a5'),
cmd_movie_plus_outline('\ub1a4'),
cmd_movie_remove('\ub1a7'),
cmd_movie_remove_outline('\ub1a6'),
cmd_movie_roll('\ub1a8'),
cmd_movie_search('\ub1aa'),
cmd_movie_search_outline('\ub1a9'),
cmd_movie_settings('\ub1ac'),
cmd_movie_settings_outline('\ub1ab'),
cmd_movie_star('\ub1ae'),
cmd_movie_star_outline('\ub1ad'),
cmd_mower('\ub1b3'),
cmd_mower_bag('\ub1b1'),
cmd_mower_bag_on('\ub1b0'),
cmd_mower_on('\ub1b2'),
cmd_muffin('\ub1b4'),
cmd_multicast('\ub1b5'),
cmd_multimedia('\ub1b6'),
cmd_multiplication('\ub1b8'),
cmd_multiplication_box('\ub1b7'),
cmd_mushroom('\ub1bc'),
cmd_mushroom_off('\ub1ba'),
cmd_mushroom_off_outline('\ub1b9'),
cmd_mushroom_outline('\ub1bb'),
cmd_music('\ub1e3'),
cmd_music_accidental_double_flat('\ub1bd'),
cmd_music_accidental_double_sharp('\ub1be'),
cmd_music_accidental_flat('\ub1bf'),
cmd_music_accidental_natural('\ub1c0'),
cmd_music_accidental_sharp('\ub1c1'),
cmd_music_box('\ub1c5'),
cmd_music_box_multiple('\ub1c3'),
cmd_music_box_multiple_outline('\ub1c2'),
cmd_music_box_outline('\ub1c4'),
cmd_music_circle('\ub1c7'),
cmd_music_circle_outline('\ub1c6'),
cmd_music_clef_alto('\ub1c8'),
cmd_music_clef_bass('\ub1c9'),
cmd_music_clef_treble('\ub1ca'),
cmd_music_note('\ub1dc'),
cmd_music_note_bluetooth('\ub1cc'),
cmd_music_note_bluetooth_off('\ub1cb'),
cmd_music_note_eighth('\ub1ce'),
cmd_music_note_eighth_dotted('\ub1cd'),
cmd_music_note_half('\ub1d0'),
cmd_music_note_half_dotted('\ub1cf'),
cmd_music_note_minus('\ub1d1'),
cmd_music_note_off('\ub1d3'),
cmd_music_note_off_outline('\ub1d2'),
cmd_music_note_outline('\ub1d4'),
cmd_music_note_plus('\ub1d5'),
cmd_music_note_quarter('\ub1d7'),
cmd_music_note_quarter_dotted('\ub1d6'),
cmd_music_note_sixteenth('\ub1d9'),
cmd_music_note_sixteenth_dotted('\ub1d8'),
cmd_music_note_whole('\ub1db'),
cmd_music_note_whole_dotted('\ub1da'),
cmd_music_off('\ub1dd'),
cmd_music_rest_eighth('\ub1de'),
cmd_music_rest_half('\ub1df'),
cmd_music_rest_quarter('\ub1e0'),
cmd_music_rest_sixteenth('\ub1e1'),
cmd_music_rest_whole('\ub1e2'),
cmd_mustache('\ub1e4'),
cmd_nail('\ub1e5'),
cmd_nas('\ub1e6'),
cmd_nativescript('\ub1e7'),
cmd_nature('\ub1e9'),
cmd_nature_people('\ub1e8'),
cmd_navigation('\ub1ed'),
cmd_navigation_outline('\ub1ea'),
cmd_navigation_variant('\ub1ec'),
cmd_navigation_variant_outline('\ub1eb'),
cmd_near_me('\ub1ee'),
cmd_necklace('\ub1ef'),
cmd_needle('\ub1f1'),
cmd_needle_off('\ub1f0'),
cmd_netflix('\ub1f2'),
cmd_network('\ub203'),
cmd_network_off('\ub1f4'),
cmd_network_off_outline('\ub1f3'),
cmd_network_outline('\ub1f5'),
cmd_network_pos('\ub1f6'),
cmd_network_strength_1('\ub1f8'),
cmd_network_strength_1_alert('\ub1f7'),
cmd_network_strength_2('\ub1fa'),
cmd_network_strength_2_alert('\ub1f9'),
cmd_network_strength_3('\ub1fc'),
cmd_network_strength_3_alert('\ub1fb'),
cmd_network_strength_4('\ub1ff'),
cmd_network_strength_4_alert('\ub1fd'),
cmd_network_strength_4_cog('\ub1fe'),
cmd_network_strength_off('\ub201'),
cmd_network_strength_off_outline('\ub200'),
cmd_network_strength_outline('\ub202'),
cmd_new_box('\ub204'),
cmd_newspaper('\ub20d'),
cmd_newspaper_check('\ub205'),
cmd_newspaper_minus('\ub206'),
cmd_newspaper_plus('\ub207'),
cmd_newspaper_remove('\ub208'),
cmd_newspaper_variant('\ub20c'),
cmd_newspaper_variant_multiple('\ub20a'),
cmd_newspaper_variant_multiple_outline('\ub209'),
cmd_newspaper_variant_outline('\ub20b'),
cmd_nfc('\ub212'),
cmd_nfc_search_variant('\ub20e'),
cmd_nfc_tap('\ub20f'),
cmd_nfc_variant('\ub211'),
cmd_nfc_variant_off('\ub210'),
cmd_ninja('\ub213'),
cmd_nintendo_game_boy('\ub214'),
cmd_nintendo_switch('\ub215'),
cmd_nintendo_wii('\ub216'),
cmd_nintendo_wiiu('\ub217'),
cmd_nix('\ub218'),
cmd_nodejs('\ub219'),
cmd_noodles('\ub21a'),
cmd_not_equal('\ub21c'),
cmd_not_equal_variant('\ub21b'),
cmd_note('\ub232'),
cmd_note_alert('\ub21e'),
cmd_note_alert_outline('\ub21d'),
cmd_note_check('\ub220'),
cmd_note_check_outline('\ub21f'),
cmd_note_edit('\ub222'),
cmd_note_edit_outline('\ub221'),
cmd_note_minus('\ub224'),
cmd_note_minus_outline('\ub223'),
cmd_note_multiple('\ub226'),
cmd_note_multiple_outline('\ub225'),
cmd_note_off('\ub228'),
cmd_note_off_outline('\ub227'),
cmd_note_outline('\ub229'),
cmd_note_plus('\ub22b'),
cmd_note_plus_outline('\ub22a'),
cmd_note_remove('\ub22d'),
cmd_note_remove_outline('\ub22c'),
cmd_note_search('\ub22f'),
cmd_note_search_outline('\ub22e'),
cmd_note_text('\ub231'),
cmd_note_text_outline('\ub230'),
cmd_notebook('\ub241'),
cmd_notebook_check('\ub234'),
cmd_notebook_check_outline('\ub233'),
cmd_notebook_edit('\ub236'),
cmd_notebook_edit_outline('\ub235'),
cmd_notebook_heart('\ub238'),
cmd_notebook_heart_outline('\ub237'),
cmd_notebook_minus('\ub23a'),
cmd_notebook_minus_outline('\ub239'),
cmd_notebook_multiple('\ub23b'),
cmd_notebook_outline('\ub23c'),
cmd_notebook_plus('\ub23e'),
cmd_notebook_plus_outline('\ub23d'),
cmd_notebook_remove('\ub240'),
cmd_notebook_remove_outline('\ub23f'),
cmd_notification_clear_all('\ub242'),
cmd_npm('\ub243'),
cmd_nuke('\ub244'),
cmd_null('\ub245'),
cmd_numeric('\ub29d'),
cmd_numeric_0('\ub24c'),
cmd_numeric_0_box('\ub249'),
cmd_numeric_0_box_multiple('\ub247'),
cmd_numeric_0_box_multiple_outline('\ub246'),
cmd_numeric_0_box_outline('\ub248'),
cmd_numeric_0_circle('\ub24b'),
cmd_numeric_0_circle_outline('\ub24a'),
cmd_numeric_1('\ub253'),
cmd_numeric_10('\ub299'),
cmd_numeric_10_box('\ub296'),
cmd_numeric_10_box_multiple('\ub294'),
cmd_numeric_10_box_multiple_outline('\ub293'),
cmd_numeric_10_box_outline('\ub295'),
cmd_numeric_10_circle('\ub298'),
cmd_numeric_10_circle_outline('\ub297'),
cmd_numeric_1_box('\ub250'),
cmd_numeric_1_box_multiple('\ub24e'),
cmd_numeric_1_box_multiple_outline('\ub24d'),
cmd_numeric_1_box_outline('\ub24f'),
cmd_numeric_1_circle('\ub252'),
cmd_numeric_1_circle_outline('\ub251'),
cmd_numeric_2('\ub25a'),
cmd_numeric_2_box('\ub257'),
cmd_numeric_2_box_multiple('\ub255'),
cmd_numeric_2_box_multiple_outline('\ub254'),
cmd_numeric_2_box_outline('\ub256'),
cmd_numeric_2_circle('\ub259'),
cmd_numeric_2_circle_outline('\ub258'),
cmd_numeric_3('\ub261'),
cmd_numeric_3_box('\ub25e'),
cmd_numeric_3_box_multiple('\ub25c'),
cmd_numeric_3_box_multiple_outline('\ub25b'),
cmd_numeric_3_box_outline('\ub25d'),
cmd_numeric_3_circle('\ub260'),
cmd_numeric_3_circle_outline('\ub25f'),
cmd_numeric_4('\ub268'),
cmd_numeric_4_box('\ub265'),
cmd_numeric_4_box_multiple('\ub263'),
cmd_numeric_4_box_multiple_outline('\ub262'),
cmd_numeric_4_box_outline('\ub264'),
cmd_numeric_4_circle('\ub267'),
cmd_numeric_4_circle_outline('\ub266'),
cmd_numeric_5('\ub26f'),
cmd_numeric_5_box('\ub26c'),
cmd_numeric_5_box_multiple('\ub26a'),
cmd_numeric_5_box_multiple_outline('\ub269'),
cmd_numeric_5_box_outline('\ub26b'),
cmd_numeric_5_circle('\ub26e'),
cmd_numeric_5_circle_outline('\ub26d'),
cmd_numeric_6('\ub276'),
cmd_numeric_6_box('\ub273'),
cmd_numeric_6_box_multiple('\ub271'),
cmd_numeric_6_box_multiple_outline('\ub270'),
cmd_numeric_6_box_outline('\ub272'),
cmd_numeric_6_circle('\ub275'),
cmd_numeric_6_circle_outline('\ub274'),
cmd_numeric_7('\ub27d'),
cmd_numeric_7_box('\ub27a'),
cmd_numeric_7_box_multiple('\ub278'),
cmd_numeric_7_box_multiple_outline('\ub277'),
cmd_numeric_7_box_outline('\ub279'),
cmd_numeric_7_circle('\ub27c'),
cmd_numeric_7_circle_outline('\ub27b'),
cmd_numeric_8('\ub284'),
cmd_numeric_8_box('\ub281'),
cmd_numeric_8_box_multiple('\ub27f'),
cmd_numeric_8_box_multiple_outline('\ub27e'),
cmd_numeric_8_box_outline('\ub280'),
cmd_numeric_8_circle('\ub283'),
cmd_numeric_8_circle_outline('\ub282'),
cmd_numeric_9('\ub292'),
cmd_numeric_9_box('\ub288'),
cmd_numeric_9_box_multiple('\ub286'),
cmd_numeric_9_box_multiple_outline('\ub285'),
cmd_numeric_9_box_outline('\ub287'),
cmd_numeric_9_circle('\ub28a'),
cmd_numeric_9_circle_outline('\ub289'),
cmd_numeric_9_plus('\ub291'),
cmd_numeric_9_plus_box('\ub28e'),
cmd_numeric_9_plus_box_multiple('\ub28c'),
cmd_numeric_9_plus_box_multiple_outline('\ub28b'),
cmd_numeric_9_plus_box_outline('\ub28d'),
cmd_numeric_9_plus_circle('\ub290'),
cmd_numeric_9_plus_circle_outline('\ub28f'),
cmd_numeric_negative_1('\ub29a'),
cmd_numeric_off('\ub29b'),
cmd_numeric_positive_1('\ub29c'),
cmd_nut('\ub29e'),
cmd_nutrition('\ub29f'),
cmd_nuxt('\ub2a0'),
cmd_oar('\ub2a1'),
cmd_ocarina('\ub2a2'),
cmd_oci('\ub2a3'),
cmd_ocr('\ub2a4'),
cmd_octagon('\ub2a6'),
cmd_octagon_outline('\ub2a5'),
cmd_octagram('\ub2a8'),
cmd_octagram_outline('\ub2a7'),
cmd_octahedron('\ub2aa'),
cmd_octahedron_off('\ub2a9'),
cmd_odnoklassniki('\ub2ab'),
cmd_offer('\ub2ac'),
cmd_office_building('\ub2b8'),
cmd_office_building_cog('\ub2ae'),
cmd_office_building_cog_outline('\ub2ad'),
cmd_office_building_marker('\ub2b0'),
cmd_office_building_marker_outline('\ub2af'),
cmd_office_building_minus('\ub2b2'),
cmd_office_building_minus_outline('\ub2b1'),
cmd_office_building_outline('\ub2b3'),
cmd_office_building_plus('\ub2b5'),
cmd_office_building_plus_outline('\ub2b4'),
cmd_office_building_remove('\ub2b7'),
cmd_office_building_remove_outline('\ub2b6'),
cmd_oil('\ub2bc'),
cmd_oil_lamp('\ub2b9'),
cmd_oil_level('\ub2ba'),
cmd_oil_temperature('\ub2bb'),
cmd_om('\ub2bd'),
cmd_omega('\ub2be'),
cmd_one_up('\ub2bf'),
cmd_onepassword('\ub2c0'),
cmd_opacity('\ub2c1'),
cmd_open_in_app('\ub2c2'),
cmd_open_in_new('\ub2c3'),
cmd_open_source_initiative('\ub2c4'),
cmd_openid('\ub2c5'),
cmd_opera('\ub2c6'),
cmd_orbit('\ub2c8'),
cmd_orbit_variant('\ub2c7'),
cmd_order_alphabetical_ascending('\ub2c9'),
cmd_order_alphabetical_descending('\ub2ca'),
cmd_order_bool_ascending('\ub2cc'),
cmd_order_bool_ascending_variant('\ub2cb'),
cmd_order_bool_descending('\ub2ce'),
cmd_order_bool_descending_variant('\ub2cd'),
cmd_order_numeric_ascending('\ub2cf'),
cmd_order_numeric_descending('\ub2d0'),
cmd_origin('\ub2d1'),
cmd_ornament('\ub2d3'),
cmd_ornament_variant('\ub2d2'),
cmd_outdoor_lamp('\ub2d4'),
cmd_overscan('\ub2d5'),
cmd_owl('\ub2d6'),
cmd_pac_man('\ub2d7'),
cmd_package('\ub2e4'),
cmd_package_check('\ub2d8'),
cmd_package_down('\ub2d9'),
cmd_package_up('\ub2da'),
cmd_package_variant('\ub2e3'),
cmd_package_variant_closed('\ub2df'),
cmd_package_variant_closed_check('\ub2db'),
cmd_package_variant_closed_minus('\ub2dc'),
cmd_package_variant_closed_plus('\ub2dd'),
cmd_package_variant_closed_remove('\ub2de'),
cmd_package_variant_minus('\ub2e0'),
cmd_package_variant_plus('\ub2e1'),
cmd_package_variant_remove('\ub2e2'),
cmd_page_first('\ub2e5'),
cmd_page_last('\ub2e6'),
cmd_page_layout_body('\ub2e7'),
cmd_page_layout_footer('\ub2e8'),
cmd_page_layout_header('\ub2ea'),
cmd_page_layout_header_footer('\ub2e9'),
cmd_page_layout_sidebar_left('\ub2eb'),
cmd_page_layout_sidebar_right('\ub2ec'),
cmd_page_next('\ub2ee'),
cmd_page_next_outline('\ub2ed'),
cmd_page_previous('\ub2f0'),
cmd_page_previous_outline('\ub2ef'),
cmd_pail('\ub2fa'),
cmd_pail_minus('\ub2f2'),
cmd_pail_minus_outline('\ub2f1'),
cmd_pail_off('\ub2f4'),
cmd_pail_off_outline('\ub2f3'),
cmd_pail_outline('\ub2f5'),
cmd_pail_plus('\ub2f7'),
cmd_pail_plus_outline('\ub2f6'),
cmd_pail_remove('\ub2f9'),
cmd_pail_remove_outline('\ub2f8'),
cmd_palette('\ub300'),
cmd_palette_advanced('\ub2fb'),
cmd_palette_outline('\ub2fc'),
cmd_palette_swatch('\ub2ff'),
cmd_palette_swatch_outline('\ub2fd'),
cmd_palette_swatch_variant('\ub2fe'),
cmd_palm_tree('\ub301'),
cmd_pan('\ub30c'),
cmd_pan_bottom_left('\ub302'),
cmd_pan_bottom_right('\ub303'),
cmd_pan_down('\ub304'),
cmd_pan_horizontal('\ub305'),
cmd_pan_left('\ub306'),
cmd_pan_right('\ub307'),
cmd_pan_top_left('\ub308'),
cmd_pan_top_right('\ub309'),
cmd_pan_up('\ub30a'),
cmd_pan_vertical('\ub30b'),
cmd_panda('\ub30d'),
cmd_pandora('\ub30e'),
cmd_panorama('\ub31b'),
cmd_panorama_fisheye('\ub30f'),
cmd_panorama_horizontal('\ub311'),
cmd_panorama_horizontal_outline('\ub310'),
cmd_panorama_outline('\ub312'),
cmd_panorama_sphere('\ub314'),
cmd_panorama_sphere_outline('\ub313'),
cmd_panorama_variant('\ub316'),
cmd_panorama_variant_outline('\ub315'),
cmd_panorama_vertical('\ub318'),
cmd_panorama_vertical_outline('\ub317'),
cmd_panorama_wide_angle('\ub31a'),
cmd_panorama_wide_angle_outline('\ub319'),
cmd_paper_cut_vertical('\ub31c'),
cmd_paper_roll('\ub31e'),
cmd_paper_roll_outline('\ub31d'),
cmd_paperclip('\ub325'),
cmd_paperclip_check('\ub31f'),
cmd_paperclip_lock('\ub320'),
cmd_paperclip_minus('\ub321'),
cmd_paperclip_off('\ub322'),
cmd_paperclip_plus('\ub323'),
cmd_paperclip_remove('\ub324'),
cmd_parachute('\ub327'),
cmd_parachute_outline('\ub326'),
cmd_paragliding('\ub328'),
cmd_parking('\ub329'),
cmd_party_popper('\ub32a'),
cmd_passport('\ub32c'),
cmd_passport_biometric('\ub32b'),
cmd_pasta('\ub32d'),
cmd_patio_heater('\ub32e'),
cmd_patreon('\ub32f'),
cmd_pause('\ub336'),
cmd_pause_box('\ub331'),
cmd_pause_box_outline('\ub330'),
cmd_pause_circle('\ub333'),
cmd_pause_circle_outline('\ub332'),
cmd_pause_octagon('\ub335'),
cmd_pause_octagon_outline('\ub334'),
cmd_paw('\ub33a'),
cmd_paw_off('\ub338'),
cmd_paw_off_outline('\ub337'),
cmd_paw_outline('\ub339'),
cmd_peace('\ub33b'),
cmd_peanut('\ub33f'),
cmd_peanut_off('\ub33d'),
cmd_peanut_off_outline('\ub33c'),
cmd_peanut_outline('\ub33e'),
cmd_pen('\ub345'),
cmd_pen_lock('\ub340'),
cmd_pen_minus('\ub341'),
cmd_pen_off('\ub342'),
cmd_pen_plus('\ub343'),
cmd_pen_remove('\ub344'),
cmd_pencil('\ub358'),
cmd_pencil_box('\ub349'),
cmd_pencil_box_multiple('\ub347'),
cmd_pencil_box_multiple_outline('\ub346'),
cmd_pencil_box_outline('\ub348'),
cmd_pencil_circle('\ub34b'),
cmd_pencil_circle_outline('\ub34a'),
cmd_pencil_lock('\ub34d'),
cmd_pencil_lock_outline('\ub34c'),
cmd_pencil_minus('\ub34f'),
cmd_pencil_minus_outline('\ub34e'),
cmd_pencil_off('\ub351'),
cmd_pencil_off_outline('\ub350'),
cmd_pencil_outline('\ub352'),
cmd_pencil_plus('\ub354'),
cmd_pencil_plus_outline('\ub353'),
cmd_pencil_remove('\ub356'),
cmd_pencil_remove_outline('\ub355'),
cmd_pencil_ruler('\ub357'),
cmd_penguin('\ub359'),
cmd_pentagon('\ub35b'),
cmd_pentagon_outline('\ub35a'),
cmd_pentagram('\ub35c'),
cmd_percent('\ub362'),
cmd_percent_box('\ub35e'),
cmd_percent_box_outline('\ub35d'),
cmd_percent_circle('\ub360'),
cmd_percent_circle_outline('\ub35f'),
cmd_percent_outline('\ub361'),
cmd_periodic_table('\ub363'),
cmd_perspective_less('\ub364'),
cmd_perspective_more('\ub365'),
cmd_ph('\ub366'),
cmd_phone('\ub3a0'),
cmd_phone_alert('\ub368'),
cmd_phone_alert_outline('\ub367'),
cmd_phone_bluetooth('\ub36a'),
cmd_phone_bluetooth_outline('\ub369'),
cmd_phone_cancel('\ub36c'),
cmd_phone_cancel_outline('\ub36b'),
cmd_phone_check('\ub36e'),
cmd_phone_check_outline('\ub36d'),
cmd_phone_classic('\ub370'),
cmd_phone_classic_off('\ub36f'),
cmd_phone_clock('\ub371'),
cmd_phone_dial('\ub373'),
cmd_phone_dial_outline('\ub372'),
cmd_phone_forward('\ub375'),
cmd_phone_forward_outline('\ub374'),
cmd_phone_hangup('\ub377'),
cmd_phone_hangup_outline('\ub376'),
cmd_phone_in_talk('\ub379'),
cmd_phone_in_talk_outline('\ub378'),
cmd_phone_incoming('\ub37d'),
cmd_phone_incoming_outgoing('\ub37b'),
cmd_phone_incoming_outgoing_outline('\ub37a'),
cmd_phone_incoming_outline('\ub37c'),
cmd_phone_lock('\ub37f'),
cmd_phone_lock_outline('\ub37e'),
cmd_phone_log('\ub381'),
cmd_phone_log_outline('\ub380'),
cmd_phone_message('\ub383'),
cmd_phone_message_outline('\ub382'),
cmd_phone_minus('\ub385'),
cmd_phone_minus_outline('\ub384'),
cmd_phone_missed('\ub387'),
cmd_phone_missed_outline('\ub386'),
cmd_phone_off('\ub389'),
cmd_phone_off_outline('\ub388'),
cmd_phone_outgoing('\ub38b'),
cmd_phone_outgoing_outline('\ub38a'),
cmd_phone_outline('\ub38c'),
cmd_phone_paused('\ub38e'),
cmd_phone_paused_outline('\ub38d'),
cmd_phone_plus('\ub390'),
cmd_phone_plus_outline('\ub38f'),
cmd_phone_refresh('\ub392'),
cmd_phone_refresh_outline('\ub391'),
cmd_phone_remove('\ub394'),
cmd_phone_remove_outline('\ub393'),
cmd_phone_return('\ub396'),
cmd_phone_return_outline('\ub395'),
cmd_phone_ring('\ub398'),
cmd_phone_ring_outline('\ub397'),
cmd_phone_rotate_landscape('\ub399'),
cmd_phone_rotate_portrait('\ub39a'),
cmd_phone_settings('\ub39c'),
cmd_phone_settings_outline('\ub39b'),
cmd_phone_sync('\ub39e'),
cmd_phone_sync_outline('\ub39d'),
cmd_phone_voip('\ub39f'),
cmd_pi('\ub3a3'),
cmd_pi_box('\ub3a1'),
cmd_pi_hole('\ub3a2'),
cmd_piano('\ub3a5'),
cmd_piano_off('\ub3a4'),
cmd_pickaxe('\ub3a6'),
cmd_picture_in_picture_bottom_right('\ub3a8'),
cmd_picture_in_picture_bottom_right_outline('\ub3a7'),
cmd_picture_in_picture_top_right('\ub3aa'),
cmd_picture_in_picture_top_right_outline('\ub3a9'),
cmd_pier('\ub3ac'),
cmd_pier_crane('\ub3ab'),
cmd_pig('\ub3af'),
cmd_pig_variant('\ub3ae'),
cmd_pig_variant_outline('\ub3ad'),
cmd_piggy_bank('\ub3b1'),
cmd_piggy_bank_outline('\ub3b0'),
cmd_pill('\ub3b4'),
cmd_pill_multiple('\ub3b2'),
cmd_pill_off('\ub3b3'),
cmd_pillar('\ub3b5'),
cmd_pin('\ub3b9'),
cmd_pin_off('\ub3b7'),
cmd_pin_off_outline('\ub3b6'),
cmd_pin_outline('\ub3b8'),
cmd_pine_tree('\ub3bc'),
cmd_pine_tree_box('\ub3ba'),
cmd_pine_tree_fire('\ub3bb'),
cmd_pinterest('\ub3bd'),
cmd_pinwheel('\ub3bf'),
cmd_pinwheel_outline('\ub3be'),
cmd_pipe('\ub3c4'),
cmd_pipe_disconnected('\ub3c0'),
cmd_pipe_leak('\ub3c1'),
cmd_pipe_valve('\ub3c2'),
cmd_pipe_wrench('\ub3c3'),
cmd_pirate('\ub3c5'),
cmd_pistol('\ub3c6'),
cmd_piston('\ub3c7'),
cmd_pitchfork('\ub3c8'),
cmd_pizza('\ub3c9'),
cmd_plane_car('\ub3ca'),
cmd_plane_train('\ub3cb'),
cmd_play('\ub3dc'),
cmd_play_box('\ub3d3'),
cmd_play_box_lock('\ub3cf'),
cmd_play_box_lock_open('\ub3cd'),
cmd_play_box_lock_open_outline('\ub3cc'),
cmd_play_box_lock_outline('\ub3ce'),
cmd_play_box_multiple('\ub3d1'),
cmd_play_box_multiple_outline('\ub3d0'),
cmd_play_box_outline('\ub3d2'),
cmd_play_circle('\ub3d5'),
cmd_play_circle_outline('\ub3d4'),
cmd_play_network('\ub3d7'),
cmd_play_network_outline('\ub3d6'),
cmd_play_outline('\ub3d8'),
cmd_play_pause('\ub3d9'),
cmd_play_protected_content('\ub3da'),
cmd_play_speed('\ub3db'),
cmd_playlist_check('\ub3dd'),
cmd_playlist_edit('\ub3de'),
cmd_playlist_minus('\ub3df'),
cmd_playlist_music('\ub3e1'),
cmd_playlist_music_outline('\ub3e0'),
cmd_playlist_play('\ub3e2'),
cmd_playlist_plus('\ub3e3'),
cmd_playlist_remove('\ub3e4'),
cmd_playlist_star('\ub3e5'),
cmd_plex('\ub3e6'),
cmd_pliers('\ub3e7'),
cmd_plus('\ub3f9'),
cmd_plus_box('\ub3eb'),
cmd_plus_box_multiple('\ub3e9'),
cmd_plus_box_multiple_outline('\ub3e8'),
cmd_plus_box_outline('\ub3ea'),
cmd_plus_circle('\ub3ef'),
cmd_plus_circle_multiple('\ub3ed'),
cmd_plus_circle_multiple_outline('\ub3ec'),
cmd_plus_circle_outline('\ub3ee'),
cmd_plus_lock('\ub3f1'),
cmd_plus_lock_open('\ub3f0'),
cmd_plus_minus('\ub3f4'),
cmd_plus_minus_box('\ub3f2'),
cmd_plus_minus_variant('\ub3f3'),
cmd_plus_network('\ub3f6'),
cmd_plus_network_outline('\ub3f5'),
cmd_plus_outline('\ub3f7'),
cmd_plus_thick('\ub3f8'),
cmd_podcast('\ub3fa'),
cmd_podium('\ub3fe'),
cmd_podium_bronze('\ub3fb'),
cmd_podium_gold('\ub3fc'),
cmd_podium_silver('\ub3fd'),
cmd_point_of_sale('\ub3ff'),
cmd_pokeball('\ub400'),
cmd_pokemon_go('\ub401'),
cmd_poker_chip('\ub402'),
cmd_polaroid('\ub403'),
cmd_police_badge('\ub405'),
cmd_police_badge_outline('\ub404'),
cmd_police_station('\ub406'),
cmd_poll('\ub407'),
cmd_polo('\ub408'),
cmd_polymer('\ub409'),
cmd_pool('\ub40b'),
cmd_pool_thermometer('\ub40a'),
cmd_popcorn('\ub40c'),
cmd_post('\ub40f'),
cmd_post_lamp('\ub40d'),
cmd_post_outline('\ub40e'),
cmd_postage_stamp('\ub410'),
cmd_pot('\ub416'),
cmd_pot_mix('\ub412'),
cmd_pot_mix_outline('\ub411'),
cmd_pot_outline('\ub413'),
cmd_pot_steam('\ub415'),
cmd_pot_steam_outline('\ub414'),
cmd_pound('\ub419'),
cmd_pound_box('\ub418'),
cmd_pound_box_outline('\ub417'),
cmd_power('\ub42e'),
cmd_power_cycle('\ub41a'),
cmd_power_off('\ub41b'),
cmd_power_on('\ub41c'),
cmd_power_plug('\ub420'),
cmd_power_plug_off('\ub41e'),
cmd_power_plug_off_outline('\ub41d'),
cmd_power_plug_outline('\ub41f'),
cmd_power_settings('\ub421'),
cmd_power_sleep('\ub422'),
cmd_power_socket('\ub42c'),
cmd_power_socket_au('\ub423'),
cmd_power_socket_ch('\ub424'),
cmd_power_socket_de('\ub425'),
cmd_power_socket_eu('\ub426'),
cmd_power_socket_fr('\ub427'),
cmd_power_socket_it('\ub428'),
cmd_power_socket_jp('\ub429'),
cmd_power_socket_uk('\ub42a'),
cmd_power_socket_us('\ub42b'),
cmd_power_standby('\ub42d'),
cmd_powershell('\ub42f'),
cmd_prescription('\ub430'),
cmd_presentation('\ub432'),
cmd_presentation_play('\ub431'),
cmd_pretzel('\ub433'),
cmd_printer('\ub46b'),
cmd_printer_3d('\ub43d'),
cmd_printer_3d_nozzle('\ub43b'),
cmd_printer_3d_nozzle_alert('\ub435'),
cmd_printer_3d_nozzle_alert_outline('\ub434'),
cmd_printer_3d_nozzle_heat('\ub437'),
cmd_printer_3d_nozzle_heat_outline('\ub436'),
cmd_printer_3d_nozzle_off('\ub439'),
cmd_printer_3d_nozzle_off_outline('\ub438'),
cmd_printer_3d_nozzle_outline('\ub43a'),
cmd_printer_3d_off('\ub43c'),
cmd_printer_alert('\ub43e'),
cmd_printer_check('\ub43f'),
cmd_printer_eye('\ub440'),
cmd_printer_off('\ub442'),
cmd_printer_off_outline('\ub441'),
cmd_printer_outline('\ub443'),
cmd_printer_pos('\ub467'),
cmd_printer_pos_alert('\ub445'),
cmd_printer_pos_alert_outline('\ub444'),
cmd_printer_pos_cancel('\ub447'),
cmd_printer_pos_cancel_outline('\ub446'),
cmd_printer_pos_check('\ub449'),
cmd_printer_pos_check_outline('\ub448'),
cmd_printer_pos_cog('\ub44b'),
cmd_printer_pos_cog_outline('\ub44a'),
cmd_printer_pos_edit('\ub44d'),
cmd_printer_pos_edit_outline('\ub44c'),
cmd_printer_pos_minus('\ub44f'),
cmd_printer_pos_minus_outline('\ub44e'),
cmd_printer_pos_network('\ub451'),
cmd_printer_pos_network_outline('\ub450'),
cmd_printer_pos_off('\ub453'),
cmd_printer_pos_off_outline('\ub452'),
cmd_printer_pos_outline('\ub454'),
cmd_printer_pos_pause('\ub456'),
cmd_printer_pos_pause_outline('\ub455'),
cmd_printer_pos_play('\ub458'),
cmd_printer_pos_play_outline('\ub457'),
cmd_printer_pos_plus('\ub45a'),
cmd_printer_pos_plus_outline('\ub459'),
cmd_printer_pos_refresh('\ub45c'),
cmd_printer_pos_refresh_outline('\ub45b'),
cmd_printer_pos_remove('\ub45e'),
cmd_printer_pos_remove_outline('\ub45d'),
cmd_printer_pos_star('\ub460'),
cmd_printer_pos_star_outline('\ub45f'),
cmd_printer_pos_stop('\ub462'),
cmd_printer_pos_stop_outline('\ub461'),
cmd_printer_pos_sync('\ub464'),
cmd_printer_pos_sync_outline('\ub463'),
cmd_printer_pos_wrench('\ub466'),
cmd_printer_pos_wrench_outline('\ub465'),
cmd_printer_search('\ub468'),
cmd_printer_settings('\ub469'),
cmd_printer_wireless('\ub46a'),
cmd_priority_high('\ub46c'),
cmd_priority_low('\ub46d'),
cmd_professional_hexagon('\ub46e'),
cmd_progress_alert('\ub46f'),
cmd_progress_check('\ub470'),
cmd_progress_clock('\ub471'),
cmd_progress_close('\ub472'),
cmd_progress_download('\ub473'),
cmd_progress_helper('\ub474'),
cmd_progress_pencil('\ub475'),
cmd_progress_question('\ub476'),
cmd_progress_star('\ub477'),
cmd_progress_upload('\ub478'),
cmd_progress_wrench('\ub479'),
cmd_projector('\ub483'),
cmd_projector_off('\ub47a'),
cmd_projector_screen('\ub482'),
cmd_projector_screen_off('\ub47c'),
cmd_projector_screen_off_outline('\ub47b'),
cmd_projector_screen_outline('\ub47d'),
cmd_projector_screen_variant('\ub481'),
cmd_projector_screen_variant_off('\ub47f'),
cmd_projector_screen_variant_off_outline('\ub47e'),
cmd_projector_screen_variant_outline('\ub480'),
cmd_propane_tank('\ub485'),
cmd_propane_tank_outline('\ub484'),
cmd_protocol('\ub486'),
cmd_publish('\ub488'),
cmd_publish_off('\ub487'),
cmd_pulse('\ub489'),
cmd_pump('\ub48b'),
cmd_pump_off('\ub48a'),
cmd_pumpkin('\ub48c'),
cmd_purse('\ub48e'),
cmd_purse_outline('\ub48d'),
cmd_puzzle('\ub49e'),
cmd_puzzle_check('\ub490'),
cmd_puzzle_check_outline('\ub48f'),
cmd_puzzle_edit('\ub492'),
cmd_puzzle_edit_outline('\ub491'),
cmd_puzzle_heart('\ub494'),
cmd_puzzle_heart_outline('\ub493'),
cmd_puzzle_minus('\ub496'),
cmd_puzzle_minus_outline('\ub495'),
cmd_puzzle_outline('\ub497'),
cmd_puzzle_plus('\ub499'),
cmd_puzzle_plus_outline('\ub498'),
cmd_puzzle_remove('\ub49b'),
cmd_puzzle_remove_outline('\ub49a'),
cmd_puzzle_star('\ub49d'),
cmd_puzzle_star_outline('\ub49c'),
cmd_pyramid('\ub4a0'),
cmd_pyramid_off('\ub49f'),
cmd_qi('\ub4a1'),
cmd_qqchat('\ub4a2'),
cmd_qrcode('\ub4a8'),
cmd_qrcode_edit('\ub4a3'),
cmd_qrcode_minus('\ub4a4'),
cmd_qrcode_plus('\ub4a5'),
cmd_qrcode_remove('\ub4a6'),
cmd_qrcode_scan('\ub4a7'),
cmd_quadcopter('\ub4a9'),
cmd_quality_high('\ub4aa'),
cmd_quality_low('\ub4ab'),
cmd_quality_medium('\ub4ac'),
cmd_quora('\ub4ad'),
cmd_rabbit('\ub4b0'),
cmd_rabbit_variant('\ub4af'),
cmd_rabbit_variant_outline('\ub4ae'),
cmd_racing_helmet('\ub4b1'),
cmd_racquetball('\ub4b2'),
cmd_radar('\ub4b3'),
cmd_radiator('\ub4b6'),
cmd_radiator_disabled('\ub4b4'),
cmd_radiator_off('\ub4b5'),
cmd_radio('\ub4bc'),
cmd_radio_am('\ub4b7'),
cmd_radio_fm('\ub4b8'),
cmd_radio_handheld('\ub4b9'),
cmd_radio_off('\ub4ba'),
cmd_radio_tower('\ub4bb'),
cmd_radioactive('\ub4c0'),
cmd_radioactive_circle('\ub4be'),
cmd_radioactive_circle_outline('\ub4bd'),
cmd_radioactive_off('\ub4bf'),
cmd_radiobox_blank('\ub4c1'),
cmd_radiobox_marked('\ub4c2'),
cmd_radiology_box('\ub4c4'),
cmd_radiology_box_outline('\ub4c3'),
cmd_radius('\ub4c6'),
cmd_radius_outline('\ub4c5'),
cmd_railroad_light('\ub4c7'),
cmd_rake('\ub4c8'),
cmd_raspberry_pi('\ub4c9'),
cmd_raw('\ub4cb'),
cmd_raw_off('\ub4ca'),
cmd_ray_end('\ub4cd'),
cmd_ray_end_arrow('\ub4cc'),
cmd_ray_start('\ub4d1'),
cmd_ray_start_arrow('\ub4ce'),
cmd_ray_start_end('\ub4cf'),
cmd_ray_start_vertex_end('\ub4d0'),
cmd_ray_vertex('\ub4d2'),
cmd_razor_double_edge('\ub4d3'),
cmd_razor_single_edge('\ub4d4'),
cmd_react('\ub4d5'),
cmd_read('\ub4d6'),
cmd_receipt('\ub4e2'),
cmd_receipt_outline('\ub4d7'),
cmd_receipt_text('\ub4e1'),
cmd_receipt_text_check('\ub4d9'),
cmd_receipt_text_check_outline('\ub4d8'),
cmd_receipt_text_minus('\ub4db'),
cmd_receipt_text_minus_outline('\ub4da'),
cmd_receipt_text_outline('\ub4dc'),
cmd_receipt_text_plus('\ub4de'),
cmd_receipt_text_plus_outline('\ub4dd'),
cmd_receipt_text_remove('\ub4e0'),
cmd_receipt_text_remove_outline('\ub4df'),
cmd_record('\ub4e7'),
cmd_record_circle('\ub4e4'),
cmd_record_circle_outline('\ub4e3'),
cmd_record_player('\ub4e5'),
cmd_record_rec('\ub4e6'),
cmd_rectangle('\ub4e9'),
cmd_rectangle_outline('\ub4e8'),
cmd_recycle('\ub4eb'),
cmd_recycle_variant('\ub4ea'),
cmd_reddit('\ub4ec'),
cmd_redhat('\ub4ed'),
cmd_redo('\ub4ef'),
cmd_redo_variant('\ub4ee'),
cmd_reflect_horizontal('\ub4f0'),
cmd_reflect_vertical('\ub4f1'),
cmd_refresh('\ub4f4'),
cmd_refresh_auto('\ub4f2'),
cmd_refresh_circle('\ub4f3'),
cmd_regex('\ub4f5'),
cmd_registered_trademark('\ub4f6'),
cmd_reiterate('\ub4f7'),
cmd_relation_many_to_many('\ub4f8'),
cmd_relation_many_to_one('\ub4fa'),
cmd_relation_many_to_one_or_many('\ub4f9'),
cmd_relation_many_to_only_one('\ub4fb'),
cmd_relation_many_to_zero_or_many('\ub4fc'),
cmd_relation_many_to_zero_or_one('\ub4fd'),
cmd_relation_one_or_many_to_many('\ub4fe'),
cmd_relation_one_or_many_to_one('\ub500'),
cmd_relation_one_or_many_to_one_or_many('\ub4ff'),
cmd_relation_one_or_many_to_only_one('\ub501'),
cmd_relation_one_or_many_to_zero_or_many('\ub502'),
cmd_relation_one_or_many_to_zero_or_one('\ub503'),
cmd_relation_one_to_many('\ub504'),
cmd_relation_one_to_one('\ub506'),
cmd_relation_one_to_one_or_many('\ub505'),
cmd_relation_one_to_only_one('\ub507'),
cmd_relation_one_to_zero_or_many('\ub508'),
cmd_relation_one_to_zero_or_one('\ub509'),
cmd_relation_only_one_to_many('\ub50a'),
cmd_relation_only_one_to_one('\ub50c'),
cmd_relation_only_one_to_one_or_many('\ub50b'),
cmd_relation_only_one_to_only_one('\ub50d'),
cmd_relation_only_one_to_zero_or_many('\ub50e'),
cmd_relation_only_one_to_zero_or_one('\ub50f'),
cmd_relation_zero_or_many_to_many('\ub510'),
cmd_relation_zero_or_many_to_one('\ub512'),
cmd_relation_zero_or_many_to_one_or_many('\ub511'),
cmd_relation_zero_or_many_to_only_one('\ub513'),
cmd_relation_zero_or_many_to_zero_or_many('\ub514'),
cmd_relation_zero_or_many_to_zero_or_one('\ub515'),
cmd_relation_zero_or_one_to_many('\ub516'),
cmd_relation_zero_or_one_to_one('\ub518'),
cmd_relation_zero_or_one_to_one_or_many('\ub517'),
cmd_relation_zero_or_one_to_only_one('\ub519'),
cmd_relation_zero_or_one_to_zero_or_many('\ub51a'),
cmd_relation_zero_or_one_to_zero_or_one('\ub51b'),
cmd_relative_scale('\ub51c'),
cmd_reload('\ub51e'),
cmd_reload_alert('\ub51d'),
cmd_reminder('\ub51f'),
cmd_remote('\ub524'),
cmd_remote_desktop('\ub520'),
cmd_remote_off('\ub521'),
cmd_remote_tv('\ub523'),
cmd_remote_tv_off('\ub522'),
cmd_rename_box('\ub525'),
cmd_reorder_horizontal('\ub526'),
cmd_reorder_vertical('\ub527'),
cmd_repeat('\ub52b'),
cmd_repeat_off('\ub528'),
cmd_repeat_once('\ub529'),
cmd_repeat_variant('\ub52a'),
cmd_replay('\ub52c'),
cmd_reply('\ub531'),
cmd_reply_all('\ub52e'),
cmd_reply_all_outline('\ub52d'),
cmd_reply_circle('\ub52f'),
cmd_reply_outline('\ub530'),
cmd_reproduction('\ub532'),
cmd_resistor('\ub534'),
cmd_resistor_nodes('\ub533'),
cmd_resize('\ub536'),
cmd_resize_bottom_right('\ub535'),
cmd_responsive('\ub537'),
cmd_restart('\ub53a'),
cmd_restart_alert('\ub538'),
cmd_restart_off('\ub539'),
cmd_restore('\ub53c'),
cmd_restore_alert('\ub53b'),
cmd_rewind('\ub544'),
cmd_rewind_10('\ub53e'),
cmd_rewind_15('\ub53f'),
cmd_rewind_30('\ub540'),
cmd_rewind_45('\ub541'),
cmd_rewind_5('\ub53d'),
cmd_rewind_60('\ub542'),
cmd_rewind_outline('\ub543'),
cmd_rhombus('\ub54a'),
cmd_rhombus_medium('\ub546'),
cmd_rhombus_medium_outline('\ub545'),
cmd_rhombus_outline('\ub547'),
cmd_rhombus_split('\ub549'),
cmd_rhombus_split_outline('\ub548'),
cmd_ribbon('\ub54b'),
cmd_rice('\ub54c'),
cmd_rickshaw('\ub54e'),
cmd_rickshaw_electric('\ub54d'),
cmd_ring('\ub54f'),
cmd_rivet('\ub550'),
cmd_road('\ub552'),
cmd_road_variant('\ub551'),
cmd_robber('\ub553'),
cmd_robot('\ub56b'),
cmd_robot_angry('\ub555'),
cmd_robot_angry_outline('\ub554'),
cmd_robot_confused('\ub557'),
cmd_robot_confused_outline('\ub556'),
cmd_robot_dead('\ub559'),
cmd_robot_dead_outline('\ub558'),
cmd_robot_excited('\ub55b'),
cmd_robot_excited_outline('\ub55a'),
cmd_robot_happy('\ub55d'),
cmd_robot_happy_outline('\ub55c'),
cmd_robot_industrial('\ub55f'),
cmd_robot_industrial_outline('\ub55e'),
cmd_robot_love('\ub561'),
cmd_robot_love_outline('\ub560'),
cmd_robot_mower('\ub563'),
cmd_robot_mower_outline('\ub562'),
cmd_robot_off('\ub565'),
cmd_robot_off_outline('\ub564'),
cmd_robot_outline('\ub566'),
cmd_robot_vacuum('\ub56a'),
cmd_robot_vacuum_alert('\ub567'),
cmd_robot_vacuum_variant('\ub569'),
cmd_robot_vacuum_variant_alert('\ub568'),
cmd_rocket('\ub56f'),
cmd_rocket_launch('\ub56d'),
cmd_rocket_launch_outline('\ub56c'),
cmd_rocket_outline('\ub56e'),
cmd_rodent('\ub570'),
cmd_roller_shade('\ub572'),
cmd_roller_shade_closed('\ub571'),
cmd_roller_skate('\ub574'),
cmd_roller_skate_off('\ub573'),
cmd_rollerblade('\ub576'),
cmd_rollerblade_off('\ub575'),
cmd_rollupjs('\ub577'),
cmd_rolodex('\ub579'),
cmd_rolodex_outline('\ub578'),
cmd_roman_numeral_1('\ub57a'),
cmd_roman_numeral_10('\ub583'),
cmd_roman_numeral_2('\ub57b'),
cmd_roman_numeral_3('\ub57c'),
cmd_roman_numeral_4('\ub57d'),
cmd_roman_numeral_5('\ub57e'),
cmd_roman_numeral_6('\ub57f'),
cmd_roman_numeral_7('\ub580'),
cmd_roman_numeral_8('\ub581'),
cmd_roman_numeral_9('\ub582'),
cmd_room_service('\ub585'),
cmd_room_service_outline('\ub584'),
cmd_rotate_360('\ub588'),
cmd_rotate_3d('\ub587'),
cmd_rotate_3d_variant('\ub586'),
cmd_rotate_left('\ub58a'),
cmd_rotate_left_variant('\ub589'),
cmd_rotate_orbit('\ub58b'),
cmd_rotate_right('\ub58d'),
cmd_rotate_right_variant('\ub58c'),
cmd_rounded_corner('\ub58e'),
cmd_router('\ub593'),
cmd_router_network('\ub58f'),
cmd_router_wireless('\ub592'),
cmd_router_wireless_off('\ub590'),
cmd_router_wireless_settings('\ub591'),
cmd_routes('\ub595'),
cmd_routes_clock('\ub594'),
cmd_rowing('\ub596'),
cmd_rss('\ub599'),
cmd_rss_box('\ub597'),
cmd_rss_off('\ub598'),
cmd_rug('\ub59a'),
cmd_rugby('\ub59b'),
cmd_ruler('\ub59e'),
cmd_ruler_square('\ub59d'),
cmd_ruler_square_compass('\ub59c'),
cmd_run('\ub5a0'),
cmd_run_fast('\ub59f'),
cmd_rv_truck('\ub5a1'),
cmd_sack('\ub5a3'),
cmd_sack_percent('\ub5a2'),
cmd_safe('\ub5a6'),
cmd_safe_square('\ub5a5'),
cmd_safe_square_outline('\ub5a4'),
cmd_safety_goggles('\ub5a7'),
cmd_sail_boat('\ub5a9'),
cmd_sail_boat_sink('\ub5a8'),
cmd_sale('\ub5ab'),
cmd_sale_outline('\ub5aa'),
cmd_salesforce('\ub5ac'),
cmd_sass('\ub5ad'),
cmd_satellite('\ub5b0'),
cmd_satellite_uplink('\ub5ae'),
cmd_satellite_variant('\ub5af'),
cmd_sausage('\ub5b2'),
cmd_sausage_off('\ub5b1'),
cmd_saw_blade('\ub5b3'),
cmd_sawtooth_wave('\ub5b4'),
cmd_saxophone('\ub5b5'),
cmd_scale('\ub5ba'),
cmd_scale_balance('\ub5b6'),
cmd_scale_bathroom('\ub5b7'),
cmd_scale_off('\ub5b8'),
cmd_scale_unbalanced('\ub5b9'),
cmd_scan_helper('\ub5bb'),
cmd_scanner('\ub5bd'),
cmd_scanner_off('\ub5bc'),
cmd_scatter_plot('\ub5bf'),
cmd_scatter_plot_outline('\ub5be'),
cmd_scent('\ub5c1'),
cmd_scent_off('\ub5c0'),
cmd_school('\ub5c3'),
cmd_school_outline('\ub5c2'),
cmd_scissors_cutting('\ub5c4'),
cmd_scooter('\ub5c6'),
cmd_scooter_electric('\ub5c5'),
cmd_scoreboard('\ub5c8'),
cmd_scoreboard_outline('\ub5c7'),
cmd_screen_rotation('\ub5ca'),
cmd_screen_rotation_lock('\ub5c9'),
cmd_screw_flat_top('\ub5cb'),
cmd_screw_lag('\ub5cc'),
cmd_screw_machine_flat_top('\ub5cd'),
cmd_screw_machine_round_top('\ub5ce'),
cmd_screw_round_top('\ub5cf'),
cmd_screwdriver('\ub5d0'),
cmd_script('\ub5d8'),
cmd_script_outline('\ub5d1'),
cmd_script_text('\ub5d7'),
cmd_script_text_key('\ub5d3'),
cmd_script_text_key_outline('\ub5d2'),
cmd_script_text_outline('\ub5d4'),
cmd_script_text_play('\ub5d6'),
cmd_script_text_play_outline('\ub5d5'),
cmd_sd('\ub5d9'),
cmd_seal('\ub5db'),
cmd_seal_variant('\ub5da'),
cmd_search_web('\ub5dc'),
cmd_seat('\ub5e7'),
cmd_seat_flat('\ub5de'),
cmd_seat_flat_angled('\ub5dd'),
cmd_seat_individual_suite('\ub5df'),
cmd_seat_legroom_extra('\ub5e0'),
cmd_seat_legroom_normal('\ub5e1'),
cmd_seat_legroom_reduced('\ub5e2'),
cmd_seat_outline('\ub5e3'),
cmd_seat_passenger('\ub5e4'),
cmd_seat_recline_extra('\ub5e5'),
cmd_seat_recline_normal('\ub5e6'),
cmd_seatbelt('\ub5e8'),
cmd_security('\ub5ea'),
cmd_security_network('\ub5e9'),
cmd_seed('\ub5f0'),
cmd_seed_off('\ub5ec'),
cmd_seed_off_outline('\ub5eb'),
cmd_seed_outline('\ub5ed'),
cmd_seed_plus('\ub5ef'),
cmd_seed_plus_outline('\ub5ee'),
cmd_seesaw('\ub5f1'),
cmd_segment('\ub5f2'),
cmd_select('\ub602'),
cmd_select_all('\ub5f3'),
cmd_select_arrow_down('\ub5f4'),
cmd_select_arrow_up('\ub5f5'),
cmd_select_color('\ub5f6'),
cmd_select_compare('\ub5f7'),
cmd_select_drag('\ub5f8'),
cmd_select_group('\ub5f9'),
cmd_select_inverse('\ub5fa'),
cmd_select_marker('\ub5fb'),
cmd_select_multiple('\ub5fd'),
cmd_select_multiple_marker('\ub5fc'),
cmd_select_off('\ub5fe'),
cmd_select_place('\ub5ff'),
cmd_select_remove('\ub600'),
cmd_select_search('\ub601'),
cmd_selection('\ub60d'),
cmd_selection_drag('\ub603'),
cmd_selection_ellipse('\ub606'),
cmd_selection_ellipse_arrow_inside('\ub604'),
cmd_selection_ellipse_remove('\ub605'),
cmd_selection_marker('\ub607'),
cmd_selection_multiple('\ub609'),
cmd_selection_multiple_marker('\ub608'),
cmd_selection_off('\ub60a'),
cmd_selection_remove('\ub60b'),
cmd_selection_search('\ub60c'),
cmd_semantic_web('\ub60e'),
cmd_send('\ub618'),
cmd_send_check('\ub610'),
cmd_send_check_outline('\ub60f'),
cmd_send_circle('\ub612'),
cmd_send_circle_outline('\ub611'),
cmd_send_clock('\ub614'),
cmd_send_clock_outline('\ub613'),
cmd_send_lock('\ub616'),
cmd_send_lock_outline('\ub615'),
cmd_send_outline('\ub617'),
cmd_serial_port('\ub619'),
cmd_server('\ub621'),
cmd_server_minus('\ub61a'),
cmd_server_network('\ub61c'),
cmd_server_network_off('\ub61b'),
cmd_server_off('\ub61d'),
cmd_server_plus('\ub61e'),
cmd_server_remove('\ub61f'),
cmd_server_security('\ub620'),
cmd_set_all('\ub622'),
cmd_set_center('\ub624'),
cmd_set_center_right('\ub623'),
cmd_set_left('\ub627'),
cmd_set_left_center('\ub625'),
cmd_set_left_right('\ub626'),
cmd_set_merge('\ub628'),
cmd_set_none('\ub629'),
cmd_set_right('\ub62a'),
cmd_set_split('\ub62b'),
cmd_set_square('\ub62c'),
cmd_set_top_box('\ub62d'),
cmd_settings_helper('\ub62e'),
cmd_shaker('\ub630'),
cmd_shaker_outline('\ub62f'),
cmd_shape('\ub639'),
cmd_shape_circle_plus('\ub631'),
cmd_shape_outline('\ub632'),
cmd_shape_oval_plus('\ub633'),
cmd_shape_plus('\ub634'),
cmd_shape_polygon_plus('\ub635'),
cmd_shape_rectangle_plus('\ub636'),
cmd_shape_square_plus('\ub637'),
cmd_shape_square_rounded_plus('\ub638'),
cmd_share('\ub642'),
cmd_share_all('\ub63b'),
cmd_share_all_outline('\ub63a'),
cmd_share_circle('\ub63c'),
cmd_share_off('\ub63e'),
cmd_share_off_outline('\ub63d'),
cmd_share_outline('\ub63f'),
cmd_share_variant('\ub641'),
cmd_share_variant_outline('\ub640'),
cmd_shark('\ub646'),
cmd_shark_fin('\ub644'),
cmd_shark_fin_outline('\ub643'),
cmd_shark_off('\ub645'),
cmd_sheep('\ub647'),
cmd_shield('\ub67b'),
cmd_shield_account('\ub64b'),
cmd_shield_account_outline('\ub648'),
cmd_shield_account_variant('\ub64a'),
cmd_shield_account_variant_outline('\ub649'),
cmd_shield_airplane('\ub64d'),
cmd_shield_airplane_outline('\ub64c'),
cmd_shield_alert('\ub64f'),
cmd_shield_alert_outline('\ub64e'),
cmd_shield_bug('\ub651'),
cmd_shield_bug_outline('\ub650'),
cmd_shield_car('\ub652'),
cmd_shield_check('\ub654'),
cmd_shield_check_outline('\ub653'),
cmd_shield_cross('\ub656'),
cmd_shield_cross_outline('\ub655'),
cmd_shield_crown('\ub658'),
cmd_shield_crown_outline('\ub657'),
cmd_shield_edit('\ub65a'),
cmd_shield_edit_outline('\ub659'),
cmd_shield_half('\ub65c'),
cmd_shield_half_full('\ub65b'),
cmd_shield_home('\ub65e'),
cmd_shield_home_outline('\ub65d'),
cmd_shield_key('\ub660'),
cmd_shield_key_outline('\ub65f'),
cmd_shield_link_variant('\ub662'),
cmd_shield_link_variant_outline('\ub661'),
cmd_shield_lock('\ub666'),
cmd_shield_lock_open('\ub664'),
cmd_shield_lock_open_outline('\ub663'),
cmd_shield_lock_outline('\ub665'),
cmd_shield_moon('\ub668'),
cmd_shield_moon_outline('\ub667'),
cmd_shield_off('\ub66a'),
cmd_shield_off_outline('\ub669'),
cmd_shield_outline('\ub66b'),
cmd_shield_plus('\ub66d'),
cmd_shield_plus_outline('\ub66c'),
cmd_shield_refresh('\ub66f'),
cmd_shield_refresh_outline('\ub66e'),
cmd_shield_remove('\ub671'),
cmd_shield_remove_outline('\ub670'),
cmd_shield_search('\ub672'),
cmd_shield_star('\ub674'),
cmd_shield_star_outline('\ub673'),
cmd_shield_sun('\ub676'),
cmd_shield_sun_outline('\ub675'),
cmd_shield_sword('\ub678'),
cmd_shield_sword_outline('\ub677'),
cmd_shield_sync('\ub67a'),
cmd_shield_sync_outline('\ub679'),
cmd_shimmer('\ub67c'),
cmd_ship_wheel('\ub67d'),
cmd_shipping_pallet('\ub67e'),
cmd_shoe_ballet('\ub67f'),
cmd_shoe_cleat('\ub680'),
cmd_shoe_formal('\ub681'),
cmd_shoe_heel('\ub682'),
cmd_shoe_print('\ub683'),
cmd_shoe_sneaker('\ub684'),
cmd_shopping('\ub689'),
cmd_shopping_music('\ub685'),
cmd_shopping_outline('\ub686'),
cmd_shopping_search('\ub688'),
cmd_shopping_search_outline('\ub687'),
cmd_shore('\ub68a'),
cmd_shovel('\ub68c'),
cmd_shovel_off('\ub68b'),
cmd_shower('\ub68e'),
cmd_shower_head('\ub68d'),
cmd_shredder('\ub68f'),
cmd_shuffle('\ub692'),
cmd_shuffle_disabled('\ub690'),
cmd_shuffle_variant('\ub691'),
cmd_shuriken('\ub693'),
cmd_sickle('\ub694'),
cmd_sigma('\ub696'),
cmd_sigma_lower('\ub695'),
cmd_sign_caution('\ub697'),
cmd_sign_direction('\ub69b'),
cmd_sign_direction_minus('\ub698'),
cmd_sign_direction_plus('\ub699'),
cmd_sign_direction_remove('\ub69a'),
cmd_sign_language('\ub69d'),
cmd_sign_language_outline('\ub69c'),
cmd_sign_pole('\ub69e'),
cmd_sign_real_estate('\ub69f'),
cmd_sign_text('\ub6a0'),
cmd_sign_yield('\ub6a1'),
cmd_signal('\ub6af'),
cmd_signal_2g('\ub6a2'),
cmd_signal_3g('\ub6a3'),
cmd_signal_4g('\ub6a4'),
cmd_signal_5g('\ub6a5'),
cmd_signal_cellular_1('\ub6a6'),
cmd_signal_cellular_2('\ub6a7'),
cmd_signal_cellular_3('\ub6a8'),
cmd_signal_cellular_outline('\ub6a9'),
cmd_signal_distance_variant('\ub6aa'),
cmd_signal_hspa('\ub6ac'),
cmd_signal_hspa_plus('\ub6ab'),
cmd_signal_off('\ub6ad'),
cmd_signal_variant('\ub6ae'),
cmd_signature('\ub6b3'),
cmd_signature_freehand('\ub6b0'),
cmd_signature_image('\ub6b1'),
cmd_signature_text('\ub6b2'),
cmd_silo('\ub6b5'),
cmd_silo_outline('\ub6b4'),
cmd_silverware('\ub6bb'),
cmd_silverware_clean('\ub6b6'),
cmd_silverware_fork('\ub6b8'),
cmd_silverware_fork_knife('\ub6b7'),
cmd_silverware_spoon('\ub6b9'),
cmd_silverware_variant('\ub6ba'),
cmd_sim('\ub6c1'),
cmd_sim_alert('\ub6bd'),
cmd_sim_alert_outline('\ub6bc'),
cmd_sim_off('\ub6bf'),
cmd_sim_off_outline('\ub6be'),
cmd_sim_outline('\ub6c0'),
cmd_simple_icons('\ub6c2'),
cmd_sina_weibo('\ub6c3'),
cmd_sine_wave('\ub6c4'),
cmd_sitemap('\ub6c6'),
cmd_sitemap_outline('\ub6c5'),
cmd_size_l('\ub6c7'),
cmd_size_m('\ub6c8'),
cmd_size_s('\ub6c9'),
cmd_size_xl('\ub6ca'),
cmd_size_xs('\ub6cb'),
cmd_size_xxl('\ub6cc'),
cmd_size_xxs('\ub6cd'),
cmd_size_xxxl('\ub6ce'),
cmd_skate('\ub6d0'),
cmd_skate_off('\ub6cf'),
cmd_skateboard('\ub6d1'),
cmd_skateboarding('\ub6d2'),
cmd_skew_less('\ub6d3'),
cmd_skew_more('\ub6d4'),
cmd_ski('\ub6d7'),
cmd_ski_cross_country('\ub6d5'),
cmd_ski_water('\ub6d6'),
cmd_skip_backward('\ub6d9'),
cmd_skip_backward_outline('\ub6d8'),
cmd_skip_forward('\ub6db'),
cmd_skip_forward_outline('\ub6da'),
cmd_skip_next('\ub6df'),
cmd_skip_next_circle('\ub6dd'),
cmd_skip_next_circle_outline('\ub6dc'),
cmd_skip_next_outline('\ub6de'),
cmd_skip_previous('\ub6e3'),
cmd_skip_previous_circle('\ub6e1'),
cmd_skip_previous_circle_outline('\ub6e0'),
cmd_skip_previous_outline('\ub6e2'),
cmd_skull('\ub6e9'),
cmd_skull_crossbones('\ub6e5'),
cmd_skull_crossbones_outline('\ub6e4'),
cmd_skull_outline('\ub6e6'),
cmd_skull_scan('\ub6e8'),
cmd_skull_scan_outline('\ub6e7'),
cmd_skype('\ub6eb'),
cmd_skype_business('\ub6ea'),
cmd_slack('\ub6ec'),
cmd_slash_forward('\ub6ee'),
cmd_slash_forward_box('\ub6ed'),
cmd_sledding('\ub6ef'),
cmd_sleep('\ub6f1'),
cmd_sleep_off('\ub6f0'),
cmd_slide('\ub6f2'),
cmd_slope_downhill('\ub6f3'),
cmd_slope_uphill('\ub6f4'),
cmd_slot_machine('\ub6f6'),
cmd_slot_machine_outline('\ub6f5'),
cmd_smart_card('\ub6fc'),
cmd_smart_card_off('\ub6f8'),
cmd_smart_card_off_outline('\ub6f7'),
cmd_smart_card_outline('\ub6f9'),
cmd_smart_card_reader('\ub6fb'),
cmd_smart_card_reader_outline('\ub6fa'),
cmd_smog('\ub6fd'),
cmd_smoke('\ub707'),
cmd_smoke_detector('\ub706'),
cmd_smoke_detector_alert('\ub6ff'),
cmd_smoke_detector_alert_outline('\ub6fe'),
cmd_smoke_detector_off('\ub701'),
cmd_smoke_detector_off_outline('\ub700'),
cmd_smoke_detector_outline('\ub702'),
cmd_smoke_detector_variant('\ub705'),
cmd_smoke_detector_variant_alert('\ub703'),
cmd_smoke_detector_variant_off('\ub704'),
cmd_smoking('\ub70b'),
cmd_smoking_off('\ub708'),
cmd_smoking_pipe('\ub70a'),
cmd_smoking_pipe_off('\ub709'),
cmd_snail('\ub70c'),
cmd_snake('\ub70d'),
cmd_snapchat('\ub70e'),
cmd_snowboard('\ub70f'),
cmd_snowflake('\ub716'),
cmd_snowflake_alert('\ub710'),
cmd_snowflake_check('\ub711'),
cmd_snowflake_melt('\ub712'),
cmd_snowflake_off('\ub713'),
cmd_snowflake_thermometer('\ub714'),
cmd_snowflake_variant('\ub715'),
cmd_snowman('\ub717'),
cmd_snowmobile('\ub718'),
cmd_snowshoeing('\ub719'),
cmd_soccer('\ub71b'),
cmd_soccer_field('\ub71a'),
cmd_social_distance_2_meters('\ub71c'),
cmd_social_distance_6_feet('\ub71d'),
cmd_sofa('\ub721'),
cmd_sofa_outline('\ub71e'),
cmd_sofa_single('\ub720'),
cmd_sofa_single_outline('\ub71f'),
cmd_solar_panel('\ub723'),
cmd_solar_panel_large('\ub722'),
cmd_solar_power('\ub726'),
cmd_solar_power_variant('\ub725'),
cmd_solar_power_variant_outline('\ub724'),
cmd_soldering_iron('\ub727'),
cmd_solid('\ub728'),
cmd_sony_playstation('\ub729'),
cmd_sort('\ub746'),
cmd_sort_alphabetical_ascending('\ub72b'),
cmd_sort_alphabetical_ascending_variant('\ub72a'),
cmd_sort_alphabetical_descending('\ub72d'),
cmd_sort_alphabetical_descending_variant('\ub72c'),
cmd_sort_alphabetical_variant('\ub72e'),
cmd_sort_ascending('\ub72f'),
cmd_sort_bool_ascending('\ub731'),
cmd_sort_bool_ascending_variant('\ub730'),
cmd_sort_bool_descending('\ub733'),
cmd_sort_bool_descending_variant('\ub732'),
cmd_sort_calendar_ascending('\ub734'),
cmd_sort_calendar_descending('\ub735'),
cmd_sort_clock_ascending('\ub737'),
cmd_sort_clock_ascending_outline('\ub736'),
cmd_sort_clock_descending('\ub739'),
cmd_sort_clock_descending_outline('\ub738'),
cmd_sort_descending('\ub73a'),
cmd_sort_numeric_ascending('\ub73c'),
cmd_sort_numeric_ascending_variant('\ub73b'),
cmd_sort_numeric_descending('\ub73e'),
cmd_sort_numeric_descending_variant('\ub73d'),
cmd_sort_numeric_variant('\ub73f'),
cmd_sort_reverse_variant('\ub740'),
cmd_sort_variant('\ub745'),
cmd_sort_variant_lock('\ub742'),
cmd_sort_variant_lock_open('\ub741'),
cmd_sort_variant_off('\ub743'),
cmd_sort_variant_remove('\ub744'),
cmd_soundbar('\ub747'),
cmd_soundcloud('\ub748'),
cmd_source_branch('\ub74f'),
cmd_source_branch_check('\ub749'),
cmd_source_branch_minus('\ub74a'),
cmd_source_branch_plus('\ub74b'),
cmd_source_branch_refresh('\ub74c'),
cmd_source_branch_remove('\ub74d'),
cmd_source_branch_sync('\ub74e'),
cmd_source_commit('\ub756'),
cmd_source_commit_end('\ub751'),
cmd_source_commit_end_local('\ub750'),
cmd_source_commit_local('\ub752'),
cmd_source_commit_next_local('\ub753'),
cmd_source_commit_start('\ub755'),
cmd_source_commit_start_next_local('\ub754'),
cmd_source_fork('\ub757'),
cmd_source_merge('\ub758'),
cmd_source_pull('\ub759'),
cmd_source_repository('\ub75b'),
cmd_source_repository_multiple('\ub75a'),
cmd_soy_sauce('\ub75d'),
cmd_soy_sauce_off('\ub75c'),
cmd_spa('\ub75f'),
cmd_spa_outline('\ub75e'),
cmd_space_invaders('\ub760'),
cmd_space_station('\ub761'),
cmd_spade('\ub762'),
cmd_speaker('\ub76b'),
cmd_speaker_bluetooth('\ub763'),
cmd_speaker_message('\ub764'),
cmd_speaker_multiple('\ub765'),
cmd_speaker_off('\ub766'),
cmd_speaker_pause('\ub767'),
cmd_speaker_play('\ub768'),
cmd_speaker_stop('\ub769'),
cmd_speaker_wireless('\ub76a'),
cmd_spear('\ub76c'),
cmd_speedometer('\ub76f'),
cmd_speedometer_medium('\ub76d'),
cmd_speedometer_slow('\ub76e'),
cmd_spellcheck('\ub770'),
cmd_sphere('\ub772'),
cmd_sphere_off('\ub771'),
cmd_spider('\ub775'),
cmd_spider_thread('\ub773'),
cmd_spider_web('\ub774'),
cmd_spirit_level('\ub776'),
cmd_spoon_sugar('\ub777'),
cmd_spotify('\ub778'),
cmd_spotlight('\ub77a'),
cmd_spotlight_beam('\ub779'),
cmd_spray('\ub77c'),
cmd_spray_bottle('\ub77b'),
cmd_sprinkler('\ub77f'),
cmd_sprinkler_fire('\ub77d'),
cmd_sprinkler_variant('\ub77e'),
cmd_sprout('\ub781'),
cmd_sprout_outline('\ub780'),
cmd_square('\ub792'),
cmd_square_circle('\ub782'),
cmd_square_edit_outline('\ub783'),
cmd_square_medium('\ub785'),
cmd_square_medium_outline('\ub784'),
cmd_square_off('\ub787'),
cmd_square_off_outline('\ub786'),
cmd_square_opacity('\ub788'),
cmd_square_outline('\ub789'),
cmd_square_root('\ub78b'),
cmd_square_root_box('\ub78a'),
cmd_square_rounded('\ub78f'),
cmd_square_rounded_badge('\ub78d'),
cmd_square_rounded_badge_outline('\ub78c'),
cmd_square_rounded_outline('\ub78e'),
cmd_square_small('\ub790'),
cmd_square_wave('\ub791'),
cmd_squeegee('\ub793'),
cmd_ssh('\ub794'),
cmd_stack_exchange('\ub795'),
cmd_stack_overflow('\ub796'),
cmd_stackpath('\ub797'),
cmd_stadium('\ub79a'),
cmd_stadium_outline('\ub798'),
cmd_stadium_variant('\ub799'),
cmd_stairs('\ub79e'),
cmd_stairs_box('\ub79b'),
cmd_stairs_down('\ub79c'),
cmd_stairs_up('\ub79d'),
cmd_stamper('\ub79f'),
cmd_standard_definition('\ub7a0'),
cmd_star('\ub7c1'),
cmd_star_box('\ub7a4'),
cmd_star_box_multiple('\ub7a2'),
cmd_star_box_multiple_outline('\ub7a1'),
cmd_star_box_outline('\ub7a3'),
cmd_star_check('\ub7a6'),
cmd_star_check_outline('\ub7a5'),
cmd_star_circle('\ub7a8'),
cmd_star_circle_outline('\ub7a7'),
cmd_star_cog('\ub7aa'),
cmd_star_cog_outline('\ub7a9'),
cmd_star_crescent('\ub7ab'),
cmd_star_david('\ub7ac'),
cmd_star_face('\ub7ad'),
cmd_star_four_points('\ub7af'),
cmd_star_four_points_outline('\ub7ae'),
cmd_star_half('\ub7b1'),
cmd_star_half_full('\ub7b0'),
cmd_star_minus('\ub7b3'),
cmd_star_minus_outline('\ub7b2'),
cmd_star_off('\ub7b5'),
cmd_star_off_outline('\ub7b4'),
cmd_star_outline('\ub7b6'),
cmd_star_plus('\ub7b8'),
cmd_star_plus_outline('\ub7b7'),
cmd_star_remove('\ub7ba'),
cmd_star_remove_outline('\ub7b9'),
cmd_star_settings('\ub7bc'),
cmd_star_settings_outline('\ub7bb'),
cmd_star_shooting('\ub7be'),
cmd_star_shooting_outline('\ub7bd'),
cmd_star_three_points('\ub7c0'),
cmd_star_three_points_outline('\ub7bf'),
cmd_state_machine('\ub7c2'),
cmd_steam('\ub7c3'),
cmd_steering('\ub7c5'),
cmd_steering_off('\ub7c4'),
cmd_step_backward('\ub7c7'),
cmd_step_backward_2('\ub7c6'),
cmd_step_forward('\ub7c9'),
cmd_step_forward_2('\ub7c8'),
cmd_stethoscope('\ub7ca'),
cmd_sticker('\ub7da'),
cmd_sticker_alert('\ub7cc'),
cmd_sticker_alert_outline('\ub7cb'),
cmd_sticker_check('\ub7ce'),
cmd_sticker_check_outline('\ub7cd'),
cmd_sticker_circle_outline('\ub7cf'),
cmd_sticker_emoji('\ub7d0'),
cmd_sticker_minus('\ub7d2'),
cmd_sticker_minus_outline('\ub7d1'),
cmd_sticker_outline('\ub7d3'),
cmd_sticker_plus('\ub7d5'),
cmd_sticker_plus_outline('\ub7d4'),
cmd_sticker_remove('\ub7d7'),
cmd_sticker_remove_outline('\ub7d6'),
cmd_sticker_text('\ub7d9'),
cmd_sticker_text_outline('\ub7d8'),
cmd_stocking('\ub7db'),
cmd_stomach('\ub7dc'),
cmd_stool('\ub7de'),
cmd_stool_outline('\ub7dd'),
cmd_stop('\ub7e1'),
cmd_stop_circle('\ub7e0'),
cmd_stop_circle_outline('\ub7df'),
cmd_storage_tank('\ub7e3'),
cmd_storage_tank_outline('\ub7e2'),
cmd_store('\ub7fe'),
cmd_store_24_hour('\ub7e4'),
cmd_store_alert('\ub7e6'),
cmd_store_alert_outline('\ub7e5'),
cmd_store_check('\ub7e8'),
cmd_store_check_outline('\ub7e7'),
cmd_store_clock('\ub7ea'),
cmd_store_clock_outline('\ub7e9'),
cmd_store_cog('\ub7ec'),
cmd_store_cog_outline('\ub7eb'),
cmd_store_edit('\ub7ee'),
cmd_store_edit_outline('\ub7ed'),
cmd_store_marker('\ub7f0'),
cmd_store_marker_outline('\ub7ef'),
cmd_store_minus('\ub7f2'),
cmd_store_minus_outline('\ub7f1'),
cmd_store_off('\ub7f4'),
cmd_store_off_outline('\ub7f3'),
cmd_store_outline('\ub7f5'),
cmd_store_plus('\ub7f7'),
cmd_store_plus_outline('\ub7f6'),
cmd_store_remove('\ub7f9'),
cmd_store_remove_outline('\ub7f8'),
cmd_store_search('\ub7fb'),
cmd_store_search_outline('\ub7fa'),
cmd_store_settings('\ub7fd'),
cmd_store_settings_outline('\ub7fc'),
cmd_storefront('\ub80a'),
cmd_storefront_check('\ub800'),
cmd_storefront_check_outline('\ub7ff'),
cmd_storefront_edit('\ub802'),
cmd_storefront_edit_outline('\ub801'),
cmd_storefront_minus('\ub804'),
cmd_storefront_minus_outline('\ub803'),
cmd_storefront_outline('\ub805'),
cmd_storefront_plus('\ub807'),
cmd_storefront_plus_outline('\ub806'),
cmd_storefront_remove('\ub809'),
cmd_storefront_remove_outline('\ub808'),
cmd_stove('\ub80b'),
cmd_strategy('\ub80c'),
cmd_stretch_to_page('\ub80e'),
cmd_stretch_to_page_outline('\ub80d'),
cmd_string_lights('\ub810'),
cmd_string_lights_off('\ub80f'),
cmd_subdirectory_arrow_left('\ub811'),
cmd_subdirectory_arrow_right('\ub812'),
cmd_submarine('\ub813'),
cmd_subtitles('\ub815'),
cmd_subtitles_outline('\ub814'),
cmd_subway('\ub818'),
cmd_subway_alert_variant('\ub816'),
cmd_subway_variant('\ub817'),
cmd_summit('\ub819'),
cmd_sun_angle('\ub81b'),
cmd_sun_angle_outline('\ub81a'),
cmd_sun_clock('\ub81d'),
cmd_sun_clock_outline('\ub81c'),
cmd_sun_compass('\ub81e'),
cmd_sun_snowflake('\ub820'),
cmd_sun_snowflake_variant('\ub81f'),
cmd_sun_thermometer('\ub822'),
cmd_sun_thermometer_outline('\ub821'),
cmd_sun_wireless('\ub824'),
cmd_sun_wireless_outline('\ub823'),
cmd_sunglasses('\ub825'),
cmd_surfing('\ub826'),
cmd_surround_sound('\ub82d'),
cmd_surround_sound_2_0('\ub827'),
cmd_surround_sound_2_1('\ub828'),
cmd_surround_sound_3_1('\ub829'),
cmd_surround_sound_5_1('\ub82b'),
cmd_surround_sound_5_1_2('\ub82a'),
cmd_surround_sound_7_1('\ub82c'),
cmd_svg('\ub82e'),
cmd_swap_horizontal('\ub833'),
cmd_swap_horizontal_bold('\ub82f'),
cmd_swap_horizontal_circle('\ub831'),
cmd_swap_horizontal_circle_outline('\ub830'),
cmd_swap_horizontal_variant('\ub832'),
cmd_swap_vertical('\ub838'),
cmd_swap_vertical_bold('\ub834'),
cmd_swap_vertical_circle('\ub836'),
cmd_swap_vertical_circle_outline('\ub835'),
cmd_swap_vertical_variant('\ub837'),
cmd_swim('\ub839'),
cmd_switch('\ub83a'),
cmd_sword('\ub83c'),
cmd_sword_cross('\ub83b'),
cmd_syllabary_hangul('\ub83d'),
cmd_syllabary_hiragana('\ub83e'),
cmd_syllabary_katakana('\ub840'),
cmd_syllabary_katakana_halfwidth('\ub83f'),
cmd_symbol('\ub841'),
cmd_symfony('\ub842'),
cmd_synagogue('\ub844'),
cmd_synagogue_outline('\ub843'),
cmd_sync('\ub848'),
cmd_sync_alert('\ub845'),
cmd_sync_circle('\ub846'),
cmd_sync_off('\ub847'),
cmd_tab('\ub84e'),
cmd_tab_minus('\ub849'),
cmd_tab_plus('\ub84a'),
cmd_tab_remove('\ub84b'),
cmd_tab_search('\ub84c'),
cmd_tab_unselected('\ub84d'),
cmd_table('\ub884'),
cmd_table_account('\ub84f'),
cmd_table_alert('\ub850'),
cmd_table_arrow_down('\ub851'),
cmd_table_arrow_left('\ub852'),
cmd_table_arrow_right('\ub853'),
cmd_table_arrow_up('\ub854'),
cmd_table_border('\ub855'),
cmd_table_cancel('\ub856'),
cmd_table_chair('\ub857'),
cmd_table_check('\ub858'),
cmd_table_clock('\ub859'),
cmd_table_cog('\ub85a'),
cmd_table_column('\ub85f'),
cmd_table_column_plus_after('\ub85b'),
cmd_table_column_plus_before('\ub85c'),
cmd_table_column_remove('\ub85d'),
cmd_table_column_width('\ub85e'),
cmd_table_edit('\ub860'),
cmd_table_eye('\ub862'),
cmd_table_eye_off('\ub861'),
cmd_table_filter('\ub863'),
cmd_table_furniture('\ub864'),
cmd_table_headers_eye('\ub866'),
cmd_table_headers_eye_off('\ub865'),
cmd_table_heart('\ub867'),
cmd_table_key('\ub868'),
cmd_table_large('\ub86b'),
cmd_table_large_plus('\ub869'),
cmd_table_large_remove('\ub86a'),
cmd_table_lock('\ub86c'),
cmd_table_merge_cells('\ub86d'),
cmd_table_minus('\ub86e'),
cmd_table_multiple('\ub86f'),
cmd_table_network('\ub870'),
cmd_table_of_contents('\ub871'),
cmd_table_off('\ub872'),
cmd_table_picnic('\ub873'),
cmd_table_pivot('\ub874'),
cmd_table_plus('\ub875'),
cmd_table_question('\ub876'),
cmd_table_refresh('\ub877'),
cmd_table_remove('\ub878'),
cmd_table_row('\ub87d'),
cmd_table_row_height('\ub879'),
cmd_table_row_plus_after('\ub87a'),
cmd_table_row_plus_before('\ub87b'),
cmd_table_row_remove('\ub87c'),
cmd_table_search('\ub87e'),
cmd_table_settings('\ub87f'),
cmd_table_split_cell('\ub880'),
cmd_table_star('\ub881'),
cmd_table_sync('\ub882'),
cmd_table_tennis('\ub883'),
cmd_tablet('\ub887'),
cmd_tablet_cellphone('\ub885'),
cmd_tablet_dashboard('\ub886'),
cmd_taco('\ub888'),
cmd_tag('\ub8a5'),
cmd_tag_arrow_down('\ub88a'),
cmd_tag_arrow_down_outline('\ub889'),
cmd_tag_arrow_left('\ub88c'),
cmd_tag_arrow_left_outline('\ub88b'),
cmd_tag_arrow_right('\ub88e'),
cmd_tag_arrow_right_outline('\ub88d'),
cmd_tag_arrow_up('\ub890'),
cmd_tag_arrow_up_outline('\ub88f'),
cmd_tag_check('\ub892'),
cmd_tag_check_outline('\ub891'),
cmd_tag_faces('\ub893'),
cmd_tag_heart('\ub895'),
cmd_tag_heart_outline('\ub894'),
cmd_tag_minus('\ub897'),
cmd_tag_minus_outline('\ub896'),
cmd_tag_multiple('\ub899'),
cmd_tag_multiple_outline('\ub898'),
cmd_tag_off('\ub89b'),
cmd_tag_off_outline('\ub89a'),
cmd_tag_outline('\ub89c'),
cmd_tag_plus('\ub89e'),
cmd_tag_plus_outline('\ub89d'),
cmd_tag_remove('\ub8a0'),
cmd_tag_remove_outline('\ub89f'),
cmd_tag_search('\ub8a2'),
cmd_tag_search_outline('\ub8a1'),
cmd_tag_text('\ub8a4'),
cmd_tag_text_outline('\ub8a3'),
cmd_tailwind('\ub8a6'),
cmd_tally_mark_1('\ub8a7'),
cmd_tally_mark_2('\ub8a8'),
cmd_tally_mark_3('\ub8a9'),
cmd_tally_mark_4('\ub8aa'),
cmd_tally_mark_5('\ub8ab'),
cmd_tangram('\ub8ac'),
cmd_tank('\ub8ad'),
cmd_tanker_truck('\ub8ae'),
cmd_tape_drive('\ub8af'),
cmd_tape_measure('\ub8b0'),
cmd_target('\ub8b3'),
cmd_target_account('\ub8b1'),
cmd_target_variant('\ub8b2'),
cmd_taxi('\ub8b4'),
cmd_tea('\ub8b6'),
cmd_tea_outline('\ub8b5'),
cmd_teamviewer('\ub8b7'),
cmd_teddy_bear('\ub8b8'),
cmd_telescope('\ub8b9'),
cmd_television('\ub8c6'),
cmd_television_ambient_light('\ub8ba'),
cmd_television_box('\ub8bb'),
cmd_television_classic('\ub8bd'),
cmd_television_classic_off('\ub8bc'),
cmd_television_guide('\ub8be'),
cmd_television_off('\ub8bf'),
cmd_television_pause('\ub8c0'),
cmd_television_play('\ub8c1'),
cmd_television_shimmer('\ub8c2'),
cmd_television_speaker('\ub8c4'),
cmd_television_speaker_off('\ub8c3'),
cmd_television_stop('\ub8c5'),
cmd_temperature_celsius('\ub8c7'),
cmd_temperature_fahrenheit('\ub8c8'),
cmd_temperature_kelvin('\ub8c9'),
cmd_temple_buddhist('\ub8cb'),
cmd_temple_buddhist_outline('\ub8ca'),
cmd_temple_hindu('\ub8cd'),
cmd_temple_hindu_outline('\ub8cc'),
cmd_tennis('\ub8cf'),
cmd_tennis_ball('\ub8ce'),
cmd_tent('\ub8d0'),
cmd_terraform('\ub8d1'),
cmd_terrain('\ub8d2'),
cmd_test_tube('\ub8d5'),
cmd_test_tube_empty('\ub8d3'),
cmd_test_tube_off('\ub8d4'),
cmd_text('\ub8ed'),
cmd_text_account('\ub8d6'),
cmd_text_box('\ub8e6'),
cmd_text_box_check('\ub8d8'),
cmd_text_box_check_outline('\ub8d7'),
cmd_text_box_edit('\ub8da'),
cmd_text_box_edit_outline('\ub8d9'),
cmd_text_box_minus('\ub8dc'),
cmd_text_box_minus_outline('\ub8db'),
cmd_text_box_multiple('\ub8de'),
cmd_text_box_multiple_outline('\ub8dd'),
cmd_text_box_outline('\ub8df'),
cmd_text_box_plus('\ub8e1'),
cmd_text_box_plus_outline('\ub8e0'),
cmd_text_box_remove('\ub8e3'),
cmd_text_box_remove_outline('\ub8e2'),
cmd_text_box_search('\ub8e5'),
cmd_text_box_search_outline('\ub8e4'),
cmd_text_long('\ub8e7'),
cmd_text_recognition('\ub8e8'),
cmd_text_search('\ub8ea'),
cmd_text_search_variant('\ub8e9'),
cmd_text_shadow('\ub8eb'),
cmd_text_short('\ub8ec'),
cmd_texture('\ub8ef'),
cmd_texture_box('\ub8ee'),
cmd_theater('\ub8f0'),
cmd_theme_light_dark('\ub8f1'),
cmd_thermometer('\ub901'),
cmd_thermometer_alert('\ub8f2'),
cmd_thermometer_auto('\ub8f3'),
cmd_thermometer_bluetooth('\ub8f4'),
cmd_thermometer_check('\ub8f5'),
cmd_thermometer_chevron_down('\ub8f6'),
cmd_thermometer_chevron_up('\ub8f7'),
cmd_thermometer_high('\ub8f8'),
cmd_thermometer_lines('\ub8f9'),
cmd_thermometer_low('\ub8fa'),
cmd_thermometer_minus('\ub8fb'),
cmd_thermometer_off('\ub8fc'),
cmd_thermometer_plus('\ub8fd'),
cmd_thermometer_probe('\ub8ff'),
cmd_thermometer_probe_off('\ub8fe'),
cmd_thermometer_water('\ub900'),
cmd_thermostat('\ub905'),
cmd_thermostat_auto('\ub902'),
cmd_thermostat_box('\ub904'),
cmd_thermostat_box_auto('\ub903'),
cmd_thought_bubble('\ub907'),
cmd_thought_bubble_outline('\ub906'),
cmd_thumb_down('\ub909'),
cmd_thumb_down_outline('\ub908'),
cmd_thumb_up('\ub90b'),
cmd_thumb_up_outline('\ub90a'),
cmd_thumbs_up_down('\ub90d'),
cmd_thumbs_up_down_outline('\ub90c'),
cmd_ticket('\ub914'),
cmd_ticket_account('\ub90e'),
cmd_ticket_confirmation('\ub910'),
cmd_ticket_confirmation_outline('\ub90f'),
cmd_ticket_outline('\ub911'),
cmd_ticket_percent('\ub913'),
cmd_ticket_percent_outline('\ub912'),
cmd_tie('\ub915'),
cmd_tilde('\ub917'),
cmd_tilde_off('\ub916'),
cmd_timelapse('\ub918'),
cmd_timeline('\ub92a'),
cmd_timeline_alert('\ub91a'),
cmd_timeline_alert_outline('\ub919'),
cmd_timeline_check('\ub91c'),
cmd_timeline_check_outline('\ub91b'),
cmd_timeline_clock('\ub91e'),
cmd_timeline_clock_outline('\ub91d'),
cmd_timeline_minus('\ub920'),
cmd_timeline_minus_outline('\ub91f'),
cmd_timeline_outline('\ub921'),
cmd_timeline_plus('\ub923'),
cmd_timeline_plus_outline('\ub922'),
cmd_timeline_question('\ub925'),
cmd_timeline_question_outline('\ub924'),
cmd_timeline_remove('\ub927'),
cmd_timeline_remove_outline('\ub926'),
cmd_timeline_text('\ub929'),
cmd_timeline_text_outline('\ub928'),
cmd_timer('\ub95b'),
cmd_timer_10('\ub92c'),
cmd_timer_3('\ub92b'),
cmd_timer_alert('\ub92e'),
cmd_timer_alert_outline('\ub92d'),
cmd_timer_cancel('\ub930'),
cmd_timer_cancel_outline('\ub92f'),
cmd_timer_check('\ub932'),
cmd_timer_check_outline('\ub931'),
cmd_timer_cog('\ub934'),
cmd_timer_cog_outline('\ub933'),
cmd_timer_edit('\ub936'),
cmd_timer_edit_outline('\ub935'),
cmd_timer_lock('\ub93a'),
cmd_timer_lock_open('\ub938'),
cmd_timer_lock_open_outline('\ub937'),
cmd_timer_lock_outline('\ub939'),
cmd_timer_marker('\ub93c'),
cmd_timer_marker_outline('\ub93b'),
cmd_timer_minus('\ub93e'),
cmd_timer_minus_outline('\ub93d'),
cmd_timer_music('\ub940'),
cmd_timer_music_outline('\ub93f'),
cmd_timer_off('\ub942'),
cmd_timer_off_outline('\ub941'),
cmd_timer_outline('\ub943'),
cmd_timer_pause('\ub945'),
cmd_timer_pause_outline('\ub944'),
cmd_timer_play('\ub947'),
cmd_timer_play_outline('\ub946'),
cmd_timer_plus('\ub949'),
cmd_timer_plus_outline('\ub948'),
cmd_timer_refresh('\ub94b'),
cmd_timer_refresh_outline('\ub94a'),
cmd_timer_remove('\ub94d'),
cmd_timer_remove_outline('\ub94c'),
cmd_timer_sand('\ub952'),
cmd_timer_sand_complete('\ub94e'),
cmd_timer_sand_empty('\ub94f'),
cmd_timer_sand_full('\ub950'),
cmd_timer_sand_paused('\ub951'),
cmd_timer_settings('\ub954'),
cmd_timer_settings_outline('\ub953'),
cmd_timer_star('\ub956'),
cmd_timer_star_outline('\ub955'),
cmd_timer_stop('\ub958'),
cmd_timer_stop_outline('\ub957'),
cmd_timer_sync('\ub95a'),
cmd_timer_sync_outline('\ub959'),
cmd_timetable('\ub95c'),
cmd_tire('\ub95d'),
cmd_toaster('\ub960'),
cmd_toaster_off('\ub95e'),
cmd_toaster_oven('\ub95f'),
cmd_toggle_switch('\ub966'),
cmd_toggle_switch_off('\ub962'),
cmd_toggle_switch_off_outline('\ub961'),
cmd_toggle_switch_outline('\ub963'),
cmd_toggle_switch_variant('\ub965'),
cmd_toggle_switch_variant_off('\ub964'),
cmd_toilet('\ub967'),
cmd_toolbox('\ub969'),
cmd_toolbox_outline('\ub968'),
cmd_tools('\ub96a'),
cmd_tooltip('\ub97e'),
cmd_tooltip_account('\ub96b'),
cmd_tooltip_cellphone('\ub96c'),
cmd_tooltip_check('\ub96e'),
cmd_tooltip_check_outline('\ub96d'),
cmd_tooltip_edit('\ub970'),
cmd_tooltip_edit_outline('\ub96f'),
cmd_tooltip_image('\ub972'),
cmd_tooltip_image_outline('\ub971'),
cmd_tooltip_minus('\ub974'),
cmd_tooltip_minus_outline('\ub973'),
cmd_tooltip_outline('\ub975'),
cmd_tooltip_plus('\ub977'),
cmd_tooltip_plus_outline('\ub976'),
cmd_tooltip_question('\ub979'),
cmd_tooltip_question_outline('\ub978'),
cmd_tooltip_remove('\ub97b'),
cmd_tooltip_remove_outline('\ub97a'),
cmd_tooltip_text('\ub97d'),
cmd_tooltip_text_outline('\ub97c'),
cmd_tooth('\ub980'),
cmd_tooth_outline('\ub97f'),
cmd_toothbrush('\ub983'),
cmd_toothbrush_electric('\ub981'),
cmd_toothbrush_paste('\ub982'),
cmd_torch('\ub984'),
cmd_tortoise('\ub985'),
cmd_toslink('\ub986'),
cmd_tournament('\ub987'),
cmd_tow_truck('\ub988'),
cmd_tower_beach('\ub989'),
cmd_tower_fire('\ub98a'),
cmd_town_hall('\ub98b'),
cmd_toy_brick('\ub997'),
cmd_toy_brick_marker('\ub98d'),
cmd_toy_brick_marker_outline('\ub98c'),
cmd_toy_brick_minus('\ub98f'),
cmd_toy_brick_minus_outline('\ub98e'),
cmd_toy_brick_outline('\ub990'),
cmd_toy_brick_plus('\ub992'),
cmd_toy_brick_plus_outline('\ub991'),
cmd_toy_brick_remove('\ub994'),
cmd_toy_brick_remove_outline('\ub993'),
cmd_toy_brick_search('\ub996'),
cmd_toy_brick_search_outline('\ub995'),
cmd_track_light('\ub999'),
cmd_track_light_off('\ub998'),
cmd_trackpad('\ub99b'),
cmd_trackpad_lock('\ub99a'),
cmd_tractor('\ub99d'),
cmd_tractor_variant('\ub99c'),
cmd_trademark('\ub99e'),
cmd_traffic_cone('\ub99f'),
cmd_traffic_light('\ub9a1'),
cmd_traffic_light_outline('\ub9a0'),
cmd_train('\ub9ba'),
cmd_train_car('\ub9b8'),
cmd_train_car_autorack('\ub9a2'),
cmd_train_car_box('\ub9a5'),
cmd_train_car_box_full('\ub9a3'),
cmd_train_car_box_open('\ub9a4'),
cmd_train_car_caboose('\ub9a6'),
cmd_train_car_centerbeam('\ub9a8'),
cmd_train_car_centerbeam_full('\ub9a7'),
cmd_train_car_container('\ub9a9'),
cmd_train_car_flatbed('\ub9ac'),
cmd_train_car_flatbed_car('\ub9aa'),
cmd_train_car_flatbed_tank('\ub9ab'),
cmd_train_car_gondola('\ub9ae'),
cmd_train_car_gondola_full('\ub9ad'),
cmd_train_car_hopper('\ub9b1'),
cmd_train_car_hopper_covered('\ub9af'),
cmd_train_car_hopper_full('\ub9b0'),
cmd_train_car_intermodal('\ub9b2'),
cmd_train_car_passenger('\ub9b6'),
cmd_train_car_passenger_door('\ub9b4'),
cmd_train_car_passenger_door_open('\ub9b3'),
cmd_train_car_passenger_variant('\ub9b5'),
cmd_train_car_tank('\ub9b7'),
cmd_train_variant('\ub9b9'),
cmd_tram('\ub9bc'),
cmd_tram_side('\ub9bb'),
cmd_transcribe('\ub9be'),
cmd_transcribe_close('\ub9bd'),
cmd_transfer('\ub9c3'),
cmd_transfer_down('\ub9bf'),
cmd_transfer_left('\ub9c0'),
cmd_transfer_right('\ub9c1'),
cmd_transfer_up('\ub9c2'),
cmd_transit_connection('\ub9c6'),
cmd_transit_connection_horizontal('\ub9c4'),
cmd_transit_connection_variant('\ub9c5'),
cmd_transit_detour('\ub9c7'),
cmd_transit_skip('\ub9c8'),
cmd_transit_transfer('\ub9c9'),
cmd_transition('\ub9cb'),
cmd_transition_masked('\ub9ca'),
cmd_translate('\ub9ce'),
cmd_translate_off('\ub9cc'),
cmd_translate_variant('\ub9cd'),
cmd_transmission_tower('\ub9d2'),
cmd_transmission_tower_export('\ub9cf'),
cmd_transmission_tower_import('\ub9d0'),
cmd_transmission_tower_off('\ub9d1'),
cmd_trash_can('\ub9d4'),
cmd_trash_can_outline('\ub9d3'),
cmd_tray('\ub9dc'),
cmd_tray_alert('\ub9d5'),
cmd_tray_arrow_down('\ub9d6'),
cmd_tray_arrow_up('\ub9d7'),
cmd_tray_full('\ub9d8'),
cmd_tray_minus('\ub9d9'),
cmd_tray_plus('\ub9da'),
cmd_tray_remove('\ub9db'),
cmd_treasure_chest('\ub9dd'),
cmd_tree('\ub9df'),
cmd_tree_outline('\ub9de'),
cmd_trello('\ub9e0'),
cmd_trending_down('\ub9e1'),
cmd_trending_neutral('\ub9e2'),
cmd_trending_up('\ub9e3'),
cmd_triangle('\ub9e8'),
cmd_triangle_outline('\ub9e4'),
cmd_triangle_small_down('\ub9e5'),
cmd_triangle_small_up('\ub9e6'),
cmd_triangle_wave('\ub9e7'),
cmd_triforce('\ub9e9'),
cmd_trophy('\ub9ef'),
cmd_trophy_award('\ub9ea'),
cmd_trophy_broken('\ub9eb'),
cmd_trophy_outline('\ub9ec'),
cmd_trophy_variant('\ub9ee'),
cmd_trophy_variant_outline('\ub9ed'),
cmd_truck('\uba03'),
cmd_truck_alert('\ub9f1'),
cmd_truck_alert_outline('\ub9f0'),
cmd_truck_cargo_container('\ub9f2'),
cmd_truck_check('\ub9f4'),
cmd_truck_check_outline('\ub9f3'),
cmd_truck_delivery('\ub9f6'),
cmd_truck_delivery_outline('\ub9f5'),
cmd_truck_fast('\ub9f8'),
cmd_truck_fast_outline('\ub9f7'),
cmd_truck_flatbed('\ub9f9'),
cmd_truck_minus('\ub9fb'),
cmd_truck_minus_outline('\ub9fa'),
cmd_truck_outline('\ub9fc'),
cmd_truck_plus('\ub9fe'),
cmd_truck_plus_outline('\ub9fd'),
cmd_truck_remove('\uba00'),
cmd_truck_remove_outline('\ub9ff'),
cmd_truck_snowflake('\uba01'),
cmd_truck_trailer('\uba02'),
cmd_trumpet('\uba04'),
cmd_tshirt_crew('\uba06'),
cmd_tshirt_crew_outline('\uba05'),
cmd_tshirt_v('\uba08'),
cmd_tshirt_v_outline('\uba07'),
cmd_tsunami('\uba09'),
cmd_tumble_dryer('\uba0c'),
cmd_tumble_dryer_alert('\uba0a'),
cmd_tumble_dryer_off('\uba0b'),
cmd_tune('\uba10'),
cmd_tune_variant('\uba0d'),
cmd_tune_vertical('\uba0f'),
cmd_tune_vertical_variant('\uba0e'),
cmd_tunnel('\uba12'),
cmd_tunnel_outline('\uba11'),
cmd_turbine('\uba13'),
cmd_turkey('\uba14'),
cmd_turnstile('\uba16'),
cmd_turnstile_outline('\uba15'),
cmd_turtle('\uba17'),
cmd_twitch('\uba18'),
cmd_twitter('\uba19'),
cmd_two_factor_authentication('\uba1a'),
cmd_typewriter('\uba1b'),
cmd_ubisoft('\uba1c'),
cmd_ubuntu('\uba1d'),
cmd_ufo('\uba1f'),
cmd_ufo_outline('\uba1e'),
cmd_ultra_high_definition('\uba20'),
cmd_umbraco('\uba21'),
cmd_umbrella('\uba28'),
cmd_umbrella_beach('\uba23'),
cmd_umbrella_beach_outline('\uba22'),
cmd_umbrella_closed('\uba26'),
cmd_umbrella_closed_outline('\uba24'),
cmd_umbrella_closed_variant('\uba25'),
cmd_umbrella_outline('\uba27'),
cmd_undo('\uba2a'),
cmd_undo_variant('\uba29'),
cmd_unfold_less_horizontal('\uba2b'),
cmd_unfold_less_vertical('\uba2c'),
cmd_unfold_more_horizontal('\uba2d'),
cmd_unfold_more_vertical('\uba2e'),
cmd_ungroup('\uba2f'),
cmd_unicode('\uba30'),
cmd_unicorn('\uba32'),
cmd_unicorn_variant('\uba31'),
cmd_unicycle('\uba33'),
cmd_unity('\uba34'),
cmd_unreal('\uba35'),
cmd_update('\uba36'),
cmd_upload('\uba3f'),
cmd_upload_lock('\uba38'),
cmd_upload_lock_outline('\uba37'),
cmd_upload_multiple('\uba39'),
cmd_upload_network('\uba3b'),
cmd_upload_network_outline('\uba3a'),
cmd_upload_off('\uba3d'),
cmd_upload_off_outline('\uba3c'),
cmd_upload_outline('\uba3e'),
cmd_usb('\uba43'),
cmd_usb_flash_drive('\uba41'),
cmd_usb_flash_drive_outline('\uba40'),
cmd_usb_port('\uba42'),
cmd_vacuum('\uba45'),
cmd_vacuum_outline('\uba44'),
cmd_valve('\uba48'),
cmd_valve_closed('\uba46'),
cmd_valve_open('\uba47'),
cmd_van_passenger('\uba49'),
cmd_van_utility('\uba4a'),
cmd_vanish('\uba4c'),
cmd_vanish_quarter('\uba4b'),
cmd_vanity_light('\uba4d'),
cmd_variable('\uba4f'),
cmd_variable_box('\uba4e'),
cmd_vector_arrange_above('\uba50'),
cmd_vector_arrange_below('\uba51'),
cmd_vector_bezier('\uba52'),
cmd_vector_circle('\uba54'),
cmd_vector_circle_variant('\uba53'),
cmd_vector_combine('\uba55'),
cmd_vector_curve('\uba56'),
cmd_vector_difference('\uba59'),
cmd_vector_difference_ab('\uba57'),
cmd_vector_difference_ba('\uba58'),
cmd_vector_ellipse('\uba5a'),
cmd_vector_intersection('\uba5b'),
cmd_vector_line('\uba5c'),
cmd_vector_link('\uba5d'),
cmd_vector_point('\uba62'),
cmd_vector_point_edit('\uba5e'),
cmd_vector_point_minus('\uba5f'),
cmd_vector_point_plus('\uba60'),
cmd_vector_point_select('\uba61'),
cmd_vector_polygon('\uba64'),
cmd_vector_polygon_variant('\uba63'),
cmd_vector_polyline('\uba69'),
cmd_vector_polyline_edit('\uba65'),
cmd_vector_polyline_minus('\uba66'),
cmd_vector_polyline_plus('\uba67'),
cmd_vector_polyline_remove('\uba68'),
cmd_vector_radius('\uba6a'),
cmd_vector_rectangle('\uba6b'),
cmd_vector_selection('\uba6c'),
cmd_vector_square('\uba73'),
cmd_vector_square_close('\uba6d'),
cmd_vector_square_edit('\uba6e'),
cmd_vector_square_minus('\uba6f'),
cmd_vector_square_open('\uba70'),
cmd_vector_square_plus('\uba71'),
cmd_vector_square_remove('\uba72'),
cmd_vector_triangle('\uba74'),
cmd_vector_union('\uba75'),
cmd_vhs('\uba76'),
cmd_vibrate('\uba78'),
cmd_vibrate_off('\uba77'),
cmd_video('\uba99'),
cmd_video_2d('\uba79'),
cmd_video_3d('\uba7c'),
cmd_video_3d_off('\uba7a'),
cmd_video_3d_variant('\uba7b'),
cmd_video_4k_box('\uba7d'),
cmd_video_account('\uba7e'),
cmd_video_box('\uba80'),
cmd_video_box_off('\uba7f'),
cmd_video_check('\uba82'),
cmd_video_check_outline('\uba81'),
cmd_video_high_definition('\uba83'),
cmd_video_image('\uba84'),
cmd_video_input_antenna('\uba85'),
cmd_video_input_component('\uba86'),
cmd_video_input_hdmi('\uba87'),
cmd_video_input_scart('\uba88'),
cmd_video_input_svideo('\uba89'),
cmd_video_marker('\uba8b'),
cmd_video_marker_outline('\uba8a'),
cmd_video_minus('\uba8d'),
cmd_video_minus_outline('\uba8c'),
cmd_video_off('\uba8f'),
cmd_video_off_outline('\uba8e'),
cmd_video_outline('\uba90'),
cmd_video_plus('\uba92'),
cmd_video_plus_outline('\uba91'),
cmd_video_stabilization('\uba93'),
cmd_video_switch('\uba95'),
cmd_video_switch_outline('\uba94'),
cmd_video_vintage('\uba96'),
cmd_video_wireless('\uba98'),
cmd_video_wireless_outline('\uba97'),
cmd_view_agenda('\uba9b'),
cmd_view_agenda_outline('\uba9a'),
cmd_view_array('\uba9d'),
cmd_view_array_outline('\uba9c'),
cmd_view_carousel('\uba9f'),
cmd_view_carousel_outline('\uba9e'),
cmd_view_column('\ubaa1'),
cmd_view_column_outline('\ubaa0'),
cmd_view_comfy('\ubaa3'),
cmd_view_comfy_outline('\ubaa2'),
cmd_view_compact('\ubaa5'),
cmd_view_compact_outline('\ubaa4'),
cmd_view_dashboard('\ubaab'),
cmd_view_dashboard_edit('\ubaa7'),
cmd_view_dashboard_edit_outline('\ubaa6'),
cmd_view_dashboard_outline('\ubaa8'),
cmd_view_dashboard_variant('\ubaaa'),
cmd_view_dashboard_variant_outline('\ubaa9'),
cmd_view_day('\ubaad'),
cmd_view_day_outline('\ubaac'),
cmd_view_gallery('\ubaaf'),
cmd_view_gallery_outline('\ubaae'),
cmd_view_grid('\ubab3'),
cmd_view_grid_outline('\ubab0'),
cmd_view_grid_plus('\ubab2'),
cmd_view_grid_plus_outline('\ubab1'),
cmd_view_headline('\ubab4'),
cmd_view_list('\ubab6'),
cmd_view_list_outline('\ubab5'),
cmd_view_module('\ubab8'),
cmd_view_module_outline('\ubab7'),
cmd_view_parallel('\ubaba'),
cmd_view_parallel_outline('\ubab9'),
cmd_view_quilt('\ubabc'),
cmd_view_quilt_outline('\ubabb'),
cmd_view_sequential('\ubabe'),
cmd_view_sequential_outline('\ubabd'),
cmd_view_split_horizontal('\ubabf'),
cmd_view_split_vertical('\ubac0'),
cmd_view_stream('\ubac2'),
cmd_view_stream_outline('\ubac1'),
cmd_view_week('\ubac4'),
cmd_view_week_outline('\ubac3'),
cmd_vimeo('\ubac5'),
cmd_violin('\ubac6'),
cmd_virtual_reality('\ubac7'),
cmd_virus('\ubacb'),
cmd_virus_off('\ubac9'),
cmd_virus_off_outline('\ubac8'),
cmd_virus_outline('\ubaca'),
cmd_vlc('\ubacc'),
cmd_voicemail('\ubacd'),
cmd_volcano('\ubacf'),
cmd_volcano_outline('\ubace'),
cmd_volleyball('\ubad0'),
cmd_volume_equal('\ubad1'),
cmd_volume_high('\ubad2'),
cmd_volume_low('\ubad3'),
cmd_volume_medium('\ubad4'),
cmd_volume_minus('\ubad5'),
cmd_volume_mute('\ubad6'),
cmd_volume_off('\ubad7'),
cmd_volume_plus('\ubad8'),
cmd_volume_source('\ubad9'),
cmd_volume_variant_off('\ubada'),
cmd_volume_vibrate('\ubadb'),
cmd_vote('\ubadd'),
cmd_vote_outline('\ubadc'),
cmd_vpn('\ubade'),
cmd_vuejs('\ubadf'),
cmd_vuetify('\ubae0'),
cmd_walk('\ubae1'),
cmd_wall('\ubaed'),
cmd_wall_fire('\ubae2'),
cmd_wall_sconce('\ubaec'),
cmd_wall_sconce_flat('\ubae6'),
cmd_wall_sconce_flat_outline('\ubae3'),
cmd_wall_sconce_flat_variant('\ubae5'),
cmd_wall_sconce_flat_variant_outline('\ubae4'),
cmd_wall_sconce_outline('\ubae7'),
cmd_wall_sconce_round('\ubaeb'),
cmd_wall_sconce_round_outline('\ubae8'),
cmd_wall_sconce_round_variant('\ubaea'),
cmd_wall_sconce_round_variant_outline('\ubae9'),
cmd_wallet('\ubaf4'),
cmd_wallet_giftcard('\ubaee'),
cmd_wallet_membership('\ubaef'),
cmd_wallet_outline('\ubaf0'),
cmd_wallet_plus('\ubaf2'),
cmd_wallet_plus_outline('\ubaf1'),
cmd_wallet_travel('\ubaf3'),
cmd_wallpaper('\ubaf5'),
cmd_wan('\ubaf6'),
cmd_wardrobe('\ubaf8'),
cmd_wardrobe_outline('\ubaf7'),
cmd_warehouse('\ubaf9'),
cmd_washing_machine('\ubafc'),
cmd_washing_machine_alert('\ubafa'),
cmd_washing_machine_off('\ubafb'),
cmd_watch('\ubb04'),
cmd_watch_export('\ubafe'),
cmd_watch_export_variant('\ubafd'),
cmd_watch_import('\ubb00'),
cmd_watch_import_variant('\ubaff'),
cmd_watch_variant('\ubb01'),
cmd_watch_vibrate('\ubb03'),
cmd_watch_vibrate_off('\ubb02'),
cmd_water('\ubb22'),
cmd_water_alert('\ubb06'),
cmd_water_alert_outline('\ubb05'),
cmd_water_boiler('\ubb0a'),
cmd_water_boiler_alert('\ubb07'),
cmd_water_boiler_auto('\ubb08'),
cmd_water_boiler_off('\ubb09'),
cmd_water_check('\ubb0c'),
cmd_water_check_outline('\ubb0b'),
cmd_water_circle('\ubb0d'),
cmd_water_minus('\ubb0f'),
cmd_water_minus_outline('\ubb0e'),
cmd_water_off('\ubb11'),
cmd_water_off_outline('\ubb10'),
cmd_water_opacity('\ubb12'),
cmd_water_outline('\ubb13'),
cmd_water_percent('\ubb15'),
cmd_water_percent_alert('\ubb14'),
cmd_water_plus('\ubb17'),
cmd_water_plus_outline('\ubb16'),
cmd_water_polo('\ubb18'),
cmd_water_pump('\ubb1a'),
cmd_water_pump_off('\ubb19'),
cmd_water_remove('\ubb1c'),
cmd_water_remove_outline('\ubb1b'),
cmd_water_sync('\ubb1d'),
cmd_water_thermometer('\ubb1f'),
cmd_water_thermometer_outline('\ubb1e'),
cmd_water_well('\ubb21'),
cmd_water_well_outline('\ubb20'),
cmd_waterfall('\ubb23'),
cmd_watering_can('\ubb25'),
cmd_watering_can_outline('\ubb24'),
cmd_watermark('\ubb26'),
cmd_wave('\ubb27'),
cmd_waveform('\ubb28'),
cmd_waves('\ubb2c'),
cmd_waves_arrow_left('\ubb29'),
cmd_waves_arrow_right('\ubb2a'),
cmd_waves_arrow_up('\ubb2b'),
cmd_waze('\ubb2d'),
cmd_weather_cloudy('\ubb31'),
cmd_weather_cloudy_alert('\ubb2e'),
cmd_weather_cloudy_arrow_right('\ubb2f'),
cmd_weather_cloudy_clock('\ubb30'),
cmd_weather_dust('\ubb32'),
cmd_weather_fog('\ubb33'),
cmd_weather_hail('\ubb34'),
cmd_weather_hazy('\ubb35'),
cmd_weather_hurricane('\ubb36'),
cmd_weather_lightning('\ubb38'),
cmd_weather_lightning_rainy('\ubb37'),
cmd_weather_night('\ubb3a'),
cmd_weather_night_partly_cloudy('\ubb39'),
cmd_weather_partly_cloudy('\ubb3b'),
cmd_weather_partly_lightning('\ubb3c'),
cmd_weather_partly_rainy('\ubb3d'),
cmd_weather_partly_snowy('\ubb3f'),
cmd_weather_partly_snowy_rainy('\ubb3e'),
cmd_weather_pouring('\ubb40'),
cmd_weather_rainy('\ubb41'),
cmd_weather_snowy('\ubb44'),
cmd_weather_snowy_heavy('\ubb42'),
cmd_weather_snowy_rainy('\ubb43'),
cmd_weather_sunny('\ubb47'),
cmd_weather_sunny_alert('\ubb45'),
cmd_weather_sunny_off('\ubb46'),
cmd_weather_sunset('\ubb4a'),
cmd_weather_sunset_down('\ubb48'),
cmd_weather_sunset_up('\ubb49'),
cmd_weather_tornado('\ubb4b'),
cmd_weather_windy('\ubb4d'),
cmd_weather_windy_variant('\ubb4c'),
cmd_web('\ubb58'),
cmd_web_box('\ubb4e'),
cmd_web_cancel('\ubb4f'),
cmd_web_check('\ubb50'),
cmd_web_clock('\ubb51'),
cmd_web_minus('\ubb52'),
cmd_web_off('\ubb53'),
cmd_web_plus('\ubb54'),
cmd_web_refresh('\ubb55'),
cmd_web_remove('\ubb56'),
cmd_web_sync('\ubb57'),
cmd_webcam('\ubb5a'),
cmd_webcam_off('\ubb59'),
cmd_webhook('\ubb5b'),
cmd_webpack('\ubb5c'),
cmd_webrtc('\ubb5d'),
cmd_wechat('\ubb5e'),
cmd_weight('\ubb63'),
cmd_weight_gram('\ubb5f'),
cmd_weight_kilogram('\ubb60'),
cmd_weight_lifter('\ubb61'),
cmd_weight_pound('\ubb62'),
cmd_whatsapp('\ubb64'),
cmd_wheel_barrow('\ubb65'),
cmd_wheelchair('\ubb67'),
cmd_wheelchair_accessibility('\ubb66'),
cmd_whistle('\ubb69'),
cmd_whistle_outline('\ubb68'),
cmd_white_balance_auto('\ubb6a'),
cmd_white_balance_incandescent('\ubb6b'),
cmd_white_balance_iridescent('\ubb6c'),
cmd_white_balance_sunny('\ubb6d'),
cmd_widgets('\ubb6f'),
cmd_widgets_outline('\ubb6e'),
cmd_wifi('\ubb9b'),
cmd_wifi_alert('\ubb70'),
cmd_wifi_arrow_down('\ubb71'),
cmd_wifi_arrow_left('\ubb73'),
cmd_wifi_arrow_left_right('\ubb72'),
cmd_wifi_arrow_right('\ubb74'),
cmd_wifi_arrow_up('\ubb76'),
cmd_wifi_arrow_up_down('\ubb75'),
cmd_wifi_cancel('\ubb77'),
cmd_wifi_check('\ubb78'),
cmd_wifi_cog('\ubb79'),
cmd_wifi_lock('\ubb7b'),
cmd_wifi_lock_open('\ubb7a'),
cmd_wifi_marker('\ubb7c'),
cmd_wifi_minus('\ubb7d'),
cmd_wifi_off('\ubb7e'),
cmd_wifi_plus('\ubb7f'),
cmd_wifi_refresh('\ubb80'),
cmd_wifi_remove('\ubb81'),
cmd_wifi_settings('\ubb82'),
cmd_wifi_star('\ubb83'),
cmd_wifi_strength_1('\ubb87'),
cmd_wifi_strength_1_alert('\ubb84'),
cmd_wifi_strength_1_lock('\ubb86'),
cmd_wifi_strength_1_lock_open('\ubb85'),
cmd_wifi_strength_2('\ubb8b'),
cmd_wifi_strength_2_alert('\ubb88'),
cmd_wifi_strength_2_lock('\ubb8a'),
cmd_wifi_strength_2_lock_open('\ubb89'),
cmd_wifi_strength_3('\ubb8f'),
cmd_wifi_strength_3_alert('\ubb8c'),
cmd_wifi_strength_3_lock('\ubb8e'),
cmd_wifi_strength_3_lock_open('\ubb8d'),
cmd_wifi_strength_4('\ubb93'),
cmd_wifi_strength_4_alert('\ubb90'),
cmd_wifi_strength_4_lock('\ubb92'),
cmd_wifi_strength_4_lock_open('\ubb91'),
cmd_wifi_strength_alert_outline('\ubb94'),
cmd_wifi_strength_lock_open_outline('\ubb95'),
cmd_wifi_strength_lock_outline('\ubb96'),
cmd_wifi_strength_off('\ubb98'),
cmd_wifi_strength_off_outline('\ubb97'),
cmd_wifi_strength_outline('\ubb99'),
cmd_wifi_sync('\ubb9a'),
cmd_wikipedia('\ubb9c'),
cmd_wind_power('\ubb9e'),
cmd_wind_power_outline('\ubb9d'),
cmd_wind_turbine('\ubba1'),
cmd_wind_turbine_alert('\ubb9f'),
cmd_wind_turbine_check('\ubba0'),
cmd_window_close('\ubba2'),
cmd_window_closed('\ubba4'),
cmd_window_closed_variant('\ubba3'),
cmd_window_maximize('\ubba5'),
cmd_window_minimize('\ubba6'),
cmd_window_open('\ubba8'),
cmd_window_open_variant('\ubba7'),
cmd_window_restore('\ubba9'),
cmd_window_shutter('\ubbaf'),
cmd_window_shutter_alert('\ubbaa'),
cmd_window_shutter_auto('\ubbab'),
cmd_window_shutter_cog('\ubbac'),
cmd_window_shutter_open('\ubbad'),
cmd_window_shutter_settings('\ubbae'),
cmd_windsock('\ubbb0'),
cmd_wiper('\ubbb3'),
cmd_wiper_wash('\ubbb2'),
cmd_wiper_wash_alert('\ubbb1'),
cmd_wizard_hat('\ubbb4'),
cmd_wordpress('\ubbb5'),
cmd_wrap('\ubbb7'),
cmd_wrap_disabled('\ubbb6'),
cmd_wrench('\ubbbf'),
cmd_wrench_check('\ubbb9'),
cmd_wrench_check_outline('\ubbb8'),
cmd_wrench_clock('\ubbbb'),
cmd_wrench_clock_outline('\ubbba'),
cmd_wrench_cog('\ubbbd'),
cmd_wrench_cog_outline('\ubbbc'),
cmd_wrench_outline('\ubbbe'),
cmd_xamarin('\ubbc0'),
cmd_xml('\ubbc1'),
cmd_xmpp('\ubbc2'),
cmd_yahoo('\ubbc3'),
cmd_yeast('\ubbc4'),
cmd_yin_yang('\ubbc5'),
cmd_yoga('\ubbc6'),
cmd_youtube('\ubbcb'),
cmd_youtube_gaming('\ubbc7'),
cmd_youtube_studio('\ubbc8'),
cmd_youtube_subscription('\ubbc9'),
cmd_youtube_tv('\ubbca'),
cmd_yurt('\ubbcc'),
cmd_z_wave('\ubbcd'),
cmd_zend('\ubbce'),
cmd_zigbee('\ubbcf'),
cmd_zip_box('\ubbd1'),
cmd_zip_box_outline('\ubbd0'),
cmd_zip_disk('\ubbd2'),
cmd_zodiac_aquarius('\ubbd3'),
cmd_zodiac_aries('\ubbd4'),
cmd_zodiac_cancer('\ubbd5'),
cmd_zodiac_capricorn('\ubbd6'),
cmd_zodiac_gemini('\ubbd7'),
cmd_zodiac_leo('\ubbd8'),
cmd_zodiac_libra('\ubbd9'),
cmd_zodiac_pisces('\ubbda'),
cmd_zodiac_sagittarius('\ubbdb'),
cmd_zodiac_scorpio('\ubbdc'),
cmd_zodiac_taurus('\ubbdd'),
cmd_zodiac_virgo('\ubbde');
override val typeface: ITypeface by lazy { CommunityMaterial }
}
} | apache-2.0 | 0ad9540a053abd469a51f29abf973288 | 37.959884 | 82 | 0.554158 | 3.214151 | false | false | false | false |
redundent/kotlin-xml-builder | kotlin-xml-builder/src/test/kotlin/org/redundent/kotlin/xml/CDATAElementTest.kt | 1 | 936 | package org.redundent.kotlin.xml
import org.junit.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertNotEquals
class CDATAElementTest {
@Test
fun testHashCode() {
val text = CDATAElement("test")
assertNotEquals(text.text.hashCode(), text.hashCode(), "CDATA hashcode is not just text.hashCode()")
}
@Test
fun `equals null`() {
val text = CDATAElement("test")
assertFalse(text.equals(null))
}
@Test
fun `equals different type`() {
val text = CDATAElement("test")
val other = TextElement("test")
assertNotEquals(text, other)
}
@Test
fun `equals different text`() {
val text1 = CDATAElement("text1")
val text2 = CDATAElement("text2")
assertNotEquals(text1, text2)
assertNotEquals(text2, text1)
}
@Test
fun equals() {
val text1 = CDATAElement("text1")
val text2 = CDATAElement("text1")
assertEquals(text1, text2)
assertEquals(text2, text1)
}
} | apache-2.0 | 5e098c1a5183649c5974d01b76ea63c0 | 18.520833 | 102 | 0.711538 | 3.227586 | false | true | false | false |
JuliusKunze/kotlin-native | runtime/src/main/kotlin/kotlin/text/CharCategory.kt | 1 | 4581 | /*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kotlin.text
// The values duplicate constants defined in KString.cpp.
/**
* Represents the character general category in the Unicode specification.
*/
public enum class CharCategory(public val value: Int, public val code: String) {
/**
* General category "Cn" in the Unicode specification.
*/
UNASSIGNED(0, "Cn"),
/**
* General category "Lu" in the Unicode specification.
*/
UPPERCASE_LETTER(1, "Lu"),
/**
* General category "Ll" in the Unicode specification.
*/
LOWERCASE_LETTER(2, "Ll"),
/**
* General category "Lt" in the Unicode specification.
*/
TITLECASE_LETTER(3, "Lt"),
/**
* General category "Lm" in the Unicode specification.
*/
MODIFIER_LETTER(4, "Lm"),
/**
* General category "Lo" in the Unicode specification.
*/
OTHER_LETTER(5, "Lo"),
/**
* General category "Mn" in the Unicode specification.
*/
NON_SPACING_MARK(6, "Mn"),
/**
* General category "Me" in the Unicode specification.
*/
ENCLOSING_MARK(7, "Me"),
/**
* General category "Mc" in the Unicode specification.
*/
COMBINING_SPACING_MARK(8, "Mc"),
/**
* General category "Nd" in the Unicode specification.
*/
DECIMAL_DIGIT_NUMBER(9, "Nd"),
/**
* General category "Nl" in the Unicode specification.
*/
LETTER_NUMBER(10, "Nl"),
/**
* General category "No" in the Unicode specification.
*/
OTHER_NUMBER(11, "No"),
/**
* General category "Zs" in the Unicode specification.
*/
SPACE_SEPARATOR(12, "Zs"),
/**
* General category "Zl" in the Unicode specification.
*/
LINE_SEPARATOR(13, "Zl"),
/**
* General category "Zp" in the Unicode specification.
*/
PARAGRAPH_SEPARATOR(14, "Zp"),
/**
* General category "Cc" in the Unicode specification.
*/
CONTROL(15, "Cc"),
/**
* General category "Cf" in the Unicode specification.
*/
FORMAT(16, "Cf"),
/**
* General category "Co" in the Unicode specification.
*/
PRIVATE_USE(18, "Co"),
/**
* General category "Cs" in the Unicode specification.
*/
SURROGATE(19, "Cs"),
/**
* General category "Pd" in the Unicode specification.
*/
DASH_PUNCTUATION(20, "Pd"),
/**
* General category "Ps" in the Unicode specification.
*/
START_PUNCTUATION(21, "Ps"),
/**
* General category "Pe" in the Unicode specification.
*/
END_PUNCTUATION(22, "Pe"),
/**
* General category "Pc" in the Unicode specification.
*/
CONNECTOR_PUNCTUATION(23, "Pc"),
/**
* General category "Po" in the Unicode specification.
*/
OTHER_PUNCTUATION(24, "Po"),
/**
* General category "Sm" in the Unicode specification.
*/
MATH_SYMBOL(25, "Sm"),
/**
* General category "Sc" in the Unicode specification.
*/
CURRENCY_SYMBOL(26, "Sc"),
/**
* General category "Sk" in the Unicode specification.
*/
MODIFIER_SYMBOL(27, "Sk"),
/**
* General category "So" in the Unicode specification.
*/
OTHER_SYMBOL(28, "So"),
/**
* General category "Pi" in the Unicode specification.
*/
INITIAL_QUOTE_PUNCTUATION(29, "Pi"),
/**
* General category "Pf" in the Unicode specification.
*/
FINAL_QUOTE_PUNCTUATION(30, "Pf");
/**
* Returns `true` if [char] character belongs to this category.
*/
public operator fun contains(char: Char): Boolean = char.getType() == this.value
public companion object {
public fun valueOf(category: Int): CharCategory =
when {
category >=0 && category <= 16 -> values()[category]
category >= 18 && category <= 30 -> values()[category - 1]
else -> throw IllegalArgumentException("Category #$category is not defined.")
}
}
} | apache-2.0 | f5b58ea96382ac3de56f27a2a1ac71e8 | 23.502674 | 93 | 0.594193 | 4.134477 | false | false | false | false |
JuliusKunze/kotlin-native | backend.native/tests/external/codegen/box/delegatedProperty/kt4138.kt | 5 | 813 | import kotlin.reflect.KProperty
class Delegate<T>(var inner: T) {
operator fun getValue(t: Any?, p: KProperty<*>): T = inner
operator fun setValue(t: Any?, p: KProperty<*>, i: T) { inner = i }
}
class Foo (val f: Int) {
companion object {
val A: Foo by Delegate(Foo(11))
var B: Foo by Delegate(Foo(11))
}
}
interface FooTrait {
companion object {
val A: Foo by Delegate(Foo(11))
var B: Foo by Delegate(Foo(11))
}
}
fun box() : String {
if (Foo.A.f != 11) return "fail 1"
if (Foo.B.f != 11) return "fail 2"
Foo.B = Foo(12)
if (Foo.B.f != 12) return "fail 3"
if (FooTrait.A.f != 11) return "fail 4"
if (FooTrait.B.f != 11) return "fail 5"
FooTrait.B = Foo(12)
if (FooTrait.B.f != 12) return "fail 6"
return "OK"
}
| apache-2.0 | 2ce63f10ebe8d68acaf3121aaf86dfc1 | 20.972973 | 71 | 0.564576 | 2.967153 | false | false | false | false |
JuliusKunze/kotlin-native | backend.native/tests/external/codegen/box/destructuringDeclInLambdaParam/extensionComponents.kt | 5 | 428 | class A<T>(val x: String, val y: String, val z: T)
fun <T> foo(a: A<T>, block: (A<T>) -> String): String = block(a)
operator fun A<*>.component1() = x
object B {
operator fun A<*>.component2() = y
}
fun B.bar(): String {
operator fun <R> A<R>.component3() = z
val x = foo(A("O", "K", 123)) { (x, y, z) -> x + y + z.toString() }
if (x != "OK123") return "fail 1: $x"
return "OK"
}
fun box() = B.bar()
| apache-2.0 | 63fc7633f9b0e5071b18f7094f89454c | 19.380952 | 71 | 0.521028 | 2.517647 | false | false | false | false |
AndroidX/androidx | lifecycle/lifecycle-viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandle.kt | 3 | 16664 | /*
* Copyright 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package androidx.lifecycle
import android.os.Binder
import android.os.Build
import android.os.Bundle
import android.os.Parcelable
import android.util.Size
import android.util.SizeF
import android.util.SparseArray
import androidx.annotation.MainThread
import androidx.annotation.RestrictTo
import androidx.core.os.bundleOf
import androidx.savedstate.SavedStateRegistry
import java.io.Serializable
import java.lang.ClassCastException
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
/**
* A handle to saved state passed down to [androidx.lifecycle.ViewModel]. You should use
* [SavedStateViewModelFactory] if you want to receive this object in `ViewModel`'s
* constructor.
*
* This is a key-value map that will let you write and retrieve objects to and from the saved state.
* These values will persist after the process is killed by the system
* and remain available via the same object.
*
* You can read a value from it via [get] or observe it via [androidx.lifecycle.LiveData] returned
* by [getLiveData].
*
* You can write a value to it via [set] or setting a value to
* [androidx.lifecycle.MutableLiveData] returned by [getLiveData].
*/
class SavedStateHandle {
private val regular = mutableMapOf<String, Any?>()
private val savedStateProviders = mutableMapOf<String, SavedStateRegistry.SavedStateProvider>()
private val liveDatas = mutableMapOf<String, SavingStateLiveData<*>>()
private val flows = mutableMapOf<String, MutableStateFlow<Any?>>()
private val savedStateProvider =
SavedStateRegistry.SavedStateProvider {
// Get the saved state from each SavedStateProvider registered with this
// SavedStateHandle, iterating through a copy to avoid re-entrance
val map = savedStateProviders.toMap()
for ((key, value) in map) {
val savedState = value.saveState()
set(key, savedState)
}
// Convert the Map of current values into a Bundle
val keySet: Set<String> = regular.keys
val keys: ArrayList<String> = ArrayList(keySet.size)
val value: ArrayList<Any?> = ArrayList(keys.size)
for (key in keySet) {
keys.add(key)
value.add(regular[key])
}
bundleOf(KEYS to keys, VALUES to value)
}
/**
* Creates a handle with the given initial arguments.
*
* @param initialState initial arguments for the SavedStateHandle
*/
constructor(initialState: Map<String, Any?>) {
regular.putAll(initialState)
}
/**
* Creates a handle with the empty state.
*/
constructor()
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
fun savedStateProvider(): SavedStateRegistry.SavedStateProvider {
return savedStateProvider
}
/**
* @param key The identifier for the value
*
* @return true if there is value associated with the given key.
*/
@MainThread
operator fun contains(key: String): Boolean {
return regular.containsKey(key)
}
/**
* Returns a [androidx.lifecycle.LiveData] that access data associated with the given key.
*
* @param key The identifier for the value
*
* @see getLiveData
*/
@MainThread
fun <T> getLiveData(key: String): MutableLiveData<T> {
@Suppress("UNCHECKED_CAST")
return getLiveDataInternal(key, false, null) as MutableLiveData<T>
}
/**
* Returns a [androidx.lifecycle.LiveData] that access data associated with the given key.
*
* ```
* `LiveData<String> liveData = savedStateHandle.get(KEY, "defaultValue");`
* ```
* Keep in mind that [LiveData] can have `null` as a valid value. If the
* `initialValue` is `null` and the data does not already exist in the
* [SavedStateHandle], the value of the returned [LiveData] will be set to
* `null` and observers will be notified. You can call [getLiveData] if
* you want to avoid dispatching `null` to observers.
*
* ```
* `String defaultValue = ...; // nullable
* LiveData<String> liveData;
* if (defaultValue != null) {
* liveData = savedStateHandle.getLiveData(KEY, defaultValue);
* } else {
* liveData = savedStateHandle.getLiveData(KEY);
* }`
*```
*
* @param key The identifier for the value
* @param initialValue If no value exists with the given `key`, a new one is created
* with the given `initialValue`. Note that passing `null` will
* create a [LiveData] with `null` value.
*/
@MainThread
fun <T> getLiveData(
key: String,
initialValue: T
): MutableLiveData<T> {
return getLiveDataInternal(key, true, initialValue)
}
private fun <T> getLiveDataInternal(
key: String,
hasInitialValue: Boolean,
initialValue: T
): MutableLiveData<T> {
@Suppress("UNCHECKED_CAST")
val liveData = liveDatas[key] as? MutableLiveData<T>
if (liveData != null) {
return liveData
}
// double hashing but null is valid value
val mutableLd: SavingStateLiveData<T> = if (regular.containsKey(key)) {
@Suppress("UNCHECKED_CAST")
SavingStateLiveData(this, key, regular[key] as T)
} else if (hasInitialValue) {
regular[key] = initialValue
SavingStateLiveData(this, key, initialValue)
} else {
SavingStateLiveData(this, key)
}
liveDatas[key] = mutableLd
return mutableLd
}
/**
* Returns a [StateFlow] that will emit the currently active value associated with the given
* key.
*
* ```
* val flow = savedStateHandle.getStateFlow(KEY, "defaultValue")
* ```
* Since this is a [StateFlow] there will always be a value available which, is why an initial
* value must be provided. The value of this flow is changed by making a call to [set], passing
* in the key that references this flow.
*
* If there is already a value associated with the given key, the initial value will be ignored.
*
* @param key The identifier for the flow
* @param initialValue If no value exists with the given `key`, a new one is created
* with the given `initialValue`.
*/
@MainThread
fun <T> getStateFlow(key: String, initialValue: T): StateFlow<T> {
@Suppress("UNCHECKED_CAST")
// If a flow exists we should just return it, and since it is a StateFlow and a value must
// always be set, we know a value must already be available
return flows.getOrPut(key) {
// If there is not a value associated with the key, add the initial value, otherwise,
// use the one we already have.
if (!regular.containsKey(key)) {
regular[key] = initialValue
}
MutableStateFlow(regular[key]).apply { flows[key] = this }
}.asStateFlow() as StateFlow<T>
}
/**
* Returns all keys contained in this [SavedStateHandle]
*
* Returned set contains all keys: keys used to get LiveData-s, to set SavedStateProviders and
* keys used in regular [set].
*/
@MainThread
fun keys(): Set<String> = regular.keys + savedStateProviders.keys + liveDatas.keys
/**
* Returns a value associated with the given key.
*
* @param key a key used to retrieve a value.
*/
@MainThread
operator fun <T> get(key: String): T? {
return try {
@Suppress("UNCHECKED_CAST")
regular[key] as T?
} catch (e: ClassCastException) {
// Instead of failing on ClassCastException, we remove the value from the
// SavedStateHandle and return null.
remove<T>(key)
null
}
}
/**
* Associate the given value with the key. The value must have a type that could be stored in
* [android.os.Bundle]
*
* This also sets values for any active [LiveData]s or [Flow]s.
*
* @param key a key used to associate with the given value.
* @param value object of any type that can be accepted by Bundle.
*
* @throws IllegalArgumentException value cannot be saved in saved state
*/
@MainThread
operator fun <T> set(key: String, value: T?) {
if (!validateValue(value)) {
throw IllegalArgumentException(
"Can't put value with type ${value!!::class.java} into saved state"
)
}
@Suppress("UNCHECKED_CAST")
val mutableLiveData = liveDatas[key] as? MutableLiveData<T?>?
if (mutableLiveData != null) {
// it will set value;
mutableLiveData.setValue(value)
} else {
regular[key] = value
}
flows[key]?.value = value
}
/**
* Removes a value associated with the given key. If there is a [LiveData] and/or [StateFlow]
* associated with the given key, they will be removed as well.
*
* All changes to [androidx.lifecycle.LiveData]s or [StateFlow]s previously
* returned by [SavedStateHandle.getLiveData] or [getStateFlow] won't be reflected in
* the saved state. Also that `LiveData` or `StateFlow` won't receive any updates about new
* values associated by the given key.
*
* @param key a key
* @return a value that was previously associated with the given key.
*/
@MainThread
fun <T> remove(key: String): T? {
@Suppress("UNCHECKED_CAST")
val latestValue = regular.remove(key) as T?
val liveData = liveDatas.remove(key)
liveData?.detach()
flows.remove(key)
return latestValue
}
/**
* Set a [SavedStateProvider] that will have its state saved into this SavedStateHandle.
* This provides a mechanism to lazily provide the [Bundle] of saved state for the given key.
*
* Calls to [get] with this same key will return the previously saved state as a [Bundle] if it
* exists.
*
* ```
* Bundle previousState = savedStateHandle.get("custom_object");
* if (previousState != null) {
* // Convert the previousState into your custom object
* }
* savedStateHandle.setSavedStateProvider("custom_object", () -> {
* Bundle savedState = new Bundle();
* // Put your custom object into the Bundle, doing any conversion required
* return savedState;
* });
* ```
*
* Note: calling this method within [SavedStateProvider.saveState] is supported, but
* will only affect future state saving operations.
*
* @param key a key which will populated with a [Bundle] produced by the provider
* @param provider a SavedStateProvider which will receive a callback to
* [SavedStateProvider.saveState] when the state should be saved
*/
@MainThread
fun setSavedStateProvider(key: String, provider: SavedStateRegistry.SavedStateProvider) {
savedStateProviders[key] = provider
}
/**
* Clear any [SavedStateProvider] that was previously set via
* [setSavedStateProvider].
*
* Note: calling this method within [SavedStateProvider.saveState] is supported, but
* will only affect future state saving operations.
*
* @param key a key previously used with [setSavedStateProvider]
*/
@MainThread
fun clearSavedStateProvider(key: String) {
savedStateProviders.remove(key)
}
internal class SavingStateLiveData<T> : MutableLiveData<T> {
private var key: String
private var handle: SavedStateHandle?
constructor(handle: SavedStateHandle?, key: String, value: T) : super(value) {
this.key = key
this.handle = handle
}
constructor(handle: SavedStateHandle?, key: String) : super() {
this.key = key
this.handle = handle
}
override fun setValue(value: T) {
handle?.let {
it.regular[key] = value
it.flows[key]?.value = value
}
super.setValue(value)
}
fun detach() {
handle = null
}
}
companion object {
private const val VALUES = "values"
private const val KEYS = "keys"
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@JvmStatic
@Suppress("DEPRECATION")
fun createHandle(restoredState: Bundle?, defaultState: Bundle?): SavedStateHandle {
if (restoredState == null) {
return if (defaultState == null) {
// No restored state and no default state -> empty SavedStateHandle
SavedStateHandle()
} else {
val state: MutableMap<String, Any?> = HashMap()
for (key in defaultState.keySet()) {
state[key] = defaultState[key]
}
SavedStateHandle(state)
}
}
// When restoring state, we use the restored state as the source of truth
// and ignore any default state, thus ensuring we are exactly the same
// state that was saved.
val keys: ArrayList<*>? = restoredState.getParcelableArrayList<Parcelable>(KEYS)
val values: ArrayList<*>? = restoredState.getParcelableArrayList<Parcelable>(VALUES)
check(!(keys == null || values == null || keys.size != values.size)) {
"Invalid bundle passed as restored state"
}
val state = mutableMapOf<String, Any?>()
for (i in keys.indices) {
state[keys[i] as String] = values[i]
}
return SavedStateHandle(state)
}
/**
* @suppress
*/
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
fun validateValue(value: Any?): Boolean {
if (value == null) {
return true
}
for (cl in ACCEPTABLE_CLASSES) {
if (cl!!.isInstance(value)) {
return true
}
}
return false
}
// doesn't have Integer, Long etc box types because they are "Serializable"
private val ACCEPTABLE_CLASSES = arrayOf( // baseBundle
Boolean::class.javaPrimitiveType,
BooleanArray::class.java,
Double::class.javaPrimitiveType,
DoubleArray::class.java,
Int::class.javaPrimitiveType,
IntArray::class.java,
Long::class.javaPrimitiveType,
LongArray::class.java,
String::class.java,
Array<String>::class.java, // bundle
Binder::class.java,
Bundle::class.java,
Byte::class.javaPrimitiveType,
ByteArray::class.java,
Char::class.javaPrimitiveType,
CharArray::class.java,
CharSequence::class.java,
Array<CharSequence>::class.java,
// type erasure ¯\_(ツ)_/¯, we won't eagerly check elements contents
ArrayList::class.java,
Float::class.javaPrimitiveType,
FloatArray::class.java,
Parcelable::class.java,
Array<Parcelable>::class.java,
Serializable::class.java,
Short::class.javaPrimitiveType,
ShortArray::class.java,
SparseArray::class.java,
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
Size::class.java
else
Int::class.javaPrimitiveType,
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
SizeF::class.java
else
Int::class.javaPrimitiveType
)
}
}
| apache-2.0 | 0916d89fbd84c397f110d0a79b874b0a | 36.104677 | 100 | 0.612725 | 4.71821 | false | false | false | false |
smmribeiro/intellij-community | plugins/kotlin/jvm-debugger/core/src/org/jetbrains/kotlin/idea/debugger/stackFrame/KotlinStackFrame.kt | 2 | 11342 | // Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.kotlin.idea.debugger.stackFrame
import com.intellij.debugger.engine.DebugProcessImpl
import com.intellij.debugger.engine.JavaStackFrame
import com.intellij.debugger.engine.JavaValue
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl
import com.intellij.debugger.jdi.LocalVariableProxyImpl
import com.intellij.debugger.jdi.StackFrameProxyImpl
import com.intellij.debugger.ui.impl.watch.*
import com.intellij.xdebugger.frame.XValueChildrenList
import com.sun.jdi.ObjectReference
import com.sun.jdi.Value
import org.jetbrains.kotlin.codegen.AsmUtil
import org.jetbrains.kotlin.codegen.AsmUtil.THIS
import org.jetbrains.kotlin.codegen.DESTRUCTURED_LAMBDA_ARGUMENT_VARIABLE_PREFIX
import org.jetbrains.kotlin.codegen.coroutines.CONTINUATION_VARIABLE_NAME
import org.jetbrains.kotlin.codegen.coroutines.SUSPEND_FUNCTION_COMPLETION_PARAMETER_NAME
import org.jetbrains.kotlin.codegen.inline.INLINE_FUN_VAR_SUFFIX
import org.jetbrains.kotlin.codegen.inline.isFakeLocalVariableForInline
import org.jetbrains.kotlin.idea.debugger.*
import org.jetbrains.kotlin.idea.debugger.evaluate.KotlinDebuggerEvaluator
open class KotlinStackFrame(stackFrameDescriptorImpl: StackFrameDescriptorImpl) : JavaStackFrame(stackFrameDescriptorImpl, true) {
private val kotlinVariableViewService = ToggleKotlinVariablesState.getService()
constructor(frame: StackFrameProxyImpl) : this(StackFrameDescriptorImpl(frame, MethodsTracker()))
private val kotlinEvaluator by lazy {
val debugProcess = descriptor.debugProcess as DebugProcessImpl // Cast as in JavaStackFrame
KotlinDebuggerEvaluator(debugProcess, this@KotlinStackFrame)
}
override fun getEvaluator() = kotlinEvaluator
override fun buildLocalVariables(
evaluationContext: EvaluationContextImpl,
children: XValueChildrenList,
localVariables: List<LocalVariableProxyImpl>
) {
if (!kotlinVariableViewService.kotlinVariableView) {
return super.buildLocalVariables(evaluationContext, children, localVariables)
}
buildVariablesInKotlinView(evaluationContext, children, localVariables)
}
override fun superBuildVariables(evaluationContext: EvaluationContextImpl, children: XValueChildrenList) {
if (!kotlinVariableViewService.kotlinVariableView) {
return super.superBuildVariables(evaluationContext, children)
}
buildVariablesInKotlinView(evaluationContext, children, visibleVariables)
}
private fun buildVariablesInKotlinView(
evaluationContext: EvaluationContextImpl,
children: XValueChildrenList,
variables: List<LocalVariableProxyImpl>
) {
val nodeManager = evaluationContext.debugProcess.xdebugProcess?.nodeManager
fun addItem(variable: LocalVariableProxyImpl) {
if (nodeManager == null) {
return
}
val variableDescriptor = nodeManager.getLocalVariableDescriptor(null, variable)
children.add(JavaValue.create(null, variableDescriptor, evaluationContext, nodeManager, false))
}
val (thisVariables, otherVariables) = variables
.partition { it.name() == THIS || it is ThisLocalVariable }
val existingVariables = ExistingVariables(thisVariables, otherVariables)
if (!removeSyntheticThisObject(evaluationContext, children, existingVariables) && thisVariables.isNotEmpty()) {
remapThisObjectForOuterThis(evaluationContext, children, existingVariables)
}
thisVariables.forEach(::addItem)
otherVariables.forEach(::addItem)
}
private fun removeSyntheticThisObject(
evaluationContext: EvaluationContextImpl,
children: XValueChildrenList,
existingVariables: ExistingVariables
): Boolean {
val thisObject = evaluationContext.frameProxy?.thisObject() ?: return false
if (thisObject.type().isSubtype(CONTINUATION_TYPE)) {
ExistingInstanceThisRemapper.find(children)?.remove()
return true
}
val thisObjectType = thisObject.type()
if (thisObjectType.isSubtype(Function::class.java.name) && '$' in thisObjectType.signature()) {
val existingThis = ExistingInstanceThisRemapper.find(children)
if (existingThis != null) {
existingThis.remove()
val containerJavaValue = existingThis.value as? JavaValue
val containerValue = containerJavaValue?.descriptor?.calcValue(evaluationContext) as? ObjectReference
if (containerValue != null) {
attachCapturedValues(evaluationContext, children, containerValue, existingVariables)
}
}
return true
}
return removeCallSiteThisInInlineFunction(evaluationContext, children)
}
private fun removeCallSiteThisInInlineFunction(evaluationContext: EvaluationContextImpl, children: XValueChildrenList): Boolean {
val frameProxy = evaluationContext.frameProxy
val variables = frameProxy?.safeVisibleVariables() ?: return false
val inlineDepth = getInlineDepth(variables)
val declarationSiteThis = variables.firstOrNull { v ->
val name = v.name()
name.endsWith(INLINE_FUN_VAR_SUFFIX) && dropInlineSuffix(name) == AsmUtil.INLINE_DECLARATION_SITE_THIS
}
if (inlineDepth > 0 && declarationSiteThis != null) {
ExistingInstanceThisRemapper.find(children)?.remove()
return true
}
return false
}
private fun attachCapturedValues(
evaluationContext: EvaluationContextImpl,
children: XValueChildrenList,
containerValue: ObjectReference,
existingVariables: ExistingVariables
) {
val nodeManager = evaluationContext.debugProcess.xdebugProcess?.nodeManager ?: return
attachCapturedValues(containerValue, existingVariables) { valueData ->
val valueDescriptor = nodeManager.getDescriptor(this.descriptor, valueData)
children.add(JavaValue.create(null, valueDescriptor, evaluationContext, nodeManager, false))
}
}
private fun remapThisObjectForOuterThis(
evaluationContext: EvaluationContextImpl,
children: XValueChildrenList,
existingVariables: ExistingVariables
) {
val thisObject = evaluationContext.frameProxy?.thisObject() ?: return
val variable = ExistingInstanceThisRemapper.find(children) ?: return
val thisLabel = generateThisLabel(thisObject.referenceType())
val thisName = thisLabel?.let(::getThisName)
if (thisName == null || !existingVariables.add(ExistingVariable.LabeledThis(thisLabel))) {
variable.remove()
return
}
// add additional checks?
variable.remapName(getThisName(thisLabel))
}
// The visible variables are queried twice in the common path through [JavaStackFrame.buildVariables],
// so we cache them the first time through.
protected open val _visibleVariables: List<LocalVariableProxyImpl> by lazy {
InlineStackFrameVariableHolder.fromStackFrame(stackFrameProxy).visibleVariables.remapInKotlinView()
}
final override fun getVisibleVariables(): List<LocalVariableProxyImpl> {
if (!kotlinVariableViewService.kotlinVariableView) {
val allVisibleVariables = stackFrameProxy.safeVisibleVariables()
return allVisibleVariables.map { variable ->
if (isFakeLocalVariableForInline(variable.name())) variable.wrapSyntheticInlineVariable() else variable
}
}
return _visibleVariables
}
protected fun List<LocalVariableProxyImpl>.remapInKotlinView(): List<LocalVariableProxyImpl> {
val (thisVariables, otherVariables) = filter { variable ->
val name = variable.name()
!isFakeLocalVariableForInline(name) &&
!name.startsWith(DESTRUCTURED_LAMBDA_ARGUMENT_VARIABLE_PREFIX) &&
!name.startsWith(AsmUtil.LOCAL_FUNCTION_VARIABLE_PREFIX) &&
name != CONTINUATION_VARIABLE_NAME &&
name != SUSPEND_FUNCTION_COMPLETION_PARAMETER_NAME
}.partition { variable ->
val name = variable.name()
name == THIS ||
name == AsmUtil.THIS_IN_DEFAULT_IMPLS ||
name.startsWith(AsmUtil.LABELED_THIS_PARAMETER) ||
name == AsmUtil.INLINE_DECLARATION_SITE_THIS
}
// The variables are already sorted, so the mainThis is the last one in the list.
val mainThis = thisVariables.lastOrNull()
val otherThis = thisVariables.dropLast(1)
val remappedMainThis = mainThis?.remapVariableIfNeeded(THIS)
val remappedOtherThis = otherThis.map { it.remapVariableIfNeeded() }
val remappedOther = otherVariables.map { it.remapVariableIfNeeded() }
return (remappedOtherThis + listOfNotNull(remappedMainThis) + remappedOther)
}
private fun LocalVariableProxyImpl.remapVariableIfNeeded(customName: String? = null): LocalVariableProxyImpl {
val name = dropInlineSuffix(this.name())
return when {
name.startsWith(AsmUtil.LABELED_THIS_PARAMETER) -> {
val label = name.drop(AsmUtil.LABELED_THIS_PARAMETER.length)
clone(customName ?: getThisName(label), label)
}
name == AsmUtil.THIS_IN_DEFAULT_IMPLS -> clone(customName ?: ("$THIS (outer)"), null)
name == AsmUtil.RECEIVER_PARAMETER_NAME -> clone(customName ?: ("$THIS (receiver)"), null)
name == AsmUtil.INLINE_DECLARATION_SITE_THIS -> {
val label = generateThisLabel(frame.getValue(this)?.type())
if (label != null) {
clone(customName ?: getThisName(label), label)
} else {
this
}
}
name != this.name() -> {
object : LocalVariableProxyImpl(frame, variable) {
override fun name() = name
}
}
else -> this
}
}
private fun LocalVariableProxyImpl.clone(name: String, label: String?): LocalVariableProxyImpl {
return object : LocalVariableProxyImpl(frame, variable), ThisLocalVariable {
override fun name() = name
override val label = label
}
}
override fun equals(other: Any?): Boolean {
val eq = super.equals(other)
return other is KotlinStackFrame && eq
}
}
interface ThisLocalVariable {
val label: String?
}
private fun LocalVariableProxyImpl.wrapSyntheticInlineVariable(): LocalVariableProxyImpl {
val proxyWrapper = object : StackFrameProxyImpl(frame.threadProxy(), frame.stackFrame, frame.indexFromBottom) {
override fun getValue(localVariable: LocalVariableProxyImpl): Value {
return frame.virtualMachine.mirrorOfVoid()
}
}
return LocalVariableProxyImpl(proxyWrapper, variable)
}
| apache-2.0 | dfe89acf22655828f54a446f59eb8aec | 42.791506 | 158 | 0.686916 | 5.344958 | false | false | false | false |
smmribeiro/intellij-community | plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/intentions/AddNamesToCallArgumentsIntention.kt | 3 | 2216 | // Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.kotlin.idea.intentions
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.util.TextRange
import org.jetbrains.kotlin.idea.KotlinBundle
import org.jetbrains.kotlin.idea.caches.resolve.resolveToCall
import org.jetbrains.kotlin.idea.project.languageVersionSettings
import org.jetbrains.kotlin.psi.KtCallElement
import org.jetbrains.kotlin.psi.KtLambdaArgument
import org.jetbrains.kotlin.psi.KtValueArgument
import org.jetbrains.kotlin.psi.LambdaArgument
import org.jetbrains.kotlin.psi.psiUtil.endOffset
import org.jetbrains.kotlin.psi.psiUtil.startOffset
class AddNamesToCallArgumentsIntention : SelfTargetingRangeIntention<KtCallElement>(
KtCallElement::class.java,
KotlinBundle.lazyMessage("add.names.to.call.arguments")
) {
override fun applicabilityRange(element: KtCallElement): TextRange? {
val arguments = element.valueArguments
if (arguments.all { it.isNamed() || it is LambdaArgument }) return null
val resolvedCall = element.resolveToCall() ?: return null
if (!resolvedCall.candidateDescriptor.hasStableParameterNames()) return null
if (arguments.all {
AddNameToArgumentIntention.argumentMatchedAndCouldBeNamedInCall(it, resolvedCall, element.languageVersionSettings)
}
) {
val calleeExpression = element.calleeExpression ?: return null
if (arguments.size < 2) return calleeExpression.textRange
val endOffset = (arguments.firstOrNull() as? KtValueArgument)?.endOffset ?: return null
return TextRange(calleeExpression.startOffset, endOffset)
}
return null
}
override fun applyTo(element: KtCallElement, editor: Editor?) {
val arguments = element.valueArguments
val resolvedCall = element.resolveToCall() ?: return
for (argument in arguments) {
if (argument !is KtValueArgument || argument is KtLambdaArgument) continue
AddNameToArgumentIntention.apply(argument, resolvedCall)
}
}
} | apache-2.0 | f16a7d6fae7bbdadcd5f34a5812f7506 | 44.244898 | 158 | 0.742329 | 5.036364 | false | false | false | false |
fabmax/kool | kool-physics/src/jvmMain/kotlin/de/fabmax/kool/physics/joints/PrismaticJoint.kt | 1 | 1408 | package de.fabmax.kool.physics.joints
import de.fabmax.kool.math.Mat4f
import de.fabmax.kool.physics.Physics
import de.fabmax.kool.physics.RigidActor
import de.fabmax.kool.physics.createPxTransform
import de.fabmax.kool.physics.toPxTransform
import org.lwjgl.system.MemoryStack
import physx.PxTopLevelFunctions
import physx.extensions.*
actual class PrismaticJoint actual constructor(
val bodyA: RigidActor,
val bodyB: RigidActor,
posA: Mat4f,
posB: Mat4f
) : Joint() {
actual val frameA = Mat4f().set(posA)
actual val frameB = Mat4f().set(posB)
override val pxJoint: PxPrismaticJoint
init {
Physics.checkIsLoaded()
MemoryStack.stackPush().use { mem ->
val frmA = frameA.toPxTransform(mem.createPxTransform())
val frmB = frameB.toPxTransform(mem.createPxTransform())
pxJoint = PxTopLevelFunctions.PrismaticJointCreate(Physics.physics, bodyA.pxRigidActor, frmA, bodyB.pxRigidActor, frmB)
}
}
actual fun setLimit(lowerLimit: Float, upperLimit: Float, stiffness: Float, damping: Float) {
pxJoint.setLimit(PxJointLinearLimitPair(lowerLimit, upperLimit, PxSpring(stiffness, damping)))
pxJoint.setPrismaticJointFlag(PxPrismaticJointFlagEnum.eLIMIT_ENABLED, true)
}
actual fun removeLimit() {
pxJoint.setPrismaticJointFlag(PxPrismaticJointFlagEnum.eLIMIT_ENABLED, false)
}
} | apache-2.0 | 2d1e301e4a67a9384b83994bb485f980 | 35.128205 | 131 | 0.734375 | 3.705263 | false | false | false | false |
mdaniel/intellij-community | plugins/kotlin/jvm-debugger/coroutines/src/org/jetbrains/kotlin/idea/debugger/coroutine/util/CoroutineUtils.kt | 1 | 6878 | // Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.kotlin.idea.debugger.coroutine.util
import com.intellij.debugger.engine.SuspendContextImpl
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl
import com.intellij.debugger.impl.DebuggerUtilsEx
import com.intellij.debugger.jdi.StackFrameProxyImpl
import com.intellij.debugger.jdi.ThreadReferenceProxyImpl
import com.intellij.openapi.project.Project
import com.intellij.psi.JavaPsiFacade
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.xdebugger.XDebuggerUtil
import com.intellij.xdebugger.XSourcePosition
import com.sun.jdi.*
import org.jetbrains.kotlin.idea.debugger.SUSPEND_LAMBDA_CLASSES
import org.jetbrains.kotlin.idea.debugger.base.util.*
import org.jetbrains.kotlin.idea.debugger.core.canRunEvaluation
import org.jetbrains.kotlin.idea.debugger.core.invokeInManagerThread
import org.jetbrains.kotlin.idea.debugger.coroutine.data.SuspendExitMode
import org.jetbrains.kotlin.idea.debugger.evaluate.DefaultExecutionContext
import org.jetbrains.kotlin.idea.util.application.isUnitTestMode
import org.jetbrains.kotlin.idea.util.application.runReadAction
const val CREATION_STACK_TRACE_SEPARATOR = "\b\b\b" // the "\b\b\b" is used as creation stacktrace separator in kotlinx.coroutines
const val CREATION_CLASS_NAME = "_COROUTINE._CREATION"
fun Method.isInvokeSuspend(): Boolean =
name() == "invokeSuspend" && signature() == "(Ljava/lang/Object;)Ljava/lang/Object;"
fun Method.isInvoke(): Boolean =
name() == "invoke" && signature().contains("Ljava/lang/Object;)Ljava/lang/Object;")
fun Method.isSuspendLambda() =
isInvokeSuspend() && declaringType().isSuspendLambda()
fun Method.hasContinuationParameter() =
signature().contains("Lkotlin/coroutines/Continuation;)")
fun Location.getSuspendExitMode(): SuspendExitMode {
val method = safeMethod() ?: return SuspendExitMode.NONE
if (method.isSuspendLambda())
return SuspendExitMode.SUSPEND_LAMBDA
else if (method.hasContinuationParameter())
return SuspendExitMode.SUSPEND_METHOD_PARAMETER
else if ((method.isInvokeSuspend() || method.isInvoke()) && safeCoroutineExitPointLineNumber())
return SuspendExitMode.SUSPEND_METHOD
return SuspendExitMode.NONE
}
fun Location.safeCoroutineExitPointLineNumber() =
(wrapIllegalArgumentException { DebuggerUtilsEx.getLineNumber(this, false) } ?: -2) == -1
fun ReferenceType.isContinuation() =
isBaseContinuationImpl() || isSubtype("kotlin.coroutines.Continuation")
fun Type.isBaseContinuationImpl() =
isSubtype("kotlin.coroutines.jvm.internal.BaseContinuationImpl")
fun Type.isAbstractCoroutine() =
isSubtype("kotlinx.coroutines.AbstractCoroutine")
fun Type.isCoroutineScope() =
isSubtype("kotlinx.coroutines.CoroutineScope")
fun Type.isSubTypeOrSame(className: String) =
name() == className || isSubtype(className)
fun ReferenceType.isSuspendLambda() =
SUSPEND_LAMBDA_CLASSES.any { isSubtype(it) }
fun Location.isInvokeSuspend() =
safeMethod()?.isInvokeSuspend() ?: false
fun Location.isInvokeSuspendWithNegativeLineNumber() =
isInvokeSuspend() && safeLineNumber() < 0
fun Location.isFilteredInvokeSuspend() =
isInvokeSuspend() || isInvokeSuspendWithNegativeLineNumber()
fun StackFrameProxyImpl.variableValue(variableName: String): ObjectReference? {
val continuationVariable = safeVisibleVariableByName(variableName) ?: return null
return getValue(continuationVariable) as? ObjectReference ?: return null
}
fun StackFrameProxyImpl.continuationVariableValue(): ObjectReference? =
variableValue("\$continuation")
fun StackFrameProxyImpl.thisVariableValue(): ObjectReference? =
this.thisObject()
private fun Method.isGetCoroutineSuspended() =
signature() == "()Ljava/lang/Object;" && name() == "getCOROUTINE_SUSPENDED" && declaringType().name() == "kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsKt"
fun DefaultExecutionContext.findCoroutineMetadataType() =
debugProcess.invokeInManagerThread { findClassSafe("kotlin.coroutines.jvm.internal.DebugMetadataKt") }
fun DefaultExecutionContext.findDispatchedContinuationReferenceType(): List<ReferenceType>? =
vm.classesByName("kotlinx.coroutines.DispatchedContinuation")
fun DefaultExecutionContext.findCancellableContinuationImplReferenceType(): List<ReferenceType>? =
vm.classesByName("kotlinx.coroutines.CancellableContinuationImpl")
fun hasGetCoroutineSuspended(frames: List<StackFrameProxyImpl>) =
frames.indexOfFirst { it.safeLocation()?.safeMethod()?.isGetCoroutineSuspended() == true }
fun StackTraceElement.isCreationSeparatorFrame() =
className.startsWith(CREATION_STACK_TRACE_SEPARATOR) ||
className == CREATION_CLASS_NAME
fun Location.findPosition(project: Project) =
runReadAction {
if (declaringType() != null)
getPosition(project, declaringType().name(), lineNumber())
else
null
}
private fun getPosition(project: Project, className: String, lineNumber: Int): XSourcePosition? {
val psiFacade = JavaPsiFacade.getInstance(project)
val psiClass = psiFacade.findClass(
className.substringBefore("$"), // find outer class, for which psi exists TODO
GlobalSearchScope.everythingScope(project)
)
val classFile = psiClass?.containingFile?.virtualFile
// to convert to 0-based line number or '-1' to do not move
val localLineNumber = if (lineNumber > 0) lineNumber - 1 else return null
return XDebuggerUtil.getInstance().createPosition(classFile, localLineNumber)
}
fun SuspendContextImpl.executionContext() =
invokeInManagerThread { DefaultExecutionContext(EvaluationContextImpl(this, this.frameProxy)) }
fun <T : Any> SuspendContextImpl.invokeInManagerThread(f: () -> T?): T? =
debugProcess.invokeInManagerThread { f() }
fun ThreadReferenceProxyImpl.supportsEvaluation(): Boolean =
threadReference?.isSuspended ?: false
fun SuspendContextImpl.supportsEvaluation() =
this.debugProcess.canRunEvaluation || isUnitTestMode()
fun threadAndContextSupportsEvaluation(suspendContext: SuspendContextImpl, frameProxy: StackFrameProxyImpl?) =
suspendContext.invokeInManagerThread {
suspendContext.supportsEvaluation() && frameProxy?.threadProxy()?.supportsEvaluation() ?: false
} ?: false
fun Location.sameLineAndMethod(location: Location?): Boolean =
location != null && location.safeMethod() == safeMethod() && location.safeLineNumber() == safeLineNumber()
fun Location.isFilterFromTop(location: Location?): Boolean =
isFilteredInvokeSuspend() || sameLineAndMethod(location) || location?.safeMethod() == safeMethod()
fun Location.isFilterFromBottom(location: Location?): Boolean =
sameLineAndMethod(location) | apache-2.0 | 824c2f2cdb18628474635eb9dc30171a | 43.096154 | 166 | 0.776534 | 4.678912 | false | false | false | false |
mbrlabs/Mundus | editor/src/main/com/mbrlabs/mundus/editor/utils/FileFormatUtils.kt | 1 | 2759 | /*
* Copyright (c) 2016. See AUTHORS file.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:JvmName("FileFormatUtils")
package com.mbrlabs.mundus.editor.utils
import com.badlogic.gdx.files.FileHandle
const val FORMAT_3D_G3DB = "g3db"
const val FORMAT_3D_G3DJ = "g3dj"
const val FORMAT_3D_COLLADA = "dae"
const val FORMAT_3D_WAVEFONT = "obj"
const val FORMAT_3D_FBX = "fbx"
const val FORMAT_IMG_PNG = "png"
const val FORMAT_IMG_JPG = "jpg"
const val FORMAT_IMG_JPEG = "jpeg"
const val FORMAT_IMG_TGA = "tga"
fun isG3DB(filename: String) = filename.toLowerCase().endsWith(FORMAT_3D_G3DB)
fun isG3DB(file: FileHandle) = isG3DB(file.name())
fun isWavefont(filename: String) = filename.toLowerCase().endsWith(FORMAT_3D_WAVEFONT)
fun isWavefont(file: FileHandle) = isWavefont(file.name())
fun isCollada(filename: String) = filename.toLowerCase().endsWith(FORMAT_3D_COLLADA)
fun isCollada(file: FileHandle) = isCollada(file.name())
fun isFBX(filename: String) = filename.toLowerCase().endsWith(FORMAT_3D_FBX)
fun isFBX(file: FileHandle) = isFBX(file.name())
fun isG3DJ(filename: String) = filename.toLowerCase().endsWith(FORMAT_3D_G3DJ)
fun isG3DJ(file: FileHandle) = isG3DJ(file.name())
fun isPNG(file: FileHandle) = isPNG(file.name())
fun isPNG(filename: String) = filename.toLowerCase().endsWith(FORMAT_IMG_PNG)
fun isJPG(file: FileHandle) = isJPG(file.name())
fun isTGA(filename: String) = filename.toLowerCase().endsWith(FORMAT_IMG_TGA)
fun isTGA(file: FileHandle) = isTGA(file.name())
fun is3DFormat(file: FileHandle) = is3DFormat(file.name())
fun isImage(file: FileHandle) = isImage(file.name())
fun isJPG(filename: String): Boolean {
val fn = filename.toLowerCase()
return (fn.endsWith(FORMAT_IMG_JPG) || fn.endsWith(FORMAT_IMG_JPEG))
}
fun is3DFormat(filename: String): Boolean {
val fn = filename.toLowerCase()
return fn.endsWith(FORMAT_3D_WAVEFONT) || fn.endsWith(FORMAT_3D_COLLADA) || fn.endsWith(FORMAT_3D_G3DB)
|| fn.endsWith(FORMAT_3D_G3DJ) || fn.endsWith(FORMAT_3D_FBX)
}
fun isImage(filename: String): Boolean {
val fn = filename.toLowerCase()
return fn.endsWith(FORMAT_IMG_TGA) || fn.endsWith(FORMAT_IMG_JPEG)
|| fn.endsWith(FORMAT_IMG_JPG) || fn.endsWith(FORMAT_IMG_PNG)
}
| apache-2.0 | 452e270645942197ef1a742b4d50b31f | 40.179104 | 107 | 0.732149 | 3.124575 | false | false | false | false |
JetBrains/kotlin-native | backend.native/tests/stdlib_external/numbers/MathTest.kt | 4 | 32042 | /*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the LICENSE file.
*/
package test.numbers
import kotlin.math.*
import kotlin.test.*
fun assertAlmostEquals(expected: Double, actual: Double, tolerance: Double? = null) {
val tolerance_ = tolerance?.let { abs(it) } ?: 0.000000000001
if (abs(expected - actual) > tolerance_) {
assertEquals(expected, actual)
}
}
fun assertAlmostEquals(expected: Float, actual: Float, tolerance: Double? = null) {
val tolerance_ = tolerance?.let { abs(it) } ?: 0.0000001
if (abs(expected - actual) > tolerance_) {
assertEquals(expected, actual)
}
}
class DoubleMathTest {
@Test fun trigonometric() {
assertEquals(0.0, sin(0.0))
assertAlmostEquals(0.0, sin(PI))
assertEquals(0.0, asin(0.0))
assertAlmostEquals(PI / 2, asin(1.0))
assertEquals(1.0, cos(0.0))
assertAlmostEquals(-1.0, cos(PI))
assertEquals(0.0, acos(1.0))
assertAlmostEquals(PI / 2, acos(0.0))
assertEquals(0.0, tan(0.0))
assertAlmostEquals(1.0, tan(PI / 4))
assertAlmostEquals(0.0, atan(0.0))
assertAlmostEquals(PI / 4, atan(1.0))
assertAlmostEquals(PI / 4, atan2(10.0, 10.0))
assertAlmostEquals(-PI / 4, atan2(Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY))
assertAlmostEquals(0.0, atan2(0.0, 0.0))
assertAlmostEquals(0.0, atan2(0.0, 10.0))
assertAlmostEquals(PI / 2, atan2(2.0, 0.0))
for (angle in listOf(Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY)) {
assertTrue(sin(angle).isNaN(), "sin($angle)")
assertTrue(cos(angle).isNaN(), "cos($angle)")
assertTrue(tan(angle).isNaN(), "tan($angle)")
}
for (value in listOf(Double.NaN, 1.2, -1.1)) {
assertTrue(asin(value).isNaN())
assertTrue(acos(value).isNaN())
}
assertTrue(atan(Double.NaN).isNaN())
assertTrue(atan2(Double.NaN, 0.0).isNaN())
assertTrue(atan2(0.0, Double.NaN).isNaN())
}
@Test fun hyperbolic() {
assertEquals(Double.POSITIVE_INFINITY, sinh(Double.POSITIVE_INFINITY))
assertEquals(Double.NEGATIVE_INFINITY, sinh(Double.NEGATIVE_INFINITY))
assertTrue(sinh(Double.MIN_VALUE) != 0.0)
assertTrue(sinh(710.0).isFinite())
assertTrue(sinh(-710.0).isFinite())
assertTrue(sinh(Double.NaN).isNaN())
assertEquals(Double.POSITIVE_INFINITY, cosh(Double.POSITIVE_INFINITY))
assertEquals(Double.POSITIVE_INFINITY, cosh(Double.NEGATIVE_INFINITY))
assertTrue(cosh(710.0).isFinite())
assertTrue(cosh(-710.0).isFinite())
assertTrue(cosh(Double.NaN).isNaN())
assertAlmostEquals(1.0, tanh(Double.POSITIVE_INFINITY))
assertAlmostEquals(-1.0, tanh(Double.NEGATIVE_INFINITY))
assertTrue(tanh(Double.MIN_VALUE) != 0.0)
assertTrue(tanh(Double.NaN).isNaN())
}
@Test fun inverseHyperbolicSin() {
for (exact in listOf(Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, 0.0, Double.MIN_VALUE, -Double.MIN_VALUE, 0.00001)) {
assertEquals(exact, asinh(sinh(exact)))
}
for (approx in listOf(Double.MIN_VALUE, 0.1, 1.0, 100.0, 710.0)) {
assertAlmostEquals(approx, asinh(sinh(approx)))
assertAlmostEquals(-approx, asinh(sinh(-approx)))
}
assertTrue(asinh(Double.NaN).isNaN())
}
@Test fun inverseHyperbolicCos() {
for (exact in listOf(Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, 0.0)) {
assertEquals(abs(exact), acosh(cosh(exact)))
}
for (approx in listOf(Double.MIN_VALUE, 0.00001, 1.0, 100.0, 710.0)) {
assertAlmostEquals(approx, acosh(cosh(approx)))
assertAlmostEquals(approx, acosh(cosh(-approx)))
}
for (invalid in listOf(-1.0, 0.0, 0.99999, Double.NaN)) {
assertTrue(acosh(invalid).isNaN())
}
}
@Test fun inverseHyperbolicTan() {
for (exact in listOf(Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, 0.0, Double.MIN_VALUE, -Double.MIN_VALUE)) {
assertEquals(exact, atanh(tanh(exact)))
}
for (approx in listOf(0.00001)) {
assertAlmostEquals(approx, atanh(tanh(approx)))
}
for (invalid in listOf(-1.00001, 1.00001, Double.NaN, Double.MAX_VALUE, -Double.MAX_VALUE, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY)) {
assertTrue(atanh(invalid).isNaN())
}
}
@Test fun powers() {
assertEquals(5.0, hypot(3.0, 4.0))
assertEquals(Double.POSITIVE_INFINITY, hypot(Double.NEGATIVE_INFINITY, Double.NaN))
assertEquals(Double.POSITIVE_INFINITY, hypot(Double.NaN, Double.POSITIVE_INFINITY))
assertTrue(hypot(Double.NaN, 0.0).isNaN())
assertEquals(1.0, Double.NaN.pow(0.0))
assertEquals(1.0, Double.POSITIVE_INFINITY.pow(0))
assertEquals(49.0, 7.0.pow(2))
assertEquals(0.25, 2.0.pow(-2))
assertTrue(0.0.pow(Double.NaN).isNaN())
assertTrue(Double.NaN.pow(-1).isNaN())
assertTrue((-7.0).pow(1/3.0).isNaN())
assertTrue(1.0.pow(Double.POSITIVE_INFINITY).isNaN())
assertTrue((-1.0).pow(Double.NEGATIVE_INFINITY).isNaN())
assertEquals(5.0, sqrt(9.0 + 16.0))
assertTrue(sqrt(-1.0).isNaN())
assertTrue(sqrt(Double.NaN).isNaN())
assertTrue(exp(Double.NaN).isNaN())
assertAlmostEquals(E, exp(1.0))
assertEquals(1.0, exp(0.0))
assertEquals(0.0, exp(Double.NEGATIVE_INFINITY))
assertEquals(Double.POSITIVE_INFINITY, exp(Double.POSITIVE_INFINITY))
assertEquals(0.0, expm1(0.0))
assertEquals(Double.MIN_VALUE, expm1(Double.MIN_VALUE))
assertEquals(0.00010000500016667084, expm1(1e-4))
assertEquals(-1.0, expm1(Double.NEGATIVE_INFINITY))
assertEquals(Double.POSITIVE_INFINITY, expm1(Double.POSITIVE_INFINITY))
}
@Test fun logarithms() {
assertTrue(log(1.0, Double.NaN).isNaN())
assertTrue(log(Double.NaN, 1.0).isNaN())
assertTrue(log(-1.0, 2.0).isNaN())
assertTrue(log(2.0, -1.0).isNaN())
assertTrue(log(2.0, 0.0).isNaN())
assertTrue(log(2.0, 1.0).isNaN())
assertTrue(log(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY).isNaN())
assertEquals(-2.0, log(0.25, 2.0))
assertEquals(-0.5, log(2.0, 0.25))
assertEquals(Double.NEGATIVE_INFINITY, log(Double.POSITIVE_INFINITY, 0.25))
assertEquals(Double.POSITIVE_INFINITY, log(Double.POSITIVE_INFINITY, 2.0))
assertEquals(Double.NEGATIVE_INFINITY, log(0.0, 2.0))
assertEquals(Double.POSITIVE_INFINITY, log(0.0, 0.25))
assertTrue(ln(Double.NaN).isNaN())
assertTrue(ln(-1.0).isNaN())
assertEquals(1.0, ln(E))
assertEquals(Double.NEGATIVE_INFINITY, ln(0.0))
assertEquals(Double.POSITIVE_INFINITY, ln(Double.POSITIVE_INFINITY))
assertEquals(1.0, log10(10.0))
assertAlmostEquals(-1.0, log10(0.1))
assertAlmostEquals(3.0, log2(8.0))
assertEquals(-1.0, log2(0.5))
assertTrue(ln1p(Double.NaN).isNaN())
assertTrue(ln1p(-1.1).isNaN())
assertEquals(0.0, ln1p(0.0))
assertEquals(9.999995000003334e-7, ln1p(1e-6))
assertEquals(Double.MIN_VALUE, ln1p(Double.MIN_VALUE))
assertEquals(Double.NEGATIVE_INFINITY, ln1p(-1.0))
}
@Test fun rounding() {
for (value in listOf(Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, 0.0, 1.0, -10.0)) {
assertEquals(value, ceil(value))
assertEquals(value, floor(value))
assertEquals(value, truncate(value))
assertEquals(value, round(value))
}
assertTrue(ceil(Double.NaN).isNaN())
assertTrue(floor(Double.NaN).isNaN())
assertTrue(truncate(Double.NaN).isNaN())
assertTrue(round(Double.NaN).isNaN())
val data = arrayOf( // v floor trunc round ceil
doubleArrayOf( 1.3, 1.0, 1.0, 1.0, 2.0),
doubleArrayOf(-1.3, -2.0, -1.0, -1.0, -1.0),
doubleArrayOf( 1.5, 1.0, 1.0, 2.0, 2.0),
doubleArrayOf(-1.5, -2.0, -1.0, -2.0, -1.0),
doubleArrayOf( 1.8, 1.0, 1.0, 2.0, 2.0),
doubleArrayOf(-1.8, -2.0, -1.0, -2.0, -1.0),
doubleArrayOf( 2.3, 2.0, 2.0, 2.0, 3.0),
doubleArrayOf(-2.3, -3.0, -2.0, -2.0, -2.0),
doubleArrayOf( 2.5, 2.0, 2.0, 2.0, 3.0),
doubleArrayOf(-2.5, -3.0, -2.0, -2.0, -2.0),
doubleArrayOf( 2.8, 2.0, 2.0, 3.0, 3.0),
doubleArrayOf(-2.8, -3.0, -2.0, -3.0, -2.0)
)
for ((v, f, t, r, c) in data) {
assertEquals(f, floor(v), "floor($v)")
assertEquals(t, truncate(v), "truncate($v)")
assertEquals(r, round(v), "round($v)")
assertEquals(c, ceil(v), "ceil($v)")
}
}
@Test fun roundingConversion() {
assertEquals(1L, 1.0.roundToLong())
assertEquals(1L, 1.1.roundToLong())
assertEquals(2L, 1.5.roundToLong())
assertEquals(3L, 2.5.roundToLong())
assertEquals(-2L, (-2.5).roundToLong())
assertEquals(-3L, (-2.6).roundToLong())
assertEquals(9223372036854774784, (9223372036854774800.0).roundToLong())
assertEquals(Long.MAX_VALUE, Double.MAX_VALUE.roundToLong())
assertEquals(Long.MIN_VALUE, (-Double.MAX_VALUE).roundToLong())
assertEquals(Long.MAX_VALUE, Double.POSITIVE_INFINITY.roundToLong())
assertEquals(Long.MIN_VALUE, Double.NEGATIVE_INFINITY.roundToLong())
assertEquals(1, 1.0.roundToInt())
assertEquals(1, 1.1.roundToInt())
assertEquals(2, 1.5.roundToInt())
assertEquals(3, 2.5.roundToInt())
assertEquals(-2, (-2.5).roundToInt())
assertEquals(-3, (-2.6).roundToInt())
assertEquals(2123456789, (2123456789.0).roundToInt())
assertEquals(Int.MAX_VALUE, Double.MAX_VALUE.roundToInt())
assertEquals(Int.MIN_VALUE, (-Double.MAX_VALUE).roundToInt())
assertEquals(Int.MAX_VALUE, Double.POSITIVE_INFINITY.roundToInt())
assertEquals(Int.MIN_VALUE, Double.NEGATIVE_INFINITY.roundToInt())
}
@Test fun absoluteValue() {
assertTrue(abs(Double.NaN).isNaN())
assertTrue(Double.NaN.absoluteValue.isNaN())
for (value in listOf(0.0, Double.MIN_VALUE, 0.1, 1.0, 1000.0, Double.MAX_VALUE, Double.POSITIVE_INFINITY)) {
assertEquals(value, value.absoluteValue)
assertEquals(value, (-value).absoluteValue)
assertEquals(value, abs(value))
assertEquals(value, abs(-value))
}
}
@Test fun signs() {
assertTrue(sign(Double.NaN).isNaN())
assertTrue(Double.NaN.sign.isNaN())
val negatives = listOf(Double.NEGATIVE_INFINITY, -Double.MAX_VALUE, -1.0, -Double.MIN_VALUE)
for (value in negatives) {
assertEquals(-1.0, sign(value))
assertEquals(-1.0, value.sign)
}
val zeroes = listOf(0.0, -0.0)
for (value in zeroes) {
assertEquals(value, sign(value))
assertEquals(value, value.sign)
}
val positives = listOf(Double.POSITIVE_INFINITY, Double.MAX_VALUE, 1.0, Double.MIN_VALUE)
for (value in positives) {
assertEquals(1.0, sign(value))
assertEquals(1.0, value.sign)
}
val allValues = negatives + positives
for (a in allValues) {
for (b in allValues) {
val r = a.withSign(b)
assertEquals(a.absoluteValue, r.absoluteValue)
assertEquals(b.sign, r.sign, "expected $a with sign bit of $b to have sign ${b.sign}")
}
val rp0 = a.withSign(0.0)
assertEquals(1.0, rp0.sign)
assertEquals(a.absoluteValue, rp0.absoluteValue)
val rm0 = a.withSign(-0.0)
assertEquals(-1.0, rm0.sign)
assertEquals(a.absoluteValue, rm0.absoluteValue)
val ri = a.withSign(-1)
assertEquals(-1.0, ri.sign)
assertEquals(a.absoluteValue, ri.absoluteValue)
val rn = a.withSign(Double.NaN)
assertEquals(a.absoluteValue, rn.absoluteValue)
}
}
@Test fun nextAndPrev() {
for (value in listOf(0.0, -0.0, Double.MIN_VALUE, -1.0, 2.0.pow(10))) {
val next = value.nextUp()
if (next > 0) {
assertEquals(next, value + value.ulp)
} else {
assertEquals(value, next - next.ulp)
}
val prev = value.nextDown()
if (prev > 0) {
assertEquals(value, prev + prev.ulp)
}
else {
assertEquals(prev, value - value.ulp)
}
val toZero = value.nextTowards(0.0)
if (toZero != 0.0) {
assertEquals(value, toZero + toZero.ulp.withSign(toZero))
}
assertEquals(Double.POSITIVE_INFINITY, Double.MAX_VALUE.nextUp())
assertEquals(Double.MAX_VALUE, Double.POSITIVE_INFINITY.nextDown())
assertEquals(Double.NEGATIVE_INFINITY, (-Double.MAX_VALUE).nextDown())
assertEquals((-Double.MAX_VALUE), Double.NEGATIVE_INFINITY.nextUp())
assertTrue(Double.NaN.ulp.isNaN())
assertTrue(Double.NaN.nextDown().isNaN())
assertTrue(Double.NaN.nextUp().isNaN())
assertTrue(Double.NaN.nextTowards(0.0).isNaN())
assertEquals(Double.MIN_VALUE, (0.0).ulp)
assertEquals(Double.MIN_VALUE, (-0.0).ulp)
assertEquals(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY.ulp)
assertEquals(Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY.ulp)
val maxUlp = 2.0.pow(971)
assertEquals(maxUlp, Double.MAX_VALUE.ulp)
assertEquals(maxUlp, (-Double.MAX_VALUE).ulp)
}
}
@Test fun IEEEremainder() {
val data = arrayOf( // a a IEEErem 2.5
doubleArrayOf(-2.0, 0.5),
doubleArrayOf(-1.25, -1.25),
doubleArrayOf( 0.0, 0.0),
doubleArrayOf( 1.0, 1.0),
doubleArrayOf( 1.25, 1.25),
doubleArrayOf( 1.5, -1.0),
doubleArrayOf( 2.0, -0.5),
doubleArrayOf( 2.5, 0.0),
doubleArrayOf( 3.5, 1.0),
doubleArrayOf( 3.75, -1.25),
doubleArrayOf( 4.0, -1.0)
)
for ((a, r) in data) {
assertEquals(r, a.IEEErem(2.5), "($a).IEEErem(2.5)")
}
assertTrue(Double.NaN.IEEErem(2.5).isNaN())
assertTrue(2.0.IEEErem(Double.NaN).isNaN())
assertTrue(Double.POSITIVE_INFINITY.IEEErem(2.0).isNaN())
assertTrue(2.0.IEEErem(0.0).isNaN())
assertEquals(PI, PI.IEEErem(Double.NEGATIVE_INFINITY))
}
/*
* Special cases:
* - `atan2(0.0, 0.0)` is `0.0`
* - `atan2(0.0, x)` is `0.0` for `x > 0` and `PI` for `x < 0`
* - `atan2(-0.0, x)` is `-0.0` for 'x > 0` and `-PI` for `x < 0`
* - `atan2(y, +Inf)` is `0.0` for `0 < y < +Inf` and `-0.0` for '-Inf < y < 0`
* - `atan2(y, -Inf)` is `PI` for `0 < y < +Inf` and `-PI` for `-Inf < y < 0`
* - `atan2(y, 0.0)` is `PI/2` for `y > 0` and `-PI/2` for `y < 0`
* - `atan2(+Inf, x)` is `PI/2` for finite `x`y
* - `atan2(-Inf, x)` is `-PI/2` for finite `x`
* - `atan2(NaN, x)` and `atan2(y, NaN)` is `NaN`
*/
@Test fun atan2SpecialCases() {
assertEquals(atan2(0.0, 0.0), 0.0)
assertEquals(atan2(0.0, 1.0), 0.0)
assertEquals(atan2(0.0, -1.0), PI)
assertEquals(atan2(-0.0, 1.0), -0.0)
assertEquals(atan2(-0.0, -1.0), -PI)
assertEquals(atan2(1.0, Double.POSITIVE_INFINITY), 0.0)
assertEquals(atan2(-1.0, Double.POSITIVE_INFINITY), -0.0)
assertEquals(atan2(1.0, Double.NEGATIVE_INFINITY), PI)
assertEquals(atan2(-1.0, Double.NEGATIVE_INFINITY), -PI)
assertEquals(atan2(1.0, 0.0), PI/2)
assertEquals(atan2(-1.0, 0.0), -PI/2)
assertEquals(atan2(Double.POSITIVE_INFINITY, 1.0), PI/2)
assertEquals(atan2(Double.NEGATIVE_INFINITY, 1.0), -PI/2)
assertTrue(atan2(Double.NaN, 1.0).isNaN())
assertTrue(atan2(1.0, Double.NaN).isNaN())
}
}
class FloatMathTest {
companion object {
const val PI = kotlin.math.PI.toFloat()
const val E = kotlin.math.E.toFloat()
}
@Test fun trigonometric() {
assertEquals(0.0F, sin(0.0F))
assertAlmostEquals(0.0F, sin(PI))
assertEquals(0.0F, asin(0.0F))
assertAlmostEquals(PI / 2, asin(1.0F), 0.0000002)
assertEquals(1.0F, cos(0.0F))
assertAlmostEquals(-1.0F, cos(PI))
assertEquals(0.0F, acos(1.0F))
assertAlmostEquals(PI / 2, acos(0.0F))
assertEquals(0.0F, tan(0.0F))
assertAlmostEquals(1.0F, tan(PI / 4))
assertAlmostEquals(0.0F, atan(0.0F))
assertAlmostEquals(PI / 4, atan(1.0F))
assertAlmostEquals(PI / 4, atan2(10.0F, 10.0F))
assertAlmostEquals(-PI / 4, atan2(Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY))
assertAlmostEquals(0.0F, atan2(0.0F, 0.0F))
assertAlmostEquals(0.0F, atan2(0.0F, 10.0F))
assertAlmostEquals(PI / 2, atan2(2.0F, 0.0F))
for (angle in listOf(Float.NaN, Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY)) {
assertTrue(sin(angle).isNaN(), "sin($angle)")
assertTrue(cos(angle).isNaN(), "cos($angle)")
assertTrue(tan(angle).isNaN(), "tan($angle)")
}
for (value in listOf(Float.NaN, 1.2F, -1.1F)) {
assertTrue(asin(value).isNaN())
assertTrue(acos(value).isNaN())
}
assertTrue(atan(Float.NaN).isNaN())
assertTrue(atan2(Float.NaN, 0.0F).isNaN())
assertTrue(atan2(0.0F, Float.NaN).isNaN())
}
@Test fun hyperbolic() {
assertEquals(Float.POSITIVE_INFINITY, sinh(Float.POSITIVE_INFINITY))
assertEquals(Float.NEGATIVE_INFINITY, sinh(Float.NEGATIVE_INFINITY))
assertTrue(sinh(Float.MIN_VALUE) != 0.0F)
assertTrue(sinh(89.0F).isFinite())
assertTrue(sinh(-89.0F).isFinite())
assertTrue(sinh(Float.NaN).isNaN())
assertEquals(Float.POSITIVE_INFINITY, cosh(Float.POSITIVE_INFINITY))
assertEquals(Float.POSITIVE_INFINITY, cosh(Float.NEGATIVE_INFINITY))
assertTrue(cosh(89.0F).isFinite())
assertTrue(cosh(-89.0F).isFinite())
assertTrue(cosh(Float.NaN).isNaN())
assertAlmostEquals(1.0F, tanh(Float.POSITIVE_INFINITY))
assertAlmostEquals(-1.0F, tanh(Float.NEGATIVE_INFINITY))
assertTrue(tanh(Float.MIN_VALUE) != 0.0F)
assertTrue(tanh(Float.NaN).isNaN())
}
@Test fun inverseHyperbolicSin() {
for (exact in listOf(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY, 0.0F, Float.MIN_VALUE, -Float.MIN_VALUE, 0.00001F)) {
assertEquals(exact, asinh(sinh(exact)))
}
for (approx in listOf(Float.MIN_VALUE, 0.1F, 1.0F, 89.0F)) {
assertAlmostEquals(approx, asinh(sinh(approx)))
assertAlmostEquals(-approx, asinh(sinh(-approx)))
}
assertTrue(asinh(Float.NaN).isNaN())
}
@Test fun inverseHyperbolicCos() {
for (exact in listOf(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY, 0.0F)) {
assertEquals(abs(exact), acosh(cosh(exact)))
}
for (approx in listOf(Float.MIN_VALUE, 0.1F, 1.0F, 89.0F)) {
assertAlmostEquals(approx, acosh(cosh(approx)))
assertAlmostEquals(approx, acosh(cosh(-approx)))
}
for (invalid in listOf(-1.0F, 0.0F, 0.99999F, Float.NaN)) {
assertTrue(acosh(invalid).isNaN())
}
}
@Test fun inverseHyperbolicTan() {
for (exact in listOf(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY, 0.0F, Float.MIN_VALUE, -Float.MIN_VALUE)) {
assertEquals(exact, atanh(tanh(exact)))
}
for (approx in listOf(0.00001F)) {
assertAlmostEquals(approx, atanh(tanh(approx)))
}
for (invalid in listOf(-1.00001F, 1.00001F, Float.NaN, Float.MAX_VALUE, -Float.MAX_VALUE, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY)) {
assertTrue(atanh(invalid).isNaN())
}
}
@Test fun powers() {
assertEquals(5.0F, hypot(3.0F, 4.0F))
assertEquals(Float.POSITIVE_INFINITY, hypot(Float.NEGATIVE_INFINITY, Float.NaN))
assertEquals(Float.POSITIVE_INFINITY, hypot(Float.NaN, Float.POSITIVE_INFINITY))
assertTrue(hypot(Float.NaN, 0.0F).isNaN())
assertEquals(1.0F, Float.NaN.pow(0.0F))
assertEquals(1.0F, Float.POSITIVE_INFINITY.pow(0))
assertEquals(49.0F, 7.0F.pow(2))
assertEquals(0.25F, 2.0F.pow(-2))
assertTrue(0.0F.pow(Float.NaN).isNaN())
assertTrue(Float.NaN.pow(-1).isNaN())
assertTrue((-7.0F).pow(1/3.0F).isNaN())
assertTrue(1.0F.pow(Float.POSITIVE_INFINITY).isNaN())
assertTrue((-1.0F).pow(Float.NEGATIVE_INFINITY).isNaN())
assertEquals(5.0F, sqrt(9.0F + 16.0F))
assertTrue(sqrt(-1.0F).isNaN())
assertTrue(sqrt(Float.NaN).isNaN())
assertTrue(exp(Float.NaN).isNaN())
assertAlmostEquals(E, exp(1.0F))
assertEquals(1.0F, exp(0.0F))
assertEquals(0.0F, exp(Float.NEGATIVE_INFINITY))
assertEquals(Float.POSITIVE_INFINITY, exp(Float.POSITIVE_INFINITY))
assertEquals(0.0F, expm1(0.0F))
assertEquals(-1.0F, expm1(Float.NEGATIVE_INFINITY))
assertEquals(Float.POSITIVE_INFINITY, expm1(Float.POSITIVE_INFINITY))
}
@Test fun logarithms() {
assertTrue(log(1.0F, Float.NaN).isNaN())
assertTrue(log(Float.NaN, 1.0F).isNaN())
assertTrue(log(-1.0F, 2.0F).isNaN())
assertTrue(log(2.0F, -1.0F).isNaN())
assertTrue(log(2.0F, 0.0F).isNaN())
assertTrue(log(2.0F, 1.0F).isNaN())
assertTrue(log(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY).isNaN())
assertEquals(-2.0F, log(0.25F, 2.0F))
assertEquals(-0.5F, log(2.0F, 0.25F))
assertEquals(Float.NEGATIVE_INFINITY, log(Float.POSITIVE_INFINITY, 0.25F))
assertEquals(Float.POSITIVE_INFINITY, log(Float.POSITIVE_INFINITY, 2.0F))
assertEquals(Float.NEGATIVE_INFINITY, log(0.0F, 2.0F))
assertEquals(Float.POSITIVE_INFINITY, log(0.0F, 0.25F))
assertTrue(ln(Float.NaN).isNaN())
assertTrue(ln(-1.0F).isNaN())
assertAlmostEquals(1.0F, ln(E))
assertEquals(Float.NEGATIVE_INFINITY, ln(0.0F))
assertEquals(Float.POSITIVE_INFINITY, ln(Float.POSITIVE_INFINITY))
assertEquals(1.0F, log10(10.0F))
assertAlmostEquals(-1.0F, log10(0.1F))
assertAlmostEquals(3.0F, log2(8.0F))
assertEquals(-1.0F, log2(0.5F))
assertTrue(ln1p(Float.NaN).isNaN())
assertTrue(ln1p(-1.1F).isNaN())
assertEquals(0.0F, ln1p(0.0F))
assertEquals(Float.NEGATIVE_INFINITY, ln1p(-1.0F))
}
@Test fun rounding() {
for (value in listOf(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY, 0.0F, 1.0F, -10.0F)) {
assertEquals(value, ceil(value))
assertEquals(value, floor(value))
assertEquals(value, truncate(value))
assertEquals(value, round(value))
}
assertTrue(ceil(Float.NaN).isNaN())
assertTrue(floor(Float.NaN).isNaN())
assertTrue(truncate(Float.NaN).isNaN())
assertTrue(round(Float.NaN).isNaN())
val data = arrayOf( // v floor trunc round ceil
floatArrayOf( 1.3F, 1.0F, 1.0F, 1.0F, 2.0F),
floatArrayOf(-1.3F, -2.0F, -1.0F, -1.0F, -1.0F),
floatArrayOf( 1.5F, 1.0F, 1.0F, 2.0F, 2.0F),
floatArrayOf(-1.5F, -2.0F, -1.0F, -2.0F, -1.0F),
floatArrayOf( 1.8F, 1.0F, 1.0F, 2.0F, 2.0F),
floatArrayOf(-1.8F, -2.0F, -1.0F, -2.0F, -1.0F),
floatArrayOf( 2.3F, 2.0F, 2.0F, 2.0F, 3.0F),
floatArrayOf(-2.3F, -3.0F, -2.0F, -2.0F, -2.0F),
floatArrayOf( 2.5F, 2.0F, 2.0F, 2.0F, 3.0F),
floatArrayOf(-2.5F, -3.0F, -2.0F, -2.0F, -2.0F),
floatArrayOf( 2.8F, 2.0F, 2.0F, 3.0F, 3.0F),
floatArrayOf(-2.8F, -3.0F, -2.0F, -3.0F, -2.0F)
)
for ((v, f, t, r, c) in data) {
assertEquals(f, floor(v), "floor($v)")
assertEquals(t, truncate(v), "truncate($v)")
assertEquals(r, round(v), "round($v)")
assertEquals(c, ceil(v), "ceil($v)")
}
}
@Test fun roundingConversion() {
assertEquals(1L, 1.0F.roundToLong())
assertEquals(1L, 1.1F.roundToLong())
assertEquals(2L, 1.5F.roundToLong())
assertEquals(3L, 2.5F.roundToLong())
assertEquals(-2L, (-2.5F).roundToLong())
assertEquals(-3L, (-2.6F).roundToLong())
// assertEquals(9223372036854774784, (9223372036854774800.0F).roundToLong()) // platform-specific
assertEquals(Long.MAX_VALUE, Float.MAX_VALUE.roundToLong())
assertEquals(Long.MIN_VALUE, (-Float.MAX_VALUE).roundToLong())
assertEquals(Long.MAX_VALUE, Float.POSITIVE_INFINITY.roundToLong())
assertEquals(Long.MIN_VALUE, Float.NEGATIVE_INFINITY.roundToLong())
assertEquals(1, 1.0F.roundToInt())
assertEquals(1, 1.1F.roundToInt())
assertEquals(2, 1.5F.roundToInt())
assertEquals(3, 2.5F.roundToInt())
assertEquals(-2, (-2.5F).roundToInt())
assertEquals(-3, (-2.6F).roundToInt())
assertEquals(16777218, (16777218F).roundToInt())
assertEquals(Int.MAX_VALUE, Float.MAX_VALUE.roundToInt())
assertEquals(Int.MIN_VALUE, (-Float.MAX_VALUE).roundToInt())
assertEquals(Int.MAX_VALUE, Float.POSITIVE_INFINITY.roundToInt())
assertEquals(Int.MIN_VALUE, Float.NEGATIVE_INFINITY.roundToInt())
}
@Test fun absoluteValue() {
assertTrue(abs(Float.NaN).isNaN())
assertTrue(Float.NaN.absoluteValue.isNaN())
for (value in listOf(0.0F, Float.MIN_VALUE, 0.1F, 1.0F, 1000.0F, Float.MAX_VALUE, Float.POSITIVE_INFINITY)) {
assertEquals(value, value.absoluteValue)
assertEquals(value, (-value).absoluteValue)
assertEquals(value, abs(value))
assertEquals(value, abs(-value))
}
}
@Test fun signs() {
assertTrue(sign(Float.NaN).isNaN())
assertTrue(Float.NaN.sign.isNaN())
val negatives = listOf(Float.NEGATIVE_INFINITY, -Float.MAX_VALUE, -1.0F, -Float.MIN_VALUE)
for (value in negatives) {
assertEquals(-1.0F, sign(value))
assertEquals(-1.0F, value.sign)
}
val zeroes = listOf(0.0F, -0.0F)
for (value in zeroes) {
assertEquals(value, sign(value))
assertEquals(value, value.sign)
}
val positives = listOf(Float.POSITIVE_INFINITY, Float.MAX_VALUE, 1.0F, Float.MIN_VALUE)
for (value in positives) {
assertEquals(1.0F, sign(value))
assertEquals(1.0F, value.sign)
}
val allValues = negatives + positives
for (a in allValues) {
for (b in allValues) {
val r = a.withSign(b)
assertEquals(a.absoluteValue, r.absoluteValue)
assertEquals(b.sign, r.sign)
}
val rp0 = a.withSign(0.0F)
assertEquals(1.0F, rp0.sign)
assertEquals(a.absoluteValue, rp0.absoluteValue)
val rm0 = a.withSign(-0.0F)
assertEquals(-1.0F, rm0.sign)
assertEquals(a.absoluteValue, rm0.absoluteValue)
val ri = a.withSign(-1)
assertEquals(-1.0F, ri.sign)
assertEquals(a.absoluteValue, ri.absoluteValue)
}
}
@Test fun nextAndPrev() {
for (value in listOf(0.0f, -0.0f, Float.MIN_VALUE, -1.0f, 2.0f.pow(10))) {
val next = value.nextUp()
if (next > 0) {
assertEquals(next, value + value.ulp)
} else {
assertEquals(value, next - next.ulp)
}
val prev = value.nextDown()
if (prev > 0) {
assertEquals(value, prev + prev.ulp)
}
else {
assertEquals(prev, value - value.ulp)
}
val toZero = value.nextTowards(0.0f)
if (toZero != 0.0f) {
assertEquals(value, toZero + toZero.ulp.withSign(toZero))
}
assertEquals(Float.POSITIVE_INFINITY, Float.MAX_VALUE.nextUp())
assertEquals(Float.MAX_VALUE, Float.POSITIVE_INFINITY.nextDown())
assertEquals(Float.NEGATIVE_INFINITY, (-Float.MAX_VALUE).nextDown())
assertEquals((-Float.MAX_VALUE), Float.NEGATIVE_INFINITY.nextUp())
assertTrue(Float.NaN.ulp.isNaN())
assertTrue(Float.NaN.nextDown().isNaN())
assertTrue(Float.NaN.nextUp().isNaN())
assertTrue(Float.NaN.nextTowards(0.0f).isNaN())
assertEquals(Float.MIN_VALUE, (0.0f).ulp)
assertEquals(Float.MIN_VALUE, (-0.0f).ulp)
assertEquals(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY.ulp)
assertEquals(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY.ulp)
val maxUlp = 2.0f.pow(104)
assertEquals(maxUlp, Float.MAX_VALUE.ulp)
assertEquals(maxUlp, (-Float.MAX_VALUE).ulp)
}
}
@Test fun IEEEremainder() {
val data = arrayOf( // a a IEEErem 2.5
floatArrayOf(-2.0f, 0.5f),
floatArrayOf(-1.25f, -1.25f),
floatArrayOf( 0.0f, 0.0f),
floatArrayOf( 1.0f, 1.0f),
floatArrayOf( 1.25f, 1.25f),
floatArrayOf( 1.5f, -1.0f),
floatArrayOf( 2.0f, -0.5f),
floatArrayOf( 2.5f, 0.0f),
floatArrayOf( 3.5f, 1.0f),
floatArrayOf( 3.75f, -1.25f),
floatArrayOf( 4.0f, -1.0f)
)
for ((a, r) in data) {
assertEquals(r, a.IEEErem(2.5f), "($a).IEEErem(2.5f)")
}
assertTrue(Float.NaN.IEEErem(2.5f).isNaN())
assertTrue(2.0f.IEEErem(Float.NaN).isNaN())
assertTrue(Float.POSITIVE_INFINITY.IEEErem(2.0f).isNaN())
assertTrue(2.0f.IEEErem(0.0f).isNaN())
assertEquals(PI.toFloat(), PI.toFloat().IEEErem(Float.NEGATIVE_INFINITY))
}
}
class IntegerMathTest {
@Test
fun intSigns() {
val negatives = listOf(Int.MIN_VALUE, -65536, -1)
val positives = listOf(1, 100, 256, Int.MAX_VALUE)
negatives.forEach { assertEquals(-1, it.sign) }
positives.forEach { assertEquals(1, it.sign) }
assertEquals(0, 0.sign)
(negatives - Int.MIN_VALUE).forEach { assertEquals(-it, it.absoluteValue) }
assertEquals(Int.MIN_VALUE, Int.MIN_VALUE.absoluteValue)
positives.forEach { assertEquals(it, it.absoluteValue) }
}
@Test
fun longSigns() {
val negatives = listOf(Long.MIN_VALUE, -65536L, -1L)
val positives = listOf(1L, 100L, 256L, Long.MAX_VALUE)
negatives.forEach { assertEquals(-1, it.sign) }
positives.forEach { assertEquals(1, it.sign) }
assertEquals(0, 0L.sign)
(negatives - Long.MIN_VALUE).forEach { assertEquals(-it, it.absoluteValue) }
assertEquals(Long.MIN_VALUE, Long.MIN_VALUE.absoluteValue)
positives.forEach { assertEquals(it, it.absoluteValue) }
}
}
| apache-2.0 | 6043442f91b422745f4ae835982ab6d8 | 39.0525 | 153 | 0.582704 | 3.373552 | false | false | false | false |
androidx/androidx | compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/gesture/FancyScrollingDemo.kt | 3 | 5304 | /*
* Copyright 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package androidx.compose.animation.demos.gesture
import android.util.Log
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.SpringSpec
import androidx.compose.animation.core.calculateTargetValue
import androidx.compose.animation.core.exponentialDecay
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.foundation.gestures.draggable
import androidx.compose.foundation.gestures.rememberDraggableState
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.height
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.drawscope.DrawScope
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import kotlinx.coroutines.launch
import kotlin.math.roundToInt
const val DEBUG = false
@Preview
@Composable
fun FancyScrollingDemo() {
Column {
Text(
"<== Scroll horizontally ==>",
fontSize = 20.sp,
modifier = Modifier.padding(40.dp)
)
val animScroll = remember { Animatable(0f) }
val itemWidth = remember { mutableStateOf(0f) }
val scope = rememberCoroutineScope()
val modifier = Modifier.draggable(
orientation = Orientation.Horizontal,
state = rememberDraggableState { delta ->
// Snap to new drag position
scope.launch {
animScroll.snapTo(animScroll.value + delta)
}
},
onDragStopped = { velocity: Float ->
// Uses default decay animation to calculate where the fling will settle,
// and adjust that position as needed. The target animation will be used for
// animating to the adjusted target.
scope.launch {
val decay = exponentialDecay<Float>()
val target = decay.calculateTargetValue(animScroll.value, velocity)
// Adjust the target position to center align the item
var rem = target % itemWidth.value
if (rem < 0) {
rem += itemWidth.value
}
animScroll.animateTo(
targetValue = target - rem,
initialVelocity = velocity,
animationSpec = SpringSpec(dampingRatio = 2.0f, stiffness = 100f)
)
}
}
)
Canvas(modifier.fillMaxWidth().height(400.dp)) {
val width = size.width / 2f
val scroll = animScroll.value + width / 2
itemWidth.value = width
if (DEBUG) {
Log.w(
"Anim",
"Drawing items with updated" +
" Scroll: ${animScroll.value}"
)
}
drawItems(scroll, width, size.height)
}
}
}
private fun DrawScope.drawItems(
scrollPosition: Float,
width: Float,
height: Float
) {
var startingPos = scrollPosition % width
if (startingPos > 0) {
startingPos -= width
}
var startingColorIndex =
((scrollPosition - startingPos) / width).roundToInt().rem(pastelColors.size)
if (startingColorIndex < 0) {
startingColorIndex += pastelColors.size
}
val size = Size(width - 20, height)
drawRect(
pastelColors[startingColorIndex],
topLeft = Offset(startingPos + 10, 0f),
size = size
)
drawRect(
pastelColors[(startingColorIndex + pastelColors.size - 1) % pastelColors.size],
topLeft = Offset(startingPos + width + 10, 0.0f),
size = size
)
drawRect(
pastelColors[(startingColorIndex + pastelColors.size - 2) % pastelColors.size],
topLeft = Offset(startingPos + width * 2 + 10, 0.0f),
size = size
)
}
private val colors = listOf(
Color(0xFFffd9d9),
Color(0xFFffa3a3),
Color(0xFFff7373),
Color(0xFFff3b3b),
Color(0xFFce0000),
Color(0xFFff3b3b),
Color(0xFFff7373),
Color(0xFFffa3a3)
)
| apache-2.0 | 21bdfbcc5df7e317ad089e5c55d33b89 | 33.666667 | 92 | 0.643665 | 4.517888 | false | false | false | false |
GunoH/intellij-community | plugins/full-line/src/org/jetbrains/completion/full/line/tasks/SetupLocalModelsTask.kt | 2 | 3297 | package org.jetbrains.completion.full.line.tasks
import com.intellij.lang.Language
import com.intellij.openapi.application.EdtReplacementThread
import com.intellij.openapi.components.service
import com.intellij.openapi.diagnostic.thisLogger
import com.intellij.openapi.progress.ProgressIndicator
import com.intellij.openapi.progress.Task
import com.intellij.openapi.project.Project
import com.intellij.openapi.project.ProjectManager
import org.jetbrains.completion.full.line.currentOpenProject
import org.jetbrains.completion.full.line.services.managers.ConfigurableModelsManager
import org.jetbrains.completion.full.line.settings.MLServerCompletionBundle.Companion.message
import java.util.concurrent.atomic.AtomicBoolean
class SetupLocalModelsTask(project: Project, private val languagesToDo: List<ToDoParams>) : Task.Backgroundable(
project,
message("full.line.progress.downloading.models.title"),
) {
val log = thisLogger()
constructor(project: Project, vararg languagesToDo: ToDoParams) : this(project, languagesToDo.toList())
private val manager = service<ConfigurableModelsManager>()
@Synchronized
override fun run(indicator: ProgressIndicator) {
isRunning.set(true)
languagesToDo.forEach { (language, action, modelPath) ->
when (action) {
Action.DOWNLOAD -> {
title = "Downloading full line model for ${language.displayName}"
log.info("Downloading full line model for ${language.displayName}")
manager.download(language, true)
}
Action.UPDATE -> {
title = "Updating full line model for ${language.displayName}"
log.info("Updating full line model for ${language.displayName}")
manager.update(language, true)
}
Action.REMOVE -> {
title = "Removing full line model for ${language.displayName}"
log.info("Removing full line model for ${language.displayName}")
manager.remove(language)
}
Action.IMPORT_FROM_LOCAL_FILE -> {
requireNotNull(modelPath) { "For importing local file modelPath must be provided" }
title = "Importing full line model from local file for ${language.displayName}"
log.info("Importing full line model from local file for ${language.displayName}")
manager.importLocal(language, modelPath)
}
}
}
}
override fun onSuccess() = manager.apply()
override fun onCancel() = manager.reset()
override fun onThrowable(error: Throwable) = manager.reset()
override fun onFinished() = isRunning.set(false)
override fun whereToRunCallbacks() = EdtReplacementThread.WT
override fun shouldStartInBackground() = true
enum class Action {
IMPORT_FROM_LOCAL_FILE,
DOWNLOAD,
UPDATE,
REMOVE,
}
data class ToDoParams(
val language: Language,
val action: Action,
// required for local
val modelPath: String? = null
)
companion object {
val isRunning: AtomicBoolean = AtomicBoolean(false)
fun queue(actions: List<ToDoParams>) {
// TODO: handle when project hasn't been created yet
val project = ProjectManager.getInstanceIfCreated()?.currentOpenProject() ?: return
// Downloading new and removing old models
SetupLocalModelsTask(project, actions).queue()
}
}
}
| apache-2.0 | 933459ba2c67af4b7cc7f561feef3835 | 36.044944 | 112 | 0.718532 | 4.604749 | false | false | false | false |
GunoH/intellij-community | plugins/kotlin/refactorings/kotlin.refactorings.k2/src/org/jetbrains/kotlin/idea/refactoring/KotlinFirRefactoringsSettings.kt | 2 | 1133 | // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.idea.refactoring
import com.intellij.openapi.components.*
import com.intellij.util.xmlb.XmlSerializerUtil
@State(name = "KotlinFirRefactoringSettings", storages = [Storage("kotlinFirRefactoring.xml")], category = SettingsCategory.CODE)
class KotlinFirRefactoringsSettings : PersistentStateComponent<KotlinFirRefactoringsSettings> {
var RENAME_SEARCH_FOR_TEXT_FOR_VARIABLE: Boolean = false
var RENAME_SEARCH_FOR_TEXT_FOR_FUNCTION: Boolean = false
var RENAME_SEARCH_FOR_TEXT_FOR_CLASS: Boolean = false
var RENAME_SEARCH_IN_COMMENTS_FOR_PROPERTY: Boolean = false
var RENAME_SEARCH_IN_COMMENTS_FOR_FUNCTION: Boolean = false
var RENAME_SEARCH_IN_COMMENTS_FOR_CLASS: Boolean = false
override fun getState() = this
override fun loadState(state: KotlinFirRefactoringsSettings) = XmlSerializerUtil.copyBean(state, this)
companion object {
@JvmStatic
val instance: KotlinFirRefactoringsSettings
get() = service()
}
} | apache-2.0 | 56ba331e862342ed16624afbf01c064c | 44.36 | 129 | 0.756399 | 4.374517 | false | false | false | false |
GunoH/intellij-community | plugins/full-line/python/src/org/jetbrains/completion/full/line/python/formatters/StringFormatter.kt | 2 | 1349 | package org.jetbrains.completion.full.line.python.formatters
import com.intellij.psi.PsiElement
import com.intellij.psi.impl.source.tree.LeafPsiElement
import com.jetbrains.python.psi.PyStringElement
import org.jetbrains.completion.full.line.language.ElementFormatter
class StringFormatter : ElementFormatter {
override fun condition(element: PsiElement): Boolean = element is PyStringElement
override fun filter(element: PsiElement): Boolean? {
return element is LeafPsiElement && element.parent !is PyStringElement || element is PyStringElement
}
override fun format(element: PsiElement): String {
element as PyStringElement
val quote = if (element.isTripleQuoted) {
TRIPLE_QUOTE
}
else {
fixQuote(element.content)
}
val content = if (element.prefix.contains("r")) {
element.content
}
else {
unescapedNewQuote.replace(element.content, SINGLE_QUOTE)
}
return element.prefix + quote + content + quote
}
private fun fixQuote(content: String): String {
return if (content.contains("\"") && !content.contains("\\\"")) SINGLE_QUOTE else DOUBLE_QUOTE
}
companion object {
const val TRIPLE_QUOTE = "\"\"\""
const val SINGLE_QUOTE = "\'"
const val DOUBLE_QUOTE = "\""
val unescapedNewQuote = Regex("(([\\\\])(^\\\\\\\\)*)$SINGLE_QUOTE")
}
}
| apache-2.0 | b8b46f76331580ac8c38384b645f1147 | 28.977778 | 104 | 0.696071 | 4.16358 | false | false | false | false |
GunoH/intellij-community | plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/inspections/kdoc/KDocMissingDocumentationInspection.kt | 4 | 3955 | // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.kotlin.idea.inspections.kdoc
import com.intellij.codeInsight.FileModificationService
import com.intellij.codeInspection.LocalQuickFix
import com.intellij.codeInspection.ProblemDescriptor
import com.intellij.codeInspection.ProblemsHolder
import com.intellij.openapi.editor.EditorModificationUtil
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElementVisitor
import com.siyeh.ig.psiutils.TestUtils
import org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithVisibility
import org.jetbrains.kotlin.idea.base.resources.KotlinBundle
import org.jetbrains.kotlin.idea.caches.resolve.resolveToDescriptorIfAny
import org.jetbrains.kotlin.idea.codeInsight.DescriptorToSourceUtilsIde
import org.jetbrains.kotlin.idea.core.unblockDocument
import org.jetbrains.kotlin.idea.codeinsight.api.classic.inspections.AbstractKotlinInspection
import org.jetbrains.kotlin.idea.inspections.describe
import org.jetbrains.kotlin.idea.codeinsight.utils.findExistingEditor
import org.jetbrains.kotlin.idea.kdoc.KDocElementFactory
import org.jetbrains.kotlin.idea.kdoc.findKDoc
import org.jetbrains.kotlin.kdoc.psi.impl.KDocSection
import org.jetbrains.kotlin.psi.KtNamedDeclaration
import org.jetbrains.kotlin.psi.namedDeclarationVisitor
import org.jetbrains.kotlin.psi.psiUtil.endOffset
import org.jetbrains.kotlin.psi.psiUtil.getChildOfType
import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
import org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyPublicApi
class KDocMissingDocumentationInspection : AbstractKotlinInspection() {
override fun buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitor =
namedDeclarationVisitor { element ->
if (TestUtils.isInTestSourceContent(element)) {
return@namedDeclarationVisitor
}
val nameIdentifier = element.nameIdentifier
if (nameIdentifier != null) {
if (element.findKDoc { DescriptorToSourceUtilsIde.getAnyDeclaration(element.project, it) } == null) {
val descriptor =
element.resolveToDescriptorIfAny() as? DeclarationDescriptorWithVisibility ?: return@namedDeclarationVisitor
if (descriptor.isEffectivelyPublicApi) {
val message = element.describe()?.let { KotlinBundle.message("0.is.missing.documentation", it) }
?: KotlinBundle.message("missing.documentation")
holder.registerProblem(nameIdentifier, message, AddDocumentationFix())
}
}
}
}
class AddDocumentationFix : LocalQuickFix {
override fun getName(): String = KotlinBundle.message("add.documentation.fix.text")
override fun getFamilyName(): String = name
override fun applyFix(project: Project, descriptor: ProblemDescriptor) {
val declaration = descriptor.psiElement.getParentOfType<KtNamedDeclaration>(true)
?: throw IllegalStateException("Can't find declaration")
declaration.addBefore(KDocElementFactory(project).createKDocFromText("/**\n*\n*/\n"), declaration.firstChild)
val editor = descriptor.psiElement.findExistingEditor() ?: return
// If we just add whitespace
// /**
// *[HERE]
// it will be erased by formatter, so following code adds it right way and moves caret then
editor.unblockDocument()
val section = declaration.firstChild.getChildOfType<KDocSection>() ?: return
val asterisk = section.firstChild
editor.caretModel.moveToOffset(asterisk.endOffset)
EditorModificationUtil.insertStringAtCaret(editor, " ")
}
}
}
| apache-2.0 | b805b552b89bb81d1624990ec08c7bb1 | 49.063291 | 158 | 0.730721 | 5.330189 | false | false | false | false |
jwren/intellij-community | plugins/kotlin/core/src/org/jetbrains/kotlin/idea/core/util/inlineAnalysisUtils.kt | 2 | 5923 | // Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.kotlin.idea.core.util
import org.jetbrains.kotlin.descriptors.CallableDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.idea.codeInsight.DescriptorToSourceUtilsIde
import org.jetbrains.kotlin.idea.resolve.ResolutionFacade
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.CompositeBindingContext
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.inline.InlineUtil
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedSimpleFunctionDescriptor
import org.jetbrains.kotlin.utils.addIfNotNull
import java.util.ArrayList
import java.util.HashSet
import java.util.LinkedHashSet
fun analyzeInlinedFunctions(
resolutionFacadeForFile: ResolutionFacade,
file: KtFile,
analyzeOnlyReifiedInlineFunctions: Boolean,
bindingContext: BindingContext? = null
): Pair<BindingContext, List<KtFile>> {
val analyzedElements = HashSet<KtElement>()
val context = analyzeElementWithInline(
resolutionFacadeForFile,
file,
analyzedElements,
!analyzeOnlyReifiedInlineFunctions, bindingContext
)
//We processing another files just to annotate anonymous classes within their inline functions
//Bytecode not produced for them cause of filtering via generateClassFilter
val toProcess = LinkedHashSet<KtFile>()
toProcess.add(file)
for (collectedElement in analyzedElements) {
val containingFile = collectedElement.containingKtFile
toProcess.add(containingFile)
}
return Pair<BindingContext, List<KtFile>>(context, ArrayList(toProcess))
}
private fun analyzeElementWithInline(
resolutionFacade: ResolutionFacade,
element: KtElement,
analyzedElements: MutableSet<KtElement>,
analyzeInlineFunctions: Boolean,
fullResolveContext: BindingContext? = null
): BindingContext {
val project = element.project
val declarationsWithBody = HashSet<KtDeclarationWithBody>()
val innerContexts = ArrayList<BindingContext>()
innerContexts.addIfNotNull(fullResolveContext)
element.accept(object : KtTreeVisitorVoid() {
override fun visitExpression(expression: KtExpression) {
super.visitExpression(expression)
val bindingContext = resolutionFacade.analyze(expression)
innerContexts.add(bindingContext)
val call = bindingContext.get(BindingContext.CALL, expression) ?: return
val resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, call)
checkResolveCall(resolvedCall)
}
override fun visitDestructuringDeclaration(destructuringDeclaration: KtDestructuringDeclaration) {
super.visitDestructuringDeclaration(destructuringDeclaration)
val bindingContext = resolutionFacade.analyze(destructuringDeclaration)
innerContexts.add(bindingContext)
for (entry in destructuringDeclaration.entries) {
val resolvedCall = bindingContext.get(BindingContext.COMPONENT_RESOLVED_CALL, entry)
checkResolveCall(resolvedCall)
}
}
override fun visitForExpression(expression: KtForExpression) {
super.visitForExpression(expression)
val bindingContext = resolutionFacade.analyze(expression)
innerContexts.add(bindingContext)
checkResolveCall(bindingContext.get(BindingContext.LOOP_RANGE_ITERATOR_RESOLVED_CALL, expression.loopRange))
checkResolveCall(bindingContext.get(BindingContext.LOOP_RANGE_HAS_NEXT_RESOLVED_CALL, expression.loopRange))
checkResolveCall(bindingContext.get(BindingContext.LOOP_RANGE_NEXT_RESOLVED_CALL, expression.loopRange))
}
private fun checkResolveCall(resolvedCall: ResolvedCall<*>?) {
if (resolvedCall == null) return
val descriptor = resolvedCall.resultingDescriptor
if (descriptor is DeserializedSimpleFunctionDescriptor) return
isAdditionalResolveNeededForDescriptor(descriptor)
if (descriptor is PropertyDescriptor) {
for (accessor in descriptor.accessors) {
isAdditionalResolveNeededForDescriptor(accessor)
}
}
}
private fun isAdditionalResolveNeededForDescriptor(descriptor: CallableDescriptor) {
if (!(InlineUtil.isInline(descriptor) && (analyzeInlineFunctions || hasReifiedTypeParameters(descriptor)))) {
return
}
val declaration = DescriptorToSourceUtilsIde.getAnyDeclaration(project, descriptor)
if (declaration != null && declaration is KtDeclarationWithBody && !analyzedElements.contains(declaration)) {
declarationsWithBody.add(declaration)
return
}
}
})
analyzedElements.add(element)
if (declarationsWithBody.isNotEmpty()) {
for (inlineFunction in declarationsWithBody) {
val body = inlineFunction.bodyExpression
if (body != null) {
innerContexts.add(
analyzeElementWithInline(
resolutionFacade,
inlineFunction,
analyzedElements,
analyzeInlineFunctions
)
)
}
}
analyzedElements.addAll(declarationsWithBody)
}
return CompositeBindingContext.create(innerContexts)
}
private fun hasReifiedTypeParameters(descriptor: CallableDescriptor): Boolean {
return descriptor.typeParameters.any { it.isReified }
} | apache-2.0 | 371b416efb54afca4a70b48b10035f08 | 39.027027 | 158 | 0.707918 | 5.761673 | false | false | false | false |
JetBrains/kotlin-native | Interop/Runtime/src/jvm/kotlin/kotlinx/cinterop/JvmCallbacks.kt | 1 | 16060 | /*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package kotlinx.cinterop
import java.util.concurrent.ConcurrentHashMap
import java.util.function.LongConsumer
import kotlin.reflect.KClass
import kotlin.reflect.KFunction
import kotlin.reflect.KType
import kotlin.reflect.full.companionObjectInstance
import kotlin.reflect.full.declaredMemberProperties
import kotlin.reflect.full.isSubclassOf
import kotlin.reflect.jvm.reflect
internal fun createStablePointer(any: Any): COpaquePointer = newGlobalRef(any).toCPointer()!!
internal fun disposeStablePointer(pointer: COpaquePointer) = deleteGlobalRef(pointer.toLong())
@PublishedApi
internal fun derefStablePointer(pointer: COpaquePointer): Any = derefGlobalRef(pointer.toLong())
private fun getFieldCType(type: KType): CType<*> {
val classifier = type.classifier
if (classifier is KClass<*> && classifier.isSubclassOf(CStructVar::class)) {
return getStructCType(classifier)
}
return getArgOrRetValCType(type)
}
private fun getVariableCType(type: KType): CType<*>? {
val classifier = type.classifier
return when (classifier) {
!is KClass<*> -> null
ByteVarOf::class -> SInt8
ShortVarOf::class -> SInt16
IntVarOf::class -> SInt32
LongVarOf::class -> SInt64
CPointerVarOf::class -> Pointer
// TODO: floats, enums.
else -> if (classifier.isSubclassOf(CStructVar::class)) {
getStructCType(classifier)
} else {
null
}
}
}
private val structTypeCache = ConcurrentHashMap<Class<*>, CType<*>>()
private fun getStructCType(structClass: KClass<*>): CType<*> = structTypeCache.computeIfAbsent(structClass.java) {
// Note that struct classes are not supposed to be user-defined,
// so they don't require to be checked strictly.
val annotations = structClass.annotations
val cNaturalStruct = annotations.filterIsInstance<CNaturalStruct>().firstOrNull() ?:
error("struct ${structClass.simpleName} has custom layout")
val propertiesByName = structClass.declaredMemberProperties.groupBy { it.name }
val fields = cNaturalStruct.fieldNames.map {
propertiesByName[it]!!.single()
}
val fieldCTypes = mutableListOf<CType<*>>()
for (field in fields) {
val lengthAnnotation = field.annotations.filterIsInstance<CLength>().firstOrNull()
if (lengthAnnotation == null) {
val fieldType = getFieldCType(field.returnType)
fieldCTypes.add(fieldType)
} else {
assert(field.returnType.classifier == CPointer::class)
val length = lengthAnnotation.value
if (length != 0) {
val pointed = field.returnType.arguments.single().type!!
val pointedCType = getVariableCType(pointed) ?: TODO("array element type '$pointed'")
// Represent array field as repeated element-typed fields:
repeat(length) {
fieldCTypes.add(pointedCType)
}
}
}
}
@Suppress("DEPRECATION")
val structType = structClass.companionObjectInstance as CVariable.Type
Struct(structType.size, structType.align, fieldCTypes)
}
private fun getStructValueCType(type: KType): CType<*> {
val structClass = type.arguments.singleOrNull()?.type?.classifier as? KClass<*> ?:
error("'$type' type is incomplete")
return getStructCType(structClass)
}
private fun getEnumCType(classifier: KClass<*>): CEnumType? {
val rawValueType = classifier.declaredMemberProperties.single().returnType
val rawValueCType = when (rawValueType.classifier) {
Byte::class -> SInt8
Short::class -> SInt16
Int::class -> SInt32
Long::class -> SInt64
else -> error("'${classifier.simpleName}' has unexpected value type '$rawValueType'")
}
@Suppress("UNCHECKED_CAST")
return CEnumType(rawValueCType as CType<Any>)
}
private fun getArgOrRetValCType(type: KType): CType<*> {
val classifier = type.classifier
val result = when (classifier) {
!is KClass<*> -> null
Unit::class -> Void
Byte::class -> SInt8
Short::class -> SInt16
Int::class -> SInt32
Long::class -> SInt64
CPointer::class -> Pointer
// TODO: floats
CValue::class -> getStructValueCType(type)
else -> if (classifier.isSubclassOf(@Suppress("DEPRECATION") CEnum::class)) {
getEnumCType(classifier)
} else {
null
}
} ?: error("$type is not supported in callback signature")
if (type.isMarkedNullable != (classifier == CPointer::class)) {
if (type.isMarkedNullable) {
error("$type must not be nullable when used in callback signature")
} else {
error("$type must be nullable when used in callback signature")
}
}
return result
}
private fun createStaticCFunction(function: Function<*>): CPointer<CFunction<*>> {
val errorMessage = "staticCFunction must take an unbound, non-capturing function"
if (!isStatic(function)) {
throw IllegalArgumentException(errorMessage)
}
val kFunction = function as? KFunction<*> ?: function.reflect() ?:
throw IllegalArgumentException(errorMessage)
val returnType = getArgOrRetValCType(kFunction.returnType)
val paramTypes = kFunction.parameters.map { getArgOrRetValCType(it.type) }
@Suppress("UNCHECKED_CAST")
return interpretCPointer(createStaticCFunctionImpl(returnType as CType<Any?>, paramTypes, function))!!
}
/**
* Returns `true` if given function is *static* as defined in [staticCFunction].
*/
private fun isStatic(function: Function<*>): Boolean {
// TODO: revise
try {
with(function.javaClass.getDeclaredField("INSTANCE")) {
if (!java.lang.reflect.Modifier.isStatic(modifiers) || !java.lang.reflect.Modifier.isFinal(modifiers)) {
return false
}
isAccessible = true // TODO: undo
return get(null) == function
// If the class has static final "INSTANCE" field, and only the value of this field is accepted,
// then each class is handled at most once, so these checks prevent memory leaks.
}
} catch (e: NoSuchFieldException) {
return false
}
}
private val createdStaticFunctions = ConcurrentHashMap<Class<*>, CPointer<CFunction<*>>>()
@Suppress("UNCHECKED_CAST")
internal fun <F : Function<*>> staticCFunctionImpl(function: F) =
createdStaticFunctions.computeIfAbsent(function.javaClass) {
createStaticCFunction(function)
} as CPointer<CFunction<F>>
private val invokeMethods = (0 .. 22).map { arity ->
Class.forName("kotlin.jvm.functions.Function$arity").getMethod("invoke",
*Array<Class<*>>(arity) { java.lang.Object::class.java })
}
private fun createStaticCFunctionImpl(
returnType: CType<Any?>,
paramTypes: List<CType<*>>,
function: Function<*>
): NativePtr {
val ffiCif = ffiCreateCif(returnType.ffiType, paramTypes.map { it.ffiType })
val arity = paramTypes.size
val pt = paramTypes.toTypedArray()
@Suppress("UNCHECKED_CAST")
val impl: FfiClosureImpl = when (arity) {
0 -> {
val f = function as () -> Any?
ffiClosureImpl(returnType) { _ ->
f()
}
}
1 -> {
val f = function as (Any?) -> Any?
ffiClosureImpl(returnType) { args ->
f(pt.read(args, 0))
}
}
2 -> {
val f = function as (Any?, Any?) -> Any?
ffiClosureImpl(returnType) { args ->
f(pt.read(args, 0), pt.read(args, 1))
}
}
3 -> {
val f = function as (Any?, Any?, Any?) -> Any?
ffiClosureImpl(returnType) { args ->
f(pt.read(args, 0), pt.read(args, 1), pt.read(args, 2))
}
}
4 -> {
val f = function as (Any?, Any?, Any?, Any?) -> Any?
ffiClosureImpl(returnType) { args ->
f(pt.read(args, 0), pt.read(args, 1), pt.read(args, 2), pt.read(args, 3))
}
}
5 -> {
val f = function as (Any?, Any?, Any?, Any?, Any?) -> Any?
ffiClosureImpl(returnType) { args ->
f(pt.read(args, 0), pt.read(args, 1), pt.read(args, 2), pt.read(args, 3), pt.read(args, 4))
}
}
else -> {
val invokeMethod = invokeMethods[arity]
ffiClosureImpl(returnType) { args ->
val arguments = Array(arity) { pt.read(args, it) }
invokeMethod.invoke(function, *arguments)
}
}
}
return ffiCreateClosure(ffiCif, impl)
}
@Suppress("NOTHING_TO_INLINE")
private inline fun Array<CType<*>>.read(args: CArrayPointer<COpaquePointerVar>, index: Int) =
this[index].read(args[index].rawValue)
private inline fun ffiClosureImpl(
returnType: CType<Any?>,
crossinline invoke: (args: CArrayPointer<COpaquePointerVar>) -> Any?
): FfiClosureImpl {
// Called through [ffi_fun] when a native function created with [ffiCreateClosure] is invoked.
return LongConsumer { retAndArgsRaw ->
val retAndArgs = retAndArgsRaw.toCPointer<CPointerVar<*>>()!!
// Pointer to memory to be filled with return value of the invoked native function:
val ret = retAndArgs[0]!!
// Pointer to array of pointers to arguments passed to the invoked native function:
val args = retAndArgs[1]!!.reinterpret<COpaquePointerVar>()
val result = invoke(args)
returnType.write(ret.rawValue, result)
}
}
/**
* Describes the bridge between Kotlin type `T` and the corresponding C type of a function's parameter or return value.
* It is supposed to be constructed using the primitive types (such as [SInt32]), the [Struct] combinator
* and the [CEnumType] wrapper.
*
* This description omits the details that are irrelevant for the ABI.
*/
private abstract class CType<T> internal constructor(val ffiType: ffi_type) {
internal constructor(ffiTypePtr: Long) : this(interpretPointed<ffi_type>(ffiTypePtr))
abstract fun read(location: NativePtr): T
abstract fun write(location: NativePtr, value: T): Unit
}
private object Void : CType<Any?>(ffiTypeVoid()) {
override fun read(location: NativePtr) = throw UnsupportedOperationException()
override fun write(location: NativePtr, value: Any?) {
// nothing to do.
}
}
private object SInt8 : CType<Byte>(ffiTypeSInt8()) {
override fun read(location: NativePtr) = interpretPointed<ByteVar>(location).value
override fun write(location: NativePtr, value: Byte) {
interpretPointed<ByteVar>(location).value = value
}
}
private object SInt16 : CType<Short>(ffiTypeSInt16()) {
override fun read(location: NativePtr) = interpretPointed<ShortVar>(location).value
override fun write(location: NativePtr, value: Short) {
interpretPointed<ShortVar>(location).value = value
}
}
private object SInt32 : CType<Int>(ffiTypeSInt32()) {
override fun read(location: NativePtr) = interpretPointed<IntVar>(location).value
override fun write(location: NativePtr, value: Int) {
interpretPointed<IntVar>(location).value = value
}
}
private object SInt64 : CType<Long>(ffiTypeSInt64()) {
override fun read(location: NativePtr) = interpretPointed<LongVar>(location).value
override fun write(location: NativePtr, value: Long) {
interpretPointed<LongVar>(location).value = value
}
}
private object Pointer : CType<CPointer<*>?>(ffiTypePointer()) {
override fun read(location: NativePtr) = interpretPointed<CPointerVar<*>>(location).value
override fun write(location: NativePtr, value: CPointer<*>?) {
interpretPointed<CPointerVar<*>>(location).value = value
}
}
private class Struct(val size: Long, val align: Int, elementTypes: List<CType<*>>) : CType<CValue<*>>(
ffiTypeStruct(
elementTypes.map { it.ffiType }
)
) {
override fun read(location: NativePtr) = interpretPointed<ByteVar>(location).readValue<CStructVar>(size, align)
override fun write(location: NativePtr, value: CValue<*>) = value.write(location)
}
@Suppress("DEPRECATION")
private class CEnumType(private val rawValueCType: CType<Any>) : CType<CEnum>(rawValueCType.ffiType) {
override fun read(location: NativePtr): CEnum {
TODO("enum-typed callback parameters")
}
override fun write(location: NativePtr, value: CEnum) {
rawValueCType.write(location, value.value)
}
}
private typealias FfiClosureImpl = LongConsumer
private typealias UserData = FfiClosureImpl
private val topLevelInitializer = loadKonanLibrary("callbacks")
/**
* Reference to `ffi_type` struct instance.
*/
internal class ffi_type(rawPtr: NativePtr) : COpaque(rawPtr)
/**
* Reference to `ffi_cif` struct instance.
*/
internal class ffi_cif(rawPtr: NativePtr) : COpaque(rawPtr)
private external fun ffiTypeVoid(): Long
private external fun ffiTypeUInt8(): Long
private external fun ffiTypeSInt8(): Long
private external fun ffiTypeUInt16(): Long
private external fun ffiTypeSInt16(): Long
private external fun ffiTypeUInt32(): Long
private external fun ffiTypeSInt32(): Long
private external fun ffiTypeUInt64(): Long
private external fun ffiTypeSInt64(): Long
private external fun ffiTypePointer(): Long
private external fun ffiTypeStruct0(elements: Long): Long
/**
* Allocates and initializes `ffi_type` describing the struct.
*
* @param elements types of the struct elements
*/
private fun ffiTypeStruct(elementTypes: List<ffi_type>): ffi_type {
val elements = nativeHeap.allocArrayOfPointersTo(*elementTypes.toTypedArray(), null)
val res = ffiTypeStruct0(elements.rawValue)
if (res == 0L) {
throw OutOfMemoryError()
}
return interpretPointed(res)
}
private external fun ffiCreateCif0(nArgs: Int, rType: Long, argTypes: Long): Long
/**
* Creates and prepares an `ffi_cif`.
*
* @param returnType native function return value type
* @param paramTypes native function parameter types
*
* @return the initialized `ffi_cif`
*/
private fun ffiCreateCif(returnType: ffi_type, paramTypes: List<ffi_type>): ffi_cif {
val nArgs = paramTypes.size
val argTypes = nativeHeap.allocArrayOfPointersTo(*paramTypes.toTypedArray(), null)
val res = ffiCreateCif0(nArgs, returnType.rawPtr, argTypes.rawValue)
when (res) {
0L -> throw OutOfMemoryError()
-1L -> throw Error("FFI_BAD_TYPEDEF")
-2L -> throw Error("FFI_BAD_ABI")
-3L -> throw Error("libffi error occurred")
}
return interpretPointed(res)
}
private external fun ffiCreateClosure0(ffiCif: Long, userData: Any): Long
/**
* Uses libffi to allocate a native function which will call [impl] when invoked.
*
* @param ffiCif describes the type of the function to create
*/
private fun ffiCreateClosure(ffiCif: ffi_cif, impl: FfiClosureImpl): NativePtr {
val res = ffiCreateClosure0(ffiCif.rawPtr, userData = impl)
when (res) {
0L -> throw OutOfMemoryError()
-1L -> throw Error("libffi error occurred")
}
return res
}
private external fun newGlobalRef(any: Any): Long
private external fun derefGlobalRef(ref: Long): Any
private external fun deleteGlobalRef(ref: Long) | apache-2.0 | e14b82345f18ca21286d86bb143cc952 | 33.839479 | 119 | 0.663885 | 4.197595 | false | false | false | false |
GunoH/intellij-community | platform/platform-impl/src/com/intellij/ide/customize/transferSettings/providers/vswin/parsers/VSXmlParser.kt | 2 | 3586 | package com.intellij.ide.customize.transferSettings.providers.vswin.parsers
import com.intellij.ide.customize.transferSettings.db.KnownKeymaps
import com.intellij.ide.customize.transferSettings.models.PatchedKeymap
import com.intellij.ide.customize.transferSettings.models.Settings
import com.intellij.ide.customize.transferSettings.providers.vswin.parsers.data.*
import com.intellij.ide.customize.transferSettings.providers.vswin.utilities.VSHive
import com.intellij.ide.customize.transferSettings.providers.vswin.utilities.Version2
import com.intellij.openapi.diagnostic.logger
import org.jdom.Document
import org.jdom.Element
import org.jdom.input.SAXBuilder
import java.io.File
class VSXmlParserException(message: String) : Exception(message)
class VSXmlParser(settingsFile: File, private val hive: VSHive? = null) {
companion object {
const val applicationIdentity = "ApplicationIdentity"
const val toolsOptions = "ToolsOptions"
const val category = "Category"
const val envGroup = "Environment_Group"
const val nameAttr = "name"
const val versionAttr = "version"
private val logger = logger<VSXmlParser>()
}
private val document: Document
val allSettings = Settings(
keymap = KnownKeymaps.VisualStudio2022
)
val ver: Version2
init {
require(settingsFile.exists()) { "Settings file was not found" }
if (hive != null) {
logger.info("Parsing $hive")
}
document = SAXBuilder().build(settingsFile)
logger.info("Parsing file ${settingsFile.absolutePath}")
val verStr = document.rootElement.getChild(applicationIdentity)?.getAttribute(versionAttr)?.value
?: throw VSXmlParserException("Can't find version")
ver = Version2.parse(verStr)
?: throw VSXmlParserException("Can't parse version")
categoryDigger(ver, document.rootElement)
}
fun toSettings(): Settings {
return allSettings
}
private fun categoryDigger(version: Version2, rtElement: Element) {
for (el in rtElement.children) {
if (el.name == applicationIdentity) continue
if (el.name == toolsOptions || (el.name == category && el.getAttribute(nameAttr)?.value == envGroup)) {
categoryDigger(version, el)
continue
}
val disp = parserDispatcher(version, el, hive)?.let { it() }
if (disp != null) {
val name = el?.getAttribute(nameAttr)?.value
if (name == null) {
logger.info("This should not happen. For some reason there is no name attribute")
continue
}
when (disp) {
is FontsAndColorsParsedData -> allSettings.laf = disp.theme.toRiderTheme()
is KeyBindingsParsedData -> allSettings.keymap = if (disp.convertToSettingsFormat().isNotEmpty() && allSettings.keymap != null) PatchedKeymap(allSettings.keymap!!, disp.convertToSettingsFormat(), emptyList()) else allSettings.keymap
}
}
}
}
private fun parserDispatcher(version: Version2, el: Element, hive: VSHive?): (() -> VSParsedData?)? {
//.debug("Processing $value")
return when (el.getAttribute(nameAttr)?.value) {
FontsAndColorsParsedData.key -> {
{ VSParsedDataCreator.fontsAndColors(version, el) }
}
KeyBindingsParsedData.key -> {
{ VSParsedDataCreator.keyBindings(version, el, hive) }
}
//DebuggerParsedData.key -> { { VSParsedDataCreator.debugger(version, el) } }
//ToolWindowsParsedData.key -> { { VSParsedDataCreator.toolWindows(version, el) } }
//else -> { logger.debug("Unknown").let { null } }
else -> null
}
}
} | apache-2.0 | 99b934810d5d3d6e4d92d88017757aa7 | 37.159574 | 242 | 0.699944 | 4.126582 | false | false | false | false |
GunoH/intellij-community | platform/workspaceModel/storage/gen/com/intellij/workspaceModel/storage/bridgeEntities/ArchivePackagingElementEntityImpl.kt | 2 | 16240 | // Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.workspaceModel.storage.bridgeEntities
import com.intellij.workspaceModel.storage.*
import com.intellij.workspaceModel.storage.EntityInformation
import com.intellij.workspaceModel.storage.EntitySource
import com.intellij.workspaceModel.storage.EntityStorage
import com.intellij.workspaceModel.storage.GeneratedCodeApiVersion
import com.intellij.workspaceModel.storage.GeneratedCodeImplVersion
import com.intellij.workspaceModel.storage.MutableEntityStorage
import com.intellij.workspaceModel.storage.WorkspaceEntity
import com.intellij.workspaceModel.storage.impl.ConnectionId
import com.intellij.workspaceModel.storage.impl.EntityLink
import com.intellij.workspaceModel.storage.impl.ModifiableWorkspaceEntityBase
import com.intellij.workspaceModel.storage.impl.UsedClassesCollector
import com.intellij.workspaceModel.storage.impl.WorkspaceEntityBase
import com.intellij.workspaceModel.storage.impl.WorkspaceEntityData
import com.intellij.workspaceModel.storage.impl.extractOneToAbstractManyChildren
import com.intellij.workspaceModel.storage.impl.extractOneToAbstractManyParent
import com.intellij.workspaceModel.storage.impl.extractOneToAbstractOneParent
import com.intellij.workspaceModel.storage.impl.extractOneToManyChildren
import com.intellij.workspaceModel.storage.impl.updateOneToAbstractManyChildrenOfParent
import com.intellij.workspaceModel.storage.impl.updateOneToAbstractManyParentOfChild
import com.intellij.workspaceModel.storage.impl.updateOneToAbstractOneParentOfChild
import com.intellij.workspaceModel.storage.url.VirtualFileUrl
import org.jetbrains.deft.ObjBuilder
import org.jetbrains.deft.Type
import org.jetbrains.deft.annotations.Abstract
import org.jetbrains.deft.annotations.Child
@GeneratedCodeApiVersion(1)
@GeneratedCodeImplVersion(1)
open class ArchivePackagingElementEntityImpl(val dataSource: ArchivePackagingElementEntityData) : ArchivePackagingElementEntity, WorkspaceEntityBase() {
companion object {
internal val PARENTENTITY_CONNECTION_ID: ConnectionId = ConnectionId.create(CompositePackagingElementEntity::class.java,
PackagingElementEntity::class.java,
ConnectionId.ConnectionType.ONE_TO_ABSTRACT_MANY, true)
internal val ARTIFACT_CONNECTION_ID: ConnectionId = ConnectionId.create(ArtifactEntity::class.java,
CompositePackagingElementEntity::class.java,
ConnectionId.ConnectionType.ABSTRACT_ONE_TO_ONE, true)
internal val CHILDREN_CONNECTION_ID: ConnectionId = ConnectionId.create(CompositePackagingElementEntity::class.java,
PackagingElementEntity::class.java,
ConnectionId.ConnectionType.ONE_TO_ABSTRACT_MANY, true)
val connections = listOf<ConnectionId>(
PARENTENTITY_CONNECTION_ID,
ARTIFACT_CONNECTION_ID,
CHILDREN_CONNECTION_ID,
)
}
override val parentEntity: CompositePackagingElementEntity?
get() = snapshot.extractOneToAbstractManyParent(PARENTENTITY_CONNECTION_ID, this)
override val artifact: ArtifactEntity?
get() = snapshot.extractOneToAbstractOneParent(ARTIFACT_CONNECTION_ID, this)
override val children: List<PackagingElementEntity>
get() = snapshot.extractOneToAbstractManyChildren<PackagingElementEntity>(CHILDREN_CONNECTION_ID, this)!!.toList()
override val fileName: String
get() = dataSource.fileName
override val entitySource: EntitySource
get() = dataSource.entitySource
override fun connectionIdList(): List<ConnectionId> {
return connections
}
class Builder(result: ArchivePackagingElementEntityData?) : ModifiableWorkspaceEntityBase<ArchivePackagingElementEntity, ArchivePackagingElementEntityData>(
result), ArchivePackagingElementEntity.Builder {
constructor() : this(ArchivePackagingElementEntityData())
override fun applyToBuilder(builder: MutableEntityStorage) {
if (this.diff != null) {
if (existsInBuilder(builder)) {
this.diff = builder
return
}
else {
error("Entity ArchivePackagingElementEntity is already created in a different builder")
}
}
this.diff = builder
this.snapshot = builder
addToBuilder()
this.id = getEntityData().createEntityId()
// After adding entity data to the builder, we need to unbind it and move the control over entity data to builder
// Builder may switch to snapshot at any moment and lock entity data to modification
this.currentEntityData = null
// Process linked entities that are connected without a builder
processLinkedEntities(builder)
checkInitialization() // TODO uncomment and check failed tests
}
fun checkInitialization() {
val _diff = diff
if (!getEntityData().isEntitySourceInitialized()) {
error("Field WorkspaceEntity#entitySource should be initialized")
}
// Check initialization for list with ref type
if (_diff != null) {
if (_diff.extractOneToManyChildren<WorkspaceEntityBase>(CHILDREN_CONNECTION_ID, this) == null) {
error("Field CompositePackagingElementEntity#children should be initialized")
}
}
else {
if (this.entityLinks[EntityLink(true, CHILDREN_CONNECTION_ID)] == null) {
error("Field CompositePackagingElementEntity#children should be initialized")
}
}
if (!getEntityData().isFileNameInitialized()) {
error("Field ArchivePackagingElementEntity#fileName should be initialized")
}
}
override fun connectionIdList(): List<ConnectionId> {
return connections
}
// Relabeling code, move information from dataSource to this builder
override fun relabel(dataSource: WorkspaceEntity, parents: Set<WorkspaceEntity>?) {
dataSource as ArchivePackagingElementEntity
if (this.entitySource != dataSource.entitySource) this.entitySource = dataSource.entitySource
if (this.fileName != dataSource.fileName) this.fileName = dataSource.fileName
if (parents != null) {
val parentEntityNew = parents.filterIsInstance<CompositePackagingElementEntity?>().singleOrNull()
if ((parentEntityNew == null && this.parentEntity != null) || (parentEntityNew != null && this.parentEntity == null) || (parentEntityNew != null && this.parentEntity != null && (this.parentEntity as WorkspaceEntityBase).id != (parentEntityNew as WorkspaceEntityBase).id)) {
this.parentEntity = parentEntityNew
}
val artifactNew = parents.filterIsInstance<ArtifactEntity?>().singleOrNull()
if ((artifactNew == null && this.artifact != null) || (artifactNew != null && this.artifact == null) || (artifactNew != null && this.artifact != null && (this.artifact as WorkspaceEntityBase).id != (artifactNew as WorkspaceEntityBase).id)) {
this.artifact = artifactNew
}
}
}
override var entitySource: EntitySource
get() = getEntityData().entitySource
set(value) {
checkModificationAllowed()
getEntityData(true).entitySource = value
changedProperty.add("entitySource")
}
override var parentEntity: CompositePackagingElementEntity?
get() {
val _diff = diff
return if (_diff != null) {
_diff.extractOneToAbstractManyParent(PARENTENTITY_CONNECTION_ID, this) ?: this.entityLinks[EntityLink(false,
PARENTENTITY_CONNECTION_ID)] as? CompositePackagingElementEntity
}
else {
this.entityLinks[EntityLink(false, PARENTENTITY_CONNECTION_ID)] as? CompositePackagingElementEntity
}
}
set(value) {
checkModificationAllowed()
val _diff = diff
if (_diff != null && value is ModifiableWorkspaceEntityBase<*, *> && value.diff == null) {
// Setting backref of the list
if (value is ModifiableWorkspaceEntityBase<*, *>) {
val data = (value.entityLinks[EntityLink(true, PARENTENTITY_CONNECTION_ID)] as? List<Any> ?: emptyList()) + this
value.entityLinks[EntityLink(true, PARENTENTITY_CONNECTION_ID)] = data
}
// else you're attaching a new entity to an existing entity that is not modifiable
_diff.addEntity(value)
}
if (_diff != null && (value !is ModifiableWorkspaceEntityBase<*, *> || value.diff != null)) {
_diff.updateOneToAbstractManyParentOfChild(PARENTENTITY_CONNECTION_ID, this, value)
}
else {
// Setting backref of the list
if (value is ModifiableWorkspaceEntityBase<*, *>) {
val data = (value.entityLinks[EntityLink(true, PARENTENTITY_CONNECTION_ID)] as? List<Any> ?: emptyList()) + this
value.entityLinks[EntityLink(true, PARENTENTITY_CONNECTION_ID)] = data
}
// else you're attaching a new entity to an existing entity that is not modifiable
this.entityLinks[EntityLink(false, PARENTENTITY_CONNECTION_ID)] = value
}
changedProperty.add("parentEntity")
}
override var artifact: ArtifactEntity?
get() {
val _diff = diff
return if (_diff != null) {
_diff.extractOneToAbstractOneParent(ARTIFACT_CONNECTION_ID, this) ?: this.entityLinks[EntityLink(false,
ARTIFACT_CONNECTION_ID)] as? ArtifactEntity
}
else {
this.entityLinks[EntityLink(false, ARTIFACT_CONNECTION_ID)] as? ArtifactEntity
}
}
set(value) {
checkModificationAllowed()
val _diff = diff
if (_diff != null && value is ModifiableWorkspaceEntityBase<*, *> && value.diff == null) {
if (value is ModifiableWorkspaceEntityBase<*, *>) {
value.entityLinks[EntityLink(true, ARTIFACT_CONNECTION_ID)] = this
}
// else you're attaching a new entity to an existing entity that is not modifiable
_diff.addEntity(value)
}
if (_diff != null && (value !is ModifiableWorkspaceEntityBase<*, *> || value.diff != null)) {
_diff.updateOneToAbstractOneParentOfChild(ARTIFACT_CONNECTION_ID, this, value)
}
else {
if (value is ModifiableWorkspaceEntityBase<*, *>) {
value.entityLinks[EntityLink(true, ARTIFACT_CONNECTION_ID)] = this
}
// else you're attaching a new entity to an existing entity that is not modifiable
this.entityLinks[EntityLink(false, ARTIFACT_CONNECTION_ID)] = value
}
changedProperty.add("artifact")
}
override var children: List<PackagingElementEntity>
get() {
val _diff = diff
return if (_diff != null) {
_diff.extractOneToAbstractManyChildren<PackagingElementEntity>(CHILDREN_CONNECTION_ID,
this)!!.toList() + (this.entityLinks[EntityLink(true,
CHILDREN_CONNECTION_ID)] as? List<PackagingElementEntity>
?: emptyList())
}
else {
this.entityLinks[EntityLink(true, CHILDREN_CONNECTION_ID)] as List<PackagingElementEntity> ?: emptyList()
}
}
set(value) {
// Set list of ref types for abstract entities
checkModificationAllowed()
val _diff = diff
if (_diff != null) {
for (item_value in value) {
if (item_value is ModifiableWorkspaceEntityBase<*, *> && (item_value as? ModifiableWorkspaceEntityBase<*, *>)?.diff == null) {
// Backref setup before adding to store an abstract entity
if (item_value is ModifiableWorkspaceEntityBase<*, *>) {
item_value.entityLinks[EntityLink(false, CHILDREN_CONNECTION_ID)] = this
}
// else you're attaching a new entity to an existing entity that is not modifiable
_diff.addEntity(item_value)
}
}
_diff.updateOneToAbstractManyChildrenOfParent(CHILDREN_CONNECTION_ID, this, value.asSequence())
}
else {
for (item_value in value) {
if (item_value is ModifiableWorkspaceEntityBase<*, *>) {
item_value.entityLinks[EntityLink(false, CHILDREN_CONNECTION_ID)] = this
}
// else you're attaching a new entity to an existing entity that is not modifiable
}
this.entityLinks[EntityLink(true, CHILDREN_CONNECTION_ID)] = value
}
changedProperty.add("children")
}
override var fileName: String
get() = getEntityData().fileName
set(value) {
checkModificationAllowed()
getEntityData(true).fileName = value
changedProperty.add("fileName")
}
override fun getEntityClass(): Class<ArchivePackagingElementEntity> = ArchivePackagingElementEntity::class.java
}
}
class ArchivePackagingElementEntityData : WorkspaceEntityData<ArchivePackagingElementEntity>() {
lateinit var fileName: String
fun isFileNameInitialized(): Boolean = ::fileName.isInitialized
override fun wrapAsModifiable(diff: MutableEntityStorage): WorkspaceEntity.Builder<ArchivePackagingElementEntity> {
val modifiable = ArchivePackagingElementEntityImpl.Builder(null)
modifiable.diff = diff
modifiable.snapshot = diff
modifiable.id = createEntityId()
return modifiable
}
override fun createEntity(snapshot: EntityStorage): ArchivePackagingElementEntity {
return getCached(snapshot) {
val entity = ArchivePackagingElementEntityImpl(this)
entity.snapshot = snapshot
entity.id = createEntityId()
entity
}
}
override fun getEntityInterface(): Class<out WorkspaceEntity> {
return ArchivePackagingElementEntity::class.java
}
override fun serialize(ser: EntityInformation.Serializer) {
}
override fun deserialize(de: EntityInformation.Deserializer) {
}
override fun createDetachedEntity(parents: List<WorkspaceEntity>): WorkspaceEntity {
return ArchivePackagingElementEntity(fileName, entitySource) {
this.parentEntity = parents.filterIsInstance<CompositePackagingElementEntity>().singleOrNull()
this.artifact = parents.filterIsInstance<ArtifactEntity>().singleOrNull()
}
}
override fun getRequiredParents(): List<Class<out WorkspaceEntity>> {
val res = mutableListOf<Class<out WorkspaceEntity>>()
return res
}
override fun equals(other: Any?): Boolean {
if (other == null) return false
if (this.javaClass != other.javaClass) return false
other as ArchivePackagingElementEntityData
if (this.entitySource != other.entitySource) return false
if (this.fileName != other.fileName) return false
return true
}
override fun equalsIgnoringEntitySource(other: Any?): Boolean {
if (other == null) return false
if (this.javaClass != other.javaClass) return false
other as ArchivePackagingElementEntityData
if (this.fileName != other.fileName) return false
return true
}
override fun hashCode(): Int {
var result = entitySource.hashCode()
result = 31 * result + fileName.hashCode()
return result
}
override fun hashCodeIgnoringEntitySource(): Int {
var result = javaClass.hashCode()
result = 31 * result + fileName.hashCode()
return result
}
override fun collectClassUsagesData(collector: UsedClassesCollector) {
collector.sameForAllEntities = true
}
}
| apache-2.0 | 56f6ad59c467d978a9f5472bc604acc8 | 43.861878 | 281 | 0.666379 | 5.732439 | false | false | false | false |
smmribeiro/intellij-community | plugins/kotlin/completion/tests/testData/basic/common/namedArguments/CompactTypeNames.kt | 12 | 361 | val paramTest = 12
fun small(paramFirst: Sequence<String>, paramSecond: Comparable<kotlin.collections.List<kotlin.Any>>) {
}
fun test() = small(<caret>)
// EXIST: {"lookupString":"paramSecond =","tailText":" Comparable<List<Any>>","itemText":"paramSecond ="}
// EXIST: {"lookupString":"paramFirst =","tailText":" Sequence<String>","itemText":"paramFirst ="}
| apache-2.0 | 53575f460359c8ac22cf9586969b2c29 | 39.111111 | 105 | 0.700831 | 3.721649 | false | true | false | false |
smmribeiro/intellij-community | plugins/kotlin/frontend-fir/test/org/jetbrains/kotlin/idea/frontend/api/components/AbstractExpectedExpressionTypeTest.kt | 2 | 2189 | /*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.frontend.api.components
import com.intellij.openapi.util.io.FileUtil
import com.intellij.psi.util.parentOfType
import org.jetbrains.kotlin.idea.executeOnPooledThreadInReadAction
import org.jetbrains.kotlin.idea.frontend.api.analyze
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
import org.jetbrains.kotlin.psi.KtExpression
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.test.KotlinTestUtils
import org.jetbrains.kotlin.test.util.IgnoreTests
import java.io.File
abstract class AbstractExpectedExpressionTypeTest : KotlinLightCodeInsightFixtureTestCase() {
override fun isFirPlugin() = true
protected fun doTest(path: String) {
val testDataFile = File(path)
val ktFile = myFixture.configureByText(testDataFile.name, FileUtil.loadFile(testDataFile)) as KtFile
val expressionAtCaret = ktFile.findElementAt(myFixture.caretOffset)?.parentOfType<KtExpression>()
?: error("No element was found at caret or no <caret> is present in the test file")
val actualExpectedTypeText: String? = executeOnPooledThreadInReadAction {
analyze(ktFile) {
expressionAtCaret.getExpectedType()?.asStringForDebugging()
}
}
IgnoreTests.runTestWithFixMeSupport(testDataFile.toPath()) {
KotlinTestUtils.assertEqualsToFile(File(path), testDataFile.getTextWithActualType(actualExpectedTypeText))
}
}
private fun File.getTextWithActualType(actualType: String?) : String {
val text = FileUtil.loadFile(this)
val textWithoutTypeDirective = text.split('\n')
.filterNot { it.startsWith(EXPECTED_TYPE_TEXT_DIRECTIVE) }
.joinToString(separator = "\n")
return "$textWithoutTypeDirective\n$EXPECTED_TYPE_TEXT_DIRECTIVE $actualType"
}
companion object {
private const val EXPECTED_TYPE_TEXT_DIRECTIVE = "// EXPECTED_TYPE:"
}
} | apache-2.0 | 56763489e62864850595cd80cd982bdd | 41.941176 | 118 | 0.740064 | 4.727862 | false | true | false | false |
Cognifide/gradle-aem-plugin | src/main/kotlin/com/cognifide/gradle/aem/common/instance/local/Status.kt | 1 | 1270 | package com.cognifide.gradle.aem.common.instance.local
@Suppress("MagicNumber")
class Status(val type: Type, val exitValue: String) {
val text: String get() = when (type) {
Type.UNRECOGNIZED -> "${type.displayName} ($exitValue)"
else -> type.displayName
}
val running: Boolean get() = type == Type.RUNNING
val runnable: Boolean get() = Type.RUNNABLE.contains(type)
val unrecognized: Boolean get() = type == Type.UNRECOGNIZED
@Suppress("MagicNumber")
enum class Type(val exitValue: String) {
RUNNING("0"),
DEAD("1"),
NOT_RUNNING("3"),
UNKNOWN("4"),
UNRECOGNIZED("<none>");
val displayName: String get() = name.toLowerCase().replace("_", " ").capitalize()
override fun toString() = displayName
companion object {
val RUNNABLE = arrayOf(NOT_RUNNING, UNKNOWN)
fun byExitValue(exitValue: Int) = values().find { it.exitValue == exitValue.toString() } ?: UNRECOGNIZED
}
}
override fun toString() = text
companion object {
val UNRECOGNIZED = Status(Type.UNRECOGNIZED, Type.UNRECOGNIZED.exitValue)
fun byExitValue(exitValue: Int) = Status(Type.byExitValue(exitValue), exitValue.toString())
}
}
| apache-2.0 | d4452eda0cd952079ddf0f056b719bb7 | 28.534884 | 116 | 0.626772 | 4.440559 | false | false | false | false |
erdo/asaf-project | example-kt-08ktor/src/main/java/foo/bar/example/forektorkt/OG.kt | 1 | 2817 | package foo.bar.example.forektorkt
import android.app.Application
import co.early.fore.kt.core.logging.AndroidLogger
import co.early.fore.kt.core.logging.SilentLogger
import co.early.fore.kt.net.InterceptorLogging
import co.early.fore.kt.net.ktor.CallProcessorKtor
import foo.bar.example.forektorkt.api.CustomGlobalErrorHandler
import foo.bar.example.forektorkt.api.CustomGlobalRequestInterceptor
import foo.bar.example.forektorkt.api.CustomKtorBuilder
import foo.bar.example.forektorkt.api.fruits.FruitService
import foo.bar.example.forektorkt.feature.fruit.FruitFetcher
import java.util.*
import kotlin.collections.set
/**
*
* OG - Object Graph, pure DI implementation
*
* Copyright © 2019 early.co. All rights reserved.
*/
@Suppress("UNUSED_PARAMETER")
object OG {
private var initialized = false
private val dependencies = HashMap<Class<*>, Any>()
fun setApplication(application: Application) {
// create dependency graph
val logger = if (BuildConfig.DEBUG) AndroidLogger("fore_") else SilentLogger()
// networking classes common to all models
val httpClient = CustomKtorBuilder.create(
CustomGlobalRequestInterceptor(logger),
InterceptorLogging(logger)
)//logging interceptor should be the last one
val callProcessor = CallProcessorKtor(
errorHandler = CustomGlobalErrorHandler(logger),
logger = logger
)
// models
val fruitFetcher = FruitFetcher(
FruitService.create(httpClient),
callProcessor,
logger
)
// add models to the dependencies map if you will need them later
dependencies[FruitFetcher::class.java] = fruitFetcher
}
fun init() {
if (!initialized) {
initialized = true
// run any necessary initialization code once object graph has been created here
}
}
/**
* This is how dependencies get injected, typically an Activity/Fragment/View will call this
* during the onCreate()/onCreateView()/onFinishInflate() method respectively for each of the
* dependencies it needs.
*
* Can use a DI library for similar behaviour using annotations
*
* Will return mocks if they have been set previously in putMock()
*
*
* Call it like this:
*
* <code>
* yourModel = OG[YourModel::class.java]
* </code>
*
* If you want to more tightly scoped object, one way is to pass a factory class here and create
* an instance where you need it
*
*/
@Suppress("UNCHECKED_CAST")
operator fun <T> get(model: Class<T>): T = dependencies[model] as T
fun <T> putMock(clazz: Class<T>, instance: T) {
dependencies[clazz] = instance as Any
}
}
| apache-2.0 | 16c220b18a674d949db63cd693eeca8e | 29.27957 | 100 | 0.673651 | 4.338983 | false | false | false | false |
morizooo/conference2017-android | app/src/main/kotlin/io/builderscon/conference2017/view/activity/QRCodeReaderActivity.kt | 1 | 2551 | package io.builderscon.conference2017.view.activity
import android.Manifest
import android.content.pm.PackageManager
import android.os.Bundle
import android.support.v4.app.ActivityCompat
import android.support.v4.content.ContextCompat
import android.support.v7.app.AlertDialog
import android.support.v7.app.AppCompatActivity
import android.view.ViewGroup
import com.google.zxing.Result
import io.builderscon.conference2017.R
import io.builderscon.conference2017.extension.initSupportActionBar
import io.builderscon.conference2017.extension.openWebView
import kotlinx.android.synthetic.main.activity_qrcode_reader.*
import me.dm7.barcodescanner.zxing.ZXingScannerView
class QRCodeReaderActivity : AppCompatActivity(), ZXingScannerView.ResultHandler {
lateinit var mScannerView: ZXingScannerView
override fun handleResult(result: Result?) {
val text: String? = result?.text
AlertDialog.Builder(this)
.setTitle("Result")
.setMessage(text ?: "")
.setPositiveButton("Open", { _, _ ->
this.openWebView(text)
})
.setNegativeButton("Cancel", { _, _ ->
mScannerView.resumeCameraPreview(this)
})
.show()
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_qrcode_reader)
initSupportActionBar(tool_bar)
toolbar_title.text = getString(R.string.title_qrcodereader)
val frame = fragment as ViewGroup
mScannerView = ZXingScannerView(this)
frame.addView(mScannerView)
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
return ActivityCompat.requestPermissions(this,
listOf(Manifest.permission.CAMERA).toTypedArray(), 1)
}
}
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
if (grantResults.isNotEmpty() && grantResults.first() == PackageManager.PERMISSION_GRANTED) {
mScannerView.setResultHandler(this)
mScannerView.startCamera()
return
}
this.finish()
}
override fun onResume() {
super.onResume()
mScannerView.setResultHandler(this)
mScannerView.startCamera()
}
public override fun onPause() {
super.onPause()
mScannerView.stopCamera()
}
}
| apache-2.0 | 5dcb6c4a7b8d40d38ba9c358588945ab | 34.430556 | 119 | 0.681693 | 4.680734 | false | false | false | false |
TachiWeb/TachiWeb-Server | TachiServer/src/main/java/xyz/nulldev/ts/api/v2/java/impl/ServerAPIImpl.kt | 1 | 1053 | package xyz.nulldev.ts.api.v2.java.impl
import eu.kanade.tachiyomi.data.database.DatabaseHelper
import eu.kanade.tachiyomi.data.database.inTransactionReturn
import xyz.nulldev.ts.api.v2.java.impl.categories.CategoriesControllerImpl
import xyz.nulldev.ts.api.v2.java.impl.chapters.ChaptersControllerImpl
import xyz.nulldev.ts.api.v2.java.impl.extensions.ExtensionsControllerImpl
import xyz.nulldev.ts.api.v2.java.impl.library.LibraryControllerImpl
import xyz.nulldev.ts.api.v2.java.impl.mangas.MangasControllerImpl
import xyz.nulldev.ts.api.v2.java.model.ServerAPI
import xyz.nulldev.ts.ext.kInstanceLazy
class ServerAPIImpl : ServerAPI {
private val db: DatabaseHelper by kInstanceLazy()
override val library = LibraryControllerImpl()
override val chapters = ChaptersControllerImpl()
override val mangas = MangasControllerImpl()
override val categories = CategoriesControllerImpl()
override val extensions = ExtensionsControllerImpl()
fun <T> transaction(block: () -> T) {
db.db.inTransactionReturn(block)
}
} | apache-2.0 | 964ef12f0a8489c38c17ac3ef7cb151b | 41.16 | 74 | 0.79867 | 3.929104 | false | false | false | false |
lsxiao/Apollo | core/src/main/java/com/lsxiao/apollo/core/serialize/KryoSerializer.kt | 1 | 1411 | package com.lsxiao.apollo.core.serialize
import com.esotericsoftware.kryo.Kryo
import com.esotericsoftware.kryo.KryoException
import com.esotericsoftware.kryo.io.Input
import com.esotericsoftware.kryo.io.Output
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.IOException
/**
* write with Apollo
* author:lsxiao
* date:2017-05-17 17:25
* github:https://github.com/lsxiao
* zhihu:https://zhihu.com/people/lsxiao
*/
class KryoSerializer : Serializable {
private val mKryo = Kryo()
init {
mKryo.references = false
}
override fun serialize(obj: Any): ByteArray {
val outputStream = ByteArrayOutputStream()
val output = Output(outputStream)
mKryo.writeObject(output, obj)
output.flush()
output.close()
val b = outputStream.toByteArray()
try {
outputStream.flush()
outputStream.close()
} catch (e: IOException) {
e.printStackTrace()
}
return b
}
override fun <T> deserialize(data: ByteArray, clazz: Class<T>): T {
val byteArrayInputStream = ByteArrayInputStream(data)
val input = Input(byteArrayInputStream)
val t = mKryo.readObject(input, clazz)
try {
input.close()
} catch (e: KryoException) {
e.printStackTrace()
}
return t
}
}
| apache-2.0 | c22d528be79645b1ea2a6caec945bfe1 | 24.196429 | 71 | 0.641389 | 4.301829 | false | false | false | false |
paoloach/zdomus | ZTopology/app/src/main/java/it/achdjian/paolo/ztopology/rest/RequestAttributes.kt | 1 | 2020 | package it.achdjian.paolo.ztopology.rest
import android.util.Log
import com.fasterxml.jackson.core.type.TypeReference
import it.achdjian.paolo.ztopology.DomusEngine
import it.achdjian.paolo.ztopology.MessageType
import it.achdjian.paolo.ztopology.domusEngine.rest.Attribute
import it.achdjian.paolo.ztopology.domusEngine.rest.Attributes
import it.achdjian.paolo.ztopology.domusEngine.rest.DomusEngineRest
import it.achdjian.paolo.ztopology.domusEngine.rest.ZigbeeRunnable
import it.achdjian.paolo.ztopology.zigbee.Cluster
import java.io.IOException
/**
* Created by Paolo Achdjian on 2/27/18.
*/
class RequestAttributes(
val nwkAddress: Int,
val endpoint: Int,
val cluster: Cluster,
val attributes: List<Int>
) : ZigbeeRunnable() {
override fun run() {
if (attributes.size == 0)
return
val buffer = StringBuffer()
attributes.forEach { buffer.append(it).append(",") }
buffer.deleteCharAt(buffer.lastIndex)
val path = "/devices/${nwkAddress.toString(16)}" +
"/endpoint/${endpoint.toString(16)}" +
"/cluster/in/${cluster.id.toString(16)}" +
"/attributes?id=${buffer.toString()}"
val body = DomusEngineRest.get(path)
if (body.isNotBlank()) {
try {
Log.i(TAG, body)
val jsonAttributes = MAPPER.readValue<List<Attribute>>(
body,
object : TypeReference<List<Attribute>>() {})
val attributes = Attributes(nwkAddress, endpoint, cluster, jsonAttributes)
DomusEngine.handler.sendMessage(
DomusEngine.handler.obtainMessage(MessageType.NEW_ATTRIBUTES, attributes )
)
Log.i(TAG, jsonAttributes.toString())
} catch (e: IOException) {
Log.e(TAG, "Error parsing response for $path")
Log.e(TAG, "Response: $body")
e.printStackTrace()
}
}
}
} | gpl-2.0 | 27ba36f952c0bc07e29e81b423af7841 | 34.45614 | 94 | 0.624752 | 4.362851 | false | false | false | false |
square/sqldelight | sqldelight-idea-plugin/src/main/kotlin/com/squareup/sqldelight/intellij/lang/SqlDelightCommenter.kt | 1 | 1696 | /*
* Copyright (C) 2018 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.squareup.sqldelight.intellij.lang
import com.alecstrong.sql.psi.core.psi.SqlTypes
import com.intellij.lang.CodeDocumentationAwareCommenter
import com.intellij.psi.PsiComment
import com.intellij.psi.tree.IElementType
class SqlDelightCommenter : CodeDocumentationAwareCommenter {
override fun getLineCommentTokenType(): IElementType = SqlTypes.COMMENT
override fun getLineCommentPrefix() = "-- "
override fun getBlockCommentTokenType(): IElementType? = null
override fun getBlockCommentPrefix(): String? = null
override fun getBlockCommentSuffix(): String? = null
override fun getDocumentationCommentTokenType(): IElementType = SqlTypes.JAVADOC
override fun isDocumentationComment(psiComment: PsiComment?) =
psiComment?.tokenType == documentationCommentTokenType
override fun getDocumentationCommentPrefix() = "/**"
override fun getDocumentationCommentLinePrefix() = "*"
override fun getDocumentationCommentSuffix() = "*/"
override fun getCommentedBlockCommentPrefix(): String? = null
override fun getCommentedBlockCommentSuffix(): String? = null
}
| apache-2.0 | 30d971be12a061d814740e0d25967f5d | 38.44186 | 82 | 0.775943 | 4.804533 | false | false | false | false |
bubelov/coins-android | app/src/main/java/com/bubelov/coins/api/coins/MockCoinsApi.kt | 1 | 2435 | package com.bubelov.coins.api.coins
import com.bubelov.coins.data.Place
import com.bubelov.coins.model.User
import com.bubelov.coins.repository.place.BuiltInPlacesCache
import com.bubelov.coins.repository.synclogs.LogsRepository
import kotlinx.coroutines.runBlocking
import java.time.LocalDateTime
import java.util.*
class MockCoinsApi(
placesCache: BuiltInPlacesCache,
logsRepository: LogsRepository
) : CoinsApi {
private val places = mutableListOf<Place>()
private val date1 = LocalDateTime.parse("2019-03-01T20:10:14")
private val user1 = User(
id = "E5B65104-60FF-4EE4-8A38-36144F479A93",
email = "[email protected]",
emailConfirmed = false,
firstName = "Foo",
lastName = "Bar",
avatarUrl = "",
createdAt = date1,
updatedAt = date1
)
private val users = mutableListOf(user1)
init {
runBlocking {
logsRepository.append("api", "Initializing mock API")
places.addAll(placesCache.loadPlaces())
}
}
override suspend fun getToken(authorization: String): TokenResponse {
return TokenResponse(
token = UUID.randomUUID().toString(),
user = user1
)
}
override suspend fun createUser(args: CreateUserArgs): User {
val user = User(
id = UUID.randomUUID().toString(),
email = args.email,
emailConfirmed = false,
firstName = args.firstName,
lastName = args.lastName,
avatarUrl = "",
createdAt = LocalDateTime.now(),
updatedAt = LocalDateTime.now()
)
users += user
return user
}
override suspend fun getUser(id: String, authorization: String): User {
return users.firstOrNull { it.id == id } ?: throw Exception("No user with id: $id")
}
override suspend fun getPlaces(createdOrUpdatedAfter: LocalDateTime): List<Place> {
return emptyList()
}
override suspend fun addPlace(authorization: String, args: CreatePlaceArgs): Place {
places += args.place
return args.place
}
override suspend fun updatePlace(
id: String,
authorization: String,
args: UpdatePlaceArgs
): Place {
val existingPlace = places.find { it.id == id }
places.remove(existingPlace)
places += args.place
return args.place
}
} | unlicense | 16106335ffd208389e35298bc60bdcf6 | 27.325581 | 91 | 0.623819 | 4.427273 | false | false | false | false |
tommyettinger/SquidSetup | src/main/kotlin/com/github/czyzby/setup/data/templates/template.kt | 1 | 10137 | package com.github.czyzby.setup.data.templates
import com.github.czyzby.setup.data.files.SourceFile
import com.github.czyzby.setup.data.files.path
import com.github.czyzby.setup.data.platforms.*
import com.github.czyzby.setup.data.project.Project
/**
* Interface shared by all project templates. Templates should be annotated with ProjectTemplate.
* @author MJ
*/
interface Template {
val id: String
// Sizes are kept as strings so you can set the sizes to static values, for example: MainClass.WIDTH.
val width: String
get() = "640"
val height: String
get() = "480"
/**
* Used as project description in README file. Optional.
*/
val description: String
get() = ""
/**
* @param project is being created. Should contain sources provided by this template.
*/
fun apply(project: Project) {
addApplicationListener(project)
addAndroidLauncher(project)
addDesktopLauncher(project)
addGwtLauncher(project)
addHeadlessLauncher(project)
addIOSLauncher(project)
addLwjgl3Launcher(project)
addServerLauncher(project)
project.readmeDescription = description
}
fun addApplicationListener(project: Project) {
addSourceFile(project = project, platform = Core.ID, packageName = project.basic.rootPackage,
fileName = "${project.basic.mainClass}.java", content = getApplicationListenerContent(project));
}
/**
* @param project is being created.
* @return content of Java class implementing ApplicationListener.
*/
fun getApplicationListenerContent(project: Project): String
fun addDesktopLauncher(project: Project) {
addSourceFile(project = project, platform = Desktop.ID, packageName = "${project.basic.rootPackage}.desktop",
fileName = "DesktopLauncher.java", content = getDesktopLauncherContent(project));
}
fun getDesktopLauncherContent(project: Project): String = """package ${project.basic.rootPackage}.desktop;
import com.badlogic.gdx.Files.FileType;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import ${project.basic.rootPackage}.${project.basic.mainClass};
/** Launches the desktop (LWJGL) application. */
public class DesktopLauncher {
public static void main(String[] args) {
createApplication();
}
private static LwjglApplication createApplication() {
return new LwjglApplication(new ${project.basic.mainClass}(), getDefaultConfiguration());
}
private static LwjglApplicationConfiguration getDefaultConfiguration() {
LwjglApplicationConfiguration configuration = new LwjglApplicationConfiguration();
configuration.title = "${project.basic.name}";
configuration.width = ${width};
configuration.height = ${height};
for (int size : new int[] { 128, 64, 32, 16 }) {
configuration.addIcon("libgdx" + size + ".png", FileType.Internal);
}
return configuration;
}
}"""
fun addGwtLauncher(project: Project) {
addSourceFile(project = project, platform = GWT.ID, packageName = "${project.basic.rootPackage}.gwt",
fileName = "GwtLauncher.java", content = getGwtLauncherContent(project));
}
fun getGwtLauncherContent(project: Project): String = """package ${project.basic.rootPackage}.gwt;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.backends.gwt.GwtApplication;
import com.badlogic.gdx.backends.gwt.GwtApplicationConfiguration;
import ${project.basic.rootPackage}.${project.basic.mainClass};
/** Launches the GWT application. */
public class GwtLauncher extends GwtApplication {
@Override
public GwtApplicationConfiguration getConfig() {
GwtApplicationConfiguration configuration = new GwtApplicationConfiguration(${width}, ${height});
return configuration;
}
@Override
public ApplicationListener createApplicationListener() {
return new ${project.basic.mainClass}();
}
}"""
fun addAndroidLauncher(project: Project) {
addSourceFile(project = project, platform = Android.ID, packageName = "${project.basic.rootPackage}.android",
fileName = "AndroidLauncher.java", content = getAndroidLauncherContent(project));
}
fun getAndroidLauncherContent(project: Project): String = """package ${project.basic.rootPackage}.android;
import android.os.Bundle;
import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import ${project.basic.rootPackage}.${project.basic.mainClass};
/** Launches the Android application. */
public class AndroidLauncher extends AndroidApplication {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration configuration = new AndroidApplicationConfiguration();
initialize(new ${project.basic.mainClass}(), configuration);
}
}"""
fun addHeadlessLauncher(project: Project) {
addSourceFile(project = project, platform = Headless.ID, packageName = "${project.basic.rootPackage}.headless",
fileName = "HeadlessLauncher.java", content = getHeadlessLauncherContent(project));
}
fun getHeadlessLauncherContent(project: Project): String = """package ${project.basic.rootPackage}.headless;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.backends.headless.HeadlessApplication;
import com.badlogic.gdx.backends.headless.HeadlessApplicationConfiguration;
import ${project.basic.rootPackage}.${project.basic.mainClass};
/** Launches the headless application. Can be converted into a utilities project or a server application. */
public class HeadlessLauncher {
public static void main(String[] args) {
createApplication();
}
private static Application createApplication() {
// Note: you can use a custom ApplicationListener implementation for the headless project instead of ${project.basic.mainClass}.
return new HeadlessApplication(new ${project.basic.mainClass}(), getDefaultConfiguration());
}
private static HeadlessApplicationConfiguration getDefaultConfiguration() {
HeadlessApplicationConfiguration configuration = new HeadlessApplicationConfiguration();
configuration.renderInterval = -1f; // When this value is negative, ${project.basic.mainClass}#render() is never called.
return configuration;
}
}"""
fun addIOSLauncher(project: Project) {
addSourceFile(project = project, platform = iOS.ID, packageName = "${project.basic.rootPackage}.ios",
fileName = "IOSLauncher.java", content = getIOSLauncherContent(project));
}
fun getIOSLauncherContent(project: Project): String = """package ${project.basic.rootPackage}.ios;
import org.robovm.apple.foundation.NSAutoreleasePool;
import org.robovm.apple.uikit.UIApplication;
import com.badlogic.gdx.backends.iosrobovm.IOSApplication;
import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration;
import ${project.basic.rootPackage}.${project.basic.mainClass};
/** Launches the iOS (RoboVM) application. */
public class IOSLauncher extends IOSApplication.Delegate {
@Override
protected IOSApplication createApplication() {
IOSApplicationConfiguration configuration = new IOSApplicationConfiguration();
return new IOSApplication(new ${project.basic.mainClass}(), configuration);
}
public static void main(String[] argv) {
NSAutoreleasePool pool = new NSAutoreleasePool();
UIApplication.main(argv, null, IOSLauncher.class);
pool.close();
}
}"""
fun addLwjgl3Launcher(project: Project) {
addSourceFile(project = project, platform = LWJGL3.ID, packageName = "${project.basic.rootPackage}.lwjgl3",
fileName = "Lwjgl3Launcher.java", content = getLwjgl3LauncherContent(project));
}
fun getLwjgl3LauncherContent(project: Project): String = """package ${project.basic.rootPackage}.lwjgl3;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import ${project.basic.rootPackage}.${project.basic.mainClass};
/** Launches the desktop (LWJGL3) application. */
public class Lwjgl3Launcher {
public static void main(String[] args) {
createApplication();
}
private static Lwjgl3Application createApplication() {
return new Lwjgl3Application(new ${project.basic.mainClass}(), getDefaultConfiguration());
}
private static Lwjgl3ApplicationConfiguration getDefaultConfiguration() {
Lwjgl3ApplicationConfiguration configuration = new Lwjgl3ApplicationConfiguration();
configuration.setTitle("${project.basic.name}");
configuration.setWindowedMode(${width}, ${height});
configuration.setWindowIcon("libgdx128.png", "libgdx64.png", "libgdx32.png", "libgdx16.png");
return configuration;
}
}"""
fun addServerLauncher(project: Project) {
addSourceFile(project = project, platform = Server.ID, packageName = "${project.basic.rootPackage}.server",
fileName = "ServerLauncher.java", content = getServerLauncherContent(project));
}
fun getServerLauncherContent(project: Project): String = """package ${project.basic.rootPackage}.server;
/** Launches the server application. */
public class ServerLauncher {
public static void main(String[] args) {
// TODO Implement server application.
}
}"""
fun addSourceFile(project: Project, platform: String, packageName: String, fileName: String,
content: String, sourceFolderPath: String = path("src", "main", "java")) {
if (project.hasPlatform(platform)) {
project.files.add(SourceFile(projectName = platform, sourceFolderPath = sourceFolderPath,
packageName = packageName, fileName = fileName, content = content))
}
}
}
| apache-2.0 | f79a9cc5173da560d471491a1f5762d4 | 40.207317 | 136 | 0.716583 | 4.73913 | false | true | false | false |
tonyofrancis/Fetch | fetch2/src/main/java/com/tonyodev/fetch2/provider/GroupInfoProvider.kt | 1 | 1946 | package com.tonyodev.fetch2.provider
import com.tonyodev.fetch2.Download
import com.tonyodev.fetch2.FetchGroup
import com.tonyodev.fetch2.model.FetchGroupInfo
import com.tonyodev.fetch2core.Reason
import java.lang.ref.WeakReference
class GroupInfoProvider(private val namespace: String,
private val downloadProvider: DownloadProvider) {
private val lock = Any()
private val groupInfoMap = mutableMapOf<Int, WeakReference<FetchGroupInfo>>()
fun getGroupInfo(id: Int, reason: Reason): FetchGroupInfo {
synchronized(lock) {
val info = groupInfoMap[id]?.get()
return if (info == null) {
val groupInfo = FetchGroupInfo(id, namespace)
groupInfo.update(downloadProvider.getByGroup(id), null, reason)
groupInfoMap[id] = WeakReference(groupInfo)
groupInfo
} else {
info
}
}
}
fun getGroupReplace(id: Int, download: Download, reason: Reason): FetchGroup {
return synchronized(lock) {
val groupInfo = getGroupInfo(id, reason)
groupInfo.update(downloadProvider.getByGroupReplace(id, download), download, reason)
groupInfo
}
}
fun postGroupReplace(id: Int, download: Download, reason: Reason) {
synchronized(lock) {
val groupInfo = groupInfoMap[id]?.get()
groupInfo?.update(downloadProvider.getByGroupReplace(id, download), download, reason)
}
}
fun clean() {
synchronized(lock) {
val iterator = groupInfoMap.iterator()
while (iterator.hasNext()) {
val ref = iterator.next()
if (ref.value.get() == null) {
iterator.remove()
}
}
}
}
fun clear() {
synchronized(lock) {
groupInfoMap.clear()
}
}
} | apache-2.0 | 1889aa9e58f01d8fc72184da4f1ef2e0 | 30.403226 | 97 | 0.5889 | 4.557377 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.