Esempio n. 1
0
 CWizKMAttachmentGetDataParam(int nApiVersion, const QString& strToken, const QString& strBookGUID, const QString& strAttachmentGUID, UINT nParts)
     : CWizKMTokenOnlyParam(strToken, strBookGUID)
 {
     ChangeApiVersion(nApiVersion);
     //
     AddString(_T("attachment_guid"), strAttachmentGUID);
     AddBool(_T("attachment_info"), (nParts & WIZKM_XMKRPC_ATTACHMENT_PART_INFO) ? TRUE : FALSE);
     AddBool(_T("attachment_data"), (nParts & WIZKM_XMKRPC_ATTACHMENT_PART_DATA) ? TRUE : FALSE);
 }
Esempio n. 2
0
void CGUIDialogVideoSettings::CreateSettings()
{
  // clear out any old settings
  m_settings.clear();
  // create our settings
  {
#ifdef __APPLE__
    const int entries[] = { 16018, 16019, 16020, 16021, 16022, 20129, 20130 };
    AddSpin(VIDEO_SETTINGS_INTERLACEMETHOD, 16023, (int*)&g_stSettings.m_currentVideoSettings.m_InterlaceMethod, 7, entries);
#else
    const int entries[] = { 16018, 16019, 16020, 16021, 16022, 20129, 20130, 20131 };
    AddSpin(VIDEO_SETTINGS_INTERLACEMETHOD, 16023, (int*)&g_stSettings.m_currentVideoSettings.m_InterlaceMethod, 8, entries);
#endif
  }
  {
#ifdef __APPLE__
    const int entries[] = { 16302, 16307, 16308 };
    AddSpin(VIDEO_SETTINGS_SCALINGMETHOD, 16300, (int*)&g_stSettings.m_currentVideoSettings.m_ScalingMethod, 3, entries);
#else
    const int entries[] = { 16301, 16302, 16303, 16304, 16305, 16306, 16307, 16308, 16309 };
    AddSpin(VIDEO_SETTINGS_SCALINGMETHOD, 16300, (int*)&g_stSettings.m_currentVideoSettings.m_ScalingMethod, 3, entries);
#endif
  }
  AddBool(VIDEO_SETTINGS_CROP, 644, &g_stSettings.m_currentVideoSettings.m_Crop);
  {
    const int entries[] = {630, 631, 632, 633, 634, 635, 636 };
    AddSpin(VIDEO_SETTINGS_VIEW_MODE, 629, &g_stSettings.m_currentVideoSettings.m_ViewMode, 7, entries);
  }
  AddSlider(VIDEO_SETTINGS_ZOOM, 216, &g_stSettings.m_currentVideoSettings.m_CustomZoomAmount, 0.5f, 0.01f, 2.0f);
  AddSlider(VIDEO_SETTINGS_PIXEL_RATIO, 217, &g_stSettings.m_currentVideoSettings.m_CustomPixelRatio, 0.5f, 0.01f, 2.0f);
  
  if (g_renderManager.SupportsBrightness())
    AddSlider(VIDEO_SETTINGS_BRIGHTNESS, 464, &g_stSettings.m_currentVideoSettings.m_Brightness, 0, 100);
  if (g_renderManager.SupportsContrast())
    AddSlider(VIDEO_SETTINGS_CONTRAST, 465, &g_stSettings.m_currentVideoSettings.m_Contrast, 0, 100);
  if (g_renderManager.SupportsGamma())
    AddSlider(VIDEO_SETTINGS_GAMMA, 466, &g_stSettings.m_currentVideoSettings.m_Gamma, 0, 100);

  AddSeparator(8);
  AddButton(VIDEO_SETTINGS_MAKE_DEFAULT, 12376);
#ifdef HAS_XBOX_HARDWARE
  m_flickerFilter = g_guiSettings.GetInt("videoplayer.flicker");
  AddSpin(VIDEO_SETTINGS_FLICKER, 13100, &m_flickerFilter, 0, 5, g_localizeStrings.Get(351).c_str());
  m_soften = g_guiSettings.GetBool("videoplayer.soften");
  AddBool(VIDEO_SETTINGS_SOFTEN, 215, &m_soften);
#endif
  AddButton(VIDEO_SETTINGS_CALIBRATION, 214);
  if (g_application.GetCurrentPlayer() == EPC_MPLAYER)
  {
    AddSlider(VIDEO_SETTINGS_FILM_GRAIN, 14058, (int*)&g_stSettings.m_currentVideoSettings.m_FilmGrain, 0, 10);
    AddBool(VIDEO_SETTINGS_NON_INTERLEAVED, 306, &g_stSettings.m_currentVideoSettings.m_NonInterleaved);
    AddBool(VIDEO_SETTINGS_NO_CACHE, 431, &g_stSettings.m_currentVideoSettings.m_NoCache);
    AddButton(VIDEO_SETTINGS_FORCE_INDEX, 12009);
  }
}
void UIActivityIndicatorView::ConvertStaticMappings(NIBWriter *writer, XIBObject *obj)
{
    UIView::ConvertStaticMappings(writer, obj);
    if ( _style ) AddInt(writer, "UIActivityIndicatorViewStyle", _style);
    if ( _animating ) AddBool(writer, "UIAnimating", _animating);
    if ( _tintColor ) AddOutputMember(writer, "UITintColor", _tintColor);
}
Esempio n. 4
0
status_t
AttributeMessage::SetAttribute(const char* name, bool value)
{
	if (ReplaceBool(name, value) == B_OK)
		return B_OK;
	return AddBool(name, value);
}
Esempio n. 5
0
status_t Preferences::SetBool (const char *name, bool b)
{
	if (HasBool (name) == true)
		return ReplaceBool (name, 0, b);

	return AddBool(name, b);
}
Esempio n. 6
0
void UILabel::ConvertStaticMappings(NIBWriter *writer, XIBObject *obj)
{
    if ( _shadowOffset.width != 0.0 || _shadowOffset.height != 0.0 ) obj->AddSize(writer, "UIShadowOffset", _shadowOffset);
    if ( _text ) obj->AddString(writer, "UIText", _text);
    if ( _textColor ) {
        obj->AddOutputMember(writer, "UITextColor", _textColor);
    } else {
        UIColor *color = new UIColor(4, 4, 0.0f, 0.0f, 0.0f, 1.0f, "whiteColor");
        obj->AddOutputMember(writer, "UITextColor", color->CreateObject(writer));
    }
    if ( _highlightedColor ) {
        obj->AddOutputMember(writer, "UIHighlightedColor", _textColor);
    }
    AddOutputMember(writer, "UIMinimumScaleFactor", new XIBObjectFloat(1.0f));
    if ( _textAlignment != 0 ) AddInt(writer, "UITextAlignment", _textAlignment);
    if ( _numberOfLines != 1 ) AddInt(writer, "UINumberOfLines", _numberOfLines);
    if ( _baselineAdjustment != 0 ) AddInt(writer, "UIBaselineAdjustment", _baselineAdjustment);
    if ( _numberOfLines == 1 ) {
        if ( _adjustsFontSizeToFit ) AddBool(writer, "UIAdjustsFontSizeToFit", _adjustsFontSizeToFit);
        if ( _minimumFontSize != -1.0f ) AddOutputMember(writer, "UIMinimumFontSize", new XIBObjectFloat(_minimumFontSize));
    }
    if ( _font ) AddOutputMember(writer, "UIFont", _font);

    Map(writer, obj, propertyMappings, numPropertyMappings);
    UIView::ConvertStaticMappings(writer, obj);
}
Esempio n. 7
0
void UITextView::ConvertStaticMappings(NIBWriter *writer, XIBObject *obj)
{
    if ( _shadowOffset.width != 0.0 || _shadowOffset.height != 0.0 ) obj->AddSize(writer, "UIShadowOffset", _shadowOffset);
    if ( _text ) obj->AddString(writer, "UIText", _text);
    if ( !_editable ) AddBool(writer, "UIEditable", _editable);
    if ( _dataDetectorTypes ) AddInt(writer, "UIDataDetectorTypes", _dataDetectorTypes);
    if ( _autoCorrectionType ) AddInt(writer, "UIAutocorrectionType", _autoCorrectionType);
    if ( _returnKeyType ) AddInt(writer, "UIReturnKeyType", _returnKeyType);
    if ( _textColor && !_textColor->isNil() ) {
        obj->AddOutputMember(writer, "UITextColor", _textColor);
    } else {
        UIColor *color = new UIColor(4, 4, 0.0f, 0.0f, 0.0f, 1.0f, "whiteColor");
        obj->AddOutputMember(writer, "UITextColor", color->CreateObject(writer));
    }
    if ( _font ) obj->AddOutputMember(writer, "UIFont", _font);
    AddOutputMember(writer, "UIMinimumScaleFactor", new XIBObjectFloat(1.0f));

    CGSize size;
    size.width = getFrame().width;
    size.height = getFrame().height;
    AddSize(writer, "UIContentSize", size);

    AddInt(writer, "UITextAlignment", _textAlignment);

    if ( !_subviews ) {
        _subviews = new XIBArray();
        _subviews->_className = "NSMutableArray";
    }

    Map(writer, obj, propertyMappings, numPropertyMappings);
    UIScrollView::ConvertStaticMappings(writer, obj);
}
Esempio n. 8
0
myinline ArpMessage& ArpMessage::SetBool(const char *name, bool dat)
{
	if( !this ) return *((ArpMessage*)NULL);
	if( status == B_NO_ERROR ) {
		status = AddBool(name, dat);
	}
	return *this;
}
Esempio n. 9
0
void
PSettings::SetBool(const char *name,bool value)
{
	bool	old;
	status_t s=FindBool(name,&old);
	if(s==B_OK)ReplaceBool(name,value);
	else AddBool(name,value);	
}
void UIRuntimeOutletCollectionConnection::ConvertStaticMappings(NIBWriter *writer, XIBObject *obj)
{
    ObjectConverter::ConvertStaticMappings(writer, obj);
    AddString(writer, "UILabel", _label);
    AddOutputMember(writer, "UISource", _source);
    AddOutputMember(writer, "UIDestination", _destination);
    AddString(writer, "runtimeCollectionClassName", _collectionClassName);
    AddBool(writer, "addsContentToExistingCollection", _addsToExisting);
}
Esempio n. 11
0
void UITabBarItem::ConvertStaticMappings(NIBWriter* writer, XIBObject* obj) {
    ObjectConverterSwapper::ConvertStaticMappings(writer, obj);

    AddBool(writer, "UIEnabled", _enabled);
    if (_title)
        AddString(writer, "UITitle", _title);
    if (_image)
        AddOutputMember(writer, "UIImage", _image);
    if (_tag != -1)
        AddInt(writer, "UITag", _tag);
}
Esempio n. 12
0
void VJSONArrayWriter::AddBools(const char *inArray, sLONG inCountOfElements)
{
	if(testAssert(inArray != NULL && inCountOfElements >= 0))
	{
		if(inCountOfElements > 0)
		{
			_ReopenIfNeeded();

			for(sLONG i = 0; i < inCountOfElements; ++i)
				AddBool(*inArray++ != 0);	// Add(VBoolean(*inArray++ != 0));
		}
	}
}
Esempio n. 13
0
void UITextField::ConvertStaticMappings(NIBWriter* writer, XIBObject* obj) {
    if (_shadowOffset.width != 0.0 || _shadowOffset.height != 0.0) {
        obj->AddSize(writer, "UIShadowOffset", _shadowOffset);
    }

    if (_text) {
        obj->AddString(writer, "UIText", _text);
    }

    if (_placeholder) {
        obj->AddString(writer, "UIPlaceholder", _placeholder);
    }

    if (_borderStyle != 0) {
        obj->AddInt(writer, "UIBorderStyle", _borderStyle);
    }

    if (_font) {
        AddOutputMember(writer, "UIFont", _font);
    }

    if (_textColor && !_textColor->isNil()) {
        obj->AddOutputMember(writer, "UITextColor", _textColor);
    } else {
        UIColor* color = new UIColor(4, 4, 0.0f, 0.0f, 0.0f, 1.0f, "whiteColor");
        obj->AddOutputMember(writer, "UITextColor", color->CreateObject(writer));
    }

    if (_autoCorrectionType) {
        AddInt(writer, "UIAutocorrectionType", _autoCorrectionType);
    }

    if (_returnKeyType) {
        AddInt(writer, "UIReturnKeyType", _returnKeyType);
    }

    if (_clearsOnBeginEditing) {
        AddBool(writer, "UIClearsOnBeginEditing", _clearsOnBeginEditing);
    }

    if (_clearButtonOffset.width != 0.0f || _clearButtonOffset.height != 0.0f) {
        AddSize(writer, "UIClearButtonOffset", _clearButtonOffset);
    }

    AddOutputMember(writer, "UIMinimumScaleFactor", new XIBObjectFloat(1.0f));

    Map(writer, obj, propertyMappings, numPropertyMappings);
    UIControl::ConvertStaticMappings(writer, obj);
}
Esempio n. 14
0
AnimationCtrlWrapper::AnimationCtrlWrapper()
    : wxcWidget(ID_WXANIMATIONCTRL)
{
    PREPEND_STYLE(wxAC_DEFAULT_STYLE, true);
    PREPEND_STYLE(wxAC_NO_AUTORESIZE, false);

    SetPropertyString(_("Common Settings"), "wxAnimationCtrl");

    AddBool(PROP_ANIM_AUTO_PLAY, _("Load and play animation on creation"), false);
    AddProperty(new BitmapPickerProperty(PROP_BITMAP_PATH, wxT(""), _("Select the animation file")));
    AddProperty(
        new BitmapPickerProperty(PROP_DISABLED_BITMAP_PATH, wxT(""),
                                 _("Sets the bitmap to show on the control when it's not playing an animation")));

    m_namePattern = "m_animationCtrl";
    SetName(GenerateName());
}
Esempio n. 15
0
void CGUIDialogLockSettings::CreateSettings()
{
  // clear out any old settings
  m_settings.clear();
  // create our settings
  if (m_bGetUser)
  {
    AddButton(1,20142);
    if (!m_strUser.empty())
      m_settings[0].name = StringUtils::Format("%s (%s)",g_localizeStrings.Get(20142).c_str(),m_strUser.c_str());
    AddButton(2,12326);
    if (!m_locks.code.empty())
      m_settings[1].name = StringUtils::Format("%s (%s)",g_localizeStrings.Get(12326).c_str(),g_localizeStrings.Get(20141).c_str());
    if (m_saveUserDetails)
      AddBool(3, 13423, m_saveUserDetails);
    return;
  }
  AddButton(1,m_iButtonLabel);
  if (m_locks.mode > LOCK_MODE_QWERTY)
    m_locks.mode = LOCK_MODE_EVERYONE;
  if (m_locks.mode != LOCK_MODE_EVERYONE)
    m_settings[0].name = StringUtils::Format("%s (%s)", g_localizeStrings.Get(m_iButtonLabel).c_str(), g_localizeStrings.Get(12336+m_locks.mode).c_str());
  else
    m_settings[0].name = StringUtils::Format("%s (%s)", g_localizeStrings.Get(m_iButtonLabel).c_str(), g_localizeStrings.Get(1223).c_str());

  if (m_bDetails)
  {
    AddSeparator(2);
    AddBool(3,20038,&m_locks.music);
    AddBool(4,20039,&m_locks.video);
    AddBool(5,20040,&m_locks.pictures);
    AddBool(6,20041,&m_locks.programs);
    AddBool(7,20042,&m_locks.files);
    
    std::vector<std::pair<int, int> > settingsLevelOptions;
    settingsLevelOptions.push_back(std::make_pair(LOCK_LEVEL::NONE,     106));
    settingsLevelOptions.push_back(std::make_pair(LOCK_LEVEL::ALL,      593));
    settingsLevelOptions.push_back(std::make_pair(LOCK_LEVEL::STANDARD, 10037));
    settingsLevelOptions.push_back(std::make_pair(LOCK_LEVEL::ADVANCED, 10038));
    settingsLevelOptions.push_back(std::make_pair(LOCK_LEVEL::EXPERT,   10039));
    AddSpin(8, 20043, (int*)&m_locks.settings, settingsLevelOptions);
    
    AddBool(9,24090,&m_locks.addonManager);
    EnableDetails(m_locks.mode != LOCK_MODE_EVERYONE);
  }
}
Esempio n. 16
0
void CGUIDialogLockSettings::CreateSettings()
{
  // clear out any old settings
  m_settings.clear();
  // create our settings
  if (m_bGetUser)
  {
    AddButton(1,20142);
    if (!m_strUser.IsEmpty())
      m_settings[0].name.Format("%s (%s)",g_localizeStrings.Get(20142).c_str(),m_strUser.c_str());
    AddButton(2,12326);
    if (!m_locks.code.IsEmpty())
      m_settings[1].name.Format("%s (%s)",g_localizeStrings.Get(12326).c_str(),g_localizeStrings.Get(20141).c_str());
    if (m_saveUserDetails)
      AddBool(3, 13423, m_saveUserDetails);
    return;
  }
  AddButton(1,m_iButtonLabel);
  if (m_locks.mode > LOCK_MODE_QWERTY)
    m_locks.mode = LOCK_MODE_EVERYONE;
  if (m_locks.mode != LOCK_MODE_EVERYONE)
    m_settings[0].name.Format("%s (%s)",g_localizeStrings.Get(m_iButtonLabel).c_str(),g_localizeStrings.Get(12336+m_locks.mode).c_str());
  else
    m_settings[0].name.Format("%s (%s)",g_localizeStrings.Get(m_iButtonLabel).c_str(),g_localizeStrings.Get(1223).c_str());

  if (m_bDetails)
  {
    AddSeparator(2);
    AddBool(3,20038,&m_locks.music);
    AddBool(4,20039,&m_locks.video);
    AddBool(5,20040,&m_locks.pictures);
    AddBool(6,20041,&m_locks.programs);
    AddBool(7,20042,&m_locks.files);
    AddBool(8,20043,&m_locks.settings);
    AddBool(9,24090,&m_locks.addonManager);
    EnableDetails(m_locks.mode != LOCK_MODE_EVERYONE);
  }
}
Esempio n. 17
0
void UIBarButtonItem::ConvertStaticMappings(NIBWriter *writer, XIBObject *obj)
{
    AddOutputMember(writer, "UIEnabled", new XIBObjectBool(true));
    if ( _systemItem != -1 ) {
        AddInt(writer, "UISystemItem", _systemItem);
        AddBool(writer, "UIIsSystemItem", true);
    }
    if ( _title ) AddString(writer, "UITitle", _title);
    if ( !_customView ) {
        if ( _style ) AddInt(writer, "UIStyle", _style);
        if ( _width != -1.0f ) {
            AddOutputMember(writer, "UIWidth", new XIBObjectFloat(_width));
        }
    }
    if ( _customView ) {
        AddOutputMember(writer, "UICustomView", _customView);
    }
    if ( _connections ) 
    {
        for ( int i = 0; i < _connections->count(); i ++ ) {
            XIBObject *curObj = _connections->objectAtIndex(i);

            if ( strcmp(curObj->_className, "segue") == 0 ) {
                UIStoryboardSegue *segue = (UIStoryboardSegue *) curObj;

                UIRuntimeEventConnection *newEvent = new UIRuntimeEventConnection();
                newEvent->_label = "perform:";
                newEvent->_source = this;
                newEvent->_destination = segue;
                writer->_connections->AddMember(NULL, newEvent);
                writer->AddOutputObject(newEvent);

                //AddOutputMember(writer, "UIOutlet", refObj);
            }
        }
    }
    ObjectConverterSwapper::ConvertStaticMappings(writer, obj);
}
Esempio n. 18
0
void UIView::ConvertStaticMappings(NIBWriter *writer, XIBObject *obj)
{
    if ( !_ignoreUIObject ) writer->_allUIObjects->AddMember(NULL, this);

    if ( _subviews->count() > 0 ) {
        int count = _subviews->count();
        for ( int i = 0; i < count; i ++ ) {
            XIBObject *curObj = _subviews->objectAtIndex(i);
            if ( !curObj->_ignoreUIObject ) writer->_allUIObjects->AddMember(NULL, curObj);
        }
    }

    AddRect(writer, "UIBounds", _bounds);
    AddPoint(writer, "UICenter", _center);
    if ( _contentStretch.x != 0.0f || _contentStretch.y != 0.0f || _contentStretch.width != 0.0f || _contentStretch.height != 0.0f ) {
        AddRect(writer, "UIContentStretch", _contentStretch);
    }

    Map(writer, obj, propertyMappings, numPropertyMappings);
    if ( _subviews->count() > 0 ) AddOutputMember(writer, "UISubviews", _subviews);
    if ( _constraints->count() > 0) AddOutputMember(writer, "UIViewAutolayoutConstraints", _constraints);

    if ( _autoresizeSubviews ) AddBool(writer, "UIAutoresizeSubviews", _autoresizeSubviews);
    if ( _autoresizingMask ) AddInt(writer, "UIAutoresizingMask", _autoresizingMask);
    if ( _clipsToBounds ) AddBool(writer, "UIClipsToBounds", _clipsToBounds);
    if ( _backgroundColor ) AddOutputMember(writer, "UIBackgroundColor", _backgroundColor);
    if ( _contentMode ) AddInt(writer, "UIContentMode", _contentMode);
    if ( _userInteractionDisabled ) AddBool(writer, "UIUserInteractionDisabled", _userInteractionDisabled);
    if ( _hidden ) AddBool(writer, "UIHidden", _hidden);
    if ( !_enabled ) AddBool(writer, "UIDisabled", true);
    if ( _multipleTouchEnabled ) AddBool(writer, "UIMultipleTouchEnabled", _multipleTouchEnabled);
    if ( !_clearsContextBeforeDrawing ) AddBool(writer, "UIClearsContextBeforeDrawing", _clearsContextBeforeDrawing);

    // Metadata
    if ( !_translatesAutoresizeToConstraints || !obj->GetBool("IBViewMetadataTranslatesAutoresizingMaskIntoConstraints", true) ) AddBool(writer, "UIViewDoesNotTranslateAutoresizingMaskIntoConstraints", true);

    if ( _opaque ) obj->AddBool(writer, "UIOpaque", _opaque);

    ObjectConverterSwapper::ConvertStaticMappings(writer, obj);
}
Esempio n. 19
0
TopLevelWinWrapper::TopLevelWinWrapper(int type)
    : wxcWidget(type)
    , m_auiDropDownMenuHelperRegistered(false)
{
    PREPEND_STYLE(wxSTAY_ON_TOP, false);
    PREPEND_STYLE(wxCLOSE_BOX, false);
    PREPEND_STYLE(wxSYSTEM_MENU, false);
    PREPEND_STYLE(wxMINIMIZE_BOX, false);
    PREPEND_STYLE(wxMAXIMIZE_BOX, false);
    PREPEND_STYLE(wxRESIZE_BORDER, false);
    PREPEND_STYLE(wxCAPTION, false);

    if(type == ID_WXFRAME || type == ID_WXDIALOG) {
        // a real top level windows
        // add support for wxTopLevelWindow events
        RegisterEvent(wxT("wxEVT_MAXIMIZE"), wxT("wxMaximizeEvent"), wxT("Process a wxEVT_MAXIMIZE event"));
        RegisterEvent(wxT("wxEVT_MOVE"), wxT("wxMoveEvent"),
                      wxT("Process a wxEVT_MOVE event, which is generated when a window is moved"));
        RegisterEvent(wxT("wxEVT_MOVE_START"), wxT("wxMoveEvent"),
                      wxT("Process a wxEVT_MOVE_START event, which is generated when the "
                          "user starts to move or size a window. Windows only"));
        RegisterEvent(wxT("wxEVT_MOVE_END"), wxT("wxMoveEvent"),
                      wxT("Process a wxEVT_MOVE_END event, which is generated when "
                          "the user stops moving or sizing a window. Windows only"));
        RegisterEvent(wxT("wxEVT_SHOW"), wxT("wxShowEvent"), wxT("Process a wxEVT_SHOW event"));
    }

    // Default size for top level windows
    DoSetPropertyStringValue(PROP_SIZE, wxT("500,300"));
    if(IsWxTopLevelWindow()) {
        // Add a persistency object support
        AddBool(PROP_PERSISTENT,
                _("When enabled, the generated code will add support for wxPersistenceManager (i.e. the Window will "
                  "remember its size, position and any child wxBookCtrlBase control will remember its selection)"),
                true);
    }

    wxArrayString arr;
    arr.Add(wxT(""));
    arr.Add(wxT("wxBOTH"));
    arr.Add(wxT("wxVERTICAL"));
    arr.Add(wxT("wxHORIZONTAL"));

    AddProperty(new StringProperty(PROP_TITLE, "", _("The title, if any")));
    AddProperty(
        new VirtualFolderProperty(PROP_VIRTUAL_FOLDER, "", _("CodeLite's virtual folder for the generated files")));
    AddProperty(new ChoiceProperty(PROP_CENTRE_ON_SCREEN, arr, 1,
                                   _("Centre on parent. This may be in both dimensions (the default); only "
                                     "vertically or horizontally; or not at all.")));

    AddProperty(new CategoryProperty(_("Inherited C++ Class Properties")));
    AddProperty(new StringProperty(PROP_INHERITED_CLASS, "",
                                   _("Inherited class name\nFill this field to generate a class that inherits from the "
                                     "base class,\nwhere you should place all your application logic.\ne.g. for a "
                                     "generated class 'FooDialogBase', you might enter 'FooDialog' here.")));
    AddProperty(new StringProperty(PROP_FILE, "",
                                   _("The name for the inherited class's files (without any file "
                                     "extension).\nwxCrafter will generate a $(FILE).cpp and $(FILE).h\ne.g. "
                                     "for an inherited class 'FooDialog', you might enter 'foodialog' here.")));
    AddProperty(new StringProperty(PROP_CLASS_DECORATOR, "",
                                   _("MSW Only\nC++ macro decorator - allows exporting this class from a DLL")));

    if(m_properties.Contains(PROP_NAME)) {
        m_properties.Item(PROP_NAME)->SetTooltip(_("The generated C++ class name"));
    }

    DelProperty(PROP_WINDOW_ID);
}
Esempio n. 20
0
void CSettings::LoadDefaults(bool bClient)
{
	CLogFile::Printf("LoadDefaultSettings: %d",bClient);

	if(!bClient) {
		AddInteger("queryport", 10000, 1024, 65534);
		AddInteger("port", 9999, 1024, 65535);
		AddInteger("httpport", 9998, 80, 65535);
		AddString("httpserver", "");
		AddInteger("maxplayers", MAX_PLAYERS, 1, MAX_PLAYERS);
		AddInteger("maxvehicles", MAX_VEHICLES, 0, MAX_VEHICLES);
		AddString("password", "");
		AddBool("query", true);
		AddBool("listed", false);
		AddBool("guinametags",false);
		AddBool("vehicledamage", false);
		AddBool("vehiclewaterdeath", true);
		AddBool("headmovement",true);
		AddBool("checkGTAFiles",true);
		AddString("hostname", VERSION_IDENTIFIER_2 " Server");
		AddString("hostaddress", "");
		AddBool("frequentevents", false);
		AddBool("kickoldplayers", true);
		AddBool("paynspray", true);
		AddBool("autoaim", true);
		AddInteger("weather", 1, 1, 10);
		AddFloat("wind",0.0,0.0,50.0);
		AddBool("silent", false);
		AddBool("timestamp", true);
		AddList("script");
		AddList("clientscript");
		AddList("clientresource");
		AddList("module");
		AddList("config");
		AddList("resource");
	}
	else {
		// Load client settings
		AddString("ip", "127.0.0.1");
		AddInteger("port", 9999, 1, 65535);
		AddString("nick", "player");
		AddString("pass", "");
		AddBool("windowed", false);
		AddBool("fps", false);
		AddString("chatfont", "tahoma-bold");
		AddInteger("chatsize", 10, 1, 100);
		AddInteger("chatbga", 0, 0, 255);
		AddInteger("chatbgr", 0, 0, 255);
		AddInteger("chatbgg", 0, 0, 255);
		AddInteger("chatbgb", 0, 0, 255);
	}
}
Esempio n. 21
0
status_t TPreferences::SetBool(const char *name, bool b) {
	if (HasBool(name)) {
		return ReplaceBool(name, 0, b);
	}
	return AddBool(name, b);
}
Esempio n. 22
0
// and now for the important part,
// which determines what goes into and comes out of the config file:
// add all of the things we want to save and load to a list
// (but don't actually save or load anything yet)
void WinRegisterConfigItems()
{
#define CATEGORY "Config"
	AddBool2C("NiceAlignment", niceAlignment, true, "on to line up the =, :, and # in each section of this config file");
	AddBool2C("Comments", showComments, true, "on to keep comments such as this in this config file. To update/refresh all comments, set this to false and run Snes9x, then set it to true and run Snes9x again.");
	AddUIntC("Sort", configSort, 1, "ordering within sections: 0=allow reordering, 1=force default order, 2=sort alphabetically");
	AddBoolC("Lock", readOnlyConfig, false, "if true, prevents Snes9x from editing this configuration file (or making it read-only while it is running)");
#undef CATEGORY
#define CATEGORY "Display"
	AddBool2C("HiRes", Settings.SupportHiRes, true, "on to support the hi-res mode that a few games use, off to render them in low-res");
	AddBool2("Transparency", Settings.Transparency, true);
	AddBoolC("MessagesInImage", Settings.AutoDisplayMessages, false, "true to draw text inside the SNES image (will get into AVIs, screenshots, and filters)");
	AddBool2C("FrameRate", Settings.DisplayFrameRate, false, "on to display the framerate (will be inaccurate if AutoMaxSkipFrames is too small)");
	AddBoolC("DisplayInput", Settings.DisplayPressedKeys, false, "true to show which buttons are pressed");
	AddBoolC("DisplayFrameCount", Settings.DisplayMovieFrame, true, "true to show the frame count when a movie is playing");
#undef CATEGORY
#define CATEGORY "Display\\Win"
	AddUIntC("OutputMethod", GUI.outputMethod, 0, "0=DirectDraw, 1=Direct3D, 2=OpenGL");
	AddUIntC("FilterType", GUI.Scale, 0, filterString);
	AddUIntC("FilterHiRes", GUI.ScaleHiRes, 0, filterString2);
	AddBoolC("BlendHiRes", GUI.BlendHiRes, true, "true to horizontally blend Hi-Res images (better transparency effect on filters that do not account for this)");
	AddBoolC("ShaderEnabled", GUI.shaderEnabled, false, "true to use pixel shader (if supported by output method)");
	AddStringC("Direct3D:D3DShader", GUI.D3DshaderFileName, MAX_PATH, "", "shader filename for Direct3D mode (HLSL effect file or CG shader");
	AddStringC("OpenGL:OGLShader", GUI.OGLshaderFileName, MAX_PATH, "", "shader filename for OpenGL mode (bsnes-style XML shader or CG shader)");
	AddBoolC("OpenGL:DisablePBOs", GUI.OGLdisablePBOs, false, "do not use PBOs in OpenGL mode, even if the video card supports them");
	AddBoolC("ExtendHeight", GUI.HeightExtend, false, "true to display an extra 15 pixels at the bottom, which few games use. Also increases AVI output size from 256x224 to 256x240.");
	AddBoolC("AlwaysCenterImage", GUI.AlwaysCenterImage,false, "true to center the image even if larger than window");
	AddIntC("Window:Width", GUI.window_size.right, 512, "256=1x, 512=2x, 768=3x, 1024=4x, etc. (usually)");
	AddIntC("Window:Height", GUI.window_size.bottom, 448, "224=1x, 448=2x, 672=3x,  896=4x, etc. (usually)");
	AddIntC("Window:Left", GUI.window_size.left, 0, "in pixels from left edge of screen");
	AddIntC("Window:Top", GUI.window_size.top, 0, "in pixels from top edge of screen");
	AddBool("Window:Maximized", GUI.window_maximized, false);
	AddBoolC("Stretch:Enabled", GUI.Stretch, true, "true to stretch the game image to fill the window or screen");
	AddBoolC("Stretch:MaintainAspectRatio", GUI.AspectRatio, true, "prevents stretching from changing the aspect ratio");
	AddUIntC("Stretch:AspectRatioBaseWidth", GUI.AspectWidth, 256, "base width for aspect ratio calculation (AR=AspectRatioBaseWidth/224), default is 256 - set to 299 for 4:3 aspect ratio");
	AddBoolC("Stretch:BilinearFilter", GUI.BilinearFilter, true, "allows bilinear filtering of stretching. Depending on your video card and the window size, this may result in a lower framerate.");
	AddBoolC("Stretch:LocalVidMem", GUI.LocalVidMem, true, "determines the location of video memory in DirectDraw mode. May increase or decrease rendering performance, depending on your setup and which filter and stretching options are active.");
	AddBool("Fullscreen:Enabled", GUI.FullScreen, false);
	AddUInt("Fullscreen:Width", GUI.FullscreenMode.width, 640);
	AddUInt("Fullscreen:Height", GUI.FullscreenMode.height, 480);
	AddUInt("Fullscreen:Depth", GUI.FullscreenMode.depth, 16);
	AddUInt("Fullscreen:RefreshRate", GUI.FullscreenMode.rate, 60);
	AddBool("Fullscreen:DoubleBuffered", GUI.DoubleBuffered, false);
	AddBoolC("Fullscreen:EmulateFullscreen", GUI.EmulateFullscreen, true,"true makes snes9x create a window that spans the entire screen when going fullscreen");
	AddBoolC("HideMenu", GUI.HideMenu, false, "true to auto-hide the menu bar on startup.");
	AddBoolC("Vsync", GUI.Vsync, false, "true to enable Vsync");
#undef CATEGORY
#define CATEGORY "Settings"
	AddUIntC("FrameSkip", Settings.SkipFrames, AUTO_FRAMERATE, "200=automatic (limits at 50/60 fps), 0=none, 1=skip every other, ...");
	AddUIntC("AutoMaxSkipFramesAtOnce", Settings.AutoMaxSkipFrames, 0, "most frames to skip at once to maintain speed in automatic mode, don't set to more than 1 or 2 frames because the skipping algorithm isn't very smart");
	AddUIntC("TurboFrameSkip", Settings.TurboSkipFrames, 15, "how many frames to skip when in fast-forward mode");
	AddUInt("AutoSaveDelay", Settings.AutoSaveDelay, 30);
	AddBool("BlockInvalidVRAMAccess", Settings.BlockInvalidVRAMAccessMaster, true);
	AddBool2C("SnapshotScreenshots", Settings.SnapshotScreenshots, true, "on to save the screenshot in each snapshot, for loading-when-paused display");
	AddBoolC("MovieTruncateAtEnd", Settings.MovieTruncate, true, "true to truncate any leftover data in the movie file after the current frame when recording stops");
	AddBoolC("MovieNotifyIgnored", Settings.MovieNotifyIgnored, false, "true to display \"(ignored)\" in the frame counter when recording when the last frame of input was not used by the SNES (such as lag or loading frames)");
	AddBool("DisplayWatchedAddresses", Settings.DisplayWatchedAddresses, true);
	AddBool2C("WrongMovieStateProtection", Settings.WrongMovieStateProtection, true, "off to allow states to be loaded for recording from a different movie than they were made in");
	AddUIntC("MessageDisplayTime", Settings.InitialInfoStringTimeout, 120, "display length of messages, in frames. set to 0 to disable all message text");
#undef CATEGORY
#define CATEGORY "Settings\\Win"
    AddUIntC("RewindBufferSize", GUI.rewindBufferSize, 0, "rewind buffer size in MB - 0 disables rewind support");
    AddUIntC("RewindGranularity", GUI.rewindGranularity, 1, "rewind granularity - rewind takes a snapshot each x frames");
	AddBoolC("PauseWhenInactive", GUI.InactivePause, TRUE, "true to pause Snes9x when it is not the active window");
	AddBoolC("CustomRomOpenDialog", GUI.CustomRomOpen, false, "false to use standard Windows open dialog for the ROM open dialog");
	AddBoolC("AVIHiRes", GUI.AVIHiRes, false, "true to record AVI in Hi-Res scale");
//	AddUIntC("Language", GUI.Language, 0, "0=English, 1=Nederlands"); // NYI
	AddBoolC("FrameAdvanceSkipsNonInput", GUI.FASkipsNonInput, false, "causes frame advance to fast-forward past frames where the game is definitely not checking input, such as during lag or loading time. EXPERIMENTAL");
	AddBool("MovieDefaultClearSRAM", GUI.MovieClearSRAM, false);
	AddBool("MovieDefaultStartFromReset", GUI.MovieStartFromReset, false);
	AddBool("MovieDefaultReadOnly", GUI.MovieReadOnly, true);
	AddUInt("CurrentSaveSlot", GUI.CurrentSaveSlot, 0);
	AddUIntC("MaxRecentGames", GUI.MaxRecentGames, 14, "max recent games to show in the recent games menu (must be <= 32)");
#undef CATEGORY
#define CATEGORY "Settings\\Win\\Files"
	AddStringC("Dir:Roms", GUI.RomDir, _MAX_PATH, ".\\Roms", "directory where the Open ROM dialog will start");
	AddStringC("Dir:Screenshots", GUI.ScreensDir, _MAX_PATH, ".\\Screenshots", "directory where screenshots will be saved");
	AddStringC("Dir:Movies", GUI.MovieDir, _MAX_PATH, ".\\Movies", "the default directory for recorded movie (.smv) files");
	AddStringC("Dir:SPCs", GUI.SPCDir, _MAX_PATH, ".\\SPCs", "directory where SPCs will be saved");
	AddStringC("Dir:Savestates", GUI.FreezeFileDir, _MAX_PATH, ".\\Saves", "directory where savestates will be created and loaded from");
	AddStringC("Dir:SRAM", GUI.SRAMFileDir, _MAX_PATH, ".\\Saves", "directory where battery saves will be created and loaded from");
	AddStringC("Dir:Patches", GUI.PatchDir, _MAX_PATH, ".\\Cheats", "directory in which ROM patches (.ips files) and cheats (.cht files) will be looked for");
	AddStringC("Dir:Bios", GUI.BiosDir, _MAX_PATH, ".\\BIOS", "directory where BIOS files (such as \"BS-X.bios\") will be located");
	AddBoolC("Dir:Lock", GUI.LockDirectories, false, "true to prevent Snes9x from changing configured directories when you browse to a new location");
	#define ADD(n) AddString("Rom:RecentGame" #n, GUI.RecentGames[n-1], MAX_PATH, "")
		ADD(1);  ADD(2);  ADD(3);  ADD(4);  ADD(5);  ADD(6);  ADD(7);  ADD(8);
		ADD(9);  ADD(10); ADD(11); ADD(12); ADD(13); ADD(14); ADD(15); ADD(16);
		ADD(17); ADD(18); ADD(19); ADD(20); ADD(21); ADD(22); ADD(23); ADD(24);
		ADD(25); ADD(26); ADD(27); ADD(28); ADD(29); ADD(30); ADD(31); ADD(32);
		assert(MAX_RECENT_GAMES_LIST_SIZE == 32);
	#undef ADD
	AddString("Rom:MultiCartA", multiRomA, _MAX_PATH, "");
	AddString("Rom:MultiCartB", multiRomB, _MAX_PATH, "");
#undef CATEGORY
#define	CATEGORY "Sound"
	AddIntC("Sync", Settings.SoundSync, 1, "1 to sync emulation to sound output, 0 to disable.");
	AddBool2("Stereo", Settings.Stereo, true);
	AddBool("SixteenBitSound", Settings.SixteenBitSound, true);
	AddUIntC("Rate", Settings.SoundPlaybackRate, 32000, "sound playback quality, in Hz");
	AddUIntC("InputRate", Settings.SoundInputRate, 31900, "for each 'Input rate' samples generated by the SNES, 'Playback rate' samples will produced. If you experience crackling you can try to lower this setting.");
	AddBoolC("ReverseStereo", Settings.ReverseStereo, false, "true to swap speaker outputs");
	AddBoolC("Mute", GUI.Mute, false, "true to mute sound output (does not disable the sound CPU)");
#undef CATEGORY
#define	CATEGORY "Sound\\Win"
	AddUIntC("SoundDriver", GUI.SoundDriver, 4, "0=Snes9xDirectSound, 4=XAudio2 (recommended), 5=FMOD Default, 6=FMOD ASIO, 7=FMOD OpenAL");
	AddUIntC("BufferSize", GUI.SoundBufferSize, 64, "sound buffer size in ms - determines the internal and output sound buffer sizes. actual mixing is done every SoundBufferSize/4 samples");
	AddBoolC("MuteFrameAdvance", GUI.FAMute, false, "true to prevent Snes9x from outputting sound when the Frame Advance command is in use");
#undef CATEGORY
#define	CATEGORY "Controls"
	AddBoolC("AllowLeftRight", Settings.UpAndDown, false, "true to allow left+right and up+down");
#undef CATEGORY
#define	CATEGORY "ROM"
	AddBoolC("Cheat", Settings.ApplyCheats, true, "true to allow enabled cheats to be applied");
	AddInvBoolC("Patch", Settings.NoPatch, true, "true to allow IPS/UPS patches to be applied (\"soft patching\")");
	AddBoolC("BS", Settings.BS, false, "Broadcast Satellaview emulation");
	AddStringC("Filename", rom_filename, MAX_PATH, "", "filename of ROM to run when Snes9x opens");
#undef CATEGORY
#ifdef NETPLAY_SUPPORT
#define	CATEGORY "Netplay"
	AddUInt("Port", Settings.Port, NP_DEFAULT_PORT);
	AddString("Server", Settings.ServerName, 128, Settings.ServerName);
	AddBool2("SyncByReset", NPServer.SyncByReset, true);
	AddBool2("SendROMImageOnConnect", NPServer.SendROMImageOnConnect, false);
	AddUInt("MaxFrameSkip", NetPlay.MaxFrameSkip, 10);
	AddUInt("MaxBehindFrameCount", NetPlay.MaxBehindFrameCount, 10);
	AddBoolC("UseJoypad1", GUI.NetplayUseJoypad1, true, "if false, player 2 has to use their joypad #2 controls, etc.");
	#define ADD(n,d) AddString("RecentHost" #n, GUI.RecentHostNames[n-1], MAX_PATH, d)
		ADD(1,"localhost");  ADD(2,"");  ADD(3,"");  ADD(4,"");  ADD(5,"");  ADD(6,"");  ADD(7,"");  ADD(8,"");
		ADD(9,"");  ADD(10,"");  ADD(11,"");  ADD(12,"");  ADD(13,"");  ADD(14,"");  ADD(15,"");  ADD(16,"");
		assert(MAX_RECENT_HOSTS_LIST_SIZE == 16);
	#undef ADD
#undef CATEGORY
#endif
#define	CATEGORY "Controls\\Win"
#define ADD(n,x) AddVKey("Joypad" #n ":" #x, Joypad[n-1].x, Joypad[n-1].x)
#define ADDN(n,x,n2) AddVKey("Joypad" #n ":" #n2, Joypad[n-1].x, Joypad[n-1].x)
#define ADDB(n,x) AddBool("Joypad" #n ":" #x, Joypad[n-1].x, Joypad[n-1].x)
#define ADD2(n) ADDB(n,Enabled); ADD(n,Up); ADD(n,Down); ADD(n,Left); ADD(n,Right); ADD(n,A); ADD(n,B); ADD(n,Y); ADD(n,X); ADD(n,L); ADD(n,R); ADD(n,Start); ADD(n,Select); ADDN(n,Left_Up,Left+Up); ADDN(n,Right_Up,Right+Up); ADDN(n,Right_Down,Right+Down); ADDN(n,Left_Down,Left+Down)
#define ADDT(n,x) AddVKey("Joypad" #n "Turbo:" #x, Joypad[n-1+8].x, Joypad[n-1+8].x)
#define ADDTN(n,x,n2) AddVKey("Joypad" #n "Turbo:" #n2, Joypad[n-1+8].x, Joypad[n-1+8].x)
#define ADDT2(n) ADDTN(n,Down,AutoFire); ADDTN(n,Left,AutoHold); ADDTN(n,Up,TempTurbo); ADDTN(n,Right,ClearAll)
#define ADDT3(n) ADDT(n,A); ADDT(n,B); ADDT(n,Y); ADDT(n,X); ADDT(n,L); ADDT(n,R); ADDT(n,Start); ADDT(n,Select)
#define ADD2T2(n) ADD2(n); ADDT2(n)
	// NOTE: for now, the windows port doesn't actually allow 8 different controllers to be set configured, only 5
	ADD2T2(1); ADD2T2(2); ADD2T2(3); ADD2T2(4); ADD2T2(5); ADD2T2(6); ADD2T2(7); ADD2T2(8);
	ADDT3(1); ADDT3(2); ADDT3(3); ADDT3(4); ADDT3(5); ADDT3(6); ADDT3(7); ADDT3(8);
#undef ADD
#undef ADD2
#undef ADDN
#undef ADDB
#undef ADDT
#undef ADDT2
#undef ADDT3
#undef ADDTN
#undef ADD2T2
	AddBool2C("Input:Background", GUI.BackgroundInput, false, "on to detect game keypresses and hotkeys while window is inactive, if PauseWhenInactive = FALSE.");
#undef CATEGORY
#define	CATEGORY "Controls\\Win\\Hotkeys"
	AddBool2C("Handler:Joystick", GUI.JoystickHotkeys, true, "on to detect game controller buttons assigned to hotkeys. May impact performance.");
#define ADD(x) AddVKey("Key:" #x , CustomKeys.x.key, CustomKeys.x.key); AddVKMod("Mods:" #x, CustomKeys.x.modifiers, CustomKeys.x.modifiers)
#define ADDN(x,n2) AddVKey("Key:" #n2, CustomKeys.x.key, CustomKeys.x.key); AddVKMod("Mods:" #n2, CustomKeys.x.modifiers, CustomKeys.x.modifiers)
	ADD(SpeedUp); ADD(SpeedDown); ADD(Pause); ADD(FrameAdvance);
	ADD(SkipUp); ADD(SkipDown); ADD(ScopeTurbo); ADD(ScopePause);
	ADD(FrameCount); ADD(ReadOnly); ADD(FastForward); ADD(FastForwardToggle); ADD(ShowPressed);
	ADDN(Save[0],SaveSlot0); ADDN(Save[1],SaveSlot1); ADDN(Save[2],SaveSlot2); ADDN(Save[3],SaveSlot3); ADDN(Save[4],SaveSlot4); ADDN(Save[5],SaveSlot5); ADDN(Save[6],SaveSlot6); ADDN(Save[7],SaveSlot7); ADDN(Save[8],SaveSlot8); ADDN(Save[9],SaveSlot9);
	ADDN(Load[0],LoadSlot0); ADDN(Load[1],LoadSlot1); ADDN(Load[2],LoadSlot2); ADDN(Load[3],LoadSlot3); ADDN(Load[4],LoadSlot4); ADDN(Load[5],LoadSlot5); ADDN(Load[6],LoadSlot6); ADDN(Load[7],LoadSlot7); ADDN(Load[8],LoadSlot8); ADDN(Load[9],LoadSlot9);
	ADDN(SelectSave[0],SelectSlot0); ADDN(SelectSave[1],SelectSlot1); ADDN(SelectSave[2],SelectSlot2); ADDN(SelectSave[3],SelectSlot3); ADDN(SelectSave[4],SelectSlot4); ADDN(SelectSave[5],SelectSlot5); ADDN(SelectSave[6],SelectSlot6); ADDN(SelectSave[7],SelectSlot7); ADDN(SelectSave[8],SelectSlot8); ADDN(SelectSave[9],SelectSlot9);
	ADD(SaveScreenShot); ADD(SlotPlus); ADD(SlotMinus); ADD(SlotSave); ADD(SlotLoad);
	ADD(BGL1); ADD(BGL2); ADD(BGL3); ADD(BGL4); ADD(BGL5);
	ADD(ClippingWindows); /*ADD(BGLHack);*/ ADD(Transparency); /*ADD(HDMA)*/; /*ADD(GLCube);*/
	/*ADD(InterpMode7);*/ ADD(JoypadSwap); ADD(SwitchControllers); ADD(ResetGame); ADD(ToggleCheats);
	ADD(TurboA); ADD(TurboB); ADD(TurboY); ADD(TurboX); ADD(TurboL); ADD(TurboR); ADD(TurboStart); ADD(TurboSelect); ADD(TurboUp); ADD(TurboDown); ADD(TurboLeft); ADD(TurboRight);
	ADD(QuitS9X);ADD(Rewind);
#undef ADD
#undef ADDN
#undef CATEGORY

}
Esempio n. 23
0
void CSettings::LoadDefaults()
{
	// jenksta: HACKY, find another way
#ifdef _SERVER
	AddString("logfile", "ivmp-svr.log");
	AddInteger("port", 9999, 1024, 65535);
	AddInteger("httpport", 9998, 80, 65535);
	AddString("httpserver", "");
	AddInteger("maxplayers", MAX_PLAYERS, 1, MAX_PLAYERS);
	AddInteger("maxvehicles", MAX_VEHICLES, 0, MAX_VEHICLES);
	AddString("password", "");
	AddBool("query", true);
	AddBool("listed", false);
	AddBool("guinametags",false);
	AddBool("headmovement",true);
	AddString("hostname", VERSION_IDENTIFIER_2 " Server");
	AddString("hostaddress", "");
	AddBool("frequentevents", false);
	AddBool("kickoldplayers", true);
	AddBool("paynspray", true);
	AddBool("autoaim", true);
	AddInteger("weather", 1, 1, 10);
	AddFloat("wind",0.0,0.0,50.0);
	AddBool("silent", false);
	AddBool("timestamp", true);
	AddList("script");
	AddList("clientscript");
	AddList("clientresource");
	AddList("module");
	AddList("config");
#else
	AddString("ip", "127.0.0.1");
	AddInteger("port", 9999, 1024, 65535);
	//AddString("nick", "kyefag");
	//AddString("nick", "jenksta");
	AddString("nick", "player");
	AddString("pass", "");
	AddBool("windowed", false);
	AddBool("fps", false);
	AddString("chatfont", "tahoma-bold");
	AddInteger("chatsize", 10, 1, 100);
	AddInteger("chatbga", 0, 0, 255);
	AddInteger("chatbgr", 0, 0, 255);
	AddInteger("chatbgg", 0, 0, 255);
	AddInteger("chatbgb", 0, 0, 255);
#endif
}
Esempio n. 24
0
void UIViewController::ConvertStaticMappings(NIBWriter *writer, XIBObject *obj)
{
    Map(writer, obj, propertyMappings, numPropertyMappings);

    XIBArray *segueTemplates = new XIBArray();

    if ( _tabBarItem ) AddOutputMember(writer, "UITabBarItem", _tabBarItem);
    if ( _navigationItem ) AddOutputMember(writer, "UINavigationItem", _navigationItem);
    if ( !_resizesToFullSize ) AddBool(writer, "UIAutoresizesArchivedViewToFullSize", _resizesToFullSize);
    if ( _view ) {
        if ( !_isStory ) {
            AddOutputMember(writer, "UIView", _view);
        } else {
            ScanForSegues(segueTemplates, this);

            XIBDictionary *externalObjects = new XIBDictionary();

            char szNibName[255];

            sprintf(szNibName, "%s-view-%s", _id, _view->_id);
            AddString(writer, "UINibName", szNibName);

            char szOutputName[255];
            sprintf(szOutputName, "%s.nib", szNibName);
            printf("Writing %s\n", GetOutputFilename(szOutputName).c_str());
            FILE *fpOut = fopen(GetOutputFilename(szOutputName).c_str(), "wb");
    
            NIBWriter *viewWriter = new NIBWriter(fpOut, externalObjects, _view);
            viewWriter->ExportObject(_view);

            XIBObject *ownerProxy = viewWriter->AddProxy("IBFilesOwner");
            viewWriter->_topObjects->AddMember(NULL, ownerProxy);
            XIBObject *firstResponderProxy = viewWriter->AddProxy("IBFirstResponder");
            viewWriter->_topObjects->AddMember(NULL, firstResponderProxy);

            //  Add view connection
            viewWriter->AddOutletConnection(ownerProxy, _view, "view");

            viewWriter->WriteObjects();
            fclose(fpOut);

            if ( externalObjects->_members.size() > 1 ) AddOutputMember(writer, "UIExternalObjectsTableForViewLoading", externalObjects);
        }
    }
    if ( _parentViewController ) {
        AddOutputMember(writer, "UIParentViewController", _parentViewController);
    }
    if ( _isStory ) {
        XIBObject *storyboard = writer->AddProxy("UIStoryboardPlaceholder");
        writer->AddOutletConnection(this, storyboard, "storyboard");
        
        for ( int i = 0; i < segueTemplates->count(); i ++ ) {
            UIStoryboardSegue *curSegue = (UIStoryboardSegue *) segueTemplates->objectAtIndex(i);

            writer->AddOutletConnection(curSegue, this, "viewController");
        }
        if ( segueTemplates->count() > 0 ) {
            AddOutputMember(writer, "UIStoryboardSegueTemplates", segueTemplates);

            for ( int i = 0; i < segueTemplates->count(); i ++ ) {
                UIStoryboardSegue *curSegue = (UIStoryboardSegue *) segueTemplates->objectAtIndex(i);

                NIBWriter::ExportController(curSegue->getAttrib("destination"));
            }
        }
    }
    if ( _childViewControllers->count() > 0 ) {
        AddOutputMember(writer, "UIChildViewControllers", _childViewControllers);
    }
    if ( _viewControllers->count() > 0 ) {
        AddOutputMember(writer, "UIViewControllers", _viewControllers);
    }
    ObjectConverterSwapper::ConvertStaticMappings(writer, obj);
}