mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:22:45 +00:00 
			
		
		
		
	Applications: Run clang-format on everything.
This commit is contained in:
		
							parent
							
								
									e09c3a1ae8
								
							
						
					
					
						commit
						fd604a7c68
					
				
					 24 changed files with 350 additions and 294 deletions
				
			
		|  | @ -1,9 +1,9 @@ | |||
| #include <LibGUI/GApplication.h> | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <LibGUI/GLabel.h> | ||||
| #include <LibGUI/GButton.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibGUI/GButton.h> | ||||
| #include <LibGUI/GDesktop.h> | ||||
| #include <LibGUI/GLabel.h> | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <sys/utsname.h> | ||||
| 
 | ||||
| int main(int argc, char** argv) | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| #include <LibGUI/GApplication.h> | ||||
| #include <LibCore/CHttpRequest.h> | ||||
| #include <LibCore/CHttpResponse.h> | ||||
| #include <LibCore/CNetworkJob.h> | ||||
| #include <LibGUI/GApplication.h> | ||||
| #include <stdio.h> | ||||
| 
 | ||||
| int main(int argc, char** argv) | ||||
|  |  | |||
|  | @ -1,8 +1,8 @@ | |||
| #include "DirectoryView.h" | ||||
| #include <LibGUI/GSortingProxyModel.h> | ||||
| #include <AK/FileSystemPath.h> | ||||
| #include <unistd.h> | ||||
| #include <LibGUI/GSortingProxyModel.h> | ||||
| #include <stdio.h> | ||||
| #include <unistd.h> | ||||
| 
 | ||||
| void DirectoryView::handle_activation(const GModelIndex& index) | ||||
| { | ||||
|  |  | |||
|  | @ -1,25 +1,25 @@ | |||
| #include <LibGUI/GWindow.h> | ||||
| #include <LibGUI/GWidget.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include "DirectoryView.h" | ||||
| #include <AK/FileSystemPath.h> | ||||
| #include <LibCore/CUserInfo.h> | ||||
| #include <LibGUI/GAction.h> | ||||
| #include <LibGUI/GApplication.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibGUI/GFileSystemModel.h> | ||||
| #include <LibGUI/GInputBox.h> | ||||
| #include <LibGUI/GLabel.h> | ||||
| #include <LibGUI/GMenuBar.h> | ||||
| #include <LibGUI/GMessageBox.h> | ||||
| #include <LibGUI/GProgressBar.h> | ||||
| #include <LibGUI/GSplitter.h> | ||||
| #include <LibGUI/GStatusBar.h> | ||||
| #include <LibGUI/GTextEditor.h> | ||||
| #include <LibGUI/GToolBar.h> | ||||
| #include <LibGUI/GMenuBar.h> | ||||
| #include <LibGUI/GAction.h> | ||||
| #include <LibGUI/GLabel.h> | ||||
| #include <LibGUI/GInputBox.h> | ||||
| #include <LibGUI/GMessageBox.h> | ||||
| #include <LibGUI/GProgressBar.h> | ||||
| #include <LibGUI/GTreeView.h> | ||||
| #include <LibGUI/GFileSystemModel.h> | ||||
| #include <LibGUI/GSplitter.h> | ||||
| #include <LibCore/CUserInfo.h> | ||||
| #include <AK/FileSystemPath.h> | ||||
| #include <unistd.h> | ||||
| #include <LibGUI/GWidget.h> | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <signal.h> | ||||
| #include <stdio.h> | ||||
| #include "DirectoryView.h" | ||||
| #include <unistd.h> | ||||
| 
 | ||||
| int main(int argc, char** argv) | ||||
| { | ||||
|  | @ -92,8 +92,8 @@ int main(int argc, char** argv) | |||
|         if (input_box.exec() == GInputBox::ExecOK && !input_box.text_value().is_empty()) { | ||||
|             auto new_dir_path = FileSystemPath(String::format("%s/%s", | ||||
|                                                    directory_view->path().characters(), | ||||
|                 input_box.text_value().characters() | ||||
|             )).string(); | ||||
|                                                    input_box.text_value().characters())) | ||||
|                                     .string(); | ||||
|             int rc = mkdir(new_dir_path.characters(), 0777); | ||||
|             if (rc < 0) { | ||||
|                 GMessageBox::show(String::format("mkdir(\"%s\") failed: %s", new_dir_path.characters(), strerror(errno)), "Error", GMessageBox::Type::Error, window); | ||||
|  |  | |||
|  | @ -1,13 +1,13 @@ | |||
| #include "FontEditor.h" | ||||
| #include "GlyphMapWidget.h" | ||||
| #include "GlyphEditorWidget.h" | ||||
| #include <LibGUI/GPainter.h> | ||||
| #include "GlyphMapWidget.h" | ||||
| #include <LibGUI/GButton.h> | ||||
| #include <LibGUI/GLabel.h> | ||||
| #include <LibGUI/GTextBox.h> | ||||
| #include <LibGUI/GCheckBox.h> | ||||
| #include <LibGUI/GSpinBox.h> | ||||
| #include <LibGUI/GGroupBox.h> | ||||
| #include <LibGUI/GLabel.h> | ||||
| #include <LibGUI/GPainter.h> | ||||
| #include <LibGUI/GSpinBox.h> | ||||
| #include <LibGUI/GTextBox.h> | ||||
| #include <stdlib.h> | ||||
| 
 | ||||
| FontEditorWidget::FontEditorWidget(const String& path, RetainPtr<Font>&& edited_font, GWidget* parent) | ||||
|  |  | |||
|  | @ -44,7 +44,8 @@ Rect GlyphMapWidget::get_outer_rect(byte glyph) const | |||
|         row * (font().glyph_height() + m_vertical_spacing) + 1, | ||||
|         font().max_glyph_width() + m_horizontal_spacing, | ||||
|         font().glyph_height() + m_horizontal_spacing | ||||
|     }.translated(frame_thickness(), frame_thickness()); | ||||
|     } | ||||
|         .translated(frame_thickness(), frame_thickness()); | ||||
| } | ||||
| 
 | ||||
