/* * This function enables/disables the dual panel * * Input: * enable - Flag to enable/disable the dual Panel mode */ void setDualPanel( unsigned long enable ) { unsigned long value; /* Enable/Disable the Dual Display */ value = peekRegisterDWord(PANEL_DISPLAY_CTRL); if (enable == 1) value = FIELD_SET(value, PANEL_DISPLAY_CTRL, DUAL_DISPLAY, ENABLE); else value = FIELD_SET(value, PANEL_DISPLAY_CTRL, DUAL_DISPLAY, DISABLE); pokeRegisterDWord(PANEL_DISPLAY_CTRL, value); /* Force to 18-bit Panel. Do this after enable Dual Panel function above since setPanelType(TFT_18BIT) will check if the Dual Panel is enable or not before it set the Panel to 18-bit. */ if (enable == 1) setPanelType(TFT_18BIT); }
//! //! Constructor of the PanelFrame class. //! //! \param panelType The type of the panel to create. //! \param parent A widget the created instance will be child of. //! \param flags Extra widget options. //! \param showToolBars Flag to control whether to display tool bars in the panel frame. //! PanelFrame::PanelFrame ( Panel::Type panelType, QWidget *parent /* = 0 */, Qt::WindowFlags flags /* = 0 */, bool showToolBars /* = 0 */ ) : QFrame(parent, flags), m_mainToolBar(0), m_panelToolBar(0), m_panelType(Panel::T_Uninitialized), m_panel(0), m_label(0) { // create gui elements defined in the Ui_Panel class setupUi(this); setFrameShape(QFrame::Panel); setFrameShadow(QFrame::Plain); // set the style sheet to use for tool bars /* QString toolBarStyleSheet ( "QToolBar {" " border: none;" " margin: 0px;" " spacing: 1px;" "}" "QToolBar::separator {" " width: 6px;" " background-image: url(:/toolbarSeparatorIcon);" " background-repeat: no-repeat;" " background-origin: content;" " background-position: center center;" "}" "QToolButton {" " max-height: 22px;" " max-width: 22px;" "}" "QToolButton[popupMode=\"1\"] {" " max-width: 32px;" "}" ); QString frameStyleSheet ( "QFrame {" " border: 1px solid #737373;" " background: #595959;" "}" ); setStyleSheet(frameStyleSheet); */ // create the panel's main tool bar m_mainToolBar = new QToolBar(this); m_mainToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); m_mainToolBar->setIconSize(QSize(16, 16)); m_mainToolBar->setMinimumHeight(18); m_mainToolBar->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); // m_mainToolBar->setStyleSheet(toolBarStyleSheet); // create the panel's main tool bar m_panelToolBar = new QToolBar(this); m_panelToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly); m_panelToolBar->setIconSize(QSize(16, 16)); m_panelToolBar->setMinimumHeight(18); m_panelToolBar->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); // m_panelToolBar->setStyleSheet(toolBarStyleSheet); if (!showToolBars) { m_mainToolBar->hide(); m_panelToolBar->hide(); ui_panelTypeComboBox->hide(); //ui_vboxLayout->removeItem(ui_hboxLayout); } // insert the panel's main tool bar after the spacer behind the panel type combo box // Give a little space to the keyframe widget QWidget *spacerWidget = new QWidget(); spacerWidget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); spacerWidget->setMinimumWidth(5); spacerWidget->setMaximumWidth(5); ui_hboxLayout->insertWidget(0, spacerWidget); ui_hboxLayout->insertWidget(3, m_mainToolBar); ui_hboxLayout->insertWidget(4, m_panelToolBar); // fill panel type combo box with panel type names ui_panelTypeComboBox->blockSignals(true); for (int i = 0; i < Panel::T_NumTypes; ++i) { Panel::Type panelType = (Panel::Type) i; QString panelTypeName = Panel::getTypeName(panelType); QString panelTypeIconName = Panel::getTypeIconName(panelType); if (panelTypeIconName.isEmpty()) ui_panelTypeComboBox->addItem(panelTypeName); else ui_panelTypeComboBox->addItem(QIcon(panelTypeIconName), panelTypeName); } // fill the panel type combo box with dynamic type names for(int i = 0; i < PanelFactory::m_panelTypeMap.keys().length(); ++i){ QString PlugInName = PanelFactory::m_panelPluginNames.at(i); QIcon PlugInIcon = QIcon(PanelFactory::m_panelPluginIcons.at(i)); ui_panelTypeComboBox->addItem(PlugInIcon, PlugInName); } ui_panelTypeComboBox->blockSignals(false); // relay the viewPanelCreated signal to the window that this panel frame is contained in connect(this, SIGNAL(viewPanelCreated(ViewPanel *)), window(), SIGNAL(viewPanelCreated(ViewPanel *))); // initialize the panel frame's panel type setPanelType(panelType); // create the panel drop-down menu QMenu *panelMenu = new QMenu("Panel Menu", this); panelMenu->addAction(ui_splitHorizontallyAction); panelMenu->addAction(ui_splitVerticallyAction); panelMenu->addSeparator(); panelMenu->addAction(ui_maximizeAction); panelMenu->addAction(ui_restoreAction); panelMenu->addAction(ui_maximizeHorizontallyAction); panelMenu->addAction(ui_restoreHorizontallyAction); panelMenu->addAction(ui_maximizeVerticallyAction); panelMenu->addAction(ui_restoreVerticallyAction); panelMenu->addAction(ui_minimizeAction); panelMenu->addSeparator(); panelMenu->addAction(ui_maximizeRowAction); panelMenu->addAction(ui_minimizeRowAction); panelMenu->addAction(ui_maximizeColumnAction); panelMenu->addAction(ui_minimizeColumnAction); panelMenu->addSeparator(); panelMenu->addAction(ui_duplicateAction); panelMenu->addAction(ui_extractAction); panelMenu->addSeparator(); panelMenu->addAction(ui_closeRowAction); panelMenu->addAction(ui_closeColumnAction); panelMenu->addAction(ui_closeAction); ui_panelMenuAction->setMenu(panelMenu); ui_maximizeAction->setVisible(false); ui_restoreAction->setVisible(false); ui_maximizeHorizontallyAction->setVisible(false); ui_restoreHorizontallyAction->setVisible(false); ui_maximizeVerticallyAction->setVisible(false); ui_restoreVerticallyAction->setVisible(false); ui_maximizeColumnAction->setVisible(false); ui_minimizeColumnAction->setVisible(false); ui_maximizeRowAction->setVisible(false); ui_minimizeRowAction->setVisible(false); ui_closeRowAction->setVisible(false); ui_closeColumnAction->setVisible(false); // set up external signal/slot connections connect(this, SIGNAL(panelTypeChanged(const QString &)), window(), SLOT(updateWindowTitle(const QString &))); connect(this, SIGNAL(duplicateRequested(PanelFrame *)), window(), SLOT(duplicatePanelFrame(PanelFrame *))); connect(this, SIGNAL(extractRequested(PanelFrame *)), window(), SLOT(extractPanelFrame(PanelFrame *)), Qt::QueuedConnection); connect(this, SIGNAL(closeRequested(PanelFrame *)), window(), SLOT(closePanelFrame(PanelFrame *)), Qt::QueuedConnection); // insert border widget to ui_vboxLayout at index 1 just after toolbar vbox QString borderStyle ( "border-top: 1px solid #393939; border-bottom: 1px solid #959595" ); QFrame *borderFrame = new QFrame(this); borderFrame->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); borderFrame->setMinimumHeight(2); borderFrame->setMaximumHeight(2); borderFrame->setStyleSheet(borderStyle); ui_vboxLayout->insertWidget(1, borderFrame); }
long ddk750_setLogicalDispOutput( disp_output_t output, unsigned char swapDisplay ) { unsigned long ulReg; switch (output) { case NO_DISPLAY: { /* In here, all the display device has to be turned off first before the the display control. */ setDisplayControl(PANEL_CTRL, DISP_OFF); /* Turn off Panel control */ setDisplayControl(CRT_CTRL, DISP_OFF); /* Turn off CRT control */ setDisplayControl(VGA_CTRL, DISP_OFF); /* Turn off VGA control */ swPanelPowerSequence(DISP_OFF, 4); /* Turn off Panel */ setDAC(DISP_OFF); /* Turn off DAC */ ddk750_setDPMS(DPMS_OFF); /* Turn off DPMS */ setDualPanel(0); /* Turn off Panel 2 */ setPath(PANEL_PATH, PANEL_CTRL, DISP_OFF); /* Turn off Panel path */ setPath(CRT_PATH, PANEL_CTRL, DISP_OFF); /* Turn off CRT path */ break; } case PANEL1_ONLY: { /*PANEL1 only (24 or 36 bit TFT) show primary controller data */ setDisplayControl(PANEL_CTRL, DISP_ON); /* Turn on Panel control */ setDisplayControl(CRT_CTRL, DISP_OFF); /* Turn off CRT control */ setDisplayControl(VGA_CTRL, DISP_OFF); /* Turn off VGA control */ swPanelPowerSequence(DISP_ON, 4); /* Turn on Panel */ setDAC(DISP_OFF); /* Turn off DAC */ ddk750_setDPMS(DPMS_OFF); /* Turn off DPMS */ setDualPanel(0); /* Turn off Panel 2 */ setPath(PANEL_PATH, PANEL_CTRL, DISP_ON); /* Turn on Panel Path and use panel data */ setPath(CRT_PATH, CRT_CTRL, DISP_ON); /* Turn CRT path to secondary controller */ break; } case CRT1_CRT2_SIMUL: { /* CRT1,2 show primary controller data */ setDisplayControl(PANEL_CTRL, DISP_ON); /* Turn on Panel Control */ setDisplayControl(CRT_CTRL, DISP_OFF); /* Turn off CRT control */ setDisplayControl(VGA_CTRL, DISP_OFF); /* Turn off VGA control */ swPanelPowerSequence(DISP_OFF, 4); /* Turn off Panel */ /* set bit 25 of 0x80000 to 1 can driver DVI-CRT with out turn on PANEL */ pokeRegisterDWord(PANEL_DISPLAY_CTRL,FIELD_SET(peekRegisterDWord(PANEL_DISPLAY_CTRL), PANEL_DISPLAY_CTRL,DATA,ENABLE)); setDAC(DISP_ON); /* Turn on DAC */ ddk750_setDPMS(DPMS_ON); /* Turn on DPMS to drive CRT */ setDualPanel(0); /* Turn off Panel 2 */ setPath(PANEL_PATH, PANEL_CTRL, DISP_ON); /* Turn off Panel Path */ setPath(CRT_PATH, PANEL_CTRL, DISP_ON); /* Turn off CRT Path and use panel data */ break; } case PANEL_CRT_SIMUL: { /* Panel1 (18,24,36 bit TFT) and CRT1,2 show same content with primary controller panel type is none of my bussiness,pleae set it out side if 18-bit TFT selected then this option means PANEL1 + PANEL2 + CRTs */ setDisplayControl(PANEL_CTRL, DISP_ON); /* Turn on Panel Control */ setDisplayControl(CRT_CTRL, DISP_OFF); /* Turn off CRT control */ setDisplayControl(VGA_CTRL, DISP_OFF); /* Turn off VGA control */ swPanelPowerSequence(DISP_ON, 4); /* Turn on Panel */ setDAC(DISP_ON); /* Turn on DAC */ ddk750_setDPMS(DPMS_ON); /* Turn on DPMS to drive CRT */ setPath(PANEL_PATH, PANEL_CTRL, DISP_ON); /* Turn on Panel Path and use panel data */ setPath(CRT_PATH, PANEL_CTRL, DISP_ON); /* Turn on CRT Path and use panel data */ break; } case PANEL_CRT_SIMUL_SEC: { /* like above but show secondary controller data */ setDisplayControl(PANEL_CTRL, DISP_OFF); /* Turn OFF Panel Control */ setDisplayControl(CRT_CTRL, DISP_ON); /* Turn ON CRT control */ setDisplayControl(VGA_CTRL, DISP_OFF); /* Turn off VGA control */ swPanelPowerSequence(DISP_ON, 4); /* Turn on Panel */ setDAC(DISP_ON); /* Turn on DAC */ ddk750_setDPMS(DPMS_ON); /* Turn on DPMS to drive CRT */ setPath(PANEL_PATH, CRT_CTRL, DISP_ON); /* Turn ON Panel Path and use secondary ctrl */ setPath(CRT_PATH, CRT_CTRL, DISP_ON); /* Turn on CRT Path and use secondary ctrl */ break; } case PANEL1_PANEL2_SIMUL: { /* dual 18 bit TFT show primary controller data */ setDisplayControl(PANEL_CTRL, DISP_ON); /* Turn ON Panel Control */ setDisplayControl(CRT_CTRL, DISP_OFF); /* Turn OFF CRT control */ setDisplayControl(VGA_CTRL, DISP_OFF); /* Turn off VGA control */ swPanelPowerSequence(DISP_ON, 4); /* Turn on Panel */ setDAC(DISP_OFF); /* Turn on DAC */ ddk750_setDPMS(DPMS_OFF); /* Turn on DPMS to drive CRT */ setPanelType(TFT_18BIT); setPath(PANEL_PATH, PANEL_CTRL, DISP_ON); /* Turn ON Panel Path and use secondary ctrl */ setPath(CRT_PATH, PANEL_CTRL, DISP_ON); /* Turn on CRT Path and use secondary ctrl */ break; } case PANEL_CRT_DUAL: { /* view1:PANEL1 + DVI-CRT view2:VGA-CRT */ setDisplayControl(PANEL_CTRL, DISP_ON); /* Turn on Panel Control */ setDisplayControl(CRT_CTRL, DISP_ON); /* Turn on CRT control */ setDisplayControl(VGA_CTRL, DISP_OFF); /* Turn off VGA control */ swPanelPowerSequence(DISP_ON, 4); /* Turn on Panel */ setDAC(DISP_ON); /* Turn on DAC */ ddk750_setDPMS(DPMS_ON); /* Turn on DPMS to drive CRT */ setDualPanel(0); /* Turn off Panel 2 */ if (swapDisplay == 1) { setPath(PANEL_PATH, CRT_CTRL, DISP_ON); /* Turn on Panel Path and use CRT data */ setPath(CRT_PATH, PANEL_CTRL, DISP_ON); /* Turn on CRT Path and use Panel data */ } else { setPath(PANEL_PATH, PANEL_CTRL, DISP_ON); /* Turn on Panel Path and use panel data */ setPath(CRT_PATH, CRT_CTRL, DISP_ON); /* Turn on CRT Path and use CRT data */ } break; } } return 0; }
//! //! Fills the panel frame with a panel according to the given panel type //! index. //! //! \param index The new panel type index. //! void PanelFrame::on_ui_panelTypeComboBox_currentIndexChanged ( int index ) { // if (index > Panel::T_Uninitialized && index < Panel::T_NumTypes) if (index > Panel::T_Uninitialized) setPanelType((Panel::Type) index); }