Exemplo n.º 1
0
void DrawIntro()
{
	unsigned char frame;
	
	ResetVideo();
	setupFont();
	
	vsync();
	set_color(1, 0);
	SetFontColors(14, 0, 0, 0);
	put_string("KORDAMP PRESENTS", 12, 14);
	for(frame = 0; frame < 7; frame ++)
	{
		SetFontColors(14, 0, RGB(frame, frame, frame), 0);
		vsync(3);
	}
	
	frame = 5;
	while(frame)
		frame --;
	
	for(frame = 7; frame > 0; frame --)
	{
		SetFontColors(14, 0, RGB(frame, frame, frame), 0);
		vsync(3);
	}
}
Exemplo n.º 2
0
/**
 * Construct an object with the given parent
 */
CommandLineInterpreter::CommandLineInterpreter(const ScriptingEnv & environ, QWidget *parent)
  : ScriptEditor(parent,environ.createCodeLexer()), m_runner(), m_history(),
    m_inputBuffer(),m_status(Waiting),
    m_promptKey(markerDefine(QsciScintilla::ThreeRightArrows)),
    m_continuationKey(markerDefine(QsciScintilla::ThreeDots)),
    m_currentPromptLineIndex(0),
    m_pastedText(), m_pasteQueue(),
    m_copy(NULL), m_cut(NULL), m_paste(NULL), m_saveAs(NULL),
    m_zoomIn(NULL), m_zoomOut(NULL)
{
  enableAutoCompletion();
  setupEnvironment(environ);
  setupMargin();
  setupIndentation();
  setupFont();

  initActions();

  setContextMenuPolicy(Qt::CustomContextMenu);
  connect(this, SIGNAL(customContextMenuRequested(const QPoint&)),
          this, SLOT(showContextMenu(const QPoint &)));
  setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
  // Need to disable some default key bindings that Scintilla provides as they don't really
  // fit here
  remapWindowEditingKeys();
}
Exemplo n.º 3
0
const Font* FontManager::getSystemVariableWidthFont()
{
    if (!systemVariableWidthFont_)
        systemVariableWidthFont_ = setupFont(SystemVariableWidthFont);

    return systemVariableWidthFont_;
}
Exemplo n.º 4
0
const Font* FontManager::getSystemMonospaceFont()
{
    if (!systemMonospaceFont_)
        systemMonospaceFont_ = setupFont(SystemMonospaceFont);

    return systemMonospaceFont_;
}
Exemplo n.º 5
0
QgsLegendLayer::QgsLegendLayer( QgsMapLayer* layer )
    : QgsLegendItem( )
    , mLyr( layer )
    , mDrawingOrder( -1 )
    , mShowFeatureCount( false )
{
  mType = LEGEND_LAYER;

  Qt::ItemFlags flags = Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable;

  QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
  if ( !vlayer || vlayer->hasGeometryType() )
  {
    flags |= Qt::ItemIsUserCheckable;
  }

  setFlags( flags );

  setCheckState( 0, Qt::Checked );

  layerNameChanged();
  setupFont();

  // Set the initial visibility flag for layers
  // This user option allows the user to turn off initial drawing of
  // layers when they are added to the map. This is useful when adding
  // many layers and the user wants to adjusty symbology, etc prior to
  // actually viewing the layer.
  QSettings settings;
  bool visible = settings.value( "/qgis/new_layers_visible", true ).toBool();
  mLyr.setVisible( visible );

  // not in overview by default
  mLyr.setInOverview( false );

  // setup connections that will update the layer icons
  if ( qobject_cast<QgsVectorLayer *>( layer ) )
  {
    QgsDebugMsg( "Connecting signals for updating icons, layer " + layer->name() );
    connect( layer, SIGNAL( editingStarted() ), this, SLOT( updateIcon() ) );
    connect( layer, SIGNAL( editingStopped() ), this, SLOT( updateIcon() ) );
    connect( layer, SIGNAL( layerModified() ), this, SLOT( updateAfterLayerModification() ) ); // TODO[MD]: should have symbologyChanged signal
  }
  if ( qobject_cast<QgsRasterLayer *>( layer ) )
  {
    connect( layer, SIGNAL( dataChanged() ), this, SLOT( updateAfterLayerModification() ) );
  }
  connect( layer, SIGNAL( layerNameChanged() ), this, SLOT( layerNameChanged() ) );

  updateIcon();
  setToolTip( 0, layer->publicSource() );
}
Exemplo n.º 6
0
void RedrawMain()
{
	ResetVideo();
	setupFont();

#ifndef CDROM1
	set_tile_data(MB_bg);
	load_tile(0x1000);
	load_palette(0, MB_pal, 1);  
	set_map_data(MB_map, 40, 30);
	load_map(0, 0, 0, 0, 40, 30);	
#ifdef SGFX
	if(sgx_detect())
	{
		vpc_win_size(VPC_WIN_A, 0x01ff);
		vpc_win_size(VPC_WIN_B, 0x01ff);
		vpc_win_reg(VPC_WIN_A, VDC_ON+VPC_NORM);
		vpc_win_reg(VPC_WIN_B, VDC_ON+VPC_NORM);
		vpc_win_reg(VPC_WIN_AB, VDC_ON+VPC_NORM);
		vpc_win_reg(VPC_WIN_NONE, VDC_ON+VPC_NORM);

		sgx_set_screen_size(SCR_SIZE_32x32);
		sgx_disp_off();
		
		sgx_set_tile_data(SMPTE75_bg);
		sgx_load_tile(0x1000);		
		sgx_set_map_data(SMPTE75_map, 40, 30);
		sgx_load_map(0, 0, 0, 0, 40, 30);	
		//load_palette(0, SMPTE75_pal, 16);
		sgx_disp_on();
		sgx_scroll(40, 40);
	}
#endif
#else
	set_screen_size(SCR_SIZE_64x32); 
	cd_loaddata(GPHX_OVERLAY, OFS_mainbg_PAL_bin, palCD, SIZE_mainbg_PAL_bin); 
	load_palette(0, palCD, 1); 
	cd_loadvram(GPHX_OVERLAY, OFS_mainbg_DATA_bin, 0x1000, SIZE_mainbg_DATA_bin);
	cd_loadvram(GPHX_OVERLAY, OFS_mainbg_BAT_bin, 0x0000, SIZE_mainbg_BAT_bin);
#endif
   
	init_satb();
	DrawSP();
	satb_update();
	
	Center224in240();
	DisplaySystemInfo();		
}
Exemplo n.º 7
0
void Widget::onPrevious()
{
    m_visible.start();
    if (m_previousStack.size() < 1)
        return;
    Message m = m_previousStack.pop();
    m_messageQueue.push_front(m);
    loadDefaults();
    setupFont();
    setupColors();
    setupIcon();
    setupTitle();
    setupContent();
    connectForPosition(m_messageQueue.front().data["pos"]->toString());
    updateFinalWidth();
}
Exemplo n.º 8
0
void Widget::onNext()
{
    m_visible.start();
    if (m_messageQueue.size() < 2)
        return;
    Message m = m_messageQueue.front();
    boost::optional<QVariant> tmpManual = m.data["manually_shown"];
    m.data["manually_shown"] = boost::optional<QVariant>(true);
    m_previousStack.push(m);
    m_messageQueue.pop_front();
    loadDefaults();
    setupFont();
    setupColors();
    setupIcon();
    setupTitle();
    setupContent();
    connectForPosition(m_messageQueue.front().data["pos"]->toString());
    updateFinalWidth();
    if (m_messageQueue.front().data["bounce"] && !tmpManual)
        startBounce();
}
Exemplo n.º 9
0
void Widget::processMessageQueue()
{
    if (m_messageQueue.empty()) {
        return;
    }

    if (m_animation.state() == QAbstractAnimation::Running ||
            m_visible.isActive()) {
       //(m_animation.totalDuration() - m_animation.currentTime()) < 50) {
        return;
    }

    QFont boldFont = font();
    boldFont.setBold(true);
    Message& m = m_messageQueue.front();
    loadDefaults();
    if (m.data["aot"]->toBool()) {
        setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
        raise();
    }
    setupFont();
    setupColors();
    setupIcon();
    setupTitle();
    setupContent();
    connectForPosition(m.data["pos"]->toString());
    m_animation.setDirection(QAnimationGroup::Forward);
    int width = computeWidth();
    qobject_cast<QPropertyAnimation*>(m_animation.animationAt(0))->setEasingCurve(QEasingCurve::Type(m_settings.get("gui/in_animation").toInt()));
    qobject_cast<QPropertyAnimation*>(m_animation.animationAt(0))->setStartValue(0);
    qobject_cast<QPropertyAnimation*>(m_animation.animationAt(0))->setEndValue(width);
    m_animation.start();
    QString soundCommand = m.data["sc"]->toString();
    if (!soundCommand.isEmpty())
        QProcess::startDetached(soundCommand);
   // m_shortcutGrabber.enableShortcuts();
}
Exemplo n.º 10
0
bool Widget::update(const Message &m)
{
    bool found = false;
    for (QQueue<Message>::iterator it = m_messageQueue.begin(); it != m_messageQueue.end(); ++it) {
        if (it->data["id"] && it->data["id"]->toInt() == m.data["id"]->toInt()) {
            it->data = m.data;
            found = true;
            break;
        }
    }
    if (found && !m_messageQueue.isEmpty() && m_messageQueue.front().data["id"]
        && m_messageQueue.front().data["id"]->toInt() == m.data["id"]->toInt()) {
        loadDefaults();
        setupFont();
        setupColors();
        setupIcon();
        setupTitle();
        setupContent();
        updateFinalWidth();
        connectForPosition(m_messageQueue.front().data["pos"]->toString());
        m_visible.start();
    }
    return found;
}
Exemplo n.º 11
0
 PictogramDisplay::PictogramDisplay()
 {
   setupFont();
 }