| void GlyphMapWidget::update_glyph(byte glyph) | ||||
|  | @ -71,8 +72,7 @@ void GlyphMapWidget::paint_event(GPaintEvent& event) | |||
|                 outer_rect.x() + m_horizontal_spacing / 2, | ||||
|                 outer_rect.y() + m_vertical_spacing / 2, | ||||
|                 font().max_glyph_width(), | ||||
|                 font().glyph_height() | ||||
|             ); | ||||
|                 font().glyph_height()); | ||||
|             if (glyph == m_selected_glyph) { | ||||
|                 painter.fill_rect(outer_rect, Color::from_rgb(0x84351a)); | ||||
|                 painter.draw_glyph(inner_rect.location(), glyph, Color::White); | ||||
|  |  | |||
|  | @ -1,16 +1,16 @@ | |||
| #include "IRCAppWindow.h" | ||||
| #include "IRCWindow.h" | ||||
| #include "IRCWindowListModel.h" | ||||
| #include <LibGUI/GApplication.h> | ||||
| #include <LibGUI/GStackWidget.h> | ||||
| #include <LibGUI/GTableView.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibGUI/GToolBar.h> | ||||
| #include <LibGUI/GAction.h> | ||||
| #include <LibGUI/GApplication.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibGUI/GInputBox.h> | ||||
| #include <LibGUI/GMenu.h> | ||||
| #include <LibGUI/GMenuBar.h> | ||||
| #include <LibGUI/GInputBox.h> | ||||
| #include <LibGUI/GSplitter.h> | ||||
| #include <LibGUI/GStackWidget.h> | ||||
| #include <LibGUI/GTableView.h> | ||||
| #include <LibGUI/GToolBar.h> | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| #include "IRCChannel.h" | ||||
| #include "IRCClient.h" | ||||
| #include "IRCChannelMemberListModel.h" | ||||
| #include "IRCClient.h" | ||||
| #include <stdio.h> | ||||
| #include <time.h> | ||||
| 
 | ||||
|  |  | |||
|  | @ -25,7 +25,8 @@ int IRCChannelMemberListModel::column_count(const GModelIndex&) const | |||
| String IRCChannelMemberListModel::column_name(int column) const | ||||
| { | ||||
|     switch (column) { | ||||
|     case Column::Name: return "Name"; | ||||
|     case Column::Name: | ||||
|         return "Name"; | ||||
|     } | ||||
|     ASSERT_NOT_REACHED(); | ||||
| } | ||||
|  | @ -33,7 +34,8 @@ String IRCChannelMemberListModel::column_name(int column) const | |||
| GModel::ColumnMetadata IRCChannelMemberListModel::column_metadata(int column) const | ||||
| { | ||||
|     switch (column) { | ||||
|     case Column::Name: return { 70, TextAlignment::CenterLeft }; | ||||
|     case Column::Name: | ||||
|         return { 70, TextAlignment::CenterLeft }; | ||||
|     } | ||||
|     ASSERT_NOT_REACHED(); | ||||
| } | ||||
|  | @ -42,7 +44,8 @@ GVariant IRCChannelMemberListModel::data(const GModelIndex& index, Role role) co | |||
| { | ||||
|     if (role == Role::Display) { | ||||
|         switch (index.column()) { | ||||
|         case Column::Name: return m_channel.member_at(index.row()); | ||||
|         case Column::Name: | ||||
|             return m_channel.member_at(index.row()); | ||||
|         } | ||||
|     } | ||||
|     return {}; | ||||
|  |  | |||
|  | @ -1,20 +1,21 @@ | |||
| #include "IRCClient.h" | ||||
| #include "IRCChannel.h" | ||||
| #include "IRCQuery.h" | ||||
| #include "IRCLogBuffer.h" | ||||
| #include "IRCQuery.h" | ||||
| #include "IRCWindow.h" | ||||
| #include "IRCWindowListModel.h" | ||||
| #include <LibCore/CNotifier.h> | ||||
| #include <sys/socket.h> | ||||
| #include <netinet/in.h> | ||||
| #include <arpa/inet.h> | ||||
| #include <unistd.h> | ||||
| #include <netinet/in.h> | ||||
| #include <stdio.h> | ||||
| #include <sys/socket.h> | ||||
| #include <time.h> | ||||
| #include <unistd.h> | ||||
| 
 | ||||
| #define IRC_DEBUG | ||||
| 
 | ||||
| enum IRCNumeric { | ||||
| enum IRCNumeric | ||||
| { | ||||
|     RPL_WHOISUSER = 311, | ||||
|     RPL_WHOISSERVER = 312, | ||||
|     RPL_WHOISOPERATOR = 313, | ||||
|  | @ -105,14 +106,16 @@ void IRCClient::process_line(ByteBuffer&& line) | |||
|     Vector<char, 32> prefix; | ||||
|     Vector<char, 32> command; | ||||
|     Vector<char, 256> current_parameter; | ||||
|     enum { | ||||
|     enum | ||||
|     { | ||||
|         Start, | ||||
|         InPrefix, | ||||
|         InCommand, | ||||
|         InStartOfParameter, | ||||
|         InParameter, | ||||
|         InTrailingParameter, | ||||
|     } state = Start; | ||||
|     } state | ||||
|         = Start; | ||||
| 
 | ||||
|     for (int i = 0; i < line.size(); ++i) { | ||||
|         char ch = line[i]; | ||||
|  | @ -216,8 +219,7 @@ void IRCClient::handle(const Message& msg) | |||
|     printf("IRCClient::execute: prefix='%s', command='%s', arguments=%d\n", | ||||
|         msg.prefix.characters(), | ||||
|         msg.command.characters(), | ||||
|         msg.arguments.size() | ||||
|     ); | ||||
|         msg.arguments.size()); | ||||
| 
 | ||||
|     int i = 0; | ||||
|     for (auto& arg : msg.arguments) { | ||||
|  | @ -231,16 +233,26 @@ void IRCClient::handle(const Message& msg) | |||
| 
 | ||||
|     if (is_numeric) { | ||||
|         switch (numeric) { | ||||
|         case RPL_WHOISCHANNELS: return handle_rpl_whoischannels(msg); | ||||
|         case RPL_ENDOFWHOIS: return handle_rpl_endofwhois(msg); | ||||
|         case RPL_WHOISOPERATOR: return handle_rpl_whoisoperator(msg); | ||||
|         case RPL_WHOISSERVER: return handle_rpl_whoisserver(msg); | ||||
|         case RPL_WHOISUSER: return handle_rpl_whoisuser(msg); | ||||
|         case RPL_WHOISIDLE: return handle_rpl_whoisidle(msg); | ||||
|         case RPL_TOPICWHOTIME: return handle_rpl_topicwhotime(msg); | ||||
|         case RPL_TOPIC: return handle_rpl_topic(msg); | ||||
|         case RPL_NAMREPLY: return handle_rpl_namreply(msg); | ||||
|         case RPL_ENDOFNAMES: return handle_rpl_endofnames(msg); | ||||
|         case RPL_WHOISCHANNELS: | ||||
|             return handle_rpl_whoischannels(msg); | ||||
|         case RPL_ENDOFWHOIS: | ||||
|             return handle_rpl_endofwhois(msg); | ||||
|         case RPL_WHOISOPERATOR: | ||||
|             return handle_rpl_whoisoperator(msg); | ||||
|         case RPL_WHOISSERVER: | ||||
|             return handle_rpl_whoisserver(msg); | ||||
|         case RPL_WHOISUSER: | ||||
|             return handle_rpl_whoisuser(msg); | ||||
|         case RPL_WHOISIDLE: | ||||
|             return handle_rpl_whoisidle(msg); | ||||
|         case RPL_TOPICWHOTIME: | ||||
|             return handle_rpl_topicwhotime(msg); | ||||
|         case RPL_TOPIC: | ||||
|             return handle_rpl_topic(msg); | ||||
|         case RPL_NAMREPLY: | ||||
|             return handle_rpl_namreply(msg); | ||||
|         case RPL_ENDOFNAMES: | ||||
|             return handle_rpl_endofnames(msg); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  | @ -502,8 +514,7 @@ void IRCClient::handle_rpl_whoisuser(const Message& msg) | |||
|         nick.characters(), | ||||
|         username.characters(), | ||||
|         host.characters(), | ||||
|         realname.characters() | ||||
|     )); | ||||
|         realname.characters())); | ||||
| } | ||||
| 
 | ||||
| void IRCClient::handle_rpl_whoisidle(const Message& msg) | ||||
|  | @ -541,8 +552,7 @@ void IRCClient::handle_rpl_topicwhotime(const Message& msg) | |||
|             tm->tm_mday, | ||||
|             tm->tm_hour, | ||||
|             tm->tm_min, | ||||
|             tm->tm_sec | ||||
|         ); | ||||
|             tm->tm_sec); | ||||
|     } | ||||
|     ensure_channel(channel_name).add_message(String::format("*** (set by %s at %s)", nick.characters(), setat.characters()), Color::Blue); | ||||
| } | ||||
|  |  | |||
|  | @ -1,8 +1,8 @@ | |||
| #include "IRCLogBufferModel.h" | ||||
| #include "IRCLogBuffer.h" | ||||
| #include <SharedGraphics/Font.h> | ||||
| #include <stdio.h> | ||||
| #include <time.h> | ||||
| #include <SharedGraphics/Font.h> | ||||
| 
 | ||||
