Removed old/unused files.

Separated opengl module from kcminfo, now it lives in its own kcmopengl.
Opengl module now uses .ui file.


svn path=/trunk/KDE/kdebase/apps/; revision=789343
This commit is contained in:
Ivo Anjo 2008-03-24 00:05:49 +00:00
parent 76d6dd9b89
commit f9e10a5a83
13 changed files with 167 additions and 112 deletions

View file

@ -6,6 +6,7 @@ add_subdirectory( solidproc )
add_subdirectory( info )
add_subdirectory( nics )
add_subdirectory( usbview )
add_subdirectory( opengl )
macro_optional_find_package(RAW1394)
macro_log_feature(RAW1394_FOUND "RAW1394" "library for direct access to IEEE 1394 bus" "http://www.linux1394.org/" FALSE "" "View FireWire devices in kinfocenter.")

View file

@ -12,24 +12,15 @@ check_include_files(Alib.h HAVE_ALIB_H) # info_hpux.cpp
configure_file (config-infocenter.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-infocenter.h )
if(OPENGL_FOUND AND OPENGL_GLU_FOUND)
ADD_DEFINITIONS(-DINFO_OPENGL_AVAILABLE ) # added manually
include_directories( ${OPENGL_INCLUDE_DIR} ${OPENGL_GLU_INCLUDE_DIR} )
else(OPENGL_FOUND AND OPENGL_GLU_FOUND)
MESSAGE(STATUS "OpenGL information module has been disabled.")
endif(OPENGL_FOUND AND OPENGL_GLU_FOUND)
########### next target ###############
set(kcm_info_PART_SRCS main.cpp memory.cpp opengl.cpp )
set(kcm_info_PART_SRCS main.cpp memory.cpp )
kde4_add_plugin(kcm_info ${kcm_info_PART_SRCS})
target_link_libraries(kcm_info ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} ${QT_QT3SUPPORT_LIBRARY} ${X11_X11_LIB})
if(OPENGL_FOUND AND OPENGL_GLU_FOUND)
target_link_libraries(kcm_info ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
endif(OPENGL_FOUND AND OPENGL_GLU_FOUND)
install(TARGETS kcm_info DESTINATION ${PLUGIN_INSTALL_DIR} )
@ -38,5 +29,5 @@ install(TARGETS kcm_info DESTINATION ${PLUGIN_INSTALL_DIR} )
install(FILES memory.desktop
# processor.desktop # currently broken
dma.desktop interrupts.desktop ioports.desktop opengl.desktop pci.desktop sound.desktop devices.desktop scsi.desktop partitions.desktop xserver.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
dma.desktop interrupts.desktop ioports.desktop pci.desktop sound.desktop devices.desktop scsi.desktop partitions.desktop xserver.desktop DESTINATION ${SERVICES_INSTALL_DIR} )

View file

@ -1,27 +0,0 @@
1998-11-09 Alex Zepeda <alex@zippy.dyn.ml.org>
* info_fbsd.cpp: Fix the SCSI information, so that it's actually
displayed (only if info can be found). However, either kcminfo or
camcontrol needs to be suid root. Your choice.
* info_fbsd.cpp: Add a few (hopefully) useful comments, and tidy up
some of the code.
1998-12-08 Helge Deller <deller@gmx.de>
* info.cpp:
fixed the column-width of KTabListboxes, where only one column was/is visible.
If more than one column is used, then the called function should set the width !
* added sections to the online-help in the /doc-directory
1998-12-08 Duncan Haldane <f.d.m.haldane@cwix.com>
* info_linux.cpp:
made the sound info look first for /dev/sndstat, before /proc/sound.
Introduced #defines for all the hard-coded /proc/* files to make subsequent
changes easier.
* expanded the descriptions in the online help.
* deleted processor.xpm and memory.xpm (no longer needed)

View file

@ -1,22 +0,0 @@
# libmach for Tru64
# linux/raw.h for Linux
# devinfo.h, libdevinfo for the list of {IRQ,DMA,IOPORTS/MEMRANGES} for FreeBSD
case "$host" in
*-*-osf*)
AC_CHECK_LIB(mach, vm_statistics, LIB_TRU64_MACH="-lmach")dnl
;;
*-*-linux*)
AC_CHECK_HEADERS(linux/raw.h sys/raw.h)dnl
;;
*-*-freebsd*)
AC_CHECK_HEADERS(devinfo.h)
AC_CHECK_LIB(devinfo, devinfo_foreach_rman, LIBDEVINFO="-ldevinfo")
;;
esac
AC_SUBST(LIB_TRU64_MACH)
AC_HAVE_GL( have_gl=yes, have_gl=no )
AM_CONDITIONAL(COMPILE_GL_INFO, test x$have_gl = xyes)
KDE_CHECK_LONG_LONG