Exemplo n.º 12
0
void DrawCredits()
{
	unsigned char end = 0;
	int counter = 0;

	redraw = 1;
	refresh = 1;
    while(!end)
    {   
		vsync();
		
        if(redraw)
        {
			ResetVideo();
			setupFont();
			
			SetFontColors(15, RGB(3, 3, 3), RGB(0, 6, 0), 0);
			SetFontColors(13, RGB(3, 3, 3), RGB(1, 6, 6), 0);

			set_xres(512, xres_flags);
			
#ifndef CDROM1			
			set_map_data(MB512_map, 64, 30);
			set_tile_data(MB512_bg);
			load_tile(0x1000);
			load_map(0, 0, 0, 0, 64, 30);
			load_palette(0, MB512_pal, 1);  
#else		
			set_screen_size(SCR_SIZE_64x32); 
			cd_loaddata(GPHX_OVERLAY, OFS_back512_PAL_bin, palCD, SIZE_back512_PAL_bin); 
			load_palette(0, palCD, 1);
			cd_loadvram(GPHX_OVERLAY, OFS_back512_DATA_bin, 0x1000, SIZE_back512_DATA_bin);			
			cd_loadvram(GPHX_OVERLAY, OFS_back512_BAT_bin, 0, SIZE_back512_BAT_bin);
#endif
			
			Center224in240();
			
            redraw = 0;
			refresh = 1;
			disp_on();
        }
		
		if(refresh)
		{
			RefreshCredits();

			refresh = 0;
		}
		
		set_font_pal(14);
		if(counter == 1)
			put_string("Artemio Urbina      ", HPOS+2, 8);
		if(counter == 60*4)
			put_string("@Artemio (twitter)  ", HPOS+2, 8);
		if(counter == 60*8)
			put_string("*****@*****.**", HPOS+2, 8);
		if(counter == 60*16)
			counter = 0;
			
		counter++;

        controller = joytrg(0);
        
		if (controller & JOY_II)
			end = 1;
			
		if (controller & JOY_SEL)
		{
			DrawN();
			redraw = 1;
		}
    }	
}