__clicked_l7eOfD__(x, y, e)
click to toggle source
名前からはプロフィールに、タイムスタンプからはツイートのパーマリンクにリンクしなければならない
_schemer()
click to toggle source
アイコン上のボタンの数の変更
def _schemer
{x_count: 1, y_count: 1} end
clicked(x, y, e)
click to toggle source
座標 ( x , y ) にクリックイベントを発生させる
def clicked(x, y, e)
signal_emit(:click, e, x, y)
case e.button
when 1
iob_clicked
if not textselector_range
index = main_pos_to_index(x, y)
if index
l = message.links.segment_by_index(index)
l[:callback].call(l) if l and l[:callback] end end
when 3
@tree.get_ancestor(Gtk::Window).set_focus(@tree)
Plugin::GUI::Command.menu_pop
end end
destroy()
click to toggle source
def destroy
def self.tree
raise DestroyedError.new end
def self.to_message
raise DestroyedError.new end
def self.p_message
raise DestroyedError.new end
instance_variables.each{ |v|
instance_variable_set(v, nil) }
@tree = nil
signal_emit('destroy')
super
freeze
end
iob_clicked()
click to toggle source
アイコンをクリックしたら必ずプロフィールを表示しなければならない
def iob_clicked
if(current_icon_pos)
Plugin.call(:show_profile, Service.primary, message.user) end end
iob_etc_clicked()
click to toggle source
iob_fav_clicked()
click to toggle source
def iob_fav_clicked
message.favorite(!message.favorite?)
end
iob_icon_pixbuf()
click to toggle source
def iob_icon_pixbuf
[ ["reply.png", "etc.png"],
["retweet.png",
message.favorite? ? "unfav.png" : "fav.png"] ] end
iob_icon_pixbuf_off()
click to toggle source
def iob_icon_pixbuf_off
[ [(UserConfig[:show_replied_icon] and message.mentioned_by_me? and "reply.png"),
nil],
[message.retweeted? ? "retweet.png" : nil,
message.favorite? ? "unfav.png" : nil]
]
end
iob_reply_clicked()
click to toggle source
def iob_reply_clicked
@tree.imaginary.create_reply_postbox(message) end
main_pos_to_index(x, y)
click to toggle source
つぶやきの左上座標から、クリックされた文字のインデックスを返す
def main_pos_to_index(x, y)
x -= pos.main_text.x
y -= pos.main_text.y
inside, byte, trailing = *main_message.xy_to_index(x * Pango::SCALE, y * Pango::SCALE)
message.to_s.get_index_from_byte(byte) if inside end
main_pos_to_index_forclick(x, y)
click to toggle source
def main_pos_to_index_forclick(x, y)
x -= pos.main_text.x
y -= pos.main_text.y
result = main_message.xy_to_index(x * Pango::SCALE, y * Pango::SCALE)
result[1] = message.to_s.get_index_from_byte(result[1])
return *result end
on_modify(event=true)
click to toggle source
更新イベントを発生させる
def on_modify(event=true)
if not destroyed?
@pixmap = nil
@pixbuf = nil
@coordinate = nil
if(defined? @last_modify_height and @last_modify_height != height)
tree.get_column(0).queue_resize
@last_modify_height = height end
signal_emit('modified') if event
end
end
on_selected()
click to toggle source
def on_selected
if not frozen?
@selected = true
on_modify end end
on_unselected()
click to toggle source
def on_unselected
if not frozen?
@selected = false
on_modify end end
pixbuf()
click to toggle source
TLに表示するための Gdk::Pixbuf のインスタンスを返す
def pixbuf
@pixbuf ||= gen_pixbuf
end
pixmap()
click to toggle source
TLに表示するための Gdk::Pixmap のインスタンスを返す
def pixmap
@pixmap ||= gen_pixmap
end
point_leaved(x, y)
click to toggle source
leaveイベントを発生させる
def point_leaved(x, y)
iob_main_leave
signal_emit(:leave_notify_event)
end
point_moved(x, y)
click to toggle source
座標 ( x , y ) にマウスオーバーイベントを発生させる
def point_moved(x, y)
point_moved_main_icon(x, y)
signal_emit(:motion_notify_event, x, y)
textselector_select(*main_pos_to_index_forclick(x, y)[1..2]) end
pressed(x, y)
click to toggle source
MiraclePainterの座標x, y上でポインティングデバイスのボタン1が押されたことを通知する
def pressed(x, y)
textselector_press(*main_pos_to_index_forclick(x, y)[1..2])
end
released(x=nil, y=nil)
click to toggle source
MiraclePainterの座標x, y上でポインティングデバイスのボタン1が離されたことを通知する
def released(x=nil, y=nil)
if(x == y and not x)
unselect
else
textselector_release(*main_pos_to_index_forclick(x, y)[1..2]) end end
set_tree(new)
click to toggle source
Gtk::TimeLine::InnerTLのインスタンスを設定する。今後、このインスタンスは new に所属するものとして振舞う
def set_tree(new)
type_strict new => Gtk::TimeLine::InnerTL
@tree = new
self end
signal_do_click(event, cell_x, cell_y)
click to toggle source
def signal_do_click(event, cell_x, cell_y)
end
signal_do_expose_event()
click to toggle source
def signal_do_expose_event()
end
signal_do_leave_notify_event()
click to toggle source
def signal_do_leave_notify_event()
end
signal_do_modified()
click to toggle source
def signal_do_modified()
end
signal_do_motion_notify_event(cell_x, cell_y)
click to toggle source
def signal_do_motion_notify_event(cell_x, cell_y)
end
unselect()
click to toggle source
MiraclePainterが選択解除されたことを通知する
def unselect
textselector_unselect end
visible?()
click to toggle source
画面上にこれが表示されているかを返す
def visible?
if tree
start, last = tree.visible_range
if start
range = tree.selected_range_bytime
if(tree.vadjustment.value == 0)
range.first <= message.modified.to_i
else
range.include?(message.modified.to_i) end end
else
true end end