View file

@ -491,7 +491,7 @@ static int GetInfo_ReadfromPipe( Q3ListView *lBox, const char *FileName, bool Wi
#elif defined(__APPLE__)
#include "info_osx.cpp"
#else
#include "info_generic.cpp" /* Default for unsupportet systems.... */
#include "info_generic.cpp" /* Default for unsupported systems.... */
#endif
/*

View file

@ -27,7 +27,6 @@ bool GetInfo_Devices( Q3ListView *lBox );
bool GetInfo_SCSI( Q3ListView *lBox );
bool GetInfo_Partitions( Q3ListView *lBox );
bool GetInfo_XServer_and_Video( Q3ListView *lBox );
extern bool GetInfo_OpenGL( Q3ListView *lBox );
class KInfoListWidget : public KCModule
{

View file

@ -84,9 +84,6 @@ CREATE_FACTORY(Partitions, i18n("Partitions"))
#ifdef INFO_XSERVER_AVAILABLE
CREATE_FACTORY(XServer_and_Video, i18n("X-Server"))
#endif
#ifdef INFO_OPENGL_AVAILABLE
CREATE_FACTORY(OpenGL, i18n("OpenGL"))
#endif
KInfoModulesFactory::KInfoModulesFactory(const char *componentName)
: KPluginFactory(componentName)
@ -123,9 +120,6 @@ KInfoModulesFactory::KInfoModulesFactory(const char *componentName)
#ifdef INFO_XSERVER_AVAILABLE
registerPlugin<KXServer_and_VideoInfoWidget>("xserver");
#endif
#ifdef INFO_OPENGL_AVAILABLE
registerPlugin<KOpenGLInfoWidget>("opengl");
#endif
}
KComponentData KInfoModulesFactory::componentData()

View file

@ -0,0 +1,25 @@
if(OPENGL_FOUND AND OPENGL_GLU_FOUND)
ADD_DEFINITIONS(-DINFO_OPENGL_AVAILABLE ) # added manually
include_directories( ${OPENGL_INCLUDE_DIR} ${OPENGL_GLU_INCLUDE_DIR} )
########### next target ###############
set(KCM_OPENGL_PART_SRCS opengl.cpp )
set(KCM_OPENGL_PART_UIS opengl.ui )
qt4_wrap_ui(KCM_OPENGL_PART_UIS_H ${KCM_OPENGL_PART_UIS})
kde4_add_plugin(kcm_opengl ${KCM_OPENGL_PART_SRCS} ${KCM_OPENGL_PART_UIS_H})
# FIXME: Remove need for Qt3Support
target_link_libraries(kcm_opengl ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} ${QT_QT3SUPPORT_LIBRARY} ${X11_X11_LIB} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
install(TARGETS kcm_opengl DESTINATION ${PLUGIN_INSTALL_DIR})
########### install files ###############
install(FILES opengl.desktop DESTINATION ${SERVICES_INSTALL_DIR})
else(OPENGL_FOUND AND OPENGL_GLU_FOUND)
MESSAGE(STATUS "OpenGL information module has been disabled.")
endif(OPENGL_FOUND AND OPENGL_GLU_FOUND)

View file

@ -0,0 +1,2 @@
#! /usr/bin/env bash
$XGETTEXT *.cpp -o $podir/kcmopengl.pot

View file

@ -1,54 +1,86 @@
/***************************************************************************
* *
* Copyright (C) 2004 by Ilya Korniyko <k_ilya@ukr.net> *
* Adapted from Brian Paul's glxinfo from Mesa demos (http:/www.mesa3d.org)
* Copyright (C) 1999-2002 Brian Paul *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#if defined(INFO_OPENGL_AVAILABLE)
#define KCMGL_DO_GLU
/*
* solidproc.cpp
*
* Copyright (C) 2008 Ivo Anjo <knuckles@gmail.com>
* Copyright (C) 2004 Ilya Korniyko <k_ilya@ukr.net>
* Adapted from Brian Paul's glxinfo from Mesa demos (http:/www.mesa3d.org)
* Copyright (C) 1999-2002 Brian Paul
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <QtGui>
#include <QRegExp>
#include <q3listview.h>
#include <QFile>
//Added by qt3to4:
#include <QTextStream>
#include <KPluginFactory>
#include <KPluginLoader>
#include <kaboutdata.h>
#include <kdialog.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kdebug.h>
// X11 includes
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#ifdef KCMGL_DO_GLU
// GLU includes
#include <GL/glu.h>
#endif
// OpenGL includes
#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glx.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// FIXME: Remove need for Qt3Support
#include <Q3ListView>
#include <Q3ListViewItem>
#include "opengl.h"
#include "opengl.moc"
K_PLUGIN_FACTORY(KCMOpenGLFactory,
registerPlugin<KCMOpenGL>();
)
K_EXPORT_PLUGIN(KCMOpenGLFactory("kcmopengl"))
// FIXME: Temporary!
bool GetInfo_OpenGL(Q3ListView * lBox);
KCMOpenGL::KCMOpenGL(QWidget *parent, const QVariantList &)
: KCModule(KCMOpenGLFactory::componentData(), parent)
{
setupUi(this);
GetInfo_OpenGL(listView);
KAboutData *about =
new KAboutData(I18N_NOOP("kcmopengl"), 0,
ki18n("KCM OpenGL Information"),
0, KLocalizedString(), KAboutData::License_GPL,
ki18n("(c) 2008 Ivo Anjo\n(c) 2004 Ilya Korniyko\n(c) 1999-2002 Brian Paul"));
about->addAuthor(ki18n("Ivo Anjo"), KLocalizedString(), "knuckles@gmail.com");
about->addAuthor(ki18n("Ilya Korniyko"), KLocalizedString(), "k_ilya@ukr.net");
about->addCredit(ki18n("Helge Deller"), ki18n("Original Maintainer"), "deller@gmx.de");
about->addCredit(ki18n("Brian Paul"), ki18n("Author of glxinfo Mesa demos (http:/www.mesa3d.org)"));
setAboutData(about);
}
static bool IsDirect;
@ -518,12 +550,10 @@ void print_glx_glu(Q3ListViewItem *l1, Q3ListViewItem *l2)
l3 = new Q3ListViewItem(l2, l3, i18n("GLX extensions"));
print_extension_list(gli.glxExtensions,l3);
#ifdef KCMGL_DO_GLU
l2 = new Q3ListViewItem(l1, l2, i18n("GLU"));
l3 = new Q3ListViewItem(l2, i18n("GLU version"), gli.gluVersion);
l3 = new Q3ListViewItem(l2, l3, i18n("GLU extensions"));
print_extension_list(gli.gluExtensions,l3);
#endif
}
@ -592,10 +622,9 @@ static Q3ListViewItem *get_gl_info(Display *dpy, int scrnum, Bool allowDirect,Q3
gli.glVersion = (const char *) glGetString(GL_VERSION);
gli.glExtensions = (const char *) glGetString(GL_EXTENSIONS);
gli.displayName = NULL;
#ifdef KCMGL_DO_GLU
gli.gluVersion = (const char *) gluGetString(GLU_VERSION);
gli.gluExtensions = (const char *) gluGetString(GLU_EXTENSIONS);
#endif
IsDirect = glXIsDirect(dpy, ctx);
result = print_screen_info(l1, after);
@ -662,6 +691,3 @@ bool GetInfo_OpenGL(Q3ListView * lBox)
{
return GetInfo_OpenGL_Generic(lBox);
}
#endif /* INFO_OPENGL_AVAILABLE */

View file

@ -1,12 +1,11 @@
[Desktop Entry]
Exec=kcmshell4 opengl
Icon=kcmopengl
Exec=kcmshell4 kcmopengl
Type=Service
X-KDE-ServiceTypes=KCModule
X-DocPath=kinfocenter/opengl/index.html
Icon=kcmopengl
X-KDE-Library=kcm_info
X-KDE-Library=kcm_opengl
X-KDE-PluginKeyword=opengl
X-KDE-ParentApp=kinfocenter

View file

@ -0,0 +1,37 @@
/*
* opengl.h
*
* Copyright (C) 2008 Ivo Anjo <knuckles@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KCONTROL_OPENGL_H
#define KCONTROL_OPENGL_H
#include <kcmodule.h>
#include "ui_opengl.h"
class KCMOpenGL: public KCModule, public Ui::OpenGL
{
Q_OBJECT
public:
explicit KCMOpenGL(QWidget *parent = 0, const QVariantList &list = QVariantList() );
};
#endif

View file

@ -0,0 +1,30 @@
<ui version="4.0" >
<class>OpenGL</class>
<widget class="QWidget" name="OpenGL" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<layout class="QHBoxLayout" >
<item>
<widget class="Q3ListView" name="listView" />
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Q3ListView</class>
<extends>Q3Frame</extends>
<header>q3listview.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>