| IRCLogBufferModel::IRCLogBufferModel(Retained<IRCLogBuffer>&& log_buffer) | ||||
|     : m_log_buffer(move(log_buffer)) | ||||
|  | @ -26,9 +26,12 @@ int IRCLogBufferModel::column_count(const GModelIndex&) const | |||
| String IRCLogBufferModel::column_name(int column) const | ||||
| { | ||||
|     switch (column) { | ||||
|     case Column::Timestamp: return "Time"; | ||||
|     case Column::Name: return "Name"; | ||||
|     case Column::Text: return "Text"; | ||||
|     case Column::Timestamp: | ||||
|         return "Time"; | ||||
|     case Column::Name: | ||||
|         return "Name"; | ||||
|     case Column::Text: | ||||
|         return "Text"; | ||||
|     } | ||||
|     ASSERT_NOT_REACHED(); | ||||
| } | ||||
|  | @ -36,9 +39,12 @@ String IRCLogBufferModel::column_name(int column) const | |||
| GModel::ColumnMetadata IRCLogBufferModel::column_metadata(int column) const | ||||
| { | ||||
|     switch (column) { | ||||
|     case Column::Timestamp: return { 60, TextAlignment::CenterLeft }; | ||||
|     case Column::Name: return { 70, TextAlignment::CenterRight, &Font::default_bold_font() }; | ||||
|     case Column::Text: return { 800, TextAlignment::CenterLeft }; | ||||
|     case Column::Timestamp: | ||||
|         return { 60, TextAlignment::CenterLeft }; | ||||
|     case Column::Name: | ||||
|         return { 70, TextAlignment::CenterRight, &Font::default_bold_font() }; | ||||
|     case Column::Text: | ||||
|         return { 800, TextAlignment::CenterLeft }; | ||||
|     } | ||||
|     ASSERT_NOT_REACHED(); | ||||
| } | ||||
|  | @ -56,7 +62,8 @@ GVariant IRCLogBufferModel::data(const GModelIndex& index, Role role) const | |||
|             if (entry.sender.is_empty()) | ||||
|                 return String::empty(); | ||||
|             return String::format("<%c%s>", entry.prefix ? entry.prefix : ' ', entry.sender.characters()); | ||||
|         case Column::Text: return entry.text; | ||||
|         case Column::Text: | ||||
|             return entry.text; | ||||
|         } | ||||
|     } | ||||
|     if (role == Role::ForegroundColor) { | ||||
|  |  | |||
|  | @ -1,13 +1,13 @@ | |||
| #include "IRCWindow.h" | ||||
| #include "IRCClient.h" | ||||
| #include "IRCChannel.h" | ||||
| #include "IRCChannelMemberListModel.h" | ||||
| #include "IRCClient.h" | ||||
| #include "IRCLogBufferModel.h" | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibGUI/GTableView.h> | ||||
| #include <LibGUI/GTextEditor.h> | ||||
| #include <LibGUI/GTextBox.h> | ||||
| #include <LibGUI/GSplitter.h> | ||||
| #include <LibGUI/GTableView.h> | ||||
| #include <LibGUI/GTextBox.h> | ||||
| #include <LibGUI/GTextEditor.h> | ||||
| 
 | ||||
| IRCWindow::IRCWindow(IRCClient& client, void* owner, Type type, const String& name, GWidget* parent) | ||||
|     : GWidget(parent) | ||||
|  |  | |||
|  | @ -1,7 +1,7 @@ | |||
| #include "IRCWindowListModel.h" | ||||
| #include "IRCWindow.h" | ||||
| #include "IRCClient.h" | ||||
| #include "IRCChannel.h" | ||||
| #include "IRCClient.h" | ||||
| #include "IRCWindow.h" | ||||
| #include <stdio.h> | ||||
| #include <time.h> | ||||
| 
 | ||||
|  | @ -27,7 +27,8 @@ int IRCWindowListModel::column_count(const GModelIndex&) const | |||
| String IRCWindowListModel::column_name(int column) const | ||||
| { | ||||
|     switch (column) { | ||||
|     case Column::Name: return "Name"; | ||||
|     case Column::Name: | ||||
|         return "Name"; | ||||
|     } | ||||
|     ASSERT_NOT_REACHED(); | ||||
| } | ||||
|  | @ -35,7 +36,8 @@ String IRCWindowListModel::column_name(int column) const | |||
| GModel::ColumnMetadata IRCWindowListModel::column_metadata(int column) const | ||||
| { | ||||
|     switch (column) { | ||||
|     case Column::Name: return { 70, TextAlignment::CenterLeft }; | ||||
|     case Column::Name: | ||||
|         return { 70, TextAlignment::CenterLeft }; | ||||
|     } | ||||
|     ASSERT_NOT_REACHED(); | ||||
| } | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| #include "IRCAppWindow.h" | ||||
| #include "IRCClient.h" | ||||
| #include <LibGUI/GApplication.h> | ||||
| #include "IRCAppWindow.h" | ||||
| #include <stdio.h> | ||||
| 
 | ||||
| int main(int argc, char** argv) | ||||
|  |  | |||
|  | @ -1,16 +1,16 @@ | |||
| #include <SharedGraphics/GraphicsBitmap.h> | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <LibGUI/GWidget.h> | ||||
| #include <LibGUI/GButton.h> | ||||
| #include <LibCore/CConfigFile.h> | ||||
| #include <LibCore/CUserInfo.h> | ||||
| #include <LibGUI/GApplication.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibCore/CConfigFile.h> | ||||
| #include <sys/wait.h> | ||||
| #include <signal.h> | ||||
| #include <unistd.h> | ||||
| #include <stdio.h> | ||||
| #include <LibGUI/GButton.h> | ||||
| #include <LibGUI/GWidget.h> | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <SharedGraphics/GraphicsBitmap.h> | ||||
| #include <errno.h> | ||||
| #include <LibCore/CUserInfo.h> | ||||
| #include <signal.h> | ||||
| #include <stdio.h> | ||||
| #include <sys/wait.h> | ||||
| #include <unistd.h> | ||||
| 
 | ||||
| static GWindow* make_launcher_window(); | ||||
| 
 | ||||
|  | @ -55,7 +55,8 @@ public: | |||
|                     perror("execl"); | ||||
|             } | ||||
|         }; | ||||
|     } virtual ~LauncherButton() { } | ||||
|     } | ||||
|     virtual ~LauncherButton() {} | ||||
| 
 | ||||
