| 1 | /* |
| 2 | * File: Regs32.cpp |
| 3 | * |
| 4 | * Author: Jacob Dekel |
| 5 | * Created on: Aug 7, 2009 |
| 6 | * |
| 7 | * Copyright (c) 2009-2013 Jacob Dekel |
| 8 | * $Id$ |
| 9 | * |
| 10 | * This program is free software: you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation, either version 3 of the License, or |
| 13 | * (at your option) any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | * |
| 23 | */ |
| 24 | |
| 25 | #include "Regs32.h"cxx . . $ `<file>/HercStudio/Regs32.h`/ |
| 26 | #include "Preferences.h"cxx . . $ `<file>/HercStudio/Preferences.h`/ |
| 27 | #include "MainWindow.h"cxx . . $ `<file>/HercStudio/MainWindow.h`/ |
| 28 | |
| 29 | #include <iostream> |
| 30 | |
| 31 | stdcxx . . $ std/::stringcxx . . $ std/string# Regs32cxx . . $ Regs32#::gCommandcxx . . $ Regs32#gCommand. = "]GREGS="cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 32 | stdcxx . . $ std/::stringcxx . . $ std/string# Regs32cxx . . $ Regs32#::cCommandcxx . . $ Regs32#cCommand. = "]CREGS="cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 33 | stdcxx . . $ std/::stringcxx . . $ std/string# Regs32cxx . . $ Regs32#::fCommandcxx . . $ Regs32#fCommand. = "]FREGS="cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 34 | stdcxx . . $ std/::stringcxx . . $ std/string# Regs32cxx . . $ Regs32#::aCommandcxx . . $ Regs32#aCommand. = "]AREGS="cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 35 | |
| 36 | Regs32cxx . . $ Regs32#::Regs32cxx . . $ Regs32#Regs32(ad93d92ad6dd8c69).(QWidgetcxx . . $ QWidget# * parent, stdcxx . . $ std/::stringcxx . . $ std/string# command) : |
| 37 | QWidgetcxx . . $ QWidget#QWidget(872e7b0c281abd8d).(parent), |
| 38 | mParentcxx . . $ Regs32#mParent.(parent), |
| 39 | mLine1cxx . . $ Regs32#mLine1.(this), |
| 40 | mLine2cxx . . $ Regs32#mLine2.(this), |
| 41 | mLine3cxx . . $ Regs32#mLine3.(this), |
| 42 | mLine4cxx . . $ Regs32#mLine4.(this) |
| 43 | { |
| 44 | //QFont font("monospace", 9); |
| 45 | setFontcxx . . $ Regs32#setFont(49f6e7a06ebc5aa8).(); |
| 46 | |
| 47 | mCommandcxx . . $ Regs32#mCommand. =cxx . . $ std/__cxx11/basic_string#`operator=`(c0b47be1fddc0e75). command; |
| 48 | } |
| 49 | |
| 50 | Regs32cxx . . $ Regs32#::~cxx . . $ Regs32#`~Regs32`(49f6e7a06ebc5aa8).Regs32cxx . . $ Regs32#() |
| 51 | { |
| 52 | } |
| 53 | |
| 54 | void Regs32cxx . . $ Regs32#::setActivecxx . . $ Regs32#setActive(b45ddcbc8423892c).(bool active) |
| 55 | { |
| 56 | mLine1cxx . . $ Regs32#mLine1..setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(active); |
| 57 | mLine2cxx . . $ Regs32#mLine2..setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(active); |
| 58 | mLine3cxx . . $ Regs32#mLine3..setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(active); |
| 59 | mLine4cxx . . $ Regs32#mLine4..setVisiblecxx . . $ QWidget#setVisible(b45ddcbc8423892c).(active); |
| 60 | stdcxx . . $ std/::stringcxx . . $ std/string# command = mCommandcxx . . $ std/__cxx11/basic_string#basic_string(3bc0f77cdfbaa67f). +cxx . . $ std/operator+(4f1c09d7d89f005e). (active ? '1' : '0'); |
| 61 | MainWindowcxx . . $ MainWindow# * mainWindow = dynamic_cast<MainWindowcxx . . $ MainWindow# *>(mParentcxx . . $ Regs32#mParent.); |
| 62 | mainWindow->issueCommandcxx . . $ MainWindow#issueCommand(7c222eea44a24d43).(command); |
| 63 | } |
| 64 | |
| 65 | void Regs32cxx . . $ Regs32#::setFontcxx . . $ Regs32#setFont(49f6e7a06ebc5aa8).() |
| 66 | { |
| 67 | Preferencescxx . . $ Preferences#& pref = Preferencescxx . . $ Preferences#::getInstancecxx . . $ Preferences#getInstance(2e7be89de0a5bc0).(); |
| 68 | int fontSize = pref.fontSizecxx . . $ Preferences#fontSize(de63a260e3acfa17).(Preferencescxx . . $ Preferences#::RegsFontObjectcxx . . $ Preferences#RegsFontObject.); |
| 69 | QFontcxx . . $ QFont# fontcxx . . $ QFont#QFont(7ae16150a604556).(prefcxx . . $ QString#QString(85c52e162fed56f9)..fontNamecxx . . $ Preferences#fontName(4f9fe96fc69d00d).(Preferencescxx . . $ Preferences#::RegsFontObjectcxx . . $ Preferences#RegsFontObject.).c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), |
| 70 | fontSize, |
| 71 | (pref.fontIsBoldcxx . . $ Preferences#fontIsBold(104456de71e6e103).(Preferencescxx . . $ Preferences#::RegsFontObjectcxx . . $ Preferences#RegsFontObject.) ? QFontcxx . . $ QFont#::Boldcxx . . $ QFont#Bold. : QFontcxx . . $ QFont#::Normalcxx . . $ QFont#Normal.), |
| 72 | pref.fontIsItaliccxx . . $ Preferences#fontIsItalic(104456de71e6e103).(Preferencescxx . . $ Preferences#::RegsFontObjectcxx . . $ Preferences#RegsFontObject.)); |
| 73 | |
| 74 | font.setStyleHintcxx . . $ QFont#setStyleHint(5f69bb8fd37dc5d9).(QFontcxx . . $ QFont#::Couriercxx . . $ QFont#Courier.); |
| 75 | mLine1cxx . . $ Regs32#mLine1..setFontcxx . . $ QWidget#setFont(d0a4bd0c8524b912).(font); |
| 76 | mLine2cxx . . $ Regs32#mLine2..setFontcxx . . $ QWidget#setFont(d0a4bd0c8524b912).(font); |
| 77 | mLine3cxx . . $ Regs32#mLine3..setFontcxx . . $ QWidget#setFont(d0a4bd0c8524b912).(font); |
| 78 | mLine4cxx . . $ Regs32#mLine4..setFontcxx . . $ QWidget#setFont(d0a4bd0c8524b912).(font); |
| 79 | mLine1cxx . . $ Regs32#mLine1..setGeometrycxx . . $ QWidget#setGeometry(748afa4755bc9595).(2,fontSize+2,fontSize*35,fontSize+2); |
| 80 | mLine2cxx . . $ Regs32#mLine2..setGeometrycxx . . $ QWidget#setGeometry(748afa4755bc9595).(2,2*(fontSize+2),fontSize*35,fontSize+2); |
| 81 | mLine3cxx . . $ Regs32#mLine3..setGeometrycxx . . $ QWidget#setGeometry(748afa4755bc9595).(2,3*(fontSize+2),fontSize*35,fontSize+2); |
| 82 | mLine4cxx . . $ Regs32#mLine4..setGeometrycxx . . $ QWidget#setGeometry(748afa4755bc9595).(2,4*(fontSize+2),fontSize*35,fontSize+2); |
| 83 | |
| 84 | } |
| 85 | |
| 86 | bool Regs32cxx . . $ Regs32#::notifycxx . . $ Regs32#notify(544790aa27d183a0).(const QByteArraycxx . . $ QByteArray#& statusLine) |
| 87 | { |
| 88 | if (statusLine.lengthcxx . . $ QByteArray#length(455f465bc33b4cdf).() < 2) |
| 89 | { |
| 90 | setFontcxx . . $ Regs32#setFont(49f6e7a06ebc5aa8).(); |
| 91 | return false; |
| 92 | } |
| 93 | if (statusLine[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).2] == '0') |
| 94 | Regs32cxx . . $ Regs32#::mLine1cxx . . $ Regs32#mLine1..setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(statusLinecxx . . $ QString#QString(45672f3c6961a244).); |
| 95 | else if (statusLine[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).2] == '4') |
| 96 | Regs32cxx . . $ Regs32#::mLine2cxx . . $ Regs32#mLine2..setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(statusLinecxx . . $ QString#QString(45672f3c6961a244).); |
| 97 | else if (statusLine[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).2] == '8') |
| 98 | Regs32cxx . . $ Regs32#::mLine3cxx . . $ Regs32#mLine3..setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(statusLinecxx . . $ QString#QString(45672f3c6961a244).); |
| 99 | else if (statusLine[cxx . . $ QByteArray#`operator[]`(ed855a77b1899856).2] == 'C') |
| 100 | Regs32cxx . . $ Regs32#::mLine4cxx . . $ Regs32#mLine4..setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(statusLinecxx . . $ QString#QString(45672f3c6961a244).); |
| 101 | else return false; |
| 102 | |
| 103 | return true; |
| 104 | } |