⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mozilla.bash

📁 gtk_server的源代码
💻 BASH
字号:
#!/bin/bash## Testing GtkMozEmbed - PvE - april 22, 2008 GPL.##------------------------------------------------# Name of PIPE filedeclare PI=/tmp/bash.gtk.$$#---------------------------------------------------------------------# Communication function; assignment function#---------------------------------------------------------------------function gtk() { echo $1 > $PI; read GTK < $PI; }function define() { $2 "$3"; eval $1="$GTK"; }# -------------------------------------------------------------------------------------# IMPORTANT!## The script 'run-mozilla.sh' sets some environment variables before executing the# webbrowser binary. The 'gtkembedmoz' widget must be linked together with the other# Mozilla libs using 'LD_LIBRARY_PATH' in order to be used successfully.# -------------------------------------------------------------------------------------LIB=`locate -n 1 libgtkembedmoz.so`if [[ -z $LIB ]]then    echo "No Mozilla library found!"    exit 1else    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${LIB%/*}fi# Start gtk-server in FIFO modegtk-server -fifo=$PI &while [ ! -p $PI ]; do continue; done# Define GUIgtk "gtk_init NULL NULL"define WINDOW gtk "gtk_window_new 0"gtk "gtk_window_set_title $WINDOW 'My own webbrowser'"gtk "gtk_window_set_position $WINDOW 1"gtk "gtk_widget_set_size_request $WINDOW 700 500"gtk "gtk_window_set_icon_name $WINDOW mozilla"# Set the componentpath of gtkembedmoz alsogtk "gtk_moz_embed_set_comp_path ${LIB%/*}"# Store a temporary profile in /tmp so my profile will be savegtk "gtk_moz_embed_set_profile_path /tmp mozilla"# Create the widgetdefine MOZ gtk "gtk_moz_embed_new"gtk "gtk_container_add $WINDOW $MOZ"# Load some URLgtk "gtk_moz_embed_load_url $MOZ 'http://www.gtk-server.org'"gtk "gtk_widget_show_all $WINDOW"# Load external file example.#gtk "gtk_moz_embed_open_stream $MOZ \"file://\" \"text/html\""#while read LINE#do#    gtk "gtk_moz_embed_append_data $MOZ '$LINE' ${#LINE}"#done < somepage.html# Mainloopwhile [[ $EVENT != $WINDOW ]]do    define EVENT gtk "gtk_server_callback WAIT"done# Exit GTKgtk "gtk_server_exit"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -