File: save_size.C

package info (click to toggle)
peruser 4b33-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,952 kB
  • ctags: 1,064
  • sloc: cpp: 22,367; perl: 2,733; makefile: 345; sh: 335
file content (24 lines) | stat: -rw-r--r-- 521 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <signal.h>
#include "npcompose.h"

void NP_Compose::save_size()
{
   char buffer[ 1024 ];
   snprintf( buffer, sizeof buffer, "%s/.npcompose:size", home );

   FILE *file;
   if (( file = fopen( buffer, "w" )) == NULL )
   {
      perror( "fopen" );
      exit( 1 );
   }

   int width, height, x, y;
   gdk_window_get_size( window->window, &width, &height );
   gdk_window_get_root_origin( window->window, &x, &y );

   fprintf( file, "%d\n%d\n%d\n%d\n", width, height, x, y );
   fclose( file );

   return;
}