Remove old KWingrid from checkout
g0dil [Wed, 11 Oct 2006 09:18:21 +0000 (09:18 +0000)]
old/Makefile [deleted file]
old/kwingrid.cc [deleted file]
old/kwingrid.h [deleted file]
old/kwingrid_iface.h [deleted file]
old/main.cc [deleted file]

diff --git a/old/Makefile b/old/Makefile
deleted file mode 100644 (file)
index e8255dc..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-TARGET=kwingrid
-
-MOCS=\
-kwingrid.moc
-
-OBJECTS=\
-main.o \
-kwingrid.o \
-kwingrid_iface_skel.o \
-kwingrid_iface_stub.o 
-
-LIBS=-lkdecore -lkdeui -lDCOP -lqt-mt -lX11 -lXext
-LOPTS=-L/usr/X11R6/lib
-COPTS=-I. -I /usr/include/kde -I /usr/include/qt3 -I /usr/X11R6/include/X11 -O2
-
-all: mocs bin
-
-clean:
-       rm -f $(OBJECTS) $(MOCS) *_skel.cpp *_stub.h *_stub.cpp $(TARGET)
-
-bin: $(TARGET)
-
-mocs: $(MOCS)
-
-%.moc: %.h
-       moc $< -o $@
-
-%.o: %.cc
-       g++ $(COPTS) -c $< -o $@
-
-%.o: %.cpp
-       g++ $(COPTS) -c $< -o $@
-
-%.idl: %.h
-       dcopidl $< > $@
-
-%_skel.cpp %_stub.h %_stub.cpp: %.idl
-       dcopidl2cpp $<
-
-$(TARGET): $(OBJECTS)
-       g++ $(LOPTS) -o $@ $(OBJECTS) $(LIBS)
-
-
diff --git a/old/kwingrid.cc b/old/kwingrid.cc
deleted file mode 100644 (file)
index fc1ee2c..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-#include <kapplication.h>
-#include <dcopclient.h>
-#include <kwin.h>
-#include <Xlib.h>
-
-#include "kwingrid.h"
-#include "kwingrid.moc"
-
-KWinGrid::KWinGrid(int hgap__, int vgap__, int hsplit__, int vsplit__)
-    : DCOPObject("grid"), hgap_(hgap__), vgap_(vgap__), hsplit_(hsplit__), vsplit_(vsplit__)
-{
-    module_ = new KWinModule(KApplication::kApplication());
-}
-
-void KWinGrid::move(int __xslot, int __yslot)
-{
-    moveResize(__xslot, __yslot, -1, -1);
-}
-
-void KWinGrid::resize(int __xsize, int __ysize)
-{
-    moveResize(-1,-1,__xsize,__ysize);
-}
-
-void KWinGrid::toDesk(int __desk)
-{
-    int w = module_->activeWindow();
-    if (w) 
-       KWin::setOnDesktop(w,__desk);
-}
-
-void KWinGrid::moveResize(int __xslot, int __yslot,
-                         int __xsize, int __ysize)
-{
-    initGeometry();
-    if (activeWindow_) {
-       QRect newGeometry = doMoveResize(__xslot,__yslot,__xsize,__ysize);
-       updateGeometry(newGeometry);
-       applyGeometry();
-    }
-}
-
-void KWinGrid::moveRelative(int __xdiff, int __ydiff)
-{
-    initGeometry();
-    if (activeWindow_) {
-       int xSlot = (outer_.left()-region_.left()+hsize_/2)/hsize_;
-       int ySlot = (outer_.top()-region_.top()+vsize_/2)/vsize_;
-       xSlot += __xdiff;
-       ySlot += __ydiff;
-       if (xSlot<0)
-           xSlot = 0;
-       else if (xSlot >= hsplit_)
-           xSlot = hsplit_-1;
-       if (ySlot<0)
-           ySlot = 0;
-       else if (ySlot >= vsplit_)
-           ySlot = vsplit_-1;
-       QRect newGeometry = doMoveResize(xSlot,ySlot,-1,-1);
-       updateGeometry(newGeometry);
-       applyGeometry();
-    }
-}
-
-void KWinGrid::resizeRelative(int __xdiff, int __ydiff)
-{
-    initGeometry();
-    if (activeWindow_) {
-       int xSize = (outer_.width()+hsize_/2)/hsize_;
-       int ySize = (outer_.height()+vsize_/2)/vsize_;
-       xSize += __xdiff;
-       ySize += __ydiff;
-       if (xSize<1)
-           xSize = 1;
-       if (xSize>hsplit_)
-           xSize = hsplit_;
-       if (ySize<1)
-           ySize = 1;
-       if (ySize>vsplit_)
-           ySize = vsplit_;
-       QRect newGeometry = doMoveResize(-1,-1,xSize,ySize);
-       updateGeometry(newGeometry);
-       applyGeometry();
-    }
-}
-
-QRect KWinGrid::doMoveResize(int __xslot, int __yslot,
-                            int __xsize, int __ysize)
-{
-    QRect newGeometry(outer_);
-       
-    if (__xsize != -1) 
-       newGeometry.setWidth(__xsize*hsize_-hgap_);
-    if (__ysize != -1)
-       newGeometry.setHeight(__ysize*vsize_-vgap_);
-    QSize size = newGeometry.size();
-    if (__xslot != -1) {
-       QPoint p(newGeometry.topLeft());
-       p.setX(region_.left() 
-              + __xslot*hsize_
-              + hgap_/2);
-       newGeometry.moveTopLeft(p);
-    }
-    if (__yslot != -1) {
-       QPoint p(newGeometry.topLeft());
-       p.setY(region_.top()
-              + __yslot*vsize_
-              + vgap_/2);
-       newGeometry.moveTopLeft(p);
-    }
-       
-    return newGeometry;
-}
-
-void KWinGrid::initGeometry()
-{
-    activeWindow_ = module_->activeWindow();
-    if (activeWindow_) {
-       KWin::Info info(KWin::info(activeWindow_));
-       inner_ = info.geometry;
-       outer_ = info.frameGeometry;
-       region_ = module_->workArea();
-
-       hsize_ = (region_.width()-hgap_)/hsplit_;
-       vsize_ = (region_.height()-vgap_)/vsplit_;
-
-       int hdelta = region_.width()-hsize_*hsplit_;
-       int vdelta = region_.height()-vsize_*vsplit_;
-       QPoint topLeft(region_.topLeft());
-       topLeft+=QPoint(hdelta/2,vdelta/2);
-       region_.moveTopLeft(topLeft);
-       region_.setSize(QSize(hsize_*hsplit_,vsize_*vsplit_));
-    }
-}
-
-void KWinGrid::updateGeometry(QRect& __new)
-{
-    QRect newInner(inner_);
-    newInner.moveTopLeft(QPoint(__new.top()+(inner_.top()-outer_.top()),
-                               __new.left()+(inner_.left()-outer_.left())));
-    newInner.setSize(QSize(__new.width()-(outer_.width()-inner_.width()),
-                          __new.height()-(outer_.height()-inner_.height())));
-    inner_ = newInner;
-    outer_ = __new;
-}
-
-void KWinGrid::applyGeometry()
-{
-    XMoveResizeWindow(KApplication::kApplication()->getDisplay(),activeWindow_,
-                     outer_.x(),outer_.y(),
-                     inner_.width(),inner_.height());
-    KWin::setActiveWindow(activeWindow_);
-}
-
-// slots
-
-void KWinGrid::move_TL()
-{
-    move(0,0);
-}
-
-void KWinGrid::move_TR()
-{
-    move(hsplit_/2,0);
-}
-
-void KWinGrid::move_BL()
-{
-    move(0,vsplit_/2);
-}
-
-void KWinGrid::move_BR()
-{
-    move(hsplit_/2,vsplit_/2);
-}
-
-    
-void KWinGrid::resize_Q()
-{
-    resize(vsplit_/2,hsplit_/2);
-}
-
-void KWinGrid::resize_H()
-{
-    resize(vsplit_,hsplit_/2);
-}
-
-void KWinGrid::resize_V()
-{
-    resize(vsplit_/2,hsplit_);
-}
-
-void KWinGrid::resize_F()
-{
-    resize(vsplit_,hsplit_);
-}
-
-
-void KWinGrid::move_L()
-{
-    moveRelative(-1,0);
-}
-
-void KWinGrid::move_R()
-{
-    moveRelative(1,0);
-}
-
-void KWinGrid::move_U()
-{
-    moveRelative(0,-1);
-}
-
-void KWinGrid::move_D()
-{
-    moveRelative(0,1);
-}
-
-    
-void KWinGrid::resize_IH()
-{
-    resizeRelative(1,0);
-}
-
-void KWinGrid::resize_DH()
-{
-    resizeRelative(-1,0);
-}
-
-void KWinGrid::resize_IV()
-{
-    resizeRelative(0,1);
-}
-
-void KWinGrid::resize_DV()
-{
-    resizeRelative(0,-1);
-}
-
diff --git a/old/kwingrid.h b/old/kwingrid.h
deleted file mode 100644 (file)
index c16646f..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-// -*- c++ -*-
-
-#ifndef __kwingrid_h
-#define __kwingrid_h 1
-
-#include <qobject.h>
-#include <kwinmodule.h>
-#include <kwingrid_iface.h>
-
-class KWinGrid 
-    : public QObject, public virtual KWinGrid_Iface
-{
-    Q_OBJECT
-
-public:
-    KWinGrid(int hgap__, int vgap__, int hsplit__, int vsplit__);
-    
-    virtual void move(int __xslot, int __yslot);
-    virtual void resize(int __xsize, int __ysize);
-    virtual void moveResize(int __xslot, int __yslot, 
-                           int __xsize, int __ysize);
-    virtual void moveRelative(int __xdiff, int __ydiff);
-    virtual void resizeRelative(int __xdiff, int __ydiff);
-    virtual void toDesk(int __desk);
-
-public slots:
-    void move_TL();
-    void move_TR();
-    void move_BL();
-    void move_BR();
-    
-    void resize_Q();
-    void resize_H();
-    void resize_V();
-    void resize_F();
-
-    void move_L();
-    void move_R();
-    void move_U();
-    void move_D();
-    
-    void resize_IH();
-    void resize_DH();
-    void resize_IV();
-    void resize_DV();
-
-private:
-    void initGeometry();
-    void updateGeometry(QRect& __new);
-    void applyGeometry();
-    QRect doMoveResize(int __xslot, int __yslot, 
-                      int __xsize, int __ysize);
-    
-    KWinModule* module_;
-    DCOPClient* client_;
-
-    int activeWindow_;
-    QRect inner_;
-    QRect outer_;
-    QRect region_;
-
-    int hsize_;
-    int vsize_;
-
-    int hgap_;
-    int vgap_;
-    int hsplit_;
-    int vsplit_;
-};
-
-#endif
diff --git a/old/kwingrid_iface.h b/old/kwingrid_iface.h
deleted file mode 100644 (file)
index 06d8808..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef __kwingrid_iface_h
-#define __kwingrid_iface_h
-
-#include <qstring.h>
-#include <dcopobject.h>
-
-class KWinGrid_Iface : virtual public DCOPObject
-{
-    K_DCOP
-public:
-    virtual ~KWinGrid_Iface() {}
-
-k_dcop:
-    virtual void move(int __xslot, int __yslot) = 0;
-    virtual void resize(int __xsize, int __ysize) = 0;
-    virtual void moveResize(int __xslot, int __yslot, 
-                           int __xsize, int __ysize) = 0;
-    virtual void moveRelative(int __xdiff, int __ydiff) = 0;
-    virtual void resizeRelative(int __xdiff, int __ydiff) = 0;
-    virtual void toDesk(int __desk) = 0;
-};
-
-#endif
diff --git a/old/main.cc b/old/main.cc
deleted file mode 100644 (file)
index 6ae6b77..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-#include <stdlib.h>
-#include <kuniqueapplication.h>
-#include <klocale.h>
-#include <kcmdlineargs.h>
-#include <kaboutdata.h>
-#include <kdebug.h>
-#include <kglobalaccel.h>
-#include <qnamespace.h>
-
-#include "kwingrid.h"
-
-static KCmdLineOptions winGridOpts[] =
-{
-    { "+hgap", I18N_NOOP("hgap"), 0 },
-    { "+vgap", I18N_NOOP("vgap"), 0 },
-    { "+hsplit", I18N_NOOP("hsplit"), 0 },
-    { "+vsplit", I18N_NOOP("vsplit"), 0 },
-    { 0,0,0 }
-};
-
-/* Die optimalen werte für hgap und vgap berechnen sich zu:
- *
- * gap = size % split + n * split
- *
- * für n = 0,1,2,... und size die Bildschirmgröße in der jeweiligen Richtung
- */
-
-int main(int argc, char **argv)
-{
-    KAboutData * aboutdata = new KAboutData("kwingrid","KWinGrid","0.5",
-                                           I18N_NOOP("Window Grid"),
-                                           KAboutData::License_GPL,
-                                           "(C) 1999,2000,2002, Stefan Bund",
-                                           "", "http://home.t-online.de/home/Stefan.Bund/");
-    aboutdata->addAuthor("Stefan Bund",I18N_NOOP("Developer"),"asbund@gmx.de",
-                        "http://home.t-online.de/home/Stefan.Bund");
-  
-    KCmdLineArgs::init(argc, argv, aboutdata);
-    KCmdLineArgs::addCmdLineOptions(winGridOpts);
-    KUniqueApplication::addCmdLineOptions();
-
-    if (! KUniqueApplication::start()) {
-       kdError() << "KWinGrid is already running!" << endl;
-       return 0;
-    }
-
-    KApplication * app = new KUniqueApplication;
-    KCmdLineArgs * args = KCmdLineArgs::parsedArgs();
-
-    if (args->count()!=4) {
-       kdError() << "Invalid arguments. Try --help\n";
-       return 0;
-    }
-  
-    int hgap = atoi(args->arg(0));
-    int vgap = atoi(args->arg(1));
-    int hsplit = atoi(args->arg(2));
-    int vsplit = atoi(args->arg(3));
-
-    args->clear();
-
-    KWinGrid * winGrid = new KWinGrid(hgap,vgap,hsplit,vsplit);
-
-    KGlobalAccel * accel = new KGlobalAccel(app);
-
-    accel->insert("move_TL",
-                 I18N_NOOP("Move top-left"),
-                 I18N_NOOP("Move active window top-left"),
-                 Qt::ALT+Qt::SHIFT+Qt::Key_I, KKey::QtWIN+Qt::SHIFT+Qt::Key_I,
-                 winGrid, SLOT ( move_TL() ));
-    accel->insert("move_TR",
-                 I18N_NOOP("Move top-right"),
-                 I18N_NOOP("Move active window top-right"),
-                 Qt::ALT+Qt::SHIFT+Qt::Key_O, KKey::QtWIN+Qt::SHIFT+Qt::Key_O,
-                 winGrid, SLOT ( move_TR() ));
-    accel->insert("move_BL",
-                 I18N_NOOP("Move bottom-left"),
-                 I18N_NOOP("Move active window bottom-left"),
-                 Qt::ALT+Qt::SHIFT+Qt::Key_K, KKey::QtWIN+Qt::SHIFT+Qt::Key_K,
-                 winGrid, SLOT ( move_BL() ));
-    accel->insert("move_BR",
-                 I18N_NOOP("Move bottom-right"),
-                 I18N_NOOP("Move active window bottom-right"),
-                 Qt::ALT+Qt::SHIFT+Qt::Key_L, KKey::QtWIN+Qt::SHIFT+Qt::Key_L,
-                 winGrid, SLOT ( move_BR() ));
-
-    accel->insert("resize_Q",
-                 I18N_NOOP("Resize quarter"), I18N_NOOP("Resize quarter"),
-                 Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_I, KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_I,
-                 winGrid, SLOT ( resize_Q() ));
-    accel->insert("resize_H",
-                 I18N_NOOP("Resize horizontal"), I18N_NOOP("Resize horizontal"),
-                 Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_O, KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_O,
-                 winGrid, SLOT ( resize_H() ));
-    accel->insert("resize_V",
-                 I18N_NOOP("Resize vertical"), I18N_NOOP("Resize vertical"),
-                 Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_K, KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_K,
-                 winGrid, SLOT ( resize_V() ));
-    accel->insert("resize_F",
-                 I18N_NOOP("Resize full"), I18N_NOOP("Resize full"),
-                 Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_L, KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_L,
-                 winGrid, SLOT ( resize_F() ));
-
-    accel->insert("move_L",
-                 I18N_NOOP("Move left"), I18N_NOOP("Move left"),
-                 Qt::ALT+Qt::SHIFT+Qt::Key_Left, KKey::QtWIN+Qt::SHIFT+Qt::Key_Left,
-                 winGrid, SLOT ( move_L() ));
-    accel->insert("move_R",
-                 I18N_NOOP("Move right"), I18N_NOOP("Move right"),
-                 Qt::ALT+Qt::SHIFT+Qt::Key_Right, KKey::QtWIN+Qt::SHIFT+Qt::Key_Right,
-                 winGrid, SLOT ( move_R() ));
-    accel->insert("move_U",
-                 I18N_NOOP("Move up"), I18N_NOOP("Move up"),
-                 Qt::ALT+Qt::SHIFT+Qt::Key_Up, KKey::QtWIN+Qt::SHIFT+Qt::Key_Up,
-                 winGrid, SLOT ( move_U() ));
-    accel->insert("move_D",
-                 I18N_NOOP("Move down"), I18N_NOOP("Move down"),
-                 Qt::ALT+Qt::SHIFT+Qt::Key_Down, KKey::QtWIN+Qt::SHIFT+Qt::Key_Down,
-                 winGrid, SLOT ( move_D() ));
-
-    accel->insert("resize_IH",
-                 I18N_NOOP("Increase horizontal size"), I18N_NOOP("Increase horizontal size"),
-                 Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Right,KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_Right,
-                 winGrid, SLOT ( resize_IH() ));
-    accel->insert("resize_IV",
-                 I18N_NOOP("Increase vertical size"), I18N_NOOP("Increase vertical size"),
-                 Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Down,KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_Down,
-                 winGrid, SLOT ( resize_IV() ));
-    accel->insert("resize_DH",
-                 I18N_NOOP("Decrease horizontal size"), I18N_NOOP("Decrease horizontal size"),
-                 Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Left,KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_Left,
-                 winGrid, SLOT ( resize_DH() ));
-    accel->insert("resize_DV",
-                 I18N_NOOP("Decrease vertical size"), I18N_NOOP("Decrease vertical size"),
-                 Qt::ALT+Qt::CTRL+Qt::SHIFT+Qt::Key_Up,KKey::QtWIN+Qt::CTRL+Qt::SHIFT+Qt::Key_Up,
-                 winGrid, SLOT ( resize_DV() ));
-    
-    
-    accel->updateConnections();
-
-
-    int ret = app->exec();
-
-    delete app;
-    return ret;
-}
-