- Merge in changes for macosx with native gtk+

This commit is contained in:
Stefan Gehn 2008-02-10 13:30:48 +00:00
parent 0db0b41476
commit b5ad32c190
4 changed files with 211 additions and 3 deletions

View File

@ -161,7 +161,7 @@ install_gkrellm.pc:
$(INSTALL) -d $(PKGCONFIGDIR)
$(INSTALL) -m $(INCLUDEMODE) -c gkrellm.pc $(PKGCONFIGDIR)
install_darwin: install_gkrellm.pc
install_darwin install_macosx: install_gkrellm.pc
(cd po && ${MAKE} install)
(cd src && ${MAKE} install STRIP="")
(cd server && ${MAKE} install STRIP="")
@ -227,6 +227,11 @@ darwin: gkrellm.pc
LINK_FLAGS="-prebind -Wl,-bind_at_load -framework CoreFoundation" \
gkrellmd )
macosx: gkrellm.pc
(cd po && ${MAKE} all)
(cd src && ${MAKE} macosx)
(cd server && ${MAKE} macosx)
netbsd1: gkrellm.pc
(cd po && ${MAKE} all)
(cd src && ${MAKE} \

View File

@ -131,6 +131,12 @@ darwin:
EXTRAOBJS= SYS_LIBS="-lkvm -lmd5" \
LINK_FLAGS="-flat_namespace -undefined warning" gkrellmd
macosx:
$(MAKE) STRIP= HAVE_GETADDRINFO=1 \
EXTRAOBJS= SYS_LIBS="-lkvm" \
LINK_FLAGS="-flat_namespace -undefined warning" \
gkrellmd
netbsd1:
$(MAKE) EXTRAOBJS= SYS_LIBS="-lkvm" gkrellmd
@ -177,7 +183,7 @@ uninstall:
rm -f $(SINSTALLDIR)/$(PACKAGE_D)
rm -f $(SMANDIR)/$(PACKAGE_D).1
install_darwin:
install_darwin install_macosx:
$(MAKE) install STRIP=
install_freebsd:

View File

@ -142,6 +142,15 @@ else
gkrellm
endif
macosx:
$(MAKE) STRIP= HAVE_GETADDRINFO=1 \
EXTRAOBJS="winops-gtk-mac.o sysdeps-unix.o" \
LINK_FLAGS="-Wl,-bind_at_load -framework CoreFoundation" \
SYS_LIBS="-lkvm -framework IOKit" \
SMC_LIBS="" \
UNIXOBJS="" \
gkrellm
netbsd1:
$(MAKE) EXTRAOBJS= SYS_LIBS="-lkvm" \
SMC_LIBS="-L/usr/X11R6/lib -lSM -lICE -Wl,-R/usr/X11R6/lib" \
@ -188,7 +197,7 @@ uninstall:
$(RM) $(MANDIR)/$(PACKAGE).1
$(RM) $(LIBDIR)/libgkrellm.a
install_darwin:
install_darwin install_macosx:
$(MAKE) install STRIP=
install_freebsd:
@ -310,6 +319,7 @@ client.o: client.c $(GKRELLM_H)
utils.o: utils.c $(GKRELLM_H)
sysdeps-unix.o: sysdeps-unix.c $(GKRELLM_H_SYS) $(SYSDEPS_SRC)
winops-x11.o: winops-x11.c $(GKRELLM_H)
winops-gtk-mac.o: winops-gtk-mac.c $(GKRELLM_H)
deprecated.o: deprecated.c $(GKRELLM_H)
sysdeps/win32.o: sysdeps/win32.c $(GKRELLM_H_SYS)
winops-win32.o: winops-win32.c $(GKRELLM_H)

187
src/winops-gtk-mac.c Normal file
View File

@ -0,0 +1,187 @@
/* GKrellM
| Copyright (C) 1999-2007 Bill Wilson
|
| Author: Bill Wilson billw@gkrellm.net
| Latest versions might be found at: http://gkrellm.net
|
|
| GKrellM 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 3 of the License, or
| (at your option) any later version.
|
| GKrellM 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, see http://www.gnu.org/licenses/
*/
#include "gkrellm.h"
#include "gkrellm-private.h"
#include <errno.h>
#if !defined(F_TLOCK)
#include <sys/file.h>
#endif
#include <pwd.h>
#include <sys/types.h>
static FILE *f_lock;
static gboolean
_gkrellm_get_lock(void)
{
gchar *lock_dir, *lock_file; //, *display, *s;
gchar buf[32];
snprintf(buf, sizeof(buf), "LCK..%d", (gint) getuid());
#if defined(F_TLOCK)
lock_dir = "/var/lock/gkrellm";
if (!g_file_test(lock_dir, G_FILE_TEST_IS_DIR))
mkdir(lock_dir, 0755);
lock_file = gkrellm_make_config_file_name(lock_dir, buf);
/*display = XDisplayName(NULL);
if (display)
{
s = g_strconcat(lock_file, "_", display, NULL);
g_free(lock_file);
lock_file = s;
}*/
f_lock = fopen(lock_file, "w+"); /* buffering does not apply here */
g_free(lock_file);
if ( f_lock
&& lockf(fileno(f_lock), F_TLOCK, 0) != 0
&& errno == EAGAIN
)
return FALSE;
if (f_lock)
{
fprintf(f_lock, "%10d\n", (gint) getpid());
fflush(f_lock);
}
#endif
return TRUE;
}
void
gkrellm_winop_reset(void)
{
}
void
gkrellm_winop_state_skip_taskbar(gboolean state)
{
gdk_window_set_skip_taskbar_hint(gkrellm_get_top_window()->window, state);
}
void
gkrellm_winop_state_skip_pager(gboolean state)
{
gdk_window_set_skip_pager_hint(gkrellm_get_top_window()->window, state);
}
void
gkrellm_winop_state_above(gboolean state)
{
gdk_window_set_keep_above(gkrellm_get_top_window()->window, state);
}
void
gkrellm_winop_state_below(gboolean state)
{
gdk_window_set_keep_below(gkrellm_get_top_window()->window, state);
}
void
gkrellm_winop_update_struts(void)
{
}
void
gkrellm_winop_options(gint argc, gchar **argv)
{
gint n = 0;
if ( !_GK.allow_multiple_instances_real
&& !_GK.force_host_config
&& !_gkrellm_get_lock()
)
{
printf("gkrellm: %s\n",
_("Exiting because multiple instances option is off.\n"));
exit(0);
}
}
void
gkrellm_winop_withdrawn(void)
{
}
/* Use XParseGeometry, but width and height are ignored.
| If GKrellM is moved, update _GK.y_position.
*/
void
gkrellm_winop_place_gkrellm(gchar *geom)
{
/*gint place, x, y, w_gkrell, h_gkrell;
x = y = 0;
place = XParseGeometry(geom, &x, &y,
(guint *) &w_gkrell, (guint *) &h_gkrell);
w_gkrell = _GK.chart_width + _GK.frame_left_width + _GK.frame_right_width;
h_gkrell = _GK.monitor_height + _GK.total_frame_height;
if (place & YNegative)
y = _GK.h_display - h_gkrell + y;
if (place & XNegative)
x = _GK.w_display - w_gkrell + x;
gdk_window_move(gkrellm_get_top_window()->window, x, y);
_GK.y_position = y;
_GK.x_position = x;
_GK.position_valid = TRUE;
if (_GK.debug_level & DEBUG_POSITION)
printf("geometry moveto %d %d\n", x, y);
*/
}
void
gkrellm_winop_flush_motion_events(void)
{
}
/* Check if background has changed
*/
gboolean
gkrellm_winop_updated_background(void)
{
return TRUE;
}
gboolean
gkrellm_winop_draw_rootpixmap_onto_transparent_chart(GkrellmChart *cp)
{
return FALSE;
}
gboolean
gkrellm_winop_draw_rootpixmap_onto_transparent_panel(GkrellmPanel *p)
{
return FALSE;
}
void
gkrellm_winop_apply_rootpixmap_transparency(void)
{
}