| private: | ||||
|     String m_executable_path; | ||||
|  |  | |||
|  | @ -1,8 +1,8 @@ | |||
| #include "MemoryStatsWidget.h" | ||||
| #include "GraphWidget.h" | ||||
| #include <LibGUI/GPainter.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibGUI/GLabel.h> | ||||
| #include <LibGUI/GPainter.h> | ||||
| #include <SharedGraphics/StylePainter.h> | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
|  |  | |||
|  | @ -2,8 +2,8 @@ | |||
| #include "GraphWidget.h" | ||||
| #include <LibCore/CFile.h> | ||||
| #include <fcntl.h> | ||||
| #include <stdio.h> | ||||
| #include <pwd.h> | ||||
| #include <stdio.h> | ||||
| 
 | ||||
| ProcessModel::ProcessModel(GraphWidget& graph) | ||||
|     : m_graph(graph) | ||||
|  | @ -42,34 +42,56 @@ int ProcessModel::column_count(const GModelIndex&) const | |||
| String ProcessModel::column_name(int column) const | ||||
| { | ||||
|     switch (column) { | ||||
|     case Column::Icon: return ""; | ||||
|     case Column::PID: return "PID"; | ||||
|     case Column::State: return "State"; | ||||
|     case Column::User: return "User"; | ||||
|     case Column::Priority: return "Pr"; | ||||
|     case Column::Linear: return "Linear"; | ||||
|     case Column::Physical: return "Physical"; | ||||
|     case Column::CPU: return "CPU"; | ||||
|     case Column::Name: return "Name"; | ||||
|     case Column::Syscalls: return "Syscalls"; | ||||
|     default: ASSERT_NOT_REACHED(); | ||||
|     case Column::Icon: | ||||
|         return ""; | ||||
|     case Column::PID: | ||||
|         return "PID"; | ||||
|     case Column::State: | ||||
|         return "State"; | ||||
|     case Column::User: | ||||
|         return "User"; | ||||
|     case Column::Priority: | ||||
|         return "Pr"; | ||||
|     case Column::Linear: | ||||
|         return "Linear"; | ||||
|     case Column::Physical: | ||||
|         return "Physical"; | ||||
|     case Column::CPU: | ||||
|         return "CPU"; | ||||
|     case Column::Name: | ||||
|         return "Name"; | ||||
|     case Column::Syscalls: | ||||
|         return "Syscalls"; | ||||
|     default: | ||||
|         ASSERT_NOT_REACHED(); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| GModel::ColumnMetadata ProcessModel::column_metadata(int column) const | ||||
| { | ||||
|     switch (column) { | ||||
|     case Column::Icon: return { 16, TextAlignment::CenterLeft }; | ||||
|     case Column::PID: return { 32, TextAlignment::CenterRight }; | ||||
|     case Column::State: return { 75, TextAlignment::CenterLeft }; | ||||
|     case Column::Priority: return { 16, TextAlignment::CenterLeft }; | ||||
|     case Column::User: return { 50, TextAlignment::CenterLeft }; | ||||
|     case Column::Linear: return { 65, TextAlignment::CenterRight }; | ||||
|     case Column::Physical: return { 65, TextAlignment::CenterRight }; | ||||
|     case Column::CPU: return { 32, TextAlignment::CenterRight }; | ||||
|     case Column::Name: return { 140, TextAlignment::CenterLeft }; | ||||
|     case Column::Syscalls: return { 60, TextAlignment::CenterRight }; | ||||
|     default: ASSERT_NOT_REACHED(); | ||||
|     case Column::Icon: | ||||
|         return { 16, TextAlignment::CenterLeft }; | ||||
|     case Column::PID: | ||||
|         return { 32, TextAlignment::CenterRight }; | ||||
|     case Column::State: | ||||
|         return { 75, TextAlignment::CenterLeft }; | ||||
|     case Column::Priority: | ||||
|         return { 16, TextAlignment::CenterLeft }; | ||||
|     case Column::User: | ||||
|         return { 50, TextAlignment::CenterLeft }; | ||||
|     case Column::Linear: | ||||
|         return { 65, TextAlignment::CenterRight }; | ||||
|     case Column::Physical: | ||||
|         return { 65, TextAlignment::CenterRight }; | ||||
|     case Column::CPU: | ||||
|         return { 32, TextAlignment::CenterRight }; | ||||
|     case Column::Name: | ||||
|         return { 140, TextAlignment::CenterLeft }; | ||||
|     case Column::Syscalls: | ||||
|         return { 60, TextAlignment::CenterRight }; | ||||
|     default: | ||||
|         ASSERT_NOT_REACHED(); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  | @ -87,10 +109,14 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const | |||
| 
 | ||||
|     if (role == Role::Sort) { | ||||
|         switch (index.column()) { | ||||
|         case Column::Icon: return 0; | ||||
|         case Column::PID: return process.current_state.pid; | ||||
|         case Column::State: return process.current_state.state; | ||||
|         case Column::User: return process.current_state.user; | ||||
|         case Column::Icon: | ||||
|             return 0; | ||||
|         case Column::PID: | ||||
|             return process.current_state.pid; | ||||
|         case Column::State: | ||||
|             return process.current_state.state; | ||||
|         case Column::User: | ||||
|             return process.current_state.user; | ||||
|         case Column::Priority: | ||||
|             if (process.current_state.priority == "Idle") | ||||
|                 return 0; | ||||
|  | @ -102,12 +128,17 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const | |||
|                 return 3; | ||||
|             ASSERT_NOT_REACHED(); | ||||
|             return 3; | ||||
|         case Column::Linear: return (int)process.current_state.linear; | ||||
|         case Column::Physical: return (int)process.current_state.physical; | ||||
|         case Column::CPU: return process.current_state.cpu_percent; | ||||
|         case Column::Name: return process.current_state.name; | ||||
|         case Column::Linear: | ||||
|             return (int)process.current_state.linear; | ||||
|         case Column::Physical: | ||||
|             return (int)process.current_state.physical; | ||||
|         case Column::CPU: | ||||
|             return process.current_state.cpu_percent; | ||||
|         case Column::Name: | ||||
|             return process.current_state.name; | ||||
|         // FIXME: GVariant with unsigned?
 | ||||
|         case Column::Syscalls: return (int)process.current_state.syscalls; | ||||
|         case Column::Syscalls: | ||||
|             return (int)process.current_state.syscalls; | ||||
|         } | ||||
|         ASSERT_NOT_REACHED(); | ||||
|         return {}; | ||||
|  | @ -115,10 +146,14 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const | |||
| 
 | ||||
|     if (role == Role::Display) { | ||||
|         switch (index.column()) { | ||||
|         case Column::Icon: return *m_generic_process_icon; | ||||
|         case Column::PID: return process.current_state.pid; | ||||
|         case Column::State: return process.current_state.state; | ||||
|         case Column::User: return process.current_state.user; | ||||
|         case Column::Icon: | ||||
|             return *m_generic_process_icon; | ||||
|         case Column::PID: | ||||
|             return process.current_state.pid; | ||||
|         case Column::State: | ||||
|             return process.current_state.state; | ||||
|         case Column::User: | ||||
|             return process.current_state.user; | ||||
|         case Column::Priority: | ||||
|             if (process.current_state.priority == "Idle") | ||||
|                 return String::empty(); | ||||
|  | @ -129,12 +164,17 @@ GVariant ProcessModel::data(const GModelIndex& index, Role role) const | |||
|             if (process.current_state.priority == "Normal") | ||||
|                 return *m_normal_priority_icon; | ||||
|             return process.current_state.priority; | ||||
|         case Column::Linear: return pretty_byte_size(process.current_state.linear); | ||||
|         case Column::Physical: return pretty_byte_size(process.current_state.physical); | ||||
|         case Column::CPU: return process.current_state.cpu_percent; | ||||
|         case Column::Name: return process.current_state.name; | ||||
|         case Column::Linear: | ||||
|             return pretty_byte_size(process.current_state.linear); | ||||
|         case Column::Physical: | ||||
|             return pretty_byte_size(process.current_state.physical); | ||||
|         case Column::CPU: | ||||
|             return process.current_state.cpu_percent; | ||||
|         case Column::Name: | ||||
|             return process.current_state.name; | ||||
|         // FIXME: It's weird that GVariant doesn't support unsigned ints. Should it?
 | ||||
|         case Column::Syscalls: return (int)process.current_state.syscalls; | ||||
|         case Column::Syscalls: | ||||
|             return (int)process.current_state.syscalls; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,20 +1,20 @@ | |||
| #include <LibCore/CTimer.h> | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <LibGUI/GWidget.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibGUI/GApplication.h> | ||||
| #include <LibGUI/GToolBar.h> | ||||
| #include <LibGUI/GMenuBar.h> | ||||
| #include <LibGUI/GGroupBox.h> | ||||
| #include <LibGUI/GAction.h> | ||||
| #include <LibGUI/GTabWidget.h> | ||||
| #include <LibGUI/GLabel.h> | ||||
| #include <unistd.h> | ||||
| #include <stdio.h> | ||||
| #include <signal.h> | ||||
| #include "ProcessTableView.h" | ||||
| #include "MemoryStatsWidget.h" | ||||
| #include "GraphWidget.h" | ||||
| #include "MemoryStatsWidget.h" | ||||
| #include "ProcessTableView.h" | ||||
| #include <LibCore/CTimer.h> | ||||
| #include <LibGUI/GAction.h> | ||||
| #include <LibGUI/GApplication.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibGUI/GGroupBox.h> | ||||
| #include <LibGUI/GLabel.h> | ||||
| #include <LibGUI/GMenuBar.h> | ||||
| #include <LibGUI/GTabWidget.h> | ||||
| #include <LibGUI/GToolBar.h> | ||||
| #include <LibGUI/GWidget.h> | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <signal.h> | ||||
| #include <stdio.h> | ||||
| #include <unistd.h> | ||||
| 
 | ||||
| int main(int argc, char** argv) | ||||
| { | ||||
|  |  | |||
|  | @ -1,8 +1,8 @@ | |||
| #include "TaskbarButton.h" | ||||
| #include <WindowServer/WSAPITypes.h> | ||||
| #include <LibGUI/GAction.h> | ||||
| #include <LibGUI/GMenu.h> | ||||
| #include <LibGUI/GEventLoop.h> | ||||
| #include <LibGUI/GMenu.h> | ||||
| #include <WindowServer/WSAPITypes.h> | ||||
| 
 | ||||
| static void set_window_minimized_state(const WindowIdentifier& identifier, bool minimized) | ||||
| { | ||||
|  |  | |||
|  | @ -1,11 +1,11 @@ | |||
| #include "TaskbarWindow.h" | ||||
| #include "TaskbarButton.h" | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <LibGUI/GDesktop.h> | ||||
| #include <LibGUI/GEventLoop.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibGUI/GButton.h> | ||||
| #include <LibGUI/GDesktop.h> | ||||
| #include <LibGUI/GEventLoop.h> | ||||
| #include <LibGUI/GFrame.h> | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <WindowServer/WSAPITypes.h> | ||||
| #include <stdio.h> | ||||
| 
 | ||||
|  | @ -70,8 +70,7 @@ void TaskbarWindow::wm_event(GWMEvent& event) | |||
|         auto& removed_event = static_cast<GWMWindowRemovedEvent&>(event); | ||||
|         dbgprintf("WM_WindowRemoved: client_id=%d, window_id=%d\n", | ||||
|             removed_event.client_id(), | ||||
|             removed_event.window_id() | ||||
|         ); | ||||
|             removed_event.window_id()); | ||||
| #endif | ||||
|         WindowList::the().remove_window(identifier); | ||||
|         update(); | ||||
|  | @ -83,8 +82,7 @@ void TaskbarWindow::wm_event(GWMEvent& event) | |||
|         dbgprintf("WM_WindowRectChanged: client_id=%d, window_id=%d, rect=%s\n", | ||||
|             changed_event.client_id(), | ||||
|             changed_event.window_id(), | ||||
|             changed_event.rect().to_string().characters() | ||||
|         ); | ||||
|             changed_event.rect().to_string().characters()); | ||||
| #endif | ||||
|         break; | ||||
|     } | ||||
|  | @ -94,8 +92,7 @@ void TaskbarWindow::wm_event(GWMEvent& event) | |||
|         dbgprintf("WM_WindowIconChanged: client_id=%d, window_id=%d, icon_path=%s\n", | ||||
|             changed_event.client_id(), | ||||
|             changed_event.window_id(), | ||||
|             changed_event.icon_path().characters() | ||||
|         ); | ||||
|             changed_event.icon_path().characters()); | ||||
| #endif | ||||
|         if (auto* window = WindowList::the().window(identifier)) { | ||||
|             window->set_icon_path(changed_event.icon_path()); | ||||
|  | @ -113,8 +110,7 @@ void TaskbarWindow::wm_event(GWMEvent& event) | |||
|             changed_event.title().characters(), | ||||
|             changed_event.rect().to_string().characters(), | ||||
|             changed_event.is_active(), | ||||
|             changed_event.is_minimized() | ||||
|         ); | ||||
|             changed_event.is_minimized()); | ||||
| #endif | ||||
|         if (!should_include_window(changed_event.window_type())) | ||||
|             break; | ||||
|  |  | |||
|  | @ -1,6 +1,6 @@ | |||
| #include "WindowList.h" | ||||
| #include <WindowServer/WSAPITypes.h> | ||||
| #include <LibGUI/GEventLoop.h> | ||||
| #include <WindowServer/WSAPITypes.h> | ||||
| 
 | ||||
| WindowList& WindowList::the() | ||||
| { | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| #include <LibGUI/GApplication.h> | ||||
| #include "TaskbarWindow.h" | ||||
| #include <LibGUI/GApplication.h> | ||||
| 
 | ||||
| int main(int argc, char** argv) | ||||
| { | ||||
|  |  | |||
|  | @ -1,27 +1,26 @@ | |||
| #include <stdio.h> | ||||
| #include <unistd.h> | ||||
| #include <errno.h> | ||||
| #include <string.h> | ||||
| #include <stdlib.h> | ||||
| #include <fcntl.h> | ||||
| #include <assert.h> | ||||
| #include <sys/ioctl.h> | ||||
| #include <sys/select.h> | ||||
| #include <pwd.h> | ||||
| #include "Terminal.h" | ||||
| #include <Kernel/KeyCode.h> | ||||
| #include <LibCore/CUserInfo.h> | ||||
| #include <LibGUI/GAction.h> | ||||
| #include <LibGUI/GApplication.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibGUI/GRadioButton.h> | ||||
| #include <LibGUI/GWidget.h> | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <LibGUI/GFontDatabase.h> | ||||
| #include <LibGUI/GGroupBox.h> | ||||
| #include <LibGUI/GMenuBar.h> | ||||
| #include <LibGUI/GAction.h> | ||||
| #include <LibGUI/GFontDatabase.h> | ||||
| #include <LibGUI/GSlider.h> | ||||
| #include <LibGUI/GRadioButton.h> | ||||
| #include <LibCore/CUserInfo.h> | ||||
| #include <LibGUI/GSlider.h> | ||||
| #include <LibGUI/GWidget.h> | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <assert.h> | ||||
| #include <errno.h> | ||||
| #include <fcntl.h> | ||||
| #include <pwd.h> | ||||
| #include <stdio.h> | ||||
| #include <stdlib.h> | ||||
| #include <string.h> | ||||
| #include <sys/ioctl.h> | ||||
| #include <sys/select.h> | ||||
| #include <unistd.h> | ||||
| 
 | ||||
| static void make_shell(int ptm_fd) | ||||
| { | ||||
|  | @ -88,7 +87,6 @@ GWindow* create_settings_window(Terminal& terminal, RetainPtr<CConfigFile> confi | |||
|     window->set_title("Terminal Settings"); | ||||
|     window->set_rect(50, 50, 200, 140); | ||||
| 
 | ||||
| 
 | ||||
|     auto* settings = new GWidget; | ||||
|     window->set_main_widget(settings); | ||||
|     settings->set_fill_with_background_color(true); | ||||
|  | @ -172,8 +170,7 @@ int main(int argc, char** argv) | |||
|     app_menu->add_action(GAction::create("Settings...", | ||||
|         [&settings_window, &terminal, &config](const GAction&) { | ||||
|             if (!settings_window) | ||||
|                                                  settings_window = | ||||
|                                                      create_settings_window(terminal, config)->make_weak_ptr(); | ||||
|                 settings_window = create_settings_window(terminal, config)->make_weak_ptr(); | ||||
|             settings_window->show(); | ||||
|             settings_window->move_to_front(); | ||||
|         })); | ||||
|  |  | |||
|  | @ -1,21 +1,21 @@ | |||
| #include <LibGUI/GWindow.h> | ||||
| #include <LibGUI/GWidget.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <AK/StringBuilder.h> | ||||
| #include <LibCore/CFile.h> | ||||
| #include <LibGUI/GAction.h> | ||||
| #include <LibGUI/GApplication.h> | ||||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibGUI/GFilePicker.h> | ||||
| #include <LibGUI/GFontDatabase.h> | ||||
| #include <LibGUI/GMenuBar.h> | ||||
| #include <LibGUI/GMessageBox.h> | ||||
| #include <LibGUI/GStatusBar.h> | ||||
| #include <LibGUI/GToolBar.h> | ||||
| #include <LibGUI/GMenuBar.h> | ||||
| #include <LibGUI/GTextEditor.h> | ||||
| #include <LibGUI/GAction.h> | ||||
| #include <LibGUI/GFontDatabase.h> | ||||
| #include <LibCore/CFile.h> | ||||
| #include <AK/StringBuilder.h> | ||||
| #include <unistd.h> | ||||
| #include <stdio.h> | ||||
| #include <signal.h> | ||||
| #include <LibGUI/GToolBar.h> | ||||
| #include <LibGUI/GWidget.h> | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <fcntl.h> | ||||
| #include <signal.h> | ||||
| #include <stdio.h> | ||||
| #include <unistd.h> | ||||
| 
 | ||||
| void open_sesame(GWindow& window, GTextEditor& editor, const String& path) | ||||
| { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling