libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] libcvd cvd/glwindow.h cvd_src/glwindow.cc


From: Gerhard Reitmayr
Subject: [libcvd-members] libcvd cvd/glwindow.h cvd_src/glwindow.cc
Date: Mon, 16 Jul 2007 21:56:25 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Gerhard Reitmayr <gerhard>      07/07/16 21:56:25

Modified files:
        cvd            : glwindow.h 
        cvd_src        : glwindow.cc 

Log message:
        position and resize glwindow

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/glwindow.h?cvsroot=libcvd&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/glwindow.cc?cvsroot=libcvd&r1=1.6&r2=1.7

Patches:
Index: cvd/glwindow.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/glwindow.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- cvd/glwindow.h      8 Jun 2007 00:26:08 -0000       1.5
+++ cvd/glwindow.h      16 Jul 2007 21:56:25 -0000      1.6
@@ -72,6 +72,7 @@
 
        /// A summary of multiple events
        struct EventSummary {
+           EventSummary() : cursor(-1,-1) {}
            /// key->frequency mapping for key presses and releases
            std::map<int,int> key_down, key_up;
            typedef std::map<int,int>::const_iterator key_iterator;
@@ -100,6 +101,12 @@
        ~GLWindow();
        /// Get the size
        ImageRef size() const;
+       /// Set the size
+       void size(const ImageRef &);
+       /// Get the position
+       ImageRef position() const;
+       /// Set the position
+       void position(const ImageRef &);
        /// Set the mouse cursor position
        void set_cursor_position(const ImageRef& where);
        /// Get the mouse cursor position

Index: cvd_src/glwindow.cc
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd_src/glwindow.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- cvd_src/glwindow.cc 8 Jun 2007 22:34:28 -0000       1.6
+++ cvd_src/glwindow.cc 16 Jul 2007 21:56:25 -0000      1.7
@@ -19,6 +19,7 @@
     
 struct GLWindow::State {
     ImageRef size;
+    ImageRef position;
     std::string title;
     Display* display;
     Window window;
@@ -126,6 +127,18 @@
 
 ImageRef CVD::GLWindow::size() const { return state->size; }
 
+void CVD::GLWindow::size(const ImageRef & s_){
+    state->size = s_;
+    XResizeWindow(state->display, state->window, s_.x, s_.y);
+}
+
+ImageRef CVD::GLWindow::position() const { return state->position; }
+
+void CVD::GLWindow::position(const ImageRef & p_){
+    state->position = p_;
+    XMoveWindow(state->display, state->window, p_.x, p_.y);
+}
+
 void CVD::GLWindow::set_cursor_position(const ImageRef& where)
 {
     XWarpPointer(state->display, None, state->window, 0, 0, 0, 0, where.x, 
where.y);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]