Remove global variables from header files

git-svn-id: http://tint2.googlecode.com/svn/trunk@671 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
o9000 2015-01-28 15:13:56 +00:00 committed by mrovi9000@gmail.com
parent 1a3ba21245
commit d584d04691
7 changed files with 21 additions and 21 deletions

View file

@ -128,7 +128,7 @@ target_link_libraries( tint2 m )
add_dependencies( tint2 version ) add_dependencies( tint2 version )
set_target_properties( tint2 PROPERTIES COMPILE_FLAGS "-Wall -pthread" ) set_target_properties( tint2 PROPERTIES COMPILE_FLAGS "-Wall -pthread" )
set_target_properties(tint2 PROPERTIES LINK_FLAGS "-pthread" ) set_target_properties( tint2 PROPERTIES LINK_FLAGS "-pthread" )
install( TARGETS tint2 DESTINATION bin ) install( TARGETS tint2 DESTINATION bin )
install( FILES sample/tint2rc DESTINATION ${SYSCONFDIR}/xdg/tint2 ) install( FILES sample/tint2rc DESTINATION ${SYSCONFDIR}/xdg/tint2 )

View file

@ -35,6 +35,10 @@
#include <pango/pangoxft.h> #include <pango/pangoxft.h>
#include <Imlib2.h> #include <Imlib2.h>
#include "config.h"
#ifndef TINT2CONF
#include "common.h" #include "common.h"
#include "server.h" #include "server.h"
#include "panel.h" #include "panel.h"
@ -44,7 +48,6 @@
#include "systraybar.h" #include "systraybar.h"
#include "launcher.h" #include "launcher.h"
#include "clock.h" #include "clock.h"
#include "config.h"
#include "window.h" #include "window.h"
#include "tooltip.h" #include "tooltip.h"
#include "timer.h" #include "timer.h"
@ -53,10 +56,14 @@
#include "battery.h" #include "battery.h"
#endif #endif
#endif
// global path // global path
char *config_path; char *config_path;
char *snapshot_path; char *snapshot_path;
#ifndef TINT2CONF
// -------------------------------------------------- // --------------------------------------------------
// backward compatibility // backward compatibility
// detect if it's an old config file (==1) // detect if it's an old config file (==1)
@ -780,5 +787,5 @@ int config_read_file (const char *path)
return 1; return 1;
} }
#endif

View file

@ -28,9 +28,10 @@
#include "server.h" #include "server.h"
#include "config.h" #include "config.h"
#include "task.h"
#include "window.h" #include "window.h"
Server_global server;
void server_catch_error (Display *d, XErrorEvent *ev){} void server_catch_error (Display *d, XErrorEvent *ev){}
void server_init_atoms () void server_init_atoms ()
@ -350,6 +351,10 @@ next:
} }
} }
int server_get_number_of_desktop ()
{
return get_property32(server.root_win, server.atom._NET_NUMBER_OF_DESKTOPS, XA_CARDINAL);
}
void get_desktops() void get_desktops()
{ {

View file

@ -130,7 +130,7 @@ typedef struct
} Server_global; } Server_global;
Server_global server; extern Server_global server;
// freed memory // freed memory

View file

@ -128,19 +128,14 @@ void init (int argc, char *argv[])
#ifdef HAVE_SN #ifdef HAVE_SN
static int error_trap_depth = 0; static int error_trap_depth = 0;
static void static void error_trap_push(SnDisplay *display, Display *xdisplay)
error_trap_push (SnDisplay *display,
Display *xdisplay)
{ {
++error_trap_depth; ++error_trap_depth;
} }
static void static void error_trap_pop(SnDisplay *display, Display *xdisplay)
error_trap_pop (SnDisplay *display,
Display *xdisplay)
{ {
if (error_trap_depth == 0) if (error_trap_depth == 0) {
{
fprintf(stderr, "Error trap underflow!\n"); fprintf(stderr, "Error trap underflow!\n");
return; return;
} }
@ -157,8 +152,7 @@ static void sigchld_handler(int sig) {
ctx = (SnLauncherContext *) g_tree_lookup (server.pids, GINT_TO_POINTER (pid)); ctx = (SnLauncherContext *) g_tree_lookup (server.pids, GINT_TO_POINTER (pid));
if (ctx == NULL) { if (ctx == NULL) {
fprintf(stderr, "Unknown child %d terminated!\n", pid); fprintf(stderr, "Unknown child %d terminated!\n", pid);
} } else {
else {
g_tree_remove (server.pids, GINT_TO_POINTER (pid)); g_tree_remove (server.pids, GINT_TO_POINTER (pid));
sn_launcher_context_complete (ctx); sn_launcher_context_complete (ctx);
sn_launcher_context_unref (ctx); sn_launcher_context_unref (ctx);

View file

@ -197,11 +197,6 @@ int window_is_skip_taskbar (Window win)
} }
int server_get_number_of_desktop ()
{
return get_property32(server.root_win, server.atom._NET_NUMBER_OF_DESKTOPS, XA_CARDINAL);
}
GSList *server_get_name_of_desktop () GSList *server_get_name_of_desktop ()
{ {

View file

@ -17,7 +17,6 @@ void set_active (Window win);
void set_desktop (int desktop); void set_desktop (int desktop);
void set_close (Window win); void set_close (Window win);
int server_get_current_desktop (); int server_get_current_desktop ();
int server_get_number_of_desktop ();
GSList *server_get_name_of_desktop (); GSList *server_get_name_of_desktop ();
int window_is_iconified (Window win); int window_is_iconified (Window win);
int window_is_urgent (Window win); int window_is_urgent (Window win);