Exemple #1
0
ColorSchemePrivate::ColorSchemePrivate(QPalette::ColorGroup state, const char* group, SetDefaultColors defaults) {
      _contrast = 1.0;    // KGlobalSettings::contrastF( config );

      // loaded-from-config colors (no adjustment)
      _brushes.bg[0] = SET_DEFAULT(NormalBackground);
      _brushes.bg[1] = SET_DEFAULT(AlternateBackground);

      // the rest
      init(state, group, defaults);
      }
Exemple #2
0
void ColorSchemePrivate::init(QPalette::ColorGroup state, const char* group, SetDefaultColors defaults) {
      // loaded-from-config colors
      _brushes.fg[0] = SET_DEFAULT(NormalText);
      _brushes.fg[1] = SET_DEFAULT(InactiveText);
      _brushes.fg[2] = SET_DEFAULT(ActiveText);
      _brushes.fg[3] = SET_DEFAULT(LinkText);
      _brushes.fg[4] = SET_DEFAULT(VisitedText);
      _brushes.fg[5] = SET_DEFAULT(NegativeText);
      _brushes.fg[6] = SET_DEFAULT(NeutralText);
      _brushes.fg[7] = SET_DEFAULT(PositiveText);

      _brushes.deco[0] = DECO_DEFAULT(Hover);
      _brushes.deco[1] = DECO_DEFAULT(Focus);

      // apply state adjustments
      if (state != QPalette::Active) {
            StateEffects effects(state);
            for (int i = 0; i < 8; i++) {
                  _brushes.fg[i] = effects.brush(_brushes.fg[i], _brushes.bg[0]);
                  }
            _brushes.deco[0] = effects.brush(_brushes.deco[0], _brushes.bg[0]);
            _brushes.deco[1] = effects.brush(_brushes.deco[1], _brushes.bg[0]);
            _brushes.bg[0] = effects.brush(_brushes.bg[0]);
            _brushes.bg[1] = effects.brush(_brushes.bg[1]);
            }

      // calculated backgrounds
      _brushes.bg[2] = ColorUtils::tint(_brushes.bg[0].color(), _brushes.fg[2].color());
      _brushes.bg[3] = ColorUtils::tint(_brushes.bg[0].color(), _brushes.fg[3].color());
      _brushes.bg[4] = ColorUtils::tint(_brushes.bg[0].color(), _brushes.fg[4].color());
      _brushes.bg[5] = ColorUtils::tint(_brushes.bg[0].color(), _brushes.fg[5].color());
      _brushes.bg[6] = ColorUtils::tint(_brushes.bg[0].color(), _brushes.fg[6].color());
      _brushes.bg[7] = ColorUtils::tint(_brushes.bg[0].color(), _brushes.fg[7].color());
      }
ColorSchemePrivate::ColorSchemePrivate(QPalette::ColorGroup state,
                                       const char* group, SetDefaultColors defaults, const QBrush& tint) {
      _contrast = CONTRAST; // KGlobalSettings::contrastF( config );

      // loaded-from-config colors
      _brushes.bg[0] = SET_DEFAULT(NormalBackground);
      _brushes.bg[1] = SET_DEFAULT(AlternateBackground);

      // adjustment
      _brushes.bg[0] = ColorUtils::tint(_brushes.bg[0].color(), tint.color(), 0.4);
      _brushes.bg[1] = ColorUtils::tint(_brushes.bg[1].color(), tint.color(), 0.4);

      // the rest
      init(state, group, defaults);
      }
void emberAfRf4ceMsoIrRfDatabaseOriginatorClearAll(void)
{
  // Reset each entry back to the default and then wipe the heap.
  uint8_t i;
  for (i = 0; i < COUNTOF(database); i++) {
    SET_DEFAULT(&database[i]);
  }
  MEMSET(heap, 0, sizeof(heap));
  tail = heap;
}
EmberStatus emberAfRf4ceMsoIrRfDatabaseOriginatorClear(EmberAfRf4ceMsoKeyCode keyCode)
{
  // Clearing an entry is the same as replacing it with a default.
  EmberAfRf4ceMsoIrRfDatabaseEntry entry;
  uint8_t index = getEntryIndex(keyCode);
  if (index == 0xFF) {
    return EMBER_NOT_FOUND;
  }
  SET_DEFAULT(&entry);
  return setEntry(index, &entry);
}
Exemple #6
0
void InitDefaultStrings()
{
    SET_DEFAULT(ZS_DEMODLG_WNDTITLE, TEXT("{{appName}} Demo"));
    SET_DEFAULT(ZS_DEMODLG_TITLE, TEXT("Thank you for trying {{appName}}."));
    SET_DEFAULT(ZS_DEMODLG_DESCRIPTION, TEXT("You are using {{appName}} in demo mode.\nThe software will stop functioning when the end of the trial period is reached."));
    SET_DEFAULT(ZS_DEMODLG_START_DEMO, TEXT("Start Demo"));
    SET_DEFAULT(ZS_DEMODLG_CONTINUE_DEMO, TEXT("Continue Demo"));
    SET_DEFAULT(ZS_DEMODLG_CLOSE, TEXT("Close"));
    SET_DEFAULT(ZS_DEMODLG_DAYS_LEFT, TEXT("days left."));
    SET_DEFAULT(ZS_DEMODLG_1DAY_LEFT, TEXT("1 day left."));
    SET_DEFAULT(ZS_DEMODLG_NO_DAYS_LEFT, TEXT("No days left. Please purchase a license."));
    SET_DEFAULT(ZS_DEMODLG_REMAINING_TIME, TEXT("Remaining Time"));
    SET_DEFAULT(ZS_DEMODLG_REMAINING_TIME_DESC, TEXT("Only the days of actual usage are counted."));
    SET_DEFAULT(ZS_DEMODLG_PURCHASE_LICENSE, TEXT("Purchase License"));
    SET_DEFAULT(ZS_DEMODLG_ENTER_LICKEY, TEXT("Enter License Key"));

    SET_DEFAULT(ZS_ENTERLICKEYDLG_WNDTITLE, TEXT("Enter License Key"));
    SET_DEFAULT(ZS_ENTERLICKEYDLG_TITLE, TEXT("Please enter your license information below:"));
    SET_DEFAULT(ZS_ENTERLICKEYDLG_FULL_NAME, TEXT("Full Name:"));
    SET_DEFAULT(ZS_ENTERLICKEYDLG_ORGANIZATION, TEXT("Organization:"));
    SET_DEFAULT(ZS_ENTERLICKEYDLG_LICKEY, TEXT("License Key:"));
    SET_DEFAULT(ZS_ENTERLICKEYDLG_CANCEL, TEXT("Cancel"));
    SET_DEFAULT(ZS_ENTERLICKEYDLG_ACTIVATE, TEXT("Activate"));

    SET_DEFAULT(ZS_PREVVERSIONDLG_WNDTITLE, TEXT("Obsolete License Detected"));
    SET_DEFAULT(ZS_PREVVERSIONDLG_TITLE, TEXT("You need to upgrade your license."));
    SET_DEFAULT(ZS_PREVVERSIONDLG_DESCRIPTION, TEXT("You have entered an obsolete license key.\nThis version requires a new license key."));
    SET_DEFAULT(ZS_PREVVERSIONDLG_BACK, TEXT("Back"));
    SET_DEFAULT(ZS_PREVVERSIONDLG_UPGRADE, TEXT("Take me to the upgrade page"));

    SET_DEFAULT(ZS_LIC_LICERROR, TEXT("{{appName}} Licensing Error"));
    SET_DEFAULT(ZS_LIC_CONNECTION_FAILED, TEXT("Failed to contact the licensing server.\n\nPlease try again later."));
    SET_DEFAULT(ZS_LIC_PARSE_ERROR, TEXT("Failed to parse response from the licensing server.\n\nPlease try again later."));
    SET_DEFAULT(ZS_LIC_UNEXPECTED_RESPONSE, TEXT("Unexpected response from the licensing server:\n"));

    SET_DEFAULT(ZS_LIC_ACTIVATION, TEXT("{{appName}} Activation"));
    SET_DEFAULT(ZS_LIC_LICINVALID, TEXT("This license key is not valid. Please try again."));
    SET_DEFAULT(ZS_LIC_ACTIVATION_ERROR, TEXT("Unfortunately, an error occurred during the activation of {{appName}}:\n\n"));
    SET_DEFAULT(ZS_LIC_ACTIVATION_SUCCESS, TEXT("Thank you for activating {{appName}}."));

    SET_DEFAULT(ZS_LIC_DEACTIVATION, TEXT("{{appName}} Deactivation"));
    SET_DEFAULT(ZS_LIC_DEACTIVATION_ERROR, TEXT("Unfortunately, an error occurred during deactivating {{appName}}:\n\n"));
    SET_DEFAULT(ZS_LIC_DEACTIVATION_SUCCESS, TEXT("You have successfully deactivated {{appName}}.\nThe application will quit now."));

    SET_DEFAULT(ZS_LIC_DEMO_ERROR, TEXT("Unfortunately, an error while retrieving a demo license from the licensing server:\n"));
    
    SET_DEFAULT(ZS_UPDATES_CHECK, TEXT("Check for Updates"));
    
    SET_DEFAULT(ZS_OPEN_FINDER, TEXT("Open in Finder"));
    SET_DEFAULT(ZS_OPEN_EXPLORER, TEXT("Open in Explorer"));
    SET_DEFAULT(ZS_OPEN_FILEMANAGER, TEXT("Open in file manager"));
    SET_DEFAULT(ZS_OPEN_PATH_DOESNT_EXIST, TEXT("The path %s does not exist."));
}
static EmberStatus setEntry(uint8_t index,
                            const EmberAfRf4ceMsoIrRfDatabaseEntry *entry)
{
  // When a new entry comes in, we always remove the old entry, even though the
  // new entry might not fit.  The rationale is that the old entry is being
  // replaced because it is no longer valid for the peripheral devices in the
  // system.  Reverting to a default entry seems better than keeping the old,
  // invalid entry.
  uint32_t reclaimableBytes = calculateHeapUsage(&database[index]);
  if (reclaimableBytes != 0) {
    uint8_t *head;
    uint8_t i;

    // If the space we think we are using is ever less than what we think we
    // can reclaim, then something has gone very wrong.
    assert(reclaimableBytes <= USED_HEAP_SPACE());

    // The RF payloads and the IR code are all stored contiguously in the heap,
    // although some of them may be empty.  We just need to find whichever one
    // is first.  If we expect to have one but can't find it or we do find it
    // but its not actually within the heap area, then something has gone very
    // wrong.
    head = findHead(&database[index]);
    assert(head != NULL);
    assert(heap <= head);
    assert(head + reclaimableBytes <= tail);

    // Rewind the tail pointer and all the RF payload and IR code pointers for
    // entries that follow the old one.  This makes them point to where they
    // should after the heap is adjusted.  This means the pointers are NOT
    // valid until the heap is adjusted.
    tail -= reclaimableBytes;
    for (i = 0; i < COUNTOF(database); i++) {
      if (head < database[i].rfPressedDescriptor.payload) {
        database[i].rfPressedDescriptor.payload -= reclaimableBytes;
      }
      if (head < database[i].rfRepeatedDescriptor.payload) {
        database[i].rfRepeatedDescriptor.payload -= reclaimableBytes;
      }
      if (head < database[i].rfReleasedDescriptor.payload) {
        database[i].rfReleasedDescriptor.payload -= reclaimableBytes;
      }
      if (head < database[i].irDescriptor.irCode) {
        database[i].irDescriptor.irCode -= reclaimableBytes;
      }
    }

    // Move the stuff after the old entry so it immediately follows the stuff
    // preceding the old entry.  The old entry is now gone and the tail, RF
    // payload, and IR pointers are all valid again.
    MEMMOVE(head, head + reclaimableBytes, tail - head);

    // Wipe the stuff following the new tail.
    MEMSET(tail, 0, reclaimableBytes);
  }

  // The free space is the unused space and includes what we reclaimed from the
  // old entry.  If we don't have enough room, we drop the new entry and leave
  // a default in its place.
  if (FREE_HEAP_SPACE() < calculateHeapUsage(entry)) {
    SET_DEFAULT(&database[index]);
    return EMBER_TABLE_FULL;
  }

  // The basic structure of the new entry is copied as is to the database.  The
  // variable-sized portion of each descriptor is copied into the heap and then
  // the pointer to that data from the database is adjusted to point into the
  // heap.
  MEMCOPY(&database[index], entry, sizeof(EmberAfRf4ceMsoIrRfDatabaseEntry));
  database[index].rfPressedDescriptor.payload
    = copyRfPayload(emberAfRf4ceMsoIrRfDatabaseEntryHasRfPressedDescriptor(entry),
                    &entry->rfPressedDescriptor);
  database[index].rfRepeatedDescriptor.payload
    = copyRfPayload(emberAfRf4ceMsoIrRfDatabaseEntryHasRfRepeatedDescriptor(entry),
                    &entry->rfRepeatedDescriptor);
  database[index].rfReleasedDescriptor.payload
    = copyRfPayload(emberAfRf4ceMsoIrRfDatabaseEntryHasRfReleasedDescriptor(entry),
                    &entry->rfReleasedDescriptor);
  database[index].irDescriptor.irCode
    = copyIrCode(emberAfRf4ceMsoIrRfDatabaseEntryHasIrDescriptor(entry),
                 &entry->irDescriptor);

  return EMBER_SUCCESS;
}
ModSfsGenerateKeyDlg::ModSfsGenerateKeyDlg(wxWindow *parent)
    : ModSfsGenerateKeyDlgBase(parent)
{
	wxString			 pathPrefix = newDefaultName();
	wxSize				 indent;
	wxIcon				 icon;
	wxDateTime			 time;
	wxSizerItem			*spacer;
	struct anoubis_keysubject	*defsubj;

	defsubj = anoubis_keysubject_defaults();
	if (defsubj) {

/* Macro to make the folloing repeated code more readable. */
#define SET_DEFAULT(TEXTCTRL, FIELD)					\
	if (defsubj->FIELD)						\
		(TEXTCTRL)->ChangeValue(wxString::FromAscii(defsubj->FIELD))

	SET_DEFAULT(certCountryTextCtrl, country);
	SET_DEFAULT(certStateTextCtrl, state);
	SET_DEFAULT(certLocalityTextCtrl, locality);
	SET_DEFAULT(certOrgaTextCtrl, organization);
	SET_DEFAULT(certOrgaUnitTextCtrl, orgunit);
	SET_DEFAULT(certCnTextCtrl, name);
	SET_DEFAULT(certEmailTextCtrl, email);

#undef SET_DEFAULT

		anoubis_keysubject_destroy(defsubj);
	}

	keyPicker->setTitle(_("Configure private key:"));
	keyPicker->setButtonLabel(_("Browse ..."));
	keyPicker->setMode(AnPickFromFs::MODE_NEWFILE
	    | AnPickFromFs::MODE_NOINFO | AnPickFromFs::MODE_NORESOLVE);
	keyPicker->setFileName(pathPrefix + wxT(".key"));

	certificatePicker->setTitle(_("Configure certificate:"));
	certificatePicker->setButtonLabel(_("Browse ..."));
	certificatePicker->setMode(AnPickFromFs::MODE_NEWFILE
	    | AnPickFromFs::MODE_NOINFO | AnPickFromFs::MODE_NORESOLVE);
	certificatePicker->setFileName(pathPrefix + wxT(".crt"));

	/* Get initial indent size. */
	spacer = certDetailsIndentSizer->GetItem((size_t)0);
	indent = keyPicker->getTitleSize();

	/* Set indentation. */
	keyPicker->setTitleMinSize(indent);
	certificatePicker->setTitleMinSize(indent);
	passphraseLabel->SetMinSize(indent);

	/* Adjust indent by indentation of details block. */
	indent.DecBy(spacer->GetSize().GetWidth(), 0);
	certValidityLabel->SetMinSize(indent);

	icon = AnIconList::instance()->GetIcon(AnIconList::ICON_ERROR);
	passphraseMismatchIcon->SetIcon(icon);
	passphraseMismatchIcon->Hide();
	passphraseMismatchText->Hide();

	/*
	 * Set default validity to 2 years and the range of pickable dates
	 * from tomorrow to 20 years.
	 */
	time = wxDateTime::Now();
	time.Add(wxDateSpan::Years(2));
	certValidityDatePicker->SetValue(time);
	time.Add(wxDateSpan::Years(18));
	certValidityDatePicker->SetRange(
	   (wxDateTime::Now() + wxTimeSpan::Days(31)), time);
}
JitOptions::JitOptions()
{
    // Whether to perform expensive graph-consistency DEBUG-only assertions.
    // It can be useful to disable this to reduce DEBUG-compile time of large
    // asm.js programs.
    SET_DEFAULT(checkGraphConsistency, true);

#ifdef CHECK_OSIPOINT_REGISTERS
    // Emit extra code to verify live regs at the start of a VM call
    // are not modified before its OsiPoint.
    SET_DEFAULT(checkOsiPointRegisters, false);
#endif

    // Whether to enable extra code to perform dynamic validation of
    // RangeAnalysis results.
    SET_DEFAULT(checkRangeAnalysis, false);

    // Toggles whether Alignment Mask Analysis is globally disabled.
    SET_DEFAULT(disableAma, false);

    // Toggles whether Effective Address Analysis is globally disabled.
    SET_DEFAULT(disableEaa, false);

    // Toggle whether eager simd unboxing is globally disabled.
    SET_DEFAULT(disableEagerSimdUnbox, false);

    // Toggles whether Edge Case Analysis is gobally disabled.
    SET_DEFAULT(disableEdgeCaseAnalysis, false);

    // Toggle whether global value numbering is globally disabled.
    SET_DEFAULT(disableGvn, false);

    // Toggles whether inlining is globally disabled.
    SET_DEFAULT(disableInlining, false);

    // Toggles whether loop invariant code motion is globally disabled.
    SET_DEFAULT(disableLicm, false);

    // Toggles whether Loop Unrolling is globally disabled.
    SET_DEFAULT(disableLoopUnrolling, true);

    // Toggles whether instruction reordering is globally disabled.
    SET_DEFAULT(disableInstructionReordering, false);

    // Toggles whether Range Analysis is globally disabled.
    SET_DEFAULT(disableRangeAnalysis, false);

    // Toggle whether eager scalar replacement is globally disabled.
    SET_DEFAULT(disableScalarReplacement, false);

    // Toggles whether shared stubs are used in Ionmonkey.
    SET_DEFAULT(disableSharedStubs, true);

    // Toggles whether sincos optimization is globally disabled.
    // See bug984018: The MacOS is the only one that has the sincos fast.
    #if defined(XP_DARWIN)
        SET_DEFAULT(disableSincos, false);
    #else
        SET_DEFAULT(disableSincos, true);
    #endif

    // Toggles whether sink code motion is globally disabled.
    SET_DEFAULT(disableSink, true);

    // Whether functions are compiled immediately.
    SET_DEFAULT(eagerCompilation, false);

    // Whether IonBuilder should prefer IC generation above specialized MIR.
    SET_DEFAULT(forceInlineCaches, false);

    // Toggles whether large scripts are rejected.
    SET_DEFAULT(limitScriptSize, true);

    // Toggles whether functions may be entered at loop headers.
    SET_DEFAULT(osr, true);

    // Whether to enable extra code to perform dynamic validations.
    SET_DEFAULT(runExtraChecks, false);

    // How many invocations or loop iterations are needed before functions
    // are compiled with the baseline compiler.
    SET_DEFAULT(baselineWarmUpThreshold, 10);

    // Number of exception bailouts (resuming into catch/finally block) before
    // we invalidate and forbid Ion compilation.
    SET_DEFAULT(exceptionBailoutThreshold, 10);

    // Number of bailouts without invalidation before we set
    // JSScript::hadFrequentBailouts and invalidate.
    SET_DEFAULT(frequentBailoutThreshold, 10);

    // How many actual arguments are accepted on the C stack.
    SET_DEFAULT(maxStackArgs, 4096);

    // How many times we will try to enter a script via OSR before
    // invalidating the script.
    SET_DEFAULT(osrPcMismatchesBeforeRecompile, 6000);

    // The bytecode length limit for small function.
    SET_DEFAULT(smallFunctionMaxBytecodeLength_, 100);

    // Force how many invocation or loop iterations are needed before compiling
    // a function with the highest ionmonkey optimization level.
    // (i.e. OptimizationLevel_Normal)
    const char* forcedDefaultIonWarmUpThresholdEnv = "JIT_OPTION_forcedDefaultIonWarmUpThreshold";
    if (const char* env = getenv(forcedDefaultIonWarmUpThresholdEnv)) {
        Maybe<int> value = ParseInt(env);
        if (value.isSome())
            forcedDefaultIonWarmUpThreshold.emplace(value.ref());
        else
            Warn(forcedDefaultIonWarmUpThresholdEnv, env);
    }

    // Force the used register allocator instead of letting the optimization
    // pass decide.
    const char* forcedRegisterAllocatorEnv = "JIT_OPTION_forcedRegisterAllocator";
    if (const char* env = getenv(forcedRegisterAllocatorEnv)) {
        forcedRegisterAllocator = LookupRegisterAllocator(env);
        if (!forcedRegisterAllocator.isSome())
            Warn(forcedRegisterAllocatorEnv, env);
    }

    // Toggles whether unboxed plain objects can be created by the VM.
    SET_DEFAULT(disableUnboxedObjects, false);
}